Archive for the 'Programming' Category
One of my fellow Exchange MVP buddies, Bharat (sounds like “Bart”) Suneja is talking about the release of Windows PowerShell 2.0 CTP! Now, before you get overly excited, that CTP acronym stands for Community Technology Preview which is just a fancy name for Beta which is just a pretty name for Broken. So while you should definitely not go buck wild and install this on a production system, kudos to PowerShell team for getting the stuff out into developers hands especially given that the new release supports:
Remoting!!! Jim Harrison and I were talking about this very feature at this years TechEd, and the limitation that seemed almost crippling. Remoting gives you the ability to manage remote systems, execute cmdlets on remote servers which is important because..
You can now write your own cmdlets in PowerShell instead of having to compile .NET code. That in turn is important because:
PowerShell 2.0 comes with a GUI (of sorts) so you can do cool stuff like multiple shells, highlight and run only select pieces of the code..
Now, you do need .NET 3.0 but the boldfaced stuff up threre ought to give you more than enough reason to go get it. If you are new to PowerShell try get-help, if you’re experienced you’ve GOT to check out remoting: get-help About_Remoting
Sorry for the inane fanboyism about this but this level of flexibility and automation is what the PowerShell is all about and it allows organizations that rely on these servers to save a ton of time. It’s really a two-fold benefit. We spend a lot of time automating the documenting our processes in PowerShell since we have gone to Exchange 2007 and now Server 2008 because it enables us to give higher level administrative functions to the jr admins and not worry about them breaking anything. This shrinks our training requirements, makes sure everything is done according to our process (after all, humans make a lot more mistakes than computers).
So go, check it out. If you’re a sysadmin and you’re not yet knees deep in PowerShell I hope you’re working for the government cause you’re becoming obsolete more rapidly than the computer you’re reading this blog on. Go, get your dev on!
Read the whole post...
Happy Programmers Day.
It’s 256th day of the year and I spent all day coding.
I also lost my voice and took 45 minutes to write an 8 line JavaScript… but hey, it’s just programmers day, not good programmers day. So hug your developer! At least its a day for a real profession, unlike the administrative assistant day where we take a moment to appreciate college education and count our blessings that we’re not useless in every facet of modern business life.
P.S. Last comment written to draw ire from the crowd that attacked Karl. I find it hard to believe that none of those useless people read this blog enough to slam me, after all, I’ve met some of you and… man…. 3 + 4 = ice cream if you know what I mean (courtesy: Mark S.)
Read the whole post...
So a little while back I wrote a thanksgiving post explaining how I would never have made it to where I am at today if there weren’t some incredible people along the way kicking my ass to do bigger and better things.
Around that same time I had decided that I would use this large vladville.com megaphone I have to give back and help better someone else… though there is a secret here, that other person has to be hungry, looking to better themselves too. So I figured if there was just one thing, one thing I could offer once a week, to pass some of my skills.. vladville would be a success.
So this first step, related to the AJAX post made the other day, gives you a 10,000 ft view of HTML, Javascript, SQL, Wordpress templates and internals as well as some very basic PHP. It is a simple article, one that you can easilly cut and paste and achieve identical results. That is by all means a huge lie, because learning comes with experimentation and trying new things, coming up with new problems and solutions. But at the very least this will give you a starting point and it is step #1 in a five step program to AJAXify your Wordpress installation and provide Facebook-style status updates.
I hope you enjoy it, click here to read article.
Read the whole post...
When you do professional development for living the complexity of what you have created can get to you. On such days its best to get outside, away from computers.. but if you live in Florida and outside looks like a scene from Coming Global Superstorm: The Day After Tomorrow you look for the stupidest project you can possibly work on, that nobody can hold you accountable for.
For me, that project is Vladville. Lately I’ve been spending a lot of time on Facebook playing the game “Which of my high school friends aren’t dead” and I’ve sort of fallen in love with the AJAX implementation of Facebook status update. It’s just very slick, very easy to use and effortless. So, in yet another effort involving sinking an enormous amount of talent and time into the toilet of productivity, I’ve implemented the same process for Vladville. And I’ve done one better, I’ve tracked the changes and I will be writing a post on how to do this yourself, in an effort to familiarize you with some Wordpress internals.
Hey, if you’re going to lose, lose big. Right?
Step 1: Include jQuery
If you look at my blog, on the upper right hand side there is a box that says “Whats on Vlad’s Mind” and until today that was a hardcoded block of HTML in my Wordpress theme. There are a few steps here.
First step is to actually download, include and enable jQuery and jQuery inline edit plugins. These are simple Javascript libraries that enable pretty AJAX client side effects to work.
Second step is to actually alter the wp_users table that Wordpress uses to store user data and add an extra database field for status. This will hold our current status. I’ve gone an extra step to create another database table to hold the archive of status changes so they can be syndicated through other services. Lose really big. If you’ve done this properly the little tooltip will show up over the container that contains your current status text.

Step 2: Enable Inline Edit
In order to make updates effortless, I’m relying on jQuery Inline Edit plugin as well as Wordpress authentication. It checks if I am logged into this session, if I am, double clicking on the container described above will update the container with the div contents in an editable textarea that I can change on the fly.

Step 3: Change text, Update
More than meets the eye here, thats for sure, but simple enough – type in new text and hit update.

Step 4: AJAX Update
After clicking Update Status button the browser uses AJAX (well, AJAH) to make the call to the backend and update my status. This takes and validates the input, sanitizes it and updates my account in the wp_users table with the new status. It sends that sanitized text back and…

Step 5: New Content Inline
The new content is passed back to the browser that updates the original container with the new update. Each further load of the page includes the status field from my account.

Additional Steps: No stop loss..
I’ve taken a few more extra steps that I intend to expand upon in the detailed writeup, one of the major ones being an explanation of why I’m tying in my status via users table and why I’ve made a separate tracking table.
In a nutshell, the status tracking table is used as a logging table that I can also use to syndicate my status. You can take a look at an XML feed here that shows you last five status updates. This is cool because you can export that data and reuse it elsewhere, such as Facebook. Instead of logging in and updating my status there I can just use the RSS syndication to send my content from Vladville up the stream to Facebook. Or more importantly, SharePoint.
The wp_users part is pretty interesting. Right now I am only checking if $user_id == 1, meaning I just want to enable inline edits if I am the one logged in. Everyone else gets a plain text looking thing. However, lets say I wanted to create a little shoutboard. What if instead of comments I also gave my visitors the ability to update their own status or write something on my board? Same principle, tie the update to the user_id of the currently authenticated user and then update the status field on the backend in the database for everyone else to see, logged in or not.
That, in a nutshell, is the power of Web 2.0, syndicated content and AJAX. It’s also a heck of a way to learn how others write code (Wordpress internals) and at the same time experiment a little for a fun Saturday evening.
And hey, chicks dig it.
Read the whole post...
I am about a billion times more productive on the road, despite being less organized and less resourceful. The other day I was in a hotel room with no wifi, no ability to lookup some javascript function and yet I managed to have better output than I’ve had this morning. In the same amount of time last week I managed to crank out a ton of code, today – well, not quite impressive.
Why?
Cause apparently I have an attention span of a braindead squirrel. I opened up Firefox to look up something quick on the intranet for the dynamics tab section of Shockey Monkey but instead ended up reading an article on the Boeing Dreamliner. Brilliant, and almost 10 minutes gone along with the idea I had before my digg.com homepage came up.
When I get back home to Orlando I am absolutely disabling wireless access on my laptop so I can get some real work done. Something to ponder on how much of a distraction Internet provides on top of regular office stuff.
Read the whole post...
It’s almost 4 AM and I’m sitting around coding in MSN/Live/com IM integration for Shockey Monkey. The basic premise is that the system will IM me when there is a new ticket waiting or when a user had updated/escalated their request. I finished coding this thing about a week ago and it works fairly well for what it is (a dumb sql->messenger gateway) but tonight I sat down to get rid of some annoyances. Here is what I found out.
For the most part, MSNP 9 is the most thoroughly documented implementation out there.
MSNP 9 is also very outdated, and MSN is trying very hard to move/force you up (I think they are on 13 now).
There is a gotcha in the signup process. For example, if you sign up for a live.com/msn.com passport id and initiate the first connection via MSNP 9, you will be prohibited from logging into it with that protocol – forever. However, if your first session is initiated via live.com messenger client (MSN P 10+) you can use any of the higher and lower edition clients.
Also, MSN does not tollerate bots on their network. The proper way to integrate your bot in the MSN network is to do your development/etc via IM Provisioning Center.
Read the whole post...
We have a little saying around the office, “If that patch isn’t committed to the cvs by noon we’re deporting you to India.”
Tonight I decided to get cute and implement some visual effects. I’m ashamed that the stuff below took 25 minutes to produce:
$style = ( $i % 2 ? ‘altrow’ : ‘row’); $i++;
echo “<tr class=\”$style\”
onClick=\”window.location.href=’
/view.asp?item=ticket&ticketid=$tickets[ticketid]‘\”
onMouseOver=\”this.className=’hrow’;\”
onMouseOut=\”this.className=’$style’;\”>”;
I’ve posted it in its entirety so I can be ridiculed at a later date. What took so long? Stupidity as usual, but the longer you go in a stupid direction the longer it takes to figure out just what went wrong in the first place.
The top line just determines which style gets applied to the row in a listing. The idea is to alternate styles so that the table is easier to read. There are two styles here, row and altrow – pretty simple. As I list data I’m using the modulus (remainder after /2) to determine which style gets applied. There are two events that fire – namely when the mouse hovers over the row and when it leaves it. When it hovers, the style ought to be switched to hrow which is my highlighted row. After it leaves, reset the style back to what it was previously.
Then I decided to get cute. I wanted the row color to change as I scrolled up and down the list. I also wanted to be able to click on any inactive space in the row and still take the default action. Again, programming 101. Where I lost the ball game was on the this.style part – this.style takes on all sorts of things like color for example – all except stylesheet name. It took me good 20 minutes to figure out why/where/how before I finally went back to look it up. I suck.
Read the whole post...
Several thousand Microsoft.com visitors come to Vladville every day. Perhaps one of you is doing Internet Explorer development and have to suffer through the debugging, I don’t know, but if any of you work in PSS and are… let’s say ready to sell your stock.. I got $100 for you if you make this your last act before you leave

I don’t know how I’d make it through the day without Dilbert. Some people have coffee, some have Mountain Dew, some have pr0n, some have warez, a side job selling junk on eBay.. whatever it takes to get you motivated and working. For me, thats Dilbert. The sad part is that not a day goes by that I don’t get a live reenactment of a previous strip. It alone gives me enough sense of humor not to kill half of the people I work with.
P.S. Offer not available to the SBS team which has already promised to do much worse.
Read the whole post...
For the past month I have been embarking on a task of replacing myself with a shell script. This isn't as complicated as it seems, turns out I'm very predictable in terms of how I manage the business. The problem is that in the world where there are only 24 hours but I need to work 30 hours there is a need to hand off certain responsibilties to another monkey and hopefully with minimal training be able to delegate some of the responsibility without affecting the result (network up).
So about a month ago I set out to code the NOC management system for Own Web Now and man, did I underestimate just how much stuff happens transparently without really thinking or documenting it. For example, last night I spent nearly two hours writing the function to calculate ticket age. The function itself took about 10 minutes, the debug/test/what if took just shy of two hours. Why? Well, time zones. Leap years. SLA plans.
Here is the context. No client should be knocked out for more than 0.1% of the day – If the monitoring system notices a downed state it opens a ticket. So far so good. Now, the system calculates the time between the initial outage and service restore and if that period is less than 0.1% we're delivering on our SLA. Now let's say the system goes down at 11:58 PM but comes back at 12:04 AM. How is the outage logged? Uhh, it was just down Bob! But, the panel that shows the client flawless performance throughout the week will now have two orange fields instead of just one red one if we dropped the ball.
That makes me look bad even though they were only down for 6 minutes - maybe they were not even down, maybe it was just timing out on my monitor because we only do ping checks for this client. Hrm. Ok. Now, let me widen the range. If the time crosses two calendar days but we meet the SLA on the total outage I only count that as one down, not two separate incidents (as it appears in the overview panel). Ok, now calculate which day had a longer outage and stick the report into that calendar day. Woo! Oh, the field of when the outage happened? Ok, 11:58 PM. But wait, the other function calculates the time by subtracting the resolution time from the open time. Outage interval: -23:54? Ok, throw in another consistancy check.
So as a monkey I really only had the server out for 6 minutes in my head. On a logical evaluation and reporting mechanism I have 200ish lines of code to explain that to the computer. So who is smarter, the monkey or the computer? And people wonder why I keep on calling myself and my staff the monkey force. There was literally a moment last night / this morning where I felt like the gorilla at the opening of 2001 Space Odyssey, thank god there were no bones around me or that monolith would have been beaten.
But here is some value-add for you to thank you for reading all this text: Here is a blog post off digg.com where someone made cheatsheets for web development. Now I've never been accused of being a great developer so this is a total life saver for me. I honeslty do not spend enough time in JavaScript to justify learning all the parameters that XMLHttpRequest object takes. Digg it!
Read the whole post...
Microsoft.com again offers two e-books on Visual Basic as free downloads. The two titles are Introducing Visual Basic 2005 for Developers and Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET. I know, I know, this seems irrelevant but you should check it out. You see, back in VB6 days nearly everyone could be a coder because it was such a simple thing to nearly master - if it was possible, it was possible in a matter of minutes. With .NET and .NET 2.0 things are just as easy and a lot more powerful - but the intrface has changed quite a bit. So get it and catch up on the first few chapters. As for this weekend, there are a few things that have kind of caught my eye. First one is the ifolder server which appears very interesting. Not a server monster? Well, there is some stuff over at multiply.com that appears interesting but not quite useful. Either way, more fun stuff to play with.
Read the whole post...