June 15, 2016

WAMP Port 80 is in use

Most comprehensive solution yet.

https://www.devside.net/wamp-server/opening-up-port-80-for-apache-to-use-on-windows

Because we, devs, are too lazy to type the port number everytime.

Oracle INS-30131 Initial setup error

Had trouble with it. Found some fixes

Fix 1 :

  • Enable administrative share for C$ (Please check with your System Admin to do this or See Microsoft document http://support.microsoft.com/kb/314984)
  • Check that it is ok:
  • net use \\c$ should work
  • the current user (i.e. user in administrator group) should have all privileges on the default share
  • Retry the installation
  • Remove the administrative share again



Fix 2 :

  • Remove the OracleRemExecService before doing the Oracle Client 12c Release 1 32-bit or 64-bit installation on the same Microsoft Windows x64 (64-bit) after installing the Oracle 64-bit or 32-bit software .
  • Go to the Windows 'Services'
  • Stop OracleRemExecServiceV2
  • ( This service is having a intelligence .Once someone tries to stop it this service gets deleted. This is due to the fact ,that this service is not running from the Oracle Home like other oracle services ,but from temp . For example : C:\Users\AppData\Local\Temp\oraremservi... )
  • Then try to install the Oracle 12c 32-bit or 64-bit on the same Microsoft Windows x64 (64-bit)



Fix 3 :

  • Launch cmd.exe in Administrator mode
  • SET TEMP = C:\TEMP
  • Run the installer from that command window

Eclipse Java Project Files Organization

Think of Java sourcecode packages as one big hierarchical namespace. Commercial applications typically live under 'com.mycompany.myapp' (the website for this application might be 'http://myapp.mycompany.com' although this is obviously not always the case). How you organize stuff under your myapp package is largely up to you. The distinction you make for C# between executable (.exe), DLL's and low-level classes does not exist in the same form in Java. All Java source code is compiled into .class files (the contents of which is called 'bytecode') which can be executed by a Java Virtual Machine (JVM) on many platforms. So there is no inherent distinction in high-level/low-level classes, unless you attribute such levels via your packaging. A common way of packaging is:
  • com.mycompany.myapp: main class; MyApp (with a main method)
  • com.mycompany.myapp.model: domain model classes; Customer, Order, etc.
  • com.mycompany.myapp.ui: user interface (presentation or view) code
  • com.mycompany.myapp.service: services within your application, i.e. 'business logic'
  • com.mycompany.myapp.util: helper classes used in several places
this suggests a standalone Java app, it might be different if it is a webapp using one of the many frameworks.
These packages correspond to a directory hierarchy in your project. When using Eclipse, the root of such a hierarchy is called a 'source directory'. A project can define multiple source directories, commonly a 'main' and a 'test' source directory.
Example of files in your project:
src/test/java/com/acme/foo/BarTest.java
src/main/java/com/acme/foo/Bar.java
lib/utilities_1_0.jar
And inside utilities_1_0.jar:
com/acme/foo/BarUtils.class
BarUtils.class this is a compiled java class, so in platform independent bytecode form that can be run on any JVM. Usually jarfiles only contain the compiled classes although you can sometimes download a version of the jar that also contains the source (.java) files. This is useful if you want to be able to read the original source code of a jar file you are using.
In the example above Bar, BarTest and BarUtils are all in the same package com.acme.foo but physically reside in different locations on your harddisk.
Classes that reside directly in a source directory are in the 'default package', it is usually not a good idea to keep classes there because it is not clear to which company and application the class belongs and you can get name conflicts if any jar file you add to your classpath contains a class with the same name in the default package.
Now if you deploy this application, it would normally be compiled into .class files and bundled in a .jar (which is basically a fancy name for a .zip file plus some manifest info). Making a .jar is not necessary to run the application, but handy when deploying/distributing your application. Using the manifest info you can make a .jar file 'executable', so that a user can easily run it, see [a].
Usually you will also be using several libraries, i.e. existing .jar files you obtained from the Internet. Very common examples are log4j (a logging framework) or JDBC libraries for accessing a database etc. Also you might have your own sub-modules that are deployed in separate jarfiles (like 'utilities_1_0.jar' above). How things are split over jarfiles is a deployment/distribution matter, they still all share the universal namespace for Java source code. So in effect, you could unzip all the jarfiles and put the contents in one big directory structure if you wanted to (but you generally don't).
When running a Java application which uses/consists of multiple libraries, you run into what is commonly referred to as 'Classpath hell'. One of the biggest drawbacks of Java as we know it. (note: help is supposedly on the way). To run a Java application on the command line (i.e. not from Eclipse) you have to specify every single .jar file location on the classpath. When you are using one of Java's many frameworks (Maven, Spring, OSGi, Gradle) there is usually some form of support to alleviate this pain. If you are building a web application you would generally just have to adhere to its layering/deployment conventions to be able to easily deploy the thing in the web container of your choice (Tomcat, Jetty, Glassfish).
I hope this gives some general insight in how things work in Java!

June 8, 2016

Project Management Tool : Redmine

MySQL Cluster

Had a nice informal interview (more like a meetup, really) with one of the partners of Kendra Solutions (https://kendra-solutions.com), Andreas. They work on a payment exchange/gateaway system for Telco companies called Kendra Exchange System. Andreas introduced me to some tools that the company are using for the development of their system and MySQL Cluster is one of them.

Gotta learn what it is.



June 6, 2016

Getting 2-dimensional array data to Excel File with PHP



 header('Content-type: application/ms-excel');
 header('Content-Disposition: attachment; 

 filename=REPORT_ORDER.csv');

 $fp = fopen("php://output", "w");

 $test = array ();
 $test[0]['collumn1'] = '00'; 
 $test[0]['collumn2'] = '10'; 
 $test[0]['collumn3'] = '01'; 
 $test[1]['collumn1'] = '11'; 
 $test[1]['collumn2'] = '20'; 
 $test[1]['collumn3'] = '21'; 

  //insert collumn names
 fputcsv($fp, array_keys($test[0]));

 //insert data rows
 for($x=0; $x
     fputcsv($fp, $test[$x]);
 }

 fclose($fp);
 exit;

?>

June 1, 2016

Re-learning Java Spring Part 1

Relearning Java Spring for next project.