Wednesday, February 25, 2009

My Referee Theorem

Once a year for about 10 years I have spent a weekend locked in an Edmonton High School with a class of North Zone Officials. For the past 2 years I have had an instructor stand up at the front of the room and preach to us about the importance of dedication to officiating. Each time he has told us that Friday and Saturday nights are forfeit from September to March. He attempts to shame the class into never saying no to an assignment and he holds himself up as an example telling us his wife just knows she will have to wait until the summer to spend time with him. Both times I've heard this speech and thought to myself: "well that's a load of crap".

Maybe I'm being unfair, this is an instructor who has accomplished more in officiating than I may even be capable of doing. He is respected and well liked, to the best of my knowledge, and as far as I can tell his wife loves him and respects his choice for free time activities. However, I can't help but think that when you do nothing but referee in your free time you end up worse for the wear.

This year like every other year I went to my clinic and I learnt from the experienced and kowledgable people in that room and I came away from the weekend a better offcial. This year like every other year I looked forward to seeing people I hadn't seen for months. This year like every other year was excited about my first games and about moving up in the ranks. This year however, I did something completely different. Instead of answering phone calls and saying yes to every game offered, I limited myself to no more than 3 games a week. I also limited the nights I would referee so that I always had a concrete idea of when I was going to be on the ice and when I could spend time with my wife and friends. Strangely enough this is the first year in about 5 or 6 years that February has come and gone without me being sick and tired of officiating. For once I go to the arena at the end of the year with a genuine intrest in being on the ice.

When I talk to guys doing 20 or 25 games a month they don't seem to be enjoying themselves anymore. For these officials has it become a second job? Has it become an unlikeable chore? Are they so burnt out by the end of the year that they aren't performing at their peak for the most important games (playoffs)? I know when I used to always say yes that is exactly how I would feel when February rolled around. I'd be burnt out, unexcited and unenthusiastic about going to the arena. I have solved my problem but I think a problem remains.

This year the instructor who delivered the dedication speech also asked us why we thought we were losing officials after only one year of being in the program. At the time I might have said "the abuse from coaches and fans", or I might have pointed out that per hour they weren't making all that much money (I would have been wrong $19 for a atom game is a good hourly rate). But as I happily returned from my game tonight I realized perhaps its not the outside elements that affect these first year officials. Maybe the internal pressure to do as many games as possible is driving them away. Perhaps they are getting the same burnt out, unexcited and unenthusiastic feeling going to the rink that I have had and they don't have enough invested in officiating to keep them interested.

Could this be why we lose referees? Maybe first years and veterans alike are realizing that something that is done mostly for the fun of doing it isn't fun anymore. I suspect if everyone took the same approach as me to doing hockey there would be a serious lack of officials during the busy weeks of the year. I don't honestly believe it is the right solution for everyone, but maybe it is worth looking into limiting the first years number of times on the ice per week. Even just teaching them to take it easy could reduce the drop out rate. This would help spread the hockey around to different officials and would keep guys from spending all weekend at the arena and burning out before the end of the season. I could be wrong, but it helped me.

Tuesday, July 17, 2007

The Code is Killing Me

And now I want it to kill you... Okay I don't want it to kill you.

This is a neat bit of code, I had to create a new local user in Windows XP. Then I had to change two things, I had to add it to the administrator's group and flag it so that the user's password never expires. As you may or may not know the local users and computers on Windows XP is very similar to Active Directory (I still owe you the Authenticate through AD post). However, there are enough differences that all the AD code I found was just the vaguest of hints as to what I needed to do.

You obviously have to use this in Windows form mode. I'll post a screen shot of the form and then the code.


Sorry I've forgotten all the sites and searches I did.



Now for the Code


The formatting (I hope) will be okay. However I don't think you'll be getting colours. If anyone reads this and knows of a program I can use to convert code to html with formatting and colours I would love an e-mail.

Form



Code Behind

namespace AddLocalUser
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void BtnOK_Click(object sender, EventArgs e)
{
if (TxtUserName.Text.Length > 0 && TxtPassword.Text.Length > 0)
{
if (TxtPassword.Text.Equals(TxtConfirmPassword.Text))
{
try
{
DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName +_ ",computer");
DirectoryEntry NewUser = AD.Children.Add(TxtUserName.Text, "user");
NewUser.Invoke("SetPassword", new object[] { TxtPassword.Text });
NewUser.Invoke("Put", new object[] { "Description", "Computer owner" });

//Insert the User.
NewUser.CommitChanges();
//Now change the "UserFlags" so that the password never expires
int iUserAccountControl = (int)ADS_USER_FLAG.ADS_UF_DONT_EXPIRE_PASSWD;
NewUser.Properties["UserFlags"].Value = iUserAccountControl;
NewUser.CommitChanges();
DirectoryEntry grp;

grp = AD.Children.Find("Administrators", "group");
if (grp != null) { grp.Invoke("Add", new object[] { NewUser.Path.ToString() }); }

}
catch(Exception ex)
{
MessageBox.Show("Error: " + ex.Message);
}
}
else
{
LblMessage.Visible = true;
LblMessage.Text = "The Password fields must match";
LblMessage.ForeColor = System.Drawing.Color.Red;
}
}
else
{
LblMessage.Visible = true;
LblMessage.Text = "All fields must be filled out";
LblMessage.ForeColor = System.Drawing.Color.Red;
}
}


(BAH Sorry about the formatting I tried really hard..okay sorta hard)


Explanation


This is an easy bit of code to write. I'll go through it real quick.
DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName +_ ",computer");
DirectoryEntry NewUser = AD.Children.Add(TxtUserName.Text, "user");
NewUser.Invoke("SetPassword", new object[] { TxtPassword.Text });
NewUser.Invoke("Put", new object[] { "Description", "Computer owner" });

//Insert the User.
NewUser.CommitChanges();
This bit is pretty similar (If I'm not mistaken) to the AD version of adding a user. The big difference is using "Environment.MachineName" instead of using your AD server address.

Two DirectoryEntries are used, one for the Directory on your computer. One for the user that you are adding. The CommitChanges() slaps it into the local directory.

//Now change the "UserFlags" so that the password never expires
int iUserAccountControl = (int)ADS_USER_FLAG.ADS_UF_DONT_EXPIRE_PASSWD;
NewUser.Properties["UserFlags"].Value = iUserAccountControl;
NewUser.CommitChanges();
DirectoryEntry grp;

grp = AD.Children.Find("Administrators", "group");
if (grp != null) { grp.Invoke("Add", new object[] { NewUser.Path.ToString() }); }
This is the more interesting part. This changes the user options that we wanted to change. The ADS_USER_FLAG is obtained by referencing ActiveDS, and then of course adding "using ActiveDs;" to the top of your form code.

Your NewUser Directory entry is used again here. Change the .Property["UserFlags"] to the UserControl int you declare above. Here is a big change from AD code, in Active Directory you would use NewUser.Properties[attribute name]. Here we are changing the UserFlags instead.

After that we create a new Directory entry that will represent the group we want to add the user to. "Find" the group we are looking for (Administrators) and then check to see if that group came back to our object correctly. If it did, simply invoke the add function from AD and point it at the path of our NewUser DirectoryEntry.


WOW I hope that made sense, I did not enjoy writing that i must say. I will try to edit it before I post but my brain may liquefy before I finish that.

Have fun Everyone

This comes in in all sizes

Monday, April 02, 2007

Wow

Look at the prices that apple charges for WWDC07. I would have gone on my own dime but it's just too expensive, too bad we aren't a mac shop I could have talked my boss into paying for me.



Music



I just "obtained" a copy of Less than Jake's album "In with the out crowd". There are only horns in 3 songs... this is not the band that wrote "Johnny Quest thinks we're sellouts". Oh well pretty good album, they are planning on touring with Reel Big Fish and Streetlight Manifesto this summer. I'm excited to say the least.



Beer



I went to Brewsters here in Edmonton. I had the Bow Valley Brown Ale (good) and Greg had the River City Raspberry Ale (not my taste just okay). They have a barely wine I want to try one day. I might just buy two bottles try one that day and save one for another day.




I have a little work to do before going to buy OS X for Sirina's old computer

I dream about puzzle quest

Thursday, March 29, 2007

Beer School



Well I was listening again to my podcasts (instead of working?) and I thought I'd do the homework for "Beer School: What's in Nico's Fridge?". I bought myself 4 cans of Kilkenny, (9.$$ at Superstore Liquor store). Carried them home (not very gently) I opened the can and tried very hard to ignore the fact that it sounded like a mouse had just died in it (Thanks Motor). After I cleaned up the mess it made on my counter, I poured myself the glass you see to the left.

I had accidently left the beer on the counter for an hour therefore it was at room temperature. I thought, "What the hell. Isn't that the way it's supposed to be served?". So I sat down with dinner and drank it up.

I thought it tasted awesome, totally nice aftertaste, very creamy, all around excellent. This morning when I went looking to see where the stuff was brewed (Ireland) I noticed that on the can it says: "Serve Ice Cold". I'm going to try one tonight and see what it tastes like, but I don't believe that it will be as good as it was at room temp.

Anyway...



..back to the homework. I donned my safety glasses (not really) my protective gloves (wouldn't even know where to find them) and grabbed my certified scissors (from the stationary isle at Wal-Mart) and cut into the can to get my widget. After washing the head off of the can and widget I took the picture to the right.

It was a very simple round white plastic ball. There is a small hole in either end and it's glued together in the middle like a cheap plastic toy might be. Not nearly as cool as I thought it would be.. oh well. I tried to take some close up pictures of it but it just was too white and they came out really bad. Maybe I'll play in photoshop and see if I can't get them looking a little better.

Thanks Beer School, for giving me a whole evening of entertainment.


PS. John left a comment on the site which I thought was awesome, thanks John for taking the time to respond I await your next show with baited (not really) breath.

The can left no marks

Wednesday, March 14, 2007

Ahhhhhhh!

It has been crazy at work, today the exchange server broke (no one's fault just bad luck) and consequently broke my Events application. Events app in and of itself was hurried and did not go as well as I would have liked. Oh well live and learn, I will do better next time and manage my time better and manage the expectations better.

I've been listening to a podcast called Beer School. As a good Canadian this is a topic that is near and dear too my heart. I've enjoyed the show for the most part however the show with the bartender in it was annoying...

I am looking seriously into a Mac pro I think I will get one in the next month or so. I'm kinda waiting for dual quad core processors. But I think it will be better for me than building a machine of my own.

Anyway I sould go back to work. Enjoy your day.

The twitter it consumes all!

Wednesday, March 07, 2007

I'm back

All 0 of you must be excited I'm making another post. This one will talk about gadgets and macs and podcasts.


Gadgets


I've had my Sennheiser HD 280 pro headphones for a while. These are some amazing headphones, I'm no Alex Lindsay(sp?) so I wouldn't know good sound from fart noise, but these give some amazing sound quality. They sound good with everything I listen to, Rock, punk, Johnny Cash, everything. The only complaint I could see people having is when I listen to what little rap I have, I need to turn up the volume very loud to get any hits from the bass.

I love them, I would buy them again if this set broke, and for the price I can't say that it would break me.

I have to go now as I timed this post poorly but I will try to get back tomorrow and finish up.

Have a nice day you bastard!

Tuesday, January 30, 2007

Again with the Errors

I'm still stupid, I still need to learn the order in which ASP.net renders a page. Always! I mean always! Make sure that if you are assigning data to something (anything) that you check that it is NOT a postback. You can not only get strange thing happening with data containers you just get annoyed and frustrated.

Anyway I'm off

Everything in Moderation