Tuesday, October 30, 2007

DIG MX Records

Query mx record using default DNS server for operating system:

dig mx tech-recipes.com

Specifying a DNS server to query:

dig @dns1.not_a_real_name_server.com mx www.blogger.com

Friday, October 05, 2007

wxPython - Multiple Panels Without Tab Control

Wanted to display multiple Panels, one at a single time the rest hidden. Without showing the tabs. Found this gem on the wxPython news group from Robin Dunn:

to have no tabs at all but still show a page window? If so, then
you can do that simply but not using the notebook at all when you don't
want the tabs. Just put all the page windows in a box sizer, each with
proportion=1 and wx.EXPAND flag set, and Hide() all but the one you want
to be visible. If you need to change which is visible then Hide() the
current one, Show() the other and call sizer.Layout().

Wednesday, October 03, 2007

C# SqlCommand

Dynamic SQL queries in ADO.Net. How to bind dynamic parameters to a query and avoid concatenating strings. Avoiding problems with cross site scripting attacks. Good link SqlCommand bind parameter info.

SqlCommand cmd = new SqlCommand( @"SELECT something, anothervalue FROM sometable WHERE something > @param1 AND anothervalue > @param2" );

cmd.Parameters.AddWithValue("@param1", "2007-10-02");
cmd.Parameters.AddWithValue("@param2", 5678 );

SqlDataReader reader = cmd.ExecuteReader();
while ( reader.Read() ){
Console.WriteLine( reader["something"].ToString() );
}

Tuesday, October 02, 2007

C# DateTime to String conversion

Found this helpful link on C# DateTime to String Conversion.

Issues with WebDav on Windows Vista

Had to install this patch for things to even work.