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/env python2 | |
| # Small test client for rtl_tcp | |
| # Simeon Miteff <[email protected]> | |
| # Thu Sep 27 09:28:55 SAST 2012 | |
| import socket | |
| import struct | |
| import time | |
| SET_FREQUENCY = 0x01 | |
| SET_SAMPLERATE = 0x02 |
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
| #include <Python.h> | |
| #include <numpy/arrayobject.h> | |
| #include "chi2.h" | |
| /* Docstrings */ | |
| static char module_docstring[] = | |
| "This module provides an interface for calculating chi-squared using C."; | |
| static char chi2_docstring[] = | |
| "Calculate the chi-squared of some data given a model."; |
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
| /* | |
| Functional programming in C | |
| ``````````````````````````` | |
| This is an example of how to use executable memory to get partial function | |
| application (i.e. bind1st()) in C. (Well, this actually only compiles as C++ | |
| since i'm using a varargs typedef, but there's no classes or templates.) | |
| To proceed, we need to be comfortable with the cdecl and stdcall calling | |
| conventions on x86, and just a little assembly. |
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
| (trace-source (let ((i (+ 4 5))) | |
| (+ i (* 2 (/ 3 4))))) | |
| ;; Output | |
| (let ((i (+ 4 5))) | |
| (+ i (* 2 (/ 3 4)))) | |
| -- (+ 4 5) | |
| >> RESULT: 9 |
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
| ;; outlet code for implementing traditional macro expansion | |
| ;; macros | |
| (define (expand form) | |
| (cond | |
| ((variable? form) form) | |
| ((literal? form) form) | |
| ((macro? (car form)) | |
| (expand ((macro-function (car form)) form))) |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Tom Robinson <http://tlrobinson.net/> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
| // Run Redis - cd redis-2.2.4 and run src/redis-server | |
| var sip = require('sip'); | |
| var sys = require('sys'); | |
| var redis = require('redis'); | |
| var tropoapi = require('tropo-webapi'); | |
| //Trim leading and trailing whitespace from string values. | |
| function trim(str) { | |
| return str.replace(/^\s+|\s+$/g, ''); |
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
| #!/bin/bash | |
| # https://gist.github.com/949831 | |
| # http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/ | |
| # command line OTA distribution references and examples | |
| # http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson | |
| # http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution | |
| # http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/ | |
| # http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html |
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
| import unittest | |
| class StepCollection(object): | |
| def __setattr__(self, attr, val): | |
| if hasattr(self, attr): | |
| raise RuntimeError("step %s is already declared!" % (attr,)) | |
| return super(StepCollection, self).__setattr__(attr, val) | |
| class Object(object): pass | |
| class World(unittest.TestCase): | |
| def __init__(self): |