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
2 tone | |
2-step garage | |
4-beat | |
4x4 garage | |
8-bit | |
acapella | |
acid | |
acid breaks | |
acid house | |
acid jazz |
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
@main(b0: bool, b1: bool) { | |
jmp .start; | |
.end: | |
print x_0_2; | |
print x_1_2; | |
ret; | |
.l_1_3: | |
jmp .end; | |
.l_1_2: | |
x_1_2 : int = const 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
import "primitives/core.futil"; | |
component stats(flow: 0, @go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) { | |
cells { | |
count_0_sto = std_reg(0); | |
eq_1 = std_eq(0); | |
} | |
wires { | |
group count_0_sto_incr_group { | |
count_0_sto.write_en = 1'd1; | |
} |
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
// This is a quick demonstration of "function inheritance" as described in | |
// this paper from Daniel Brown and William Cook. | |
// http://www.cs.utexas.edu/users/wcook/Drafts/2009/sblp09-memo-mixins.pdf | |
// Expressed in TypeScript (and without the monads). | |
// Syntax note: When you write function types in TypeScript, you need to name | |
// each parameter. But the names don't actually matter, so I just use _. You | |
// can read `(_:A) => B` as `a -> b` in ML or Haskell syntax. | |
// In Brown and Cook's Haskell, `type Gen a = a -> a` is a "generator." The |
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
"""Simple but robust implementation of generator/coroutine-based | |
pipelines in Python. The pipelines may be run either sequentially | |
(single-threaded) or in parallel (one thread per pipeline stage). | |
This implementation supports pipeline bubbles (indications that the | |
processing for a certain item should abort). To use them, yield the | |
BUBBLE constant from any stage coroutine except the last. | |
In the parallel case, the implementation transparently handles thread | |
shutdown when the processing is complete and when a stage raises an |
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 | |
"""Aliases for argparse positional arguments.""" | |
import argparse | |
class AliasedSubParsersAction(argparse._SubParsersAction): | |
class _AliasedPseudoAction(argparse.Action): | |
def __init__(self, name, aliases, help): |
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
"""This is a Python transcription of the famous Quake III "fast inverse | |
square root" function. Run the script to see a quick comparison with an | |
"exact" square root. | |
""" | |
import struct | |
import math | |
# From: |
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 "primitives/core.futil"; | |
component main() -> () { | |
cells { | |
q = std_reg(4); //multiplier (11) | |
//will use these shifters and adders | |
add_3bits = std_add(3); |
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
"""mk2mpris.py: forward GNOME media key events to an MPRIS2 player. | |
""" | |
import dbus | |
from dbus.mainloop.glib import DBusGMainLoop | |
import gobject | |
APP_NAME = 'mk2mpris' | |
DBUS_INTERFACE_MK = 'org.gnome.SettingsDaemon.MediaKeys' | |
OBJ_PATH_MK = '/org/gnome/SettingsDaemon/MediaKeys' | |
OBJ_NAME_GSETTINGS = 'org.gnome.SettingsDaemon' |
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
"""A simple addition to Python's optparse module supporting subcommands | |
like those found in the svn or hg CLIs. | |
To use it, instantiate the Subcommand class for every subcommand you | |
want to support. Each subcommand has a name, aliases, a help message, | |
and a separate OptionParser instance. Then pass a list of Subcommands | |
to the constructor of SubcommandsOptionParser to make a subcommand- | |
aware parser. Calling parse_args on that parser gives you the | |
subcommand invoked, the subcommand's arguments and options, and the | |
global options all in one fell swoop. See the smoke test at the bottom |
NewerOlder