cheatsheet
I never remember this syntax, so here it is for future reference: To back with a SQL Server database with T-SQL, this is the command: BACKUP DATABASE [YourDb] TO
DISK = N'C:\YourDb.bak' WITH STATS = 1
Be careful with using WITH STATS = 1 on very large databases
The only thing worse than my XPath skills are my RegEx skills. I don’t use XPath all that much these days, but today I needed to. It took me a while to find a code sample that does this. After a playing a bit with SnippetCompiler, I found the solution: StringBuilder builder = new StringBuilder();
builder.AppendLine("<foo>");
builder.AppendLine("<bar baz=\"a\">1</bar>");
builder.AppendLine("<bar>2</bar>");
builder.AppendLine("<bar baz=\"b\">3</bar>");
builder.AppendLine("<bar>4</bar>");
builder.AppendLine("<bar baz=\"c\">5</bar>");
builder.AppendLine("</foo>");
XmlDocument doc = new XmlDocument();
doc.LoadXml(builder.ToString());
XmlNodeList nodes = doc.SelectNodes("//foo/bar[not(@baz)]");
if ( nodes == null )
{
WL("nodes was null");
}
else
{
foreach ( XmlNode node in nodes )
{
...
It’s here… good bye Vista – won’t be missing you. Hello beauty
I just paved my machine with the new RTM of Windows 7 Ultimate. Below is my base image – now it’s time to back everything up to my home server.
Windows Live Mesh
I had to cut Mesh out of my life.... it was hogging too many system resources - especially disk reads. I...
JumpstartTV is another one of these sites that are popping up that offer short and sweet tech screen casting. They offer 5-10 minutes videos covering the basics of a narrow technical topic. JumpstartTV focuses primarily on SQL Server topics, but they do have other material from time to time. I like this because I’m not really a database guy. I’ve designed a built a lot of applications, and therefore I fully appreciate the role the RDBMS plays in an system architecture, but my mind thinks in objects – not relational schema. Today’s topic was SQL Server Properties to Avoid...
I've had to build one of these a few times over the years. If you want a very quick and dirty dropdown of US states in an ASP.NET app, here is the code
1: <asp:DropDownList runat="server" ID="StatesList">
2: <asp:ListItem Value="AL" Text="Alabama"></asp:ListItem>
3: <asp:ListItem Value="AK" Text="Alaska"></asp:ListItem>
4: <asp:ListItem Value="AZ" Text="Arizona"></asp:ListItem>
5: <asp:ListItem Value="AR" Text="Arkansas"></asp:ListItem>
6: <asp:ListItem Value="CA" Text="California"></asp:ListItem>
7: <asp:ListItem Value="CO" Text="Colorado"></asp:ListItem>
...
From time to time I have to break out skills from my past. I needed to solve a few problems today that required a VBS script and a couple of batch scripts. It took me longer than I care to admit to remember how to do this.
So, this post is a reminder for my future self.
Here's how to set a local variable in DOS and use them, as well as how to use a system environment variable (WinDir):
1: SET INTERNAL_ROOT_PATH=D:\foo\trunk
2:
3: svn.exe update %INTERNAL_ROOT_PATH%
4: %WinDir%\Microsoft.NET\Framework\v2.0.50727\msbuild.exe %INTERNAL_ROOT_PATH%\Internal.sln /Property:Config=Release
Here is...