<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Ben Powell</title><link>http://blog.benpowell.co.uk/</link><description>my life, opinions and innocuous ramblings</description><language>en</language><managingEditor>noreply@blogger.com (Ben)</managingEditor><lastBuildDate>Thu, 25 Jun 2009 12:08:23 PDT</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">148</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/benpowell" type="application/rss+xml" /><item><title>EU has its knickers in a twist over Microsoft Windows 7</title><link>http://feedproxy.google.com/~r/benpowell/~3/VWV4fyqSrYY/eu-has-its-knickers-in-twist-over.html</link><category>technology</category><category>EU</category><category>Microsoft</category><category>politics</category><category>business</category><author>noreply@blogger.com (Ben)</author><pubDate>Thu, 25 Jun 2009 12:08:23 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-8380601602861864911</guid><description>&lt;div&gt;Microsoft has decided that the &lt;a href="http://www.guardian.co.uk/technology/blog/2009/jun/25/windows7-uk-prices"&gt;forthcoming release of Windows 7&lt;/a&gt; will exclude Internet Explorer 8 in the EU, to avoid any further anti-trust fines from the European Commission. Now the&lt;a href="http://www.nytimes.com/2009/06/13/technology/companies/13euro.html?_r=1&amp;amp;ref=world"&gt; EU have their knickers in a twist&lt;/a&gt; because they told Microsoft to stop including Internet Explorer in Windows, but actually that wasn't what they actually wanted. They really wanted Microsoft to offer alternative browsers to customers when the customer installs Windows 7 for the first time. Therein lies a rather short sightedness from the EU, that has genuinely left them looking rather stupid.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Microsoft is unable to pre-install other companies software into the operating system. If they did, that too would be an anti-trust case waiting to happen. Who gets included, who doesn't? Furthermore, can you imagine the licensing implications, the tie in for language support. The list goes on. It is simply never going to happen, and nor should it. PC manufacturers have the responsibility to offer the alternative, not Microsoft.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now the EU is left with egg on its face (yet again), and Microsoft will be giggling like a bunch of school boys. The EU got what it asked for. Case closed. No company should be forced to promote a competitors’ product. Now, how about we take a look at Apple and Safari, oh wise ones in Brussels?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-8380601602861864911?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-25T12:08:23.897-07:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/06/eu-has-its-knickers-in-twist-over.html</feedburner:origLink></item><item><title>Taking a bite out of Apple</title><link>http://feedproxy.google.com/~r/benpowell/~3/JddE_jH5CLk/taking-bite-out-of-apple.html</link><category>technology</category><category>O2</category><category>music</category><category>Apple</category><category>itunes</category><author>noreply@blogger.com (Ben)</author><pubDate>Wed, 10 Jun 2009 22:57:25 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-3415706968309250044</guid><description>Apple are in the news again today. The first story that caught my eye was that &lt;a href="http://www.timesonline.co.uk/tol/travel/business/article6461347.ece"&gt;O2 is to charge an extra monthly fee for iPhone tethering&lt;/a&gt;. It plans to charge a whopping £15 per month when the new iPhone 3G S models come out, and the base contract cost will also increase for the new model. At first one has a tendency to blame O2, but if you really think about it, the bad guy here is Apple. Apple has mastered a very non-consumer-friendly "exclusivity deal" with O2, and O2 had to bid a lot of money to get the deal. This cost is being passed on to O2 customers.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I actually think that what Apple has done with O2 should be made illegal across the EU and that they should be fined. The French competition agency ruled the &lt;a href="http://www.engadget.com/2008/12/17/oranges-iphone-exclusive-ruled-illegal-in-france/"&gt;Orange-Apple exclusive deal anti-competitive and illegal&lt;/a&gt; back in 2008, and &lt;a href="http://business.timesonline.co.uk/tol/business/industry_sectors/telecoms/article2917665.ece"&gt;the Germans made a similar decision in 2007&lt;/a&gt;. The EU needs to stamp out this practice, and soon.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The second piece of news that I noticed this morning, was a story about &lt;a href="http://www.timesonline.co.uk/tol/news/uk/crime/article6471432.ece"&gt;a criminal gang that published their own songs, but then bought them via iTunes (and Amazon) with stolen credit cards&lt;/a&gt;. Notably, the gang made $300,000 from the royalties on $750,000 of sales.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you do the math, that's a 40%  return for the gang. The real crime is that Amazon and Apple earn the other 60%. &lt;a href="http://www.wired.com/listening_post/2008/03/apple-apparentl/"&gt;Previous estimates have suggested that Apple's iTunes profit margin is around 30%&lt;/a&gt;. Have I missed something here, or are these two figures vastly different?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So in summary, the British authorities do not see a problem with Apple and a mobile operator openly colluding to restrict competition and fix prices and Apple are taking a rather nice cut on iTunes sales, passing 40% to the producers.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-3415706968309250044?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-10T22:57:25.333-07:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/06/taking-bite-out-of-apple.html</feedburner:origLink></item><item><title>Dirty workaround for iPhone RDP and Cisco VPN problems</title><link>http://feedproxy.google.com/~r/benpowell/~3/uIkCImv05-8/dirty-workaround-for-iphone-rdp-and.html</link><category>VPN</category><category>IPSEC</category><category>technology</category><category>RDP</category><category>Cisco</category><author>noreply@blogger.com (Ben)</author><pubDate>Mon, 08 Jun 2009 17:30:22 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-8119070093054396960</guid><description>&lt;div&gt;I've been trying to setup my iPhone VPN using the built-in iPhone Cisco VPN IPSEC client. The main reason being is that there is now an Remote Desktop (RDP) client available in the Apple App Store (&lt;a href="http://mochasoft.dk/iphone_rdp.htm"&gt;RDP Lite&lt;/a&gt;) for free and I have servers which require a Cisco VPN client.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, the iPhone only seems to support &lt;a href="http://manuals.info.apple.com/en_US/Enterprise_Deployment_Guide.pdf"&gt;certain&lt;/a&gt; &lt;a href="http://www.cisco.com/en/US/docs/security/vpn_client/cisco_vpn_client/iPhone/2.0/connectivity/guide/iphone.html#wp39406"&gt;Cisco VPN configs&lt;/a&gt;. I have a wide range of VPNs I can test with and &lt;a href="http://discussions.apple.com/thread.jspa?messageID=8308641"&gt;none of them would work&lt;/a&gt;. The suggested Apple/Cisco solution is to configure the Cisco hardware to work with the iPhone, but in my book that's just like drilling out the square hole to fit the round peg.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, I thought of a way around this, which is a dirty, nasty and XXX rated. :-) &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can&lt;a href="http://mochasoft.dk/iphone_rdp_xp.htm"&gt; RDP from the iPhone to your PC&lt;/a&gt; if you are on the same LAN. Then, via that RDP session, you can then use your PC's Cisco VPN client to connect to the required remote network and then RDP to the remote server from your PC instead. Whhheeewww....&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you want to connect to your PC from outside your home network then you can &lt;a href="http://www.onecomputerguy.com/networking/xp_vpn_server.htm"&gt;setup your Windows XP box to accept incoming PPTP VPN connections&lt;/a&gt; (which the iPhone seems to connect to quite happily) and &lt;a href="http://www.portforward.com/"&gt;configure your router to forward the connection&lt;/a&gt; through.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's not pretty, and probably slow, but theoretically it should work...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-8119070093054396960?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-08T17:30:22.525-07:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/06/dirty-workaround-for-iphone-rdp-and.html</feedburner:origLink></item><item><title>Parliament Hotel - Better than expensing a second home?</title><link>http://feedproxy.google.com/~r/benpowell/~3/lOZUIykMPLU/parliament-hotel-better-than-expensing.html</link><category>scandal</category><category>hotel</category><category>UK</category><category>expenses</category><category>solution</category><category>government</category><author>noreply@blogger.com (Ben)</author><pubDate>Fri, 08 May 2009 05:15:41 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4886267074484841013</guid><description>With all the fuss going on at the moment over minister's expense claims in the UK, I thought that a much better solution. I think that the state should buy a hotel in Westminster and ministers would stay there whilst conducting their parliamentary business in London.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The underlying problem here is that the vast majority of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MPs&lt;/span&gt; represent constituencies that are geographically distant from London, and as a result that are required to spend a great deal of time in London to conduct the day-to-day business of being an MP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The second home allows minister the flexibility of somewhere to stay, rather than paying for a hotel, whilst in London. However, this system has been systematically abused.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the state was to buy a hotel, many of the basic expenses that are currently individually claimed for by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;MPs&lt;/span&gt; for their second homes (heating, electricity, telephone, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;internet&lt;/span&gt;, cleaning) would all be provided by Parliament hotel on a fixed basis that the tax payer pays for, but with the knowledge that these expenses are fixed. Gone are the expenses for a new boiler, or £600 hanging baskets.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It would basically be a big halls of residence, and for other civil servants, such as the police, ambulance and fire fighters of London, this is a quite common scenario.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What do you think? Good idea or stupid idea?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4886267074484841013?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-08T05:15:41.126-07:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/05/parliament-hotel-better-than-expensing.html</feedburner:origLink></item><item><title>How to bring down the system in 10 easy steps</title><link>http://feedproxy.google.com/~r/benpowell/~3/NxL8SDwNgIs/how-to-bring-down-system-in-10-easy.html</link><category>credit</category><category>crisis</category><category>change</category><category>government</category><category>establishment</category><category>economy</category><author>noreply@blogger.com (Ben)</author><pubDate>Tue, 07 Apr 2009 02:03:02 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5535106776405750349</guid><description>&lt;div&gt;&lt;ol&gt;&lt;li&gt;Wait for the government bailouts to invoke &lt;a href="http://www.telegraph.co.uk/finance/personalfinance/investing/3189539/Bank-bail-out-Inflation-and-stupidity-are-here-to-stay.html"&gt;inflationary consequences&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for &lt;a href="http://www.telegraph.co.uk/finance/financetopics/financialcrisis/3166706/Financial-crisis-Rising-unemployment-on-the-way-as-recession-looms.html"&gt;unemployment to rise sharply&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for the &lt;a href="http://business.timesonline.co.uk/tol/business/industry_sectors/construction_and_property/article3406268.ece"&gt;housing market to completely collapse&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for the &lt;a href="http://www.telegraph.co.uk/finance/personalfinance/borrowing/mortgages/5018160/2m-homeowners-to-fall-into-negative-equity-FSA-warns.html"&gt;home owners to be stuck in negative equitity&lt;/a&gt; and &lt;a href="http://www.telegraph.co.uk/finance/personalfinance/borrowing/mortgages/4734269/Repossessions-set-to-soar-during-2009.html"&gt;lose their homes&lt;/a&gt; when they lose their jobs&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for the &lt;a href="http://news.bbc.co.uk/1/hi/uk/7975597.stm"&gt;protests and demonstrations by the hippies and anarchists&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for the &lt;a href="http://www.guardian.co.uk/world/2009/apr/06/g20-protest-police-assault"&gt;police brutalitity&lt;/a&gt; to get so bad that the media actually reports it&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for the media to have their &lt;a href="http://www.bjp-online.com/public/showPage.html?page=836646"&gt;key rights&lt;/a&gt; (as the &lt;a href="http://en.wikipedia.org/wiki/Fourth_Estate"&gt;fourth estate&lt;/a&gt;) to be removed by the establishment&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for the establishment to revoke your &lt;a href="http://www.amnesty-eu.org/static/html/pressrelease.asp?cfid=12&amp;amp;id=257&amp;amp;cat=4&amp;amp;l=1"&gt;human rights&lt;/a&gt;, apply marshal law and implement a policed state&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wait for the protests, widespread strikes and demonstrations by the general public including the middle classes&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Act and collectively stop paying all debts.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;The past 9 months have demonstrated that the system is fallable. The interconnected governments, economies and social constructs are dependent on the free flow of credit. This is why we have seen the billions of dollars pumped into the financial system, even though in the long term the result will be massive inflation and an unimaginable burden of debt that will be passed on to the next generations.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The system is like a river. Every couple of years the public get a chance to slightly alter the course of the river in "democratic" elections, aimed to give us the feeling of choice and a voice. The end result, whoever we choose, is that the water in the river ends up in the sea. Action number 10, cuts off the water, and without water, the river runs dry.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bringing down the system is risky. The result is most likely to be massive upheaval. Your comfortable lives will melt away, replaced with short to medium term pain; no jobs, starvation, violence and aggression. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, in the long term, people will adapt, and a new system will takes the place of the old. Perhaps better, perhaps the same, perhaps worse, but like a phoenix, it will be stronger and less infallable than the one before.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What might scare you more is that the first 9 steps are passive, and many of them are, or have already occurred. It is only the very last step, that requires your collective and active participation to complete the process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I think I have outlined how the system has its very own built in self destruct button. But are you prepared to press it? I'm not sure I would.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5535106776405750349?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-07T02:03:02.702-07:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/04/how-to-bring-down-system-in-10-easy.html</feedburner:origLink></item><item><title>Implementing RPX without ASP.NET Membership</title><link>http://feedproxy.google.com/~r/benpowell/~3/KtD9STyxC9s/implementing-rpx-without-aspnet.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 01 Mar 2009 01:09:10 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-3579043136704403240</guid><description>&lt;div&gt;I've almost completed my test of RPX with ASP.NET webforms. My first pass attempted to mix the ASP.NET Membership with RPX, and although I got it working, it felt like a fudge. I wrote a custom Membership Provider, and pushed the RPX identities through it, but somehow it just felt dirty. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In fact I've never liked the ASP.NET Membership model, and it has always bugged me. It forces you into a model of username over email address (where email addresses are always more memorable and unique)  and never seems to deliver a profesional finish. Now OpenID is here to stay, making registration and login so simple, the Membership model feels slightly wonky. It still has its place, especially in intranet applications with Windows / LDAP, but as an internet model it just sucks. Look at any of the big popular websites out there, and then imagine the CreateUserWizard. I know it can be customized, but hell, they could have made it just a little bit more snazzy.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Membership rant aside and to cut a long story short, I dropped the custom Membership Provider. I cut everything down to the bare minimum, and aimed to produce a skeleton website, that uses RPX as an authentication mechanism, and would be my base framework for any new sites I build.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I used two tables, the first stores our base Account information, and it's dead simple, containing only an AccountId and a Nickname. The second table is AccountIdentity and stores identities for each Account, and one Account can be associated to multiple identities. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Why multiple identities? Well, users often have more than one OpenID provider. They might have a Google Account and YahooID, they might also have a Myspace or a Facebook account. Any of these can be used as an OpenID, and the user might want to tie these all together into one Account with us, or not - the choice is theirs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Our AccountIdentity table stores all of the common information provided by the RXPAuthenticationDetails, delivered after a callback to the RPX Service. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In more detail - when a user clicks on the sign-in button, provided by the easy to use login controls RPX Now gives you to get started, you give RPX a Url on your website, to which the user will be redirected to after they have authorised your website with their OpenID provider. In this authentication stage you'll do a couple of things:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Check if the user is already logged in. If so, we are going to check the existing AccountIdentity table to see if this RPX Identity already exists for this user, and if not, we'll add it.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If the user is not logged in, we check the RXPAuthenticationDetails to see if a "LocalKey" was provided. If so, we've already mapped this RPX Identity to an existing user account. We need to load the appropriate account, check the identity does indeed match, and then log the user in.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Finally, if the user is not logged in, and no LocalKey was provided then this user is probably new. We should still check the existing AccountIdentity table to make sure the identity doesn't exist, and then we'll create a brand new account, and store the new associated identity.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;Then we use the Account.AccountId as the Forms Authentication ticket, and sign the user in. That's it, nothing more complicated.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, what about Roles, and Profiles you ask? Well that's to come...&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-3579043136704403240?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-01T01:09:10.724-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/03/implementing-rpx-without-aspnet.html</feedburner:origLink></item><item><title>Why the Pirate Bay should win</title><link>http://feedproxy.google.com/~r/benpowell/~3/LpITh3RO4PY/why-pirate-bay-should-win.html</link><category>technology</category><category>music</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 01 Mar 2009 00:18:45 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-946469580546870735</guid><description>&lt;div&gt;I don't buy music anymore, yet I don't download either. I'm living in a historic music bubble, deliberately uninterested in any new music, yet enjoying what I already own.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The simple reason why I no longer buy music is that I refuse to support an industry that I feel is deliberately and persistently abusing its customer base.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Every forward thinking company that tries to do something interesting with music and technology is given the middle finger by the music cartel.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I feel sorry for the artists, but they choose to sign up with a bunch of greedy, immoral robbing bastards.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I really hope the Pirate Bay wins, not because they are right, but what they stand for. If they lose, consumers should vote with their cash, and boycott all music until the cartel crumbles.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We all know that people are downloading copyrighted content via their torrent tracker, but we should put Google in the dock too, because you can find torrents through their search engine as well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If Google had balls, they would say as much. I would love to see a statement of Google stating that fact. They would certainly win a lot of hearts and minds by doing so.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;"Do no evil", also implies "do some good" too.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-946469580546870735?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-01T00:18:45.256-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/03/why-pirate-bay-should-win.html</feedburner:origLink></item><item><title>RPX OpenID with ASP.NET Webforms and Membership Providers</title><link>http://feedproxy.google.com/~r/benpowell/~3/AuwKTW1ULkw/rpx-openid-with-aspnet-webforms-and.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Tue, 10 Feb 2009 13:46:19 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-3081486070989705499</guid><description>&lt;div&gt;This evening I started playing around with &lt;a href="https://rpxnow.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;RPX&lt;/span&gt;&lt;/a&gt;, the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;OpenID&lt;/span&gt; consolidator from &lt;a href="http://www.janrain.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;JanRain&lt;/span&gt;&lt;/a&gt;. I hit a few hurdles along the way, and I thought I would share a little of those experiences with others trying out &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;RPX&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My first step was to download the &lt;a href="http://code.google.com/p/rpxlib/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;RXPLib&lt;/span&gt; from Google Code&lt;/a&gt;, which is a full &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;API&lt;/span&gt; wrapper for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;RPX&lt;/span&gt;. It gives you all the method calls you'll need to work with the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;RPX&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;API&lt;/span&gt;. It is built using the .NET 3.5 Framework, but it worked fine with my 2.0 web application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The &lt;a href="https://rpxnow.com/docs#example_code"&gt;example code&lt;/a&gt; provided by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;RPXNow&lt;/span&gt;.com in &lt;a href="https://rpxnow.com/examples/Rpx.cs"&gt;C#&lt;/a&gt; isn't particularly helpful. It is basically a Windows Console application, which allows you to basically interact with the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;API&lt;/span&gt;. N.B. It requires that you pass parameters to the application, so if you struggle to figure that out, view the project properties and edit the "Command Line Arguments" before you start to run the application in debug mode.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step right past the console app, and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;login&lt;/span&gt; to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;RPXNow&lt;/span&gt;.com, with any &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;OpenID&lt;/span&gt; enabled account and create a website profile. Then use the template created for you, and plug that code straight into your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;login&lt;/span&gt; page of your new website project. Create a call back page to which the authorisation token will be returned to. Add this URL to the script in the place holder (e.g. http://localhost:3456/ReceiveToken.aspx).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Running the web application you'll get a simple "Sign In" link, which when clicked offers a number of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;OpenID&lt;/span&gt; providers to select. You need to select one, which will redirect you to that provider. Agreeing to the conditions of your provider, you &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;login&lt;/span&gt; and are passed back to your token receiving page.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is where you implement your tie in to your Membership Provider. It makes a lot of sense to implement a custom Membership Provider, and hook the user into that.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The key areas you want to consider when a user logs into your application using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;OpenID&lt;/span&gt; is:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;The user won't be using a password to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;login&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Does the email address provided by the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;OpenID&lt;/span&gt; provider already exist in your database?&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Does the preferred user name passed back also exist?&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;Because the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;OpenID&lt;/span&gt; user doesn't need a password to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;login&lt;/span&gt; (although you can offer them one), the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;CreateUser&lt;/span&gt; method of your Membership provider will need to have a default password created for them. Ideally you create a random one and email it to them in their welcome email. This does two things. It allows them to continue logging in with their preferred &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;OpenID&lt;/span&gt;, or if they want to, log in with their user name and password.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the email address already exists in your database (and ideally email addresses would be unique in your provider), you are able to use the "Mapping" feature of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;RPX&lt;/span&gt;. Mappings lost me to start with, because they are not very well explained on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;RPX&lt;/span&gt; Now website. Quite simply, it allows you to tie up your existing user, to an identity on &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;RPX&lt;/span&gt;. After authentication in your Token page, you can call the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;RPX&lt;/span&gt; service to map your local &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;UserId&lt;/span&gt; (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;CustomerId&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;AccountId&lt;/span&gt;, etc) to an identity in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;RPX&lt;/span&gt;. In this way, you can map one of your user accounts to multiple &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;RPX&lt;/span&gt; identities.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If the preferred user name returned by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;RPX&lt;/span&gt; already exists in your database, you'll obviously have to offer the user an alternative user name (unless you use email addresses as user names).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In summary, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;RPX&lt;/span&gt; looks great, and is very simple to implement in a basic format. I'm sure I've only just scratched the surface in the few hours I've played around with it. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notably, the basic version of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;RPX&lt;/span&gt; is free, but offers a limited subset of features compared to the premium accounts. One of the issues with the basic version is that your users won't log in to your website directly, but be transferred to https://youraccount.rpxnow.com. As a result, users may be put off as they are warned constantly about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;phishing&lt;/span&gt; these days, and this looks like a blatant &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;phishing&lt;/span&gt; attempt. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Secondly, implementing &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;RPX&lt;/span&gt; means that you are putting all of your eggs into one basket. That's not to say that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;RPX&lt;/span&gt; is going to disappear, but it could. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, saying all of that, I think &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;RPX&lt;/span&gt; is a great idea. Having a single simple control that offers users a great selection of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;OpenID&lt;/span&gt; providers in a easy to understand format is what &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;OpenID&lt;/span&gt; needs at the moment.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I look forward to getting something more concrete together soon.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-3081486070989705499?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-10T13:46:19.557-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/02/rpx-openid-with-aspnet-webforms-and.html</feedburner:origLink></item><item><title>Paging and sorting in a .NetTiers custom stored procedure</title><link>http://feedproxy.google.com/~r/benpowell/~3/k5_Z3fbe7AE/paging-and-sorting-in-nettiers-custom.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Wed, 04 Feb 2009 08:54:48 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4923109322277461116</guid><description>If you use &lt;a href="http://www.nettiers.com/"&gt;.NetTiers&lt;/a&gt; as an Application Framework, you'll have used custom stored procedures in cases where the generic Entity Service Find methods do not offer enough granularity. Specifically, if you have the need to join across database tables, you'll find that a custom stored procedure is certainly the way to go. However, one of the biggest challenges facing developers is how to develop custom stored procedures for .NetTiers that support paging and sorting.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have struggled to get a stored procedure that would not just provide the paging and sorting we need, but also would work with .NetTiers so that the correct methods would be generated. So therefore I have put this together to help others. &lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When .NetTiers generates the output code, it looks for &lt;a href="http://nettiers.com/DataLayer.ashx#Custom_Stored_Procedures:_16"&gt;custom stored procedures&lt;/a&gt;, based on a given format, and attempts to work out whether the SQL code is returning a list of known objects, or simply a dataset.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Searching, sorting and paging in combination are usually going to imply the use of dynamic SQL queries, but .NetTiers cannot determine the output from dynamically created queries by parsing the SQL code. Therefore, what you'll find, when you first attempt to create a custom stored procedure, is a new method that returns void. Hence, .NetTiers did not expect any output to be returned from the procedure.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.google.com/search?hl=en&amp;amp;q=Paging+in+SQL+2005&amp;amp;btnG=Search"&gt;Paging in SQL 2005&lt;/a&gt; is well documented, and with the use of PageIndex, ROW_Number() and RowIndex, you can quite easily perform effective and efficent paging against a 2005 database. For paging we need to know which page we are on, how many results there are, and how many pages of data are possible, given the current search criteria. Most important of all, is the total rows returned. Without this value, the ASP.NET Grid paging or ObjectDataSource / EntityDataSource cannot know how many pages are required to be shown.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My example involves two database tables:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Company: Contain company information
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Address: Contains address information
&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;The two tables are linked by the [Company].AddressId to the [Address].AddressId.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Our task is to return a list of companies, by searching on the Address fields. Example:&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Return all Companies where the [Address].City='London'&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have put together a &lt;a href="http://www.box.net/shared/jq9tchg85i"&gt;download to demonstrate .NetTiers Custom Stored Procedure Paging and Sorting&lt;/a&gt; &lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This includes table / procedure create scripts, plus an example query. You'll have to populate the tables yourself. The entire stored procedure is listed below:
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="csharpcode"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 12px; "&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   1:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;EXISTS&lt;/span&gt; (&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SELECT&lt;/span&gt; * &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;FROM&lt;/span&gt; sysobjects &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;WHERE&lt;/span&gt; type = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'P'&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AND&lt;/span&gt; name = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'_Company_CustomSearch'&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;DROP&lt;/span&gt;  &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;Procedure&lt;/span&gt; [dbo].[_Company_CustomSearch]&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   5:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   6:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;GO&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   7:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   8:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;CREATE&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;PROCEDURE&lt;/span&gt; [dbo].[_Company_CustomSearch]&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   9:  &lt;/span&gt;(&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  10:  &lt;/span&gt;    @CompanyId &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;int&lt;/span&gt;   = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  11:  &lt;/span&gt;    @CompanyName nvarchar (150)  = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  12:  &lt;/span&gt;    @CompanyAddressTownCity nvarchar (200)  = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  13:  &lt;/span&gt;    @CompanyAddressState nvarchar (200)  = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  14:  &lt;/span&gt;    @CompanyAddressPostcode nvarchar (20)  = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  15:  &lt;/span&gt;    @OrderBy nvarchar (2000) = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  16:  &lt;/span&gt;    @PageIndex &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;int&lt;/span&gt; = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  17:  &lt;/span&gt;    @PageSize &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;int&lt;/span&gt; = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; ,&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  18:  &lt;/span&gt;    @TotalRows &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;int&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;OUTPUT&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  19:  &lt;/span&gt;)&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  20:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AS&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  21:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  22:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  23:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  24:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;--&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  25:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @PageIndex &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  26:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @PageIndex = 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  27:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  28:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @PageSize &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  29:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @PageSize = 400&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  30:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;--&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  31:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; DATEFORMAT dmy&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  32:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  33:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- Build WHERE Clause&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  34:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;DECLARE&lt;/span&gt; @WhereClause [nvarchar] (2000)&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  35:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  36:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @WhereClause = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'1=1'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  37:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  38:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @CompanyId &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NOT&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AND&lt;/span&gt; @CompanyId &lt;&gt; 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  39:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @WhereClause = @WhereClause + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' AND [Company].CompanyId = '&lt;/span&gt; + &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;CAST&lt;/span&gt;(@CompanyId &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AS&lt;/span&gt; NVARCHAR(20))&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  40:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  41:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @CompanyName &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NOT&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AND&lt;/span&gt; LEN(@CompanyName) &gt; 0&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  42:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @WhereClause = @WhereClause + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' AND [Company].CompanyName LIKE '&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt; + @CompanyName + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'%'&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  43:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  44:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @CompanyAddressTownCity &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NOT&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AND&lt;/span&gt; LEN(@CompanyAddressTownCity) &gt; 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  45:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @WhereClause = @WhereClause + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' AND [Address].TownCity LIKE '&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt; + @CompanyAddressTownCity + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'%'&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  46:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  47:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @CompanyAddressState &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NOT&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AND&lt;/span&gt; LEN(@CompanyAddressState) &gt; 0&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  48:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @WhereClause = @WhereClause + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' AND [Address].State LIKE '&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt; + @CompanyAddressState + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'%'&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  49:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  50:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @CompanyAddressPostcode &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NOT&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;AND&lt;/span&gt; LEN(@CompanyAddressPostcode) &gt; 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  51:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @WhereClause = @WhereClause + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' AND [Address].Postcode LIKE '&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt; + @CompanyAddressPostcode + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'%'&lt;/span&gt;&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;''&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  52:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  53:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;DECLARE&lt;/span&gt; @PageLowerBound &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;int&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  54:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;DECLARE&lt;/span&gt; @PageUpperBound &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;int&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  55:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  56:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- Set the page bounds&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  57:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @PageLowerBound = @PageSize * @PageIndex&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  58:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @PageUpperBound = @PageLowerBound + @PageSize&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  59:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  60:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; (@OrderBy &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;is&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;null&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;or&lt;/span&gt; LEN(@OrderBy) &lt;&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  61:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  62:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- default order by to first column&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  63:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @OrderBy = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'[CompanyId]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  64:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  65:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  66:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- SQL Server 2005 Paging&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  67:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;declare&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;as&lt;/span&gt; nvarchar(&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;max&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  68:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  69:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- get row count&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  70:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'SELECT @TotalRows = COUNT(DISTINCT Company.CompanyId)'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  71:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' FROM dbo.[Company]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  72:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' INNER JOIN [Address] ON [Address].AddressId = [Company].AddressId'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  73:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  74:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; LEN(@WhereClause) &gt; 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  75:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  76:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' WHERE '&lt;/span&gt; + @WhereClause&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  77:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  78:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  79:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;EXEC&lt;/span&gt; sp_executesql @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt;, N&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'@TotalRows int out'&lt;/span&gt;, @TotalRows &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;out&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  80:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  81:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- Get Data&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  82:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;'WITH PageIndex AS ('&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  83:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' SELECT'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  84:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @PageSize &gt; 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  85:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  86:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' TOP '&lt;/span&gt; + &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;convert&lt;/span&gt;(nvarchar, @PageUpperBound)&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  87:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  88:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  89:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' ROW_NUMBER() OVER (ORDER BY [Company].'&lt;/span&gt; + @OrderBy + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;') as RowIndex'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  90:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  91:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[CompanyId]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  92:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[CompanyName]'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  93:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[AddressId]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  94:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[CompanyUrl]'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  95:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[Telephone]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  96:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  97:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' FROM dbo.[Company]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  98:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' INNER JOIN [Address] ON [Address].AddressId = [Company].AddressId'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  99:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 100:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; LEN(@WhereClause) &gt; 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 101:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 102:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' WHERE '&lt;/span&gt; + @WhereClause&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 103:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 104:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 105:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- Group By&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 106:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' GROUP BY '&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 107:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' [Company].[CompanyId]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 108:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[CompanyName]'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 109:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[AddressId]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 110:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[CompanyUrl]'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 111:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Company].[Telephone]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 112:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 113:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' ) SELECT'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 114:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' [CompanyId]'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 115:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [CompanyName]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 116:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [AddressId]'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 117:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [CompanyUrl]'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 118:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;', [Telephone]'&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 119:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' FROM PageIndex'&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 120:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' WHERE RowIndex &gt; '&lt;/span&gt; + &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;convert&lt;/span&gt;(nvarchar, @PageLowerBound)&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 121:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 122:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; @PageSize &gt; 0&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 123:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 124:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' AND RowIndex &lt;= '&lt;/span&gt; + &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;convert&lt;/span&gt;(nvarchar, @PageUpperBound)&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 125:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 126:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 127:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SET&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; = @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt; + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;' ORDER BY '&lt;/span&gt; + @OrderBy&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 128:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 129:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- Get Data&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 130:  &lt;/span&gt;--&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;PRINT&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 131:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;EXEC&lt;/span&gt; sp_executesql @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 132:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;PRINT&lt;/span&gt; @&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SQL&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 133:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 134:  &lt;/span&gt;&lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;-- HACK (to get .NetTiers to gen the TList&lt;company&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 135:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IF&lt;/span&gt; USER_NAME() &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;IS&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;NULL&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 136:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;BEGIN&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 137:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;SELECT&lt;/span&gt; * &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;FROM&lt;/span&gt; Company &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;WHERE&lt;/span&gt; 1=0&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 138:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;RETURN&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 139:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 140:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 141:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 142:  &lt;/span&gt; &lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt; 143:  &lt;/span&gt;GO&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you have any questions or comments, please don't hestitate to ask.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4923109322277461116?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-04T08:54:48.919-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/02/paging-and-sorting-in-nettiers-custom.html</feedburner:origLink></item><item><title>ASP.NET - Disabling the submit button to prevent double submissions</title><link>http://feedproxy.google.com/~r/benpowell/~3/U9jMF6beUSM/aspnet-disabling-submit-button-to.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Wed, 21 Jan 2009 11:59:15 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-2533666626278790064</guid><description>If a user clicks on a form submit button and the page response is slow, the user may often re-click that button. Because the original request has already been submitted, you may find that the user has made a double submission. In e-commerce sites, the double submission of a credit card payment may be very unpopular with your customers. &lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is a common problem faced by web developers, and there are a variety of ways to try to prevent it. However, I have not seen a really elegant way to solve the problem, so I set about trying to find a simple and effective solution.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There were some key issues I wanted to address:&lt;div&gt;&lt;ol&gt;&lt;li&gt;I wanted to disable the button when it was clicked, but &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;only&lt;/span&gt; if the page was valid
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I did not want to manually add code to every button in my application
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I did not want to break the existing validation, especially when using validation groups
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I wanted to preserve the CausesValidation property
&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;To achieve these goals, I set about creating a custom button that inherited the standard ASP Button. This custom button would replace the existing buttons in my application.
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First add a new class to your App_Code directory called "EnhancedButton" and then override the OnPreRender event:&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="csharpcode"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 12px; "&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   1:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;namespace&lt;/span&gt; Junto.WebControls&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   3:  &lt;/span&gt;    &lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;/// &lt;summary&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   4:  &lt;/span&gt;    &lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;/// If CausesValidation then check the current ValidationGroup is valid&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   5:  &lt;/span&gt;    &lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;/// and if so, disable the button.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   6:  &lt;/span&gt;    &lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;/// &lt;/summary&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   7:  &lt;/span&gt;    [ToolboxData(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"&lt;{0}:EnhancedButton runat=server&gt;&lt;/{0}:EnhancedButton&gt;"&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   8:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;public&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;class&lt;/span&gt; EnhancedButton : Button&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   9:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;protected&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;override&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;void&lt;/span&gt; OnPreRender(EventArgs e)&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  11:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  12:  &lt;/span&gt;            &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;if&lt;/span&gt; (&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;this&lt;/span&gt;.CausesValidation)&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  13:  &lt;/span&gt;            {&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  14:  &lt;/span&gt;                StringBuilder sb = &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;new&lt;/span&gt; StringBuilder();&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  15:  &lt;/span&gt;                sb.Append(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"if (typeof(Page_ClientValidate) == 'function') { "&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  16:  &lt;/span&gt;                sb.Append(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"if (Page_ClientValidate('"&lt;/span&gt; + &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;this&lt;/span&gt;.ValidationGroup + &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"') == false) { return false; }} "&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  17:  &lt;/span&gt;                sb.Append(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"this.value = 'Please wait...';"&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  18:  &lt;/span&gt;                sb.Append(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"this.disabled = true; "&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  19:  &lt;/span&gt;                sb.Append(&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;this&lt;/span&gt;.Page.GetPostBackEventReference(&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;this&lt;/span&gt;));&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  20:  &lt;/span&gt;                sb.Append(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;";"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  21:  &lt;/span&gt;                &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;this&lt;/span&gt;.Attributes.Add(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"onclick"&lt;/span&gt;, sb.ToString());&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  22:  &lt;/span&gt;            }&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  23:  &lt;/span&gt; &lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  24:  &lt;/span&gt;            &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;base&lt;/span&gt;.OnPreRender(e);&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  25:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  26:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  27:  &lt;/span&gt;}&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, we add the following to our web.config to take advantage of the tagMapping feature:&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="csharpcode"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 12px; "&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   1:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;pages&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;controls&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;add&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;tagPrefix&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="Junto"&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;namespace&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="Junto.WebControls"&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;controls&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;tagMapping&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;add&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;tagType&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="System.Web.UI.WebControls.Button"&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;mappedTagType&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="Junto.WebControls.EnhancedButton"&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   7:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;tagMapping&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   8:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;pages&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The result is that all instances of standard Buttons are replaced with our new Enhanced custom button. You have no need to add extra code in every Page_Load. The Tag Mapping takes care of replacing the standard button across the web application.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And Voilà, our job is done!&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-2533666626278790064?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-21T11:59:15.998-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/01/aspnet-disabling-submit-button-to.html</feedburner:origLink></item><item><title>An Open Letter to the People of Israel</title><link>http://feedproxy.google.com/~r/benpowell/~3/AP8TkfYvPkI/open-letter-to-people-of-israel.html</link><category>politics</category><author>noreply@blogger.com (Ben)</author><pubDate>Thu, 15 Jan 2009 23:04:34 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-7712095871867843295</guid><description>&lt;p class="MsoNormal"&gt;When &lt;a href="http://en.wikipedia.org/wiki/Adolf_hitler"&gt;Adolf Hitler&lt;/a&gt; rose to power in 1933 on a wave of nationalism, born out of the failures of a nation after the Great War, he looked for someone to blame. Although anyone fulfilling the role of a non-German was considered fair game, but it was the German Jews that took the full force of the backlash. As Germany expanded its borders through invasion and &lt;a href="http://en.wikipedia.org/wiki/Anschluss"&gt;annexation&lt;/a&gt; the rest of the world resorted to&lt;a href="http://en.wikipedia.org/wiki/Appeasement_of_Hitler"&gt; appeasement&lt;/a&gt;, scarred by memories of the Great War.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Anti-Semitism was a key policy of the National Socialists and in 1939 Adolf Eichmann started to systematically move Jews into designated areas of Polish cities, which was to be the start of the Nazi “&lt;a href="http://en.wikipedia.org/wiki/Final_Solution"&gt;Final Solution&lt;/a&gt;”. During the war the Nazis created &lt;a href="http://en.wikipedia.org/wiki/Ghettos_in_occupied_Europe_1939-1944"&gt;Jewish ghettos across occupied Europe&lt;/a&gt;. Commonly a wall was built around the area, and the Jewish inhabitants were restricted from leaving the ghetto. Food and supplies were strictly controlled by the Nazis and crowded living conditions led to disease and starvation.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;One of the most infamous ghettos was the &lt;a href="http://en.wikipedia.org/wiki/Warsaw_Ghetto"&gt;Warsaw Ghetto&lt;/a&gt; that contained 300,000 – 400,000 people. In 1943 the Jewish population were being subjected to the second wave of deportations to concentration camps and by this time they realised that they were being sent to their deaths. An insurgency was born, and using a handful of small arms and improvised weapons, the inhabitants of the ghetto fought against a superior war machine. The main &lt;a href="http://en.wikipedia.org/wiki/Warsaw_Ghetto_Uprising"&gt;rebellion&lt;/a&gt; was over with a month, and at the end, 13,000 Jewish people had died. The remaining 50,000 inhabitants were captured and shipped off to concentration camps, mainly Treblinka.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Years before in 1922, the &lt;a href="http://en.wikipedia.org/wiki/League_of_Nations"&gt;League of Nations&lt;/a&gt; (pre-cursor to the UN), granted the British a mandate over Palestine. Although Jewish emigration to Palestine had started some time before, it was the rise of Nazism in the 1930’s that started the “Fifth Aliyah”, bringing a quarter of a million Jews to settle in Palestine. In opposition to these large numbers of immigrants, an &lt;a href="http://en.wikipedia.org/wiki/1936%E2%80%931939_Arab_revolt_in_Palestine"&gt;uprising&lt;/a&gt;, started by a general strike by the Arabs in Palestine led Britain to halt further Jewish immigration into Palestine in 1939.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;By the end of World War II, the &lt;a href="http://en.wikipedia.org/wiki/Israel#Zionism_and_the_British_Mandate"&gt;Jewish population of Palestine had increased to 33%, from 11% in 1922&lt;/a&gt;. After 1945, Britain struggled to control Palestine and became embroiled in an increasingly &lt;a href="http://en.wikipedia.org/wiki/British_Conflict_with_Zionism"&gt;violent conflict with the Jews&lt;/a&gt;. On May 14, 1948, the day before the end of the British mandate, the Jewish Agency proclaimed independence, naming the country Israel. Eleven minutes after the Declaration of Independence was signed, US President Truman, recognised the &lt;a href="http://en.wikipedia.org/wiki/Declaration_of_Independence_(Israel)"&gt;State of Israel&lt;/a&gt;, and a nation was born.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Over the years since, Israel has expanded its borders through armed conflict with its neighbours, and now occupies much of this land. Throughout this expansion Israel has been appeased and although several UN mandates have been passed against Israel, many remain ignored. Israel has developed into a strong militarised nation with &lt;a href="http://en.wikipedia.org/wiki/Israel_and_weapons_of_mass_destruction"&gt;biological, chemical and nuclear capabilities&lt;/a&gt;. It remains the most powerful military force in the region.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In 1967, Israel took control of the Gaza strip, a piece of land bordering Israel and Egypt. It is roughly 41 kilometres long and between 6 – 12 kilometres wide. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;In 1987 the “&lt;a href="http://en.wikipedia.org/wiki/First_Intifada"&gt;First Intifada&lt;/a&gt;” or the “War of Stones” started, and was a mass Palestinian uprising against Israeli rule. Action ranged from civil disobedience to violence. Many suspected Israeli collaborators were killed by their own people. The result was loss of life on both sides, but it also cemented Palestinian identity in the eyes of the rest of the world.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Since 1987, violence has never left the region. Tit-for-tat attacks have continued unabated and many lives have been lost. Peace treaties have been discussed, signed and ignored. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Under the Oslo Accords, Israel left the Gaza strip in 1994 and the area came under Palestinian control. From this date onwards Israel set about building a wall around Gaza, known as the”&lt;a href="http://en.wikipedia.org/wiki/Israeli_Gaza_Strip_barrier"&gt;Israel – Gaza Strip Barrier&lt;/a&gt;”. There are three crossing points in the barrier, which are controlled by Israel, and are of crucial importance to the 1.4 million inhabitants of Gaza, who are unable to be self sufficient.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Regardless of who has controlled Gaza since, a steady stream of rocket attacks have hit Israeli cities, and Palestinian suicide bombers have been used to create havoc and fear. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;In June 2007 both Egypt and &lt;a href="http://en.wikipedia.org/wiki/Gaza_Strip_blockade"&gt;Israel blockaded the Gaza strip&lt;/a&gt; and Israel sealed the borders and allowing only enough goods in to prevent a humanitarian crisis.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now the Gaza strip is a ghetto. The inhabitants are walled in. One can draw parallels to the Warsaw ghetto in the 1940’s, but many who do are criticised, such as &lt;a href="http://en.wikipedia.org/wiki/Patrick_Buchanan#A_Palestinian_State"&gt;Pat Buchanan&lt;/a&gt;, who accused Israel of &lt;a href="http://en.wikipedia.org/wiki/Gaza_Strip#Concentration_camp_comparisons"&gt;turning Gaza into a “concentration camp”&lt;/a&gt;. &lt;/p&gt;  &lt;p class="MsoNormal"&gt;One can now see a similarity between the Gazan insurgency and the Jewish insurgency in the Warsaw ghetto. Both fought a superior and better armed opponent in a guerrilla war. Both were confined to a piece of land, unable to move freely, with restricted access to work, food, or medical supplies.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;It is a moral requirement that we see this situation as it is. The world still reels from the guilt of the holocaust, and appeases Israel because of it. But enough is enough. Israel has to be responsible for its actions. It has to realise that it cannot continue on this path, because ironically, it is this very path that has destroyed so much of its own. The Palestinians have nothing more to lose, and they know it. Israel is a hair’s breadth from making a decision it will long regret in the history of humanity. It is arguably on the brink of having committed war crimes against humanity and ethnic cleansing.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;It is Israel that must make the first move. It holds the power and the keys to the kingdom. The only thing that the Palestinian authorities have left in their diplomatic armory is their refusal to recognise the State of Israel, and it is a worthless sticking point that both use to maintain the diabolical status-quo.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;It is important that one realises that criticism of Israeli policies is not anti-Semitic. To draw an analogy with the Nazi era, one can criticise the Nazi state, whilst holding nothing against German people. It is an important differentiation to make between the crimes of a state and its people. The same can be said of Hamas and the people of Gaza.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We cannot undo history, so now we are only left with a valid two state solution that is equitable and honoured by both. There is no reason that the two nations cannot live side by side and prosper. &lt;/p&gt;&lt;p class="MsoNormal"&gt;Where the Nazis fostered the Jews as their nemesis, today it is the turn of Islamic fundamentalism. In reality it is nothing more than a crusade, aimed to gather a population and direct them against a common evil, and prevent them from looking inwards.&lt;/p&gt;&lt;p class="MsoNormal"&gt;If we were able to truly reflect on ourselves and what we have become, I think we would have much to change.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now that is change we can believe in.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-7712095871867843295?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-15T23:04:34.953-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2009/01/open-letter-to-people-of-israel.html</feedburner:origLink></item><item><title>Importing (hacking) custom formatted blog XML posts into Blogger</title><link>http://feedproxy.google.com/~r/benpowell/~3/UoG8AGZNlXw/importing-hacking-custom-formatted-blog.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 13:20:39 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-7247350983593001070</guid><description>Some years ago I coded and used a custom blog engine, which used XML as a data store. The format of this XML file was completely unique to this engine, so it has always been too difficult to get this data into Blogger.&lt;br /&gt;&lt;br /&gt;However, in June, Blogger offered up an export/import feature, which allowed users to backup and move posts around between blogger blogs. With this in mind I set about trying to import these old posts into Blogger.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 1: Identity the Blogger Import Format&lt;/span&gt;&lt;br /&gt;I needed to work out what format the blogger import feature used. I tried to import my custom XML, which not surprisingly, didn't work. So with the help of some guidance from the web, and an export of my current Blogger posts, I figured out the format I required.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 2: Transform my custom XML into Blogger XML&lt;/span&gt;&lt;br /&gt;I needed to transform my custom XML format into the Blogger import format (essentially an ATOM feed). The easiest way to do this seemed to be to use XSL. I hacked together a simple XSL document to transform the custom XML into valid Blogger XML.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 3: Create a mechanism for performing the transformation&lt;/span&gt;&lt;br /&gt;I created a simple HTML file that would load the custom XML file, transform this into the Blogger ATOM feed and then save it to disk.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 4: Import the custom posts into Blogger&lt;/span&gt;&lt;br /&gt;I imported the Blogger ATOM feed into the Draft Blogger website, using their import tool. I noticed that several of the posts seemed to have weird characters, and realised that I has an encoding problem.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 5: Force the encoding of the output file&lt;/span&gt;&lt;br /&gt;I forced the file to be stored in a UTF-8 encoding, to preserve some of the characters that ASCII doesn't support.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Step 6: Edit and publish imported posts&lt;/span&gt;&lt;br /&gt;I went through and editing the posts I wanted to edit and then published everything into this blog.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Get the code&lt;/span&gt;&lt;br /&gt;If you have a similar problem, where you have XML in one blog format and want to import into Blogger, I have put together &lt;a href="http://www.box.net/shared/k62sp2smef"&gt;a simple example for transforming the XML as a download&lt;/a&gt;, which you can download and use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-7247350983593001070?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T13:20:39.082-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/11/importing-hacking-custom-formatted-blog.html</feedburner:origLink></item><item><title>Legal music downloads aren't working</title><link>http://feedproxy.google.com/~r/benpowell/~3/-tAACSSgrcY/used-abused-and-totally-screwed.html</link><category>opinion</category><category>music</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4878875048352488600</guid><description>Michael Robertson of &lt;a href="http://mp3tunes.com/"&gt;MP3Tunes.com&lt;/a&gt; writes today in the Register that &lt;a href="http://www.theregister.co.uk/2008/09/09/michael_robertson_music_models/"&gt;legal digital music distribution is commercial suicide&lt;/a&gt;. I thought I'd comment on my feeling towards digital music.&lt;br /&gt;
&lt;br /&gt;
I used to love listening and collecting music. Although I used to baulk at buying CDs (at UK prices), every now and then I would indulge. However, in the last few years my music purchases are rare, and I loathe spending the money on something I believe is over-priced.&lt;br /&gt;
&lt;br /&gt;
The music industry is still trying to convince us that we should pay more for digital music than we did for CDs (£0.99 x ~15 tracks = album cost). I don't download music, because I don't feel it's fair to the artist, and therefore my only option is to stop buying new music in protest. I'll have to stick with what I paid handsomely for over the years before I realised I was being ripped off.&lt;br /&gt;
&lt;br /&gt;
The entire industry is a sham. The consumer is being used, abused and totally screwed. I'd be happy to pay an equitable price for music, and might even get back into collecting music again if I thought I wasn't being ripped off anymore.&lt;br /&gt;
&lt;br /&gt;
Digital music has no fixed physical value, because it requires no physical product to be produced, packaged or distributed. There is no scarcity factor, supply is boundless and demand is fickle. The resulting price should naturally fall very low. Basic economics...&lt;br /&gt;
&lt;br /&gt;
It is kept artificially high through &lt;a href="http://business.timesonline.co.uk/tol/business/industry_sectors/media/article671912.ece"&gt;lack of competition&lt;/a&gt;, quasi "&lt;a href="http://www.usatoday.com/life/music/news/2002-09-30-cd-settlement_x.htm"&gt;price&lt;/a&gt;-&lt;a href="http://business.timesonline.co.uk/tol/business/industry_sectors/technology/article737029.ece"&gt;fixing&lt;/a&gt;", politicians "persuaded" by &lt;a href="http://www.theinquirer.net/en/inquirer/news/2007/08/07/music-industry-body-illegally-funds-lobbyists-spinners"&gt;industry lobbyists&lt;/a&gt; and expensive &lt;a href="http://recordingindustryvspeople.blogspot.com/2008/07/aba-judges-journal-article-large.html"&gt;cartel&lt;/a&gt; lawyers with sharp teeth. None of which the savvy customer really appreciates.&lt;br /&gt;
&lt;br /&gt;
The music industry needs to remember, that without us buying the crap they pump out - they are screwed. Maybe they should consider that next time they are &lt;a href="http://mashable.com/2008/07/24/music-tax-cocaine/"&gt;snorting&lt;/a&gt; &lt;a href="http://entertainment.timesonline.co.uk/tol/arts_and_entertainment/music/article3370224.ece"&gt;cocaine&lt;/a&gt; off a whores tits, funded by us mugs here in consumer-ville.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4878875048352488600?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.324-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/09/used-abused-and-totally-screwed.html</feedburner:origLink></item><item><title>Chrome is coming - Finally a real challenger to the Microsoft browser throne</title><link>http://feedproxy.google.com/~r/benpowell/~3/8yTCmOQocu8/chrome-is-coming-finally-real.html</link><category>opinion</category><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5741148843311173702</guid><description>Google premature announcement of its new &lt;span id="SPELLING_ERROR_0"&gt;browser&lt;/span&gt; platform called &lt;a href="http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html"&gt;Chrome&lt;/a&gt; has some interesting implications, that have not been discussed widely in the &lt;span id="SPELLING_ERROR_1"&gt;blogosphere&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
I would not be surprised that if we revisit this article in two years time, that Chrome would have a larger market share than &lt;span id="SPELLING_ERROR_2"&gt;Firefox&lt;/span&gt;, and will have severely dented Microsoft's Internet Explorer domination. Chrome has the advantage that it has an easier download path compared to &lt;span id="SPELLING_ERROR_3"&gt;Firefox&lt;/span&gt;. At present the majority of &lt;span id="SPELLING_ERROR_4"&gt;Firefox&lt;/span&gt; enthusiasts are certainly more technically aware, but these people are in the minority on the &lt;span id="SPELLING_ERROR_5"&gt;internet&lt;/span&gt; as a whole. The "average" user is unlikely to ever visit the &lt;span id="SPELLING_ERROR_6"&gt;Firefox&lt;/span&gt; download website and install the &lt;span id="SPELLING_ERROR_7"&gt;Firefox&lt;/span&gt;. Opera has the same problem, regardless of whether they are good browsers or not.&lt;br /&gt;
&lt;br /&gt;
Microsoft's download route is obviously the most direct, downloaded via Windows Update on &lt;span id="SPELLING_ERROR_8"&gt;XP&lt;/span&gt; and Vista, but &lt;span id="SPELLING_ERROR_9"&gt;Google's&lt;/span&gt; download route will be a close second. Prepare to see it packaged in the same manner as the Google Toolbar, hence, straight off the Google front page (to an extremely wide audience) and embedded in other "free" software such as Adobe Flash and Reader.&lt;br /&gt;
&lt;br /&gt;
Assuming the final release of Chrome is bug free, and works, &lt;span id="SPELLING_ERROR_10"&gt;CSS&lt;/span&gt; friendly &lt;span id="SPELLING_ERROR_11"&gt;et&lt;/span&gt; &lt;span id="SPELLING_ERROR_12"&gt;al&lt;/span&gt;, the &lt;span id="SPELLING_ERROR_13"&gt;internet&lt;/span&gt; community will quite quickly switch to the new preferred default browser.&lt;br /&gt;
&lt;br /&gt;
Of the &lt;a href="http://www.alexa.com/site/ds/top_sites?ts_mode=global&amp;amp;lang=none"&gt;top 10 global websites&lt;/a&gt;, over half are pushing the bounds of JavaScript in today's browsers. Google apps (Gmail, Docs, etc), &lt;span id="SPELLING_ERROR_14"&gt;Hotmail&lt;/span&gt;, Yahoo Mail, &lt;span id="SPELLING_ERROR_15"&gt;Facebook&lt;/span&gt;, &lt;span id="SPELLING_ERROR_16"&gt;Youtube&lt;/span&gt;, and &lt;span id="SPELLING_ERROR_17"&gt;Myspace&lt;/span&gt;, have the potential to work &lt;a href="http://www.google.com/googlebooks/chrome/"&gt;better, faster and be more stable&lt;/a&gt; under Chrome. &lt;span id="SPELLING_ERROR_18"&gt;Firefox&lt;/span&gt; and Internet Explorer, will not be able to compete in this areas, in their current builds anyway. This is due to the unique threading sandbox model, and &lt;a href="http://en.wikipedia.org/wiki/Google_Chrome#JavaScript"&gt;compiled JavaScript code&lt;/a&gt;, Chrome will employ.&lt;br /&gt;
&lt;br /&gt;
Chrome also plugs in &lt;a href="http://en.wikipedia.org/wiki/Gears_(software)"&gt;Google Gears&lt;/a&gt;, which gives it an advantage out of the box, so it inherently will support Gears where no other browser does.&lt;br /&gt;
&lt;br /&gt;
Google has found a place from which they can attack the Microsoft domination of the browser market in a way that Netscape, &lt;span id="SPELLING_ERROR_19"&gt;Firefox&lt;/span&gt; and Opera were never been able to do.&lt;br /&gt;
&lt;br /&gt;
Finally, although this is not apparent in Chrome at the moment, it stands to reason that it could also display advertising in a way that the other browsers have not done so to date. It would not be out of the bounds of reality, for Google to have a advertising sidebar that loads based on EVERY page you view. At a minimum, it gives Google advertising tracking that other ad-networks can only dream of, and which Google Toolbar gives them partially at the moment.&lt;br /&gt;
&lt;br /&gt;
Watch this space....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5741148843311173702?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.328-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/09/chrome-is-coming-finally-real.html</feedburner:origLink></item><item><title>US Energy independence is the key to controlling Russia now</title><link>http://feedproxy.google.com/~r/benpowell/~3/Bynk5nWhU8g/us-energy-independence-is-key-to.html</link><category>opinion</category><category>politics</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-9140396968470860620</guid><description>Over the last week &lt;a href="http://www.guardian.co.uk/world/2008/aug/12/georgia1"&gt;Russia has redrawn the geo-political map of a vital strategic region&lt;/a&gt; notes the Guardian today. Russia has shown that it has risen from its embarrassing collapse in the early 90's, like a phoenix from the ashes. Through Georgia and South Ossetia, America and Russia have fought a one way proxy war, and the west decided to leave Georgia in the cold. I have no doubt that they have encouraged the Georgian president, and now the west and President Saakashvili have egg on their faces.&lt;br /&gt;
&lt;br /&gt;
I believe that this debacle was a "test of the water", to see what type of response Russia would give under the new Medvedev/Putin regime. There is a good reason for this interest. Russia maintains strong but loose links to Tehran, and it is Russia that stops the US attacking Iran over its nuclear policy via its veto in the UN Security Council. Both Russia and China supply the majority of missile technology that allow the Iranians to build and maintain the Shahab-3 rocket systems which the Iranians might use to launch nuclear bombs.&lt;br /&gt;
&lt;br /&gt;
The &lt;a href="https://www.cia.gov/news-information/speeches-testimony/2000/walpole_missile_092200.htm"&gt;US strongly believes that it needs to stop the Iranian nuclear industry&lt;/a&gt; in its tracks. It doesn't feel it can risk a Muslim state with the power to develop nuclear weapons, especially one that has proven long range missile delivery systems that in the near future could reach all of Israel (As a note, Pakistan is an "ally" and run by a dictator, hence not "Muslim controlled").&lt;br /&gt;
&lt;br /&gt;
I believe that had their gamble worked in Georgia, an attack on Iran would have been much easier for them to go ahead with. They would have known that Russia did not have the balls to stop them. Now the situation has almost been reversed, and they have absolutely no idea what Putin will do, if, and this is the most probable outcome; Israel bombs key Iranian nuclear facilities.&lt;br /&gt;
&lt;br /&gt;
Please note that Israel needs a very valid reason to bomb Iranian sovereign territory, so be prepared to see something happen that gives Israel "due cause to retaliate", before this November, as President Bush needs Israel to do this before he leaves office.&lt;br /&gt;
&lt;br /&gt;
What is most interesting about all of this, is Europe's response to the whole thing, which was tepid at best. It shows the weight Russia holds in terms of energy in Europe, and the Europeans are quick to appease (and these are Nato countries). I don't blame Europe, since they are energy dependent on Russian oil and gas.&lt;br /&gt;
&lt;br /&gt;
The US is already starting to talk about energy independence, but now they REALLY need it. If the US is to match Russia in the years to come, they need to offer Europe another option for energy generation, that doesn't leave Europe dependent on Russian oil and gas.&lt;br /&gt;
&lt;br /&gt;
Sadly, the US might have left this too late. Their own system of pandering to the oil lobbyists in Washington have made sure that alternative energy has remained on the sidelines. I have no doubt that Houston will remain rich, but the rest of the US will continue to decline as a result of this lack of forethought.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-9140396968470860620?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.332-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/08/us-energy-independence-is-key-to.html</feedburner:origLink></item><item><title>My Solution to Britain's Problems</title><link>http://feedproxy.google.com/~r/benpowell/~3/9DAGkp0gseg/my-solution-to-britains-problems.html</link><category>opinion</category><category>politics</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-6119874765268708149</guid><description>The UK is suffering from a social meltdown. The problem is spiralling and if something is not done soon, the morally-destitute youth of today will become the parent's of tomorrow. Parents are unwilling to take the responsibility of controlling and disciplining their children. They no longer understand, or have been taught, the meaning of respect. The media does nothing to help the situation and schools have become the last place where any degree of social responsibility is being taught, and even then, it is almost impossible for them to do so effectively. I generalise, but as this becomes the norm, and the majority of our youth become unproductive and problematic in society we are left with a country that will not be able to compete in a world that has recently seen 3 billion people added to the capitalist economy.&lt;br /&gt;
&lt;br /&gt;
So what can we do to stop the rot? How can we turn this around? Are we doomed to a country where it is no longer a pleasure to live?&lt;br /&gt;
&lt;br /&gt;
I propose that the government needs to enforce a program of social responsibility. It needs to be done through a mandatory program of combined social and military service. It needs to be well thought out, widely supported and effective. The young people placed within the program need to feel that they are achieving something, and earning the respect of their peers. It should not be a waste of their time. Both military and social service &lt;strong&gt;should be undertaken abroad&lt;/strong&gt; and not in the UK. This will teach them the value of life, and what the UK still has to offer compared to abroad in poorer and more troubling areas of the world. Military or civil service should be mandatory for both sexes.&lt;br /&gt;
&lt;br /&gt;
There should be certain exceptions. The vast majority of my German friends have stated that in certain cases a blanket approach is not the way forward. The system in Germany forces all men to take part in either military service, or if you have a valid reason not to military service, you have to do civil service at school leaving age. For students who will undertake long periods of study afterwards, such as doctors, this is simply a break in their studies they do not need, and provides them with no long term benefit.&lt;br /&gt;
&lt;br /&gt;
Therefore, students studying certain professions can do their civil service as part of their studies. Doctors for example could do their civil service after their first few years on study, and as a practical part of their studies give their services abroad in countries where their expertise, even though their studies are uncompleted, will be valuable and welcomed.&lt;br /&gt;
&lt;br /&gt;
The government needs to evaluate the higher education system, plan for which professions will provide our country with the &lt;strong&gt;most beneficial professionals in the medium to long term&lt;/strong&gt;. These people should not have to take part in the civil or military service program. They should have as many resources available for them to improve and deliver in the community around them. If we want to compete on the world stage, against highly technically skilled Indian students and Chinese labour, we need to consider where the UK will fit in the global marketplace.&lt;br /&gt;
&lt;br /&gt;
We forget that the UK is a very small country. We forget that our place in the world stage is 50 years in the making, and from our position at the end of the last world war. We forget that our economy is built on the adventurers, explorers and entrepreneurs (and imperialism) of the past. This power is quickly starting to wane. Our position on the world stage during the past decades is leveraged with our affiliation to the United States. Although the US is not going anywhere soon, its power is in recession. The US has happily outsourced its manufacturing and services, and now in recent years its technological research and development abroad. It only brands goods and services, and that, it not something you should rely on. The new economies of India and China, are starting to become more aware that they don't need to US, and our connection with the United States becomes less and less beneficial, from an economic point of view, if not a militaristic one.&lt;br /&gt;
&lt;br /&gt;
We do not want to end up with a country that is full of young people with no work, no work ethic, and a stagnating economy. I don't believe that any of the British political parties have the forethought to consider our long term survival on the world stage. It will take a definitive plan, hard work, and a drive to succeed to achieve this goal. Other countries are aware of this, and if we don't do something soon, we are doomed to become a second rate nation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-6119874765268708149?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.336-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/07/my-solution-to-britains-problems.html</feedburner:origLink></item><item><title>How is price determined in the stock market?</title><link>http://feedproxy.google.com/~r/benpowell/~3/1QWFwD_2x1A/how-is-price-determined-in-stock-market.html</link><category>opinion</category><category>business</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5511084447557369594</guid><description>This question has bugged me for ages. I understand that on a base level, the price of a share or stock, is governed by demand and supply. The supply of a stock is for all intents and purposes, finite, so if the demand for that stock increases, the price increases. Obviously when demand decreases (or supply increases) the price should drop.&lt;br /&gt;
All good, perfectly understood. Now, let's assume I have 1000 shares in Yahoo. Today's share price is roughly $27. That means that I can sell my 1000 shares and I will receive $27,000 dollars for those shares. To sell those shares, there needs to be a buyer, who will pay $27,000 to buy those shares, or a number of buyers, who will all pay $27 per share, for a percentage of those 100 shares (e.g. 10 buyers each buy 100 shares).&lt;br /&gt;
What I would like to know is three things:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;What happens when there isn't a buyer for my shares? &lt;/li&gt;
&lt;li&gt;What happens behind the scenes when I sell my shares?&lt;/li&gt;
&lt;li&gt;What is the underlying process, that allows my 1000 shares to be sold to one or more buyers at the price I agreed with my broker (or online trading account)?&lt;/li&gt;
&lt;/ul&gt;I am trying to understand how the inner working of the stock market function. There needs to be two parties at the exchange, who agree a price, but what doesn't make sense then, is that my price has already been set? It is the point of exchange, which I think is the black box I don't understand.&lt;br /&gt;
I'd love some feedback on this. I am interesting in creating a computer model of a stock market, and I need to understand this issue before I can continue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5511084447557369594?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.339-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/05/how-is-price-determined-in-stock-market.html</feedburner:origLink></item><item><title>How I built my personal website in 10 easy steps</title><link>http://feedproxy.google.com/~r/benpowell/~3/vmZYfZXtdAk/how-i-built-my-personal-website-in-10.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sat, 31 Jan 2009 03:55:22 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4128217179408195683</guid><description>&lt;ol&gt;&lt;li&gt;Download RSS Toolkit from CodePlex: &lt;a href="http://www.codeplex.com/ASPNETRSSToolkit"&gt;http://www.codeplex.com/ASPNETRSSToolkit&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Link my Blogger posts feed, comments feed, Flickr feed and Last.fm to Feedburner. Force Blogger feeds to output as RSS 2.0 from Feedburner (switch off Smart Feed), otherwise RSS Toolkit can't process the ATOM entry links correctly.&lt;/li&gt;&lt;li&gt;Set each Feedburner feed to the appropriate RssDataSource and set the DataSource to bind to a simple ASP.Net Repeater.
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Setup the RSS Toolkit Caching using the application settings suggested &lt;a href="http://www.codeplex.com/ASPNETRSSToolkit/Wiki/View.aspx?title=Feed%20Cache&amp;amp;referringTitle=Home"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Revamp website design using templates from the &lt;a href="http://www.oswd.org/design/preview/id/3207"&gt;Open Source Web Design templates library&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Publish, and see results of &lt;a href="http://www.benpowell.co.uk/"&gt;Ben Powell&lt;/a&gt;'s new website.
&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;And, now for some code:&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="csharpcode"&gt;&lt;span class="Apple-style-span" style="font-family: Consolas; font-size: 12px; "&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   1:  &lt;/span&gt;&lt;span class="asp" style="background-color: rgb(255, 255, 0); "&gt;&lt;%@ Register Assembly="RssToolkit" Namespace="RssToolkit.Web.WebControls" TagPrefix="cc1" %&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   2:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;asp:Repeater&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;ID&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="Repeater1"&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;runat&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="server"&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;DataSourceID&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="RssDataSource1"&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;HeaderTemplate&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;ul&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;class&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="sidemenu"&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;HeaderTemplate&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;li&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;a&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;href&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="&lt;%# Eval("&lt;/span&gt;&lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;link&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;") %&gt;"&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;span class="asp" style="background-color: rgb(255, 255, 0); "&gt;&lt;%&lt;/span&gt;# Eval(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"title"&lt;/span&gt;) &lt;span class="asp" style="background-color: rgb(255, 255, 0); "&gt;%&gt;&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;a&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;li&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   8:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;ItemTemplate&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;   9:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;FooterTemplate&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;ul&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  11:  &lt;/span&gt;        &lt;span class="rem" style="color: rgb(0, 128, 0); "&gt;&lt;!-- Cached at &lt;%=DateTime.Now.ToString()%&gt; --&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  12:  &lt;/span&gt;    &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;FooterTemplate&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(244, 244, 244); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  13:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;asp:Repeater&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;span class="lnum" style="color: rgb(96, 96, 96); "&gt;  14:  &lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&lt;&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;cc1:RssDataSource&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;id&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="RssDataSource1"&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;runat&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="server"&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;url&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="http://feeds2.feedburner.com/benpowell"&lt;/span&gt; &lt;span class="attr" style="color: rgb(255, 0, 0); "&gt;MaxItems&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;="10"&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/&lt;/span&gt;&lt;span class="html" style="color: rgb(128, 0, 0); "&gt;cc1:RssDataSource&lt;/span&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Update: Well now this is only 6 steps, but who's counting..&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4128217179408195683?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-31T03:55:22.503-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/05/how-i-built-my-personal-website-in-10.html</feedburner:origLink></item><item><title>Yahoo, Microsoft and Google</title><link>http://feedproxy.google.com/~r/benpowell/~3/dDA2bxMLCCg/yahoo-microsoft-and-google.html</link><category>opinion</category><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-1556056993256287937</guid><description>Microsoft made the right move in backing off from the Yahoo deal. Yahoo are in a mess. Yahoo know they are disjointed and screwed, their Y!OS is proof enough of that. Until Yahoo can reassemble their offering into something cohesive, and reunite all that they have, Yahoo will still have the same problems it has now. Yahoo, also believed that Microsoft had undervalued them. I believe that the market quite aptly demonstrated that Microsoft overvalued them, otherwise Yahoo's share price wouldn't have collapsed 20% yesterday. The market sets the price Mr Yang, not you.&lt;br /&gt;
&lt;br /&gt;
Microsoft have similar problems. Not many people know where to find Microsoft's search engine, even though it is easier to type than both Google and Yahoo. It is simply &lt;a href="http://www.live.com/"&gt;live.com&lt;/a&gt;, but who would know that? Microsoft changes and rebrands their offering so often, the consumers have got completely lost, and given up on them. I don't believe it is for any other reason that live.com has such a dire market share.&lt;br /&gt;
&lt;br /&gt;
What Google does well, is simply that it delivers everything consistently, and makes it simple to use their tools. I have one Google account, and that account page shows we all the services I am using. It makes that easy. Yahoo has a multitude of web sites under its umbrella that look different and act different. Y!OS needs to fix this for starters.&lt;br /&gt;
&lt;br /&gt;
The search engine market isn't dead yet, but I for one am happy to see three players left in the market. I'm happy to use whichever service I feel is the best. I'm certainly not brand biased. I'm one of the floating voters Yahoo and Microsoft need to win over. Bring it on guys.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-1556056993256287937?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.347-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/05/yahoo-microsoft-and-google.html</feedburner:origLink></item><item><title>Facebook can't get their advertising to speak the right language</title><link>http://feedproxy.google.com/~r/benpowell/~3/UJ_cKntSP6c/facebook-cant-get-their-advertising-to.html</link><category>opinion</category><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-2674317739002863115</guid><description>Apparently &lt;a href="http://www.facebook.com/"&gt;Facebook&lt;/a&gt; has gone German. Not the clichéd hairy-armpitted-sun-lounger-thieving German, but the nice Deutsch speaking people that I'm so fond of.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.guardian.co.uk/"&gt;The Guardian&lt;/a&gt; picked up on this and ran a nice &lt;a href="http://blogs.guardian.co.uk/digitalcontent/2008/03/facebook_germany_get_anklopfen.html"&gt;little article&lt;/a&gt; on the subject, even touting a rather nice &lt;a href="http://blogs.guardian.co.uk/digitalcontent/images/deutsch3mar2008-tm.jpg"&gt;screenshot&lt;/a&gt;. However, if you check the provided screenshot of Facebook in German, you'll notice an error. The advertising is in English, UK focused and not in German.&lt;br /&gt;
&lt;br /&gt;
As with nearly all advertising online, the language of the ads you see are governed by &lt;a href="http://en.wikipedia.org/wiki/Geo_targeting"&gt;geo-targeting&lt;/a&gt; your &lt;a href="http://en.wikipedia.org/wiki/IP_address"&gt;IP address&lt;/a&gt;, and not by your &lt;a href="http://www.w3.org/International/questions/qa-lang-priorities"&gt;browser preferred language&lt;/a&gt;. Hence, if you live in &lt;a href="http://en.wikipedia.org/wiki/Cardiff"&gt;Cardiff&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Wales"&gt;Wales&lt;/a&gt; you get the English language ads even though you might be &lt;a href="http://en.wikipedia.org/wiki/Welsh_language"&gt;Welsh speaking&lt;/a&gt;. If you live in &lt;a href="http://en.wikipedia.org/wiki/Barcelona"&gt;Barcelona&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Spain"&gt;Spain&lt;/a&gt;, you get ads in Spanish even if you are a Catalan speaking &lt;a href="http://en.wikipedia.org/wiki/Catalonia"&gt;Catalonian&lt;/a&gt;. If you live in LA, USA, you'll get advertising in English, whether you are Spanish speaking or not. What I find most interesting about Facebook, is that they themselves run their own advertising platform (with some &lt;a href="http://advertising.microsoft.com/facebook?tab=overview"&gt;ads from Microsoft&lt;/a&gt; it would appear?), and Facebook actually asks you for your &lt;a href="http://www.facebook.com/editaccount.php?language"&gt;preferred language&lt;/a&gt; in your account settings. So what’s the problem?&lt;br /&gt;
&lt;br /&gt;
In the Facebook case it would seem that the developers have just made the same &lt;a href="http://www.readwriteweb.com/archives/facebook_and_the_myth_of_contexual_advertising.php"&gt;mistakes&lt;/a&gt; as all other ad-serving platform providers. In this Guardian example most Germans who live in the UK can speak English rather well. Imagine the &lt;a href="http://news.bbc.co.uk/2/hi/uk_news/6210358.stm"&gt;estimated 5.5 million Brits living abroad&lt;/a&gt; (that's roughly one in ten British people). A large majority of those 5.5 million Brits who are living in Spain are much less likely to respond to advertising in Spanish on Facebook, or any other website (including Google).&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/Online_advertising"&gt;Online Advertising&lt;/a&gt; is a funny business, run predominantly by a &lt;a href="http://en.wikipedia.org/wiki/Category:Advertising_and_Affiliate_Networks"&gt;few&lt;/a&gt; &lt;a href="http://publisher.yahoo.com/"&gt;very&lt;/a&gt; &lt;a href="http://www.google.com/adsense"&gt;big&lt;/a&gt; companies. These ad-serving providers deliver millions of advertising impressions, without fully optimizing the click-through results for those advertisers that pay them a lot of money. To give you a better idea of that, &lt;a href="http://www.guardian.co.uk/business/2007/mar/28/advertising.newmedia"&gt;11.4% of total advertising spend in the UK&lt;/a&gt; in 2006 was spent on internet advertising.&lt;br /&gt;
&lt;br /&gt;
The point here is that ad-serving companies are focused on the majority; Therefore, targeting those people who use the internet at home, in their home country, and speak the dominant language of that country.&lt;br /&gt;
&lt;br /&gt;
However, I believe that the minority are larger than the ad-servers have considered. For example, there are more &lt;a href="http://en.wikipedia.org/wiki/Catalan_language"&gt;Catalan&lt;/a&gt; speakers (9.1 million) in the world than speakers of &lt;a href="http://en.wikipedia.org/wiki/Norwegian_language"&gt;Norwegian&lt;/a&gt; (4.7 million). There are 45 million people living in America who do not speak English at home (and over &lt;a href="http://en.wikipedia.org/wiki/Hispanics_in_the_United_States"&gt;14% of the US population is Hispanic&lt;/a&gt;). In our increasingly shrinking and interconnected world, immigration and travel is growing steadily.&lt;br /&gt;
&lt;br /&gt;
Advertisers are forgetting some of their most profile targets, those businessmen with disposable cash. Whenever they travel abroad, they won't be seeing any ads targeting them correctly.&lt;br /&gt;
&lt;br /&gt;
The best example of how ad-servers have screwed up their technology, is that in the USA, 82% of the country speaks English as a first language. Hence the other 18% are being missed out in terms of effective, targeted advertising. Now, if I come to you, the advertiser, and say, "I can show your ad to a great many people here in the USA, but 18% probably won't understand it, because they don't speak English as a first language, hence can you make sure the ad isn't too high brow or witty", do you think you'd be happy with that?&lt;br /&gt;
&lt;br /&gt;
Whilst the advertisers remain blissfully unaware of this fact, the arrogant ad-serving platform providers will not be addressing the issue. If Yahoo really wanted to dent Google's market share of online advertising, they should consider fixing this before Google does and marketing this technology advantage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-2674317739002863115?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.350-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/03/facebook-cant-get-their-advertising-to.html</feedburner:origLink></item><item><title>Why we should all fight against a nationwide DNA database</title><link>http://feedproxy.google.com/~r/benpowell/~3/QWRH0W6vW7k/why-we-should-all-fight-against.html</link><category>opinion</category><category>politics</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-4147132101784555687</guid><description>&lt;a href="http://www.timesonline.co.uk/tol/comment/columnists/david_aaronovitch/"&gt;David Aaronovitch&lt;/a&gt; wrote in the Times today that we should not fear a nationwide DNA database and that we should "&lt;a href="http://www.timesonline.co.uk/tol/comment/columnists/david_aaronovitch/article3434198.ece"&gt;Ignore the paranoid fantasists&lt;/a&gt;". I cannot concur, and commented thus:&lt;br /&gt;
&lt;br /&gt;
A nationwide DNA database is great way to identify and discriminate against ethnic groups, should any future despotic British government wish to do so. Of course, considering our &lt;a href="http://news.bbc.co.uk/2/hi/uk_news/politics/446670.stm"&gt;superb&lt;/a&gt; &lt;a href="http://www.guardian.co.uk/world/2006/oct/28/bae.whitehall"&gt;history&lt;/a&gt; of &lt;a href="http://news.bbc.co.uk/2/hi/events/newsnight/1211849.stm"&gt;arms&lt;/a&gt; sales to &lt;a href="http://news.bbc.co.uk/2/hi/uk_news/7156645.stm"&gt;dictators&lt;/a&gt; and nut-jobs, this technology would be great for them too. I can think of a few states around the world where such a technology could be very welcomed, and allow much more effective and targeted genocide.&lt;br /&gt;
&lt;br /&gt;
Hitler would have certainly put this to "good use", should he have had access to it. Do not forget that much of today's genetic technology stems from the &lt;a href="http://en.wikipedia.org/wiki/Eugenics"&gt;ground work&lt;/a&gt; Nazi scientists started 60 years ago.&lt;br /&gt;
&lt;br /&gt;
Such technology is the absolute power &lt;a href="http://en.wikipedia.org/wiki/John_Dalberg-Acton%2C_1st_Baron_Acton"&gt;John Acton&lt;/a&gt; spoke about when he said, "Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men". &lt;a href="http://en.wikipedia.org/wiki/William_Pitt_the_Younger"&gt;William Pitt&lt;/a&gt; also noted, "Unlimited power is apt to corrupt the minds of those who possess it".&lt;br /&gt;
&lt;br /&gt;
Do not doubt it; A government that controls a nationwide DNA database has absolute power over its citizens.&lt;br /&gt;
&lt;br /&gt;
I have no problem with a DNA database that stores criminals DNA to help solve crimes both past and future. Yet all recordable crime suspects have their DNA taken and added to the existing database, whether proved guilty or not. That already quite adequately demonstrates the deep desire our authorities have for a national database of all citizens, and not just criminals. We, as a nation, are fast approaching that fine line between having enough rope, and hanging ourselves.&lt;br /&gt;
&lt;br /&gt;
To add a twist to a common phrase, I shall note the following for posterity, "That which is given, cannot be taken away". You can quote me on it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-4147132101784555687?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.354-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/02/why-we-should-all-fight-against.html</feedburner:origLink></item><item><title>Problems with Skype and the Cisco VPN Client</title><link>http://feedproxy.google.com/~r/benpowell/~3/WwvkqL530dc/problems-with-skype-and-cisco-vpn.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Wed, 21 Jan 2009 12:17:24 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-42336029467714985</guid><description>I have a variety of problems with Skype call quality, and calls being dropped, whilst connected to a Cisco VPN Concentrator using the Cisco VPN Client. I am using version 4.8.02.0010 of the client. I would be interested to hear from anyone else who has problems with this, and if you managed to find a solution, I'd love to hear about it.&lt;br /&gt;&lt;br /&gt;Ideally, Skype is allowed Local LAN access, and goes out via that interface, whilst other VPN traffic moves normally across the VPN. I understand this might require split tunneling? Other people have told me that they don't have these call problems, so I am wondering if it is a problem with my machine configuration.&lt;br /&gt;&lt;br /&gt;I am using a vanilla Linksys WRT54GS router, connected to a cable modem (with no configuration access). I have setup port forwarding to direct Skype into a desired port, and without VPN, those calls are crystal clear. Are there any other settings on the router that might improve VPN and Skype quality?&lt;br /&gt;&lt;br /&gt;Using the Cisco VPN Client's "Stateful Firewall" definitely causes problems, but that doesn't surprise me since Cisco bought in third party code to accomplish this task (Zone Alarm). What implications does switching this off actually have in terms of a security risk?&lt;br /&gt;&lt;br /&gt;So, what are the options? What is the best configuration? How can you fix the client without degrading security on the VPN (split tunneling is not recommended)? I welcome any comments.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UPDATE&lt;/span&gt;&lt;br /&gt;I have upgraded my Cisco VPN Client from 4.8 to 5.0.04. Although the problem still happens occasionally, it is much less frequent than it was. I hope this helps others with the same issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-42336029467714985?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-21T12:17:24.713-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/02/problems-with-skype-and-cisco-vpn.html</feedburner:origLink></item><item><title>Quick solution to solve date format problem in ASP - UK date format</title><link>http://feedproxy.google.com/~r/benpowell/~3/LnxppKUTOlo/quick-solution-to-solve-date-format.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-5704714058429282301</guid><description>It isn't often obvious, but when you create a date in ASP, the date format is based on the default user regional settings. You can change them via the Regional Settings control control option. More information is available on the &lt;a href="http://www.microsoft.com/globaldev/reference/win2k/setup/changeUI.mspx"&gt;Microsoft Support website&lt;/a&gt;. See note on "How to change the Default User UI Language". To use the DD/MM/YYYY format as is the case in the UK, select "English (United Kingdom" and then select the checkbox below that says "Apply all settings to the current user account and to the default user profile". Click "Ok" and reboot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-5704714058429282301?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.360-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/01/quick-solution-to-solve-date-format.html</feedburner:origLink></item><item><title>Handy Tip: How to split large Outlook PST files to make Outlook run faster (for free)</title><link>http://feedproxy.google.com/~r/benpowell/~3/ztjo8qNma0Q/handy-tip-how-to-split-large-outlook.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Wed, 21 Jan 2009 12:19:38 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-3725779846113613842</guid><description>&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;I get a lot of email. I run two profiles for Outlook; one for home and one for work. My work one is split into a working PST file and an archive PST file. I've started to find that the archive is just far to big. It means that my machine struggles to &lt;span id="SPELLING_ERROR_0"&gt;defragment&lt;/span&gt; the archive file, and today I came across a nice Microsoft support tip, that means you can split PST files up into smaller, more&lt;span id="SPELLING_ERROR_1"&gt;manageable&lt;/span&gt; file sizes. If you want to read how to do it, see this &lt;a href="http://support.microsoft.com/kb/932086"&gt;Microsoft support article (KB932086)&lt;/a&gt;. Now I can have Archives by year (e.g. &lt;span id="SPELLING_ERROR_2"&gt;WorkArchive&lt;/span&gt;2005, &lt;span id="SPELLING_ERROR_3"&gt;WorkArchive&lt;/span&gt;2006, etc). Nice!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once you have migrated all of your email out of the existing PST file, create a new one and set that to be your new default mail file. Outlook does not reduce the size of the existing PST when you move or delete items.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Update&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Please note that I will not publish any comments that appear to sell products that recover or repair PST files. I do not believe that these products solve the problem outlined here, whilst the knowledge base article supplied by Microsoft does, and more importantly does it for free. If you need to &lt;a href="http://office.microsoft.com/en-us/outlook/HA010563001033.aspx"&gt;repair a PST file&lt;/a&gt;, Outlook has a Repair PST facility.&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-3725779846113613842?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-21T12:19:38.475-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/01/handy-tip-how-to-split-large-outlook.html</feedburner:origLink></item><item><title>Windows Crash after MFT defrag</title><link>http://feedproxy.google.com/~r/benpowell/~3/W0s-E21XBWU/windows-crash.html</link><category>technology</category><author>noreply@blogger.com (Ben)</author><pubDate>Sun, 30 Nov 2008 10:30:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3399926169453259985.post-9148419690682610617</guid><description>I've recently been through a hard disk corruption, which has required me to repair my system using my original Dell Reinstallation CD. Although painful, I'm now back on track.&lt;br /&gt;
Some lessons learnt: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Never fuck with the MFT. Third party tools that say they can defrag the MFT should be left well alone. Note to Microsoft that they need to have some tool that optimizes the MFT, rather than a fresh reinstall.&lt;/li&gt;
&lt;li&gt;Always have a backup plan. A couple of DVDs with important data are ok, but full on disk backups are the way forward, backed up to something meaty and NASty. Remember the things you might need, such as personal documents and settings, product keys, database and code backups if you are a developer, etc.&lt;/li&gt;
&lt;li&gt;You can recover DTS jobs from a screwed SQL Server installation (they live in the MSDB data file).&lt;/li&gt;
&lt;li&gt;Rebuilds take days to complete, where your stress levels are raised and you aren't doing paid work!&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3399926169453259985-9148419690682610617?l=blog.benpowell.co.uk'/&gt;&lt;/div&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T10:30:06.364-08:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.benpowell.co.uk/2008/01/windows-crash.html</feedburner:origLink></item></channel></rss>
