Instead of the verbose setOnClickListener
:
RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));
Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
package main | |
import ( | |
"log" | |
"bufio" | |
"time" | |
"os" | |
"fmt" | |
"io" | |
"net" |
Can be extracted from `libswiftCore.dylib` with: | |
cd `xcode-select -p`/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx | |
nm -a libswiftCore.dylib | grep "T _swift_" | |
Output: | |
00000000001a4fc0 T _swift_ClassMirror_count | |
00000000001a52a0 T _swift_ClassMirror_quickLookObject | |
00000000001a5000 T _swift_ClassMirror_subscript |
import pyproj | |
from shapely.geometry import shape | |
from shapely.ops import transform | |
geom = {'type': 'Polygon', | |
'coordinates': [[[-122., 37.], [-125., 37.], | |
[-125., 38.], [-122., 38.], | |
[-122., 37.]]]} | |
s = shape(geom) |
Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux
After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling
import Darwin | |
extension Array { | |
func shuffle() -> Array { | |
// this will sometimes crash (submitted bug #17127524) | |
self.sort { _,_ in arc4random_uniform(2) == 1 } | |
return self | |
} | |
mutating func removeAtIndexes( indexes:Int... ) { | |
indexes.sort(>) |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)A Dashing widget for displaying the number of current visitors (in real time) to your website, as reported by Google Analytics.
This widget is a fork of https://gist.github.com/mtowers/5986576