import argparse | |
import json | |
import os | |
import os.path | |
import shutil | |
import sys | |
from jupyter_client.kernelspec import (KernelSpec, KernelSpecManager, | |
NoSuchKernel) |
// put in https://editor.p5js.org/ | |
// generated (mostly) with GPT4 | |
let cols, rows; | |
let w = 2; | |
let colors = []; | |
let i = 0; | |
let j = 0; | |
let sorted = false; |
type term = | |
| Lam of (term -> term) | |
| Pi of term * (term -> term) | |
| Appl of term * term | |
| Ann of term * term | |
| FreeVar of int | |
| Star | |
| Box | |
let unfurl lvl f = f (FreeVar lvl) |
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Linq; | |
public class MyDictionary<T, V>: Dictionary<(string, T), V> | |
{ | |
private IEnumerable<(string Name, T Value)> GetMembers(object obj) | |
{ | |
var properties = obj.GetType().GetProperties(BindingFlags.Public).Select(o => (o.Name, Value: (T)o.GetValue(obj))); |
# Download all images from all FOLDER_NAME in FOLDER_NAME folder | |
# and save them to FOLDER_NAME/_attachments folder. | |
# Then replace remote image paths with local paths. | |
# Usage: python download_imgs.py | |
import os | |
import urllib | |
import urllib.parse | |
import urllib.request | |
import re |
using namespace System.Management.Automation | |
using namespace System.Management.Automation.Language | |
Register-ArgumentCompleter -Native -CommandName 'stack' -ScriptBlock { | |
param($wordToComplete, $commandAst) | |
[string[]]$localCommand = @('"--bash-completion-enriched"') | |
$hay = [System.Collections.Generic.List[string]]::new() | |
foreach ($item in $commandAst.CommandElements) { | |
$localCommand += '"--bash-completion-word"' | |
$localCommand += """$item""" | |
$hay.Add($item.ToString()) |
In the olden days, HTML was prepared by the server, and JavaScript was little more than a garnish, considered by some to have a soapy taste.
After a fashion, it was decided that sometimes our HTML is best rendered by JavaScript, running in a user's browser. While some would decry this new-found intimacy, the age of interactivity had begun.
But all was not right in the world. Somewhere along the way, we had slipped. Our pages went uncrawled by Bing, time to first meaningful paint grew faster than npm, and it became clear: something must be done.
And so it was decided that the applications first forged for the browser would also run on the server. We would render our HTML using the same logic on the server and the browser, and reap the advantages of both worlds. In a confusing series of events a name for this approach was agreed upon: Server-side rendering. What could go wrong?
In dark rooms, in hushed tones, we speak of colours.
My answer to: https://www.reddit.com/r/Clojure/comments/pcwypb/us_engineers_love_to_say_the_right_tool_for_the/ which asked to know when and at what is Clojure "the right tool for the job"?
My take is that in general, the right tool for the job actually doesn't matter that much when it comes to programming language.
There are only a few cases where the options of tools that can do a sufficiently good job at the task become limited.
That's why they are called: General-purpose programming languages, because they can be used generally for most use cases without issues.
Let's look at some of the dimensions that make a difference and what I think of Clojure for them: