Skip to content

Instantly share code, notes, and snippets.

[{"attribution":null,"tags":[],"type":"image","location":{"latitude":37.442283174,"name":"Whole Foods Market","longitude":-122.159368017,"id":1178},"comments":{"count":1,"data":[{"created_time":"1350103607","text":"Love this picture? Check out my gallery at http://instacanv.as/smartwatermelon","from":{"username":"smartwatermelon","profile_picture":"http://images.instagram.com/profiles/profile_30712150_75sq_1334523529.jpg","id":"30712150","full_name":"Andrew Rich"},"id":"301013334694666156"}]},"filter":"Rise","created_time":"1350103507","link":"http://instagr.am/p/QtaUYBoZ8T/","likes":{"count":0,"data":[]},"images":{"low_resolution":{"url":"http://distilleryimage3.s3.amazonaws.com/c38165ee14f011e284a91231382040e4_6.jpg","width":306,"height":306},"thumbnail":{"url":"http://distilleryimage3.s3.amazonaws.com/c38165ee14f011e284a91231382040e4_5.jpg","width":150,"height":150},"standard_resolution":{"url":"http://distilleryimage3.s3.amazonaws.com/c38165ee14f011e284a91231382040e4_7.jpg","width":612,"height":612}},"cap
[ 80.835] (EE)
[ 80.835] (EE) Backtrace:
[ 80.866] (EE) 0: /usr/bin/X (xorg_backtrace+0x36) [0x58a426]
[ 80.866] (EE) 1: /usr/bin/X (0x400000+0x18e279) [0x58e279]
[ 80.866] (EE) 2: /usr/lib/libpthread.so.0 (0x7f5077329000+0xf1e0) [0x7f50773381e0]
[ 80.866] (EE) 3: /usr/lib/xorg/modules/drivers/nvidia_drv.so (0x7f5074717000+0xfcae1) [0x7f5074813ae1]
[ 80.866] (EE) 4: /usr/lib/xorg/modules/drivers/nvidia_drv.so (0x7f5074717000+0x543ce8) [0x7f5074c5ace8]
[ 80.866] (EE) 5: /usr/bin/X (0x400000+0x17a6c3) [0x57a6c3]
[ 80.866] (EE) 6: /usr/lib/xorg/modules/drivers/nvidia_drv.so (0x7f5074717000+0x50391a) [0x7f5074c1a91a]
[ 80.866] (EE) 7: /usr/bin/X (0x400000+0xc4ae0) [0x4c4ae0]
[10:15:10 matthew]% irb ~/balanced/balanc
irb(main):001:0> require 'balanced'
=> true
irb(main):002:0> Balanced.configure('83b9b666cd9411e2b213026ba7cac9da')
=> #<Balanced::Client:0x000000026f0a70 @api_key="83b9b666cd9411e2b213026ba7cac9da", @config={:scheme=>"https", :host=>"api.balancedpayments.com", :port=>443, :version=>"1", :logging_level=>"WARN", :connection_timeout=>30, :read_timeout=>30, :logger=>nil, :ssl_verify=>true, :faraday_adapter=>:net_http}, @conn=#<Faraday::Connection:0x000000026e7ad8 @headers={"User-Agent"=>"balanced-ruby/0.7.1"}, @params={}, @options={:open_timeout=>30, :timeout=>30}, @ssl={:verify=>true}, @parallel_manager=nil, @default_parallel_manager=nil, @builder=#<Faraday::Builder:0x000000026e79c0 @handlers=[FaradayMiddleware::EncodeJson, Faraday::Response::Logger, Faraday::Response::RaiseBalancedError, FaradayMiddleware::ParseJson, Faraday::Adapter::NetHttp]>, @url_prefix=#<URI::HTTPS:0x000000026e7cb8 URL:
var Balanced = (function () {
var capabilities = {
system_timezone:-(new Date()).getTimezoneOffset() / 60,
user_agent:navigator.userAgent,
language:navigator.language
};
function validateData (requiredKeys, data, errors) {
for (var i = 0; i < requiredKeys.length; i++) {
var key = requiredKeys[i];
// compile with: g++ -lboost_thread -lboost_system -ggdb -O0 -std=c++1y gdb_bug.cc
#include <boost/thread.hpp>
#include <iostream>
using namespace std;
using namespace boost;
@matthewfl
matthewfl / order-align.patch
Created January 8, 2015 07:23
patch for the linux kernel to change the way alignments for large memory request from pci devices are handled
diff -Naur linux-3.10.0-123.13.2.el7.mfl.x86_64/drivers/pci/setup-bus.c linux-3.10.0-123.13.2.el7.mfl.x86_64-patched/drivers/pci/setup-bus.c
--- linux-3.10.0-123.13.2.el7.mfl.x86_64/drivers/pci/setup-bus.c 2014-12-12 16:14:08.000000000 -0800
+++ linux-3.10.0-123.13.2.el7.mfl.x86_64-patched/drivers/pci/setup-bus.c 2015-01-05 01:05:16.111882902 -0800
@@ -962,8 +962,7 @@
dev_warn(&dev->dev, "disabling BAR %d: %pR "
"(bad alignment %#llx)\n", i, r,
(unsigned long long) align);
- r->flags = 0;
- continue;
+ order = 11;
import random
import sys
def run(n=100):
a = 0
c = 0
while a < n:
c += 1
if a % 2 == 0:
d = 1
@matthewfl
matthewfl / latexc.py
Last active May 25, 2021 21:17
Get a notification when latexmk fails
#!/usr/bin/env python3
import subprocess
import sys
def main():
proc = subprocess.Popen(['latexmk', '-pvc'] + sys.argv[1:],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
@matthewfl
matthewfl / pytorch hogwild.py
Last active December 9, 2020 16:18
pytorch hogwild
import torch
import torch.multiprocessing as mp
import queue
import resource
import os
class SimpleSGD(torch.optim.Optimizer):
def __init__(self, params, lr=.01):
@matthewfl
matthewfl / README.md
Last active February 22, 2018 03:30
Midi to g-code

Convert Midi files to g-code and build customized plates

My idea is to convert a midi file, which can be written in any time and even contain a mix of times or use notes at the half way points (1/8th time), and convert it into g-code that can be run the router (CNC) and build custom plates.

Advantages

  1. Music can be in any time that it wants as long as it divides the wheel and avoids the breaks between plates
  2. Easily convert songs written on the computer into the marble machine (just fill in all the wholes that were drilled on the programming wheel)

Disadvantages

  1. Each song will require its own custom plate