Wednesday, May 26, 2010

Ruby memcached client on Ubuntu

It was a pain to figure out how to install a Ruby memcached library. Here's the error in 'irb' for requiring the basic library:

irb(main):001:0> require 'memcached'
LoadError: no such file to load -- rlibmemcached
from /var/lib/gems/1.9.1/gems/memcached-0.19.5/lib/memcached.rb:19:in `require'
from /var/lib/gems/1.9.1/gems/memcached-0.19.5/lib/memcached.rb:19:in `'
from (irb):1:in `require'
from (irb):1
from /usr/bin/irb:12:in `

Finally, I found this README where I realized I could install it as a gem:
sudo gem install memcached --no-rdoc --no-ri

This gave a ton of 'make' output, ending with this error:

rlibmemcached_wrap.c:12375: warning: format not a string literal and no format arguments
rlibmemcached_wrap.c:12380: warning: format not a string literal and no format arguments
rlibmemcached_wrap.c:12385: warning: format not a string literal and no format arguments
rlibmemcached_wrap.c: In function ‘_wrap_memcached_generate_hash_rvalue’:
rlibmemcached_wrap.c:12415: warning: format not a string literal and no format arguments
rlibmemcached_wrap.c: In function ‘Init_rlibmemcached’:
rlibmemcached_wrap.c:13285: warning: implicit declaration of function ‘sasl_client_init’
rlibmemcached_wrap.c:13285: error: ‘SASL_OK’ undeclared (first use in this function)
make: *** [rlibmemcached_wrap.o] Error 1

Gem files will remain installed in /var/lib/gems/1.9.1/gems/memcached-0.19.5 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/memcached-0.19.5/ext/gem_make.out

So I tried installing it in my home directory instead of globally for my machine:
gem install memcached --no-rdoc --no-ri

Then I have to do something different with the gems so that my default 'irb' session will find it:
export GEM_HOME=/home/trent/.gem/ruby/1.9.1

I expect this will make it so no other system-level gems will work. Ah, well. At least I can get their example to work.

GlueCon 2010

Eric Brewer (originated CAP theorem)

Since we almost always need partitioning, the choice is consistency vs availability (meaning availability for updates).
Turns out the CAP theorem rules out relatively little. (He talks about probabilities of catastrophic failure, like half your nodes.)
Facebook approach to consistency with backup: reads may be stale, until your own write after which read from master
Real world: weak consistency + delayed exception + compensation

Mike Stonebreaker (Ingres/Postgres)

- SQL is too slow
- want key-value interface
- SQL systems don't scale
- no open-source implementations
- ACID is too slow
- in CAP, choose AP over CA

VoltDB is a current example

2 reasons for slowness:

* interface: don't use ODBC/JDBC; use stored procedures instead
* services (eg. disk buffer pool, crash recovery, locking, multi-threading)

A modern DB on TPC-C benchmark, only 12% of time spent in useful work; other 88% was spent on buffer pool, latching, locking, & recovery. ACID is 1/3 of the cost; get rid of it to speed up 50% (see reference 1 here).

2 criteria:
  • no joins
  • no complex transactions
"SAML, OpenID, Facebook Connect: When to use what"

Facebook Connect is simplest 'cause they're the sole provider
OpenID is open with different providers, and you have already it with Google, Yahoo, etc.
SAML is the mother-of-formats using tokens and allowing all kinds of granularity
OAuth secures APIs, RESTful
WS-Trust secures web services, SOAP

Douglas Crackford (creator of JavaScript, JSON)

"The only way we can get things done is to avoid doing anything at all."
"One reason JSON worked is that it tried to solve the intersection problem rather than the union problem."
Web standards mandate security holes.

Safe JavaScript subsets:
These have been incorporated into ECMAScript Fifth Edition.

DOM is a big hole, so must fix DOM as well as JavaScript. HTML5 is making things worse:
  • new modes of attack
  • new capabilities of attack
  • long standards process
We should reset HTML5.
We must kill IE6.
30 days after all browsers have stable versions of ECMAScript5, let's stop supporting IE6.

Ross Turk

To get around the toll-cost per SMS, let's allow bundling of the API with ad access so provider shares in the benefit (revenue share).

3 calls-to-action if you have ideas:

Monica Keller, Facebook

Facebook allows your app to be notified of your user's changes & updates. It's not PubSub, just an HTTP callback.

Dustin Whittle on YQL

Very easy to try out and have them host your scripts.

Chris Messina on XAuth

Not for authentication: it's a central server telling the user's available services.

Brad Fitzpatrick on WebFinger

Try it out at

Sunday, May 2, 2010

recommendations for Utah native plants

Brandon at J&L Nursery gave me these recommendations for native plants:
He said I should avoid these:
  • mahonia -- obviously I've done something wrong because that's also on the top list... I'll find out...
  • squaw bush
  • golden rod
  • yarrow

Saturday, May 1, 2010

My Favorite Dishes at My Favorite Restaurant: Z'Tejas

Z'Tejas is my wife's and my favorite restaurant. There are a few dishes I highly recommend, including many appetizers; note that (in SLC) appetizers are half-price before 7 PM... we often go and just get a meal of those.
  • Appetizers
    • Grilled Shrimp & Guacamole Tostada Bites
    • Cast-Iron Skillet Dumplings
    • Crab & Spinach Skillet - new on their"spring" menu, and ends on June 7

  • Entrees
    • Diablo Chicken Pasta
    • Chorizo-Stuffed Pork Tenderloin
    • Ancho-Rubbed Pork Tenderloin - usually not available, so if you see it on special, get it!
Now, I don't know the deal with the Crab & Spinach Skillet, and why it's not a permanent part of the menu. I was blown away by the taste, and that's my new favorite dish... so I'm hoping others will enjoy it enough that we can make it permanent! At least, here in SLC. ;-)

A friend just recommended the Gorgonzola New York Strip, so I'll try that if I ever go out of my comfort zone.


BTW, @ZTejas on Twitter is very active, replying to people's comments, which reminded me that I wanted to wrote this post. Plus the fact that they post the recipes for some of their dishes... I'm impressed. (If they put their news items in RSS, I'd follow it.)