Skip to content

Instantly share code, notes, and snippets.

# Download and set Chicago95 theme and background for XFCE
cd ~
mkdir -p ~/.themes
mkdir -p ~/.icons
wget https://github.com/grassmunk/Chicago95/archive/5670fde8ce33b33d37622b888278aa9cdbe5eea2.zip
unzip 5670fde8ce33b33d37622b888278aa9cdbe5eea2.zip
cd Chicago95-5670fde8ce33b33d37622b888278aa9cdbe5eea2
cp -r Theme/Chicago95 ~/.themes
cp -r Icons/* ~/.icons
cd ..

robots.json - machine learning access control proposal

Introduction

Similar to the way the file robots.txt controls the scraping of pages on a web server, the file robots.json in a source code repository should control whether machine learning algorithms are allowed to process and exploit the source code.

Examples

For example:

@dvolk
dvolk / day-2.py
Last active December 1, 2021 14:42
import itertools
def slide(xs, k=2):
xs = list(xs)
for i in range(len(xs) - k + 1):
yield xs[i : i + k]
print(
#0 __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:499
#1 0x00005555562638df in std::__copy_move<true, true, std::random_access_iterator_tag>::__copy_m<string_id<effect_on_condition> > (
__result=0x55557cc4e090, __last=0x55557cc4e070, __first=<optimized out>) at /usr/include/c++/9/bits/stl_algobase.h:393
#2 std::__copy_move_a<true, string_id<effect_on_condition>*, string_id<effect_on_condition>*> (__result=0x55557cc4e090, __last=0x55557cc4e070,
__first=<optimized out>) at /usr/include/c++/9/bits/stl_algobase.h:404
#3 std::__copy_move_a2<true, __gnu_cxx::__normal_iterator<string_id<effect_on_condition>*, std::vector<string_id<effect_on_condition>, std::allocator<string_id<effect_on_condition> > > >, __gnu_cxx::__normal_iterator<string_id<effect_on_condition>*, std::vector<string_id<effect_on_condition>, std::allocator<string_id<effect_on_condition> > > > > (__result=..., __last=..., __first=...) at /usr/include/c++/9/bits/stl_algobase.h:440
#4 std::move
==4917== Use of uninitialised value of size 8
==4917== at 0x10A017: isSmallChunk__2Ih49c9ai3KYJhUe3C8xg07w_2system (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x10A2E3: interiorAllocatedPtr__NuzKjA4SX9afyji9cHHIuKpQ (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x10F9F7: gcMark__x5SbLN3uVBCsEa67N20nPwsystem (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x10FC60: markStackAndRegisters__U6T7JWtDLrWhtmhXSoy9a6g (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x112600: collectCTBody__XHio9cMpnLoH7GyCj1Z9besg_2 (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x1127FB: collectCT__XHio9cMpnLoH7GyCj1Z9besg (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x112BDB: rawNewObj__ehkAaLROrd0Hc9aLROWt1nQ (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x11323C: newObj (in /home/dv/src/cwmin/src/fasta)
==4917== by 0x1132D6: rawNewString (in /home/dv/src/cwmin/src/fasta)
import sys,pathlib
p = pathlib.Path(sys.argv[1])
while True:
last = p
if p.is_dir():
sys.stdout.write(str(p))
sys.exit(0)
p = p.parent
/*
Some parts adapted from
http://www.redblobgames.com/pathfinding/a-star/implementation.html
*/
#include <array>
#include <random>
#include <algorithm>
#include <iostream>
#include <queue>
import math
proc sign(x : float64) : float64 =
if x > 0:
1
else:
-1
proc fresnel*(x : var float64) : auto =
## calculates the normalized fresnel integrals C(x) and S(x)
@dvolk
dvolk / nbody.jl
Last active August 29, 2015 14:11
julia nbody
# This is a translation of the C nbody benchmark from
# The Computer Language Benchmarks Game
type Body
x :: Float64
y :: Float64
z :: Float64
vx :: Float64
vy :: Float64
vz :: Float64