-
the C programming language has a set of functions implementing operations on strings (character/byte strings) in its standard library
- e.g. length, copying, concatenation, tokenization, searching
-
for character strings, the standard library uses the convention that strings are null-terminated:
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
function Invoke-ElevatedCommand { | |
param ( | |
[string]$Command | |
) | |
$ExpandedCommand = "Write-Host `"Command: `"$Command`"; $Command; Read-Host 'Press Enter to exit window and continue'" | |
Write-Host "Invoke-ElevatedCommand: `"$Command`"" | |
$process = Start-Process powershell.exe -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"$ExpandedCommand`"" -PassThru | |
$process.WaitForExit() | |
} |
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 bash | |
# Usage: ./render_code_to_svg.sh hello_world.c | |
# -> Creates hello_world.svg | |
CODE_FILE="$1" | |
CODE_FILE_EXTENSION="${CODE_FILE##*.}" | |
CODE_FILE_OUT="${CODE_FILE%.${CODE_FILE_EXTENSION}}.svg" | |
BUILD_DIR=build |
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 bash | |
# Horizontally flip png images and overlay an png image on top of them | |
for filename in frame_*.png | |
do | |
echo "Update $filename" | |
# Horizontal flip | |
magick "$filename" -flop "$filename" | |
# Add overlay image | |
magick convert "$filename" "../overlay.webp" -gravity Center -composite "$filename" |
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
{ | |
"dependencies": { | |
"sharp": "^0.33.2", | |
"ts-node": "^10.9.2" | |
}, | |
"scripts": { | |
"start": "ts-node script.ts" | |
} | |
} |
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 bash | |
# Replace certain rectangles on an osu! skin with transparent areas | |
# Based on: https://stackoverflow.com/a/64823099 | |
# Used skin: https://drive.google.com/file/d/1pEWOl8hRefi9ZGCitIrKaso-K7jBgj9b/view (- Project HKttyCatz V1.0.0 -.osk) | |
for filename in ./scorebar-bg*.png; do | |
WIDTH=$(identify -format '%w' "$filename") | |
HEIGHT=$(identify -format '%h' "$filename") | |
if [[ "$filename" == *@2x* ]]; then |
With the following configuration it is possible to stream 2 audio sinks to Twitch and then on the VOD mute one of the sinks while at the same time hearing forwarding both audio streams to your headphone audio output/sink.
pactl list | grep Name
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 argparse | |
import black | |
import json | |
import re | |
from pathlib import Path | |
def ipynb_format_code_cells(path: Path, verbose: bool) -> tuple[Path, int]: | |
json_data = {} |
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
# Tower of Hanoi | |
# setup: | |
# - 3 towers | |
# - N disks on tower 1 stacked in increasing size (largest on the bottom) | |
# goal: move the entire stack to another rod | |
# rules: | |
# - Only one disk can be moved at a time | |
# - Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack | |
# - No disk may be placed on top of a smaller disk. |
Bottom-Up Parser(word='dnvdndn'):
Grammar:
- S
$\rightarrow$ NP VP - NP
$\rightarrow$ 'd' 'n' - VP
$\rightarrow$ 'v' NP NP | 'v' NP
| | stack | input | action |
NewerOlder