teleren/devto huggingface dataset:
【Redis Week】 - 7 Days Best Practice With Alibaba Cloud ApsaraDB - Day06
Published: 2021-04-25 09:27:33

### Day 6 - How To Use Tair-CPC In Real-time Risk Control Stream Computing
[Watch Now (25 mins)>](https://www.youtube.com/watch?v=2QRdIDLO2hQ)

> This video is in Chinese, and it's free. The contents are suitable for all developers, DBAs and database enthusiasm. For English speakers, we recommended to click the playlist in the end of the video or you can click the link below to start learning directly.
[Best Practice of Redis (EN)>](https://www.youtube.com/playlist?list=PL54EFTJJZrwgfve8XuYSKTnIfve08WmfN)


### Main Contents

1. What is real-time risk control?
2. The history of the risk control system architecture
Traditional risk control architecture, stand-alone architecture, streaming computing architecture
3. Streaming computing solution with ApsaraDB for Redis (Tair) on Alibaba Cloud
Typical challenges of risk control, what is TairCPC and how it can be used in a streaming computing
Premium Tools for Developers (Free Deals)
Tags: beginners, webdev, programming, productivity
Published: 2021-04-25 08:33:54

Hi,

I am back with the new update on GoOnlineTools :)

Today I collected some of the best tools which I use in GoOnlineTools.

You can check all tools on [GoOnlineTools Deals](https://goonlinetools.com/deals/) page.

![GoOnlineTools Deals](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ukrcyx5zohaz1c0srhsn.jpg)

If you want any tool then click on the grab deal button to get an offer on that tool.

I hope this is helpful :)
LeetCode 377. Combination Sum IV (javascript solution)

Tags: algorithms, javascript
Published: 2021-04-25 07:22:21

###Description:
Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.

The answer is guaranteed to fit in a 32-bit integer.

###Solution:
Time Complexity : O(n^2)
Space Complexity: O(n)

```javascript
var combinationSum4 = function(nums, target) {
    // Create dp array
    const dp = Array(target+1).fill(0)
    // Set default
    dp[0] = 1
    // Loop until we hit target
    for(let i = 0; i <= target;i++) {
        // Loop through all possible nums
        for(let j = 0; j < nums.length; j++) {
            // If the sum of the current position in dp and the current num is less than target, increment the index at the sum in dp array by all the ways to make dp[i]
            if(nums[j]+i <= target) dp[nums[j]+i] += dp[i]
        }
    }
    return dp[target]
};
```
Fakta mengenai Laku6.com
Tags: application, marketplace, onlineshop, mobile
Published: 2021-04-25 07:20:29

Laku6.com merupakan salah satu situs jual beli hp atau tukar tambah hp yang bekerja sama dengan tokopedia.


Namun saat membuat akun laku6 di desktop atau laptop bisa dikatakan tidak pernah berhasil.

Karena saat kita mengecek email untuk mengkonfirmasi akun yang dibuat, tertulis ‘Silakan verfikasi akun Anda dengan dengan memasukkan kode OTP (One Time Password) yang kami kirim ke nomor hp Anda.’

Sedangkan saat kembali ke situs laku6 tidak ada kolom untuk menginput kode OTP tersebut.

___

Berbeda dengan sign up akun di aplikasi laku6 yang diinstal lewat playstore, semuanya mudah tanpa kendala. Walaupun jika dilihat dari hasil reviewnya hanya mempunyai rating 3.3 dari 506 ulasan.

Mengapa?! Salah satunya adalah saat kita mengisi formulir pendaftaran.

Di aplikasi ini mewajibkan kita untuk mengisi data berupa nama toko, foto KTP, foto selfie dengan KTP, serta informasi akun bank yang kita gunakan seperti nama bank, nama akun bank hingga nomor rekening.


![Formulir pendaftaran pada aplikasi Laku6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5cvsmur060wkygjrq14t.jpeg) Formulir pendaftaran pada aplikasi Laku6

____

Hal yang tidak biasa dalam suatu marketplace untuk mengisi formulir pendaftaran seperti ini sebagai pembeli, hingga banyak mendatangkan kritikan dari calon pengguna.

Bagaimana dengan kamu? Setuju dengan kebijakan laku6 dalam hal ini?

___

Selain itu alamat email CS laku6 menggunakan gmail.com
Hal yang tidak biasa untuk alamat email customer service suatu perusahan atau suatu situs besar.

![CS LAKU6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rjo0uijll4ltzjs3udua.jpeg)

___

Hal lain adalah tidak tertulisnya minus produk handphone yang di lelang dalam bidding proses, sehingga barang yang tidak sesuai dengan spek harus kita retur dalam waktu yang sudah di tentukan.

Namun dari banyak pengguna, banyak kok yang puas membeli hp di laku6, asal kita harus pelajari dahulu mekanisme yang berlaku di aplikasi.

Happy shopping:)

____

Artikel terkait dengan [Laku6](https://irrin.web.id/cara-tukar-tambah-hp-online/)

by [Myblog](https://irrin.web.id/)
LeetCode 70. Climbing Stairs
(javascript solution)
Tags: algorithms, javascript
Published: 2021-04-25 06:54:17

###Description:
You are climbing a staircase. It takes n steps to reach the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
var uniquePathsWithObstacles = function(obstacleGrid) {
    const m = obstacleGrid.length;
    const n = obstacleGrid[0].length
    // Create dp array
    const dp = Array(m + 1).fill(0).map(() => Array(n + 1).fill(0));
    dp[0][1] = 1
    
    for(let i = 1; i < m+1; i++) {
        for(let j = 1; j < n+1; j++){
            // Add value to dp array if the cell we are looking at in the grid is not blocked
            dp[i][j] = obstacleGrid[i-1][j-1]===0 ? dp[i-1][j]+dp[i][j-1] : 0 
        }
    }
    return dp[m][n]
};
```
CSS Tips: Apply/Unapply Rules With CSS Negation Pseduo-Class
Tags: webdev, beginners, css, html
Published: 2021-04-25 06:32:47

Well, this is another part of CSS tips series. Now we will learn how to utilize `:not()` also known as CSS pseduo-class.

## The Power of CSS Negation Pseduo-Class
### Result
Just look at example below, how I use it for navigation links.

{% codepen https://codepen.io/nurofsun/pen/MWJLrEq %}

Let me explain this code below.

```css
.navbar-link {
  color: #0d4ee5;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  padding: 15px 10px;
}
```
So, I have an element with class `.navbar-link` and it has default style as above, having blue color, bold text, and so on.

and How I unapply the default color except for the last element that has class `.navbar-link`?

I would write a code like this. 
```css
.navbar-link:not(:last-child) {
  color: #555555;
}
```
and you can see the result on embedded codepen.

### Conclusion
My time saved a lot when I use this thing and my code looks more clean and neat. 

So I start include this tips/trick of CSS to my list of topics that I want to share to you guys.
DISK PARTITIONING
Tags: diskpartitioning, operatingsystem
Published: 2021-04-25 06:27:01


**What is disk partitioning?** **Disk partitioning** is the process of splitting a disk into one or more regions called partitions. A **partition table** is located in the first sector of a disk and stores information about the size and location of created partitions. In other words, disk partitioning allows for the splitting of one physical drive into smaller, logical drives called volumes. To an operating system, these drives are completely separate, so you can carry out operations on one volume without affecting the others.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rr0xg7zcogozpca90fys.png)
**Why partition a disk?**
Most users won’t ever encounter the need to partition disks, but disk partitioning can be useful in some cases.

1.A new hard drive is practically unusable unless it is partitioned to save data.
2.Partitions can be used to organize data according to their type. For instance, you can have one partition that stores all your documents and another that stores all your music files.
3.Windows can easily be reinstalled without affecting the installed programs since the boot files are safely stored in the ​system partition. The system partition is kept separate from the rest of the partitions that store installed applications.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vfahv9hgji1rmliivan.jpg)
4.If you want to back up a certain subset of data, the partition it is stored in can be backed up rather than the whole physical drive.
5.Partitions make data recovery convenient and efficient.
Manipulating Strings in C Using Library Functions.
Published: 2021-04-25 06:05:55

In this we will be able learn to manipulate strings in C using library functions .Using as gets(), puts()and more. We will be able learn to get string from the user and perform operations on the string.

We need to often manipulate strings according to the need of a problem. Most, if not all, of the time string manipulation can be done manually but, this makes programming complex and large. C supports a large number of string handling functions in the standard library “string.h”.

C strcpy():-

The function prototype of strcpy() is:

char* strcpy(char* destination, const char* source);

The strcpy() function copies the string pointed by source including the null character to the destination.

The strcpy() function also returns the copied string.

The strcpy() function is defined in the string.h header file.

Use strcpy(), the size of the destination string should be large enough to store the copied string. Otherwise, it may result in undefined behavior.

#include <stdio.h>
#include <string.h>

int main() 
{
   char str1[10] = "C language";
   char str2[10];

   // copying str1 to str2
   strcpy(str2, str1);

   puts(str2); // C language

   return 0;
}

C strlen():-

The strlen() function calculates the length of a given string.

The strlen() function takes a string as an argument and returns its length. The returned value is of type size_t (the unsigned integer type).

It is defined in the <string.h> header file.

#include<stdio.h>
#include<string.h> 
int main() 
{
  
  int len1, len2;
  
  //initializing the strings
  char string1[10] = "Hello";
  char string2[10] = {'w','o','r','l','d','\0'};
  
  //calculating the length of the two strings
  len1 = strlen(string1);
  len2 = strlen(string2);
  
  //displaying the values
  printf("Length of string1 is: %d \n", len1);
  printf("Length of string2 is: %d \n", len2);
}

The strlen() function doesn't count the null character \0 while calculating the length.
Free SSL certificate for shared hosting using certbot
Published: 2021-04-25 05:59:22

Depending on your hosting plan, it is possible that you have limited access to the machine were you app is running, which makes it difficult to generate a free SSL certificate (i.e. installing [`certbot`](https://certbot.eff.org/about)) on the web server.

Fortunately, `certbot` makes it possible to generate an SSL certificate on a machine **other than the one where certificate is going to be installed**. For example, you could generate a certificate from your own computer and push it to your web server using good-old cpanel or FTP. To do that, follow these steps:

Step 1. Install `certbot` on your computer. If you are using a Debian-based OS, do something like this:

```bash
sudo apt-get install certbot
```

For further instructions about installing `certbot`, [click here](https://certbot.eff.org/docs/install.html).

Step 2. To get a certificate, run the following command (_you will need admin permission to run this command_)

```bash
certbot certonly --manual --preferred-challenges http
```

Step 3. Next, enter domain name(s) to be included in your certificate, for example:

```bash
Plugins selected: Authenticator manual, Installer None
Please enter in your domain name(s) (comma and/or space separated)  (Enter 'c'
to cancel): 

www.my-super-project.com
```

Step 4. Now, `certbot` will start the validation process. Following message will appear, asking you to create a file and place it in `.well-known/acme-challenge/` directory in your web server:

```bash
Create a file containing just this data:

GXyDY4mNeg46oX55-...

And make it available on your web server at this URL:

http://www.my-super-project.com/.well-known/acme-challenge/GXyDY4m...

```

Step 5. Once validation is completed, you'll see a message from `certbot` showing where certificates have been saved, for example:

```bash
Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/www.my-super-project.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/www.my-super-project.com/privkey.pem
   Your cert will expire on [3 months from now]. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"

```

That's it! You now have a valid certificate that can be installed in your web application.
ThankYouNext 🖤 - Next.js starter template
Tags: nextjs, typescript, sass, opensource
Published: 2021-04-25 05:47:42

Website: https://thankyounext.vercel.app/
GitHub: https://github.com/stevefrenzel/thankyounext

I first came into contact with Next.js about a year ago and have been a big fan ever since! I'm not only excited about features like routing, image optimization or the flexibility to choose between SSG and SSR (or use both). Especially the developer experience feels more pleasant than with React and the support from people like [Lee Robinson](https://leerob.io/) and [Cassidy Williams](https://cassidoo.co/) is just priceless! To me, Next.js feels like a superset of React, similar to TypeScript and Javascript. 🙂

For this reason, I decided to use Next.js for my personal projects. However, I didn't want to start from scratch every time and painstakingly put everything together until I have a base I feel comfortable coding on. So I decided to create a template to share with the public, as I'm interested in what other people would add, change or improve.

Since there is a detailed explanation on the website itself, I'll just very briefly list here what features ThankYouNext has:

- TypeScript
- Sass support
- ESLint & Prettier configuration
- Absolute imports
- React strict mode
- Ready-to-use SEO setup
- All necessary security headers

In addition, this template offers the following:

- A perfect Google Lighthouse score
- No accessibility violations
- Ships with zero byte of JavaScript
- No HTML warnings or errors
- No CSS errors

I will update this template over time.The most important point for me at the moment is the integration of [Preact](https://preactjs.com/), since that hasn't worked yet.  I would also be interested in your opinion on what else could be added. This template is mainly intended for simple websites and blogs, but has the option to expand and make it more complex at any time.
LeetCode 63. Unique Paths II
(javascript solution)
Tags: algorithms, javascript
Published: 2021-04-25 05:46:45

###Description:
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).

The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).

Now consider if some obstacles are added to the grids. How many unique paths would there be?

An obstacle and space is marked as 1 and 0 respectively in the grid.

How many possible unique paths are there?

###Solution:
Time Complexity : O(n^2)
Space Complexity: O(n^2)

```javascript
var uniquePathsWithObstacles = function(obstacleGrid) {
    const m = obstacleGrid.length;
    const n = obstacleGrid[0].length
    // Create dp array
    const dp = Array(m + 1).fill(0).map(() => Array(n + 1).fill(0));
    dp[0][1] = 1
    
    for(let i = 1; i < m+1; i++) {
        for(let j = 1; j < n+1; j++){
            // Add value to dp array if the cell we are looking at in the grid is not blocked
            dp[i][j] = obstacleGrid[i-1][j-1]===0 ? dp[i-1][j]+dp[i][j-1] : 0 
        }
    }
    return dp[m][n]
};
```
49 Days of Ruby: Day 29 - Command Line Interfaces (CLI)
Tags: ruby
Published: 2021-04-25 05:05:52

---
title: 49 Days of Ruby: Day 29 - Command Line Interfaces (CLI)
published: true
description: Join us on a 49 day learning journey through Ruby!
series: 49 Days of Ruby
tags: #ruby
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9m73qaetuse3nm3y3it8.png
---

**Welcome to day 29 of the 49 Days of Ruby! 🎉**

We are ready to discuss starting to build your own applications in Ruby!

One of the first application types you may want to build is a CLI, or a command-line interface.

A CLI is a form of application that runs as text, often in a user's terminal. You have interacted with lots of CLIs already, from when you started by installing Ruby to yesterday when you learned a bit about debugging!

Today we are going to discuss the file contents of a CLI, and tomorrow, we will discuss how to accept user input.

A CLI in Ruby needs the following at the top of it:

```ruby
#!/usr/bin/env ruby
```

That `#!` followed by the `/usr/bin/env ruby` tells your computer *how* to run the rest of the code. In our case, we want it to be run using `ruby` installed on the system.

Go ahead and create a file in your terminal called `cli.rb` and add that line at the top.

Then add on a new line:

```ruby
puts "This is my CLI!"
```

Once you save the file, from your terminal type `./cli.rb`.

Did it not work? We need to designate the file as an executable first! Run the following: `chmod +x cli.rb`. This changes the file to be an eXecutable type.

Now, try the `./cli.rb` again.

You should see "This is my CLI" in your terminal. Congrats you built and ran your first CLI!

Tomorrow, we will make our CLI be more dynamic, and a bit more practical, by learning how to accept user input.

**Come back tomorrow for the next installment of 49 Days of Ruby! You can join the conversation on Twitter with the hashtag [#49daysofruby](https://twitter.com/hashtag/49daysofruby).**
10 Simple Navigation Bar Hover Animations
Tags: css, beginners, webdev, productivity
Published: 2021-04-25 04:09:34

One of the main components of a web page is the navigation menu, it help us to quickly navigate to the page we want. Some navigation bar contains many links/menu items which make it a complex element, sometimes it will be difficult to understand in which link we are or which link we clicked to get here. In such a situation a visual indication of our current location in the web page will be a great help, here I list 10 simple beginner level hover effects which can be used to show on which menu item we are pointing to. Or this can be used to show the active menu item. On the code I commented briefly what method I used to get the effect, I don't do much styling, you can use your creative ideas. I just want to show some methods to animate menu elements on hover. All these are simple animation easy for a beginner, please comment the mistakes you found in the code or any new ideas you like to share. Happy Coding.


{% codepen https://codepen.io/kiran-r-raj/pen/LYxqOzJ default-tab=result %}
{% codepen https://codepen.io/kiran-r-raj/pen/mdRvqMY default-tab=result %}

{% link https://dev.to/kiranrajvjd/10-simple-toggle-switch-animation-using-css-and-javascript-3gpn %}
{% link https://dev.to/kiranrajvjd/awesome-css-generators-3709 %}
{% link https://dev.to/kiranrajvjd/7-simple-menu-icon-animation-for-beginners-25oa %}
{% link https://dev.to/kiranrajvjd/40-awesome-illustrations-resources-for-your-web-projects-2fea %}
First Post - Should I Blog?😕
Tags: watercooler, beginners
Published: 2021-04-25 03:57:51

Hello fellow coders, My name is Hritik Agarwal. I am a 3rd-year student at the Indian Institute of Technology, Dhanbad pursuing my bachelor's in Electronics.

Well, being with Electronics for 3 years, I realized that it's not for me😅, I am more inclined towards computer science. Well, nothing can be done about that, and so moving forward.

You see, I am pretty much a noob in coding & know only a little bit about web development but since I am going to be free for the next 3 months(*Summer Vacation*), I wanted to dive fully into coding & come out as a better programmer.

This is my first post on DEV or rather any tech-related post on the internet and I don't know if it's the correct way to ask a question in the community, but here it goes-

*Is it beneficial to blog alongside you are learning or wait until you become little good in it & then blog?*
*Is it beneficial to blog at all?*

You see, I came across this site, searching for a problem & I wondered should I also write blogs like these people. It looked cool but I am not sure if it's worth it, so any wisdom on this would be appreciated.🙂

Also, thoughts on completely random topics are also welcomed.😎
LeetCode 62. Unique Paths
(javascript solution)
Tags: algorithms, javascript
Published: 2021-04-25 03:56:33

###Description:
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).

The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).

How many possible unique paths are there?

###Solution:
Time Complexity : O(n^2)
Space Complexity: O(n)

```javascript
var uniquePaths = function(m, n) {
    // Create dp array
    const dp = new Array(n + 1).fill(1);
    
    // Populate dp array
    for(let row = m - 1; row > 0; row--){
        for(let col = n - 1; col > 0; col--){
            dp[col] = dp[col] + dp[col + 1];
        }
    }
    return dp[1];
}
```
The Subsea Cables that Connect Us
Published: 2021-04-25 03:53:01

Most of us are probably not looking to make the career change into submarine cable technicians. However, as software developers, as important as it is to keep up with the latest software tech, it's also beneficial to study the modern marvel that is the internet on a macro-macro-macro-level.

Cables Galore:
In 1858, the first trans-Atlantic telegraph cable connecting Newfoundland, aka Canada, to Ireland sent its first transmission. Today, there are over 380 underwater cables in operation around the world supporting the internet, with a total length of three quarters of a million miles. These cables supports nearly all intercontinental electronic communication in our world, today.

The Tech Giants Own The Internet:
As you cram for your interview with Microsoft, remember they're not just a software company. They own the internet. Google, Facebook, Amazon, Microsoft lease or own half of the world's undersea bandwidth. Recently, Facebook and Google teamed up to invest in the creation of internet cables that will span the Pacific Ocean, further connecting the U.S. and Asia.

Penguins and Postcards:
Antarctica is the only continent that has never been wired to the Internet via submarine cables due to harsh conditions and a tiny population. But perhaps that will soon change, as The Australian Bureau of Meteorology (BoM) has toyed with the idea of adding a cable connecting Antartica to Australia.

The Future is Satellite?
Fun fact: Undersea cables are both more cost-effective and faster than these fancy satellites. Satellites are extremely expensive to manufacture, and the distance from the Earth creates a latency effect. However, keep your ears peeled as companies are attempting to tackle these issues and bring satellite-enabled internet into our lives. Recently, SES chose Elon Musks' SpaceX to launch four MEO satellites; these satellites orbit the Earth at a lower altitude, but require more intricate antennae. 

For over 150 years, we have relied on large cables spanning the lengths of oceans to connect us to each other. We're not all meant to become experts on the subject. But perhaps, we can, at the very least, appreciate the fact that internet connects us all today because of a bunch of cables under the sea. Thank you cables.