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,…

1

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…

0

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…

4

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…

1

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…

0

Path.GetFullPath()

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…

1

Dos and Lotus 1-2-3 Myth

http://www.proudlyserving.com/archives/2005/08/dos_aint_done_t.html 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. 

0

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…

3

New way of dragging and dropping files

http://liihs.irit.fr/dragice/foldndrop/ 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

0

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…

1