August 16, 2005

Make the XMLHttpRequest Object Work Cross-Browser

he World Wide Web has traditionally used a book or slideshow metaphor as the basis for navigation between hyperlinks. Clicking on a link is like flicking from one page to another in a book or magazine, or like operating a slideshow projector?click a button or link, and a new page

When JMX Is Overkill, Build a Lightweight Monitoring Framework

evelopers often need to monitor a set of applications and perform recovery measures in the event of a failure. In my case, I had to design a monitoring server for a multi-tier telecom backend comprised of several components distributed across multiple operating systems. I found JMX solutions to be overkill

Structs with Care: Boxing

Consider an employee service, say in an SOA-based implementation, which exposes the following method: Employee getEmployeeInfo(int employeeId) Looking at this signature, Employee can be defined as struct because it would be faster and lighter weight compared to defining Employee as a class: struct Employee{int employeeId;int department;string name;string designation;string address;….} In

Call a Private Method of a Class

Use this polymorphic technique to cheat the compiler and expose private information: See the code below.class A{public: virtual void f2() { printf(“in A::f2 “); }};class B: public A{private: void f2(int j) { printf(“in B::f2 “); } };int main(){ B b; A *a = &b; a->f2(10); } Because a->f2 is virtual

Release Virtual Machine Resources

Failing to release virtual machine resources results in a ‘memory leak.’ The following example is missing the ReleaseIntArrayElements call: jint * tempArray = env->GetIntArrayElements(jiArray, false);if (tempArray ){ return;}if (…) // exception occurred.{ // Missing the call ReleaseIntArrayElements return;}// Normal returnenv->ReleaseIntArrayElements(jiArray, tempArray, JNI_ABORT); Call ReleaseIntArrayElements whenever you call the GetIntArrayElements function.

XMI : Exchanging Models and Interchanging Ideas Using UML

MI is the standard that everyone has heard about but few are sure what to do with. Beginning with this article, I will demonstrate some interesting value-added ideas on the use of this standard. In future articles I will use XMI to grab information about assets from UML diagrams, put