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
// For Phillips Ambilight TV | |
#include <IRremote.h> | |
IRsend irsend; | |
// Raw data recorded from a few buttons: | |
unsigned int mute[40] = {2700,850,500,750,500,400,500,350,1350,1200,500,400,500,350,500,350,500,400,500,350,500,350,500,400,500,350,500,350,500,400,450,400,950,350,500,800,950,2850,50,}; | |
unsigned int power[42] = {2700,850,500,750,500,400,500,350,1350,1200,500,400,500,350,500,350,500,400,500,350,500,350,500,400,500,350,500,350,500,400,450,400,950,350,500,800,500,350,500,2800,200,}; | |
unsigned int netflix[38] = {2700,850,500,750,550,300,500,350,1400,1200,550,300,550,350,500,350,500,350,550,350,500,350,500,350,500,400,900,400,500,350,500,800,950,350,550,750,500,}; | |
unsigned int smarttv[40] = {2700,800,500,800,500,350,500,350,1400,1200,500,350,500,350,500,400,500,350,500,350,500,400,500,350,950,800,950,350,500,350,500,400,500,350,500,800,500,2250,1200,}; |
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 <iostream> | |
#include <chrono> | |
#include <ratio> | |
class progbar { | |
private: | |
int call_count = 0; | |
// formatting: |
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
#ifndef _LOG_H_ | |
#define _LOG_H_ | |
// logging utils | |
// | |
#include <iostream> | |
#include <ctime> | |
#define LOG(level) ::log_internal::_log_helper<::log_internal::loglevel:: level >(__FILE__, __LINE__, __FUNCTION__) |
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
#ifndef _READNP_H_ | |
#define _READNP_H_ | |
// Simple header-only library for loading serialized numpy arrays. | |
// Only for testing. | |
#include <algorithm> | |
#include <cassert> | |
#include <fstream> | |
#include <regex> | |
#include <string> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function arxiv-authors() { | |
if [ $# -ne 1 ]; then | |
echo "Usage: arxiv-authors arxiv_url_or_id" | |
echo "Prints authors' names, one per line." | |
else | |
if [[ $1 == http* ]]; then | |
url=$1 | |
else | |
url=http://arxiv.org/abs/$1 | |
fi |
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
--[[ An implementation of L-BFGS, heavily inspired by minFunc (Mark Schmidt) | |
This implementation of L-BFGS relies on a user-provided line | |
search function (state.lineSearch). If this function is not | |
provided, then a simple learningRate is used to produce fixed | |
size steps. Fixed size steps are much less costly than line | |
searches, and can be useful for stochastic problems. | |
The learning rate is used even when a line search is provided. | |
This is also useful for large-scale stochastic problems, where |
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/bash | |
############################## | |
# install Torch | |
# export PREFIX=/home/scratch/$USER/torch | |
export PREFIX="/home/scratch/torchshared/torch" | |
mkdir -p $PREFIX | |
rm -rf /tmp/luajit-rocks |
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
""" | |
Google Directions API | |
""" | |
import urllib2 | |
import urllib | |
import json | |
class Modes: | |
DRIVING="driving" |
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
# -*- coding: utf-8 -*- | |
__author__ = 'brendan' | |
import collections | |
class property_dict(collections.Mapping): | |
""" | |
Dictionary wrapper that adapts a dict with a wrapper allowing property-style reads. Intended | |
for ease of JSON accessing. |
NewerOlder