henry_flower: A melancholy wolf (Default)
henry_flower ([personal profile] henry_flower) wrote2019-09-13 01:09 pm

Freshwater fish from the streams around the world comes in myriad of species

Кількість інторнет-радіостанцій по країнам:

$ curl -s http://www.radio-browser.info/webservice/json/countries | \
    json -a stationcount name -c 'this.stationcount >= 145' | sort -rn | column
3748 United States of America   241 Australia
2684 Germany                    226 Portugal
2066 China                      225 Ecuador
1625 France                     224 India
1182 Italy                      221 Colombia
1028 Canada                     221 Austria
856 Russia                      211 Taiwan
732 Poland                      211 Hungary
719 United Kingdom              199 Mexico
583 Brazil                      196 Belgium
575 Spain                       187 Romania
437 Switzerland                 166 Indonesia
385 Netherlands                 166 Czech Republic
326 Greece                      162 Turkey
281 Argentina                   145 Ukraine

Контраста с Польщею є цікавий.

Upd: Рейтинг країн за кількістю людей на 1 радіостанцію:

$ ./iradiostat 
rank  Country Name          ppl         stations    ppl/stations ratio
----  --------------------  ----------  ----------  ------------------
1     Switzerland           8516543     437         19488             
2     Estonia               1320884     60          22014             
3     Germany               82927922    2684        30897             
4     Latvia                1926542     61          31582             
5     Greece                10727668    326         32906             
6     Croatia               4089400     116         35253             
7     Canada                37058856    1024        36190             
8     Austria               8847037     221         40031             
9     France                66987244    1613        41529             
10    Finland               5518050     132         41803             
11    Ireland               4853506     115         42204             
12    Netherlands           17231017    386         44639             
13    Portugal              10281762    226         45494             
14    Hungary               9768785     211         46297             
15    Italy                 60431283    1182        51126             
16    Poland                37978548    730         52025             
17    Slovenia              2067372     39          53009             
18    Lithuania             2789533     49          56929             
19    Belgium               11422068    195         58574             
20    Serbia                6982084     119         58672             
21    Norway                5314336     89          59711             
22    Czech Republic        10625695    166         64010             
23    Slovak Republic       5447011     83          65626             
24    Bulgaria              7024216     98          71675             
25    Ecuador               17084357    225         75930             
26    New Zealand           4885500     64          76335             
27    Uruguay               3449299     44          78393             
28    Spain                 46723749    573         81542             
29    Armenia               2951776     36          81993             
30    Moldova               3545883     42          84425             
31    United States         327167434   3747        87314             
32    Denmark               5797446     65          89191             
33    Bosnia and Herzegovi  3323929     37          89835             
34    United Kingdom        66488991    722         92090             
35    Sweden                10183175    109         93423             
36    Australia             24992369    241         103702            
37    Romania               19473936    187         104138            
38    Belarus               9485386     69          137469            
39    Argentina             44494502    281         158343            
40    Russian Federation    144478050   890         162334            
41    Israel                8883800     49          181302            
42    Chile                 18729160    89          210440            
43    Colombia              49648685    219         226706            
44    Peru                  31989256    138         231806            
45    Ukraine               44622516    145         307741            
46    Tunisia               11565204    37          312573            
47    Dominican Republic    10627165    32          332098            
48    Brazil                209469333   580         361154            
49    Kazakhstan            18276499    50          365529            
50    Turkey                82319724    161         511302            
51    Morocco               36029138    69          522161            
52    Mexico                126190788   199         634124            
53    China                 1392730000  2066        674119            
54    Korea, Rep.           51635256    63          819607            
55    Algeria               42228429    47          898477            
56    Thailand              69428524    77          901669            
57    South Africa          57779622    56          1031778           
58    Japan                 126529100   90          1405878           
59    Indonesia             267663435   165         1622202           
60    Vietnam               95540395    41          2330253           
61    Egypt, Arab Rep.      98423595    37          2660097           
62    India                 1352617328  225         6011632

Зе мейкфайла:


#!/usr/bin/make -f
# requires: curl, bsdtar, `npm -g i json json2csv`, sqlite3

all: cc.csv rs.csv pop.csv; @echo "$$merge" | sqlite3

cc.csv:; curl -sf http://country.io/iso3.json | json -M | json2csv -H > $@
rs.csv:
	curl -sf http://www.radio-browser.info/webservice/json/countrycodes | json2csv -H > $@
pop.csv:
	curl -sf 'http://api.worldbank.org/v2/en/indicator/SP.POP.TOTL?downloadformat=csv' | bsdtar xfO - API_SP.POP.TOTL_DS2_en_csv_v2_126182.csv | sed 1,4d > $@

export define merge =
create table cc(iso2, iso3);
create table rs(iso2, c2, stations int);
.mode csv
.import cc.csv cc
.import rs.csv rs
.import pop.csv pop

.mode col
.headers on
.width 4, 20
SELECT row_number () over (ORDER BY "2018"/stations) rank,
       "Country Name", "2018" as ppl, stations,
       "2018"/stations as "ppl/stations ratio"
FROM pop
INNER JOIN cc ON pop."Country Code" = cc.iso3
INNER JOIN rs ON cc.iso2 = rs.iso2
WHERE cast(ppl as i) > 1300000 AND stations > 30
ORDER BY "ppl/stations ratio";
endef

.DELETE_ON_ERROR:
SHELL = bash -o pipefail

jurgen: (Default)

[personal profile] jurgen 2019-09-13 03:34 pm (UTC)(link)

Мда. А я не вижу в них смысла. Как и в fm.