Skip to content

Instantly share code, notes, and snippets.

@jagill
jagill / geometry-typestate.rs
Created July 14, 2020 12:29
Using typestate to statically check valid/prepared status for geometries
use crate::SegRTree;
use crate::{Coordinate, Rectangle};
#[derive(Debug)]
struct ValidationError;
#[derive(Debug)]
struct RingError;
// STATE
POLYGON ((-79.7450000000000045 32.8400000000000034, -79.7300000000000040 32.8400000000000034, -79.7288448999999986 32.8382823000000030, -79.7270325000000071 32.8323201999999981, -79.7269957000000034 32.8320999999999970, -79.7269265000000047 32.8319647000000003, -79.7268492999999978 32.8318738999999979, -79.7268452999999937 32.8317048999999983, -79.7268337000000002 32.8315417000000025, -79.7267664000000025 32.8313592000000014, -79.7267915999999985 32.8311232000000004, -79.7266943000000055 32.8307564999999997, -79.7266920999999940 32.8305892999999998, -79.7266834999999929 32.8304589999999976, -79.7266943000000055 32.8302741999999981, -79.7267032999999969 32.8301608000000016, -79.7266543000000070 32.8299331999999993, -79.7291239999999988 32.8298295000000024, -79.7303481999999946 32.8259316999999982, -79.7307530000000071 32.8254675000000020, -79.7308311000000032 32.8255059000000031, -79.7309419000000048 32.8255388999999980, -79.7310331000000048 32.8255553999999989, -79.7316256000000010 32.8256706000000023, -79.73
0 $ python train.py
WARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype.
WARN: You are calling 'step()' even though this environment has already returned done = True. You should always call 'reset()' once you receive 'done = True' -- any further steps are undefined behavior.
Exception ignored in: <function Viewer.__del__ at 0x119f546a8>
Traceback (most recent call last):
File "/Users/jagill/.envs/gym/lib/python3.7/site-packages/gym/envs/classic_control/rendering.py", line 143, in __del__
File "/Users/jagill/.envs/gym/lib/python3.7/site-packages/gym/envs/classic_control/rendering.py", line 62, in close
File "/Users/jagill/.envs/gym/lib/python3.7/site-packages/pyglet/window/cocoa/__init__.py", line 281, in close
File "/Users/jagill/.envs/gym/lib/python3.7/site-packages/pyglet/window/__init__.py", line 770, in close
ImportError: sys.meta_path is None, Python is likely shutting down
@jagill
jagill / findMergedBranches.sh
Last active January 4, 2016 14:29
Find remote branches which have been fully merged into a given branch.
baseBranch=develop
for b in `git branch -r | awk '{print $1}'`; do
numLogs=`git log --oneline $baseBranch..$b | wc -l`;
lastModified=`git show $b | grep "^Date:" | sed 's/^Date:\(.*\)/\1/'`
echo $b : $numLogs : $lastModified;
done | grep " 0 "
@jagill
jagill / gist:7953616
Created December 13, 2013 23:45
Meteor update from 0.6.7-rc0 to 0.6.7-rc1 failure
jag@coati:/tmp$ meteor create --release 0.6.7-rc1 test2
Installing Meteor 0.6.7-rc1:
* Package updates: accounts-ui-unstyled facebook facts github google madewith
meetup meteor mongo-livedata spiderable templating test-in-browser twitter
weibo
Failed to load packages for release 0.6.7-rc1
/Users/jag/.meteor/tools/0b2f28e18b/lib/node_modules/fibers/future.js:206
throw(ex);
@jagill
jagill / Build output
Created December 13, 2013 23:42
My application fails to build when upgrading from Meteor 0.6.6.3 to 0.6.7-rc0.
jag@coati:~/madeye/integration-tests/apogee (develop)$ meteor --settings "$PWD/settings.json" --port $MADEYE_APOGEE_PORT --release 0.6.7-rc0 --raw-logs
=> Using Meteor 0.6.7-rc0 as requested (overriding Meteor 0.6.6.3)
[[[[[ ~/madeye/integration-tests/apogee ]]]]]
iron-router: updating npm dependencies -- connect...
stripe: updating npm dependencies -- stripe...
npm ERR! missing: coffee-script@1.6.3, required by pince@0.0.4
npm ERR! missing: underscore@1.5.2, required by pince@0.0.4
npm ERR! missing: moment@2.4.0, required by pince@0.0.4
@jagill
jagill / test output
Created December 6, 2013 16:02
Test failures for oortcloud/node-ddp-client#master I'm on OS X 10.8.5, with node version 0.8.21
jag@coati:/tmp/node-ddp-client (master)$ npm install && npm test
> ddp@0.3.7 test /private/tmp/node-ddp-client
> ./node_modules/mocha/bin/mocha test
․․․․․․․․․
✖ 4 of 9 tests failed:
@jagill
jagill / terminal output
Created November 14, 2013 08:53
undefined to_sym bug in homebrew
jag@coati:~$ brew update
Error: undefined method `to_sym' for nil:NilClass
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Homebrew/cmd/update.rb:134:in `report'
/usr/local/Library/Homebrew/cmd/update.rb:132:in `each_line'
/usr/local/Library/Homebrew/cmd/update.rb:132:in `report'
/usr/local/Library/Homebrew/cmd/update.rb:36:in `update'
/usr/local/Library/brew.rb:91:in `send'
/usr/local/Library/brew.rb:91
@jagill
jagill / laikaTest.js
Created October 28, 2013 15:53
laika fails on pending tests
assert = require('assert');
describe('Test test', function(){
it('should ignore pending tests');
//it('should ignore pending tests', function(){
//assert.ok(true);
//});
@jagill
jagill / joinTest.coffee
Created July 31, 2013 23:15
An example of a "join" with meteor. It's client-powered, which is fine as long as you don't mind people intentionally choosing to get a different set of items.
###
Add coffeescript, random packages:
$ meteor add coffeescript random
Remove autopublish package:
$ meteor remove autopublish
###
##Set up collections and subscriptions
Items = new Meteor.Collection 'items'