This file contains 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
/* | |
//Software usage License : Fluent Nhibernate membership and role provider | |
//-------------------------------------------------- | |
//Copyright (c) 2010, Suhel Shah ([email protected]) | |
//All rights reserved. | |
//Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
//1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
//2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
This file contains 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 | |
module ProjectEuler.Program | |
open System; | |
open System.Diagnostics; | |
open System.Reflection; | |
let dynamicExecute prob = | |
let probNum = prob.ToString() | |
let ass = Assembly.GetExecutingAssembly() | |
let modul = ass.GetType("ProjectEuler.Problem" + probNum) |
This file contains 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
ObjectFactory.Initialize(fun x -> x.AddRegistry (new SearchRegistry())) | |
let write<'T> item = | |
async { | |
ObjectFactory.GetAllInstances<Indexer<'T>>() | |
|> Seq.iter (fun idxr -> idxr.Index item) | |
} | |
let itemsToIndex<'T when 'T:null and 'T:not struct and 'T:equality> = | |
let p = QueueProvider<'T>.Create() |
This file contains 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 Program | |
#light | |
open System.Threading | |
open StructureMap | |
open BrewTelligence.Domain | |
open BrewTelligence.Search.Indexing | |
open BrewTelligence.ApplicationServices | |
open BrewTelligence.ApplicationServices.Messaging |
This file contains 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
ObjectFactory.Initialize(fun x -> x.AddRegistry (new SearchRegistry())) | |
let write<'T> item = | |
ObjectFactory.GetAllInstances<Indexer<'T>>() | |
|> Seq.iter (fun idxr -> idxr.Index item) | |
let itemsToIndex<'T when 'T:null and 'T:not struct and 'T:equality> = | |
let p = QueueProvider<'T>.Create() | |
seq { | |
while true do |
This file contains 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 Seq | |
#light | |
let rec merge s1 s2 = | |
seq { | |
yield s1 |> Seq.head | |
yield s2 |> Seq.head | |
yield! merge s1 s2 | |
} |
This file contains 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 Seq | |
#light | |
let merge (s1:seq<'a>) (s2:seq<'a>) = | |
let rec innerMerge s1 s2 = | |
seq { | |
match s1, s2 with | |
| LazyList.Cons(h1, t1), LazyList.Cons(h2, t2) -> | |
yield h1 |
This file contains 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 | |
open System | |
module Seq = | |
let merge (s1:seq<option<'a>>) (s2:seq<option<'a>>) = | |
let rec innerMerge s1 s2 = | |
seq { | |
match s1, s2 with | |
| LazyList.Cons(h1, t1), LazyList.Cons(h2, t2) -> | |
yield h1 |
This file contains 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 Program | |
#light | |
open System.Threading | |
open StructureMap | |
open BrewTelligence.Domain | |
open BrewTelligence.Search.Indexing | |
open BrewTelligence.ApplicationServices | |
open BrewTelligence.ApplicationServices.Messaging |
This file contains 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
type Service = //snip | |
member this.Run() = | |
let mutable retryCount = 0 | |
while retryCount < 10 do | |
//what to do on mono? Maybe setting up local log better | |
let errorCallback = | |
function(ex:System.Exception) -> this.EventLog.WriteEntry("error in BrewTelligence Indexing Service:\n\n" + ex.Message + "\n\n" + ex.StackTrace) | |
try |
OlderNewer