I have spent days trying to debug one of the applications I deployed to WebLogic Server. Here is some basic steps of settings we need to do: Compile all the codes IN DEBUG MODE. JAR-WAR-EAR the project. Before deploying to Weblogic Server, check managed server settings for enabling DEBUG MODE + DEBUG PORT (YOU WILL NEED THIS … Continue reading Java remote debug with Eclipse
Author: Coder Stan
Binary Indexed Tree
Binary indexed tree is a kind of data that use mostly to handle questions like "get the sum from indexes x to y of array"; It pre-processes all data in another array for query purpose. One of the key functions is to get the lowest binary "1" bit. (lowBit())For example: given number "15", which in binary is "1111",lowBit … Continue reading Binary Indexed Tree
Storing a two-integer element (coordinate, result set)?
I did a little test today about how to store a two-integer element like coordinate or global/local result set. The most compact way, which I prefer, is to use a long to store the two results. public static void main (String[] args) { long point = 0L; long lowMask = 0x00000000FFFFFFFF; int x = -7; int … Continue reading Storing a two-integer element (coordinate, result set)?
LeetCode – Palindrome Partitioning II
The first thing that comes up is that we should be able to solve this problem using DFS. For each recursion we do: 1.From designated start point, we scan from len - 1 down to start point to see if s.substring(i, j) is palindrome. 2.If so, we do dfs(s, j + 1), record the minimum … Continue reading LeetCode – Palindrome Partitioning II
PLSQL package best practice (fast changing schema)
I has been using PLSQL to build storage procedures in my daily work for a while. Here are some lessons I have learned in our code that could have saved me some trouble in the future. Be careful where you commit your changes to data. Create a separated script for schema changes. Easier to track changes. Use … Continue reading PLSQL package best practice (fast changing schema)
LeetCode – Best Time to Buy and Sell Stock IV Answers/Solution/Thoughts
This is the generic version of following problems Best Time to Buy and Sell Stock III (two transactions) Best Time to Buy and Sell Stock II (unlimited transactions) Best Time to Buy and Sell Stock (one transaction) So there are two dimensions to be considered: the number of transactions and the profit up to a given point of … Continue reading LeetCode – Best Time to Buy and Sell Stock IV Answers/Solution/Thoughts
Handling Date, DateTime and Timezone
Recently I came across this problem in one of my project. Since this is a commonly used lib so I will just keep it here for future reference. Based on Java™ Platform Standard Ed. 7 Now to compatible with java.sql.Date, we use constructor Date(long date) which takes a milliseconds time value. (milliseconds since January 1, 1970, 00:00:00 GMT not to exceed the … Continue reading Handling Date, DateTime and Timezone
