- このサンプルをダウンロードして解凍したディレクトリで以下を実行
$ ruby extconf.rb
$ make
$ ruby test.rb| require "mkmf" | |
| $libs += " -lstdc++ " | |
| create_makefile("human") |
| /* $ gcc -Wall -g [-DDEBUG] curl_writefunction.c -lcurl */ | |
| /* $ ./a.out [URL] */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <curl/curl.h> | |
| #define BUFFER_MAX 0x10000 | |
| size_t write_length = 0; |
| /* | |
| test_libcurl.c | |
| "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe" -source-charset:utf-8 -execution-charset:utf-8 -EHsc -Fe.\test_libcurl.exe .\test_libcurl.c -I.\curl-7.74.0_2-win64-mingw\include -link /LIBPATH:.\ /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64" libcurl-x64.lib | |
| del test_libcurl.obj | |
| test_libcurl | |
| ------------------------------------------------------------------------ | |
| extract | |
| from curl-7.74.0/win64/curl-7.74.0_2-win64-mingw.zip 3,565,580 | |
| to curl-7.74.0_2-win64-mingw/ |
| #include "SDL2/SDL.h" | |
| #include "SDL2/SDL_mixer.h" | |
| static const char *MY_COOL_MP3 = "cool_tunes.mp3"; | |
| int main(int argc, char **argv) { | |
| int result = 0; | |
| int flags = MIX_INIT_MP3; | |
| if (SDL_Init(SDL_INIT_AUDIO) < 0) { |
| /* | |
| test_pico_waveout.c | |
| "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe" -source-charset:utf-8 -execution-charset:utf-8 -EHsc -Fe.\test_pico_waveout.exe .\test_pico_waveout.c -I. -I.\curl-7.74.0_2-win64-mingw\include -I..\SDL2-2.0.14-dev\include -I..\SDL2_mixer-2.0.4-dev\include -link /SUBSYSTEM:CONSOLE /LIBPATH:.\ /LIBPATH:..\SDL2-2.0.14-dev\lib\x64 /LIBPATH:..\SDL2_mixer-2.0.4-dev\lib\x64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64" libcurl-x64.lib lame_enc.lib libmpg123-0.lib SDL2_mixer.lib SDL2main.lib SDL2.lib shell32.lib winmm.lib | |
| del test_pico_waveout.obj | |
| test_pico_waveout | |
| ------------------------------------------------------------------------ | |
| see also test_libcurl.c | |
| ------------------------------------------------------ |
| #!/usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| '''_test_pin_angle_ | |
| pin 8->1 line = sqrt(3)/9 = 0.19245... = tan(0.1901256...) = 10.893... (degree) | |
| tan(10.893 deg) = 0.1924... | |
| tan(6 deg) = 0.1051... | |
| tan(3 deg) = 0.0524... | |
| ''' | |
| import sys, os |
| #!/usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| '''_test_meshgrid_contour_ | |
| ''' | |
| import sys, os | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| from matplotlib.colors import hsv_to_rgb |