-
arguments.callee
var sum = function(i) { if (i == 1) { return i; } else { return i + arguments.callee(i-1); } } alert(sum(3));
-
makeArray function
function highest(){ //return arguments.slice(1).sort(function(a,b){ return makeArray(arguments).sort(function(a,b){ return b - a; }); } function makeArray(array){ return [].slice.call( array ); }
-
change in mvc2 project
- project file change, replace guid {603c0e0b-db56-11dc-be95-000d561079b0} with {F85E285D-A4E0-4152-9332-AB1D724D3325} in ProejctTypeGuids nodes
- Reference dll change, update all reference in web.config files and project files
update runtime binding.
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> </assemblyBinding></runtime>
- javascript file changes, copy new script from new project to old project
-
Covariant/Contravariant Support for generic interface .net 4.0
The introduction of generic in .net makes covariant/contravariant support a very interesting topic. Now .net 4, there are some support for generic interface. But covariant and contravariant for generic class is still not supported with good reason, so you can not write the following code in .net 2 and .net 4
[TestMethod] public void no_covariant_support_for_generic_class() { //can not be compiled List<object> list = GetListOfString(); //if support, what if use write list[0] = 1; //this is not secure
-
compiled time support for Covariant and Contravariant in .net 2.0
In .net 2.0, A delegate can be associated with a named method, this facility provide support for covariant and contravariant as the following sample code shows.
delegate void ProcessString(string item); delegate object GetObject();