Monday, June 15, 2015

Long sentence


http://yarchive.net/blog/long_sentences.html

Long sentence =>
complicated sentence =>
- Need to remember context
- Not to extend and repeat previsoue idea

Thursday, June 11, 2015

Binary tree search logic in pseudo code

  node search (node, key) {
       if node is null then return null;
     
       if node.key = key then
          return node
         
       if key < node then
          return search (node.left, key);
       else
          return search (node.right, key);

Reference:
http://www.codeproject.com/Articles/18976/A-simple-Binary-Search-Tree-written-in-C

Wednesday, June 10, 2015

How to solve problem "Inheritance security rules violated by type: 'System.Web.WebPages.Razor.WebPageRazorHost'. Derived types must either match the security accessibility of the base type or be less accessible."

How to solve problem "Inheritance security rules violated by type: 'System.Web.WebPages.Razor.WebPageRazorHost'. Derived types must either match the security accessibility of the base type or be less accessible."

This error happens after add Razor engine into ASP.NET MVC 4 project by nuget package.
https://github.com/Antaris/RazorEngine

I fixed this problem by remove following part from web.config
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>

Reason:
Default ASP.NET MVC 4 razor engine is version 2, and nuget for RazorEngine project is version 3.