Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Tuesday, 20 April 2021

Guava Cache tutorial


      Introduction to Guava Cache
      Hello world application
      Auto load the object when it is not exist in cache
      LoadingCache: Load not found values automatically
      Get Cache statistics
      Avoid caching when the values are null
      Refreshing the value associate with this key
      Get all the entries in cache
      Get total number of elements in the cache

Previous                                                    Next                                                    Home

Thursday, 8 April 2021

JsonSchema tutorial

In coming posts, you are going to learn

a.   Generate json schema from a java class

b.   Generate json schema from json string

c.    Validate json document against json schema

d. Extract all messages from processing report in json-schema validator

 

I am going to use following dependency for this tutorial.

<dependencies>
  <dependency>
    <groupId>com.fasterxml.jackson.module</groupId>
    <artifactId>jackson-module-jsonSchema</artifactId>
    <version>2.12.2</version>
  </dependency>

  <dependency>
    <groupId>com.github.java-json-tools</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>2.2.14</version>
  </dependency>

</dependencies>

 

 

 

Previous                                                    Next                                                    Home

Monday, 29 March 2021

javax.json package tutorial

In this tutorial series, I am going to explain about javax.json package. ‘JSR 374’ documents the API contract for JSON processing.

 

javax.json package is part of Java EE and it well documented all the interfaces. You need to provide an implementation library to work with json using javax.json apis (Ex: javax.json artifact from glasshfish provided implementation for javax.json package).

 

I am using following dependencies for this tutorial.

<dependencies>
	<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
	<dependency>
		<groupId>javax.json</groupId>
		<artifactId>javax.json-api</artifactId>
		<version>1.1</version>
	</dependency>


	<dependency>
		<groupId>org.glassfish</groupId>
		<artifactId>javax.json</artifactId>
		<version>1.1.4</version>
	</dependency>

</dependencies>

 

      Create json and print
      Convert json string to JsonObject
      Convert object to json string
      JsonArrayBuilder: build arrays
      Pretty print json
      Build JsonObject from string
      Get an object from json string
      Get list from JsonArray
      Querying using object model api
      Query json using streaming api
      Read json from a file
      Write json string to a file
      Generate json using JsonGenerator

 

You can download the example applications from this link.

https://github.com/harikrishna553/javax-json-tutorial

 

 

 

Previous                                                    Next                                                    Home

Saturday, 6 March 2021

Springboot: quartz tutorial



      Springboot, quartz and MySQL: Hello world application
      Spring boot: quartz: autowire jobs
      Spring boot: quartz: Add, delete jobs dynamically

Previous                                                    Next                                                    Home

Monday, 1 March 2021

How PHP works?

PHP is server side language. In typical php web application development, you write php files to read request payload, process the data, retrieve the data from databases, transform it and send it back to the clients.

 


Once a request come to the php file, server takes the php file, process the information and convert the php snippet to respective html code and send back to the browser.

 

For example, as you see the contents of post_form.php file, it contains both html and php code. When request comes to this php file, server executes the business logic written in this php file and send the response back to the browser.

 

post_form.php

<form method = "POST">
    <label for = "name">Enter your name:</label>
    <input type = "text" name = "name"/><br />

    <button type="submit">Submit</button>
</form>

<?php

    if(isset($_POST['name'])){
        $my_name = $_POST['name'];
        echo "Hello $my_name, very good morning!!!!!";
    }
   
?>

 

Can I write php in html files?

No, you can write html in php files, but you can’t write php in html files.

 

 

 

Previous                                                    Next                                                    Home

Sunday, 28 February 2021

PHP core tutorial

      Introduction to PHP
      How PHP works?
      Install php on Mac
      Hello World application
      Php: apache: hello world application
      Access query parameters
      post form example
      Basic syntax
      variables
      Variable references
      echo: print the data to console
      comments: Documenting the code
      Php: data types
      Booleans
      is_bool: check variable holds Boolean value or not
      strings
      Single vs double quotes
      in place substitution of variables in a string
      Concatenate strings
      Escape characters
      built-in string functions
            strtolower: Get the string in lowercase form
            strtoupper: Get the string in uppercase form
            ucfirst: Make a string's first character uppercase
            lcfirst: Make a string's first character lowercase
            ucwords: Uppercase the first character of each word in a string
            strlen: Get string length
            ltrim, rtrim, trim : Trim the string
            strrev: Reverse a string
            substr: Return part of a string
      NULL: Represent nothing
      Emptiness
      Constants
      Arrays
            Add an element to the array
            Add an element to associate array
            Update values of array using reference
            Array pointers
            Basic array functions
                  array: count: count number of elements in the array
                  Array: max, min: get maximum and minimum value of array
                  sort: Sort the elements of array in ascending order
                  rsort: Sort array contents in descending order
                  is_array(): Chek whether a variable is an array
                  in_array: Check for existence of an element
      Operators
            Comparison operators
            <=>: Spaceship operator
            Logical operators
            Arithmetic operators
            what is the sign of modulo operator result?
            ++, --: increment and decrement operators
      Conditional statements
      if statement
      php is loosely coupled: === operator
      else statement
      if – else if - else statement
      Ternary operator
      switch statement
      while loop
      do-while loop
      for-each loop
      break statement: exit from the loop
      continue statement
      multi-dimensional arrays
            Access elements in a multi-dimensional array
      functions
            Access variables defined outside of a function
            Set default value to function argument
            functions: return a value from function
            Functions: pass the argument by reference
            Anonymous function
            Classes and objects
            How to define a class?
            get_declared_classes: Get all the classes that Php knows
            class_exists: Check whether class is defined or not
            How to get an object from class?
            Add properties to class definition
            Add methods to the class definition
            $this: refer to current instance properties
            Convert an object to string
            Class inheritance
            Override method definitions in subclass
            Access specifiers (or) visibility modifiers
            Adding dynamic properties, overloading
            Setter and getter methods
            Static properties
            static methods
            Access static properties from super classes
            new self(): Return instance of the class where new statement is defined
            new self() vs new static()
            Class level constants
            How to refer parent class properties, methods from sub class
            __construct: Constructor method
            Constructors and inheritance
            Why to use array as an argument to constructor definition
            clone an object
            __clone called while cloning an object
            Object are assigned by reference
            Implement singleton design pattern
            How to compare two objects?
      Return multiple values from a function
      Organizing your code
      include_once, require_once
      Interfaces
            class implement multiple interfaces
      Traits
      Abstract classes
      namespaces
      namespace: access entities using aliases
      Exception handling
      How to throw an exception
      Handle Exceptions
      try and multiple catch statements
      finally block
      uncaught exception handler
Previous                                                    Next                                                    Home

Thursday, 26 March 2020

TableSaw tutorial

      Introduction to TableSaw
      Working with Columns
      Perform Arithmetic operations on a column
      Selections: Filter the information
      where: filter the elements that matches given criteria
      Selection.with : Select specific rows
      Selection.selectNRowsAtRandom : Select n random rows
      Selection.withRange: Select rows in given range
      Selection.withoutRange: Select elements that are not in given range
      Perform Arithmetic Operations between columns
      min: Find minimum value in a column
      max: Find maximum value in a column
      count: Count number of elements that satisfy given predicate
      countUnique: Count unique elements in a column
      Standard Deviation of a column
      Table
      Create table from csv file
      Get structure or metadata of a table
      Get the shape of a table
      Get number of rows and columns in a table
      Get first n rows of a table
      Get last n rows of a table
      Print all the rows in console
      Print total table in minimized way
      Get all the columns of a table
      Remove specific columns from a table
      Retain specific columns of a table
      Remove columns with missing values
      Add columns to a table
      Column names are case insensitive
      Table: Get column by name
      Table: Get column by index
      Table: Get columns of desired type
      Get all the columns of specific type
      dropRowsWithMissingValues: Drop rows with missing values
      Drop rows that satisfy the condition
      Print table row wise
      Select n random rows from a table
      Add rows from other table
      Print table contents using for-each loop
      Sort the elements of a table
      Sort elements of table in both ascending and descending order
      Filtering the elements of a table
      Combining filters into complex queries
      Select specific column from a table
      Selecting columns in a query statement
      Get summary of table
      Selecting columns in a query statement

Previous                                                    Next                                                    Home

Tuesday, 17 March 2020

Swagger Tutorial

      Introduction to Swagger
      Installing Swagger Editor and Swagger UI
      Hello World API in swagger editor
      Add Query parameters to API
      Adding template or path parameters to the API
      Adding headers to the API
      Build request body
      Reuse the snippet via components
      Specify required fields in the reusable components
      Create reusable response objects
      Reusing Query Parameters
      Specify media type (content negotiation)
      Generate Interactive documentation from API Definition file
      Tagging the APIs
      Specify security like basic, oauth2
      Generating server stub
      Generating client stub
      Introduction to Swagger Hub
      Versioning of APIs

Previous                                                    Next                                                    Home

Saturday, 7 March 2020

TestNG tutorial

      Introduction to TestNG
      Install TestNG plugin in Eclipse
      Setup TestNG Project in Eclipse
      Basic Annotations
            @Test: Write test case
      @Test: run testcases in alphabetical order
                  Ignore or disable test cases from execution
                  Skip test cases
                  Specify timeout for the testcase
                  invocationCount: Invoke test method given number of times
                  Run independent test method in parallel
            @BeforeClass: Execute this method before executing test cases
            @AfterClass: Execute this method before executing all test cases
            @BeforeMethod: Execute before every test case
            AfterMethod: Execute after every test case executed
            @BeforeSuite: Run before all the tests in this suite run
            AfterSuite: Run after all the tests in this suite ran
            Run Test suite from xml file
            BeforeTest and AfterTest annotations
            Specify timeout at suite level
      Exploring Assertions
      assertTrue: Assert condition is true
      assertFalse: Assert condition is false
      assertEquals: Assert equality
      assertNotEquals: Check inequality
      assertNull: Assert null value
      assertNotNull: Assert object is not null
      assertSame: Asserts that two references refer to the same object
      assertNotSame: Asserts that two objects are not refer to same object
      Hard Assertions
      Soft Assertions
      Prioritize test methods execution order
      dependsOnMethods: Specify dependent test cases
      dependsOnGroups: Test method can dependent on groups
      Execute test cases from specific group or groups
      Group of groups
      @DataProvider: Pass parameters to test cases
      Access data provider defined in other class
      Provide test input based on method name
      ITestResult: Describe result of a test
      Working with ITestListener
      successPercentage: Specify success percentage
      IExecutionListener: Monitor test starts and ends.
      surefire reports
      Run test cases using maven
      Run Tests in parallel
      Run test methods in parallel
      Run test classes parallel
      Run tests inside a suite in parallel
      Run test classes parallel
Previous                                                    Next                                                    Home

Tuesday, 10 December 2019

Spring Data REST tutorial

Previous                                                    Next                                                    Home

Wednesday, 13 November 2019

Spring Boot JDBC tutorial

Previous                                                    Next                                                    Home

Thursday, 8 August 2019

spring boot security tutorial

Previous                                                    Next                                                    Home

Friday, 6 May 2016

Python Home

Python
Introduction to Python
Python is open source and is available on Windows, Mac OS X, and Unix operating systems. You can download and work with python for free. Python is fun to experiment and easy to learn. Read more>>
Airflow
Airflow is a software to author, schedule and monitor batch data pipelines. Read more>>
Built-in functions
Examples of python built-in functions Read more>>
Database Access
Python database API provides number of modules to perform CRUD operations on databases. Python database API supports number of databases. Read more>>
enum module
Python enum module support enumeration related functionality. Read more>>
FastAPI
FastAPI is a web framework for building APIs with Python 3.6+. Read more>>
Logging
Every enterprise/web/large application requires efficient logging mechanism to debug in application development phase, maintenance phase. In this tutorial series, you are going to learn python logging module. Read more>>
matplotlib tutorial
Matplotlib is a widely used library for data visualizations in Python. You can create static, interactive, and animated visualizations in a wide range of formats. Matplotlib is heavily used in data science, Machine learning, Finance, Engineering fields etc., Read more>>
Miscellaneous
You can find all the miscellaneous application here Read more>>
OpenCV
Image processing with OpenCV Read more>>
Pandas
Data Processing with Pandas Read more>>
Pydantic
Pydantic is a python library that enforces type hints at runtime, and provides user friendly errors when data is invalid. Read more>>
Pygame: Gaming Library
Pygame is a set of modules used to develop games in python. Pygame adds functionality on top of Simple DirectMedia Layer(SDL) library. Read more>>
Threads
Thread is a lightweight Process. Each thread has its own local variables, program counter, and its life cycle independent on other threads. Read more>>
time module
You will learn about about time, datetime, calendar APIs. Read more>>
Useful Programs
Programs on lists, string, numbers time, datetime, calendar APIs etc., Read more>>