This file contains hidden or 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
#!/usr/bin/python3 | |
import sqlite3 | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
from dateutil.parser import parse | |
conn = sqlite3.connect('iup.db') | |
c = conn.cursor() |
This file contains hidden or 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
cscorley@geogaddi: ~ | |
% python2 | |
Python 2.7.8 (default, Jul 1 2014, 17:30:21) | |
[GCC 4.9.0 20140604 (prerelease)] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> s = u"test💩word" | |
>>> s | |
u'test\U0001f4a9word' | |
>>> type(s) | |
<type 'unicode'> |
This file contains hidden or 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
git://git.eclipse.org/gitroot/platform/eclipse.platform.common.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.debug.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.news.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.basebuilder.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.buildtools.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.eclipsebuilder.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.git | |
git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.maps.git |
This file contains hidden or 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
/* | |
[The "BSD licence"] | |
Copyright (c) 2013 Terence Parr, Sam Harwell | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions | |
are met: | |
1. Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. |
This file contains hidden or 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
[general] | |
ui = ttyui | |
accounts = gmail,crimson | |
fsync = False | |
[Account gmail] | |
localrepository = gmail-local | |
remoterepository = gmail-remote | |
status_backend = sqlite |
This file contains hidden or 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
umount /dev/sda* | |
# Create a new disk label for GPT. Type y when prompted after running: | |
parted /dev/sda mklabel gpt | |
#Partition the USB drive or SD card: | |
cgpt create -z /dev/sda | |
cgpt create /dev/sda | |
cgpt add -i 1 -t kernel -b 8192 -s 32768 -l U-Boot -S 1 -T 5 -P 10 /dev/sda | |
cgpt add -i 2 -t data -b 40960 -s 32768 -l Kernel /dev/sda | |
cgpt add -i 12 -t data -b 73728 -s 32768 -l Script /dev/sda | |
cgpt add -i 3 -t data -b 106496 -s `expr 15633375 - 106496` -l Root /dev/sda |
This file contains hidden or 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
letters = "acdegilmnoprstuw" | |
def hash(s): | |
h = 7 | |
for char in s: | |
h = h * 37 + letters.index(char) | |
return h | |
target = 910897038977002.0 | |
current = target |
This file contains hidden or 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
try: | |
from urllib.parse import quote # Py 3 | |
except ImportError: | |
from urllib2 import quote # Py 2 | |
import os | |
import sys | |
BLOG_DIR = os.environ['BLOG_DIR'] | |
# BLOG_DIR = '/Users/cscorley/git/cscorley.github.io/' |
This file contains hidden or 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
from ctypes import * | |
class Cell(Structure): | |
pass | |
Cell._fields_ = [ | |
("val", c_int), | |
("next", POINTER(Cell))] | |
class LinkedList: |
This file contains hidden or 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
from timeit import timeit | |
from ctypes import * | |
size = 10 | |
l = list() | |
arr = (c_int * size)() | |
def test(x): | |
for n in range(x): | |
l.append(n) |