ろーれむいぷさむ
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 | |
# cf. http://bit.ly/2raKfLZ | |
# makeopenapp - URLをオープンするだけのスクリプトをMacのアプリケーションにする | |
if ARGV.length != 2 | |
abort("Usage: makeopenapp URL Example.app") | |
end | |
url = ARGV[0] | |
appname = ARGV[1] |
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 'prime' | |
MAX = 10000_00000_00000 | |
n = Rational(0) | |
s = Rational(0) | |
Prime.each(MAX) do |p| | |
n += 1 | |
s += p | |
if (s/n).denominator == 1 | |
puts "f(#{n}) = #{s/n} : INTEGER" |
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
(1..9).each do |a| | |
(1..9).each do |b| | |
(1..9).each do |c| | |
x = (10 * a + b).to_r | |
y = (10 * b + c).to_r | |
# puts "a = #{a}, b = #{b}, c = #{c}, x = #{x}, y = #{y}" | |
if a != c and x / y == a.to_r / c.to_r | |
puts "\\frac{#{x.to_i}}{#{y.to_i}} = \\frac{#{a}}{#{c}}, " | |
end | |
end |
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人のうち1人が100点でN-1人が0点であるとき、100点の人の偏差値 | |
N = 15802 # 人数 | |
μ = 100.0 / N # 平均 | |
v = ((N-1) * (0-μ) ** 2 + 1 * (100-μ) ** 2) / N # 分散 | |
σ = Math.sqrt(v) # 標準偏差 | |
puts 50 + (100-μ) / σ * 10 # 100点の人の偏差値 | |
# => 1307.0202862324857 |
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
43 math | |
37 IT | |
34 science | |
30 tech | |
29 数学 | |
27 famous | |
25 My | |
23 engineer | |
20 it | |
17 twizard-magic-list |
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
/* | |
* FameList.js | |
* | |
* When you see | |
* https://twitter.com/EXAMPLEUSER/... | |
* Then you jump to | |
* https://twitter.com/EXAMPLEUSER/memberships | |
* | |
* Written by Hiroshi Yuki. | |
* Licensed under CC0. |
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/perl | |
# | |
# This is UpFtp, Version 1.3 | |
# Copyright (C) 2000,2003,2006,2017 by Hiroshi Yuki. | |
# http://www.hyuki.com/upftp/ | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the same terms as Perl itself. | |
# | |
use 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
[ 2017-07-02 23:34:03.2697 29259/7f7fb7fff700 age/Cor/CoreMain.cpp:588 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown) | |
[ 2017-07-02 23:34:03.2804 29259/7f7fca2e4880 age/Cor/CoreMain.cpp:999 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected... | |
[ 2017-07-02 23:34:03.2860 29269/7fd29ffff700 age/Ust/UstRouterMain.cpp:430 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown) | |
[ 2017-07-02 23:34:03.2867 29269/7fd2a9f35880 age/Ust/UstRouterMain.cpp:500 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected... | |
[ 2017-07-02 23:34:03.2877 29269/7fd29f7fe700 Ser/Server.h:862 ]: [UstRouterApiServer] Freed 0 spare client objects | |
[ 2017-07-02 23:34:03.2880 29269/7fd29f7fe700 Ser/Server.h:490 ]: [UstRouterApiServer] Shutdown finished | |
[ 2017-07-02 23:34:03.2878 29269/7fd29ffff700 Ser/Server.h:490 ]: [UstRouter] Shutdown finished | |
[ 2017-07-02 23:34:03.2855 29259/7f7fca2e |
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 'prime' | |
def φ(n) | |
if n == 1 | |
return 1 | |
end | |
Prime.each(n-1) do |p| | |
if n % p == 0 | |
b = n | |
j = 0 |
NewerOlder