Skip to content

Instantly share code, notes, and snippets.

@Hamayama
Hamayama / callcc.bat
Last active November 9, 2023 03:05
Gauche で、call/cc によるコンテキストスイッチのサンプル
View callcc.bat
gosh callcc.scm
pause
@Hamayama
Hamayama / test_0001_open.bat
Last active October 29, 2023 10:55
Gauche の fast lock (spin lock) 実装のテスト (MSYS2/MinGW-w64)
View test_0001_open.bat
@rem set GOSH=C:\Gauche\Gauche-mingw-dist\Gauche-i686\bin\gosh.exe
set GOSH=C:\Gauche\Gauche-mingw-dist\Gauche-x86_64\bin\gosh.exe
@rem set GOSH=C:\Gauche\Gauche-mingw-dist\Gauche-x86_64_2_mutexlock\bin\gosh.exe
%GOSH% test_0001_open.scm
pause
@Hamayama
Hamayama / 0000_compile_32.bat
Created October 27, 2023 13:22
Windows で spin lock と mutex lock のテスト (MSYS2/MinGW-w64)
View 0000_compile_32.bat
@set PATH=C:\msys64\mingw32\bin;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\bin;%PATH%
set MSYSTEM=MINGW32
for %%i in (
spinlock mutexlock
) do (
gcc -g -O2 -Wall -Wextra -o %%i_32.exe %%i.c
)
pause
@Hamayama
Hamayama / 0000_compile.bat
Created October 18, 2023 12:36
Windows の _execvp() の実行サンプル
View 0000_compile.bat
@set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\bin;%PATH%
set MSYSTEM=MINGW64
for %%i in (
inout execvp
) do (
gcc -g -O2 -Wall -Wextra -o %%i.exe %%i.c
)
pause
@Hamayama
Hamayama / 1004_parseInt.md
Last active October 1, 2023 13:08
JavaScript の parseInt で小数を整数に変換しようとしてはまる
View 1004_parseInt.md

JavaScript の parseInt で小数を整数に変換しようとしてはまる

現象

  • JavaScript の parseInt で小数を整数に変換しようとして、はまったことがありました。
    以下のように、小数第6位までが 0 で、第7位以降に 0 以外の値があると、
    変換結果の整数が 0 ではなくなってしまいます。
    小さい値を入力した方が、変換結果は逆に大きな値になるため、
    一見すると理由が分かりにくい現象でした。
@Hamayama
Hamayama / 1007_MinGW64_Install.md
Last active June 22, 2023 13:25
MSYS2/MinGW-w64 (64bit/32bit) インストール手順 メモ
View 1007_MinGW64_Install.md

MSYS2/MinGW-w64 (64bit/32bit) インストール手順 メモ

  • 自分がインストールしたとき (2022年9月) の参考用のメモです。
    (情報が古くなっている可能性があります)
  1. MSYS2 のページ
    https://msys2.github.io/
    から、MSYS2 のインストーラ ( msys2-x86_64-20220904.exe ) を取得して実行します。
    (注意:32bit 版のインストーラは、提供されなくなりました。
@Hamayama
Hamayama / wincon_mouse.c
Last active May 8, 2023 19:41
Windows Console Mouse Input Test
View wincon_mouse.c
/*
Windows Console Mouse Input Test
2021-3-13 v1.28
OS : Windows 10 (version 20H2) (64bit)
DevTools : MSYS2/MinGW-w64 (64bit) (gcc version 10.2.0 (Rev6, Built by MSYS2 project)))
Terminal : Windows Terminal 1.6.10571.0
Compile : gcc -g -O2 -Wall -Wextra -o wincon_mouse.exe wincon_mouse.c
*/
#include <windows.h>
@Hamayama
Hamayama / 1000_make_code.bat
Last active April 22, 2023 06:59
Gauche による C のコード生成のサンプル
View 1000_make_code.bat
gosh 1000_make_code.scm
pause
@Hamayama
Hamayama / 1009_readconsole.md
Last active October 30, 2022 04:37
Windows API の ReadConsoleW の再現テスト
View 1009_readconsole.md
@Hamayama
Hamayama / information.txt
Last active September 17, 2022 11:11
Gauche の http-get で、mbedTLS のエラーが出る件の調査
View information.txt
<Scheme:初心者の質問箱>
https://practical-scheme.net/wiliki/wiliki.cgi?Scheme%3A%E5%88%9D%E5%BF%83%E8%80%85%E3%81%AE%E8%B3%AA%E5%95%8F%E7%AE%B1
(rfc.http) http-get での error について(Gauche-0.9.12)
(use rfc.http)
(http-get "artscape.jp" "/exhibition/traveling/index.html" :secure #t)
*** ERROR: TLS handshake failed: SSL - A field in a message was incorrect or inconsistent with other fields (-26112)