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
shared = rand(16) | |
bisort(shared) = begin | |
NUM = UInt(length(shared)) | |
k = UInt(2) | |
while (k <= NUM) | |
j = div(k,2) | |
while(j >=1) | |
for tid in UInt(0):UInt(NUM-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
library(rayshader) | |
library(av) | |
elmat1 = matrix(0, 500, 500) | |
elmat1[200:400, 200:400] = 971.0 | |
sunangle = 33 | |
for(sunangle in 140:360) { | |
elmat1 %>% | |
sphere_shade %>% | |
add_shadow(ray_shade(elmat1,zscale=3,maxsearch = 300, sunangle = sunangle),0.5) %>% |
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(rayshader) | |
library(av) | |
library(future) | |
plan(multiprocess) | |
# set up an elevation matrix with a wall around the outside and a gap on each of | |
# the walls. | |
elmat1 = matrix(0, 500, 500) | |
elmat1[1:100, 1:200] = 3000 |
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
using JDF | |
using CSV, DataFrames | |
using Serialization:serialize,deserialize | |
using BufferedStreams | |
@time a = CSV.read("C:/Users/ZJ.DAI/Documents/git/format-wars/data/Performance_2016Q4.txt", delim = '|', header = false); | |
io = BufferedOutputStream(open("c:/data/bin.bin","w")) | |
@time serialize(io, a) | |
close(io) |
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
using CSV, Feather, JLD2, JLSO, JDF, FileIO, Blosc, StatsPlots | |
using DataFrames, WeakRefStrings # required for JLD2, JDF | |
Blosc.set_num_threads(6) | |
gen_benchmark(dirpath, largest_file, outpath, data_label; delim = ',', header=true) = begin | |
if !isdir(outpath) | |
mkpath(outpath) | |
end |
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
using CSV, Feather | |
#using JLD2 | |
#using JLD#, JLSO | |
using JDF, FileIO, Blosc, StatsPlots, RCall | |
using DataFrames, WeakRefStrings # required for JLD2, JDF | |
Blosc.set_num_threads(6) | |
gen_benchmark(dirpath, largest_file, outpath, data_label; delim = ',', header=true) = begin | |
if !isdir(outpath) | |
mkpath(outpath) |
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(data.table) | |
library(disk.frame) | |
setup_disk.frame() | |
bench_disk.frame_data.table_group_by <- function(data1,n) { | |
setDT(data1) | |
a.sharded.df = as.disk.frame(data1, shardby = c("year", "month", "day")) | |
a.not_sharded.df = as.disk.frame(data1) | |
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
apt-get update && apt-get upgrade -y | |
apt-get install wget -y | |
apt-get install proot -y | |
apt-get install git -y | |
cd ~ | |
git clone https://github.com/MFDGaming/ubuntu-in-termux.git | |
cd ubuntu-in-termux | |
chmod +x ubuntu.sh | |
./ubuntu.sh | |
cp ~/ubuntu-in-termux/resolv.conf ~/ubuntu-in-termux/ubuntu-fs/etc/ |
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
FROM python:3.7-alpine3.10 | |
RUN apk add --no-cache \ | |
build-base \ | |
cmake \ | |
bash \ | |
boost-dev \ | |
autoconf \ | |
zlib-dev \ | |
flex \ |
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
using DataFrames | |
df1 = DataFrame(a = repeat([1], 100), b = "a") | |
df2 = DataFrame(a = repeat([2], 100), b = "b") | |
B = Array{Bool, 2}(undef, 100, 2) | |
df1[B] # doesn't work | |
# Let's overload get index get index |