This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <math.h> | |
| #include <time.h> | |
| #ifndef M_PI | |
| #define M_PI 3.14159265358979323846264338327950288419716939937511 | |
| #endif | |
| #ifndef DEBUG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/local/bin/perl -w | |
| # Convert a decimal number to its literal expression in English. | |
| use strict; | |
| use warnings; | |
| use Getopt::Std; | |
| my %opts; | |
| getopts("u", \%opts); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/local/bin/perl -w | |
| # Generate a graphical representation of either the Stern-Brocot or | |
| # (with option -d) the dyadic tree on the interval [0,1]. | |
| # -- David A. Madore <http://www.madore.org/~david/> 2023-12-23 | |
| # Public Domain | |
| use strict; | |
| use warnings; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- (This is the Haskell version) | |
| -- Define pairing and projection functions by storing values in a closure | |
| let pairing = \x -> \y -> \f -> f x y | |
| let proj1 = \p -> p (\x -> \y -> x) | |
| let proj2 = \p -> p (\x -> \y -> y) | |
| -- Conversion from and to native pairs | |
| let fromnative = \(x,y) -> pairing x y | |
| let tonative = \p -> p (\x -> \y -> (x,y)) | |
| let tonative_broken = \p -> (proj1 p, proj2 p) | |
| -- This works as expected: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| graph cant { | |
| c0101 [label="0101"]; | |
| c0104 [label="0104"]; | |
| c0101 -- c0104; | |
| c0107 [label="0107"]; | |
| c0101 -- c0107; | |
| c0110 [label="0110"]; | |
| c0101 -- c0110; | |
| c0111 [label="0111"]; | |
| c0101 -- c0111; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install postgresql-13-postgis-3 postgresql-13-postgis-3-scripts | |
| createdb admin-express | |
| sudo -u postgres psql -d admin-express -c 'CREATE EXTENSION postgis ;' | |
| sudo -u postgres psql -d admin-express -c 'GRANT ALL ON TABLE public.spatial_ref_sys TO david ;' | |
| ## Go to <URL: https://geoservices.ign.fr/adminexpress > | |
| ## and download ADMIN-EXPRESS_3-2__SHP_LAMB93_FXX_2023-10-16.7z to /data/FTP | |
| cd /data/tmp | |
| 7z x /data/FTP/ADMIN-EXPRESS_3-2__SHP_LAMB93_FXX_2023-10-16.7z | |
| cd /data/tmp/ADMIN-EXPRESS_3-2__SHP_LAMB93_FXX_2023-10-16/ADMIN-EXPRESS/1_DONNEES_LIVRAISON_2023-10-16/ADE_3-2_SHP_LAMB93_FXX | |
| ogr2ogr -f postgresql PG:"host=localhost dbname=admin-express" REGION.shp -nlt PROMOTE_TO_MULTI |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### Plot of cumulative precipitations in France | |
| ## Input data: /tmp/precs.csv is expected to contain a list of daily | |
| ## precipitations in France (first column = date (unused), second | |
| ## column = precipiptations in mm/day). It can be produced from the | |
| ## data source described in <URL: | |
| ## https://twitter.com/gro_tsen/status/1620435663844970497 > by the | |
| ## following command line: | |
| # perl -ne 'next if /^\#/; die unless /^([0-9]{8})\s+(\-?[0-9]+\.[0-9]+(?:[Ee](?:[+-]?[0-9]+))?)\s*$/; printf "%s,%.4f\n", $1,($2+0)' /data/meteo/climexp/iera5_prcp_daily_eu_France_metropolitan.dat > /tmp/precs.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 19500101 | 0.0501 | |
|---|---|---|
| 19500102 | 0.4288 | |
| 19500103 | 4.4788 | |
| 19500104 | 3.0397 | |
| 19500105 | 1.0753 | |
| 19500106 | 0.7376 | |
| 19500107 | 0.0551 | |
| 19500108 | 0.0924 | |
| 19500109 | 1.5346 | |
| 19500110 | 0.3256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #### Some statistical analysis of daily mean temperatures in France | |
| #### See: <URL: https://twitter.com/gro_tsen/status/1620488744867598337 > | |
| ## Input data: /tmp/temps.csv is expected to contain a list of daily | |
| ## average temperatures in France (first column = date (unused), | |
| ## second column = temperature in Celsius), over a whole number of | |
| ## calendar years. It can be produced from the data source described | |
| ## in <URL: https://twitter.com/gro_tsen/status/1620435663844970497 > | |
| ## by the following command line: |