RSSAmplifier

Blog

ballingt

Recent content on ballingt

ballingt.comRSS feed ↗46 posts

Latest posts

JavaScript Packaging

Publishing a JavaScript library requires creating an artifact (a .tar.gz file, aka tarball) that will be downloaded when your users install the package, say with npm install your-package . Call the directory in a git repo the “source package” and the tarball artifact the “distribution package.” After creating this artifact you upload it to a package registry, typically npm.…

I finally got excited about LLMs


 I’ve been reading Simon Willison , Matt Webb , and Geoffrey Litt this week on using LLMs to accomplish things I didn’t realize computers could do. 
 That’s Large Language Models, often we’re talking about GPT-3 from OpenAI but the technology is more than a specific product. Open versions of this aren’t far behind. Google might have had better versions of all…

Observable Hugo Shortcode

Here&rsquo;s a shortcode for embedding Observable notebooks in Hugo. &#xA; {{< obs&#xA; specifier='@ballingt/embedding-example'&#xA; cells='vegaPetalsWidget,viewof minSepalLength,viewof minSepalWidth'&#xA;>}}&#xA; When the shortcode is installed in layouts/shortcodes/obs.html in your Hugo site, the input above produces the output below. &#xA; &#xA; &#xA;&#xA; Here&rsquo;s the code to stick in the…

Porting Endless Sky

&#xA; I spent a couple weekends in 2018 and 2019 trying and giving up at porting Endless Sky , an open source 2D space exploration game in the vein of Escape Velocity, to the web. I&rsquo;d start with writing Hello World in C using Emscripten to compile to WebAssembly and then try to draw the rest of the owl: porting a whole application. &#xA; This year I decided to ask for help. I was fortunate…

2019

&#xA; This Year &#xA; New biking destinations! &#xA; &#xA; China Camp, great for first time biking campers, bike path almost the whole way, <30mi &#xA; Pinehurst Road around Redwood Regional Park from Berkeley, great forest! &#xA; &#xA; &#xA; Reading : lots of scifi! I had a great reading summer. &#xA; Traveled to Serbia and Argentina! &#xA; &#xA; Work: I joined a data engineering team at Dropbox…

Waiting for the next Python implementation

The time may be ripe for a new Python implementation. &#xA; A lot of keynotes lately have called for one anyway. They are joined &mdash; informally, not speaking in an official capacity &mdash; by Python core developers in issuing a wakeup call: where is Python in the browser? Where is Python on mobile devices? How could Python be 2x faster? &#xA; Barry Warsaw at the PyCon 2019 Python Steering…

Experiences that have Tetris-Effect&#39;d me

Tetris Effect : doing certain kinds of really absorbing things will make the activity pevasive in your thoughts when you close your eyes. This isn&rsquo;t conversing with characters from a book I&rsquo;m reading in a dream, this is starting to fall asleep and suddenly seeing falling blocks. I&rsquo;d consider this different from &ldquo;thinking with portals&rdquo; where I start to be reminded of a…

The Thue-Morse Sequence

&#xA;&#xA;&#xA; Making things even &#xA; When I was little I liked (had a compulsion 1 ) to make certain things symmetrically even: if I accidentally brushed my face with my left hand, I might purposefully brush it with my right. &#xA; Sometimes left then right wasn&rsquo;t enough: the right touch had been more recent! As the mental weight of each touch decayed with time, the right touch remained…

Python is not Java or C&#43;&#43;: Python as a second language empathy

&#xA; abstract &#xA; &#xA; &#xA; &#xA;&#xA; &#xA; Python is not Java, nor is it C++ &#xA; It&rsquo;s different! Let&rsquo;s talk about how. &#xA; Why? &#xA; Because as Python experts (you did choose to come to a Python conference so likely you&rsquo;re either an expert already or in time you&rsquo;re going to become one if you keep going to Python conferences) we have a responsibility to help our…

PyCon Trivia 2017

Brandon Rhodes, in addition to chairing the PyCon and giving a talk this year,&#xA;MC’d the Python trivia night as he has done for the past three years.&#xA;( 2014 ,&#xA; 2015 ,&#xA; 2016 ) &#xA; This year for some reason (maybe because I see him at&#xA;work ) Brandon asked me to help out with the&#xA;trivia night. Along with Larry Hastings, each of the three of us wrote eight&#xA;trivia…

Methods in Python

Meet self &#xA; In Python we have functions and methods. &#xA; Function definitions in Python look like this: &#xA; def sloganify (x):&#xA; return ' {} or bust!' . format(x) &#xA; And method definitions look like this: &#xA; class Person :&#xA; def sloganize (self, x):&#xA; return ' {} or bust!' . format(x) &#xA; Classes are buckets of functions &#xA; When we write Python code, we don&rsquo;t…

Why teach JavaScript first

A couple of tweet threads from Sarah Drasner caught my eye today: &#xA; The decision by Stanford to use JavaScript to teach instead of Java has me wondering, why not Python? &mdash; Sarah Drasner (@sarah_edo) April 22, 2017 &#xA; &#xA; After a few hours of this tweet going and some interesting discussion in the thread, I think my opinion on this has swayed https://t.co/1z1z5EJyNf &mdash; Sarah…

Debouncing terminology

&#xA; When I get stuck on a computer thing, I tend to ask a question&#xA;in an irc channel or Slack or Zulip. &#xA; &#xA; &#xA; Sometimes it takes a while for my question to be answered. This is OK!&#xA;Sometimes the act of asking the question helps me get unstuck.&#xA;Often I end up making some progress after asking the question.&#xA;At this point I can say &ldquo;nevermind, I don&rsquo;t need…

Who am I to give this talk?

Mariatta Wijaya tweeted &#xA; 💭Thought process: - I wanna do a talk about lib X 💡 - nah I'm not qualified 😩 - lib author should give the talk How can I overcome this? 😓😕 &mdash; Mariatta 🤦 (@mariatta) January 9, 2017 &#xA; &#xA; tonight, asking how to get over the feeling that&#xA;you are not qualified to give a talk you have an idea for.&#xA;You can read other answers by following the tweet…

From the Recurse Center to Dropbox

&#xA; Last September I moved on from the Recurse Center , f.k.a. Hacker School.&#xA;Three and a half wonderful years there shaped me as a programmer, an educator,&#xA;a contributing community member and above all as a learner. &#xA; There&rsquo;s so much to say about the Recurse Center that I have trouble saying anything at all.

Interactive Interpreter Undo

Undo is my favorite feature of the fancy python shell I help&#xA;maintain , and I wish more interactive&#xA;interpreters had it. I’ve previously&#xA;written about the mechanics&#xA;of implementing a command line interface that can rewrite its history, but not&#xA;about how to teach a system to undo. I’d like to tell you why I like undo, and&#xA;I hope afterward you&rsquo;ll consider adding undo to…

Richer command line interfaces

This post is preceded by a description of two types of command line&#xA;interfaces . The more command line-like of these&#xA;two types integrates into a normal shell session ( python , telnet , bash )&#xA;instead of using the alternate screen to present a fullscreen text user interface&#xA;( top , vim , emacs ).&#xA;Sometimes programs blur this boundary with fancy formatting in a…

Two types of command line interfaces

Command Line Creature Comforts &#xA; When a command line utility writes to stdout, sometimes that output is going&#xA;to be piped to another utility or redirected to a file. And sometimes the&#xA;input it reads from stdin will be coming from a file or another utility.&#xA;But other times that output is just going to be displayed by a terminal emulator,&#xA;and that input is going to be provided by…

Basic banner grabbing with Python

I&rsquo;m attempting to write a bot and I was trying to find some information&#xA;about ports on other computers. If anyone could help me out, I would appreciate it. &#xA; When you create a socket in Python, what does it represent? &#xA; What would be the underlying procedure for creating a connection with a host? &#xA; Let&rsquo;s say I try to connect to a host using socket.connect, does it raise…

Finding closure with closures

This is a presentation I gave at PyCon 2016.&#xA;You can watch the video on YouTube &#xA;and view the slides &#xA;served from the&#xA; repo on GitHub . &#xA; &#xA; A friend of mine was asked what a closure was at a programming interview a few&#xA;years ago. Despite being a competent Python and JavaScript programmer who took&#xA;advantage of closures in code he wrote, he froze up at the…

Rebinding closures in Python

Since the release of Python 2.2 &#xA;in 2001, all Python functions have closed over bindings in outer scopes.&#xA;Before this release variables referenced from outer scopes had to be passed in&#xA;as arguments. A common workaround to this limiting behavior&#xA;was to set these at function definition time&#xA;with keyword arguments: &#xA; #!/usr/bin/env python2.0 &#xA; def find (self, name):&#xA;…

Remember to use invalidate_caches() in Python 3

This code fails 42% of the time. https://t.co/kTWKHrff3Q pic.twitter.com/pxLTYjkPYU &mdash; Thomas Ballinger (@ballingt) December 21, 2015 &#xA; &#xA;&#xA;&#xA; I was getting intermittent failures of a&#xA;test that checked that a feature of&#xA; bpython was working. 1 &#xA;The test was failing on my computer&#xA;despite passing on Travis CI ,&#xA;a service that automatically runs the tests…

Terminal talk in one week

Last night Amy Hanlon , A. Jesse Jiryu Davis &#xA;and I gave previews of our upcoming PyCon talks at an NYC Python Meetup Group &#xA;event hosted at Venmo. &#xA; I had a great talk with James Powell about&#xA; rlundo and his many adventures&#xA;with loading shared libraries, and got valuable feedback about the talk from a&#xA;few folks, particularly Jesse.&#xA;I won&rsquo;t be able to post the…

Comparing key detection code in Blessed and Curtsies

lmontopo and I recently contributed&#xA;to jquast&rsquo;s wcwidth , a pure Python&#xA;implementation of the system call of the same name. Contributing was really&#xA;easy, and jquast was very supportive and helpful. Working on wcwidth led me to&#xA;(re)discover Blessed, a terminal wrapper used in wcwidth&#xA;to assist with manually inspecting whether character sequences were the right&#xA;length…

Writing Curtsies Docs

I finally bit the bullet and wrote documentation for&#xA;Curtsies this last weekend.&#xA;This required getting familiar with a few new tools like reStructuredText&#xA;and Sphinx&rsquo;s additions to it, including learning enough about those projects'&#xA;internals to write a hacky&#xA; custom directive and parser &#xA;for displaying ANSI escape code-containing terminal output. But the…

In celebration of yield from

A conversation with current Hacker Schooler Cerek &#xA;about writing a&#xA;boggle solver in Haskell motivated me to squeeze in writing up a&#xA;solution in Python yesterday morning between appointments with&#xA;Hacker Schoolers. &#xA; The strategy I followed was to generate all candidate&#xA;words and check them for validity with a dictionary, with the optimization&#xA;of not actually traversing…

Reading Error Detecting and Error Correcting Codes

Last week&rsquo;s Hacker School &#xA; Paper of the Week &#xA;was Richard Hamming&rsquo;s &ldquo;Error Detecting and Error Correcting&#xA;Codes.&rdquo; &#xA;I worked through the paper (not something I do a lot)&#xA;and wanted to show an example of my process reading it. &#xA; I&rsquo;m probably an &ldquo;active&#xA;learner,&rdquo; insofar as that&rsquo;s a useful label in describing learning…

Python Prompt Toolkit impressions

Last night I discovered Jonathan Slenders&rsquo; Python Terminal Toolkit : a fancy interface to&#xA;the Python interpreter very much like&#xA; bpython-curtsies , the project I&rsquo;ve&#xA;been working on on and off for a year. I was simultaneously very excited to&#xA;see this work and a little depressed - on first glance many aspects&#xA;of the project seem better than bpython, and appears to…

Garbage collection

Guy Steele is a smart man who gave a talk sixteen 1 years ago about the&#xA;design 2 of the Java 3 programming 4 language. 5 6 &#xA;In Guy Steele&rsquo;s talk &ldquo; Growing a&#xA;Language &rdquo; he&#xA;does not tell what garbage collection means, and says that is a task&#xA;for you to try in&#xA;your spare time. I have some spare time this day, and so will try to tell&#xA;what garbage…

August bpython sprint

I just took a vacation for a week! I spend time with my family in Washington&#xA;State mostly doing fun outdoorsy things.&#xA;I didn&rsquo;t answer email for the week but I did try to get some&#xA;work in on bpython: only as much as was fun to do at the time. I made a list of&#xA;issues 1 &#xA;to try to tackle and chose the deadline of the first day of the next batch of&#xA;Hacker School to finish…

PyGotham bpython lightning talk

The Python REPL is great! You can try out code before putting it in your&#xA;program and get information about types and objects: &#xA; &#xA; A while ago some people created an even better REPL - you probably haven&rsquo;t&#xA;heard of it: 1 &#xA; &#xA; Then a fellow named Bob created bpython. It does some cool things. I wrote&#xA;bpython-curtsies, an alternative frontend to bpython, that&rsquo;s…

bpython curtsies is live

bpython 0.13 has just been released &#xA;and it includes bpython-curtsies, the bpython&#xA;frontend I&rsquo;ve been working on on and off for 9 months. If you&rsquo;re&#xA;not reading on your phone or in bed with an ipad, take a moment to try it out: &#xA; $ pip install bpython[curtsies]&#xA;...&#xA;$ bpython-curtsies&#xA;>>> s = 'abc'&#xA;>>> s. <look at that great autocompletion and call a…

Python Essential Reference Tutorial Quiz

Sometimes Python serves as a convenient lingua franca:&#xA;it stands in for psuedocode as a language for expressing&#xA;general programming ideas. For example,&#xA;this excellent introduction to functional programming &#xA;uses map(function, iterable) &#xA;to to express the same idea&#xA;that list comprehensions express.&#xA;This isn&rsquo;t as Pythonic, but it&rsquo;s more universal.&#xA;The…

Python and JavaScript

One late night at Hacker School a few months ago, I had the chance to&#xA;discuss programming languages with the inimitable Will Byrd.&#xA;At one point I mentioned that JavaScript and Python felt terrifically similar to me.&#xA;Will thought that seemed odd, which made me want to examine it further. &#xA; Let me tell you about my favorite dynamically typed language. &#xA; JavaScript∪Python &#xA; In…

Surprising Python

Here are some things that surprise folks about Python.&#xA;I&rsquo;ll present one with some background, then list a few others. &#xA; &#xA; Ever since Kristen Widman built a bittorrent client &#xA;at Hacker School last year, building one from scratch has been a popular project here. 1 &#xA; A few months ago my friend Joe Wilner was having fun with the parser section of the&#xA;project, decoding a…

Math Museum Review

Last Saturday I went to the Museum of Mathematics , across from Madison Square Park&#xA;with Casey. The museum of math appears to be primarily a playground where parents&#xA;bring their children to osmose math from pretty geometric shapes.&#xA;It was a bit expensive, small, and broken. But it was also pretty fun. &#xA; Exhibits were generally interactive activities you could enjoy without…

Trees in Python

This week I wrote a lot of trees: &#xA; &#xA; &#xA; Regular expression&#xA;parser - builds regular expressions with a recursive&#xA;descent parser &#xA; &#xA; &#xA; Regression trees - building a decision tree for classification &#xA; &#xA; &#xA; Program Synthesis - I talked to a lot of other people about program&#xA;synthesis and built things with some of them. &#xA; &#xA; &#xA; Simple Tree in…

Nonblocking stdin read works differently in Python 3

I added better paste support to&#xA; bpython-curtsies this week, and when I&#xA;finally got around to testing the feature in Python 3 I found things weren&rsquo;t&#xA;working as expected. The bug was to do with doing nonblocking&#xA;reads of stdin working differently in Python 2 vs 3. &#xA; Once I traced the problem (pressing keys didn&rsquo;t do anything) to recent changes&#xA;I&rsquo;d made to…

Prepping for a Python talk with code snippets

After not making much progress on bpython for a while, someone in #bpython&#xA;asked for better paste support, and I found I needed the same feature.&#xA;Building something someone else needs and building something I want are two&#xA;of my favorite things! &#xA; I&rsquo;d like to give a presentation this week at Hacker School about features of&#xA;Python folks might not have seen, in the form of…

Native scrolling in bpython: bpython-curtsies

I&rsquo;ve mostly finished up work on an alternative frontend for bpython. &#xA; Updated: this is now the default bpython frontend,&#xA;installed with pip install bpython &#xA;and then run with bpython . To use the old frontend, use bpython-curses .&#xA;The rest of this post refers to this new frontend as bpython-curtsies . &#xA; bpython-curtsies is bpython with native terminal scrolling: &#xA;…

(untitled)

&#xA; &#xA; &#xA; &#xA; &#xA; &#xA; &#xA; hello&#xA; &#xA; &#xA; &#xA; &#xA; Merry Christmas!&#xA; &#xA; Let's go to Hamilton on Feb 27!&#xA; &#xA; &#xA; &#xA; &#xA;&#xA; &#xA;

Books I&#39;ve read since 2018

&#xA; &#xA; &#xA; Books I've read &#xA; &#xA; &#xA; 2024 &#xA; In progress -->&#xA; -->&#xA; A Deepness in the Sky - Vernor Vinge &#xA; The Wee Free Men - Terry Pratchett &#xA; It's been a rough year for reading! I've been pretty into work. &#xA; 2023 &#xA; Ace - Angela Chen &#xA; The Warmth of Other Suns - Isabel Wilderson &#xA; Happy Go Lucky - David Sedaris &#xA; Soul Music - Terry Pratchett…

Games I&#39;ve played since I 2017

&#xA; &#xA; &#xA; Games I've played &#xA; &#xA; &#xA; 2026 &#xA; 2025 &#xA; Peglin &#xA; Balatro &#xA; Thronefall &#xA; 2024 &#xA; 2023 &#xA; Final Fantasy XVI &#xA; 2022 &#xA; Horizon Zero Dawn: Forbidden West &#xA; Cult of the Lamb &#xA; Vampire Survivors &#xA; Slay the Spire &#xA; Hades &#xA; 2021 &#xA; Horizon Zero Dawn &#xA; Stardew Valley &#xA; Frog Fractions 3 &#xA; Final Fantasy XV &#xA;…

Marie&#39;s Crisis

&#xA; &#xA; &#xA; Marie's Crisis &#xA; How fun is Marie's Crisis? More fun if you like singing, more fun if you know the music, more fun if you know the words.&#xA; &#xA; &#xA; Pianists &#xA; Michael James Roy - most Saturdays? &#xA; Saturdays are great.&#xA; Brandon James Gwinn - Thursdays maybe? &#xA; Thursdays sometimes maybe?&#xA; Playlists &#xA; Most Popular Spotify list &#xA; Really popular…

Programming ideas I&#39;m tracking

&#xA; &#xA; &#xA; Things in Programming &#xA; that I'm paying attention to &#xA; &#xA; &#xA; Philip Guo &#xA; Publications &#xA; repl.it &#xA; lighttable+eve &#xA; The tragedy of a wonderful run &#xA; Runkit &#xA; I wonder what's going on with this &#xA; Observable.hq &#xA; I want to understand how this can work product-wise &#xA; Glitch &#xA; fast.ai &#xA; Airtable &#xA; &#xA;

Thomas Ballinger bio

&#xA; &#xA; &#xA; Thomas Ballinger &#xA; Variable length bio &#xA; Move the slider to get a bio of the length you need.&#xA; Prompted by @pgbovine .&#xA; &#xA; 42 chars &#xA; &#xA; full name in body&#xA; &#xA; &#xA; &#xA; Tom is pretty awesome. You'll need to enable JavaScript for this. If you'd prefer a handcrafted bio for your purposes, send me an email . &#xA; &#xA; &#xA; &#xA; &#xA; &#xA;