Samuel Taylor Coleridge (via Contact):
It is not impossible that to some infinitely superior being the whole universe may be as one plain, the distance between planet and planet being only the pores in a grain of sand, and the spaces between system and system no greater than the intervals between one grain and the grain adjacent.
Rdio requires the discrete graphics card on systems which support dynamic switching. This is annoying, since playing audio shouldn’t require intense graphics.
To get around this limitation, we can update the Rdio app’s
Info.plist to inform the system that it supports the integrated card. We can accomplish this with the following command:
defaults write /Applications/Rdio.app/Contents/Info.plist NSSupportsAutomaticGraphicsSwitching -bool YES
To revert back to forcing the discrete card, we can remove the key:
defaults delete /Applications/Rdio.app/Contents/Info.plist NSSupportsAutomaticGraphicsSwitching
Incidentally, gfxCardStatus is an excellent tool for monitoring graphics card changes and manually switching between cards.
GoDaddy has received a lot of bad press for their support of the Stop Online Privacy Act (SOPA), which they helped write and from whom they are exempt. However, GoDaddy and many other registrars should be avoided for more simple reasons.
Continue reading Morality clauses in domain registration
I started off reading eBooks from the Amazon Kindle store. As time has progressed, I’ve found myself using my physical Kindle less and less. Partly because I forget to charge it, and partly because I can never get the lighting in my favorite reading locations quite right. And at night? Forget about it.
Continue reading Migrating from Kindle to iBooks
Bitmasks are fun. There’s lots of little tricks you can do with them. A common situation is checking for the presence of a flag among elements in a linked list, or some similar data structure. I came across a trick a few years ago that makes it drop-dead simple.
Let’s say we needed to check for
AUsefulFlag in the
flags element of each node, and total how many elements in the linked list had the flag.
uint64_t count = 0;
for(Node *iter = head; iter != NULL; iter = iter->next)
count += !!(iter->flags & AUsefulFlag);
count is the number of items which have
!!) is one of those useful operations which are especially useful with bitmasks. It may require a double-take at first, but it behaves exactly how you’d think.
0. In fact,
!! of any true value evaluates to
1, so we can use it to transform something like
0b00001000 to simply
1 and increment by that value.
From Atlas Shrugged by Ayn Rand:
James: What are you after?
James: Don’t you have enough?
Francisco: In his lifetime, every one of my ancestors raised the production of d’Anconia Copper by about ten per cent. I intend to raise it by one hundred.
James: What for?
Francisco: When I die, I hope to go to heaven–whatever the hell that is–and I want to be able to afford the price of admission.
James: Virtue is the price of admission.
Francisco: That’s what I mean, James. So I want to be prepared to claim the greatest virtue of all–that I was a man who made money.
James: Any grafter can make money.
Francisco: James, you ought to discover some day that words have an exact meaning.