Skip to content

Instantly share code, notes, and snippets.

"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby27-x64/include/ruby-2.7.0/x64-mingw32 -Ic:/Ruby27-x64/include/ruby-2.7.0/ruby/backward -Ic:/Ruby27-x64/include/ruby-2.7.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -Lc:/Ruby27-x64/lib -L. -pipe -s -fstack-protector-strong -lx64-msvcrt-ruby270 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return !!argv[argc];
numo_to_array.rb:13: [BUG] Segmentation fault
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0016 e:000015 CFUNC :*
c:0002 p:0061 s:0011 E:0005e8 EVAL numo_to_array.rb:13 [FINISH]
c:0001 p:0000 s:0003 E:001840 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
numo_to_array.rb:13:in `<main>'
require 'numo/narray'
require 'arrow-numo-narray'
a = Numo::Int32.new(3,100000000).seq
table_a = a.to_arrow
a_t = table_a.to_narray
@dsisnero
dsisnero / README.md
Created January 10, 2020 17:34 — forked from savetheclocktower/README.md
Using a rotary encoder as a volume control for the Raspberry Pi

Using a rotary encoder as a volume control

On my RetroPie machine I wanted a hardware volume knob — the games I play use a handful of emulators, and there's no unified software interface for controlling the volume. The speakers I got for my cabinet are great, but don't have their own hardware volume knob. So with a bunch of googling and trial and error, I figured out what I need to pull this off: a rotary encoder and a daemon that listens for the signals it sends.

Rotary encoder

A rotary encoder is like the standard potentiometer (i.e., analog volume knob) we all know, except (a) you can keep turning it in either direction for as long as you want, and thus (b) it talks to the RPi differently than a potentiometer would.

I picked up this one from Adafruit, but there are plenty others available. This rotary encoder also lets you push the knob in and treats that like a button press, so I figured that would be useful for toggling mute on and off.

@dsisnero
dsisnero / Import Contacts from Slack.js
Created August 2, 2019 18:27 — forked from simonbs/Import Contacts from Slack.js
Scriptable script that imports contacts from Slack. Existing contacts will also have their avatar and social profiles updated. The contacts must have their phone number set in Slack.
// In order to use the script,
// you must create a Slack bot
// with the user:read scope and
// generate an accesss token.
// The script will prompt you
// to copy the access token in.
// The token is stored securely
// in the keychain.
let containers = await ContactsContainer.all()
let contacts = await Contact.all(containers)
@dsisnero
dsisnero / Water Reminder.js
Created August 2, 2019 18:22 — forked from schl3ck/Water Reminder.js
A scriptable script to remind you to drink water and record it. The data gets overridden after 2 days and is lost forever. Features: • Highly customiseable (interval of notifications, repeated notifications if I haven't responded, sound, preset list of how much you want to write down,...) • Works completely in notifications, no need to open the …
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: tint;
/*******************************************
* *
* __ __ _ *
* \ \ / /_ _| |_ ___ _ _ *
* \ \/\/ / _` | _/ -_) '_| *
* ___ \_/\_/\__,_|\__\___|_| *
* | _ \___ _ __ (_)_ _ __| |___ _ _ *
@dsisnero
dsisnero / fd arrow
Created March 21, 2019 13:57
arrow on windows
E:\msys64\mingw64>fd arrow
bin\libarrow-glib-11.dll
bin\libarrow.dll
bin\libarrow_python.dll
include\arrow
include\arrow-glib
lib\libarrow-glib.dll.a
lib\libarrow.a
lib\libarrow.dll.a
lib\libarrow_python.a
@dsisnero
dsisnero / gem_make.out
Created February 28, 2019 21:21
gem install glib2 errors
current directory: D:/rubies/Ruby26-x64/lib/ruby/gems/2.6.0/gems/glib2-3.3.2/ext/glib2
D:/rubies/Ruby26-x64/bin/ruby.exe -I D:/rubies/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190228-22052-16km5y1.rb extconf.rb
checking for --enable-debug-build option... no
checking for -Wall option to compiler... yes
checking for -Waggregate-return option to compiler... yes
checking for -Wcast-align option to compiler... yes
checking for -Wextra option to compiler... no
checking for -Wformat=2 option to compiler... yes
checking for -Winit-self option to compiler... yes
checking for -Wlarger-than-65500 option to compiler... yes
@dsisnero
dsisnero / gem_make.out
Created November 6, 2018 14:36
ruby gtk3 build failure
current directory: E:/rubies/rubyinstaller-2.5.3-1-x64/lib/ruby/gems/2.5.0/bundler/gems/ruby-gnome2-f347d1a69c18/glib2/ext/glib2
E:/rubies/rubyinstaller-2.5.3-1-x64/bin/ruby.exe -r ./siteconf20181106-19324-12g30df.rb extconf.rb
checking for --enable-debug-build option... no
checking for -Wall option to compiler... yes
checking for -Waggregate-return option to compiler... yes
checking for -Wcast-align option to compiler... yes
checking for -Wextra option to compiler... yes
checking for -Wformat=2 option to compiler... yes
checking for -Winit-self option to compiler... yes
checking for -Wlarger-than-65500 option to compiler... yes
@dsisnero
dsisnero / mdbanalyzer.rb
Created October 16, 2018 23:00 — forked from kinumi/mdbanalyzer.rb
MS-AccessのMDBファイルを解析して適当な相関図を作成します。 (ソーステーブル) => (選択クエリ) => (更新系クエリ) => (ディスティネーションテーブル) ※ソーステーブルとディスティネーションテーブルには同じテーブルが登場する場合があります。
#!ruby -Ku
#coding: utf-8
#
# mdbanalyzer.rb
#
# なにこれ?
# MS-AccessのMDBファイルを解析して適当な相関図を作成します。
#
# (ソーステーブル) => (選択クエリ) => (更新系クエリ) => (ディスティネーションテーブル)