Embracing the Messiness in Search of Epic Solutions

Month: September 2013

  • Configuring Quartz Scheduler to Run in Clustered Environment

    The goal of running a Quartz job in the clustered environment is NOT to have duplicate running jobs. The triggered job should run just one time regardless of the number of nodes in the clustered environment. Download Quartz and extract the file. Navigate to quartz-x.x.x -> docs -> dbTables and run the database SQL script… Read More…

  • Configuring Remote UPS Shutdown on Mac OS X

    PROBLEM I have APC Smart-UPS SMT1500. It contains a SmartSlot that accepts a network management card that allows the UPS to be connected to the switch (or router) instead of plugging the USB cable from the UPS to a computer. That said, I also have APC AP9630 UPS Network Management Card 2. My goal is… Read More…

  • Managing the Order of AJAX Calls on Input Field’s Keyup Event

    SCENARIO Consider the following code:- When user types an employee’s name, “Mike”, in the search field, a web service call is fired per character typed. In this example, the following web service calls are made:- Let’s assume this web service searches the input string against databases (or flat files, Facebook API, etc) and returns a… Read More…

  • Pretty Print JSON in JavaScript

    PROBLEM You want to display a JSON object in JavaScript. TAKE 1 While this works, I find this approach inconvenient when viewing the output in Firebug because I have to click on each generated link to view the details. TAKE 2 … will generate this:- This approach will display the entire JSON object as one… Read More…

  • Reading Directory/File’s ACL Directly from Java

    Prior to Java 7, there’s no way to read a directory/file’s ACL directly from Java. With Java 7, you can write something like this:- When you execute the code above, you will get something like this:- Read More…

  • Managing Log4j Configuration for Both Development and Production Environments

    PROBLEM Most of the time, we set the Log4j’s log levels to something lower (debug or info) during our local development. Once it is ready for production, we normally set the Log4j’s log levels to something higher (warn or even error) to prevent meaningless information from flooding the server log. One way to do this… Read More…