Thursday, November 28, 2013

Important issues about computer vision

 Who doesn't like robot, who resists Star Wars caracters and I will not even mention curiosity rover (our dude exploring MARS and sending to us on earth some smart and fancy photos). Are those things magical ? Are they Scientific ?
As one old man told me another, this technology of yours will never stop surprising us...
 If I may say something or ask something who will resist the charm of computer vision ?

Today I was just reading this famous book of Linda S and G. Stockman on computer vision till I came across these important points.  Among some critical issues to the understanding of computer vision are the following:
  •  Sensing: How do sensors obtain images of the world ? How do the images encode properties of the world, such as material, shape, illumination and spatial relationships ?
  •  Encoded Information: How do images yield information for understanding  the 3D world (geometry, texture, shading, motion and identify of object in it) ?
  •  Representations: what representations should be used for stored descriptions of objects, their parts, properties and relationships ?
  • Algorithms: what methods are there to process image information and construct descriptions  of the world and its objects?
When we see all these numerous applications of machine vision in different aspect of our daily life, it is clear we have move from fiction to reality...then what neXt ???????

Sunday, November 24, 2013

Glassfish or Tomcat for your Production Project ?

This post is dedicated to those new in J2EE especially in JSF who are certainly wondering what will their choice of web application to deploy maybe their first ever enterprise web application on production. From my experience to make your life easier, Glassfish is the way to go, and I may mention that I have nothing against Uncle Tommy. Glassfish offers everything from development to the administration out of the box and free to you to smoothly deploy your application.
Such as :
  •  Command line utilities
  • Easy to use administration GUI
  • Multiple security features
  • Clustering features
  • Very good documentation
  • Stability
 For more details information feels free to google Glassfish Vs Tomcat to hear what other folks out there are gossiping about.
The following paragraph is taken from Chapter  3 of the Book entitled: " Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications" by Mick Knutson.

   GlassFish is a complete Java EE application server, in contrast to a Servlet container that would provide the Java EE web profile capabilities. GlassFish has an open source and supported version, and is described by the java.net project as:
   An open source, production-ready, Java EE-compatible application server. GlassFish version 3 provides a small footprint, fully-featured implementation of Java EE 6.
The Java EE 6 platform significantly improves developer productivity, introduces the lightweight Web Profile for Web-centric applications, and includes the latest versions of technologies such as JAX-RS 1.1, JavaServer Faces (JSF) 2.0, Enterprise JavaBeans (EJB) 3.1, Java Persistence (JPA) 2.0, Context and Dependency Injection (CDI) 1.0, and more. GlassFish is a Java EE open source application server.
    Apache Tomcat is maintained by the Apache foundation and described as:
Apache Tomcat is an open source software implementation of the Java Servlet
and JavaServer Pages technologies. The Java Servlet and JavaServer Pages
specifications are developed under the Java Community Process.
Tomcat is an excellent choice for projects that do not require enterprise services from Java EE.



Monday, November 11, 2013

getting day, month and year form java.util.Date

You may be trying to get for example the day, month and year from the java.util.Date directly such as:
Date date;
          int day =  date.getDay();
          int month = date.getMonth();
          int year = date.getYear();

         Just know that this previous way of getting them (d,m,y) is deprecated and only lead you to mess. However you should rather use the Calendar to get what you want from the date object, and here is how:

 Date date;
 Calendar calendar = Calendar.getInstance();
 calendar.setTime(date);
 int day = calendar.get(Calendar.DAY_OF_MONTH);
 int month= calendar.get(Calendar.MONTH);
 int year= calendar.get(Calendar.YEAR);

Hope you feel released...

Note: Of course importing from java.util.*;

Friday, November 8, 2013

Restore and recover an Oracle database to a new host

I promised it long time after receiving to many requests I decided to share it with you today. Many people usually prefer to work with mysql instead of oracle (no debate !!!) because with mysql they can easily export and import their database. But Oracle that so inflexible ? No. As you will see you can easily export (backup) and recover (import)  an Oracle database between two hosts (I am using Wxp) using the RMAN power.

Note:
H1: current host.
H2: new host.

  1. Backup H1 using RMAN.
  2. in host H1:
         Make sure H1 is in archivelog mode and rman autobackup on...
      rman> backup database;
  3.  transfer the backup of H1 to host H2 (flash_recovery_area = C:\oracle\product\10.2.0\flash_recovery_area)
  4. Determine the DBID of host H1
    • Now on host H2, make sure it has been shutdown. 
    •  -set the oracle_sid same as for H1 
    •   -rman target /
     
  5.  -set the oracle_sid same as for H1 
  6.   -rman target /
  7.  rman> set dbid dbid_of_H1
  8.  rman> startup nomount
  9.  rman> restore controlfile from autobackup;
  10.  rman> alter database mount;
  11. list the backup and take the SCN (scn_nb) number...
          rman> list backup
  12. restore and recover

          rman> run
                {
                set until scn scn_nb
                restore database;
                switch datafile all;
                recover database;
                };

          if receive ORA-19698 telling the dbid is different...
          Solution: replace the redologs ( located inside oradata) file in H2 wiht the one in H1
          Then run run{...} again
  13. open the database resetlog option.
            rman> alter database open resetlogs;

Note: Sometimes you have to backup database plus archivelog in order to avoid ORA-19698.

I hope from now on you will have fun with it. You feedback is always welcome.

Thursday, November 7, 2013

Greenstome Remote Server Error: Server returned HTTP response code: 403

Are you trying to remotely access your librarian interface and getting the following error message : Server returned HTTP response code: 403. 

To solve it you need to enable external connection from the server.:

Start --> Programs ---> Greenstone-2.8X -->Greenstone Server -->File --->Settings ---> Check Allow External Connections.

Irepot: Row transferred to next page get Calculated in the current page

This is a common problem with ireport but no formal ansvwer yet but some  workarounds do exist and I will show you one.

Here is the problem:  I have a report with a numeric column(suppose its name is quantity) per row which I want to show summation of that column for all records in every page, the desired value will calculate from summation of quantity columns in current page and all previous pages(suppose its name is qSum). If i allow splitting for Detail band rows, there is no problem, but when I prevent splitting, the quantity column value of splitted row will add to calculated summation (qSum) of current page, but the row itself will shown in the next page!
In order words how can I force the summation to be only for the row appearing on that page. (excluding the transferred row)
My column summation is the column footer.

Workaround: the key thing to do here is to create a dummy group for each row based on their primary key.

How ?

Whenever a row spread over two consecutives pages ireport becomes confused. Instead of using split type= prevent as option in the detail band , set it to split type= Stretch. Then create a dummy group (by primary key of the row) with group header and footer enabled that will act as a container for each row . Dummy group option are: reprint header=true, Min Height to start new= value of detail band height, Footer Position= normal, Keep together= true.

Now if each is processed as group and will be forwarded to next page it cannot fit a the current one. This scenario is common with financial accounting report when you have credit , debit and has to calculate a running balance with carry forward and bring forward totals.

I will try on my next post to illustrate this solution with some screenshots, but for now I hope you have got some ideas at least. Feel free to comment or knock me.