Skip to content

Instantly share code, notes, and snippets.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDaq6hozejSIW4QG7eygagW17LgKGM1B3t5+evxF4UZP9L0Ki7kvZ27cEi5fVHIOTqNZRCTpqbjwnRRukI7jGwG1RHE3xF+Th2O5GjduAZydHYS8nYhY4BEfVNL/FUKE/kHcXqQ6ofO3m2s10ZStt5PVEP6f2N6pNwdxYUPz+1xqaYQ5KRoVeM0rRQx/oxoFbSl4aYZhJJ37ZGsXmZDSHe/1UFB7xJu3u06AD7yNSzU7n0XH47AyUFeZ659pFPM2wEaQr2f677mBHr5ZUJ9FCCtKN7fjDWSZIHT8EJCuHuiJHiF9NjGc1W9BW6MxQIo3AUlB+daFncJjuvbMpgZyYFn [email protected]
[java] FAIL in (seq-and-transducer) (transducers.clj:135)
[java] {:coll [0 0],
[java] :actions (->> coll (take 1)),
[java] :s (0),
[java] :xs (0 0),
[java] :xi [0 0],
[java] :xt [0 0]}
[java]
[java] expected: (:result res)
[java] actual: false
Ok, this isn't quite rigorous, but I bet it's right anyway =P
Imagine F is discontinuous at some point, and jumps by like, 1. Well, if you
put x1 and x2 really close together around the point, we'll violate the
constraint, right? So let's make F nice and smooth instead. But let's say
somewhere F has a derivative of 1. Well, if we put x1 and x2, say, 0.01 apart,
then (x2-x1)^2 = 0.0001 but F is gonna change by 0.01, so that's out.
But however small we make the derivative, we can always squeeze the two points
closer together so that the function changes too fast.
Clearly it's just never allowed to change at all. F(x) = C.
diff --git i/src/clj/clojure/core_deftype.clj w/src/clj/clojure/core_deftype.clj
index 97e14cc..eb98de8 100644
--- i/src/clj/clojure/core_deftype.clj
+++ w/src/clj/clojure/core_deftype.clj
@@ -50,6 +50,18 @@
(drop-while seq? (next s)))
ret)))
+(comment
+ (map deref
@MichaelBlume
MichaelBlume / wifi.bash
Last active August 29, 2015 14:15
don't let me leave tethering on when I don't need it
#!/usr/bin/env bash
wifis=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s`
hwwifis=`echo "$wifis" | grep "Climate\|Volterra"`
tether=`echo "$wifis" | grep "Mike"`
if [ -n "$hwwifis" ] && [ -n "$tether" ]; then
growlnotify -s -m "stop tethering"
fi
@MichaelBlume
MichaelBlume / gist:a62cc5d717e27141f7c0
Last active February 10, 2016 19:38
gawker block
# Paste this into your /etc/hosts
# Then (if you're on a Mac) run 'sudo dscacheutil -flushcache'
# This will prevent your computer from accessing sites owned by Gawker Media,
# thus improving your internet experience.
0.0.0.0 gawker.com deadspin.com lifehacker.com gizmodo.com io9.com jalopnik.com jezebel.com kotaku.com io9.gizmodo.com
(ns honeysql.extensions.returning
(:require
[honeysql.format :as f]
[honeysql.helpers :as h]))
(defmethod f/format-clause :returning [[_ fields] _]
(str "RETURNING " (f/comma-join (map f/to-sql fields))))
(f/register-clause! :returning 225)
Initialized empty Git repository in /Users/michael.blume/workspace/git/t/trash directory.t3400-rebase/.git/
expecting success:
git config core.logAllRefUpdates true &&
echo First >A &&
git update-index --add A &&
git commit -m "Add A." &&
git checkout -b force-3way &&
echo Dummy >Y &&
git update-index --add Y &&
git commit -m "Add Y." &&
01-10 16:12:36.311 15315 15315 D AndroidRuntime: Shutting down VM
01-10 16:12:36.320 15315 15315 D HockeyApp: Writing unhandled exception to: /data/user/0/com.tumblr/files/202aa2c9-7325-4ec6-a2f1-45f96266dd92.stacktrace
01-10 16:12:36.332 15315 15315 W System.err: java.lang.AbstractMethodError: abstract method "int android.text.ParcelableSpan.getSpanTypeIdInternal()"
01-10 16:12:36.332 15315 15315 W System.err: at android.text.TextUtils.writeToParcel(TextUtils.java:653)
01-10 16:12:36.332 15315 15315 W System.err: at android.os.Parcel.writeCharSequence(Parcel.java:572)
01-10 16:12:36.332 15315 15315 W System.err: at android.view.accessibility.AccessibilityNodeInfo.writeToParcel(AccessibilityNodeInfo.java:2701)
01-10 16:12:36.332 15315 15315 W System.err: at android.os.Parcel.writeTypedList(Parcel.java:1148)
01-10 16:12:36.332 15315 15315 W System.err: at android.view.accessibility.IAccessibilityInteractionConnectionCallback$Stub$Proxy.setFindAccessibilityNodeInfosResult(IAccessibilityInteractionConnectio
@MichaelBlume
MichaelBlume / textsecure_cutoff.clj
Created March 24, 2016 21:13
drops all messages older than some date from a textsecure backup
(def cutoff
(clj-time.coerce/to-long
(clj-time.core/date-time 2015 4 3 5 54)))
(with-open [input (java.io.FileInputStream.
"/Users/michael.blume/TextSecurePlaintextBackup.xml")
output (java.io.FileWriter.
"/Users/michael.blume/betterbackup.xml")]
(-> input
clojure.data.xml/parse