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
// Dev Express documentation is lacking F# interactive samples | |
// https://docs.devexpress.com/WindowsForms/2508/controls-and-libraries/chart-control/examples/producing-output/how-to-export-a-chart-to-image | |
#r @"paket: nuget DevExpress.XtraCharts.v21.1" | |
open System.IO | |
open System.Windows.Forms | |
open DevExpress.XtraCharts | |
let pieChart = ChartControl(Width=1600,Height=1000) | |
let series = | |
new Series( |
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
// replicating same techniques as | |
// https://youtu.be/1ZJ8ROVS5gk?t=1435 | |
[<Struct>] | |
type Point = | |
val mutable X : int | |
val mutable Y : int | |
new(x, y) = { X = x; Y = y } | |
type Enemy(location: Point) = |
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
open System | |
open System.Data.SqlClient | |
type EntryType = | |
| BuffersReceived | |
| BuffersSent | |
| BytesSent | |
| ConnectionTime | |
| CursorOpens | |
| IduCount |
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
// code converted for http://seif.codes/playing-with-net-dotnet-and-ironfunctions/ | |
// https://twitter.com/SeifLotfy/status/805901527659540480 | |
open System | |
open System.IO | |
open System.Security.Cryptography | |
open System.Text | |
let downloadRemoteImageFile (url: string) = | |
let request = url |> System.Net.WebRequest.CreateHttp |
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
declare | |
@templateSchemaName nvarchar(max) | |
, @templateTableName nvarchar(max) | |
, @newSchemaName nvarchar(max) | |
, @newTableName nvarchar(max) | |
with columninfo as ( | |
select | |
t.name table_name | |
, c.name column_name |
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
open System | |
open System.Data | |
module DataTableMaker = | |
type ColumnMaker<'t> = { Name: string; Type: Type; GetValue: 't -> obj } | |
let makeColumn name (f: _ -> 'c) = | |
{ Name = name; Type = typeof<'c>; GetValue = f >> box } |
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
namespace MyTypeProviders | |
open System | |
open System.IO | |
open System.Reflection | |
open ProviderImplementation.ProvidedTypes | |
open Microsoft.FSharp.Core.CompilerServices | |
open CsvHelper | |
open System.Collections.Generic | |
open Microsoft.FSharp.Quotations |
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
#r "../../../../packages/Mono.Cecil/lib/net40/Mono.Cecil.dll" | |
#r "../../../../packages/QuickGraph/lib/net4/QuickGraph.dll" | |
#r "../../../../packages/FAKE/tools/FakeLib.dll" | |
open Mono.Cecil | |
open System.IO | |
open QuickGraph | |
open System.Linq | |
open System.Reflection | |
let folder = @"C:\testing\DevExpress 15.2\Components\Bin\Framework" |
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
with | |
unique_constraint_infos (schemaname, tablename, constraintname, columnname) | |
as ( | |
select | |
quotename(tc.table_schema) | |
, quotename(tc.table_name) | |
, quotename(tc.constraint_name) | |
, quotename(cc.column_name) | |
from | |
information_schema.table_constraints tc |
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
open System | |
type Part = Days of int | |
| Hours of int | |
| Minutes of int | |
| Seconds of int | |
| Milliseconds of int | |
let bigPartString p = | |
match p with | |
| Days 0 -> "" |
NewerOlder