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
{-# LANGUAGE MultiParamTypeClasses #-} | |
module DataLib where | |
class Record a where | |
getId :: a -> Int | |
insert :: Record a => a -> [a] -> [a] | |
insert r rs = r : rs |
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
A few general notes: | |
* We switched from Mongo to Postgres, so all the lookups are ID based rather than filename/foldername based. | |
* There's a new table "photo_sequence". The hierarchy is "folder 1->* photo_sequence 1->* upload", where a "sequence" denotes e.g. one run through the gif sequence, and the corresponding "uploads" are each of the individual phots, gifs, user-edits, etc from that sequence. | |
* Folders can contain multiple "galleries", each of which has its own sharing configuration. A common use case is in printer mode, they'll have one gallery for the individual shots allowing social, and one for the composites just allowing prints, and run two separate tablets. | |
* The workflow for customizing images and forms has been improved, allowing things like gif annotation without custom code. | |
* I denote an array of objects below by brackets, e.g. [string] is a string array or [{id:int;name:string}] is an array of that record type. | |
* ... means there are other fields you can ignore | |
* v4 api serv |
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
package com.company; | |
import java.util.ArrayDeque; | |
import java.util.PriorityQueue; | |
import java.util.Queue; | |
public class Main { | |
// Start by defining Nodes and Edges (Nodes in a tree have Edges of a certain length to a child Node) | |
static class Edge { |
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
open System.Threading.Tasks | |
open System.Threading | |
open System | |
let criteria _ b = b = 10 | |
let callback (i: int) = | |
Thread.Sleep(50) | |
printfn "Callback %d" i | |
let rec compute (task: Task) state = |
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
{{input}} -annotate +10+20 "{{firstName}} {{lastName}}" {{output}} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Response><Sms>Nothing to see here.</Sms></Response> |
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
#time "on" | |
type State = { remaining: int64; aggregate: int64 } | |
let div = 10L | |
let rec skynet num size postback = | |
if size = 1L then | |
postback num | |
else |
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
#time "on" | |
type State = { remaining: int64; aggregate: int64 } | |
let div = 10L | |
let rec skynet num size postback = | |
if size = 1L then | |
postback num | |
else |
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 '[clojure.algo.monads]) | |
(require '[clojure.core.async :as async]) | |
(defmonad async-m | |
"Monad describing async operations." | |
[m-result (fn m-result-async [v] | |
(let [c (async/chan)] | |
(async/go (async/>! c v)) | |
c)) |
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
open System.Diagnostics | |
let N = 100000 | |
let calc_sync i = i % 10 | |
let sum_sync() = | |
async { | |
let ints = Seq.initInfinite calc_sync |> Seq.take N | |
return Seq.sum ints | |
} |