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 'net/http' | |
require 'uri' | |
File.write('firefox.exe', Net::HTTP.get(URI('http://www.dnsbalance.ring.gr.jp/pub/net/www/mozilla/firefox/releases/latest/win32/ja/Firefox%20Setup%2028.0.exe'))) |
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
(site:homes.co.jp OR site:suumo.jp OR site:athome.co.jp OR site:chintai.net OR site:eheya.net OR site:able.co.jp OR site:apamanshop.com) (告知事項 OR 説明義務) |
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 './variable_table_of_caller' | |
def easy_printf(template) | |
keys = template.scan(/%{(.+?)}/).flatten.map(&:to_sym) | |
printf(template, variable_table_of_caller_with_level(2, *keys)) | |
end | |
if $0 == __FILE__ | |
foo = 1 | |
bar = 'baz' |
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
$ make test-all TESTS='-v ruby/test_exception.rb' | |
CC = gcc-4.9 | |
LD = ld | |
LDSHARED = gcc-4.9 -shared | |
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -ansi -std=iso9899:199409 -fPIC | |
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT | |
CPPFLAGS = -I. -I.ext/include/x86_64-linux -I../include -I.. | |
DLDFLAGS = -Wl,-soname,libruby2.1.so.2.1 -fstack-protector | |
SOLIBS = -lpthread -lgmp -ldl -lcrypt -lm | |
Using built-in specs. |
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
$ for i in 1 2 3; do time ruby2.2 -e 'N=1<<(1<<22); rand(N)*rand(N)'; done | |
real 0m0.069s | |
user 0m0.064s | |
sys 0m0.008s | |
real 0m0.076s | |
user 0m0.072s | |
sys 0m0.000s |
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 memprof | |
def vmsize | |
IO.readlines("/proc/self/status").grep(/VmSize/)[0].scan(/\d+/)[0].to_i | |
end | |
GC.start | |
GC.disable | |
before = vmsize | |
begin | |
yield | |
after = vmsize |
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
.file "tmp.c" | |
.section .rodata | |
.LC0: | |
.string "hello world" | |
.text | |
.globl main | |
.type main, @function | |
main: | |
leal 4(%esp), %ecx | |
andl $-16, %esp |
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
/* | |
* ffsc - far faster scala compiler, omit booting time of fsc(1) | |
* | |
* Copyright (c) 2010 Tadashi Saito | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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 "decimal" | |
require "bigdecimal" | |
require "bigdecimal/math" | |
N = 100 | |
STEP = 10 | |
TRY = 10 | |
result = { | |
n: (0..N).map{|m|m * STEP}, |
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
sqrt | Decimal | BigDecimal | |
---|---|---|---|
0 | 0 | 0 | |
30 | 0.124887 | 0.028016 | |
60 | 0.168286 | 0.050961 | |
90 | 0.193021 | 0.089924 | |
120 | 0.244228 | 0.120451 | |
150 | 0.284446 | 0.152398 | |
180 | 0.328916 | 0.18304 | |
210 | 0.392945 | 0.316898 | |
240 | 0.460614 | 0.386293 |
OlderNewer