HTML Style , CSS properties Browser compatibility

CSS Proprties and Browser compatibility

CSS Properties :

1) content

  Never use content to set background image for div, instead use background-image :


    position: absolute;
    top: 12px;
    right: 11px;
    width: 40px;
    height: 40px;
    content: url(../../images/elective.png)
The above properties works fine in Chrome, but in firefox the image doesn't appear.
    position: absolute;
    top: 12px;
    right: 11px;
    width: 40px;
    height: 40px;
    content: url(../../images/elective.png)

2) background-size

    position: absolute;
    top: 12px;
    right: 11px;
    width: 40px;
    height: 40px;
    background-image: url(../../images/elective.png);
    -webkit-background-size: 100%;
    background-size: 100%

-webkit-background-size: is specifically for those browsers which support web kit layout rendering engine.
Note :

Opera supports 
But in latest opera versions, webkit itself is sufficient

3) box-shadow

   border: 1px solid #08c;
   box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 3px 6px rgba(0, 0, 0, 0.25)

This doesn't works in Firefox,

   border: 1px solid #08c;
  -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 3px 6px rgba(0, 0, 0, 0.25);
  -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 3px 6px rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 3px 6px rgba(0, 0, 0, 0.25)

4) border-radius:

    border-radius: 100px;

For Firefox and other browsers
    -moz-border-radius: 100px;
    -webkit-border-radius: 100px;
    border-radius: 100px;

5) innerText :
innerText is old style of using in older version of internet explorer.
Instead of using innerText , use textContent or innerHTML, this works fine in all browsers.

User innerHTML Or contentText


Ethics in Education : Every Nation must change

Education :

Swami Vivekananda said ” Education is the manifestation of the perfection already in man”, what kind of perfection a man has within him ? Human mind is an incredible thing, which has an incredible power, but the way we use the talent matters a lot. According to Swami Vivekananda what is perfection ? It has an incredible message , learning should be manifested which means it should be obvious to our mind. If something is obvious to our mind, then we will never forget and we will never leave that throughout our life. Perfection means the ability to address various problems human beings encounter in society. An education which doesn’t help to face the problems, which doesn’t build good character, which doesn’t build the social responsibility within us is not an education. Perfection in human means ethics.

Nelson Mandela said “Education is the most powerful weapon which you can use to change the world”, what change it is about ? History always teach us a lesson, a person like Swami Vivekananda,Mandela, Mahatma Gandhi and many more always pointed ethics in education not the science. 

Why Ethics is so important ?

The simplest and best answer for this is to save humanity on planet and which means to save our planet, We humans forgetting that we are spoiling everything. The greedy human losing his control, we destroy everything and every one for the sake of money. 

Education should not be business, the most important objective of education should be to equip the students with ethical values.

“Humans are the only living being who pays to live “, of course we can not say everything is wrong but there is no limit for his act. Ethics in education might bring the change.

What kind of ethics we are talking here ?

According to Rushmore Kidder’s research , we are talking about the following ethics in education

  • Ethics of justice
  • Ethic of Critique
  • Ethic of Care
  • Ethic of profession

Moral Values in Education

The moral values in humans are going away, every generation losing some extent of morality. Rushmore Kidder pointed 5 important moral values

  • Honesty
  • Respect
  • Responsibility
  • Compassion 

The funniest thing is , some has to do research to conclude that ethics is important in education

What I am talking about ? What are all these things ? Really if some one talk all about these, he will become priest, Swami because a normal man can not talk like this in society. The way people look towards you will be totally different when we talk about moral values.Have you ever tried to live your life with all the above ethics ? You will struggle, yes you have to struggle. It is not an easy go. 

Okie how can we change ? 

Let us start first with our profession, if you apply ethics in your profession then slowly you can change yourself and people around you. What is ethics in profession ? If you are a civil engineer, then think before you take the work, think before you start it, because one big project might destroy environmental balance in the future. If you are a government employee then first think about your country, how can you bring change in society? how can you serve your society ? it is not just a government employee but every one must.

But it is very difficult to change ourselves and others after certain age, we should impart ethics in our kids, teach them only about ethics till certain age, teach them how to look after seniors, teach them how to serve the society, teach them how to save our planet, teach them what is good and bad.

John Wesley said  – “Do all the good you can. By all the means you can. In all the ways you can. In all the places you can. At all the times you can. To all the people you can. As long as ever you can.”

There many more things to discuss, students should learn to respect Guru (Teacher), A guru should selflessly teach his Shishya ( Student ) , these days the bounding between Guru-Shishya is going away, there is no respect on guru. Education becoming a business rather than a media to change the society. Many people argue that I am thinking only in one direction, but that is the reality, that is the fact. Dr K. C. Chakrabarty, Deputy Governor, RBI has done enough research on Indian Education System and he pointed the importance of ethics in education.

How can we impart ethics in education?

Keep on educating kids on ethics, talk good , show good and ask them to do good. The best way to induce good qualities in kids is by telling how human destroying the nature, how our freedom fighters struggle for the sake of people, most importantly we should teach kids that we should never give importance to money, we should tell them how money will change human mind and how people do mistakes for the sake of money.

Give less money to your kids, do not give too much comfort life to your kids, teach them to accept difficulties and to overcome from difficulties, because when human face difficulty, he will realise the true meaning of life.

Also Read –



Algorithm Efficiency : Merge sort vs Insertion sort

Algorithm Efficiency : Merge sort vs Insertion sort

Importance of Algorithm Efficiency :

Let us learn how an algorithm efficiency matters a lot ? We will analyse this by taking some interesting experiment as an example. Before that let us know what are the efficiencies of both the algorithm

Insertion sort :

 The average and worst case efficiency of merge sort is (C1) O(n2)

Merge Sort :

 The average and worst case efficiency of merge sort is (C2) O(nlog(n)) 

But let us analyse the efficiency with an experiment :

Experiment :

Let us take a faster computer , Computer A running insertion sort and a slower computer running merge sort.

They each must sort an array of one million numbers. Considering the following factors

  • Computer A executes one billion instructions per second
  • Computer B executes ten million instructions per second
  • Computer A is 100 times faster than Computer B in raw computing power
  • To make the difference even more dramatic , suppose that the world’s craftiest programmer writes insertion sort in machine level language for Computer A and resulting code requires 2n2 instructions to sort n numbers ( 2 is constant c1)
  • Merge sort  will be developed by an average programmer using high-level language with an efficient compiler with a resulting code 50nlog(n) instructions ( 50 is constant c2)

With the above assumptions , to sort one million numbers

Time taken by Insertion Sort in Computer A ( Faster computer ) :
( 2 X (106)2 Instructions ) / 109 instructions/second = 2000 seconds,

Time taken by Merge Sort in Computer B ( Slower Computer ) :
(50 X 106 lg(106) Instructions) / 107 instructions/second = 100 seconds,
This experiment shows even with slower computer (100 times slower) the best algorithm gives best result compared to faster computer running less efficient algorithm.

Computer B runs 20 times faster than Computer A, even though Computer A is 100 times faster than Computer B.

This proves that even though the underlying hardware is low end, an efficient algorithm performs much better, one very good example for this is Android vs iOS 🙂

Even though android smart phones are very high end , very good RAM and processor, they perform less compared to iPhone which has less RAM and less speed processor
Reference : Introduction to algorithms by Thomas H. Cormen

Neurons to Networks…

From Neurons to Networks

I was just trying to understand how can I use a graph theory to understand or analyse human brain and connections within it. I found an interesting video here. It will ignite an interest within you and a new connections will be created in your brain as you start watching 🙂



Java Jar files; Java Libraries; JSON lib;

Java Jar files and Uses

JAR:  aopalliance-repackaged-2.2.0.jar 

Usage: aop alliance will be internally used by

Note : Google Guice Core is a powerful library released by Google for dependency injection, this works with java 6 and above ( download )

JAR:  apache-mime4j-0.6.jar

Usage: apache mime will be used for mime message parsing. This jar internally used by 

  • commons-io
  • commons-logging
  • junit like testing libraries
  • log4j 

JAR : commons-io

Usage – commons io provides utility classes, stream implementations, file filters,file comparators, endian transformation classes

JAR : asm-3.3.jar

Usage : asm jar will be used to analyse the byte code and analyse the frameworks

Note: asm is used by certain code generation libraries like cglib

JAR : gson-2.3.jar 

Usage : gson used to convert java objects into json object. Can be used in struts and springs to convert java objects. ( Documentation )

 JAR : persistence-api-1.0.jar

 Usage : The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications

Dependencies :

  • Servlet-API
  • Javax.inject 

JAR : hk2-api-2.2.0.jar 

Usage : This is called hundred kilobyte kernal for glassfish server, It forma the core glassfish server architecture


Hibernate NoSuchBeanDefinitionException : Java Hibernate Exception

Hibernate NoSuchBeanDefinitionException : Java Hibernate Exception

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.cess.service.Employee.EmployeeService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=EmployeeServiceImpl)} at at at at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject( … 25 more

Solution – 

This issue is a strange issue in hibernate autowire for bean objects, the solution will be as follows but no technical description why so ? 🙂

EmployeeService employeeService;  //EmployeeService is an interface


Change the above @Qualifier as below 

Note : the only change is instead of capital E in EmployeeServiceImpl, it should be small 'e' employeeServiceImpl
If it is reverse case then do make it Capital .