Skip to content

Instantly share code, notes, and snippets.

View DSCF-1224's full-sized avatar

DSCF_1224 DSCF-1224

View GitHub Profile
@DSCF-1224
DSCF-1224 / 201908181049.f08
Created August 18, 2019 01:49
generate random characters using subroutine `RANDOM_NUMBER`
program hello
use, intrinsic :: iso_fortran_env
implicit none
integer(INT8), parameter :: ichar_a = ichar("a")
integer(INT8), parameter :: ichar_z = ichar("z")
integer(INT8), parameter :: ichar_width_az = ichar_z - ichar_a + 1
function exchangeBackslash(path::Core.AbstractString)
return Base.replace(path, '\u005c' => '\u002f')
end
path_raw = Base.readline(Base.stdin)
path_fix = Main.exchangeBackslash(path_raw)
Base.println(Base.stdout, path_fix)
Base.println(Base.stdout, Base.Filesystem.isabspath(path_raw))
@DSCF-1224
DSCF-1224 / 201910222251.jl
Last active October 22, 2019 13:54
trial module of Julia 2019/10/22 version 01
module Mod20191022v01
mutable struct Coordinate{T <: Core.Real}
x::T
y::T
end
function Base.:+(cd1::Coordinate{T}, cd2::Coordinate{T}) where T <: Core.Real
return Coordinate{T}(cd1.x + cd2.x, cd1.y + cd2.y)
end
@DSCF-1224
DSCF-1224 / 201910240001.cpp
Last active October 23, 2019 22:07
my handling exceptions for C++
#include <cstdlib>
// for; EXIT_SUCCESS
// for; EXIT_FAILURE
#include <iostream>
// for; std::cerr
#include <string>
// for; std::string
// for; std::string std::literals::string_literals::operator ""s
#include "ver20191023_01.hpp"
@DSCF-1224
DSCF-1224 / 201911091817.hs
Created November 9, 2019 09:20
Euler Method about ODE
{- reference -}
-- ISBN978-4-320-01343-8
-- http://lqtmirage.hatenablog.com/entry/2017/05/29/125134
{- module to import -}
import Prelude
@DSCF-1224
DSCF-1224 / 202004262249.jl
Created April 26, 2020 13:50
ガウス過程と機械学習 第1章 linear.py
# ==================================================================================================================================
# ISBN 978-4-06-152926-7
# ガウス過程と機械学習
# [reference]
# http://chasen.org/~daiti-m/gpbook/python/linear.py
# http://chasen.org/~daiti-m/gpbook/data/linear.dat
# ==================================================================================================================================
module ISBN9784061529267
@DSCF-1224
DSCF-1224 / 202004292200.jl
Created April 29, 2020 13:01
ガウス過程と機械学習 第1章 linear.py version.02
# ==================================================================================================================================
# ISBN 978-4-06-152926-7
# ガウス過程と機械学習
#
# [reference]
# http://chasen.org/~daiti-m/gpbook/python/linear.py
# http://chasen.org/~daiti-m/gpbook/data/linear.dat
# https://nbviewer.jupyter.org/gist/genkuroki/a37894d5669ad13b4cd27da16096bfd2
#
# [How to execute]
@DSCF-1224
DSCF-1224 / 20200504_0007.f08
Created May 3, 2020 15:13
ガウス過程と機械学習 第1章 linear.py version 01
! ==================================================================================================================================
! ISBN 978-4-06-152926-7
! ガウス過程と機械学習
!
! [reference]
! http://chasen.org/~daiti-m/gpbook/python/linear.py
! http://chasen.org/~daiti-m/gpbook/data/linear.dat
! https://nbviewer.jupyter.org/gist/genkuroki/a37894d5669ad13b4cd27da16096bfd2
! http://www.caero.mech.tohoku.ac.jp/publicData/Daiguji/
! ==================================================================================================================================
@DSCF-1224
DSCF-1224 / 20200504_1200.jl
Created May 4, 2020 03:05
ガウス過程と機械学習 第1章 lm.py version 01
# ==================================================================================================================================
# ISBN 978-4-06-152926-7
# ガウス過程と機械学習
#
# [reference]
# http://chasen.org/~daiti-m/gpbook/python/lm.py
# http://chasen.org/~daiti-m/gpbook/data/nonlinear.dat
# https://nbviewer.jupyter.org/gist/genkuroki/a37894d5669ad13b4cd27da16096bfd2
# https://github.com/JuliaData/CSV.jl/issues/371 <- `ignorerepeated = true`
#
@DSCF-1224
DSCF-1224 / 20200505_1430.f08
Created May 5, 2020 05:39
ガウス過程と機械学習 第1章 lm.py version 01 (Fortran)
! ==================================================================================================================================
! ISBN 978-4-06-152926-7
! ガウス過程と機械学習
!
! [reference]
! http://chasen.org/~daiti-m/gpbook/python/lm.py
! http://chasen.org/~daiti-m/gpbook/data/nonlinear.dat
! https://nbviewer.jupyter.org/gist/genkuroki/a37894d5669ad13b4cd27da16096bfd2
! https://gihyo.jp/book/2015/978-4-7741-7506-5
! ==================================================================================================================================