Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Beal beala

View GitHub Profile
View covid.yaml
gf has covid [0.95]:
friend has covid [0.14]: true
~friend has covid: false
~gf has covid:
friend has covid [0.02]: true
~friend has covid: false
@beala
beala / concede.yaml
Last active Oct 27, 2020
Forecast for https://www.metaculus.com/questions/5356/2020-us-election-concession/ using a small tool for summing the interesting paths in a probability tree.
View concede.yaml
biden wins [0.85]:
biden large win [0.47]:
results before deadline [0.90]:
trump concedes [0.75]: true
~trump concedes: false
~results before deadline:
trump concedes [0.01]: true
~trump concedes: false
biden moderate win [0.3]:
results before deadline [0.80]:
View gist:23f6eaa08ecced705638397953805466

This question focuses on New York City, which has seen both a reduction in cases from a peak of 6368 confirmed cases on April 6th, and widespread protesting, with the first protests beginning on May 28th. New York City has not entered phase one of reopening, but is slated to begin on June 8th.

This question asks what the average of confirmed new cases per day will be for June 15th to June 21st (7 days, inclusive of both endpoints) as calculated from values in this CSV file in the CASE_COUNT column. The values will be read two weeks later, on July 5th at 10 AM MST to account for reporting lag. If the numbers are not available, or the github repository no longer exists, the question will resolve ambi

@beala
beala / extract.md
Last active Apr 27, 2020
Worldometers Country Data Extractor
View extract.md

What is this

This bookmarklet extracts data from worlometers country pages into a downloadable csv file.

Installation

To install it:

  1. If your bookmarks bar is hidden, display it: Ctrl + Shift + b.
  2. Copy the following code into your clipboard. You'll need it in a sec.
@beala
beala / Config
Last active Dec 16, 2017
Use Dhall (https://hackage.haskell.org/package/dhall-1.8.2/docs/Dhall-Tutorial.html) and dhall-text (https://github.com/dhall-lang/dhall-text) to generate a training script for tensorflow training.
View Config
-- Type decl for parameters to the training script.
{ architecture : Text
, learningRate : List Double
, steps : List Natural
, unknownPercent : Natural
, windowStrideMs : Natural
, startingCheckpoint: Optional Natural
}
View john_muir.md

Yosemite Valley Sep 3d 1843

Dear Sister Sarah,

I have just returned from the longest & hardest trip I have ever made in the mtns., having been gone over five weeks. I am weary but resting fast, Sleepy but sleeping deep & fast, hungry but eating much – For two weeks I explored the glaciers of the summits east of here, sleeping among the snowy mtns without blankets & with but little to eat on account of its being so inaccessible. After my icy experiences it seems strange to be down here in so warm & flowery a climate.

I will soon be off again determined to use all the season in prosecuting my researches — will go next to Kings river a hundred miles south, then to Lake Tahoe & adjacent mtns. & in winter work in Oakland with my pen. The Scotch are slow but some day I will have the results of my mountain studies in a form in which you all will be able to read & judge of them. In the mean time I write occaisonally for the Overland Monthly but neither these magazine articles nor my first book will form any fini

@beala
beala / TreeRotation.idr
Created Mar 5, 2017
Proving some properties of binary trees and rotation in idris.
View TreeRotation.idr
{-
In this file I:
- Define a binary tree.
- Define a type level predicate for right rotation of a tree. That is, this type
can only be instantiated for trees that can be right rotated.
- Prove that it's decidable if a tree can be right-rotated or not.
- Prove that right-rotating a tree preserves in-order traversal.
-}
-- A binary tree.
@beala
beala / ¯|_(ツ)_|¯.scala
Created Jun 17, 2016
I've been using Scala for years and I have no idea how inheritance works. http://docs.scala-lang.org/tutorials/FAQ/initialization-order.html
View ¯|_(ツ)_|¯.scala
class C {
val a: Int = 1
val b: Int = a + 10
}
class B extends C {
override val a: Int = 100
}
println(s"a = ${new B().a}")
@beala
beala / Cryptol.agda
Last active Jun 14, 2016
A runnable implementation of the "Cryptol view" from the "Power of Pi": http://www.cs.ru.nl/~wouters/Publications/ThePowerOfPi.pdf I also attempted to implement part of SHA-1.
View Cryptol.agda
open import Data.Vec hiding (take; drop; [_]; split)
open import Data.Nat using (_*_; ℕ; zero; suc; _+_)
open import Data.Fin using (Fin; _≤_; compare; toℕ)
open import Relation.Binary.Core using (_≡_; refl)
open import Relation.Binary.PropositionalEquality using (cong)
import Data.Bool.Base as B using (if_then_else_; Bool; _∧_; true; false)
-- A runnable implementation of the "Cryptol View" from "The Power of Pi"
-- by Nicolas Oury and Wouter Swierstra with an implementation of SHA-1
@beala
beala / TabsVsSpaces.scala
Last active May 31, 2016
Mixing tabs and spaces is great... in theory.
View TabsVsSpaces.scala
// Indent with tabs (␉), align with spaces (␠)
class C {
def f(loooooooooooooooooooooooongName: String
␉ ␠␠␠␠␠␠b: String): Unit = {
␉ ␉ doThing(loooooooooooooooooooooooongName,
␉ ␉ ␠␠␠␠␠␠␠␠b)
␉ }
}