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/python | |
# -*- coding: utf-8 -*- | |
from HTMLParser import HTMLParser | |
from re import match | |
Grades = { | |
u'\uff21': 'A', | |
u'\uff22': 'B', | |
u'\uff23': 'C', | |
u'\uff30': 'P' |
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
#!/bin/sh | |
ABSPATH=$(cd "$1"; pwd) | |
COUNT=0 | |
if [ ! -e $ABSPATH ]; then | |
echo "*** $ABSPATH doesn't exist! ***" | |
exit | |
fi | |
for F in $ABSPATH/*; do |
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
[{"id":"20ea5e9c.df15a2","type":"mqtt-broker","broker":"lain.sfc.wide.ad.jp","port":"1883","clientid":""},{"id":"f82418fa.07dbe8","type":"mqtt in","name":"Subscriber","topic":"gif-iot/data/","broker":"20ea5e9c.df15a2","x":138.5,"y":80,"z":"55f994be.aa066c","wires":[["bd027790.42fd88"]]},{"id":"9419ee6a.6be61","type":"mqtt out","name":"Publisher","topic":"gif-iot/cmd/<OpenBlocks MAC address>/servo","qos":"0","retain":"false","broker":"20ea5e9c.df15a2","x":537.5,"y":80,"z":"55f994be.aa066c","wires":[]},{"id":"bd027790.42fd88","type":"function","name":"2*objectTemp >> angle","func":"return {\n\tpayload: {\n\t\tid: 0,\n\t\tangle: 2*JSON.parse(msg.payload).objectTemp\n\t}\n};","outputs":1,"x":341,"y":80,"z":"55f994be.aa066c","wires":[["9419ee6a.6be61","eb9a908d.14657"]]},{"id":"eb9a908d.14657","type":"debug","name":"","active":true,"console":"false","complete":"false","x":548,"y":120,"z":"55f994be.aa066c","wires":[]}] |
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
/* Parse a string received as MQTT message to a JSON object */ | |
var data = JSON.parse(msg.payload); | |
/* Extrace attributes stored in the JSON */ | |
var accelX = data.accelX; | |
var accelY = data.accelY; | |
/* Compute the Theta and Phi from Acceleration along x/y axis */ | |
var theta = - (Math.asin(accelY)); | |
var phi = Math.asin(accelX/Math.cos(theta)); |
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
Months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'] | |
Days = [31,29,31,30,31,30,31,31,30,31,30,31] | |
DateDict = dict(zip(Months,Days)) | |
WeekDayList = ["Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] | |
weekinitializer = [0,0,0,0,0,0,0] | |
monthinitializer = [0,0,0,0,0,0,0,0,0,0,0,0] | |
Thirteens = dict(zip(WeekDayList, weekinitializer)) | |
JasonCount = [] | |
JasonMonthCount = dict(zip(Months, monthinitializer)) |
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 | |
# Takes an interger n for 2^n x 2^n Hadamard matrix | |
import numpy as np | |
import sys | |
def recursiveKronecker(k, hmat): | |
if 2**(k-1) == 1: | |
return hmat | |
else: |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <netdb.h> |
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 | |
# -*- coding: utf-8 -*- | |
# SFC-SFS "Report for overnight stay" script | |
# Last modified: 4/12/2016 | |
# | |
# **Fisrt complete the values below** | |
# =begin=========================================================== | |
login = "" # Ex. "s58000yf" | |
passwd = "" # Ex. "yukichifukuzawa" (passwd is hardcoded here) |
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 | |
# -*- coding: utf-8 -*- | |
from HTMLParser import HTMLParser | |
from re import match, search | |
from sys import exit, stdout | |
import csv | |
class HWParser(HTMLParser): | |
def __init__(self): | |
HTMLParser.__init__(self) |
OlderNewer