Using jQuery to enable/disable a button based on a text box

Since this is an html file, just create a blank file on your desktop called Test.html and copy and past the code below.

The steps for doing this are comments in the code.

Note: This should handle typing, pasting, code change, etc…

<!-- Step 1a - Create HTML File (see step 1b way below) -->
<!DOCTYPE html>
<html>
<head>
    <!-- Step 2 - Include jquery -->
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
 
    <!-- Step 3 - Add script to run when page loads -->
    <script  type="text/javascript">
        jQuery(document).ready(function () { 
            <!-- Step 4 - Bind method to text box -->    
            $("#txtField").bind("propertychange keyup input paste", setButtonState);
			
            <!-- Step 4 - Set the default state -->
			setButtonState();
        });
		var setButtonState = function () {
			if ($("#txtField").val() == "")
				$("#btnEnter").attr("disabled","disabled");
			else
				$("#btnEnter").removeAttr("disabled"); 
		}
    </script>
</head>
<body>
<!-- Step 1b - Add HTML elements --> 
<input type="text" id="txtField" size="50"/>
<button type="button" id="btnEnter">Enter</button>
</body>

Update: 5/22/2013: Fixed example. Before if it was used on a page with links, going forward and back could result in the button being disabled even if the text box was populated. This new example solves this issue.

See a MVVM version of this here:
Using MVVM with HTML5 and JavaScript


Win two free windows phones!

Microsoft is giving away two free windows phones through my wife Michelle’s blog.

If you want to try to win a pair of windows phones, one for you and one for your spouse, then sign up here:
How We Met & a Windows Phone for You and Your Valentine


Best Practices for Preparing a Windows Virtual Machine

If you use Virtual Machines  in your lab (either with Hyper-V, VMWare Workstation, Virtual Box or other), you probably would love to have a list of steps to create a nice usable Virtual Machine. There are probably annoyances you have with your Virtual Machines that if you only knew how you could make them go away.

Also, it is frustrating to revert and have to redo settings, so knowing when is best to snapshot is also nice.

This document is to help you with just that: Creating the perfect Virtual Machine that is easy to use and avoids annoyances.

Note: I have been using VMWare Workstation since 2004. I have also used ESX, Virtual Box, and Hyper-V. I have worked with lab environments the most, but I have also worked with Virtual Machines in production and consider myself highly experienced.

Setting up a new Virtual Machine

Note: These steps provide general guidelines for when to snaphsot

  1. Create a new VM in your favorite Virtual Machine Manager.
    Note: I have used VMWare Workstation and ESX, Virtual Box, and Hyper-V and find I like them all fine.
  2. Use a very large disk image size, but do not choose to use allocate disk space now.
    Note: It is very frustrating to run out of space, so avoid this.
  3. Delete the floppy disk if the hardware configuration has one.
    Note: VMWare workstation will annoy you to no end if you leave a floppy on the system.
  4. Install Windows.
  5. Note: Do not activate or enter a Product Key if it allows you to skip this step.
    Note: I will use Windows Server 2008 R2 for this example.
  6. Create a snapshot called “Clean Install” here.
  7. Apply all patches and updates and driver updates.
  8. Add a secondary admin account in case you forget the primary admin account.
  9. Create Snapshot called clean install with Patches.

Windows Activation

If this is to be a base OS to use to clone other Virtual Machines, never activate the base Operating System, only activate a Virtual Machine after it has been cloned and after you are sure the Virtual Machine will not be discarded as lab Virtual Machines can be discarded often.

Activation can be a delicate balance. You don’t want to active every time, but at the same time, you don’t to revert a virtual machine and have to activate again. As soon as you know you will use the Virtual Machine for a while, activate it and snapshot it. Hopefully you never have to revert to a state before it was activated.

Making the Virtual Machine Easier to Use

Allow the Virtual Machine to Shutdown from the Login Screen

  1. Run gpedit.msc to launch the Local Group Policy Editor.
  2. Click to expand Computer Configuration | Windows Settings |Security Settings |Local Policies | Security Options.
  3. Scroll down in the right pane and right click on “Shutdown: Allow system to be shut down without having to log on” and choose Properties.
  4. Click Enabled and then OK.

Disable the shutdown event tracker

Virtual Machines, especially in a lab, shutdown often and unlike production machines, tracking these shutdowns is not necessary, so lets turn this off.

  1. Run gpedit.msc to launch the Local Group Policy Editor.
  2. Click to expand Computer Configuration | Administrative Templates |System.
  3. Scroll down in the right pane and right click on “Display Shutdown Event Tracker” and choose Edit.
  4. Click Disabled and then OK.

Disable Internet Explorer Enhanced Security Configuration

It is a pain in a lab to be prompted on every web site and for every download. Labs usually trade security for speed and agility.

  1. Go to Server Manager.
  2. Under Security Information on the right, click on Configure IE ESC.
  3. Set the values to Off.
  4. CLick OK.

Making the Virtual Machine more efficient

Turn off unnecessary services

If you need to run a lot of Virtual Machines and you need to squeeze every last bit of processor power out of your Virtual Machines, then they should only run the bare minimum they need to run.

Make a list of services you do not need but are running by default and disable them.

Note: Google search for “Services you can turn off in Server 2008” or whatever Operating System you are using.

Note: Often developers install Visual Studio, which includes SQL Express, and even if they never use SQL Express, they leave the service running. Stop such services and set them to manual so they don’t restart every reboot.

Software on the Virtual Machine

Install commonly used software

This one appears easy at first. However, it is different and there is more to it than you think.

  1. Make a list of software you use on your Virtual Machine. Here are a few examples:
    Notepad++
    7zip
    Acrobat Reader
    Firefox or Chrome (or your favorite browser)
    etc…
  2. Install your desired software.
  3. Update your software.
  4. Snapshot.

Delete Unique Values for Some Software

If you are going to use this as a base Virtual Machine to clone other Virtual Machines, then you don’t want anything that should be unique to be the same on each machine. Any software that has unique values should have those unique values removed. I’ve seen VPN software have unique values, the LANDesk Agent, etc… Remove these unique value before you Sysprep.

Using Virtual Machines with Active Directory

Using the Virtual Machine as a base

If you are going to create a base Virtual Machine that  you will clone often, just never join it to the domain. Instead, take the time to get the system perfect and sysprep the Virtual Machine so it will join the domain and prompt for a computer name on first boot.

Sysprepping a Virtual Machine

Sysprep is eithe ron the ISO or already installed.

  1. Run c:\windows\system32\sysprep\sysprep.exe.
    (Or find sysprep on the ISO)
  2. For System Cleanup Action, choose Enter System Out-of-Box Experience (OOBE)
  3. For Shutdown Options, choose Shutdown.
  4. Click OK.
  5. Snapshot once the machine has shutdown.

Prevent the Virtual Machine from ever losing a trust with the domain

When a Windows Virtual Machine is joined to the domain, reverting can cause a huge delay, especially if the snapshot is from a while ago, because a machine and the domain have a trust based on a system password (that is all under the covers) and this password can update. When reverting after the password has changed, your reverted state will no longer have a trust with the domain. This can be prevented.

  1. Join your machine to the domain.
  2. Apply DisablePasswordChange registry key.
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters]
    "DisablePasswordChange"=dword:00000001
    
  3. Create a snaptshot called “Machine joined to domain, DisablePasswordChange set”.

For more information, read this post: Virtual Machines, Snapshots, Domain Membership, and trust relationship

Change the domain password requirements to be easy or off

Again, in lab environments, security is often traded for speed and efficiency. You may want to allow passwords that are blank or two characters.

Also, because of snapshots and reverting it will eliminate Virtual Machine problems if passwords never expire.

If your Active Directory server is also in your lab, you may be able to change the passwords requirements to be easy or even turn them off completely. If your Active Directory server is not in your lab, you may have to live with them.

Don’t clone machines joined to the domain

If you clone a machine joined to the domain, you have created two machines that have the same domain membership, which should be unique. If one machine changes, it can break the trust relationship for the other machine.

The only time you should clone a machine that is joined to the domain is when you plan to discard the Virtual Machine you are cloning from.

Other Steps

Everyone has unique needs, and these are supposed to be general needs. You should document your needs and add them to your Virtual Machine creation.

If you have an idea that isn’t listed here and it is a general step, please comment.


C# Interview Questions

Comparing C# to other languages

  1. Q: What makes C# different than C++?
    A: C# has the CLR. C# has a Garbage collector, Properties, no globals, statics, C# has single inheritance with multiple interfaces while C++ has multiple inheritance. C# allows for the property syntax.
  2. Q: In what ways are C# and C++ the same?
    A: Object oriented. They both have classes, enums, methods, similar types (bool, int, double, etc…).

You can change the above to questions by replacing C++ with any language that candidate may say they are familiar with on their resume: Java, PHP, Ruby, Perl, Python. Of course, you may have to look up the answer. (Or not. You can usually tell by the interviewee’s confidence without knowing the answers yourself.)

C# Basics

Look the basics at least make sure they aren’t completely lying on there resume and they actually have at least done something in C#.

  1. Q: What is a benefit of having Properties over getters and setters?
    A: If you started using a variable and now you need to wrap code to have multiple actions on get and set, you don’t have to refactor as the Property has the same name and is used the same as a member variable.
    A: Readability. For syntactical purposes the getter and the setter always have to be in the same place in code because they are grouped. Other languages allow for the getter and setter to be anywhere in the object.
  2. Q: What is the syntax for instantiating an instance of each of the following:
    boolean
    A: bool b = true;
    integer
    A: int i = 0;
    real number
    A: double d = 1.0;
    array of integers
    A: int[] myArray = new int[10];
  3. Q: What is the standard way to create an empty string?
    A: string someEmptyValue = string.empty
  4. Q: Is a string mutable or immutable?
    A: immutable.
    Q: What does that mean when performing string manipulation functions?
    A: Any time the string changes, what really happens is a new string is created in a new location in memory.
  5. Q: Write both a for loop and a foreach loop that iterates through a List called myStrings.
    A:

    for (int i = 0; i < myStrings.Count; i++)
    {
        // put code here
    }
    
    foreach  (string str in myStrings)
    {
        // put code here
    }
    

    Q: Why would you use one method over another?
    A: Maybe you need the current id, so you use the for loop.

C# – Big O

  1. How to find the duplicate in an array using Big O of N?

C# – Open Ended Questions

  1. What design patterns do you use when developing? What design patterns do you hope to learn?
  2. What is the latest C# object or feature you have learned to use?
  3. Which areas of C# have your worked with? Which areas of C# have you not worked with?

C# – Security

  1. Q: What are some security related tools (executable files) included with .NET Framework?
    A: Caspol.exe (Code Access Security Policy Tool): Enables you to view and configure security policy for the machine policy level, the user policy level, and the enterprise policy level. In the .NET Framework 4 and later, this tool does not affect code access security (CAS) policy unless the element is set to true. For more information, see Security Changes in the .NET Framework.Cert2spc.exe (Software Publisher Certificate Test Tool): Creates a Software Publisher’s Certificate (SPC) from one or more X.509 certificates. This tool is for testing purposes only.Certmgr.exe (Certificate Manager Tool): Manages certificates, certificate trust lists (CTLs), and certificate revocation lists (CRLs).

    Makecert.exe (Certificate Creation Tool): Generates X.509 certificates for testing purposes only.

    Peverify.exe (PEVerify Tool): Helps you verify whether your Microsoft intermediate language (MSIL) code and associated metadata meet type safety requirements.

    SecAnnotate.exe (.NET Security Annotator Tool): Identifies the SecurityCritical and SecuritySafeCritical portions of an assembly.

    SignTool.exe (Sign Tool): Digitally signs files, verifies signatures in files, and time-stamps files.

    Sn.exe (Strong Name Tool): Helps create assemblies with strong names. This tool provides options for key management, signature generation, and signature verification.

    Ref: http://msdn.microsoft.com/en-us/library/dd233106.aspx

  2. Q: What are some libraries in the System.Security namespace?
    A:System.Security
    System.Security.AccessControl
    System.Security.Authentication
    System.Security.Authentication.ExtendedProtection
    System.Security.Authentication.ExtendedProtection.Configuration
    System.Security.Claims
    System.Security.Cryptography
    System.Security.Cryptography.Pkcs
    System.Security.Cryptography.X509Certificates
    System.Security.Cryptography.Xml
    System.Security.Permissions
    System.Security.Policy
    System.Security.Principal
    System.Security.RightsManagementQ: Can you discuss any of these libraries?
    A: See what they have to say and compare it to the web site on MSDN for these libraries.Q: Which libraries have you used? Tell my about a project you used that library in.
  3. What are some of the Key Security Concepts in C#?
    A: Security Permissions, Type Safety and Security,  Principal, Authentication, Authorization, Security Concerns for Keywords
    Ref: http://msdn.microsoft.com/en-us/library/z164t8hs.aspx
  4. What is Code Access Permissions?
    A: permission objects that are used to help protect resources and operations from unauthorized use. They are a fundamental part of the common language runtime’s mechanism for enforcing security restrictions on managed code.
    Ref: http://msdn.microsoft.com/en-us/library/h846e9b3.aspx

More to come . . .


A Spreadsheet for Sprint Planning

As a follow-up to Why your story estimation was off!“, I have created a spreadsheet for sprint management. This spread is not for helping you size a story, but instead it is for helping you determine how many stories your team can really do a single sprint.

It has the documentation on a separate sheet inside it.

Sprint Planning Spread Sheet Template.xlsx


Removing all xml or html tags using Notepad++

Let’s say you have an xml or an html document and you want to remove the tags.

<h2>Shopping List</h2>
<ol>
	<li>Milk</li>
	<li>eggs</li>
	<li>butter</li>
	<li>cereal</li>
	<li>bananas</li>
	<li>apples</li>
	<li>orange juice</li>
	<li>yogurt</li>
	<li>bread</li>
	<li>cheese</li>
</ol>

This can be done rather quickly in a tool like notepad++ using the find and replace with regular expressions feature.

  1. Go to Find and Replace.
  2. Enter this regular expression: <[^>]+>
  3. Select regular expression.
  4. Make sure the cursor is at the start of the document.
  5. Click replace all.

That is it.


The Joel Test updated for 2013

Many of you have heard of The Joel Test. Joel Spolsky wrote it in 2000 and yet is still eye-opening to many development environments. Here is the Joel test if you haven’t read about it.

The Joel Test (written by Joel Spolsky in 2000)

  1. Do you use source control?
  2. Can you make a build in one step?
  3. Do you make daily builds?
  4. Do you have a bug database?
  5. Do you fix bugs before writing new code?
  6. Do you have an up-to-date schedule?
  7. Do you have a spec?
  8. Do programmers have quiet working conditions?
  9. Do you use the best tools money can buy?
  10. Do you have testers?
  11. Do new candidates write code during their interview?
  12. Do you do hallway usability testing?

This test is a good measuring stick. However, it has been a dozen years since Joel wrote this. Are updates needed? I think so. It is missing some important yet still simple yes/no questions. So here is my updated version. New stuff is in blue.

The Joel Test (Updated for 2013 by me)

Source Control

  1. Do you use distributed source control?
  2. Do you have a gated check-in?
  3. Do you have a branching strategy?

Build and Install

  1. After checking out source, can a developer build and debug with one click.
  2. Can you make a build and an installer in one step?
  3. Do you make daily builds and installers?
  4. Can a developer add to the build easily?
Coding Practices and Coding Architecture/Design
  1. Do you have coding best practices?
  2. Is your code considered decoupled?
  3. Do you analyse and design before you code?
Bugs and Enhancement Tracking
  1. Do you have an integrated bug database?
  2. Can customers/users see status of existing bugs, submit new bugs and enhancement ideas, and vote on them?
  3. Do you fix bugs before writing new code?
Testing
  1. Do you write a Unit Test exposing the bug before fixing the bug?
  2. Do you write Unit Tests and publish code coverage/complexity results buildly?
  3. Do you have automated tests and testers writing them?
  4. Do you do hallway usability testing?
Road Map/Development
  1. Do you have an up-to-date schedule?
  2. Do you have a spec?
  3. Are you practicing a successful software development methodology?
Developers
  1. Do you have a continuous education program for developers?
  2. Do developers interact with customers once a year?
  3. Do new candidates write code during their interview?
  4. Do you have a training program for newly hired developers?
Tools and Workplace
  1. Do programmers have quiet working conditions?
  2. Do you use the best software money can buy?
  3. Do you have the best hardware money can buy?
  4. Do you have a simple process for developers to request software or hardware?
User Experience
  1. Do you have a team dedicated to enhancing the user experience?
  2. Do you send a prototype to customers/users before you start coding?

So I think that the above changes are quite easy to use still. They are simple yes/no questions. The look is quite different, yet it seems much more clear as to why the questions are being asked. Even though there are a lot more questions (more than double), it is still easy and short.

So here is a list (probably not comprehensive) of the changes I made.

  1. I grouped the questions into categories so the failure areas become clear.
  2. I enhanced some questions taking into account some software development movements over the past dozen years.
  3. I added some questions, again taking into account some movements over the past dozen years.
  4. I added a questions that focus on the customer/user.
  5. Also, Joel has a lot of paragraphs explaining his questions and some of what he explains could be added to the question in one word, for example, I added “installer” to the build questions.

Well I suppose some people will hate the updates and some will love them.

If you want to add or alter some of these questions, feel free to comment.


Sorting by Reversals in C#

I am getting a masters and I was studying this and wanted to implement it to understand it fully. Efficiency could be improved for sure but the goal of this is not efficiency, just to implement the algorithm so when I question comes up on the final, I can answer it.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Reversals
{
    class Program
    {
        static void Main(string[] args)
        {
            // SolveByReversals1
            int[] array1 = new int[] { 0, 1, 2, 3, 7, 6, 5, 4, 9, 8, 10 };
            Console.WriteLine("Before: " + string.Join(", ", array1));
            SolveByReversals1(array1);
            Console.WriteLine(" After: " + string.Join(", ", array1));

            Console.WriteLine();

            // SolveByReversals2
            int[] array2 = new int[] { 0, 1, 2, 3, 7, 6, 5, 4, 9, 8, 10 };
            Console.WriteLine("Before: " + string.Join(", ", array2));
            SolveByReversals1(array2);
            Console.WriteLine(" After: " + string.Join(", ", array2));

            int[] array3 = new int[] { 0, 10, 20, 30, 70, 60, 50, 40, 90, 80, 100 };
            Console.WriteLine("Before: " + string.Join(", ", array3));
            SolveByReversals2(array3);
            Console.WriteLine(" After: " + string.Join(", ", array3));

            Console.WriteLine();

            // SolveByReversals3
            int[] array4 = new int[] { 0, 1, 2, 3, 7, 6, 5, 4, 9, 8, 10 };
            Console.WriteLine("Before: " + string.Join(", ", array4));
            SolveByReversals3(array4);
            Console.WriteLine(" After: " + string.Join(", ", array4));

            int[] array5 = new int[] { 0, 10, 20, 30, 70, 60, 50, 40, 90, 80, 100 };
            Console.WriteLine("Before: " + string.Join(", ", array5));
            SolveByReversals3(array5);
            Console.WriteLine(" After: " + string.Join(", ", array5));

            int[] array6 = new int[] { 0, 0, 1, 4, 3, 3, 1, 2, 2, 4 };
            Console.WriteLine("Before: " + string.Join(", ", array6));
            SolveByReversals3(array6);
            Console.WriteLine(" After: " + string.Join(", ", array6));
        }

        /// <summary>
        /// Works only for perfect sequences starting at zero 
        /// and incrementing by one {0,1,2,3,...,10,...}
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static int[] SolveByReversals1(int[] array)
        {
            for (int i = 0; i < array.Length; i++)
            {
                int j = Array.IndexOf<int>(array, i);
                Array.Reverse(array, i, j - i + 1);
            }
            return null;
        }

        /// <summary>
        /// Works with sequences of unique integers.
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static int[] SolveByReversals2(int[] array)
        {
            int pos = 0;
            for (int i = 0; i < array.Max() - 1; i++)
            {
                int j = Array.IndexOf<int>(array, i, pos);
                if (j == -1)
                    continue;
                Array.Reverse(array, pos, j - pos + 1);
                pos++;
            }
            return null;
        }

        /// <summary>
        /// Works for numbers of any sequence.
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static int[] SolveByReversals3(int[] array)
        {
            int pos = 0;
            int highLoop = array.Max();
            if (array.Length > highLoop)
                highLoop = array.Length;
            for (int i = 0; i < array.Max() - 1; i++)
            {
                int j = 0;
                while ((j = Array.IndexOf<int>(array, i, pos)) != -1)
                {
                    Array.Reverse(array, pos, j - pos + 1);
                    pos++;
                }
            }
            return null;
        }
    }
}

So it was nice to implement this to understand some of the difficulties and solve this issue. I may never have arrived at the third method just from class discussion.


Say YES to Education but say NO to large debt (part1)

Recently, I have seen articles discussing the idea of “saying no to college”.

Education is extremely important! Notice, I didn’t say college was extremely important I said education. UnSchool is not exactly off base. They are saying to get educated, but they are saying to do it without college. However, college degrees are the standard today for proof of education, and that should not be overlooked.

Some of the arguments for UnCollege and not valid. For example, here is one of the quotes:

“You wasted $150,000 on an education you coulda got for a buck fifty in late charges at the public library.”
– Will Hunting

OK. So I am total agreement with this statement assuming you were foolish enough to spend $150K on a college degree. Do NOT spend that much on a degree unless you are going to be something like a specialized surgeon or unless it doesn’t change the number of zeros in your (or your daddy’s) bank account.

I am not, however, in perfect agreement with UnCollege. My recommendation is to acquire education and do it in a way that provides “Proof of Education.”

Person Experience: I have a bachelor’s degree and I am almost done with my Masters of Computer Science. How much debt have I incurred from my bachelors and my Masters? $0. Now that doesn’t mean I never had a loan for education. I took out a $4k loan for a certification course. My certification was my first Proof of Education.

Proof of Education

Proof of Education is proof that you have learning or experience that can help you be successful in a role. Proof of Education is extremely important.

The most common and well-known and most accepted form of proof of education is a High School Diploma followed closely by a Bachelors degree. Another well-known proof of education but not necessarily considered such is your driver’s license.

Here is a list of the common forms of Proof of Education. These end with a nice certificate from an accredited institution.

  1. High School Diploma or GED
  2. Bachelors Degree
  3. Masters Degree
  4. Doctorate or Ph.d.

These are not the only ways to obtain Proof of Education. There are other ways however, the “proof” part is often harder to come by as it is not always a nice signed piece of paper from an accredited instituation.

  1. Job Experience
  2. Apprenticeship
  3. Certifications in your field
  4. Non-profit work and projects
  5. Life experiences

How do you prove Job Experience? Job experience is not too hard to prove, especially if the company is still around and their HR can confirm your employment and title. If the company you worked for disappears, how can you prove you worked there? Well, pay statements, references (keep in contact with previous managers and co-workers which is very easy these days).

Why is a degree the most important Proof of Education?

Often in many companies and government organizations a degree is required. If the most qualified individual doesn’t not have a degree, they are likely not to even get an interview because they don’t pass the filter.

Personal Experience: Even there is a possibility for an exception to be made, it often isn’t. I interviewed for a government job that required a Degree in Computer Science. I was qualified. My undergraduate degree was in English because I could already write code. This company wanted a WPF developer (which is my forte) and were willing to pay 110K a year, but my undergraduate degree was in English. They couldn’t make the exception despite my experience and I lost out on a great high paying job.

Personal Experience: My father’s degree is in Psychology. He worked a great job in the oil field for twenty years. Then he passed some Appraisal certifications and became an appraiser of houses. It seemed he may never use his degree. During the housing crash, around 2009, he had the opportunity to teach seminary to supplement his income. Teaching required a degree. He would have lost that opportunity without a degree.

Why may a degree not be for you?

Here are some examples of why a degree may not be for you:

  1. You may never use it. I know many people who end up working in the oil field or as a mechanic or various other positions that don’t require a degree an they never use it.
  2. It may not be worth the money. A degree in English from Yale when you plan to be a technical writer is probably not going to provide any bang for your buck. A degree from your local community college in english or even just some technical writing courses and experience would probably result in similar salaries, so save yourself some money.
  3. You want to be an entrepeneur. You just have the bug and want to work for yourself. Take some business courses somewhere, and get your business started, and stay away from college. Just be aware that most business owners fail many times and put in 80 hours a week while failing. However, once you succeed, you could end up making six figures and possibly more. It is higher risk but higher reward.
  4. You just can’t sit still and concentrate in a classroom environment and fail anytime you try. If this is you, you know who you are. Find another way to get educated and make sure to grab some Proof of Education along the way.
  5. You already have a marketable skill.

Personal Experience: I have a brother-in-law who doesn’t have a degree. His father was a surveyor and he started working with him at a young age and had years of experience already and a marketable skill already. He got a few certifications and has a great job. He may never need a degree. However, he is only in his thirties so who knows if he will wish for a degree sometime in his career.

Continued in How to get a degree and stay out of debt? (Part 2)


How to get a degree and stay out of debt? (Part 2)

Continued from Say YES to Education but say NO to large debt (part1)

Pay as you go. Get a company to reimburse your for education. This is easier said than done. It takes work, but it is doable. I know because I did it for certifications and for my Bachelors degree, and I am doing it now for my Masters.

Step 1 – Choose your career field

In what field do you want to work in:

  • IT
  • Software Developement
  • Business Intelligence Analysis
  • Sales
  • Dental
  • Medical or Health
  • Home Improvement (plumbing, electrical, etc…)
  • Mechanic
  • Other…

Step 2 – Research entry-level proofs of education in the field

Take any field of employment and search the internet for it along with basic words such as “certification” or “certificate” or “apprenticeship”. For example: Developer Certification, Medical Career Certification, Dental Apprenticeship. You will probably find some nice and cheap ways into your field.

Step 3 – Start on the quickest proof of education to obtain

There are a lot of certifications that come after a one week course. There are a lot of jobs where you can be an apprentice and learn while your work.

Example: Sometimes, there are no solutions to be faster, only solutions to be cheaper. Think of becoming a General Contractor for example. You can work framing houses for four years and study to be a general contractor on the side. Four years experience is a requirement. Sure you don’t make much money your first four years, but you won’t gather 150K of college debt and at the end of four years, you will have experience and a General Contractor’s license, which is proof of education.

Step 4 – Get an entry-level job with a company that has education reimbursement

Find all the companies in your field you can work at. Apply at all of them for entry-level positions. Make sure to let them know about your “proof of experience”. Volunteer at them if you have to until you get hired. Try to choose one that has tuition reimbursement in your field.

Note: Be smart. If a company will pay you $15 an hour with tuition reimbursement, that is not as good as a company paying $25 and hour without tuition reimbursement. Who cares if you pay for the tuition or the company if you aren’t going into debt and you are getting good experience.

Personal Experience: You may have to start with any job, even one outside your field. I needed to get a $4K loan to get my first certifications. In 1999, I needed to make $9 and hour in order to get a 4K loan to get some computer training and a computer certification. I got a job as a grunt on a crew that framed houses even though I wanted to be either in IT or in Software Development. I got up to $9 an hour framing houses, got the loan, and took a 12 week course evening course for a certification called an MCSE. I came out of the course with only one of the five exams past: a single certification, which started me out as an MCP. With that one certification, I got a job making $14.42 an hour at a company called Convergys that pays tuition reimbursement.

Step 5 – Take two classes a semester while working

Working full-time is tough. Going to school full-time while working full-time is even tougher. I recommend part-time. Let your career and your degree grow together.  Create a spreadsheet of every class you need to graduate.

Important Personal Experience! Get accepted for your major. Get commitment from the college about graduation requirements. Too many people fail to take time to get accepted in their major and then the requirements change and they feel like they have to additional requirements. Usually, if you get accepted and work with a counselor, you can graduate without taking extra credit hours because of a change in curriculum.

Personal Experience: Your company may have limits to education reimbursement. Mine did. I could only reimburse $3500 a year, so I could only take about 15-18 credits a year. I found this was beneficial anyway. I took two calls in fall, two class in the winter, and one in the spring/summer. Night classes catered to working adults. They seemed easier because I already had knowledge from work. I was able to get work credit. Sometimes when taking a class in my field, I was able to do projects for my classes that coincided with work projects. It took me six years to get my degree but when it was done, I was completely out of debt and had years of work experience behind me so I wasn’t ever just a new college grad. I graduated at age 27. I started work and college at age 21 because I spent two years on a religious mission to the Dominican Republic from age 19-21. (Oh yeah, I speak fluent spanish. My proof of experience, living two years in the Dominican Republic.)

Conclusion

If you start this process when turn eighteen, you will have a college degree and, assuming it took you the first year or two to get in your field, four or five years of experience.

Look at this comparison chart:

4 years of college 2 years Job 6 years working and Degree
Education Debt $80k to $150K $0-$5k
Montly debt payment $400 to $1500 $0-$50
Years to pay off 10 to 20 (already two years in) 1 year
Experience/Salary level 1-2 years 4-6 years
Degree Yes Yes
Certifications No (but they could) Yes
Partying time at school Plenty A little

I think you can see why UnCollege exists. However, I think the focus should neither be “College” or “UnCollege” the focus should be to get Proof of Education without going into debt.


C# – Creating a Service to Monitor a Directory

Let’s say you wanted to watch a directory and perform an action each time a file is added, deleted, changed, or renamed.

  • Microsoft has a Visual C# Windows Service project template in Visual Studio.
  • Microsoft also has a nice class already created to help with this: FileSystemWatcher

Example Project

Here is an example project you can download: DirectoryMonitoring.zip

Step 1 – Create a Visual C# Windows Service project in Visual Studio

  1. Select File | New Project.
  2. Select Templates | VIsual C# | Windows | Windows Service.
  3. Provide a name: DirectoryMonitoring
  4. Click OK.

Step 2 – Create an object that inherits from FileSystemWatcher

  1. Right-click on Project and choose Add | Class.
  2. Name it MyFileSystemWatcher.cs.
using System;
using System.IO;

namespace DirectoryMonitoring
{
    public class MyFileSystemWatcher : FileSystemWatcher
    {
        public MyFileSystemWatcher()
        {
            Init();
        }

        public MyFileSystemWatcher(String inDirectoryPath)
            : base(inDirectoryPath)
        {
            Init();
        }

        public MyFileSystemWatcher(String inDirectoryPath, string inFilter)
            : base(inDirectoryPath, inFilter)
        {
            Init();
        }

        private void Init()
        {
            IncludeSubdirectories = true;
            // Eliminate duplicates when timestamp doesn't change
            NotifyFilter = NotifyFilters.FileName | NotifyFilters.Size; // The default also has NotifyFilters.LastWrite
            EnableRaisingEvents = true;
            Created += Watcher_Created;
            Changed += Watcher_Changed;
            Deleted += Watcher_Deleted;
            Renamed += Watcher_Renamed;
        }

        public void Watcher_Created(object source, FileSystemEventArgs inArgs)
        {
            Log.WriteLine(&quot;File created or added: &quot; + inArgs.FullPath);
        }

        public void Watcher_Changed(object sender, FileSystemEventArgs inArgs)
        {
            Log.WriteLine(&quot;File changed: &quot; + inArgs.FullPath);
        }

        public void Watcher_Deleted(object sender, FileSystemEventArgs inArgs)
        {
            Log.WriteLine(&quot;File deleted: &quot; + inArgs.FullPath);
        }

        public void Watcher_Renamed(object sender, RenamedEventArgs inArgs)
        {
            Log.WriteLine(&quot;File renamed: &quot; + inArgs.OldFullPath + &quot;, New name: &quot; + inArgs.FullPath);
        }
    }
}

Notice that each method is logging. We will implement this log next.

Step 3 – Add logging

  1. Add the class from a previous post: A simple Log singleton in C#
  2. Make sure to change the namespace to match.

Step 4 – Implement the Service

  1. Right-click on the Service1.cs file and choose View Code.
  2. Change both the Name and the ServiceName to DirectoryMonitoringService. You can right-click on the file to rename. If that doesn’t rename the class, you can open the file, right-click on the class name and choose Refactor | Rename.
  3. Go to the code of the DirectoryMonitoringService.cs file (which was Service1.cs just a couple steps ago) in Visual Studio.
  4. Implement the constructor as follows:
using System.IO;
using System.ServiceProcess;

namespace DirectoryMonitoring
{
    public partial class DirectoryMonitoringService: ServiceBase
    {
        protected FileSystemWatcher Watcher;

        // Directory must already exist unless you want to add your own code to create it.
        string PathToFolder = @&quot;C:\Directoy\To\Monitor&quot;;

        public DirectoryMonitoringService()
        {
            Log.Instance.LogPath = @&quot;C:\ProgramData\DirectoryMonitoring&quot;;
            Log.Instance.LogFileName = &quot;DirectoryMonitoring&quot;;
            Watcher = new MyFileSystemWatcher(PathToFolder);
        }

        protected override void OnStart(string[] args)
        {
        }

        protected override void OnStop()
        {
        }
    }
}

Step 5 – Create a Service Installer

  1. Right-click on DirectoryMonitoringService.cs and choose View Designer.
  2. Right-click anywhere in the designer window and choose Add Installer. This adds a ProjectInstaller.cs file.
  3. Right-click on ProjectInstaller.cs and choose View Designer.
  4. In the designer, right-click on serviceProcessInstaller1 and choose Properties.
  5. In the properties, set Account to LocalSystem.
  6. Back in the designer, right-click on serviceInstaller1 and choose Properties.
  7. Set StartType to Automatic.
  8. Add a descriptions if you want.

Step 6 – Install the Service

  1. Open the Developer Command Prompt by right-clicking and choosing Run as Administrator.
    Note: If you don’t have the Developer Command Prompt, you can open a normal command prompt as administration and get installUtil.exe from this path:

    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe
  2. In the command prompt, change to the bin\debug folder in your project directory.
  3. Run this command to install the service:

    installutil.exe DirectoryMonitoring.exe

  4. Start the service with this command.

    net start DirectoryMonitoringService

Step 7 – Debug the Service

  1. Make sure the service is started and running.
  2. In Visual Studio with the DirectoryMonitoring project open, click Debug | Attach to Process.
  3. Select the DirectoryMonitoring.exe file.
  4. Put a break point at each event in the MyFileSystemWatcher object.
  5. Test all four events:
    1. Add a file.
    2. Rename a file.
    3. Open and save a file.
    4. Delete a file.

You have now created a service to monitor a directory and you have seen how to debug it.


Is Windows 8 Pro Hyper-V the end of VMWare Workstation?

So I have had a license for VMWare Workstation through work since 2004. I have been a loyal user for eight years. However, my current job is not going to provide any further VMWare Workstation licenses.

Price of VMware Workstation vs Hyper-V

Because Hyper-V is included in Windows 8 Pro and the Microsoft Windows 8 Pro Upgrade is under $70 for a full version (not upgrade) of Windows 8 Professional System Builder DVD 64-Bit you are only looking at over $125.00 on sale (normally $199). VMWare Workstation alone is $249. VMWare Workstation is $50 more expensive than paying full retail price for the full version of Windows 8. If you are planning to buy Windows 8 Pro anyway, then technically, VMWare Workstation $249 too much.

Hyper-V vs VMWare Workstation

Having used both, I am going to mention some differentiating features.

  • Hyper-V virtual machines seem to snapshot and revert must faster than VMWare Workstation.
  • VMWare auto sizes the screen does, Hyper-V doesn’t.
  • VMWare workstation has a cool mode where you can run apps from the virtual machine as if they were regular desktop apps.
  • VMWare workstation works better with alternate operating systems.

There are advanced features that I haven’t tested. For example, when I worked at LANDesk we need to test PXE Booting so the ability for the virtual machine to PXE Boox was extremely important, and VMWare worked really well with PXE Booting. I haven’t tested Hyper-V with PXE Booting, so if you have please post and let me know if how it works.

Of course, don’t forget about Virtual Box. The open source edition, Virtual Box OSE, is free no matter what operating system is the host, whether it is Windows 8 or FreeBSD or Linux. It has been free for a while and yet VMWare Workstation is still popular so maybe it will remain popular despite Windows 8 Pro?


How to open a command prompt on a remote computer

There are three tools that can do this:

  • PSExec – Not redistributable but free for download. No source code.
  • RemCom – BSD Licensed but not really maintained and I haven’t been able to get it to work in Windows 7. Source code available. Uses its own command line.
  • PAExec – Free to distribute but no source code. Uses same command line as PSExec.

So they all use the same command line to connect to a remote computer. I think I am going to go with PAExec because it is newer, maintained, distributable, and works in Windows 7.

PAExec \\RemotePC cmd.exe

However, with that command line, it can be confusing to have a command prompt open on your machine without a way to know it is actually a command prompt for a remote computer so it is a good idea to add a prompt.

PAExec \\RemotePC cmd.exe /k prompt $C%computername%$F$S$p$G

I hope this helps.


I just broke 1000 points on StackOverflow

Ok, this may be a total geek thing to celebrate, but I just broke over 1000 reputation points on Stack Overflow.
http://stackoverflow.com/users/375727/rhyous

I thought I would celebrate by sharing this geekiness of mine with everyone.


Windows 8 Review

So I installed Windows 8 on my work computer.

Day 1 and 2 Review

  1. I like that Hyper-V is included in Windows 8 Pro but don’t expect it to have anywhere near the features of VMWare Workstation. Even Virtual Box is more feature rich. No clipboard to copy and paste and no automatic screen resolution features are enough to drive me crazy.
  2. I miss Start | All Programs. It is quite hard to get to “All apps” if you don’t now how. Press the windows button, or drag your mouse to the bottom left corner of the screen and click on a small popup to get to slide mode. Then right-click and in the bottom right there is an All Apps image you can click on.
  3. I opened some slides in an XPS file and they opened on my left monitor. I found I could click and drag the slideset to the other monitor. The application started freaking out and flashing opened and closed on the first monitor.
  4. When I open an application, I am not exactly sure how to close it. Is it like Android and IOS in that I just don’t close it?

Other than that, it feels like Windows 7 with a slightly different theme.

Day 3 Review

  1. I tried to find the power off or restart option. I had to Google it. Rebooting the system was not very intuitive. Perhaps on a tablet, they will have the option come up when pressing the power button, like on my Kindle or my HTC Sensation phone, but when using this as a desktop, it annoying that I didn’t find it. I never expected them to put it in Settings. Here are the steps.

    Step 1 – Go to the very bottom right corner, until the right widget bar opens.
    Step 2 – Move mouse up  Settings.
    Step 3 – Choose Power from settings.

  2. I feel that when using Windows 8 as a desktop, if you don’t know keyboard shortcuts, it is going to be a struggle.