Archive for January, 2008

h1

My plans for 2008

January 13, 2008

Okay so this blog entry is about 14 days old now but hey, better late than never right?

Firstly, I would like to say while I had a rough mental idea of what I wanted accomplished in 2007 I had never actually thought about listing them out as such but in general I wanted to sell my car, pay off my credit card and save up a decent amount of money. Well I got two thirds of the way. I sold my car, I paid off my credit card and I saved up a bit but no where near the amount I had planned. Those were the financial side of things, the learning/studying side of things was to learn asp.net 3.5 and to learn . I am coming along nicely with both.

Okay enough about last year and more about this year. I will break up my goals into two parts ,short term (1 to 3 months) and long term (1 year to 3 years).

Short Term:

*Make a decision on investment properties or aMichelle’ss pattisserie franchise

*Get my MCTS

*Write at least one of my ideas in myone notee “Programs to write” tab

*Get my motor bike license

*Buy a motorbike.

 

Long Term:

*Learn Chinese mandarin well enough to the point where I can communicate up to 70% to my girlfriends parents

*Become financially ready to have buy a business (depending on my short term decision about business vs property)

*Take up a senior role at a bank or any very large company

*Buy a Tablet PC

 

I have a generally solid idea about how I will accomplish each of these but some of them require some more thought and in the interest of keeping any potential readers of this blog interested, I will not bore you of these details (unless requested ūüėČ )

Technorati Tags:

h1

Whinge: Windows Application Project templates vs Website Templates

January 6, 2008

<whinge>

I’m sure you’ve all noticed this but the ASP.NET website application template doesn’t let you run the website application and make on the fly code changes, save them and refresh the page and watch it take effect while the website template does. There are a few advantages and disadvantages of both the templates but from my¬†experience the trend with¬†more involved and complex websites the trend is to have an asp.net web application template. This can get tedious when it takes you 1 minute to hit play and¬†build the database project, data layer project,¬†LINQ classes etc and¬†finally the asp.net website, then another 2 minutes of¬†creating some dummy data to get to where you want in the application to finally¬†execute the piece of code for unit testing and bang, it fails because you forgot to check for null,¬†or what ever the case may be. With the Website templates it’s so much easier to just¬†make the changes, hit save, refresh and¬†wallah hey presto you’re done, rather than¬†pressing stop, waiting for another 15 seconds¬†for that to work (this is¬†on a¬†fast laptop mind you, and not even in¬†a virtual pc!¬†native!) then¬†make the changes and hit play and go through it again.¬†

I hope the asp.net program manager hears this whinge and includes that nice “save and compile per page” feature the website template has and include it into the website application template.

</whinge>

**Updated the next day **

 <embarrassed>

http://weblogs.asp.net/scottgu/archive/2006/05/08/445742.aspx

</embarrassed>

=]

h1

Copying URL’s and MSN in today’s world.

January 4, 2008

2 years ago, If you said to me as a fellow developer, You shouldn’t have a URL longer than 400 characters including the http:// I would have said to you, why? And politely requested that you put up a good enough reason for it. These days I would say,¬† “yes, you are right!” because I have found a “good enough” reason. MSN! With Instant Messaging being such a growing, common and popular method of communications these days I think it has already surpassed the point where you and I as a developer have to take into account people copy your URL as messages into the msn chat client screen to send to a friend rather than emailing the link.

ASP.NET 2.0 has provided many means of communicating data across pages like cross page posting and using the PreviousPageType directive to get strongly typed properties on the recieving aspx page. I realize that last bit wasn’t very clear so I will attempt to explain how we can avoid query strings using the cross page posting technique.

Let’s say you have¬†a page that accepts collects a substantial amount of personal data called PersonalDetails.aspx. Now consider that there is another page that accepts the data, processes and order and sends the details to securepay. Let this pages name be ProcessOrder.aspx. Within ProcessOrder.aspx’s directive you would add an attribute “PreviousPageType” and point it to PersonalDetails.aspx. Once this is done, make sure you expose all the controls on the PersonalDetails.aspx page with public properties. Finally (you may need to hit build for intellisense to kick in) you now have access to all the properties on the PersonalDetails page from the ProcessOrders page through the PreviousPage property.

Some of you old school asp dev guys may remember that this was easily accomplished by assignging the form’s action attribute to ProcessOrders.asp but this is not able to be done in .net so here is a very nice type-safe solution.

h1

Unit Test Method Names

January 4, 2008

 I would like to share some experience with unit test projects in Visual Studio. When you run the unit tests  the method name is what is displayed in the result screen.

Take a look at this screen shot of my current project and you will know what I’m talking about:

unit test method names

Because the test name is what the unit tests method name is, it makes sense to create very long and descriptive method names. You will not be using these method names in code or anything the very long names wont turn into a readability problem. You are just running these tests to see the beautiful green ticks.

Important Note: One of the Failed unit tests that aren’t visible in the screen shot threw an exception of “Failed¬†Can_Create_BackEnd_User¬†Tests¬†Test method OricaMiningServices.Tests.UserManagerTest.Can_Create_BackEnd_User threw exception:¬† System.NotSupportedException: Specified method is not supported..¬†” The exception is being thrown by the create method of the asp.net Membership class. The exception when stepping through the debugger is “Password is not strong enough” but the error message that appears in the test result window is the previous copy pasted error. Huh? What gives. When I step through the web application I can a password not strong enough error. When the unit test tries to access the method I get a different exception?! After 5 minutes of scratching my head it hit me. (Well, this is my guess anyway) There is no HTTP context for the unit test to run on, and there for none of the asp.net membership provider stuff can possibly work. For example, who are you authenticating? The Unit Test? It’s no me (Robert) that is running the application it’s visual studio’s unit test project. Anyway in my opinion this is a bug and should be fixed because it makes unit testing the whole user security layer slightly more complex.

h1

Holiday Studying…

January 1, 2008

I have decided to migrate to wordpress from blogger.com. In my opinion it’s layout is more logical and I feel that the wysiwyg is a bit more coder friendly. By that I mean you can copy paste code snippets into the code tab and not have as much html kung fu to do to keep the formatting from getting messed up.

Okay so now the real reason for this blog post. Today I have started my 1 week of holiday studying to get my MCTS: Technology Specialist: .NET Framework 2.0 Web Applications

I am 2 days late when looking at my personal project plan for my holidays. I should have started on sunday but I didn’t factor in enough slack and the schedule blew out a bit.

So anyway I was clicking through the previously mentioned link to try and purchase a book to study when something caught my eye… “Exam Insurance”. What? Exam Insurance? Hmm, sounds interesting. After some reading I find out that for some bizzare reason microsoft (for a limited time only) is giving people a free second try to their exams OR if you pass, 25% off your next exam! For FREE!!! I don’t know why but it’s true.

Here’s the link. I think the important thing here is to not let your self get into a mental trap by saying “If I fail I can try again, so it’s okay.” No, it’s not okay! Study hard and get it the first time so that you can get 25% off the next exam! That is the mental thinking I’m going to keep while studying for this exam.