Friday, 3 June 2011
Thursday, 5 May 2011
Simple ADO.NET
http://msdn.microsoft.com/en-us/library/haa3afyz(v=VS.100).aspx
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=78
Friday, 8 April 2011
PC to image
Sometimes its handy to backup a entire machine to a virtual image so you can load it up later.
http://www.online-tech-tips.com/free-software-downloads/convert-pc-into-virtual-machine/
http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
Wednesday, 16 March 2011
Monday, 14 March 2011
Required tools for Jquery debugging
Firefox +
Firebug +
FireQuery +
JS Deminifier (https://addons.mozilla.org/af/firefox/addon/javascript-deminifier/)
Deminifier is essential if your scripts are minified.
Tried https://addons.mozilla.org/af/firefox/addon/javascript-deminifier/ for Firefox 3.6, there is another version I have come across https://addons.mozilla.org/en-us/firefox/addon/deminifier/ - haven’t tried that one.
Thursday, 10 March 2011
Re-applying jQuery functions in replaced/inserted content
$(function () {
$('#div_id').updateStatus();
});
$.fn.updateStatus = function () {
return this.each(function () {
window.setInterval
(
refreshStatus,
5000
);
function refreshStatus() {
var param1 = $('#statusId').val();
var param2 = $('#reportsId).val();
$.get
(
AJAXUrls.getStatusURL, { Param1: param1 },
function (data) {
$('#status').empty().append(data);
}
);
$.get
(
AJAXUrls.getStatusReportURL, { Param1: param1, Param2: param2 },
function (data) {
$('#reports').empty().append(data);
$('a[rel=boxy]').boxy(); // Boxy re-applied.
}
);
};
});
}
Tuesday, 8 March 2011
Selecting text in Visual Studio
Pressing CTRL + W repeatedly selects the word, then the line, then the block of text. It’s the fastest way to select text.
Monday, 14 February 2011
Attaching debugger to w3wp.exe macro
This is a good link to automate the tedious task of attaching to w3wp.exe which you have to do countless times a day if you are a web developer.
Wednesday, 2 February 2011
Free book on claims based identity
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4C09FFE4-43DD-4FCC-BE35-C897C9BC4386
There are some other free Microsoft books there too.
Monday, 31 January 2011
Fluent API for Pre and Post conditions
http://msdn.microsoft.com/en-us/magazine/ee335714.aspx
download here, free open source:
http://conditions.codeplex.com/
update:
alternatives are
http://research.microsoft.com/en-us/projects/contracts/
http://research.microsoft.com/en-us/projects/specsharp/
Friday, 28 January 2011
Running mixed mode assemblies
FileLoadException was unhandled
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
This can be fixed obviously by building the dependency to 4.0 or with this config (if you don't have control of the assembly as in my case)
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<startup/>
key config is useLegacyV2RuntimeActivationPolicy="true"
(under <configuration> )
.NET Framework 4 Client Profile
using Microsoft.IdentityModel.Protocols.WSTrust;
but got the complier error 'the type or namespace name ... could not be found'. This was completely driving me nuts - lost 0.5 days on this. When I include the reference initially, intellisense would pick it up, but on compiling it failed with that error, then intellisense stopped picking it up.
It turns out that I was using '.NET Framework 4 Client Profile' as the target framework, on changing to '.NET Framework 4', it fixed the problem.
Thursday, 27 January 2011
XML from WIF SecurityToken
var sth = new Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler();
var ms = new MemoryStream();
var writer = XmlWriter.Create(ms);
sth.WriteToken(writer, token);
writer.Flush();
ms.Seek(0, SeekOrigin.Begin);
var xml = new StreamReader(ms).ReadLine();
where token is a SecurityToken object (System.IdentityModel.Tokens).
WCF Logging
<system.diagnostics>
<sources>
<source propagateActivity="true" logKnownPii="true" name="System.ServiceModel"
switchValue="Warning">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="traceListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="Microsoft.IdentityModel" switchValue="Warning, ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="traceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="c:\logs\log.svclog" type="System.Diagnostics.XmlWriterTraceListener"
name="traceListener" traceOutputOptions="None">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
Introduction
this is my blog mainly for keeping notes to myself - if anyone else finds it useful than great.