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
# Problem A - The 3n + 1 problem | |
# https://vjudge.net/contest/145712#problem/A | |
# Author: Adam | |
import sys | |
import functools | |
@functools.lru_cache(maxsize=1000000) | |
def cycle_len(k): | |
if k == 1: |
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 fileinput | |
def solve(sequence): | |
pass | |
def main(): | |
sequence = [] | |
for line in fileinput.input(): | |
for word in line.split(): |
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 fileinput | |
def main(): | |
for line in fileinput.input(): | |
i, j = [int(x) for x in line.split()] | |
# beware the min and max! | |
low = min(i, j) | |
high = max(i, j) | |
print('%d %d %d' % (i, j, solve(low, high))) |
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
# airflow/plugins/slack.py | |
import logging | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.plugins_manager import AirflowPlugin | |
from slackclient import SlackClient | |
from titan.utils import config | |
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
# airflow.cfg | |
[core] | |
airflow_home = /opt/titan/airflow | |
dags_folder = /opt/titan/airflow/dags | |
s3_log_folder = None | |
executor = CeleryExecutor | |
sql_alchemy_conn = mysql://airflow:airflow@mysql/airflow | |
parallelism = 32 | |
dag_concurrency = 16 |
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
pi@gifbooth ~/GIFBooth $ gphoto2 --list-ports | |
Devices found: 2 | |
Path Description | |
-------------------------------------------------------------- | |
ptpip: PTP/IP Connection | |
usb:001,003 Universal Serial Bus | |
pi@gifbooth ~/GIFBooth $ gphoto2 --auto-detect | |
Model Port | |
---------------------------------------------------------- | |
pi@gifbooth ~/GIFBooth $ gphoto2 --capture-image-and-download |
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
boxysean-mbpr:solenoid-controller boxysean$ avrdude -p m128 -B 50 -P usb -c dragon_isp | |
avrdude: jtagmkII_getsync(): sign-on command: status -1 | |
avrdude: AVR device initialized and ready to accept instructions | |
Reading | ################################################## | 100% 0.16s | |
avrdude: Device signature = 0x1e9702 | |
avrdude: safemode: Fuses OK (E:FD, H:99, L:DE) |
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 "ofApp.h" | |
void ofApp::writejacks(int jacks) { | |
ofFile file(ofToDataPath("DocumentRoot/jumpingjacks.tmp"), ofFile::WriteOnly); | |
file << jacks/2; | |
file.close(); | |
ofFile::moveFromTo(ofToDataPath("DocumentRoot/jumpingjacks.tmp"),ofToDataPath("DocumentRoot/jumpingjacks"), true, true); | |
} | |
void ofApp::writecalibrated(int calibrated) { |
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
/** | |
* Arduino code to control Mic's Triac Bloc, which Mic documented here: | |
* http://wemakethings.net/2013/10/27/triac-bloc/ | |
* | |
* by boxysean, Dec 11 2013 -- Dash 7 Design | |
*/ | |
#include <Wire.h> | |
#define COMMAND_CALIBRATE 'c' |
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 "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofSetVerticalSync(true); | |
bSendSerialMessage = false; | |
ofBackground(255); | |
ofSetLogLevel(OF_LOG_ERROR); | |