Thursday, May 28, 2026

Show HN: Py-SQL-cleaner – format SQL embedded in Python strings https://ift.tt/gOF4aXf

Show HN: Py-SQL-cleaner – format SQL embedded in Python strings Hi HN, I built py-sql-cleaner, a CLI for formatting SQL embedded in Python files. Python formatters handle Python syntax. They do not format SQL written inside Python code. On the other hand, SQL formatters usually target SQL files or raw SQL text, not SQL embedded inside a Python file. Still, I think it is not uncommon to find long SQL queries inside Python codebases. py-sql-cleaner detects embedded SQL inside Python files and works only on that SQL. The main things it can do are: find the SQL, format it in place, or extract it into a .sql file. It avoids rewriting SQL that depends on runtime values or template expansion. For example, SQL containing parameters like %s or :name, or Jinja-style template variables like {{ ds }}, is skipped by default. Try it with: uvx py-sql-cleaner list path/to/file.py uvx py-sql-cleaner format path/to/file.py --dry-run If you write Python, have run into this kind of SQL cleanup problem, or are just curious, I’d be happy if you take a look. https://ift.tt/iIZjKUy May 28, 2026 at 11:00PM

Wednesday, May 27, 2026

Show HN: An update to our long-turn FreeCiv experience https://ift.tt/ar1DF9p

Show HN: An update to our long-turn FreeCiv experience So we have had quiet the journey here. So 70 days ago (aka 73 turns ago) I posted on HN sharing our FreeCiv deployment ( https://ift.tt/j1FJgLl ). FreeCiv is a great game, the clients is very buggy however. I'm using the GTK4 version, but a few others have opted for the QT variant. At some point, we might turn our focus to contributing to improving the client based on our experiences playing the game. We've since added a lot of little fun features: - The editor: you can write to the newspaper Editor and they /might/ publish what you write, quote you, or decide you're full of it and write an opinion piece slamming your reputation. The editor will also reach out to a few players, each turn, and ask for their input on current game matters. - The Intelligence Dashboard. People were forgetting what they were up to, so we added a dashboard showing the timeline of what happens per turn for your player. - beta the online map viewer: I wanted a way to view the map without loading the client, so we started working on a beta map viewer that is HTML based. - The Chronicle (The newspaper) has also grown a bit. Maybe too much? We'll see. The crossword is fun. Some other 'fun' things that happened: my brother in law stopped speaking to me because of in game banter that was taken way too seriously. My friends invaded my wifes territory, and well, she didn't like that either. I'm currently in the lead, but theres still a long way to go from 475BC. https://ift.tt/lSg0sA2 May 28, 2026 at 05:54AM

Show HN: Open-Source AI Racing Harness https://ift.tt/N0tsIi2

Show HN: Open-Source AI Racing Harness Hi I'm Dan from Elodin, making an open source real-time capable flight software simulation. For AI Grand Prix contestants, the wait for the Round 1 virtual qualifier simulation has been grueling. If you’re competing, check out our simulation harness to tide you over, built to match the published competition constraints and message format. It runs against real Betaflight, which we learned requires at least 1000 sensor samples per second to run real-time correctly. The competition warranted introducing a new feature to generate the camera sensor directly in the simulation loop. Typically people connect to Unreal or similar game engine to create a camera sensor, which works well but is very heavy. For the simple needs of this challenge, creating sample directly in the loop is very handy and easy to use. Happy to hear your feedback on this! While it's not fancy looking currently, it uses the Rust Bevy game engine, which should allow us to improve the visual fidelity quickly. We all should easily be able to shift our implementation to the published competition sim once it lands. Hope you enjoy and good luck! https://ift.tt/fPR8G7r May 28, 2026 at 02:07AM

Tuesday, May 26, 2026

Show HN: DDoS detection in 500 lines of Python (MIT, no cloud, no account) https://ift.tt/zTs4o0H

Show HN: DDoS detection in 500 lines of Python (MIT, no cloud, no account) https://ift.tt/nKWH2LS May 27, 2026 at 02:09AM

Show HN: I used AI to built static recompilers for 5 retro game systems https://ift.tt/Tgt2PkW

Show HN: I used AI to built static recompilers for 5 retro game systems https://1379.tech/nes-snes-genesis-virtualboy-and-psx-a-journey-with-ai-and-recompilation/ May 26, 2026 at 11:08PM

Show HN: An LLM translator whose source is a single prompt https://ift.tt/0oaG9d5

Show HN: An LLM translator whose source is a single prompt https://ift.tt/YLRIZbE May 26, 2026 at 11:53PM

Monday, May 25, 2026

Show HN: Py-SQL-cleaner – format SQL embedded in Python strings https://ift.tt/gOF4aXf

Show HN: Py-SQL-cleaner – format SQL embedded in Python strings Hi HN, I built py-sql-cleaner, a CLI for formatting SQL embedded in Python f...