Skip to content

Instantly share code, notes, and snippets.

@vsapsai
vsapsai / README.md
Last active August 29, 2015 13:56
All features.

Demonstrate all features present in ukraine_map_data/ukraine.json.

@vsapsai
vsapsai / README.md
Last active August 29, 2015 13:56
Highlight selected region.

Demonstrate how you can highlight a specific region. Note: regions' names are in Ukrainian.

@vsapsai
vsapsai / README.md
Last active August 29, 2015 13:57
Map with timeline.

Demonstrate how you can display on a map data that changes during some period of time.

Please, note that this example is not a reliable source of information about 2014 Ukrainian Regional State Administration occupations. I've tried to be correct, but I might have done a few mistakes. See data_explanation.md for more details.

@vsapsai
vsapsai / README.md
Last active August 29, 2015 13:57 — forked from vsapsai/README.md
Map with timeline and legend.

Demonstrate how you can display on a map data that changes during some period of time and how to create a legend.

Please, note that this example is not a reliable source of information about 2014 Ukrainian Regional State Administration occupations. I've tried to be correct, but I might have done a few mistakes. See data_explanation.md for more details.

@vsapsai
vsapsai / README.md
Created April 12, 2014 20:39
SVG path animations with D3.js.
@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 / 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 / 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 / gist:7290949
Created November 3, 2013 14:42
Explanation of thought process for transitive_desired_includes.patch in IWYU issue #105. It was fun to write explanation like a dialog and I don't want to loose this text (thought it's useless).
Thought process was the following:
- How do we know that we don't need to #include <string> in sub.h, sub.cc?
- Well, sub.h won't compile without #include "base.h" and base.h requires <string>.
- But how can we tell that base.h requires <string>?
- The same way we decide that <string> is a desired include for sub.h, sub.cc. There is a full use of symbol std::string in sub.h, sub.cc, and <string> provides symbol std::string. So you need just to check if there are full uses, forward-declaration uses in base.h (and all other included headers).
- ...(awkward silence)
- Also, have you noticed that usage of std::string in base.cc doesn't trigger recommendation to #include <string> in base.cc?
- Yeah, <string> is accessible in base.cc via base.h, it's an associated include. So no need to #include <string> both in base.h and base.cc.
@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