$ javac Main.java
$ time java Main
java Main 5.91s user 0.29s system 102% cpu 6.053 total
$ go build -o main
$ time ./main
./main 33.44s user 3.35s system 117% cpu 31.391 total
View ColorScene.js
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
var ColorScene = cc.Scene.extend({ | |
ctor: function(color) { | |
cc.Scene.prototype.ctor.call(this); | |
this.layerColor = color; | |
}, | |
onEnter:function () { | |
var color = this.layerColor; | |
var ColorLayer = cc.Layer.extend({ | |
init:function () { | |
this._super(); |
View Main.java
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.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
try (Scanner s = new Scanner(System.in)) { | |
for (int t = 1, T = s.nextInt(); t <= T; ++t) { | |
int shynessLevelMax = s.nextInt(); | |
String line = s.next(); | |
int additionalFriends = 0; | |
for (int shynessLevel = 0, standingSum = 0; shynessLevel <= shynessLevelMax; ++shynessLevel) { |
View 0README.md
View init.sql
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
CREATE TABLE follow ( | |
follow_from INT(11) NOT NULL, | |
follow_to INT(11) NOT NULL, | |
); | |
CREATE INDEX follow_from_to_idx ON follow (follow_from, follow_to); | |
CREATE TABLE tweet ( | |
id INT(11) NOT NULL AUTO_INCREMENT, | |
user_id INT(11) NOT NULL, |
View tweet.go
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" | |
"strings" | |
) | |
func main() { | |
for m := 0; m < 1000; m++ { | |
fmt.Println("INSERT INTO tweet (`user_id`, `tweet`) VALUES") |
View follow.go
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/rand" | |
"strings" | |
) | |
type Member struct { | |
Id int |
View main.go
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 ( | |
"runtime" | |
) | |
func init() { | |
runtime.GOMAXPROCS(runtime.NumCPU()) | |
} |
View Main.java
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.util.Map; | |
import java.util.HashMap; | |
class Main { | |
public static void main(String[] args){ | |
for (int i = 0; i < 10000; i++) { | |
Map<Integer, Integer> m = new HashMap<Integer, Integer>(); | |
for (int j = 0; j < 10000; j++) { | |
if (!m.containsKey(j)) { | |
m.put(j, i); |
View main.go
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 ( | |
"bufio" | |
"flag" | |
"fmt" | |
"github.com/golang/glog" | |
"io" | |
"log" | |
"os" |
View main.go
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 ( | |
"log" | |
"runtime" | |
"sync" | |
"time" | |
) | |
func f(x int) int64 { |
NewerOlder