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
/*************************************************************** | |
* Computing pi by Binary Splitting Algorithm with GMP libarary. | |
**************************************************************/ | |
#include <cmath> | |
#include <iostream> | |
#include <fstream> | |
#include <gmpxx.h> | |
using namespace std; |
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
#!/bin/bash | |
# 1. 指定文字数左へ移動後に echo | |
# ( 最後の echo 以外は改行しない ) | |
# | |
echo -n `date +"%Y-%m-%d %H:%M:%S"` | |
for i in {0..4}; | |
do | |
sleep 1 | |
tput cub 19 |
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 calculate a simple regression curve. | |
# : y = a + b * ln(x) | |
# : 連立方程式を ガウスの消去法で解く方法 | |
#********************************************* | |
# | |
class Array | |
def reg_curve_ln(y) | |
# 以下の場合は例外スロー |
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 compute a logistic regression analysis. | |
# (by extending the matrix class) | |
#********************************************* | |
# | |
require 'matrix' | |
class Matrix | |
ALPHA = 0.01 # 学習率 |
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
#! /usr/local/bin/ruby | |
# coding: utf-8 | |
#---------------------------------------------------- | |
# Ruby script to write a watermark by rmagick. | |
# | |
# date name version | |
# 2016.04.24 mk-mode.com 1.00 New creation. | |
# | |
# Copyright(C) 2016 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
class String | |
def to_camel | |
self.split(/_/).map(&:capitalize).join | |
# or | |
#self.split(/_/).map{ |w| w[0] = w[0].upcase; w }.join | |
end | |
def to_snake | |
self.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') | |
.gsub(/([a-z\d])([A-Z])/, '\1_\2') |
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/python3.6 | |
import datetime | |
import sys | |
import traceback | |
from daemon import DaemonContext | |
from os import path | |
from time import sleep | |
from lockfile.pidlockfile import PIDLockFile |
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
!**************************************************** | |
! 線形計画法(シンプレックス法) | |
! | |
! * 入力はテキストファイルをパイプ処理 | |
! 1行目: 行数 列数 変数の数 | |
! 2行目以降: 1行に列数分の係数 * 行数 | |
! | |
! date name version | |
! 2018.12.05 mk-mode.com 1.00 新規作成 | |
! |
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
!******************************************************************************* | |
! ECEF -> BLH 変換 | |
! : ECEF(Earth Centered Earth Fixed; 地球中心・地球固定直交座標系)座標を | |
! WGS84 の緯度(Latitude)/経度(Longitude)/楕円体高(Height)に変換する。 | |
! | |
! date name version | |
! 2019.02.21 mk-mode.com 1.00 新規作成 | |
! | |
! Copyright(C) 2019 mk-mode.com All Rights Reserved. | |
! --- |
NewerOlder