Monday, December 26, 2011

Crabmeat Cream Sauce

We made this with lobster ravioli for a special occasion. The original recipe was for about one pound of pasta and in parentheses I've added my changes 3 pounds.
  • 2 ounces of unsalted butter (6 ounces for 3 lbs.)
  • 1 tablespoon of chopped shallots (1 large bulb for 3 lbs.)
  • 4 ounces of chunk crabmeat (8 ounces for 3 lbs.)
  • 2 ounces of Cognac (I substituted Grand Marnier because I had it on hand and used only 2 ounces for 3 lbs. because of its strong flavor)
  • 5 ounces of tomato sauce (15 ounces for 3 lbs.)
  • 10 ounces of heavy cream (30 ounces for 3 lbs.)
  • Salt to taste
In a pan or pot large enough to contain all the liquid, melt the butter and then sauté the shallots on medium heat until they are translucent.

Add the crabmeat and sauté for 2-3 minutes more.

Remove from the heat, add the Cognac, then put it back on the burner. PLEASE BE CAREFUL! The Cognac might ignite and result in a large flame. Don't burn your face off. Sauté for 2-3 minutes more.

Add the tomato sauce, cream, and salt. Cook until it reduces about halfway and becomes thicker.

Add the sauce to the cooked ravioli and let them sit for 1-2 minutes to absorb some of the sauce. Serve immediately.

Peach Cobbler in a Cast Iron Skillet

This is insanely good, especially if you like cast-iron cooking.
  • 6 tablespoons of unsalted butter
  • 1 cup of sugar
  • 1 cup of flour
  • 2 teaspoons of baking powder
  • 1/4 teaspoon of salt
  • 1 cup + 1 tablespoon of whole milk
  • 1 can of sliced peaches with their liquid (I have been substituting 1 jar of Trader Joe's peach halves, minus 2 halves, with about half the liquid in the jar)
Pre-heat the oven to 350 with a 10" or 12" cast iron skillet inside. After the oven is pre-heated, let it continue to heat for another 8-10 minutes.

Mix sugar, flour, baking powder, salt, and milk together into a batter.

Take the skillet out of the oven and melt the butter in it. I find this easier if I cut the butter into 1-tablespoon blocks. Pour the batter into the skillet. Spread the peaches on top of the batter. Pour the liquid on top of that. If you're using a 12" skillet, don't worry if the batter doesn't spread all the way out to the edges--it will rise to about 3/4 of an inch.

Bake at 350 for 30-40 minutes.

Monday, November 7, 2011

Testing Geolocation Locally with Chrome and URIs with file://

If you need to test geolocation in Chrome using local files -- where your URL is going to start with file:// -- you need to throw a switch when you start Chrome.

--allow-file-access-from-files

If you're a Launchy user like me, you can do this by starting to type Chrome, hitting Tab, then pasting in that switch.

This issue is documented and tracked here: http://code.google.com/p/chromium-os/issues/detail?id=13009

Sunday, November 6, 2011

VirtualBox on Mac OS X Lion Running Windows XP and Accessing a USB Drive

File this one under "odd."

While running VirtualBox 4.1.4 on Mac OS X Lion as the host and Windows XP 3 as the guest, I was having some trouble getting my Western Digital Elements external hard drive recognized on the guest. The external was formatted for Windows and all my data was added from a Windows machine, so I could read it from the Mac, but I couldn't write to it. The Mac would recognize the external, but not the Windows guest. If I clicked on the USB icon at the bottom of the VirtualBox window, the external drive would be greyed out.

Oddly enough, if I started the VM first, had the Windows guest window selected, and THEN plugged in the external, XP would recognize it immediately. The host would not recognize it at all.

While the external was plugged into the Mac with my first attempts, I did add a filter for it under Ports > USB, but I'm not sure if that was really part of the solution.

Whatever. It's working!

Friday, October 28, 2011

Moving Thunderbird from a PC to a Mac

This was pure awesome sauce when I heard I could do it.

I had been using Thunderbird on a PC for about two years before needing to move over to a Mac, OS X Lion, to be specific. Thankfully, you can move your Thunderbird profile from a PC to a Mac with hardly any fuss at all.

1) Open up a terminal window. You should be in your user directory by default. If not, get there. The user Library directory is hidden now in Lion, so you have to unhide it with the following command. Once you run this, you can see it in Finder: chflags nohidden ~/Library

2) Exit Thunderbird if you have it running. In Finder go to Users/[user]/Library/Thunderbird/Profiles/[existing default profile]/. Copy the contents of your Windows profile directory into the existing default profile directory on your Mac.

Open Thunderbird and you're done! I had all my emails, my email server settings still worked, and all was well with the world.

As always, make sure you backup anything you're copying over.

Sources:

Thursday, October 20, 2011

Testing for an empty sequence in XQuery

In an XQuery code base I was maintaining recently, all external variables were strongly typed as strings (declare variable $input as xs:string external;). This saved some time and lines of code since we always knew the type of those variables and the code would fail fast if they were not strings.

Unfortunately, the writers of the calling code decided it was too hard to make sure an empty string was passed in for certain cases and they wanted to pass in null, which was translated to the empty sequence. Rather than make edits to many different functions, we edited the main modules to be more defensive.

For some reason I have a hard time remembering how to test for an empty sequence and I also wasn't sure if I could redefine a declared variable in a FLOWR so I wrote the little test snippet below.
xquery version "1.0-ml";
declare variable $input := ();

let $original-input := $input
let $input := if(fn:empty($input)) then "" else $input

return (
element results {
element original-input-empty { fn:empty($original-input) },
element revised-input-empty { fn:empty($input) }
}
)

Monday, August 1, 2011

Freeware and Shareware Tools

I'll always forget about some of these tools primarily because I don't use all of them all of the time.
  • ASP.NET / Visual Studio-related
    • Ankh
    • Castle Windsor
    • CruiseControl.NET
    • ELMAH
    • Enterprise Library
    • FxCop
    • GhostDoc
    • JustDecompile
    • Log4Net
    • NAnt
    • NArrange
    • NCover
    • NHibernate
    • NuGet
    • NUnit
    • PowerCommands
    • Productivity Power Tools
    • Reflector
    • ReSharper
    • Sandcastle
    • StyleCop
    • TestDriven.NET
  • BitKinex
  • CLRProfiler
  • ColorPic
  • DAEMON Tools Lite (mounting CDs)
  • Dexpot (multiple Windows desktops)
  • Eclipse
  • eXist-db
  • FeedDemon
  • Fiddler2 and Fil
  • FileZilla
  • Firefox
    • Add n Edit Cookies
    • BetterPrivacy
    • Firebug
    • Flashblock
    • Google Gears
    • HTTPS-Everywhere
    • Live HTTP Headers
    • SQLite Manager
    • Web Developer Toolbar
    • YSlow
  • FreeMind
  • gVim (been good at opening *really* large text files)
  • GNUWin32 tools
  • HTTrack Website Copier
  • IETester
  • IISPeek
  • IrfanView
  • IZArc
  • Launchy
  • MarkLogic Server
  • Mercurial
  • Notepad++
  • OpenProject
  • Oxygen XML Editor
  • Paint.NET
  • PasswordSafe
  • Pidgin
  • PowerShell
  • Process Explorer
  • PuTTY
  • Remote Desktop
    • Microsoft's Remote Desktop Connection Manager
    • visionapp Remote Desktop
  • Saxon
  • Selenium
  • Skype
  • SQLite
  • Sublime Text 2
    • Package Control
    • Export HTML
    • Format SQL
    • JsFormat
    • Terminal
  • sumatraPDF
  • Textml Server
  • TinkerTool (Mac)
  • Tor
  • TortoiseSVN
  • Unison (Mac)
  • Unlocker
  • VirtualBox
  • VisualSVN Server
  • Web Application Test (WAPT)
  • WebStorm from JetBrains
  • WinMerge
  • XAMPP
  • XVI32
  • 7-Zip
  • Audio and video tools
    • Audacity
    • Handbrake
    • videoLAN
    • XLD
  • Chrome JSON Formatter
  • Chrome Postman
  • Charles Proxy

Tuesday, June 14, 2011

Beware Old Posts

I noticed that many of my older posts are woefully out of date. I added a little JavaScript snippet to warn you about that. There's probably a more elegant way to do this, but it'll work for now.
var message = " <span style='font-size: 20px; font-weight: bold; color: red;'>STOP! This is an old post. Are you sure it's still relevant?</span>";
var currentDate = new Date();
var thisYear = currentDate.getFullYear();
var lastYear = currentDate.getFullYear() - 1;

function stringDoesNotContainYear(myString, myYear) {
return myString.indexOf(myYear) == -1;
}

$(document).ready(function() {
$(".date-header").each(function(){
current = $(this).text();
if(stringDoesNotContainYear(current, thisYear) && stringDoesNotContainYear(current, lastYear)) {
$(this).append(message);
}
});
});

Thursday, May 12, 2011

XQuery Katas

After having several MarkLogic projects back-to-back, I haven't had a new one in far too long. So, to practice my XQuery in the hopes of having a new one soon, I've started a collection of XQuery katas.

The intent of these is less TDD and more brushing up on XQuery, but I'm also interested in testing my functions. To that end you'll see I have my tests built using:
  1. Visual Studio
  2. NUnit
  3. Saxon HE
Meager, but it suits my current needs.

My first kata is up now on BitBucket and I've gotten some constructive feedback from the xquery-talk mailing list. I hope to add more over the next few weeks.

Getting Capabilities from WURFL in ASP.NET

This is one of those things that took me a little too much time to find the first time around.

I'm using WURFL with 51Degrees for mobile device detection in an ASP.NET MVC application. I needed to also detect whether the device using the app is a tablet or not. WUFL has the "is_tablet" capability defined, but this is not a default property on the Browser object.

So how do you get at the value for the current request? It's pretty simple once you see it:

Request.Browser["is_tablet"]

Wednesday, March 16, 2011

Tequila

I'm on a quest for a tequila that is as smooth to drink as Grand Marnier.
  1. paQuí Silvera : Surprisingly, this is a bit easier to drink than Herradura Añejo. It simply has a little less bite. I expected that I would like an añejo more.

  2. Herradura Añejo : It's not quite smooth sipping, but very good with a small piece of ice.

  3. Patrón Silver : Not sure what all the fuss is about here. They're clearly brilliant marketers.

  4. Cabo Wabo Reposado : Essentially donkey urine with artificial sweeteners. I can't believe I actually paid money for this. I couldn't choke down the last few ounces even in a mixed drink so I poured it down the drain, an act I would normally consider heresy.

Launchy, Remote Desktop, Dual Monitors, and Windows 7

I've come to love Launchy -- to the point where I get irritated when it's not installed on a machine I might be working on temporarily.

Unfortunately, when I setup my new machine, I suddenly could not trigger Launchy while using my preferred remote desktop application, visionapp Remote Desktop. I'm not sure if it was my new dual-monitor configuration or Windows 7, but every time I hit Alt+Space it would trigger Launchy on my machine no matter what I did. This was not a problem on XP with a single monitor.

The work-around I found was to change the hotkey combination on the remote machine. I simply changed it to Ctrl+Alt+Space and it worked perfectly! Wish I thought of that sooner!