Skip to content

Instantly share code, notes, and snippets.

# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# Description:
# Listen for a specific title from Qiita:Team
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_QIITA_TEAM
# HUBOT_QIITA_TOKEN
#
def polynomial(numbers, x)
r = 0
numbers.each_with_index do |n, i|
r += n * x**i
end
r
end
def polynomial2(numbers, x)
ary = [1, x]
// Fetch the default set of models for this collection, resetting the
// collection when they arrive. If `reset: true` is passed, the response
// data will be passed through the `reset` method instead of `set`.
fetch: function(options) {
options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true;
var success = options.success;
var collection = this;
options.success = function(resp) {
var method = options.reset ? 'reset' : 'set';
class IO
def write(string)
str = string.is_a?(String) ? string : string.to_s
return str.size unless str.size > 0
len = syswrite(str)
if str.size == len
@pos += len
return len
end
@akiray03
akiray03 / command
Last active December 21, 2015 15:38
$ ruby t.rb
OK
$ ./tmp/mruby/bin/mruby t.rb
not found class A
t.rb:11: uninitialized constant A (NameError)
$ ./tmp/mruby/bin/mruby t2.rb
OK
$ cat Gemfile
source 'http://rubygems.org'
gem 'chef'
gem 'berkshelf'
gem 'knife-solo', :github => 'matschaffer/knife-solo'
$ bundle install
Updating git://github.com/matschaffer/knife-solo.git
Fetching gem metadata from http://rubygems.org/........
Fetching gem metadata from http://rubygems.org/..
diff --git a/mrbgems/mruby-bin-mirb/mrbgem.rake b/mrbgems/mruby-bin-mirb/mrbgem.rake
index fd0b202..0cc9bb1 100644
--- a/mrbgems/mruby-bin-mirb/mrbgem.rake
+++ b/mrbgems/mruby-bin-mirb/mrbgem.rake
@@ -2,4 +2,11 @@ MRuby::Gem::Specification.new('mruby-bin-mirb') do |spec|
spec.license = 'MIT'
spec.authors = 'mruby developers'
spec.bins = %w(mirb)
+
+ if MRuby::Build.current && MRuby::Build.current.name == "host"
(gdb) run t4.rb
Starting program: /home/yumiyama/work/mruby/mruby/bin/mruby t4.rb
t4.rb:6: expected String (TypeError)
"done."
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff77f1201 in EVP_MD_CTX_cleanup () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
(gdb) bt
#0 0x00007ffff77f1201 in EVP_MD_CTX_cleanup () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#1 0x00007ffff777265d in HMAC_CTX_cleanup () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0