This file contains 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
#!/usr/bin/env ruby | |
def a(m );print (m); end; | |
require 'zlib' ;eval(%w(c ='#'; s=32. | |
chr;f="\n"; j=4;i= [25, 20,14,8,3,3,j,j,5 | |
,5,6];a (s*3 0+c*4+ s*11+c*4+f);p=-1 | |
;[28 ,38, 50 ,62 ,72].each{|n|a(s *i[ | |
p+=1 ]+c *n +f) ;}; w=['c 1bxji 7',' 9ixq z9b' | |
,'7k 1eptf', '76 zemy2' ,'qoi m0x'] .map {|g| g.to_ i(36) | |
.to_ s(2) };[2,3 ]. eac h{|h |w[h ]='0 '+w[ h]};w[ 4]=('0 |
This file contains 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
diff --git a/kernel/bootstrap/string.rb b/kernel/bootstrap/string.rb | |
index a6f066f..d26370c 100644 | |
--- a/kernel/bootstrap/string.rb | |
+++ b/kernel/bootstrap/string.rb | |
@@ -1,5 +1,14 @@ | |
# -*- encoding: us-ascii -*- | |
+module Rubinius | |
+ module String | |
+ def self.to_dbl(str, strict) |
This file contains 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
def self.coerce_to_float(obj, strict=false) | |
case obj | |
when Numeric | |
coerce_to obj, Float, :to_f | |
when Float | |
return obj | |
when String | |
result = Rubinius.invoke_primitive :string_to_f, obj, strict | |
raise ArgumentError, "invalid value for Float" if result.nil? | |
result |
This file contains 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
n = 5_000_000 | |
puts Benchmark.measure { n.times { Float("9.0") } } | |
puts Benchmark.measure { n.times { "9.0".to_f } } |
This file contains 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
-- install packages | |
# yum update | |
# yum groupinstall "Development Tools" "Additional Development" | |
-- epel for redis, libyaml, pip, qtwebkit-devel | |
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm | |
# yum install libicu-devel libyaml-devel redis wget python-pip qt-devel qtwebkit-devel | |
-- install ruby |
This file contains 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
From 2587a13c97b654175d7cf68f2b969d37d42c5fea Mon Sep 17 00:00:00 2001 | |
From: Michael Macias <[email protected]> | |
Date: Wed, 13 Mar 2013 15:42:34 -0500 | |
Subject: [PATCH] Add NArray#map alias for NArray#collect | |
--- | |
narray.c | 2 ++ | |
1 file changed, 2 insertions(+) | |
diff --git a/narray.c b/narray.c |
This file contains 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
M=%w[R S P];S=STDIN;S.gets.to_i.times{t=0;S.gets.to_i.times{i,j=S.gets.split.map{|a|M.index(a)};M[i-2]==M[j]?t+=1:M[i]!=M[j]&&t-=1};puts t==0?"TIE":"Player #{t>0?1:2}"} |
This file contains 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
source 'https://rubygems.org' | |
gem 'sinatra', '~> 1.4.5' | |
gem 'ffi-gphoto2', '~> 0.5.0' |
This file contains 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
// Michael Macias <[email protected]> | |
// created 2014-10-02, updated 2014-10-13 | |
// rust 0.12.0 | |
// MIT license (http://opensource.org/licenses/MIT) | |
// | |
// acmhash.rs is a Rust solution to the fall 2014 University of Mississippi | |
// ACM hashing competition (http://micha.elwillia.ms/). The goal is to find | |
// an input so that the SHA-256 cryptographic hash function produces a digest | |
// with the most leading zeros. For example, the word "mismatchment" has 4 | |
// leading zeros. |
This file contains 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 'shrine' | |
require 'shrine/storage/memory' | |
Shrine.storages = { | |
cache: Shrine::Storage::Memory.new, | |
store: Shrine::Storage::Memory.new | |
} | |
class DocumentUploader < Shrine | |
plugin :determine_mime_type |
OlderNewer