tag:blogger.com,1999:blog-83046223153778586212024-03-13T15:01:33.504+13:00IAmUnknownStuff I think is worth sharing.preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.comBlogger56125tag:blogger.com,1999:blog-8304622315377858621.post-22862113274543027582020-06-30T09:20:00.003+12:002020-06-30T09:23:03.346+12:00WSL2 and Host networking<div dir="ltr" style="text-align: left;" trbidi="on">
Just a small post so I don't forget how to do this.<br />
<br />
<a href="https://github.com/microsoft/WSL/issues/4285#issuecomment-647185072">https://github.com/microsoft/WSL/issues/4285#issuecomment-647185072</a><br />
<br />
<div style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 16px;">
I got a clue in the following: <a data-hovercard-type="issue" data-hovercard-url="/microsoft/WSL/issues/4844/hovercard" href="https://github.com/microsoft/WSL/issues/4844" style="background-color: initial; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">Issue 4844</a><br />
(I also removed docker WSL and reinstalled it after, but I don't think that that made any diff)</div>
<ol style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box; margin-left: 0px;">Created a /etc/wsl.conf containing</li>
</ol>
<pre style="background-color: #f6f8fa; border-radius: 6px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; line-height: 1.45; margin-bottom: 16px; overflow-wrap: normal; overflow: auto; padding: 16px;"><code style="background: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;">
[network]
generateResolvConf = false
</code></pre>
<ol start="2" style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box; margin-left: 0px;"><div style="box-sizing: border-box; margin-bottom: 16px;">
I exited wsl and then issued a <code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 6px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; margin: 0px; padding: 0.2em 0.4em;">wsl --shutdown</code></div>
</li>
<li style="box-sizing: border-box; margin-left: 0px; margin-top: 0.25em;"><div style="box-sizing: border-box; margin-bottom: 16px;">
entered wsl force deleted the /etc/resov.conf to stop it being a symbolic link</div>
</li>
</ol>
<div style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 16px;">
<code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 6px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; margin: 0px; padding: 0.2em 0.4em;">sudo rm -fd /etc/resov.conf</code></div>
<ol start="4" style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box; margin-left: 0px;"><div style="box-sizing: border-box; margin-bottom: 16px;">
I exited wsl and then issued a <code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 6px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; margin: 0px; padding: 0.2em 0.4em;">wsl --shutdown</code></div>
</li>
<li style="box-sizing: border-box; margin-left: 0px; margin-top: 0.25em;"><div style="box-sizing: border-box; margin-bottom: 16px;">
entered wsl and recreated a resolv.conf</div>
</li>
</ol>
<pre style="background-color: #f6f8fa; border-radius: 6px; box-sizing: border-box; color: #24292e; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; line-height: 1.45; margin-bottom: 16px; overflow-wrap: normal; overflow: auto; padding: 16px;"><code style="background: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;"> sudo touch /etc/resov.conf
sudo nano /etc/resov.conf
</code></pre>
<ol start="5" style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box; margin-left: 0px;">Added the following line to the /etc/resolv.conf</li>
</ol>
<div style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 16px;">
<code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 6px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; margin: 0px; padding: 0.2em 0.4em;"> nameserver 8.8.8.8</code></div>
<ol start="6" style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; margin-bottom: 0px !important; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box; margin-left: 0px;"><div style="box-sizing: border-box; margin-bottom: 16px;">
I exited wsl and then issued a <code style="background-color: rgba(27, 31, 35, 0.05); border-radius: 6px; box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; margin: 0px; padding: 0.2em 0.4em;">wsl --shutdown</code></div>
</li>
<li style="box-sizing: border-box; margin-left: 0px; margin-top: 0.25em;"><div style="box-sizing: border-box; margin-bottom: 16px;">
Entered wsl and everything was now working</div>
</li>
</ol>
</div>
preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-82872844603446346492015-12-07T15:26:00.002+13:002015-12-07T15:41:22.005+13:00Removing old Configurations from Visual Studio XML project files<div dir="ltr" style="text-align: left;" trbidi="on">
This morning I decided that I had to do something that I've been putting off for weeks. The current code base I'm looking after has about 400+ C++ projects and over past the (20+) years these projects have accumulated a large amount of dross. One in particular is the number of left over project configurations that are no longer working or of any use.<br />
<br />
Since I couldn't find a function within VS 2015 to remove configuration from a large number of C++ project files I decided to see if it could be done with very simple code and here's the result<br />
<br />
<br />
<pre style="background: #1e1e1e; color: gainsboro; font-family: Consolas; font-size: 13;"><span style="color: #569cd6;">using</span> <span style="color: gold; font-style: italic;">System</span>;
<span style="color: #569cd6;">using</span> <span style="color: gold; font-style: italic;">System</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Collections</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Generic</span>;
<span style="color: #569cd6;">using</span> <span style="color: gold; font-style: italic;">System</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Linq</span>;
<span style="color: #569cd6;">using</span> <span style="color: gold; font-style: italic;">System</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Text</span>;
<span style="color: #569cd6;">using</span> <span style="color: gold; font-style: italic;">System</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Threading</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Tasks</span>;
<span style="color: #569cd6;">using</span> <span style="color: gold; font-style: italic;">System</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Xml</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Linq</span>;
<span style="color: #569cd6;">namespace</span> <span style="color: gold;">RemoveVSConfig</span>
{
<span style="color: #569cd6;">class</span> <span style="color: #4ec9b0;">Program</span>
{
<span style="color: #569cd6;">static</span> <span style="color: #569cd6;">void</span> <span style="color: #ff8000;">Main</span>(<span style="color: #569cd6;">string</span>[] <span style="color: darkkhaki;">args</span>)
{
<span style="color: #569cd6;">try</span>
{
<span style="color: gold; font-style: italic;">XDocument</span> <span style="color: darkkhaki;">doc</span> <span style="color: #b4b4b4;">=</span> <span style="color: gold; font-style: italic;">XDocument</span><span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">Load</span>(<span style="color: darkkhaki;">args</span>[<span style="color: #b5cea8;">0</span>]);
<span style="color: darkkhaki;">doc</span><span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">Descendants</span>()
<span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Elements</span>()
<span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">Where</span>(<span style="color: gold; font-style: italic;">e</span> <span style="color: #b4b4b4;">=></span>
<span style="color: gold; font-style: italic;">e</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Attributes</span>()
<span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">Where</span>(<span style="color: gold; font-style: italic;">a</span> <span style="color: #b4b4b4;">=></span> <span style="color: gold; font-style: italic;">a</span><span style="color: #b4b4b4;">.</span><span style="color: darkkhaki; font-style: italic;">Value</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Contains</span>(<span style="color: darkkhaki;">args</span>[<span style="color: #b5cea8;">1</span>]))
<span style="color: #b4b4b4;">.</span><span style="color: darkkhaki; font-style: italic;">Count</span>() <span style="color: #b4b4b4;">></span> <span style="color: #b5cea8;">0</span>)
<span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">Remove</span>();
<span style="color: #569cd6;">string</span> <span style="color: darkkhaki;">output</span> <span style="color: #b4b4b4;">=</span> <span style="color: darkkhaki;">doc</span><span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">ToString</span>();
<span style="color: darkkhaki;">doc</span><span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">Save</span>(<span style="color: darkkhaki;">args</span>[<span style="color: #b5cea8;">0</span>]);
<span style="color: gold; font-style: italic;">Console</span><span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">WriteLine</span>(<span style="color: darkkhaki;">output</span>);
}
<span style="color: #569cd6;">catch</span> (<span style="color: gold; font-style: italic;">System</span><span style="color: #b4b4b4;">.</span><span style="color: gold; font-style: italic;">Exception</span> <span style="color: darkkhaki;">ex</span>)
{
<span style="color: gold; font-style: italic;">Console</span><span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">WriteLine</span>(<span style="color: darkkhaki;">ex</span><span style="color: #b4b4b4;">.</span><span style="color: #ff8000; font-style: italic;">ToString</span>());
}
}
}
}</pre>
<br />
Yes it's a sledgehammer! But it works ;-)<br />
<br />
<br /></div>
preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-65018396128805975032015-12-01T09:25:00.001+13:002015-12-01T09:30:49.215+13:00Little gotcha using Visual Studio 2015, Git, GitVersion and tags<div dir="ltr" style="text-align: left;" trbidi="on">
I'm still a baby in the brave (new?) world of DVCS and Git in particular and we're currently moving our workflow from a homegrown customised solution using SVN, Mantis and JIRA to a git, gitflow and TFS one. Anyway I've been learning about <a href="http://semver.org/" target="_blank">Semantic Versioning</a> using <a href="https://gitversion.readthedocs.org/en/latest/" target="_blank">GitVersion</a> when something weird popped up for me.<br />
<br />
Essentially I was finding that GitVersion was giving different version on my machine than it was in the automated build (yes I've playing with automated builds again ;-)<br />
<br />
So doing what any person would do these days, I outlined the whole thing in this question on StackOverflow - <a href="http://stackoverflow.com/q/33946642/30225" style="background-color: white; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 1.3;" target="_blank">What could make gitversion compute a different version on the same branch (local vs build agent repos)</a><span style="background-color: white; color: #222222; font-family: "arial" , "helvetica neue" , "helvetica" , sans-serif; line-height: 1.3;">. </span>What was happening was that on my local machine GitVersion was correctly picking up the version info from a tag in my local repo, while it was not doing the same in the automated build.<br />
<br />
I've been trying to hone my own workflow from TortoiseGit (and previously TortoiseSVN) to one based more around the old familiar one from with Visual Studio so I didn't think twice that every thing I do in my local repo wouldn't be replicated into TFS repositories. However this was the gotcha Visual Studio 2015 (at the time of writing) doesn't sync tag commits back to the server repos - big thanks to to <a href="http://stackoverflow.com/users/5425825/cece-msft" target="_blank">Cece from Microsoft</a> for <a href="http://stackoverflow.com/a/33995119/30225" target="_blank">proving that I wasn't mad</a>.<br />
<br />
So while I'd been happily tagged my branch (so that GitVersion could find them), what I didn't realise was that this tag never made it back to the server even though Visual Studio seemed to reporting that it was true. Therefore when the build server repo was synced there were no tags and thus GitVersion said quite correctly that my build was version 0.1.0 as opposed to my tag which asked for version 3.10.0.<br />
<br />
The short and skinny is that tags must be pushed using "git push --tags" manually outside of visual studio. Using TortoiseGit to check both repos confirmed this and now all is sunshiny (!) again!<br />
<br />
<br />
<br />
Hope this helps someone.<br />
<br />
(oh just got this note that<a href="https://www.visualstudio.com/en-us/news/vs2015-update1-vs.aspx" target="_blank"> VS2015 Update 1</a> is available - let's see if this is fixed)<br />
<br />
<br /></div>
preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0Auckland, New Zealand-36.8484597 174.76333150000005-37.2549887 174.11788450000006 -36.4419307 175.40877850000004tag:blogger.com,1999:blog-8304622315377858621.post-67993714947552375512015-10-10T15:52:00.000+13:002015-10-10T15:53:25.211+13:00Where is the windows connect to VPN functionality hidden???<div dir="ltr" style="text-align: left;" trbidi="on">
Right down to moaning again. I've been using Windows 10 for a few weeks now (yes I'm old and slow these days!) and have been getting used to the new UI. Anyway like most major upgrades from Microsoft, some things get moved around, some become easier but to my chagrin some get hidden or become much harder to user.<br />
<div>
<br /></div>
<div>
The setting that really got me was the Windows connect to VPN function. In Windows 8, connecting to a VPN was as simple as clicking on the networking icon in the tray and selecting the VPN connection I wanted and clicking connect. To disconnect the procedure was just as simple. However now in Windows 10 the new UI for this is appalling. </div>
<div>
<br /></div>
<div>
First I click on the try icon and then I select the VPN I want:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-hISLpAQpWiL5ip_TwFH3f6a92wT4Em34kXcKryT3SSpKsZioVX2rqvYU7C2UFPfDAyzTKTVCFAhIgXs_JzhnJeaWEmiKzVjGsbV7XPcyM18dLa1YpW6ioxaTnUaqK2LCHLloIfPzqJP/s1600/2015-10-10_15-20-44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC-hISLpAQpWiL5ip_TwFH3f6a92wT4Em34kXcKryT3SSpKsZioVX2rqvYU7C2UFPfDAyzTKTVCFAhIgXs_JzhnJeaWEmiKzVjGsbV7XPcyM18dLa1YpW6ioxaTnUaqK2LCHLloIfPzqJP/s320/2015-10-10_15-20-44.png" width="187" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
Then another properties page comes up and I have to select the connection I want again. Then I get the option to connect:</div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZgC3b7pLxsk4_kZT51-eY-5_1mjMyDWEu4ozrk-WYzAYWE18UHU7BQ1siMoHr8t39HMPuR8fcmyzc97FAoOVLjhXTliM1ZaWPSlHqxpK2lYjQtyL59YCTiW_eTRUWdEw8XCIjvb61-VPQ/s1600/2015-10-10_15-23-24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZgC3b7pLxsk4_kZT51-eY-5_1mjMyDWEu4ozrk-WYzAYWE18UHU7BQ1siMoHr8t39HMPuR8fcmyzc97FAoOVLjhXTliM1ZaWPSlHqxpK2lYjQtyL59YCTiW_eTRUWdEw8XCIjvb61-VPQ/s320/2015-10-10_15-23-24.png" width="320" /></a></div>
<div>
<br /></div>
<div>
The process for disconnection is the same except I get the option to disconnect instead of connect.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_79scENOvTGXS7b2X1HF7MgYeRlGaVDj5wl_Qp7t-5mykDrVekl34rpCaBlTybnz2y1CUWwAOv_cqOeCWqPRnso6tgwYUfwY9MamHJHw08yf4DvgE5_RQWSsm67Mf0G70TCoaxa_uiQSF/s1600/2015-10-10_15-25-37.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_79scENOvTGXS7b2X1HF7MgYeRlGaVDj5wl_Qp7t-5mykDrVekl34rpCaBlTybnz2y1CUWwAOv_cqOeCWqPRnso6tgwYUfwY9MamHJHw08yf4DvgE5_RQWSsm67Mf0G70TCoaxa_uiQSF/s320/2015-10-10_15-25-37.png" width="320" /></a></div>
<div>
<br /></div>
<div>
Why this extra dialog? Sure I understand that if I wanted to play with the settings I'd need it, but for connection and disconnection? No that is a really backward step in my opinion.</div>
<div>
<br /></div>
<div>
So what to do? I tried googling a few times over the past few weeks but nothing really compelling came up. Then a few minutes ago this turned up on superuser.com <a href="http://superuser.com/q/947060/7672" target="_blank">"Windows 10 VPN Connect Button Cumbersome"</a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5APyccorjf0psPaCovH8zK39ltzQCrQbBNmRaiRF92jLUnHu_cssfqnhypyGMH3zb98jaUnL2KZUY1cGnUN7rKJLrMUP0prQnWy0p4NQxvwn5kh1Ds7EVWnKU7cz7aNphz7oX77TcWzXe/s1600/2015-10-10_15-43-30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5APyccorjf0psPaCovH8zK39ltzQCrQbBNmRaiRF92jLUnHu_cssfqnhypyGMH3zb98jaUnL2KZUY1cGnUN7rKJLrMUP0prQnWy0p4NQxvwn5kh1Ds7EVWnKU7cz7aNphz7oX77TcWzXe/s320/2015-10-10_15-43-30.png" width="313" /></a></div>
<div>
<br /></div>
<div>
And then this lovely answer recommending some freeware called <a href="https://www.facebook.com/VPNMyWay-1710104869211133/" target="_blank">VPNMyWay </a>written by the author (a mysterious hero by the <i>nom de guerre</i> of <a href="http://superuser.com/users/345317/reg-edit" target="_blank">Reg Edit</a> apparently in the UK) of the answer, </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7krescCNkIru8hj5oBnUtfQdTL1nLAyEjqNd1OkKv44DFJmzt1xUnfZbLME1BE7JwJ-glG-x-xS2QyQNzgMEiWpGeCCuwwZPxSkH06luXsBxoqAwj66SBW8nZ7hy1skMk_V_7n_JjuXkM/s1600/2015-10-10_15-44-55.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7krescCNkIru8hj5oBnUtfQdTL1nLAyEjqNd1OkKv44DFJmzt1xUnfZbLME1BE7JwJ-glG-x-xS2QyQNzgMEiWpGeCCuwwZPxSkH06luXsBxoqAwj66SBW8nZ7hy1skMk_V_7n_JjuXkM/s320/2015-10-10_15-44-55.png" width="257" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
So downloaded, installed and it works beautifully. Thank you Reg - I've sent you some beer tokens!</div>
</div>
preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-55558370792424030682015-10-10T15:19:00.003+13:002015-12-07T15:42:26.741+13:00And he's back!<div dir="ltr" style="text-align: left;" trbidi="on">
Been a long time since I posted and I think I need to start again. So what better way than to tell you what I've been up. In 2011 I moved into the BI consultancy space. And it was like learning to program again. I had to learn new techniques (Data Warehousing), new databases technologies SQL Server Analysis Server, new languages (MDX, RDL), new forms of reporting but most important of all I learned about analytics and how why BI is so important.<br />
<br />
Now 4 years later I've moved out of the Legal domain and into the healthcare one, and though not completely out of BI space, I'm programming in the traditional sense much more. For instance yesterday I was debugging a TCP/IP stack.<br />
<br />
Anyway I'm loving this new focus and I now have the time to start this blog up a again.<br />
<br />
- preet (lots older but probably not much wiser!)</div>
preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-13726136144902312882011-10-13T02:47:00.001+13:002011-10-13T02:54:29.985+13:00Goodbye windows phone 7<div dir="ltr" style="text-align: left;" trbidi="on">After having played with a WP7 device for about 8 months, I now have to say it's not for me. There are two reasons.<br />
<br />
Firstly my current phone was lent to me, and now has to be returned. But this is not the show stopper. I'd buy a new one tomorrow if it wasn't for the second reason. The main reason I'm giving up on the Windows Phone 7 is that I cannot find a way (that works for me) to back up my telephony data. My text (SMS) messages and calling data are important to me and in order to continue using these devices I need to have a way to record and back up this information.<br />
<br />
Because Microsoft has made it incredibly difficult to back up this data via their API's I cannot buy or even write an app that will let me back up this data easily or in fact at all. So finally I gave up trying.<br />
<br />
It's a sad day because for all of it's flaws, the Windows Phone 7 is one of the most ergonomic phones I've ever used. It was mostly intuitive and in the main just works. And looking at the future of Windows Phone and Windows 8 - the metro paradigm (the one on the Phone) look like it's the future of Windows.<br />
<br />
I'm now looking at either an iPhone (deep sucky in breath) or and Android Phone (slightly less sucky in breath).<br />
<br />
:-(</div>preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com4tag:blogger.com,1999:blog-8304622315377858621.post-25448526627004954282011-02-07T08:47:00.000+13:002011-02-07T08:47:32.736+13:00The Suprising Truth about Motivation<div dir="ltr" style="text-align: left;" trbidi="on">I found this this morning via <a href="http://www.reddit.com/r/programming/comments/fg9le/the_surprising_truth_about_what_motivates_us/">reddit</a> and I think it sums up what's being playing on my mind for years. What motivates us as people who make machines do 'stuff'.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="390" src="http://www.youtube.com/embed/u6XAPnuFjJc" title="YouTube video player" width="640"></iframe><br />
<br />
For reference: <a href="http://www.thersa.org/events/vision/animate/rsa-animate-drive">original link to the Royal Society of Arts in the UK</a></div>preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com2tag:blogger.com,1999:blog-8304622315377858621.post-82876352024132016982010-03-05T10:41:00.002+13:002010-07-17T15:06:51.528+12:00SQL Server 2005/8 OUTPUT clause<p>This just passed me by. What a <a href="http://msdn.microsoft.com/en-us/library/ms177564.aspx" target="_blank">great function</a> to avoid writing some triggers. Which we all know aren’t guaranteed to always fire.</p><p>Here are a couple of examples : </p><ul><li><a href="http://weblogs.sqlteam.com/mladenp/archive/2006/06/08/10122.aspx">http://weblogs.sqlteam.com/mladenp/archive/2006/06/08/10122.aspx</a> </li>
<li><a href="http://blog.sqlauthority.com/2007/10/01/sql-server-2005-output-clause-example-and-explanation-with-insert-update-delete/">http://blog.sqlauthority.com/2007/10/01/sql-server-2005-output-clause-example-and-explanation-with-insert-update-delete/</a></li>
</ul>preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com2tag:blogger.com,1999:blog-8304622315377858621.post-4554937580723166102010-01-29T14:50:00.000+13:002010-02-22T09:00:32.366+13:00Hard Disk Beat Boxing<p>I’ve just returned from a month away and have discovered that my disk has gone north last week, making the sounds of a rather rubbish DeeJay. </p> <p>Since I use virtual machines for a lot of the work I’ve been doing and these machines actually run from a separate disk – I‘ve been fairly lucky and have only lost my vs2008 environment – the vs2010 is in a VM. This environment is easily recovered as we have a hard disk images for most of the vs2008 environments, and I only have to reinstall beyond compare, configure notepad++ and some VS settings, restore a couple of test databases and I’m back in business.</p> <p>However this is another timely reminder for </p> <ul> <li>Using Source Control – I’ve lost no source code, including all my part changes which are in <a href="http://msdn.microsoft.com/en-us/library/ms181403.aspx" target="_blank">TFS as shelvesets</a> </li> <li>Use a second disk for VMs – not only is it faster but it can also save your bacon from time to time </li> <li>Keep hard disk images of important setups of your dev environment. I have to thank Aderant’s great IT team for this. They really are the best IT team I’ve ever worked with. <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:68aec0f2-f548-4d69-b8aa-63bdddbf68dd" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Disk+backup" rel="tag">Disk backup</a></div> </li> <li>back up important things before going away – and please please please automate this as its trivial on windows to set up <a href="http://technet.microsoft.com/en-us/library/cc507860.aspx" target="_blank">scheduled task</a> to do this for you. </li> </ul> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-39156384155390675872009-09-28T10:47:00.001+13:002009-09-28T10:47:30.009+13:00Make coding easier ???<p><a href="http://lh5.ggpht.com/_KCdtnU2dH00/Sr_dbL0VHHI/AAAAAAAACSY/cMnlb68rMNs/s1600-h/image%5B3%5D.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="376" alt="image" src="http://lh4.ggpht.com/_KCdtnU2dH00/Sr_dcHNIXbI/AAAAAAAACSc/S83sb9TSkzw/image_thumb%5B1%5D.png?imgmax=800" width="385" border="0" /></a> </p> <p>The <a title="Resharper 4.5" href="http://www.jetbrains.com/resharper/index.html" target="_blank">Resharper 4.5</a> splash screen during installation made me laugh today. I completely dig Resharper (though I prefer <a title="Refactor Pro" href="http://www.devexpress.com/Downloads/Visual_Studio_Add-in/index.xml" target="_blank">Refactor Pro</a>) so don’t get me wrong. I just thought <em>“Wow, that makes my code easier to understand”</em>.</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-6257209482178369542009-08-06T12:09:00.001+12:002015-10-10T16:10:55.461+13:00TRX File decoder script updated to include Console output<div dir="ltr" style="text-align: left;" trbidi="on">
Can’t imagine how I forgot this, but I did:<br />
<br />
<pre class="csharpcode"><span class="kwrd"><</span><span class="html">xsl:stylesheet</span> <span class="attr">version</span><span class="kwrd">="2.0"</span>
<span class="attr">xmlns:xsl</span><span class="kwrd">="http://www.w3.org/1999/XSL/Transform"</span>
<span class="attr">xmlns:t</span><span class="kwrd">="http://microsoft.com/schemas/VisualStudio/TeamTest/2006"</span>
<span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">xsl:template</span> <span class="attr">match</span><span class="kwrd">="/"</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">html</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">head</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">style</span> <span class="attr">type</span><span class="kwrd">="text/css"</span><span class="kwrd">></span>
h2 {color: sienna}
p {margin-left: 20px}
.resultsHdrRow { font-face: arial; padding: 5px }
.resultsRow { font-face: arial; padding: 5px }
<span class="kwrd"></</span><span class="html">style</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">head</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">body</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">h2</span><span class="kwrd">></span>Test Results<span class="kwrd"></</span><span class="html">h2</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">h3</span><span class="kwrd">></span>Summary<span class="kwrd"></</span><span class="html">h3</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">ul</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">li</span><span class="kwrd">></span>Tests found: <span class="kwrd"><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="t:TestRun/t:ResultSummary/t:Counters/@total"</span><span class="kwrd">/></</span><span class="html">li</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">li</span><span class="kwrd">></span>Tests executed: <span class="kwrd"><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="t:TestRun/t:ResultSummary/t:Counters/@executed"</span><span class="kwrd">/></</span><span class="html">li</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">li</span><span class="kwrd">></span>Tests passed: <span class="kwrd"><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="t:TestRun/t:ResultSummary/t:Counters/@passed"</span><span class="kwrd">/></</span><span class="html">li</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">li</span><span class="kwrd">></span>Tests Failed: <span class="kwrd"><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="t:TestRun/t:ResultSummary/t:Counters/@failed"</span><span class="kwrd">/></</span><span class="html">li</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">ul</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">table</span> <span class="attr">border</span><span class="kwrd">="1"</span> <span class="attr">width</span><span class="kwrd">="80%"</span> <span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">tr</span> <span class="attr">class</span><span class="kwrd">="resultsHdrRow"</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">th</span> <span class="attr">align</span><span class="kwrd">="left"</span><span class="kwrd">></span>Test<span class="kwrd"></</span><span class="html">th</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">th</span> <span class="attr">align</span><span class="kwrd">="left"</span><span class="kwrd">></span>Outcome<span class="kwrd"></</span><span class="html">th</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">tr</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">xsl:for-each</span> <span class="attr">select</span><span class="kwrd">="/t:TestRun/t:Results/t:UnitTestResult"</span> <span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">tr</span> <span class="attr">valign</span><span class="kwrd">="top"</span> <span class="attr">class</span><span class="kwrd">="resultsRow"</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">td</span> <span class="attr">width</span><span class="kwrd">='30%'</span><span class="kwrd">><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="@testName"</span><span class="kwrd">/></</span><span class="html">td</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">td</span> <span class="attr">width</span><span class="kwrd">='70%'</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">Div</span><span class="kwrd">></span>Message: <span class="kwrd"><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="t:Output/t:ErrorInfo/t:Message"</span><span class="kwrd">/></</span><span class="html">Div</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">br</span><span class="kwrd">/></span>
<span class="kwrd"><</span><span class="html">Div</span><span class="kwrd">></span>Stack: <span class="kwrd"><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="t:Output/t:ErrorInfo/t:StackTrace"</span><span class="kwrd">/></</span><span class="html">Div</span><span class="kwrd">></span>
<span class="kwrd"><</span><span class="html">br</span><span class="kwrd">/></span>
<span class="kwrd"><</span><span class="html">Div</span><span class="kwrd">></span>Console: <span class="kwrd"><</span><span class="html">xsl:value-of</span> <span class="attr">select</span><span class="kwrd">="t:Output/t:StdOut"</span><span class="kwrd">/></</span><span class="html">Div</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">td</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">tr</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">xsl:for-each</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">table</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">body</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">html</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">xsl:template</span><span class="kwrd">></span>
<span class="kwrd"></</span><span class="html">xsl:stylesheet</span><span class="kwrd">></span></pre>
<br />
<style type="text/css"><br /><br />.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }</style> </div>
preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-89396256926031369122009-08-06T11:21:00.001+12:002009-09-09T14:39:12.570+12:00Using Beyond Compare with Visual Studio<p>This <a href="http://blogs.msdn.com/jmanning/articles/535573.aspx" target="_blank">info is in other places on the internet</a> but I’m putting it here for my future reference:</p> <p>Under Tools|Options|Source Control|Visual Studio Team Foundation Server</p> <p>Select Configure User Tools</p> <p><a href="http://lh6.ggpht.com/_KCdtnU2dH00/SnoUDlfVAGI/AAAAAAAACRM/0xofqF5jgLU/s1600-h/ConfigBC3%5B7%5D.png"><img title="ConfigBC3" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="321" alt="ConfigBC3" src="http://lh6.ggpht.com/_KCdtnU2dH00/SnoUEgQRk6I/AAAAAAAACRQ/yufBIcaA3J8/ConfigBC3_thumb%5B3%5D.png?imgmax=800" width="484" border="0" /></a> </p> <p>Then add the following tools:</p> <p>Compare:</p> <p>   Tool: C:\Program Files (x86)\Beyond Compare 3\BCompare.exe</p> <p>   Arguments: %1 %2 /title1=%6 /title2=%7 /solo</p> <p>Merge:</p> <p>   Tool: C:\Program Files (x86)\Beyond Compare 3\BCompare.exe</p> <p>   Arguments: %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9 /solo</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com3tag:blogger.com,1999:blog-8304622315377858621.post-62406174814319698802009-06-29T11:55:00.001+12:002009-06-29T11:55:07.991+12:00MS Test Error: Metadata files that belong to projects cannot be edited. If you wish to use this metadata file, please import it into the solution<p>Visual studio (2008) sometimes gets into a bind. It loses the binding with a testadatafile (vsmdi) and try as you might you cannot reattach it and you get the message:</p> <p><em>“Metadata files that belong to projects cannot be edited. If you wish to use this metadata file, please import it into the solution”.</em></p> <p>Well there is <a title="Solution" href="http://social.msdn.microsoft.com/Forums/en-US/vststest/thread/903e85f0-385e-4400-aa38-69525189cee4" target="_blank">one proposed solution on msdn</a> but it didn’t work for me. To get round it I dropped the vsmdi from the solution. Added it back using add existing item in the solution designer and then went to the <em>Test | Create a new Test list</em></p> <p><a href="http://lh5.ggpht.com/_KCdtnU2dH00/SkgC1s92LJI/AAAAAAAACQU/XbbhfD-hoZY/s1600-h/image%5B2%5D.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="202" alt="image" src="http://lh6.ggpht.com/_KCdtnU2dH00/SkgC24MCgdI/AAAAAAAACQY/QtTfM91bz-w/image_thumb.png?imgmax=800" width="244" border="0" /></a> </p> <p>This allowed me to recreate my test list. since I don’t really use many test lists it was a piece of cake but I don’t recommend this solution if you have legacy test lists and are afraid of losing them.</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-42314857920989823572009-06-09T17:37:00.001+12:002009-06-09T17:37:27.214+12:00MS Test Error : Test skipped/Test host process exited unexpectedly<p>I get this occasionally – esp. when I’m killing the tests part way through a debug session. The trick is to kill the VSPerfMon process that hangs around.</p> <p><a href="http://lh6.ggpht.com/_KCdtnU2dH00/Si31EC5gKPI/AAAAAAAACQM/q6rUykP5mwU/s1600-h/Killvsperfmon%5B4%5D.png"><img title="Killvsperfmon" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="233" alt="Killvsperfmon" src="http://lh3.ggpht.com/_KCdtnU2dH00/Si31FtMH-oI/AAAAAAAACQQ/CxBqpBmp0eE/Killvsperfmon_thumb%5B2%5D.png?imgmax=800" width="506" border="0" /></a> </p> <p>Or the way I do it:</p> <pre class="csharpcode"><br />c:\>tasklist | findstr /i VSPERFMON<br />VSPerfMon.exe 6500 Console 1 23,192 K<br />c:\>kill -f 6500 </pre><br /><style type="text/css"><br />.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }</style> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-8672898190967047672009-05-21T13:50:00.001+12:002009-07-02T15:43:28.505+12:00Why Oh Why Oh Why….<p>Has MSTest decided it needs me to have a DVD in the drive in order to run my tests.</p> <p><a href="http://lh3.ggpht.com/_KCdtnU2dH00/ShSzdcutxgI/AAAAAAAACQA/2rS43yYsTeE/s1600-h/WhyOWhyOWhy%5B4%5D.png"><img title="WhyOWhyOWhy" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="228" alt="WhyOWhyOWhy" src="http://lh3.ggpht.com/_KCdtnU2dH00/ShSze9RjBvI/AAAAAAAACQI/FadE_yjsXTA/WhyOWhyOWhy_thumb%5B2%5D.png?imgmax=800" width="501" border="0" /></a> </p> <p>I swear its <a title="Infamy" href="http://www.yourdictionary.com/quotes/infamy" target="_blank">got it in for me</a>… Ye gads even if I kill the process it and restart it still refuses to proceed unless I replace the <a href="http://www.amazon.co.uk/Chef-Season-DVD-Lenny-Henry/dp/B0009S9LOE" target="_blank">Chef Series 2</a> DVD I was listening. I suppose it must have like Lenny Henry!</p> <p>Update: It’s now decided I cannot take “Romeo and Juliet” out of the DVD drive!!!!</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-7388964811794981092009-05-12T15:17:00.001+12:002009-05-12T15:17:32.933+12:00Awesome intro regexp!!!<p>Found <a href="http://www.smashingmagazine.com/2009/05/06/introduction-to-advanced-regular-expressions/" target="_blank">this tutorial</a> on digg today. It’s definitely worth reading.</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com2tag:blogger.com,1999:blog-8304622315377858621.post-46805082100666684142009-04-13T00:00:00.010+12:002009-04-13T00:28:59.301+12:00Scratch ThatAfter realising that my son is producing his own videos using ms movie maker, <a href="http://www.google.co.nz/url?q=http://www.hyperionics.com/hc/&ei=N9nhSerbMI2itgPY14SrCQ&sa=X&oi=spellmeleon_result&resnum=1&ct=result&usg=AFQjCNHHXYxsSEE7Ikso2dTiqBc44mtLQw">hypercam </a>and the awesome <a href="http://www.geocities.com/peter_bone_uk/pivot.html">pivot stick figure animator</a> and seeing the quality of this work I decided to introduce him to the really cool <a href="http://scratch.mit.edu/">Scratch </a>tool from MIT. <br /><br />This is his <a href="http://scratch.mit.edu/projects/ilikers/486276">first attempt</a> at event driven programming.<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLf8AvtUY3ipm_M9XM8JnLk7mtmYveIX_PeMUqh7Pa9vK-PQf0YF23kWNSQ-PiCQ85etd0hHMaBgdUz7rbabm99pzdga2SiBlnZs_C7ghHEoNJgCoM4GbUdiLeGI4FLcHBirckzK6d3cbr/s1600-h/stick+man+conversation.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 266px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLf8AvtUY3ipm_M9XM8JnLk7mtmYveIX_PeMUqh7Pa9vK-PQf0YF23kWNSQ-PiCQ85etd0hHMaBgdUz7rbabm99pzdga2SiBlnZs_C7ghHEoNJgCoM4GbUdiLeGI4FLcHBirckzK6d3cbr/s320/stick+man+conversation.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5323779587211022626" /></a><br /><br /><br/><br /><br /><a href="http://scratch.mit.edu/projects/ilikers/486361">This is his second</a> <br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG7_B8vvp1wwW4NZ0ZsaR_jss7baklR3wOrOulUpbPdxxVx9oQqbDcuWl1dOj9Nmi0IprzY1xnnNor-hs41rqfAiBLCjCk3GRtr__WPKFKWNJB_J6kaS_ZOReTPPAWzDMNI1c-MMIG3ZqS/s1600-h/kill+the+diver.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 262px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG7_B8vvp1wwW4NZ0ZsaR_jss7baklR3wOrOulUpbPdxxVx9oQqbDcuWl1dOj9Nmi0IprzY1xnnNor-hs41rqfAiBLCjCk3GRtr__WPKFKWNJB_J6kaS_ZOReTPPAWzDMNI1c-MMIG3ZqS/s320/kill+the+diver.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5323779743436640498" /></a><br /><br />and its a great but simple game. The diver swims from left to right and back again. The left right cursor keys control the cannon (the pointy wizard's hat) and the space bar fires a bullet at the diver. Each time you hit the diver you get one point. <br /><br /><br /><br />My son is only 10 and the game's official tester only just turned 7 this week. But they've managed to build and have a global release of their first game in the space of one sunday afternoon - amazing what two easter eggs can achieve in terms of productivity. I wonder if Joel Spolsky is listening....preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com6tag:blogger.com,1999:blog-8304622315377858621.post-80506661278867859002009-04-08T13:29:00.002+12:002009-04-09T09:36:19.012+12:00Beer and Bytes inaugural meeting<p>Last night was the first meeting of the Auckland North Shore Beer and Bytes group. I consider is a great success not because I wasn't the only person there (I ensured that by dragging a couple of willing cohorts from work - cheers Joe and Steve), but because I had not anticipated how the evening would progress. Would everyone be bored? What would we talk about? </p> <p>Well as it happened there was some very interesting things discussed. Joe tells me there were tape (actually digital but due to my age they'll always be tape) recorders in action. If anyone has any snippets they'd a like to add please feel free to add a comment. </p> <p>Mark and Greg from <a href="http://www.tracado.com" target="_blank">Tracado</a> gave us a run down on all the cool new things in <a href="http://silverlight.net/getstarted/silverlight3/default.aspx" target="_blank">Silverlight 3</a> that make this the best release yet. I had discussion about <a href="http://www.hibernate.org/343.html" target="_blank">NHibernate</a> and magic. Peter recommends <a href="http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx" target="_blank">this project as a great example of why WPF is great</a>. But I think my favourite of all was Peter (please could you,  and everyone else who wants to, send me links to your web pages?) encouraging us to have a .net (real guns and bullets) shooting night!</p> <p>Actually the other main thing we discovered was how many of us have <a href="http://en.wikipedia.org/wiki/DBase" target="_blank">DBase</a> or <a href="http://en.wikipedia.org/wiki/Clipper_(programming_language)" target="_blank">Clipper</a> in our backgrounds....  Thanks to Steve, Guy, Patrick, Peter, Allan, Joe, David, Mark, Greg and Bruce!</p> <p>I think the general consensus was that we should do it again so I'll organise one for a couple weeks after Easter. Next time I'll bring my laptop and maybe we'll look at some code too :-)</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com2tag:blogger.com,1999:blog-8304622315377858621.post-61978456065843620292009-03-18T17:35:00.001+13:002009-03-18T17:35:04.760+13:00MSTest - Specified cast is invalid<p>Just remembered this one. When running a VSMDI from the command line (using the mstest command switch /testmetadata) sometimes this error just happens - no help just 'specified cast is invalid'. </p> <p>I found out a while ago that if you have test lists that are empty this error sometimes happens. What you do is go to the VSMDI editor in visual studio and in the VSMDI in question ensure that you either have tests in each Test List, or remove the test lists that are empty.</p> <p>One more hassle from MSTest!!!! </p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-53509354144327587182009-03-17T13:58:00.001+13:002009-03-18T17:27:33.677+13:00Generating SQL from the NHibernate mapping file<p>I spent 10 minutes searching for a simple program that would dump out the SQL that NHibernate generates from a mapping file if requested. In the end I just wrote my own. This is the relevant snippet.</p> <div class="csharpcode"><pre class="alt"> NHibernate.Cfg.Configuration config = <span class="kwrd">new</span> NHibernate.Cfg.Configuration();</pre><pre> config.Configure();</pre><pre class="alt"> config.AddFile(<span class="str">"hbm_mapping.xml"</span>);</pre><pre> </pre><pre class="alt"> var export = <span class="kwrd">new</span> NHibernate.Tool.hbm2ddl.SchemaExport(config);</pre><pre> export.Execute(<span class="kwrd">true</span>, <span class="kwrd">false</span>, <span class="kwrd">false</span>, <span class="kwrd">true</span>);</pre></div><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><div class="csharpcode"><pre></pre></div><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style><br /><br /><style type="text/css">.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }<br /></style> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-51154675696630797282009-03-16T08:38:00.001+13:002009-03-16T08:38:26.805+13:00For future use<p>For those idle moments I like to visit <a href="http://stackoverflow.com/questions/tagged/command-line" target="_blank">http://stackoverflow.com/questions/tagged/command-line</a> - there's always a gem or two there. This morning I learned about <a href="http://quux.wiki.zoho.com/WMIC-Snippets.html" target="_blank">quux's Excellent WMIC cheat sheet!</a></p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-5796987440872160692009-03-13T08:59:00.001+13:002009-03-18T17:37:26.719+13:00Finally it's out!<p>It's been a while coming and taken its toll in terms of long hours and hard work but the <a href="http://www.aderant.com/" target="_blank">ADERANT</a> team have finally released our new software - <a href="http://www.aderant.com/newsroom/press_release.aspx?id={2FDD196B-EC44-42DF-95E0-74FEFF285895}" target="_blank">ADERANT Expert "Golden Gate" Release</a>. I leave you read the <a href="http://www.aderant.com/newsroom/press_release.aspx?id={2FDD196B-EC44-42DF-95E0-74FEFF285895}" target="_blank">press release</a> but I must say it's an exciting release - workflow, DSLs, WCF, WPF, new User Experiences, - you name it - it's in there! Well done everyone!</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com2tag:blogger.com,1999:blog-8304622315377858621.post-70982789296023097282009-03-12T23:46:00.002+13:002009-03-12T23:49:06.450+13:00Awww what a shame ....Sorry but I couldn't help but feel a tinge of sadness <a href="http://www.infoq.com/news/2009/03/NET-4-Parsing">this...</a>. Only joking!preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-39440373423857003612009-03-03T10:01:00.001+13:002009-03-03T10:01:17.624+13:00Taking ownership of a file without explorer<p>Use the following command on vista (<a href="http://blogs.msdn.com/tims/archive/2006/11/02/windows-vista-secret-10-open-an-elevated-command-prompt-in-six-keystrokes.aspx" target="_blank">elevated</a>) command prompt:</p> <pre class="csharpcode">icacls full_path_and_filename.ext /setowner name_of_user_or_group</pre><br /><style type="text/css"><br />.csharpcode, .csharpcode pre<br />{<br /> font-size: small;<br /> color: black;<br /> font-family: consolas, "Courier New", courier, monospace;<br /> background-color: #ffffff;<br /> /*white-space: pre;*/<br />}<br />.csharpcode pre { margin: 0em; }<br />.csharpcode .rem { color: #008000; }<br />.csharpcode .kwrd { color: #0000ff; }<br />.csharpcode .str { color: #006080; }<br />.csharpcode .op { color: #0000c0; }<br />.csharpcode .preproc { color: #cc6633; }<br />.csharpcode .asp { background-color: #ffff00; }<br />.csharpcode .html { color: #800000; }<br />.csharpcode .attr { color: #ff0000; }<br />.csharpcode .alt <br />{<br /> background-color: #f4f4f4;<br /> width: 100%;<br /> margin: 0em;<br />}<br />.csharpcode .lnum { color: #606060; }</style> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com0tag:blogger.com,1999:blog-8304622315377858621.post-20291633391148977832009-03-03T09:28:00.001+13:002009-03-18T17:27:00.888+13:00Notepad++ on Vista 64 - replacing Notepad.exe<p>There are links <a href="http://www.decimation.com/markw/2007/07/16/free-notepad-replacement-for-windows-vista-and-xp/" target="_blank">here</a> and <a href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank">here</a> (among many other places) that shows how to replace notepad editor with the excellent <a href="http://en.wikipedia.org/wiki/Notepad%2B%2B" target="_blank">Notepad++</a> on a vista or xp machine as the system default text editor. If you use vista 64 you'll need to add another directory to the location where you replace the original notepad.exe </p> <p>(%SystemRoot%\SysWOW64).</p> <p>So the set is :</p> <table cellspacing="0" cellpadding="2" width="400" border="1"><tbody> <tr> <td valign="top" width="400">%SystemRoot%</td> </tr> <tr> <td valign="top" width="400">%SystemRoot%\System32</td> </tr> <tr> <td valign="top" width="400">%SystemRoot%\SysWOW64</td> </tr> </tbody></table> <p>As always on Vista you'll need to jump through a few hoops to allow you to do this. The first is to replace the file owner with someone other than the default 'TrueInstaller' and secondly to give the new owner full control over the file. </p> <p>The above links give more info if you need it.</p> <p>Don't forget - you mess with windows at your own risk :-)</p> preet sanghahttp://www.blogger.com/profile/07027050079768738581noreply@blogger.com1