Skip to content

Instantly share code, notes, and snippets.

View Vaguery's full-sized avatar

Bill Tozier Vaguery

View GitHub Profile
@rxwei
rxwei / ad-manifesto.md
Last active November 9, 2023 09:58
First-Class Automatic Differentiation in Swift: A Manifesto
@Vaguery
Vaguery / bad-push.txt
Last active January 23, 2016 18:43
A Push program for stress-testing the new interpreter
caught exception: Value out of range for long: 1.4582948234106589E85 running
[342.44921875 227.47265625 "ࣲ࣊ݺ࿧aQᇧႂȾོቪÆભ୦՜቏ຨࢮ" \Ј 867977268 :code-pop "1෤ݢî" (:input!3 false :integer-divide true (("ᄴʗ" :input!3 :input!3 :string-yankdup 468875600) 680044766 :boolean-pop (30827267 217.14453125 true :char-notequal? 396804191) :string-fromfloat)) 223961527 :input!5 true 199.7734375 "ȑ˽౑܄ࠣჩцݺባ೜฿྅ӝိݫૄہ" "ठۏષྛ෧ࡨ಑" 16209681 :char-rotate (922763113 :char>? \' 230282795 :input!1) :input!3 "ńခ၄౶" (\μ \ᆱ (false :boolean-stackdepth :exec-y (\኱ 689117054 :input!2 :input!9 :exec-rotate) :boolean-frominteger) true :integer-inc) \ڽ 162.69921875 (:float-min 343.58203125 :integer-notequal? 212610666 :code-size) false "ף౫Ⴒ࿅లጕϗఈນੈ" :input!7 :string-fromchar "׾ቲ࿤໷ؼ,৽ؗNਰ࿟ድᄚચ୽׍ፑ" true false "ኑȵಫ൦Риލ੗čັ଒ਰ०ሄቒ൸ೝቭତ׈" :boolean-pop :code-do*count (:string-rotate 338.91015625 "ጱ݁Ǿሃ߾ݮභ້ीמփΝႝଐ٩ݫȀᅣשອ" true :boolean-shove) false 266.0234375 247.34765625 243110307 ("ʊ" \ൂ \ኺ :integer-swap false) :input!6 362347294 (136932036 :input!8 "ӃIჱ" 314.6
@Vaguery
Vaguery / challenge.md
Last active August 29, 2015 14:15
Winkler ZeroesAndOnes

Which Zeroes and Ones?

Peter Winkler, in one of the first puzzles in his excellent Mathematical Puzzles: A Connoisseur's Collection, asks for proof that every positive integer can be multiplied by some (other) integer, and the resulting product will contain only the digits 0 and 1.

As prep for a small project, I'd rather ask you: For each of the first 100 integers (or 1000 if you're ambitious), what is the smallest integer multiplicand which gives a product with only 1 and 0 among its base-10 digits?

Real question for you: How did you find them? Code welcomed, any language.

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<!--
Author: Rod Page
Source: http://iphylo.blogspot.com/2011/07/correcting-ocr-using-hocr-firefox.html#comment-400434491
-->
<xsl:output method='html' version='1.0' encoding='utf-8' indent='yes'/>
<xsl:variable name="scale" select="800 div //page/@width" />
@jboner
jboner / latency.txt
Last active July 17, 2024 03:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@lightyrs
lightyrs / gist:1108708
Created July 27, 2011 04:52
lion rails 3 setup
# 2011-07-25
#
# Mac OS X 10.7
# Xcode 4.1
# Install Lion.
# Xcode
# Download Xcode from Mac App Store.