This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #light | |
| type Currency = { Code : string; Name : string; } | |
| type Money = { Amount : float; Currency : Currency } | |
| type Asset = | |
| | Equity of string * Money | |
| | FixedIncome of string * Money | |
| | Cash of Money |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #light | |
| let rec printList xs = | |
| match xs with | |
| | [] -> printfn "" | |
| | [x] -> printf "%d" x | |
| printList [] | |
| | x :: xs -> printf "%d, " x | |
| printList xs | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static IEnumerable<T> As<T>(this IEnumerable genericEnumerable) { | |
| foreach (T item in genericEnumerable) | |
| yield return item; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #light | |
| (* | |
| Translating some functions in the Polynomials chapter of | |
| "The Haskell Road to Logic Maths and Programming" | |
| (chapter 9) | |
| http://fldit-www.cs.uni-dortmund.de/~peter/PS07/HR.pdf | |
| *) | |
| let N = Seq.init_infinite (fun x -> x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #light | |
| namespace SqlFuckTests | |
| open NUnit.Framework | |
| // Didn't find the extension methods you referenced, so made these | |
| module Extensions = | |
| type System.Object with | |
| member this.ShouldBeOfType (a:System.Type) : unit = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Polynomials | |
| where | |
| difs :: [Integer] -> [Integer] | |
| difs [] = [] | |
| difs [n] = [] | |
| difs (n:m:ks) = m-n : difs (m:ks) | |
| difLists :: [[Integer]]->[[Integer]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Broker_Recon_Data | |
| go | |
| begin transaction | |
| select | |
| * | |
| from | |
| Broker_Recon_Data.dbo.t_Bond_Reference | |
| WHERE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <!-- Trying to make a build file for a pure (no-xaml) f# silverlight application --> | |
| <PropertyGroup> | |
| <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | |
| <SchemaVersion>2.0</SchemaVersion> | |
| <NoStdLib>true</NoStdLib> | |
| <NoStdCfg>true</NoStdCfg> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| position.BrokerAccount | |
| , position.Contract | |
| , contractDetails.Future_Index_Contracts as Name | |
| , contractDetails.Market_Sector_Code as MarketSectorCode | |
| , position.Currency | |
| , contract.BloombergTicker | |
| , Sum(position.Quantity) as Quantity | |
| from | |
| ( select |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void GetSql() { | |
| var cfg = new NHibernate.Cfg.Configuration(); | |
| SessionFactoryManager.Configurers.Get("fx").ConfigureProperties(cfg); | |
| SessionFactoryManager.Models.Get("fx").Configure(cfg); | |
| var exporter = new SchemaExport(cfg); | |
| CancelView(); | |
| Response.Write("<html><body>"); | |
| exporter.Create(x => Response.Write("<br /><pre>" + x + "</pre>"), false); | |
| Response.Write("</body></html>"); |