Neethack

command-t.vim Crash on Yosemite

| Comments

The bug

Today I updraged my mac osx to 10.10 yosemite, However, the command-t.vim plugin does not work correctly with new os.

I saw the command-t.vim could not load the C extension message from vim.

Learn jQuery From jqLite

| Comments

JQuery

Jquery is a great library, it makes manipulating DOM element and browser really simple and easy. As a web developer, jQuery is our day to day tool. However, sometimes it just too convenience that we forget how to make web page without it. It is important to go back to see how jQuery handle and wrap the DOM api and provide the simple interface for us.

JQLite

JQLite

Angular.js comes with a simple compatible implementation of jQuery, called JQLite. JQLite is used internally for angular.element if user doesn’t include jQuery, as a replacement for jQuery. It only have 1000 lines of code with lots comments, So it’s a good starting point to understand how jQuery works.

Understand Node Stream (What I Learned When Fixing Aws Sdk Bug)

| Comments

Node.js stream

Node.js provides asynchronous I/O base on event loop. When reading and writing from filesystem or sending http request, Node.js can process other events when waiting for response, which we called it non-blocking I/O. Stream is an extend of this concept, it provides an event base I/O interface to save memory buffers and bandwidth.

What I Talk About When I Talk About Pairing

| Comments

Pair programming, I used to heard a lot about it.
Some said, it is fun.
Some said, it produce good and clean code.
Some said, you can learn from your pair everyday.
Therefore, When I have chance to join a pair programming shop. I took the offer without any hestitation.

So after 7 months of pair programming. I thinks it’s a good time to talk about it.

Understand Chef Lwrp (Heavy Version)

| Comments

Recently I am mainly working on devops things, including system admin and chef. We are refactoring our old chef recipes into a more modulize shape with tests, So I think it’s a good time to share some experience in this refactor!

Resource and Provider in Chef

In chef, we use resource to describe the state of our system. And cookbook is a series of resources that describe the server state.

Announcing Code-Warrior

| Comments

Recently I am preparing the interview with some companies in West Coast.
One of the problem I have during the preparation, which is because I am a vim user, It is uncomfortable to practice algorithm questions on TopCoder, so I think it would be great if I have a npm tool that can download algorithm problems and provide some skeleton test case for practice. Therefore I created Code-Warrior

Bacon.js for Dummies

| Comments

Bacon.js is an FRP module for events on javascript. Which can transform your event listener/handler to a functional event stream. After servey a few blogs and example project, I found it is a really interesting concept and can make event handling speghetti code into clear functional logics.

Event stream

First, what is event stream? Actually it is nothing special, it is just an event listener that listen to specific event.

For example,

$("#clickme").on('click', function(event){ alert(event.target)})

Can transfer to event stream by Bacon.js’s asEventStream helper:

clicked = $("#clickme").asEventStream('click')

And add handler to event stream, listen to click event:

clicked.onValue(function(event){ alert(event.target) })

Express Bigpipe Experiment

| Comments

Bigpipe

Bigpipe is an unique frontend technique used by Facebook to increase their page rendering speed.

When I read the article talk about bigpipe on facebook, I was pretty shocked about how facebook implements those unique ideas to increase their page rendering speed.

Recently I am using node.js for web development, I think the async structure of node is a perfect environment to use this technique, so I wrote a small experiments app with express:

Understand Event Loops

| Comments

Event loop is the core feature in node.js, and is also the reason why it is better on handling requests and realtime communication like long polling.

The Obstacle of IO

The reason is on this is because the I/O is expensive:

Review of 2012

| Comments

2012 is a great year for me, lots of new things and new experience happened, and I also explored and learned lots of things in software from work and projects.

In the last day of 2012, I think it is a good time to review what I have done in this year, what I can improve and my expectation for the incoming year.