Worked like a charm! Worked like a charm!

Posted by jstrecker on 2019.10.04 @ 22:03

Filed under:

Recently a friend and fellow programmer asked me how I learn a new language or platform. I answered that I do it with specific task in mind. Basically, I bumble along googling every little step until I complete my task. But I forgot to tell her about the pitfall of this method… [more...]

Making a mach server

Posted by cwright on 2019.08.17 @ 14:23

Filed under:

(This is a sort of simplified retelling of http://fdiv.net/2011/01/14/machportt-inter-process-communication with some added lore. You should probably start there.)

Much of the magic behind macOS and iOS (and all the derived xOSs - watch, appleTV, the stripped down versions in cables and touch bars and wherever else these things invariably end up) is performed with the assistance of other processes (including the kernel). Communicating between them is accomplished by various ways, but for macOS, the underlying mechanism is a client/server IPC mechanism powered by Mach, and the underlying currency is the mach port (mach_port_t). [more...]

Mirror, Mirror, or, Don't fly off the Handle

Posted by cwright on 2019.08.13 @ 10:12

Filed under:

During my time at Apple, I dealt with a lot of rather low-level systems treachery. It’s poorly documented, even internally, and asking for help has roughly even odds on getting a passive aggressive non-answer.

The cool trick for today is creating a “memory object.” A memory object is one or more physical pages that are wrapped in a mach port. With this, you can pass the port to another process, who can map the pages, creating shared memory. Or you can map the pages again in your own address space, to create a mirror, or with different permissions so you can expose read-only pages at an interface boundary while still having the pages be writable at a different address. [more...]

Debugging childbed fever Debugging childbed fever

Posted by jstrecker on 2019.01.13 @ 12:15

Filed under:

Vienna in the 1840s was a scary time and place to give birth. From 1840 to 1846, 7% of women who gave birth at the Vienna General Hospital died of a postpartum infection called childbed fever. One doctor at the hospital, Ignaz Semmelweis, made it his mission to stop the disease. His work saved hundreds of lives, contributed to the development of medical hygiene — and can teach us a few things about debugging. [more...]

Some thoughts on gender and science/technology magazines Some thoughts on gender and science/technology magazines

Posted by jstrecker on 2018.11.04 @ 21:46

Filed under:

One day in 2010, I flipped through the latest issue of National Geographic and counted how many women and how many men were mentioned by name. It was actually an article about women in a particular country that sparked my curiosity. The unusually many women in that article (it turned out to be 8 women and 4 men) stood out in contrast with the rest of the magazine. The other feature articles (none of which were purportedly about men) mentioned in total 54 men and 12 women. [more...]

“The never-ending notary nuisance,” or, “infinite loop at Infinite Loop” “The never-ending notary nuisance,” or, “infinite loop at Infinite Loop”

Posted by smokris on 2018.10.24 @ 21:11

Filed under:

A couple weeks ago, Apple posted a note that says:

In an upcoming release of macOS, Gatekeeper will require Developer ID–signed software to be notarized by Apple.

Being a developer of Developer ID-signed (i.e., non-App-Store) software, I set out to vault Apple’s latest hurdle.

Xcode includes a command-line utility called altool that manages the notarization process. That seems appropriate since my app isn’t built using Xcode’s build system. [more...]

Tweaking Synology’s DNS Server For Great Justice

Posted by cwright on 2016.06.23 @ 23:05

Filed under:

Years ago I purchased a Synology NAS (a DS1812+, if you must know). I also purchased some hard drives for it, and a 2GB stick of RAM (bringing its total up to 3GB). Under the hood it’s a dual-core Cedarview Atom x86 CPU, and it runs a Linux distro wherein the owner of the device also has root access (i.e., you own what you own, like in the good old days). It’s also got dual GB NICs, some USB ports, etc.

In addition to storing substantial slabs of data, you can install services on these devices, so in effect they’re more like mini servers than the NAS name might imply. It’s busybox-based though, so a lot of the normal Linux commands act weird or don’t have useful aliases (more, not less, only a subset of vi commands work, etc).

One of the services I opted to install was a DNS server, in the hopes that it would allow me to move some per-machine hosts file management stuff to it, and that our previously-rootless devices (read: iPads, iPhones, etc) would also be able to finally take advantage of a local caching name server with internal friendly names for devices that don’t participate in Bonjour. [more...]

4 images from the Allied Media Conference 2016 4 images from the Allied Media Conference 2016

Posted by jstrecker on 2016.06.22 @ 12:16

Filed under:

If you were to metaphorically represent media depictions of Detroit as photos of individual people, most would be either a mugshot of a scowling black man (the personification of crime lurking among abandoned buildings) or a photo looking down on big sad brown eyes like one of those “save the children” ads (the personification of neediness and white man’s burden).

The Allied Media Conference, held in Detroit for more than half of its 18 years, generates a powerful counter-narrative and counter-imagery about Detroit. The AMC is very much by and about Detroit (about a third of its participants are from Detroit). It’s also a place for wider communities of people of color, queer and trans, disabled, low-income, and other identities and issues, to come together and organize around common principles. [more...]

Emulating "defer" in C, with Clang or GCC+Blocks Emulating "defer" in C, with Clang or GCC+Blocks

Posted by smokris on 2015.10.08 @ 23:24

Filed under:

In the Go language (and now Apple’s Swift), there’s a new control-flow mechanism: defer.

When you tag a function call with the defer keyword, its execution is deferred until the end of the current scope. This makes it easy to construct an ad-hoc use of the RAII pattern — handy for placing resource initialization and finalization next to each other, to make it less likely that you’ll forget to finalize a resource.

I was curious whether it was possible to do something similar in C. It turns out it’s pretty straightforward. [more...]

Project Ruori encounters electro-music, a suit of armor, and a fallout shelter Project Ruori encounters electro-music, a suit of armor, and a fallout shelter

Posted by jstrecker on 2015.05.27 @ 22:05

Filed under:

Project Ruori, a pseudorandomly generated collective of humans and machines, sent several delegates to this year’s Asheville electro-music festival. We came prepared with knowledge gained from last year, for example: if it smokes, unplug it. The human delegates — Steve Mokris, Melissa Egan, and Jaymie Strecker — now present their report of this year’s proceedings. [more...]

mythical