View aveprime.rb
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"
View curious.rb
(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
View a.rb
# 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
View 1.txt
43 math
37 IT
34 science
30 tech
29 数学
27 famous
25 My
23 engineer
20 it
17 twizard-magic-list
View FameList.js
/*
* 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.
View upftp.pl
#!/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;
View error.txt
[ 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
View phi.rb
require 'prime'
def φ(n)
if n == 1
return 1
end
Prime.each(n-1) do |p|
if n % p == 0
b = n
j = 0
View error.txt
$ docker-compose pull
$ docker-compose build
$ docker-compose run --rm web rails db:migrate
$ docker-compose run --rm web rails mastodon:maintenance:prepare_for_foreign_keys
$ docker-compose run --rm web rails db:migrate
$ docker-compose run --rm web rails assets:precompile
Creating mastodon user (UID : 1000 and GID : 1000)...
Updating permissions...
Executing process...
yarn install v0.24.5
View TipmonaTipBookmarklet.js
/*
* TipmonaTipBookmarklet.js
*
* When you see
* https://twitter.com/EXAMPLEUSER/...
* Then you jump to
* https://twitter.com/intent/tweet?text=@tipmona%20tip%20@EXAMPLEUSER%201%20Mona%20を贈ります。
* And when you see
* https://twitter.com/EXAMPLEUSER/status/xxxxxxxx
* Then you jump to