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> // | |
| double x;t,i,m,j, N=1000000; ////// | |
| main(){for( ;j<N;j++){ // // | |
| for(m=9,i=0 ;i<4 ;++i){t=1+ // // | |
| rand()%6;m= t<m?t:m; x ////// | |
| +=t;}x-=m;}printf("%f\n",x/N);} |
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
| # Randomness and Certainty | |
| # https://www.lms.ac.uk/sites/default/files/inline-files/NLMS_505_for%20web.pdf#page=24 | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from diffrax import diffeqsolve, ODETerm, Dopri5, SaveAt | |
| N = 300 | |
| rng = np.random.default_rng(42) |
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
| import polars as pl | |
| import altair as alt | |
| # https://data.sncf.com/explore/dataset/meilleurs-temps-des-parcours-des-trains/information/ | |
| DATA_FILE = "meilleurs-temps-des-parcours-des-trains.csv" | |
| # https://en.wikipedia.org/wiki/File:France_TGV.png | |
| LGVs = pl.DataFrame( | |
| { | |
| "line": [ |
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/bin/env zsh | |
| exifedit() { | |
| local title=$(exiftool -T -Title $1) | |
| local author=$(exiftool -T -Author $1) | |
| vared -p "Title: " title | |
| vared -p "Author(s): " author | |
| exiftool -Author=$author -Title=$title -overwrite_original $1 | |
| } |
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
| BC E6 56 29 99 95 AE 27 9F 89 88 8F BC B4 2A 71 44 7F AF 96 | |
| 72 57 13 DD 08 44 9E A0 13 09 3F D5 AA 06 5E DB E1 EF 14 0B | |
| 42 B8 F3 8E 58 F0 FA 7F 7C BD FF AF DB D9 13 3E 5D D4 30 FB | |
| 60 CA B4 A1 73 E4 31 B5 B3 0C 85 DD 27 42 4F D0 11 09 28 39 | |
| 1B 40 7C B1 01 79 52 53 65 65 BE 0F 4A 43 CD D7 A6 FE 7F 51 | |
| 25 AB CC 20 F9 CC 7F 3B 4F 22 9C 72 F5 FE F9 BF A5 58 1F C7 | |
| EA B2 E4 F8 72 7B 80 A2 D7 C1 4F 46 D1 5E FA AB 12 40 82 7E | |
| 52 BF 4D 37 C6 5F 3D EF 56 11 D2 69 A4 02 0D 58 11 A7 9E 06 | |
| F6 B2 60 AF 83 08 4E 11 71 27 60 6F 9E 0A D3 19 20 F6 A3 40 | |
| B7 26 1B 3A 18 FE E3 3C FB DA 7E 78 CA 49 F3 FE 14 86 53 E9 |
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
| ⎕io←0 | |
| ⍝ Stencil uses zero boundaries | |
| r30←{(7-2⊥⍵)⌷(8⍴2)⊤30}⌺3 | |
| ⍝ Other version, slightly shorter but less legible | |
| r30←{⊃30⊤⍨2⍴⍨1+2⊥⍵}⌺3 | |
| ⍝ Single alive cell initialization | |
| init←(30⍴0),1,30⍴0 | |
| ' █'[↑{(r30⍣⍵)init}¨⍳30] |
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
| from __future__ import print_function, division, unicode_literals | |
| import json | |
| import numpy as np | |
| import emoji | |
| from flask import Flask | |
| from flask import request | |
| from torchmoji.sentence_tokenizer import SentenceTokenizer | |
| from torchmoji.model_def import torchmoji_emojis |
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/bin/awk -f | |
| BEGIN { | |
| FS = "\t"; | |
| } | |
| $2 ~ "^" ARGV[2] "$" { | |
| count++; | |
| if (count > 10) | |
| exit; |
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
| using ProgressMeter | |
| using Plots | |
| plotly(size=(500,500)) | |
| function updatesandpile!(d, i, j) | |
| n = get(d, (i,j), 0) | |
| if n >= 4 | |
| d[(i-1,j)] = get(d, (i-1,j), 0) + 1 | |
| d[(i+1,j)] = get(d, (i+1,j), 0) + 1 | |
| d[(i,j-1)] = get(d, (i,j-1), 0) + 1 |
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
| using LinearAlgebra | |
| using Distributions | |
| using Plots | |
| plotly() | |
| m(x) = 0.25*x^2 | |
| k(x,y) = exp(-0.5 * (x-y)^2) | |
| xmin = -5 | |
| xmax = 5 |
NewerOlder