Skip to content

Instantly share code, notes, and snippets.

View yodiz's full-sized avatar

Mikael Kjellqvist yodiz

  • Yodiz AB
  • Sweden
View GitHub Profile
package spotify.metadata.proto;
option optimize_for = SPEED;
option java_package = "com.spotify.metadata.proto";
option java_outer_classname = "Metadata";
message TopTracks {
optional string country = 1;
repeated Track track = 2;
}
BEGIN TRAN
CREATE Table CdrPresentation (
CdrPresentationId INT NOT NULL IDENTITY(1,1),
Description VARCHAR(250) NOT NULL,
ChargePerNumber NUMERIC(7,4) NOT NULL,
ChargeIntervall BIGINT NOT NULL,
BaseUnit char(1) NOT NULL,
@yodiz
yodiz / s
Created May 18, 2012 12:13
sdsdf
sdfsdf
1500444040002639480000000114738TAbonnemang: 042182975
1500444040002639480000000114738T
1500444040002639480000000114738TTrafik (20120202-20120417) Pris/st Antal Intervall Pris/enhet Volym
1500444040002639480000000114738TQall kundtjänst 0,00 5 60s 0,00/min 00:52:00 0,00
1500444040002639480000000114738TInrikes fasttelefoni 0,59 2 60s 0,19/min 00:37:00 8,21
1500444040002639480000000114738T
1500444040002639480000000114738TFakturaavgift (20121210) 30,00
SELECT COUNT(*) FROM Cdr
JOIN Contract ON Cdr.BillingClientNr = Contract.ClientNr And Cdr.BillingContractNr = Contract.ContractNr
WHERE BillingClientNr = 44404 And StartTime > '2013-02-01' And StartTime < '2013-03-01' And Cdr.CallType=1
And NumberGroupCode = 'FIXED'
And Contract.ProductNr = 0
And Cdr.BillingPriceListCode like 'T%'
25908
using System;
using System.Collections.Generic;
using System.Linq;
namespace GLIM.Utilities.Text
{
public enum FieldOption
{
Required = 0,
Optional = 1
@yodiz
yodiz / BTree.fs
Created April 13, 2017 20:52
F# Binary tree
module BTree
type Node<'a, 'b> = {
Key : 'a
Value : 'b
Left : Tree<'a, 'b>
Right : Tree<'a, 'b>
}
and Tree<'a, 'b> =
@yodiz
yodiz / time_fold.fs
Created May 16, 2019 20:06
Timing of fold-functions in F#
let inline fold f a (xs: _ []) =
let mutable a = a
for i=0 to xs.Length-1 do
a <- f a xs.[i]
a
let afold f a (xs: _ []) =
let mutable a = a
for i=0 to xs.Length-1 do
a <- f a xs.[i]
type CircularBuffer<'b>(bufferSize) =
let buffer : 'b option array = Array.init bufferSize (fun _ -> None)
let mutable currentIndex = bufferSize - 1
let lockObj = System.Object()
member x.Add item =
lock (lockObj)
(fun () ->
let newIndex =
type Rec = { A : int; B : string }
let customServiceSchema : JsonSchemaType<Rec> =
recordSchema<Rec> "My Record" ""
[|
qouteField "id" "" SchemaJSON.int32 <@ fun x -> x.A @>
qouteField "status" "" SchemaJSON.string <@ fun x -> x.B @>
|]