Nuo Yan

Problem Solved

Recent Posts

Tags

News


  • Follow me on twitter: @nuoyan
    Make a donation to this Blog by PayPal. Thanks!






    Nuo is currently a Software Development Engineer in a Seattle-based software company.




    Locations of visitors to this page

    The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my school or employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.


Community

Email Notifications

Archives

Browse by Tags

All Tags » 5. Programming (RSS)
Class instance variable for ruby modules
Sorry if the title is a bit misleading, but this post talks about the scenario such that I have several classes, all extending the same module, and I need to avoid using shared or class variables (@@) in the module because the classes extending the module...
Don't forget the port number when replicating CouchDB
In the afternoon I needed to replicate a database from my co-worker's CoudhDB using CouchDBX. In the replicator, I entered my co-worker's database's path like the following: http://10.0.0.3/TestDatabase And I selected to replicate to one of...
Creating a Merb Rack middleware for running in Merb applications
There are a lot of resources on the Internet showing how to write and run a standalone rack application or middleware, but few showing how to write one to run in other Merb applications. This is actually very easy, so I'm going to share how I did...
Posted: Mon, Jul 13 2009 20:54 by Nuo Yan | with no comments
Filed under:
Modify bind address for couchdb 0.9.0
By default couchdb only binds to 127.0.0.1 so it's not accepting requests from other IP addresses. The bind address setting can be modified in the configuration file. For 0.9.0, by default, the default configuration file is located at /usr/local/etc...
Making an executable standalone Merb Slice gem
I have a standalone Merb Slice which can be started by running the "slice" command in its top directory. Today I needed to make a gem file for this Slice so that people can install the gem and start it directly by running the Slice's name...
Posted: Thu, May 21 2009 0:31 by Nuo Yan | with no comments
Filed under:
Testing exceptions with RSpec
I'm new to ruby and rspec. I wrote a ruby function and wanted to check whether it throws an exception or not in a certain situation with rspec, but I realized should_raise function no longer worked in the rspec version I was using (1.2.2). I tried...
Using Eclipse to add/update files to CVS
The command-line based CVS tool is hard to use for first time users; many GUI-based CVS tools are not really well designed to be easy to use either. I’m not against the point that developers and testers should learn how to use a technical tool in...
Book Recommendation
Writing Solid Code: Microsoft's Techniques for Developing Bug-Free C Programs (Microsoft Programming Series) Yes it's an old book which was published in 1993, but it's really awesome! I first got this book in last Saturday night, then I spent...
Posted: Tue, May 29 2007 23:04 by Nuo Yan | with no comments
Filed under:
Calculating Required Storage In a Direct-Mapped Cache
Suppose a 1-level direct-mapped cache need to have 64 KB's data, each block is 16-byte, and the memory address is 32-bit. To calculate the total bits needed for the cache, we could go through the following steps: We need to have 64 KB's data ...
Notes on Compiler Constructions
Table of Contents: 1. Introduction 2. Overview of Compilers 3. Scanner 4. Parser and Code Generation 5. Conclusions Introduction: This document briefly introduces the concepts and construction of programming language compilers. The document uses a simple...