Tuesday, July 23, 2013

{HYPERLINK “dir”} appears in Microsoft Word

If you have a problem with HYPERLINK appearing in microsoft word , these are the steps to follow:

  1. Office button
  2. Word options ( from the window bottom )
  3. Advanced ( from left side menu )
  4. Show document content ( scroll down )
  5.  uncheck Show field codes instead of their values
  6.  done !



Wednesday, July 10, 2013

Tpye french accents with a QWERTY keyboard

Hi, if you use french language and familiar with english you may have come through this issue. If you don't want to install a third party software or alter your  PC configuration, here is a simple a easy way to do that.

 Just type ALT + Three number as follows.

 ALT 130 =  é
 ALT  131 = â
 ALT   132 = ä
 ALT  133 =  à
 ALT 134 =  å
 ALT 135=   ç
 ALT   136 = ê

 and soon.

Friday, July 5, 2013

Warning: mysl_result() expects parameter 2 to be long, string

You may have certainly come across this problem.
To solve this problem you have to set the second parameter as zero 0 to ask mysql to start from the first row.
e.g: $res = mysql_result($comment_result, 0);

Hope it helps.

Monday, June 24, 2013

Hibernate Vs Spring

Hi,
Either your are a professional or a novice I am sure you have already been stroke the first time by these terms Hibernate, Spring and then ask yourself what is even the difference between them.
  • Hibernate = a persistance framework.
  • Spring = a web application framework 
In simple language , Hibernate a is just an ORM a tool that provides some easiness to deal with database or to abstract it.
Spring can be compared with  JSF or STRUTS.
Spring is an enterprise web application framework that make use of hibernate to persist data.
Spring itself does not have persistence features it borrows them from hibernate.
Spring allows programmer to follow MVC architecture.

   I hope you have certainly got the idea.

Friday, June 21, 2013

EJB vs JPA vs Hibernate : Part 1

Hi,
Today I am going to address one of the hot issues that I always try to grab.
Like many newbies making their first step with the persistence, sometimes they are confused with these terminologies: ejb, jpa, hibernate and so on.
  The persistency technology has become unavoidable giving the advantages that it provides over JDBC: speed, flexibility , security  at the price of a higher learning curve.
 This is going to be a continuous debate and I will go straight to the point.
In short how can we differentiate between EJB, JPA and Hibernate.

  1. EJB: it a large set of specifications (security, transactions, persistence management, Timer services , administrations)
  2. JPA:  it a part of EJB specification that refers to persistence. (i.e: some empty crud methods)
  3. Hibernate: it an implementation of JPA specification. (i.e: implemented crud methods) 
  Notes:
  •   Hibernate is just an ORM tool.
  •  Hibernate and EJB ( or EJB 3) are completely different concepts and cannot be compared. EJB 3.0 is a specification of architecture for developing and deploying server side managed components (beans). The architecture manages the lifecycle of beans and also provides services like security, transactions, persistence management, Timer services , administration etc.
  • Using JPA in combination with EJB 3 is the easiest solution. Using JPA or Hibernate standalone requires much more verbose code and you manually have to manage transactions, which can be a pain.
  • JPA vs Hibernate is another debate. JPA has the benefit of having the standardized interfaces, so more developers will likely be familiar with it. On the other hand, the native Hibernate APIs are always a super set of those of JPA and thus offer more power.
  •   JPA is a set of methods without implementation. This set provides everything you need to organize the  mapping of objects to database tables, CRUD operations, managing transactions. Meanwhile, Hibernate is one of the implementations of JPA. It contains all the method’s realizations and even extends the set of methods with its own.
I am not an expert but I have tried through this short post to share my understanding of these terms.

Part 2 coming soon.