| #!/usr/bin/env python3 | |
| """ | |
| Demonstrate banning the em-dash (and common variants) with logit_bias. | |
| import os, sys, textwrap | |
| import openai # pip install openai>=1.9.0 | |
| MODEL = "chatgpt-4o-latest" | |
| PROMPT = ("Write a short sentence that would normally include an em dash " | |
| "(for example between two clauses).") |
I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥
| from dataclasses import dataclass, field | |
| from itertools import count | |
| from datetime import datetime | |
| counter = count() | |
| @dataclass | |
| class Event: | |
| message: str |
sed -E -f solver.sed input where input is a file containing the maze.
For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.
The solver assumes the following:
- The maze only contains the characters
# \nSE - Every line has the same number of characters
- There is only one start (
S) and end (E)
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #ifdef _MSC_VER | |
| #include <intrin.h> /* for rdtscp and clflush */ | |
| #pragma optimize("gt",on) | |
| #else | |
| #include <x86intrin.h> /* for rdtscp and clflush */ | |
| #endif |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
| all: | |
| rm boundary.topojson; | |
| mapshaper -i ~/Downloads/cb_2015_us_nation_5m/cb_2015_us_nation_5m.shp name=boundary -clip bbox=-126,23,-65,50 -filter-slivers min-area=700000000 -lines -simplify dp 5% -o format=topojson boundary.topojson; |
| // Start of HEAD | |
| import org.json.simple.JSONArray | |
| import org.json.simple.JSONObject | |
| import org.json.simple.parser.JSONParser | |
| import collection.JavaConversions._ | |
| // End of HEAD | |
| // Start of Body | |
| /** |