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
require 'net/imap' | |
require 'base64' | |
require 'rexml/document' | |
require 'yaml' | |
require 'open3' | |
require 'pp' | |
class GPG | |
def initialize(gpg_exec, gpg_home, gpg_pass) |
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
'''calculate lists of indexes for n objects taken k at a time without respect for order''' | |
def indexlist1(n,k): | |
''' | |
soultion by counting up in binary with k pegs | |
''' | |
l = range(k) | |
yield list(l) | |
#until the first peg is in its maximum position | |
while l[0] < (n - k): |
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
#!/usr/bin/env python | |
import time, getpass | |
class FakeStream(object): | |
def write(self, *args, **kwargs): | |
pass | |
def flush(self, *args, **kwargs): | |
pass | |
print '''TapTempo |
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
''' | |
DATA: 0#112233456677Z,CR (16 chars) | |
'0' is address byte | |
'#' is command code for Routine Time Update | |
where '11' is hex MS,LS of Seconds of Minute (1-59) | |
where '22' is hex MS,LS of Minutes of Hr (0-59) | |
where '33' is hex MS,LS of Hour of Day (0-23) | |
where '4' is hex Day of Week (Sun - 0 etc.) | |
where '5' is hex Month of Year (1-12) | |
where '66' is hex MS,LS of Day of Month (1-31) |
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
- install mingw with mingw-get-inst (c,c++,developer toolkit) | |
in msys | |
- mingw-get install msys-wget-bin | |
- ln -s /mingw/bin/libtool /bin/libtool | |
- install tortoise-git | |
- git clone git://mspgcc4.git.sourceforge.net/gitroot/mspgcc4/mspgcc4 | |
in msys | |
- ./buildgcc.pl |
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
<html> | |
<head> | |
<style type="text/css"> | |
div#container { | |
top: 100px; | |
margin: auto; | |
position:relative; | |
width: 800px; | |
height: 650px; | |
text-align: center; |
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
#include "UsbKeyboard.h" | |
#define BUTTON_PIN_RIGHT 9 | |
#define BUTTON_PIN_LEFT 10 | |
#define BUTTON_PIN_UP 11 | |
#define BUTTON_PIN_DOWN 12 | |
#define KEY_ARROW_RIGHT 0x4F | |
#define KEY_ARROW_LEFT 0x50 | |
#define KEY_ARROW_UP 0x51 |
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
class word(object): | |
def __init__(self,w): | |
self.w = w | |
self.key = "%02d%s" % (len(w),w) | |
self.set = self._makeset(w) | |
def __str__(self): | |
return self.w | |
def __cmp__(self,other): | |
return cmp(other.key,self.key) | |
def __repr__(self): |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var drawOn = function (id) { | |
var lastPoint = null; | |
var canvas = document.getElementById(id); | |
var ctx = canvas.getContext('2d'); | |
ctx.lineWidth = 4; | |
var offset = jQuery('#'+id).offset(); |
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
from VideoCapture import Device | |
import pygame | |
import datetime | |
import glob | |
cam = Device() | |
pic_dir = './' | |
pic_ext = '.jpg' | |
pics = glob.glob(pic_dir+'*'+pic_ext) |
OlderNewer