This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Primel Solver | |
# Sieve of Eratosthenes | |
N = 100000 | |
primes = [True] * N | |
for i in range(2, N): | |
if not primes[i]: | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Nicholas Pilkington, 2015 | |
# Blog Post: https://nickp.svbtle.com/sudoku-satsolver | |
import pycosat | |
N = 9 | |
M = 3 | |
def exactly_one(variables): | |
cnf = [ variables ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) thread apply all bt | |
Thread 14 (Thread 0x7f89f7067700 (LWP 23443)): | |
£0 0x00007f89ff922d5c in LZWDecode () | |
from /home/ubuntu/tilemill/node_modules/mapnik/lib/binding/libmapnik.so | |
£1 0x00007f89ff90bffd in TIFFReadEncodedStrip () | |
from /home/ubuntu/tilemill/node_modules/mapnik/lib/binding/libmapnik.so | |
£2 0x00007f89f9534165 in GTiffDataset::LoadBlockBuf(int, int) () | |
from /home/ubuntu/tilemill/node_modules/mapnik/lib/binding/mapnik/input/gdal.input | |
£3 0x00007f89f9536586 in GTiffRasterBand::IReadBlock(int, int, void*) () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu@ip-10-182-57-31:~/tilemill$ which node | |
/usr/bin/node | |
ubuntu@ip-10-182-57-31:~/tilemill$ gdb /usr/bin/node core | |
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7 | |
Copyright (C) 2014 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. Type "show copying" | |
and "show warranty" for details. | |
This GDB was configured as "x86_64-linux-gnu". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Receive status from drone. | |
{ | |
source: 'drone', | |
destination: 'gcs', | |
name: 'status' | |
data: { | |
'mode' : 'manual' | |
'latitude' : '2324.2434', | |
'longitude' : '2324.2434', | |
'altitude' : '2324.2434', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo rm /etc/apt/sources.list.d/*mapnik* | |
sudo rm /etc/apt/sources.list.d/*developmentseed* | |
sudo rm /etc/apt/sources.list.d/*chris-lea* | |
sudo rm /etc/apt/sources.list.d/*ubuntugis* | |
# Add bleeding edge PPAs | |
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js | |
echo 'yes' | sudo apt-add-repository ppa:mapnik/v2.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import pickle | |
import numpy as np | |
import scipy.sparse | |
from sklearn import svm, cross_validation, datasets | |
from sklearn.grid_search import GridSearchCV | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.svm import SVC, LinearSVC | |
from sklearn.utils import shuffle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Module dependencies | |
### | |
require.paths.unshift "#{__dirname}/lib/support/express-csrf/" | |
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/" | |
express = require 'express' | |
app = module.exports = express.createServer() | |
RedisStore = require 'connect-redis' |