Wednesday, August 4, 2010

Mac annoyances (for a developer)

I'm switching to a Mac at work, mostly because it is recommended by other developers I respect.  But when it comes to productivity, I don't think it's going to make much of a difference: there are a bunch of features I had on my previous Linux (Ubuntu 10.4) laptop that just don't work well on the Mac.  Here is my list, in case Steve Jobs asks me later.
  • Apple has that stupid custom COMMAND button, just like Windows has their stupid custom START and MENU buttons.  It wouldn't be so bad if I could ignore it or use it in place of ALT, but it's used in most of the keyboard shortcuts, and the placement of the ALT and COMMAND keys on a connected keyboard is exactly reversed from the laptop keyboard.  I'm afraid I'll have to remap the keys whenever I connect my keyboard.  Ug.  I would love a good solution to this one.
  • Speaking of buttons, why doesn't the default keyboard have DELETE, HOME, END, PAGE-UP, and PAGE-DOWN?  I'll live since they usually work on my connected keyboard, but I emphasize "usually": for example, the HOME and END buttons do nothing as I'm writing this post in my browser.  Great... do I start learning Mac shortcuts for those?
  • Depending on the focus, keyboard shortcuts for enclosing windows don't fire.  For example, in Safari, if my cursor is in a text box, then I cannot switch to the next tab using my keyboard.  I get the same behavior in Eclipse... I just get stuck if my cursor isn't in just the right place.  Ouch.
  • I often want to resize a window by grabbing it's border on, say, the left side... or somewhere besides the bottom-right corner.
  • It's hard to navigate through the menu bar.  To get into a menu, I have to get to the menu bar, then type the first letter of the desired menu, then hit ENTER; on my other systems, one key combination will take me to the desired menu (eg. ALT+F for the "File" menu).
  • The menu bar contains many different sections: app operations, services, time, the Apple menu.  Why can't I separate them out and put the time where I'm accustomed to seeing it?
  • Any why does the menu bar always have to be at the top?  I'm accustomed to accessing system applications (eg. services) on the bottom.  Also, I put my dual screens on top of one another... luckily I can configure the menu bar to go at the top of my second monitor, or I would have been outright pissed (since it would have been in the middle of both screens).

I admit to being a Mac newbie, so I appreciate if you know any solutions that help with this stuff.  (But if you're going to say that I should buy a Mac keyboard or learn The Mac Way, please realize that I'll always do development work on some of my own machines where I run Linux (and I regularly hop on other people's Windows machines), so totally converting myself to the proprietary Mac approach isn't very attractive.)

Maybe I'm the wrong audience for this thing!?

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)

Myths:
- 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).

NoSQL
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.
datatables.org

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 webfinger.org

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.

Cheers!

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.)

Friday, April 2, 2010

Tech Breakfast miscellany

Here are my quick notes from today's breakfast (along with the people who brought up the topic, in parens).

We started on UI...
... then HTML 5, and the Ignite SLC event including a rap...


... and security, how we in tech tend to be lazy when it comes to security...


... so maybe these books will help us with the issues...


... and luckily we have new tools for managing authorization...



... and maybe some verifiable anonymity?


We discussed relationships, and tinychat.com and chatroulette.com came up.

Other... miscellany:

  • Silicon Snake-Oil by Clifford Stoll (Dan)
  • Archer Farm in Logan (... a historical farm here locally? Maybe someone can elaborate in the comments.)
  • "Never ascribe to malice, that which can be explained by incompetence." -- Napoleon Bonaparte (Phil)
  • Fear the Boom and Bust, a rap battle between economists Keynes and Hayek (Trent)

Wednesday, March 31, 2010

command to join multi-line output with awk

This outputs a single line with a colon separating the files in the listing:

ls /usr/local/jira/atlassian-jira/WEB-INF/lib/* | awk '{ ORS=":"; print; }'