teleren/devto huggingface dataset:
📇How to Draw Underline Link Hover Effect | HTML & CSS✏️
Tags: html, css, beginners, webdev
Published: 2022-07-06 12:57:44

Lets Create a Underline Link Hover Effect using just HTML CSS, step-by-step in a very easy to follow along tutorial.

***
{% youtube pE49J4r7Q8o %}
***

###Source Code:

**Markup:**
```html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Cool Underline Hover Effects</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <nav>
    <ul>
      <li><a href="#"></a>Home</li>
      <li><a href="#"></a>Services</li>
      <li><a href="#"></a>Contact</li>
      <li><a href="#"></a>About</li>
    </ul>
  </nav>

</body>

</html>
```
**css**
```css
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

*,
*::before,
*::after {
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}

body {
	background-color: #0a0a0a;
	color: rgb(226, 226, 226);
}

ul {
	height: 100vh;
	width: 70vw;
	min-width: 600px;
	display: flex;
	align-items: center;
	justify-content: space-around;
	margin: auto;
}
li {
	position: relative;
	list-style: none;
	font-family: 'Poppins', sans-serif;
	color: #a0a0a0;
	font-size: 18px;
	letter-spacing: 0.5px;
	padding: 0 10px;
}

li::after {
	content: '';
	position: absolute;
	background-color: #ff3c78;
	height: 3px;
	width: 0;
	left: 0;
	bottom: -8px;
	transition: all 0.5s ease;
}

li:hover {
	color: #fff;
}
li:hover::after {
	width: 100%;
}
```
***
🛴 Follow me on:
YouTube:        https://bit.ly/3oBQbc0
Facebook:       https://bit.ly/3cp2S5W
Instagram{New}: https://bit.ly/3Ihh2EB
Get all separate digits of a number (TypeScript)
Tags: typescript, numbers, math
Published: 2022-07-06 12:53:09

Do you need to "extract" each digit of a given number? Then this little TypeScript program is probably exactly what you're looking for. I have inserted some important comments about the "safe" input range, so make sure you are aware of it before using it in critical segments. There are many different solutions, this one avoids converting the number to a String internally, so it's a pure mathematical algorithm. (Note: I have updated the code to work correctly if given number is `0`.)

```ts
/**
 * @param num A number in the int32 range [-2147483648 .. 2147483647]
 * @returns A number[] containing each digit of `num`.
 * If negative `num` given, resulting array will contain negatives numbers.
 */
function separateDigits(num: number): number[] {
  let arr: number[] = [];
  let lastDigit: number;

  num = toInt32(num);

  do {
    lastDigit = num % 10;
    arr.push(lastDigit);
    // Updating num to num/10 cuts off the last digit:
    num = toInt32(num / 10);
  }
  while (num !== 0);

  return arr.reverse();
}

/**
* Fast bitwise operation, truncates floating point number resulting in int32.
* The >> bitwise operator is used, an overflow occurs if number too large.
* A *safe* integer division in JavaScript would be Math.floor(x/y);
* @param f A (JavaScript) number between [-2147483648.999 .. 2147483647.999]
* @returns Input 'f' truncated to Int32.
*/
function toInt32(f: number): number {
  // Note that type "number" in JS is always "float" internally.
  return f >> 0;
}

console.log(separateDigits(3142520));

// Output:
// [3, 4, 1, 2, 5, 2, 0]
```
randomUUID in TypeScript
Tags: typescript, hash, uuid, encryption
Published: 2022-07-06 12:49:55

## How to add missing support

As of today (May 2022) TypeScript type definition files lack Crypto API's randomUUID method.

I came up with this short solution which doesn't require modifying the typedef files. It is a simple workaround which exports the randomUUID method as generateUUID, and also checks browser support (returns an empty string if not supported in your browser). Maybe it will be of some use to others until TS gets updated.

More about randomUUID on MDN [here](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID). Overview of browser support [here](https://caniuse.com/mdn-api_crypto_randomuuid)

```ts
export {generateUUID};

interface CryptoNew extends Crypto {
  randomUUID?() : string;
}

/**
 * Returns an empty string if Crypto API or randomUUID is not supported by browser.
 */
function generateUUID() : string {
  let cryptoRef: CryptoNew;
  let r: string | undefined = "";

  if (typeof self.crypto !== "undefined") {
    cryptoRef = self.crypto;
    r = cryptoRef.randomUUID?.();
  }

  return r ? r : "";
}
```
Cardano’s Most Crucial Upgrade for 2022, Vasil, Goes Live In Testnet
Tags: cardano, blockchain, testnet, web3
Published: 2022-07-06 12:40:01

Cardano (ADA) has successfully activated a testnet hardfork in preparation for the upcoming Vasil upgrade.

As hotly anticipated Vasil is live in testnet, Input-Output Global claims it would take roughly four weeks for it to be implemented on the mainnet.

**Cardano Launches Vasil on Testnet: Why is This Crucial?**

Cardano (ADA), a largest network running on the [Proof-of-Stake ](https://getblock.io/blog/what-is-a-blockchain-consensus-algorithm-and-how-does-it-work/)consensus, has activated its major Vasil upgrade in testnet.

Vasil is to maximize scalability on Cardano by increasing throughput, speed, and efficiency for [decentralized applications](https://getblock.io/blog/what-is-a-dapp-everything-you-need-to-know-about-dapps/). What’s more, users can expect lower fees and interoperability with other blockchains.

Cardano’s Vasil upgrade is a major part of the Basho era, which comes as stage four among five big upgrades awaiting the Cardano network. In Cardano, Byron (phase 1) was mainly responsible to provide a robust foundation to the network; Shelley (phase 2) focused on decentralization; Goguen (phase 3) implemented smart contract functionality; whereas Basho (the current phase 4) is set to guarantee maximum scalability.

As stated by IOG, the community has to be “comfortable and ready” before the new upgrade goes live on the mainnet. Underpinned by token ADA, Cardano nodes ecosystem is going to on-bord next generation of [dApps](https://getblock.io/blog/what-is-a-dapp-everything-you-need-to-know-about-dapps/).

**How Cardano (ADA) Price Reacts
**
After the announcement of the testnet hardfork completion was made, [Cardano (ADA) ](https://getblock.io/nodes/ada/)gained only a little momentum. The price growth was up 0.1% over the period of 24 hours. Transaction volume also dropped by 68%, plummeting from $847.13 million to $150.64 million. Furthermore, whale transactions showed an 82% decrease due to the same reasoning.

Despite a rather underwhelming reaction to the Vasil testnet hardfork, Cardano (ADA) upgrade remains one of the most anticipated in the last few months.

**What are GetBlock’s Blockchain Nodes for Cardano?
**
GetBlock is a top-notch [blockchain nodes ](https://getblock.io/blog/what-are-blockchain-nodes-and-why-are-they-crucial-for-crypto/)provider for 40+ networks. GetBlock facilitates the latest blockchain technology for its clients by offering shared and dedicated blockchain nodes as a service.

Via [Cardano shared nodes ](https://getblock.io/nodes/ada/)provided by GetBlock, users gain access to the peer-shared nodes infrastructure and can experiment with the unexplored smart contracts, driven by ADA API for the on-chain applications.

[Cardano dedicated nodes](https://getblock.io/dedicated-nodes/ada/), another service by GetBlock, are the perfect solution for Web3 developers looking for privately designed blockchain node infrastructure. GetBlock clients can access Cardano network via API keys designed to establish a reliable and convenient connection.
My Mobile Development Journey(React Native)
Tags: solidity, evm, blockchain, web3
Published: 2022-07-06 12:39:42

My Name is Enoch Daniel, I am a Smart Contract engineer,Full-stack/MERN developer. So after a few years of web app development I finally would be starting Mobile App development with React Native, Kinda Started first with some few research on what framework is best to start native mobile app development and I finally Settle with react Native Basically because I would be Integrating some web3 since integrating web3 features in flutter or swift is not really easy has with Javascript or React Native.
  Also since I have strong background in Javascript and ReactJs then it would be nice for further into react Native for mobile app development.
 I am new to writing blog and articles as a developer so i would try to keep you guys posted on my journey to mastery in becoming a React Native Mobile App developer.
  So i came up with some basic  ideas like a P2E (play to earn),Food Recipes, Todo List and a Web3 Token Saver for my first set of apps but I would Like to start with what project we would be building the youtube videos I would be watching.
   So today I learnt How install Expo Cli and what are the differences between reactJS and React native, Also learnt the different Between Expo cli and The React Native Terminal.
     It Turns out that for those of that do not have the patient to wait for Android studio (For Linux and Windows Users) and X code (For Apple Users) to download, expo-cli would be our fastest option to getting started with app development. No Bugs at installation so far and I hope i do get Bugged out of it by the end of the month. Would keep you Guys Posted.
 Thanks for Reading.
btrfsのRAID構成をオンラインで変更する
Tags: btrfs
Published: 2022-07-06 12:23:05

今まで btrfs の RAID 5 で3台の HDD を束ねて使っていましたが、容量の不足もあったので3台の HDD を追加し RAID 6 運用に変更した際の忘備録。これがオンラインで出来るのはありがたいです。

もとの状態
```
konota@storage:/data$ sudo btrfs filesystem show
Label: none  uuid: 71cdbe11-5102-448d-9aac-2dda635edf30
        Total devices 1 FS bytes used 8.57GiB
        devid    1 size 58.09GiB used 11.06GiB path /dev/mapper/ubuntu--vg-ubuntu--lv

Label: '/data'  uuid: 27c4fe5d-89ec-4edd-853b-82a13ce4febe
        Total devices 3 FS bytes used 3.01TiB
        devid    1 size 2.73TiB used 1.54TiB path /dev/sde
        devid    2 size 2.73TiB used 1.54TiB path /dev/sdd
        devid    3 size 2.73TiB used 1.54TiB path /dev/sdf
```
新しいHDDを追加して、balance実行時にオプションでdataとmetadataを変換します。追加前に mkfs.btrfs でフォーマットを忘れずに。本来なら直前にbtrfs filesystem show コマンド等で追加状況を確認したほうがいいです。
```
konota@storage:~$ sudo btrfs device add /dev/sda /data
konota@storage:~$ sudo btrfs device add /dev/sdb /data
konota@storage:~$ sudo btrfs device add /dev/sdc /data
konota@storage:~$ sudo btrfs balance start -dconvert=raid6 -mconvert=raid6 /data
WARNING:

        RAID5/6 support has known problems and is strongly discouraged
        to be used besides testing or evaluation. It is recommended that
        you use one of the other RAID profiles.
        The operation will continue in 10 seconds.
        Use Ctrl-C to stop.
10 9 8 7 6 5 4 3 2 1
```
balance処理中は追加されたdeviceのusedが増加するのがわかります。
```
konota@storage:~$ sudo btrfs filesystem  show
[sudo] password for konota:
Label: none  uuid: 71cdbe11-5102-448d-9aac-2dda635edf30
        Total devices 1 FS bytes used 8.57GiB
        devid    1 size 58.09GiB used 11.06GiB path /dev/mapper/ubuntu--vg-ubuntu--lv

Label: '/data'  uuid: 27c4fe5d-89ec-4edd-853b-82a13ce4febe
        Total devices 6 FS bytes used 3.01TiB
        devid    1 size 2.73TiB used 1.54TiB path /dev/sde
        devid    2 size 2.73TiB used 1.54TiB path /dev/sdd
        devid    3 size 2.73TiB used 1.54TiB path /dev/sdf
        devid    4 size 2.73TiB used 17.27GiB path /dev/sda
        devid    5 size 2.73TiB used 17.27GiB path /dev/sdb
        devid    6 size 2.73TiB used 17.27GiB path /dev/sdc
```
balance処理中、Celeron G6900ですがtopはこのような状態です。この量の変換で一晩ほどかかりそうです。(現在進行系)
![balance中の様子](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7njwuyqlktsktgidlcal.png)

---
その後無事に変換が完了していることを確認しました。今回の場合、3台追加してRAID6にしたので各デバイスごとのusedは減少しました。
Polkadot (DOT) Announces Upgraded Blockchain Governance
Tags: polkadot, blockchain, web3
Published: 2022-07-06 12:32:45

Here’s how Polkadot’s blockchain governance system upgrade will affect the network and what that means for GetBlock clients.

During the annual Polkadot Decoded gathering, Polkadot’s founder Gavin Wood announced an upgrade of the blockchain governance system to the Gov2 version.

**Introducing Polkadot’s Gov2, an upgraded governance design for Polkadot nodes**

[Polkadot is a decentralized blockchain ](https://getblock.io/nodes/dot/)consisting of several parallel proof-of-stake chains, also known as parachains. Polkadot (DOT) nodes are leveraged by numerous dApps of all types.

The Polkadot network’s decision-making process is set to increase its capability to process a greater number of voting proposals and boost inclusivity and decentralization. Prior to being activated on Polkadot (DOT) nodes, the upgrade will initially be tested on Kusama - Polkadot’s highly scalable canary network.

Among some of the new updates are the ability to make simultaneous governance decisions and start referendums, the removal of the voting hierarchy, and the introduction of the Polkadot Fellowship organization.

**Polkadot adopts Fellowship and Origins, novel ecosystem instruments
**
The Polkadot Fellowship will replace the current Polkadot’s Technical Committee. Following the Polkadot founder’s statement, becoming a member of the Fellowship will be “as easy as placing a small deposit”.

Besides being well-informed, participants of the new self-governing and fully transparent body will work towards staying in line with Polkadot’s vision before coming out with the final decision.

Under the new upgrade, independent proposals will be known as “Origins”, the name highlighting the significance of community participation in the network’s maintenance. Moreover, each proposal is assigned a “track” in order to stay updated on the progress of the proposal.

Members of the Polkadot Fellowship responsible for the proposal are able to choose which Origin they would like to execute their proposal with, therefore, determining the track that particular proposal is set to go with and the way the proposal referendum is to be carried out.

**How Can GetBlock Help Developers on Polkadot**

Polkadot is a robust blockchain and a popular choice among Web3 developers. Via GetBlock, developers and entrepreneurs can get fast and reliable access to Polkadot’s ecosystem by implementing GetBlock’s shared and dedicated blockchain nodes into their decentralized projects. With the help of GetBlock’s cost-efficient API-driven infrastructure, clients can experiment with their businesses under realistic economic conditions.

Polkadot (DOT) shared nodes are the perfect first-entry solution for beginners offering peer-shared architecture; whereas [Polkadot dedicated nodes ](https://getblock.io/dedicated-nodes/dot/)are privately designed solutions with an unlimited number of requests.
Apache Kafka Simply Explained
Tags: apachekafka, data, streaming, beginners
Published: 2022-07-06 12:22:37

Apache Kafka is a de facto standard for data streaming. There is a lot of interest and usage of Apache Kafka, but the learning curve can be steep. So here is my attempt to explain it using simple and friendly vocabulary:

https://aiven.io/blog/kafka-simply-explained

The article covers the following topics:

- What is Apache Kafka?
- Where Apache Kafka is used
- Apache Kafka’s way of thinking
- How Apache Kafka coordinates events
- Topics and messages
- Brokers and partitions
- Apache Kafka connectors

Hoping that you’ll find it useful!
Svelte dialogs - the easy way
Tags: svelte, dialog, html
Published: 2022-07-06 12:11:27

The simplest way to create a reusable dialog component using native [HTML5 dialogs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement) in svelte!

1) Create Dialog.svelte component:

```html
<script>
	export let dialog
</script>
<dialog bind:this={dialog} on:close>
	<slot/>
</dialog>
```
Here we export the ref to the native dialog which allows access to its methods by binding to `dialog` in the parent (below)

`on:close` simply forwards the native dialog's close event to the parent.

2) Use it in other component:

``` html
<script>
	import Dialog from './Dialog.svelte'
	let dialog
</script>

<button on:click={() => dialog.showModal()}>Open It!</button>

<Dialog bind:dialog on:close={() => console.log('closed')}>
	This is amazingly simple! (press esc to close)
</Dialog>
```

See it working in the [REPL](https://svelte.dev/repl/885653f873284f7880490dcdd1200238?version=3.48.0)!

;)
Memory Management in Java
Tags: java, memorymanagemen
Published: 2022-07-06 12:04:40

**There are primarily two tyes of memories that store primitive variables, objects, referenes of the objects, call to the different methods.**

- Stack memory in java
-
_Whenever we call new method a new block is created on top of the stack that has primitive variables, references to the object related to that method._

_When the method is finished with the execution the space is freed from the stack and is made available._

**If this memory is full java throws `StackOverflow` Error**
For example :  This `stackoverflow` exception you must have seen when your recursive code does not have a proper base case.

- Heap memory in java
-
_This is used for dynamic memory allocation for java objects and JRE classes at runtime._

_New objects are always stored on heap memory (having global access i.e. accessible from anywhere in the program) and its reference is stored on stack memory._ 
**If this memory is full java throws `OutOfMemory` Error.**

_This memory is not automatically freed it requires garbage collector to free up space by deallocating the memory allocated to already created objects._

**For better understandig see the below code and its memory allocation process by JVM**

```java
class Person {
    int id;
    String name;

    public Person(int id, String name) {
        this.id = id;
        this.name = name;
    }
}

public class PersonBuilder {
    private static Person buildPerson(int id, String name) {
        return new Person(id, name);
    }

    public static void main(String[] args) {
        int id = 23;
        String name = "John";
        Person person = null;
        person = buildPerson(id, name);
    }
}
```
<img src = "https://www.baeldung.com/wp-content/uploads/2018/07/java-heap-stack-diagram.png" />

[code and image source ](https://www.baeldung.com/java-stack-heap#:~:text=Heap%20space%20is%20used%20for,from%20anywhere%20in%20the%20application.)
2306. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-06 11:59:38

```
class Solution {
 public:
  long long distinctNames(vector<string>& ideas) {
    long long ans = 0;
    // group strings by initials
    vector<unordered_set<string>> suffixes(26);

    for (const auto& idea : ideas)
      suffixes[idea[0] - 'a'].insert(idea.substr(1));

    for (int i = 0; i < 25; ++i)
      for (int j = i + 1; j < 26; ++j) {
        int count = 0;
        for (const auto& suffix : suffixes[i])
          if (suffixes[j].count(suffix))
            ++count;
        ans += 2 * (suffixes[i].size() - count) * (suffixes[j].size() - count);
      }

    return ans;
  }
};

```

#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/naming-a-company/
2302. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-06 11:58:13

```
class Solution {
 public:
  long long countSubarrays(vector<int>& nums, long long k) {
    long long ans = 0;
    long long sum = 0;

    for (int l = 0, r = 0; r < nums.size(); ++r) {
      sum += nums[r];
      while (sum * (r - l + 1) >= k)
        sum -= nums[l++];
      ans += r - l + 1;
    }

    return ans;
  }
};

```

#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/count-subarrays-with-score-less-than-k/submissions/
Tip for those who are struggling to find some time to code while studying at the university
Tags: writing, university, community, beginners
Published: 2022-07-06 11:55:40

Two years ago, at the very start of my IT career, I was pretty sure that I can handle all my university hassle by myself without any assistance. Well, long story short, I failed.

During my 3 year of bachelors program, I was hired as a junior frontend developer and decided to combine my studying with full-time job. First few months was ok, but as I was continuously moving toward my thesis, writing my assignments became almost impossible task. 

So I started searching for a way out. Surprisingly, I found that awesome article on [Business-review](https://business-review.eu/education/best-essay-writing-services-top-5-websites-to-pay-for-essays-231573), where guys made a detailed guide on essay writing services, which can cover your back when you're too busy on tasks. It's simple and easy to use, and for sure can be used when you're overloaded with tasks on a project. 

It was a game changer for me and I guess it could help some folks who are struggling to do all of their writing assignments on time. Funny thing, since I started using those services, quality of writing my documentations skyrocketed, because I constantly was chatting with a professional writers.

Hope it will help someone. :)
2272. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-06 11:53:22

```
class Solution {
 public:
  int largestVariance(string s) {
    int ans = 0;

    for (char c1 = 'a'; c1 <= 'z'; ++c1)
      for (char c2 = 'a'; c2 <= 'z'; ++c2)
        if (c1 != c2)
          ans = max(ans, kadane(s, c1, c2));

    return ans;
  }

 private:
  // a := the char w/ higher freq
  // b := the char w/ lower freq
  int kadane(const string& s, char a, char b) {
    int ans = 0;
    int countA = 0;
    int countB = 0;
    bool canExtendPrevB = false;

    for (const char c : s) {
      if (c != a && c != b)
        continue;
      if (c == a)
        ++countA;
      else
        ++countB;
      if (countB > 0) {
        // an interval should contain at least one b
        ans = max(ans, countA - countB);
      } else if (countB == 0 && canExtendPrevB) {
        // edge case: consider previous b
        ans = max(ans, countA - 1);
      }
      // reset if # of b > # of a
      if (countB > countA) {
        countA = 0;
        countB = 0;
        canExtendPrevB = true;
      }
    }

    return ans;
  }
};

```

#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/substring-with-largest-variance/submissions/
2267. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-06 11:51:20

```
class Solution {
 public:
  bool hasValidPath(vector<vector<char>>& grid) {
    const int m = grid.size();
    const int n = grid[0].size();
    // dp[i][j][k] := 1 if there's a path from grid[i][j] to grid[m - 1][n - 1]
    // w/ # of '(' - # of ')' == k
    dp.resize(m, vector<vector<int>>(n, vector<int>(m + n, -1)));
    return hasValidPath(grid, 0, 0, 0);
  }

 private:
  vector<vector<vector<int>>> dp;

  int hasValidPath(const vector<vector<char>>& grid, int i, int j, int k) {
    if (i == grid.size() || j == grid[0].size())
      return 0;
    k += grid[i][j] == '(' ? 1 : -1;
    if (k < 0)
      return 0;
    if (i == grid.size() - 1 && j == grid[0].size() - 1)
      return k == 0;
    if (dp[i][j][k] != -1)
      return dp[i][j][k];
    return dp[i][j][k] = hasValidPath(grid, i + 1, j, k) |
                         hasValidPath(grid, i, j + 1, k);
  }
};

```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/check-if-there-is-a-valid-parentheses-string-path/submissions/