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 <FlexiTimer2.h> | |
#define LedPin1 10 | |
#define LedPin2 9 | |
void blink1() { | |
digitalWrite(LedPin1, !digitalRead(LedPin1)); | |
} | |
void blink2() { | |
digitalWrite(LedPin2, !digitalRead(LedPin2)); |
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
if __name__ == "__main__": | |
mode = raw_input("mode? ([a]stable or [m]onostable)> ") | |
if(mode == 'a'): | |
calcType = raw_input("result? ([f]req or [r]egister]> ") | |
if(calcType == 'f'): | |
r1, r2, c = map(float, raw_input("r1? r2? c?> ").split(" ")) | |
aFreqCalculate({"r1": r1, "r2": r2, "c": c}) | |
elif(calcType == 'r'): | |
(f, d, c) = map(float, raw_input("freq? duty? c?> ").split(" ")) | |
aResisterCalculate({"freq": f, "duty": d, "c": c}) |
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
def mTimeCalculate(info): | |
r1 = info["r1"] | |
c = info["c"] | |
print "R1: %d, C: %f¥n¥tTime: %f(sec)¥n" % (r1, c, r1 * c * math.log(3)) | |
# math.log(3) = 1.1 | |
def mResisterCalculate(info): | |
t = info["time"] | |
c = info["c"] |
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
def aFreqCalculate(info): | |
r1 = info["r1"] | |
r2 = info["r2"] | |
c = info["c"] | |
t1 = math.log(2) * (r1 + r2) * c # Time of HIGH | |
t2 = math.log(2) * r2 * c # Time of LOW | |
total = t1 + t2 | |
freq = 1 / total | |
duty = t1 / total | |
print "R1: %d, R2: %d, C: %f¥n¥tHIGH:%f + LOW:%f = TOTAL:%f(sec)" ¥ |
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 -*- | |
* | |
* Copyright : (c) SAEKI Yoshiyasu | |
* License : MIT-style license | |
* <http://www.opensource.org/licenses/mit-license.php> | |
**/ | |
import scala.actors.Actor | |
class Counter(name:String) extends Actor { |
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/jython | |
# -*- coding: utf-8 -*- | |
# Copyright : (c) SAEKI Yoshiyasu | |
# License : MIT-style license | |
# <http://www.opensource.org/licenses/mit-license.php> | |
# last updated: 2011/02/26 | |
from akka.actor import Actors, UntypedActor | |
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/jython | |
# -*- coding: utf-8 -*- | |
# Copyright : (c) SAEKI Yoshiyasu | |
# License : MIT-style license | |
# <http://www.opensource.org/licenses/mit-license.php> | |
# last updated: 2011/02/26 | |
from akka.actor import Actors, UntypedActor | |
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/jython | |
# -*- coding: utf-8 -*- | |
# Copyright : (c) SAEKI Yoshiyasu | |
# License : MIT-style license | |
# <http://www.opensource.org/licenses/mit-license.php> | |
# last updated: 2011/02/26 | |
from akka.stm import Atomic, Ref | |
import time |
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
import glob | |
import operator | |
import time | |
from mapreduce import * | |
if __name__ == "__main__": | |
start_time = time.time() | |
input_files = glob.glob("Edgar Allan Poe/*.txt") |
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 -*- | |
# Copyright : (c) SAEKI Yoshiyasu | |
# License : MIT-style license | |
# <http://www.opensource.org/licenses/mit-license.php> | |
# last updated: 2011/03/04 | |
from akka.actor import Actors, UntypedActor | |
# from akka.dispatch import Futures | |
import collections |