Entries Tagged '.net' ↓

Project Hansen XNA - Family Game Development

XNALast weekend, I downloaded the XNA 2.0 toolkit and get the kids involved in Software Development.  What we’re going to do is create our own Video Game.  We were able to get a very basic game that we all worked on during the weekend to run on the XBOX 360.  It’s nothing special but it did get the kids very excited about creating our own Game.

I downloaded Blender, an excellent Open Source modeling tool.  Megan has been playing around with it and has begun to understand how to create some very simple models.

Maloree was been using Garageband on the iMac to create some very basic sound effects. (Probably something better out there, but she loves using Garageband and now she has a reason to use it.)

Mark’s been creating the game attributes and creating the script for the future game we plan on developing. He’s got about 30 sheets of drawings done and has his own Folder that he put them all in.  Pretty funny but it’s great to see him put so much passion into it.

This should be fun and it will get everyone involved and get them exposed to software development. For myself, this is a nice change from the mundane development for business that I’ve been now doing for over 15 years.  Now the weekends I can keep my skills up and also have the kids involved!

The great thing about XNA is that you use Visual Studio 2005 and C# to do the development in. Since I’ve been using C# since its inception I feel really comfortable working in the environment. Now it’s learning all about 3D development and how it really works.  This should be a really fun project for the weekends and I hope the kids will stay with it for at a little while!

 

Learn Ruby on Rails or learn MVC for ASP.NET?

Ruby on Rails has a released version 2.0 and I think based on some of the new and improved changes that it maybe the time to finally jump ship on ASP.NET and move over to Ruby on Rails.  
The one problem that I’ve had with RoR in the past is that it just does not scale.   I’m hoping that this gets resolved and makes my decision easier. My other choice is to continue using ASP.NET and see how their new MVC model is going to be like?
Is it better to use a framework like Ruby on Rails where MVC was designed from the beginning or as an afterthought to ASP.NET. ASP.NET is really started to feel bloated.
It’s reminding me of the days back in VB 6 and web development.  Visual Basic (before .net days) was not designed for the web but as an afterthought.  VB 6  you could develop web applications several ways.  You could just use ASP with vbscript, ASP with VB COM dlls, VB with COM Control running in MTS or VB 6 web classes. They all have their plus and minuses but again they were an after thought.   
 This is what I feel ASP.NET is becoming. You can do it the old way (Web Forms), AJAX way (which is bloated and I’d prefer to use jQuery or Protoype), and now MVC. I don’t know enough of it yet to make an educated decision but at this point should I just jump and move over to RoR instead? Decisions, decisions…. 

Microsoft’s answer to .net Open Source Projects: Hire the developers and stop the development!!

Am I the only one that has noticed a disturbing trend going on with the .net open source projects? Instead of them being supported by developer community, Microsoft is hiring the developers that created them like they are going out of style.

Sure, at the moment it looks like it could be a good thing, but in the end is the source code being owned by Microsoft or will they still be truly open source? 

It first started out out with Jon Lam with his Ruby port to .net.  Then Phil Haack with SubText and finally Rob Conery with SubSonic.

I guess I find it a bit ironic that these Open Source developers would have no problem drinking the kool-aid  so easily.  Don’t get me wrong I think its great that they are working at Microsoft, they need to make a living.

I put this way, its like a politician who’s a Democratic one day, is now running as a Republican because someone gave them some money. However they are still able to be continue their liberal agenda. Would this not seem a little strange to you?

These are definitely strange times we live in.

Why can’t the .net community be more like the Ruby on Rails community?

I’ve been reading a few blogs lately about how the .net community has let down some open source projects. The one that has comes to mind was nDoc. I’m guilty of this myself. However as I’ve become more aware of the importance of such projects I’ve realized the importance of either donating time or money to them to help them grow.
I had fallen into the trap that the .net community was only MSDN. Don’t get me wrong, this has been a wealth of information but I never felt I belonged to a community. The problem with having really only one voice in the community (Microsoft), some things important to the development community go largely ignored. Partly because Microsoft may feel that it’s not worth pursuing. I don’t blame them. I’ve met members of the tools team at Microsoft and I know they want to build the best development tools out there. However, they are only one company and they can’t build or think of everything. At the end of the day they need to make money!
Ruby on Rails Logo

The last 4 to 6 months, I’ve been getting my feet wet with Ruby on Rails. What I can tell you is that the Ruby on Rails community is thriving! Every day I find new information about the framework and how people are really excited about using it to build applications very quickly.  If there is something missing, many people have worked together to add it.

At the beginning I thought I was the only .net developer by day and a ruby on rails enthusiast by night. Wow was I wrong! I’m finding people online everday day that are doing the exact same thing!  It makes you stop to think why?  Is it because of the lack of tools in .net or is the lack of community that people are craving for!
I make my bread and butter with the .net framework but I’ve fallen in love with Ruby on Rails! Reading up on Rails has had me rethink of better ways of writing applications in C#.

On a positive note, I’ve seen that Microsoft has been paying attention to what’s going on in the rails community. (And other scripting languages) Features that make ruby so powerful have been adopted in the next version of C#. (LINQ is a perfect example of this)

Even if Ruby on Rails is the flavor of the month and eventually becomes yesterday’s news, it has had a positive effect of the future of the development languages. This has all been possible by a growing and supportive community like Ruby on Rails!

Visual Studio 2005 Tip #5 Using the Back/Forward mouse buttons to navigate

If you own a Microsoft Explorer mouse, or one that has the back/forward buttons you can navigate back and forth through your code.

For example if you need to see a defintion, right click and select “Go To Definition” from the popup menu.

You are taken to the definition.

Now how many times do you need to go back to where you we’re working?

Simply click the back button on your mouse! Viola! You are now back to where you were before!

If you need to go forward again and look at the defintion, click the the forward button on yor mouse

OK so that’s all great if you like using the mouse. So how would you do it with the keyboard?

Tip #5b: Using the Keyboard to navigate to a definition and back.

Have the cursor over the item you want to get the defintion for and click the F12 key. Sweet! But now how to we get back? Press Ctrl + - (minus key). If you want to back to the definition again press Ctrl + - (minus key) again! There you have it!

NOTE: These key strokes assume you have selected the Visual Studio.net keyboard layout.  I have not tested this with any of the other layouts.

To use the id or name attribute….

I’ve been writing some code that will do a form post from one website to another. (php to an asp.net site)

I created the form that will post the values stored in a couple of hidden input tags. I used the id attribute to name each input tag.

I run a test and it looks like it posted succesfully to the asp.net site. All is good. Well….Maybe not. The asp.net site shows that it received a post but there are no items in the Forms or Querystring collection.

I don’t even think to look at then php code because A) the php page displayed in the browser and B) it did the submit to the other site without throwing a javascript error. I’m thinking the problem is 100% on the asp.net 2.0 site that received the post.

I spend the next 1.5 hours trying everything I could think of but I still can’t get the what should have been posted to the page to show up.

After almost throwing my computer out the window, I go back and look at the PHP code. I then decide to use the name attribute instead of id. Guess what? It worked!

So some of you maybe wondering why I was using id attribute instead of name? It’s because I’ve gotten so used to using the id attribute for asp.net server controls that I’d almost forgotten about the name attribute!

So the moral of the story is to write plain html once in a while so you don’t make these kind of rookie mistakes! It’s always something so simple that can ruin a good day of coding!

Visual Studio 2005 Tip #4: Column Selecting Text

There are times when you need to select text in column mode instead of the tradtional row selection. Think of it like selecting a range of columns and rows in Excel.

For example, lets say I want to highlight all the strings from this section of constants because you want to put into a store procedure as input parameters.
The image “http://static.flickr.com/21/98461267_8d67f24660.jpg?v=0” cannot be displayed, because it contains errors.

Move the cursor to the beginning column you want to start highlighting from. Hold down the ALT key and then press and hold down the left mouse button. Then Highlight the code you want with the mouse or arrow keys. Once you have the code you need, simply copy ( + C), cut ( + X), paste ( + V) or delete.
The image “http://static.flickr.com/32/98461269_a31ccc6621.jpg?v=0” cannot be displayed, because it contains errors.
Now the clipboard has stored only the text that is highlighted above. The only thing now is remove the quotes and the semi-colons in when posting it in your stored procedure!

ALT + Left Mouse button = Column Text Selection

This feature also works in Visual Studio 2003. (It may work in 2001 but I have not used it in several years to remember)

technorati tags: ,

Visual Studio 2005 Tips #3: Using Surround with …

Another nice feature that will save on time and re-indenting your code is the Surrounds with snippets.  It works the same way as Code Snippets but the difference is that you highlight a section of code that you want to surround your code with.

This example I am going to surround a section of my code with a try catch.  The keyboard short cut is Ctrl + K and the S.

A popup combo box will appear asking you what type.  You can selec the you want to surround with.  Since I am going to use a try catch, I can hit the “T” key and then hit enter.

My code is now surrounded by a try/catch with the Exception object available for me to assign a variable to.

Visual Studio 2005 Tip#2:Writing your own Code Snippets

Now that you’ve seen the power of using Code Snippets, the only thing cooler is creating your very own code snippets!

The best tool that I’ve seen to help you create your own is one from Microsoft. It’s actually an open source project that if want to contribute to, you can.

You can download it from the MSDN website.

Visual Studio 2005 Tips #1: Code Snippets

One of the new features of Visual Studio 2005 is the ability to use Code Snippets.

At times coding can be very repeative and the 9 out of 10 times its the same thing that I am typing.  By using the snippets feature I can reduce this.

So How do you insert a Code Snippet?
The fastest way is from the keyboard Press the Ctrl key + K and then X.

A popup window will appear for you do select the available snippets.  There are several to choose from and you can even create your own!  For this tip I am going to do a Property snippet. Press ‘P’ on your keyboard or scroll through the list and select it.
Flickr Photo

Your code will now have the snippet template of the property item in place.  Very cool!  However the best is yet to come!  Notice that the private data member type is highlighted. 

Flickr Photo

Go ahead and change it to the type you need.  I am going to change mine to a string.
Flickr Photo

To change the name of the private data member simply hit the tab key.  Now the highlighted box is around the private data member name.  Type in the name you would normally give your private data members.
Flickr Photo

One really nice feature is the set and get values have been modified automatically to the same name as the private data member.

Finally tab one more time and enter your property Name.

Flickr Photo
Once you like what you see hit the enter key.  However if you want to change any of the values you made you can simply hit the tab key again and it cycle through them all. (You can’t do this after hit the enter key though)

To me this is one of my favorite features and I find myself constantly doing these key strokes when I am in Visual Studio 2003. One more reason to port everything over to .net 2.0!

Debugging Tips for Visual Studio 2005


For the last couple of weeks I have been deep in development on a new project using Visual Studio 2005. All I can say is “Thank you Microsoft!” The debugging tools alone are worth the upgrade. I can’t tell you how much more productive I have been using the new Visual Studio. Microsoft, I take back everything I have said bad about you (for aleast a couple of days, or until something drives me nuts about Windows XP). This is one awesome IDE.

There is a great site I found by a developer at Microsoft. He is presenting his top debugging tips. I greatly suggest if you are using Visual Studio 2005 that you read his tips. They have been extemely useful and I want to pass this on to all (3) of my readers! ;)

First Impressions of Windows Vista

For the last 3 or 4 days I have been playing heavily with the PDC bits. The one technology that I have installed on a couple of my computers is Windows Vista.

I have a Pentium 4 3.4 ghz desktop with a 2 160 gig drives setup as a raid array. I had no problems installing beta 1 of Longhorn. (Well a little,. I realized that I needed to create a floppy for the drivers of raid controller). Hmm….I soon realized that many of the features that were shown at the PDC were not on this build. So I looked into “The Goods” (6 DVDS) that were given to everyone at PDC and found an ISO image for PDC build of Windows Vista.

Cool! I created a new DVD from the ISO image and started installing it. Damn it! For some reason the Raid drivers don’t work. I even tried getting the raid drivers from the Intel site. Nope, it rejected those drivers also. After screaming at the display a few times and cursing at Microsoft, I gave up! For the night that is. It was 2 am and time to get some sleep.

In the morning,I ended up installing an old 60 gig ATA drive that I had in my box of old computer equipment. After getting all the boot sequences right and setting up the master and slave configuration with the dvd drive, I was able to get it installed.

I have a REALLY good graphics card with over 256 megs of RAM on it and the OS took advantage of the power big time. I noticed a huge performance over Windows XP when it came to rendering windows.

The other cool feature is that when you hover over the program on the task bar, you get a thumbnail of the actual application. To take it even further, its rendering real time of what the applciation is doing. So if you’re watching a video with Media Player, you will see the video playing in the thumbnail! Thumbnails have replaced the boring old tool tip! Very cool. What’s more impressive for Windows though is that its running pretty damn smooth. By pushing most of the work to the GPU, your CPU can take care of the more important tasks.

I have also installed the new WinFX SDK to the machine and am starting to play around with this new technlogy. The technology I find the most impresive is Avalon (WPF) It’s like taking Flash and putting it on steriods. I took a brief look at this in 2003 but decided to leave it alone because it was still too far away to get too involved with it. Now that were about 1 to 1.5 years away and its matured alot since then, I plan on giving it a serious look. The other positive value of this technology is that it will work on Windows XP. There is no way that Windows Vista will be on every desktop in the next 3 to 5 years. To be able to support it on Windows XP will allow people to adopt it much quicker knowing it will have a broader audience. These are good times again. Like one of the speakers said at PDC; “Programming is fun again!!”

PDC Day 3

Keynote

Microsoft is releasing a set of tools that will allow you to create Avalon files, 3d tool to manipulate avalon files and new HTML designer. The new HTML is 1000% better than frontpage and from what I’ve seen is going to blow dreamweaver away! Pretty damn cool.

They also showed off the new Sharepoint portal services and how cool Infopath is going to work with it. Again like my previous post, Office 12 is going to change the way we do things. 2003 was a good start with with server integration, but this version is amazing. It always takes Microsoft 2 to 3 times to get it right but when they do its great. Sharepoint is really going to be that awesome product I’ve wanted it to be. We use it now at work but when this is released its going to be used like it should be. I am really digging InfoPath as a tool.

C# 3.0

HOLY SHIT. Anders has been smoking the good stuff! The things he is coming up with are amazing for the language. He has invented a new query API for C# called Linq. You will be able to create queries to any datasource writing C# code. I can’t explain it right now but it looks and feels right. I’ve always hated doing object oriented programming and then having to do things differently when I connected to the database. They just did not feel right together. Now this is going to change!

Tons of other features to the language. The one thing is that it takes the power of scripting languages that have used late binding but make it work in a way that your actualy using early binding! The compiler will know what your talking about and do the error checking and validation that you would not get from a scripting language. And to makes things even better, intellisense works! It’s totally wacky but I see it being the future of programming! I got a white paper from them on this and I plan to play around with this a bit and post what I find.

OK I gotta run. More tomorrow!

PDC, Day 2 Post KeyNote

Sorry for this being late. I had so much to see this day that I did not get much time to get onto a computer and post this.

They keynote was GREAT!

Couple of things:

1) Microsoft has been paying attention to what Apple has been up to. Since PDC 2003, when they first introduced Longhorn, the OS has gone through an other make over. Many things that were introduced in 10.3 and 10.4 of OS X are now in Vista. And they have now taken it to the next level. This is a good thing. It only makes the OS better for Microsoft and Apple. Now I can’t wait to see what Apple is going to do to leap frog Vista. We still have a year to go before they release this, so who knows!

2) Office 12 will be by far the best Office ever released. I’ve never been excited over an Office release, but this one is amazing! Menus are going away. Smart toolbars from the menu! Hard to explain but its going to change the way you use Office forever.

3) Avalon and Indigo are really going to make it! When they showed this stuff in 2003, I was blown away. It’s now 2 year later and its only gotten better and will have a future. Compared to what they showed us in 2001 (.net Services), I really had no faith back when I saw it because at the time it seemed to radical for Microsoft to pull off. However, 2 years was good because they figured out alot of the problems I saw back then and made it into a solild technology that I will now start learning.

4) The new Atlas components are awesome. It’s the new framework for creating AJAX applications. They even showed it working in Firefox and Safari!! Kudos to Microsoft for making sure it works with all browsers that support XMLHTTP!

3) I’m really excited about Microsoft again and they have restored my faith!

PDC, Day 2 Pre Keynote

I’m here at 7:30 AM waiting for the keynote. The breakfast was much better than yesterday. They also surprised me opening up another section for people to eat. (The other side of the hall). So I am wrong, there are more people here than I thought. I’ve based this on in the past by the size of the eating area. It has to hold everyone at one time. Good I have hope again for the industry.

It should be interesting on what they are going to show at the keynote. Based on conversations at our pre conference session yesterday, there was alot of things in Office 12 that they could not talk about until after the keynote. I have a feeling based on my questions about Avalon, they are intergrating it into Office 12. It also seems that Sharepoint will play an even bigger role with the servers and the office products. I like Sharepoint, but it still has a long way to go to being an awesome product.

Time will tell!!

BTW I am writing this blog in IE 7.0 on Windows Vista in the labs. I am not impressed by how SLOWWWWW the browser is. Even typing this blog, its having a hard time keeping up with my typing. But then again this could be a cytrix version of the OS. Did I ever tell you how much I think Cytrix sucks! ;)

PDC Day 1, Lunch Time

Well its lunch time and I have to say the food is not what it used to be. Sure it was good but they served us salad. It was a really good salad and I am not complaining because I have been trying to watch what I eat. So in a way it was good because the temptation was not there.

I can’t get over the fact on really how small this PDC is. Over half the convention center is not being used. They used to have three main halls and now they are down to two. Also I would say they are using half as many rooms for the sesssions. Hopefully less means more!

Also if it were not for the Europeans there would be no PDC. It seems like over 70% of the conversations that I have heard are in German, French, Swedish or any of the other languages of Northern Europe. The other who are talking English have a huge accent. Its great to seem them here but I have to wonder of the state of developers here in the US. PDC has always had huge Euro presence, but with half the attendees as normal, its much more noticable.

The pre conference session I have been today as been on the VSTO. This is the Visual Studio Tool for Office. Its pretty impressive what you can do with .net and Office. The VSTO is much more extensive than the Office Interop for .net. The 2005 version using .net 2.0 allows you to control more of the application. 2003 was focused highly on the office document model. It’s an all day session and I really like these because you can get into things in much greater detail. The actual developers are here and are giving really good details on how it actually works. This helps me because then I get my hands on it more when I know what’s actually going on behind the black box.

Session starts in 5 mins so I am heading there now. The good thing with it being so small is that I don’t have to trek half way across the convention center!

.net sure feels like Cocoa

I’ve been spending a lot of free time learning to program in Cocoa. Cocoa is “THE” language to program on the Mac. The more I review its object model, I feel like I am looking at the Microsoft.net framework. However, how you create apps is much different. It has a better RAD feel then that of Microsoft.net.

Cocoa syntax is based on Objective-C which has been around since the NeXT computer. In fact all the key classes of Cocoa have the prefix of NS which stands for NeXT Step.

I am having a lot of fun programming again. Compared to Windows development, it’s a whole different way then I am used to. The feeling is what I had when made the switch from the Amiga to Windows and started programming in Visual Basic 1.0.

The other language I’ve been trying out a little bit is Ruby! A very interesting language to say the least! I really hope this language catches on. It feels much cleaner than Perl. With languages like Ruby gaining in popularity, it forces companies like Microsoft to improve upon their languages. If were not for Java, Microsoft would never have created C# and improved Visual Basic!

Visual Studio 2005 Beta 2 is here

After a ton of delays we finally have beta 2 of Visual Studio 2005! I think every .net developer is trying to download from MSDN today. I started this morning and I am still only 25% of the way there and I have been at it for over 6 hours now. I know its 3.7 gigs but I’ve been able to download 2 gigs with my connection in under 90 minutes.

All I can say its about time that its available. I’ve been building a new application under the beta 1 bits for the last couple of months and lately Visual Studio has been crashing every 15 mins or just hangs completely on me.

Hopefully by PDC 2005 we will have the production version out.

UPDATE: We finally did get everything working in Visual Studio 2005 beta 2, but the third party controls we are using are failing to initialize! So now we have been forced to remove them until we get a new update from them. That’s at least 3 weeks away!

Microsoft MVPs Say They Want Old VB Back

It very interesting to hear from so many old VB 6 programmers that they hate/dislike/refuse to use vb.net I have no idea why because I always felt that VB was becoming an obsolete programming language.

Back in 1999 I was invited up to Microsoft’s Campus for 2 days of discovery of what was then called COM+ 2.0 and the Next Generation Windows Services. The group I was involved in was with the VB team. For 16 hours we met with the team and discussed what they where doing with VB. I was totally into what they were presenting and planning to do with Visual Basic. I was thinking that VB would finally be a REAL programming language.

The team did have some concerns on if they should support old VB6 code as well as VB 7 code (that is what they were calling it then) in the new Visual Studio IDE. 3/4 of the guests, including myself, were saying to forget about supporting both; we need to move forward a modern language. I felt that if you left VB programmers to their own devices they would not use any of the new awesome features. The other 1/4 of the guests were saying that this would be a big mistake to not have the ability to build VB6 style apps in the new environment.

I guess when I look back it I was thinking about how our company used VB. We did many things that not your average VB programmer would do. Many times I would say I needed this feature in VB and the response back from Microsoft was that maybe I should forget about VB and start doing everything in C++. I LOVED VB and I did not want to switch to C++! How dare they tell me to give up my first programming love! Just give it a face lift and I will be happy. When I saw VB 7 I was in Heaven. My old VB would finally be the true beauty that I expected it to be!

When I we left the MSFT campus, a package arrived a couple of days later at home with the latest bits for what is now .NET. I installed it and started playing around with what they had showed us the previous week. It extremely slow and buggy but it gave me a chance to play with what was about to change they way we do development! I could not wait for this new framework. (Little did I know I would almost have to wait 2 1/2 more years)

Then something happened that changed my development career. It was called COOL. I remember all the rumors about this new language Microsoft was creating called COOL and I found this in the New Projects Window. I started playing around with COOL and I simply fell in love with it. Yes its just like Java, but it was better. It felt like Java/C++ but it was as easy as VB. From this point on I decided that I would be COOL and learn everything I could about it in this technology preview. The name was later changed to C#.

So when .NET finally shipped, I broke off my 10 relationship with Visual Basic. (I actually cheating on VB for several years with the beta, but now I could go public with it) Since 2001 I would say that 80% of my work has been in C#, 15% in C++ and 5% in either VB.NET or VB6. I hated every minute working in VB. I had a job at a consulting firm and I wrote this address validation control in VB and the whole time I was wishing I could have done it in C#. VB just did not do it for me any more. It started looking foreign and I felt like it could never be like the old days.

Lately I’ve been diving into Java and cocoa (Apple C Language) for personal enlightenment on my Mac.

Some ways I feel a bit responsible for the decision of Microsoft to only support VB.net and guilty because I did not even use the new language when it was introduced. Although I highly doubt Microsoft’s decision to not support VB6 with .nET was made from 6 guests telling them not to!!! I can only hope that I had that much pull :)