This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# What are these funky characters I'm seeing on my console? | |
c:\>ri File.read | |
←[0m←[1;32mFile.read←[m | |
(from ruby core) | |
←[32mImplementation from IO←[m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I've got a have_library call failing when I tried to install the pg gem | |
c:\Users\djberge\Downloads\Ruby>gem install pg -- --with-pg-dir="c:\Program Files (x86)\PostgreSQL\9.1" | |
Building native extensions. This could take a while... | |
ERROR: Error installing pg: | |
ERROR: Failed to build gem native extension. | |
c:/usr/bin/ruby.exe extconf.rb --with-pg-dir=c:\Program Files (x86)\PostgreSQL\9.1 | |
checking for pg_config... yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Visual Studio 10 | |
Windows 7 | |
I installed RubyInline without (apparent) issue. Tried this code next: | |
# stuff.rb | |
require 'inline' | |
class Array | |
inline :C do |builder| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ruby.h" | |
# line 6 "average.rb" | |
static VALUE stuff(VALUE self, VALUE _self) { | |
VALUE self = (_self); | |
return (INT2FIX(7)); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Chopped path | |
27) Failure: | |
test_accessor(TestInline::TestC) [c:/Users/djberge/Repositories/djberg96-rubyinline/test/t | |
est_inline.rb:152]: | |
--- expected | |
+++ actual | |
@@ -1,4 +1,4 @@ | |
-["# line N \"c:/Users/djberge/Repositories/djberg96-rubyinline/lib/inline.rb\" | |
+["# line N \"c\" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\djberge\Repositories\win32-sound>jruby -S rake --trace | |
** Invoke default (first_time) | |
** Invoke test (first_time) | |
** Execute test | |
c:/jruby/bin/jruby.exe -w -I"lib" "test/test*.rb" | |
Error opening script file: C:/Users/djberge/Repositories/win32-sound/test/test*.rb (The fi | |
lename, directory name, or volume label syntax is incorrect) | |
rake aborted! | |
Command failed with status (1): [c:/jruby/bin/jruby.exe -w -I"lib" "test/t...] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c:\Users\djberge\Repositories\win32-sound>irb | |
irb(main):001:0> require 'socket' | |
=> true | |
irb(main):002:0> sockets = Socket.pair(Socket::AF_INET, Socket::SOCK_STREAM, 0) | |
=> [#<Socket:fd 4>, #<Socket:fd 5>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c:\Users\djberge\Repositories\win32-sound>jruby -Ilib test/test*.rb | |
Error opening script file: c:/Users/djberge/Repositories/win32-sound/test/test*.rb (The filename, directory name, or volume label syntax is incorrect) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It seems this is the wrong way to create an array of union in FFI. What's the right way? | |
array = [] | |
# FileSegmentElement is an FFI::Union, and :Alignment is a :uint64 | |
for i in 0...page_num | |
segment = FileSegmentElement.new | |
segment[:Alignment] = base_address + page_size * i | |
array << segment | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
import java.lang.System | |
class File::Temp < File | |
VERSION = '1.2.2' | |
TMPDIR = System.getProperties["java.io.tmpdir"] | |
attr_reader :path |