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:

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...