<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>Fran Hoey</title>
        <link>http://geekswithblogs.net/FranHoey/Default.aspx</link>
        <description> </description>
        <language>en-GB</language>
        <copyright>FranHoey</copyright>
        <managingEditor>fran@bluejumper.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Fran Hoey</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/FranHoey/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Non Coding Skills That Make You A Better Programmer</title>
            <category>career</category>
            <category>programming</category>
            <link>http://geekswithblogs.net/FranHoey/archive/2013/05/31/non-coding-skills-that-make-you-a-better-programmer.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/FranHoey/archive/2013/05/31/non-coding-skills-that-make-you-a-better-programmer.aspx'&gt;http://geekswithblogs.net/FranHoey/archive/2013/05/31/non-coding-skills-that-make-you-a-better-programmer.aspx&lt;/a&gt;&lt;/p&gt;&lt;span id="docs-internal-guid-31c03eb8-f9a1-7a24-2a6f-ca1e4a0f8245"&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-family: Arial; font-size: 15px; white-space: pre-wrap; line-height: 1.15;"&gt;Recently I was speaking with a junior programmer who was worried he would get stuck on the bottom rung and was planning a lot of training to ensure that didn’t happen. I wish I’d said it at the time, but technical skills are not the sole requirement of being a good programmer and advancing your career. &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;A programmer is a person, interacting with other people and that interaction is often were we fall down. As we are technically minded people we often overly focus on the technical aspects of our job. So much so, that as a group we are often stereotyped as unhelpful, smelly, moaners.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;So here are four skills that will make us better programmers, advance our careers and make work more enjoyable.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b&gt;Be Inquisitive&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;It’s easy to learn that if I x is broken and I alter y the problem is solved. A good programmer doesn’t learn by rote. Look one level deeper. What actually happens when I alter y? How does that relate to x. Find someone who knows and ask them, always try to deepen your understanding of the domain.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b&gt;Be Positive&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;We are natural analysts, when someone gives us a problem our analytical brain jumps to attention. As solutions come from problems our first thoughts are often problems. There is a tendency to find the problems and tell the users immediately to show that our analytical skills are superior. Suppress it, don’t stop at the problems, carry on and think through the solutions. Don't be a blocker.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b&gt;Be Helpful&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;Don’t hoard your code or systems. People will see you as a problem, and problems need solutions. If you do what you can to help other coders and business users you will become an invaluable knowledge base. Take it further, don’t let your role be a limit, if you can see a way you can help someone by a bit of knowledge you’ve learned or &lt;/span&gt;&lt;span style="font-family: Arial; font-size: 15px; line-height: 17px; white-space: pre-wrap;"&gt;a potential tweak in your code&lt;/span&gt;&lt;span style="font-family: Arial; font-size: 15px; white-space: pre-wrap; line-height: 1.15;"&gt;, offer it.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b&gt;Be Friendly&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;It’s obvious, but perhaps not so easy for us. I heard of a study that showed most techie people are on the autistic spectrum. Personally, I find introducing myself and small talk hard. We have to find a way through it, you don’t want to be known as what-his-name in IT. Being friendly means you will understand the problem you are coding better, business owners will be more open about what they are doing and what they need and take more time explaining it to you.&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;It's not about brown nosing, it's about being a human being that people are happy to know.&lt;/span&gt;&lt;/p&gt;&lt;p dir="ltr" style="line-height:1.15;margin-top:0pt;margin-bottom:0pt;"&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style="font-size: 15px; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt; &lt;img src="http://geekswithblogs.net/FranHoey/aggbug/153022.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>FranHoey</dc:creator>
            <guid>http://geekswithblogs.net/FranHoey/archive/2013/05/31/non-coding-skills-that-make-you-a-better-programmer.aspx</guid>
            <pubDate>Fri, 31 May 2013 08:18:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/FranHoey/comments/153022.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/FranHoey/archive/2013/05/31/non-coding-skills-that-make-you-a-better-programmer.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/FranHoey/comments/commentRss/153022.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How do you interview a programmer?</title>
            <category>programming</category>
            <category>interviews</category>
            <link>http://geekswithblogs.net/FranHoey/archive/2011/06/12/how-do-you-interview-a-programmer.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/FranHoey/archive/2011/06/12/how-do-you-interview-a-programmer.aspx'&gt;http://geekswithblogs.net/FranHoey/archive/2011/06/12/how-do-you-interview-a-programmer.aspx&lt;/a&gt;&lt;/p&gt;&lt;h3&gt;How do you know the programmer you are interviewing is the best of the bunch?&lt;/h3&gt;

&lt;p&gt;I'm talking about natural programming talent. The best programmers will pick up new technologies fast and be using them in an innovative, imaginative and logical way. They will write clean logical code that rarely fails and is easy, even pleasing, to follow.&lt;/p&gt;

&lt;p&gt;Most interview tests can be passed by reading a textbook and having a little experience. They don't weed out the truly good programmers from the ones who learn programming parrot fashion.&lt;/p&gt;
&lt;p&gt;For me, an interviewer needs to test the interviewees problem understanding and solving techniques as this underpins any good programmer. I think a good way of doing this is via logic games.&lt;/p&gt;

&lt;h4&gt;Blocked Car/Parking Lot&lt;/h4&gt;
&lt;p&gt;The user has to move other cars out of the way to get the yellow car out of the parking lot. This exercises the programming problem solving muscle. The user has to think about many factors as the levels get harder (e.g. I need to move the red car, but to do that I have to move the blue car, but I cant because....) &lt;/p&gt;
&lt;p&gt;Here is an example - &lt;a href="http://www.funatico.com/flash-games/yellow-out-2042.html" target="_blank"&gt; http://www.funatico.com/flash-games/yellow-out-2042.html&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;River Crossing Puzzle&lt;/h4&gt;
&lt;p&gt;A classic logic puzzle. The user has to get a group of people from one side of a river to the other, but the boat cant take them all at once. There are several rules restricting who the people are happy to be with that restrict the order they can be moved. This is the sort of problem common when programming. The core task is simple, but restrictions in the environment or business rules add complications.&lt;/p&gt;
&lt;p&gt;Here is an example - &lt;a href="http://www.smart-kit.com/s888/river-crossing-puzzle-hard/" target="_blank"&gt;http://www.smart-kit.com/s888/river-crossing-puzzle-hard&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I'm not suggesting this is the only test you should try, or even the best, but it at least tests something that is nearly always missed.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/FranHoey/aggbug/145820.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>FranHoey</dc:creator>
            <guid>http://geekswithblogs.net/FranHoey/archive/2011/06/12/how-do-you-interview-a-programmer.aspx</guid>
            <pubDate>Sun, 12 Jun 2011 07:26:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/FranHoey/comments/145820.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/FranHoey/archive/2011/06/12/how-do-you-interview-a-programmer.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/FranHoey/comments/commentRss/145820.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Compact Framework Visual Inheritance P/Invoke Designer Error</title>
            <category>Compact Framework</category>
            <category>.Net</category>
            <link>http://geekswithblogs.net/FranHoey/archive/2011/05/06/compact-framework-visual-inheritance-pinvoke-designer-error.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/FranHoey/archive/2011/05/06/compact-framework-visual-inheritance-pinvoke-designer-error.aspx'&gt;http://geekswithblogs.net/FranHoey/archive/2011/05/06/compact-framework-visual-inheritance-pinvoke-designer-error.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;This is a problem I've struggled and struggled with. No workaround or fix I found on the internet worked. In fact the work around I finally got to work incorporates a combination of fixes.&lt;/p&gt;

&lt;h2&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;The Form or User Control designer in Visual Studio displays the following error:&lt;/p&gt;
&lt;p style="font-family: Courier New"&gt;Visual inheritance is currently disabled because the base class references a device-specific component or contains P/Invoke&lt;/p&gt;

&lt;h2&gt;Cause&lt;/h2&gt;
&lt;p&gt;In case you didn't know P/Invoke is used to access un-managed code (com components). The designer has to compile and initialise your forms via the constructor to display them on the design pane, however, it is unable access un-managed code. If your forms inherit from a custom base form and the designer sees a P/Invoke anywhere in your code (even if it will never access it) it throws the above error. &lt;/p&gt;

&lt;p&gt;Two examples of this I've found are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The InputPanel Control&lt;/li&gt;
&lt;li&gt;The Sqlite .Net Libraries from PHX Software&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;See here for more - &lt;a href="http://msdn.microsoft.com/en-us/library/ms228851.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/ms228851.aspx&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Solution&lt;/h2&gt;
&lt;p&gt;As hinted at before there are two parts to the solution. First you need to tell the designer “Don't worry about it, I wont let you touch P/Invoke code”, then you need to live up to your promise.&lt;/p&gt;

&lt;h3&gt;Part 1&lt;/h3&gt;
&lt;p&gt;Mark your base form with &lt;span style="font-family: Courier New"&gt;DesktopCompatible(true)&lt;/span&gt; to calm the designer.&lt;/p&gt;

&lt;ol&gt;
    &lt;li&gt;In Solution Explorer, right click your form and select "View Class Diagram".&lt;/li&gt;
    &lt;li&gt;Select the class blob.&lt;/li&gt;
    &lt;li&gt;In Properties Pane click "..." button in the "Custom Attributes"&lt;/li&gt;
    &lt;li&gt;Paste &lt;span style="font-family: Courier New"&gt;DesktopCompatible(true)&lt;/span&gt; into the text area and click ok.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Part 2&lt;/h3&gt;
&lt;p&gt;Avoid code that references the P/Invoke code. There are many ways to do this but here is my simple method. &lt;/p&gt;
&lt;p&gt;The designer pane only initialises the forms it requires. When the program runs for real, the static class &lt;span style="font-family: Courier New"&gt;Program&lt;/span&gt; opens the first form and your code takes it from there. That little nugget of information makes my method work.&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Create a static class with a static property as such&lt;br /&gt;&lt;span style="font-family: Courier New"&gt;public static bool IsRuntime { get; set; }&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;In the &lt;span style="font-family: Courier New"&gt;Main&lt;/span&gt; function in the &lt;span style="font-family: Courier New"&gt;Program&lt;/span&gt; Class (Program.cs) set the above property to true before it opens the first form. This code is only run at runtime.&lt;/li&gt;
    &lt;li&gt;Use this property in &lt;span style="font-family: Courier New"&gt;if&lt;/span&gt; statements in your code to avoid P/Invoke calls when &lt;span style="font-family: Courier New"&gt;IsRuntime&lt;/span&gt; is false.&lt;br /&gt;&lt;img src="http://www.bluejumper.com/blogimages/pinvoke_runtimetest.gif" /&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;SQLite Solution&lt;/h2&gt;
&lt;p&gt;The above solution would work if you are using SQLite, but you would end up with very messy code as you are probably referencing your SQLite libraries quite often. This is a neater solution that keeps all the runtime checks in a central place.&lt;/p&gt;

&lt;h3&gt;Part 1&lt;/h3&gt;
&lt;p&gt;Same as above.&lt;/p&gt;

&lt;h3&gt;Part 2&lt;/h3&gt;
&lt;p&gt;Create a class that sets up your SQLite Objects and perform your checks there. Unfortunately I cant publish my class here as the source code belongs to my client, however, I can give you a few snippets to give you the general idea.&lt;/p&gt;

&lt;p&gt;1. Create an IsRuntime Property&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bluejumper.com/blogimages/pinvoke_runtimeprop.gif" /&gt;&lt;/p&gt;

&lt;p&gt;2. Get the calling code (e.g. Form) to pass in the IsRuntime flag&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bluejumper.com/blogimages/pinvoke_constructor.gif" /&gt;&lt;/p&gt;

&lt;p&gt;3. Use Interfaces to avoid any declaration of SQLite classes and only initialise SQLite classes when IsRuntime is true.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bluejumper.com/blogimages/pinvoke_getcommand.gif" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bluejumper.com/blogimages/pinvoke_execute.gif" /&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/FranHoey/aggbug/145213.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>FranHoey</dc:creator>
            <guid>http://geekswithblogs.net/FranHoey/archive/2011/05/06/compact-framework-visual-inheritance-pinvoke-designer-error.aspx</guid>
            <pubDate>Fri, 06 May 2011 11:36:57 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/FranHoey/comments/145213.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/FranHoey/archive/2011/05/06/compact-framework-visual-inheritance-pinvoke-designer-error.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/FranHoey/comments/commentRss/145213.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Connecting an MVC project to an SQL database</title>
            <category>ASP.NET</category>
            <category>MVC</category>
            <link>http://geekswithblogs.net/FranHoey/archive/2011/03/29/connecting-an-mvc-project-to-an-sql-database.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/FranHoey/archive/2011/03/29/connecting-an-mvc-project-to-an-sql-database.aspx'&gt;http://geekswithblogs.net/FranHoey/archive/2011/03/29/connecting-an-mvc-project-to-an-sql-database.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I'm just getting to grips with MVC linq etc etc and came across what looks like a common stumbling block. For the more experienced of you reading this please refrain from shouting "Dumbass" at me.&lt;/p&gt;

&lt;p&gt;All the tutorials are either Code First examples or they create the database from scratch in the App_Data directory. All well and good for a tutorial that need to be easily portable to the readers computer, but not very helpful when setting up a full scale MVC application.&lt;/p&gt;

&lt;p&gt;My first problem was my lack of knowledge of Linq to SQL. If you fall into this category have a look at this link - it's gold dust.&lt;/p&gt;

&lt;p&gt;http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx&lt;/p&gt;
 

&lt;p&gt;Finally, how to add an external SQL database to your MVC project:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Right click on "Models" folder, select "Add New Item"&lt;/li&gt;
  &lt;li&gt;Add a "Link to SQL Classes" item&lt;/li&gt;
  &lt;li&gt;Open your "Server Explorer" pane (if you cant see it try "View" on the menu bar and "Server Explorer"&lt;/li&gt;
  &lt;li&gt;Right click on "Data Connections" and select "Add Connection"&lt;/li&gt;
  &lt;li&gt;Follow the instructions.&lt;/li&gt;
  &lt;li&gt;Almost there....&lt;/li&gt;
  &lt;li&gt;Expand your newly added database to view the tables.&lt;/li&gt;
  &lt;li&gt;Drag the tables you want over to the main pane of the "Link to SQL Classes" item you added at the start.&lt;/li&gt;
  &lt;li&gt;Hey presto, you have a database context you can run Linq queries against.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Please bear in mind you will need to use the "Models" namespace to reference you database context objects.&lt;/p&gt;

&lt;p&gt;....&lt;/p&gt;

&lt;p&gt;And now back to highly sophisticated programming!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/FranHoey/aggbug/144574.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>FranHoey</dc:creator>
            <guid>http://geekswithblogs.net/FranHoey/archive/2011/03/29/connecting-an-mvc-project-to-an-sql-database.aspx</guid>
            <pubDate>Tue, 29 Mar 2011 21:14:53 GMT</pubDate>
            <comments>http://geekswithblogs.net/FranHoey/archive/2011/03/29/connecting-an-mvc-project-to-an-sql-database.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/FranHoey/comments/commentRss/144574.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>