Skip to content

Instantly share code, notes, and snippets.

View damian-m-g's full-sized avatar

Damián M. González damian-m-g

View GitHub Profile
@damian-m-g
damian-m-g / ffi [BUG] Segmentation fault
Created February 14, 2019 19:05
This happens when trying to `read_string()` on a pointer to char returned by accessing a member of an union. This only fails in x64 platform, for x86 (x32) works great.
Testing started at 3:45 PM ...
bundle.bat exec C:\Ruby25-x64\bin\ruby.exe C:\Ruby25-x64\bin\rake test
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/ffi-1.10.0-x64-mingw32/lib/ffi/pointer.rb:55: [BUG] Segmentation fault
ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
-- Control frame information -----------------------------------------------
c:0033 p:---- s:0189 e:000188 CFUNC :get_string
c:0032 p:0034 s:0184 e:000183 METHOD C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/ffi-1.10.0-x64-mingw32/lib/ffi/pointer.rb:55
c:0031 p:0101 s:0179 e:000178 METHOD C:/Users/Dami/Desktop/xlsx_drone/lib/xlsx_drone/sheet.rb:27
@damian-m-g
damian-m-g / FXButton SEL_KEYRELEASE not working.rb
Created January 15, 2013 01:01
The event SEL_KEYRELEASE is not triggered correctly on a #FXButton.
#encoding: utf-8
require 'fox16'
include Fox
class HelloWindow < FXMainWindow
def initialize(app)
ventana = super(app, "Hello, World!", width: 600, height: 400)
a = FXPacker.new(ventana, opts: LAYOUT_FILL)
#encoding: utf-8
#[Parte del modelo MVC] Vista
#[Descripcion] Solapa que forma parte de +Lenguetas+. Su contenido es lo referente a materiales, al material como objeto individual.
class LenguetaMateriales
#Crea un objeto +FXTabItem+(una solapa) y una "página" vinculada en donde se encuentra la interfaz para manipular este departamento. _p_ es el widget padre, debería ser una instancia de *Lenguetas*.
def initialize(p, ventanaprin)
lengueta_materiales = FXTabItem.new(p, "Materiales\tBase de datos de materiales\tTodos los materiales existentes en el globo Cablevisión. Se pueden modificar sus datos o agregar nuevos.")