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
package common; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.Reader; | |
/** | |
* A UTF-8 decoder, that fallbacks to Latin-1. | |
* |
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 pygame, math, sys | |
from pygame.locals import * | |
#from pygame.math import Vector2 | |
class Vector2(object): | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
pygame.init() |
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 <SDL/SDL.h> | |
#include <stdio.h> | |
#include <math.h> | |
#define NUM_NOTES 37 | |
float notes[NUM_NOTES] = {0}; | |
float freqs[NUM_NOTES] = {0}; | |
int volume = 32; |
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 threading | |
from javax.swing import JFrame, JButton | |
from java.awt.event import ActionListener, WindowAdapter | |
class Frame(JFrame, ActionListener): | |
def __init__(self): | |
print "constructing! thread is %s" % threading.currentThread() | |
button = JButton("Hello") | |
button.setActionCommand('button') |
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/python | |
# convert_files.py -- simple script to convert multiple files in parallel | |
# July 8th, 2012 | |
# | |
# This software is provided 'as-is', without any express or implied | |
# warranty. In no event will the authors be held liable for any damages | |
# arising from the use of this software. | |
# | |
# Permission is granted to anyone to use this software for any purpose, |
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 | |
from PyQt4 import QtCore, QtGui | |
class MyDraggableWidget(QtGui.QLabel): | |
def __init__(self): | |
QtGui.QLabel.__init__(self) | |
self.setText("DRAG ME") |
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
Cygwin wrapper for Windows | |
These files are used to expose the "sh" binary to your regular Windows console. | |
Installation: | |
* Put sh.bat somewhere in your PATH (example: C:\Windows) | |
* Put sh_wrapper.sh where sh.bat will find it | |
(default: C:\cygwin\bin\sh_wrapper.sh) | |
If you don't use these paths, you will have to adapt the filenames in those |
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
gcc set_mouse.c -o set_mouse.exe | |
gcc set_mouse.c -o set_trackpad.exe -DSENSITIVITY=20 |
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 <stdio.h> | |
#define STRINGIFY(x) #x | |
#define TOSTRING(x) STRINGIFY(x) | |
int main(void) | |
{ | |
puts("ex" TOSTRING(__LINE__)); | |
return 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
def file_is_binary(filename): | |
with open(filename) as fp: | |
return chr(0) in iter(fp.read(8000)) |
OlderNewer