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
tables <- SQLQuery(" | |
select TABLE_NAME as table_name | |
from cs_reporting.information_schema.tables | |
where table_type = 'BASE TABLE'") | |
sizes <- rbindlist(lapply(tables$table_name, function(x) SQLQuery(paste0("sp_spaceused [", x, "]")))) | |
StripKB <- function(x) as.integer(str_replace_all(x, ' KB', '')) | |
sizes[, reserved := StripKB(reserved)] |
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
randomPoints[n_] := RandomSample[Block[{nn = Ceiling[Sqrt[n]]}, | |
Flatten[Table[{i, j}, {i, 1, nn}, {j, 1, nn}], 1]], n]; | |
(* n is number of moves = 2 * number of points *) | |
randomBoard[n_] := Module[ | |
{points = randomPoints[2 n]}, | |
Join[ | |
Take[points, n] /. {x_, y_} -> black[x, y], | |
Take[points, -n] /. {x_, y_} -> white[x, y] | |
]] |
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 ( | |
"bytes" | |
"fmt" | |
"log" | |
"net/mail" | |
enmime "github.com/jhillyerd/go.enmime" | |
) |
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 ( | |
"bytes" | |
"fmt" | |
"strings" | |
"code.google.com/p/go.net/html" | |
"code.google.com/p/go.net/html/atom" | |
) |
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
-988 = 1 - (989) | |
-960 = (1 - (9)) * ((8 - (sqrt(9)))!) | |
-881 = 1 - ((98) * (9)) | |
-873 = (1 - (98)) * (9) | |
-817 = 1 - (98) - (((sqrt(9))!)!) | |
-800 = 1 - ((9) * (89)) | |
-791 = 1 - ((9) * (8)) - (((sqrt(9))!)!) | |
-784 = (1 - (9)) * (8) - (((sqrt(9))!)!) | |
-743 = 1 - ((sqrt(9)) * (8)) - (((sqrt(9))!)!) | |
-736 = 1 - (9 + 8) - (((sqrt(9))!)!) |
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
-988 = 1 - (989) | |
-960 = (1 - (9)) * ((8 - (sqrt(9)))!) | |
-881 = 1 - ((98) * (9)) | |
-873 = (1 - (98)) * (9) | |
-839 = 1 - (((sqrt(9))!)! + (8 - (sqrt(9)))!) | |
-817 = 1 - (98) - (((sqrt(9))!)!) | |
-808 = 1 - (((sqrt(9))!)! + 89) | |
-800 = 1 - (sqrt(sqrt((9) ^ (8))) + ((sqrt(9))!)!) | |
-791 = 1 - ((9) * (8)) - (((sqrt(9))!)!) | |
-784 = (1 - (9)) * (8) - (((sqrt(9))!)!) |
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" | |
"os" | |
"strconv" | |
) | |
type Op int64 // Operators |
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
-990 [2] = -(1 + (989)) | |
-989 [2] = -((1) * (989)) | |
-988 [1] = 1 - (989) | |
-976 [5] = -((1 - (sqrt(9))) ^ (8) + (((sqrt(9))!)!)) | |
-960 [4] = (1 - (9)) * ((8 - (sqrt(9)))!) | |
-918 [4] = -(198) - (((sqrt(9))!)!) | |
-912 [5] = ((1 + (sqrt(9)))!) * (-(8)) - (((sqrt(9))!)!) | |
-900 [5] = (sqrt(sqrt((1 + (9)) ^ (8)))) * (-(9)) | |
-891 [2] = (1 + (98)) * (-(9)) | |
-890 [2] = (1 + (9)) * (-(89)) |
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" | |
"log" | |
"math" | |
"os" | |
"sort" | |
"strconv" | |
"strings" |
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
library(digest) | |
LoadRDataIfExists <- function(fn) { | |
# Calls _fn_ and caches the result on disk, unless the cache already exists | |
# | |
# _fn_ should be a function with signature _fn(filename, ...)_ | |
# If cache file exists and is recent, load data from it. | |
# Otherwise call the original function. | |
function (filename, ...) { | |
param.hash = digest(c(fn, list(...))) # Cache file names depends on params/fn def |
OlderNewer