Skip to content

Instantly share code, notes, and snippets.

View aomoriringo's full-sized avatar
🏠
Working from home

aomoriringo aomoriringo

🏠
Working from home
View GitHub Profile
"""""""""""""""""""""
" general
"""""""""""""""""""""
set number
set tabstop=2
set laststatus=2
set t_Co=256
set expandtab
set noswapfile
@aomoriringo
aomoriringo / progress karaoke
Last active August 29, 2015 14:03
進捗カラオケ
switch(i%4):
case 0:
thinca
case 1:
kyubuns
case 2:
supermomonga
case 3:
aomoriringo
@aomoriringo
aomoriringo / result
Last active August 29, 2015 14:13
uzumaki
>>> from uzumaki import *
>>> [uzumaki(x) for x in range(20)]
[(0, 0), (1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1), (2, -1), (2, 0), (2, 1), (2, 2), (1, 2), (0, 2), (-1, 2), (-2, 2), (-2, 1), (-2, 0), (-2, -1)]
>>> uzumaki(1000000000)
(1683, -15811)
x27[32;01m * x27[39;49;00mPackage: dev-lang/R-3.1.2
x27[32;01m * x27[39;49;00mRepository: gentoo
x27[32;01m * x27[39;49;00mMaintainer: calchan@gentoo.org sci-mathematics@gentoo.org
x27[32;01m * x27[39;49;00mUSE: abi_x86_64 amd64 elibc_glibc kernel_linux nls openmp readline userland_GNU
x27[32;01m * x27[39;49;00mFEATURES: preserve-libs sandbox userpriv usersandbox
x27[32;01m*x27[0m Using following Fortran compiler:
x27[32;01m*x27[0m F77: x86_64-pc-linux-gnu-gfortran
x27[32;01m*x27[0m FC: x86_64-pc-linux-gnu-gfortran
x27[32;01m*x27[0m x86_64-pc-linux-gnu-gfortran has OPENMP support
>>> Unpacking source...
let s:name = 'World'
echo "\nHello" . s:name
function! Isdigit(str)
return match(a:str, '^[+-]\?\d\+$') != -1
endfunction
let g:bigint = {'num': [], 'sign': 1}
let g:nodeMaxDigit = 8
let g:bigint = {'num': [], 'sign': 1}
let g:nodeMaxDigit = 8
let g:nodeMaxNum = 100000000
function! Isdigit(str)
return match(a:str, '^[+-]\?\d\+$') != -1
endfunction
function! StringToBigint(str)
if Isdigit(a:str) != 1
@aomoriringo
aomoriringo / p003.vim
Last active August 29, 2015 14:18
Project Euler 003
reltime: 54.894354
source ./bigint.vim
function! Fib(n) abort
let [a,b,i] = [FromString("0"),FromString("1"),0]
while i < a:n
let [a,b,i] = [b,BigAdd(a,b),i+1]
endwhile
return ToString(a)
endfunction
@aomoriringo
aomoriringo / p003.vim
Last active August 29, 2015 14:19
Project Euler 3
" Require: https://github.com/vim-jp/vital.vim
let s:big = vital#of('vital').import('Data.BigNum')
function! P003()
let l:num = s:big.from_string("600851475143")
let l:primes = Factorize(l:num)
for i in l:primes
echo s:big.to_string(i)
endfor
endfunction
@aomoriringo
aomoriringo / pe001.hs
Created August 8, 2012 03:57
Project Euler Problem 0001 with Haskell
--http://projecteuler.net/problem=1
--If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
--Find the sum of all the multiples of 3 or 5 below 1000.
main = do
print $ sum [ x | x<-init[1..1000], x`mod`==0 || x`mod`5==0 ]