Skip to content

Instantly share code, notes, and snippets.

@kotarou3
kotarou3 / gist:c0c09061a5d805e22c16
Created July 19, 2014 16:50
Darkest names you can get on showdown (less than 7 characters)
qe8r
qi6w
q6t9
12f5
2ulz
29qx
4mkc
acmg8
am51f
anb8u
@kotarou3
kotarou3 / clean.js
Created October 11, 2014 15:46
Cleans small snippets of speech, and attempts to equate loudness
#!/usr/bin/nodejs --harmony
"use strict";
require("prfun");
function readAudio(filename) {
return new Promise(function (resolve, reject) {
let reader = new (require("wav").Reader)();
let rawBuffer = new Buffer(0);
let format;
@kotarou3
kotarou3 / blacklist
Created October 11, 2014 18:10
Gets word pronounciations from languagepod and forvo for my Anki decks (e.g., https://ankiweb.net/shared/info/3370070635)
さっき-forvo-ankek
いとこ-forvo-atengid
ところで-forvo-cenpoy
くしゃみ-forvo-cocomlle
こんにちは-forvo-dn725
レモン-forvo-GLOCS
しっかり-forvo-gotonobu
こんにちは-forvo-Hijiki
レモネード-forvo-hirata
ひどい-forvo-Hirorina
@kotarou3
kotarou3 / randomiseCards.py
Created October 17, 2014 13:03
Randomises the due dates of the cards in a deck, but only bringing them closer to being due. Run in Anki's REPL console (ctrl+:)
# Randomises the due dates of the cards in a deck, but only bringing them closer to being due
# Run in Anki's REPL console (ctrl+:)
from random import random
from math import floor
deckName = u"わかった!"
for cid in self.col.decks.cids(self.col.decks.byName(deckName)["id"], True):
card = self.col.getCard(cid)
#!/usr/bin/env nodejs
var x = [];
var y = [];
var buffer = "";
require("child_process").spawn("evemu-record", {stdio: [process.stdin, "pipe", process.stderr]}).stdout.on("data", function (data) {
buffer += data.toString();
if (buffer.indexOf("\n") >= 0) {
var lines = buffer.split("\n");
#include <chrono>
#include <map>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <unistd.h>
#include <sys/wait.h>

ARM compared with AVR

Disclaimer

This document will be based on the ARMv8-A architecture, mainly focusing on AArch64, and comparing it to ATmega2560's megaAVR architecture.
Thus "ARM" will be used to mean "ARMv8-A AArch64" and "AVR" as "megaAVR".

Microarchitectural details for ARM are taken from the Cortex-A57.

Overview

Focusing on the differences between ARM and AVR, ARM has:

/**
* Room Avatar Commands
**/
function fakeUnrecognized() {
var fullCmd = this.namespaces.concat(this.cmd).join(' ');
if (this.cmdToken === '!') {
return this.errorReply("The command '" + this.cmdToken + fullCmd + "' was unrecognized.");
}
return this.errorReply("The command '" + this.cmdToken + fullCmd + "' was unrecognized. To send a message starting with '" + this.cmdToken + fullCmd + "', type '" + this.cmdToken.repeat(2) + fullCmd + "'.");
}
@kotarou3
kotarou3 / perf.c
Created September 1, 2015 10:38
Scripted performance counting for side channel attacks
#define _GNU_SOURCE
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <linux/perf_event.h>
#include <sched.h>
#include <sys/syscall.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <string.h>
int main() {
int listenfd = socket(AF_INET, SOCK_STREAM, 0);
setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &(int){ 1 }, sizeof(int));
struct sockaddr_in servaddr;