teleren/devto huggingface dataset:
Back To Basics: Git
Tags: git
Published: 2020-03-12 11:27:45

Personally, I believe that aspiring developers should learn git/version control before engaging into any kind of programming. Git is extremely important in programming. I remember when I was starting out, I had no idea what version control was. Infact, I only learnt about git about two years into my programming career (courtesy of [Traversy Media's git course](https://www.youtube.com/watch?v=SWYqp7iY_Tc)) and it was awesome.
Learning the basics of git is simple since to start out, one needs to only learn three commands.
- Initialze a project as a git repository
- Add files
- Commit added files

#### Installation
- Download git from [here]([https://git-scm.com/downloads](https://git-scm.com/downloads))  and install on your computer

Once git is installed, open the command line and type `git` then press `enter`. A long list of commands should be displayed.

Lets create a project and name it `hello_world`. Open the folder and git bash directly into it by right clicking and choosing `Git bash here` option from the dropdown list. Once the terminal is opened, type `git init` to initialize the folder as a git repository.

We can then add a file into the folder by typing `touch index.html`. This creates a html file. Open the html inside any text editor and add the following code (for testing purposes).

```html

	<html>
		<head>
			<title>Hello World!</title>
		</head>
		<body>
			Hello World from Git!
		</body>
	</html>

```
#### Adding files to git
To add changed files to git,
- To add a single file

```shell

	git add index.html
	
```
- To add all files
```shell

	git add .

```

#### Commiting files
Commiting files provides a point of reference incase you want to revert your code to a certain point

```shell
	
	git commit -m 'Initial Commit'
	
```
The `-m` flag lets you add a message with your commit so as to understand what changes you made or files you added at that particular commit.

#### Ignoring files and folders
Git provides you with the ability to ignore files and folders that exist in your working folder which you don't want to add to your git repository. To ignore files and folder create a `.gitignore` file and add the name of the file or folder

In your terminal create a file and folder as follows
- Creating a file

```shell
	
	touch ignorefile.txt
	 
```
- Creating a folder

```shell
	
	mkdir ignorefolder
	
```
- Create a gitignore file to ignore the files and folders

```shell

	touch .gitignore

```

You can open the gitignore file with your text editor or edit directly from the terminal. To edit directly from the terminal,

```shell
	
	nano .gitignore
	
```

The command above opens the gitignore file in terminal, once the file is opened press `i` then write,

```shell

	ignorefile.txt
	ignorefolder/
	
```

Then press `CTRL/Command + X` to exit. Then press `Enter`.

The file and folder will be ignored anytime the `git add .` command is executed.

Incase of any error, please feel free to comment or constructively criticize.
How to build onnx/onnx for your ARMv7l devices
Tags: onnx, docker, raspberrypi
Published: 2020-03-12 10:38:34

[microsoft/onnxruntime](https://github.com/microsoft/onnxruntime) provides build instruction for ARMv7l python wheel which requires [onnx/onnx](https://github.com/onnx/onnx). But it doesn't provide binary package or build instruction for ARMv7l. So I've written a dockerfile to build [onnx/onnx](https://github.com/onnx/onnx) python wheel.

---

# Build instruction

## 1. Create a build directory

```bash
mkdir build-onnx
cd build-onnx
```

## 2. Save the dockerfile on into the build directory

- `Dockerfile.arm32v7`

```dockerfile
FROM balenalib/raspberrypi3-python:latest-stretch-build

ARG REPO_URL=https://github.com/onnx/onnx
ARG BRANCH=master

#Enforces cross-compilation through Qemu
RUN [ "cross-build-start" ]

RUN install_packages \\
    sudo \\
    build-essential \\
    cmake \\
    git \\
    python3 \\
    python3-pip \\
    python3-dev \\
    libprotoc-dev \\
    protobuf-compiler

RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install numpy

# Prepare onnx Repo
WORKDIR /code
RUN git clone --single-branch --branch ${BRANCH} --recursive ${REPO_URL} onnx

# Start the basic build
WORKDIR /code/onnx
RUN python3 setup.py bdist_wheel

# Build Output
RUN realpath /code/onnx/dist/onnx-*.whl

RUN [ "cross-build-end" ]
```

## 3. Run docker build

It will take several hours depending on your machine specs.

```bash
docker build -t onnx-arm32v7 -f Dockerfile.arm32v7 .
```

## 4. Note the full path of the `.whl` file

It will print the path something like this.

```
Step 12/13 : RUN realpath /code/onnx/dist/onnx-*.whl
---> Running in ded3b4302e29
/code/onnx/dist/onnx-1.6.0-cp35-cp35m-linux_armv7l.whl
```

## 5. Copy the Python wheel from the docker image

```bash
docker create -ti --name onnx_temp onnx-arm32v7 bash
docker cp onnx_temp:/code/onnx/dist/onnx-1.6.0-cp35-cp35m-linux_armv7l.whl .
docker rm -fv onnx_temp
```

## 6. Copy the wheel file to your ARMv7l device

example:

```bash
scp onnx-1.6.0-cp35-cp35m-linux_armv7l.whl pi@RaspberryPi:/home/pi/
```

## 7. On device, install the wheel file

```bash
pip install onnx-1.6.0-cp35-cp35m-linux_armv7l.whl
```
⚡ CSS Text Animations
Tags: css, webdev, html, beginners
Published: 2020-03-12 10:26:14

This is a quick video to show you how you can perform a few different text animations ⚡ for your website.

You can use these types of animation effects for **landing pages**, **transitions** and **hover effects**.
{% youtube UugW7G7rsYQ %}
The types of animations we will go through are the most popular and easy ones including: 
* keyframe animation
* hover animation
* text-shadow (allows you to perform glow effects)
* letter-spacing (expanding text!)
* opacity
* font-size
* font-weight 
* line-height
* background-clip

There are lots of other ways we can do animation, but those are just a few. If you like the content of content, I would really appreciate a follow on twitter on a subscription on youtube as I am trying to branch out to provide more useful content. 👍

If you have suggestions on things you might want to see, please leave it in the comments below. 😊

Quick Link to the video: https://youtu.be/UugW7G7rsYQ
## Follow and support me: 
Special thanks if you subscribe to my channel :)
* [🎞️ Youtube](https://www.youtube.com/channel/UCvM5YYWwfLwpcQgbRr68JLQ?sub_confirmation=1)
* [🐦 Twitter](https://twitter.com/adrian_twarog)
* [💬 Discord](https://discord.gg/nGdThpE)
* [💸 Patreon](https://www.patreon.com/adriantwarog)

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Adobe XD to Fully Responsive WordPress Site](https://dev.to/adriantwarog/adobe-xd-to-fully-responsive-wordpress-site-16e0)
* [Adobe XD to HTML Full Process](https://dev.to/adriantwarog/adobe-xd-to-html-full-process-ao6)
* [Full Tutorial on how to use SASS to improve your CSS](https://dev.to/adriantwarog/full-tutorial-on-how-to-use-sass-to-improve-your-css-57on)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
Remote work as a software company
Tags: discuss, hiring, remote
Published: 2020-03-12 10:17:05

---
title: Remote work as a software company
published: true
description: Remote work as a software company
tags: discuss, hiring, remote
---

For the 'not yet believers', if you want you can try learning from people that already are remote and profitable. Remote doesn't mean bombarding your colleagues with videos all day, it's about learning how to write more and not expect an instant response and give time for productive work. A very special note is that if you don't work on your own product, you are already remote for some other company :) Extend the curtsy to the people that chose to work with you.

I like @Basecamp a lot and they extended this offer of buying their book on remote work with full refund. If you are curious, take it!

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">For the foreseeable future, we’ll be refunding the purchase price of our book “REMOTE: Office Not Required”. Buy a copy, tweet me a picture of you holding the book w/ a sales receipt dated 3/10/20 or later, and we’ll PayPal you a complete refund (DM your email, please).</p>&mdash; Jason Fried (@jasonfried) <a href="https://twitter.com/jasonfried/status/1237773562322259970?ref_src=twsrc%5Etfw">March 11, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>


While you are here, I need your help to make (even more) known the companies that create software remote. Big plus for Europe zones, as they are less talked about. Are you working for a remote company that allows remote or is remote from the get-go? Share the name with the world :)
Sum of Array the Maximum Consecutive Subarray
Tags: algorithms, kotlin, programming, learning
Published: 2020-03-12 10:07:53

---
title: Sum of Array the Maximum Consecutive Subarray
published: true
description: Given an array of integers, find the maximum possible sum you can get from one of its contiguous subarrays. The subarray from which this sum comes must contain at least `1` element
tags: algorithms, Kotlin, Programming, learning
---

In the past few weeks, I have been learning a lot of algorithms and data structures. Finding Kotlin written algorithms has proven challenging. So let us fix that by with writing our own. if you can't beat them, look for a way to beat them 😅.

The problem.
 
Given an array of integers, find the maximum possible sum you can get from one of its contiguous subarrays. The subarray from which this sum comes must contain at least `1` element.

One of the methods to solve this will be through using a nested for loop, the first will loop through all the elements and calculating the sum and saving it to a variable `var max_sum`. This solution would be correct although it would not be efficient as it runs at `0(n²)`.

There are many dynamic algorithms that can be used to make this program efficient by running linearly. In this instance, we will use the popular **Kadane's Algorithm**.


We will create a method `ArrayMaxConsecutiveSum` which takes in a parameter `inputArray: IntArray`. Then a variable `max_sum` which will be equal to the first element of the array `var max_sum = inputArray[0]`, variable `current_sum` which will be equal to our maximum sum, `var current_sum = max_sum`, a for loop, given the size of the array we will make the `current_sum ` equal to the result of the element input position of the array plus the `current_sum `compared to the next element input position. Update the `max_sum` with the `current_sum `.


To make it work we will return the `max_sum`.


Now that wasn't hard 😄 😄.

Let's look at the code

```
fun ArrayMaxConsecutiveSum (inputArray: IntArray): Int {

    var max_sum = inputArray[0]
    var current_sum = max_sum

    for (i in inputArray.indices) {
        current_sum = (inputArray[i] + current_sum).coerceAtLeast(inputArray[i]) 
/**
* checks what is greater the current_sum
  plus the next element input position or
  the next element input position alone
 **/
        max_sum = current_sum.coerceAtLeast(max_sum) // we update the max sum with the current sum if it's greater
    }

    return max_sum
}

```

[Github Repo](https://github.com/meshnesh/codilityAlgorithims/blob/master/dailyAlgorithims/day_one/src/ArrayMaxConsecutiveSum.kt)

Thank you for reading, please share if you found it helpful 💯.

__Asante Sana__
ลองใช้ Podman แทน Docker ใน CentOS 8
Tags: container, podman
Published: 2020-03-12 09:22:07

---
title: ลองใช้ Podman แทน Docker ใน CentOS 8
published: true
description: 
tags: container,podman
---

Podman เป็น container engine เหมือน Docker แต่ว่า Podman ไม่ต้องมี daemon process(dockerd) ซึ่งทำให้เราสามารถรัน container ได้โดยไม่จำเป็นต้องเป็น root 

Podman ติดตั้งมาพร้อมกับ CentOS 8 เลย ดังนั้นสามารถรัน container ได้เลย สะดวกดี

เราจะยืม docker command จาก docker getting start มาลองกัน
```
podman run hello-world
Trying to pull registry.access.redhat.com/hello-world...
  name unknown: Repo not found
Trying to pull registry.fedoraproject.org/hello-world...
  manifest unknown: manifest unknown
Trying to pull registry.centos.org/hello-world...
  manifest unknown: manifest unknown
Trying to pull docker.io/library/hello-world...
Getting image source signatures
Copying blob 1b930d010525 done
Copying config fce289e99e done
Writing manifest to image destination
Storing signatures

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

``` 

สังเกตว่า podman จะไปหา image ที่ 
registry.access.redhat.com 
registry.fedoraproject.org
docker.io/library
ตามลำดับ ซึ่งไฟล์ config ของ repo ก็อยู่ที่ /etc/containers/registries.conf 

ลองใช้ podman ps -a หรือ podman container ls -a
```
podman container ls -a
CONTAINER ID  IMAGE                                 COMMAND    CREATED         STATUS                     PORTS  NAMES
0175e1d84375  docker.io/library/hello-world:latest  /hello     22 minutes ago  Exited (0) 22 minutes ago         zealous_leakey
a82ca14e379b  docker.io/library/alpine:latest       sh         42 hours ago    Up 42 hours ago                   gallant_ellis
493b3889a145  docker.io/library/alpine:latest       /bin/bash  42 hours ago    Created                           vigilant_volhard
fc53c0e17871  docker.io/library/alpine:latest       /bash/bin  42 hours ago    Created                           pensive_buck
```

คำสั่งของ podman ก็จะเหมือน docker ดังนั้นเราสามารถใช้แทน docker ได้เลย
```
alias docker=podman
```
sysadmin function bakup
Published: 2021-12-27 15:28:01

---
title: sysadmin function bakup
published: true
date: 2020-03-12 09:19:36 UTC
tags: 
canonical_url: https://blog.moulard.org/sysadminfunctionbackup/
---

# sysadmin function bakup

Dans les règles d’or de tout sysadmin il y a bien sûr la nécessité de mettre en œuvre une politique de backup complet des systèmes. Ce n’est pas le sujet de cet article !!! Il existe une bonne pratique pour garantir la traçabilité et la capacité de revenir sur une mauvaise manip.

**Avant de modifier une fichier, il faut en faire une copie !!!**

Alors c’est simple à première vue:

```
cp /etc/fstab /etc/fstab.bkp

```

Bon ça c’est la base :) Franchement ça aide dans bien des cas. On peut aller un peu plus loin et ajouter un horodatage.

```
cp /etc/fstab /etc/fstab-bkp200312002553

```

Pour ma part je me suis souvent demandé pourquoi personne n’avait écrit en `cp` avec cette fonction… Bien probablement car il y a les function en shell :)

Il faut juste la créer dans son environnement et le mettre dans son fichier `$HOME/.bashrc`

```
bkp (){ cp -a $1 $1-bkp$(date +"%y%m%d%H%M%S") ; }

```

On peut alors ensuite l’utiliser comme une commande classique

```
root@pi3:~> bkp (){ cp -a $1 $1-bkp$(date +"%y%m%d%H%M%S") ; }
root@pi3:~> bkp /etc/fstab
root@pi3:~> ls -l /etc/fstab*
-rw-r--r-- 1 root root 305 nov. 29 18:40 /etc/fstab
-rw-r--r-- 1 root root 305 nov. 29 18:40 /etc/fstab-bkp200312003354

```

> Cool non!!!

Bien sûr l’utilisation des fonctions en bash n’a pas de limite, voilà une autre que j’utilise souvent pour répéter X fois la même commande…

```
t10 (){ for x in {01..10}; do $@ ; done }

```

Et à l’utilisation

```
pi@pi3:~ $ t10 (){ for x in {01..10}; do $@ ; done }
pi@pi3:~ $ t10 echo g >> /tmp/10g
pi@pi3:~ $ cat /tmp/10g
g
g
g
g
g
g
g
g
g
g

```

On peut faire des choses beaucoup plus sophistiquées… Voila une fonction qui décompresse les principaux fichiers d’archive.

```
# Extract the content of an achive
function extract {
 if [-z "$1"]; then
    # display usage if no parameters given
    echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
    echo " extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
    return 1
 else
    for n in $@
    do
      if [-f "$n"] ; then
          case "${n%,}" in
            *.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar)
                         tar xvf "$n" ;;
            *.lzma) unlzma ./"$n" ;;
            *.bz2) bunzip2 ./"$n" ;;
            *.rar) unrar x -ad ./"$n" ;;
            *.gz) gunzip ./"$n" ;;
            *.zip) unzip ./"$n" ;;
            *.z) uncompress ./"$n" ;;
            *.7z|*.arj|*.cab|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.rpm|*.udf|*.wim|*.xar)
                         7z x ./"$n" ;;
            *.xz) unxz ./"$n" ;;
            *.exe) cabextract ./"$n" ;;
            *)
                         echo "extract: '$n' - unknown archive method"
                         return 1
                         ;;
          esac
      else
          echo "'$n' - file does not exist"
          return 1
      fi
    done
fi
}

```
Show dev.to: a 130 pages free book about web-scraping
Tags: showdev, books, java, tutorial
Published: 2020-03-12 09:04:13

## Introduction

Hi everyone, 

2 years ago, I left my job full-time and joined Kevin to take the indie-hacker road.

We had some ups and downs.

We tanked our first product, a price monitoring application, that never managed to make money even 9 months after launch.

Nevertheless, we persisted and then launched ScrapingBee, a web-scraping API.

I don't know if you've been following our open report on Twitter or IndieHacker but currently, ScrapingBee is making around $4k per month.

It is far from being enough to make a living out of it but we feel like we are onto something and work hard every-day to make it work.

## Java Web Scraping Handbook

Today we are excited to release a 130 pages about web scraping, for free.

We don't even ask about your email. 

The first four chapters are language agnostic, and the last can be applied to any language, so don't be scared if you don't know Java 😃

By the end of the book, you will know:

- How to scrape any website
- Just enough XPath / Regex / DOM knowledge to be dangerous 😈
- How to deal with Javascript-heavy websites (Single Page application...)
- How to programmatically perform actions on a website behind a login form 🤖
- Parse information inside PDFs 📑
- Bypass captchas ⛔️
- Deploy your scrapers in the cloud ☁️

The book is available [here](https://www.scrapingbee.com/java-webscraping-book/). 

Happy Scraping
Top 10 website to learn Angular
Published: 2020-03-12 09:03:35

## Top 10 websites to learn Angular

1. [Officical Angular Document](https://angular.io/docs)
2. [tektutorialshub.com](https://www.tektutorialshub.com/angular-tutorial/)
3. [techiediaries.com](https://www.techiediaries.com/angular/)
4. [w3schools](https://www.w3schools.com/angular/)
5. [javatpoint](https://www.javatpoint.com/angular-7-tutorial)
6. [edureka](https://www.edureka.co/blog/angular-tutorial/)
7. [djamware](https://www.djamware.com/post-sub-category/5d5cb64ffdef3404227777c3/angular)
8. [.positronx.io](https://www.positronx.io/free-angular-tutorials/)
9. [appdividend](https://appdividend.com/angular-tutorial/)
10. [tutorialspoint](https://www.tutorialspoint.com/angular4/index.htm)
11. [Google](https://www.google.com/)
Top Blockchain Development Company 
Tags: blockchain, cryptocurrencydevelopment, software
Published: 2020-03-12 08:41:45

What is the most complicated process? Find a Blockchain development company or one of the leading Blockchain development companies; Of course, the later one. If it is a business solution, the search process is very difficult.

Your Google search will show you multiple companies, how do you filter the correct [blockchain development company](https://www.arstudioz.com/blockchain-cryptocurrency-development), as the technology itself is still maturing?

Well, it had brought together the best blockchain companies for easy access. These blockchain development companies provide end-to-end services including ICO launch, ICO marketing, blockchain application development, cloud development. The blockchain companies listed here have a proven track record and have real clients.
Electron-application-is-startup-with-white-screen
Tags: electron, javascript, whitescreen
Published: 2020-03-12 08:28:06

---
title: Electron-application-is-startup-with-white-screen
published: true
description: If you electron application is startup with white screen, look at this article.
tags: electron, javascript, whitescreen
---

https://burak.hashnode.dev/electron-application-is-startup-with-white-screen-ck7ogwby100ar69s1r510w6u7
Alexa Setup
Published: 2020-03-12 07:33:22

How to Setup Alexa
Download Alexa App in Your Smart Phone and Computer. Log in with Your Amazon Account.  and continue when Your Echo's Light Turn Blue to Orange That means Your Echo Setup is Ready. for Setting Up Alexa Choose Add device and Choose your Echo Device After that Connect Alexa To WiFi. Your <a href="https://setupecho.co.uk/alexa-setup/">Alexa Setup</a> is done Enjoy Your Alexa :)
Javascript Closure
Tags: javascript, beginners
Published: 2020-03-12 07:29:13

In javascript, when a function returns another function, a function that returned can access the variables inside the other function. This is called **closure**.

```javascript
function counter(){
  var number = 0;
  return function consoleIt(){
    debugger
    number += 1
    console.log(number)
  }
}
```
In this example inside the **counter** function there is a variable named **number** and this function returns another function. We invoke the **counter** function and assigned consoleIt function to  the **increment** variable.But there is one more thing. Now consoleIt function can access the **number** variable. You can see this if you put *debugger* inside the consoleIt function.
Whenever we invoke **increment** function, **number** variable will be increased by one.


## What is the benefit of **closure**?

You can give memory to functions. Whenever function invoked, it can remember variables from past invokes.
For example;

```javascript
const debounce=(debounceFn,timeout)=>{
  var timeoutId
  return function(...args){
    clearTimeout(timeoutId);
    timeoutId=setTimeout(() => debounceFn(...args),timeout)
  }
}
const debouncedHandleSearch = debounce(handleSearch,300)

```
Whenever we invoke **debouncedHandleSearch** function, it will remember timeoutID and clear it.


Thanks for reading it. You can see my other post below.

[Understanding This](https://dev.to/frk_ozbk/understanding-this-3k67)

[What is the difference between var and let](https://dev.to/frk_ozbk/what-is-the-difference-between-var-and-let-436a)

[What is syntactic sugar](https://dev.to/frk_ozbk/what-is-syntactic-sugar-5d5g)