Questions tagged [fiddle]

Fiddle is an extension to translate a foreign function interface (FFI) with ruby.

52 questions
38
votes
1 answer

Nested structures in Ruby Fiddle

Is it somehow possible to define nested structure signatures in Ruby's Fiddle lib? Or at this point via any other up-to-date library which I'm not familiar with? It is kind of a desperate question since I've searched through the documentation and…
Ríša Werner
  • 501
  • 3
  • 6
21
votes
8 answers

How to delay the display of the background image in a div

Here's my fiddle. I just want the " background-image: " in the css to load fully and display after 3 seconds with a quick fade in effect, until then the entire div must be in black color. How it is possible in css or javascript. .initials { …
Zack
  • 471
  • 3
  • 9
  • 22
6
votes
1 answer

How to use Fiddle with Windows API (dll) to run a shellcode in Ruby

I'm trying to use ruby Fiddle standard library to Windows APIs to run a shellcode The idea of the code is to having a hexdicemial shellcode raw that executes anything (eg. MessageBoxA) call kernel32.dll allocate a memory for this shellcode.…
KING SABRI
  • 775
  • 7
  • 18
5
votes
1 answer

How can I load Windows DLL files with Ruby fiddle?

I am trying to create a GR framework binding for ruby. I use Fiddle. Fiddle is a default extension to translate a foreign function interface (FFI) with ruby. It Works well on Linux and Mac. But on Windows, I got following error. code…
kojix2
  • 806
  • 7
  • 18
4
votes
1 answer

Ruby fiddle define struct

I am trying to define the Tinn C lib in Ruby using fiddle, but it is giving me an error with the struct Tinn.h typedef struct { // All the weights. float* w; // Hidden to output layer weights. float* x; // Biases. float* b; …
arjun
  • 1,594
  • 16
  • 33
3
votes
0 answers

Ruby Fiddle: Nested union of structs within a struct

I have seen this question asked a few times on this site, and others, and have yet to see a legitimate and actual answer aside from posting links to the Ruby docs that don't answer the question either. Is it possible, and if so how, to have a union…
ForeverZer0
  • 2,379
  • 1
  • 24
  • 32
3
votes
0 answers

What does Fiddle.dlwrap and Fiddle.dlunwrap do in Ruby?

I'm trying to understand how Ruby's Fiddle library works. I understand mostly how it interacts with libffi, but there's just one thing that's still baffling me: what on earth do Fiddle.dlwrap and Fiddle.dlunwrap do exactly? The documentation just…
danini
  • 365
  • 5
  • 9
3
votes
1 answer

Ruby Fiddle dll search Path

I am trying to load a dll using the following fiddle code: ( If there is a easier way to load a dll and call a function on it that would solve my problem I am happy to hear it ) require 'fiddle' unless defined?(Fiddle) require 'fiddle/import' unless…
marsh
  • 2,592
  • 5
  • 29
  • 53
2
votes
1 answer

Sql sum up based on parent table

My sql looks like: create table ad( ad_id int, ad_name varchar(10) ); insert into ad(ad_id, ad_name) values (1,'ad1'), (2,'ad2'), (3,'ad3'); create table ad_insight( id int, ad_id int, date date, clicks int …
miclofa
  • 49
  • 1
  • 10
2
votes
1 answer

Ruby Fiddle - Function behaves differently between C and Ruby

I am using Ruby Fiddle to access a C function to perform some heavy calculations. The C function works perfectly well when called directly, but when used via Fiddle it returns various rows of nans and infs in an unpredictable way. The function…
Rojj
  • 1,170
  • 1
  • 12
  • 32
2
votes
0 answers

Why is my Fiddle struct being filled with garbage?

I'm attempting to convert a very simple C Win32 API call over to Ruby utilizing Fiddle and I'm not having much success. The first two method calls work flawlessly, though when I get to the call which populates a struct I'm having a bit of…
cjones26
  • 3,459
  • 1
  • 34
  • 51
2
votes
5 answers

How to style font-awesome icons in css?

I have a screenshot below which I have replicated in HTML/CSS. The design is exactly the same both for mobile and desktop view. In the design, the angle dropdown font-awesome icons (marked with arrow in the screenshot) are aligned properly with the…
flash
  • 1,455
  • 11
  • 61
  • 132
2
votes
1 answer

access dll function on C project from Ruby

I have a project written in C controlling hardware devices. I'm trying to access DLL functions in my projects from a Ruby app in order to control the hardware from the Ruby web app. I'm failing in loading the dll project files using FFI and Fiddle.…
Yof
  • 23
  • 5
2
votes
1 answer

Fiddle script not working on website

If I copy the code from here: https://jsfiddle.net/agt10exp/ It's working fine on fiddle, however when I make a new file on my pc and just paste the code in it, I get the same layout, however it's not functioning properly (added the …
KingBoomie
  • 278
  • 1
  • 12
2
votes
1 answer

Passing RUBY Array to C DLL using Fiddle

First I am aware that my question is similar to the one posted as the following. How to deal with array pointers in ruby Fiddle But that question is indeed not answered. My problem is to write a function in ruby, that will accept a ruby array of…
Saedrna
  • 51
  • 4
1
2 3 4