This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "github.com/andlabs/ui" | |
| _ "github.com/andlabs/ui/winmanifest" | |
| ) | |
| func makePage1() ui.Control { | |
| return ui.NewLabel("Page 1") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > cmd | |
| Microsoft Windows [Version 10.0.20241.1005] | |
| (c) 2020 Microsoft Corporation. All rights reserved. | |
| C:\Users\oliver\AppData\Local\Temp>mkdir d1 d2 | |
| C:\Users\oliver\AppData\Local\Temp>echo @echo BAT >d1\a.bat | |
| C:\Users\oliver\AppData\Local\Temp>echo @echo BAT >d2\a.bat | |
| C:\Users\oliver\AppData\Local\Temp>echo print('PY') >d1\a.py | |
| C:\Users\oliver\AppData\Local\Temp>echo print('PY') >d2\a.py | |
| C:\Users\oliver\AppData\Local\Temp>set PATHEXT=.COM;.EXE;.BAT;.PY | |
| C:\Users\oliver\AppData\Local\Temp>set PATH=d1;d2;%PATH% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is a relatively common pattern: | |
| while (true) | |
| { | |
| if (predicate()) | |
| continue; | |
| ... | |
| break; | |
| } | |
| // so is this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <comment> | |
| A pseudo-RXML of how you might implement a table-rendering based on a collection of YAML files, | |
| using technologies built into Roxen since 1995, imagining the vcs tag had gained git support, | |
| and that a yaml tag had been introduced similar to other parsing tags. | |
| Roxen was based on uLPC, the MUD language, which was a dynamic (jit'd -> p-code) C++/Objective-C | |
| like language, which meant it was capable of jit/caching dynamic content generation... | |
| It featured a server-side XML-based scripting language called RXML which integrated with | |
| your HTML fluidly the way modern HTML 5 introduced things like <template> etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| # time | |
| t = 0 | |
| # how likely is replication to be successful | |
| replication_success_ratio = 0.7 | |
| # estimate time for rna in a cell to reach a replication center, | |
| # we'll also repurpose it as how long it takes a viable strand to | |
| # start itself replicating (which is generous), | |
| # and how long the virions in a dead cell take to find new cells. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this is pseudo-c | |
| struct Pointers { | |
| const char *timestampStart; | |
| const char *timestampEnd; | |
| const char *pidStart; | |
| const char *pidEnd; | |
| const char *levelStart; | |
| const char *levelEnd; | |
| const char *prefixStart; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Go's informal error handling syntax introduces a lot of boiler-plate and ambiguity: | |
| // boiler-plate: you have to capture and test the value, and you frequently want to forward it, etc | |
| // there is also the potential for people to violate convention/norms. | |
| func sqrt(value float64) (float64, error, error) { | |
| // what does the second error mean? | |
| } | |
| func v(value float64) (error) { | |
| // just, what ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| # requires zeroconf (e.g. pip install --user zeroconf) | |
| from collections import defaultdict | |
| from time import sleep | |
| from zeroconf import Zeroconf, ServiceBrowser, ZeroconfServiceTypes | |
| from json import dumps | |
| verbose = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| # requires zeroconf (e.g. pip install --user zeroconf) | |
| from collections import defaultdict | |
| from time import sleep | |
| from zeroconf import Zeroconf, ServiceBrowser, ZeroconfServiceTypes | |
| from json import dumps | |
| verbose = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| # requires zeroconf (e.g. pip install --user zeroconf) | |
| from collections import defaultdict | |
| from time import sleep | |
| from zeroconf import Zeroconf, ServiceBrowser, ZeroconfServiceTypes | |
| from json import dumps | |
| verbose = False |