Welcome to NeoTekSystems Blog Sign in | Join | Help

Diskeeper

I downloaded Diskeeper the other day and installed it.  I'm pretty impressed with it.  It was an easy install and once I set it up, it just runs.  I haven't had to mess with it since.  It has kept my drive perfect for a while now.

If you want to check it out, you can go here 

It works on Vista also, though I only ran it on XP.  They also have some extra features if you're a network admin to control and defrag you're entire network.

posted by jspano | 0 Comments

HEad First Object Oriented Analysis and Design

   I'm almost to the end of Head First Object-Oriented Analysis and Design from O'Reilly and I must say it's an excellent book.  It's very easy to read like all the Head First books and very informative.  I got through most of it while waiting on my wife to have a root canal at the dentist (yuck!).

   I like it's structure the most.  It takes you from a first try perspective and then refactors the code until you have a good object oriented design.  This mimics most programmers style; just shoot from the hip and go back and make it better later.  It shows you why the from the hip code is bad and how to make it better.  Hopefully this book will help you stop doing that and shoot right for the good design up front.

   Stuff covered is of course object oriented design along with single responsibility, some uml and the basic principles of object oriented coding like encapsulation and delegation. 

   I think this book will be good for anybody new to object oriented design as it teaches you the basic principles of it, and also people that already have a good background in it to brush up on your skills and design choices.

   I'll be doing a more indepth review of it later after I finish it.

 

ISBN: 0596008678

By O'Reilly

posted by jspano | 0 Comments

Infragistics 6.3

I downloaded and checked out Infragistics's NetAdvantage 6.3 the other day.  If you do a lot of UI work and like to make your apps look good, I definately would suggest you check them out.  They support ribbon like Office 2007 and have several cool features like the AppStylist which lets you apply custom styles easily to your apps and formatted tooltips.  They're easy to work with also, having a powerful object model.

If you do a lot of web work, they have a whole suite of ajax controls and a good looking grid for Asp.Net.

If anyone uses them, post your cool ideas or styles for look and feel in your apps.

posted by jspano | 0 Comments

Google homepage

If you haven't heard yet, Google has come out with a customizable home page that allows you to put modules on it.  The modules can be very diverse allowing you to create a pretty cool or useful homepage.  I threw a few together.  Some useful, some not :)

You can check them out here.   

posted by jspano | 1 Comments

unit testing and mocking frameworks

If you know me, you'll know that I am the last one to advocate unit tests :)

I have always disliked them for the simple fact, that in a real project, you have to do a TON of wire up just to get the unit test to work.  Connect to a db most of the time, do a bunch of setup etc etc.  I usually find that the tests take almost as much time to code as the actual app.

Well recently a friend of mine told me to check out TypeMock.  I had never heard of mocking frameworks before.  It was a new experience.

After getting a copy, I started looking at what it does to help fix all the problems I find with unit tests.  It allows you to "mock" any object in your system.  Mocking means that it will intercept calls to your real objects and return "fake" objects for you to use in your testing.

For instance, say I want to test a class that does calculations.  In that class, a call is made to the database to fill out some basic numbers in the class that are used to perform the calculations.  With standard testing you have to wire up the db call, make sure you have a good db etc, just to test the calculate method.  With TypeMock, I can intercept the call to the db object and return any value I want.  IE the calculate class thinks it hit the db and now my unit test can just test the calculations to see if they're right.

It has a ton of features, way to many to list here, but some that stood out are the ability to mock a whole object, specific functions of an object, specific properties, multiple return values depending on input, a reflection module so  you can mock anything, even if it isn't public and many others.

I highly suggest you check it out if you do unit tests, or you were like me and didn't like them.

http://www.typemock.com/

 

posted by jspano | 3 Comments

Dot Net 3.0

Microsoft as merged Dot Net 3.0 with WinFX.  Not only will you have the standard base class libraries, but all of WinFX (WPF, WCF, WF and WCS) will be part of the base framework now.

 

Read more here

posted by jspano | 0 Comments
Filed Under:

Microsoft's been busy

Microsoft announced a new developer edition of vs.net for dba's.  It looks like it may provide some cool new tools like source control of base line scripts etc.

Check it out Here

 

They also have been working on some new security stuff that may prove interesting.  It's called ForeFront

posted by jspano | 0 Comments

FlowLayout Panel

I found a neat control in vs.net 2005 the other day.  Sometimes you need a control that will turn parts of itself off and on visibly.  When parts turn off,  you want to move the other parts of the form around on the form to eliminate gaps in the form.

For instance, think of several checkboxes that are vertically spaced down the windows form.  Depending on the client viewing the form, you may want to remove a checkbox for them.  It was a pain in the past to position the checkboxes below the one you removed. 

Well with the FlowLayoutPanel, you no longer have to calculate positions.  It will do this for you.  It works similar to the web page flow layout principal.  When the one check box becomes invisible, the rest "snap" up to remove spacing between them.  This control lets you make comples windows forms very easily.

posted by jspano | 0 Comments

South Carolina Code Camp

Another code camp is coming to South Carolina!  There will be many great sessions available to learn from. 

 

If you want to get some more info or wish to help out by volunteering or speaking, you can check it out here: GspDevelopers.org

posted by jspano | 0 Comments
Filed Under:

For each loop gotcha

Take the following code:

Dim ar As ArrayList = New ArrayList

ar.Add(1)

ar.Add(2)

ar.Add(3)

For Each o As Object In ar

Dim total As Double

total += 2

MessageBox.Show(total.ToString)

Next

 

The compiler actually moves the dim statement out of the loop so you get output of 2, 4 and 6 as the loop goes through. 

This doesn't happen in c# as the compiler won't allow you to use double total;  It forces you to write double total = 0; which fixes the problem.  You could also add a total = 0 after the message box line to fix it.

 

posted by jspano | 0 Comments

My English

Well, here is my english.  Hmmm, I guess the Yankee is from my mother who is a yankee....

 

 

55% General American English
35% Dixie
10% Yankee
0% Midwestern
0% Upper Midwestern

posted by jspano | 0 Comments

Single Instance of a Windows Form With the Singleton Pattern

People have asked me this a lot lately so I am going to show how to use the Singleton design pattern to create a form that has only one instance of itself.
The first thing you want to do is make your constructor of the form private. This is to ensure programmers don't create instances of the form, but use the one that already exists.

Just change the public to private:

Code:
Private Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call

End Sub

Next, we are going to add a method to the form that will return the current instance of the form. We also add a class level variable to hold the form instance.

Code:
Private Shared _Instance As form1 = Nothing

Public Shared Function Instance() As form1
    If _Instance Is Nothing OrElse _Instance.IsDisposed = True Then
        _Instance = New form1
    End If
    _Instance.BringToFront()
    Return _Instance
End Function

This method checks to see if an instance of the form is already open, and if so shows it.

To call the form from other MDI windows or forms, you do the following:

Code:
Dim MyForm As form1
MyForm = form1.Instance 'Decare our variable = to the existing instance of the form
MyForm.MdiParent = Me 'if we have an mdi parent window
MyForm.Show() 'this shows the current instance of the form

As you can see it's simple to use the Singleton pattern to create one instance forms. This pattern can also be used for any object you want to have a single instance of.
posted by jspano | 0 Comments

Brand New Blog

Just dusting off this new blog...

More to come

posted by jspano | 0 Comments