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 java.util.HashMap; | |
| import java.util.Map; | |
| public class RomanNumber { | |
| static final Map<Character, Integer> ROMAN_NUMERALS; | |
| static { | |
| HashMap<Character, Integer> m = new HashMap<>(); | |
| m.put('I', 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
| // as long answer to https://twitter.com/pivovarit/status/1067883547669815296 | |
| import java.lang.reflect.Field; | |
| import java.util.Arrays; | |
| class Tuples { | |
| public static void main(String... args) throws NoSuchFieldException, IllegalAccessException { | |
| new Tuples().exec(); | |
| } |
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
| /** | |
| demo of Java 11 HttpClient | |
| */ | |
| import java.net.URI; | |
| import java.net.http.HttpClient; | |
| import java.net.http.HttpClient.Redirect; | |
| import java.net.http.HttpRequest; | |
| import java.net.http.HttpResponse; | |
| import java.net.http.HttpResponse.BodyHandlers; |
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
| build/ |
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
| # Multicast receiver | |
| # Guidance: https://stackoverflow.com/a/1794373 | |
| import socket | |
| import struct | |
| MCAST_GRP = '224.1.1.1' | |
| MCAST_PORT = 5007 | |
| IS_ALL_GROUPS = True | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) |
On Twitter, Will McGuan posted a perspective screenshot.
This gist provides few basic steps, using ImageMagick, to produce some similar looking.
Following steps were processed.
- starting with a screenshot of the Rich CLI help in a terminal
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
| birth - created - touch | |
| birth 2022-12-20 22:56:54.558640670 +0100 | |
| access 2022-12-20 22:56:54.558640670 +0100 | |
| modify 2022-12-20 22:56:54.558640670 +0100 | |
| change 2022-12-20 22:56:54.558640670 +0100 | |
| atime - accessed - cat | |
| birth 2022-12-20 22:56:54.558640670 +0100 | |
| access 2022-12-20 22:56:55.570654581 +0100 |
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
| """ | |
| Solution for the challenge https://mastodon.social/@willmcgugan/112025856092773557 | |
| How to execute: | |
| 1. the very first run of the script generates the example file with | |
| 10 million lines, of random lengths | |
| 2. drop file system caches [1] | |
| echo 3 | sudo tee /proc/sys/vm/drop_caches | |
| 3. run the script to get the time it takes to read the last five lines from | |
| the uncached file |
OlderNewer
