This file contains 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
var surrogate = @"([\ud800-\udbff][\udc00-\udfff])";// .NET can't handle \U10000-\u10FFFF | |
var c = @"([\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd]|"+surrogate + ")"; | |
var s = @"([\u0020\u0009\u000d\u000a]+)"; | |
var nameStartChar = @"([:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|" + surrogate + ")"; | |
var nameChar = "(" + nameStartChar + @"|[-.0-9\u00B7\u0300-\u036F\u203F-\u2040])"; | |
var name = "(?'name'" + nameStartChar + nameChar + "*)"; | |
var names = "(?'names'" + name + @"(\u0020" + name +")*)"; | |
var nmtoken = "(?'nmtoken'" + nameChar + "+)"; | |
var nmtokens = "(?'nmtokens'" + nmtoken + @"(\u0020" + nmtoken +")*)"; | |
var pereference = "%" + name + ";"; |
This file contains 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
open System | |
open System.Diagnostics | |
type InteractionF<'f> = | |
| Get of (string -> 'f) | |
| Put of string * 'f | |
with | |
static member map f = function | |
| Get g -> Get (f << g) | |
| Put (s, g) -> Put (s, f g) |
This file contains 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 System.ComponentModel; | |
using System.Diagnostics; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using Microsoft.Win32.SafeHandles; | |
[DllImport("Kernel32.dll")] | |
static extern uint GetCurrentThreadId(); |
This file contains 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
Console.WriteLine("Cheese".StartsWith( | |
"C\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000E\u000F\u0010\u0011\u0012" | |
+ "\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u0068" | |
+ "\u007F\u0080\u0081\u0082\u0083\u0084\u0086\u0087\u0088\u0089\u008A\u008B\u008C\u008D" | |
+ "\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095\u0096\u0097\u0098\u0099\u009A\u009B" | |
+ "\u009C\u009D\u009E\u009F\u00AD\u034F\u0488\u0489\u0591\u0592\u0593\u0594\u0595\u0596" | |
+ "\u0597\u0598\u0599\u059A\u059B\u059C\u059D\u059E\u059F\u05A0\u05A1\u05A2\u05A3\u05A4" | |
+ "\u05A5\u05A6\u05A7\u05A8\u05A9\u05AA\u05AB\u05AC\u05AD\u05AE\u05AF\u05BD\u05C4\u05C5" | |
+ "\u0600\u0601\u0602\u0603\u0604\u0605\u0610\u0611\u0612\u0613\u0614\u0615\u0616\u0617" |
This file contains 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
# to look up a word by "definition" (f2d = find): | |
f2d() { grep -ixe "$(echo "$1" | sed 's/[[:digit:]]\+/\\w\\{\0\\}/g')" /usr/share/dict/words; } | |
# to generate the word lists below: | |
while read word; do if [[ "${#word}" -gt 2 && "$word" != *"'"* ]]; then echo "$word ${word: 0:1} $((${#word} - 2)) ${word: -1:1}"; fi; done < /usr/share/dict/words | sort -f -k2,2 -k3,3n -k4,4 | uniq -u -i -f1 | awk '{ print $2 $3 $4 " " $1 }' > AnZ.txt | |
# this is mostly getting the output to come out nice: | |
# | |
# skip all words less than 3 characters long, or that have apostrophes | |
# print out like "word w 2 d" |
This file contains 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 System; | |
namespace UnicodeRulez | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
Console.WriteLine("Cheese".StartsWith("C͏ͿԤԥԨԩԪԫԬԭԮԯՠֈ֍֎֏ׯ؝ـ߽߾߿ࡠࡡࡢࡣࡤࡥࡦࡧࡨࡩࡪࡰࡱࡲࡳࡴࡵࡶࡷࡸࡹࡺࡻࡼࡽࡾࡿࢀࢁࢂࢃࢄࢅࢆࢇ࢈ࢉࢊࢋࢌࢍࢎ࢙࢚࢛࢘࢜࢝࢞࢟ࢠࢡࢢࢣࢤࢥࢦࢧࢨࢩࢪࢫࢬࢭࢮࢯࢰࢱࢲࢳࢴࢵࢶࢷࢸࢹࢺࢻࢼࢽࢾࢿࣀࣁࣂࣃࣄࣅࣆࣇࣈࣉࣰࣱࣲ࣏࣐࣑࣒࣓ࣣࣦࣩ࣭࣮࣯ࣶࣹࣺ࣊࣋࣌࣍࣎ࣔࣕࣖࣗࣘࣙࣚࣛࣜࣝࣞࣟ࣠࣡ࣤࣥࣧࣨ࣪࣫࣬ࣳࣴࣵࣷࣸࣻࣼࣽࣾࣿऀॸঀ৻ৼ৽৾੶૰ૹૺૻૼ૽૾૿୕ఀఄఴ఼ౚౝ౷ಀಁ಄ೝೳഀഁഄ഻഼൏ൔൕൖ൘൙൚൛൜൝൞ൟ൶൷൸ඁ෦෧෨෩෪෫෬෭෮෯ຆຉຌຎຏຐຑຒຓຘຠຨຩຬ຺໌໎ໞໟჇჍჽჾჿᏵᏸᏹᏺᏻᏼᏽᛱᛲᛳᛴᛵᛶᛷᛸᜍ᜕ᜟ |
This file contains 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
#[tokio::main] | |
pub async fn login() -> Result<()> { | |
println!("Loggin In"); | |
let (tx, rx) = tokio::sync::oneshot::channel::<()>(); | |
let tx = Arc::new(Mutex::new(Some(tx))); | |
// If this is not the first time you are using the client credentials grant | |
// then you only have to run request_access_token() and you can comment out | |
// what is below. | |
let query = warp::query::<AccessCode>() | |
.map(Some) |
This file contains 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
{-# LANGUAGE RankNTypes, ConstraintKinds, BlockArguments #-} | |
module Main where | |
import Data.Foldable (for_) | |
import Control.Monad.Bayes.Class (MonadSample, uniformD) | |
import Control.Monad.Bayes.Enumerator (enumerate) | |
import Text.Printf (printf) | |
-- helpers |
This file contains 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 <atomic> | |
#include <string> | |
#include <chrono> | |
#include <iostream> | |
std::string GetValueFromSomewhere() | |
{ | |
auto now = std::chrono::system_clock::now(); | |
return std::to_string(now.time_since_epoch().count()); | |
} |
This file contains 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
const TESTS: &[(&str, &str)] = &[ | |
( | |
" | |
1AA2 | |
1AA2 | |
4335 | |
4675 | |
8 9 | |
", | |
" |
NewerOlder