Archive for September, 2007

Its going to be a gaming weekend!

Posted in General
Post date: September 28, 2007

This weekend is going to be hectic!

Saturday:

0830 –> Check out wedding venue
1000 –> Next wedding venue
1300 –> Play Practice
1530 –> Rush home to catch the rest of the Chelsea vs Fulham game.

THEN

1800 –> Halo 3
2000 –> Fifa 2008
2200 –> Halo 3 til whatever time!

Sunday:

0830 –> get ready for rAge
0930 –> meet guy for a game exchange
1000 –> Arrive at rAge and bug CraigN for an hour or two. Buy Skate and StrangleHold
1330 –> Find time to play Halo 3, FIFA2008, Tiger Woods08, Skate and Stranglehold

Cool weekend hey?! ;) now somewhere inbetween all of this I need to carry on looking into LiNQ to SQL. Priorities people! Priorities! ;)

Blogged with Flock

LiNQ to SQL Introduction

Posted in Development, LiNQ
Post date: September 25, 2007

I finally got around to installing Visual Studio Orcas Beta 2 again. Recently I wanted to start looking into making use of O/RM (Object relational mapping) for a private project I was starting up at home.

First I tried to install NHibernate and use that but since I was too lazy to figure out exactly how it worked I moved onto ActiveRecord. That was going well till I actually tried to run the damn project. ActiveRecord for some reason would not connect to my database. After checking everything and posting on the ActiveRecord forums nothing was resolved. It is strange though as the connectionstring ActiveRecord was using was being used for a standard SqlConnection which worked perfectly.

I have no decided to move my focus from third party “plug-ins” to a Microsoft Beta. For those of you have no heard of or read about LINQ then take a seat and get ready.

LiNQ (Language Integrated Query)


The LINQ Project is a codename for a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with native language syntax for queries and provides class libraries to take advantage of these capabilities.

http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx


The LiNQ project covers several areas each naturally has a different function:

If you don’t have Orcas Beta 2 yet you can download it here : http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx. Now I realise its quite a massive download so if you want me to copy it to DVDs for you then drop me a mail here at “StevenMcd at StevenMcD.Net” and we’ll work something out to get these DVDs to you.

LiNQ to SQL

LiNQ to SQL is what I’m doing to be concentrating on first since this is basically and O/RM as previously stated. An amazing set of tutorials are available from ScottGu’s blog located here. His tutorials on LiNQ to SQL start here. His blog is wealth of information and if your aren’t subscribed to his RSS feed you are seriously missing out! Now what do I mean by saying that LiNQ is an O/RM? Imagine spending more time designing your classes to reflect your database structure? So take for an example an Employee Class. You would have an Employee Name, LastName, and probably ID Number. Imagine not having to write the general Select, Insert, Update and Delete SQL statements that makes our jobs so tedious?! Well imagine no more!

By constructing your class properly, and using a set of LiNQ attributes on your classes and properties you would not have to write these boring and tedious tasks! Obviously with more complex queries to the database you would still need to write your own Stored Procedures. In a future article I will cover this topic in more detail but for now I’ll end this off. I hope to have my next LiNQ article up by the weekend but due to other commitments it might only be early next week. For now, check out Scott’s blog and at the links listed below!

LINQ: .NET Language-Integrated Query
101 LiNQ Samples
LiNQ Wikipedia Entry

Blogged with Flock

VS2008 UserControl does not follow best Practice

Post date: September 20, 2007

Craig Nicholson found this bug while working with Visual Studio 2008 Beta 2 today. Help us get Microsoft to fix this before the Visual Studio 2008 release as this is extremely important. You vote here.

Why do I say this is extremely important? I have recently started delving into the world of Best Practice which I must has been an eye opening experience. When it comes to something like user controls, we as developers are generally lazy sods and we like using shortcuts. A company like Microsoft knows this and when it comes to built in controls they need to be leading the way in implementing Best Practice.

Best Practice is something a lot of developers know very little about and most of them aren’t too bothered by it. The general consensus is that if it works then its fine. This is a notion that we must get out of our heads! If developers at Microsoft are too lazy to follow things like this then why would the average developer out there care? So take the time and vote for this! head over to CraigN’s blog and show your support!

Blogged with Flock

Blog Rush

Posted in General
Post date: September 20, 2007

Thanks to ArnoNel’s Post I have discovered BlogRush. BlogRush is bascially a small “advert” widget that plugs into your site and will show links to related blog posts. It seems like quite a leke way of getting more hits on your website so I’m trying this out.

Blogged with Flock

The Facebook Language

Posted in General
Post date: September 18, 2007

I decided to have a look at the facebook API tonight and see whats available and what isn’t. I was shocked to find out that facebook literally have their own mark-up language now called FBML

Local entrepreneur, Tyler Reed, and I started a mini conversation via Facebook and we both agree that Facebook is starting to redefine the internet. Personally I know of quite a few people that couldn’t even use email that have now learnt to use it just so that they could register for facebook. There is actually a demand for FBML developers and for PHP developers that interface with facebook.

Obviously he couldn’t elaborate on the type of projects that he has been approached to do due to confidentialty clauses but it really got me thinking. How big is Facebook? MySpace was big for a while and has almost died as far as I am concerned. I don’t see people’s MySpace pages been “advertised” in their email signatures anymore, now its a facebook link!

Although Google are massive, they haven’t exactly developed their own language yet. Now I know some people might say that I’m comparing apples to pears here but think about it. Google is currently one of the largest if not the largest Web Company in the world. They have developed many web tools for use developers to use but not an entire mark-up language!

Going back to the API, I had a look at the Facebook Developer Toolkit which is quite nice. This toolkit contains Windows and Web Controls for interacting with facebook. Personally I was hoping to write a windows application to send messages to my facebook contacts but it doesn’t seem like the API caters for this. Admittedly I only skimmed over the API in about 2 hours or so, so there might be that functionality and I just haven’t found it yet. Also, the facebook API hasn’t even been out that long and they are already starting to deprecate certain API calls!

The one thing I hope that facebook does is squash the Social Networking Websites popping up all over the place. Its really annoying having some people on MySapce, some one LinkedIn and some on Facebook. Yahoo is now trying something called Mash.

Now Mash, from what I’ve read, is a combination of MySpace and Facebook. It is still in a BETA phase so its currently invite only thing by the looks of it. The Social Networking market is completely saturated, what would be nice would be some way to link across the networks. I’m sure many others have thought of this idea, but I’ll be honest, I’m way too busy to try do something like that. I’ll leave the amazing things like that to all you web entrepreneurs out there ;)

Blogged with Flock

Discipline

Posted in General
Post date: September 18, 2007

Recently I’ve been wondering what I can do to increase my knowledge and experience and it suddenly hit me. I just have to be more disciplined!

I currently spend 3-4 hours an evening playing on xbox live. Its a wonderful escape from the stress of the day BUT do I actually gain anything out of it? NO!

So now I’ve decided I’m going to limit myself to a maximum of 1 hours gaming per night. That’ll automatically open up an additional 2 - 3 hours an evening for reading and experiementing. I am currently reading the Best Practices book from BB&D and I’m learning so much!

I also had a look at some books that Armand recommended. Unforuntately all the books together come to just over R 2000! I’m sure it’ll be worth it in the end though, will try to buy one book a month and work through them all. The books on design and patterns will take more than a month though I’m sure.

Lastly, I hope you like the new Wordpress theme I’ve put one. A few guys told me that the black and blue was a bit hard on the eyes. I like this one but I’m still looking at a few others.

Blogged with Flock

How Company Policy got started

Posted in Humor
Post date: September 10, 2007

I got an email from an old colleague of mine and I just have to share this.

How Things Work In Real Life

Start with a
cage containing five monkeys. Inside the cage, hang a banana on a string and
place a set of stairs under it. Before long, a monkey will go to the stairs and
start to climb towards the banana. As soon as he touches the stairs, spray all
of the other monkeys with cold water.

After a while, another monkey
makes an attempt with the same result all the other monkeys are sprayed with
cold water. Pretty soon, when another monkey tries to climb the stairs, the
other monkeys will try to prevent it.

Now, put away the cold water.
Remove one monkey from the cage and replace it with a new one. The new monkey
sees the banana and wants to climb the stairs. To his surprise and horror, all
of the other monkeys attack him. After another attempt and attack, he knows that
if he tries to climb the stairs, he will be assaulted.

Next, remove
another of the original five monkeys and replace it with a new one. The newcomer
goes to the stairs and is attacked. The previous newcomer takes part in the
punishment with enthusiasm! Likewise, replace a third original monkey with a new
one, then a fourth, then the fifth. Every time the newest monkey takes to the
stairs, he is attacked.

Most of the monkeys that are beating him have no
idea why they were not permitted to climb the stairs or why they are
participating in the beating of the newest monkey.

After replacing all
the original monkeys, none of the remaining monkeys have ever been sprayed with
cold water. Nevertheless, no monkey ever again approaches the stairs to try for
the banana. Why not? Because as far as they know that’s the way it’s always been
done around here.

And that, my friends, is how a company policy begins.

Blogged with Flock

Shift in mentality

Post date: September 9, 2007

In all honesty, I’m still a beginner when it comes to developement. I only just have over 2 years experience. After attending an SaDev meeting recently and hearing about NHibernate for the first time I decided to check it out. Someone then suggested that I look into ActiveRecord instead. ActiveRecord is an O/R mapper that encapsulates the NHibernate framework and it seems much easier to work with. (More coming on this topic shortly)

While reading up on these things I started spotting certain things. I started reading up on different design models.

1) Database Driven Design
2) Domain Driven Design
3) CRUD (Create, Read, Update, Delete) Design
4) Extreme Programming
5) Agile Programming
6) Waterfall Model
7) Feature Driven Developement

Now to most of you with degrees, and honurs and whatever else, this is probably some standard ideas and methodologies but to me they are things I’ve never really looked into. I’ve now started spending more and more time reading on methodologies and design practices than actual developement articles! I’m starting to feel that maybe I should start looking into architecture even more. I think part of this also started last week when I received my best practice books from BB&D.

Sadly though, I registered on http://www.saarchitect.net/ and the forums there seem quite dead. I’m going to try contact some guys from the forums for help and more information on certain topics.

Blogged with Flock

Tears don’t fall Acoustic

Posted in music
Post date: September 5, 2007

I found this on YouTube this evening and wow. I’m a huge rock/metal fan and I love this song. The acoustic version of tears don’t fall is amazing!

Blogged with Flock

"using” statement in C#

Posted in Development
Post date: September 4, 2007

I stumbled across something *VERY* interesting tonight that I never knew about.

usually when connecting to a Database, I manually open, close and dispose all the connection which is infact not necessary! Enter the “using” statement for C#.

This is usually how I would write the block of code:

   1:  SqlConnection sqlConn =  null;
   2:  SqlCommand sqlCmd = null;
   3:   
   4:  try
   5:  {
   6:      sqlConn = new SqlConnection(connectionString);
   7:      sqlCmd = new SqlCommand(“Sql command Here”, sqlConn);
   8:      sqlConn.Open();
   9:      sqlCmd.ExecuteNonQuery();
  10:   
  11:      sqlConn.Close();
  12:  }
  13:  catch(Exception ex)
  14:  {
  15:      //handle exception
  16:  }
  17:  finally
  18:  {
  19:      if (sqlCmd != null )
  20:      {
  21:          sqlCmd .Dispose();
  22:      }
  23:      if (null != sqlConn )
  24:      {
  25:          sqlConn .Dispose();
  26:      }
  27:  }

Whereas all that is really needed is:

   1:  using (SqlConnection sqlConn = new SqlConnection(connectionString))
   2:  {
   3:      using (SqlCommand sqlCmd = new SqlCommand(commandString, sqlConn))
   4:      {
   5:          sqlConn.Open();
   6:          sqlCmd.ExecuteNonQuery();
   7:      }
   8:  }

The using statement automatically disposes what is being used once the code block has run. Might be old news to some but awesome news to me. Its the small things that are so cool to discover

Blogged with Flock