Tuesday, 7 March 2017

Tools To Minify Javascript

Put succinctly, minifying is the technique of removing the unnecessary characters from the source code. This is also known as code compression and minimization. A lot of production websites are using JavaScript minification, but it has its own technique to compress scripts into smaller tracks. In order to execute different difficult tasks successfully, web developers get tremendous benefits from great JavaScript minifying tools. In the development tasks, these enhanced JavaScript minifying tools assist developers and help in improving the code. Minifying your source code will improve load time and also the performance of web applications. Here are some of my favorite:

Ajaxmin UI:
This is my favourite tool Ajexmin UI can superbly minifies files into folders as well as nested folders. It can even minimize the individual JavaScript files, charge the minifier in the background, and open up the productive folder when the minifier finishes running.

JS Min:
Unnecessary comments and white space from the JavaScript files can be eliminated easily by using JS Min. It reduces the file size by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean literate self-documentation.

YUI Compressor:
This is a command line tool printed in Java and expanded by Yahoo. If you want to minify quickly, the YUI compressor is a great fit for your needs. It is 100% secure and gives an elevated compression ratio as compared to other tools.

Dojo Shrinks Safe:
It is another compressor that parses the JavaScript using the Rhino library and crunches the local variable name. The size of your script can be naturally trimmed down, thus allowing it to rely on the programming style. It will never change the public variable and API, which means you can drop down the compression version of the JavaScript into the page without changing any code.

Packers:
Packers is another well-known Java minifying tool. It automatically creates the compressed version of your code. Just paste the code and hit the pack button. It can go beyond regular compression and add advanced, on-the-fly decompression with the JavaScript runtime piece.

Google Closure Compiler:
If you want to formulate your JavaScript to download and run extremely fast, the Google Closure compiler is a great tool for you. This tool eradicates the dull code, evaluates it, rewrites it, and also diminishes the leftovers. It also checks the syntax, variable references, and types, and warns you about common JavaScript pitfalls. It is the true compiler for JavaScript.

Making registry file to set the User variables/paths

1. run regedit from run command
2. go to HKEY_CURRENT_USER\Environment
2.1 Incase if you want system variables HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
3. select the folder right click and Export give some name (setUserVariable.reg)
    here if you dont want all variables you can edit this file
4. copy the setUserVariable.reg to other machine where you need to set the paths
5. double click on that 

Thursday, 22 December 2016

Eclipse Short Cuts Most often used



Specific Short Cuts :

Block Selection :
 Very Useful if you want to select block of area in eclipse just Alt+Shit+A , selection cursor(+) will be enabled , now select required area in eclipse editor , so beatuful
Alt + Shift + A
Alt + Cmd + A (on Mac)

Lower Case to Upper and Upper to Lower Case in Eclipse:
Lower case: CTRL+SHIFT+Y (CMD+SHIFT+Y on Mac OS X and Windows )
Upper case: CTRL+SHIFT+X (CMD+SHIFT+X on Mac OS X and Windows)

Friday, 11 April 2014

How to make osgi setup for big applications

Follow the below folder hirarchy can be followed applicationlibs bin configuration plugins thirdparylibs applicationlibs com.mycomp.sample.HelloService_1.0.0.jar com.mycomp.sample.HelloWorld_1.0.0.jar bin startServer.bat plugins org.eclipse.equinox.cm-1.0.0.v20080509-1800.jar org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.equinox.simpleconfigurator_1.0.0.v20080604.jar org.eclipse.osgi_3.4.0.v20080605-1900.jar thirdpartylibs jetty.continuation-8.1.13.jar jetty.deploy-8.1.13.jar jetty.http-8.1.13.jar jetty.io-8.1.13.jar jetty.jmx-8.1.13.jar jetty.security-8.1.13.jar jetty.server-8.1.13.jar jetty.servlet-8.1.13.jar jetty.start.osgi-1.0.0.jar jetty.util-8.1.13.jar jetty.web.extender.fragment.osgi-1.0.1.jar jetty.webapp-8.1.13.jar jetty.xml-8.1.13.jar org.eclipse.equinox.cm-1.0.0.v20080509-1800.jar org.eclipse.equinox.event-1.1.0.v20080225.jar org.eclipse.osgi.services-3.1.200.v20071203.jar servlet-api-3.0.jar configuration config.ini java5-server.profile jetty.fragment log4j.config org.eclipse.equinox.simpleconfigurator org.eclipse.osgi jetty.fragment etc\jetty.xml META-INF\MANIFEST.MF log4j.config META-INF\MANIFEST.MF log4j.properties org.eclipse.equinox.simpleconfigurator bundles.info The config.ini is as follow: # --------------- Config file for the OSGI Platform -------------------------------- # # OSGI Specific Configs osgi.launcherPath=. eclipse.ignoreApp=true osgi.noShutdown=true osgi.instance.area.default=../work osgi.framework=file\:plugins/org.eclipse.osgi_3.4.0.v20080605-1900.jar osgi.bundles.defaultStartLevel=4 osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.0.v20080604.jar@1\:start #simple Configurator Properties org.eclipse.equinox.simpleconfigurator.configUrl=file\:../configuration/org.eclipse.equinox.simpleconfigurator/bundles.info org.eclipse.equinox.simpleconfigurator.exclusiveInstallation=false osgi.java.profile=../configuration/java5-server.profile bundle.info : content #----------------------------------------------------- # symbolic Name, Version , Location , Start Level , ToBeStarted # -------------- Bundle Starter / Eclipse /OSGI Specifics -----------------------------------------# org.eclipse.equinox.simpleconfigurator,1.0.0.v20080604,file:plugins\org.eclipse.equinox.simpleconfigurator_1.0.0.v20080604.jar,1,true org.eclipse.osgi.services,3.1.200.v20071203,file:thirdpartylibs\org.eclipse.osgi.services-3.1.200.v20071203.jar,1,true org.eclipse.equinox.event,3.1.200.v20071203,file:thirdpartylibs\org.eclipse.equinox.event-1.1.0.v20080225.jar,1,true org.eclipse.equinox.cm,1.0.0.v20080310,file:plugins\org.eclipse.equinox.cm-1.0.0.v20080509-1800.jar,2,true # -------------------------------------------------------------------------------# # ----------------------------Web Server----------------------------------------# #catalina.osgi,5.5.23,file:thirdpartylibs\catalina.osgi-5.5.23-SNAPSHOT.jar,3,false #catalina.start.osgi,1.0,file:thirdpartylibs\catalina.start.osgi-1.0-SNAPSHOT.jar,3,false #tomcat.fragment,1.0,file:configuration\tomcat.fragment,3,false #jetty.osgi,6.0.16,file:thirdpartylibs\jetty.server-6.1.9.jar,4,false org.eclipse.jetty.server,8.1.13.v20130916,file:thirdpartylibs\jetty.server-8.1.13.jar,4,false org.eclipse.jetty.continuation,8.1.13.v20130916,file:thirdpartylibs\jetty.continuation-8.1.13.jar,4,false org.eclipse.jetty.deploy,8.1.13.v20130916,file:thirdpartylibs\jetty.deploy-8.1.13.jar,4,false org.eclipse.jetty.http,8.1.13.v20130916,file:thirdpartylibs\jetty.http-8.1.13.jar,4,false org.eclipse.jetty.io,8.1.13.v20130916,file:thirdpartylibs\jetty.io-8.1.13.jar,4,false org.eclipse.jetty.jmx,8.1.13.v20130916,file:thirdpartylibs\jetty.jmx-8.1.13.jar,4,false org.eclipse.jetty.security,8.1.13.v20130916,file:thirdpartylibs\jetty.security-8.1.13.jar,4,false org.eclipse.jetty.servlet,8.1.13.v20130916,file:thirdpartylibs\jetty.servlet-8.1.13.jar,4,false org.eclipse.jetty.util,8.1.13.v20130916,file:thirdpartylibs\jetty.util-8.1.13.jar,4,false org.eclipse.jetty.webapp,8.1.13.v20130916,file:thirdpartylibs\jetty.webapp-8.1.13.jar,4,false org.eclipse.jetty.xml,8.1.13.v20130916,file:thirdpartylibs\jetty.xml-8.1.13.jar,4,false javax.servlet,3.0.0.v201112011016,file:thirdpartylibs\servlet-api-3.0.jar,4,false start.jetty.osgi,1.0.0,file:thirdpartylibs\jetty.start.osgi-1.0.0.jar,4,false start.jetty.osgi.fragment,1.0.0,file:configuration\jetty.fragment,4,false web.extender.fragment.osgi,1.0.1,file:thirdpartylibs\jetty.web.extender.fragment.osgi-1.0.1.jar,4,false #jetty-util,6.0.16,file:thirdpartylibs\jetty.util-6.1.9.jar,4,false #----------------Application Bundles to be started Later------------------------------# com.mycom.sample.HelloService,1.0.0,file:applicationlibs\com.mycom.sample.HelloService_1.0.0.jar,5,true com.mycom.sample.HelloWorld,1.0.0,file:applicationlibs\com.mycom.sample.HelloWorld_1.0.0.jar,5,true Commands to run the application : java -classpath org.eclipse.equinox.launcher_1.2.0.v20110502.jar org.eclipse.equinox.launcher.Main start -debug -console -clean

Wednesday, 26 March 2014

How to invoke SP with Eclipse link

Check the below link http://ronaldoblanc.blogspot.com.br/2012/05/jpa-eclipselink-and-complex-parameters.html

Tuesday, 4 March 2014

Some usefull linux commands

To check http header response
curl -si http://localhost:8022/wrs/ | head

Thursday, 28 November 2013

NoClassDefFoundError vs ClassNotFoundException

Difference between ClassNotFoundException vs NoClassDefFoundErrorBefore seeing the differences between ClassNotFoundException and NoClassDefFoundError let's see some similarities which are main reason of confusion between these two errors:

1) Both NoClassDefFoundError and ClassNotFoundException are related to unavailability of a class at run-time.
2) Both ClassNotFoundException and NoClassDefFoundError are related to java classpath.

Now let's see the difference between NoClassDefFoundError and ClassNotFoundException:

1) ClassNotFoundException comes in java if we try to load a class at run-time using with Class.forName() or ClassLoader.loadClass() or ClassLoader.findSystemClass() method and requested class is not available in Java. the most of the time it looks like that we have the class in classpath but eventually it turns out to be issue related to classpath and application may not be using classpath what we think it was using e.g. classpath defined in jar's manifest file will take precedence over CLASSPATH or -cp option, for more details see How classpath works in java. On the other hand NoClassDefFoundError is little different than ClassNotFoundException, in this case culprit class was present during compile time and let's application to compile successfully and linked successfully but not available during run-time due to various reason.

2) ClassNotFoundException is a checked Exception derived directly from java.lang.Exception class and you need to provide explicit handling for it while NoClassDefFoundError is an Error derived from LinkageError.

3) If you are using classloaders in Java and have two classloaders then if a classloader tries to access a class which is loaded by another classloader will result in ClassNoFoundException.

4) ClassNotFoundException comes up when there is an explicit loading of class is involved by providing name of class at runtime using ClassLoader.loadClass, Class.forName while NoClassDefFoundError is a result of implicit loading of class because of a method call from that class or any variable access.