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 json | |
| from typing import Any, List, Dict | |
| class Snowflake: | |
| def generate(self): | |
| # Replace with your implementation of Snowflake ID generator | |
| from random import randint | |
| return randint(1, 1 << 63) # Example implementation |
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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "time" | |
| ) | |
| func Produce(values chan<- int, ready <-chan bool) { | |
| for { |
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
| sources: | |
| scratch_logs: | |
| type: "journald" | |
| include_units: ["scratchworker.service", "scratchdb.service"] | |
| init_logs: | |
| type: "journald" | |
| include_units: ["init.scope"] |
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
| package main | |
| // go version go1.22.1 darwin/arm64 | |
| // M1 2020 macbook with OS version 12.5 (21G72) | |
| import ( | |
| "fmt" | |
| "os" | |
| "syscall" | |
| "time" |
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
| filter = identifier ,[not], ".", operator, [modifier] , operand; | |
| identifier = quoted_identifier | plain_identifier; | |
| quoted_identifier = '"',inside_quotes, '"'; | |
| plain_identifier = "[A-Za-z0-9_]+" ; | |
| inside_quotes = '[!"\"".]+' ; | |
| not = '.not'; | |
| operator = "[A-Za-z]+" ; | |
| modifier = "(", plain_identifier, ")"; | |
| operand = element; | |
| Element = QuotedString / UnquotedString / Number / Tuple / Set; |
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 json | |
| def parse(obj, path = None, use_indices = False): | |
| if path is None: | |
| path = [] | |
| if isinstance(obj, list): | |
| if use_indices: | |
| return [p for i, item in enumerate(obj) for p in parse(item, path + [i], use_indices)] | |
| return [p for i in obj for p in parse(i, path, use_indices) ] | |
| if isinstance(obj, dict): |
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 <string.h> | |
| #include <sys/mman.h> | |
| #include <unistd.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> | |
| #include <sys/types.h> | |
| const unsigned int num_records = 100000000; |
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
| ````.................-------::::-` | |
| `.-:/+ossyhhddmmmmmmmmmmmmmmdddddddddddddddddddddmmy: | |
| `-/oydmmmmmdyso++/::-:::///////:::::::---.`````````````./hmh/ | |
| -/ydmdhyso+++//:------:---.`````` ````.:::-. `-ymh- | |
| .+hmds/.:/:-------..````...------:::::::::::::--.```-//- :dm+ | |
| -ymds:` `-```````....------..````` `..------..`.://:.`-+/- .hms` | |
| omd+` `----------.` ::......--://:::-/+/.`-/-` `yNy` | |
| oNy` :/:.``````...--` -o` `.-+/:-//- .-. `yNy` |
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
| Given I have a string "hello world" | |
| When I split it based on the " " character | |
| Then I expect two tokens | |
| And I expect these tokens to be present: | |
| | token | | |
| | hello | | |
| | world | |
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
| Let us go then, you and I, | |
| When the evening is spread out against the sky | |
| Like a patient etherized upon a table; | |
| Let us go, through certain half-deserted streets, | |
| The muttering retreats | |
| Of restless nights in one-night cheap hotels | |
| And sawdust restaurants with oyster-shells: | |
| Streets that follow like a tedious argument | |
| Of insidious intent | |
| To lead you to an overwhelming question. . . |
NewerOlder