Wednesday, November 24, 2010

Ski Season Opening!

Tahoe got a lot of snow in the last few days and the ski resorts are now open.

I already went to Squaw Valley on Saturday for the opening day. Only one lift was open but it was enough for my daugther and I to have a great time skiing there. The drive back was a little long as we had a big snow storm but it was worth it.

Going back to Squaw Valley again tomorrow morning with my kids and a friend and hoping for a great day as the  snow accumulation is already about 9ft at 8200ft!



and the weather forecast looks really good too!



Schedule:
4:30am leaving San Carlos... ouch that's early :)
5:00am pick up a friend in San Francisco
6:30am pick up my daugther in Davis
8:30am breakfast in Squaw Valley
9:00am on the slopes!

Wednesday, November 17, 2010

JSON vs XML, structured vs semi-structured data

That debate has been going for years now... When should you use JSON vs XML?

Interesting blog posts on this today from Norm Walsh and Noah Mendelsohn.

Both agree that:
"XML wasn't designed to solve the problem of transmitting structured bundles of atomic values. XML was designed to solve the problem of unstructured data. In a word or two: mixed content."

Noah then adds:
"If you want to send along a list of job applicants and their recent salaries, JSON does fine;  if you want to send their resumes, well JSON isn’t quite as helpful.   A surprising amount of the world’s important information is in just such semi-structured documents.  Think insurance policies, shop manuals, and even Web pages themselves."

+1 to that! I've worked -- and struggled sometimes :) -- with XML for years, and more recently with JSON, and couldn't agree more!

Adding my 2c:
When you work with structured business data, use an object (or struct, or record) model in your favorite programming language, and an object serialization encoding like JSON.

When you work with semi-structured document resources, use a document API or a document centric programming language (like XQuery, XSLT) or even better, a document-node centric programming language (like XLinq), and an XML document encoding.

You'll need both programming approaches. Don't use a single approach for everything, unless you're looking for trouble.

When you need to communicate both structured and semi-structured data, don't bundle them. Just link these resources using URI references.

Simple enough?

Tuesday, November 16, 2010

Full support for Git at Apache

The Apache infrastructure team is starting to work on full support for Git at Apache. Woo-hoo!!

Many contributors already use the Apache Git mirrors and git-svn, but this will take Git usage at Apache to the next level.

Discussions are happening on the Apache infrastructure-dev mailing list there and JIRA issues have been opened to track the initial tasks there.

Issue INFRA-317 will be particularly interesting, I think... as it's about describing the basic Git workflows that will be used by Apache committers.

Git is a distributed version control system which makes it very easy for individual contributors to work in isolation on local private repositories for some time, then publish and merge their work with others later.

That's different from the traditional Apache way, where contributors from a project community collaborate more closely around a centralized (Subversion) repository.

So, I think it'll be interesting to see how these distributed and centralized workflows can be reconciled, to allow people to use Git for everything it's good at, while still following the Apache way.

Monday, November 15, 2010

My VI configuration file

After a few years using Eclipse, I've gone back to VI. I actually use VIM, an extended version of the original VI.

I won't expand on the reasons, but I just find it simpler, faster, and less distracting than a graphical IDE like Eclipse.

I've experimented a bit and found that I'm able to better focus on writing code with VI in a single barebones 24x80 window, instead of spending time and energy clicking and moving around outline views and windows.

I use exuberant-ctags to navigate big codebases, and Google search as a richer replacement for code-assist.

After I used VI to show and write code in my ApacheCon demos, a few folks asked me for my VI configuration supporting syntax highlighting, auto-indenting and code navigation.

Here's my $HOME/.vimrc file. Nothing fancy, but I find it useful:


" vi-improved mode
set nocompatible

" cycle buffers without writing
set hidden

" backup while writing
set writebackup

" file completion
set wildmenu
set wildmode=list:longest

" update window title
set title

" display cursor location
set ruler

" display current command
set showcmd

" short message prompts
set shortmess=atI

" silent
set noerrorbells

" switch to current file's directory
set autochdir

" remember marks, registers, searches, buffer list
set viminfo='20,<50,s10,h,%

" keep a big history
set history=1000

" syntax highligting
syntax on

" auto smart code indent
set autoindent
filetype indent on
set smartindent
set smarttab
set tabstop=4
set softtabstop=4
set expandtab
set shiftwidth=4
set shiftround

" allow backspacing in insert mode
set backspace=indent,eol,start

" incremental search
set incsearch
set nohlsearch

" ignore case
set ignorecase
set smartcase

" restore last cursor position
function! RESTORE_CURSOR()
    if line("'\"") > 0 && line ("'\"") <= line("$")
        exe "normal! g'\""
    endif
endfunction
autocmd BufReadPost * call RESTORE_CURSOR()

" navigate code using exuberant ctags
set tags=tags;$HOME
set tags+=$HOME/.vim/tags/cpp
set tags+=$HOME/.vim/tags/curl
set tags+=$HOME/.vim/tags/httpd
set tags+=$HOME/.vim/tags/libmozjs
set tags+=$HOME/.vim/tags/libxml2


Hope this helps.

Friday, November 5, 2010


The postings on this site are my own and don’t necessarily represent positions, strategies or opinions of my employer IBM.