This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Day9 | |
{ | |
public static void Run() | |
{ | |
var lines = Input.Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); | |
long total = 0; | |
foreach (var line in lines) | |
{ | |
// for part 2 just reverse this array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Input `n`: number of coin_types | |
// Input `X`: the wanted sum | |
int coin_types = { ... }; | |
const int32_t TRASH = 2 << 24; // guaranteed greater than X | |
std::vector<int32_t> coin_count(TRASH, X); | |
for (int x = 1; x <= X; x++) { | |
for (int c = 0; c < n; c++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "common" | |
require "./types" | |
require "./serializer" | |
require "./annotations" | |
macro rpc_object(name, &block) | |
class {{name}} | |
extend TxtRPC::Object | |
extend BuilderPattern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import init, { run_app } from '/ui/lenote_ui.js'; | |
async function main() { | |
await init('/ui/lenote_ui_bg.wasm'); | |
run_app(); | |
} | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start the server: | |
cd lenote-server; fswatch src -vro | (while read; do clear; \ | |
date; \ | |
pkill lenote-server; \ | |
sleep 2; \ | |
(RUST_LOG="warn,lenote_server=info" cargo run -- --ui ../target/pkg/debug/ --pages ../pages --data ~/lenote-data &); \ | |
done) | |
# On a different terminal, start file-watcher to compiler the UI on changes: | |
cd lenote-ui; fswatch src -vro | (while read; do clear; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
... | |
<Reference Include="System.Xml.Linq" /> | |
<Reference Include="System.Web" /> | |
<Reference Include="System.Web.Extensions" /> | |
<Reference Include="System.Web.Abstractions" /> | |
<Reference Include="System.Web.Routing" /> | |
<Reference Include="System.Xml" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<ItemGroup> | |
<Reference Include="http://Microsoft.NET.Sdk.Web"> | |
<HintPath>$SDK_ROOT/Microsoft.NET.Sdk.Web.dll</HintPath> | |
</Reference> | |
</ItemGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
class Test_Location { | |
get name() { | |
return this._name; | |
} | |
set name(val) { | |
if (val === null || val === undefined) { | |
throw "Cannot set null or undefined value for 'name'"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fib(i : Int32, ch : Channel(Int32) | Nil) | |
if i < 2 | |
return i if ch.nil? | |
ch.send(i) | |
return 0 | |
end | |
sub_ch = Channel(Int32).new | |
spawn fib(i - 1, sub_ch) | |
x = fib(i - 2, nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FileInfo* = object |
NewerOlder