diff --git a/CookieEnterKeyPresser.py b/CookieEnterKeyPresser.py new file mode 100755 index 0000000..e53f5ca --- /dev/null +++ b/CookieEnterKeyPresser.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 + +"""Lets you collect cookies""" + +import multiprocessing as mp +import collections +import pickle + +big_cookie = """ + WNXXXXXNWW + WNNXK0OkkOO0OOO000KXXNNW + WN0O0O0kOOOO000OOkOOkOKK0OkO0N + N0kkOkdxxkkOOOOkkxkxddxkkkOK0kxk0KKXXNW + XkOOkxddkxkkOOkkkloddoodl;.;x0koOkdodxdddxk0XW + WK0O0OkdokkkOkdddl:ooodxdkxoloc:lkx000kdo;..,,,dON + Xxx:l0OkdkO0Okkxxdc::dkO0000OxxxdxoodOkdO00o';cd. :xk0N + XkOd'cxxkO0kdc.. .. .:llkOkxdolododdxkOOkkOOOOo:' coodx0NW + WXKOO00OkkkxkOd' .cko:;':cdxdddoolllooooocclloooddkklxxoodxkO0X + WKkOOkkoddxxkkkOko...lkk,.;ooooolllcc;::lllc:cclc:lloddxxkkkxooxddK + XOOkkxdokddoddxxxkOo;'...,dOkxxkdc,..;ooccccclc,..ll:;:;:ookOOkdxxxxK + NOkOOxdolodoodddoddlxxdo:dOkOxkko....';ldxxdoxxOk.:kc:lxdc:oxdcddl::xk0W + Nkkxkkxdll:cocc:ool::l;;lxkkxkkdll:'.'oxx:k000Kkkk. ...;.cdxkkxxx:. 'dx0 + NkkxdddoolcooddxocdxxkodO00kxkOk'..lol,..:;;kkkkOdO; . 'lxko,. .lddX + KxxxxdddddxxdoxkxdkOOOOOO0Odlxkk;.. 'lc:;,::xkxoxxkO. .''.;dkxo,.. ..,lodk + Oxxxxxxxolc'. ckcdxkkOOOOxl'cOkx:. ;oolcdkxoldk0000x'oxol:dkkllol'';odddddX +Nxxxdxxxdoc:;,. .l:ooxdxkxxxkkk00kdc:c:odxkkk0Ooxkkkxkkk0Okkxxdxkxl:odxdddddK 1 +KxdxxxxkkkkckkxkkOOx:dddxxddxo:,cldxxxdodxxkOOOl:clllodxxdkxddxdooccodxdooodxW +Xdoloxxoxkkdlc:;,oxx:cddddddoccllxxxdddlxkkkxdddo:cllloodxldkOOOolxxdooolloolX + kddoddodxdxxxkkocxkx:,loododxcc:;,,ldlcxxxdooooclcllloddxkxokOO;.'lxdxxxolclK + 0dddxxx:dkxxokkkkkkOk::xdddll:. .:. .okxdoooooooooolloloddOOxxl. 'ooddddollN + Nxdolddl;OOxlxxxxdxxd:cxxkxlc;. .. . .lllo:cll;.:xkxdlcooxxxxdd,. ;dodoloolk + XddoldocxOklldddoddlclddxolkOx' :cloc;: .';'oxdddododooooc..cddxlloolX + Oddlololxkklcddddo;ccc:::.oxo:. .;lcoxxl .dxxoooodooll;;;;:ooooooo + XOdclxxdxooloolollkkkoddc:ooc:okkxdloxk; ..odooodoodxxdcllll:clooo0 + 0odxdlo:odddllcxOkocllclxkOOkkxkxdodxxl' .'ldoooo:;;,:lc;ddddoooolO + Nxodddddddxxldlokxc;;,xkxdddxxxkxxxdddkko,:::cclodo.... . ;dddlcllcX + Nlloxol;llc::;,;.',cooddodooddxkxxdo:clllcloc;coodo. ..,ldxollolcx + K......:;,ld,.. 'ooododoooodddoc,;coooodxl:;;:cllcclooooooolollW + 0' ...;.;okxxxlcdOkdl:clooooolddddoooddlclodl::ccllccodoolooll,k + Wxlddxoxxdolldddxxxdlcclllol:l,. . .;ccllll::cc:;::ccoddooo;x + Wdoxxdool::::ccccclodxddxd; ,olllcclcccclooxdoolccdW + W0oloddodooclodxxxooddxxxd;. . .:c:;::cooooooccoollox0W + 0occlolcloodxddxdooooddkkc,,.okdlclooodlcddlccclxX + Xkocc::::cllodoooolcc:ccllcccoooooddxo,,':coON + XOdclclcc:llcllolc:;;cllooooddldooooxk0X + NK0kdlcc:::ccc:clcllllcooooclx0XW + WNXXKOxoc;:cccccccldOKW + NOOddkOXW +""" + +little_cookie = """ + ╱───╲ + ╱○ ○ ╲ +│ ○ ○ │ + ╲ ○ ○ ╱ + ╲───╱ +""" + +def say_cookies(num): + if num == 1: + return "cookie" + else: + return "cookies" + +def save(obj, name): + with open(name, "wb") as f: + pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL) + +def load(name): + with open(name, "rb") as f: + return pickle.load(f) + +if __name__ == "__main__": + state = { + "cookies": 0 + } + + dispatch = { + "": lambda st: {"cookies": st["cookies"] + 1}, + "help": lambda _: print(""" +Available commands: + save [save name] - save current game state + load [save name] - load previous save + help - get this message + cookie - see a minicookie + - get cookies + """), + "save": lambda st, save_name: save(st, save_name), + "load": lambda _, save_name: load(save_name), + "cookie": lambda _: print(little_cookie) + } + + print(big_cookie) + + while True: + print("You have %d %s." % (state["cookies"], say_cookies(state["cookies"]))) + + result_tokens = input(u"|||> ").split(" ") + + try: + selected_func = dispatch[result_tokens[0]] + except: + print("Command not found.") + dispatch["help"](state) + continue + + change = selected_func(state, *result_tokens[1:]) + + try: # An operation might return nothing instead of changing state. + for k, v in change.items(): + state[k] = v + except: + pass \ No newline at end of file diff --git a/KerbalName/.gitignore b/KerbalName/.gitignore new file mode 100755 index 0000000..311eebb --- /dev/null +++ b/KerbalName/.gitignore @@ -0,0 +1,392 @@ +# Created by https://www.gitignore.io/api/f#,linux,windows,macos,vim,emacs,visualstudio,visualstudiocode + +### F# ### +lib/debug +lib/release +Debug +*.suo +*.user +obj +bin + + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + + +### Windows ### +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +### macOS ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Vim ### +# swap +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +# session +Session.vim +# temporary +.netrwhist +*~ +# auto-generated tag files +tags + + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +### VisualStudioCode ### +.vscode + + + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +build/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml diff --git a/KerbalName/KerbalName/App.config b/KerbalName/KerbalName/App.config new file mode 100755 index 0000000..3661651 --- /dev/null +++ b/KerbalName/KerbalName/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/KerbalName/KerbalName/KerbalName.fs b/KerbalName/KerbalName/KerbalName.fs new file mode 100755 index 0000000..3e7a3ed --- /dev/null +++ b/KerbalName/KerbalName/KerbalName.fs @@ -0,0 +1,77 @@ +module Kerbal.Names + +open Argu + +let readLinesFrom file = + use reader = new System.IO.StreamReader(path=file) + reader.ReadToEnd().Split('\n') + |> List.ofArray + +type CommandLineArgument = +| [] Quantity of int +| [] Separator of string +| [] DataDir of string +with + interface IArgParserTemplate with + member this.Usage = + match this with + | Quantity _ -> "How many names to generate (defaults to 1)" + | Separator _ -> "What to separate generated names with (defaults to newline)" + | DataDir _ -> "Where the program's datafiles can be found (defaults to KerbalNameData under working directory)" + +module RNG = + let seedGenerator = System.Random() + let localGenerator = new System.Threading.ThreadLocal(fun _ -> + lock seedGenerator (fun _ -> + let seed = seedGenerator.Next() + new System.Random(seed))) + + // Returns a version of System.Random using the threadlocal RNG. + // NOTE: Most functions are NOT thread-safe in this version. + let getRand() = {new System.Random() with member this.Next(lim) = localGenerator.Value.Next(lim)} + +let inline randomChoice (rand : System.Random) (list:'a list) = + list.[rand.Next(list.Length)] + +let inline generateHybridName rand prefixList suffixList = + (randomChoice rand prefixList) + (randomChoice rand suffixList) + +let genName (rand : System.Random) properNames namePrefixes nameSuffixes = + if rand.Next(20) = 20 then + randomChoice rand properNames + else + generateHybridName rand namePrefixes nameSuffixes + +[] +let main argv = + // Construct CLI parser with programname taken from env variables + let argParser = ArgumentParser.Create(programName = (Array.head <| System.Environment.GetCommandLineArgs())) + + let parseResults = argParser.Parse argv + let dataDir = parseResults.GetResult(<@ DataDir @>, defaultValue = "KerbalNameData") + "/" // Append a slash in case missing + let quantity = parseResults.GetResult(<@ Quantity @>, defaultValue = 1) + let separator = parseResults.GetResult(<@ Separator @>, defaultValue = "\n") + + // Access name datafiles + let properNames = readLinesFrom (dataDir + "Proper.txt") + let namePrefixes = readLinesFrom (dataDir + "Prefixes.txt") + let nameSuffixes = readLinesFrom (dataDir + "Suffixes.txt") + + let rand = RNG.getRand() + + let printingMailbox = MailboxProcessor.Start(fun inbox -> + let rec loop () = async { + let! msg = inbox.Receive() + printf "%s" msg + return! loop() + } + + loop() + ) + + System.Threading.Tasks.Parallel.For(0, quantity, fun idx -> + genName rand properNames namePrefixes nameSuffixes + |> (fun name -> printingMailbox.Post(name + separator)) + ) |> ignore // We do not care about the result which came from the parallel loop. + + 0 \ No newline at end of file diff --git a/KerbalName/KerbalName/KerbalName.fsproj b/KerbalName/KerbalName/KerbalName.fsproj new file mode 100755 index 0000000..2127b83 --- /dev/null +++ b/KerbalName/KerbalName/KerbalName.fsproj @@ -0,0 +1,1051 @@ + + + + + Debug + AnyCPU + 2.0 + 8f63bc8c-59e1-4e29-a3c1-89d003ed32b2 + Exe + KerbalName + KerbalName + v4.0 + true + 4.4.0.0 + KerbalName + + + true + full + false + false + bin\$(Configuration)\ + DEBUG;TRACE + 3 + $(Platform) + bin\$(Configuration)\$(AssemblyName).XML + + + pdbonly + true + true + bin\$(Configuration)\ + TRACE + 3 + $(Platform) + bin\$(Configuration)\$(AssemblyName).XML + + + + + True + + + + + + + + + + + 14 + + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + + + + + + ..\packages\Argu\lib\net35\Argu.dll + True + True + + + + + + + ..\packages\Argu\lib\net40\Argu.dll + True + True + + + + + + + ..\packages\Argu\lib\netstandard1.6\Argu.dll + True + True + + + + + + + + + ..\packages\Microsoft.Win32.Primitives\lib\net46\Microsoft.Win32.Primitives.dll + True + True + + + + + + + ..\packages\Microsoft.Win32.Primitives\ref\netstandard1.3\Microsoft.Win32.Primitives.dll + False + True + + + + + + + + + ..\packages\System.AppContext\lib\net463\System.AppContext.dll + True + True + + + + + + + ..\packages\System.AppContext\lib\netstandard1.6\System.AppContext.dll + True + True + + + + + + + + + ..\packages\System.Buffers\lib\netstandard1.1\System.Buffers.dll + True + True + + + + + + + + + ..\packages\System.Collections\ref\netstandard1.0\System.Collections.dll + False + True + + + + + + + ..\packages\System.Collections\ref\netstandard1.3\System.Collections.dll + False + True + + + + + + + + + ..\packages\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll + True + True + + + + + + + + + ..\packages\System.Console\lib\net46\System.Console.dll + True + True + + + + + + + ..\packages\System.Console\ref\netstandard1.3\System.Console.dll + False + True + + + + + + + + + ..\packages\System.Diagnostics.DiagnosticSource\lib\net46\System.Diagnostics.DiagnosticSource.dll + True + True + + + + + + + ..\packages\System.Diagnostics.DiagnosticSource\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll + True + True + + + + + + + + + ..\packages\System.Diagnostics.Tracing\lib\net462\System.Diagnostics.Tracing.dll + True + True + + + + + + + + + ..\packages\System.Globalization\ref\netstandard1.0\System.Globalization.dll + False + True + + + + + + + ..\packages\System.Globalization\ref\netstandard1.3\System.Globalization.dll + False + True + + + + + + + + + ..\packages\System.Globalization.Calendars\lib\net46\System.Globalization.Calendars.dll + True + True + + + + + + + ..\packages\System.Globalization.Calendars\ref\netstandard1.3\System.Globalization.Calendars.dll + False + True + + + + + + + + + ..\packages\System.Globalization.Extensions\lib\net46\System.Globalization.Extensions.dll + True + True + + + + + + + ..\packages\System.Globalization.Extensions\ref\netstandard1.3\System.Globalization.Extensions.dll + False + True + + + + + + + + + ..\packages\System.IO\lib\net462\System.IO.dll + True + True + + + + + + + ..\packages\System.IO\ref\netstandard1.0\System.IO.dll + False + True + + + + + + + ..\packages\System.IO\ref\netstandard1.3\System.IO.dll + False + True + + + + + + + ..\packages\System.IO\ref\netstandard1.5\System.IO.dll + False + True + + + + + + + + + ..\packages\System.IO.Compression\lib\net46\System.IO.Compression.dll + True + True + + + + + + + + + True + + + ..\packages\System.IO.Compression.ZipFile\lib\net46\System.IO.Compression.ZipFile.dll + True + True + + + + + + + ..\packages\System.IO.Compression.ZipFile\lib\netstandard1.3\System.IO.Compression.ZipFile.dll + True + True + + + + + + + + + ..\packages\System.IO.FileSystem\lib\net46\System.IO.FileSystem.dll + True + True + + + + + + + ..\packages\System.IO.FileSystem\ref\netstandard1.3\System.IO.FileSystem.dll + False + True + + + + + + + + + ..\packages\System.IO.FileSystem.Primitives\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + + + + + + + ..\packages\System.IO.FileSystem.Primitives\lib\netstandard1.3\System.IO.FileSystem.Primitives.dll + True + True + + + + + + + + + ..\packages\System.Linq\lib\net463\System.Linq.dll + True + True + + + + + + + ..\packages\System.Linq\lib\netstandard1.6\System.Linq.dll + True + True + + + + + + + + + ..\packages\System.Linq.Expressions\lib\net463\System.Linq.Expressions.dll + True + True + + + + + + + ..\packages\System.Linq.Expressions\lib\netstandard1.6\System.Linq.Expressions.dll + True + True + + + + + + + + + ..\packages\System.Linq.Queryable\lib\netstandard1.3\System.Linq.Queryable.dll + True + True + + + + + + + + + ..\packages\System.Net.Http\lib\net46\System.Net.Http.dll + True + True + + + + + + + + + ..\packages\System.Net.Sockets\lib\net46\System.Net.Sockets.dll + True + True + + + + + + + ..\packages\System.Net.Sockets\ref\netstandard1.3\System.Net.Sockets.dll + False + True + + + + + + + + + ..\packages\System.Net.WebHeaderCollection\lib\netstandard1.3\System.Net.WebHeaderCollection.dll + True + True + + + + + + + + + ..\packages\System.ObjectModel\lib\netstandard1.3\System.ObjectModel.dll + True + True + + + + + + + + + ..\packages\System.Reflection\lib\net462\System.Reflection.dll + True + True + + + + + + + ..\packages\System.Reflection\ref\netstandard1.0\System.Reflection.dll + False + True + + + + + + + ..\packages\System.Reflection\ref\netstandard1.3\System.Reflection.dll + False + True + + + + + + + ..\packages\System.Reflection\ref\netstandard1.5\System.Reflection.dll + False + True + + + + + + + + + ..\packages\System.Reflection.Emit\lib\netstandard1.3\System.Reflection.Emit.dll + True + True + + + + + + + + + ..\packages\System.Reflection.Emit.ILGeneration\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll + True + True + + + + + + + + + ..\packages\System.Reflection.Emit.Lightweight\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll + True + True + + + + + + + + + ..\packages\System.Reflection.Primitives\ref\netstandard1.0\System.Reflection.Primitives.dll + False + True + + + + + + + + + ..\packages\System.Reflection.TypeExtensions\lib\net462\System.Reflection.TypeExtensions.dll + True + True + + + + + + + ..\packages\System.Reflection.TypeExtensions\lib\netstandard1.5\System.Reflection.TypeExtensions.dll + True + True + + + + + + + + + True + + + + + + + True + + + ..\packages\System.Runtime\lib\net462\System.Runtime.dll + True + True + + + + + + + ..\packages\System.Runtime\ref\netstandard1.0\System.Runtime.dll + False + True + + + + + + + ..\packages\System.Runtime\ref\netstandard1.2\System.Runtime.dll + False + True + + + + + + + ..\packages\System.Runtime\ref\netstandard1.3\System.Runtime.dll + False + True + + + + + + + ..\packages\System.Runtime\ref\netstandard1.5\System.Runtime.dll + False + True + + + + + + + + + ..\packages\System.Runtime.Extensions\lib\net462\System.Runtime.Extensions.dll + True + True + + + + + + + + + ..\packages\System.Runtime.Handles\ref\netstandard1.3\System.Runtime.Handles.dll + False + True + + + + + + + + + ..\packages\System.Runtime.InteropServices\lib\net463\System.Runtime.InteropServices.dll + True + True + + + + + + + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + + + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll + False + True + + + + + + + + + ..\packages\System.Runtime.Numerics\lib\netstandard1.3\System.Runtime.Numerics.dll + True + True + + + + + + + + + ..\packages\System.Security.Cryptography.Algorithms\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + + + + + ..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.6\System.Security.Cryptography.Algorithms.dll + False + True + + + + + + + + + ..\packages\System.Security.Cryptography.Cng\lib\net463\System.Security.Cryptography.Cng.dll + True + True + + + + + + + ..\packages\System.Security.Cryptography.Cng\ref\netstandard1.6\System.Security.Cryptography.Cng.dll + False + True + + + + + + + + + ..\packages\System.Security.Cryptography.Csp\lib\net46\System.Security.Cryptography.Csp.dll + True + True + + + + + + + ..\packages\System.Security.Cryptography.Csp\ref\netstandard1.3\System.Security.Cryptography.Csp.dll + False + True + + + + + + + + + ..\packages\System.Security.Cryptography.Encoding\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + + + + + ..\packages\System.Security.Cryptography.Encoding\ref\netstandard1.3\System.Security.Cryptography.Encoding.dll + False + True + + + + + + + + + ..\packages\System.Security.Cryptography.OpenSsl\lib\netstandard1.6\System.Security.Cryptography.OpenSsl.dll + True + True + + + + + + + + + ..\packages\System.Security.Cryptography.Primitives\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + + + + + ..\packages\System.Security.Cryptography.Primitives\lib\netstandard1.3\System.Security.Cryptography.Primitives.dll + True + True + + + + + + + + + ..\packages\System.Security.Cryptography.X509Certificates\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + + + + + + ..\packages\System.Security.Cryptography.X509Certificates\ref\netstandard1.4\System.Security.Cryptography.X509Certificates.dll + False + True + + + + + + + + + ..\packages\System.Text.Encoding\ref\netstandard1.0\System.Text.Encoding.dll + False + True + + + + + + + ..\packages\System.Text.Encoding\ref\netstandard1.3\System.Text.Encoding.dll + False + True + + + + + + + + + ..\packages\System.Text.RegularExpressions\lib\net463\System.Text.RegularExpressions.dll + True + True + + + + + + + ..\packages\System.Text.RegularExpressions\lib\netstandard1.6\System.Text.RegularExpressions.dll + True + True + + + + + + + + + ..\packages\System.Threading\lib\netstandard1.3\System.Threading.dll + True + True + + + + + + + + + ..\packages\System.Threading.Tasks\ref\netstandard1.0\System.Threading.Tasks.dll + False + True + + + + + + + ..\packages\System.Threading.Tasks\ref\netstandard1.3\System.Threading.Tasks.dll + False + True + + + + + + + + + ..\packages\System.Threading.Tasks.Extensions\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll + True + True + + + + + + + + + ..\packages\System.Threading.Tasks.Parallel\lib\netstandard1.3\System.Threading.Tasks.Parallel.dll + True + True + + + + + + + + + ..\packages\System.Threading.Thread\lib\netstandard1.3\System.Threading.Thread.dll + True + True + + + + + + + + + ..\packages\System.Threading.ThreadPool\lib\netstandard1.3\System.Threading.ThreadPool.dll + True + True + + + + + + + + + ..\packages\System.ValueTuple\lib\netstandard1.0\System.ValueTuple.dll + True + True + + + + + + + ..\packages\System.ValueTuple\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + True + True + + + + + + + + + True + + + ..\packages\System.Xml.ReaderWriter\lib\net46\System.Xml.ReaderWriter.dll + True + True + + + + + + + ..\packages\System.Xml.ReaderWriter\lib\netstandard1.3\System.Xml.ReaderWriter.dll + True + True + + + + + + + + + True + + + + + + + ..\packages\System.Xml.XDocument\lib\netstandard1.3\System.Xml.XDocument.dll + True + True + + + + + \ No newline at end of file diff --git a/KerbalName/KerbalName/paket.references b/KerbalName/KerbalName/paket.references new file mode 100755 index 0000000..18120d0 --- /dev/null +++ b/KerbalName/KerbalName/paket.references @@ -0,0 +1,4 @@ +FSharp.Core +System.Runtime +System.IO +Argu \ No newline at end of file diff --git a/KerbalName/KerbalNameData/Prefixes.txt b/KerbalName/KerbalNameData/Prefixes.txt new file mode 100755 index 0000000..9113db2 --- /dev/null +++ b/KerbalName/KerbalNameData/Prefixes.txt @@ -0,0 +1,96 @@ +Ad +Al +Ald +An +Bar +Bart +Bil +Billy-Bob +Bob +Bur +Cal +Cam +Chad +Cor +Dan +Der +Des +Dil +Do +Don +Dood +Dud +Dun +Ed +El +En +Er +Fer +Fred +Gene +Geof +Ger +Gil +Greg +Gus +Had +Hal +Han +Har +Hen +Her +Hud +Jed +Jen +Jer +Joe +John +Jon +Jor +Kel +Ken +Ker +Kir +Lan +Lem +Len +Lo +Lod +Lu +Lud +Mac +Mal +Mat +Mel +Mer +Mil +Mit +Mun +Ned +Neil +Nel +New +Ob +Or +Pat +Phil +Ray +Rib +Rich +Ro +Rod +Ron +Sam +Sean +See +Shel +Shep +Sher +Sid +Sig +Son +Thom +Thomp +Tom +Wehr +Wil \ No newline at end of file diff --git a/KerbalName/KerbalNameData/Proper.txt b/KerbalName/KerbalNameData/Proper.txt new file mode 100755 index 0000000..a3b63eb --- /dev/null +++ b/KerbalName/KerbalNameData/Proper.txt @@ -0,0 +1,37 @@ +Al +Alan +Archibald +Buzz +Carson +Chad +Charlie +Chris +Chuck +Dean +Ed +Edan +Edlu +Frank +Franklin +Gus +Hans +Jack +James +Jim +Kirk +Kurt +Lars +Luke +Mac +Matt +Phil +Randall +Scott +Scott +Sean +Steve +Tom +Will +Yuri +Olev +Dimitry \ No newline at end of file diff --git a/KerbalName/KerbalNameData/Suffixes.txt b/KerbalName/KerbalNameData/Suffixes.txt new file mode 100755 index 0000000..9da20e5 --- /dev/null +++ b/KerbalName/KerbalNameData/Suffixes.txt @@ -0,0 +1,119 @@ +ald +bal +bald +bart +bas +berry +bert +bin +ble +bles +bo +bree +brett +bro +bur +burry +bus +by +cal +can +cas +cott +dan +das +den +din +do +don +dorf +dos +dous +dred +drin +dun +ely +emone +emy +eny +fal +fel +fen +field +ford +fred +frey +frey +frid +frod +fry +furt +gan +gard +gas +gee +gel +ger +gun +hat +ing +ke +kin +lan +las +ler +ley +lie +lin +lin +lo +lock +long +lorf +ly +mal +man +min +ming +mon +more +mund +my +nand +nard +ner +ney +nie +ny +oly +ory +rey +rick +rie +righ +rim +rod +ry +sby +sel +sen +sey +ski +son +sted +ster +sy +ton +top +trey +van +vey +vin +vis +well +wig +win +wise +zer +zon +zor \ No newline at end of file diff --git a/KerbalName/build.cmd b/KerbalName/build.cmd new file mode 100755 index 0000000..e5ad79b --- /dev/null +++ b/KerbalName/build.cmd @@ -0,0 +1,14 @@ +@echo off +cls + +.paket\paket.bootstrapper.exe +if errorlevel 1 ( + exit /b %errorlevel% +) + +.paket\paket.exe restore +if errorlevel 1 ( + exit /b %errorlevel% +) + +packages\FAKE\tools\FAKE.exe build.fsx %* diff --git a/KerbalName/build.fsx b/KerbalName/build.fsx new file mode 100755 index 0000000..c3a40bf --- /dev/null +++ b/KerbalName/build.fsx @@ -0,0 +1,51 @@ +// include Fake libs +#r "./packages/FAKE/tools/FakeLib.dll" + +open Fake + +// Directories +let buildDir = "./build/" +let deployDir = "./deploy/" + + +// Filesets +let appReferences = + !! "/**/*.csproj" + ++ "/**/*.fsproj" + +// version info +let version = "1.2a" + +// Targets +Target "Clean" (fun _ -> + CleanDirs [buildDir; deployDir] +) + +Target "Build" (fun _ -> + MSBuildDebug buildDir "Build" appReferences + |> Log "AppBuild-Output: " +) + +Target "BuildRelease" (fun _ -> + MSBuildRelease buildDir "Build" appReferences + |> Log "AppBuild-Output: " +) + +Target "Deploy" (fun _ -> + // Copy name data to buildDir for deployment + FileUtils.cp_r "KerbalNameData" (buildDir + "KerbalNameData/") + + !! (buildDir + "/**/*.*") + -- "*.zip" + |> Zip buildDir (deployDir + "KerbalName." + version + ".zip") +) + +// Build order +"Clean" + ==> "BuildRelease" + ==> "Deploy" + +"Build" <=> "BuildRelease" + +// start build +RunTargetOrDefault "Build" diff --git a/KerbalName/build.sh b/KerbalName/build.sh new file mode 100755 index 0000000..e225157 --- /dev/null +++ b/KerbalName/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if test "$OS" = "Windows_NT" +then + # use .Net + + .paket/paket.bootstrapper.exe + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + + .paket/paket.exe restore + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + + packages/FAKE/tools/FAKE.exe $@ +else + # use mono + mono .paket/paket.bootstrapper.exe + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + + mono .paket/paket.exe restore + exit_code=$? + if [ $exit_code -ne 0 ]; then + exit $exit_code + fi + mono packages/FAKE/tools/FAKE.exe $@ +fi diff --git a/KerbalName/paket.dependencies b/KerbalName/paket.dependencies new file mode 100755 index 0000000..bbcb085 --- /dev/null +++ b/KerbalName/paket.dependencies @@ -0,0 +1,4 @@ +source https://www.nuget.org/api/v2 +nuget FAKE +nuget FSharp.Core +nuget Argu \ No newline at end of file diff --git a/KerbalName/paket.lock b/KerbalName/paket.lock new file mode 100755 index 0000000..29d31e7 --- /dev/null +++ b/KerbalName/paket.lock @@ -0,0 +1,569 @@ +NUGET + remote: https://www.nuget.org/api/v2 + Argu (3.7) + FSharp.Core (>= 4.0.1.7-alpha) - framework: >= net463, >= netstandard16 + NETStandard.Library (>= 1.6) - framework: >= net463, >= netstandard16 + System.Xml.XDocument (>= 4.0.11) - framework: >= net463, >= netstandard16 + FAKE (4.56) + FSharp.Core (4.1.0.2) + System.Collections (>= 4.0.11) - framework: >= netstandard16 + System.Console (>= 4.0) - framework: >= netstandard16 + System.Diagnostics.Debug (>= 4.0.11) - framework: >= netstandard16 + System.Diagnostics.Tools (>= 4.0.1) - framework: >= netstandard16 + System.Globalization (>= 4.0.11) - framework: >= netstandard16 + System.IO (>= 4.1) - framework: >= netstandard16 + System.Linq (>= 4.1) - framework: >= netstandard16 + System.Linq.Expressions (>= 4.1) - framework: >= netstandard16 + System.Linq.Queryable (>= 4.0.1) - framework: >= netstandard16 + System.Net.Requests (>= 4.0.11) - framework: >= netstandard16 + System.Reflection (>= 4.1) - framework: >= netstandard16 + System.Reflection.Extensions (>= 4.0.1) - framework: >= netstandard16 + System.Resources.ResourceManager (>= 4.0.1) - framework: >= netstandard16 + System.Runtime (>= 4.1) - framework: >= netstandard16 + System.Runtime.Extensions (>= 4.1) - framework: >= netstandard16 + System.Runtime.Numerics (>= 4.0.1) - framework: >= netstandard16 + System.Text.RegularExpressions (>= 4.1) - framework: >= netstandard16 + System.Threading (>= 4.0.11) - framework: >= netstandard16 + System.Threading.Tasks (>= 4.0.11) - framework: >= netstandard16 + System.Threading.Tasks.Parallel (>= 4.0.1) - framework: >= netstandard16 + System.Threading.Thread (>= 4.0) - framework: >= netstandard16 + System.Threading.ThreadPool (>= 4.0.10) - framework: >= netstandard16 + System.Threading.Timer (>= 4.0.1) - framework: >= netstandard16 + System.ValueTuple (>= 4.3) - framework: >= net10, netstandard10, netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 + Microsoft.NETCore.Platforms (1.1) - framework: >= net10, >= netstandard10, netstandard13 + Microsoft.NETCore.Targets (1.1) - framework: >= net10, >= netstandard10, netstandard13 + Microsoft.Win32.Primitives (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + NETStandard.Library (1.6.1) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard10 + Microsoft.Win32.Primitives (>= 4.3) - framework: >= net46, >= netstandard13 + System.AppContext (>= 4.3) - framework: >= net46, >= netstandard13 + System.Collections (>= 4.3) - framework: >= netstandard10 + System.Collections.Concurrent (>= 4.3) - framework: >= net45, >= netstandard11 + System.Console (>= 4.3) - framework: >= net46, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard10 + System.Diagnostics.Tools (>= 4.3) - framework: >= netstandard10 + System.Diagnostics.Tracing (>= 4.3) - framework: >= net45, >= netstandard11 + System.Globalization (>= 4.3) - framework: >= netstandard10 + System.Globalization.Calendars (>= 4.3) - framework: >= net46, >= netstandard13 + System.IO (>= 4.3) - framework: >= netstandard10 + System.IO.Compression (>= 4.3) - framework: >= net45, >= netstandard11 + System.IO.Compression.ZipFile (>= 4.3) - framework: >= net46, >= netstandard13 + System.IO.FileSystem (>= 4.3) - framework: >= net46, >= netstandard13 + System.IO.FileSystem.Primitives (>= 4.3) - framework: >= net46, >= netstandard13 + System.Linq (>= 4.3) - framework: >= netstandard10 + System.Linq.Expressions (>= 4.3) - framework: >= netstandard10 + System.Net.Http (>= 4.3) - framework: >= net45, >= netstandard11 + System.Net.Primitives (>= 4.3) - framework: >= netstandard10 + System.Net.Sockets (>= 4.3) - framework: >= net46, >= netstandard13 + System.ObjectModel (>= 4.3) - framework: >= netstandard10 + System.Reflection (>= 4.3) - framework: >= netstandard10 + System.Reflection.Extensions (>= 4.3) - framework: >= netstandard10 + System.Reflection.Primitives (>= 4.3) - framework: >= netstandard10 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard10 + System.Runtime (>= 4.3) - framework: >= netstandard10 + System.Runtime.Extensions (>= 4.3) - framework: >= netstandard10 + System.Runtime.Handles (>= 4.3) - framework: >= net46, >= netstandard13 + System.Runtime.InteropServices (>= 4.3) - framework: >= net45, >= netstandard11 + System.Runtime.InteropServices.RuntimeInformation (>= 4.3) - framework: >= net45, >= netstandard11 + System.Runtime.Numerics (>= 4.3) - framework: >= net45, >= netstandard11 + System.Security.Cryptography.Algorithms (>= 4.3) - framework: >= net46, >= netstandard13 + System.Security.Cryptography.Encoding (>= 4.3) - framework: >= net46, >= netstandard13 + System.Security.Cryptography.Primitives (>= 4.3) - framework: >= net46, >= netstandard13 + System.Security.Cryptography.X509Certificates (>= 4.3) - framework: >= net46, >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: >= netstandard10 + System.Text.Encoding.Extensions (>= 4.3) - framework: >= netstandard10 + System.Text.RegularExpressions (>= 4.3) - framework: >= netstandard10 + System.Threading (>= 4.3) - framework: >= netstandard10 + System.Threading.Tasks (>= 4.3) - framework: >= netstandard10 + System.Threading.Timer (>= 4.3) - framework: >= net451, >= netstandard12 + System.Xml.ReaderWriter (>= 4.3) - framework: >= netstandard10 + System.Xml.XDocument (>= 4.3) - framework: >= netstandard10 + runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.native.System (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) + Microsoft.NETCore.Targets (>= 1.1) + runtime.native.System.IO.Compression (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) + Microsoft.NETCore.Targets (>= 1.1) + runtime.native.System.Net.Http (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) + Microsoft.NETCore.Targets (>= 1.1) + runtime.native.System.Security.Cryptography.Apple (4.3) - framework: >= net463, >= netstandard16 + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (>= 4.3) + runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) + runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (4.3) - framework: >= net463, >= netstandard16 + runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + System.AppContext (4.3) - framework: >= net463, >= netstandard16 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Buffers (4.3) - framework: >= net463, >= netstandard16 + System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard11 + System.Diagnostics.Tracing (>= 4.3) - framework: >= netstandard11 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard11 + System.Runtime (>= 4.3) - framework: >= netstandard11 + System.Threading (>= 4.3) - framework: >= netstandard11 + System.Collections (4.3) - framework: >= net10, >= netstandard10 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Collections.Concurrent (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Reflection (>= 4.3) - framework: >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Console (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 + System.IO (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: >= netstandard13 + System.Diagnostics.Debug (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Diagnostics.DiagnosticSource (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: netstandard11, >= netstandard13 + System.Diagnostics.Tracing (>= 4.3) - framework: netstandard11, >= netstandard13 + System.Reflection (>= 4.3) - framework: netstandard11, >= netstandard13 + System.Runtime (>= 4.3) - framework: netstandard11, >= netstandard13 + System.Threading (>= 4.3) - framework: netstandard11, >= netstandard13 + System.Diagnostics.Tools (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard10 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard10 + System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard10 + System.Diagnostics.Tracing (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15 + System.Globalization (4.3) - framework: >= net10, >= netstandard10 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Globalization.Calendars (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 + System.Globalization (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Globalization.Extensions (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + System.Globalization (>= 4.3) - framework: >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: >= netstandard13 + System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard13 + System.IO (4.3) - framework: >= net10, netstandard10, netstandard13, >= netstandard15 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.IO.Compression (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + runtime.native.System (>= 4.3) - framework: >= netstandard13 + runtime.native.System.IO.Compression (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Buffers (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.IO (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime.Handles (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime.InteropServices (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.IO.Compression.ZipFile (4.3) - framework: >= net463, >= netstandard16 + System.Buffers (>= 4.3) - framework: >= netstandard13 + System.IO (>= 4.3) - framework: >= netstandard13 + System.IO.Compression (>= 4.3) - framework: >= netstandard13 + System.IO.FileSystem (>= 4.3) - framework: >= netstandard13 + System.IO.FileSystem.Primitives (>= 4.3) - framework: >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: >= netstandard13 + System.IO.FileSystem (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 + System.IO (>= 4.3) - framework: >= netstandard13 + System.IO.FileSystem.Primitives (>= 4.3) - framework: >= net46, >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.Handles (>= 4.3) - framework: >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: >= netstandard13 + System.IO.FileSystem.Primitives (4.3) - framework: >= net463, >= netstandard16 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Linq (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard16 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard16 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Linq.Expressions (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.IO (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Linq (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.ObjectModel (>= 4.3) - framework: >= netstandard16 + System.Reflection (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard16 + System.Reflection.Emit (>= 4.3) - framework: >= netstandard16 + System.Reflection.Emit.ILGeneration (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Reflection.Emit.Lightweight (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Reflection.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Reflection.Primitives (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Reflection.TypeExtensions (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard16 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Linq.Queryable (4.3) - framework: >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Linq (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Linq.Expressions (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Reflection (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Reflection.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Net.Http (4.3.1) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard13, >= netstandard16 + runtime.native.System (>= 4.3) - framework: >= netstandard16 + runtime.native.System.Net.Http (>= 4.3) - framework: >= netstandard16 + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Diagnostics.DiagnosticSource (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Globalization (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Globalization.Extensions (>= 4.3) - framework: >= netstandard16 + System.IO (>= 4.3) - framework: dnxcore50, netstandard11, netstandard13, >= netstandard16 + System.IO.FileSystem (>= 4.3) - framework: >= netstandard16 + System.Net.Primitives (>= 4.3) - framework: dnxcore50, netstandard11, netstandard13, >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, netstandard13, >= netstandard16 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Runtime.Handles (>= 4.3) - framework: netstandard13, >= netstandard16 + System.Runtime.InteropServices (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Security.Cryptography.Algorithms (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.Encoding (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.Primitives (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.X509Certificates (>= 4.3) - framework: >= net46, dnxcore50, netstandard13, >= netstandard16 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, netstandard11, netstandard13, >= netstandard16 + System.Threading (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, netstandard13, >= netstandard16 + System.Net.Primitives (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 + System.Runtime.Handles (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Net.Requests (4.3) - framework: >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.IO (>= 4.3) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 + System.Net.Http (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Net.Primitives (>= 4.3) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 + System.Net.WebHeaderCollection (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Net.Sockets (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 + System.IO (>= 4.3) - framework: >= netstandard13 + System.Net.Primitives (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: >= netstandard13 + System.Net.WebHeaderCollection (4.3) - framework: >= netstandard16 + System.Collections (>= 4.3) - framework: >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: >= netstandard13 + System.ObjectModel (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Reflection (4.3) - framework: >= net10, >= netstandard10 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.IO (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Reflection.Primitives (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Reflection.Emit (4.3) - framework: >= net463, >= netstandard16 + System.IO (>= 4.3) - framework: >= netstandard11 + System.Reflection (>= 4.3) - framework: >= netstandard11 + System.Reflection.Emit.ILGeneration (>= 4.3) - framework: >= netstandard11 + System.Reflection.Primitives (>= 4.3) - framework: >= netstandard11 + System.Runtime (>= 4.3) - framework: >= netstandard11 + System.Reflection.Emit.ILGeneration (4.3) - framework: >= net463, >= netstandard16 + System.Reflection (>= 4.3) - framework: >= netstandard10 + System.Reflection.Primitives (>= 4.3) - framework: >= netstandard10 + System.Runtime (>= 4.3) - framework: >= netstandard10 + System.Reflection.Emit.Lightweight (4.3) - framework: >= net463, >= netstandard16 + System.Reflection (>= 4.3) - framework: >= netstandard10 + System.Reflection.Emit.ILGeneration (>= 4.3) - framework: >= netstandard10 + System.Reflection.Primitives (>= 4.3) - framework: >= netstandard10 + System.Runtime (>= 4.3) - framework: >= netstandard10 + System.Reflection.Extensions (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard10 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard10 + System.Reflection (>= 4.3) - framework: dnxcore50, >= netstandard10 + System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard10 + System.Reflection.Primitives (4.3) - framework: >= net10, netstandard10, netstandard13, >= netstandard15 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard10 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard10 + System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard10 + System.Reflection.TypeExtensions (4.3) - framework: >= net463, >= netstandard16 + System.Reflection (>= 4.3) - framework: >= net462, dnxcore50, netstandard13, >= netstandard15 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard15 + System.Resources.ResourceManager (4.3) - framework: >= net10, >= netstandard10 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard10 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard10 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard10 + System.Reflection (>= 4.3) - framework: dnxcore50, >= netstandard10 + System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard10 + System.Runtime (4.3) - framework: >= net10, >= netstandard10, netstandard13 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, netstandard12, netstandard13, >= netstandard15 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, netstandard12, netstandard13, >= netstandard15 + System.Runtime.Extensions (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 + System.Runtime.Handles (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.InteropServices (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15, netcore11 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15, netcore11 + System.Reflection (>= 4.3) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15, netcore11 + System.Reflection.Primitives (>= 4.3) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15, netcore11 + System.Runtime (>= 4.3) - framework: net462, >= net463, dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15, netcore11 + System.Runtime.Handles (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard15, netcore11 + System.Runtime.InteropServices.RuntimeInformation (4.3) - framework: >= net463, >= netstandard16 + runtime.native.System (>= 4.3) - framework: >= netstandard11 + System.Reflection (>= 4.3) - framework: dnxcore50, >= netstandard11 + System.Reflection.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard11 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard11 + System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard11 + System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard11 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard11 + System.Runtime.Numerics (4.3) - framework: >= net463, >= netstandard16 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Security.Cryptography.Algorithms (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard16 + runtime.native.System.Security.Cryptography.Apple (>= 4.3) - framework: >= netstandard16 + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard16 + System.Collections (>= 4.3) - framework: >= netstandard16 + System.IO (>= 4.3) - framework: >= net463, dnxcore50, netstandard13, netstandard14, >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime (>= 4.3) - framework: >= net463, dnxcore50, netstandard13, netstandard14, >= netstandard16 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime.Handles (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime.InteropServices (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime.Numerics (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.Encoding (>= 4.3) - framework: >= net463, dnxcore50, >= netstandard16 + System.Security.Cryptography.Primitives (>= 4.3) - framework: net46, net461, >= net463, dnxcore50, netstandard13, netstandard14, >= netstandard16 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Security.Cryptography.Cng (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: netstandard14, >= netstandard16 + System.IO (>= 4.3) - framework: netstandard13, netstandard14, >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: netstandard14, >= netstandard16 + System.Runtime (>= 4.3) - framework: netstandard13, netstandard14, >= netstandard16 + System.Runtime.Extensions (>= 4.3) - framework: netstandard14, >= netstandard16 + System.Runtime.Handles (>= 4.3) - framework: netstandard13, netstandard14, >= netstandard16 + System.Runtime.InteropServices (>= 4.3) - framework: netstandard14, >= netstandard16 + System.Security.Cryptography.Algorithms (>= 4.3) - framework: net46, net461, >= net463, netstandard13, netstandard14, >= netstandard16 + System.Security.Cryptography.Encoding (>= 4.3) - framework: netstandard14, >= netstandard16 + System.Security.Cryptography.Primitives (>= 4.3) - framework: net46, net461, >= net463, netstandard13, netstandard14, >= netstandard16 + System.Text.Encoding (>= 4.3) - framework: netstandard14, >= netstandard16 + System.Security.Cryptography.Csp (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + System.IO (>= 4.3) - framework: >= netstandard13 + System.Reflection (>= 4.3) - framework: >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: >= netstandard13 + System.Runtime.Handles (>= 4.3) - framework: >= netstandard13 + System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard13 + System.Security.Cryptography.Algorithms (>= 4.3) - framework: >= net46, >= netstandard13 + System.Security.Cryptography.Encoding (>= 4.3) - framework: >= netstandard13 + System.Security.Cryptography.Primitives (>= 4.3) - framework: >= net46, >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: >= netstandard13 + System.Threading (>= 4.3) - framework: >= netstandard13 + System.Security.Cryptography.Encoding (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard13 + System.Collections (>= 4.3) - framework: >= netstandard13 + System.Collections.Concurrent (>= 4.3) - framework: >= netstandard13 + System.Linq (>= 4.3) - framework: >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: >= netstandard13 + System.Runtime.Handles (>= 4.3) - framework: >= netstandard13 + System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard13 + System.Security.Cryptography.Primitives (>= 4.3) - framework: >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: >= netstandard13 + System.Security.Cryptography.OpenSsl (4.3) - framework: >= net463, >= netstandard16 + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= net463, >= netstandard16, monoandroid, monotouch, xamarinios, xamarinmac + System.Collections (>= 4.3) - framework: >= netstandard16 + System.IO (>= 4.3) - framework: >= net463, >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard16 + System.Runtime (>= 4.3) - framework: >= net463, >= netstandard16 + System.Runtime.Extensions (>= 4.3) - framework: >= net463, >= netstandard16 + System.Runtime.Handles (>= 4.3) - framework: >= netstandard16 + System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard16 + System.Runtime.Numerics (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.Algorithms (>= 4.3) - framework: >= net463, >= netstandard16 + System.Security.Cryptography.Encoding (>= 4.3) - framework: >= net463, >= netstandard16 + System.Security.Cryptography.Primitives (>= 4.3) - framework: >= net463, >= netstandard16 + System.Text.Encoding (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.Primitives (4.3) - framework: >= net463, >= netstandard16 + System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard13 + System.Globalization (>= 4.3) - framework: >= netstandard13 + System.IO (>= 4.3) - framework: >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Threading (>= 4.3) - framework: >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: >= netstandard13 + System.Security.Cryptography.X509Certificates (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard16 + runtime.native.System (>= 4.3) - framework: >= netstandard16 + runtime.native.System.Net.Http (>= 4.3) - framework: >= netstandard16 + runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard16 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Globalization.Calendars (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.IO (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.IO.FileSystem (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.IO.FileSystem.Primitives (>= 4.3) - framework: >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard13, netstandard14, >= netstandard16 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime.Handles (>= 4.3) - framework: dnxcore50, netstandard13, netstandard14, >= netstandard16 + System.Runtime.InteropServices (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime.Numerics (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Security.Cryptography.Algorithms (>= 4.3) - framework: net46, >= net461, dnxcore50, netstandard13, netstandard14, >= netstandard16 + System.Security.Cryptography.Cng (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Security.Cryptography.Csp (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.Encoding (>= 4.3) - framework: net46, >= net461, dnxcore50, netstandard13, netstandard14, >= netstandard16 + System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard16 + System.Security.Cryptography.Primitives (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Text.Encoding (4.3) - framework: >= net10, netstandard10, netstandard13, >= netstandard15 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Text.Encoding.Extensions (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Text.RegularExpressions (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard16, netcore11 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard16 + System.Threading (4.3) - framework: >= net463, >= netstandard16 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Threading.Tasks (4.3) - framework: >= net10, netstandard10, netstandard13, >= netstandard15 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Threading.Tasks.Extensions (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: >= netstandard10 + System.Runtime (>= 4.3) - framework: >= netstandard10 + System.Threading.Tasks (>= 4.3) - framework: >= netstandard10 + System.Threading.Tasks.Parallel (4.3) - framework: >= netstandard16 + System.Collections.Concurrent (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 + System.Threading.Thread (4.3) - framework: >= netstandard16 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Threading.ThreadPool (4.3) - framework: >= netstandard16 + System.Runtime (>= 4.3) - framework: >= netstandard13 + System.Runtime.Handles (>= 4.3) - framework: >= netstandard13 + System.Threading.Timer (4.3) - framework: >= net463, >= netstandard16 + Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard12 + Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard12 + System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard12 + System.ValueTuple (4.3) - framework: >= net10, netstandard10, netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 + System.Collections (>= 4.3) - framework: >= netstandard10 + System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard10 + System.Runtime (>= 4.3) - framework: >= netstandard10 + System.Xml.ReaderWriter (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.IO (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.IO.FileSystem (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.IO.FileSystem.Primitives (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime.InteropServices (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Text.Encoding.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Text.RegularExpressions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Threading.Tasks.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Xml.XDocument (4.3) - framework: >= net463, >= netstandard16 + System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Diagnostics.Tools (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.IO (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Reflection (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 + System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Text.Encoding (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 + System.Xml.ReaderWriter (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d2f257 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# random-stuff + +In the interest of transparency and/or being vaguely useful, I'm releasing random junk from my projects folder publicly. +This comes with absolutely no guarantee of support or correct function, although if you need some of this for something I will *try* and answer any queries you might have. + +## Contents (incomplete and rough list) + +* some interpreters for esolangs due to events on the esolangs discord +* bad assembly hello world for some reason +* political compass visualizer thing for one Discord server +* simple un-hexadecimal-izer program (`base64 -d` exists but somehow not `base16 -d` or something) +* scripts for packing music + metadata onto Computronics (a Minecraft mod) tape images +* some thing to generate WAV files containing beeping noises +* fairly transferable small bits of an abandoned JS project +* an extremely bad and/or unfinished cookie clicker thing where you press the enter key instead of clicking +* a very simple web API wrapper for `luamin` +* some bodged old version of [it-was-inevitable](https://github.com/BenLubar/it_was_inevitable) which runs a local webserver instead of sending to Mastodon +* an extremely cursed program which bruteforces regexes or something? +* `realtau.txt`, which seemingly contains 100000 digits of τ. I wonder if there's a faketau somewhere. +* some weird thing which lets you use synonyms to get attributes on python objects +* something which generates random vaguely human readable names in Elm. Please note that I do NOT endorse the use of Elm and this is provided mostly just to make the languages list at the side weirder. +* F# kerbal name generator & very basic stack calculator +* importer part of an unfinished wikipedia database dump viewer \ No newline at end of file diff --git a/Stackulator.fs b/Stackulator.fs new file mode 100755 index 0000000..2902344 --- /dev/null +++ b/Stackulator.fs @@ -0,0 +1,100 @@ +open System +open System.Numerics + +type Stack = StackContents of Complex list + +let splitPart (what:char) index (stringIn:string) = stringIn.Split(what).[index] +let spliti = splitPart 'i' +let firstInSpliti = spliti 0 +let secondInSpliti = spliti 1 +let isDoubleAsString text = System.Double.TryParse text |> fst +let doubleFromString text = System.Double.TryParse text |> snd +let isImaginaryAsString (text:string) = + match text.Contains("i") with + | false -> false + | true -> + let normalPart = firstInSpliti text + isDoubleAsString normalPart +let imaginaryFromString text = + let imaginaryPart = doubleFromString (firstInSpliti text) + Complex(0.0, imaginaryPart) + +let showStack (StackContents contents) = + printfn "%A" contents // Print unpacked StackContents with formatting string + StackContents (contents) // Repack the StackContents + +let push value (StackContents contents) = + StackContents (value::contents) + +let pop (StackContents contents) = + match contents with + | top::rest -> // Separate top from rest + (top, StackContents rest) // Stack contents must be the StackContents type. + | [] -> // Check for stack underflow + failwith "Stack underflow" + +let binary func stack = + let x, newStack = pop stack + let y, newestStack = pop newStack + let z = func y x // This is deliberately swapped, because we are working on a stack + push z newestStack + +let unary func stack = + let x, newStack = pop stack + push (func x) stack + +let dup stack = + let x, _ = pop stack // Drop the new stack, we want to duplicate "x" + push x stack + +let swap stack = + let x, newStack = pop stack + let y, newerStack = pop newStack + push y (push x newerStack) + +let drop stack = + let _, newStack = pop stack // Pop one off the top and ignore it + newStack + +let numberInput value stack = push value stack + +let add = binary (+) +let multiply = binary (*) +let subtract = binary (-) +let divide = binary (/) +let negate = unary (fun x -> -(x)) +let square = unary (fun x -> x * x) +let cube = dup >> dup >> multiply >> multiply +let exponent = binary ( ** ) + +let show stack = + let value, _ = pop(stack) + printfn "%A" value + stack // We're going to keep the same stack as before. + +let empty = StackContents [] + +let splitString (text:string) = text.Split ' ' + +let processTokenString stack token = + match token with + | "*" -> stack |> multiply + | "+" -> stack |> add + | "/" -> stack |> divide + | "+-" -> stack |> negate + | "sqr" -> stack |> square + | "cub" -> stack |> cube + | "**" | "^" -> stack |> exponent + | _ when isDoubleAsString token -> + let doubleInString = doubleFromString token + numberInput (Complex(doubleInString, 0.0)) stack + | _ when isImaginaryAsString token -> + let imaginaryInString = imaginaryFromString token + numberInput imaginaryInString stack + | _ -> showStack stack // For easier debugging. + +Console.Write("Please enter your expression here: ") +let userExpression = Console.ReadLine() +let splitExpression = splitString userExpression + +let resultantStack = List.fold processTokenString (empty) (Array.toList splitExpression) |> showStack diff --git a/accursed-autoregex/allstrings.py b/accursed-autoregex/allstrings.py new file mode 100755 index 0000000..e818442 --- /dev/null +++ b/accursed-autoregex/allstrings.py @@ -0,0 +1,44 @@ +#!/bin/env python3 + +chars = [chr(n) for n in range(126)] +firstchar = chars[0] +lastchar = chars[len(chars) - 1] + +def increment_char(character): + return chr(ord(character) + 1) + +def old_increment_string(string_to_increment): + reversed_string = list(reversed(string_to_increment)) # Reverse the string for easier work. + for rindex, char in enumerate(reversed_string): + if char == lastchar: # If we can't increment this char further, try the next ones. + reversed_string[rindex] = firstchar # Set the current char back to the first one. + reversed_string[rindex + 1] = increment_char(reversed_string[rindex + 1]) # Increment the next one along. + else: + # We only want to increment ONE char, unless we need to "carry". + reversed_string[rindex] = increment_char(reversed_string[rindex]) + break + return ''.join(list(reversed(reversed_string))) + +def increment_string(to_increment): + reversed_string = list(to_increment) # Reverse the string for easier work. + for rindex, char in enumerate(reversed_string): + if char == lastchar: # If we can't increment this char further, try the next ones. + reversed_string[rindex] = firstchar # Set the current char back to the first one. + reversed_string[rindex + 1] = increment_char(reversed_string[rindex + 1]) # Increment the next one along. + else: + # We only want to increment ONE char, unless we need to "carry". + reversed_string[rindex] = increment_char(reversed_string[rindex]) + break + return ''.join(list(reversed_string)) + +def string_generator(): + length = 0 + while 1: + length += 1 + string = chars[0] * length + while True: + try: + string = increment_string(string) + except IndexError: # Incrementing has gone out of the char array, move onto next length + break + yield string diff --git a/accursed-autoregex/autoregex.py b/accursed-autoregex/autoregex.py new file mode 100755 index 0000000..22f5669 --- /dev/null +++ b/accursed-autoregex/autoregex.py @@ -0,0 +1,82 @@ +#!/bin/env python3 +import re, sys, allstrings, multiprocessing +from setproctitle import setproctitle # https://github.com/dvarrazzo/py-setproctitle + +string = sys.argv[1] + +def gen_strings(out_queue): + setproctitle("AutoRegexer StringGen") + for string in allstrings.string_generator(): + out_queue.put(string) + +def test_strings(regex_queue, substring_queue, out_queue, search_in): + setproctitle("AutoRegexer Tester") + + while 1: + try: # Regexes are errory things and we shove in random ones, so ignore errors. + regex_raw = regex_queue.get() + substring = substring_queue.get() + + regex = re.compile(regex_raw) + result = re.sub(regex, substring, string) + + out_queue.put({"result": result, "regex": regex_raw, "substring": substring}) # Package the values used and send them off. + except: + pass + +def print_strings(in_queue, ignore): + i = 0 + setproctitle("AutoRegexer IO") + + while 1: + i += 1 + + attempt = in_queue.get() + + if attempt["result"] == ignore: # Ignore regexes deemed boring.. + continue + + print(str(i) + "th attempt: replacing " + attempt["substring"] + + " with " + attempt["regex"] + " results in " + attempt["result"] + ".") + +if __name__ == "__main__": + print_queue = multiprocessing.Queue() # Create the IO queue + regex_queue = multiprocessing.Queue() # Create queue to distribute generated strings. + substring_queue = multiprocessing.Queue() + + print_process = multiprocessing.Process(target=print_strings, args=(print_queue, string), name="AutoRegexer IO") # Spawn a process to handle our IO. + regex_gen_process = multiprocessing.Process(target=gen_strings, args=(regex_queue,), name="AutoRegexer RegexGen") # Create process to generate our regexes. + substring_gen_process = multiprocessing.Process(target=gen_strings, args=(substring_queue,), name="AutoRegexer SubstringGen") # Make a process to generate the replaced substrings. + print_process.start() + regex_gen_process.start() + substring_gen_process.start() + + #with multiprocessing.Pool(processes=7) as pool: + for local_process_id in range(7): + #while True: + proc_name = "AutoRegexer " + str(local_process_id) + proc = multiprocessing.Process(target=test_strings, args=(regex_queue, substring_queue, print_queue, string), name=proc_name) + proc.start() + + #string_gen_process = multiprocessing.Process(target=gen_strings, args=(string_queue,), name="AutoRegexer StringGen") + #string_gen_process.start() + + setproctitle("AutoRegexer Master") + +# Obsolete old version. +''' +for iterations, regex_and_sub in enumerate(allstrings.string_generator()): + result = "" + try: + half_point = len(regex_and_sub) // 2 + regex_raw = regex_and_sub[:half_point] + substring = regex_and_sub[half_point:] + + regex = re.compile(regex_raw) + result = re.sub(regex_raw, substring, string) + except: + pass + finally: + if result != string and result != "": + print("Replacing `" + regex_raw + "` with `" + substring + "` produces `" + result + "`.") +''' diff --git a/config.ts b/config.ts new file mode 100644 index 0000000..84acef5 --- /dev/null +++ b/config.ts @@ -0,0 +1,22 @@ +import { parse } from "toml" +import { readFileSync } from "fs" +import { join } from "path" +import { path } from "ramda" + +import * as log from "./log" + +const defaults = { + production: process.env.NODE_ENV === "production" +} + +const config = parse(readFileSync(process.env.CONFIG_FILE || join(__dirname, "..", "config.toml"), { encoding: "utf8" })) + +export const get = key => { + const arrKey = key.split(".") + const out = path(arrKey, config) || path(arrKey, defaults) + if (out === undefined) { + log.error(`Configuration parameter ${key} missing`) + process.exit(1) + } + return out +} \ No newline at end of file diff --git a/db.ts b/db.ts new file mode 100755 index 0000000..eb792c0 --- /dev/null +++ b/db.ts @@ -0,0 +1,49 @@ +import Database = require("better-sqlite3") + +import * as C from "./config" +import * as log from "./log" + +export const DB = Database(C.get("db")) + +const migrations = [ +` +--whatever +` +] + +const executeMigration = DB.transaction((i) => { + const migration = migrations[i] + DB.exec(migration) + DB.pragma(`user_version = ${i + 1}`) + log.info(`Migrated to schema ${i + 1}`) +}) + +const schemaVersion = DB.pragma("user_version", { simple: true }) +if (schemaVersion < migrations.length) { + log.info(`Migrating DB - schema ${schemaVersion} used, schema ${migrations.length} available`) + for (let i = schemaVersion; i < migrations.length; i++) { + executeMigration(i) + } +} + +DB.pragma("foreign_keys = 1") + +const preparedStatements = new Map() + +export const SQL = (strings, ...params) => { + const sql = strings.join("?") + let stmt + const cachedValue = preparedStatements.get(sql) + if (!cachedValue) { + stmt = DB.prepare(sql) + preparedStatements.set(sql, stmt) + } else { + stmt = cachedValue + } + return { + get: () => stmt.get.apply(stmt, params), + run: () => stmt.run.apply(stmt, params), + all: () => stmt.all.apply(stmt, params), + statement: stmt + } +} \ No newline at end of file diff --git a/diacriticize.py b/diacriticize.py new file mode 100755 index 0000000..4f05f23 --- /dev/null +++ b/diacriticize.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +import random +import fileinput +import sys + +zalgo = [ + '\u030d', '\u030e', '\u0304', '\u0305', + '\u033f', '\u0311', '\u0306', '\u0310', + '\u0352', '\u0357', '\u0351', '\u0307', + '\u0308', '\u030a', '\u0342', '\u0343', + '\u0344', '\u034a', '\u034b', '\u034c', + '\u0303', '\u0302', '\u030c', '\u0350', + '\u0300', '\u0301', '\u030b', '\u030f', + '\u0312', '\u0313', '\u0314', '\u033d', + '\u0309', '\u0363', '\u0364', '\u0365', + '\u0366', '\u0367', '\u0368', '\u0369', + '\u036a', '\u036b', '\u036c', '\u036d', + '\u036e', '\u036f', '\u033e', '\u035b', + '\u0346', '\u031a', + '\u0316', '\u0317', '\u0318', '\u0319', + '\u031c', '\u031d', '\u031e', '\u031f', + '\u0320', '\u0324', '\u0325', '\u0326', + '\u0329', '\u032a', '\u032b', '\u032c', + '\u032d', '\u032e', '\u032f', '\u0330', + '\u0331', '\u0332', '\u0333', '\u0339', + '\u033a', '\u033b', '\u033c', '\u0345', + '\u0347', '\u0348', '\u0349', '\u034d', + '\u034e', '\u0353', '\u0354', '\u0355', + '\u0356', '\u0359', '\u035a', '\u0323', + '\u0315', '\u031b', '\u0340', '\u0341', + '\u0358', '\u0321', '\u0322', '\u0327', + '\u0328', '\u0334', '\u0335', '\u0336', + '\u034f', '\u035c', '\u035d', '\u035e', + '\u035f', '\u0360', '\u0362', '\u0338', + '\u0337', '\u0361', '\u0489' +] + +zero_width = ["\u200b", "\u200c", "\u200d"] + +def process_char(c): + return c + random.choice(zalgo) + +for line in fileinput.input(): +# line = line.replace("\n", "") + out = "".join([process_char(c) for c in line]) + sys.stdout.buffer.write(out.encode("utf-8")) diff --git a/it-was-inevitable/.gitignore b/it-was-inevitable/.gitignore new file mode 100755 index 0000000..7460463 --- /dev/null +++ b/it-was-inevitable/.gitignore @@ -0,0 +1 @@ +*.local.* diff --git a/it-was-inevitable/Dockerfile b/it-was-inevitable/Dockerfile new file mode 100755 index 0000000..aded57f --- /dev/null +++ b/it-was-inevitable/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.10.1 as builder + +COPY *.go /go/src/github.com/BenLubar/it_was_inevitable/ + +WORKDIR /go/src/github.com/BenLubar/it_was_inevitable + +RUN go get -d + +RUN CGO_ENABLED=0 go build -a -o /it_was_inevitable + +FROM benlubar/dwarffortress:df-ai-0.44.12-r1-update1 + +COPY --from=builder /it_was_inevitable /usr/local/bin/it_was_inevitable + +RUN sed -i /df_linux/dfhack -e "s/ setarch / exec setarch /" + +CMD ["it_was_inevitable"] diff --git a/it-was-inevitable/LICENSE b/it-was-inevitable/LICENSE new file mode 100755 index 0000000..c655218 --- /dev/null +++ b/it-was-inevitable/LICENSE @@ -0,0 +1,19 @@ +zlib License + +(C) 2018 Ben Lubar + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. diff --git a/it-was-inevitable/README.md b/it-was-inevitable/README.md new file mode 100755 index 0000000..135c929 --- /dev/null +++ b/it-was-inevitable/README.md @@ -0,0 +1,9 @@ +# Sentient Dwarf Fortress was inevitable. + +The source code that powers [@it\_was\_inevitable@botsin.space](https://botsin.space/@it_was_inevitable) and [@it\_was\_inevitable\_slow@botsin.space](https://botsin.space/@it_was_inevitable_slow) on Mastodon. +Except it's actually not, this version is to run a webserver on port 1556 to provide messages instead. + +## To run locally: + +1. Install Docker. +2. Run this in Docker. \ No newline at end of file diff --git a/it-was-inevitable/announcements.txt.go b/it-was-inevitable/announcements.txt.go new file mode 100755 index 0000000..8190511 --- /dev/null +++ b/it-was-inevitable/announcements.txt.go @@ -0,0 +1,6 @@ +package main + +var announcementstxt = []byte(` +[REGULAR_CONVERSATION:D_D] +[CONFLICT_CONVERSATION:D_D] +`[1:]) diff --git a/it-was-inevitable/cleanup.go b/it-was-inevitable/cleanup.go new file mode 100755 index 0000000..e2ca5a2 --- /dev/null +++ b/it-was-inevitable/cleanup.go @@ -0,0 +1,44 @@ +package main + +import ( + "io/ioutil" + "os" + "path/filepath" +) + +func cleanup() { + // Enable only conversation in the log. + if err := ioutil.WriteFile("/df_linux/data/init/announcements.txt", announcementstxt, 0644); err != nil { + panic(err) + } + + // Remove any old log we might have. + if err := os.Remove("/df_linux/gamelog.txt"); err != nil && !os.IsNotExist(err) { + panic(err) + } + + // Remove any old worlds. + if err := clearSaves(); err != nil { + panic(err) + } + + // Set up df-ai. + if err := ioutil.WriteFile("/df_linux/dfhack-config/df-ai.json", dfaijson, 0644); err != nil { + panic(err) + } +} + +func clearSaves() error { + files, err := ioutil.ReadDir("/df_linux/data/save") + if err != nil { + return err + } + + for _, file := range files { + if err = os.RemoveAll(filepath.Join("/df_linux/data/save", file.Name())); err != nil && !os.IsNotExist(err) { + return err + } + } + + return nil +} diff --git a/it-was-inevitable/config.go b/it-was-inevitable/config.go new file mode 100755 index 0000000..c3c29a0 --- /dev/null +++ b/it-was-inevitable/config.go @@ -0,0 +1,21 @@ +package main + +const ( + // Pause DF-AI when the queue length gets above this threshold. + maxQueuedLines = 1000 + + // Unpause DF-AI when the queue length gets below this threshold. + minQueuedLines = 500 + + // Minimum number of lines before a duplicate is allowed. + minLinesBeforeDuplicate = 500 + + // Maximum number of "fuzzy" (some words changed) duplicates allowed. + maxFuzzyDuplicates = 5 + + // Number of lines to remember for "fuzzy" duplicate checking. + fuzzyDuplicateWindow = 10 + + // Maximum number of words that can differ in a "fuzzy" duplicate. + maxFuzzyDifferentWords = 2 +) \ No newline at end of file diff --git a/it-was-inevitable/cp437.go b/it-was-inevitable/cp437.go new file mode 100755 index 0000000..e9b608f --- /dev/null +++ b/it-was-inevitable/cp437.go @@ -0,0 +1,14 @@ +package main + +var cp437 = []rune("\x00☺☻♥♦♣♠•◘○◙♂♀♪♬☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\u00A0") + +func mapCP437(s string) string { + b := []byte(s) + r := make([]rune, len(b)) + + for i, c := range b { + r[i] = cp437[c] + } + + return string(r) +} diff --git a/it-was-inevitable/df-ai.json.go b/it-was-inevitable/df-ai.json.go new file mode 100755 index 0000000..d4b824f --- /dev/null +++ b/it-was-inevitable/df-ai.json.go @@ -0,0 +1,19 @@ +package main + +var dfaijson = []byte(` +{ + "camera": false, + "cancel_announce": 0, + "fps_meter": false, + "lockstep": true, + "manage_labors": "autolabor", + "manage_nobles": true, + "no_quit": true, + "plan_allow_legacy": false, + "plan_verbosity": -1, + "random_embark": true, + "record_movie": false, + "write_console": false, + "write_log": false +} +`[1:]) diff --git a/it-was-inevitable/game.go b/it-was-inevitable/game.go new file mode 100755 index 0000000..0f55539 --- /dev/null +++ b/it-was-inevitable/game.go @@ -0,0 +1,267 @@ +package main + +import ( + "context" + "fmt" + "log" + "os" + "os/exec" + "strings" + "syscall" + "time" + + "github.com/hpcloud/tail" + "github.com/kr/pty" +) + +func logError(err error, message string) { + if err != nil { + log.Println(message, err) + } +} + +func logErrorD(f func() error, message string) { + logError(f(), message) +} + +type dataBuffer struct { + queue []string + threshold int + recent [minLinesBeforeDuplicate]string + fuzzy [fuzzyDuplicateWindow][]string + running bool +} + +func dwarfFortress(ctx context.Context, buffer *dataBuffer, ch chan<- string) { + addch := make(chan string, 100) + debugch := make(chan struct{}) + + go watchLog(ctx, addch) + go watchDebug(ctx, debugch) + + for { + select { + case <-ctx.Done(): + return + default: + } + + runGame(ctx, buffer, ch, addch, debugch) + } +} + +func runGame(ctx context.Context, buffer *dataBuffer, ch chan<- string, addch <-chan string, debugch <-chan struct{}) { + cmd := exec.CommandContext(ctx, "/df_linux/dfhack") + cmd.Env = append(cmd.Env, "TERM=xterm-256color") + cmd.Dir = "/df_linux" + + f, err := pty.Start(cmd) + if err != nil { + panic(err) + } + defer logErrorD(f.Close, "Closing Pseudo-TTY:") + + exited := make(chan error, 1) + go func() { + exited <- cmd.Wait() + }() + + defer logErrorD(clearSaves, "Removing saved worlds:") + + signal := func(s os.Signal) { + logError(cmd.Process.Signal(s), "Sending "+s.String()+":") + } + + buffer.running = true + first := true + + for { + var nextLine string + out := ch + if len(buffer.queue) == 0 { + out = nil + } else { + nextLine = buffer.queue[0] + } + + select { + case <-time.After(time.Minute * 30): + if buffer.running { + log.Println("30 minutes without any log output. Assuming DF is stuck. Resetting.") + signal(syscall.SIGTERM) + select { + case <-time.After(time.Minute): + log.Println("Process has not exited. Killing.") + signal(syscall.SIGKILL) + case <-exited: + return + } + } + + case out <- nextLine: + buffer.queue = buffer.queue[1:] + checkQueueLength(buffer, signal) + + case line := <-addch: + if isDuplicate(buffer, line) { + log.Println("Duplicate detected:", line) + continue + } + + if first || len(buffer.queue) == 0 { + log.Println("First toot queued:", line) + first = false + } + + buffer.queue = append(buffer.queue, line) + checkQueueLength(buffer, signal) + + case err := <-exited: + log.Println("Dwarf Fortress process exited:", err) + return + + case <-debugch: + signal(syscall.SIGKILL) + if err := os.Remove("/df_linux/df-ai-debug.log"); err != nil { + log.Println("Removing debug log:", err) + } + return + } + } +} + +func isDuplicate(buffer *dataBuffer, line string) bool { + if minLinesBeforeDuplicate == 0 && fuzzyDuplicateWindow == 0 { + return false + } + + firstLine := line[:strings.IndexByte(line, '\n')] + for _, dup := range buffer.recent { + if dup == firstLine { + return true + } + } + + firstLineWords := strings.Fields(firstLine) + fuzzy := 0 + for _, dup := range buffer.fuzzy { + if isFuzzyDuplicate(dup, firstLineWords) { + fuzzy++ + } + } + if fuzzy > maxFuzzyDuplicates { + return true + } + + if len(buffer.recent) != 0 { + copy(buffer.recent[:], buffer.recent[1:]) + buffer.recent[len(buffer.recent)-1] = firstLine + } + if len(buffer.fuzzy) != 0 { + copy(buffer.fuzzy[:], buffer.fuzzy[1:]) + buffer.fuzzy[len(buffer.fuzzy)-1] = firstLineWords + } + return false +} + +func isFuzzyDuplicate(dup, words []string) bool { + // Only allow changes, not additions or deletions, to simplify this. + if len(dup) != len(words) { + return false + } + + different := 0 + for i := range dup { + if dup[i] != words[i] { + different++ + } + } + + return different <= maxFuzzyDifferentWords +} + +func checkQueueLength(buffer *dataBuffer, signal func(os.Signal)) { + if l := len(buffer.queue); l%100 == 0 && (buffer.threshold >= l+100 || buffer.threshold <= l-100) { + buffer.threshold = l + log.Println(l, "lines are buffered.") + } + + if len(buffer.queue) < minQueuedLines { + if !buffer.running { + log.Println("Unsuspending Dwarf Fortress") + buffer.running = true + } + signal(syscall.SIGCONT) + } else if len(buffer.queue) > maxQueuedLines { + if buffer.running { + log.Println("Suspending Dwarf Fortress") + buffer.running = false + } + signal(syscall.SIGSTOP) + } +} + +func watchDebug(ctx context.Context, ch chan<- struct{}) { + for { + // Wait at least a minute between kills to make sure there's time to clean up. + select { + case <-ctx.Done(): + return + case <-time.After(time.Minute): + } + + f, err := tail.TailFile("/df_linux/df-ai-debug.log", tail.Config{ + Follow: true, + }) + if err != nil { + panic(err) + } + + select { + case <-ctx.Done(): + return + case first := <-f.Lines: + log.Println("df-ai crashed! debug log follows:") + go func() { + f.Kill(f.StopAtEOF()) + f.Cleanup() + }() + fmt.Println(first.Text) + for line := range f.Lines { + fmt.Println(line.Text) + } + + ch <- struct{}{} + } + } +} + +func watchLog(ctx context.Context, ch chan<- string) { + f, err := tail.TailFile("/df_linux/gamelog.txt", tail.Config{ + ReOpen: true, + Follow: true, + }) + if err != nil { + panic(err) + } + defer f.Cleanup() + + go func() { + <-ctx.Done() + f.Kill(ctx.Err()) + }() + + for line := range f.Lines { + if line.Err != nil { + log.Println(line.Err) + continue + } + + text := mapCP437(strings.TrimSpace(line.Text)) + + // Chatter messages are formatted as "Urist McName, Occupation: It was inevitable." + if i, j := strings.Index(text, ", "), strings.Index(text, ": "); i > 0 && j > i { + ch <- text[j+2:] + "\n\u2014 " + text[:j] + } + } +} diff --git a/it-was-inevitable/main.go b/it-was-inevitable/main.go new file mode 100755 index 0000000..d17a03e --- /dev/null +++ b/it-was-inevitable/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "context" + "log" + "os" + "os/signal" + "syscall" + "net/http" +) + +func main() { + cleanup() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + go func() { + sigch := make(chan os.Signal, 1) + defer signal.Stop(sigch) + + signal.Notify(sigch, syscall.SIGINT, syscall.SIGTERM) + + select { + case sig := <-sigch: + log.Println(sig, "- cleaning up") + case <-ctx.Done(): + } + + cancel() + }() + + buffer := &dataBuffer{ + queue: make([]string, 0, maxQueuedLines), + } + + ch := make(chan string) + go dwarfFortress(ctx, buffer, ch) + + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + select { + case <-r.Context().Done(): + // Client went away before a message was available. + case line := <-ch: + // Abuse http.Error to just write a textual response. + http.Error(w, line, http.StatusOK) + } + }) + http.ListenAndServe(":1556", nil) +} \ No newline at end of file diff --git a/it-was-inevitable/run.sh b/it-was-inevitable/run.sh new file mode 100755 index 0000000..060667a --- /dev/null +++ b/it-was-inevitable/run.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +mode=$1 + +if [[ -z "$mode" ]]; then + echo 'No tag given. Changing command to ./run.bash example.' + mode=dev +fi + +docker build -t benlubar/it_was_inevitable . +if [[ "$mode" == "dev" ]]; then + docker run --rm -ti \ + --security-opt seccomp="$(pwd)/seccomp.json" \ + -p 1556:8080 \ + benlubar/it_was_inevitable +else + docker stop it_was_inevitable_ || : + docker rm -v it_was_inevitable_ || : + docker run -d --name it_was_inevitable_ \ + --restart unless-stopped \ + --security-opt seccomp="$(pwd)/seccomp.json" \ + -p 1556:8080 \ + benlubar/it_was_inevitable +fi diff --git a/it-was-inevitable/seccomp.json b/it-was-inevitable/seccomp.json new file mode 100755 index 0000000..9e9da36 --- /dev/null +++ b/it-was-inevitable/seccomp.json @@ -0,0 +1,768 @@ +{ + "defaultAction": "SCMP_ACT_ERRNO", + "archMap": [ + { + "architecture": "SCMP_ARCH_X86_64", + "subArchitectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ] + }, + { + "architecture": "SCMP_ARCH_AARCH64", + "subArchitectures": [ + "SCMP_ARCH_ARM" + ] + }, + { + "architecture": "SCMP_ARCH_MIPS64", + "subArchitectures": [ + "SCMP_ARCH_MIPS", + "SCMP_ARCH_MIPS64N32" + ] + }, + { + "architecture": "SCMP_ARCH_MIPS64N32", + "subArchitectures": [ + "SCMP_ARCH_MIPS", + "SCMP_ARCH_MIPS64" + ] + }, + { + "architecture": "SCMP_ARCH_MIPSEL64", + "subArchitectures": [ + "SCMP_ARCH_MIPSEL", + "SCMP_ARCH_MIPSEL64N32" + ] + }, + { + "architecture": "SCMP_ARCH_MIPSEL64N32", + "subArchitectures": [ + "SCMP_ARCH_MIPSEL", + "SCMP_ARCH_MIPSEL64" + ] + }, + { + "architecture": "SCMP_ARCH_S390X", + "subArchitectures": [ + "SCMP_ARCH_S390" + ] + } + ], + "syscalls": [ + { + "names": [ + "accept", + "accept4", + "access", + "adjtimex", + "alarm", + "bind", + "brk", + "capget", + "capset", + "chdir", + "chmod", + "chown", + "chown32", + "clock_getres", + "clock_gettime", + "clock_nanosleep", + "close", + "connect", + "copy_file_range", + "creat", + "dup", + "dup2", + "dup3", + "epoll_create", + "epoll_create1", + "epoll_ctl", + "epoll_ctl_old", + "epoll_pwait", + "epoll_wait", + "epoll_wait_old", + "eventfd", + "eventfd2", + "execve", + "execveat", + "exit", + "exit_group", + "faccessat", + "fadvise64", + "fadvise64_64", + "fallocate", + "fanotify_mark", + "fchdir", + "fchmod", + "fchmodat", + "fchown", + "fchown32", + "fchownat", + "fcntl", + "fcntl64", + "fdatasync", + "fgetxattr", + "flistxattr", + "flock", + "fork", + "fremovexattr", + "fsetxattr", + "fstat", + "fstat64", + "fstatat64", + "fstatfs", + "fstatfs64", + "fsync", + "ftruncate", + "ftruncate64", + "futex", + "futimesat", + "getcpu", + "getcwd", + "getdents", + "getdents64", + "getegid", + "getegid32", + "geteuid", + "geteuid32", + "getgid", + "getgid32", + "getgroups", + "getgroups32", + "getitimer", + "getpeername", + "getpgid", + "getpgrp", + "getpid", + "getppid", + "getpriority", + "getrandom", + "getresgid", + "getresgid32", + "getresuid", + "getresuid32", + "getrlimit", + "get_robust_list", + "getrusage", + "getsid", + "getsockname", + "getsockopt", + "get_thread_area", + "gettid", + "gettimeofday", + "getuid", + "getuid32", + "getxattr", + "inotify_add_watch", + "inotify_init", + "inotify_init1", + "inotify_rm_watch", + "io_cancel", + "ioctl", + "io_destroy", + "io_getevents", + "ioprio_get", + "ioprio_set", + "io_setup", + "io_submit", + "ipc", + "kill", + "lchown", + "lchown32", + "lgetxattr", + "link", + "linkat", + "listen", + "listxattr", + "llistxattr", + "_llseek", + "lremovexattr", + "lseek", + "lsetxattr", + "lstat", + "lstat64", + "madvise", + "memfd_create", + "mincore", + "mkdir", + "mkdirat", + "mknod", + "mknodat", + "mlock", + "mlock2", + "mlockall", + "mmap", + "mmap2", + "mprotect", + "mq_getsetattr", + "mq_notify", + "mq_open", + "mq_timedreceive", + "mq_timedsend", + "mq_unlink", + "mremap", + "msgctl", + "msgget", + "msgrcv", + "msgsnd", + "msync", + "munlock", + "munlockall", + "munmap", + "nanosleep", + "newfstatat", + "_newselect", + "open", + "openat", + "pause", + "pipe", + "pipe2", + "poll", + "ppoll", + "prctl", + "pread64", + "preadv", + "preadv2", + "prlimit64", + "pselect6", + "pwrite64", + "pwritev", + "pwritev2", + "read", + "readahead", + "readlink", + "readlinkat", + "readv", + "recv", + "recvfrom", + "recvmmsg", + "recvmsg", + "remap_file_pages", + "removexattr", + "rename", + "renameat", + "renameat2", + "restart_syscall", + "rmdir", + "rt_sigaction", + "rt_sigpending", + "rt_sigprocmask", + "rt_sigqueueinfo", + "rt_sigreturn", + "rt_sigsuspend", + "rt_sigtimedwait", + "rt_tgsigqueueinfo", + "sched_getaffinity", + "sched_getattr", + "sched_getparam", + "sched_get_priority_max", + "sched_get_priority_min", + "sched_getscheduler", + "sched_rr_get_interval", + "sched_setaffinity", + "sched_setattr", + "sched_setparam", + "sched_setscheduler", + "sched_yield", + "seccomp", + "select", + "semctl", + "semget", + "semop", + "semtimedop", + "send", + "sendfile", + "sendfile64", + "sendmmsg", + "sendmsg", + "sendto", + "setfsgid", + "setfsgid32", + "setfsuid", + "setfsuid32", + "setgid", + "setgid32", + "setgroups", + "setgroups32", + "setitimer", + "setpgid", + "setpriority", + "setregid", + "setregid32", + "setresgid", + "setresgid32", + "setresuid", + "setresuid32", + "setreuid", + "setreuid32", + "setrlimit", + "set_robust_list", + "setsid", + "setsockopt", + "set_thread_area", + "set_tid_address", + "setuid", + "setuid32", + "setxattr", + "shmat", + "shmctl", + "shmdt", + "shmget", + "shutdown", + "sigaltstack", + "signalfd", + "signalfd4", + "sigreturn", + "socket", + "socketcall", + "socketpair", + "splice", + "stat", + "stat64", + "statfs", + "statfs64", + "statx", + "symlink", + "symlinkat", + "sync", + "sync_file_range", + "syncfs", + "sysinfo", + "syslog", + "tee", + "tgkill", + "time", + "timer_create", + "timer_delete", + "timerfd_create", + "timerfd_gettime", + "timerfd_settime", + "timer_getoverrun", + "timer_gettime", + "timer_settime", + "times", + "tkill", + "truncate", + "truncate64", + "ugetrlimit", + "umask", + "uname", + "unlink", + "unlinkat", + "utime", + "utimensat", + "utimes", + "vfork", + "vmsplice", + "wait4", + "waitid", + "waitpid", + "write", + "writev" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": {}, + "excludes": {} + }, + { + "names": [ + "personality" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 0, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ], + "comment": "", + "includes": {}, + "excludes": {} + }, + { + "names": [ + "personality" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 8, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ], + "comment": "", + "includes": {}, + "excludes": {} + }, + { + "names": [ + "personality" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 131072, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ], + "comment": "", + "includes": {}, + "excludes": {} + }, + { + "names": [ + "personality" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 131080, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ], + "comment": "", + "includes": {}, + "excludes": {} + }, + { + "names": [ + "personality" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 262144, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ], + "comment": "[ADDR_NO_RANDOMIZE] Allow disabling ASLR (Address Space Layout Randomization), which DFHack needs in order to run.", + "includes": {}, + "excludes": {} + }, + { + "names": [ + "personality" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 4294967295, + "valueTwo": 0, + "op": "SCMP_CMP_EQ" + } + ], + "comment": "", + "includes": {}, + "excludes": {} + }, + { + "names": [ + "sync_file_range2" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "arches": [ + "ppc64le" + ] + }, + "excludes": {} + }, + { + "names": [ + "arm_fadvise64_64", + "arm_sync_file_range", + "sync_file_range2", + "breakpoint", + "cacheflush", + "set_tls" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "arches": [ + "arm", + "arm64" + ] + }, + "excludes": {} + }, + { + "names": [ + "arch_prctl" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "arches": [ + "amd64", + "x32" + ] + }, + "excludes": {} + }, + { + "names": [ + "modify_ldt" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "arches": [ + "amd64", + "x32", + "x86" + ] + }, + "excludes": {} + }, + { + "names": [ + "s390_pci_mmio_read", + "s390_pci_mmio_write", + "s390_runtime_instr" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "arches": [ + "s390", + "s390x" + ] + }, + "excludes": {} + }, + { + "names": [ + "open_by_handle_at" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_DAC_READ_SEARCH" + ] + }, + "excludes": {} + }, + { + "names": [ + "bpf", + "clone", + "fanotify_init", + "lookup_dcookie", + "mount", + "name_to_handle_at", + "perf_event_open", + "quotactl", + "setdomainname", + "sethostname", + "setns", + "umount", + "umount2", + "unshare" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_ADMIN" + ] + }, + "excludes": {} + }, + { + "names": [ + "clone" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 0, + "value": 2080505856, + "valueTwo": 0, + "op": "SCMP_CMP_MASKED_EQ" + } + ], + "comment": "", + "includes": {}, + "excludes": { + "caps": [ + "CAP_SYS_ADMIN" + ], + "arches": [ + "s390", + "s390x" + ] + } + }, + { + "names": [ + "clone" + ], + "action": "SCMP_ACT_ALLOW", + "args": [ + { + "index": 1, + "value": 2080505856, + "valueTwo": 0, + "op": "SCMP_CMP_MASKED_EQ" + } + ], + "comment": "s390 parameter ordering for clone is different", + "includes": { + "arches": [ + "s390", + "s390x" + ] + }, + "excludes": { + "caps": [ + "CAP_SYS_ADMIN" + ] + } + }, + { + "names": [ + "reboot" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_BOOT" + ] + }, + "excludes": {} + }, + { + "names": [ + "chroot" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_CHROOT" + ] + }, + "excludes": {} + }, + { + "names": [ + "delete_module", + "init_module", + "finit_module", + "query_module" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_MODULE" + ] + }, + "excludes": {} + }, + { + "names": [ + "acct" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_PACCT" + ] + }, + "excludes": {} + }, + { + "names": [ + "kcmp", + "process_vm_readv", + "process_vm_writev", + "ptrace" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_PTRACE" + ] + }, + "excludes": {} + }, + { + "names": [ + "iopl", + "ioperm" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_RAWIO" + ] + }, + "excludes": {} + }, + { + "names": [ + "settimeofday", + "stime", + "clock_settime" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_TIME" + ] + }, + "excludes": {} + }, + { + "names": [ + "vhangup" + ], + "action": "SCMP_ACT_ALLOW", + "args": [], + "comment": "", + "includes": { + "caps": [ + "CAP_SYS_TTY_CONFIG" + ] + }, + "excludes": {} + } + ] +} diff --git a/log.ts b/log.ts new file mode 100644 index 0000000..734bc70 --- /dev/null +++ b/log.ts @@ -0,0 +1,11 @@ +import chalk from "chalk" +import { format } from "date-fns" + +const rawLog = (level, main) => { + const timestamp = format(new Date(), "HH:mm:ss") + console.log(chalk`{bold ${timestamp}} ${level} ${main}`) +} + +export const info = x => rawLog(chalk.black.bgBlueBright("INFO"), x) +export const warning = x => rawLog(chalk.black.bgKeyword("orange")("WARN"), x) +export const error = x => rawLog(chalk.black.bgRedBright("FAIL"), x) \ No newline at end of file diff --git a/luamin-api.js b/luamin-api.js new file mode 100755 index 0000000..8fb2075 --- /dev/null +++ b/luamin-api.js @@ -0,0 +1,30 @@ +const express = require("express") +const luamin = require("luamin") + +const app = express() + +app.use(function(req, res, next) { + var data = '' + req.setEncoding('utf8') + req.on('data', chunk => { + data += chunk + }) + req.on('end', () => { + req.body = data + next() + }) +}); + +app.post("*", (req, res) => { + console.log("Input length:", req.body.length) + try { + const min = luamin.minify(req.body) + console.log("Output length:", min.length) + res.send(min) + } catch(e) { + res.status(400).send(e.toString()) + } + res.end() +}) + +app.listen(12432) \ No newline at end of file diff --git a/naming.elm b/naming.elm new file mode 100755 index 0000000..3c667c3 --- /dev/null +++ b/naming.elm @@ -0,0 +1,253 @@ +module RandomNames exposing (..) + +import List.Nonempty as Nonempty + +-- Docker container name generator lists + Ubuntu release names +adjectives = + [ "admiring" + , "adoring" + , "affectionate" + , "agitated" + , "amazing" + , "angry" + , "artful" + , "awesome" + , "blissful" + , "boring" + , "brave" + , "breezy" + , "clever" + , "cocky" + , "compassionate" + , "competent" + , "condescending" + , "confident" + , "crafty" + , "cranky" + , "dapper" + , "dazzling" + , "determined" + , "distracted" + , "dreamy" + , "eager" + , "ecstatic", + , "edgy" + , "elastic" + , "elated" + , "elegant" + , "eloquent" + , "epic" + , "feisty" + , "fervent" + , "festive" + , "flamboyant" + , "focused" + , "friendly" + , "frosty" + , "gallant" + , "gifted" + , "goofy" + , "gracious" + , "gutsy" + , "happy" + , "hardcore" + , "hardy" + , "heuristic" + , "hoary" + , "hopeful" + , "hungry" + , "infallible" + , "inspiring" + , "intrepid" + , "jaunty" + , "jolly" + , "jovial" + , "karmic" + , "keen" + , "kind" + , "laughing" + , "loving" + , "lucid" + , "maverick" + , "mystifying" + , "modest" + , "musing" + , "naughty" + , "nervous" + , "natty" + , "nifty" + , "nostalgic" + , "objective" + , "oneiric" + , "optimistic" + , "peaceful" + , "pedantic" + , "pensive" + , "practical" + , "precise" + , "priceless" + , "quantal" + , "quirky" + , "quizzical" + , "raring" + , "relaxed" + , "reverent" + , "romantic" + , "sad" + , "saucy" + , "serene" + , "sharp" + , "silly" + , "sleepy" + , "stoic" + , "stupefied" + , "suspicious" + , "tender" + , "thirsty" + , "trusty" + , "trusting" + , "unruffled" + , "upbeat" + , "utopic" + , "vibrant" + , "vigilant" + , "vigorous" + , "vivid" + , "warty" + , "wily" + , "wizardly" + , "wonderful" + , "xenial" + , "xenodochial" + , "yakkety" + , "youthful" + , "zealous" + , "zesty" + , "zen" + ] + +-- http://www.birdphotography.com/birdlist2.html +birds = + [ "albatross" + , "auklet" + , "bittern" + , "blackbird" + , "bluebird" + , "booby" + , "bunting" + , "chickadee" + , "cormorant" + , "cowbird" + , "crow" + , "dove" + , "dowitcher" + , "duck" + , "eagle" + , "egret" + , "falcon" + , "finch" + , "flycatcher" + , "gallinule" + , "gnatcatcher" + , "godwit" + , "goldeneye" + , "goldfinch" + , "goose" + , "grackle" + , "grebe" + , "grosbeak" + , "gull" + , "hawk" + , "heron" + , "hummingbird" + , "ibis" + , "jaeger" + , "jay" + , "junco" + , "kingbird" + , "kinglet" + , "kite" + , "loon" + , "magpie" + , "meadowlark" + , "merganser" + , "murrelet" + , "nuthatch" + , "oriole" + , "owl" + , "pelican" + , "petrel" + , "pewee" + , "phalarope" + , "phoebe" + , "pigeon" + , "pipit" + , "plover" + , "puffin" + , "quail" + , "rail" + , "raven" + , "redstart" + , "sandpiper" + , "sapsucker" + , "scaup" + , "scoter" + , "shearwater" + , "shrike" + , "skua" + , "sparrow" + , "storm-petrel" + , "swallow" + , "swift" + , "tanager" + , "teal" + , "tern" + , "thrasher" + , "thrush" + , "titmouse" + , "towhee" + , "turnstone" + , "vireo" + , "vulture" + , "warbler" + , "wigeon" + , "woodpecker" + , "wren" + , "yellowlegs" + ] + +greekLetters = + [ "alpha" + , "beta" + , "gamma" + , "delta" + , "epsilon" + , "zeta" + , "eta" + , "theta" + , "iota" + , "kappa" + , "lambda" + , "mu" + , "nu" + , "xi" + , "omicron" + , "pi" + , "rho" + , "sigma" + , "tau" + , "upsilon" + , "phi" + , "chi" + , "psi" + , "omega" + ] + +pick : List a -> Random.Generator a +pick = + Nonempty.fromList >> Nonempty.sample + +name : String -> List (List String) -> Random.Generator String +name separator lists = + List.map pick lists + |> String.join separator \ No newline at end of file diff --git a/realtau.txt b/realtau.txt new file mode 100755 index 0000000..bfa3eea --- /dev/null +++ b/realtau.txt @@ -0,0 +1 @@ +6283185307179586476925286766559005768394338798750211641949889184615632812572417997256069650684234135964296173026564613294187689219101164463450718816256962234900568205403877042211119289245897909860763928857621951331866892256951296467573566330542403818291297133846920697220908653296426787214520498282547449174013212631176349763041841925658508183430728735785180720022661061097640933042768293903883023218866114540731519183906184372234763865223586210237096148924759925499134703771505449782455876366023898259667346724881313286172042789892790449474381404359721887405541078434352586353504769349636935338810264001136254290527121655571542685515579218347274357442936881802449906860293099170742101584559378517847084039912224258043921728068836319627259549542619921037414422699999996745956099902119463465632192637190048918910693816605285044616506689370070523862376342020006275677505773175066416762841234355338294607196506980857510937462319125727764707575187503915563715561064342453613226003855753222391818432840397876190514402130971726557731872306763655936460603904070603705937991547245198827782499443550566958263031149714484908301391901659066233723455711778150196763509274929878638510120801855403342278019697648025716723207127415320209420363885911192397893535674898896510759549453694208095069292416093368518138982586627354057978304209504324113932048116076300387022506764860071175280494992946527828398545208539845593564709563272018683443282439849172630060572365949111413499677010989177173853991381854421595018605910642330689974405511920472961330998239763669595507132739614853085055725103636835149345781955545587600163294120032290498384346434429544700282883947137096322722314705104266951483698936877046647814788286669095524833725037967138971124198438444368545100508513775343580989203306933609977254465583572171568767655935953362908201907767572721901360128450250410234785969792168256977253891208483930570044421322372613488557244078389890094247427573921912728743834574935529315147924827781731665291991626780956055180198931528157902538936796705191419651645241044978815453438956536965202953981805280272788874910610136406992504903498799302862859618381318501874443392923031419716774821195771919545950997860323507856936276537367737885548311983711850491907918862099945049361691974547289391697307673472445252198249216102487768780902488273099525561595431382871995400259232178883389737111696812706844144451656977296316912057012033685478904534935357790504277045099909333455647972913192232709772461154912996071187269136348648225030152138958902193192188050457759421786291338273734457497881120203006617235857361841749521835649877178019429819351970522731099563786259569643365997897445317609715128028540955110264759282903047492468729085716889590531735642102282709471479046226854332204271939072462885904969874374220291530807180559868807484014621157078124396774895616956979366642891427737503887012860436906382096962010741229361349838556382395879904122839326857508881287490247436384359996782031839123629350285382479497881814372988463923135890416190293100450463207763860284187524275711913277875574166078139584154693444365125199323002843006136076895469098405210829331850402994885701465037332004264868176381420972663469299302907811592537122011016213317593996327149472768105142918205794128280221942412560878079519031354315400840675739872014461117526352718843746250294241065856383652372251734643158396829697658328941219150541391444183513423344582196338183056034701342549716644574367041870793145024216715830273976418288842013502066934220628253422273981731703279663003940330302337034287531523670311301769819979719964774691056663271015295837071786452370979264265866179714128409350518141830962833099718923274360541963988619848977915142565781184646652194599424168867146530978764782386519492733461167208285627766064076498075179704874883405826553123618754688806141493842240382604066076039524220220089858643032168488971927533967790457369566247105316426289915371452486688378607937285248682154645395605614637830882202089364650543240210530454422332079333114618509422111570752693364130621979305383724112953862514117271324037116201458721319752972235820906697700692227315373506498883336079253159575437112169105930825330817061228688863717353950291322813601400475755318268803425498940841124461077989122628142254000815709466539878162909329291761594541653366126865717571396610471617866131514813590914327550508404229911523162800500252457188260432943101958518461981593094752251035313502715035659332909558349002259922978060927989426592421468087503791471922917803877942622358085956571295006406397383028057416171980960218824294442635895295545244828509709080664314370612284576275170086126643503659597324474344318321543338509497477973309898900229308125686732787580079538531344292770613472193142418361527665433283254977760157385120580456944208063442372164083800084593234239275584267515022991900313209926372589453094728504616354073503181347004701456708113408077348702724444954317830099061968897866619268175615386519879561083868289475488368526259721619977737482652094431390324793172914604326319638639033470762594833545895734484584930873360196135385647656137992800964870807402832629931795881848647579381413955884472501644337791476759724600318755294330245787157203176323511565947046689208563025254407468629306395554832063981331083752795858668839043082683798970889469134766324998683826362961855554207727754686354415091309064415541842403810332192560981852720395197656322664633327305723865337267212547135260708955256070090155447109421171909740558162871248029034361249287253589122550636268156660672508465567889950764874411670622954239852127626693553759391940619667826154219740817182674928288564554526931894094917569557440385543056146353581541431442688946121140146698487386227670098632625680850243851303596138822705602629402609563287577037058185709040233167868393124269828683191251731731141105380993041971606770144485296587945716956632611555512137775289249649371585207907055469606096058011752151650209494183287922725352089851254840841664171322381250908674426307191690137544920580323753359048123268504515439085832598386129107559828074680865750525777927991758951458349285271491050815818290271422273882182387865038215204165040523759706377541168594518335562629939801803842339434745569536945372169800675404848583302601001033664672870077903405978784466903444027625613930023568817490392024245719874324626034228896928180778128990888012397381509703205265501059669837481573361763667702045666901700972165007860426643943103686127091001533656589860827553105587950350922790796936678727660949223993307716307684113706772437345046680566174224656557842501542525892645912797979787164233491254020436712924402699343037638194607623960099468144792207370813286387901958038139927910490601090116137100391346045843827867837136068980796411910200452707072384083989491077187620468791089919556755804748432345422344728687087895644363705724817028013320886651777139734108630941393149491710066464668421460309188103310758137325466759917023125156864597654744639797514283191562239271666011881746136243205752992573489209549298319901099474851253802098075563973671876293148253609851297597112290744695734660780937676687269310758997283854112774586349744664167520224605982273587725417887759872403259030826742849785661444025380295093369530715232954758935040098151431105563930724264785281232027271631181484404040637455521055443801112296851103758506068702796885064468315246722128501278099500173125421907183893179502826206964553861249487072651383215630956362305687335914122217230663008904254947849089890847365772122681682972755340192241430249828086054507721529647268286692470379515329043282753593806299003821715196884783972583284387989814472469293688234788065318368088756102667789051484799016593182457017111643145006214251402533660480585905044023745353512440830841032368326969513033999623228202005992156773818583206057680053820828158577243015684903341817400139856424132083674361307113450506513506572258208497552365165953031591969407124452586972006831744596106997930045258349757640546841844449067971252953382981112568500782551542056805599613273165097785297605091322034593405328153118085819891363013053061074365882540673862757035721808141733422993116686869538677156342277291174735624602917537425320697827819124019878722062058323230576276875819808463494672789609151862986281059526951496238713418220275503442016063118049706181338407534384406645818866935370284428954758787503406887323982080675022347094383710092898052731025632457648925151832666078214450767484364281767017314783543019365774956531399199148981323516688275044794193668160107119698350834763767998893949735253103316553169671769062855513758005819034056705943268912425928087046235201330202482401319511702552357167658408394968847216014386091523786469845855930039750374425453501596251094191780911271584244206669339499847126050989560498022839042476563061822815814772050304548599163614494325183337090266624789609894158238306534686056488372082852727909600089600534099249640358579295339516636654262850340593846977925533688064652185504992071599293851300987363672180064761858691917794139073069881206804333088751178009126576450109051128112896493030375094239243688793165067508777138188226063019052358756005948241533029587885180597939189399113152243731239346757247251225043264172573844420654977843730872960459356141153123028926409385581364241477675562846712564721792641613644493602449652235437179276281836780734734444177664302751120074559678800830594005756615334188894912026911283450874181395879224514285978934308715693757722889162462918714396984505694321009844248494028242956114691021001603817399206605526957416216350900238614282446781732787667905885157381015286201276703966877868319226370869509299113956207658619432930287681401414720822474719968690450322101405411247053202552969661681522366026105586410854925730807207349065730211413174976451396315873579533948441150119366881739470040282041344717004014490451265302682111848038054843249687828071997907078918188814093824182818774002529120032474857604218552915862131584591049977455169220252967399978451391937631841120020331051275135713344559323977156558969771166879503748909102593126886960793284111596587360870440554196858846506604515268361407895398831958318906013950429658673311132313574728010733312833094643408780704265908705833882919808321750640373675874046977737895830214327570580469058488154731899126102014842174285226994919123027699742751409420357591462084593813334042899727492919056164873889157954466009752953048267815184086803926807822946404676143019044402136512685494329204867088010304253386498683934795408319136750711033346054780149945947270992906657773968812239299232554689903654739117644151471035330317971038197333078709896213774641371981508158468480460185180140346392072450951295788129509669329552082292646781130268661368990795814180604692092294192339377377002816694081092148591739827659336493637142063775813057407330166486394880954371135786964617886213657405445619472496187992541214945291079850798885616227473886777458812615852319199092524925941412518969113806942394599281817883611906878650247247101626989800872855705427663182513797859039285457514789382854506873388306472200907460976397103413188243470492517909746033520059773185157325712249933104706765885757085068096616661403307445712711830506956891963662682258003998411962704410234673171281565296988552882275278773384960623672890739717835088529479976456924368980175553955262559144534531112519256508553063660026814184466873155832025618635880343719719986769847099128011419911712226996050499813396846603470071608816233710530623419914179885465741851697578887292010082178453383567051741571902596688345907039075771069147485217180581635303115607811892817470122464522240187462160970970527144565153640683210096932555009000625240160159960985097069388293955032986541900986927876486445437703194810940429657942235558475224515774695437639365092596253737163410148054510052665808995255578884724334823837253887930134303155917351296479878352085203526774090998035228728240938436474152977566839379372236311631747212587720762034243171054533660164766809312951760810276160326727774843274281287099112373792822456428150660531020084820979356705717658048734180977423638181898906628843657532362062014709541099631936154401894939226872185722969883570034361558613621709380018891799055884879627842701117284439296698302527802560766400219547736132575584794360292268648914528019474851401471842006308301787358601633996107304055201455499349168005672481069207452683310851805520366968061362276371021195941132801501885217577147159207464902829357340737619761219432851699519027613861889880303084444388658260434782507671183006200666065022349831393834900542988663031177080784432819445820225807104363152564656636468509665222382560185650512380410526032782295449466297147821555174885077522349315734233882955284288222252716710774272202204653597551282049364806452966928353273961327571536269840906044816394557129439679261756308644233382449283182355346450652867137229237309044536253774536891936884832215708033536284161770056010828722629246164205188347512477988415142725503349146378378912567051408826708751715068539739894509406331322798399936525649454128267244435784780635217085788746787123778330250084880801790543967574772961169453790924877646875035770402879120114209623899768478121227391468463118159340692298286895772720820636470147300555718179515654546261009778797801984782700674650171196531173417848522485894734038781545426141373834185292509684648149710073216027209337902368018733721909265000429170586190000181430211647253458652907476420987744999339867884937103296652226829222136053489327466875068152858805336594773044187140325276929705702980725864039839937657034367907338269044488941609184793205634313103131332222719646224501257811709829019431510780048786307038180421423891460048776035323007054172520507576359503895612202743000897983442004440267002621203278308317915607423558555045195748578383583104483437917072336118948246838679684043749129851288692478506390627020662295278982399014571686131672387073865939857967582988387881217144972793767380653112872843328851521582942173996863146749929767058553865644152589456476307481992309119759651978218743425243656605169622477802393644285891533516143730761301297405226778564598994514906066567792763687889541558804568719766820071677084779470848791295111368190449689108278478820003241538727369355282603563931875994311493708389266978749687825948478286731872082007046875541317773556227899723295749428158652771747724946577929128719754933527695893300814822365131675775690971629792592254799682688545217212374491090472128630742022549361955740892818951656069753951789665648247858592116589723839334183791617966640242063686068025699023240706856028825523457166048711966006408404902414574507116239168029836193850679015155680013493105206289233410165536554444706838220526832631429481224770085169197683981522257451611822787137920286333656635264713465083414684163466446092597598560981702818958073775737578986109391140614523801900415286698671821204909017290725787091372591706263067436773653123572454727433951548366047972013182963232809889930023464262779149412417694960473074206230179685598550885370655594862279028714834443951959871937050457149052759257922538314471597324114681675153374776853281198198701000162675086490927193500968847056974940288709083915251694712843239626814693708223533766237308978755395913303455932465342962067728782750373189346004886900108999079948474465742498966941208812694321265166129965959102021908367247006061890619467166892567895260955129003001701515789909786278788979843225105119540287371788717175505275925119416335528760025087300474282556693585220399117044943444035544740083561683884789745081360311207199678109797144709349128478117170043343806279052588910878263326269061787812409356877557010847878104946272402589538374995038202294463057865354506783629321460017805553792622962180441944904151833459401570116143437276210993594620033574170138841418446581614076652690690407605572198111380026827436473674198389903297920151009868253575287349276980412792803953337118467130927827672637149139629439242168216192376921091207807691068745828289302694988156976884754435030866852061339766353666200226621738084387806216028756866830274184870602735526216982703231284539695014860659433493928133306305407065093422533504492110239916366392752741523598383840715916401519121060469253551588787261492611380216022988542820187827382762145162756271578801119900036708502368344272111455044207053607471453055844834747211502255774436381689801235602777942154164586200559533187167751781879137629712052644878745312494555207578162891767571003940568755872481565010540975163294064916258175679046490647579205968333845097929943121396238437316985354080791296255620435982643483261162110919760260096912599530224248307274903001127014025563185342848268420660313233071204946761568605731051444550609999767403069758601612520361924763032273380668222277307702183873478767045869177664510177412901507894790408793615813417361289019397309760336574868757225290763166856150612369097180759643598919936230883948507268879920580502003177654432949001364140838752316909424636692014525867910109647911427451368046453642602495358904528964182047129550544616416212703779830538577821691114225320793006879579255650003222030647032103931180842368989981557998401465895381173715575744196580270591322795776972101957217191403546259631062990336293435391952198842007236711827755563539691751620893256799761201232459697233870674773157547196672322676826770736842395787780037059138393560910896571696740234193442507067751724316462026620775533654423145389903635917950938798528439583104677153246335255095140709398829785808260372772238878392567774108735548644855361826473089897073353600000213052497094611172319799828034153967709663775002858778179901370906153023360667464453035132441505390358288450561633034333553345586070970308408047634921784656783406550851501735310235718790005586779184115336557935528906368080837108020870269677906240265275673856716165438756625309923491994113490143666413006911328806898090725512002250036867121472244553189855678741295685291352677637615131224337921008322278078127920324044307369882185210775377429675979119998224198329292882383713655400914848686804334455289117866025556317373905013899872922035137012033429070863162960210917721129100266407517290971680648059743418696182111242334309369695560788951395960852636198351284561974799753394647539147403161613645809198424732337805192546086135863306229880352947538774702818672366643228560429952679837967096975125059750484774615511911191093039278880364368199682497965247347542934452123267286592812671456214157751632808762970037682286377197655388980238642593654317768267738869365718013328161262815551545141126145880098588060484099683313095947341097116089173144045527568093364675970565421156863950708359002269454725154816042695365209004570315959159529493404568199912320313821780769164900535853188411100791758459637052960141367530083673124189110869227026830514013194976383268271911343929930806437454320529718609807957497917813225450158965655387790704350724370159259557029237686543844644762031748890105733047604506568778275054769178476884507094530619634315689566843164465404138057446466010772432695977018939094400959046224030086586453256545526435581768017572296044295075315621163940445261943499014425449695895633914592284731719156418166146646712069693063746058605331929002743675085779511594289984930807736359842778693848948397019466925358664214537374153612527983872393008819908433525568182933971385143014863148158761064785047895511488318369164312503638431046741921496665846984206902925287489961119220661598829069556914939998425719999879922456323043862977753877604456216600397203309883308523393717357674521917549135236501455198590178636104374584922173527991783229171011679454841961819563458647860213532773648080222608049401470171565744925426989273706363093938093393738785094503882798582930484771552510009497059095362959093401410069599917773539003224994456408060799092655766139195249872302020487311070446138122589877719803146932204742447095782258509539235201009594985612144253607845382205554452205088298443153009016241354347142405436048593621240755315767433381821883614897562809815103564077130781982095518828264308656881250060360551433930164192854696829391452795768512016906242813187161808254227184008395197027250959232126457747236273474648901215848823527995194923876716914983197619533489418601309268484692126847494933216086340252010411185698739188286816293705963010789435780090367151030825044718118137452975727150508382257775474353274972055321269920707358940538464594373665543478647238401554904425249503739666990302039728539775694343879329953814165043484673132545185688124086042822743984557053996939769540464764768011131103577817532272026095419687722337410462110629832503456746545735201449634597527513963267083014921767732728138694087441337730255137653229946157731403137003383729497708335830919301446857546139970742780860053306156797552770064763643107119464706137208602135152167781725409968377719027618206084719156499028797718022637167168133494474059429957016829170617156267831254152071278152789462291099166453389140498827966326866475795191136171367259450773582655011108504898388717825681009045390762435826382902700198769262354803594302456757092023207191080572881180499293386141553811096205770041617160175623154763438348355203466147710951601211202867548659802545735450608636503951583358593993008292141329142517766939595928586324593104033759460007129260915861768065496154362311066181977405101041536092606921731633078975390392008816964131934758946336172831291301060099763232981157662308690970105320139646186315553000756140932252941204291501158654192409565123049429183793044721679329124821039102104471447947902576363281195718285582963308526578400856321827387554744459996665416416593991147545475133523105422784517611040379775240228336010937473116126694320746858340781597279304592262560356535943457964587214057613817553732118650549275681079538369616408204388943942773851216832490224796124022636908248956410022159752143431136630815773087808242174606480402137068389446095333344349973973709415356241024947358495838630171288955075970759946446891224557168659369329502667314738477440292944735885574008500651117985376869918575224801511751389282741125028002359426633241430743087201375295463735117429756797816214859061882121193888631695507940188797678982886470733707841989375929013306797147777573229525888682802099777986320102415356207177223320405922387279364269921500223299665571270632290336915391374218005999539682526533004695433457314757158171493292154456683080622883058837609565087752354158086000313397355359152181993387215118993030547269962379282608662332554942467763481207463487941081340621935353149739071757934006385173251882102106716876931204678359349853568952741694995666731115801476838294639772542705190925036320868450745992572653499364811612059284229277287372844944977456686834088314696496366660328113391933773353912698283265685282994906669999896000533997517763187014715630391779801079024170702071452274728068735069428209672035092976600815692833490433474380966219353422688698963852536222147989650121478990147006338039463704239105271265168678199644997248134062153663689321458249749508063235939882279477553179973710834063769557735185805214008642533235838447041876455757761977267198232163847071114092926982264171837959226558263951298195200027992468891070028692853720928991724953818869409658658828082229308184797668887031826640215478882236814821536996213269448209647871654803889871330322176926251357059553946936860612292483607170586631946916607691082067402183353552748552420427402709708901852614380229463697149846636334414427455871135905688785096312182745625681266607874712484003209132911482917633210433321747749609448678242591175552781393807415765705550778810492151699246314873834226352269567765438833721325144207370264313295600295350462078715721379222251992056367861909741811814772270382918363902059465575114209945802297434379436009392339554003582783922758283432541403791693842868739352585491821988012016996713685040383118740740202209949467898775577197883486606357069741520644396594115950238288102198847176606909270698469965376724808665453483108060323901136130836187881996404121998828043378180141642661446179324239551061331837628238315567254585492312371420744344942019042847392966172820518577491599864474991038244390380684890461507026761371361470892999025440634897439080795221461612053981251615204058546291050415615982836858127768874699936291654674414532783534040236600929638000482616701769316830429798255221302748307887131442278065714983753818882740418103406297554692330575969647067659452027222196902968364761624108199225054916176219897394443225704979485111103215274335010979234603361922760762382872228798421276010166428197520919861864970205033658893452133227630349142511950990716047996629396440722676165699871341115104942580549079552428098636402931601604313307213553101756760860826862118360921360166918227328166977481601148254517340958451663825483147816182876627691284830188169826783619368050232798387370645111467793390749805324184652263771178316166491114389690775125757225771800821201214749300280525564805469392505643434988316466349847936706027235730734752128433355627547990201317905775485532527368366136038160921969961893952733467132456583026470557761231553655631917733836047788066615288382480682404463273715572071455388308355765287047626381005617403715009409262586670751457077321177780916622290154788587040398864394234328447001128808595978416318861433403971493854769730766687229158926835184514779717600339602951484108599160248591621091302166209259456587516832232506512503314499615698419979598124007187301986944316593034827159698209422332158317487397308244469668377544585889267035730771346392511970405214589534814523353429114729962421135543378696983532154341055437520239981628822611729115582105136860962288052387680464494187849960586710146369178071079426617689234821591832502342972974893722249521085734687341809335693734054818376202849942229931563544855869414043337659122175558881009687505688675021765652954395708001301940806604372511229466423554234882670056321768070356290508392864061915203738929817736309057124269397671088912049911333687320584439024966182121075440396043662020654083567733089436252079438137692474171503616007065409437131899895224849622199857735831793809912789524921684813186189724301538062997404134706769669910167273203569754212161960853849426482001892802874720653129036913358491333910200300459666159699215989976499412344734898722452445923581628622829321882468318718619170815827817441664546709914416151433034375319889971387591247751103235150876183561056058928400894430792561492720422658851183200514147125625277466212011782130491416048949875086368298802964239992552906213601326236764752327932636186288934259723105519640290282055120137859500492608034702978389152721578705711010634662832914100999288778187261687748969567923368103690546576806469040494113703293143295427864755103458959025226479645920478909715950917303491757542663627750591961882434845460070459301617835541013651849764464430987609674290956329442795364192664101661129584096417184095099971464077775278320399048183787789115353749946171391191602131905300607253231950132445016813485779653181502127512713993642302189933948916109457738726204073564650036464741691958022309694417523642495562653266082415243317462594162246151631964249727961442481573775622900331165027235780614172174039795177961491328791031483072638638396214115067326747607654430559769870079496003178103884175942261610246786644380693249983433830189708280374212070920758928675801178191544236160893148792561237343572203431348193532416059153315410258241981588860926578589461231902086180444287874369912126811237868502611453658293156658668104927005785835094174512968520069925922330827646015462665459661000320513448028370304083781402308577159841624396898631399811836402363946700025237545607362496399175414041506481272251862687719108509556392228587032712244699332304522947079934810316999720710590665849150477762027240469524933811163287793572619525473100944869728614243698874697060121277528913254437332340247625543124275949229972265748823542910488941799428904577132588488046036958241095699714904326939289794778412480388703662017656696049849817080615572775033182260574791757419620154543654374905802794567322968428574341106359308615300906864920107272294523636193995386697252815487039985737264767017751336719019453114963086388039115370087449600204082749966374451935477430991679943688981455828393169186016788527404175127079643392411064960642453499782280535705719934681048406218359579981143764389878264150686341596004747318197075104047782328693437116581370742379590525246898496678499268489942931369318249783711325917865981807047846666729487040741540202168776006581519668434037108456772323442083520602329183756107873489494411997004716578366738584467464799896087421683931894632530965149619896501998366601395313873431937872898669772948842700168140132176719447007906468035916511407203387398197734226421959779414103456151171038253986134619850140814049113701557358138953225259616450326627279904234196905618526075184485348515119978578556740948890437872640697883104208919452376760060135523586276279832411612540330204891773849529849378384922425062055146278168094001428712272463398474338969626510840182906082074270906593241278421095964878425034508026462980548117178412643517898869097813692798627514182069266542830632446561104594595907603760325718147145910832557735299654837232843757977148214329813838370232563057097358834727781330777152845831668500134722490769832134827468034714555991268208665376713901562986275601472470836014123836053465710238388535218244207197493848234567498625232679000247919848101690875139701591409244532923800020700098036606830709168566752875622397711263755558507440233343707908367196887661040752563888152318821364143394060457030450114625218609379684686630546426272243316561615042526309546120884754950701190457434880533277829763434617287222277813884055817628623889759883430808420682438169418816050804786588589098775728046102585423819502707200184394221082419336622303265741084605694014624131606525283423233191522654470313332507334543799706839979047376966199860551483983292768285415597741774845855410778245434497264405779685025057443565206100198902164956714581138397711093577215892561074245408493308638429056352148296480765567165943860203577669134833562279790950089667862937926152679331445345408678643349084364911412504959443995733708559795598467915811516378124505094716441047284970156681422028996095745338398037287764586461076463711946573956184450705918203468281466976952201112803648478438539012416636762909396784732922727978202420435419195340981661016370940838932874262459938471779076986027271315237221212445741119884674326204255691489292797947637713349252175896403729497534545444412535293067619960393376736198831815155370527973029250667262490107280522113921102636762634852236884037817770639271397392559007347684862602266350661065960403337763496268597736317115562068646350612956996642125943685036877106885524025646914143397706103665235928235715921777630065920458141122895244183018947807189329383247079361840278915635178217786398422452014785629833896323054768547252859619646812640048804899178891225833409901647162497478359929728226696064951555043941786554452469897203009330536287975410323063405339385940985663257100842579629341239066394053901442875646095375056057470825233278341649185034002142836170960127384651892403800455617481971954384361031706429478530650311807082041856933185059982870758365062909058119683163527411785581381979382232876237561887074304266452288725062898025490954539147878696309383262324985774714943764814300799001889346390863238771097041533147765027927832715344630201111207452678973441641561730746988488023159933501472142231870266391839424189792943510604906272954188418927139396445334755041989033690128724764842370706977597879134637561321221577088001101655314061117489708361155778343841576284670227732585933435928693752015409599907576677574069743604368487468422454788051143538163920618403648037685411409218524512835675053052671664848132250662305884691593113900501362003662180082249075803066593231394104475842065141387410218166157895999800999879064430724549695320722735539595713477316934187335917716757759125189292978275330439917657386760367202386473715711711639111208431250176730040664404902752431640923621341039066130612121300210977433449075588566267774326279119381166416683379695213121423669427243624649245451768398057228417456991375927865092857068615060221057142765928741998071389777057038080591209469226227652775779510357712084999749663276560809369723787637918108407977974530139524040399109682530001078885640786025496327631706079287985094040334551865714873332328822192513267461081843903935029665746961791495555055668844218214622270365609207269439637131114591428949536510571572669868571684623749888000645938139551663180771607870704271772015920068419509478459346662129879120362447562570916863521112346772225346956149170135212609645881930608223661334216378606221774345633503915935069437707445861923228640801276264493168222231551671716227003713809563073787627543694562950399670100956259543719816941524394921177484651399165778507008387591652123242368473753702283663213663173598920330411548105884610720356062671452653410958067680251461182467920376027565084385418953467438397457477049611484249784236694175325933441454465130113025866625211901155545508494248329662566596414472350114934774025641915108861193679111137372237679427104416890570528016250405533111535499193925322520913049136817227847653153716676939699955745341311038370893739693895699146924521258843924911417074254555304619791090038607546433329836515630935458401042533428692641927578370464643003795225206874736813438838607549376199859375516488209575624653250636369192090770708767822899355062572852185042307534651773344520808504698217405391619929519161158932794683812802007272380808406622715867308485260712291401802248960178004160295611320742030824465778293144478629015214334128711365487548793157813594537487694615269290335512420619720818543418190256172618059477008905436578549937842421334016329716679107547183827390030632403781777496842159741379822960933854130188152409300554505730145781065709712286632162538601138757083572219393840507773006915436635337377184736297695055299693764389947945941547437437680082864625527300962906224570198004148481851171850585220604213473630869403050469757270328795247172083838825939538081052966469401982230848520254687604417866219337273579738995598800252032845521852164698608236128765827669470935945079852467758316599697291854346811845124149821061706307436582336327443879037740191557636317370092901539868788197486702886325266063449549497379583641847896166628794168134616815917871621793312955171981112753905046530722884956046165362366207547177417848122606267295474202325642922932335880818103723052072018504389443778183621467174392828428895730979905716468789410015966077707772166207143861200554238911604382388579984544470691741513249385235532635771028870043657405337122133000706210043263641203521843596936987372632258745590374615794527470743430051275746715954361636975691773300867164875400829542082986985487691517421431946311887885282514054193025021623109649587880719536237623456494431650021899219325078679076184439118383637710535612429984634552632643667979387615123371182350599690026413425878480828918772479761876248090438296966329242029477836502021819354773813280831794722095287300013615421131343697256299274223766438489132789162898297233100099135396538061782237137597385894102704963218348648603076736941458579796569204447460290531135979725553593618293959675653752862319766421808743122259953304307927092884173839513474001147752995687537257536358499493887685493051263264601110260834845468329291025562556915554491504077308750856565134282577166908887026512410892848202207591092838116233724611928953917410814428397042421346866482151353515163691398138609209504554033401136908793846808342217977798683270117031577470686163104162354414376075820809396613915737094787531286726395957360734374615938784847264289690070955263134051078013084623584030692995585813248301665771679058108527537533793761006663445560037177013947246480778940094379523869468861687488751985006835761594447171826849162628809969540346472338943953143070639550999432557132623809382521836518249978073530835395980724751057305275146752705393868870880094613439773780393629485753558173395937704500327389971346043504626505853075179283034295911907756855699973291260575766392419966098903974879273814136552531497162087822446523758811988310812654026397979140752221064721259734960755830753502316608641699744184056185950529962513832685000104581774529385056933220933078434296416026100459610527567285391946741410784557830702113776787622649951414266205900886069343197889757369423287665610138501553254900024400705240741893204682929799678050517766029735632439355038916633543752551440101087958882491980154230410309239861019677396508569281451108185480626514326528158586836668429418082508506704649604386455415071109359174327671750036318677434847212310234202624705126697164073029228374009841140874403652346638943140173515707867215724547911637159517451748820508415421095072258809492020018819088991932576297383180779814373196112723427538445458152839551035544020855299389922211244118500484043540853924430991745290797845539532062104996171151894326215174026641772292653282518229726776244056888138833897652305915525065003974071974134876093964388411276251166687284389846455187444257811284188616470508816822172909073880993854298800663956572263637237762223681651573185751485276890011988845913717292096206603077782299897387087206044362188693352800004472510114726258925259219239752112851992789227738466167439253190947846924826919559149704929567596159138639730163195535070110783798230267050459747222555836549708401737907931671884392666300573912238402459777977401215998559082237653804615782621520723526955897886406420554671883381730014386560803432768128997574350751356237064265681643314221509905658994987242921643116641137446437114813032219254974875019618446042321996526606783093898928898200903056185017949014979352064818153796730588131584039663053082131627364758396818129142493789694041871552238627996049362681040078956389973240524801780430033232762707676303007547004593214925590582076813737113814031503324838597448896543885866200970964890916143779526600646505164316256065493592400562952486365724434210870579669641654690336037226343918664942214932445701742133223540693070567915525199548934437143163225282228654358869577198178561697338982827819543347380055551700537329308113190078973568222158023220801714548912587685098833518921097423447189285821170181990042991758622439227181663176524136466431230617366746167634655865639396775017416696776092776956883768006369425394908741874659672480575039584160464375748976574568745475603565401611756482149871502977995782347949225864070216286540650281806097492452588468865514252017328501666637537730151285854321105057908984307530350298439273436209887063571676690773051131328131450272715012870647301787358086340519575635438062973592768165762041892298015943027543419812390993928014173533420466009734526295102107446351422864463482282336124572841277781242038471044709342332427499938653864347408621197445007891314984923395652194050671895004182767334754578887739280005622068805216942579800149361552968817742268270500673575463359541874555736433223573068846346452927569539575028866419068000330138426109295378197010040603008976166852369041746106194637898583285064586722486302861315652814056779681968320590061848379424194320329853122682686684459765581984357208535962491457069160267652199175435622620433468051312548801459366813239696135323161004338366744736079805586321284087362415980063252889829238043891645938198424557710789756707661129372976331112458863134625654878165290122325788560700332267339564810354031043925304545091170147728117059966075836070086575340761850433581514240812247519265537134969015830229462688000366514068984181942487161889580092498862691005780136129740858706807487206525164107158023679129817870869020268593923509049914792124298057745786558504139307077279288645077665504499921197394951976465983252709194664889032751066875498585798116235157271111125387485382189423400433082343643950103966357427421210212759111717781113770577597816950183152927814938723976301562937052426650494767530238598031221837955584401741158679292765498136139753833639498473124845217430835220086121780875595335703932378280828985054096176394299760308411557401304318801857955520266151369593398591086731227969547612078873779177529210996774295793696561076940346174223552231932701007995868773867823957977421831308341826616521529481261142282219767877619096287565694905767673615883776868533244414087744577482789560203544278456382398473081103279178694852790764965921807380057671865549171012160263597681432489312799589655156730039102844310267856395645396855727678335943018252482109745140184814009097697138590089622147617599309496313782787076188694911394425783965435404153322720497916293623826722824251756779115471438997263442168879780284789699331850346277634320532652386213073307008294614160882987833872652474753555419170062651198019152546391461729608493540242465404106748533410628489641633626061279475747328496734507967497538196120436557157243302547712702658029780701976654123451786515072798795811145835032019523091808954338453161263022205607687203474948430495217030419803231716462514318146684347315253428478095655917456301019126618560533691787529929954046594728263812196548126706217958492848426916748180233878392850091825762680699762127080177519364010881672877303323576111521791379345506307616388415466519583455687525132236863978205001498365817295029958800632140769109893077189205490489493362462937588688322198667781798527682369485051408914503491865147797913037143315192296253204062159525650833118101208495822803391580067671314973850560148605124683899657293582895264554801105892180788035507267131094386200035086009500943828979968208003173589235848322003290943310267414814790052088553907710766879510109774219957041080235033949516268985215886737908756644234490137468846397975768825708412948561947125161413396621395987052138678427137176278242961470945692645556981617400493555260721110246477331259035770743934606926940244587916321358501830643497806168177303212223802299688682470024929385605761199226856702376943089954255694672353257012433955743548764872513142355890012895543674044399821339004331351528808999588153007599990969000542133197562720760462825367381156638092158553059455538808722604610357416109302308493879053025420210585414061334604889425194787990102925680953486272747995651836908235282665581292127316830585403806055203467894973392069738995308350485861208145401011807900629704584278515118969015773595585050786353031283239433688704873958889471192852126678211025365212319145243407339701294656253344904397812109976056156576285959267339348824961196438429267913149144420459735519949347625213873413826816311882403223192038047550705111260121249596652249976257638587468695372537843847955566782146621317651362755434465663065816505018546609570144995427889666778510416235121690593318110788193113708341200235971458762799651663858735820078368819857315121198719782000593972892194942943694020306256752526229354841829114808363181760012988647571167861706165661095215359904871478326244377211509934766448639130131092170576240380472728942540749726884345451575900685697262588983263695069506287008278419221759211546197440270496815011527439850730094181716502787372692772673608578353421520422231965775107988024015202789406732358743079261227972731098442748319581023816717658019531329460146775862935782636293021863352315164270284972088458489060822632130540194866017699806935081103728135468520716681921721106749472552187131770621952198847669476444417458492899536912115912503353114817682064346269125547171210471647277906407706804968454674327824794643199088165684333327204659309138940715436974688406845541330767477501233842553603153236219084019541672720872222118481823577908067604285304789785937287961785222927082914307038868570144270690603663175125655146779653779704711559859145529045878313495513335210217577529690698727213655610112924562719777175851988189289208341040894009263027595086347437551207963192529500282181331773232436007653397992393116117441727944235399043893357971402359666488120362315131614856836582123038783526011838862886921030809542114010867800036490623546743791171520721436572101271295995800827952361791072733920632438622650044770358334411036131852703607250242915185247673869644533179115398932098387622497321819959625714364698801323110439222441440618455529240199863048854717897742115324778938777889299018792066090868168420492480209744665750016349835975108775877476287978847602352540167439210618876788012751223291712188625903519542787079214864558497844253409161636662752833163653912421174578489548007189401853732531930284410126015718400497658372167948746470769816792865229400106484708129408417899842050080945356211816728801493276004174025332841891436340589350455708014901710475544178116336783689318565883403657646602994310847047182354963725718593521009640772868621755912578585081127789324389653742208565632778795142351557383086033011720593043491916397775736081622065686547973439724261241111971053207281009256430461230918894897981767816399947749490593962155240297426800024507104449339081863042623067583159605395911142101701494774950151613753075289156504886527609228608577847186970592211653876420699600081049681416880712233563434102562675761141128690123223866084888159652075590239709738911830410392018608254201455569860311007779072067652385868759416374864189982831918679273622125511459055600850972612010904767830213799782715764003882357307136429823705641570426025103703698742300684431908448902380041478707925480041622093106041586573450948108730543519178700143267215264322945163081528410604009068036714467658532383061670819024045265833010885224723839410322767871465338752031382885988988748971361955139260625917743832225858936376987267729478549520245392831769780193143417232119629440893485732841753066959971644418123960434642322846083895550998147747713588237964932182618338354454841446673527006535668117260386038648599279440889035857624570895642390706179782025068595104945527146045256276418361487949734290718155726706032164311982262828841018289458707004446163438732701869373171731262971115172489563724021742377952130593979853865635741115287028676412028215465852212686305067436448677052704043547088143056379627539751031514909387945430097693958723900095544194112358782765797969065485245457729421776654034744651763648931687249916118512067621043121241231142659831216978412868060679052452690290856735739657614850284513490361236829912937222327080994379536430845544495894806714305487363881978410022730680024769342859310373468830748323008512651342686049531025043843607156033848065339908349217518481841400933868079302035626971567138888152094046508151111552945690150365378083658793222662032026223815479726492555643804730132074808321344992498027486643449290819482599114105828487641615219672964693194777338269983956802621603116268795838970566087347802496416488962825619088754779664011972981831901064571582915376992515733177199835973504110911619800911292235751049874024910643434038856576923480547329995695101658845604046580244326020461954430313889285581960438165337973766852614321841582817039539047110697731548685055506239449486174608723902279223816006051175677528841217008946126259855577788545837945433978115185048935932037941496592189838129752938740550154773286478383808450858047063784675458633347217399245606511437061783856880761014206012955369572648638200044785957051074475113242728948019352107887967647152921398493052017818124821180843090785580882305916069066900051248820201271906007919772893233919125270375612137702744692541599465446626938794291257108523093530126493135324055849041716269543521704338268189304061534678368229500828033784824263965376313732912297076057507866232046458511123788208599067128019157299068187023053290804883755189863386112089737284172551440234463905281004619954913529567697794692863443196125357534367601049539376816997837017229800686480695348537249190479178071716427001290199635648927217463550875771935534583905222242771838945090280060236100687575055532880552523788203515374536085635324772136095577048577486051829049414790109305027067891919757923955782208378058588763713441014192921252708346588929915322530390699140372003082524792457282779559346665814113475392431299636901368452738073569911194005215973599252203807866252753711393753405859074232505601108620157281745787845142902496227155725532980485032398055494218067186661860989676119571325768957488293968299813424752957916452658980935962417996971432714217566238369726050900324185961165841666962727681084344011224397870733874267346678492883225044639388694241283475098243271401714738879461195941943945333328453486223552435280613736262070379822454267944807377400199372584509293001277057724078760100955655382567120674509651158782597050301365993821550851529497665068282426560125343418801819644705931591599560603656485698044294149622224803721522683030077513966183730556131779336472504787569054526906084083760501688472638076663676910104473598471550585821385008652289390021972217779982931710376374716505632860504187857051615593947524169127496422886797632542006340630266880461905270385917736138164271170736032200042748170230896982537168253739179834829826764115698560139651039148040363621128259450167214071370211066357568165800008310502373155890792663507706418429944105321566252056392232971619736917505025999480818559536635327982931077221787517590442994346345626303586580886224363174204703748151444420024753744388949441869862464821413016123712474505346508146664975150896593514690003864380439823992159597874676734648515220787797069855755494796101616003108952812210704440465081888713543758913086081347179298203522155189672908164697226050943695297037915167334879958301702571604121564110892598344640405644582977391879945994859494231074371784847698771171719081487620976524929757610660854292602388317979265758535665464491220770439402226093317420100016657035462355297947046185332246917774620576703125289204734399328910945521662023757677830229868187868950014605171162951238176279750471562466268455973300704545073434246151372209000909794072015913965525278468821429316979156048281631681045907387499942133118978891849257323992711270130524681067887828422254362138210458004931484720826018738377851173156933692243135910851321083201014255328353211374854840065915432128689721240247964339654344639565363325649987742999089827460410368733815344715480010786532524552064731950343785180360220858076854837101578977487766540612656655992601440139602448873023278817384444149064048924824231160870908412843024317011379231471282862613776688637056170795185546886731076837668060703564589250740403156431474653104637152710819790806647276463843978434235489893880735659237184160680773515166822303764835487829015473276814376097871651373708402329006271526671101888063847344069730202112209974545294426397308687090081826371902629036255287462087794501400996397410435254498813042923991846428462887955309341670342949873597237310558343164816130212759900036859187759831670034316151976756992451479702425962065275875243664491318847337075359822628021608627946467089818164982099828665168659764206796939628343151202165941316613042269415360736139064594398119980890241817455155245070208180478577755884926096656063826542099095719836039393567064292888237852126305323633488638710163416375095410160530805058821843652971642771505337631116822639712004427031777442073139217503012637506600588423736444378755109205445458258100858451957542133574768000123354430927688258474238704365699964870184178360337114559631284371638239498197146114066533529292145751486113074520553796474651949016895929909129606154319630791165555827874720343484599205470620553743889888983587957028926319462887070370098282788311465876409708424701634782509949963861742879323026588409183876021246284354839836812036069589977538210311581110961390775708013290675196372569283981044090560661252739125298182165525423180771399010249305999212571088767666065527719960158584569331900710242249056817503245812052402371555062749589872411099280214600269770630147097470781120581786705280142654946524392062354686788734677151824901629867147382332908256357634290804610950133427303651656979619902427838799126648267311355419600616382054408199429737483626933401218810204292538056089831929309066021550939082617742833062508962612238481564237738011205556364847004539237868870509526714707297123872650883551322796340786126574433381144451949041838583452439968881929231653891276047900567424337289312357047113032825542565383737723114543240294986810455389319142439662988676324422801387261486088834656957220355548767595407446359051086821444689102511117999729236775352980794492233591803620007019785728240839032710221752640853522595965305885176590228255168252546558159761511950370315368252948441895944368661870594533042003132502910598949025526310183527346051892426586038080567590849264651710060219341384544045414972683801087660530136242828427011430835011501727981534789267029241816577786987675287879851380120813462284418662439187240596594470232651877354448295582325914556150479011250316320626671876462300103725378106131673625997621732652654396122254309771759618697582582741499646115185818372587839002944239517213454018509543605150067546159879426907906529239053999319277130983518091666717159820402542640916780640170775776326727537036416745577026235045553921957592428474432509042918256366359643208822262334281382965434196203091556387840462312774390161004935945158499521154525182665711945274242240381144154281829729014818985343607163031514302810079522192769351113859794076709462820044760516693753470025955082655906412194230901296842437187298199583553374954896376574126463103173006579632845657646549373221318546439581432476928430697970495243357810052199609053296785908471457468795536099154818289907678315113097091811795299039702760201591602156751989155059839340109520450510406890797742507756034392143632815624969569451582481564908872336469047914137902854453950086374726652602220610684667164321866638243761321653668285782083034649443210671169998644909746155764581050464846972306304195387692208516569942992695068367512400602983140655937060373726314497680305327967137912726931487064356698639965108423461693549059417167901523291645926064884865647547490103405712139613577904353639631342156326681053351907884985256151393665221499064678107244618161416291183967471075549748405807803628587462305866928893630242589019519306861256843063889145423722980003530111635419060493775052650023941041895231883353745556894400038557827450368324571556758456887816860236224299273284931806726838908131436708954382489324251878531324061377704011119824247072743645384506356291758518750088289786796321731580175233004927039409165779096358751336209294922821028499774050427987374101874461089546822528270978561368211821543335564247666562052437117550262544235868889640288085149016612788947672758781256601794661248276122917882845538949586333143524636494433670135615297514684098311525643516794595026895798139317906509788067123122633480655294493842501151823250305930913708926699622863534051459132368955097493875692846747447796384132409702378875773644961455870404500359309068751454832782158394590590162588584441069543460836895583134798347683662342072504879143230542933801162940000526602090528709573180658146641093667774415747088952529585059538034182401574836747347017542675395536699268850483989990277663014975507486769891651953112199311190863608184035699436937099474139242417704875402770751536283326544482526884796430588329075600098501452553030157817014253199407341745338552861675445937197033824461007492548862170586861054615773056795467049203492705540641187635825079383124212727525176587514274768150881293792956620140916122689346254318238921687187165197556567053306230213008324659065809554434816711869944751710427609661018001929335217660308122564861748129118886370682751044033261162422206690624149017364867886431808718886062486245494277168406078021214188063047111234553598832004078795019979525867065171115124961799338365972844535500472038651594945348515642223946941880471491444454242505370476859174854700312732018637609098667797948314298108836511947616174313056286020534092056863363846078507059559153172482878540309948175854626210327223827515401785912964664729659652604921595175153549075432020498160924860371304832351331120032171824306911253520438537996571075574516629028816530916696881895692635755474958930716033992155881113740238465721608226180925870174365425186933742553338974779964919705557299913833092805891787012992867161964953193033028418197351040761661840646097468540693657750320814309330766923922244602751890315850539348728506385478007207721647290152539765499523744715095352577990150422960970505590169006791714167626095387576264224734856263897590045613264034004492066397934394129832748235170970375696802410968934517770280312545003964343813392162525557097192963673924282144342842997272383754950901930061791419894186867571396334893165653582388122391207569079571167848152255268821153350204861511962910557233563189931412511951014861304217060319581614668747215886573351578106696733911097360782686744031299766844178679994328295949387739381096017838613427611434301171461429763129984142817351651920575211291956484754048493961065611326557408385353693423253375892697390092901484043874789051852533722710588124956272241240527299639999899681028773657051791268452865741532659860978344680145094352837737070274466533575584347669508296004560678599471587230482551165913855367446246959797889254866090913358012406484103279256517688617087661440299134421292106647707440628648422521484897169018916098816364185527828001708084404711252043712869798829087990082196118363589776525610413288217263800337713631033845897240602147779436201541858118096149818485428203786708563685999197633932198767392328876305775442817053617751497658651747161981134151163403589832381222800381710748976545240187337120895119311495297134801635476340661476061095394721957308771876437444116780468888701773499973301208129174869201066365487259235572503616378628872650241021418938162717288103845902586490015766679757685867868487025268673040877162582566869059461730581956660134252359626063358877107145259399748071914091690446171278019782635895189750425279415675188972227890392057350242112327795201776018549223172160041560668318290359414607367039395553215274757066602404824022409397721841867817073154644478482489810306556190191173291895526896453997214962659460526195005762420703544624893019069930738618003727552818818869967462650264372416042961984537100589690932362943111488941933906035538086854406378554120943556905587832094456306875960707935972284874191336644298293087602918765855478679206550809601910446363333476071436786551415428409344767724923560795258475426241916157872768289585960517613104425852418724786127462699328037323902162316694234662405161173345527998552715815612763762613831273254825086251917987223929525220281112700679904628064622763931247265439792367450969066740412512692844790553388713675352273742392584363750915216323410606318145765740142462733261744550983732279154746109213199487562197529960482802248428554733616550278191862680831165253357902169355223733191532033199635617882997150995256877571220052759308635662726805027162832230380419299826709746626223004540136386027185919194328039439210725006711695996192697743607822322562719193713095773665171287579234631952400483924310579259580963964439892453897427492488945818691294005707538991771918321357856498210882503199260156273673498041874983146579254005731365868886268469470247859651833347900685199173794139453466516547180624257749332090292297570069228565553198321618079730515143452616366698888364038706677014258469154875115868812435742266012621200664810798338736520749235327713151775516040245873270654053420136252365034582921640508378577187048898214027641242310765558713059382915300409728656573111586941441926961474538428237379093464553550267138038030744733807373077832258337777575281505098698849946685436235778551986319343870951797619584905052472731807264014170888156908959469658360416408985334126884087511065010105504566755777408160806706384681537126021869554425127817728082620214763570667663207627056165623808166512880368410749358598524407539743603612224524898181848528397164172350235422757810321828076315000673284831219043265639424467004633484520113588256281243443928368541156865791960576467011965641639333249807171557988066630454963555390568736326017706353938956738116134212965616719609339768219627031730981386663904478872657584798106962197566054900034413086739813223556910872937544726368892953613828565600910214937329078561079881821750987833219146323943006633393661985893269828559756168451444139429775116127496061772599023694637424955458382014045517778697387891257903160593074430081920621552257966252717992978682049407207329011737457517810281368247624849477277085581656546765594665377100987174860632054949812625914469948522244303483430626723724482182773900137767179792469855263463295668015492177331119746676422765985755382299098436838417554321213694574934736377233501444203452220766134357571338962589757009788612617233989759740632103176821656470254830707702673179066589725898899012373702955821160939207813874532534077302581040227562171723237777389591521482717106917030353610394666886699046024079154147924754263206048577440107464199650601795523794625963576388934346232129446295249691510385746556565025436489361564843043293913563858819647785256988752049770455800724043877339296443125618721074635608172745453685339284385989363842981740341506672218958276360812657477518769653907116615479152289599454000694576036557056277900643597269043222213321767862810645388981091105573578883515840488004290156038419960892276509561171609688483280955006307210981318286015631674486024627502312456803167728854178143656963351505424769356491906866889924402019214210274121692360237508624145098266998849523423126664281786921831312310120063476843740314045220620383320777412932287779547263756188142305505634937915280316209403393049511548178328913735543431700116653988680335440431353544813625673313052824596487893026639471839941880655187700533911494046362640648743284117228206721304907387832010128990612032253564529788487479433343532246209795006377146433110997668424360569382505817220297105563055525124750091275153899546867369203121545407101925809878497417681256213588724483740949401673768534204511660480719968329190224497054526726529022803479049617238927168156750711377124463423104189444613087418521359470200113109876244915096745709142359478723151233528338579161051459504467711722277664434221472453163243768488635771497759621805330758685332843398182811307286449860266973597630977325733010469399447114947684966118084735428655758463284480775552866038520038456955662767526507224205067387162524817373339947655195473136445581443166495777728473869279232872661746027962842286061201746133232960735796818267185258680460864994985377566328720536202261914143228382566137315464706527930735478063532272263193110716999879720113031184387351995543586603948937629674220641300738638578904280530183093036861987310698667436685059686735983187883493244780077905534762666123549525914988773743395690753443898701318175142383544175095421437987592178954902530951500374238974147747357178040123474664215138660443264125686413134238419390117152234792326465243541789085242921971682047562643163545520444547626699082096200614655021559989798395592776706146888691506595182852753681088452956843212624553929393431294799808743180664781312145328823287721080967769432382421801740203826145214208822828648395359365709577104955895296360591947209887940095919208058549259840714419952390028069663076189542920211266689399764164424117456302145836594242383575284976070934463383308370451345846885837425632646519393082709717915426641667982257755183445223054675802068272417122915598479755665016710146039963691805191671197852110659934754098344490987065936660000446036303445315157504811766449817164256017949581865220152515754085731201399235242435369095799288141013248342042665497359247486045831071640156028233069613129497646123000678413796758953251007309964561065932572423586125686034098480460397143995789767379436608761036434883829532085950487450336687082243407726275882284419059177159612030587750550759806187774336714419152143044380055875858557260727453753164536248398676961633204320744430942028601475507558539813917424257857603810406320257172365098882670764156976693062326530081528485678174024203038846392330453684400742246092860134688412949543604270614024819772070679830533584774220341244373176714756242187035955120885126938999957450225088170904454962182974861451973920408055188235788516256376431990471931795836228815530670864351519051107231625600232769344063869301459361598158792742992354862423880404259514625033050753603471820311467630754400390488908724014369695132683081488465724212199522648697509769486907933196267743493218604107014054390596788654285074231153320005156884606214685910306789012097244552993337524815864870638598527850746215378427070514464216177963867833733655789656234094524900389681940195152184196744818014943594668157628365039168519619248349522027650528791027051862377009127252837660067707930487199483386264578943975661685520080273614940780819447694789166979237307958118823719862071233687373843897076411156079154776272135909980017024651888505944897333353366928280437983188913061884688130133570389683553355894094408391764408659076065262107498976624436078255935689220027945350778439023823567317532505616738010649800919482189413754582465642860927067456703990729654865166623828891803561921556576716746022371508731991796544906385062117623005261508514298788604890786374035984721633322261085250799166779588594320414067753563006602056024019199450444456160284714218952070385108886985997353563578209111812603190761952375184071787468395792471786225196780519662053438660837843021937831245013931823965664691100611816346147039100744333174057610798427715207407075421035604256025913368396828072574545124642885750860442181894544214694826995102838147408663655325235455199377765205445049426736670690563338555918265772276353269971545787380193149912457420604872518154482443818860174351138525151613141982403331924487216048574004909472407278968251190976345454494730693556729440383660799743525407503144929984457893586464538723835528322923759122791339913556613658063317939886153466701646998158124820040501226811468860139149094936435138088330308127316936092738524254842215079808437743225523557402851772965155044777836919904675258475583117148909895472259105190445315727292423675519694740069594281641398829116143816042718146453846620166351902131803824258959081720728151471750041178041740915934001411052501162284132781491843054661881364729888318178201844059336104665053239782262368403258326215378816944712873361636433731443937653671680557100156560808690742036730219390356467148606100970530747614706214837183541122079479012528071088455031220221452355874126944760998133384432394238851824089016928349276717987647989303479101800171895998027205334852298858013293423013435084435407754901534712748430956581182202523831511174047791400281023564529397988983581660359095175352033618820027167522715718271384891129552892835733423078390271539220972984498016689343097276610895582866019536097375669636934546751687378544862089481361537055725117033018417652762646724629746667342952904090175325522990077989900961912092197920865824671669771998058905280056998856175724807962362976953460243350832221325999110733638624657485140412747670404017372738262346693946348243830726649349065126174269460558434991245402937465173578346911675992870271760191870175511271249762098770599801535027102705558482485855497713177713302649460502942042115070503302362970180550095369103650419266379813705522887027642732430473778115757339886457763205675496407101203205978801823942770035974336726748827855194728803401402952741331140700867624222715283003690364282723964699031920212950542515187037060866575107556611501913485088536942443923741835712156787228902276667129820651281146779733435624794447503863286123402771907894873568678534197342490442237938168047265482299320248696619785988347606117683433322614608013517676086422311075888121099544341188564302977233134554248180677545549125819422026977036874823739131089949147369043613396582209011600859977590779805560876719256481884372111257557685760425510776960745728003888322851499980854401919040930834119620997993500902387294234554444087220522815950161937395035320047437549669603224062046936113422528953224749525570438048240513988706943245332178735043966622362702229300770979005024131154527229094720885371899614879386466259425475431469419942790458236530697031117427467325824048542860500752653900270182322590598757172936261445297201654176266707638740736519773578664247665410659525171476558019565292109119711026367337768925653026759698333567881952270753250359651649932691754390024876808071828169841946750928494897635236814004713916035482035539385015562978677334511579712917970211378392184879768313856139396670448045126914099462449053870838767400968636671439303325344315104838680386619803663861839316584193931249533536731929403919150947869102867482741752303464735440845477134855834139640909990619183774486987904818888335799769263969100970478732594415955490562879883651357891559142510485365217988172663474307779252577925880422421776885475313724905522426074203460157027143080906608301591889555228719487560748487329394649427682098424862827780715818483207281262807629966296381050344187420792805361798966514459590912808540351544580834646959214723757577982663661168613878965192263742763284693443746169026775443817395020988568753865004996331334763252123188353650501998748334576790348813386509930680620290445063237801847075297275696576268841974009619245434245281497914387800583714661492020872145838189153598922985858085596337545885297545990571686929555077381390029796826784908078828936052725080423722863406250223515528565982928906681784195392339819674530472353749121178940993634027394981904614416536577578146038003650685161068684341185742786347598628482170529478189656919283618722827695166227226115221692473367447539182698523164903244310426975848829008351369612824127304034077266025906555539804623729604013511381136459003270986398461182849279243405065949514622818844036039873607005299127391173285181352537137474422067831358767979153113038635576600048322707912487555568160349763874619004139980178179865617679486073547319104978260031326658815581427923092906817758302060130264386897334649655181589361575963885003916524464079026250402821992106252139311080849734109997357384604349397801909570145134595758953977766218697492885280143636632066331102306855231124481094894675609849242990426651705539769467253836529834867797564957855693783765610933996460737987956682749517405161143269882713686785879213638412354666358347641712487286727071972698899378156212803934814887316733414317384904236599578760815427500258171729315781154285366716553795710943537436885545224101853297220410307128568126473696361457588143425593364012145511911180808046635749889469290952125637908302427832583688859530213389593870803373202011039215537467079302322986187514193710911876302757913807850202990653125629402399665398440013278575074942627047284317853025240814577543315671681043929210821087088728433312448913008599802051317385455828550586234416558787550265221210576247074690213674587978716174248773877186877835142675260144063952163320892936787545161381847459504697340583382085273852418039921040824204815529638063202817172711685521907417311632854799069869309262900808039905707450400991561050931250230821850487598265252542721819880580452412567350426461013036786811490022419868292983686664729313874345182897864831801248404122577146585226719361745300009125656911514919318424106068262022365500261392301967103126400862156920381313098761308505045832398363991920550465540449971147764979976541493187271153716512103613792857075370154402444069584198787235853641318028433123185061347588913789814170652713639366372354453649982294523146407161529259623248802663347578557737845806518669972359404398996385147923534615166883419711844434034365142555506898301641055686180923892167043480401167734569941882204653390784289092213243001282134948041401837982390275293380896253450738307432458158277080787512015567030674833549588420076800461790370198909755807869224444173012032100070355252966322230665117541014708255849981971874694757416238850611024287395949982990372107184080766047143270545526174938643924438012852177236735220669200451095495562728202538381313937299002537675259381446792255257444608228362722012052808806007199397783989165479524822922748960811939412515352944753213108323714938105445847645655037359831396678149534229220604555321204012249375295545763819358322670803976280551598434833535759846320792713898570302726729443908122234353477474511145704588010872357035300461508938773861574699822070436506585945208910642159577542289979774182302247450120847750746968251417212813810411690424550906769601641060490091303533903715382640008563351610984962356103966529206489158565946025821063677127364241243106257733712991302522778452273412818790666914105397391938470070618844908773055735534605508080540449276896710647982950272688208810018466072254299216271098106307804200459919151316741076252393136628857211591339324430944339124174002745553707392168140966665026558622446501429726041390249079000747144669361418931296617841960306975741126698218473211510810172822304288296286926087454654209005553732390621571664666971568059432185043065218511786531120134424871892851013199354354077689079236326575922892163557854434367381776025355641486021284504926961490860095298577110681812437030730871094825095230553954533553954555411663160282437137602341005673055108642960697600888595999612431580912832391442556901785697961285299485418115825813843561459753895595022489461198281210125989378856186206843283325987122965626199774149058543209686726163680825293927585168618837088443271816915229215711712494762986285415653243037108320774041375396092349480161664868733076470911021889899686218698951988934534733070503532541354438836638395439275603140433986735016752011432690928734355344677517728681128974313392864208256519129069968277682578084136409401523119383368607799869673358708509842065622672636944518461110876611641388335125998402674635097824407446069814536213706890807198712364715262567553528126202625067042428398922373870166635317570409422472866245353025992834265043502710652373536388467758073093781600365427056716977688822352246820235983741847301436971571244204220801955398890624359004495915613901306593188076797473981448159535808165358801523745909567192698558780915394732328681071958443857174114991496339338812466854523946703627325212747196515110499301961452024733656721185668371169605391682754511794176757988582109960066222776920680387833224437339211698314297146713657229900003819518225043760079283952432711875148743602296111888459746083639361617129453142709522566325840089976063080421106119415333272549865661783376186471858016357482397147663438523345766983680485944258086993105388545280511928292705182869680135173538070076464114586826596318706608889299365888273464688431676152338966243866623963812219228590440307234059715021118865292293701090536995152961561601844267162275639549854353709015107665753774894918318746232494120218248921965884968257504044892518895527749898399568089365851472193706909968653307372568897873140822363558761288323306244720042983753753893479681503435261503369971271840297378588621188040491593924584913328976393515258869907065276434322679151558153274152913914051947760087683161178867227421310371997520150984837442342977859044347544229216230868996533095974516011334944810224401476691854315145543043717989389623588128893279886474008858228149443636044965167547203469337060148997112943084007224718679462582891718304577481743901741726443767457652564576926368743452380661155429530312828764461358369477207829536621628271655151170728719544330005655560742684573937757469959019206221779839228677332813690139484157540056101873440677446525927571207730643286469763111511403693817814929575824487275111333735613522108991003452158228586166257152250896388889894648963818759073801641276926335645012961906362081314050865520877140701184563783975613173082436859843454744191020648450215943615566608521817358854685791147111850544761102288087600247808337543289036045298336328385480221290324486220340011338224346637884680109591936933960859603472514081346656425992430736976280820438892684929244149115128792090597062614281816921699930753560758640379828173162932435063867533194022866121725001965913383527769211352594586292982298740924893870396807906889827028238733586660387323532730511029834996461597414456172171925222532100857859393307130503337777114422455360554548741783477927954451512978106680207771186225135998303317805003297392285441401183211233231940490397810366593855787110060786936243952316436796096792112504618292527689477259207969784877237459701555185758544413710961442099563530657242037495353379449768227912069896075345407263384201470166814773052336901496499289719485626987296074485223340853374166385008199523063815371154065484357002001288396824841479280027920720316762113185682736914823820547284054832744697642904820269543305920625681731683957590223302305965562924075827971001279992065318249705061698738062626020159995438272446173202219985828574249877708322407604082268037777443938695580899505490857614560701861165750884151026963332185575870713304251124027997649925695745242886472570735300518290093675527056517530427831296194428385935109876875116520050633707271346275852495175609889188836685834551397675245252369273090548699532482227690261096289967262357956897946415343901756831723775938591163946650139990280520302335105950115087562048447791585157312425686546240440143346114813857373872786037353191650265299829190052183413869503881795071492803366162359769290494723791211295885271614112512656237853932605295907190219425531827246636173384307157721562551982107434280440901237215074973261270118296783293531344641142903377234158196939186447344989347516619921408517844096310159826550417716756223537042853866957384379048124531584208724069770585253596802790643291758230315810092115942167796674372807604883502269445294509402158958799390710933923945352651045982930986699932646837190290072196068818442441342513539744685588141771414094858634665837704779344394270784898485235728237727558192562897383573893635518343430133822296004151886402412393927559020645417805913217112445090520522092147226273773801856344213639723710756196403694230832726065253139856684831004720195609283421705107522545781067009101227136828755170885935595402932058877537445023072760238351630805624163651121297082157586719784212885448979723792325882683600259026136727721858820016627334674430601670539247147435066147730667640968438061637289836818744788806681048981910911603281292152316202060353497695003532381738589219753840338240436337658208174141912190294083384229405482678010450668166962574070606204783939995719482781718721086719939415120892026848490736499219754516262204946559712414425314499800693658777374460979112450640892720527970845051683292864854322283963560496519112708981443845316772732532750167188862975527031229142149105603231935409688542838887036655139681510535585282252353050123193047091437591334634182663871752325651184156616037041378030300942668077220062011182963570422076950908586677837688824103588793994038822539023905312983918837995083678646929484858140543775044706878734726732640061446549407481424796512404932530394818039952490411239711525152001741634616657668876366214010902898709177084535715710383074458475911098866682034884033920018139283122546459554044243590373675271816451025763294004398469772808791830603692800942864237272124505402308224456760555707782219698040268548202824311953993087775439497075286231645967706624614350226592380911801587612855339163802968525598244358589597469780373694335300765465710411816596905961251850070425690385185597318701226592389359250474794513116831570748913511799606481098437392577698066512170291068878332045251555102583240154559370525877587506090836216145857178397943076359468699237446585522949570038522290082654974648594116681694222466749254923454925316483064854211864501251060462947751850344957464576298291183121007266915084846755832074990500498604470296392276232512782283122065368991614501654686353188810819653953053868915972695941948624899654386622772774631927272243724699452281911215984125663399884014410962305070678789215370003981977310772286699156330017992329815935628580229677529136434982815124753523690755028806295082241352032145292111371851559864414067466679783273900869338138965687325996007482905525543309524765109234176637962173761369570741107296093870191763605072105948158707735302239015874656416629253792014215035104122886756822909990027286489265638669277810187309142901380172896688036085672678102715631454794666907456852674434813155154215966103511144207359195380377991698826039199914603580248038781736271317107932388274358897526415973760074321460644109484714453379360376424684878377196833794455530438806498645462958733846800969795211807591618939208350855922756510756244789529229566585395309032458056340220087569207751308830347886792009783063763515330100190339480483128954258731322850789873776846103480025984111370857970779588533991355405417829302747378441220883096332431360843967695346174357518055841835180139054691336405302674622303600036286824192520331725964215332704672354801567556684741830528812610814361568671612214592221110004083026339274609369842671367453080061501965817872922409578222950607409978790566691564816563477288264542000593662388040664691284165294655246766058927875799675167310911983868173247018193592226800973405424635305332742155745022372070807510897483738703946731324354471845879355292650312404697514022759142419247544686274042406200993030422395202635283881640687469702570520582666983025016623960570035571142145074629827843141821026193011977199986312172731095480710379633346707176009642933019948286752236555544670382148243514568318516174518263014921205126980755452674782892275407604263669489460222606534059383467009540326421323245566005453856673116802358283889561749650672142880659250457155001961719921808187262527124265632414290681220844822416602001717452850422452496028529503885236865170677350774810948698214542009950856231893203427224518088031798320045965560359207038816009302706950539755521905567996873617381797839567938706435996027827088510543582045079402162126428609702275658299702276393828608699500037996136328882424654665661438564872481346639310938535570238630555022689293781100849622672286996920969810251669136653288305697942794475208065642532050703338782816409989464097204325551958354246950219500480615787151987543019004350338711165414506782378466814044766415517160427434955675755678203046826419697884691922738468099599655860828892632541442959223491395143936247858382748196585161112391041486848659196579796105846673283083851273476137898840294248268105014440812358871050511045001749758017313662908567033550108458960654956608811287716318390533351656585941045225525742208026960357444960357936810481584872116548493488615344329054062690270833529933780254957360202059026772539729949642423725808067538313715248139859274498619440325741440037967084738072829854047392387709474496065971009022417838575965974893572825831883506335120506687062125349050901422836296647976121459428046945104142698159679796471053744790181873133575798476742515795249751198088645779077675463469788224551414282191958009583860209348150082287076356492926159197911127798376954756268269414049349472422409797245398377703491250346503868270407623172670024782610888382014725689513502832210082194701170552408897838195780396863097056106797155568862786776798862088893133848910177189262816350244066278136319318502109371602626767630435283642086685957765223926088622277759251749218045226180169995086079154248646123381252583880784287948054178955532740497631099864491765195804126251487382189278650561248328495373699091064987603527874323127369571964743180477084253168123073445721426340534948026229052212753076678063184388693963521071676062122577570410309386727848217693526401913417943673498115632617031627632393376444409514087518122867608145170772416713035399685354904639164836536739654032047482987672699325870315370812279468549294179937123634032110220976194310971823723437933605194708341084797027112003744067015812189284254228798639209305484810176445071954696303827087714250651708098789202173158759611724028673215765043943561805163474174183292090545595430701982068147285004077277343644104575938891677530589590209732143478045865491085357133955373187984683366824454932603012431064100531068292199049871210170984351309826966191781307235138763527494728836675794845940140709041332634185921518397925546484618050479488772202852619737546782776503736863300205592982299547516577782690068229773189734043098420216865616156685617883459601796659507388128993980625079972783916320293799044176132457081682972854957256395109325855762924321434276376036168114416943173781367383878676372855690907591343854479594472930333518402211599132792519707102552711753628042681965803259374685970158494369211374965666276251832392495231380575180214546620659828124772921666675727651585260478318000711521806495456267777467835619393320293923006350845350225198663105934842667260044592981296186916401636212360420045532916080055642667351714603802274350934552611808870626263807218497819449285585691109982698001036059141416583810511356377982779925027732463876010722269244858922049790814480971424651325777786344423286589563238110973610988688206818136143217605645591937390026728762853650434094574172602027460231047372283381675135149527447952637151407621888678112912893704836605629621599675383702425440387008808360920944325387889157675418021194938643944111622815755197954414401937876449860647366103172531456222927599396627503587524643022250469946861048124421048846870746581131032681333901233178575643741551358835216142594756267037423586330006631104764497546130688835890683079040484889940682024174814437621877653633502408459880989635889894546578954022314827888245691104365684984448131750537834454556121423350809394601607407923757559338976511122934876878514023165909332271735734379532259462253440014594310722605500711233563553088457488422945976322960541048761363530714655115720501169416802641767586563201753816260098498294736503407076443923807802999904699077421199470228695658467899837587321738460275119273706474761340718228848653712302421880851916527860335603425733847856646211531770342804042239391412959962806301126609028312882924632752761980880563251383515297828513942832719687863486654047562467387608602578525275076533559006833866864721500049635148361750077695018987890979241948097088527127432999189984196176858958072733259505200648771270589168945788909433241859499099323375482824176426095404563223291208801447270316229945947843793347476529440944528444248403312030056994261266559162860503202738965113402956187158177931426985231632269380361393017911262024243698361169584544138374339263266008971604020572131571718253994927532348292786831913907910840662925605303790233587614914663151969217234740537573520588735556100048934678266486333976070814646477656369500210328266237907407297684538054095610548498120698416590951010800691432036814514907387629106235070842145311567123099974889496085464691576012374629868313209270595955891015071860959137441863344907309441676337171121208760395406152849216697975220269141878975400589235158412390509851151421807705034297705053134209069962683960678128305975268739084051216055522884382863784278781766908626353937020368020768894469789773904196388706381301311070923467162809108967576950505250789933173998411683530556025068206779293963728486006829358276123805611921570977602157941103389243045754618020893492499595998525424190336955913696516668280453295442168672487518748322107346808390947792839579085067007260372280190306953392295251130374764658493709471387160579202307358357460710631875672616449723035554108315515312351871702403338588622227772716431933523766065220832930342969395877084524337432280024475642755954826253795453342598405184403481754015391256694786440217631871257256385712714378676991770120770631635952135895968175672195192029946684114540920704358121129520657113855254699036440647228822516836485249542402407155277779194863646565574262921610706714898859524359357806913633977910703700895665123276141895390339817249420003949761841001904388726475743952974067844762308072695097725369191231951038753082023002813400245385494878777717988771946049082960212247181607254917057698712650317076876648498650533217517781663740141820047475421315397011286785770867531668519350130743001066702897981658777547470410291866609925306283028277224887587177014188937609097395071634042581698157469561362873264664563883165469134271288634307593563611639170492968016806581996388756343635460463400797946610099077471223252204799886651956025378686521116942055752980214184688776926802347111373180717048983874036208325241700859851739487163419626778809186894387498775524846481970566552453320988477025941890649117250420720165857329944834983828397793225911615354195918959061202623831802354788620841809815884889773702617368898741181805201224129885148942070709531571848541626082123709243976366018126917637407751171254982317475084212933590269297517354308767603704269656383162492519867032039787119033593786570441164959884206902543175432669044599083767936089767105950672257367445187078015840333388267818233751760797765773843200474651472317641432703254266562103637520420970436135105329734781780181439027611725347024862443138327580455465741082168407568305136657743609397590502614653268055703811883467784071708079135407122265870896517125657522122139645944284192398701866262434237578215753374408909775217882034959729427576492430791186666655112401887916086907583956456118079191985487382758755732988192809755568349667286536805256586481252016381616360878182911270387371212609017828457929043997559769869495545826559453205531680333578027298101748228425372393972408825393056596217409095972311909067604240231129395995357147784037248719865355537890812101643767645581966725433424898005352235699652875406600416368918001943447040866398941648419754302889950203411128605908564363934001840503123168834841186731629626980538622303418774452005291726112265121158512185466453115869256161136688784274737681130086861479314812203555874028284923098614148272161088420059120019132717795579853526103543756388741352299643512837318023232173081727078302607840263361153806834519290738470161283489312470304785810081895990636814972430242112366770913235330521278742731760504333244715226440388340274532993214650402154389586253056552660482761032981434913192970749670933838904716063060393832096198921362980807563965946472186017427152159724285084419283800873581095809986015674484316390907083674225873731686110768543525607055825764225861670315131319988948357687676313029686845971740849118486938659046564360701666745256758366043318367236310843431489693155684026865996518913376911653234395802436169896066489757451636754961104453630202274349073683574056054890488581094903646934983912837710248884267556704284773195985197640657417021867677365981314398922981258051485537207770102206527708908083836991773307709008114264725936213829362969573931833372368551359692008373752459611112592609190645584610323344318393735169904727059787157701549216307464290928596958462102335271549898924590513899532071894792486199068662080998841935576765400542895698813807414649821288830339210651312117355751483494422165487154863038812151596712725828665279562443789257489559623961445129342932810970026201931357262976018060749867775072836633026996509338934663223624672970879529865005235909871440861080436594974250221480802322281179982218612498462562623268109852514271344363725786557227766743605707011300718390548280173902185233508295358533606421847493417442721255666584477282723918824267855607223655264821200948194222209628000724668542902896666928335093270939946298951328684731898699369176910304830151275321017326565484958827212575208258128982765703891280528630645171724808628367733918126649012600078442638529525192538302180891539060288810923607571500607337242492455727950549333574024200678596974675002895120064420124471605868754991006407402547693632612205314060174455092593359376178117425535272213245144470445947841288618704865445620171994619026505726120221099583128958369000923609352481785785136182586118592128471404212304929241004649793318797464986793475390404798352179694914368706387329305825169612896039304032567759037899867351848297125227399189061457450906492658305822025752754121114121906275505550373584658426991049026617973593833025814768260433514647727515164016072715145600550898065590615980159888508221745138637602933587119166935286573775393322019479149993567318679569269391989790122098076729481900939045212771609351614613982458094817975833374423429505528942320880390543633901657946707429706185787409276884178659954225171368169321667986809137805357503201755092253597603093171304412242190698159341473107940515239886275327992121212221281391866165634375285208714685072351388756969699050021653297679031940098119676162421044222218388664790227210289291966842159811616418743292904625540804632014427708744692253452199574077131418399701519126922649692037681970038857537580453746911300103824309308812765850770255263532784410187669040860154603405988072523086800264552782182597665572784082460089110336810977961816155834927218487866982528232848018776149271321452467339168552916739653746963176392211714367153492401930105213185852709658299809153661442178649171414740332143479638897005768520792732149206236957245166211316174174061113519172268340149080593137526954835286210350207346573849111716416474407720356347881035026087598973764464008875608620634184206852334999600014603218962917274897755704454615266099076788869076554121752152708419689001661249526050714556206556692353394108857431063068003299415331439197008349639817440298175137207556718398943868670554589457107585157536966460220371873160143458237393523531010755006058606766141289782562282405101230179282201524764914897731036516211628069064024950944653817509501415715531946508568891870608998414002907749789645311288444739273108838845088267642445095499507098924965536106667396656831227738472688671710773694222286099649679798360633091727657870759826107044566686027590674590803251524645616227699898375228828264586753421312698505762905647901241804471575336930023332019476550732081089388330684447810421662917169407105870443985654552114964253213058277106069109948910294068987897372685891931686204838157184736044912152787356833254103711035740580814711460924127938490661559156449189942084037608600036776285801634607890101468557402624893372018555716362208182302345874974725577574981493057113086949777366212822010204604175021553783756305124547050310075906488971557455523400392970740711033531041823867868752573256923968805259050436735704473495021761956301419795682617249176304532192710280374899167385383559809424145298981147452857201042280716246215201339903707224972549351275179245059823299213375301652346835696957867459011347801575723585070288124209073250128092745763139646463500119252216184391042230171860591130993507772522594467982925671695209725525405461947840400286449741516467470983049217121642065776594836781295773984654738272009767487323044703411687541109042163102672252428582363123060351776514718978501421775852425728278488661876759466773561226359047463053354764171604940286705401848760653390348423901534176865269288549825511781549372716432433208548263034042491717211246726298632929382789312499494348391670843721549742211467691686737987929182748120676431870448718950325247837737061564564352796647461236040849312095505588620959237944859906605958499496336810578758208989400918172998374545469082701620396776372934721878514386102393729120371156490043646213177887597304486410135475993239391094488117184483590601364090359074008694490352578713354101698042621547325150339467105492460588606240719252190684714879449931842202131563565221749063774960637486164714739839031268191432540198488985949821097970303931732948029645021267073589947428502045868376517023474398899823019516749226021101012839544306385870975074238326052406065717731705696038701845175155119485055316802344268464729616805428671273508409275036510504988865931408772277573180393147760573680378817534563342827406732346530024115730783156140617742852303815000298515222585535038619345690794232042721260618108448793264134864716559577866464881155839855696926667955547531180374114961365735669593124829220579901697479938594150086550605994574459465586888597729282545069632120755941459659834605859261739160399262482660987870098665082471014210892236518228223290906942065976209568813556027615426293080019877261296253322866171641362279167663833909111651885379153968285778748693416821589263786507821392791156141204249194979658712922712157796694483995895712872408418922682477522639773070471662599372453789721681691331121375390900254897326281010947070349374601961264556093782449364292161345525541680480453231097004801790578331423523487804067516975568582257924649411838374938208401169665228135466750205439130798939432503449662446126783865741596760149697145303224686986654671332894671711286047056176784869655752177232988657879833279842097661569555409609145698291260670653014005917781253183099701881594553513425959002019645895245792378318288304006456775754697026195816203825853445420755779610792831272472833830997153681679693772336875081413024207812501225621532759809581775934955613947694634095050688431278077440247761264737607403589861790980155266304612709674851363330672321328396006037657424753496379666049367274297661851856675180455788517612017457207771833769946138789604102244353271827650304855734018881388471024040313675555770364934005130341701849924749545362738856870012587762885997581060211243475091836535994643547005873785613042005079253761499618528691602331143177340088700795301064695657465473768172708000548135356764392704445307858187961473478272816579744403555349433623639171226744316623810936587216647395222690056351566040586969196585000179136526054252659173258429530628446670358618677590271419069275436736818488884419263866259124061115103468013594748122832421584726684761129370018407433430528511274370777914283283954477484522119333479399434633633883087019056638711283541133724443043598230271127941428662578731510768929665240241284867603391172539712204492129213866158769571762873481400119953940729803854665765227065872622480730139730432127797450053447617480679348879566051659378851379348372867226995895049105258285304568483848616677620716010757404799908434422737310055068272442338628138933902637385620514959197121029001004343182663550321991573110396377238642256422141888457448088496230681211179191671163046402436921164112718539860695770226413725325517754289207199331221686145139300112612897837519893319354569434307914722421636168309454628532349786626834926532470844414520029202540241386927904112889108658332597332156617813623758018163059012725356415122877763156270226939073260775682418469388573746167864086466774555099361042060564308864944677769043068745450025717949538292161662880825173636308009837554457573960370690907401305331129834183085904551341844443494822412544131324597961206578334413748730989649221739473445109480962577848494370864721150682334570151510411426231339590916977479748445627177597168156627012109658110296557058978224381076639124845743896951881571879609580218838814134352887806546142427177477009998727767641100336680555499214055368976056382444127377727362208713905860130439105652305398254327455477683798657426112692937645479657752639729141967261783557297417335237097136009534510535082948570205629161480630598439562911551368736222037063499633403285329576818052536564889651605506418909983020903703543309262360980913597142651505623582731255631622257763312457175206175194992769887055135322433791852297006157072409054901550590126202496068360916811886585215970887124018741618364304784074358135624398456099213947647748662525346061359188792190991437915443583119460117738729369115335218490181217640442447143850907343038366974517484783882178088823191986552008901311241292232931133097518849473850467391198606071019163525235246369912381298967934600407552774873868799965886041829414723789586538552489037312047911810741025795632691084664022995198979255684865496757606540283735390524236195001281029951177930058600973521041602098307577082781884906338343997525788255444225892913658972056298636312049935577589962755443245871887562200889612159534485855249902156830689285830168552904000408553894139608355166441819404058331469450316580926182071807568595514530344175448948190453433261201093943277588634239374696937747637331350255859715003272682262925506099803827129364760865994139154030157867545731607142558182753484161131098724929 \ No newline at end of file diff --git a/thesaurwhy.py b/thesaurwhy.py new file mode 100755 index 0000000..d020c8f --- /dev/null +++ b/thesaurwhy.py @@ -0,0 +1,55 @@ +from requests_futures.sessions import FuturesSession +import concurrent.futures as futures +import random +try: + import cPickle as pickle +except ImportError: + import pickle + +try: + words_to_synonyms = pickle.load(open(".wtscache")) + synonyms_to_words = pickle.load(open(".stwcache")) +except: + words_to_synonyms = {} + synonyms_to_words = {} + +def add_to_key(d, k, v): + d[k] = d.get(k, set()).union(set(v)) + +def add_synonyms(syns, word): + for syn in syns: + add_to_key(synonyms_to_words, syn, [word]) + add_to_key(words_to_synonyms, word, syns) + +def concat(list_of_lists): + return sum(list_of_lists, []) + +def add_words(words): + s = FuturesSession(max_workers=100) + future_to_word = {s.get("https://api.datamuse.com/words", params={"ml": word}): word for word in words} + future_to_word.update({s.get("https://api.datamuse.com/words", params={"ml": word, "v": "enwiki"}): word for word in words}) + for future in futures.as_completed(future_to_word): + word = future_to_word[future] + try: + data = future.result().json() + except Exception as exc: + print(f"{exc} fetching {word}") + else: + add_synonyms([w["word"] for w in data], word) + +def getattr_hook(obj, key): + results = list(synonyms_to_words.get(key, set()).union(words_to_synonyms.get(key, set()))) + if len(results) > 0: + return obj.__getattribute__(random.choice(results)) + else: + raise AttributeError(f"Attribute {key} not found.") + +def wrap(obj): + add_words(dir(obj)) + + obj.__getattr__ = lambda key: getattr_hook(obj, key) + +wrap(__builtins__) +print(words_to_synonyms["Exception"]) + +raise __builtins__.quibble("abcd") \ No newline at end of file diff --git a/unhex.py b/unhex.py new file mode 100755 index 0000000..14b7464 --- /dev/null +++ b/unhex.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +import fileinput +import sys + +def process_char(c): + return c + random.choice(zalgo) + +for line in fileinput.input(): + #b = bytes() + #for i in range(0, len(line), 2): + # b.appendline[i:i+2] + sys.stdout.buffer.write(bytes.fromhex(line.replace("\n", "").replace(" ", ""))) diff --git a/wpdumpidx.rs b/wpdumpidx.rs new file mode 100644 index 0000000..8d588f4 --- /dev/null +++ b/wpdumpidx.rs @@ -0,0 +1,106 @@ +use rusqlite::types::ToSql; +use rusqlite::{params, Connection}; +use std::io::BufRead; +use lazy_static::lazy_static; +use regex::Regex; +use std::io::Seek; + +lazy_static! { + static ref INDEX_LINE_RE: Regex = Regex::new(r"^(\d+):(\d+):(.+)$").unwrap(); +} + +fn decompress_file(filename: &str) -> std::io::Result>>> { + let file = std::fs::File::open(filename)?; + let file = std::io::BufReader::new(file); + let file = bzip2::bufread::BzDecoder::new(file); + Ok(std::io::BufReader::new(file)) +} + +fn import(filename: &str, conn: &mut Connection) -> Result<(), Box> { + let file = decompress_file(filename)?; + + let tx = conn.transaction()?; + tx.execute("DELETE FROM page_locations", params![])?; + + for line in file.lines() { + let line = &(line)?; + let caps = INDEX_LINE_RE.captures(line).unwrap(); + let title = String::from(caps.get(3).unwrap().as_str()); + let start = caps.get(1).unwrap().as_str().parse::()?; + + tx.execute("INSERT INTO page_locations (title, start) VALUES (?1, ?2)", params![title, start])?; + } + + tx.commit()?; + + conn.execute("VACUUM", params![])?; + + Ok(()) +} + +fn view(page: &str, conn: &mut Connection) -> Result<(), Box> { + let result: Option> = conn.prepare("SELECT start FROM page_locations WHERE title = ?1")?.query_map(params![page], |row| { + Ok(row.get(0)?) + })?.nth(0); + + match result { + Some(start) => { + let start = start?; + let file = std::fs::File::open("data.bz2")?; + let mut file = std::io::BufReader::new(file); + file.seek(std::io::SeekFrom::Start(start as u64))?; + let file = bzip2::bufread::BzDecoder::new(file); + let file = std::io::BufReader::new(file); + + for result in parse_mediawiki_dump::parse(file) { + match result { + Err(error) => { + eprintln!("Parse Error: {}", error); + break; + }, + Ok(page) => if page.namespace == 0 && match &page.format { + None => false, + Some(format) => format == "text/x-wiki" + } && match &page.model { + None => false, + Some(model) => model == "wikitext" + } { + println!( + "The page {title:?} is an ordinary article with byte length {length}.", + title = page.title, + length = page.text.len() + ); + } else { + println!("The page {:?} has something special to it.", page.title); + } + } + } + }, + None => { + eprintln!("{} not found", page); + } + }; + + Ok(()) +} + +fn main() -> Result<(), Box> { + let mut conn = Connection::open("database.sqlite")?; + conn.execute( + "CREATE TABLE IF NOT EXISTS page_locations ( + title TEXT PRIMARY KEY, + start INTEGER + )", + params![], + )?; + + let args: Vec = std::env::args().collect(); + + match args[1].as_str() { + "import" => import("index.bz2", &mut conn)?, + "view" => view(&args[2], &mut conn)?, + _ => eprintln!("Invalid argument {}", args[1]) + }; + + Ok(()) +} diff --git a/wssh.py b/wssh.py new file mode 100755 index 0000000..9a2a677 --- /dev/null +++ b/wssh.py @@ -0,0 +1,37 @@ +import asyncio +import asyncio.subprocess +import websockets +import pty + +def get_shell(): + pty.spawn("/bin/fish") + return asyncio.create_subprocess_exec("/bin/fish", stdout=asyncio.subprocess.PIPE, stdin=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, bufsize = 0) + +async def input_handler(proc, ws): + while True: + msg = await ws.recv() + await ws.send(msg) + print(msg) + +async def output_handler(proc, ws): + while True: + output = (await proc.stdout.readline()).decode("utf-8") + if output != "": + print(output) + await ws.send(output) + await ws.send("[PROCESS ENDED]") + +async def shell_ws(ws, _): + proc = await get_shell() + + done, pending = await asyncio.wait( + [asyncio.ensure_future(input_handler(proc, ws)), asyncio.ensure_future(output_handler(proc, ws))], + return_when=asyncio.FIRST_COMPLETED + ) + + for task in pending: + task.cancel() + +server = websockets.serve(shell_ws, "localhost", 1234) +asyncio.get_event_loop().run_until_complete(server) +asyncio.get_event_loop().run_forever() \ No newline at end of file