Recent Entries:


Blogroll

Interview Questions Every Job Candidate Should Ask

June 17th, 2006

Interviewing for a job shouldn’t be a one-sided activity. The person conducting the interview is expecting some line of questioning from the job candidate. Come to an interview armed with these questions and you will certainly get their attention. I interview a lot of people and the very small minority of them asks any questions at all. Asking a lot of question shows that you have a genuine interest in the job and have the initiative to get the answers you need in order to make informed decisions. Make sure to stay within the time guidelines of the interview as a courtesy.

Human Resources

Company

Job Specific - Any decent software shop should give its programmers the best hardware and software to do the job.

Management - Your relationship with your manager is possibly the most important aspect of your job. Make sure your manager has the management style that fits your demeanor.

I recommend meeting with some of your peers too. Management and human resources will never give you an accurate picture of the current state of affairs but your future comrades probably will.

This is just a guide and there are a lot of different questions that could be asked. Job hunting is a chess match wrought with peril and danger. Come armed to your next interview and get the answers you need to make the right decision.


Dynamically Set Title and Meta Tags with MasterPages

June 14th, 2006

I use MasterPages in all of my ASP.NET websites. I can’t even imagine having a site that doesn’t use them. If you have pages with dynamic content it is important to be updating your page title and meta tags to correspond to the page content. This is probably most important if you have public-facing websites and care about Search Engine Optimization. Thankfully there are a couple of easy ways to dynamically change your title and meta tags.

To begin, add a 3 properties to your MasterPage class (MasterPage.master.cs) to hold the values for title, meta description, and meta keywords.

private string _pageTitle;
public string PageTitle
{
get { return _pageTitle; }
set { _pageTitle = value; }
}private string _metaDescription;
public string MetaDescription
{
get { return _metaDescription; }
set { _metaDescription = value; }
}private string _metaKeywords;
public string MetaKeywords
{
get { return _metaKeywords; }
set { _metaKeywords = value; }
}

Next you will need to edit the head section of your MasterPage.master file to use the properties we just added.

<head runat=”server”><title id=”pageTitle” runat=”server”><%# PageTitle %></title><meta name=”description” content=’<%# MetaDescription %>’ />

<meta name=”keywords” content=’<%# MetaKeywords %>’ />

</head>

Finally you set the properties of the PageTitle, MetaDescription, and MetaKeywords on the OnLoad event of your page. Make sure you keep the call to Page.DataBind().

//Set the title and meta tags.MasterPage myMaster = (MasterPage)this.Master;myMaster.PageTitle = “>myMaster.MetaDescription = “This is the description of my website.”;

myMaster.MetaKeywords = “keyword 1, keyword 2, keyword 3″;

Page.DataBind();


Add Default Item to DropDownList

June 13th, 2006

In many situations when I am using a DropDownList I need to provide a default option for the user. Perhaps there isn’t a relevant value in the list for them to choose or perhaps the List doesn’t apply. In these situations I like to add a default ListItem with an index of 0 to show that nothing has been selected from the list. It is very easy to add a default option to a bound DropDownList and a nice finishing touch to your page.

//Get your DataSet.
DataSet productList = GetProductList();
DripDownList1.DataTextField = “ProductName”;
DripDownList1.DataValueField = “ProductID”;
DripDownList1.DataSource = productList;
DripDownList1.DataBind();
//Add the default item manually.
DripDownList1.Items.Insert(0, new ListItem(”<Select One>”, “0″))

Note: Be careful with Page.DataBind(). If you call this method it will rebind your DropDownList and you will lose the item you just manually added. I banged my head against my desk for about an hour before I figured this out.


List Management with Generic List in .NET

June 12th, 2006

I work with collections of objects very frequently and with version 1.1 of the Framework I would normally use the ArrayList class to manage them. With an ArrayList you are able to hold a collection of just about any type of object but there is no help with type safety. In version 2.0 of the Framework we are able to use Generics which allow us to realize type safety at compile time. Generics allow you to create a data structure without committing to a specific data type. Generics provide type safety but without any loss of performance or code bloat.

I now use the List class to manage my read-only lists. List represents a strongly typed list of objects that can be accessed through an index. List also provides methods to search, sort, and manipulate a collection of objects. Here is simple example of List usage:

using System.Collections.Generic;

List<Book> books = new List<Book>();
Book b = new Book();
b.Author = “Anthony Bourdain”;
b.Title = “Kitchen Confidential”;
b.NumberPages = 300;
books.Add(b);

b = new Book();
b.Author = “George Orwell”;
b.Title = “1984″;
b.NumberPages = 200;
books.Add(b);

foreach (Book book in books)
{
Console.WriteLine(book.Title);
}

List implements the IList interface which is the minimum interface required to implement a binding-capable list data source. Therefore you can bind a List as a non-editable data source. Using our previous example we can now bind this list to a data source.

Repeater1.DataSource = books;
Repeater1.DataBind();

I recommend dumping the usage of ArrayList and refactoring your code to utilize the List class.


Netvibes RSS Aggregator

June 8th, 2006

I have about 30 RSS feeds in my rotation at any given time. I know, 30 feeds isn’t necessarily a lot but they can still become hard to manage. When it comes to reading my feeds I am pretty particular of my RSS reader and I seem to cycle through readers pretty quickly. Here is a brief list of the features I usually look for:

I was previously using the Google reader but it was lacking on a few features so I decided to give Netvibes a shot. Netvibes easily satisfies my minimum requirements and even offers some additional perks I wasn’t expecting. My single favorite feature is the ability to navigate Netvibes with your keyboard. Netvibes has many additional features I have yet to try and with a busy ecosystem they are always coming out with new modules. Here is an abbreviated list of modules that come with the standard setup:

This isn’t to say that Netvibes is without faults. Netvibes is very web 2.0 - almost too much. Every action you take is done asynchronously and at times I feel this takes away from the experience. The synchronization of the blogs operates on a timed basis and inevitability fails after my browser has been open for a few hours.

These minor complains aside I still feel Netvibes is a winner and once you are accumstomed to the Ajaxiness of Netvibes it is a really nice experience. Perhaps Netvibes is just what this finicky cat has been looking for.


« Previous Page