Monthly Archives: January 2013

JavaScript Encapsulation: Privacy and Data Hiding

JavaScript does not have syntax-level encapsulation. All properties of an object are visible. However, there do exist various patterns to ensure data encapsulation. Singletons and the Module Pattern The following code creates one singleton object using an object literal. JavaScript

Tagged with: , , ,
Posted in JavaScript, Web

JavaScript Inheritance: Pseudoclassical vs. Prototypal

JavaScript is a prototypal object-oriented language, which means objects can inherit directly other objects. This is in contrast with the classical languages such as Java, where a subclass inherits from a superclass, and objects are instances of classes. However, the

Tagged with: , , ,
Posted in JavaScript, Web

AJAX: Asynchronous JavaScript and XML

AJAX stands for Asynchronous JavaScript and XML. AJAX is a way to exchange data with a server using JavaScript; this allows updating parts of a web page instead of reloading a whole new page. Example applications using AJAX includes Google

Tagged with: , , , , ,
Posted in JavaScript, Web

DNF Counting and the Monte Carlo Method

A DNF formula is a disjunction (OR) of clauses; a clause is a conjunction (AND) of literals; a literal is a variable or its negation. For example, \[ (x_1 \wedge x_2 \wedge \overline{x_3}) \vee (x_1 \wedge \overline{x_4}) \vee (x_3 \wedge

Posted in Uncategorized