More from Liz Denys
While on a short road trip and then recovering from surgery, I hand quilted and hand embroidered a linen lilypad quilt. And yes, I did make this little quilt for my Frinos plush from Hades II to have a nice place to rest.
Like so many other hat knitters, I've knitted the classic WWII watch cap, which is also known as Beanie no. 212, more than a handful of times. (You can find it on Ravelry here and here, respectively.) It's a charming, quick knit that's easy to resize, but I've never really liked the crown shaping on the original. I've knit a lot of these hats, and only one's had the original crown shaping for the decreases. I'm sharing two crown shaping variations I keep going back to below. I always knit this hat in the round, and my crown shaping patterns assume you will be knitting in the round, too. Alternate crown shaping 1 This alternate crown shaping follows the 6x2 ribbing of the previous section for the bulk of each round so that the ribbing continues throughout the entire hat. Written out: Divide stitches on 3 double pointed needles with stitches evenly divided among the three needles or mark out even sections with stitch markers if decreasing across 2 circular needles or with magic loop. (k1, ssk or skp, k if previous row was knit or p if previous row was purl until 3 stitches are left on the needle/before the next marker, k2tog, k) x3. Repeat step 1 until 4 stitches remain on each needle/in each marked section. Cut and draw yarn through the remaining 12 stitches 2-3 times. Tie off and weave in the ends. Alternate crown shaping 2 This alternate shaping both maintains the ribbing throughout the crown shaping and accentuates it by creating a sort of three-pointed star with 3 of the 2-stitch-wide purl parts from the previous 6x2 ribbed section. This shaping really only makes sense when making a size hat where the number of stitches is evenly divisible by 24, so I typically only do it on size "small" hats (cast on 96 stitches). You could adjust the needle size and gauge for a yarn that works well at that gauge to make this work for different sizes. Written out: Stop the last 6x2 ribbed row 1 stitch early and divide stitches on 3 double pointed needles with stitches evenly divided among the three needles or mark out even sections with stitch markers if decreasing across 2 circular needles or with magic loop. Ensure that each needle transition or marker has a single purl stitch on each side. (p1, ssk or skp, k if previous row was knit or p if previous row was purl until 3 stitches are left on the needle/before the next marker, k2tog, p) x3. Repeat step 1 until 4 stitches remain on each needle/in each marked section. Cut and draw yarn through the remaining 12 stitches 2-3 times. Tie off and weave in the ends. Additional project notes Needle: US 7 - 4.5 mm Gauge: 19 stitches and 24 rows = 4 inches in stockinette Hats made for me should generally be a small (cast on 96 stitches), and hats made for my partner Matt should generally be a medium (cast on 104 stitches). Footnotes Either of these will create a left-leaning decrease, use whichever one you prefer.↩ Ibid.↩
After five different drivers, including a school bus driver, aggressively close-passed me in Midwood last night and two of them threatened me just for being on the street, I realized there's a huge gap in educational outreach about bike rules in NYC: drivers. I decided to make a mini-zine that demystifies the behavior of law-abiding bicyclists like myself and helps drivers better understand what to expect when sharing the road: All text and illustrations in the mini-zine are my own. Many thanks to Matt Denys for help proofreading! This zine is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, so you can copy and distribute this zine for noncommercial purposes in unadapted form as long as you give credit to me. Gas stations, car dealerships, auto repair shops, rental car offices, parking lots, book shops, restaurants, coffee shops, and other commercial establishments are welcome to give out these zines, too - as long as the zine itself is free! Check out the NYC Bike Rules for Drivers mini-zine on the web or download the pdf to print here!
Here's how to fold a mini-zine, featuring my mini-zine So you want to make a public comment! Fold the printed mini-zine page in half, then half in again, and then in half again as shown. When you open the piece of paper, each of the pages should fit fully within a set of folds. With the mini-zine page completely open, fold it in half with short ends touching ("hamburger style") so the text is on the outside. Using scissors, cut a across the dotted line. When you reopen your paper, there will be a slit in the middle of the sheet. Fold the paper in half lengthwise with long ends touching ("hotdog style"), hold the paper at either end, and fold the sheet into itself to form an 8-page booklet. Make sure the cover is on the front!
More in programming
I listen to a lot of podcasts, and I like how they fit around other tasks. I press play, lock my phone, and put it down. I’m free to wash the dishes, fold the laundry, or shop for groceries. Unfortunately, more and more information is only published as a video. Technical talks, conference sessions, video essays – they don’t work in an audio-only podcast app. I could convert these videos to MP3 files, but that breaks down the moment a video isn’t pure spoken word. If a speaker says, “Look at this slide” or holds up a diagram, an audio-only file leaves me stranded. I don’t want to give up the podcast player I like, nor stare at a screen for an hour – but I do want the information in these videos. To solve this, I’m abusing my podcast player’s chapter support. This gives me the best of both worlds: I can listen to a video as audio-first, and glance at my lock screen if I need a moment of visual context. The idea: Chapters every few seconds MP3 files can have ID3 metadata, and ID3 metadata can include chapters. A chapter covers a particular time range, and it can have an associated title, description, and cover art. My podcast app of choice is Overcast, which can’t play videos, but it does have robust chapter support. I can jump between chapters, navigate a table of contents, and see per-chapter cover art. To get videos into Overcast, I’m creating MP3 files with a new chapter every few seconds, and the per-chapter cover art is a corresponding frame from the video. As I play the file, I get a slow, stop-motion-like rendition of the original video. If my phone is locked, I can glance at my lock screen and see the current frame in the Now Playing screen. Overcast is developed by Marco Arment, and I got this idea from Forecast, his app for adding chapters to podcasts. In particular, I was struck by its ability to create chapters that don’t display in the chapter list – ideal if I don’t want a table of contents with hundreds of entries. As I was developing my script, I compared my output to the output from Forecast to ensure I was creating the chapters correctly. The code: FFmpeg and Mutagen There are three steps in this process: Convert a video file to an MP3 Extract images from the video at a fixed interval Insert the images as hidden chapters in the MP3 file Let’s go through each in turn. 1. Convert a video file to an MP3 Converting a video file to an MP3 is a single FFmpeg command: ffmpeg -i video.mp4 audio.mp3 This is consistently the slowest step of the process, and I do wonder if I could use different settings or an alternative encoder to make it go faster – but it’s not slow enough to be worth further investigation. 2. Extract images from the video at a fixed interval Extracting images from a video needs a more complicated FFmpeg command: ffmpeg -i video.mp4 \ -vf 'fps=1/5,scale=iw*sar:ih,scale=min(iw\,945):min(ih\,945):force_original_aspect_ratio=decrease' \ thumbnail_%04d.jpg This extracts an image every 5 seconds, downscales any image larger than 945 pixels square (while preserving the original aspect ratio), and saves the results as sequentially numbered JPEG images (thumbnail_0001.png, thumbnail_0002.png, and so on). The key is the -vf flag, which defines two FFmpeg filters: The fps filter selects one frame every 5 seconds (fps=1/5). The first scale filter scales the width based on the sample aspect ratio (scale=iw*sar:ih). Without this filter, frames can be stretched and distorted. The second scale filter scales the input video, preserving the original aspect ratio (force_original_aspect_ratio=decrease), and ensuring the output images fit within 945×945px or the size of the input video, whichever is smaller. My limit is 945 pixels because that’s the largest size that cover art is shown on my iPhone. This filter still isn’t completely correct – it sometimes creates images from portrait videos that are smaller than I’m expecting – but it’s good enough. These are only thumbnails for glancing at, and if I want to change it later, I can always do the image resizing outside FFmpeg. 3. Insert the images as hidden chapters in the MP3 file Inserting the chapters into the MP3 file is more complicated. Although FFmpeg has basic support for ID3 metadata, as far as I know, it can’t insert chapters with per-chapter artwork. Instead, I’m going to reach for Python and the Mutagen library. Here’s the code to add a chapter to an MP3 file: from mutagen.id3 import APIC, CHAP, ID3, PictureType audio = ID3("audio.mp3") with open("thumbnail_0001.jpg", "rb") as f: img_data = f.read() image_frame = APIC(mime="image/jpeg", type=PictureType.OTHER, data=img_data) chapter_frame = CHAP( element_id="chp1", start_time=0, end_time=5 * 1000, sub_frames=[image_frame] ) audio.add(chapter_frame) audio.save() This creates a single chapter that lasts the first 5 seconds (0 to 5000 milliseconds), and the per-chapter cover art is thumbnail_0001.jpg. If we ran this in a loop, we could add images for every 5 second slice of the original video. This code is inserting two frames into the ID3 metadata: The CHAP (chapter) frame contains the timing information, and it can have subframes for metadata like title, chapter art, or associated URL. The APIC (attached picture) subframe contains information about a picture, which can either be a blob of image data or a URL to an image on the web. Normally, you’d also insert a CTOC frame which defines a table of contents, but I don’t want a TOC with hundreds of 5-second chapters, so I’m deliberately not doing this here. This is allowed by the ID3 spec – you’re not required to insert a CTOC frame if you’re using chapters, and you can have chapters that aren’t listed in your table of contents. To work out which frames I needed, I used Forecast to create some chapters by hand, and I inspected their frames. In particular, loading an MP3 and calling Mutagen’s pprint() method shows a human-readable list of frames, and then I could drill into the individual fields: from mutagen.id3 import ID3 audio = ID3("audio.mp3") print(audio.pprint()) I wrapped all this code in a project called glancecast, which allows you to convert a video file with a single command, with optional flags to set the frame length and chapter art size: $ python3 glancecast.py interesting_talk.mp4 interesting_talk.mp3 The process takes a minute or so to complete, most of which is spent transcoding the video file to MP3. The resulting MP3s are usually 40 to 50 MB in size, which is very reasonable. The outcome: How it looks in practice Here’s what one of these “glanceable” podcasts looks like in Overcast and on my lock screen: Maggie Appleton presented this talk over two years ago and it’s been on my “talks to watch” list ever since. Once I put it in Overcast? I listened to it in less than a day. It’s not a lot of extra information, but enough that I can quickly glance down and get the gist of what a speaker is saying. Both views update with a new frame every few seconds, or I can put my phone in my pocket and ignore the screen. I’ve used this approach for half a dozen videos so far, and I’m happy with the results. I expect to keep using it, because I have a long queue of videos I’ve been meaning to watch. If you’d like to try this, check out glancecast for the full code and instructions. [If the formatting of this post looks odd in your feed reader, visit the original article]
Andrew Baker, the current Group CIO at Capitec Bank wrote an interesting piece on AI and open source, and how these tools that generate code according to one’s specification may replace the general reliance on open source implementations done by contributors around the world. I’d really recommend reading it. I have great admiration and respectContinue reading "AI Isn’t Replacing Open Source"
A framework for thinking about when AI involvement is additive or a violation
Why we need richer, thicker interfaces and better boundary objects for collaborative planning with agents
A look at 10 foundational pillars that enable agents to operate more competently and more efficiently in any codebase.