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
package main | |
import ( | |
"math" | |
"code.google.com/p/go-tour/pic" | |
) | |
func Pic(dx, dy int) [][]uint8 { | |
result := make([][]uint8, dx) | |
for x := 0; x < dx; x++ { |
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
package main | |
import "fmt" | |
type Key struct { | |
Name string | |
} | |
type Vertex struct { | |
Lat, Long float64 |
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
package main | |
import "fmt" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
now, next := 1, 0 | |
return func() int { | |
new_now, new_next := next, now+next |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
type ErrNegativeSqrt float64 | |
func (e ErrNegativeSqrt) Error() string { |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func putChannel(c chan int, count int) { | |
for i := 0; i < count; i++ { | |
c <- i |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. |
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
package snippet; | |
import java.io.FileOutputStream; | |
import java.util.List; | |
import org.apache.poi.ss.usermodel.CellStyle; | |
import org.apache.poi.ss.usermodel.IndexedColors; | |
import org.apache.poi.xssf.usermodel.XSSFCell; | |
import org.apache.poi.xssf.usermodel.XSSFCellStyle; | |
import org.apache.poi.xssf.usermodel.XSSFFont; |
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
public abstract class Parent { | |
public abstract Number someMethod(); | |
} | |
public class Child extends Parent { | |
@Override | |
@Sample | |
public Integer someMethod() { | |
return 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
import java.time.OffsetDateTime; | |
import java.time.format.DateTimeFormatter; | |
public class 日本人 { | |
protected final String name; | |
protected final OffsetDateTime birthdate; | |
public 日本人(String name, String birthdate) { | |
this.name = name; | |
// 2011-12-03T00:00:00+09:00 |
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
``` | |
irb(main):001:0> def hoge(a=1, b, c=3) a+b+c end | |
SyntaxError: (irb):1: syntax error, unexpected '=', expecting ')' | |
def hoge(a=1, b, c=3) a+b+c end | |
^ | |
from /Users/shinichi/.rbenv/versions/2.2.3/bin/irb:11:in `<main>' | |
irb(main):002:0> def hoge(b, a=1, c=3) a+b+c end | |
=> :hoge | |
irb(main):003:0> hoge 100 | |
=> 104 |
OlderNewer