View pi_mp.py
''' listing 6: pi_mp.py
Multiprocessing based code to estimate the value of PI
using monte carlo sampling
Ref: http://math.fullerton.edu/mathews/n2003/montecarlopimod.html
Uses workers:
http://docs.python.org/library/multiprocessing.html#module-multiprocessing.pool
'''
import random
View remcomms.sh
# Strip C comments
# by Stewart Ravenhall <stewart.ravenhall@ukonline.co.uk> -- 4 October 2000
# Un-Korn-ized by Paolo Bonzini <bonzini@gnu.org> -- 24 November 2000
# Strip everything between /* and */ inclusive
# Copes with multi-line comments,
# disassociated end comment symbols,
# disassociated start comment symbols,
# multiple comments per line
View Makefile
SRCDIR = src
HDRDIR = headers
OBJDIR = obj
BINDIR = bin
DEPDIR = dep
DATDIR = data
CC = gcc
TARGET = sorting
CFLAGS = -Wall -Wextra -pedantic -g -O0 -I$(HDRDIR)
View fsec_solve.py
from z3 import *
import struct
# calculate e,f,d for a given input password
def calc(m):
e = 0
f = 0
d = 0
for i in xrange(0, len(m)):
c = ord(m[i])
View VideoStream.php
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
View art-compile-arm.sh
# How to use ART to compile arm oat files on the host:
# - Get source code according to https://source.android.com/source/downloading.html
# - source build/envsetup.sh
# - mm build-art
# - Build the full android image for aosp_arm-eng
# (Follow the directions at https://source.android.com/source/building.html)
# - Use this script in the source root directory to compile APKs
CWD=`pwd`
export ANDROID_DATA="${CWD}/out/host/datadir/dalvik-cache/x86_64"
View gist:55662428bea4fb1928c294e61015d850
# How to use ART to compile arm oat files on the host:
# - Get source code according to https://source.android.com/source/downloading.html
# - source build/envsetup.sh
# - mm build-art
# - Use this script in the source root directory to compile APKs
CWD=`pwd`
export ANDROID_DATA="${CWD}/out/host/datadir/dalvik-cache/x86_64"
export ANDROID_ROOT="${CWD}/out/host/linux-x86"
BOOT_IMAGE="${CWD}/out/host/linux-x86/framework/core.art"
View util.py
"""
Handy Python functions written by Andrey Petrov (shazow). I release this code
under public domain. (Attribution is optional but appreciated.)
Approximate changelog (according to https://gist.github.com/603374):
2011-05-05
- I made a proper github repo out of this:
https://github.com/shazow/unstdlib.py
View pyscript.py
#!/usr/bin/env python
"""A simple python script template.
"""
from __future__ import print_function
import os
import sys
import argparse
View gist:b285c1c2f159be1c8e3136b787c36ac3