Blogging doesn’t earn you a penny. Especially, if your write-ups are lousy, sarcastic and with a subtle tinge of derogatory humor. Welcome to my little sad world. A software programmer by heart (since time immemorial) and profession (since last few years), JAVA has always fascinated me. After spending several sleepless nights staring at my laptops and some other places in my bedroom (the details of which I am not very keen to share), blogging is one heck of a medium to relax. So , in the midst of my struggle to keep the monthly paychecks flowing in and nourishing my love for colorful codes ( Eclipse Syntax highlighters) , I enjoy scribbling down pieces here and there , people somehow seem to like – ‘Blogs’ as they lovingly call it....
Professional Commitments Vs Personal Well-Being: The thin line in-between!!
Reading/Comressing ZIP,JAR and TAR Files using java.util.jar / java.util.zip /Commons-Compress APIs
Java JAR Operations :
The JAR file format is based on the popular ZIP file format. Usually these file format is not only used for archiving and distribution the files, these are also used for implementing various libraries, components and plug-ins in java applications. Compiler and JVMs (Java Virtual Machine) can understand and implement these formats for java application.For mentioning the product information like vendor name, product version, date of creation of the product and many other things related to the product are mentioned in the manifest file. Such type of files are special which are mentioned in the jar file for making it executable for the application. This file format is to be used for collecting auxiliary files associated with the components.
Java JAR Operations :
The JAR file format is based on the popular ZIP file format. Usually these file format is not only used for archiving and distribution the files, these are also used for implementing various libraries, components and plug-ins in java applications. Compiler and JVMs (Java Virtual Machine) can understand and implement these formats for java application.For mentioning the product information like vendor name, product version, date of creation of the product and many other things related to the product are mentioned in the manifest file. Such type of files are special which are mentioned in the jar file for making it executable for the application. This file format is to be used for collecting auxiliary files associated with the components.
package com.soham.JavaCompressOperations; import java.io.IOException; import java.util.jar.Attributes; import java.util.jar.Manifest; /*
Love,Live,Eat,Drink and Party...Theres No Tommorow !!
The "What-If" series................
“What-if” steamy Condom Commercials are back on Prime Time television?
Raped,Violated and Mocked : A Cry For Justice !!
“Basanti. In Kutto ke samne mat nachna” …. Those were probably golden days when, a bunch of guys would be content with dancing heroines. A modern day “Basanti” under such circumstances would have been torn to pieces and left bleeding to die a slow humiliating death.
Java : Comparable vs. Comparator...
The Comparable Interface :
Every bean class can have utmost one compareTo() method. Hence at a time we can have just one sorting mechanism in place.
We don't have a mechanism to explicitly specify a certain sorting condition while triggering a Collections.sort()
package com.soham.ComparableInterface;
import java.util.ArrayList;
import java.util.Collections;
public class ComparableExample {
public static void main(String[] args) {
ArrayList<EmployeeBean> li
The Comparable Interface :
Every bean class can have utmost one compareTo() method. Hence at a time we can have just one sorting mechanism in place.
We don't have a mechanism to explicitly specify a certain sorting condition while triggering a Collections.sort()
package com.soham.ComparableInterface;
import java.util.ArrayList;
import java.util.Collections;
public class ComparableExample {
public static void main(String[] args) {
ArrayList listEmpBean=new ArrayList();
listEmpBean.add(new EmployeeBean(12,"Soham","27"));
listEmpBean.add(new EmployeeBean(11,"Paras","27"));
listEmpBean.add(new EmployeeBean(100,"Saran","27"));
listEmpBean.add(new EmployeeBean(1,"Rahul","27"));
listEmpBean.add(new EmployeeBean(34,"Subho","27"));
listEmpBean.add(new EmployeeBean(67,"Arko","27"));Usage of Commons-Validator module across Popular J2EE Frameworks : Spring/Struts/JSF
The usage and configurations for Commons-Validator module across popular J2EE Frameworks.
STRUTS 2.1.6 :
The Struts 2 validation framework uses xml based configuration file. The file name should be <Your action class> -validation.xml within teh same package.
The XML would thereby validate all attributes mentioned in the Action Class i.e if they are mentioned as a part of the XML validation.
Those Good Old days....
What is better synchronized block or the synchronized method?
- That there exists only the critical section in the method body and nothing else.
- It is guaranteed that client is smart and will not mess around with the monitor of the object.
I frankly did not know. I would prefer a block since it gives my tighter control, protects against mistakes maybe made by someone else in the future (say unknowingly invoking IO in a synchronized method) and finally nothing better than to explicitly highlight your critical section and kind of self-document this "shared variable" that needs protection. Person who might touch this code down the road will precisely know the critical section.
But setting aside personal favoritism, this question peaked my interest as I wanted to know who wins!
Part 1:
Google it… (that is easy!) .. Nothing was found other than usual stuff.
Part 2:
Techies Vs Management : The ever debatable rift !!
Disclaimer :
The contents of the following post doesnot hint at any company,project or individual , living or dead (A dead manager asking for status updates would be just too scary to tolerate). So any coincidence what-soever is purely co-incidental.So all you techies and managers , please accept the article in the right spirit and participate sportingly. Well , I probably haven't been so modest and humble all this far.However, I agree and understand that its not wise to provoke flares from the management fraternity , since I plan to get married this year and a jobless guy isn't a suitable candidate for the same. So Peace Fellas !! Enjoy !!





