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
class Tableau {} | |
class SV {} | |
class DM {} | |
class Stabilizer {} | |
class Unitary {} | |
class Channel {} | |
fun apply(stabilizer: Stabilizer, tableau: Tableau) {} | |
fun apply(unitary: Unitary, sv: SV) {} | |
fun apply(channel: Channel, dm: DM) {} |
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
import Mathlib.Tactic | |
import Mathlib.Data.Real.Basic | |
import Mathlib.Data.Vector.Zip | |
theorem reverse_get_kth (n: Nat) (k: Fin n) (v: Vector Nat n): | |
v.get k = v.reverse.get (Fin.revPerm k) := by | |
cases n with | |
| zero => exact k.elim0 | |
| succ => |
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
using System; | |
using System.Text; | |
namespace ConsoleApp6 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
while (true) |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | |
</startup> | |
<runtime> | |
<gcServer enabled="true"/> | |
</runtime> | |
</configuration> |
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 AlgorithmW | |
// HINDLEY-MILNER TYPE INFERENCE | |
// Based on http://catamorph.de/documents/AlgorithmW.pdf | |
type Lit = | |
| LInt of int | |
| LBool of bool | |
type Exp = |
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 | |
// A simple service | |
module PrinterService = | |
open System | |
// Helper functions first | |
// They can be public for easy unit testing, so long as they don't leave things inconsistent | |
let isObscene s = String.length s = 4 |
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
let addChild updateNode addNode value parent = | |
match withNewChild value parent with | |
| None -> async.Return None | |
| Some (newParent, child) as path -> | |
async { do! addNode child | |
do! updateNode newParent | |
return Some child } | |
let addChildById getNode updateNode addNode logAction value parentId = | |
async { let! parent = getNode parentId |
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
{-# 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 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 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 { |
NewerOlder