Average Salary Excluding the Minimum and Maximum Salary in Java

 Average Salary Excluding the Minimum and Maximum Salary in Java.      public double average(int[] salary) {            int i;            int big = salary[0];            int small = salary[0];            double sum = salary[0];            for (i = 1; i < salary.length; i++) {                 sum += salary[i];                 big = (big > salary[i]) ? big : salary[i];                 small = (small < salary[i]) ? small : salary[i];             }            return ((sum-big-small)/(i-2));      }

Count of odd numbers between low and high in Java

Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive).     public int countOdds(int low, int high) {            int oddNumbers = 0;            // Find nearest odd number of inputs            low = (low % 2 == 0) ? low + 1 : low;            high = (high % 2 == 0) ? high - 1 : high;            for (int i = low; i <= high; i+=2) {                 oddNumbers++;            }            return oddNumbers;      }

Add Two Integers In Java

 Program to add 2 integers in Java.      public int sum(int num1, int num2) {                 return (num1+num2);      }

Ethereum Summary

 Significance of Ethereum 2nd generation blockchain implementation. More transparent and tracable. Allows more autonomy via smart contracts. ERC-725 standard is used to link real world identities to ethereum accounts. Ether - Ethereum's native crypto currency. Ethereum address - Pair of public key (for crypto transfer) and private key (secured). Initial Coin Offering (ICO) - Proposal for new blockchain based buisness. Decentralized Autonomous Organisation (DAO) - Minimal human interaction, decisions are made by smart contracts. Ethereum Smart Contracts Set of rules to follow to register a transaction in blockchain. Ethereum Virtual Machine (EVM) - An virtual environment where we can execute smart contracts. Every nodes run a copy of EVM. Each node runs every smart contracts resulting same output, hence more consistency. I learned most of these points from the linkedIn course - Please check it out as well.

Blockchain Development - Introduction

 Significance of Blockchain Technology Transactions usually require a third party who adds more trust to both sender and receiver parties. But, this third party can be corrupted and expensive. Blockchain eliminates this third party by making the process of exchange more foolproof. Transaction history is available and direct interaction of both parties. Multiple copies of transaction history are present in various locations. Blockchain solves many distributed processing issues - versioning data, remote processes, and multiple computing sources. Cryptocurrency Implementation of blockchain. Different from fiat currency - No regulatory board is present. Cryptography ensures integrity. Blockchain data and blocks Only support ADD and READ operations. UPDATE and DELETE operations aren't available. A ledger keeps track of all transactions. Blockchain data is replicated among multiple nodes and new data can be added only if the majority of nodes agree on the new transaction - Consensus and

Simultaneously deploy multiple functions in a single Azure function app

 In this article, I will explain a method I used while working with multiple functions to manage multiple azure functions under an azure function app. Issue with VSCode : In Visual Studio Code, each time I create a python function, it will add a new project directory along with a separate virtual environment, host.json and other config files. When I try to deploy a function it will delete existing azure functions in the function app. Resolution : With Azure CLI, using 'func' command, multiple python functions are created with common virtual environment, requirements.txt, host.json and local.settings.json. Deploying from the parent directory will make sure all functions are deployed and are in the latest versions. Detailed Explanation: Starting with the basics, open command prompt/terminal/powershell and login to Azure CLI (Command: az login). A new tab will be opened in your browser and ask for login info. After successful login, you will be redirected to terminal and window wi

How to install Ubuntu Server and set up static IP (WiFi) on Raspberry Pi 3

Setting up a headless OS is always painful and imagine the situation to do it without a monitor or keyboard. Here in this post, I will demonstrate how to setup Ubuntu Server in a Raspberry Pi and connect to WiFi with a static IP. The process includes the following steps, Installation of Raspberry Pi Imager Flash Ubuntu Server to SD Card Initial setup of Ubuntu Server on Raspberry Pi Configuring Static IP in Ubuntu Server's netplan network manager. Raspberry Pi Imager Raspberry Pi Imager is an SDcard burner program from the Raspberry Pi foundation aimed to make installation of different OSes in the Pi easier. You can navigate to the below link to download and install Pi Imager for your operating system. Source: Flash the SD card with Ubuntu Server Connect an SD card (preferably with storage 16GB or more) to your laptop/PC and launch Pi Imager application. From the listed Operating Systems, choose Ubuntu Server 64 bit version. I choose the 6

Popular posts from this blog

Unsupervised Learning

Automate Blog Post creation using Blogger APIs and Python

Setting up Python Flask server on internet via Port forwarding

The beginning of Data Quest

Setting up Jupyter Lab integrated with Python, Julia, R on Windows Subsystem for Linux (Ubuntu)