Category Uncategorized

Links for the week

General

7 Steps to Zap Your Creativity – Dumb Little Man shares tips for giving your creativity a quick pick me up. Some of it might be common sense, but it’s always good to get a refresher on what you can be doing to be more creative. Regardless of profession, creativity is a vital part of doing a great job.

Microsoft BizSpark Program – BizSpark is a program intended to help startups get off the ground using a Microsoft platform for their business needs. It includes support from Microsoft, development licenses, and increased public exposure. The price? $100 when you exit the program. (No, boss, I’m not looking to leave the company.)

Semantic Hacker – Semantic Hacker is intended to help with the semantic discovery of information – “I’ll know it when I see it” discovery. In addition, it is capable of generating a ‘semantic score’ for a given block of text. Supposedly, this has some advantages over some of the current techniques for scoring search results. I’m interested to see where this one goes.

Microsoft Store – Really cool. Microsoft have realized that I, a geek, might want to just download my copy of Office rather than order it online or find a copy at Best Buy. Convenient, moderately attractive site.

Development

PDC Sessions broken out by topic – I think this is a sub-section of the PDC sessions, but it has been broken out by relevant topic. Very useful if you’re trying to track something down but aren’t sure which day it occurred on.

SQL Server

Unique indexes with GROUP BY – Rob Farley explains the importance of unique indexes. I’ll be using this one when I teach an introduction to SQL to the new hires at my employer. This also includes a little bit of help on how to read execution plans (a subject I don’t know enough about).

Join Simplification in SQL Server – Rob gets another mention this week for his great introduction to JOINs. These topics are old hat to many people, but they’re still good to keep around as references to those out there who aren’t as familiar with JOINs or who need a refresher (a lot of developers can use joins but don’t fully understand them).

How I Manage Workload

Honestly, I was inspired by the latest ‘issue’ of Capt. Varchar(MAX) and the Pagelatch Posse to write about how I manage my workload.

I used to scribble tasks down on sticky notes and stick them to the bottom of my monitor. This worked when I was only working on one project/task at a time and could break things down into linear tasks. As my workload and responsibilities increased, this method fell apart pretty quickly. Before long, my monitor looked like a sunflower made of sticky notes. Changing the priority of a task meant rearranging the sticky notes and heaven forbid that I have to take them all off and rearrange them and drop them on the floor in the process.

From the mess of sticky notes, I switched to using a pad of paper and making to do lists. This rapidly turned into a “wish I could do” list and I stopped using this technique, in favor of trusting my exceptionally rusty memory.

A few major mishaps later it was determined by everyone involved that my memory couldn’t be trusted. This is around the time that I found out about Getting Things Done. I attempted to work the GTD magic fully and it didn’t really work well for me. Something about it never clicked, maybe because I’m not an email person for tracking tasks – most people will send requests for 4 or 5 things in a single email and that makes it difficult to track my work load.

These days I use a 5×8 spiral bound notebook. At the beginning of each week, I start a new page and write the date at the top. Every to do item gets an empty box drawn next to it. When I finish that item I check it off. I carry this notebook everywhere I go, so this method works well for me.

Just to make sure I hold myself accountable to the people who request work from me, I use outlook tasks. When a request comes in via email, I immediately mark that email for follow up today. Tomorrow it will turn red in my in box and I can readily see which tasks I should have already finished. I don’t mark the task as finished until I’ve actually emailed the original person and told them that everything is complete. This works particularly well for tracking stored procedure/database change requests.

It’s not the best system on earth, but it works for the moment.

Any better ideas out there? Let me know in the comments.

PASS Ambassador

As a chapter leader (chapter leader of CBusPASS, the Columbus chapter of PASS), I was asked to volunteer at the upcoming Summit. I happily volunteered from 10:00AM to 1:30PM on Wednesday, so if you see my smiling face wearing a bright red vest stop by and say hi. I’ll be more than happy to direct you somewhere if you need me to and I’ll definitely be more than happy to shoot the breeze, too. Basically, ambassadors help people find their way around and locate various events, parties, booths, et cetera.

If you’re going to be at PASS and would like to help out, contact Sanjeet Gandham to volunteer to be an ambassador.

PASS also needs data entry volunteers to help entering speaker evaluation data. If you can help out for an hour or two here and there, send an email to Marcella Santoso at PASS HQ for more information. There are plenty of time slots available.

Make sure to include your full name and cell phone number so that PASS can get a hold of you.

Links for the week

Brent Ozar provided the inspiration for this blog post and the others that will follow. Essentially, the goal is to put together a list of the most interesting/entertaining links that I’ve found in the last week. If you’re easily offended by SQL Server, I suggest you turn away now.

5 Quick Tips for the Query Using the ‘Wrong’ Index – Quick tips from Jason Massie about making sure the ‘correct’ index is being used by the query engine.

What is a ‘good’ SQLServerPedia article? – Brent covers what makes for a good article on SQLServerPedia. Shockingly, this covers what makes for any good technical article.

Constraint Yourself!Joe Celko put together a great introduction to the intricacies of using constraints not just for verifying data integrity but also to ensure that business rules are implemented in one place, in one way, and at one time.

7 Steps to Shameless (Successful) Self PromotionJeff Blankenburg covers the basics of promoting your personal brand. Not just from the standpoint of having a better blog, but how to cultivate your brand and brand recognition offline too.

Career Guidance: Become a More Successful IT Professional by Managing Your Own Personal Brand Within Your OrganizationBrad M McGehee covers the same topic from the standpoint of building your brand within your organization. But the same rules apply whether you’re building your brand inside your company or throughout the community as a whole.

That’s it for this week.

Custom Sorting ArrayLists

A co-worker approached me with the problem of sorting an ArrayList of ArrayLists. Normally you might handle this in a DataTable or entity collection in your particular ORM. In this case, this was the data structure that was available to sort:

[[sortorder][type][message]
 [sortorder][type][message]
 [sortorder][type][message]]

Knowing a little bit about how ORM tools work, I made the guess that they implement a custom comparer to perform this functionality, so I took a look at what it would take for this instance.

This turned out to be a lot easier than I thought, you need to create a class that implements IComparer and pass an instance of that class to the Sort method of the ArrayList.


public class CustomArrayListComparer : IComparer {
    int IComparer.Compare(object x, object y) {
        return ((int)((ArrayList)x)[0]).CompareTo((int)(ArrayList)y))[0]);
    }
}

// example:
myArrayList.Sort(new CustomArrayListComparer());

I know that the above code looks somewhat unreadable, but for the sake of the efficiency of the sort operation, all casting is done in place. It’s necessary to cast objects x and y to an ArrayList in order to access their collection of objects. Since we know that, in this case, the 0th item in the ArrayList is an int, that is cast to an int and the Int32.CompareTo() method is used.

Navigating Code with VS2008

Here are a few keyboard shortcuts in Visual Studio 2008 that I’ve recently (re)discovered:

  • CTRL + - Move to the last position in code.
    This is very helpful if you’ve been jumping through a file while searching for a particular function, variable, whatever.
  • CTRL + SHIFT + - Just like the above, but in reverse.
    This moves forward through code, if any forward position is available. Otherwise you’ll just wonder why you’re pressing CTRL + SHIFT + – over and over.
  • CTRL + K, CTRL + K Add a new bookmark.
  • CTRL + K, CTRL + N Move to the next bookmark in the file.
  • CTRL + K, CTRL + P Move to the previous bookmark in the file.
  • CTRL + K, CTRL + L Clear bookmarks
  • CTRL + K, CTRL + C Comment line(s).
    Comment out the current line or selected lines. Take note, this will not put a comment at the beginning of empty lines, which drives me nuts.
  • CTRL + K, CTRL + U Uncomment line(s).

The bookmark functionality is great when you’re focusing on refactoring several common code blocks that have subtle differences and you want to make sure you account for all edge conditions when you’re combining them into a single method.

Fast VPC boot times

Sick and tired of virtual machines booting slowly? Yeah, me too. I’m impatient.

Apparently Greg Low was even more annoyed at it than I am and wrote a post about Virtual PC performance using flash drives.

Essentially, use a sizable flash drive to make your Virtual PC boot twice as fast. 2x the fun! 2x the productivity! 2x the USB slots!

Missing cookies in jQuery AJAX callbacks?

For my current project, we’re making use of a large number of jQuery AJAX callbacks, as well as cookies, to deliver some rich functionality to the users of a web site. Unfortunately this created a little bit of an issue when trying get this to work in IE7.

Here’s what I originally attempted:


function do_something() {
  $.ajax({
    url: 'http://example.com/AjaxRocks',
    type: 'POST',
    dataype: 'json',
    success: success_response
  });
}
function success_response(json) {
  var cookie_data = load_data_from_cookie(); // the implementation of this is not important
  // unfortunately, cookie_data is null so this doesn't really give us the important cookie_data
}

For some reason, the full contents of document.cookie are not available from inside the success_response function call. The solution? Load the cookie’d data before making the AJAX call:


function do_something() {
  var cookie_data = load_data_from_cookie();
  $.ajax({
    url: 'http://example.com/AjaxRocks',
    type: 'POST',
    dataype: 'json',
    success: function(json) {
      success_response(json, cookie_data);
    }
  });
}
function success_response(json, cookie_data) {
  // do something successful
}

This site is protected with Urban Giraffe's plugin 'HTML Purified' and Edward Z. Yang's Powered by HTML Purifier. 401 items have been purified.