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