Rockscroll Visual Studio Add-in
Posted by Ryan Baxter Tue, 13 May 2008 13:32:00 GMT
Last Friday, Scott Hanselman announced the release of the Rockscroll Visual Studio Add-in. Rockscroll replaces Visual Studio’s code-view scrollbar with a miniature visual representation of your source code. This feature makes navigation in large source files that much easier.
Before Rockscroll, I’d oftentimes make mental notes of the scrollbar’s position while traversing code. That, and when spending a lot of time on a project I’d become so familiar with the source code that I’d begin to recognize most code blocks by shape. Rockscroll provides both of these mnemonic devices, but with less brain work. That is a good thing. Thank you, Rocky Downs. Can I have this in NetBeans? :)
- Meta no comments, permalink, rss, atom
Quote of the Day
Posted by Ryan Baxter Mon, 12 May 2008 15:01:00 GMT
XML is like violence. If it doesn’t solve your problem, you’re not using enough of it.
I got a chuckle out of reading this in a comment on Jeff Atwood’s latest post, XML: The Angle Bracket Tax. The quote is more than fitting for the XML I’ve been working with lately. For the severely twisted, check out the ODF (OpenDocument Format) and OpenXML (Office Open XML) document file formats.
A Few Date Methods
Posted by Ryan Baxter Tue, 06 May 2008 18:45:00 GMT
An ASP.NET project of mine recently required the calculation of the start and end date of the current date’s previous month. This was more difficult putting into words than code. It did, however, get me thinking about other common date routines.
public static DateTime FirstDayOfPreviousMonth
{
get
{
return new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(-1);
}
}
public static DateTime LastDayOfPreviousMonth
{
get
{
return new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddDays(-1);
}
}Being preemptive, I decided to include a few methods for determining the start and end date of the current date’s fiscal quarter. I started by calculating the current date’s quarter. This was accomplished with just a little division.
public static int CurrentQuarter
{
get
{
return (DateTime.Now.Month + 2) / 3;
}
}Finding the start and end dates of the current quarter was harder, but could still be expressed in a single line of code (or two).
public static DateTime FirstDayOfCurrentQuarter
{
get
{
return new DateTime(DateTime.Now.Year, 1 + ((CurrentQuarter - 1) * 3), 1);
}
}
public static DateTime LastDayOfCurrentQuarter
{
get
{
int lastMonthOfCurrentQuarter = 3 + ((CurrentQuarter - 1) * 3);
return new DateTime(DateTime.Now.Year, lastMonthOfCurrentQuarter, DateTime.DaysInMonth(DateTime.Now.Year, lastMonthOfCurrentQuarter));
}
}I’d like to extend this collection to include other common date routines. Feel free to post your date methods as comments if you’d like to share.
*The methods I’ve created for calculating the current quarter’s start and end dates assume the fiscal year starts on January 1st. This may not be suitable for your needs.
- Posted in Code Snippets
- Meta no comments, permalink, rss, atom
Samba Network Shares with Nautilus in Hardy Heron
Posted by Ryan Baxter Tue, 29 Apr 2008 00:50:00 GMT
A couple of days ago I mentioned a few of my woes with the latest release of Ubuntu. Since then, I’ve installed Ruby on Rails and have found a work around for the continued problems I’ve had in accessing my samba shares using the “Connect to Server…” option in Nautilus. If you’re experiencing the symptoms described in bug report #208531, then you might want to give smbmount a try. From the command-line, type:
smbmount //{server}/{share} /home/{user}/{share} -o username={server_username}To unmount the share:
sudo umount /home/{user}/{share}I’m using this as a temporary solution until the bug in Nautilus is resolved. Your mileage may vary.
*The statements above were written under the assumption that you’ve created a folder within your home directory for mounting the share.
- Meta no trackbacks, no comments, permalink, rss, atom
Ruby on Rails with Hardy Heron
Posted by Ryan Baxter Sat, 26 Apr 2008 21:20:00 GMT
This Thursday, Canonical released Ubuntu, Hardy Heron, into the wild. Like many others, I immediately fired up a torrent and began downloading. From what I read of the aftermath, many launch day downloaders were not as lucky. Most Torrent servers became immediately inaccessible due to Hardy Heron’s popular demand. It has been three days and the US update servers are still saturated. This happens every release and can only mean that Ubuntu’s userbase is steadily growing.
My installation went well, but with any new OS release comes problems and Hardy Heron was not an exception. I couldn’t connect to my NAS through Nautilus. None of my browser extensions worked and Ruby on Rails was MIA. I decided to fix Rails first. Here are the steps I took to install Ruby on Rails on Ubuntu, Hardy Heron.
sudo apt-get install rubyAt this point I could not install Ruby on Rails with RubyGems because of the following exception:
/usr/bin/gem:23: uninitialized constant Gem::GemRunner(NameError)I opened up the source file and edited the offending line.
sudo gedit /usr/bin/gemAdding require ‘rubygems/gem_runner’ to the source file,
require 'rubygems'
require 'rubygems/gem_runner'I was then able to update RubyGems
sudo gem install rubygems-updateand install Ruby on Rails and the Mongrel web server.
sudo gem install rails mongrelAt this point I had a working version of Rails on my installation of Ubuntu, Hardy Heron. To get back to work the only thing missing was the NetBeans Ruby IDE. If you haven’t tried NetBeans for your Ruby on Rails projects, I highly recommend it. It’s located in the repos and only takes a few plugins to have Rails support out of the box.
- Meta 3 trackbacks, no comments, permalink, rss, atom
Festo Air Jelly
Posted by Ryan Baxter Thu, 24 Apr 2008 20:08:00 GMT
Amazing. I’d love to see more natural design in programming languages.
- Meta no trackbacks, 2 comments, permalink, rss, atom
System.Drawing.Color Hex Values
Posted by Ryan Baxter Wed, 16 Apr 2008 23:29:00 GMT
Do you know the hexidecimal value of PapayaWhip? How about BlanchedAlmond? Me either. I’m not a big fan of the System.Drawing.Color structure in the Microsoft .NET Framework. I don’t think the addition of color names makes good framework design sense. Unless you’re an Interior Designer; the majority of these colors won’t make sense to you either.
I’ve recently spent time reworking a few design elements of an ASP.NET website. All design related ASP.NET attributes were replaced with Cascading Style Sheets (CSS) where applicable. Unfortunately the website was spattered with named colors from the System.Drawing.Color structure. To help replace these named colors with hexadecimal values, I found the following resource extremely helpful.
http://www.opinionatedgeek.com/DotNet/Tools/Colors/default.aspx
- Posted in Expect the Unexpected
- Meta no trackbacks, no comments, permalink, rss, atom
ASP.NET AJAX Control Toolkit: Transparent Tab Control Images
Posted by Ryan Baxter Thu, 10 Apr 2008 15:18:00 GMT
I’ve found a use for the Tab Control that is included with the ASP.NET AJAX Control Toolkit. The control’s default style is passable for now, but I’ve grown tired of looking at the white borders surrounding active tabs. If your background is not white, you’ve probably noticed this too.
To fix this, I’ve edited the images and posted them here. I’m not sure why the two active tab images were missed when all of the other images have transparent borders. Here are the before and after shots. Please don’t use these.
| Before | After | |
![]() |
![]() |
- Meta no trackbacks, no comments, permalink, rss, atom
Setting Focus in ASP.NET Ajax Pages
Posted by Ryan Baxter Mon, 31 Mar 2008 22:24:00 GMT

At the new job I’ve been using a lot of ASP.NET Ajax to help ease the transition of users from VB6 desktop applications to web applications on our company intranet. In doing this, the UpdatePanel has become my new best friend. Albeit charming, my old ASP.NET 2.0 friends were not as impressed.
With ASP.NET 2.0, came the long-awaited Focus method that allowed developers to set the page focus without having to write any JavaScript. Developers loved it and all was right with the world. That is until ASP.NET Ajax showed up.
I recently spent way too much time trying set the page focus on a page that contained just a few TextBox controls and an UpdatePanel. My site’s ScriptManager was located in a MasterPage, but more on that later. My obligatory googling turned up many work arounds, but none as simple as the following:
// Example
if (Page.IsPostback)
{
// Use the GetCurrent method if your ScriptManager is located
// in a MasterPage. Word.
ScriptManager.GetCurrent(this.Page).SetFocus(TextBox1);
}
else
{
// Here is the money.
AjaxControlToolkit.Utility.SetFocusOnLoad(TextBox2);
}The above example is a two-fer. The ScriptManager’s SetFocus method is handy, but remember that only one ScriptManager is allowed per page and if you’ve put your ScriptManager in a MasterPage, then you’ll need to access it in code using the GetCurrent method of the ScriptManager class.
Two. The ASP.NET 2.0 UpdatePanel is not the only Ajax control. Download the ASP.NET Ajax Control Toolkit. With this toolkit, you’ll have access to dozens of controls and best of all – the SetFocusOnLoad method. Located in the Utility class, the SetFocusOnLoad method is the answer to your !Page.IsPostback problems.
- Posted in Code Snippets
- Meta no trackbacks, no comments, permalink, rss, atom
Boston Dynamics Big Dog March 2008
Posted by Ryan Baxter Thu, 20 Mar 2008 13:40:00 GMT
- Meta 2 comments, permalink, rss, atom



