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
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
library("rjson") | |
# use rjson | |
map_data <- fromJSON(paste(readLines("http://maps.google.com/maps/api/elevation/json?path=43.0,141.4|26.2,127.7&samples=500&sensor=false"), collapse="")) | |
# get a data from Google Elevation API | |
# convert JSON data into R object using fromJSON() | |
# toJSON(): convert R object into JSON data | |
elevation_data <- lapply(map_data$result, function(x){x$elevation}) |
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
#!/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 |
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
tell application "Google Chrome" | |
view source of active tab of window 1 | |
repeat while loading of active tab of window 1 | |
delay 0.1 | |
end repeat | |
select all of active tab of window 1 | |
copy selection of active tab of window 1 | |
delete tab (active tab index of window 1) of window 1 | |
end tell |