About Projects Blog Recipes Email GitHub Twitter Press Feed

29 Jun 2016
Sketches from Singapore

I went traveling alone last December, spending about a week in Singapore followed by three weeks in Chiang Mai, Thailand. (And then Dave met up with me for a week and a half in Taiwan at the end, but I didn't do much sketching there since I was with him.)

I tweeted my sketches as I went, but since it was such a fantastic trip I really wanted to gather my favorites together in one place here as well. (I'll post my Thailand sketches separately, soon!)

An ink and watercolor sketch of Abdul Gafoor Mosque in Singapore
Abdul Gafoor Mosque was just a few blocks away from my hotel!
An ink and watercolor sketch of a walking path I stumbled across in Singapore
Just a charming walking path I stumbled across.
An ink and watercolor sketch of a very nice stranger's motorcycle in Singapore
A very nice strangers stood quietly watching me sketch this motorcycle for a long while, then apologetically interrupted me and told me that he had to leave. I was super confused at first - I hadn't realized it was his bike I'd been sketching the whole time!
An ink and watercolor sketch of clothing hanging by HDB (public housing) in Everton Park, Singapore
A friend of mine insisted that I had to visit HDB (public housing) while I was there, so I got to sketch laundry drying in Everton Park.
An ink and watercolor sketch of a small red shrine in Maxwell Food Centre in Singapore
These small shrines were ~everywhere.
An ink and watercolor sketch of some pao (steamed buns) I ate in Singapore
I was obsessed with the coffee lotus buns at this one place over by Cassia Crescent.
Another ink and watercolor sketch of some more pao (steamed buns) I ate in Singapore
So obsessed. I should make bao more often now that I'm home!
An ink and watercolor sketch of dirty dishes
Since my Singapore trip was so food-focused, I feel I ought to end with these dirty dishes and birds that kept trying to eat them clean!

20 Jan 2016
The best books I read in 2015


Fiction I loved reading in 2015 that related to gender, race, and class

  • This Burns My Heart by Samuel Park - Heartbreaking, amazing, gorgeous. A woman in South Korea who marries wrong and what that means for her freedom and her life.
  • The Crimson Petal and the White by Michael Faber - A prostitute who tries to get out by becoming the live-in mistress and nanny for a rich guy. Class issues, where book smarts are not enough.
  • The Beacon at Alexandria by Gillian Bradshaw - Roman girl wants to be a doctor, so she disguises herself as a boy and apprentices herself to a Jew. Such Alanna wow &c!
  • Sisters of the Revolution: A Feminist Speculative Fiction Anthology edited by Ann and Jeff Vandermeer - Packed full of spectacular stories!
  • A Door Into Ocean by Joan Slonczewski - A planet of women near a co-ed planet. Politics, gender, nifty scifi.
  • Carnival by Elizabeth Bear - A matriarchal world where “stud” males (as opposed to gay “gentle” males) have very few rights, a gay male couple as ambassadors from a world more like ours but with many issues of its own, and of course alien life forms. I swear this is not porn. Honest to gosh. The thing I really loved about this one was that there were complicated ethical issues with all represented worlds.


Non-fiction I loved reading in 2015 that related to gender, race, and class

  • The New Jim Crow: Mass Incarceration in the Age of Colorblindness by Michelle Alexander - You basically have to read this to understand our criminal justice system. It’s fucked up and horrible and real. A perfect companion piece to Torture & Democracy, which you should also read.
  • Picking Cotton: Our Memoir of Injustice and Redemption by Jennifer Thompson-Cannino and Ronald Cotton with (ghostwriter) Erin Torneo - A white woman and the black man she (unintentionally) falsely accused of rape, their separate stories, and the way they met and became friends when they finally did the fucking DNA testing and got him out of prison many years later.
  • Wifework: What Marriage Really Means for Women by Susan Maushart - Really fascinating and disturbing. Some of it feels like obvious bullshit. Some of it cuts to the quick.


Other fiction I loved reading in 2015

  • The Expanse Book 2: Caliban’s War by James S.A. Corey - Fantastic! So much better than the first one and all subsequent ones! All about the risks and dangers of communicating and acting with imperfect knowledge.
  • The Fate of Mice by Susan Palwick - Short stories, pretty great.
  • All She Was Worth by Miyuki Miyabe, translated by Alfred Birnbaum - Detective story, in Japan, largely discussing consumer debt.
  • The Siren by Tiffany Reisz - “Erotic romance”. No, but this was great! It really spoke to the tension between who you love and what you need, when they don’t coincide.
  • Aunty Lee’s Delights: A Singaporean Mystery and Aunty Lee’s Deadly Specials: A Singaporean Mystery by Ovidia Yu - I had to read these on my way to Singapore, of course. Fun fluff!
  • The Three-Body Problem by Cixin Liu - I mostly enjoyed this one because I kept thinking it was about different concepts during various phases along the way reading through it. (Like, for a while there I was convinced it was about the color grue.)


Books I loved reading in 2015 that related to art

  • The Natural Way to Draw by Nicolaides - Particularly great for the stage I was at earlier in the year, I think. Lots of good exercises, and more philosophical. For instance, a big takeaway for me is that when doing gesture drawings you want to feel tension in your body echoing the pose.
  • Watercolor for the Fun of it: getting started by John Lovett - Really helpful exercises and tips, especially re playing with texture.
  • Tate Watercolour Manual: Lessons from the Great Masters by Tony Smibert - Big lessons: different kinds of brushstrokes, and I really should play with tonal value more.
  • The Urban Sketcher: Techniques for Seeing and Drawing on Location by Marc Taro Holmes - I love this author and I love his art and I kinda want to be him when I grow up and this was the best!
  • Local Color: Seeing Place Through Watercolor by Mimi Robinson - Advice on mixing color in various ways, and now I totally want to build my own color palettes for various seasons and walks &c!
  • Urban Watercolor Sketching: A Guide to Drawing, Painting, and Storytelling in Color by Felix Scheinberger - Some good stuff about luminosity, being sparing with color, drawing attention to the important bits, and storytelling in here. Also I love the sketches throughout the book.
  • Experimental Drawing by Robert Kaupelis - I got lots of great ideas for drawing exercises from this.
  • Creative Sketching Workshop: Inspiration, Tips and Exercises for Sketching on the Move edited by Pete Scully
  • Urban Sketching: the complete guide to techniques by Thomas Thorspecken


Books I loved reading in 2015 that related to programming and tech

  • Storm Applied: Strategies for real-time event processing by Sean T. Allen, Matthew Jankowski and Peter Pathirana - So useful! (Storm is a tool I work with and reading this made my job easier, so that was nice.)
  • Seven Concurrency Models in Seven Weeks: When Threads Unravel by Paul Butcher - I was pleasantly surprised by how many of these I was already familiar with, but overall it was a good overview with suggestions for interesting follow-up reading at the end of each section.
  • Functional Programming in Scala by Paul Chiusano and Runar Bjarnason - Lots of stuff I already knew, but pretty clear explanations of some FP concepts, and I like finding good articulations of familiar concepts to help with sharing them.
  • Being Geek: The Software Developer’s Career Handbook by Michael Lopp - My big takeaway here was learning about trickle lists, which turn out to be a pretty useful tool.
  • Beautiful Code: Leading Programmers Explain How They Think edited by Andy Oram & Greg Wilson


Other non-fiction I loved reading in 2015

  • House Rules by Rachel Sontag - A memoir about a fucked up family. Very hard and compelling to read. I felt nauseous through most of it, and yet keep recommending it to people. There’s something particularly intense about reading about families which are obviously horrible but don’t involve any physical abuse.
  • It’s complicated: the social lives of networked teens by Danah Boyd - Actually really interesting discussions of privacy as a social norm rather than technological mandate.
  • The Lone Samurai: The Life of Miyamoto Musashi by William Scott Wilson - Christ, what an asshole. And yet in some ways I want to be him when I grow up.
  • Social Engineering: The Art of Human Hacking by Christopher Hadnagy - Hilariously reminiscent of the time a hypnotist watched me try to bully my boyfriend into reminding me to create a tea blend I wanted to try a week later and then told me that I’m very good at neuro-linguistic programming.


Books I loved re-reading in 2015

  • The Last Samurai by Helen DeWitt - This remains one of my favorite books of all time.
  • Unwind by Neal Shusterman - A world in which abortion is illegal but parents can legally have their children unwound between the ages of 13 and 18.
  • Deathless by Catherynna M. Valente - Still gives me a lot of very complicated feels.
  • Narbonic: The Perfect Collection Books One and Two by Shaenon K. Garrity - Look, it’s about a cute evil mad scientist and her adorable henchman named Dave. Of course I love it! This is basically the story of my marriage!


Total number of censored favorites not appearing in this post: 10
Total number of books read in 2015: 160

02 Jan 2015
The best books I read in 2014

This was a rough year for me and books - I had a lot of family deaths and a very short commute and started an awesome new job, all of which got in the way, as you might imagine. I only ended up reading 79 books total, which a barely over half my usual count for a year :shamefaced:. Luckily, I came across a few gems to share with you!


Fiction I loved reading in 2014

  • Spirits Abroad by Zen Cho - Absolutely spectacular Malaysian fantasy short stories. This is the big must read of the year, people. Get to it.
  • Ancillary Justice by Ann Leckie - Written from the POV of a starship’s AI in a human body from a culture with no concept of gender. Really fantastic and original scifi. Read while drinking amazing tea. (Ancillary Sword, its sequel, was fun but not really as great as its predecessor.)
  • A Guide for the Perplexed by Dara Horn - Memory and family and complicated stories and choosing stories and survival and acceptance and hope and redemption and pain passed down through generations. My entire family needs to read this one.
  • Fledgling by Octavia Butler - Vampires done with issues of race and gender in society.
  • The Pattern Scars by Caitlin Sweet - Tremendously twisted fantasy novel - seers, magic, mind control, trigger warning for sexual abuse, lots of horrors and betrayals. No heroes.
  • The Witch in the Almond Tree by C.S.E. Cooney - Gotta admit, she writes great sexy witch stories. Though this short story of hers was somehow even hotter (deeply NSFW, though).
  • The Steel Remains by Richard K. Morgan - Fantasy novel, queer characters, discrimination, brutality.
  • Mission Child by Maureen F. McHugh - Cultural and gender identity, another book with themes of getting lost and isolated from one’s culture and becoming someone else, or maybe not.
  • The Lies of Locke Lamora, Red Seas Under Red Skies, and The Republic of Thieves by Scott Lynch - Really fun fantasy novel trilogy!
  • Graceling by Kristin Cashore - A light fantasy novel, where some people have graces (superpowers, basically). Our protagonist is a teenage girl with a superpower that makes her great at killing, which of course means she unwillingly IS the brute squad for her uncle, the king. But then the story really gets started.
  • The Ghost Bride by Yangsze Choo - Great little novel about marriage prospects and Malay Chinese afterlife beliefs.
  • Last Days by Joyce Carol Oates - Great short stories. “If I had it in me to love anyone I would love you… but you know the Holy Ghost saw fit to depart from me leaving just this husk and whited sepulchre, and I can’t lift a finger in rebellion. ‘The Spirit bloweth where it will.’ Do you know what that means? That means everything.
  • The Birthday of the World and other stories by Ursula K. Le Guin - Lots and lots on gender and interesting weird relationship structures.


Non-fiction I loved reading in 2014

  • How Doctors Think by Jerome Groopman, M.D. - Mentions a doctor who kept a log of all mistakes he made. Ever since reading this, I kinda want to keep a journal of all bugs I fix/encounter. My main take-aways: Always generate a short list of alternatives, even when you think you know the answer. When talking to doctors: Ask what body parts are near where you’re having your symptoms; what body part might be causing the symptom? What else could it be? What’s the worst thing it could be? Is there anything that doesn’t fit? Is it possible I have more than one problem? (list on p263)
  • Key Concepts in Life and Death: Inside Moves and Under the Stones Techniques by Richard Hunter - Really great Go book!
  • The Unix Programming Environment by Brian W. Kernighan and Rob Pike - I went through this one slowly, with lots of interruptions, over the course of about a year - I actually counted it for last year’s best-of list because I started it in 2013, but I’m counting it again because I finished it in 2014 and it’s still spectacular. I can absolutely see it as a book I can go back and reread and expect to get more out of each time.
  • The Writing Life by Annie Dillard - I read this book because these quotes from it spoke deeply to me, and it lived up to them completely.
  • A Field Guide to Getting Lost by Rebecca Solnit - Beautiful, resonant, a perfect read while traveling through Mexico with my friend Bonnie this past spring.
  • And the Band Played On: Politics, People and the AIDS Epidemic by Randy Shilts - I kept having to close this book to remember how to breathe and stop crying. Intense and amazing and heartbreaking and probably not what I should’ve been reading in this year full of deaths, but so worth it.
  • Something Like an Autobiography by Akira Kurosawa - Yes! He has an exuberant, fascinating view on life.
  • The Fire Next Time by James Baldwin - Race in America. Painful, important.
  • Nothing to Envy: Ordinary Lives in North Korea by Barbara Demick - I had absolutely no sense of what life is like there before reading a few glimpses this year, and this was the most riveting of them all.
  • The Good Women of China by Xinran - Xinran is basically the Studs Terkel of China.
  • Factory Girls by Leslie T. Chang - Migrant young women from rural China working in factories. Particularly striking to read from my current context of the tech industry here.


Books I loved re-reading in 2014

  • for colored girls who have considered suicide / when the rainbow is enuf by Ntozake Shange - One of my favorite books of poetry of all time. Still makes me cry.
  • Earth by David Brin - I still love this novel as much as I did when I first read it probably 15ish years ago - if anything, it’s only become more strikingly relevant.
  • Alien Sex edited by Ellen Datlow - Short stories about the obvious. Not erotica, honest - it’s just a bunch of really good, weird scifi.
  • Vox by Nicholson Baker - This one really is hot, though. It’s sort of a novel about a single phone sex conversation, except it’s also thoughtful and neurotic and nerdy and brilliant and bizarre.
  • Under the Skin by Michel Faber - Had to reread because apparently there’s now a movie? This book has itched at the back of my head for years and years. If you aren’t familiar with the plot, I strongly suggest reading it without reading any reviews of spoilers first. It’s extremely disturbing and told perfectly.
  • Blindsight by Peter Watts - Way, way better than its recently released sequel. Vampires without being boring. Cognitive science and how our brains work. Breathtakingly good, really.

08 May 2014
git SHAmend! a quick way to amend changes into an older commit

When I work on projects with slow test suites, my workflow often ends up looking sort of like this: I make some changes on a branch, run the tests that seem likely to be relevant locally, and then push the branch off to tddium (or whatever) to see if any of the other tests fail unexpectedly.

I like each of my commits to be clean and green in isolation, to make digging through project history easier in the future. To that end, when I make a bunch of commits before running all my tests, I often end up fixing bugs and using interactive rebase to merge the fixes into earlier commits before merging my branch in. (So long as I’m the only person working on that branch, at least!)

It’s a reasonable enough process - stage my changes for the fix, commit them as a WIP, then open up interactive rebase to amend them as a fixup to the right commit from earlier. That’s so many steps, though! And I’m so lazy! I really just want to be able to run something like git shamend SHA_FOR_EARLIER_COMMIT instead. (Or better yet, git-smend or git-sm for short!)

So, I wrote git-shamend to solve this problem for me. The full script is available here - just copy it to /usr/local/bin (or wherever you prefer to keep such things) and you’ll be able to use it with git shamend SHA_TO_AMEND.

I initially planned on writing SHAmend! using git’s low-level (“plumbing”) commands, but all my twitter buddies told me I shouldn’t feel guilty about building on top of porcelain (git’s high-level commands) instead if I wanted to.

The meat of how it works is like this:

First, we get the SHA for the reference you pass in. This avoids problems that could come up if you pass in something like HEAD^, whose meaning changes whenever you add a new commit (as we do later on).

  SHA_TO_AMEND=$(git rev-parse "$@")

If the reference you pass in is a commit that’s in your current branch…

  if git merge-base --is-ancestor $SHA_TO_AMEND HEAD

…then git-shamend commits your staged changes, marked as a fixup (which is an amendment that retains the original commit message) to that earlier commit…

  git commit --fixup $SHA_TO_AMEND

…and if you have any remaining unstaged changes…

  git diff-index --quiet HEAD
  NOTHING_TO_STASH=$?

…stashes them so they don’t interfere with the upcoming rebase…

  git stash

…and runs an interactive rebase automatically to get that fixup amended properly to the earlier commit you specified.

  GIT_EDITOR=true git rebase -i --autosquash "$SHA_TO_AMEND^"

Wait, it runs an interactive rebase automatically? That sounds kinda weird. It’s interactive, but it’s not!

Git uses the environment variable $GIT_EDITOR to figure out which editor open up to allow you to move commits around when running an interactive rebase. Setting that to “true” here causes git to use true as your editor for this command, where true is just a tiny unix program that does nothing except exit with a successful exit code.

So from git’s perspective, it runs an interactive rebase and opens up an editor for you to move around commits, which ‘you’ close successfully. Great, that’s all git-rebase needs from, er, ‘you’ - assuming there are no conflicts, it can handle the rest on its own!

This works because the -\-autosquash flag tells git-rebase to put fixup commits in the right place for you before opening up the editor, so there’s really nothing you need to do to get things sorted out right.

From your perspective, git just kinda does its thing without bothering you. Gotta love that.

But what if something does go wrong? If the rebase exits unsuccessfully (that is, with a non-zero exit code)…

  if [ $? -ne 0 ]

…then git-shamend aborts the rebase and resets that fixup commit it created earlier, to clean up after itself. (And echos a warning, natch. All that stuff is in the actual git-shamend script.)

  git rebase --abort
  git reset --soft HEAD^

And at the very end, if you did have any unstaged changes that were stashed earlier…

  if [ $NOTHING_TO_STASH -ne 0 ]

…they’re popped from the stash, to make return your working directory to its pre-SHAmend!ing state.

  git stash pop

Now I can smend smend smend as much as I want, way more efficiently!

02 May 2014
Finding words that sound alike but are spelled wildly differently

I’ve been working on search stuff lately, and we needed some wordlists to help test search results that match only because they sound similar to the query, and not because they’re spelled similarly.

Turns out we couldn’t find a pre-existing wordlist of homophones (words that sound the same but are spelled differently) that are dramatically different in spelling. And our QA team especially wanted some examples of people’s names that meet those criteria.

So, sure, I figured that’d be fun and quick to throw together for them!

It’s a lot like finding anagrams - the basic structure was a dict (a hash map, for the non-Python folks reading this) keyed by the phonetic encoding of each word. Each key pointed to a nested dict, which included an array of words which phonetically matched the key and a bool indicating whether it fit my criteria or not. In the end, all matching words were spit into stdout as a list of comma-separated homophones.

I determined whether words were spelled differently enough by checking whether a small enough percentage of their trigrams were the same. (I also had a minumum length set, so I’d be sure to have enough trigrams per word to be worth checking for match percentage.

(It was kinda neat to find something that felt more like an interview puzzle than anything else, but was actually useful for my day job. Oh hey, look, those skills are occasionally actually useful! Now you don’t have to feel weird about all the time you spent learning how to solve these sorts of puzzles!)

Sweet and simple and fun! Here’s my script and a few of the wordlists I created with it, since I figure other people may also find this sort of thing useful when testing search implementations. (FYI, if you’re using something other than a metaphone/doublemetaphone soundalike algorithm and trigrams for misspellings, you may want to make some adjustments.)