Posts

Come Thou Fount of Every Blessing

Image
Come Thou Fount of Every Blessing is a beautiful hymm written by Robert Robinson in year 1757. This hymm with the theme of Sovereign Grace was inspired from the book 1 Samuel in which Prophet Samuel in 1 Samuel 7:12, took a stone and called its name Ebenezer and said "Till now the LORD has helped us".  In the context of 1 Samuel(1 Samuel 4-7), Israel has been defeated against Philistine as Israel people has taken for granted the grace from God in which God delivered them from slavery at Egypt and all the way to guide them to the promised land but they still sinned against the LORD by idol worshipping Baals and Ashtaroth. The Israelites has thought that by the act of bringing the ark of God to the war will bring them victory against Philistine, but God knows this hideous thought of theirs and bring them defeat instead. As the Israelites was defeated, the ark of God was taken captive by the Philistine, and the ark was brought to the house of Dagon and placed next to the ...

Simplex implementation in Java with sample code

Simplex is one of the powerful algorithm to solve linear programming problems. With simplex, we can maximise or minimise objective function with the given list of constraint. public class Simplex { private double[][] tableaux; // tableaux private int numberOfConstraints; // number of constraints private int numberOfOriginalVariables; // number of original variables private boolean maximizeOrMinimize; private static final boolean MAXIMIZE = true; private static final boolean MINIMIZE = false; private int[] basis; // basis[i] = basic variable corresponding to row i public Simplex(double[][] tableaux, int numberOfConstraint, int numberOfOriginalVariable, boolean maximizeOrMinimize) { this.maximizeOrMinimize = maximizeOrMinimize; this.numberOfConstraints = numberOfConstraint; this.numberOfOriginalVariables = numberOfOriginalVariable; this.tableaux = tableaux; basis = new int[numberOfConstraints]; for (int i = 0; i < ...

Tutorial on Connecting Java application to IBM DB2 Express-C edition (Windows)

Software Prerequisites ·           IBM DB2 Express-C ·           Java SE JDK To begin, we will need to write a Java App. An example is provided below, this app simply shows how to list all the lastname from Employee  table in Java app import java.sql.*; public class testing{  public static void main(String args[])  {        try       {              Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");              Connection con=DriverManager. getConnection("jdbc:db2: sample");              Statement stmt = con.createStatement();              ResultSet resultSet=stmt.executeQuery(" SELECT Lastname from Employee");              System.out.println("Got Results!");              while...

Tutorial on porting OpenCV(revision:5578) to android in Windows Environment

Image
Software Prerequisites svn client (eg.Tortoise SVN) ·          cmake tool   http://www.cmake.org/ ·          Android NDK (revision r5 or newer)   http://developer.android.com/sdk/ndk/index.html ·          OpenCV trunk   https://code.ros.org/svn/opencv/trunk/opencv      Additional requirements for Java wrapper and Android samples ·          SWIG   http://www.swig.org/ ·          JDK 5/JDK 6   http://www.oracle.com/technetwork/java/javase/downloads/index.html ·          Android SDK   http://developer.android.com/sdk/index.html ·          ant   http://ant.apache.org      Windows additional prerequisites At the moment OpenCV cross compilation under cy...