Old Skool Tools

I have been going back and listening to old skool Hanselminutes.com podcasts. Show#8 points out some free tools that may still be somewhat useful:

  • TeamViewer
    TeamViewer connects to any PC or server around the world within a few seconds. You can remote control your partner’s PC as if you were sitting right in front of it.
  • cr-documentor
    DXCore plugin for rendering real-time XML documentation comment previews.

Hurricane Ridge, Olympic Nat’l Forest

Here are a couple stitched panorama shots. MS Research’s ICE was used to do the stiching, and it is pretty cool and easy.

Stitch 1
Photo: 11MB
Stitch 2
Photo: 18MB

PLEASE NOTE: These panoramas are big. The files may take a bit to show in the lightbox pop-up, and they may still be tough to see. It may be best to just “right-click, save as” or “right-click, open in new tab” to view them.

The first panorama is 7 individual shots stitched together. The second is 13 stitched. ICE lets you drag and drop the photos and it figures out how to do all the stitching for you. Pretty amazing stuff.

Cool new MS toys

I recently found out from a friend about MS Research’s Pex. There is some pretty cool stuff you can do with Pex, and the addition of Moles looks like it could be a pretty awesome testing suite. I have only scratched the surface of these tools.

Another cool new toy is NuGet. NuGet offers Gems-like package management for .Net. Cooler still is it is integrated into Visual Studio. You get a Powershell experience within VS to manage your packages. There is a brief intro video from Phil Haack, but I preferred David Ebbo’s extended tutorial.

Hobbscene 2.0

Well, the Oxite MVC blog test failed. It was difficult to work with and they are changing it so drastically and there is so little documentation, I just decided to scrap it. I tried to go for a .NET engine, but in the end I went with the tried and true. If it ain’t broke I guess.

I am going to slowly manually convert each old Oxite post over to the new blog. Here goes nothing….

[EDIT: Thank you, Google cache. I did not have many posts anyway, so I was able to copy/paste them from the cached versions. Of course, the other content was not accessible, but I have it all on my laptop anyway. I'll get that all transferred over sometime in the near future. Some links may not work until then. Sorry...]

CSS Demo

Someone asked me to show them how to do something via CSS, and this is the example I came up with. Thought I’d post it on here for posterity:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
    <style type="text/css">
        /* Layout */
        body { margin: 0; padding: 0; }
        #container { position: relative; top: 0; left: 0; width: 100%; height: 100%; }
        /* The header and search windows are just normal divs */
        #header { height: 40px; margin: 0; padding: 10px; }
        #search-box { height: 20px; padding: 5px 10px; }
        /* Content "top" is total height of header and search-box heights (including padding) */
        #content { position: fixed; left: 0; right: 0; top: 90px; bottom: 60px; }
        /* These elements are contained within the content div, so we can "absolutely" position them within the container
        If an element is within a positioned element, "absolute" postion is actually relative to the container!?! */
        #nav { position: absolute; top: 0; left: 0; bottom: 0; width: 200px; }
        /* Here we position the nav menus relative to the container */
        #nav-1, #nav-2 { position: relative; left: 0; height: 50%; overflow: auto; width: 180px; padding: 0 10px; z-index: 9999; }
        /* The content div is also absolutely position inside. The overflow allows us to have the nice scrollbar effect */
        #main { position: absolute; top: 0; left: 200px; right: 0; bottom: 0;  overflow: auto; padding: 10px; }
        /* The footer is absolutely position on the page at the bottom of the window */
        #footer { position: fixed; left: 0; right: 0; bottom: 0; height: 40px; margin: 0; padding: 10px; }
        /* Design */
        #header, #nav, #footer { background: #666; color: #FFF;  }
        #search-box { background: #CCC; }
        #search, #search-results { display: none; }
        #header h1 { margin: 0; padding: 0; }
        #search-box p { margin: 0 0 5px; }
        #main h2 { margin-top: 0; }
        #footer p { text-align: center; }
        /* BlockUI */
        div.blockMsg { background: #FFF; border: 3px solid #CCC; padding: 10px; }
    </style>
</head>
<body>
    <div id="container">
        <div id="header">
            <h1>Hello World!</h1>
        </div>
        <div id="search-box">
            <p><a href="#">Search</a></p>
            <p id="search"><input type="text" id="search-val" name="search-val" value="Search" />
                <input type="submit" id="search-submit" name="search-submit" value="Submit" /></p>
        </div>
        <div id="content">
            <div id="nav">
                <div id="nav-1">
                    <h3>Top Nav</h3>
                    <ul>
                        <li><a href="#">Nav Item</a></li>
                        <li><a href="#">Nav Item</a></li>
                        <li><a href="#">Nav Item</a></li>
                    </ul>
                </div>
                <div id="nav-2">
                    <h3>Bottom Nav</h3>
                    <ul>
                        <li><a href="#">Nav Item</a></li>
                        <li><a href="#">Nav Item</a></li>
                        <li><a href="#">Nav Item</a></li>
                    </ul>
                </div>
            </div>
            <div id="main">
                <h2>Welcome!</h2>
                <p>Quisque lobortis arcu ut augue molestie dignissim. Sed ipsum leo, tristique ut placerat ut, gravida sagittis est. Ut pharetra adipiscing sem, ac viverra arcu tristique at. Aliquam sed massa eu sem porta consectetur. Donec convallis, sem vitae laoreet faucibus, sapien nulla lacinia mi, ac tincidunt lectus quam nec purus. Sed tristique sapien non leo adipiscing eu porta justo tincidunt. Quisque quis vestibulum quam. Etiam ligula sapien, pharetra quis mollis in, faucibus non elit. Etiam fermentum tempor nunc et auctor. Morbi id leo tempor justo placerat accumsan at sit amet odio. Nunc tincidunt molestie aliquam. Phasellus ligula libero, auctor id tempus id, mollis a mauris. Sed eget sodales leo. Sed eget sem id nibh tincidunt semper non a arcu. Proin vel purus in diam congue tincidunt. Nam vitae augue lorem. Nam nec massa id turpis egestas tempor nec in neque. Nam pulvinar odio sagittis lectus feugiat hendrerit. In a erat lectus. Nulla ut purus sapien.</p>
                <p>Curabitur sollicitudin, dolor non sodales tempus, justo erat volutpat tortor, ac mollis dui urna id massa. Aliquam lorem metus, commodo sit amet sodales sit amet, accumsan ut felis. Sed felis nisi, pellentesque a adipiscing sit amet, sagittis a justo. Proin rutrum nunc sit amet eros bibendum sed rhoncus ligula sagittis. Maecenas consectetur, sapien a varius dictum, elit dui molestie erat, eu aliquam felis massa nec orci. Maecenas nec dui arcu, in elementum elit. Suspendisse in enim id tellus feugiat porttitor at et tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus id ipsum lorem, vel ullamcorper mi. Curabitur id odio eu quam faucibus commodo sed ac eros. Cras vel nulla in tellus cursus pellentesque. Donec magna purus, viverra non tempor ac, convallis et erat. Mauris ultricies nisl vel elit pretium et eleifend ligula commodo. Integer quam nulla, aliquam id malesuada eu, semper in mauris.</p>
                <p>Quisque sollicitudin suscipit sapien, in rhoncus sapien gravida eget. Duis at fermentum metus. Donec dui lacus, fringilla ut bibendum eu, laoreet vitae nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In a quam mi, eget faucibus nulla. Mauris viverra consectetur ante nec mattis. Nunc porta mi et purus convallis dignissim luctus urna ultricies. Vivamus metus neque, malesuada laoreet imperdiet non, tincidunt lacinia massa. Ut at lorem et dolor accumsan lobortis quis eu mi. Aliquam pulvinar gravida hendrerit. Duis ac ipsum neque. Phasellus vel mi sed justo feugiat auctor. Phasellus porta, turpis ornare rutrum porta, orci tortor tincidunt dolor, id volutpat justo erat non est. Phasellus dapibus tristique feugiat. Curabitur fermentum vehicula mauris ac accumsan. Sed hendrerit est vel turpis blandit sed sollicitudin quam accumsan.</p>
                <p>Fusce pharetra, eros id pharetra dapibus, lorem nunc facilisis libero, in tristique est ante et lacus. Donec eu nisi in augue blandit euismod. Maecenas tristique dapibus dolor, ut placerat nisi vestibulum id. Nulla feugiat, purus vitae auctor cursus, tellus lorem accumsan risus, id accumsan ante nulla id nisl. Proin ut lectus mollis tortor dictum venenatis. Vestibulum quis enim in purus condimentum viverra. Sed consectetur ullamcorper leo, vitae hendrerit sem varius et. Etiam consectetur metus vel dolor posuere eget porttitor metus facilisis. In bibendum, ipsum nec fermentum hendrerit, mi sem consectetur ligula, et luctus purus velit in sapien. Proin eget nibh id magna porttitor accumsan. Morbi scelerisque elementum massa et malesuada. Sed consequat tempor urna blandit egestas. Maecenas bibendum dui ac enim rutrum iaculis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam tempor mattis tellus, ac luctus dui mattis non. Pellentesque imperdiet facilisis orci, consectetur dictum velit eleifend in. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur pellentesque ullamcorper est. Curabitur vel ipsum sit amet mi porta gravida. Sed ut libero neque, rhoncus eleifend diam.</p>
                <p>Donec rutrum, sapien sed laoreet volutpat, quam nisi scelerisque odio, a posuere sem nisl ac justo. Etiam a venenatis elit. Ut mattis, odio aliquam pellentesque fermentum, dui metus interdum dui, a ultricies dolor dui id sapien. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut in arcu a velit volutpat sollicitudin. Nulla pharetra diam at nisi varius rutrum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras posuere dignissim velit vel scelerisque. Ut vel nibh nulla. Maecenas eleifend, orci sed cursus tincidunt, diam lectus vestibulum libero, id tincidunt enim mauris quis metus. Praesent ullamcorper accumsan felis, et molestie ligula egestas eget. Morbi auctor placerat sodales.</p>
                <p>Aenean euismod commodo sem in ultricies. Sed sed eros sem. Nunc a blandit ipsum. Vestibulum ante urna, vulputate sed pretium eu, posuere a massa. Nunc pellentesque venenatis odio, ac rhoncus odio sollicitudin sit amet. Praesent dui felis, euismod eget tempor vel, mattis et ligula. Vivamus adipiscing pellentesque luctus. Curabitur vitae iaculis nulla. Cras laoreet, urna tincidunt ornare fringilla, odio ante varius mi, ut imperdiet lectus quam vitae magna. Nam sagittis diam sit amet velit tristique lobortis. In hac habitasse platea dictumst.</p>
                <p>Duis dapibus molestie neque sed sollicitudin. Duis lorem lectus, gravida ut accumsan sit amet, aliquet sed libero. Aliquam at nisi dolor. Cras vulputate ipsum ut mauris ullamcorper sed elementum neque tristique. Nam enim leo, gravida id sodales id, euismod in lacus. Quisque justo lacus, facilisis dapibus mollis in, rutrum in est. Nullam sit amet nulla ante, non congue sem. Duis id suscipit purus. Nunc pulvinar, mauris sed aliquet aliquet, dolor ipsum suscipit massa, vel sodales mi mi eget ante. Nunc convallis hendrerit luctus. Aliquam accumsan lorem et velit gravida mattis. Donec sed sapien ac magna molestie condimentum. Suspendisse sed orci ac erat dictum laoreet sed vitae sem. Pellentesque quis mi leo. Curabitur pulvinar faucibus dapibus. Praesent id turpis id odio laoreet sollicitudin id non nisi.</p>
                <p>Suspendisse malesuada aliquam mattis. Vestibulum iaculis venenatis lectus, nec aliquam nunc ultrices id. Nullam quis nulla in ante rhoncus rhoncus vitae eget odio. Nunc molestie, nunc eu lobortis consectetur, odio mi cursus turpis, sit amet pulvinar arcu leo at diam. Mauris sit amet nibh elementum purus semper venenatis ac et neque. Etiam porta massa felis. Aliquam a urna vel massa facilisis dapibus. Nunc elit velit, ultricies non faucibus vel, cursus dapibus dui. Suspendisse potenti. Duis pretium est elementum leo eleifend tincidunt. Ut facilisis tincidunt orci, vel placerat massa porttitor id. Proin sit amet risus sed eros gravida varius non non elit.</p>
                <p>Quisque mattis lobortis auctor. Ut at accumsan libero. Sed tincidunt, erat sed iaculis mollis, libero nulla cursus nunc, quis pellentesque ipsum nibh ac nisi. Nulla facilisi. Vestibulum eget urna et nulla lobortis pulvinar in non ipsum. Praesent interdum lectus quis ligula consectetur vel placerat neque rhoncus. Suspendisse ac erat sed leo eleifend tempus. Donec mi enim, venenatis vitae sodales id, malesuada eget lacus. Nullam tincidunt pulvinar lectus, vitae vehicula purus sollicitudin semper. Etiam et erat mi, egestas egestas dolor. Morbi nisl ligula, dapibus et tristique ut, faucibus vel mauris. Curabitur vel ante dolor.</p>
                <p>In a est orci, sit amet suscipit lectus. Ut luctus interdum enim, eu sodales libero malesuada non. Donec sollicitudin risus sit amet mauris pharetra a ultricies neque blandit. Praesent vehicula lobortis vulputate. Etiam at lectus et est viverra facilisis ut id odio. Nulla augue nulla, vehicula vitae sollicitudin at, consectetur ut magna. Integer ac nibh et metus facilisis fringilla. Proin rutrum purus eget risus hendrerit auctor. Nullam mi felis, ullamcorper sed pellentesque a, suscipit quis elit. Morbi laoreet aliquam nisi, sollicitudin molestie ante sollicitudin quis. Nullam et venenatis neque. Donec non hendrerit tortor. Donec commodo magna at arcu luctus nec cursus nulla interdum. Aenean placerat scelerisque ligula, feugiat vestibulum mauris fermentum nec. Phasellus libero dolor, rutrum vitae lacinia quis, pretium non ipsum. Ut eget dolor libero, sed vehicula nisi. Nunc porta nisl non urna congue sit amet malesuada mauris tempor. Sed condimentum lacinia purus at porttitor. Maecenas accumsan lobortis ante at ullamcorper. Mauris augue nisl, tristique eu consequat a, dignissim ac augue.</p>
                <p>Duis adipiscing metus velit, quis dapibus diam. Morbi sollicitudin placerat vulputate. Ut ut felis nibh, quis tincidunt massa. Donec eros nisl, scelerisque nec ultricies sed, vulputate a turpis. Integer leo massa, condimentum sed luctus nec, tempor in tellus. Praesent nec leo quam. Sed dignissim imperdiet mollis. In vulputate lorem at magna molestie posuere. Sed ut eros at urna scelerisque tempor. Praesent vel urna purus. Vivamus sed tortor sit amet neque adipiscing porta. Praesent ac egestas tellus. Mauris leo erat, tincidunt eu tincidunt vitae, dictum in purus. Aenean semper, erat quis dapibus ornare, massa dolor ornare diam, a ultricies nunc augue in ligula.</p>
                <p>Nulla aliquam velit nec arcu commodo egestas sed in diam. Quisque tincidunt tincidunt odio, vitae pellentesque massa placerat eget. Donec at neque nulla. Ut eget erat quam. Mauris eu pellentesque dolor. Nam facilisis justo a risus elementum interdum. Pellentesque ligula eros, posuere sed hendrerit vitae, lacinia a eros. Sed nec purus lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus non sapien ut erat volutpat viverra vitae at est. Morbi vel pellentesque nibh.</p>
                <p>Pellentesque vel magna at augue ullamcorper pretium. Sed lacinia hendrerit vestibulum. Vestibulum rutrum porta placerat. Fusce vitae felis sit amet justo aliquam iaculis in nec dolor. Donec ac ligula neque, sed tristique lorem. In viverra feugiat magna, at hendrerit quam lacinia in. Fusce id dui ligula, ac convallis diam. Fusce tempus, arcu id varius rutrum, metus velit ullamcorper massa, nec posuere nisl eros dictum nulla. Donec eget tincidunt nisi. Nam quam nunc, dapibus quis luctus nec, semper ut nulla. In metus sapien, dictum rhoncus tincidunt eu, lobortis non massa. Maecenas a metus eu dolor dapibus convallis eget pretium tortor. Donec lobortis semper bibendum.</p>
                <p>Suspendisse euismod mi non enim posuere venenatis. Quisque sed felis nunc. In sem elit, vestibulum ac euismod vel, condimentum id lectus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut dignissim faucibus varius. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pulvinar dignissim nulla, vitae rutrum dui cursus dapibus. Maecenas sem arcu, fringilla quis iaculis eget, consequat ac nunc. Vivamus id ligula orci, in interdum lectus. Vestibulum tincidunt lacinia mauris, eget venenatis erat hendrerit sed. Pellentesque non dolor risus. In hac habitasse platea dictumst. Etiam at mi justo. Aenean quis odio sed erat mattis rhoncus.</p>
                <p>Aliquam erat volutpat. Aliquam lacinia nisl vel orci egestas id pellentesque purus lacinia. Sed ultricies condimentum mi, sed laoreet purus iaculis nec. Donec et ipsum velit. Etiam tincidunt aliquam tellus sed ornare. Mauris cursus varius odio luctus blandit. Sed vel risus leo. Vivamus fringilla interdum varius. Suspendisse et tortor mi. Fusce ut metus nibh, et fermentum massa. Quisque a enim ac urna interdum rhoncus vel vel nulla. Quisque dictum mauris sit amet mi euismod a semper leo auctor. Etiam faucibus convallis quam, id bibendum dolor ornare vitae. Praesent sed purus non ligula adipiscing condimentum ut non leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
            </div>
        </div>
        <div id="footer">
            <p><em>© Footer!</em></p>
        </div>
    </div>
    <div id="search-results">
        <h2>Search Results</h2>
        <p>You searched for <em id="search-term"></em></p>
        <p>In a est orci, sit amet suscipit lectus. Ut luctus interdum enim, eu sodales libero malesuada non. Donec sollicitudin risus sit amet mauris pharetra a ultricies neque blandit. Praesent vehicula lobortis vulputate. Etiam at lectus et est viverra facilisis ut id odio. Nulla augue nulla, vehicula vitae sollicitudin at, consectetur ut magna. Integer ac nibh et metus facilisis fringilla. Proin rutrum purus eget risus hendrerit auctor. Nullam mi felis, ullamcorper sed pellentesque a, suscipit quis elit. Morbi laoreet aliquam nisi, sollicitudin molestie ante sollicitudin quis. Nullam et venenatis neque. Donec non hendrerit tortor. Donec commodo magna at arcu luctus nec cursus nulla interdum. Aenean placerat scelerisque ligula, feugiat vestibulum mauris fermentum nec. Phasellus libero dolor, rutrum vitae lacinia quis, pretium non ipsum. Ut eget dolor libero, sed vehicula nisi. Nunc porta nisl non urna congue sit amet malesuada mauris tempor. Sed condimentum lacinia purus at porttitor. Maecenas accumsan lobortis ante at ullamcorper. Mauris augue nisl, tristique eu consequat a, dignissim ac augue.</p>
        <p>Duis adipiscing metus velit, quis dapibus diam. Morbi sollicitudin placerat vulputate. Ut ut felis nibh, quis tincidunt massa. Donec eros nisl, scelerisque nec ultricies sed, vulputate a turpis. Integer leo massa, condimentum sed luctus nec, tempor in tellus. Praesent nec leo quam. Sed dignissim imperdiet mollis. In vulputate lorem at magna molestie posuere. Sed ut eros at urna scelerisque tempor. Praesent vel urna purus. Vivamus sed tortor sit amet neque adipiscing porta. Praesent ac egestas tellus. Mauris leo erat, tincidunt eu tincidunt vitae, dictum in purus. Aenean semper, erat quis dapibus ornare, massa dolor ornare diam, a ultricies nunc augue in ligula.</p>
        <p>Nulla aliquam velit nec arcu commodo egestas sed in diam. Quisque tincidunt tincidunt odio, vitae pellentesque massa placerat eget. Donec at neque nulla. Ut eget erat quam. Mauris eu pellentesque dolor. Nam facilisis justo a risus elementum interdum. Pellentesque ligula eros, posuere sed hendrerit vitae, lacinia a eros. Sed nec purus lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus non sapien ut erat volutpat viverra vitae at est. Morbi vel pellentesque nibh.</p>
    </div>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://github.com/malsup/blockui/raw/master/jquery.blockUI.js?v2.31"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#search-box a").toggle(function (e) {
                e.preventDefault();
                $("#search-box").css({ "height": "50px" });
                $("#content").css({ "top": "120px" });
                $("#search").css({ "display": "block" });
            },
            function (e) {
                e.preventDefault();
                $("#search-box").css({ "height": "20px" });
                $("#content").css({ "top": "90px" });
                $("#search").css({ "display": "none" });
            });
            $("#search-val").focus(function () {
                $(this).select();
            });
            $("#search-submit").click(function () {
                var searchval = $("#search-val").val();
                $.blockUI({ message: "<h3>Searching for '<em>" + searchval + "</em>'...</h3>" });
                setTimeout("searcher('" + searchval + "')", 2000);
            });
        });
        function searcher(searchval) {
            $.unblockUI();
            $("#search-term").html(searchval);
            $("#main").html($("#search-results").html());
        }
    </script>
</body>
</html>

Demo here

Run VS in admin mode on Win7 for remote access

This is really one of those duh kinda things, but I thought I’d just put it up here in case it helps at all.

Once I made the switch to Win7 on my work PC, I noticed when I remote desktop’d in I could not run the debugger for an already open VS instance without shutting down and starting as admin. I noticed in some screencast from people such as Phil Haack that the VS window had “(Administrator)” in the title bar. This made a little light bulb appear over my head as I had an “aha!” moment: just run VS as an admin.

I had already pinned VS to my taskbar, so I stopped for a second when I right-clicked on the VS icon and saw no “Run as administrator” option. I quickly realized I could right-click yet again on “Microsoft Visual Studio 2010″ fromt he jump menu and lo and behold there was my “Run as administrator” option.

SVN Tree Conflicts

One thing that has always baffled me and my co-workers is SVN tree conflicts. I thought it would be a good idea to keep track of different scenarios that result in tree conflicts as an exercise in demystifying them.

  • Delete a file but don’t check in the delete. Another user performs the same delete and checks it in. Perform an update = tree conflict

Automating TortoiseSVN

So the whole reason I started this stupid blog was so I’d have a place to fall back on with all the interesting crap I found on the interwebz. Yeah, that worked out well…

So why the hell am I not just adding every cool thing I find?!? Because it is way easier to bookmark it. Hell, I use this pre-alpha version of Oxite and I gotta type in my HTML markup by hand. How archaic is that! [Edit: not any more!]

Well, here is a great link to TortoiseSVN automation. I have been working towards completely automating our release procedure, and we always had the Tortoise dialog that we had to click “OK” for every time. We all know how completely annoying that can be, right? Well, no more!

Example

What good is this post without some sort of example, right? Well here you go.

We used to do something like so:

"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:%FOLDER%

That has the annoying dialog. So now we just do the following:

"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /closeonend:2 /path:%FOLDER%

That handy little /closeonend saves my click-finger! Voila! The post goes into detail on the parameter, so have a look.

SVN post-commit trigger

We use a post-commit trigger at work to notify the team of all commits made to the repository. I needed to make some modifications, so I thought I’d update my sorely neglected blog with the details. You know, for the kids…

Original post-commit file

This isn’t the exact file we use, but the majority of it was taken from this post. Dan has a great file that you can pretty much drag ‘n drop and have some seriously cool emails flying around. As Dan notes, you’ll need SendMail, but it is practically an out-of-the-box solution.

Recent tweaks

I get email. A LOT of email. It is a bit hard to manage, so I got rules up the wazoo! I originally had all the commit emails simply going into my “Commits” subfolder. However, we have some different apps, and a few different web sites going on, so having all the notifications dumped into a single folder wasn’t working either. Dan’s script adds some useful information to the subject line, but it wasn’t quite what I was looking for. I was trying to use keywords from the body of the email, but that wasn’t 100% either. So, I had to make some tweaks to get what I wanted.

I wanted to add the repo folder that was updated to the subject line. This way, I could write my rules to look for keywords based on the folder names of our projects in the repo. This would be fool-proof. Batch files have always been a little odd to me, and some of the deep, dark recesses of DOS are left unexplored. I did some searching and came up with this StackOverflow question about getting details of what was committed via svnlook. Using the dir-changed along with the suggested for loop worked quite well. Now all I had to do was get a part of the dir-changed.

More searching turned up this and this, which are both essentially the same. They pointed me down the right path and I got it going.

Not quite perfect

I am totally anal. I have personally labeled myself a “Code Nazi”. I can’t stand extra spaces, or extra line breaks, or anything that is seemingly unnecessary. It seems that svnlook author must add some extra spaces to the end of the author name, because there were 3 extra spaces at the end of every name. Up until now, I decided to just let this go. I mean, really, it wasn’t like it made the subject line illegible or anything. But, I love Mike Holmes, and like he says, make it right! So more searching turned up this great page on DOS string manipulation. I used it to replace the spaces in the author name and now the subject line is perfect!

The script

After all this talking, I could at least share the code, right? As I said earlier, it is heavily borrowed from Dan’s great code, with some minor updates made for my taste. Here you go:

@ECHO OFF
REM *************************************************************
REM * this sets the arguments supplied by Subversion            *
REM *************************************************************
SET REPOS=%1
SET REV=%2

REM *************************************************************
REM * define the path to the working copy of your code          *
REM *                                                           *
REM * the default working_copy folder would be:                 *
REM * file:///%REPOS%                                           *
REM *************************************************************
SET WORKING_COPY=file:///c:/web/svnroot
SET DIR=%REPOS%/hooks

REM *************************************************************
REM * get author's name                                         *
REM *************************************************************
for /f %%a in ( 'c:\svn\svnlook.exe author %REPOS% -r %REV%' ) do ( SET AUTHOR=%%a )

REM *************************************************************
REM * define e-mail parameters                                  *
REM *************************************************************
SET SITENAME=emw2k8dev
SET SMTP_SERVER=192.168.0.112
SET EMAIL_TO=svn@evan-moor.com
SET EMAIL_FROM=svn@evan-moor.com
for /F "eol=; tokens=1 delims=/" %%a in ( 'c:\svn\svnlook.exe dirs-changed %REPOS% -r %REV%' ) do ( SET SITENAME=%%a )
SET SUBJECT=SVN Update - %AUTHOR: =% - %SITENAME% - rev %REV% - \\emw2k8dev\%REPOS:C:\=%

REM *************************************************************
REM * generate the header to use for the e-mail message         *
REM *************************************************************
ECHO The following changes were made to the code: > %DIR%/email.txt
ECHO. >> %DIR%/email.txt

REM *************************************************************
REM * dump the log of changes to the e-mail message             *
REM *************************************************************
c:\svn\svn log %WORKING_COPY% -v -r "%REV%" >> %DIR%/email.txt
ECHO. >> %DIR%/email.txt

REM *************************************************************
REM * dump the diff changes to the e-mail message               *
REM *                                                           *
REM * WARNING: Generates tons of output                         *
REM *                                                           *
REM * NOTE: this is optional, you can remove this information   *
REM *       if you do not want a verbose message of changes     *
REM *************************************************************
c:\svn\svn diff %WORKING_COPY% -c "%REV%" --no-diff-deleted >> %DIR%/email.txt
ECHO. >> %DIR%/email.txt

REM *************************************************************
REM * send the e-mail message to the user                       *
REM *************************************************************
c:\web\svnroot\sendEmail.exe -s %SMTP_SERVER% -t %EMAIL_TO% -f %EMAIL_FROM% -u "%SUBJECT%" -o message-file=%DIR%/email.txt -l %DIR%/SendEmail.log

So it is by no means perfect or anything, but it may come in handy to someone else.

jQuery Star Rating Plugin

I am thinking about adding a star rating to one of the sites at work, so I started poking around for what was available in a jQuery plugin. Surprisingly, there are quite a few plugins but none that I totally fell in love with. they either don’t degrade, or use form elements I don’t hink they should, or whatever. I thought it would be a good exercise to try and roll my own plugin.

I started of checking out some how-to’s for jQuery plugin writing, but I usually learn better by doing, so I started with the closest thing I like, Wil Stuckey and John Resig’s rating plugin. It is pretty good, but it just needed a little nudge to be better. I figured this was a good way to start. I would not have to write an entire plugin from scratch, and I’d learn from one of the guys that created jQuery, so how could I go wrong?

It took a few days, with a few hours spent here and there. All in all I feel pretty good about the plugin, though I am sure I could make it better, and I likely forgot something important. If you are interested, you can grade the code from my code section, and there is a demo available too. Let me know what you think in the comments.