teleren/devto huggingface dataset:
My first Hacktoberfest
Tags: hacktoberfest
Published: 2020-10-23 07:02:48

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->


### About me
<!-- If you are new to the DEV community, introduce yourself and share a bit about why you joined DEV and decided to participate in Hacktoberfest this year.  --> 
Hi, I'm Vishal! This is my first post on DEV community. I got to know about DEV after I registered for Hacktoberfest. 

Also, this is my first Hacktoberfest. I wanted to join it because Open Source has always fascinated me and I wanted to contribute to it.
 
### Background

<!-- Are you brand new to open source? What about coding in general? Tell us about how you got here →
I have completed my B.Tech in Computer Science and I've always loved coding. My go to programming languages are Python and R as I work in Data Science.

I had learned about Hacktoberfest last year but it was too late before I could register. So, this year I made sure that I was on time!!

### Progress

<!-- Share a bit about where you’re at in your Hacktoberfest journey. What stage are you at? How has the process been?  -->

I wasn't really sure at the firs that I will be able to complete the challenge but eventually I did it! 

Right now I have made 5 PRs and still working on a few.


### Reflections
<!-- Overall, how has your Hacktoberfest 2020 experience been? If you’re a first-timer, will you participate again? What have you learned? Have you made any interesting connections? What is your next step in open source?  -->

The experience of joining the hacktoberfest was magical and without a doubt I will be joining next year as well!

I got to learn many things about git and had fun while learning them. The community was helpful to get me where I have reached!!
Friday Blast #93
Tags: fridayblast, links, post
Published: 2020-10-23 14:32:04

---
title: Friday Blast #93
published: true
date: 2020-10-23 07:00:00 UTC
tags: fridayblast,links,post
canonical_url: https://horia141.com/friday-blast-93.html
series: "Friday Blast"
---

[Taming floating point error (2020)](https://www.johnbcoughlin.com/posts/floating-point-axiom/) - a brief overview of what error means in _floating point_ and how it affects work. What I found most interesting was the discussion on error analysis and error propagation through a computation. This was one area I didn’t have a good mental model of how to approach from uni days, and it turns out that (at least conceptually) it is quite straightforward and elegant. Indeed, I have an even higher appreciaton for the design of the floating point standard now.

[Bloom filters debunked (2020)](https://gopiandcode.uk/logs/log-bloomfilters-debunked.html) - apparently there was an error in the analysis of Bloom filters false positive rates lurking for 30 years. Indeed the last step of the analysis seemed a bit hand-wavy the first time I encountered it. The authors used `coq` to provide a formal proof of the known correct form and increase our confidence in it.

[On the uses of a life (2020)](http://www.daemonology.net/blog/2020-09-20-On-the-use-of-a-life.html) - the author of`tarsnap` (and inventor of key derivation methods in cryptography) got called out that essentially he wasted his life making backup software. This is his response.

[Finding the right company to reach Staff engineer (2020)](https://lethain.com/finding-the-right-company/) - another one from Will Larson. Staff roles are those very-senior engineering roles in a company, and the article is about alignment and expectation setting in order to reach that.

[What engineering managers should do and why we don’t (2019) #video](https://www.youtube.com/watch?v=Q_bJVokYLRI&feature=youtu.be) - a short introduction to management for engineers. In video form.
I've just enhanced performance from 21sec to 0.4sec with this one single change
Tags: database, webperf, webdev
Published: 2020-10-23 06:55:32

### This is the only thing that I've done to decrease my network call time dramatically.
_____
#### TL;DR
[SQL indexes.](https://www.tutorialspoint.com/mysql/mysql-indexes.htm)
#### OK, OK, I know what you think
*Who doesn't know indexes are very important in all forms of SQL databases??*
*How come you ended up having a 21 seconds loader??*
#### You're right
You're right, but it can be missed. I mean, we've missed it when we've started our MySQL architecture.
I always knew the role of indexes, but it's hard to notice the real importance of it when your SQL tables are small sized.
> "Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs." 
[How MySQL Uses Indexes](https://dev.mysql.com/doc/refman/8.0/en/mysql-indexes.html)

So as a Time To Market Startup, we just forgot to add some really important indexes to our tables.
#### How things escalated
In the beginning, there weren't any performance issues.
But when the data and the DB scaled up, then things started to slow down.
One day we've noticed that one network call is taking 21 seconds (!). 
That was the trigger to start digging into the code, trying to find performance issues.
Very quickly we found the time consuming source, and it was just one DB query. 
We also noticed that this query is [joining](https://www.mysqltutorial.org/mysql-join/) two large tables, and none of the fields in the [query `where` clause](https://www.tutorialspoint.com/mysql/mysql-where-clause.htm) were indexed.
#### The solution
I added a single column index for each one of those fields.
```
ALTER TABLE `table_name`
    ADD INDEX `fieldName` (`fieldName`);
```
WOW, the speed!
Suddenly the network call took 0.4 seconds. This change just blew our minds.
_____
#### Conclusion
Do not underestimate the importance of SQL Indexes, and do not forget to add them to your SQL tables. 
One day you may end up with the query time of 21 seconds. It's not fun and it's embarrassing.
How to Deploy SmartContract in 4 simple steps.
Tags: blockchain, xinfin, technology
Published: 2020-10-23 06:46:31

Watch the #video to know how I deployed an #smartcontract on Auction at XinFin (XDC) Hybrid Blockchain Network in just 1 minute.
Video link: https://www.linkedin.com/posts/mahalaxmi-perumal-244a291b8_video-smartcontract-xdc-activity-6725294563210133504-vuRe

Steps are very easy
1) create new,
2) paste smartcontract,
3) compile with appropriate compiler
4) Deploy on XinFin #XDC Network.

#Blockchain #SOLIDITY #ethereum #network #smartcontracts #deployment #XinFin
Hacktober-Fest 2020
Tags: hacktoberfest
Published: 2020-10-23 06:44:52


### [About Hacktoberfest]
Hacktoberfest is open to everyone in our global community. Whether you’re a developer, student learning to code, event host, or a company of any size, you can help drive the growth of open source and make positive contributions to an ever-growing community. All backgrounds and skill levels are encouraged to complete the challenge.

### Languages
It's totally on contributors to contribute in whichever language they want. 

### Review Period
The most awaiting Period for all contributors. Your PR will go under 14 days review period and if during these days if any of the PR gets tagged with spam or invalid then it will not be counted for Hacktoberfest. Make sure that you have good with other's repos and fulfill the requirements for that PR.

### My Experience: 
I think anybody must have the patience for 14 Days and have faith in their contributions. Feel free to ask doubts about the issues before submitting the PR finally.
Git Rebase
Published: 2020-10-23 06:36:42

I primarily focused on removing redundant codes and functions because initially when I first designed and implemented my tool, I separated the command line parsing from URL parsing by using two objects, ArgParser and LinkValidator, to handle those functionalities. There is only one static variable “MAXNUMPATHS” in my tool, which is defined in the class LinkChecker in which the main() function is located. It is used by other classes via static imports. 

I believe in making atomic commits to make my development process to be easier to perform. After watching the professor’s video instruction on how to perform an interactive rebase, my actual practice is quite smooth. Of course, I did find some bugs while I was modifying my code. Since all of them happened at the level of local methods, all are easy to be fixed. However, I did run into instances previously that I had to modify multiple locations across 3 to 4 classes in order to accommodate the data type change of a method’s parameter.     

Since I am using Windows Subsystem for Linux (WSL) version 2 for Windows 10, the change of my project history without running into too much trouble. Of course, I primarily relied on using Vim rather than Eclipse.
Earn Free Microsoft (Azure & Power Platform) Certification Vouchers
Tags: startdevchange
Published: 2020-10-23 06:23:17

Earn Free Microsoft(Azure & Power Platform) Certification Vouchers

[Azure Fundamentals Challenge](https://www.microsoft.com/en-us/learncloudchallenge/0a7cbbae-0110-4f03-9b91-c27c6836aa23)

[Power Platform Fundamentals Challenge](https://www.microsoft.com/en-us/learncloudchallenge/94718734-483e-44e2-a245-1c9fd8fc9dc3)

That's it. You signed up for great learning and awesome opportunity to participate in the challenge and earn valuable Microsoft Certification Vouchers. Keep Learning
My Website 
Tags: help
Published: 2020-10-23 06:05:22

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fa96pj5f31jcl4fyh4n0.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7i94qfalnsq9v1yt2mr6.jpg)


https://github.com/VinayakBector2002/Zoom-Virtual-Backgrounds

I made this website using a template from HTML5-UP. It is a collection of some of the best zoom virtual backgrounds out there :P

Tho I need your help making the submission form. 

Thanks
TODO application that dynamically changes the wallpaper as your todo list.
Tags: flutter, opensource, productivity, todayilearned
Published: 2020-10-23 05:59:01

![YATA logo](https://dev-to-uploads.s3.amazonaws.com/i/prwwdywpn73f2wx5jhgr.png)

![Hello](https://media.giphy.com/media/QYkX9IMHthYn0Y3pcG/source.gif)

If you crave for productivity in your life, this application would be a great addition to your arsenal. The primary focus of the application is for anyone to be able to add a task with minimal steps and show them on their home and lock screen.

Yata stands for Yet another TODO application :p
This name is inspired from *YACC* *YARN*.

The major problem one would face to get on par with their tasks for the days is to keep track of them. With this application, the action items are always on the home and lock screen so that you don't lose track of them.
The code is open-sourced at [Github](http://github.com/Rohithgilla12/yata)

You can find the screenshots and application apk in the repository below.
{% github Rohithgilla12/yata %}

There is a small roadmap planned
- Adding users to set preferences about the wallpaper setting.
- Light Theme.
- Focus task.
- Motivational quotes on the wallpaper along with the tasks.

Many more features to come :)

Tech stack:
- Flutter
- Firebase

Download link : [Here](https://github.com/Rohithgilla12/yata/releases/download/0.1-alpha/yata.apk)

Please feel free to contribute to the repo :)

![Thanks](https://media.giphy.com/media/6tHy8UAbv3zgs/source.gif)

Peace ✌🏻,
Rohith Gilla
👾 Monster kill on all containers from docker
Tags: docker, todayilearned
Published: 2020-10-23 05:33:59

After few hours playing with docker basics, I'm front of the necessity to kill all of my container like another newbie on something used the scratch (go horse) way ONE by ONE 😱
```bash
docker rm c582332ca41c #container_id
docker stop c582332ca41c #container_id
```

## Best way to 🔪💀 containers
You'll need 3 pounds of plutonium for our yellow cake ☢️
...
hold on, I'm just kidding 🤣
...
Nothing much just our good old terminal
```bash
docker rm $(docker ps -aq)
# is the same for stopping command
docker stop $(docker ps -aq)
```
* -a: list all container
* -q: quite mode
Icards.me
Tags: hacktoberfest, meteor, react
Published: 2020-10-23 05:13:31

---
title: Icards.me
published: true
tags: hacktoberfest, MeteorJs, ReactJs
---
 ✨ https://www.icards.me/ ✨

1 year ago I was with a group of friends in my country of origin, Colombia. Without money or for a decent pc, this project took us out of the economic hole we were in, that's why I have so much affection for this project.

It is a web project based on meteor js, react js created with the need to replace the old system of cards printed on paper, also to help giving the grain of sand that this was inclemental and finally extinguish all that is the printed media on paper.

It is a web platform in which the client registers, buys a plan for 1 year and can have his digital card fully administrable with an integration of CEO and Prerender 

### Contributions

Backend Developer: https://gitlab.com/ChrisNethunter
Backend Developer: https://gitlab.com/Theevil24a
Frontend Developer: https://gitlab.com/juciff 

### Reflections
It is the first time in any call and I would like to know more I have many projects that may interest humanity in general and every day working for the environment and improvement as a species
Is coding a lenguage like english or portuguese? 
Tags: beginners, newbie, lenguage, explainlikeimfive
Published: 2020-10-23 03:38:32

Hello, my name is Jana and I am new here. 
I have never wrote a code in my life and I'm doing a very very very basic course to see if that is something I can do. Not as a career, but as a possibility. To occupy a new place in this distópico world. To feel like I can do something about it. 
the thing is, since I started I tend to see coding as a lenguage. A lenguage that has the correct and polite way to say things and the street style that you use for everyday life. 
I see front end as the street style and the back end as the formal use of lenguage. Am I crazy? 
Does everyone ever wrote about this form of learning to code and to deal with technology? 
If so, please send me some links, references and ideas. I would be very pleased to have something to look up for in order to organize my own mind as a begginer in tech skills
Deploying a Jigsaw static site to GitHub Pages using GitHub Actions
Published: 2020-10-23 03:28:03

---
title: Deploying a Jigsaw static site to GitHub Pages using GitHub Actions
published: true
description: The most straightforward way to publish your Jigsaw static site to GitHub Pages that's easier than the official methods.
tags: 
//cover_image: https://direct_url_to_image.jpg
---

There are a couple of articles on how to do this already, so I'll put them at the end of this article in case this method doesn't work out for you (and I give them credit as they gave me a starting point and I used some of their code in this article). In the meantime, I want to show you what I believe to be the best and easiest way to deploy your [Jigsaw](https://jigsaw.tighten.co/) site to GitHub Pages using GitHub Actions after a bit of my own trial and error.

This method assumes that you want to publish one of your personal GitHub projects, or a "project" site. This will probably need to be tweaked for a "user" site, which I don't have any experience with (at least not in GitHub).

It also assumes you've gotten a Jigsaw site that builds properly at least in a local dev environment.

## Setup

In your repo's GitHub settings, turn on GitHub Pages, using `gh-pages` as the branch to build from, and `/` (root) as the folder to build from.

Then, from your repo's root directory, create a new workflow under `.github/workflows/main.yml` with the following contents:

```yml
name: Build & Publish

on:
  push:
    branches:
      - master

jobs:
  build-site:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install Composer Dependencies
      run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
    - name: Install NPM Dependencies
      run: npm install
    - name: Build Site
      run: npm run production
    - name: Stage Files
      run: git add -f build_production
    - name: Commit files
      run: |
        git config --local user.email "actions@github.com"
        git config --local user.name "GitHub Actions"
        git commit -m "Build for deploy"
    - name: Publish
      run: |
        git subtree split --prefix build_production -b gh-pages
        git push -f origin gh-pages:gh-pages
```

This should literally be everything you need to do. You can test this by manually running the action from the GitHub Action tab, or just commit new code to the `master` or `main` branch of your project. 

If you're using `main`, which is possible as GitHub is making it the default for new repos, you'll just need to change anywhere `master` is referenced to `main`.

*Thanks to James Brooks and Max Kostinevich for your helpful articles getting me even started on the right path and saving me tons of time:*

https://james.brooks.page/blog/jigsaw-github-actions/
https://maxkostinevich.com/blog/deploy-jigsaw-using-github-actions/
Rename the branch from "master" to "main" in an existing GitHub repository
Tags: github, git
Published: 2020-10-23 02:56:55

## What I want to do
Sometimes I want to change the name of a branch, both locally and remotely.
For example, I may want to change the name of the branch from master to main. 
This article will show you how to do that.

## Procedure
First, locally, rename the branch from master to main.
```sh
git branch -m master main
```

Next, you'll add the main branch to the remote.
![スクリーンショット_2020-10-13_23_48_51eng](https://dev-to-uploads.s3.amazonaws.com/i/ok7ei1ppweyis7ke22f8.png)
 
You can also set the main branch as the default branch.

![スクリーンショット_2020-10-13_23_51_133eng](https://dev-to-uploads.s3.amazonaws.com/i/zrqp5w6wjnfinxudyv0h.png)

Then delete the master branch in the remote.

```sh
git push origin :master
```

Finally, the local main branch follows the remote main branch.

```sh
git push --set-upstream origin main
```

## References
[rename git branch locally and remotely]( https://gist.github.com/lttlrck/9628955 )
[Git Set Upstream | Learn Version Control with Git]( https://www.git-tower.com/learn/git/faq/set-upstream/ )
Angular: Create a custom dependency injection
Tags: angular, dependency
Published: 2020-10-23 02:37:13

---
title: Angular: Create a custom dependency injection
published: true
description: 
tags: angular, dependency
//cover_image:
---
**Objective:** In this article, you will know dependency injection concept, custom dependency injection in Angular.

**Pre-requisite** Prior to completing this article, you should have already installed all pre-requisite tooling including: Visual Studio Code, Node Package Manager (NPM), Node, Angular CLI.

1. create a property named **dependencyTitle** into **app.component.ts** file

```
public dependencyTitle: string;
```
2. So we’re gonna create a public constructor. And `this.dependencyTitle=“hello! Mahfuz Shazol”`

```
constructor() {  
    this.dependencyTitle = "Hello! Mahfuz Shazol"
}
```

3. Go to **app.component.html**, we want to bind this **p** to the value of the title. So whatever is in that **dependencyTitle** property is want to show as our **p**, that’s enough.

```
<p>{{dependencyTitle}}</p>
```

Now we want get our messages to show in this title from a **service**, or some type of **dependency** class. So we want separate the responsibilities of our
application.

4. So the first thing we want do is we want to create a class. Create a new file in this app folder named **test.message.ts**

```
export class MessageProvider{
    public getMessage(): string{
        return "Hey! Mahfuz Shazol"
    }
}
```

5. Now class can be injected into an Angular component. So the first thing we have to import a class ***decorator** called **injectable** from **Angular/core**.

```
import { Injectable } from '@angular/core';
@Injectable()
export class MessageProvider{
    public getMessage(): string{
        return "Hey! Mahfuz Shazol"
    }
}
```

This basically says that this could be injected into components throughout Angular application.

To make it available for injection, we need to use this array right here.

6. Import **messageProvider** into **app.module.ts**

```
import { MessageProvider } from './test.message';
@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule
  ],
  providers: [SampleService, MessageProvider],
  bootstrap: [AppComponent]
})
export class AppModule { }
```
Now we have this file ready to go.

7. Go to our **app.component.ts** . Import our **messageProvider**

```
import { MessageProvider } from './test.message';
```

8. Go ahead and use the **messageProvider**. Because we’re not using this provider outside of this class.

```
constructor(private _messageProvider: MessageProvider) {  
      this.dependencyTitle = _messageProvider.getMessage();
}
```

And finally we’re using our **messageProvider** and our constructor, so we’re **injecting** these **dependencies**, that looks great too.

**Output:**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3r7tqs3gt8o66w6dlqfc.png)

[Github URL](https://github.com/bipon68/angular-medium)
[StackBlitz URL](https://stackblitz.com/github/bipon68/angular-medium)

### Reference
[TypeScript](https://scrimba.com/learn/intrototypescript)
[Angular CLI](https://angular.io/cli)


Thanks for reading.
Quickly Creating CGroups to Limit CPU/Memory of Applications
Tags: linux
Published: 2023-01-06 01:13:53

---
title: Quickly Creating CGroups to Limit CPU/Memory of Applications
published: true
date: 2020-10-23 02:32:56 UTC
tags: Linux
canonical_url: https://brandonrozek.com/blog/quickcgroups/
---

Running some data science algorithms can be CPU or memory intensive. To prevent the code from hogging system resources, we can use cgroups to set limits. This also is great for applications that you don’t quite trust.

## Defining the CGroup

On Ubuntu, we will have to install `cgroup-tools`

```
sudo apt install cgroup-tools

```

Let’s create a cgroup called `limitapp`

```
sudo cgcreate -a $USER -t $USER -g memory,cpu:limitapp

```

We can limit the RAM usage in this cgroup to 2GB. [According to the Arch Linux Wiki](https://wiki.archlinux.org/index.php/Cgroups#Ad-hoc_groups), this limit only applies to RAM not SWAP.

```
echo 2000000000 > /sys/fs/cgroup/memory/limitapp/memory.limit_in_bytes

```

All processes belong to a cgroup. The majority of them belong to what is considered the root cgroup. By default, all groups have 1024 CPU shares. The amount of shares that you define in the cgroup determines the approximate percentage of CPU time that the cgroup will get if the system is congested.

Let’s say that our cgroup can have 50% of the CPU time when the system is stressed:

```
echo 512 > /sys/fs/cgroup/cpu/limitapp/cpu.shares

```

## Assigning Applications to CGroups

We can assign an existing application to a cgroup. For example, let us assign `firefox` to our cgroup.

```
cgclassify -g memory,cpu:limitapp $(pidof firefox)

```

We can start new processes in our cgroup. For example, let us start a python environment in our cgroup.

```
cgexec -g memory,cpu:limitapp python

```
October 22nd, 2020: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2020-10-23 02:03:39

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![Information flowing through your brain](https://media.giphy.com/media/qKltgF7Aw515K/giphy.gif)
</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/devteam/what-was-your-win-this-week-4l37 %}

<center>

![Price is Right contestant celebrating](https://media.giphy.com/media/gF29UEqBhSoDY8LHKg/giphy.gif)
</center>