Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
Discover gists
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
namespace LinearRegression | |
{ | |
using System; | |
using System.Diagnostics; | |
public static class Program | |
{ | |
public static void Main() | |
{ | |
var xValues = new double[] |
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 os | |
import yaml | |
import logging.config | |
import logging | |
import coloredlogs | |
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'): | |
""" | |
| **@author:** Prathyush SP | |
| Logging Setup |
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
#! /usr/bin/python3 | |
# This script requires pdfimage, pdftoppm (poppler-utils), convert (imagemagick), and alive_bar (alive-progress) | |
# If your pdf file contains jp2 images, you can either (un)comment lines 84 & 85 for a significant performance hit, or you can also install opj_decompress (libopenjp2-tools) | |
# Example usage: python3 pdf-extract-images.py "Players Handbook.pdf" "PHB" | |
# Raw images will be written to <OUTPUT_DIR>/15-organized | |
# Attempts at merging masks and images will be output in webp to <OUTPUT_DIR/30-masked> | |
# Images without corresponding masks will be written in webp to <OUTPUT_DIR>/40-standalone |
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 subprocess | |
import dspy | |
### Note this code is not tested, and likely includes errors that need to be refined. | |
class IterativeCodeRefinement(dspy.Module): | |
def __init__(self): | |
super().__init__() | |
self.generate_pseudocode = dspy.ChainOfThought("task -> pseudocode") |
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
// | |
// Demo Structure | |
// | |
// qty:lab qrtt1$ tree | |
// . | |
// ├── build.gradle | |
// └── libs | |
// ├── a.jar | |
// └── vendorA |
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
#!/bin/sh | |
# This is a pre-commit hook for python. It checks if black is passed and then if flake8 is passed. | |
# Feel free to share your updates. It will help use these git feature! | |
if black . --check; then | |
echo "Everything is all right in black" | |
else | |
echo "" |
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 { createGlobalStyle, css } from 'styled-components' | |
const GlobalStyle = createGlobalStyle` | |
html { | |
/* Maps all colors from the `theme` to CSS variables: */ | |
${({ theme }) => Object.entries(theme.colors).map(([name, value]) => css` | |
--${camelCaseToKebabCase(name)}: ${value}; | |
`)} | |
} | |
` |
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity ^0.8.15; | |
import "forge-std/Script.sol"; | |
// L1 | |
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; | |
import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol"; | |
import { L1StandardBridge } from "../L1/L1StandardBridge.sol"; | |
import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; |
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
# Default config for sway | |
# | |
# Copy this to ~/.config/sway/config and edit it to your liking. | |
# | |
# Read `man 5 sway` for a complete reference. | |
exec wal -R | |
#notifications | |
exec mako | |
exec mailnag |
NewerOlder