<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-7916618003572713740</id><updated>2009-12-22T13:24:36.098-08:00</updated><title type='text'>Paul Maddox</title><subtitle type='html'>Software development team leader specialising in Microsoft Visual C# and C++ from the Northwest of England.

Experience working in a globalised business and team; understanding of enterprise business operation and practices; experience reporting to executive management

Skills in numerous languages and technologies; knowledge of formal software development lifecycle; experience of architecture design</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default?start-index=26&amp;max-results=25'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://paulmaddox.net/atom.xml'/><author><name>.</name><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>41</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-5806706935977551148</id><published>2009-09-01T03:49:00.000-07:00</published><updated>2009-09-01T04:12:00.109-07:00</updated><title type='text'>Twitter's Impending Doom: Apps and Games</title><content type='html'>Do you have that one annoying twitizen in your following list who talks jibberish all the time?  Do you wish you could politely filter some/all of their tweets without blocking them entirely?  Well, you can't.  But don't worry, things are going to get a whole lot worse.&lt;br /&gt;&lt;br /&gt;Twitter, by its very nature, treats all tweets equally.  That's great, under the assumption all tweets are created equally.  Unfortunately, apps like Twibbon, which trade a small service (adding a tiny graphic onto your profile pic) in exchange for an automated tweet from your account, change that, and they are only the tip of the iceberg.&lt;br /&gt;&lt;br /&gt;Soon I predict a whole ecosystem of Twitter apps and games vying for access to your precious account login, and it will result in one thing: massive increase in twitter noise.  (And you thought just having tweets your friends &lt;span style="font-weight: bold;"&gt;write&lt;/span&gt; is bad enough.)  App invitations, quiz results, and spam, will all become part of your daily twitter traffic.&lt;br /&gt;&lt;br /&gt;FaceBook apps and games, whether you love them or hate them, have two redeeming features: (1) you can block invitations for them, and (2) they are prohibited by FaceBook from forcing you to spam your friends (by, for instance, only allowing you access to the results of a quiz by spamming 10 of your friends).&lt;br /&gt;&lt;br /&gt;Pretty soon Twitter will have to start factoring in recipient-based filtering of tweets depending on the origin app, and I don't believe Twitter will be able to move fast enough, with such enormous tweet volumes, to stem the tide.  Without that, Twitter will quickly reach lowest-common-denominator proportions, and users will simply move on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-5806706935977551148?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/5806706935977551148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=5806706935977551148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5806706935977551148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5806706935977551148'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/09/twitters-impending-doom-apps-and-games.html' title='Twitter&apos;s Impending Doom: Apps and Games'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-6981830912946271572</id><published>2009-05-15T01:10:00.000-07:00</published><updated>2009-05-15T01:14:24.274-07:00</updated><title type='text'>What happens if a statement fails in a SQL Server stored procedure?</title><content type='html'>Answer: it carries on regardless!  In other words: if you want a stored proc to specifically stop upon error, test for it and return.&lt;br /&gt;&lt;br /&gt;Take this example:&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[PaulTest](&lt;br /&gt;     [Number] [int] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;&lt;br /&gt;CREATE PROCEDURE uspPaulTest AS&lt;br /&gt;BEGIN&lt;br /&gt;     INSERT INTO PaulTest (Number) VALUES (NULL) -- fails as NULL is invalid&lt;br /&gt;     INSERT INTO PaulTest (Number) VALUES(1) -- still gets processed as the query doesn't return&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;-- Let's test it:&lt;br /&gt;&lt;br /&gt;SELECT * FROM PaulTest&lt;br /&gt;&lt;br /&gt;EXEC uspPaulTest&lt;br /&gt;&lt;br /&gt;SELECT * FROM PaulTest&lt;br /&gt;&lt;br /&gt;-- Output:&lt;br /&gt;&lt;br /&gt;Number&lt;br /&gt;-----------&lt;br /&gt;(0 row(s) affected)&lt;br /&gt;&lt;br /&gt;Msg 515, Level 16, State 2, Procedure uspPaulTest, Line 10&lt;br /&gt;Cannot insert the value NULL into column 'Number', table 'Test.dbo.PaulTest'; column does not allow nulls. INSERT fails.&lt;br /&gt;The statement has been terminated.(1 row(s) affected)&lt;br /&gt;&lt;br /&gt;Number&lt;br /&gt;-----------&lt;br /&gt;1&lt;br /&gt;(1 row(s) affected)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-6981830912946271572?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/6981830912946271572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=6981830912946271572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/6981830912946271572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/6981830912946271572'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/05/what-happens-if-statement-fails-in-sql.html' title='What happens if a statement fails in a SQL Server stored procedure?'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-4742355357902292311</id><published>2009-04-22T10:19:00.001-07:00</published><updated>2009-04-22T10:19:58.682-07:00</updated><title type='text'>Visual Studio 2008 Errors</title><content type='html'>&lt;p&gt;Recently I had my VS 2008 RTM/RC installation go pear shaped. Overnight I stopped being able to create VC++ smartdevice projects with the error&lt;/p&gt; &lt;p&gt;“Creating Project '&amp;lt;ProjectName&amp;gt;'... project creation failed”&lt;/p&gt; &lt;p&gt;‘No problem’, I thought, ‘I’ll just run setup and do a repair’.&amp;nbsp; Unfortunately, I got an error with the setup of&lt;/p&gt; &lt;p&gt;“A problem has been encountered while loading the setup components. Canceling setup.”&lt;/p&gt; &lt;p&gt;Luckily I came across a &lt;a href="http://stackoverflow.com/questions/114332/visual-studio-setup-problem-a-problem-has-been-encountered-while-loading-the-s" target="_blank"&gt;post on StackOverflow&lt;/a&gt; (which is running turning out to be a useful resource from the author of &lt;a href="http://www.codinghorror.com" target="_blank"&gt;CodingHorror.com&lt;/a&gt;) pointing to a Microsoft tool to ‘force’ uninstall various Microsoft products, including Visual Studio:&lt;/p&gt; &lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/vstudio/bb968856.aspx" href="http://msdn.microsoft.com/en-us/vstudio/bb968856.aspx"&gt;http://msdn.microsoft.com/en-us/vstudio/bb968856.aspx&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://paulmaddox.net/writerpics/VisualStudio2008Errors_10188/image.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://paulmaddox.net/writerpics/VisualStudio2008Errors_10188/image_thumb.png" width="244" height="203"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-4742355357902292311?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/4742355357902292311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=4742355357902292311' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/4742355357902292311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/4742355357902292311'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/04/visual-studio-2008-errors.html' title='Visual Studio 2008 Errors'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-7627159016131473151</id><published>2009-04-21T12:44:00.001-07:00</published><updated>2009-04-21T12:44:50.342-07:00</updated><title type='text'>SQL Server 2008 Truncating Log File</title><content type='html'>&lt;p&gt;First find the filename labels for your database:  &lt;p&gt;&lt;strong&gt;select name from &amp;lt;DatabaseName&amp;gt;.dbo.sysfiles&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Next truncate the log:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;BACKUP LOG &amp;lt;DatabaseName&amp;gt; WITH TRUNCATE_ONLY&lt;/strong&gt;  &lt;p&gt;Finally shrink the database based on the log file in step 1:  &lt;p&gt;&lt;strong&gt;DBCC SHRINKFILE('NameAbove_log',2048)&lt;/strong&gt;  &lt;p&gt;2048 is the resultant file size in MB.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-7627159016131473151?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/7627159016131473151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=7627159016131473151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7627159016131473151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7627159016131473151'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/04/sql-server-2008-truncating-log-file.html' title='SQL Server 2008 Truncating Log File'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-1056595336563583275</id><published>2009-04-21T12:39:00.001-07:00</published><updated>2009-04-21T12:40:08.663-07:00</updated><title type='text'>Screen Real Estate Wastage</title><content type='html'>&lt;p&gt;Usually I’m a fan of Microsoft UI design, however having installed the latest version of Windows Live Messenger (or more accurately had it forced on me) I’m astounded by the amount of screen real estate squandered.&amp;nbsp; Clearly Microsoft have been buying too many 24” monitors.&amp;nbsp; After turning off as much of the unneeded fluff as possible I was still left with a window far larger than necessary, with no real benefit.&amp;nbsp; See below!&lt;/p&gt; &lt;p&gt;&lt;a href="http://paulmaddox.net/writerpics/ScreenRealEstateWastage_1216F/image.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://paulmaddox.net/writerpics/ScreenRealEstateWastage_1216F/image_thumb.png" width="226" height="244"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-1056595336563583275?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/1056595336563583275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=1056595336563583275' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1056595336563583275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1056595336563583275'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/04/screen-real-estate-wastage.html' title='Screen Real Estate Wastage'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-8824611157802674244</id><published>2009-04-21T05:07:00.000-07:00</published><updated>2009-05-15T07:38:19.010-07:00</updated><title type='text'>SQL Quiz of the Day</title><content type='html'>&lt;pre&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;Let’s say you have raw data as so:&lt;br /&gt;&lt;br /&gt;Id          Counter     Ident&lt;br /&gt;----------- ----------- -----&lt;br /&gt;1           1           A&lt;br /&gt;2           2           A&lt;br /&gt;3           1           A&lt;br /&gt;4           3           B&lt;br /&gt;5           3           B&lt;br /&gt;6           2           A&lt;br /&gt;7           1           A&lt;br /&gt;8           4           C&lt;br /&gt;9           2           C&lt;br /&gt;10          1           B&lt;br /&gt;11          1           B&lt;br /&gt;12          4           B&lt;br /&gt;&lt;br /&gt;And you want to group by the Ident field, but&lt;br /&gt;only contiguous blocks.  So you want to display&lt;br /&gt;the following:&lt;br /&gt;&lt;br /&gt;Counter     Ident&lt;br /&gt;----------- -----&lt;br /&gt;4           A&lt;br /&gt;6           B&lt;br /&gt;3           A&lt;br /&gt;6           C&lt;br /&gt;6           B&lt;br /&gt;&lt;br /&gt;Naturally one can’t use GROUP BY, because this would&lt;br /&gt;aggregate multiple A’s and B’s.&lt;br /&gt;&lt;br /&gt;Answers on a postcard!&lt;br /&gt;&lt;br /&gt;====&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[Test](&lt;br /&gt;        [Id] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;        [Counter] [int] NOT NULL,&lt;br /&gt;        [Ident] [varchar](3)&lt;br /&gt;         COLLATE Latin1_General_CI_AS NOT NULL,&lt;br /&gt; CONSTRAINT [PK_Test] PRIMARY KEY CLUSTERED&lt;br /&gt;(&lt;br /&gt;        [Id] ASC&lt;br /&gt;)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-8824611157802674244?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/8824611157802674244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=8824611157802674244' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/8824611157802674244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/8824611157802674244'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/04/sql-quiz-of-day.html' title='SQL Quiz of the Day'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-1071376617410098228</id><published>2009-04-20T13:27:00.000-07:00</published><updated>2009-04-20T13:29:44.435-07:00</updated><title type='text'>MaddogTCP network TCP/IP fuzzer</title><content type='html'>A while ago - almost three years in fact - I wrote a fuzzer to test network security of TCP/IP connections.  Due to one reason and another I never really released it, and despite being published on the net it was hidden from Google, and hence remained undiscovered.&lt;br /&gt;&lt;br /&gt;Looking back, it was a reasonably succinct little program that deserves the light of day, so here it is:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.calcaria.net/MaddogTCP/"&gt;http://www.calcaria.net/MaddogTCP/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-1071376617410098228?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/1071376617410098228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=1071376617410098228' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1071376617410098228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1071376617410098228'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/04/maddogtcp-network-tcpip-fuzzer.html' title='MaddogTCP network TCP/IP fuzzer'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-2467149185228896569</id><published>2009-04-08T13:16:00.000-07:00</published><updated>2009-05-15T07:39:59.667-07:00</updated><title type='text'>Generic type parser using Generics C# .NET</title><content type='html'>&lt;p&gt;Recently I had the need to safely parse multiple types from text ignoring exceptions. Microsoft did not implement an IParsable interface (despite requests) so I thought a solution was crying out for using generics.&lt;/p&gt;&lt;p&gt;The concept was simple: pass in an object of type T and call T.Parse.  The .NET compiler can check at compile time that the type supports Parse, right?  Unfortunately not.  Although generics allows constraints such as new(), it does not support arbitrary method constraints.&lt;/p&gt;&lt;p&gt;Lack of method constraints means attempting to call T.Parse won't work.  The result is having to use reflection to get around this.  Of course passing in a type that does not support Parse will  throw an exception, but by virtue of the design this will be handled and the type will return the default.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre&gt;private T SafeParseAndAssign&amp;lt;T&amp;gt;(string val)&lt;br /&gt;  where T : new()&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;  T ValOut = new T();&lt;br /&gt;&lt;br /&gt;  MethodInfo MI = ValOut.GetType().&lt;br /&gt;    GetMethod("Parse", new Type[] { val.GetType() });&lt;br /&gt;&lt;br /&gt;  return (T)MI.Invoke(ValOut, new object[] { val });&lt;br /&gt;}&lt;br /&gt;catch&lt;br /&gt;{&lt;br /&gt;  // swallow exception&lt;br /&gt;}&lt;br /&gt;return default(T);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-2467149185228896569?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/2467149185228896569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=2467149185228896569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2467149185228896569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2467149185228896569'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2009/04/generic-type-parser-using-generics-c.html' title='Generic type parser using Generics C# .NET'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-7131025347367091030</id><published>2008-12-30T07:55:00.000-08:00</published><updated>2008-12-30T08:00:58.748-08:00</updated><title type='text'>TinyHomepage - icon based favourites web app</title><content type='html'>My latest venture - an icon based favourites web app for mobile phones. Feedback gratefully received.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tinyhomepage.com/" target="_blank"&gt;TinyHomepage.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://tinyhomepage.com/TinyHomepageScreenshot.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://tinyhomepage.com/TinyHomepageScreenshotWM1.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://tinyhomepage.com/TinyHomepageScreenshotWM2.png" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-7131025347367091030?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/7131025347367091030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=7131025347367091030' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7131025347367091030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7131025347367091030'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/12/tinyhomepage-icon-based-favourites-web.html' title='TinyHomepage - icon based favourites web app'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-2870208767798022211</id><published>2008-12-23T04:30:00.000-08:00</published><updated>2008-12-23T04:35:18.326-08:00</updated><title type='text'>.NET GetTempFileName throws System.IO.IOException: The file exists</title><content type='html'>Getting an exception System.IO.IOException: The file exists when calling GetTempFileName?  I had this problem with a legacy app, despite the call working fine on nearly all of our systems.  It turns out the temp directory had been filling with temp files and eventually went bang.  From the MSDN:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;                     The &lt;span&gt;&lt;span class="selflink"&gt;GetTempFileName&lt;/span&gt;&lt;/span&gt; method will raise an &lt;span&gt;&lt;a id="ctl00_rs1_mainContentContainer_ctl32" onclick="javascript:Track('ctl00_rs1_mainContentContainer_cpe873965_c|ctl00_rs1_mainContentContainer_ctl32',this);" href="http://msdn.microsoft.com/en-us/library/system.io.ioexception.aspx"&gt;IOException&lt;/a&gt;&lt;/span&gt; if it is used to create more than 65535 files without deleting previous temporary files.                 &lt;/li&gt;&lt;li&gt;                     The &lt;span&gt;&lt;span class="selflink"&gt;GetTempFileName&lt;/span&gt;&lt;/span&gt; method will raise an &lt;span&gt;&lt;a id="ctl00_rs1_mainContentContainer_ctl33" onclick="javascript:Track('ctl00_rs1_mainContentContainer_cpe873965_c|ctl00_rs1_mainContentContainer_ctl33',this);" href="http://msdn.microsoft.com/en-us/library/system.io.ioexception.aspx"&gt;IOException&lt;/a&gt;&lt;/span&gt; if no unique temporary file name is available. To resolve this error, delete all unneeded temporary files.                 &lt;/li&gt;&lt;/ul&gt;Simple really.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-2870208767798022211?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/2870208767798022211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=2870208767798022211' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2870208767798022211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2870208767798022211'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/12/net-gettempfilename-throws.html' title='.NET GetTempFileName throws System.IO.IOException: The file exists'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-8562090274957855534</id><published>2008-11-17T13:21:00.000-08:00</published><updated>2008-11-17T13:23:30.819-08:00</updated><title type='text'>C# .NET Image Manipulation Resize + Grayscale + TIFF</title><content type='html'>Code from the last three posts can be downloaded formatted properly here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://paulmaddox.net/BlogFiles/ImageManipulation_Program.cs.txt"&gt;http://paulmaddox.net/BlogFiles/ImageManipulation_Program.cs.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note you need to add the System.Drawing reference in order to get it to work with a new project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-8562090274957855534?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/8562090274957855534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=8562090274957855534' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/8562090274957855534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/8562090274957855534'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/11/c-net-image-manipulation-resize.html' title='C# .NET Image Manipulation Resize + Grayscale + TIFF'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-5947735267855099559</id><published>2008-11-17T13:10:00.000-08:00</published><updated>2008-11-17T13:17:15.779-08:00</updated><title type='text'>Convert C# .NET Bitmap to grayscale</title><content type='html'>Here's some code to convert a Bitmap into grayscale using luminance.  Note, this does not change the color depth, rather it sets the pixels to grey within a 24bit color space.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;private static Bitmap ToGrayscale(Bitmap bmIn)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;Bitmap bmOut = new Bitmap(bmIn.Width, bmIn.Height, PixelFormat.Format24bppRgb);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;for (int x = 0; x &amp;lt; bmIn.Width; x++)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;for (int y = 0; y &amp;lt; bmIn.Height; y++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Color px = bmIn.GetPixel(x, y);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int luminance = (int)((0.3f * px.R) + (0.59 * px.G) + (0.11 * px.B));&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;bmOut.SetPixel(x, y, Color.FromArgb(luminance, luminance, luminance));&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;return bmOut;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-5947735267855099559?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/5947735267855099559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=5947735267855099559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5947735267855099559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5947735267855099559'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/11/convert-c-net-bitmap-to-grayscale.html' title='Convert C# .NET Bitmap to grayscale'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-7009836448997450306</id><published>2008-11-17T13:04:00.000-08:00</published><updated>2008-11-17T13:09:20.163-08:00</updated><title type='text'>C# .NET reading a bitmap, resizing / rescaling and saving as a TIFF</title><content type='html'>Here's some code to read in a bitmap and save a new bitmap at a quarter of the size.  Note. a boilerplate method is needed to get the encoder for the write format.  This makes it easy to change from TIFF to JPEG, PNG, etc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;// Load the bitmap from first argument filename&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Bitmap bmIn = new Bitmap(inputFilename);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;// Create a new bitmap from the first, scaling down as we go&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Bitmap bmOut = new Bitmap(bmIn, new Size(bmIn.Width/2, bmIn.Height/2));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;// Create an parameter set that we use to save the file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;EncoderParameters encParams = new EncoderParameters(3);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;// Set some parameters&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt; encParams.Param[0] = new EncoderParameter(Encoder.ColorDepth, 24L);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;encParams.Param[1] = new EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionNone);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;encParams.Param[2] = new EncoderParameter(Encoder.SaveFlag, (long)EncoderValue.MultiFrame);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;// Save bitmap to second argument filename&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;bmOut2.Save(outputFilename, GetEncoder(ImageFormat.Tiff), encParams);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;private static ImageCodecInfo GetEncoder(ImageFormat format)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   foreach (ImageCodecInfo codec in codecs)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;      if (codec.FormatID == format.Guid)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;      {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;         return codec;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;      }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   return null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-7009836448997450306?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/7009836448997450306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=7009836448997450306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7009836448997450306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7009836448997450306'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/11/c-net-reading-bitmap-resizing-rescaling.html' title='C# .NET reading a bitmap, resizing / rescaling and saving as a TIFF'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-1066021609459136135</id><published>2008-11-17T12:52:00.000-08:00</published><updated>2008-11-17T13:04:22.181-08:00</updated><title type='text'>Out of Memory / OutOfMemoryException on Graphics.FromImage with PixelFormat.Format16bppArgb1555 or PixelFormat.Format16bppGrayScale</title><content type='html'>If you have some code like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Bitmap bmp = new Bitmap(100,100, PixelFormat.Format16bppArgb1555);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Graphics gfx = Graphics.FromImage(bmp);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You will find you get an out of memory exception upon executing the code.  The reason?  .NET does not actually support &lt;span style="font-weight: bold;"&gt;Format16bppArgb1555 &lt;/span&gt;or &lt;span style="font-weight: bold;"&gt;PixelFormat.Format16bppGrayScale&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-1066021609459136135?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/1066021609459136135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=1066021609459136135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1066021609459136135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1066021609459136135'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/11/out-of-memory-outofmemoryexception-on.html' title='Out of Memory / OutOfMemoryException on Graphics.FromImage with PixelFormat.Format16bppArgb1555 or PixelFormat.Format16bppGrayScale'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-2022634613133491204</id><published>2008-11-05T04:45:00.000-08:00</published><updated>2008-12-23T04:50:31.901-08:00</updated><title type='text'>Visual Studio Errors</title><content type='html'>Thanks to Matt at Siemens for this one.&lt;br /&gt;&lt;br /&gt;"If you get similar errors to below then deleting everything in the C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Microsoft\VisualStudio\&lt;vs&gt;\ProjectAssemblies will solve this. Do not delete anything above this directory as you will lose all your toolbars and settings."&lt;br /&gt;&lt;br /&gt;Error   4       The "ResolveAssemblyReference" task failed unexpectedly.&lt;br /&gt;&lt;br /&gt;System.IO.IOException: Incorrect function.&lt;br /&gt;&lt;br /&gt;  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)&lt;br /&gt;&lt;br /&gt;  at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)&lt;br /&gt;&lt;br /&gt;  at System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption)&lt;br /&gt;&lt;br /&gt;  at System.IO.Directory.GetDirectories(String path, String searchPattern)&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.Tasks.SystemState.GetDirectories(String path, String pattern)&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.Tasks.ReferenceTable.FindSatellites(Reference reference)&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.Tasks.ReferenceTable.FindAssociatedFiles()&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure()&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure(DependentAssembly[] remappedAssembliesValue, ITaskItem[] referenceAssemblyFiles, ITaskItem[] referenceAssemblyNames, ArrayList exceptions)&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute(FileExists fileExists, DirectoryExists directoryExists, GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, GetLastWriteTime getLastWriteTime)&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute()&lt;br /&gt;&lt;br /&gt;  at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean&amp;amp; taskResult)   MyProject&lt;br /&gt;&lt;/vs&gt;&lt;/user&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-2022634613133491204?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/2022634613133491204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=2022634613133491204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2022634613133491204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2022634613133491204'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/11/visual-studio-errors.html' title='Visual Studio Errors'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-9048684480541405225</id><published>2008-08-28T12:13:00.000-07:00</published><updated>2008-08-28T12:28:17.660-07:00</updated><title type='text'>Encrypting ASP.NET web.config impersonation data</title><content type='html'>It always irked me that using impersonate for my ASP.NET web apps meant I had to expose the username and password in plain text.  Eg./&lt;br /&gt;&lt;br /&gt;&amp;lt;identity impersonate="true" username="BOB" password="NOTSOSECRET"&amp;gt;&lt;br /&gt;&lt;br /&gt;Luckily it irked someone at Microsoft too and they came out with a hotfix allowing the credentials to be stored in encrypted form in the registry.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/329290"&gt;http://support.microsoft.com/kb/329290&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-9048684480541405225?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/9048684480541405225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=9048684480541405225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/9048684480541405225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/9048684480541405225'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/08/encrypting-aspnet-webconfig.html' title='Encrypting ASP.NET web.config impersonation data'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-7519401520835294591</id><published>2008-05-30T07:01:00.001-07:00</published><updated>2008-05-30T07:06:22.436-07:00</updated><title type='text'>Microsoft Source Analysis</title><content type='html'>Microsoft have released their previously internal tool Source Analysis (aka StyleCop). This allows project- and file- level source code analysis checking it meets a whole raft of style rules developed by Microsoft. Some you will agree with, some you won't. The good news is you can turn off rules you don't like, the bad news is you cannot develop your own.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/sourceanalysis/archive/2008/05/23/announcing-the-release-of-microsoft-source-analysis.aspx"&gt;blogs.msdn.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-7519401520835294591?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/7519401520835294591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=7519401520835294591' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7519401520835294591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7519401520835294591'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/05/microsoft-source-analysis.html' title='Microsoft Source Analysis'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-7804261974498654557</id><published>2008-03-27T05:33:00.000-07:00</published><updated>2008-11-17T13:26:23.851-08:00</updated><title type='text'>Visual Studio 2008 IDE C# - UK Launch Notes</title><content type='html'>&lt;ul&gt;&lt;li&gt;VS08 allows seamless (re)targeting of apps to .NET 2.0, 3.0 and 3.5. This provides graceful upgrading of existing applications. Applications initially targeted for 3.x can also be targeted to .NET 2.0 as long as features of 3.x have not been used.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Properties have now been improved so the implementation of the get and set methods do not need to be provided if the default implementation is all that is required. Eg./&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;public string FirstName { get; set; }&lt;/pre&gt;This creates a hidden private member variable.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It is now possible to use braces to initialise multiple object properties:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Thread myThread = new Thread(MyThreadMethod)&lt;br /&gt;{&lt;br /&gt;Name="my thread",&lt;br /&gt;IsBackground=true&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Anonymous types can be created using the 'var' keyword. This is NOT weak typing - C# knows what the type is and it cannot change. Anonymous types are used in instances where the developer does not know the type, the primary instance of this being LINQ. Eg./&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var anonobject = new {Name = "Bob", Age = "40"};&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Anonymous methods are best described in detail here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/04/05/C20/#S5"&gt;http://msdn.microsoft.com/msdnmag/issues/04/05/C20/#S5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Partial methods can be used as a lightweight event system in cases where a large number of objects are held in memory (IE. LINQ) or where the method may be optionally implemented. Eg./&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;partial class MyClass&lt;br /&gt;{&lt;br /&gt;MyClass()&lt;br /&gt;{&lt;br /&gt; DisplayMessage(); // Only called if definition exists&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static partial DisplayMessage(); // Not implemented&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;partial class MyClass&lt;br /&gt;{&lt;br /&gt;static partial DisplayMessage() // Optional&lt;br /&gt;{&lt;br /&gt; Console.WriteLine("MyClass created");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Extension methods allow you to 'tack on' functionality to classes that you would otherwise not be able to due to inheritance being prevented (IE. .NET classes). Eg./&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;public static class MyExtensions&lt;br /&gt;{&lt;br /&gt;public static bool&lt;br /&gt;  IsValidEmailAddress(this string s) // "this" keyword&lt;br /&gt;{&lt;br /&gt; Regex regex =&lt;br /&gt;  new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$");&lt;br /&gt; return regex.IsMatch(s);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyClass&lt;br /&gt;{&lt;br /&gt;public void MyMethod()&lt;br /&gt;{&lt;br /&gt; string email = "paul@here.com";&lt;br /&gt;&lt;br /&gt; // Extension method used like a standard string method&lt;br /&gt; if (email.IsValidEmailAddress())&lt;br /&gt; {&lt;br /&gt;  Console.WriteLine("Valid!");&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&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/7916618003572713740-7804261974498654557?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/7804261974498654557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=7804261974498654557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7804261974498654557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/7804261974498654557'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/03/visual-studio-2008-ide-c-uk-launch.html' title='Visual Studio 2008 IDE C# - UK Launch Notes'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-5672689601356208363</id><published>2008-03-27T01:12:00.001-07:00</published><updated>2008-03-27T01:12:30.930-07:00</updated><title type='text'>C# Programming - Part 2 - Conditions</title><content type='html'>&lt;span style="font-size:180%;"&gt;Scope of work&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The work is split into two parts: the first is a training part where you are encouraged to use books and the Internet to help you complete the questions; the second is a test part where you should complete the questions with no external help. The pass score is 80%.&lt;br /&gt;&lt;br /&gt;1. if, else if, else&lt;br /&gt;&lt;br /&gt;2. Nested conditions&lt;br /&gt;&lt;br /&gt;3. &amp;amp;&amp;amp; and&lt;br /&gt;&lt;br /&gt;4. switch statement&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Training Questions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create console applications to:&lt;br /&gt;&lt;br /&gt;1. Read a number from the console (use ReadLine and Int32.Parse) and using if, else if and else output one of the following&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“The number is negative”&lt;br /&gt;&lt;br /&gt;“The number is lower than 100”&lt;br /&gt;&lt;br /&gt;“The number is 100 or above”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;2. Read two numbers from the console (one after the other) and by nesting if, else if and else output one of the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“The numbers are the same”&lt;br /&gt;&lt;br /&gt;“The numbers are not the same”&lt;br /&gt;&lt;br /&gt;– the first is lower than the second”&lt;br /&gt;&lt;br /&gt;“The numbers are not the same&lt;br /&gt;&lt;br /&gt;– the second is lower than the first”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;3. Read two numbers from the console (one after the other) and using if, else if and else along with &amp;amp;&amp;amp; output one of the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“The numbers are the same and are negative”&lt;br /&gt;&lt;br /&gt;“The numbers are the same and are positive”&lt;br /&gt;&lt;br /&gt;“The numbers are not the same”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;4. Read a number from the console (use ReadLine and Int32.Parse) and using a switch statement with cascading, and depending on an input 1-10 output one of the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“You entered an even number” or&lt;br /&gt;&lt;br /&gt;“You entered an odd number” or&lt;br /&gt;&lt;br /&gt;“You entered a number that is not 1-10”&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;5. Read a number from the console (use ReadLine and Int32.Parse) and by nesting if, else if and else output one of the following depending on what range the number is in, and whether it is divisible by 5:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“The number is 0-25 and is divisible by 5” or&lt;br /&gt;&lt;br /&gt;“The number is 0-25 and is not divisible by 5” or&lt;br /&gt;&lt;br /&gt;“The number is 26-50 and is divisible by 5” or&lt;br /&gt;&lt;br /&gt;“The number is 26-50 and is not divisible by 5” or&lt;br /&gt;&lt;br /&gt;“The number is 51-75 and is divisible by 5” or&lt;br /&gt;&lt;br /&gt;“The number is 51-75 and is not divisible by 5” or&lt;br /&gt;&lt;br /&gt;“The number is above 75”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;* Note. To check if a number is divisible by 5 you can use:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;(number % 5 == 0)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Test Questions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create console applications to:&lt;br /&gt;&lt;br /&gt;1. Read two numbers from the console (one after the other) and using if, else if and else output one of the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“The first number is lower than the second”&lt;br /&gt;&lt;br /&gt;“The second number is lower than the first”&lt;br /&gt;&lt;br /&gt;“The numbers are the same”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;2. Read two numbers from the console (one after the other) and by nesting if, else if and else output one of the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“Both numbers are negative”&lt;br /&gt;&lt;br /&gt;”Both numbers are positive”&lt;br /&gt;&lt;br /&gt;“The first number is positive, the second is negative”&lt;br /&gt;&lt;br /&gt;“The second number is positive, the first is negative”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;3. Read a letter from the console and by if, else if and else with (or) output one of the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“1” (if the letter is a, b or c)&lt;br /&gt;&lt;br /&gt;“2” (if the letter is d, e or f)&lt;br /&gt;&lt;br /&gt;“3” (if the letter is g, h or i)&lt;br /&gt;&lt;br /&gt;“4” (if the letter is j, k or l)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;4. Read a number from the console (use ReadLine and Int32.Parse) and using a switch statement with cascading, and depending on an input 1-9 output one of the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;“You entered the number one, two or three” or&lt;br /&gt;&lt;br /&gt;“You entered the number four, five or six” or&lt;br /&gt;&lt;br /&gt;“You entered the number seven, eight or nine” or&lt;br /&gt;&lt;br /&gt;“You entered a number that is not 1-9”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;5. Read three numbers from the console (one after the other) and by nesting if, else if and else sort the three numbers and output them in order:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example: input numbers: 2 5 and 1&lt;br /&gt;&lt;br /&gt;Output: 1, 2, 5&lt;br /&gt;&lt;br /&gt;Example: input numbers 100, 45, 30&lt;br /&gt;&lt;br /&gt;Output: 30, 45, 100&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-5672689601356208363?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/5672689601356208363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=5672689601356208363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5672689601356208363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5672689601356208363'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/03/c-programming-part-2-conditions.html' title='C# Programming - Part 2 - Conditions'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-5241595598996428115</id><published>2008-03-22T14:16:00.000-07:00</published><updated>2008-03-22T14:51:46.644-07:00</updated><title type='text'>C# Programming - Part 1 - Strings</title><content type='html'>As languages become more high-level it seems training material focuses more on dragging and dropping components and interacting with the IDE than teaching fundamentals like problem solving and creating logical procedural code. From this deficit I created a set of C# Programming tasks that concentrate on problem solving and creating logical code. This work is made available by kind approval of &lt;a href="http://www.siemens.com/" target="_blank"&gt;Siemens AG Industry&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;The tasks are provided free of charge but may NOT be copied or redistributed. The work is copyright and all rights are reserved.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Scope of work&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The work is split into two parts: the first is a training part where you are encouraged to use books and the Internet to help you complete the questions; the second is a test part where you should complete the questions with no external help. The pass score is 80%.&lt;br /&gt;&lt;br /&gt;1. Manipulating strings&lt;br /&gt;&lt;br /&gt;2. Substrings&lt;br /&gt;&lt;br /&gt;3. Upper/lower case&lt;br /&gt;&lt;br /&gt;4. Concatenation&lt;br /&gt;&lt;br /&gt;5. Locating a character in a string&lt;br /&gt;&lt;br /&gt;6. Replacing characters in a string&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Training Questions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create console applications to:&lt;br /&gt;&lt;br /&gt;1. Store your name as a string literal and output it to screen.&lt;br /&gt;&lt;br /&gt;2. Read a string from the console and output it in upper case.&lt;br /&gt;&lt;br /&gt;3. Read a name from the console (for example "Bob") and output the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;"Hello, Bob!"&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;4. Use the following string:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;string telephone = "0800 123 4567";&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;and replace the space with a - so that the output is:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;0800-123-4567&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;5. Use the following string:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;string alphabet = "abcdefghijklmnopqrstuvwxyz";&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;and output six letters starting from e, so that the output is:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;efghij&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;6. Create a simple CSV (comma separated values) parser capable of dealing with a string read in from the console. The string will always be in the format:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;firstvalue,secondvalue,thirdvalue&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Some example strings:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;"1,2,3"&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;"aa,bb,cc"&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;"apple,banana,pear"&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The output (using the third string as an example) should be output to screen as follows:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;First value: apple&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Second value: banana&lt;br /&gt;&lt;br /&gt;Third value: pear&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Test Questions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create console applications to:&lt;br /&gt;&lt;br /&gt;1. Store your name in a string and output it to the screen in upper case.&lt;br /&gt;&lt;br /&gt;2. Use the following strings:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;string countryCode = “44”;&lt;br /&gt;&lt;br /&gt;string areaCode = “1260”;&lt;br /&gt;&lt;br /&gt;string number = “123456”&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;along with string literals to output:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;+44-1260-123456&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;to screen&lt;br /&gt;&lt;br /&gt;3. Use a string as follows:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;string test = "siemens automation and drives";&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Replace every i character with a 1 and then output the string in upper case as so:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;S1EMENS AUTOMAT1ON AND DR1VES&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;4. Parse the following string:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;string surnameforename = "Siemens, Werner";&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;so the forename appears before the surname as follows:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;"Werner Siemens"&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;store it in a string variable and output it to screen.&lt;br /&gt;&lt;br /&gt;5. Read in a string from the console that will always be in the following format:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;+&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;This should be done using the substring function.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;12+4&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Where the example would output:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;First number: 12&lt;br /&gt;&lt;br /&gt;Second number: 4 &lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-5241595598996428115?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/5241595598996428115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=5241595598996428115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5241595598996428115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/5241595598996428115'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2008/03/c-programming-part-1.html' title='C# Programming - Part 1 - Strings'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-111754035338468806</id><published>2007-11-23T03:00:00.000-08:00</published><updated>2007-11-23T03:05:43.499-08:00</updated><title type='text'>Resizing a logical volume without unmounting in Linux</title><content type='html'>I had a problem where the logical volume our kickstart image created was too small, despite the disk having enough space. As you see it only allocated 4GB:&lt;br /&gt;&lt;pre&gt;[root@example sbin]# df&lt;br /&gt;Filesystem           1K-blocks      Used Available Use% Mounted on&lt;br /&gt;/dev/mapper/VolGroup00-LogVol00&lt;br /&gt;                       4128448   3716732    202004  95% /&lt;br /&gt;/dev/sda1               101086     18598     77269  20% /boot&lt;br /&gt;none                   8203424         0   8203424   0% /dev/shm&lt;/pre&gt;&lt;br /&gt;The logical volume can be resized by running lvm (as root) at the command prompt and the following command (For 50GB):&lt;br /&gt;&lt;pre&gt;lvm&amp;gt; lvresize -L 50G VolGroup00/LogVol00&lt;/pre&gt;&lt;br /&gt;The issue we then had is that this isn't committed! Exit lvm, and then type the following:&lt;br /&gt;&lt;pre&gt;ext2online /dev/mapper/VolGroup00-LogVol00&lt;/pre&gt;&lt;br /&gt;After a few minutes of processing you will now find you have a larger volume:&lt;br /&gt;&lt;pre&gt;[root@example sbin]# df&lt;br /&gt;Filesystem           1K-blocks      Used Available Use% Mounted on&lt;br /&gt;/dev/mapper/VolGroup00-LogVol00&lt;br /&gt;                      51606140   3721676  45263616   8% /&lt;br /&gt;/dev/sda1               101086     18598     77269  20% /boot&lt;br /&gt;none                   8203424         0   8203424   0% /dev/shm&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-111754035338468806?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/111754035338468806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=111754035338468806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/111754035338468806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/111754035338468806'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2007/11/resizing-logical-volume-without.html' title='Resizing a logical volume without unmounting in Linux'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-1750038344618637165</id><published>2007-08-07T14:55:00.001-07:00</published><updated>2007-08-07T14:55:37.197-07:00</updated><title type='text'>Syntax highlighting in colour in HTML</title><content type='html'>I recently found a fantastic feature in GVIM that allows me to syntax highlight my code and turns it into HTML. I'm sure there are tools out there specifically for this job, but given the convenience of having this built into my editor I couldn't help but mention it.&lt;br /&gt;&lt;br /&gt;You can get &lt;a href="http://www.vim.org/" target="_blank"&gt;GVIM from their website&lt;/a&gt;. When you've loaded your code up (and practically every language is supported), click the Syntax -&gt; Convert to HTML menu option.&lt;br /&gt;&lt;br /&gt;Here's a sample:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color:#6a5acd;"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#804040;"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#6a5acd;"&gt;(&lt;/span&gt;&lt;span style="color:#008080;"&gt;isset&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;(&lt;/span&gt;&lt;span style="color:#804040;"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;_GET&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;[&lt;/span&gt;'&lt;span style="color:#ff00ff;"&gt;album&lt;/span&gt;'&lt;span style="color:#6a5acd;"&gt;]))&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6a5acd;"&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#0000ff;"&gt;//echo 'gallery: ' . $_GET['album'];&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#804040;"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;d&lt;/span&gt; &lt;span style="color:#804040;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#008080;"&gt;dir&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;(&lt;/span&gt;'&lt;span style="color:#ff00ff;"&gt;Photos/&lt;/span&gt;' &lt;span style="color:#804040;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#804040;"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;_GET&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;[&lt;/span&gt;'&lt;span style="color:#ff00ff;"&gt;album&lt;/span&gt;'&lt;span style="color:#6a5acd;"&gt;])&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color:#804040;"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;bFirst&lt;/span&gt; &lt;span style="color:#804040;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;true&lt;/span&gt;;&lt;br /&gt;        &lt;span style="color:#804040;"&gt;&lt;b&gt;while&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#6a5acd;"&gt;(&lt;/span&gt; &lt;span style="color:#6a5acd;"&gt;(&lt;/span&gt;&lt;span style="color:#804040;"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;file&lt;/span&gt; &lt;span style="color:#804040;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#804040;"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;d&lt;/span&gt;&lt;span style="color:#2e8b57;"&gt;&lt;b&gt;-&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;read&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;())&lt;/span&gt; &lt;span style="color:#804040;"&gt;&lt;b&gt;!=&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#804040;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;false&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;)&lt;/span&gt;&lt;br /&gt;        &lt;span style="color:#6a5acd;"&gt;{&lt;/span&gt;&lt;br /&gt;                &lt;span style="color:#804040;"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#6a5acd;"&gt;(&lt;/span&gt;&lt;span style="color:#008080;"&gt;strpos&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;(&lt;/span&gt;&lt;span style="color:#804040;"&gt;&lt;b&gt;$&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#008080;"&gt;file&lt;/span&gt;, '&lt;span style="color:#ff00ff;"&gt;tb.jpg&lt;/span&gt;'&lt;span style="color:#6a5acd;"&gt;)&lt;/span&gt; &lt;span style="color:#804040;"&gt;&lt;b&gt;!=&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#804040;"&gt;&lt;b&gt;=&lt;/b&gt;&lt;/span&gt; &lt;span style="color:#ff00ff;"&gt;false&lt;/span&gt;&lt;span style="color:#6a5acd;"&gt;)&lt;/span&gt;&lt;br /&gt;                &lt;span style="color:#6a5acd;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-1750038344618637165?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/1750038344618637165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=1750038344618637165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1750038344618637165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/1750038344618637165'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2007/08/syntax-highlighting-in-colour-in-html.html' title='Syntax highlighting in colour in HTML'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-4382455995150297320</id><published>2007-08-02T15:02:00.000-07:00</published><updated>2007-08-07T15:03:24.675-07:00</updated><title type='text'>Search Engine Effectiveness - Practical Test</title><content type='html'>I've been wondering recently how effective alternate search engines are compared to Google. As a small test I decided to take 25 searches I had performed in the last week and search on Google, Yahoo and MSN Live Search to compare results.&lt;br /&gt;&lt;br /&gt;The following table shows the results. A score of zero means the target info was found on the search page itself (I didn't have to click through to the site). A number 1-10 is the position of the search result with the target info. A blank score means the target info was not found on the first page of links.&lt;br /&gt;&lt;br /&gt;The score is a sum of each search position negated from 11. As so:&lt;br /&gt;&lt;br /&gt;Target info on search page: 11-0 = 11&lt;br /&gt;Target info on page result 4: 11-4 = 7&lt;br /&gt;Target info on page result 10: 11-10 = 1&lt;br /&gt;Target info not found: 0&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.paulmaddox.net/Files/search.gif" /&gt;&lt;br /&gt;&lt;br /&gt;Conclusions:&lt;br /&gt;&lt;br /&gt;I was pretty suprised Google was so far ahead compared to Yahoo and MSN.  Google won because it was better at finding more niche searches, whereas Yahoo and MSN failed completely.  For more obvious searches all three performed flawlessly and may do for day-to-day searches.&lt;br /&gt;&lt;br /&gt;Google tended to either have the result first, or not at all.  Yahoo had a few useful results in the top five.  MSN had some results nearer the bottom of the top 10.  This is significant for MSN because much lower results seriously increases the time taken to find what you want.&lt;br /&gt;&lt;br /&gt;Some oddities included Yahoo having numerous entries that were highly irrelevant and MSN having a curious slant to open source results, particularly source code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-4382455995150297320?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/4382455995150297320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=4382455995150297320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/4382455995150297320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/4382455995150297320'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2007/08/search-engine-effectiveness-practical.html' title='Search Engine Effectiveness - Practical Test'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-2351784382475983655</id><published>2007-06-27T01:04:00.001-07:00</published><updated>2007-06-27T01:04:06.898-07:00</updated><title type='text'>Data set Pagination in MSSQL not MySQL!</title><content type='html'>&lt;p&gt;A poster by the name of Stripe-man has come up with a really simple way of paginating&amp;nbsp;data in SQL Server.&amp;nbsp; This has always been easy with MySQL using the LIMIT keyword, which is missing from SQL Server 2000.&amp;nbsp; (SQL Server 2005 added a row count similar to Oracle's, I believe.)&lt;/p&gt; &lt;p&gt;Here is the template:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; TOP&amp;nbsp;&lt;font color="#ff00ff"&gt;&amp;lt;PAGESIZE&amp;gt;&lt;/font&gt; * &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; task_log &lt;font color="#6a5acd"&gt;WHERE&lt;/font&gt; id &lt;font color="#804040"&gt;&lt;b&gt;NOT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;IN&lt;/b&gt;&lt;/font&gt; (&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; TOP&amp;nbsp;&lt;font color="#ff00ff"&gt;&amp;lt;PAGEOFFSET&amp;gt;&lt;/font&gt; id &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; task_log &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; ID) &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; ID &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So, for example, to display 10 items from 51-60 we would do:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; TOP &lt;font color="#ff00ff"&gt;10&lt;/font&gt; * &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; task_log &lt;font color="#6a5acd"&gt;WHERE&lt;/font&gt; id &lt;font color="#804040"&gt;&lt;b&gt;NOT&lt;/b&gt;&lt;/font&gt; &lt;font color="#804040"&gt;&lt;b&gt;IN&lt;/b&gt;&lt;/font&gt; (&lt;font color="#804040"&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/font&gt; TOP&amp;nbsp;&lt;font color="#ff00ff"&gt;50&lt;/font&gt; id &lt;font color="#6a5acd"&gt;FROM&lt;/font&gt; task_log &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; ID) &lt;font color="#6a5acd"&gt;ORDER&lt;/font&gt; &lt;font color="#6a5acd"&gt;BY&lt;/font&gt; ID &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;What this essentially says is: show me the top ten results that do not appear in the top fifty results.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.phpbuilder.com/board/showpost.php?p=10668964&amp;amp;postcount=13" target="_blank"&gt;PHPBuilder.com - View Single Post - Pagination with PHP / MsSQl not MySQL!&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-2351784382475983655?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/2351784382475983655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=2351784382475983655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2351784382475983655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/2351784382475983655'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2007/06/data-set-pagination-in-mssql-not-mysql.html' title='Data set Pagination in MSSQL not MySQL!'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7916618003572713740.post-8653132243948962125</id><published>2007-06-26T07:40:00.001-07:00</published><updated>2007-06-26T07:41:24.484-07:00</updated><title type='text'>Google adding new business customers at a rate of 1000 per day since it launched in February</title><content type='html'>&lt;p&gt;Google is making a pretty good progress getting business customers on to its mail platform, at a rate of 1000 per day.&amp;nbsp; However Rishi Chandra, product manager for Google Apps, is perhaps being a bit optimistic in terms of product development, which in the case of GMail we have seen relatively little of since its beta inception.&lt;/p&gt; &lt;p&gt;&lt;em&gt;"At the end of the day, Google Apps is about innovation," said Chandra. "You don't have to wait for a major release to get these features. It happens in real time. ... It's taking the speed and innovation of the consumer world and applying it to the business world."&lt;/em&gt; &lt;p&gt;The problem is, it seems we do have to wait.&amp;nbsp; Whilst Windows Live Mail and Yahoo Mail have seen dramatic improvements in the user interface, Google can be seen lagging behind with what cynics might even call a dated user experience. &lt;p&gt;As Information Week identifies: &lt;p&gt;&lt;em&gt;"Such relentless change has the potential to leave users lost, but Chandra insists Google's focus on the user experience means that new features are easy to understand and don't require new training."&lt;/em&gt; &lt;p&gt;Unfortunately to produce a high level of innovation along with consistency of user experience is not an easy task, despite Chandra's insistence, but only time will tell what emphasis Google chooses, or whether they will attempt the impossible.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.informationweek.com/management/showArticle.jhtml?articleID=200000609&amp;amp;cid=RSSfeed_TechWeb" target="_blank"&gt;Google Apps Opens Door To Migrating E-Mail Users -- Google Apps -- InformationWeek&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7916618003572713740-8653132243948962125?l=paulmaddox.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/8653132243948962125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7916618003572713740&amp;postID=8653132243948962125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/8653132243948962125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7916618003572713740/posts/default/8653132243948962125'/><link rel='alternate' type='text/html' href='http://paulmaddox.net/2007/06/google-adding-new-business-customers-at.html' title='Google adding new business customers at a rate of 1000 per day since it launched in February'/><author><name>.</name><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='16263108982613424569'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>