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
'use strict'; | |
var util = require('util'), | |
winston = require('winston'), | |
logger = new winston.Logger(), | |
production = (process.env.NODE_ENV || '').toLowerCase() === 'production'; | |
module.exports = { | |
middleware: function(req, res, next){ | |
console.info(req.method, req.url, res.statusCode); |
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
function addTooltip(svg, popHeight, popWidth, popx, popy, data) { | |
// Define the line | |
var valueline = d3.svg.line() | |
.x(function(d) { return popx(d.date); }) | |
.y(function(d) { return 0; }); | |
var lineSvg = svg.append("g"); | |
var focus = svg.append("g") | |
.style("display", "none"); | |
lineSvg.append("path") | |
.attr("class", "line") |
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
// Takes 3 parameters: | |
// class: the object type to update; a single String. | |
// restrictions: the set of column restrictions; a Dictionary. | |
// updates: the set of column updates; a Dictionary. | |
Parse.Cloud.define("upsert", function(request, response) { | |
var query = new Parse.Query(request.params.class); | |
var restrictions = JSON.parse(request.params.restrictions); | |
for (var key in restrictions) { |
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 "alu_defines.v" | |
`include "mips_defines.v" | |
`include "mips_multicycle_defines.v" | |
`include "mips_memory_space_defines.v" | |
//`define VERBOSE | |
`default_nettype none | |
`timescale 1ns/1ps | |
/* | |
a version of the mips multicycle module with von Nuemann architecture | |
*/ |
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
var audioobj = document.getElementsByTagName("audio")[0]; | |
// var text = document.getElementById("text"); | |
var actualBPM; | |
var request = new XMLHttpRequest(); | |
console.log("Audio source: " + audioobj.src); | |
request.open('GET', audioobj.src, true); | |
request.responseType = 'arraybuffer'; | |
var targetspd = 1; | |
request.onload = function() { |
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
var express = require('express'); | |
var app = express(); var app = express(); | |
+var http = require('http').Server(app); | |
+var io = require('socket.io')(http); | |
app.use(express.static(__dirname + '/public')); app.use(express.static(__dirname + '/public')); | |
app.listen(process.env.PORT || 3000); app.listen(process.env.PORT || 3000); | |
+http.listen(3001, function(){ |
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
keep track of up to last 3 stops | |
each time we stop, take average of last 3 times of stops; invert and that’s the BPM | |
double x[NUMBER]; | |
double y[NUMBER]; | |
long times[NUMBER]; | |
long last[3] = {0}; | |
double last_dist = UDOUBLE_MAX; | |
int curr_last = 0; |
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
echo foo > output.txt | |
open("output.txt", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3 | |
echo foo < output.txt | |
open("output.txt", O_RDONLY|O_LARGEFILE) = 3 | |
echo foo 2> output.txt | |
open("output.txt", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3 |
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
rtypes = [ | |
# List of all R-type instructions. | |
"sll", "srl", "sra", "sllv", "srlv", "srav", # shifts | |
"jr", "jalr", # jumps | |
"syscall", "break", # system | |
"mfhi", "mthi", "mflo", "mtlo", # move to | |
"mult", "multu", "div", "divu", # mult/div | |
"add", "addu", "sub", "subu", # add/sub | |
"and", "or", "xor", "nor", # bitwise | |
"slt", "sltu" # set less than |
NewerOlder