Skip to main content

Posts

Enabling TLS 1.2 in Java 7

I am working on web application that uses third party API and apparently those guys have stopped using TLS 1.0 and switched TLS 1.2 I was getting the following error Apparently Java 1.8 have TLS 1.2 by default and for Java 1.7 you have to enable it. I have been searching online for few days to enable TLS 1.2. I have tried all the following things but it did not work For each application, enter this command: java ... -Dhttps.protocols=TLSv1.1,TLSv1.2 ... Using JAVA_OPTS, enter the following command in your .profile, shell rc (to affect all Java programs run by the user), or conductor.sh (to just affect Datameer): export JAVA_OPTS="${JAVA_OPTS} -Dhttps.protocols=TLSv1.1,TLSv1.2" This is what I did and boom it worked
Recent posts

How to add code sample in your Blog

When I started blogging about code examples or sample projects the issue that I use to face was adding the code to my blog. I use to directly copy and paste code in the blog making my blog appear Clumsy. Behold! Gist is here Gist is by GitHub for sharing the code and its the best thing that I have seen so far. You can integrate you gist post in the blog and your blog looks clean Here is an example of how my code looks when I copy and paste directly to the blog  /* loading spinner */     .loading {         position: fixed;         z-index: 999;         height: 2em;         width: 2em;         overflow: show;         margin: auto;         top: 0;         left: 0;         bottom: 0;         right: 0;     }     /* :not(:required) hides these rules from IE9 and below */     .loading:not(:required) {         /* hide "loading..." text */         font: 0/0 a;         color: transparent;         text-shadow: none;         background-color: transparent;  

Mind Blogging SQL Challenges

Query an  alphabetically ordered  list of all names in  OCCUPATIONS , immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example:  AnActorName(A) ,  ADoctorName(D) ,  AProfessorName(P) , and  ASingerName(S) . Query the number of ocurrences of each occupation in  OCCUPATIONS . Sort the occurrences in  ascending order , and output them in the following format:  There are total [occupation_count] [occupation]s. where  [occupation_count]  is the number of occurrences of an occupation in  OCCUPATIONS  and  [occupation]  is the  lowercase  occupation name. If more than one  Occupation  has the same  [occupation_count] , they should be ordered alphabetically. Note:  There will be at least two entries in the table for each type of occupation. Input Format The  OCCUPATIONS  table is described as follows: Occupation  will only contain one of the following values:  Doctor ,  Professor ,  Singer  or  Actor

Simple IOT Project - Electric Imp Led Light Controller

Recently I went to IBM IOT Hackathon and got Electic IMP device and thought of playing with it and this is the first application I created LED Light controller using Electric IMP device and REST webservice. Overview Skill Level: Beginner Below are detailed steps on how to connect an Electric Imp with environmental sensors to the Watson IoT Platform in order to visualize and monitor your refrigerator in real time. Ingridients   Your WIFI *network name* and *password*  A computer with a web browser  Smartphone with the Electric Imp app I OS  or Android A free Electric Imp developer account    An Electric Imp Explorer kit - purchase from Amazon    Three AA batteries STEP BY STEP  Step 1 - What is demonstrated in this example? Use an Electric Imp to switch on/off light sensor and change the color of light using combination of RGB.  Step 2 - Connect your Electric Imp to the Internet  Set Up Hardware  Plug the Imp001 into the Explorer Kit Board .Power up y

What is Hash Function and HashCode

Many a times you hear this term call hash function or hashcode. One of the most common usage is in Java when  discussing about Hashset or HashMap. Lets understand what is Hashcode and HashFunction. What is Hash Function?  A hash function is any function that can be used to map data of arbitrary size to data of fixed size -wikipediea  In simple terms, think of hash function as a juicer where you can put any fruit and the result is always a juice. As the juicer is one way that is once you make the juice out of a fruit you cannot reverse the propose i.e. you cannot get the fruit back out of the juice. The same thing goes with the hash function once you get the resultant value you cannot reverse it. This is very important in information security and some people use this to store passwords ( they are other better ways to store passwords like salt technique but we wont discuss this in this post).  What is HashCode Hash code is the resultant of the hash function (its t

When and how I started programming

I have read of posts where poeple mentioned that they started programming at very early age but in my case it was opposite even though I was exposed to it at an early age. I have met many people who feel that its very late for them to start programming. This post is for them I was in 7 grade when I was exposed to programming. One of my family member was learning web desiging. She showed me the structure of HTML I wrote the first program and at that time I did not know that what I was doing is "programming" for me it was just some fancy thing like make slides on power point.  My first code was the following <HTML> <HEAD> <TITLE> Siddiq </TITLE> <BODY> Hello World </BODY> </HEAD> I played for some time and then got busy with other stuff. Years passed by I completed my BS in CS with some exposure to JAVA still I was not doing much programming until I enrolled in MS in CS.  All my peers were really good

Adding loading spinner to JSP Page using pure CSS and JS

I wanted to add loading spinner to the web application that I was working on. This application is a legacy application and I was looking into a way to add the loading spinner whenever the user performs certain actions such as the following Clicks a button which behind the scene performs CRUD operation When user request data  As the web application was based of JSP and I was looking for a way to adding it to the webpage and finally came across the following solution  Create a div  Add the CSS for the div Create a JS function which gets called on button click.  Here is the code HTML JS      CSS