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/local/bin/ruby | |
#********************************************************* | |
# Ruby script to caculate a formula string by RPN. | |
#********************************************************* | |
class String | |
RE_0 = Regexp.new('[=\s]+$') | |
RE_1 = Regexp.new('\s+') | |
RE_D = Regexp.new('\d+') | |
RE_PL = Regexp.new('\+') |
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/local/bin/ruby | |
#********************************************************* | |
# Ruby script to convert string to RPN. | |
# (Unary operators are not supported) | |
#********************************************************* | |
class String | |
RE_0 = Regexp.new('\s+|\=') | |
RE_1 = Regexp.new('[\d\.]+|[()*/+\-]') | |
RE_D = Regexp.new('\d+') |
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 "vincenty.hpp" | |
#include <cmath> | |
#include <iostream> | |
#include <tuple> | |
namespace my_lib { | |
// 定数 | |
constexpr double kA = 6378137.0; // GRS80 長半径 | |
constexpr double kF = 1.0 / 298.257222101; // GRS80 扁平率 |
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 "vincenty.hpp" | |
#include <cmath> | |
#include <iostream> | |
#include <tuple> | |
namespace my_lib { | |
// 定数 | |
constexpr double kA = 6378137.0; // GRS80 長半径 | |
constexpr double kF = 1.0 / 298.257222101; // GRS80 扁平率 |
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 "calc.hpp" | |
#include <algorithm> // for std::count | |
#include <cmath> // for std::sqrt | |
#include <iostream> | |
#include <unordered_map> | |
#include <vector> | |
Calc::Calc(std::vector<std::vector<double>>& data) { | |
try { |
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 "calc.hpp" | |
#include <algorithm> // for std::count | |
#include <cmath> // for std::sqrt | |
#include <iostream> | |
#include <unordered_map> | |
#include <vector> | |
Calc::Calc(std::vector<std::vector<double>>& data) { | |
try { |
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
/*************************************************************** | |
Rank of numbers (integer) (by central rank method) | |
$ g++ -std=c++17 -Wall -O2 --pedantic-errors -o rank_2 rank_2.cpp | |
DATE AUTHOR VERSION | |
2020.09.04 mk-mode.com 1.00 新規作成 | |
Copyright(C) 2020 mk-mode.com All Rights Reserved. | |
***************************************************************/ |
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
/*************************************************************** | |
Rank of numbers (integer) | |
$ g++ -std=c++17 -Wall -O2 --pedantic-errors -o rank rank.cpp | |
DATE AUTHOR VERSION | |
2020.08.31 mk-mode.com 1.00 新規作成 | |
Copyright(C) 2020 mk-mode.com All Rights Reserved. | |
***************************************************************/ |
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
/*************************************************************** | |
Binomial coefficients | |
by GMP(The GNU Multi Presicion Arithmetic Library). | |
DATE AUTHOR VERSION | |
2020.08.24 mk-mode.com 1.00 新規作成 | |
Copyright(C) 2020 mk-mode.com All Rights Reserved. | |
***************************************************************/ | |
#include "common.hpp" |
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
/*************************************************************** | |
Check real number | |
$ g++ -std=c++17 -Wall -O2 --pedantic-errors -o is_real is_real.cpp | |
DATE AUTHOR VERSION | |
2020.08.24 mk-mode.com 1.00 新規作成 | |
Copyright(C) 2020 mk-mode.com All Rights Reserved. | |
***************************************************************/ |