Posted 2007-05-22, updated 2021-07-01.
These are some emacs keybindings (and other functions) that I once found useful. I’ve mostly used Sublime Text for the last few years, however.
C-[SPC]
: set mark
C-x C-x
: exchange point and mark
C-w
: kill (AKA “cut”)
M-w
: kill-ring-save (AKA “copy”)
C-y
: yank (AKA “paste”)
M-h
: Put region around current paragraph (mark-paragraph).
C-x h
: Put region around the entire buffer (mark-whole-buffer).
C-u C-[SPC]
: Move in mark ring
M-d
: Kill word
M-[DEL]
: Kill word backwards
C-M-k
: Kill the following balanced expression (kill-sexp)
C-x r r
: Save position of point in register r (point-to-register).
C-x r j r
: Jump to the position saved in register r (jump-to-register).
C-x r s r
: Copy region into register r (copy-to-register).
C-x r i r
: Insert text from register r (insert-register).
C-x r m [RET]
: Set the bookmark for the visited file, at point.
C-x r m bookmark [RET]
: Set the bookmark named bookmark at point (bookmark-set).
C-x r b bookmark [RET]
: Jump to the bookmark named bookmark (bookmark-jump).
C-x r l
: List all bookmarks (list-bookmarks).
M-x bookmark-save
: Save all the current bookmark values in the default bookmark file.
M-`
shows the menu.
M-x highlight-changes-mode
toggles showing the changes you’ve made to the file since the last save.
Posted 2007-05-22, updated 2021-07-01.
I own a Nokia 6102i phone (provided by Cingular). gnokii is a Linux program that lets me interface with the phone. Here are some recipes:
gnokii --getfilelist "A:\\predefgallery\\predeftones\\predefringtones\\*"
gnokii --putfile WiiSports.mp3 "A:\\predefgallery\\predeftones\\predefringtones\\WiiSports.mp3"
Voice mail picks up in 20 seconds, so a ring tone should be about 20 seconds long.
The easiest way to chop an MP3 in Linux is with dd; the drawback is that you need to specify length in KB, not time. To chop an MP3 to be 200 KB long, do:
dd if=Mii\ Channel.mp3 of=MiiChan2.mp3 bs=1k count=200
To make a Phonebook.ldif file from the phone (suitable for import into Thunderbird):
gnokii --getphonebook ME 1 end --ldif > Phonebook.ldif
To add the entries in Phonebook.ldif to the phone:
cat Phonebook.ldif | gnokii --writephonebook -m ME --find-free --ldif
You can specify --overwrite
instead of --find-free
if you want to overwrite all the entries, but this will lose some data (e.g. speed dial, preferred numbers).
You can get photos like this:
gnokii --getfile "A:\\predefgallery\\predefphotos\\Image000.jpg"
They are 640x480 JPG files. (You can also configure the camera so that it takes pictures at 80x96.)
You can also store files:
gnokii --putfile silly.jpg "A:\\predefgallery\\predefphotos\\silly.jpg"
These show up on the phone in My Stuff/Images
. The files don’t need to be any specific size; they are autoscaled. GIFs probably also work.
Videos live here:
gnokii --getfile "A:\\predefgallery\\predefvideos\\Video000.3gp"
VLC seems to be able to play .3gp
files, but the audio doesn’t work.
Audio recordings live here:
gnokii --getfile "A:\\predefgallery\\predefrecordings\\Audio000.amr"
Unfortunately, nothing I knew of in 2007 (when this page was first written) would play .amr
files, but these days (2021) perhaps ffmpeg input.amr output.mp3
would work. You might have to use the -ar
flag to specify the audio rate. I haven’t actually tried this though!
Posted 2007-05-22; updated 2021-07-01.
Note that these instructions are over a decade old. Some documentation may be out of date. :)
To check whether fonts are embedded, use pdffonts
, which is included with xpdf
. pdffonts
gives output that looks like this:
$ pdffonts paper.pdf name type emb sub uni object ID ------------------------------------ ------------ --- --- --- --------- FHQIOS+NimbusRomNo9L-Medi Type 1 yes yes no 6 0 NEESMN+NimbusRomNo9L-Regu Type 1 yes yes no 9 0 PJQNOS+CMSY10 Type 1 yes yes no 12 0
You want emb
to be yes
for all fonts (and possibly sub
as well; also, all fonts should be Type 1, not Type 3). By default in Ubuntu, pdflatex should embed all fonts. Just in case, you can check /etc/texmf/updmap.d/00updmap.cfg
, which should have a line like this:
pdftexDownloadBase14 true
If it’s set to false
, change it to true
, then run update-updmap
as root. Remake the PDF; if it still has non-embedded fonts, your figures are probably to blame. Check your PDF figures and make sure their fonts are embedded (using the pdffonts
command). For anything that doesn’t have embedded fonts, you can try the following magical invocation:
gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \ -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer \ -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true \ -dEmbedAllFonts=true -sOutputFile=figures/Mprime-new.pdf -f figures/Mprime.pdf
This creates a file figures/Mprime-new.pdf
that is hopefully identical to the input file figures/Mprime.pdf
, except that the fonts are embedded. Run pdffonts
on it to check.
Once all your figures are in PDF format, remake the paper again. Hopefully, all your fonts are now embedded — check again with pdffonts
.
Posted 2007-08-07.
Here’s some links about learning/mastering vim.
Posted 2019-04-01.
TLDR: read the paper and view the gallery of pretty Perl programs.
In this paper, we aim to answer a long-standing open problem in the programming languages community: is it possible to smear paint on the wall without creating valid Perl?
We answer this question in the affirmative: it is possible to smear paint on the wall without creating a valid Perl program. We employ an empirical approach, using optical character recognition (OCR) software, which finds that merely 93% of paint splatters parse as valid Perl. We analyze the properties of paint-splatter Perl programs, and present seven examples of paint splatters which are not valid Perl programs.
Accepted for publication at SIGBOVIK 2019, held April 1st 2019 in Pittsburgh. Winner of a Unwitting Participation Ribbon, “an unwelcome brand we’ve affixed to each paper determined after careful scrutiny to have included a genuine artifact, thereby furthering the admirable causes of open science and fruitful procrastination.”
Read it on Google Docs or download a PDF. Or grab the entire SIGBOVIK 2019 proceedings; I’m on page 174.
Here’s all the paint splatters on a single page, along with the valid Perl source code corresponding to each. “Not valid” is written in red for those images which did not parse as valid Perl programs. If different OCR settings recognized multiple valid Perl programs, I chose the one that seemed the most “interesting”, according to my own aesthetic sense.
Here’s a tarball of 100 paint-splatter images that were used as the main dataset for this paper.
(source code not available yet because i am bad at GitHub)
There are a few paint splatter Perl programs that I didn’t recognize as “interesting” until after the SIGBOVIK submission deadline. For example, this splatter is recognized by OCR as the string lerzfijglpFiji-j
, which evaluates to the number 0
in Perl:
The image below is recognized as the string -*?
, which also evaluates to the number 0
in Perl:
Another surprising program is shown below; OCR recognizes this image as the string ;i;c;;#\\?z{;?;;fn':.;
, which evaluates to the string c
in Perl:
Finally, this image is recognized as the string ;E,'__'
, which evaluates to the string E__
in Perl:
Posted 2019-04-03.
It’s been nearly two months since my last day at Google, so I guess I should finally make use of this newsletter :)
I wrote a paper which was published on April 1st as part of SIGBOVIK 2019: “93% of Paint Splatters are Valid Perl Programs”. In this paper, I answer a long-standing open problem in the programming languages community: is it possible to smear paint on the wall without creating valid Perl?
(Long-standing since February 13, 2019, when a Twitter conversation between Adrienne Porter Felt & Jake Archibald posed the question.)
To answer this question, I downloaded 100 images of paint splatters from Pinterest, ran the open-source Tesseract OCR engine to turn each into a text string, and then sent that text to the Perl interpreter to see whether that text successfully parsed as Perl. It turns out that 93 of the 100 paint splatters do parse as valid Perl, but since 7% do not, I conclude that it is possible to smear paint on a wall without creating valid Perl.
You might suspect there is some chicanery going on with this result. You’d be correct, but… honestly there’s not that much chicanery going on. You’ll have to read the paper for details… and for my attempts at academic humor. :)
There’s also some supporting material on this website, including a gallery of all 100 images and their associated valid Perl code. Here’s a screenshot of some of them. (Did you know that the string lerzfijglpFiji-j
evaluates to the number 0
in Perl?)
As it turns out, the publication date of my paper was exactly 10-years-minus-a-day since my Ph.D. thesis defense. I’d planned on travelling back to Carnegie Mellon to give this talk live at SIGBOVIK 2019, but unfortunately came down with a nasty cold-and-cough so I had to cancel my trip. :( Perhaps I can give a belated talk at next year’s conference.
For more light-hearted and vaguely CS-shaped research papers, check out the rest of the SIGBOVIK 2019 proceedings. I particularly enjoyed “Elo World, a framework for benchmarking weak chess engines” by tom7 (“The computer players include some traditional chess engines, but also many algorithms chosen for their simplicity, as well as some designed to be competitively bad”.)
Some other random things that I’ve been up to in the last month-and-a-half:
ohnosay, which is like “cowsay” but for comics in the style of webcomicname. [GitHub] This was a good excuse to get a Linux development environment set up on a persistent Google Cloud instance & to learn how to GitHub. Since then, I also realized that the World Outside Google uses Python 3, so I’ve started learning that :)
Gardening! Last August I randomly planted some peppermint in a railing container on my balcony, and it went gangbusters. This spring I’ve actually planned out a whole porch-garden (like Stardew Valley but real life). Last year’s mint has started growing again, and I’ve added spearmint and mojito mint. I’ve also got two types of peas, two mixes of salad greens, and spinach planted. Later I’ll be planting carrots, basil, and rosemary. The peas just started sprouting a couple days ago, which is exciting!
Gloomhaven! This is a cooperative legacy-style board game — a fun dungeon-crawler that doesn’t need a DM, so everyone gets to play. Our group is still only a few scenarios in, but we’re enjoying it so far. SO MANY HEX TILES. I’m also getting ready to paint our party’s miniatures, which is another (potential) new hobby of mine; more to come in a future newsletter, I suspect :)
Video games: just started Sekiro: Shadows Die Twice on PS4. Recently completed (and really enjoyed) New Super Mario Bros. U Deluxe for Nintendo Switch (though Nintendo seems to be trying to give Google a run for their money on ridiculous product names). I’ve also been playing Total War: Warhammer 2 regularly, and Splatoon 2 from time to time. I tried getting into XCOM 2 & enjoyed it, but I’m not sure I’m interested enough to finish the campaign. I keep going back to Total War when I want something in the tactical / strategy genre.
Guitar: starting to learn fingerstyle, with the goal of eventually becoming good enough to play Dream of the Shore Bordering Another World from Chrono Cross.
Computer stuff: upgraded my PC’s video card (it was many years old) and upgraded to an all-SSD setup. It turns out that 2TB SSDs aren’t that expensive any more.
Getting healthcare without an employer is a disaster — even in Massachusetts, which reportedly has one of the best systems in the US. Still working on straightening out my paperwork. Apparently they refuse to believe in my proof of health-insurance termination, even though it’s lettermarked by Google and everything.
Thanks for reading! Hopefully the next update will come sooner than 2 months and thus be a bit shorter than this one ended up being :)
~ Colin
]]>Posted 2020-02-09.
I can’t believe it’s here so quickly, but: today marks a year since my last day at Google. That seemed like a good occasion to dust off this newsletter & let you know what I’ve been up to: making a videogame!
I’m working on a stealth-based 2D platformer where you don’t have to kill anyone unless you want to. It’ll be possible to get through every level by sneaking and misdirection, but it’ll require you to be careful and tactical to do so… and of course if that doesn’t work out, you can always draw your swords and go in fighting! So far I’ve given it “Sneak” as a codename, but that’s definitely a placeholder until I can flesh out more of the world.
So far Sneak runs on PC & Xbox, but I hope to add Switch and PS4 support within the next couple months. I’m using a C# framework called MonoGame, which provides low-level graphics & audio support across all these platforms. In order to write games for Switch or PS4, you need to apply to Nintendo & Sony to get access to their platform-specific SDKs. So my first real milestone will be coming up with a compelling Game Design Doc & gameplay videos so that they can (hopefully) be convinced that I’m worth taking seriously. Wish me luck!
Sony won’t even talk to anyone unless they’re a Real Business (& Nintendo kinda wants you to be too), so as of… yesterday, I’m officially the founder of SemiColin Games LLC (and, for now at least, the only member…)
If you want to follow along, I have an extremely-placeholder website up at semicolin.games where you can sign up for Yet Another Newsletter if you like, and a Twitter account @SemiColinGames that would appreciate a follow. I’ll probably set up a devblog with an RSS feed too eventually, but that’s not quite ready yet. When it is, I’ll send a quick update here.
I only got started in December & a lot of my work so far has been on building infrastructure (and learning how to start a business), so I don’t have any Extremely Compelling Gameplay Videos yet. Here’s a short animated GIF for now. The bloopers on Twitter might be more fun though. :)
(Art definitely not final!)
Thanks for following along with me on this adventure! Hopefully my next update will come more quickly, and be less wordy! I’ve wanted to make videogames since I was Literally A Kid, so I’m quite excited to finally be doing that full-time, and to hopefully share something good with all of you. When I’m at a stage where I want alpha testers, I’ll definitely be asking here first.
Thanks for your support!
~ Colin (& SemiColin Games)