Browse by Tags
All Tags »
5. Programming (
RSS)
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...
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...
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...
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...
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...
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...
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...
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...
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 ...
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...