File search within JARs for Windows

for /R %G in (*.jar) do @jar -tvf “%G” | find “File Name.. wherein NoClassDefFoundError” > NUL && echo %G http://stackoverflow.com/questions/1342894/find-a-class-somewhere-inside-dozens-of-jar-files

Cache and ThreadLocal

Google Guava Cache Example using LoadingCache, CacheBuilder and CacheLoader: http://www.concretepage.com/google-api/google-guava-cache-example-using-loadingcache-cachebuilder-and-cacheloader https://github.com/google/guava/wiki/CachesExplained Introducing Caching for Java Applications (Part 1): https://dzone.com/articles/inroducing-caching-java-applic Java caching frameworks for enterprise applications: https://www.linkedin.com/pulse/java-caching-frameworks-enterprise-applications-anshuman-biswal Java Caching System: https://commons.apache.org/proper/commons-jcs/ Develop a generic caching service to improve performance: http://www.javaworld.com/article/2075440/core-java/develop-a-generic-caching-service-to-improve-performance.html ThreadLocal variable: http://stackoverflow.com/questions/817856/when-and-how-should-i-use-a-threadlocal-variable http://stackoverflow.com/questions/3386254/servlets-filters-and-threads-in-tomcat

REST handling empty POST body and filters concepts

http://stackoverflow.com/questions/20585348/post-empty-body-with-jersey-2-client   http://stackoverflow.com/questions/13326142/how-to-handle-empty-null-request-payload-in-jersey-rest   https://jersey.java.net/documentation/latest/filters-and-interceptors.html   http://www.mkyong.com/tutorials/jax-rs-tutorials/   http://www.mkyong.com/webservices/jax-rs/json-example-with-jersey-jackson/

GWT client and server interaction tips

GWT formpanel does not call onSubmitComplete http://stackoverflow.com/questions/13078770/gwt-formpanel-does-not-call-onsubmitcomplete http://stackoverflow.com/questions/24648994/gwt-formpanel-onsubmitcomplete-event-not-firing-when-downloading-a-file http://stackoverflow.com/questions/10742659/gwt-response-not-coming-back-to-onsubmitcomplete-when-sending-csv-file-in-respo Accessing Request parameters: http://stackoverflow.com/questions/18472199/access-gwt-post-parameters-via-servlet http://stackoverflow.com/questions/4515052/how-can-i-get-the-current-url-in-google-web-toolkit-via-client-side-java-code   GWT-LAB http://bootdiskrevolution.com/gwtlab-1.0.2/Gwtlab.html#WELCOME Date Time Format http://www.gwtproject.org/javadoc/latest/com/google/gwt/i18n/client/DateTimeFormat.html    

Unit testing tips

JMock doesn’t support static method testing.. Why ? Work around ?

Best practices for restful services versioning and documentation

http://stackoverflow.com/questions/389169/best-practices-for-api-versioning?rq=1 http://stackoverflow.com/questions/28853483/rest-api-versioning-with-swagger-2-0 http://stackoverflow.com/questions/35783349/setting-the-api-version-with-swagger-ui https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5 https://github.com/swagger-api/swagger-core/wiki/Annotations-1.5.X#swaggerdefinition Swagger Specification  Swagger Specification http://tech.asimio.net/2016/05/07/Documenting-multiple-REST-API-versions-using-Spring-Boot-Jersey-and-Swagger.html   Handling versioning with dispatchers http://maxenglander.com/2013/05/28/separate-resource-versions-with-context-resolvers-in-jersey.html

Date and SimpleDateFormat

http://stackoverflow.com/questions/1459656/how-to-get-the-current-time-in-yyyy-mm-dd-hhmisec-millisecond-format-in-java date.toString() would do if wanted to have a SimpleDateFormat(yyyy-MM-dd HH mm ss SSS)   Parsing back to Date from String.. http://stackoverflow.com/questions/9431927/how-to-convert-date-tostring-back-to-date Date d = new Date(); long l = d.getTime(); Date theSameDate = new Date(l); Date d = new Date(); String s = d.toString; Date theSameDate = new SimpleDateFormat(“EEE MMM dd HH:mm:ss zzz yyyy”).parse(s);… Read More »

My Todo Reads

Is open source security software too much of a risk for enterprises? http://searchsecurity.techtarget.com/answer/Is-open-source-security-software-too-much-of-a-risk-for-enterprises?utm_content=control&utm_medium=EM&asrc=EM_ERU_68477221&utm_campaign=20161123_ERU%20Transmission%20for%2011/23/2016%20(UserUniverse:%202234794)&utm_source=ERU&src=5581443   Creating successful RESTful API design http://searchsoa.techtarget.com/tip/Creating-successful-RESTful-API-design?utm_content=control&utm_medium=EM&asrc=EM_ERU_68545778&utm_campaign=20161124_ERU%20Transmission%20for%2011/24/2016%20(UserUniverse:%202235959)&utm_source=ERU&src=5582024

CMD Commands and usage

Netstat command to know the process and ports in use.. http://www.computerweekly.com/tip/How-to-use-a-netstat-command-in-Windows-to-watch-open-ports netstat –an 1 | find “3333” The command will check every second and print the results if a process starts listening on TCP port 3333. The local address entries beginning 127.0.0.1 are processes listening for connections from the PC itself, not from the Internet… Read More »

Understanding Servlet Filters

http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b14426/filters.htm http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b14426/filters.htm#BCFIAAAH

Java problem solving Question and Answers

http://www.sanfoundry.com/java-programming-examples-graph-problems-algorithms/ https://www.quora.com/How-can-I-implement-Graph-Tree-algorithms-in-java http://algs4.cs.princeton.edu/code/ Order of static, init, constructor execution: http://stackoverflow.com/questions/19561332/in-what-order-do-static-blocks-and-initialization-blocks-execute-when-using-inhe Parent static block Child static block Parent initialization block Parent Constructor Child initialization block Child Constructor

Temporary table creations in database

DB2 temporary table creation CREATE GLOBAL TEMPORARY TABLE TEMPPROD (SERIALNO CHAR(8) NOT NULL, DESCRIPTION VARCHAR(60) NOT NULL, MFGCOSTAMT DECIMAL(8,2) , MFGDEPTNO CHAR(3) , MARKUPPCT SMALLINT , SALESDEPTNO CHAR(3) , CURDATE DATE NOT NULL); http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/intro/src/tpc/db2z_creationoftemporarytables.html Postgresql temporary table creation Example: CREATE TEMPORARY TABLE temp_location ( city VARCHAR(80), street VARCHAR(80) ) ON COMMIT DELETE ROWS; http://www.sqlines.com/postgresql/statements/create_temporary_table Oracle… Read More »

IN clause limit with databases – Oracle DB2

Few solutions read for ORACLE were, No issue if IN clause values comes from a sub-query  – no limit Storing the IN clause values in global temporary table and using them Using ORs in between 1000s of INs – performance impact http://www.orafaq.com/forum/t/41437/0/ https://community.oracle.com/thread/235143 Postgresql doesn’t have any limit: http://stackoverflow.com/questions/1009706/postgresql-max-number-of-parameters-in-in-clause SQL Server has higher limit: (closer… Read More »

Containerization Docker notes

https://www.udemy.com/the-docker-for-devops-course-from-development-to-production/ https://www.udemy.com/docker-tutorial-for-devops-run-docker-containers/ https://runnable.com/docker/java/dockerize-your-java-application http://www.javaworld.com/article/3000781/development-tools/open-source-java-projects-docker.html Docker for Java Developers: How to sandbox your app in a clean environment Orchestration http://getcloudify.org/2015/06/11/orchestration-docker-cloud-automation-openstack-heat-tosca-kubernetes.html http://kubernetes.io/docs/whatisk8s/

Open source tools

Automation testing open source tools 6 Open Source Test Automation Frameworks You Need to Know I like it though not used till now.. http://redwoodhq.com/

RESTful services automated testing

WebApplication automated testing http://wiremock.org/ http://stackoverflow.com/questions/31025753/jbehave-for-testing-rest-web-application You could use WireMock. It’s a library that works really good with http requests. You could start your WireMock server in @BeforeStory and it will start recording and then shut it down in your @AfterStory in your steps class. You will have your response for your request stored in a… Read More »