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
| class RelationClassifier: | |
| def isBijection(self, domain, ran): | |
| dd = {} | |
| rr = {} | |
| for d, r in zip(domain, ran): | |
| dd[d] = 0 | |
| rr[r] = 0 | |
| for d, r in zip(domain, ran): |
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
| # -*- coding: utf-8 -*- | |
| import math,string,itertools,fractions,heapq,collections,re,array,bisect | |
| class InterestingDigits: | |
| def digits(self, base): | |
| ans = [] | |
| for n in range(2, base): | |
| ok = True | |
| for k1 in range(0, base): |
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 <cstdio> | |
| #include <cmath> | |
| #include <cstring> | |
| #include <ctime> | |
| #include <iostream> | |
| #include <algorithm> | |
| #include <set> | |
| #include <vector> | |
| #include <sstream> | |
| #include <typeinfo> |
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 <cstdio> | |
| #include <cmath> | |
| #include <cstring> | |
| #include <ctime> | |
| #include <iostream> | |
| #include <algorithm> | |
| #include <set> | |
| #include <vector> | |
| #include <sstream> | |
| #include <typeinfo> |
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 <cstdio> | |
| #include <cmath> | |
| #include <cstring> | |
| #include <ctime> | |
| #include <iostream> | |
| #include <algorithm> | |
| #include <set> | |
| #include <vector> | |
| #include <sstream> | |
| #include <typeinfo> |
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
| (ns fx-clj.core | |
| (:require [clojure.data.json :as json]) | |
| (:require [clj-http.client :as client])) | |
| (defn get-instruments [] | |
| (client/get | |
| "http://api-sandbox.oanda.com/v1/prices?instruments=EUR_USD" {:as :json})) | |
| (defrecord tick-event [instrument time bid ask]) |
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
| Time,Open,High,Low,Close,Volume | |
| 16.07.2015 00:10:00.000,1.09375,1.09376,1.09364,1.09375,64.0800 | |
| 16.07.2015 00:11:00.000,1.09375,1.09378,1.09364,1.09367,51.3600 | |
| 16.07.2015 00:12:00.000,1.09367,1.09379,1.09367,1.09375,81.7400 | |
| 16.07.2015 00:13:00.000,1.09375,1.09375,1.09334,1.09355,177.2900 | |
| 16.07.2015 00:14:00.000,1.09354,1.09358,1.09328,1.09334,181.5900 | |
| 16.07.2015 00:15:00.000,1.09337,1.09346,1.09328,1.09336,84.2500 | |
| 16.07.2015 00:16:00.000,1.09336,1.09338,1.09326,1.09330,174.3800 | |
| 16.07.2015 00:17:00.000,1.09330,1.09347,1.09328,1.09346,61.3400 | |
| 16.07.2015 00:18:00.000,1.09346,1.09350,1.09337,1.09337,123.2300 |
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
| """ | |
| Demonstrates streaming feature in OANDA open api | |
| To execute, run the following command: | |
| python streaming.py [options] | |
| To show heartbeat, replace [options] by -b or --displayHeartBeat | |
| """ |
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
| int start() { | |
| //変数の宣言 | |
| int cnt, CurrentPosition; | |
| int Ticket; | |
| double kakoa,gennzaia; | |
| double kakob,gennzaib; | |
| // オーダーチェック(ポジションなどのデータ) | |
| CurrentPosition=-1; | |
| for(cnt=0;cnt<OrdersTotal();cnt++) { |
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
| // TODO State monadを導入 | |
| import scala.util.{Try, Success, Failure} | |
| object Main { | |
| var initial = Array( | |
| Array('-','-','-'), | |
| Array('-','-','-'), | |
| Array('-','-','-')) |