teleren/devto huggingface dataset:
82. Remove Duplicates from Sorted List II
Tags: cpp, java, algorithms, 100daysofcode
Published: 2022-03-09 09:36:24

# Description

Given the `head` of a sorted linked list, *delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list*. Return *the linked list **sorted** as well*.

# **Example 1:**

![https://assets.leetcode.com/uploads/2021/01/04/linkedlist1.jpg](https://assets.leetcode.com/uploads/2021/01/04/linkedlist1.jpg)

```
Input: head = [1,2,3,3,4,4,5]
Output: [1,2,5]
```

## Example 2:



```
Input: head = [1,1,1,2,3]
Output: [2,3]
```

## Constraints:

- The number of nodes in the list is in the range `[0, 300]`.
- `100 <= Node.val <= 100`
- The list is guaranteed to be **sorted** in ascending order.

---

# 解题

## 方法一

### 思路

快慢指针，

1. 遇到相同的快指针（curr）不断往后移
2. 慢指针（prev）发现自己后面指的节点不是当初的那个节点（说明有重复节点，需要删除），直接把链接连到快指针后面，如果还是当初连的那个快节点的话，就保留当前节点，再进一步
3. 快指针往后继续移

### 代码

```java
public ListNode deleteDuplicates(ListNode head) {
    ListNode dummy = new ListNode(0);
    ListNode prev = dummy, curr = head;
    prev.next = head;
    while (curr != null) {
        while (curr.next != null && curr.val == curr.next.val) {
            curr = curr.next;
        }
        if (prev.next != curr) {
            prev.next = curr.next;
        } else {
            prev = prev.next;
        }
        curr = curr.next;
    }
    return dummy.next;
}
```

---

```cpp
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode() : val(0), next(nullptr) {}
 *     ListNode(int x) : val(x), next(nullptr) {}
 *     ListNode(int x, ListNode *next) : val(x), next(next) {}
 * };
 */
class Solution {
    public:
    ListNode *deleteDuplicates(ListNode *head) {
        ListNode *dummy = new ListNode(-1);
        dummy->next = head;
        ListNode *prev = dummy;
        while (prev->next) {
            ListNode *curr = prev->next->next;
            while (curr && prev->next->val == curr->val) {
                curr = curr->next;
            }
            if (prev->next->next == curr) {
                prev = prev->next;
            } else {
                prev->next = curr;
            }
        }
        return dummy->next;
    }
};
```

### 复杂度分析

- 时间复杂度: O(n)
- 空间复杂度: O(1)
Learning to swim again.
Tags: beginners, programming, webdev
Published: 2022-03-09 09:29:05

_“Choose a safe spot where your feet can touch the sand and move as I showed you”_, said my father to six-year-old me when we first went to the beach. It was just around 5:30 AM, and my father had already done a couple of warm-up laps along the shoreline. It took me a while to shake myself awake and trod down the gently sloped dune, shivering with each step as I waded into the chilly emerald water. Before my mind could conjure up more unpleasant thoughts, I quickly dunked my head under the water and started paddling with my feet and arms while my father remained nearby to offer assistance and words of encouragement. After a month of daily practice, my disliking of sea swimming gradually disappeared while I enjoyed every second at [the beach](https://vinpearl.com/vi/kinh-nghiem-du-lich-bai-bien-bac-my-an-thien-duong-bien-da-nang).

![0500AM in the tropical summer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72znqkuxyw61636q842v.jpg)

Earlier this year, I have pushed aside any notion of hesitation to take the plunge into a career in professional Web Development. I have spent a considerable amount of time online for both work and entertainment without fully understanding the inner working of websites and databases. I often marveled at the websites and applications which were so well-designed to make my life easier. Over time, I became more curious about how to build such products. I chose the boot camp route because it is well-suited for my propensity to learn through hands-on approaches.

From my perspective, the learning curve is not much different from learning to swim. Boot camp projects are the “safe spots” where my “feet can touch the sand”. I can code in a constructive environment with supportive teachers (and classmates) never seem out of reach. There is still the occasional fleeting moment of panic when something didn’t work the way it’s supposed to or when my mind goes blank in the face of a complex problem.

Daily practicing can make all the difference. I learn to enjoy the workflow, I am in tune with the software development culture, I appreciate the prospect of working from home, and most of all, I am glad to be in a career with so much room for innovation. As someone who loves to solve practical problems and building things, I am slowly building my skills and filling my GitHub repositories with cool/ quirky projects.

My biggest motivation has always been my family, especially my spouse who sacrifices three months of her time to take care of our children so I can fully immerse myself in the accelerated learning path. She understands my love for technical problems and technology. Without her help, I could not have pursued a career in Web Development and explored my interests in Web3.

This is the first online blog that I have ever written as someone who often prefers to think and build. I am glad if anyone finds it helpful.
Web2 vs Web3
Tags: web2, web3
Published: 2022-03-09 08:57:33

The Web is very common nowadays but it was not always like that in the early days, the web was invented by Tim Berners-Lee, a British scientist in 1989, the rest is history now.

The Web is fully known as the World Wide Web, it is a major part of the internet, which contains pages and information that can be accessed by a web browser.

It is easier for us to confuse the web for the internet, but the internet is a global network of servers. Servers are where pages and information are hosted, so they make it possible for us to share information.

Although, the focus of this article is on the comparison between Web2 and Web3. It makes sense for us to look into  Web 1.0 as well.

**Web 1.0**

This is the first stage of the Web evolution, it is widely known for displaying static pages. The contents are served from the server's file system. Elements are positioned using tables and frames. The web was mostly used by researchers and people who want to display information.

**Web 2.0**

This is the second stage of the Web evolution, although no point signified the end of web 1 and beginning of web 2, so web 2 was built on web1. It is the web for the creators. There is a lot of emphasis on user experience, user content creation. Social media, blogging, vlogging are mainstream. It is the participatory social web.

**Web 3.0**

This is the permissionless web. It is the new phase of the web, anyone on the network can use the service without interference. It also has an inbuilt payment system.  Web3 applications run on blockchains, these applications are often referred to as decentralized applications(dapps).

Some of the characteristics of Web3 are that, it is verifiable, trustless, self-governing, permissionless, distributed, stateful, and others.

**Differences between Web2 and Web3**

Applications owners can censor any account on Web2, this would not be possible on a fully decentralized Web3 application.

Payment services like PayPal have placed restrictions on some countries making it impossible to use their services, this would not be possible on a fully decentralized Web3 payment service.

Application on Web2 can go down any time, we have seen it happen with Facebook and other big social application, web3 applications run on multiple nodes and they cannot all be down at the same time, which means the web3 application will always be accessible.

**Conclusion**

In conclusion, Web2 is still a part of Web3, just like web2 is a part of web1, it is a continuum. Most web3 application frontends are still hosted on decentralized platforms, so web2 is not going anywhere.

I am part of a block games internship aimed at teaching people how to develop a decentralized application, which is sponsored by Block games (https://blockgames.gg/), Nestcoin (https://nestcoin.com/), and the Zuriteam (https://zuri.team/).

Thank you for reading

See You Next Time.
To draw a square in CSS linear gradient think of triangles
Tags: css, tips, webdev
Published: 2022-03-09 08:45:55

The easiest way to draw a pattern in CSS for linear-gradient that produces squares, is to think of triangles. A linear gradient that starts in a corner and stops at a certain percentage is doable. But a linear vertical or horizontal gradient cannot be controlled in both directions, only one. So visually, if I want to create this pattern:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9scnciey97s1kyywad13.png)

Modeling looks like this, the circle radials are easy to produce, but the squares are tougher.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ve1gcnnpwjvx1ngkwj6c.png)
 
So triangles (I choose this because it's the simplest but the options are unlimited)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwyg7dhf00n06jneek8q.png)

And the result is in CodePen

 {% embed https://codepen.io/ayyashayyash/pen/rNYgOzm %}
Understanding Kubernetes: part 45 – Startup probe
Tags: kubernetes, devops, docker, beginners
Published: 2022-03-09 08:43:37

---
title: Understanding Kubernetes: part 45 – Startup probe
published: true
description: Serie of sketchnotes about Kubernetes. Explaining in a visual way Kubernetes principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Kubernetes in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8nmzom3ofxv5maytxzor.jpg
---

Understanding Kubernetes can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Kubernetes. I think it could be a good way, more visual, to explain Kubernetes (and others technologies).

We continue the serie of Sketchnotes about Kubernetes, with a focus on startup probes.

![Kubernetes startup probe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8nmzom3ofxv5maytxzor.jpg)
![Kubernetes startup probe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/svjv2ue3z83vd4390txd.jpg)

If you are interested, I published all the sketchnotes on Kubernetes (and new ones!) to make a "book" of 173 pages: ["Understanding Kubernetes in a visual way"](https://gumroad.com/aurelievache#uCxcr).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
Developers will not lose their jobs… but everyone will become a developer
Tags: lowcode, nocode, flutter, productivity
Published: 2022-03-09 08:41:16

In the technological revolution of the last decades, software has increasingly become one of the most important pillars in businesses.

In this world where “time = money”, many people and businesses do not have the resources or the time to develop platforms or applications in the traditional way, for which no code and low code alternatives have arisen.

These trends do not mean that developers will no longer be needed, it rather means almost everyone will become a developer.

Our roles as traditional developers will continue to be critical and even though we are beginning to be substituted when creating non-complex solutions, our relevance will not be altered so easily.

These platforms will facilitate our jobs, given that we will not have to develop basic functionalities from scratch, therefore enabling us to focus on the most complex tasks.

Shameless spam: Trying to leverage this trend, I am building a low code solution that converts UI design into Flutter widgets. I, for instance, was tired of coding endless design iterations. My tool is https://codis.io/ in case you want to have a look.
Full Laravel Spatie Permission Tutorial | Laravel 9 tutorial
Tags: tutorial, beginners, laravel, php
Published: 2022-03-09 08:37:06

{% embed https://www.youtube.com/watch?v=cNrMdCXNml8 %}

Hello, friends in this video we are going to make a full admin panel with Laravel permission package from Spatie.
Full Laravel admin panel.
Hello Friends, in this video we are going to assign roles and permissions to users.

Laravel Admin Panel.
Laravel Tutorial.
Laravel 9 Tutorial.
Spatie role and permission.
Laravel permission.
Github Repo: https://github.com/laraveller/laravel...

Support me: 
https://www.patreon.com/Laraveller
https://paypal.me/TonyXhepa

Follow me:
Twitter: https://twitter.com/Laravellercom
Facebook Page: https://www.facebook.com/1laravellercom
Instagram: https://www.instagram.com/laravellercom/
Github: https://github.com/laraveller
Website: https://laraveller.com/

Playlists:
Laravel Testing For Beginners: https://bit.ly/3t1gNq4
Laravel Roles and Permissions: https://bit.ly/3gOhM7d
LARAVEL INERTIA MOVIE APP: https://bit.ly/3FVMp4Q
Laravel Livewire Movie App: https://bit.ly/3s8D6v1
Laravel Classified Website - https://bit.ly/3nsFRnb
Livewire Employees - https://bit.ly/2ZtIpZY
Laravel Employees Management - https://bit.ly/3Gglt14
Laravel admin panel - https://bit.ly/3CcX75M
What Makes a Complete Software Tester?
Tags: softwaretesting, softwaretester, qa, automationtesting
Published: 2022-03-10 02:42:36

---
title: What Makes a Complete Software Tester?
published: true
date: 2022-03-09 08:27:13 UTC
tags: softwaretesting,softwaretester,qa,automationtesting
canonical_url: https://www.katalon.com/resources-center/blog/become-software-tester/
---

![Become a complete software tester](https://d1h3p5fzmizjvp.cloudfront.net/wp-content/uploads/2022/03/BlogsBanner.png)

Katalon’s Head of Solution Engineering Gokul Sridharan and Armando Wirshing, Director of Product Marketing, recently sat down for a conversation with Kristin Jackvony, author of “The Complete Software Tester,” to discuss her thoughts on automated testing and QA, her personal journey in the world of testing, and what drove her to write her new book. We hope you’ll enjoy this inspiring dialogue with a member of the QA community where we discuss a variety of topics such as:

- [Moving from manual to automated testing](https://www.katalon.com/resources-center/blog/from-manual-to-automation-testing/) without extensive Google searches
- Growing a QA team and making testing a shared responsibility
- Test automation as the next step to boost teams’ testing maturity
- Self-healing and AI technologies 

As you watch the interview, you may find yourself thinking, “That’s great, but how in the world do I accomplish that?” Katalon invites you to reach out and ask us. 

At Katalon, we believe that QA can be easier. We built a quality automation platform for QA teams that allows anyone to easily create automated tests, smoothly collaborate across teams on testing processes, and rapidly scale testing capacity on an open, integrated platform.

Contact us today to discuss how Katalon can help you and your team become complete software testers.

You can watch the video <a href="https://youtu.be/sYXNTFRekWk" target="_blank">HERE.</a> 



The post [What Makes a Complete Software Tester?](https://www.katalon.com/resources-center/blog/become-software-tester/) appeared first on [Katalon Solution](https://www.katalon.com).
Install Kubernetes 1 master (self-hosted kubernetes)
Published: 2022-02-21 07:59:19

Ubuntu 18.04  &&&  K8s 1.22.6   &&& Docker 19.03


จะได้ K8s v1.20.14


```bash
# the following commands for both Master & Workers

{
sudo cat /sys/class/dmi/id/product_uuid
sudo ufw disable
sudo swapoff -a
sudo sed -i '/swap/d' /etc/fstab
}




{
sudo modprobe br_netfilter
lsmod | grep br_netfilter
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
}

{
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sudo sysctl --system
}







sudo kubeadm reset

sudo apt-get remove docker-ce docker-ce-cli containerd.io -y
sudo apt-get remove --purge docker-ce docker-ce-cli containerd.io -y

{
sudo apt-get update -y
sudo apt-get install ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update -y
sudo apt-get install docker-ce=5:19.03.15~3-0~ubuntu-bionic docker-ce-cli=5:19.03.15~3-0~ubuntu-bionic containerd.io -y
# sudo apt-get install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker $USER
newgrp docker
docker ps
}



{
sudo mkdir /etc/docker
cat <<EOF | sudo tee /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF
sudo systemctl enable docker
sudo systemctl daemon-reload
sudo systemctl restart docker
docker info | grep Cgroup
}



{
sudo apt-get update -y
sudo apt-get install -y apt-transport-https ca-certificates curl
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update -y
# sudo apt-get install -y kubeadm=1.19.16-00 kubelet=1.19.16-00 kubectl=1.19.16-00
sudo apt-get install -y kubeadm=1.22.7-00 kubelet=1.22.7-00 kubectl=1.22.7-00
sudo apt-mark hold kubelet kubeadm kubectl
}



# the following commands for only One Master

sudo kubeadm init --pod-network-cidr=192.168.0.0/16

# Then, copy the command from the result of the Master node to the Worker nodes. 

kubectl create -f https://docs.projectcalico.org/archive/v3.20/manifests/tigera-operator.yaml
kubectl create -f https://docs.projectcalico.org/archive/v3.20/manifests/custom-resources.yaml

watch kubectl get pods -n calico-system
kubectl get nodes -o wide




mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config


```
AWS Insiders Podcast: An Inside Look at The Planet-Scale Architecture of DynamoDB with Alex DeBrie (Part 2)
Tags: aws, dynamodb, cloudfix, podcast
Published: 2022-03-09 08:23:41

## Podcast
* [Episode URL](https://aws-insiders.simplecast.com/episodes/an-inside-look-at-the-planet-scale-architecture-of-dynamodb-with-alex-debrie-author-of-the-dynamodb-bookpart-two)
* Subscribe on [Apple Podcasts](https://podcasts.apple.com/us/podcast/aws-insiders/id1608453414), 
 [Spotify](https://open.spotify.com/show/0sH9zDLABk6FoLM0cpZHu1) or [RSS] (https://feeds.simplecast.com/4vl2TtzP)

## EPISODE NOTES
On this episode, Alex dives deep into the intricacies of Amazon DynamoDB, a Planet-Scale NoSQL database service that supports key-value and document data structures. Alex is the author of "The DynamoDB Book," a comprehensive guide to data modeling with DynamoDB. He also has been recognized as an AWS Data Hero. Alex discusses the consistency and predictability in the design of DynamoDB’s performance, and how to best utilize it.  

> “I think the most important thing to know about Dynamo, it has that primary key structure that we talked about, but every single item is going to have what's called a partition key, and what this partition key is doing is basically helping decide to which shard or node, a particular item is going to go to. So when a request comes into DynamoDB, the first thing that's going to hit is just this global request router that's deployed across the entire region. It handles all the tables within a particular region, and it gets that item, it pulls up the metadata for that table, it hashes the partition key value that was sent in for a particular item, and then based on that, it knows which node to go to in the fleet.” 
--Alex DeBrie, Principal at DeBrie Advisory and Author of “The DynamoDB Book.”

## Time Stamps
* (01:50) DynamoDB scale cases
* (05:49) The architecture of DynamoDB that allows it to theoretically scale
* (09:37) The top three tips for DynamoDB customers
* (11:51) The value of doing the math for your application
* (13:14) What mistakes to avoid to keep your costs low
* (16:28) Examples of managing costs with DynamoDB  
 
## Sponsor
This podcast is presented by [Cloudfix](https://cloudfix.com/). CloudFix automates easy, no risk AWS cost savings. So your team can focus on changing the world.
Can't open the mysql.plugin table. please run mysql_upgrade to create it.
Tags: sql
Published: 2022-03-09 08:12:54

I am having following issues:

extra alignment tab has been changed to \cr. <recently read> \endtemplate

Reasons for this issue:

There might be not correct number of column in table:

When we are using alignment characters (&), such as table, align or matrix, we have to confirm that the number of columns specified in the environment matches the number of alignment characters (&) we use before a line break. 

 

Examples:

\begin{tabular}{c|c|c}
   1 & 2 & 3 & 4 \\
   5 & 6 & 7
\end{tabular}
We get error message like:

Extra alignment tab has been changed to \cr.


<recently read> \endtemplate 
                             
l.7    1 & 2 & 3 &
                   4 \\
You have given more \span or & marks than there were
in the preamble to the \halign or \valign now in progress.
So I'll assume that you meant to type \cr instead.
Resolution:
Use following to remove extra column entry:

\begin{tabular}{c|c|c}
   1 & 2 & 3 \\
   5 & 6 & 7
\end{tabular}
Create NuxtJs Project with Typescript and Classes
Tags: vue, nuxt, beginners, typescript
Published: 2022-03-09 08:10:08

If you ever wanted to create a new nuxt(vue) project from scratch this might help you to add the basic setups needed for it.

## Initiate a nuxt project with npm & TypeScript

```
npm init nuxt-app <project-name>
```
You will get an option to select the language you can select **TypeScript**.

![Select the below options if needed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xp6gpku1qy8w10od0ykb.png)
 

## Change the directory and install some dependencies to use Class based components 

- Install the property decorator 
[Nuxt Property Decorator](https://www.npmjs.com/package/nuxt-property-decorator)
```
npm i nuxt-property-decorator
```

- Installing sass (Optional) [SASS](https://sass-lang.com/)
```
npm i sass-loader sass webpack --save-dev
```


Now you are good to go use the components and everything like a class. 


If you like the post follow me for more
{% user rahulrajrd%}
Today's Fun Joke For Developers - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2022-03-09 08:00:10

---
title: "Today's Fun Joke For Developers - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258ed882b0.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ What did JavaScript call his son?

___A:___ JSON!
 -->