View chudnovsky.cpp
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; |
View inverse_matrix.f95
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
!**************************************************** | |
! 逆行列の計算(余因子行列) | |
! | |
! DATE AUTHOR VERSION | |
! 2019.12.24 mk-mode.com 1.00 新規作成 | |
! | |
! Copyright(C) 2013 mk-mode.com All Rights Reserved. | |
!**************************************************** | |
! | |
module const |
View calc.cpp
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 <cmath> | |
#include <iomanip> | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
namespace my_lib { |
View linear_programming.cpp
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 <iostream> // for cout | |
#include <stdio.h> // for printf() | |
#define N_ROW 4 // 行数 | |
#define N_COL 6 // 列数 | |
#define N_VAR 2 // 変数の数 |
View fb_api.rb
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
require 'json' | |
require 'net/https' | |
# 各種定数 | |
URL_BASE = "https://graph.facebook.com/{ユーザID or ユーザ名}" | |
APP_ID = "{Facebook アプリの APP-ID}" | |
APP_SECRET = "{Facebook アプリの APP-SECRET}" | |
# [CLASS] Facebook API | |
class FbApi |
View lu_decomposition_3.f95
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
!************************************************************ | |
! LU 分解(クラウト法(Crout method)) | |
! | |
! date name version | |
! 2019.03.08 mk-mode.com 1.00 新規作成 | |
! | |
! Copyright(C) 2019 mk-mode.com All Rights Reserved. | |
!************************************************************ | |
! | |
module const |
View test_daemon.py
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 |
View regression_line_2.rb
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 lenear regression line. | |
# : y = a + b * x | |
# : 連立方程式を ガウスの消去法で解く方法 | |
#********************************************* | |
# | |
class Array | |
def reg_line(y) | |
# 以下の場合は例外スロー |
View calc.cpp
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 <cmath> | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
// 定数 | |
static constexpr double kAlpha = 0.01; // 学習率 | |
static constexpr double kEps = 1.0e-12; // 閾値 |
View calc.cpp
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 <cmath> | |
#include <iomanip> | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
/** | |
* @brief 配列サイズ取得 |
NewerOlder