- Git
set up Github project (manual)
set timeout for credentials:
git config --global credential.helper 'cache --timeout 3600'
{"bn": {"population": "408786", "region": "Asia", "id": "bn", "name": "Brunei Darussalam", "sub-region": "South-Eastern Asia", "latitude": "4.5", "longitude": "114.666666667", "code": "bn"}, "us": {"population": "313847465", "region": "Americas", "id": "us", "name": "United States", "sub-region": "Northern America", "latitude": "38", "longitude": "-97", "code": "us"}, "cx": {"population": "1496", "region": "", "id": "cx", "name": "Christmas Island", "sub-region": "", "latitude": "-10.5", "longitude": "105.666666667", "code": "cx"}, "li": {"population": "36713", "region": "Europe", "id": "li", "name": "Liechtenstein", "sub-region": "Western Europe", "latitude": "47.2666666667", "longitude": "9.5333333333", "code": "li"}, "la": {"population": "6586266", "region": "Asia", "id": "la", "name": "Lao People's Democratic Republic", "sub-region": "South-Eastern Asia", "latitude": "18", "longitude": "105", "code": "la"}, "pn": {"population": "48", "region": "Oceania", "id": "pn", "name": "Pitcairn", "sub-region": "Poly |
voter_id,wpca:d1,wpca:d2,name,election_id,group_id,group_name,group_abbreviation,constituency_id,order,color,r,opacity,, | |
psp_cssd,-0.7482418632,0.1293113595,ČSSD,psp,,,,,20,orange,0,0.666,0.3197655391,0.4796483087 | |
psp_ano,-0.3168710812,-0.1035360405,ANO,psp,,,,,9,#5f91b3,0,0.666,0.3053686297,0.4580529446 | |
psp_komunisticka-strana-cech-a-moravy,-0.6762161289,-0.4038085269,Komunistická strana Čech a Moravy,psp,,,,,16,red,0,0.666,0.2730384588,0.4095576882 | |
psp_top-09,0.4525589665,0.4395515933,TOP 09,psp,,,,,14,#660066,0,0.666,0.2448468909,0.3672703364 | |
psp_obcanska-demokraticka-strana-ods,0.7943568572,0.4107967282,Občanská demokratická strana ( ODS),psp,,,,,24,darkblue,0,0.666,0.196468827,0.2947032405 | |
psp_hnuti-usvit-prime-demokracie,0.1896480016,0.0414619953,Hnutí Úsvit Přímé demokracie ,psp,,,,,12,#91b82e,0,0.666,0.1854723699,0.2782085549 | |
psp_kdu-csl,-0.1381217784,0.6723076386,KDU-ČSL,psp,,,,,22,yellow,0,0.666,0.1841195264,0.2761792896 | |
psp_strana-zelenych,-0.7184183123,0.0558486474,Strana zelených,psp,,,,,25,green |
voter_id,wpca:d1,wpca:d2,name,election_id,group_id,group_name,group_abbreviation,constituency_id,order,color,r,opacity, | |
psp_ano,-0.0523439325,0.3715837072,ANO,psp,,,,,9,#5f91b3,0.3053686297,0.666, | |
psp_ceska-piratska-strana,-0.016287859,-0.0441250516,Česká pirátská strana,psp,,,,,21,black,0.1153256259,0.666, | |
psp_cssd,-0.6092475635,0.3240720346,ČSSD,psp,,,,,20,orange,0.3197655391,0.666, | |
psp_delnicka-strana-socialni-spravedlnosti,-0.4591533055,-0.6678080767,Dělnická strana sociální spravedlnosti,psp,,,,,15,brown,0.0655743852,0.666, | |
psp_hlavu-vzhuru,0.4929988828,-0.5072355212,HLAVU VZHŮRU,psp,,,,,18,#330033,0.0458257569,0.666, | |
psp_hnuti-usvit-prime-demokracie,0.1122972763,0.0898520107,Hnutí Úsvit Přímé demokracie ,psp,,,,,12,#91b82e,0.1854723699,0.666, | |
psp_kdu-csl,0.0139165345,0.4504821736,KDU-ČSL,psp,,,,,22,yellow,0.1841195264,0.666, | |
psp_klub-angazovanych-nestraniku,0.3607541507,0.3865431126,Klub angažovaných nestraníků,psp,,,,,29,#006666,0.0070710678,0.666, | |
psp_komunisticka-strana-cech-a-moravy,-0.5778337139,0. |
// calculates exact binomial confidence intervals (4 decimal digits) | |
// http://statpages.org/confint.html | |
function CalcBinL(x,N,vTL,vTU) { | |
vTL = typeof vTL !== 'undefined' ? vTL : 0.05; | |
vTU = typeof vTU !== 'undefined' ? vTU : 0.05; | |
var vx = x | |
var vN = N | |
var vP = vx/vN | |
P= vP |
<!DOCTYPE html> | |
<html lang="cs"> | |
<head> | |
<meta charset="utf-8"> | |
<title>W-PCA Scatterplot Chart</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content="WPCA scatter plot"> | |
<meta name="author" content="Michal Škop"> | |
<script src="http://d3js.org/d3.v3.min.js"></script> |
/* requires D3 + https://github.com/Caged/d3-tip */ | |
d3.scatterplot = function() { | |
function scatterplot(selection) { | |
selection.each(function(d, i) { | |
//options | |
var data = (typeof(data) === "function" ? data(d) : d.data), | |
margin = (typeof(margin) === "function" ? margin(d) : d.margin), | |
axes = (typeof(axes) === "function" ? axes(d) : d.axes), | |
minmax = (typeof(minmax) === "function" ? minmax(d) : d.minmax), | |
size = (typeof(size) === "function" ? size(d) : d.size), |
#!/bin/bash | |
cd /home/michal/project/gist/ba56b4f6c4df364f9a47 | |
git add -A | |
git commit -m "update" | |
# needed to be authentized | |
# using git config --global credential.helper 'cache --timeout 3600' | |
# also good for security | |
git push | |
d3.hemicycle = function() { | |
function hemicycle(selection) { | |
selection.each(function(d, i) { | |
// options | |
var nvar = (typeof(n) === "function" ? n(d) : n), | |
gapvar = (typeof(gap) === "function" ? gap(d) : gap), | |
widthIconvar = (typeof(widthIcon) === "function" ? widthIcon(d) : widthIcon), | |
widthvar = (typeof(width) === "function" ? width(d) : width); | |
peoplevar = (typeof(people) === "function" ? people(d) : people); | |
polling_station | estate_center | Kotleba_town | voters | |
---|---|---|---|---|
Banská Bystrica 1 | center | 0.9363227455 | 723 | |
Banská Bystrica 10 | center | 0.9345041615 | 869 | |
Banská Bystrica 11 | center | 0.8915515804 | 989 | |
Banská Bystrica 2 | center | 0.7726935278 | 622 | |
Banská Bystrica 3 | center | 0.7982934046 | 883 | |
Banská Bystrica 4 | center | 0.8874238787 | 615 | |
Banská Bystrica 5 | center | 0.8826339854 | 945 | |
Banská Bystrica 6 | center | 0.836829767 | 1714 | |
Banská Bystrica 7 | center | 0.8729690722 | 603 |