27C3
December 18th, 2010I’m heading to 27C3 this year, but all the tickets appear to be sold out. If any blog readers happen to know how I could get a ticket, I’d greatly appreciate it if you could drop me a line.
I’m heading to 27C3 this year, but all the tickets appear to be sold out. If any blog readers happen to know how I could get a ticket, I’d greatly appreciate it if you could drop me a line.
Explaining the various new baubles of the internet to an iPhone-less visitor over Thanksgiving prompted me to put this taxonomy together. It’s somewhat unfairly (and perhaps meaninglessly) reductionist, but I was surprised by how neatly the services fit into this kind of ontology.
| Service | Primary element | Feed-based | Primarily mobile | Subscription | Default public | Likes | Comments | Arbitrary restriction |
|---|---|---|---|---|---|---|---|---|
| Status update | Yes | No | Symmetric | No | Yes | Yes | 5000 friends | |
| Foursquare | Check-in | No | Yes | Symmetric | No | No | No | |
| Textual status update | Yes | Yes | Asymmetric | Yes | No | No | 140 character updates | |
| Photo | Yes | Yes | Asymmetric | Yes | Yes | Yes | Square pictures | |
| Path | Photo | Yes | Yes | Asymmetric | No | No | No | 50 friends |
| Quora | Question answer | Yes | No | Asymmetric | Yes | No | Yes |
Am I missing any important properties?
A project I’m working on at the moment has a lot of long-lived objects, and we want to make sure that everything gets garbage collected correctly.
While trying to track down some issues, I wished I had Squeak’s PointerExplorer, which makes it easy to examine the references to an object—and figure out who’s causing problems by hanging on to one.
After a quick look at a few existing tools for tracing leaks, it doesn’t appear that there’s currently any way of doing this. So I took some code from Joe Damato, updated it a bit, and implemented two things: weak arrays, and GC.heap_find().
Weak arrays work pretty much as you’d expect:
>> a = []
=> []
>> a.weak = true
=> true
>> 1000.times { a << Object.new }
=> 1000
>> GC.start
=> nil
>> a[200]
=> nil
Like the PointerExplorer, GC.heap_find scans the heap to find references to an object. Since it uses the same algorithms that the garbage collector itself uses, it won’t miss anything. (If Ruby’s mark-and-sweep collector can’t find your object, it’s not going to be kept.)
>> obj = Object.new
=> #<Object:0x1007f6900>
>> a = [obj]
=> [#<Object:0x1007f6900>]
>> h = {:foo => 2, :bar => obj}
=> {:bar=>#<Object:0x1007f6900>, :foo=>2}
>> refs = GC.heap_find(obj)
=> [{:bar=>#<Object:0x1007f6900>, :foo=>2}, [#<Object:0x1007f6900>]]
>> refs[1].object_id
=> 2151609120
>> a.object_id
=> 2151609120
One slight issue is that heap_find can’t return some objects that are traversed by Ruby’s GC, but aren’t first class Ruby objects—things like SCOPEs and VARMAPs. heap_find could indicate their presence somehow, but, since they’re not first class, they can’t be returned directly. This isn’t that big a deal: memory issues here are pretty unlikely, and any present probably indicate a bug in Ruby itself.
Because the arrays returned by heap_find are weak, you can continue to explore the object graph as far as you like, without worrying about them interfering with the results, and leading to confusing additional references.
>> refs.weak? => true >> obj2 = Object.new => #<Object:0x1013ec9c0> >> foo = [1, 2, obj2] => [1, 2, #<Object:0x1013ec9c0>] >> GC.heap_find(obj2) => [[1, 2, #<Object:0x1013ec9c0>]] >> foo.weak = true => true >> GC.heap_find(obj2) => []
Here’s the patch for ruby 1.8.7-p174 (shipped with OS X 10.6).
Gmail proved that, despite the apparently high switching costs, a new webmail client can quickly get a lot of traction. There’s room now to do to Gmail what Gmail did to everything else. The replacement should have some concept of workflow (”archive, but remind me to respond tomorrow”, “send, and alert me if I don’t get a response within a few days”), some concept of teams and colleagues (allow threads to be shared as a first-class object, rather than flailing around with forwards and CC lines), be some way smart about mining the semi-structured mails going through the system (flight booking emails should be automatically annotated with .ics files), know something about prioritization (I like Twitter DMs because of the assumption that they’ll go to a mobile device. If I’ve sent more than 20 emails to someone, they should have the option of copying their mail to me as an SMS).
Potentially most powerfully of all, developers should be able create their own plug-ins that run on the server. There should be an agreement between plug-in developers and the webmail provider that creating a plug-in automatically grants a royalty-free perpetual irrevocable worldwide (etc.) license to the provider, and that the source code to any plug-in may be merged into the main product. Though plug-ins have niche appeal, this could be a good source of new features, and a strong competitive advantage. I’d just fix Gmail if I could.
I’d happily pay for any service that got this stuff right.
This has solved the eternal “there’s 3GB of stuff in my Downloads directory that I don’t feel comfortable deleting” problem for me:
$ crontab -l
0 * * * * /Users/patrick/Binaries/clean-downloads
$ cat Binaries/clean-downloads
#!/bin/zsh
find ~/Downloads -maxdepth 1 -amin +720 -exec mv {} ~/.Trash \;
You have twelve hours to do something with whatever it is you downloaded, or it’ll end up in the Trash. I highly recommend it.
Someone asked me today what surprised me most about doing a start-up. This was my response:
Like most internet users, I waste too much time on the web. Despite that, I’ve never had much luck with the apps that set out to solve this, like Freedom or RescueTime. They feel too heavy-handed. Instead, I want fairly repetitive and annoying prods that make wasting time less fun—the equivalent of small electric shocks, counterbalancing the Dopamine hits.
So here’s undop. Every time I visit a domain in ~/.bad_sites, it dims the display by 30%, gradually returning it to its previous brightness over the course of 30 seconds. It’s both an annoyance and a reminder. The effect is small enough that I don’t mind it on those occasions when I actually do want to read Twitter or Hacker News or whatever blog, but it’s jarring enough that I now subconsciously avoiding following links to them, and have mostly broken the check-for-new-stuff muscle memory.
Caveats: it only works with Safari on OS X. (Patches with support for other browsers welcome.) I’m guessing it might not be good for display backlights.
Whenever I take a screenshot, the next step is usually to paste it into an email or IM conversation. Here’s a modified version of a launchd script for OS X, originally from Avi, that automates that: whenever you take a screenshot, it uploads it to a server of your choice, places the URL on the clipboard, and beeps. Download and execute the script to install the service. It assumes you use key-based SSH authentication.
$ < ~/Binaries/git-find-removal #!/bin/zsh if [ $# != 2 ] ; then echo "$0 <commit> <string>" >/dev/stderr exit 1 fi git bisect start git bisect good $1 git bisect bad git bisect run grep -qRE $2 .
$ git-find-removal HEAD~20 'def my_important_function'