23 June, 2022

flutter/Android WebView not loading an HTTPS or http URL


flutter/Android WebView not loading an HTTPS or http  URL

flutter/Android WebView not loading an HTTPS or http  URL


You can use the WebView plugin to display a webpage within your Flutter application. A Flutter plugin that provides a WebView widget.

Step 1:

Install web view using the following command 

  •  flutter pub add webview_flutter

Step 2:

user android:usesCleartextTraffic="true" to run  HTTP sites. not require for  HTTPS websites


Step 3:

Final Code: You can use the following code to run the website under android

import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() {
  runApp(
    const MaterialApp(
      home: WebViewApp(),
    ),
  );
}

class WebViewApp extends StatefulWidget {
  const WebViewApp({Key? key}) : super(key: key);

  @override
  State<WebViewApp> createState() => _WebViewAppState();
}

class _WebViewAppState extends State<WebViewApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter WebView'),
      ),
      body: const WebView(
        initialUrl: 'https://www.stackoverflowtips.com/',
      ),
    );
  }
}

Compile your code and have it run in an emulator:

sample output from code labs. developers. google. com



Bonus Point

You  may face the following issue "Android Webview gives net::ERR_CACHE_MISS message"

You can fix this issue by 

  • go to AndroidManifest.xml
  • add the following configuration
    • <uses-permission android:name="android.permission.INTERNET" />
  • Ensure that you don't have webView.getSettings().setBlockNetworkLoads (false);

09 June, 2022

What is a Non-fungible token?

 What is an NFT?

NFTs, or non-fungible tokens, are cryptographic tokens that exist on a blockchain but cannot be copied, each with its own unique identifying number and metadata.

NFTs are comparable to orators or information tokens, but they are neither interchangeable or fungible like cryptocurrencies like Bitcoin or Ethereum. NFT supporters claim that NFTs provide a public certificate of authenticity or proof of ownership, but the legal rights conveyed by an NFT are uncertain. The request of an NFT, as defined by the blockchain, has no inherent legal meaning and provides no other legal rights over the digital files associated with it.

A Non-fungible Token (NFT) is a digital asset, also known as a cryptographic asset, that has a unique identification code and metadata that distinguishes it from a fungible token. They, like cryptocurrencies, cannot be traded or exchanged at equivalent values. The difference between fungible tokens and cryptos is that cryptos are exactly the same and can thus be used for commercial transactions.

Some Famous and Most Expensive NFT

BORED APE YACHT CLUB

BAYC is a collection of 10,000 Bored Ape NFTs—unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation.

BAYC Floor Price:  91.5 ETH



CryptoPunks (Ͼ)

CryptoPunks launched as a fixed set of 10,000 items in mid-2017 and became one of the inspirations for the ERC-721 standard. They have been featured in places like The New York Times, Christie’s of London, Art|Basel Miami, and The PBS NewsHour.

Floor Price: 47.45 ETH , famous nft:


How does NFT work?

NFTs rely on blockchain technology to function. Because of its unique construction, each NFT has the potential to be used in a variety of applications. A digital asset management platform is a great way to represent actual assets like real estate and artwork digitally. Because NFTs are constructed on blockchains, they can also act as identity management systems in addition to removing intermediaries and linking artists to audiences.NFTs can remove intermediaries, make transactions more efficient, and create new markets.

Many crypto-trading enthusiasts and art collectors use NFTs. Additionally, it can be used for digital content, gaming items, investment collateral, and domain names.


TOP 10 NFT as of now dated 10/JUN/2022



if you are interested in crypto try the below link you will get an awesome discount on brokerage 


Use my code for the great deals

Crypto exchanges You Can Join 

Bybit Exchange - referral code: JZBLL2 or   Click to Join

Kucoin Exchange - referral code: rBPQFWD or  Click to Join

Binance Exchange - Code: GW4QZ68E or click here to join Biance


30 May, 2022

distributed messaging system and some common messaging scenarios

 

What is Distributed Messaging System?


Distributed messaging is based on the concept of reliable message queuing. Messages are queued asynchronously between client applications and messaging systems. A distributed messaging system provides the benefits of reliability, scalability, and persistence.

Most of the messaging patterns follow the publish-subscribe model (Pub-Sub) where the senders of the messages are called publishers and those who want to receive the messages are called subscribers.

Once the message has been published by the sender, the subscribers can receive the selected message with the help of a filtering option. 

Type of filtering

  •  topic-based filtering
  •  content-based filtering.

Note that the pub-sub model can communicate only via messages. It is a very loosely coupled architecture; even the senders don’t know who their subscribers are. Many of the message patterns enable with message broker to exchange publish messages for timely access by many subscribers. 

A real-life example is Netflix, amazon prime video, which publishes different channels like sports, movies, music, etc., and anyone can subscribe to their own set of channels and get them whenever their subscribed channels are available.


Some common messaging scenarios are:

Messaging. Transfer business data, such as sales or purchase orders, journals, or inventory movements.

Decouple applications. Improve reliability and scalability of applications and services. Client and service don't have to be online at the same time.

Topics and subscriptions. Enable 1:n relationships between publishers and subscribers.

Message sessions. Implement workflows that require message ordering or message deferral.

Here is an example of Azure Bus Service:



17 May, 2022

Angular-npm ERR cb() never called

 Angular-npm ERR cb() never called

Here is easy steps to solve this problem?

while installing a node package from the package.json file and the package-lock.json file is corrupted due to some reasons like  the node.js version is updated to the latest,  you may see an error like this in our terminal.

Following are the possible solutions to this problem, I trust, you may try one of them will work for you.

Solution 1:

npm config set registry https://registry.npmjs.org/

Solution 2:

npm cache clean

Or

npm cache clean --force

You might also manually remove the node_modules folder and try again in case the command above failed.

If still doesn't work, the global cache might be broken, try running npm cache clean --force and then do a clean install.

Solution 3:

npm install -g npm

Just globally installed the newest version of NPM and my guess Clearing npm cache is optional.



24 April, 2022

Azure Web Application Firewall?

 

Azure Web Application Firewall?

Azure Web Application Firewall (WAF) on Azure Application Gateway provides centralized protection of your web applications from common exploits and vulnerabilities. Web applications are increasingly targeted by malicious attacks that exploit commonly known vulnerabilities. SQL injection and cross-site scripting are among the most common attacks.

WAF on Application Gateway is based on Core Rule Set (CRS) 3.1, 3.0, or 2.2.9 from the Open Web Application Security Project (OWASP).

What problem it'll solve for your application( Features)?

  • SQL-injection protection.
  • Cross-site scripting protection.
  • Protection against other common web attacks, such as command injection, HTTP request smuggling, HTTP response splitting, and remote file inclusion.
  • Protection against HTTP protocol violations.
  • Protection against HTTP protocol anomalies, such as missing host user-agent and accept headers.
  • Protection against crawlers and scanners.
  • Detection of common application misconfigurations (for example, Apache and IIS).
  • Configurable request size limits with lower and upper bounds.
  • Exclusion lists let you omit certain request attributes from a WAF evaluation. A common example is Active Directory-inserted tokens that are used for authentication or password fields.
  • Create custom rules to suit the specific needs of your applications.
  • Geo-filter traffic to allow or block certain countries/regions from gaining access to your applications.
  • Protect your applications from bots with the bot mitigation ruleset.
  • Inspect JSON and XML in the request body

https://docs.microsoft.com/en-us/azure/web-application-firewall/media/ag-overview/waf1.png

Image Source: https://docs.microsoft.com/en-us/azure/web-application-firewall

Protection

  • Protect your web applications from web vulnerabilities and attacks without modification to back-end code.
  • Protect multiple web applications at the same time. An instance of Application Gateway can host up to 40 websites that are protected by a web application firewall.
  • Create custom WAF policies for different sites behind the same WAF
  • Protect your web applications from malicious bots with the IP Reputation ruleset
  • read more on MSDN

09 January, 2022

Fund Transfer from WazirX to Binance and Vice Versa Free

 

How To Transfer Cryptocurrency, Coins From WazirX To Binance? A Step-by-step Procedure

WazirX was acquired by Binance, a worldwide cryptocurrency exchange, in November 2019. Binance is one of, if not the largest, cryptocurrency exchanges in the world. Binance has a number of innovative crypto trading capabilities that no other Indian crypto exchange has. Furthermore, Binance offers the largest cryptocurrency collection on their site, with more than 500 coins and tokens accessible for purchase. Users of WazirX who want to acquire more cryptocurrencies that aren't available on their platform but are available on Binance can do so by linking their Binance and WazirX accounts.


You should have account on both exchanges with same email id and/Or Mobile Number

Login to Binance

Go to Wallet >> Valina Options >> WazirX,  Below is the Binance Screen shot


Once you logged over WazirX using Binance  your both app will be connected to each other(No Cost so nothing to worried, both are the same company now)

then you will click, you will find following screen


Now you can transfer token or USDT or other allowed crypto between screen writhing few second with Zero Cost.

Transfer WazirX to Binance

Login to WazirX

 Go to my walled and Selected UDT pairs crypto like INR/USDT  click on withdraw, screenshot for the same



you will seed an option to send to Binace, select it and transfer token very fast , secure and absolutely now cost. 


You will get 10% Discount on your trading fee if you join with Below invitation


Binance Joining Link: https://accounts.binance.com/en/register?ref=GW4QZ68E



06 October, 2021

How to Make a Custom URL Shortener Using C# and .Net Core 3.1

C# and .Net Core 3.1:  Make a Custom URL Shortener


Since a Random URL needs to be random and the intent is to generate short URLs that do not span more than 7 - 15 characters, the real thing is to make these short URLs random in real life too and not just a string that is used in the URLs


Here is a simple clean approach to develop custom solutions


Prerequisite:  Following are used in the demo.


Add a class file named ShortLink.cs and put this code: here we are creating two extension methods.

public static class ShortLink
{
    public static string GetUrlChunk(this long key)=> 
        WebEncoders.Base64UrlEncode(BitConverter.GetBytes(key));

    public static long GetKeyFromUrl(this string urlChunk)=> 
        BitConverter.ToInt64(WebEncoders.Base64UrlDecode(urlChunk));
}


Here is the Calling Sample code 
using System;
using System.Text;
using Microsoft.AspNetCore.WebUtilities;

namespace UrlShorten
{
    class Program
    {
        static void Main(string[] args)
        {
              
            string value = "SOME MEANING DYNAMIC/STATIC CONTENT";
            // Convert the string into a byte[].
            byte[] asciiBytes = Encoding.ASCII.GetBytes(value);
            long temp = 0;
            foreach (var item in asciiBytes)
                temp += item;
            // key = Tiks + sub of string bytes: that will be always unique
          var key = DateTime.UtcNow.Ticks + temp;
            Console.WriteLine($"Dynamic Key: {key}");
            var generatedUrl = key.GetUrlChunk();
            Console.WriteLine($"Generated URL: {generatedUrl}");
            Console.WriteLine($"Key From URL: {generatedUrl.GetKeyFromUrl()}");
            Console.ReadKey();
        }
    }
}

Here is the final output