Tuesday, July 29, 2014

SelfNote: Credit Risk Model

My first paper on Credit Risk model.

www.fonsrisksolutions.com/Documents/Using%20Default%20Rates%20FAJ.pdf is a good good paper. The unusual pattern "crisis-at-maturity" model is quite interesting to me.

Sunday, March 2, 2014

Setup Azure cloud on Windows Server

Service Bus is Azure Cloud solution, but it can be installed on your own hardware which must run Windows Server 2012.

Here are the links I think you need:
Installations and configuration instructions: http://msdn.microsoft.com/en-us/library/dn441394.aspx

the WebPI folder download folder is %LocalAppData%\Microsoft\Web Platform Installer\installers. You can get the WebPI installation file there.

the service bus connection string can be retrieved by using Get-SBClientConfiguration. Please make sure you import the certificate from the server to your local computer. Make sure use Get-SBAuthorizationRule to get the connection string with shared key.

Thursday, February 13, 2014

Reverse List Every K Node

Today I found an question and decide to use F# pattern match to give it a try.

The question is reverse a list every k node. For example, if the input list is [1; 2; 3; 4; 5; 6; 7; 8; 9; 10] and k = 3, the output will be [3; 2; 1; 6; 5; 4; 9; 8; 7; 10].

When I use pattern matching, I always like recursive implementation.

 let arr = [1..10]  
 let rec reverse arr i =   
   let reverse2 arr =   
     arr |> List.rev  
   let rec getHeadTail arr i =   
     match i with  
     | 0 -> ([], arr)  
     | _ ->   
       match arr with   
       | [] -> ([], [])  
       | h::t ->   
         let (head,tail) = getHeadTail t (i-1)  
         ([h]@head, tail)  
   let headArr, tail = getHeadTail arr i  
   match tail with  
   | [] -> reverse2 headArr  
   | _ -> reverse2 headArr @ reverse tail i  
 reverse arr 6  

Wednesday, February 12, 2014

F# Code Snippet Updated

I updated the F# code snippet addon for Visual Studio 2013. I will upload the source code to  once the source code is located. I really need to clean up the source code folder. There is no recompile is needed. The root cause for previous addon does not work on VS2013 is because this. The fix is simple, 

  1. download the code snippet vsix file
  2. rename it to .zip file because it is a zip file
  3. find the vsixmanifest file
  4. change InstallationTarget to