Skip to content

Instantly share code, notes, and snippets.

@akimboyko
akimboyko / 1readme.md
Created January 18, 2015 13:25
F# Interactive configuration for Machine Learning tasks

F# tricks

  • Use 64-bit configuration. At Visual Studio switch 'Tools/Options/F# tools/F# Interactive/64-bit F# Interactive' should be "true"
  • Tune Fsi.exe and FsiAnyCPU.exe configuration in “c:\Program Files (x86)\Microsoft SDKs\F#<version>\Framework<version>\” ** — specifies whether the common language runtime runs server garbage collection. ** — specifies whether the common language runtime runs garbage collection on a separate thread. ** — on 64-bit platforms, enables arrays that are greater than 2 gigabytes (GB) in total size.
@vbfox
vbfox / Dapper.fs
Last active April 21, 2022 02:58
Minimal dapper in F#
module DapperFSharp =
open System.Data.SqlClient
open System.Dynamic
open System.Collections.Generic
open Dapper
let dapperQuery<'Result> (query:string) (connection:SqlConnection) =
connection.Query<'Result>(query)
let dapperParametrizedQuery<'Result> (query:string) (param:obj) (connection:SqlConnection) : 'Result seq =
@kkozmic
kkozmic / AppSettingsAttribute.cs
Last active June 12, 2020 13:41
Strongly typed configuration using Castle DictionaryAdapter requires castle.core nuget package
[AttributeUsage(AttributeTargets.Interface,AllowMultiple = false)]
public class AppSettingsAttribute : KeyPrefixAttribute, IDictionaryPropertyGetter, IPropertyDescriptorInitializer
{
public AppSettingsAttribute(string keyPrefix) : base(keyPrefix)
{
}
public object GetPropertyValue(IDictionaryAdapter dictionaryAdapter, string key, object storedValue,
PropertyDescriptor property, bool ifExists)
{