Skip to content

Instantly share code, notes, and snippets.

@vsapsai
vsapsai / .block
Last active May 14, 2017 22:35
Income distribution in Canada per province for tax year 2014
license: gpl-3.0
height: 2200
@vsapsai
vsapsai / .block
Last active May 7, 2017 21:07
Income distribution in Canada
license: gpl-3.0
Red nails. They promise danger
To any reckless stranger.
So innocent and lovely,
So exquisite and shiny.
Don't let the beauty fool you,
Make miss a thing or two.
Those nails are also sharp,
Won't fail to draw some blood.
Skin scratches don't matter
It's heart that aches instead.
@vsapsai
vsapsai / const_ptr.h
Last active January 22, 2017 07:16
Test case for include-what-you-use issue #384: Build fails after Clang r289250
template<typename T> class I1_const_ptr {
public:
explicit I1_const_ptr(const T* ptr) : ptr_(ptr) { }
// ~I1_const_ptr() { delete ptr_; }
const T& operator*() { return *ptr_; }
const T* operator->() { return ptr_; }
int operator~() { return deref_a(); }
void del() { delete (((ptr_))); }
void indirect_del() { del(); }
int deref_a() { return (*ptr_)->a(); }
@vsapsai
vsapsai / .block
Last active April 12, 2018 05:51
Isometric Layer Composition
license: mit
@vsapsai
vsapsai / README.md
Last active January 6, 2016 17:32
Dancing Percentage Streamgraph

Percentage streamgraphs are nice to show how percentage changes over time. But it is hard to notice nuanced trends for anything but the lowest layer. The idea to fix this is to allow to change what layer has even bottom. Click on graph or legend to see how it works.

As it turned out, this idea isn't new. Alan Dix has described this solution for histograms, you can find more information at http://www.meandeviation.com/dancing-histograms/

The problem

A stacked histogram allows three judgements: (i) the trends on the total height of the columns, (ii) the proportion of each category within each column and (iii) the trends in the lowest category. The trends, or even inter-column comparisons for any other category is very difficult as the blocks are at different heights.

The interactive stacked histogram solves this problem by allowing different trends to be analysed using the same dynamic graph. It is an example of a general princple of adding inter

@vsapsai
vsapsai / iwyu.cc.with.try.gcov
Created February 10, 2015 01:47
Check which code parts are exercised by try-catch blocks.
-: 0:Source:/Users/vsapsay/Projects/OpenSource/llvm/llvm/tools/clang/tools/include-what-you-use/iwyu.cc
-: 0:Graph:iwyu.gcno
-: 0:Data:iwyu.gcda
-: 0:Runs:1
-: 0:Programs:1
-: 1://===--- iwyu.cc - main logic and driver for include-what-you-use ---------===//
-: 2://
-: 3:// The LLVM Compiler Infrastructure
-: 4://
-: 5:// This file is distributed under the University of Illinois Open Source
@vsapsai
vsapsai / extern_template.cc
Created May 5, 2014 13:32
"extern template" test case.
// extern_template.h, .cc don't correspond to interface/implementation pattern.
// They have the same name so that IWYU prints recommendations for both files.
#include "extern_template.h"
#include "indirect.h"
class IndirectClass;
void foo() {
ExternTemplateClass<IndirectClass> et;
@vsapsai
vsapsai / README.txt
Last active August 29, 2015 14:00
Description to change later
Steps to reproduce:
1. Create gist with non-empty description.
2. Add binary file to the gist.
3. Try to change description.
@vsapsai
vsapsai / README.md
Last active October 23, 2019 22:13 — forked from mbostock/.block
Kyiv Metro digital clock.

Digital clock like in Kyiv Metro, 1970s style. Reference image is provided by Metro Museum.