teleren/devto huggingface dataset:
A Quick Guide to the Vim Text Editor
Tags: linux, vim
Published: 2021-05-24 10:10:12

[Vim](https://en.wikipedia.org/wiki/Vim_(text_editor)) is a  text editor which is highly efficient. It is an improved variant of the vi editor, that is distributed with [UNIX systems](https://en.wikipedia.org/wiki/Unix). 

Vim is often called a "programmer's editor," and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

The vim text editor is an extremely powerful tool for developers, but it can be difficult to master.  If you are new to vim, I recommend [these exercises](https://vim.is/)

## Install vim

If you're using a Mac or a Linux machine, it's likely that your terminal has vim built in, so it's worth being familiar with to work on those systems. 

If not, you can install vim with your package manager or test if vi is installed.

To install vim for Ubuntu, follow these instructions.

1: Open a terminal window and type sudo apt-get install vim

```
sudo apt-get install vim
```

2: If you want to get updated version of vim, open a terminal window and type sudo apt-get update

```
sudo apt-get update
```

3: Then type sudo apt-get install vim

```
sudo apt-get install vim
```

The installation process will take some time, after which all the commands of vim will be available.

![apt-get install vim](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m0jtkmr48m2qabho2ffd.png)

## Basics

To start vim, just type vim in the command line

```
vim
```

Then you can type `ESC` followed by `:e filename` to open filename.

To open a vim directly from the command line, type:

```
vim filename
```

Press `ZQ` to quit vim without saving. Press `ZZ` to save and exit.

To move the cursor, you can press `ESC` and use the keys `h`,`j`,`k`,`l`.  You can also use the arrow keys in vim.

![vim cursor keys](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s50gy7ws6rebd4wrhclv.png)

Vim has modes. To switch to writing mode, press the `i` key or the `insert` key. To switch to command mode, press the `ESC` key.

To save your file press `ESC` followed by `:w`.

Press `:Explore` to open the file explorer. Use the `j` and `k` keys and press enter to open the file. You can also use `:LExplore`

{% asciinema https://asciinema.org/a/383101 %}
Installing GNU grep and find on OS X
Tags: systems, programming, productivity
Published: 2021-05-24 10:07:47

```sh
brew install grep
brew install findutils
```

After that update your `.bashrc` or `.zshrc` with following to setup the paths correctly.

```sh
# .bashrc/.zshrc
export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
```

That's all!
Getting Rust, ah yeah
Tags: rust, applesilicon, deno
Published: 2021-05-24 09:58:17

I have just started playing with Rust. It just happens that I am in office with my Apple Silicon Mac Mini. So I am quite excited to note that since 1.23, Rust had been natively available.

But challenges quickly unearth. I fail to run 

```bash
rustup doc
```

since aarch64-apple-darwin is still only a [Tier 2 target](https://github.com/rust-lang/rustup/issues/2692). 

It is not too far from knowing tricks like

```bash
rustup +stable-x86_64-apple-darwin doc
```

OK, it works, cool. 

Trying to install the pre-built toolchain failed. Right now I have 

#### rustc 1.52.1 (9bc8c42bb 2021-05-09)
#### rustup 1.24.2 (755e2b07e 2021-05-12)
#### rustfmt 1.4.36-stable (7de6968e 2021-02-07)
#### cargo 1.52.0 (69767412a 2021-04-21)

Just let it go.

Yo! Hello Fxxking world~ 
Boom... needs all the compliers installed that I have not yet load this m1 with Xcode....

Another 10 mins. Fine.

I am ok with all c-styled syntax.

And, yeah, cargo does not accept the dot (.)

Good to know. And I like cargo starts the git and gitignore ( Am I too old to like such ? ), such that I cannot hold to check [how to better config the default behaviour of cargo](https://doc.rust-lang.org/cargo/reference/config.html).

I am good with the speed of (cargo new | git clone) cargo { check build run }. Nice.
Scoreboard of Rose Bowl Games powdered by Redis & MySQL - Use Terraform To Provision All Resources
Tags: mysql, redis, terraform, gamedev
Published: 2021-05-24 09:55:20

Here is a tutorial to simulate a scoreboard of past [Rose Bowl Games](https://en.wikipedia.org/wiki/Rose_Bowl_Game), with MySQL as the persistent data store and Redis as the cache layer. 
You can also apply this solution to your backend of mobile gaming, sports event, online education, etc.
[Watch Now (15 mins)>](https://youtu.be/oROTLdhdgdY)


【Main Contents】
1) Deploy the cloud resource: Redis, MySQL, ECS, using Terraform script
2) Configure application environment - Java,  step by step
3) Demonstrate the SQL Query either through cache(Redis) or database(MySQL)

You will learn followings.
💯 Using Redis as data cache to accelerate data accessing to database.
💯 The simplest solution for RDS MySQL database caching with Redis. This solution relies on the expiration time (TTL) of the key in Redis. Redis won't be updated proactively when MySQL is updated. 

💡 The approach is simple to implement, but the inconsistency duration may be very long especially for the scenario that the read request is very frequent and the expiration time is relatively long, a lot of long-term dirty data will be generated.

【Source Code】
Please refer to the documentation on [GitHub](https://github.com/alibabacloud-howto/solution-mysql-redis-cache-simple).

【About ApsaraDB for Redis】
[ApsaraDB for Redis Series >](https://www.youtube.com/watch?v=MxxaAczoTGQ)

【Bonus】
[Get up to 60 days FREE trial now >](https://www.alibabacloud.com/product/apsaradb-for-redis)
Question about style prop in react.
Tags: react
Published: 2021-05-24 09:43:18

Hello,  I have a question of how style property works In react.

I found that if I pass an object to style property of any jsx, it's writable prop gets to false. (code below)

I know it's still writable if I pass a 'destructured object' though, I wonder why React works in this way.

```jsx
import React, { useEffect, useState } from "react";
import ReactDOM from "react-dom";
import "./styles.css";

const style = {
  color: "red"
};

const styles = {
  color: "blue"
};

export default function App() {
  console.log(Object.getOwnPropertyDescriptor(style, "color")); // writable: true
  console.log(Object.getOwnPropertyDescriptor(styles, "color")); // writable: true

  useEffect(() => {
    console.log(Object.getOwnPropertyDescriptor(style, "color")); // writable: false
    console.log(Object.getOwnPropertyDescriptor(styles, "color")); // writable: true
  }, []);

  return (
    <div className="App">
      <div style={style} styles={styles}>
        hello world
      </div>
    </div>
  );
}
```

if you want to try this in sandBox:
https://codesandbox.io/s/modest-galois-pqtdi?file=/src/App.js
Laravel Custom Setter Tutorial
Tags: laravel, php, programming, tutorial
Published: 2021-05-24 09:32:53

Hey Dev,

In this tutorial, i will learn you how to laravel custom setter tutorial in your laravel project.The laravel custom setter tutorial is so facile to utilize.so you can just follow my step by step and learn laravel custom setter tutorial.

So let's start to the example and follow to the my all step

More ..

https://codingtracker.blogspot.com/2021/05/laravel-custom-setter-tutorial.html
Build your skills for addressing a group (100 Bytes Of Wisdom: Day 52)
Tags: career, journey, advice
Published: 2021-05-24 09:22:29

---
title: Build your skills for addressing a group (100 Bytes Of Wisdom: Day 52)
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, journey, advice
//cover_image: https://direct_url_to_image.jpg
---

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/02oi9z6uwwywh7cugxju.png)

Standups, meetings, demos, meetups, conferences... so many times in a developers career you will be on the spot in front of an audience. Having the confidence to say what you need to say in a clear, concise manner will help you a lot long term. It comes up time and time again in your career. This is a totally learnable skill and things like improv classes or toastmasters have the tips and techniques to feel comfortable in front of audiences of any size.

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/
The need for simpler code reviews
Tags: codereview, codequality, programming, productivity
Published: 2021-05-24 09:03:52

Code reviews are one of the best ways to ensure code quality. 

A recent survey has found that 36% of the companies that do code reviews think it is the best way to improve code quality. Too often, however, they are understood as an individual task, instead of a team effort.

Here are five reasons that motivate the need for simpler code reviews.

1. **We aren’t teaching enough how to do code reviews.** People are entering the market much faster than they are being promoted. Code reviews, by and large, are not taught at University.

2. **Code reviews are not being prioritised.** When the code is being developed without an effective integration of the reviewing processes, it often gets done last minute.

3. **Code reviews are not an individual task.** Most teams assign this responsibility of code reviews to either team leads or senior developers alone. This is unsustainable when there are the ration of junior to senior developers is increasing.

4. **Code reviews need to withstand staffing changes.** Leads and senior developers leave. Sometimes they’re absent. If they are the ones doing code reviews, in these events we observe huge bottlenecks in code reviews.

5. **We need the right tools.** A large number of teams are still doing manual code reviews or using tools that are time consuming and error prone.

If you want to read more, check out the full article on [Reviewpad's blog](https://reviewpad.com/blog/the-case-for-simpler-code-reviews/).
Linux Commands For Everyday Life
Tags: linux, codenewbie
Published: 2021-05-24 08:38:46

Learning [Linux](https://www.linux.com/what-is-linux/) commands is one of those things that help you in your everyday life as a programmer, systems administrator or IT professional. So today I compiled a list of everyday linux commands that you might find useful in real life.

## Linux commands

Linux is solid, but you don’t realize how much you depend on it until something goes wrong. Whether it’s a simple fix or you have no idea what’s going on. We’ll start with the basics:

**ls : List contents of directory**

```
$ ls
public_html
```

```
$ ls -l
-rw-r--r-- 1 owner group 0 Jan 23 13:09 index.html
```

```
$ ls -l /tmp/
total 616
drwxrwxrwt 27 root root 4096 Oct 22 14:09 .
```

**cd : Change directory**

```
user@hostname:~$ cd /etc
user@hostname:/etc
```

```
user@hostname:~$ cd /usr/local/bin
user@hostname:/usr/local/bin
```

**pwd : Show current directory**

```
user@hostname:/usr/local/bin$ pwd
/usr/local/bin
user@hostname:/usr/local/bin$ 
```

**sudo : run command as root (admin)**

```
$ sudo ls
[sudo] password for user: 
```

**run a program**

```
$ ./app
```

## What's next? :grin:

As a Linux user, you have more commands than you can count at the tip of your fingers.

In fact, you have enough commands to do every day tasks, including:
* Using git version control for your project
* Connecting to your web server over ssh
* Controlling your file system
* Searching for files containing a particular word in the file path
* Backup databases or interact with them
* See your web server logs for security attacks
* Opening up a terminal-based text editor either locally or remotely

To get to a Linux pro level quickly, I recommend [this tutorial](https://www.practicelinux.com/)
Konfigurasi Sublime Favorit
Published: 2021-05-24 08:35:42


Kenapa saya share? karena saya suka coba-coba distro linux, otomatis sublime text saya kehapus dong. Biar nggak lupa saya tulis aja deh di blog ini.

1. Ayu Theme
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xdn1h5ao5lgh69z2jc5.png)

download [disini](https://packagecontrol.io/packages/ayu!)

2. A File Icon

![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3rlw4d2hnn2lzee2z1v4.png)
 

download [disini](https://packagecontrol.io/packages/A%20File%20Icon!)

3. JSX Snippet

download [disini](https://packagecontrol.io/packages/JSX)

4. Color Picker

download [disini](https://packagecontrol.io/packages/ColorPicker)

5. Jetbrains mono

download [disini](https://fonts.google.com/specimen/JetBrains+Mono)
5/23 TIL: Go Signals, http, & Linux file systems
Tags: todayilearned
Published: 2021-05-24 02:43:36

<strong>--Golang--</strong>
Go flag

```

addr = flag.String("addr", "0.0.0.0:9090", "Default HTTP address")

```

- port 9090 will be the default value unless the user specifies the port on the command line by doing something like --addr 0.0.0.0:8080.
- the first parameter is the name of the flag, the second parameter the default value, and the last parameter describes the default value

Package http

```

s := &http.Server{

Addr:           ":8080",

Handler:        myHandler,

ReadTimeout:    10 * time.Second,

WriteTimeout:   10 * time.Second,

MaxHeaderBytes: 1 << 20,

}

s.ListenAndServe()

```

- [https://golang.org/pkg/net/http/#Handler](https://golang.org/pkg/net/http/#Handler)

Go Signals

```

sigChan := make(chan os.Signal)

// relays incoming signals to sigChan

signal.Notify(sigChan, os.Interrupt, os.Kill)

sig := ← sigChan

log.Println("Received terminate signal, gracefully shutting down", sig)

```


<strong>--Systems--</strong>
File Systems

- Devices are represented by entries in the /dev directories
- Each device has a corresponding device driver which implements a standard set of operations: open, read, write, close functions that were discussed in file IO topic
- A device may have a corresponding hardware device driver that implements an API
- A hard disk is divided into one or more partitions, each of which may contain a file system
- A file system is an organized collection of regular files and directories
- Linux implements file systems such as the ext2 file system
- All the file systems in Linux are mounted under a single directory tree with a directory / at its root; a privileged process can mount and unmount a file system using mount() and unmount()
- Information about the mounted file systems can be retrieved using statvfs()

<strong>--Discrete Math--</strong>
Modus Ponens

- A valid argument is a list of premises from which the conclusion follows
- Ex) if p, then q. p. Therefore, q.

Modus Tollens

- If p, then q. ~q. Therefore, ~p.

Logical Arguments:

- Generalization: p. Therefore, p V q. (always true)
- Specialization: p ʌ q. Therefore, p.
- Contradiction: ~p → c. Therefore, p.
Sucess Wait For You Just Go For It.!
Tags: success, productivity
Published: 2021-05-24 08:13:43

Hi Everyone,

This is Dave Seth from CouponsI must say that if you want to achieve something in your life then you have to do it for 5 years consistently.

Here I want to share my quick journey about how I started my online journey and enjoying my life working online.

I started my online journey in 2012 and it's been 8 years since I am working online.

Earlier I started my career as a software engineer in MNC where I was working on putty and network infrastructure later I shifter to the Digital Marketing world.

Now I am running 8 websites with one Youtube channel name Coupons Agent and making money online.

I have joined this network to help people with some development skills which I acquired.

Love & Respect
Dave Seth
What the heck is defer in golang?
Tags: go
Published: 2021-05-24 08:00:38

Do you struggle to get the hang of `defer` too?
Worry not 😁, I will try to explain it as simply as I can in this post.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0gusrsag0s0t3orxarjs.png)

> A defer statement defers the execution of a function until the surrounding function returns.
> 
> The deferred call's arguments are evaluated immediately, but the function call is not executed until the surrounding function returns.

This program explains the execution of `defer` in a bit easier way:

```go
func trace(s string) string {
    fmt.Println("entering:", s)
    return s
}

func un(s string) {
    fmt.Println("leaving:", s)
}

func a() {
    defer un(trace("a"))    // similarly trace("a") also gets 
                            // executed immediately
    fmt.Println("in a")
}

func b() {
    defer un(trace("b"))    // trace("b") gets executed 
                            // immediately but un("b") gets 
                            // execute at the very last
    fmt.Println("in b")
    a()
}

func main() {
    b()
}
```

**Output:**

```go
entering: b     // output of trace("b")
in b            // note that un("b") is not executed instead 
                // program moves ahead
entering: a     // output of trace("a")
in a
leaving: a      // finally defered un("a") is called as a() 
                // returns
leaving: b      // at last un("b") is called
```

> Deferred function calls are pushed onto a stack.     
When a function returns, its deferred calls are executed in last-in-first-out order.

Here is a small program which visualise this:

```go
package main

import "fmt"

func main() {
    fmt.Println("counting \n")
    defer fmt.Println("\ndone")     // This will get executed at 
                                    // the very last

    for i := 0; i < 10; i++ {
        defer fmt.Println(i)
    }
}
```

**Output:**

```go
counting

9
8
7
6
5
4
3
2
1

done
```

However remember deferred function's arguments are evaluated immediately, hence it can give a different result

```go
i := 0
defer fmt.Println(i)
i++

// It will print 0 even though i has become 1
```


A particularly good use of `defer` is to close a file.

```go
package main
import (
    "os"
)

func main() {
    f, _ := os.Create("test.txt")
    defer f.Close()
    /*
        Stuff
    */
}
```

> Deferring a call to a function such as Close has two advantages. First, it guarantees that you will never forget to close the file, a mistake that's easy to make if you later edit the function to add a new return path.      
Second, it means that the close sits near the open, which is much clearer than placing it at the end of the function.     
[Source](https://golang.org/doc/effective_go#defer)

[Read more here.](https://blog.golang.org/defer-panic-and-recover)

Hope you learned something new 😁.
Cron Job Tutorials - How to set up cron job for BoonEx Dolphin.Pro?
Published: 2021-05-24 07:52:32


I installed BoonEx Dolphin.Pro on my server, and I want to set up a cron job to trigger BoonEx Dolphin.Pro's cron job script. What should I do to set up the cron job?

https://www.easycron.com/cron-job-tutorials/how-to-set-up-cron-job-for-boonex-dolphin

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yex0upqyqbsa77cewc5s.png)
A small thing nobody taught you in Python

Tags: python, oop, programming
Published: 2021-05-24 07:49:15

Have you ever noticed that some stuffs like `lower()`, `upper()`, `sort()` etc. are called like this `variable.lower()` or `variable.sort()`. But most of the other function are called like this `len(variable)`, `str(variable)`.       
What's the difference?

Actually, the first set of examples are actually called **attributes** or **methods**.    

Let's take the example of `lower()`, which acts on the `str` datatype.

`str` datatype is actually a class and has a number of functions inside it. These functions are called attribute and can be accessed by using the `.` notation.

```python
class Hello:
    def world(self):
        print("Hello World")

hello = Hello()        # Instantiate the class Hello
hello.world()          # Access the attribute world()

# Prints: Hello World
```

If you are familiar with OOP programming, this is all very familiar to you. If not, you can read more [here](https://www.tutorialspoint.com/python/python_classes_objects.htm).

So, back to our example:

```python
string = "Hello World"
print(string.lower())   # Here, I have called string's (str class) 
                        # attribute lower() which changes case to 
                        # lowercase

l = [1, 3, 2]
l.sort()                # Here, sort() is an attribute of l 
                        # (list datatype) which sorts the list

# Thus, lower() and sort() are actually functions inside the 
# str and list class respectively
```

On the other hand, the latter examples were all **functions**, like your normal `def func()` thing. They perform a certain task on the argument that is passed to them. The task may or may not be unique to a particular datatype.

```python
string = "Hello World"
l = [1, 2, 3]

print(len(string))      # Prints the no. of characters in string 
                        # (str datatype)
print(len(l))           # Notice, len() can be applied to list 
                        # datatype (and various other types) too
```
I hope you leaned something new today 😁.
What is computer vision? And how it works.
Tags: machinelearning, watercooler, devops, discuss
Published: 2021-05-24 07:33:06

#### Computer Vision(CV) is a field of Artificial Intelligence(AI) that enables computers and systems to derive meaningful information from digital images, videos and other visual inputs- and make recommended output based on that.

*If AI enables computers to think, computer vision enables them to see, observe and understand.*
**CV trains their machine to do such work but it should do those work in lesser time with the use of cameras or algorithms as compare to *retina* or *nerves*.**

#### According to report- the market of CV continuing to grow. It is expected to reach USD *48.6 billion by 2022*.

### How does Computer vision works?
Computer vision requires lots of data for getting good accuracy.
Two essential technologies are used to accomplish this: a type of machine learning called deep learning and a convolutional neural network (CNN) but now a days there are many pre-made libraries and frameworks available where you need not to know CNN or RNN.
For eg: [openCV](https://opencv.org/) 

### Computer Vision Applications.
There are many research has done in this field, but apart from it there are many uses of **CV** in business, entertainment, transportation, healthcare and everyday life.
eg: Google translate let you point your camera at a sign in another language almost immediately.

### Computer Vision Examples.
* **Image Classification**:
It sees an image and can classify it (a dog, an apple, a person’s face).
* **Object detection**:
It can use image classification to identify a certain class of image and then detect and tabulate their appearance in an image or video.
* **Object Tracking**:
It follows or tracks an object once it is detected. This task is executed by with image capturing in sequence or real-time.
* **Content-based image retrieval**:
It uses computer vision to browse, search and retrieve images from large data stores, based on the content of the images rather than metadata tags associated with them.(PS:This is most useful application of CV)

### Computer Vision Projects
You can check out my github repository where I have made many projects based on CV.
[OpenCV-Tutorial](https://github.com/Rishabh062/opencv)
[Projects](https://github.com/Rishabh062/MachineLearning/tree/main/openCV)

**Now it's time to explore friends.**

#### You can connect with me here:
**[Linkedln](https://www.linkedin.com/in/rishabh-dwivedi-28737b1a0)
[Twitter](https://twitter.com/Rishabh07147212)**

Thanks for reading.
Rishabh Dwivedi