Skip to content

Instantly share code, notes, and snippets.

@zonoise
zonoise / output.txt
Last active November 15, 2017 02:17
所得税計算してみる。
package com.company;
public class Main {
public static void main(String[] args) {
System.out.printf("%s\t%s\t%s\t%s\t%s\n", "給与所得", "課税所得", "所得税","所得税率","最終的な税率");
for (int i = 1; i < 1000; i += 1) {
double 給与所得 = i * 10000;
object Main {
def main(args: Array[String]): Unit = {
printAreas(2.0,2.0,2.0)
printAreas(2,2,2)
//val t = hoge(46,39,6)
val t = hoge(3,1,3)
println(t)
@zonoise
zonoise / 44.go
Last active August 29, 2015 14:16
go-tour
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
before := 0
before_before := 0
n := 0
@zonoise
zonoise / gist:5588012
Created May 15, 2013 22:41
lifegame coffee
class Matrix
constructor:(@x,@y)->
init_data = false
for y in [0..@y-1]
@data.push(( init_data for i in [0..@x-1]))
data: []
set:(x,y,value)->
if @exist(x,y)
@zonoise
zonoise / add__slots__.py
Created March 27, 2012 22:11
Python study about class
class HpError(Exception):
pass
class Employee(object):
__slots__ = ['__name','__hp']
def __init__(self,name,hp):
self.__name=name
self.__hp=hp
def work(self,time):
@zonoise
zonoise / gist:2018231
Created March 11, 2012 21:15
Haskell FizzBuzz
fizzBuzz :: Int -> String
fizzBuzz a
| 0 == (mod a 3) && 0 == (mod a 5) = "FizzBuzz"
| 0 == (mod a 3) = "Fizz"
| 0 == (mod a 5) = "Buzz"
| otherwise = show a
main = putStrLn(show(map fizzBuzz [1..100]))
sudo cp ~/tmp/src/redis-server /usr/local/bin
sudo cp ~/tmp/src/redis-cli /usr/local/bin
sudo mkdir /etc/redis
sudo mkdir /var/redis
sudo mkdir /var/redis/6379
起動スクリプトのコピー
@zonoise
zonoise / rubyをcheckinstallしたときのログ抜粋
Created February 15, 2012 13:25
procesure for ruby on rails on nginx on ubuntu using passenger

Variables

  • USERNAME
  • PASSWORD
  • SSHPORT

USER

locale

SSH

@zonoise
zonoise / gist:1721059
Created February 2, 2012 02:38
twitter list members to Redis
def get_lists(key,screen_name,list_slug)
redis = Redis.new
#max listmember 500 and per request 20 member
if 25 >= Twitter.rate_limit_status.remaining_hits
return false
end
next_cursor='-1'
@zonoise
zonoise / gist:1670826
Created January 24, 2012 15:58
ubuntu-vm-builder error log
user0@ML110:~/vm$ sudo ubuntu-vm-builder kvm oneiric --domain vm10 --dest vm10 --arch i386 --hostname vm10 --mem 512 --user username --pass password --ip 192.168.1.101 --mask 255.255.255.0 --net 192.168.1.0 --bcast 192.168.1.255 --gw 192.168.1.1 --dns 192.168.1.1 --mirror http://jp.archive.ubuntu.com/ubuntu --components main,universe \ --debug
2012-01-25 00:35:26,124 INFO : Calling hook: preflight_check
2012-01-25 00:35:26,127 INFO : Calling hook: set_defaults
2012-01-25 00:35:26,128 INFO : Calling hook: bootstrap
2012-01-25 00:39:52,363 INFO : Calling hook: configure_os
2012-01-25 00:40:09,253 INFO :
2012-01-25 00:40:09,254 INFO : Current default time zone: 'Etc/UTC'
2012-01-25 00:40:09,258 INFO : Local time is now: Tue Jan 24 15:40:09 UTC 2012.
2012-01-25 00:40:09,259 INFO : Universal Time is now: Tue Jan 24 15:40:09 UTC 2012.
2012-01-25 00:40:09,259 INFO :