Change SRID of a GIS Shape File from SRS projection EPSG 28356 GDA94 to 4326 WGS84 using ogr2ogr and proj4js

In this example we use ogr2ogr  to change SRID of a GIS Shape File from SRS Projection EPSG:28356 GDA94 to EPSG:4326 WGS84 using ogr2ogr and proj4js. first, you need to find out the epsg projection 28356 – gda94 / mga zone 56 from below and copy into -s_srs in the ogr2ogr command. https://spatialreference.org/ref/epsg/gda94-mga-zone-56/proj4/ Then run […]

Array Merge Sort Code in JavaScript and its Big-O

Array Merge Sort Code in JavaScript function mergeSort(arr) { if (arr.length === 1) { return arr; } let mid = Math.floor(arr.length / 2); let leftArr = arr.slice(0,mid); let rightArr = arr.slice(mid); return merge(mergeSort(leftArr), mergeSort(rightArr)); } function megre (leftArr, rightArr) { let output = []; while (leftArr.length && rightArr.length) { if (leftArr[0] < rightArr[0]) { output.push(leftArr.shift()); [...]

Array Selection Sort Code in JavaScript and its Big-O

Array Selection Sort Code in JavaScript function selectionSort(arr) { for (i =0; i<arr.length; i++) { indexSelection = i; for (j = i+1; j< arr.length; j++) { if (arr[j] < arr[indexSelection]) { indexSelection = j; } } //end for j if (indexSelection !== i) { let temp = arr[indexSelection]; arr[indexSelection] = arr[i]; arr[i] = temp; } […]

Install Keycloak in ubuntu behind nginx reverse proxy using postgresql database

Below we show how to install Keycloak in ubuntu behind Nginx proxy and also use PostgreSQL as its database. //download keycloadk and unzip wget https://github.com/keycloak/keycloak/releases/download/19.0.1/keycloak-legacy-19.0.1.zip //create admin user cd keycloak-legacy-19.0.1/ ./bin/add-user-keycloak.sh -r master -u admin -p mypassword //start keycloak ./bin/standalone.sh //enable proxy for keycloak by adding proxy-address-forwarding=”true” vim standalone/configuration/standalone.xml <http-listener name=”default” socket-binding=”http” redirect-socket=”https” enable-http2=”true” proxy-address-forwarding=”true”/> […]

Linked List Data Structure Code in JavaScript

In the examples below we show how to implement Linked List Data Structure in Javascript class Node { constructor(data, next=null) this.data = data; this.next = next; } } class LinkedList { constructor(data) { this.head = null; } /////////// insertStart(data) { this.head = new Node(data, this.head); } /////////// size() { let cnt = 0; let node […]

Tree code in Javascript and Breadth-First-Search and Depth-First-Search

In the examples below we show how to implement Tree in Javascript including Breadth-First-Search and Depth-First-Search class Node { constructor(data) this.data = data; this.children = []; } addData(data) { this.children.push(new Node(data)); } removeData(data) { this.children = this.childern.filter((item)=> { return item.data !== data; }); } } class Tree { constructor(data) { this.root = data; } breadth_first_search(fn) […]

JavaScript ES6 Useful Examples

In the examples below we show useful javascript ES6 examples which are very valuable Including: Array Loop and Slice Regular expression, replaces all blanks & special characters Object Keys & Values Object Map Math Sign Palindrom example Every & Some Array map elements Array Foreach loop map, filter, find reverse String balanceParser example //////Loop and […]

How to add SEO Meta Title & Description in your Website

SEO Meta Title and Description are basics and MUST HAVE settings for your website.   For adding those you must put below between  <header> </header> tags in your HTML page like the codes I put for my website:   <head> <title>Tips for Programming, Sysadmin, GIS, SEO | Full Stack Logs </title> <meta name=”description” content=”Full Stack […]

Reactjs and axios example: submit async post API request

In the example below we show how to call Post API using Axios asynchronously in React functional component.   We utilise “useState” for creating a state variable pass its value to the post request:   import React, { useState } from “react”; import axios from “axios”; const PostCreate = () => { const [title, setTitle] […]

Create HTTP Get and HTTP Post Server using Nodejs and express

For creating Http Get or Http Post Server using Nodejs (Not consuming Get or Post) Follow instructions below: First Create a Nodejs project by running:   npm init -y   Then install express and body-parser dependencies by running   npm i express body-parser   Now create and edit the index.js file and add below code […]