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
CREATE TEMPORARY TABLE newer_states ( | |
state_id INTEGER NOT NULL, | |
entity_id VARCHAR(255), | |
state INTEGER, | |
last_updated INTEGER, | |
PRIMARY KEY (state_id) | |
); | |
CREATE INDEX ix_entity_id ON newer_states (entity_id); | |
INSERT INTO newer_states | |
SELECT state_id, entity_id, CAST(state AS INTEGER), CAST(STRFTIME('%s', last_updated) AS INTEGER) |
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 numpy as np | |
import PIL.Image | |
import PIL.ImageChops | |
import sys | |
with open(sys.argv[1], 'rb') as f: | |
data = f.read() | |
size = len(data) | |
blocksize = 104 |
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 csv | |
input_file = 'rme4bcg.csv' | |
output_file = 'rme4bcg-decoded.csv' | |
with open(input_file) as c: | |
with open(output_file, 'w') as c2: | |
c.readline() | |
log = csv.reader(c) | |
out = csv.writer(c2) | |
out.writerow(['timestamp', 'player', 'current_word']) | |
active = False |
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 <string.h> | |
#include <stdio.h> | |
#include <switch.h> | |
int main(int argc, char **argv) { | |
struct HidController controller[9]; | |
gfxInitDefault(); | |
socketInitializeDefault(); |
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 python | |
import struct | |
import sys | |
class Instruction: | |
def __init__(self, name, *args): | |
self.name = name | |
self.operands = args |
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 mgba.core | |
import mgba.image | |
import mgba.log | |
import os, os.path | |
import sys | |
from concurrent.futures import ThreadPoolExecutor | |
logger = mgba.log.NullLogger() |
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
from mgba import core,image | |
c=core.loadPath('ruby.gba') | |
i=image.Image(*c.desiredVideoDimensions()) | |
c.setVideoBuffer(i) | |
c.reset() | |
for x in range(800): c.runFrame() | |
with open("out.png", "w") as f: i.savePNG(f) |
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 <stdio.h> | |
#include <limits.h> | |
// gcc detects the weirdness, clang does not! | |
// Try different optimization levels, architectures and OSes for more fun. | |
int main() { | |
// Unclobberred arguement | |
printf("%x\n", INT_MIN / -1); | |
// Unclobbered variable |
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/sh | |
# Stream video from your Freescale i.MX6 device (e.g. CuBox-i, Hummingboard, Wandboard, UDOO) | |
# Pass it a URL that `youtube-dl` can handle, or pass it as a player to `livestreamer`. | |
# Currently only works with MP4 streaming h.264 video and AAC audio. | |
# | |
# Requires: | |
# - gstreamer >= 1.2 | |
# - gst-plugins-good | |
# - gst-plugins-bad | |
# - gstreamer-imx (https://github.com/Freescale/gstreamer-imx) |
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 Data.Complex | |
import Data.Bits | |
import Data.Binary.Put | |
import qualified Data.ByteString.Lazy as BL | |
import Data.Word | |
import System.IO | |
import Control.Exception | |
import Char | |
import Ix |