it

JavaScript is the programming language of the web. With the growth of the JavaScript engine V8 (the google chrome browser JavaScript engine), which enable JavaScript to run faster, JavaScript is increasingly utilized on the server side, e.g. with node.js, phantomjs, etc.

CoffeeScript is an innovative language that compiles into JavaScript code. With CoffeeScript we can write our program logic much more faster with less and readable code.

CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

Most mainstream programming languages adopt the Object-oriented Programming (OOP) paradigm, however, JavaScript does not support OOP natively. But we can still implement classes and objects in its own way. In this article we’ll discuss about classes, objects and encapsulation in JavaScript/CoffeeScript.

Read on →
it

According to the official document for Buffer implementation, the Buffer class only supports a few encoding charsets including ‘ascii’, ‘utf8′, ‘utf16le’, ‘ucs2′, ‘base64′, ‘binary’, and ‘hex’ [http://nodejs.org/api/buffer.html#buffer_buffer]. So if you’re calling ‘toString’ method from a Buffer instance you should probably get an ‘Unknown Encoding’ error , e.g. reading a text file encoded by ‘latin1′ or ‘ISO-8859-1′. This post provides a quick fix to this problem.

Read on →
it

It’s been a long time since my last blog post. Recently, I’ve been working on our own company since spring. We are planning to sell novel and creative things targeted United States market. As the director of the IT department of our company, I’ve been considering how everyone in our company can co-operate. We’re planning to deploy several common groupware systems, e.g. the bug tracking system, the internal wiki system, etc. And we also need an active directory to provide credentials for these systems.

Read on →
it

“I have a comma delimited list of many of IDs that I want to use in an IN clause, Sometimes this list can exceed 1000 items, at which point Oracle throws an error. The query is similar to this…” – from http://stackoverflow.com/questions/400255/how-to-put-more-than-1000-values-into-an-oracle-in-clause

Recently I’ve encountered the same problem and I’m using Oracle11gR2.

Although it’s not recommended to have more than 1000 items in the IN clause list, we still need something to work around when sometimes it’s needed.

There might be some methods to work around this:

  1. Wrap the method which would possibly make a query contains an IN list which exceed 1000 items to divide the large query into subqueries.

  2. Using or in the where clause:

*select * from table1 where ID in (1,2,3,4,…,1000) or *

ID in (1001,1002,…,2000)

  1. Using union all

select * from table1 where ID in (1,2,3,4,…,1000)

union all

select * from table1 where ID in (1001,1002,…,2000)

  1. Temp table of course, the worst solution I think.

This problem does not appear to be in some of the other database systems.

If you’ve got some better solutions, please tell me.