Histogram of chances of individual articles on English and Czech Wikipedias to appear as a random article.
Created as a response to this HN comment.
| let successes = 0; | |
| let failures = 0; | |
| for (let iter = 0; iter < 100000000; ++iter) { | |
| let counts = [3,0,0,0]; | |
| while (counts.length > 1) { | |
| let loser = Math.round(Math.random() * counts.length); | |
| if (loser === 0) { | |
| break; | |
| } |
Histogram of chances of individual articles on English and Czech Wikipedias to appear as a random article.
Created as a response to this HN comment.
| 1;CT 1 HD T2;8395-8465-268 | |
| 2;CT 2 HD T2;8395-8465-270 | |
| 3;CT 24 HD T2;8395-8465-272 | |
| 4;CT sport HD T2;8395-8465-274 | |
| 5;NOVA | T2;8395-61959-525 | |
| 6;Nova Cinema | T2;8395-61959-524 | |
| 7;Prima;8395-61958-786 | |
| 8;Prima COOL;8395-61958-787 | |
| 9;CT :D/art HD T2;8395-8465-276 | |
| 10;Prima MAX;8395-61958-785 |
| void Main() | |
| { | |
| List<GdiFonts.FontData> allFonts = GdiFonts.GetAllFonts(); | |
| allFonts.Where(f => | |
| // The font must be a fixed-pitch font. | |
| (f.TextMetric.tmPitchAndFamily & 1) == 0 && | |
| // The font can’t be an italic font | |
| f.LogFont.elfLogFont.lfItalic == 0 && | |
| // or have a negative A or C space. |
| import java.nio.file.Files; | |
| import java.nio.file.FileSystems; | |
| import java.nio.file.Path; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; | |
| import java.util.Random; | |
| public class NGrams { |
I hereby claim:
To claim this, I am signing this object:
| # | NKČR AUT | Památkový katalog | Zanikleobce.cz | Prazdnedomy.cz | Vodnimlyny.cz | Znicenekostely.cz | Křížky a vetřelci | Count | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | X | 231505 | |||||||
| 2 | X | 39322 | |||||||
| 3 | X | X | 379 | ||||||
| 4 | X | 2609 | |||||||
| 5 | X | X | 25 | ||||||
| 6 | X | X | 17 | ||||||
| 7 | X | X | X | 1 | |||||
| 8 | X | 753 | |||||||
| 9 | X | X | 1 |
| void Main() | |
| { | |
| ToYoneda(new[] {1, 2, -3, 4}.ToFunctor()) | |
| //.Alpha(x => x).Dump(); | |
| .Alpha(x => (x >= 0 ? "+" : "-")).Dump(); | |
| ToYoneda(new int?(3).ToFunctor()) | |
| .Alpha(x => (x >= 0 ? "+" : "-")).Dump(); | |
| FromYoneda(ToYoneda(new[] { 1, 2, -3, 4 }.ToFunctor())).Dump(); |
| void Main() | |
| { | |
| File.Delete(@"streetzips.txt"); | |
| var zips = new Dictionary<string, HashSet<string>>(); | |
| foreach (var file in Directory.GetFiles(@"...\ruian-import", "*_ADR.CSV")) | |
| { | |
| Console.WriteLine(file); | |
| using (var reader = new StreamReader(file)) | |
| { | |
| reader.ReadLine(); |
| // https://tools.wmflabs.org/mix-n-match/#/catalog/699 | |
| void Main() | |
| { | |
| var okresy = ImportCsv(@"UI_OKRES.CSV"); | |
| var obce = ImportCsv(@"UI_OBEC.CSV"); | |
| var ulice = ImportCsv(@"UI_ULICE.CSV"); | |
| var namestiRegex = new Regex(@"\b[Nn]ám(\.|ěstí)"); |