Friday, July 26, 2019

Rest API Response Types and Required Keys and Optional Keys


When setting up a JSON API, you'll have all kinds of different types of calls and responses. Send separates responses into some basic types, and defines required and optional keys for each type:
Type
Description
Required Keys
Optional Keys
success
All went well, and (usually) some data was returned.
status, data
fail
There was a problem with the data submitted, or some pre-condition of the API call wasn't satisfied
status, data
error
An error occurred in processing the request, i.e. an exception was thrown
status, message
code, data

Thursday, July 4, 2019

Eclipse Shortcut for Ubuntu Unity

Eclipse Shortcut for Ubuntu Unity

a shortcut to run Eclipse on Ubuntu Unity and to register Eclipse with the left Launcher

Installation

In your terminal,
cd ~/.local/share/applications
wget https://gist.github.com/raw/2922285/eclipse.desktop
chmod u+x eclipse.desktop
vim eclipse.desktop
# edit eclipse.desktop to replace "<ECLIPSE_DIR>" with your eclipse directory

Register Eclipse with Unity Launcher

  1. In your terminal, xdg-open ~/.local/share/applications to open the directory with the file browser
  2. Drag and drop the eclipse.desktop on Unity Launcher
# Eclipse Shortcut
# https://gist.github.com/2922285
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=<ECLIPSE_DIR>/icon.xpm
Exec=<ECLIPSE_DIR>/eclipse
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Eclipse

Reference:

Friday, June 21, 2019

Example Remote Java Application Debugging

Step 1:

Create a Runnuable Jar file.

Step 2:

Run the Jar file as following:

java -Xdebug -Xrunjdwp:transport=dt_socket,address=0.0.0.0:8000,server=y,suspend=y -jar jar file

Example:



Step 3 : Eclipse Configurations and running.

Note : we should check the IP Address , Port Number is same .. Otherwise Debug will not work.
When you click on debug then the Jar fill will start running.
When we keep debug point then the Application will stop at the point.



Saturday, May 11, 2019

Having doubt and continuing a work

Experience : 

  • One day, I have given my bike for service in the morning . 
  • They have completed the service and i have started to servicing center to bring my bike.
  • When I started , There is raining and I have reached to servicing center by bus with helmet.
  • I have taken bike and started to come to home.
  • There is heavy raining and even though i am come to home . 
  • My mind have a doubt that I have mobile and it may be damaged because of the rain. 
  • But, i did not listen because of the mobile pouch. 
  • I have reached home and checked the mobile then i came to know that my mobile's sound is coming differently compared to previous sound.

Lesson :  Whenever , we have doubt on that we have to get clarity and that doubt and then go ahead. 

Effect of Postpone in Life

Experience : 

  • One day I came from Office and being ready to go to my home town.
  • On that day in my home water is going empty in the cans. 
  • So, my mind suggest me to bring the new water cans.
  • But , I did not listen to that and wasted my time and left home to home town.
  • I have completed some work at home town and come back to Bangalore on Sunday night .
  • I have went  to Office and come back in the evening.
  • Started preparing dinner then I came to know that cans are empty. So, I have called immediately to  cans to supplier . He told that there is raining so that it will take some time to deliver.
  • At this time, it take 3 hours to the cans supplier to come to my home and deliver the water.
  • I have realized at that moment , that because of postponement of water bringing before going to hometown, this happens.
Lesson:  we should not postpone of any work , if possible. if we do not do the work at that time , then when we have to do that work when we are busy.        

Monday, April 1, 2019

JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript

JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnitto JavaScript. Also included is a platform for automating the execution of tests on multiple browsers and mutiple machines running different OSs. Its development began in January 2001.

Download the jsunit
http://www.jsunit.net/

Test Procedure

Step 1 : run(double click) testRunner.html which is located in the  jsunit/testRunner.html.




Step 2 : Need to add the test case html page (already this frame work has some test html files in the location : jsunit/tests/*)and click on the run button from the opened testRunner. (in my case, Google Chrome is not showing me Run, Stop buttons. So, I have tested with FireFox Browser and Internet Explorer).





Documenting your javascript code like a pro, setting up JSdoc

Please find the following link ,
Explains clearly about the documentation of javascript code.

https://www.youtube.com/watch?v=Yl6WARA3IhQ

https://github.com/JSCasts-episodes/ep1-jsdoc


Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...