Skip to content

Instantly share code, notes, and snippets.

@o314
o314 / README.md
Created February 18, 2018 19:02 — forked from nitaku/README.md
Isometric "treemap"

A treemap algorithm is used to area-encode an array of random values, while an isometric projection is used to length-encode a second random value. Occlusion is extremely limited by the ordering of the treemap algorithm, making the diagram fairly readable (compare with a bar chart example that does not exhibit this property). This is possible because parallelepipedons are drawn by following the same ordering used by the treemap (to be honest, we tried and succedeed in using this method, but we are not aware of the internals of the treemap ordering algorithm that makes this possible).

An interaction tecnique is also put into place to let users focus on specific parallelepipedons by making the other ones translucent. This can be used to better evaluate their height. Because there are no fully occluded parallelepipedons, there is always a way to select a specific one.

Implementation note: we formerly used z as the name for the z axis, but this conflicted with

@o314
o314 / README.md
Created February 18, 2018 19:03 — forked from nitaku/README.md
Isometric treemap (flare)

A first attempt at making a real isometric treemap. Unlike previous attempts, this experiment uses the treemap layout to actually represent a tree (in this example, the flare package hierarchy).

Treemaps are very good to show hierarchies in a compact way, and excel in the case of attributed hierarchies with a quantitative attribute (a classical example would be a file system hierarchy, in which size is given by the number of bytes of each file). However, they are not very good in representing internal nodes, parent-child relations and depth.

Nested treemaps introduce some padding between a parent and its children to better represent this aspect, losing accuracy in area encoding. Despite this improvement, hierarchy depth is still not represented.

An isometric treemap loses some clarity and compactness to introduce an intuitive representation of de

@o314
o314 / stdlib-deps-dot.jl
Created December 6, 2018 16:04 — forked from rschwarz/stdlib-deps-dot.jl
Write dependencies in Julia's stdlib using DOT format
import Pkg
import Pkg.TOML
const STDLIB_DIR = "/home/rs/opt/julia-1.0.2/share/julia/stdlib/v1.0"
const STDLIBS = readdir(STDLIB_DIR)
println("digraph stdlib {")
for (i, stdlib) in enumerate(STDLIBS)
proj = Pkg.TOML.parsefile(joinpath(STDLIB_DIR, stdlib, "Project.toml"))
@o314
o314 / clean_code.md
Created August 23, 2019 02:29 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@o314
o314 / readme.md
Created April 8, 2020 17:30
Diagram of how-i-would-like-to-write-golang
@o314
o314 / File1.bash
Created April 8, 2020 17:31
conf-unity-icons
# for unity gui
DST_BASE="/usr/share/icons/Humanity/mimes"
for mime in *; do
[ -e "$mime" ] || continue
[ -d "$mime" ] || continue
echo "conf mime-type ${mime}"
for size in ${mime}/*.svg; do
@o314
o314 / juliacontribmontage.jl
Created October 14, 2020 05:55 — forked from jiahao/juliacontribmontage.jl
Creates a photo montage of Julia contributors using ImageMagick
#Working version
using JSON
auth_token= #fill in to access Github API
function getcontribs(owner, repo, auth_token)
#Download information about contributors
page, authors=0, {}
while true #Download every page
page += 1
url="https://api.github.com/repos/$owner/$repo/contributors?page=$(page)&access_token=$(auth_token)"
@o314
o314 / main.jl
Created February 10, 2021 12:05
last_kata.jl
#= -----------------------------------------------------------------------------
GREED (DICE GAME) KATA
--------------------------------------------------------------------------------
Write a class Greed with a score() method that accepts an array of die values
(up to 6). Scoring rules are as follows:
A single one (100)
A single five (50)
Triple ones [1,1,1] (1000)
## Some graph functions ##
using Iterators
using Combinatorics
using Base.LinAlg: checksquare
#=
X = sparse([1,1,2,2,3,4,4], [2,5,5,3,4,5,6], 1, 6, 6)
X += X'
G = dropzeros!(1 - X)
@o314
o314 / export_vsmeta_to_xml.sql
Created December 23, 2021 02:39 — forked from tohuuuuu/export_vsmeta_to_xml.sql
Export result of SQL Query to XML - Synology VideoStation metadata
CREATE TEMP TABLE "videodata_tmp" AS
SELECT
v.mapper_id as id,
'home'||v.mapper_id as uniqueid,
right(v.path, position('/' in reverse(v.path)) - 1) as filename,
v.path,
g2.genre,
h.title,
h.record_time,
s.summary