Monad: Detecting if you are an Admin

One of the LUA tasks I found very frustrating was detecting whether or not I was running as an Admin in a .BAT script.  It’s very difficult to do this correctly and the best way I found was to write a separate program that would determine this for me.  This has a couple of limitation,…


Quick Monad Scripts

Determine if a command exists in your path.  Very helpful when you are writing scripts for mulptiple machines.   $local:cmd = get-command doesnotexist -ea SilentlyContinue if ( $null -eq $cmd ) {   # Action if command does not exist } else {   # Action if command exists }   This will get the…


Shell Scripting with Monad

I spent a bit of my college days in *nix land.  Much of that time was spent writing and maintaining scripts for my various shell accounts.  After I switched to primarily developing on Windows, I was frustrated by the Windows CMD shell and eventually lost interest in scripting.    Lately I’ve been playing with Monad…


Getting HRESULTs back from COM Interop calls

COM interop is one of the messy places where error by return value vs exception meet head on.  COM was built on the basis of HRESULT return values while .NET tends to use exceptions.  To compensate for that, the CLR helps out by mapping failure HRESULTs into .NET exceptions during COM Interop.  It does this…


Assignment vs Interlocked.Exchange

It’s important in multi threaded programs to understand the difference between an assigment operation and Interlocked.Exchange when you are dealing with shared references (memory). The .NET ECMA spec in section 12.6.6 sets that reference assigment (and any other platform word size set) will be an atomic operation (when memory is properly aligned).  I’ve seen some…



It’s very important to read the documentation of this method before actually using it.  A common misunderstanding of this method is that it will throw if the path does not exist.  If Path.GetFullPath() discovers that the directory does exists it will make sure the user has access to the path.  In the abscence of a…


Dos and Lotus 1-2-3 Myth Adam Barr debunks the “Dos aint done until Lotus 1-2-3 won’t run” myth.  Includes links to the recent ones that sufaced about IE as well. 


File System Permissions

While working on a recent bug a question came up about how permissions work on NTFS.  Take the following example directory path c:\University\Fall2005\Homework.cpp Now imagine that our user University\john had the access rights that were specified below.  For completeness assume full control for Local System and Administrators.  University: Read & Execute, List Folder Contents, Read…


New way of dragging and dropping files Check out the video on this website.  The author has implemented a new way of dragging and dropping files in Java and has videotaped a demo.  Interesting stuff


Team System Developer & Test SKUs Public Chat this Wednesday

Don’t forget to join us this Wednesday at 10am PST to discuss the new Team System Testing infrastructure.  Topics include the Profiler, Test Tools (Unit, Generic, Manual), Web Load Testing, and Code Analysis (FxCop & PREFast).  We have questions for you, will answer questions from you, and will chat about the exciting new technology.  We’ll…