<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Woodbase</title>
        <link>http://geekswithblogs.net/woodbase/Default.aspx</link>
        <description>Umbraco - CSS - jQuery - .Net - C#</description>
        <language>da-DK</language>
        <copyright>woodbase</copyright>
        <managingEditor>martin.skov.nielsen@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Woodbase</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/woodbase/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Custom config section&amp;ndash;both in general and for Umbraco</title>
            <link>http://geekswithblogs.net/woodbase/archive/2013/04/04/custom-config-sectionndashboth-in-general-and-for-umbraco.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2013/04/04/custom-config-sectionndashboth-in-general-and-for-umbraco.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2013/04/04/custom-config-sectionndashboth-in-general-and-for-umbraco.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;There’re several reasons why you’d want to minimize changes in your web.config and why you’d want to seperate configurations to independent files.&lt;/p&gt;  &lt;p&gt;First of all – and this is my personal opinion – you’d want to avoid bloating your files, both your classes and config files. It makes it easier to keep an overview of what goes on where and why…&lt;/p&gt;  &lt;p&gt;That’s why I like the way I’ve seen it done by for example Examine for Umbraco. They add a new &lt;font face="Courier New"&gt;Section &lt;/font&gt;&lt;font face="Verdana"&gt;in &lt;font face="Courier New"&gt;configSections&lt;/font&gt; node in the web.config with their own configurtion classes. This allows them to add an &lt;font face="Courier New"&gt;Examine&lt;/font&gt; node that again points to an “external” config file. But best shown with some example code, so lets get to it…&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;So here’s my solution looks:&lt;/p&gt;  &lt;p&gt;First I have my configuration classes (I’ve deviated from my own seperation principles here, and put two classes in one file)&lt;/p&gt;  &lt;h3&gt;&lt;strong&gt;woodbaseChimpMailer.cs&lt;/strong&gt; &lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;namespace WoodbaseMailer.BusinessLogic.Configuration       &lt;br /&gt;{        &lt;br /&gt;    public class WoodbaseChimpMailer : ConfigurationSection        &lt;br /&gt;    {        &lt;br /&gt;        public static WoodbaseChimpMailer GetConfig()        &lt;br /&gt;        {        &lt;br /&gt;          return ConfigurationManager.GetSection("WoodbaseChimpMailer") as WoodbaseChimpMailer;        &lt;br /&gt;        }        &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;[ConfigurationProperty("woodbaseMailer")]       &lt;br /&gt;        public WoodbaseMailer WoodbaseMailer        &lt;br /&gt;        {        &lt;br /&gt;            get        &lt;br /&gt;            {        &lt;br /&gt;                return (WoodbaseMailer)this["woodbaseMailer"];        &lt;br /&gt;            }        &lt;br /&gt;            set        &lt;br /&gt;            { this["woodbaseMailer"] = value; }        &lt;br /&gt;        }        &lt;br /&gt;    }&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;     &lt;br /&gt;&lt;font face="Courier New"&gt;public class WoodbaseMailer : ConfigurationElement       &lt;br /&gt;    {        &lt;br /&gt;        [ConfigurationProperty("mailChimpSecureKey", DefaultValue = "", IsRequired = true)]        &lt;br /&gt;        public string MailChimpSecureKey        &lt;br /&gt;        {        &lt;br /&gt;            get        &lt;br /&gt;            {        &lt;br /&gt;                return this["mailChimpSecureKey"] as string;        &lt;br /&gt;            }        &lt;br /&gt;        }        &lt;br /&gt;    }        &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Not much magic – just declaring a ConfigurationSection and a ConfigurationElement. The configSection has the element as a property, and the element has it’s own property and just one in my case.&lt;/p&gt;  &lt;h3&gt;web.config:&lt;/h3&gt;  &lt;p&gt;This is how it’s referenced in the web.config&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;  &amp;lt;configSections&amp;gt;     &lt;br /&gt;...      &lt;br /&gt;&amp;lt;section name="WoodbaseChimpMailer" type="WoodbaseMailer.BusinessLogic.Configuration.WoodbaseChimpMailer" requirePermission="false" /&amp;gt;      &lt;br /&gt;...      &lt;br /&gt;  &amp;lt;/configSections&amp;gt;      &lt;br /&gt;  ...      &lt;br /&gt;&amp;lt;WoodbaseChimpMailer configSource="config\WoodbaseChimpMailer.config" /&amp;gt;      &lt;br /&gt;...&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;woodbaseChimpMailer.config&lt;/h3&gt;  &lt;p&gt;&lt;strong&gt;     &lt;br /&gt;&lt;/strong&gt;Noteworthy in the next section is that the ConfigSection must be contained here again. The node from the web.config that points out the file, must be in the file.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;WoodbaseChimpMailer&amp;gt;     &lt;br /&gt;  &amp;lt;woodbaseMailer mailChimpSecureKey="*****************-us6" /&amp;gt;      &lt;br /&gt;&amp;lt;/WoodbaseChimpMailer&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and finaly loading it in the usercontrol:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;var mcKey = WoodbaseMailer.BusinessLogic.Configuration.WoodbaseChimpMailer.GetConfig().WoodbaseMailer.MailChimpSecureKey;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Conclusion&lt;/h3&gt;  &lt;p&gt;Once you figure out how to set it up. You’ll see that it really isn’t rocket.&lt;/p&gt;  &lt;p&gt;My issue now is only to make the entries in the web.config when installing, but that will be another post….&lt;/p&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/152615.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2013/04/04/custom-config-sectionndashboth-in-general-and-for-umbraco.aspx</guid>
            <pubDate>Thu, 04 Apr 2013 18:48:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/152615.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2013/04/04/custom-config-sectionndashboth-in-general-and-for-umbraco.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/152615.aspx</wfw:commentRss>
        </item>
        <item>
            <title>WoodbaseChimpMailer in place...</title>
            <category>Umbraco</category>
            <category>MailChimp</category>
            <category>WoodbaseChimpMailer</category>
            <category>c#</category>
            <link>http://geekswithblogs.net/woodbase/archive/2013/03/25/152511.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2013/03/25/152511.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2013/03/25/152511.aspx&lt;/a&gt;&lt;/p&gt;So here it is... The first release of WoodbaseChimpMailer. A simple integration module for sending newsletters via MailChimp from the Umbraco CMS backend. (A backoffice extension in Umbraco terms)&lt;br /&gt;&lt;br /&gt;The current release is ver. 0.8.01a. It includes:&lt;br /&gt;- a dictionary (default Umbraco functionality) allowing You to translate the texts in the extension.&lt;br /&gt;- selection of page to send&lt;br /&gt;- option to enter node ids or urls manually&lt;br /&gt;- sending test mails&lt;br /&gt;- creating new campaigns&lt;br /&gt;- view stats on sent campaigns&lt;br /&gt;&lt;br /&gt;More will come when I get new ideas or get some user inputs...&lt;br /&gt;&lt;br /&gt;So try it out if You'd like a newsletter module for Umbraco (at no cost other than installation time)&lt;br /&gt;&lt;a target="_blank" title="Download here" href="http://our.umbraco.org//projects/backoffice-extensions/woodbasechimpmailer"&gt;Download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/152511.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2013/03/25/152511.aspx</guid>
            <pubDate>Mon, 25 Mar 2013 21:16:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/152511.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2013/03/25/152511.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/152511.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Renaming columns - and location them in stored procedures</title>
            <category>SQL</category>
            <link>http://geekswithblogs.net/woodbase/archive/2012/08/21/renaming-columns---and-location-them-in-stored-procedures.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2012/08/21/renaming-columns---and-location-them-in-stored-procedures.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2012/08/21/renaming-columns---and-location-them-in-stored-procedures.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I had to rename in a column in my database - let's call it Customer.CellPhone. Now 'CellPhone' needs to be 'Mobile'. Not to hard using the build-in SP:&lt;/p&gt;&lt;p&gt;&lt;font size="2" face="Courier New"&gt;use WebShop&lt;br /&gt;EXEC sp_rename 'Customer.CellPhone', 'Mobile'&lt;br /&gt;go&lt;/font&gt;&lt;/p&gt;&lt;p&gt;But what if I used 'CellPhone' in a SP? Then it would fail now... But that's when I found this &lt;a href="http://www.codegain.com/tips/sqlservers/databaseadmin/how-to-find-column-name-within-stored-procedures-in-sql-server.aspx" target="_blank"&gt;solution&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;font size="2" face="Courier New"&gt;create proc spFindWordsInSP&lt;br /&gt;@word nvarchar(100)&lt;br /&gt;as&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;SELECT ROUTINE_NAME, ROUTINE_DEFINITION&lt;br /&gt;FROM INFORMATION_SCHEMA.ROUTINES&lt;br /&gt;WHERE ROUTINE_DEFINITION LIKE '%'+@word+'%'&lt;br /&gt;AND ROUTINE_TYPE='PROCEDURE'&lt;br /&gt;ORDER BY ROUTINE_NAME ASC&lt;br /&gt;END&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Calling &lt;font size="2" face="Courier New"&gt;EXEC spFindWordsInSP 'CellPhone'&lt;/font&gt; returns all the procedures, where the word You search for is located!&lt;/p&gt;&lt;p&gt;Follow this link to the original article by &lt;a title="Original poster" href="http://www.codegain.com/users/memberprofile.aspx?MemberID=2210" target="_blank"&gt;dotnetfish&lt;/a&gt;: &lt;a href="http://www.codegain.com/tips/sqlservers/databaseadmin/how-to-find-column-name-within-stored-procedures-in-sql-server.aspx"&gt;http://www.codegain.com/tips/sqlservers/databaseadmin/how-to-find-column-name-within-stored-procedures-in-sql-server.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;/font&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/150489.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2012/08/21/renaming-columns---and-location-them-in-stored-procedures.aspx</guid>
            <pubDate>Tue, 21 Aug 2012 06:27:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/150489.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2012/08/21/renaming-columns---and-location-them-in-stored-procedures.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/150489.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Close current tab for VS2010</title>
            <category>VS2010</category>
            <link>http://geekswithblogs.net/woodbase/archive/2012/08/14/close-current-tab-for-vs2010.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2012/08/14/close-current-tab-for-vs2010.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2012/08/14/close-current-tab-for-vs2010.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I'v just come across the keyboard shortcut for closing the current tab in VS2010. For a while I was annoyed the ctrl+w wouldn't close the tab as in IE...&lt;/p&gt;&lt;p&gt;For some reason the (default) shortcut for VS2010 is &lt;strong&gt;CTRL+F4 &lt;/strong&gt;- go figure :-/&lt;/p&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/150409.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2012/08/14/close-current-tab-for-vs2010.aspx</guid>
            <pubDate>Tue, 14 Aug 2012 05:23:14 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/150409.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2012/08/14/close-current-tab-for-vs2010.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/150409.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Graduate from &amp;Aring;rhus University</title>
            <link>http://geekswithblogs.net/woodbase/archive/2012/06/28/graduate-from-aringrhus-university.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2012/06/28/graduate-from-aringrhus-university.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2012/06/28/graduate-from-aringrhus-university.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Finally! I made it to the end! After studying from December 2007 until today (28th of June 2012) where I defended my master thesis on Behaviour Driven Development versus Test Driven Development. I finally graduated my master degree in computer science! I’m one happy g33k right now!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/150074.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2012/06/28/graduate-from-aringrhus-university.aspx</guid>
            <pubDate>Thu, 28 Jun 2012 13:22:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/150074.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2012/06/28/graduate-from-aringrhus-university.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/150074.aspx</wfw:commentRss>
        </item>
        <item>
            <title>IPhone track title</title>
            <link>http://geekswithblogs.net/woodbase/archive/2012/06/08/iphone-track-title.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2012/06/08/iphone-track-title.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2012/06/08/iphone-track-title.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;If you have an IPhone, you probably know that the name in the playlist comes from the “Title”-attribute instead of the filename. Usually that is not a problem.&lt;/p&gt;  &lt;p&gt;But when I plug my IPhone to the car stereo the tracks are sorted alphabetically by the “title”-attribute. That becomes a problem when You have an e-book where each chapter starts with “Track 01”.&lt;/p&gt;  &lt;p&gt;You can manually update this in the file properties (from the context menu in Windows Explorer), but doing so for +200 tracks – no thank you :)&lt;/p&gt;  &lt;p&gt;The FileInfo-class does not contain a property for this special audio file attribute. However the problem is easily solved using TagLib.&lt;/p&gt;  &lt;p&gt;The method below, not optimized in any way - just solving the problem at hand, will set the “title”-attribute to the file name.&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial"&gt;private static void UpdateTitleAttr(string dirPath, string fileFilter)     &lt;br /&gt;        {      &lt;br /&gt;            var files = System.IO.Directory.GetFiles(dirPath, fileFilter);      &lt;br /&gt;            &lt;br /&gt;            foreach (var file in files)      &lt;br /&gt;            {      &lt;br /&gt;                var f = TagLib.File.Create(file);      &lt;br /&gt;                var newTitle = f.Name.Substring(f.Name.LastIndexOf(@"\") + 1);      &lt;br /&gt;                f.Tag.Title = newTitle;      &lt;br /&gt;&lt;/font&gt;&lt;font face="Arial"&gt;                f.Save();    &lt;br /&gt;            }      &lt;br /&gt;        }&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;So now I can hear e-books while driving :P&lt;/p&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/149854.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2012/06/08/iphone-track-title.aspx</guid>
            <pubDate>Fri, 08 Jun 2012 07:40:54 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/149854.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2012/06/08/iphone-track-title.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/149854.aspx</wfw:commentRss>
        </item>
        <item>
            <title>CSS&amp;ndash;margin or padding</title>
            <category>CSS</category>
            <link>http://geekswithblogs.net/woodbase/archive/2012/06/05/cssndashmargin-or-padding.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2012/06/05/cssndashmargin-or-padding.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2012/06/05/cssndashmargin-or-padding.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I was beginning the implementation of a new design, and once again I found that my margin property on a div-tag, did not behave as I expected. So I decided to look for best practice when it comes to using margin or padding.&lt;/p&gt;  &lt;p&gt;What I found was this very short and concise description of the difference between the two:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;“Margin is on the outside of block elements while padding is on the inside.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;Use margin to separate the block from things outside it, padding to move the contents away from the edges of the block.”&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Verdana"&gt;So what is best practice? Well it depends on the context. In my case I should have used padding…&lt;/font&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/149817.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2012/06/05/cssndashmargin-or-padding.aspx</guid>
            <pubDate>Tue, 05 Jun 2012 12:08:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/149817.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2012/06/05/cssndashmargin-or-padding.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/149817.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Wee! First article :-)</title>
            <category>Dynamicweb CMS</category>
            <category>Youtube</category>
            <link>http://geekswithblogs.net/woodbase/archive/2010/08/26/wee-first-article.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2010/08/26/wee-first-article.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2010/08/26/wee-first-article.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Hi all!&lt;/p&gt;
&lt;p&gt;I just posted my first article here: http://geekswithblogs.net/woodbase/archive/2010/08/26/getting-started-embedding-video-in-dynamicweb-cms-again.aspx&lt;/p&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/141505.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2010/08/26/wee-first-article.aspx</guid>
            <pubDate>Thu, 26 Aug 2010 19:12:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/141505.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2010/08/26/wee-first-article.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/141505.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Testing web sites</title>
            <link>http://geekswithblogs.net/woodbase/archive/2009/10/06/testing.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2009/10/06/testing.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2009/10/06/testing.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Most people can agree that testing your software is a good thing. Most developers will agree that unit testing is a great thing to have.&lt;br /&gt;
&lt;br /&gt;
But how about testing your web site? Fair enough you can run unit tests on your code behind, but unit testing a GUI can be problematic.&lt;br /&gt;
&lt;br /&gt;
If you struggled with this problem, don't worry - you're not the first!&lt;br /&gt;
&lt;br /&gt;
I've recently become aware of Selenium. Selenium is a very powerfull tool for testing web applications. It gives you a lot of nice features to help you test your web site.&lt;br /&gt;
&lt;br /&gt;
There's even a plug-in for Firefox to let you record your test and then simply play them, whenever you need to test your site. The plugin can also translate the recorded test into ordinary unit tests, so that you can integrate it with your other unit tests.&lt;br /&gt;
&lt;br /&gt;
A simple case:&lt;br /&gt;
You wish to test if your page shows a specific link:&lt;br /&gt;
&lt;br /&gt;
Page markup:&lt;/p&gt;
&lt;pre&gt;&lt;font size="2"&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"Content-Type"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"text/html; charset=UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Sample Selenium Test Suite&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="nt"&gt;&amp;lt;table&lt;/span&gt; &lt;span class="na"&gt;cellpadding=&lt;/span&gt;&lt;span class="s"&gt;"1"&lt;/span&gt; &lt;span class="na"&gt;cellspacing=&lt;/span&gt;&lt;span class="s"&gt;"1"&lt;/span&gt; &lt;span class="na"&gt;border=&lt;/span&gt;&lt;span class="s"&gt;"1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;Test Cases for De Anza A-Z Directory Links&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"./a.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;A Links&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"./b.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;B Links&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"./c.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;C Links&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"./d.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;D Links&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/font&gt;

&lt;/pre&gt;
&lt;p&gt;Now in order to test this we need to write some test code:&lt;/p&gt;
&lt;p&gt;First we need to import NUnit and the Selenium framework:&lt;/p&gt;
&lt;pre&gt;
using NUnit.Framework;
using Selenium;&lt;/pre&gt;
&lt;p&gt;Then we need to set the class up to be a TestFixture&lt;/p&gt;
&lt;pre&gt;
[TestFixture]
public class MyLinkTester{&lt;/pre&gt;
&lt;pre&gt;
.......
&lt;/pre&gt;
&lt;pre&gt;
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Then we need our set up method in order to instanciate a selenium server instance.&lt;/p&gt;
&lt;pre&gt;
Selenium client;
StringBuilder verificationErrors;&lt;/pre&gt;
&lt;pre&gt;
[SetUp]
        public void TestSetup()
        {
            client = new DefaultSelenium("localhost", 4444, "*iexplore", 
                                                 "http://www.mydomain.org");
            client.Start();            
            verificationErrors = new StringBuilder();
        }

&lt;/pre&gt;
&lt;div&gt;The client line might need a little explanation. A DefaultSelenium requires a server to run. A Selenium server is provided with the Selenium RC (Remote Control) and needs to be started for the tests to run. &lt;br /&gt;
&lt;br /&gt;
Second parameter is the port number of the server default 4444.&lt;br /&gt;
&lt;br /&gt;
Third is the name of the browser you wish to test you web site on. Selenium supports a wide range of web browsers from Safari to IE.&lt;br /&gt;
&lt;br /&gt;
Final parameter is the location of you web site. Once it's started we're ready to run our tests.&lt;br /&gt;
&lt;br /&gt;
A simple test for the markup above could be:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
[Test]&lt;/pre&gt;
&lt;pre&gt;
        public void TestForLinkB()&lt;/pre&gt;
&lt;pre&gt;
        {&lt;/pre&gt;
&lt;pre&gt;
                client.Open("http://www.mydomain.org/Default.aspx");&lt;/pre&gt;
&lt;pre&gt;
                bool result = client.IsTextPresent("B Links");&lt;/pre&gt;
&lt;pre&gt;
                Assert.IsTrue(result, "Testing B Links");&lt;/pre&gt;
&lt;pre&gt;
        }

&lt;/pre&gt;
&lt;div&gt;This will open the Default.aspx page in a browser and test if the text "B Links" can be found.&lt;br /&gt;
&lt;br /&gt;
The outcome determens wether your test passes or fails.&lt;br /&gt;
&lt;br /&gt;
Now the only thing we need is to close it all:&lt;br /&gt;
&lt;pre&gt;
[TearDown]&lt;/pre&gt;
&lt;pre&gt;
        public void TestTearDown()&lt;/pre&gt;
&lt;pre&gt;
        {&lt;/pre&gt;
&lt;pre&gt;
            try&lt;/pre&gt;
&lt;pre&gt;
            {&lt;/pre&gt;
&lt;pre&gt;
                client.Close();&lt;/pre&gt;
&lt;pre&gt;
            }&lt;/pre&gt;
&lt;pre&gt;
            catch (Exception ex)&lt;/pre&gt;
&lt;pre&gt;
            {&lt;/pre&gt;
&lt;pre&gt;
                verificationErrors.AppendLine("Failed to close client\n" + ex.Message);&lt;/pre&gt;
&lt;pre&gt;
            }&lt;/pre&gt;
&lt;pre&gt;
            Assert.AreEqual("", verificationErrors.ToString(), 
                                         "Checking if any errors occured");&lt;/pre&gt;
&lt;pre&gt;
        }

&lt;/pre&gt;
&lt;div&gt;Now this was a very simple example. Selenium provides much more advanced features for testing if links take you to the right location or if input forms validate correctly and so on.&lt;br /&gt;
&lt;br /&gt;
Selenium can be your test person - once you've recorded or written your tests.&lt;br /&gt;
&lt;br /&gt;
For more information on Selenium please refer to their web site: &lt;a href="javascript:void(0);/*1254816330740*/"&gt;www.selenium.org&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt; &lt;img src="http://geekswithblogs.net/woodbase/aggbug/135324.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2009/10/06/testing.aspx</guid>
            <pubDate>Tue, 06 Oct 2009 00:37:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/135324.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2009/10/06/testing.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/135324.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Get to love your database or not...</title>
            <link>http://geekswithblogs.net/woodbase/archive/2009/06/02/get-to-love-your-database-or-not.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/woodbase/archive/2009/06/02/get-to-love-your-database-or-not.aspx'&gt;http://geekswithblogs.net/woodbase/archive/2009/06/02/get-to-love-your-database-or-not.aspx&lt;/a&gt;&lt;/p&gt;People always told me not to use MS Access for my web sites, however the closest they ever got to actually telling me why not, is something like:&lt;br /&gt;
 "It doesn't perform well if you have many user!" Well how many users is many I asked? This is where Einstein comes in to modern programming: "Everything is relative!"&lt;br /&gt;
 &lt;br /&gt;
When I asked how many is many (user on an Access database) no one ever came up with a number - it was everything from 10 to 10.000. &lt;br /&gt;
&lt;br /&gt;
So Access performance has never been an issue to me, since the solutions where I would use it might have 10 user a day! And even though it might always perform worse&lt;br /&gt;
then MS Sql or even MySql - the solutions don't need a lot of performance!&lt;br /&gt;
&lt;br /&gt;
So why not use Access? As a newbie to database programming it has a (in my opinion) a very nice GUI - even better now with MS Office 2007 - and it doesn't require a database server.&lt;br /&gt;
&lt;br /&gt;
Well after getting some experience with database programming, I've come in contact with some points where I prefer MS SQL. It's been a long time since I used MySql, so I'll let others to talk about that.&lt;br /&gt;
&lt;br /&gt;
Before I go on I would like to state that this is in no way a scientific or factual post! It is MY experience and look on things. If You have any comments or corrections please don't hesitate to leave a comment!&lt;br /&gt;
&lt;br /&gt;
OK then!&lt;br /&gt;
&lt;br /&gt;
First thing - User management: I've yet to figure out how that works in Access, but in MS SQL it is as natural a part of creating a database as to create a table.&lt;br /&gt;
&lt;br /&gt;
Second - Schemas: Can you even create schemas in Access? Since I started using schemas I've grown kind fond of it. Primarily because I get a better overview of my database, and again user management. Schemas let's you do something in this schema, but not in the other.&lt;br /&gt;
&lt;br /&gt;
Third (and final for now) - Stored procedures: You can create queries in Access and access them as stored procedures from your code - but beware(!) or you might end up where I was and what actually let me to write this post!&lt;br /&gt;
Parameter passing with Access can be a little tricky. I'm used to naming my parameters and passing them to the stored procedure - regardless of the order. BUT in Access naming is not worth anything. It is the order of your parameters that matters!&lt;br /&gt;
&lt;br /&gt;
I spend a lot of time debugging an update procedure that didn't update my database record, didn't throw an exception - actually it didn't seem to do anything. I was checking through values and rewritting a lot of code, since I was certain that the error had to be somewhere in my code.&lt;br /&gt;
&lt;br /&gt;
Finaly I had almost given up, when a colleague told me that Access look at the order of the parameters and not their names. So in my code I was actually looking for a record with the recordId = true, but it should have looked for recordId = 3 (or something)&lt;br /&gt;
&lt;br /&gt;
So that's my brief view on MS Access vs. MS SQL. I can't say (from this) that one is better than the other. I'm just saying that maybe there's a reason professionals use MS SQL and beginner usualy use Access... &lt;img src="http://geekswithblogs.net/woodbase/aggbug/132561.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>woodbase</dc:creator>
            <guid>http://geekswithblogs.net/woodbase/archive/2009/06/02/get-to-love-your-database-or-not.aspx</guid>
            <pubDate>Tue, 02 Jun 2009 01:20:42 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/woodbase/comments/132561.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/woodbase/archive/2009/06/02/get-to-love-your-database-or-not.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/woodbase/comments/commentRss/132561.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>