Skip to content

Instantly share code, notes, and snippets.

diff -r 414057ac1f1f src/pkg/encoding/json/bench_test.go
--- a/src/pkg/encoding/json/bench_test.go Tue Aug 13 15:33:06 2013 +1000
+++ b/src/pkg/encoding/json/bench_test.go Sun Oct 13 00:17:22 2013 -0500
@@ -24,6 +24,10 @@
}
type codeNode struct {
+ codeNodeData
+}
+
diff -r a10c7a350ab5 src/cmd/cgo/gcc.go
--- a/src/cmd/cgo/gcc.go Sat Oct 12 18:40:41 2013 -0400
+++ b/src/cmd/cgo/gcc.go Mon Oct 14 02:12:48 2013 -0500
@@ -306,7 +306,7 @@
b.WriteString("void __cgo__f__(void) {\n")
b.WriteString("#line 1 \"cgo-test\"\n")
for i, n := range toSniff {
- fmt.Fprintf(&b, "%s; /* #%d */\nenum { _cgo_enum_%d = %s }; /* #%d */\n", n.C, i, i, n.C, i)
+ fmt.Fprintf(&b, "(%s); /* #%d */\nenum { _cgo_enum_%d = %s }; /* #%d */\n", n.C, i, i, n.C, i)
}
$ cat main.c
int main() {
(int);
return 0;
}
$ gcc main.c
main.c: In function ‘main’:
main.c:2: error: expected expression before ‘;’ token
$ clang -E -dM -xc -m64 - <<EOF
#line 3 "/Users/jamesgray/proj/term4k/wat/main.go"
void hrrr() {}
#define hrr hrrr
#define saywat hrr
#include <sys/types.h> /* for size_t below */
/* Define intgo when compiling with GCC. */
@james4k
james4k / test.go
Created October 23, 2013 17:36 — forked from tobstarr/test.go
package main
import (
"log"
"net/http"
"os"
"os/exec"
)
func main() {
steamcharts=# \d game_players
Table "public.game_players"
Column | Type | Modifiers
--------+--------------------------+---------------
appid | integer |
time | timestamp with time zone | default now()
count | integer |
Indexes:
"game_players_appid_idx" btree (appid)
"game_players_time_idx" btree ("time")
$ go test -race
# testmain
/var/folders/zw/9s6rndqs0qlc14d2kc_7tzdr0000gn/T/go-build602341821/j4k.co/exp/ui/scene/_test/_testmain.go:5: can't find import: "regexp"
@james4k
james4k / gist:4f3f97ebba58f727431b
Created June 6, 2014 00:26
linear regression on indie category
appid | name | slope | r2 | avg
--------+--------------------------------------------+-----------------------+-------------------+-------
221100 | DayZ | 0.0235230851097337 | 0.594449210235611 | 23093
4000 | Garry's Mod | 0.0216288958385452 | 0.8851965472592 | 28318
244850 | Space Engineers | 0.0102046830613906 | 0.646990825365276 | 4660
227300 | Euro Truck Simulator 2 | 0.00281036914838749 | 0.640144683695447 | 3391
244210 | Assetto Corsa | 0.00107091769217915 | 0.636646652098627 | 599
222880 | Insurgency | 0.000865743829271579 | 0.504934577687369 | 1184
223390 | Forge | 0.000842197454027153 | 0.587123225005886 | 927
230230 | Divinity Original Sin | 0.000284991370317435
@james4k
james4k / gist:0ca3cc71be86e09d799d
Last active August 29, 2015 14:02
peak concurrent players of free to play games
appid | name | peak | avgmonthlypeak
--------+-------------------------------------------------------------+--------+----------------
570 | Dota 2 | 843024 | 445037
440 | Team Fortress 2 | 117917 | 80091
238960 | Path of Exile | 34371 | 17599
218230 | PlanetSide 2 | 29449 | 10819
208090 | Loadout | 29424 | 4794
230410 | Warframe | 26848 | 16999
236390 | War Thunder | 26228 | 11848
243870 | Tom Clancy's Ghost Recon Phantoms - NA | 21679 | 7252
@james4k
james4k / gist:ecab13c32dee8149e567
Created June 6, 2014 18:51
linear regression on indie category w/o r2 constraint
appid | name | slope | r2 | avg
--------+-------------------------------------------------------------+-----------------------+----------------------+-------
221100 | DayZ | 0.0234480534248668 | 0.592159361502954 | 23093
4000 | Garry's Mod | 0.0215832431644035 | 0.883818454084834 | 28318
244850 | Space Engineers | 0.0102031501830021 | 0.646860944517838 | 4660
105600 | Terraria | 0.0083959098260543 | 0.114798916115606 | 41057
242920 | Banished | 0.00784941120625064 | 0.182961120318323 | 5875
208090 | Loadout | 0.00699533711903867 | 0.12655549373197 | 13612
227300 | Euro Truck S