teleren/devto huggingface dataset:
All About GitHub1s
Tags: opensource, github1s, vscode
Published: 2021-04-10 11:21:20

## What is GitHub1s
It is an Open Source Software(OSS), to read GitHub code with VS Code in One second.
https://github1s.com/

## Features
* View code
* Explore and switch branch/tag/commit
* View single-file history
* VS Code extension support, i.e. install Vim extension online and it will persist even restart the browser/device
* Extension on top of VS Code builtin supports:
    * Dart
    * Julia
    * Nim
    * Jupyter
    * Scala
    * Kotlin

## How Does it All Started 
[Netcon](https://github.com/conwnet) Started with His Idea with a simple tool to Read Code in VSCode + Its Extensions with a simple click, then [Yihong](https://github.com/xcv58) and [Me](https://github.com/Siddhant-K-code) Joined with his Amazing Idea and start collaborating on it.

## What’s the roadmap?
* Supporting GitHub Gists
* Other platforms like GitLab, Bitbucket, Gogs, etc.
* Modify code and create a PR/commit online
* Local VS Code extension
* Jump to definition of symbols
* More on: [Roadmap](github.com/conwnet/github1s/wiki/Roadmap)

## How is it helping the community?

We can read the code of any GitHub repo. Who has a habit of reading code in their IDE ( with customized themes, fonts ) 

## How is it different from GitHub CodeSpaces?

Since GitHub Codespases provides a powerful Web IDE with the complete ability of VSCode and it runs in a docker, it may need nontrivial times to boot the environment. GitHub1s is focused on providing a workspace with the lightweight and work as soon as possible, so it's inevitable to give up some abilities of VS Code. But it may be useful for someone who finds a great project on GitHub and learns its source code.

In addition, GitHub1s is designed to be expandable to other services like GitLab, Bitbucket, gogs.  


## How do we ensure the User & Contributor is happy?

Fast and convenient, we want to make sure not only the users can view the code fast but the development experience must be fast as well.

We have published a prebuilt version [@github1s/vscode-web](https://www.npmjs.com/package/@github1s/vscode-web) which is inspired by the `vscode-web`, author: https://github.com/Felx-B

It reduces the full build time from more than 10 minutes to less than 20 seconds. And the full CI build & test time drops from more than 16 minutes to around 4 minutes.


## Collaborations
* Gitpod
* Vercel
* Sourcegraph
* Browser extensions
* Active contributors

## Major Contributors
* [Netcon](https://github.com/conwnet)
* [Yihong](https://github.com/xcv58)
* [Siddhant](https://github.com/Siddhant-K-code)

## Contributors

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

## Achievements 
* 17.4K+ ⭐ on [GitHub](https://github.com/conwnet/github1s) in less than 2 months
* Selected In FridayFavorite by [Prisma.io](https://www.prisma.io/), [check here](https://twitter.com/prisma/status/1380524902336303105) 
* Selected for [DevX Conference](https://devxconf.org/) on Apr 29, 2021, 09:00 - 09:30 (PDT) 

***More to Come...***
How to Install tmux on Linux
Published: 2021-04-10 11:12:03

In this article, we'll explain how to install tmux on Linux.

<a href="https://github.com/tmux/tmux/" target="_blank" rel="noopener">tmux</a> is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. o keep SSH sessions running in the background, <em>tmux</em> can be a very quick solution. It can detach and reattach applications where the processes are kept running in the background.
<h3 style="font-size: 17px; font-weight: 500;"><a href="https://www.hostnextra.com/kb/how-to-install-tmux-on-linux/">Install tmux on Linux</a></h3>

<table role="table">
<thead>
<tr>
<th>Platform</th>
<th>Install Command</th>
</tr>
</thead>
<tbody>
<tr>
<td>Arch Linux</td>
<td><code>pacman -S tmux</code></td>
</tr>
<tr>
<td>Debian or Ubuntu</td>
<td><code>apt install tmux</code></td>
</tr>
<tr>
<td>Fedora</td>
<td><code>dnf install tmux</code></td>
</tr>
<tr>
<td>RHEL or CentOS</td>
<td><code>yum install tmux</code></td>
</tr>
<tr>
<td>macOS (using Homebrew</td>
<td><code>brew install tmux</code></td>
</tr>
<tr>
<td>macOS (using MacPorts)</td>
<td><code>port install tmux</code></td>
</tr>
<tr>
<td>openSUSE</td>
<td><code>zypper install tmux</code></td>
</tr>
</tbody>
</table>
After installing tmux, start the <em>tmux</em> session using terminal commands. It won’t take much time to get installed. Once you’ve done installing you can now get started with <em>tmux</em>. To start tmux, just type tmux in the terminal.
<blockquote># tmux</blockquote>
f you need to run more than one terminal multiplexer to keep all SSH sessions running in the background, in that case, you may find difficulties to switch between tmux to tmux. Here are the command lines to switch one form another.
<blockquote># tmux detach
# tmux attach
# tmux attach -t 2</blockquote>
To check all the tmux screen use the tmux list command.
<blockquote># tmux ls</blockquote>
That's it.

In this article, we have seen how to install tmux on Linux.

Checkout our awesome <a href="https://www.hostnextra.com/dedicated-server.html" target="_blank" rel="noopener">dedicated servers</a> and <a href="https://www.hostnextra.com/vps-hosting.html" target="_blank" rel="noopener">KVM VPS</a>.
TCP flags in TCP header
Published: 2021-04-10 11:06:14

## What are TCP flags?

Each TCP flag corresponds to 1 bit in size. The list below describes each flag in greater detail. Additionally, check out the corresponding RFC section attributed to certain flags for a more comprehensive explanation.

 - SYN - The synchronisation flag is used as a first step in
   establishing a three way handshake between two hosts. Only the first
   packet from both the sender and receiver should have this flag set.
   The following diagram illustrates a three way handshake process.
 - ACK - The acknowledgment flag is used to acknowledge the successful receipt of a packet. As we can see from the diagram above, the receiver sends an ACK as well as a SYN in the second step of the three way handshake process to tell the sender that it received its initial packet.

 - FIN - The finished flag means there is no more data from the sender. Therefore, it is used in the last packet sent from the sender.

 - URG - The urgent flag is used to notify the receiver to process the urgent packets before processing all other packets. The receiver will be notified when all known urgent data has been received. See RFC 6093 for more details.
 - PSH - The push flag is somewhat similar to the URG flag and tells the receiver to process these packets as they are received instead of buffering them.
 - RST - The reset flag gets sent from the receiver to the sender when a packet is sent to a particular host that was not expecting it.
 - ECE - This flag is responsible for indicating if the TCP peer is ECN capable. See RFC 3168 for more details.
 - CWR - The congestion window reduced flag is used by the sending host to indicate it received a packet with the ECE flag set. See RFC 3168 for more details.
 - NS (experimental) - The nonce sum flag is still an experimental flag used to help protect against accidental malicious concealment of packets from the sender. See RFC 3540 for more details.

## Reference:
[Tcpdump: Filter Packets with Tcp Flags](https://www.howtouselinux.com/post/tcpdump-capture-packets-with-tcp-flags)

[Understanding TCP Flags](https://www.howtouselinux.com/post/tcp-flags)

[Understanding TCP Sequence Number with Examples](https://www.howtouselinux.com/post/understanding-tcp-sequence-number)
[Understanding TCP Socket With Examples](https://www.howtouselinux.com/post/tcp-socket)
[Understanding TCP Socket With Examples](https://www.howtouselinux.com/post/tcp-socket)
[Tcpdump: Filter Packets with Ports](https://www.howtouselinux.com/post/tcpdump-ports)
[Understanding push ACK TCP Flags](https://www.howtouselinux.com/post/psh-ack-tcp-flags)
Talking about lambda functions in java using example
Published: 2021-04-10 10:50:27

---
title: Talking about lambda functions in java using example
published: true
description: We look into lambda functions in java using example code and understand what functions could help you with. Java has many new concepts that could help you, and lambda is just one of them. For example, you could create Suppliers that give you a value, Consumers that use a value, and then functional interfaces.
tags:
cover_image: https://i.ytimg.com/vi/GgI2_mV83zM/maxresdefault.jpg
---

{% youtube GgI2_mV83zM %}

We look into lambda functions in java using example code and understand what functions could help you with. Java has many new concepts that could help you, and lambda is just one of them. For example, you could create Suppliers that give you a value, Consumers that use a value, and then functional interfaces.
MULTISTAGE GRAPH
Tags: graph, cprog, dynamicprogramming
Published: 2021-04-10 10:18:37

A Multistage graph is a directed graph in which the nodes can be divided into a set of stages such that all edges are from a stage to next stage only (In other words there is no edge between vertices of same stage and from a vertex of current stage to previous stage).

We are give a multistage graph, a source and a destination, we need to find shortest path from source to destination. By convention, we consider source at stage 1 and destination as last stage.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgvx6ma206cprht0t68j.jpg)


The strategies that can be used are:
* Brute force method 
* Dijkstra’s Algorithm 
* Simple Greedy Method 
* Dynamic Programming
 
**Implementation**
```C
// C# program to find shortest distance
// in a multistage graph.
using System;
	
class GFG
{
	static int N = 8;
	static int INF = int.MaxValue;
		
	// Returns shortest distance from 0 to
	// N-1.
	public static int shortestDist(int[,] graph) {
		
		// dist[i] is going to store shortest
		// distance from node i to node N-1.
		int[] dist = new int[N];
		
		dist[N-1] = 0;
		
		// Calculating shortest path for
		// rest of the nodes
		for (int i = N-2 ; i >= 0 ; i--)
		{
		
			// Initialize distance from i to
			// destination (N-1)
			dist[i] = INF;
		
			// Check all nodes of next stages
			// to find shortest distance from
			// i to N-1.
			for (int j = i ; j < N ; j++)
			{
				// Reject if no edge exists
				if (graph[i,j] == INF)
					continue;
		
				// We apply recursive equation to
				// distance to target through j.
				// and compare with minimum distance
				// so far.
				dist[i] = Math.Min(dist[i], graph[i,j] +
											dist[j]);
			}
		}
		
		return dist[0];
	}
		
	// Driver code
	static void Main()
	{
		// Graph stored in the form of an
		// adjacency Matrix
		int[,] graph = new int[,]
		{{INF, 1, 2, 5, INF, INF, INF, INF},
		{INF, INF, INF, INF, 4, 11, INF, INF},
		{INF, INF, INF, INF, 9, 5, 16, INF},
		{INF, INF, INF, INF, INF, INF, 2, INF},
		{INF, INF, INF, INF, INF, INF, INF, 18},
		{INF, INF, INF, INF, INF, INF, INF, 13},
		{INF, INF, INF, INF, INF, INF, INF, 2}};
		
		Console.Write(shortestDist(graph));
	}
}

```
**Output**
```
9
```
**Time Complexity**
O(n^2)
Make your own YouTube AdBlocker for FREE!
Tags: easy, youtube, javascript, adblocker
Published: 2021-04-10 10:14:05

Hello! Are you tired of watching youtube ads? Why not make your own adblocker for free!
Let's start!

```JavaScript
setInterval(function(){
	
	var skipButton = document.getElementsByClassName("ytp-ad-skip-button");
	if(skipButton != undefined && skipButton.length > 0) {
			console.log("Ad detected");
			skipButton[0].click();
	}
	
}, 3000)
```

```JSON
{

	"manifest_version": 2,
	"name": "Youtube Ad Skiper",
	"description": "This extension will help you to watch your favorite videos, without the intervention of Advertisements!",
	"version": "1.0",
	"author": "CristoferK",
	"icons":{
		"600":"logo.png"
	},
	
	"browser_action":{
		"default_popup":"popup.html"
	},
	
	"content_scripts": [{
		"js": ["script.js"],
		"run_at": "document_idle",
		"matches": ["<all_urls>"]
	}],
	"permissions": [
		"tabs",
		"activeTab"
	]

}
```

Don't forget to subscribe to my YouTube channel for programming tutorials: https://www.youtube.com/channel/UCFzeA3xC-_i4ZT-XwcwsJxQ
My javascript / tech / web development newsletter for 2021-04-10 is out!
Tags: javascript, tech, webdev, discuss
Published: 2021-04-10 10:04:07

---
title: My javascript / tech / web development newsletter for 2021-04-10 is out!
published: true
description: A roundup of all the best javascript, tech and web development links posted to my linkblog in the past week
tags: javascript, tech, webdev, discuss
---
In this week’s edition:

Google vs Oracle, Mullenweg vs Wix, CoinbaseIPO, Microsoft AR/VR, english in the EU, TikTok Captions, LG, Yahoo Answers, hacking/cracking, JS classes, MediaQueries, blogrolls, Clubhouse, self-hosting

https://markjgsmith.substack.com/p/mark-smiths-newsletter-10-04-2021

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Ever thought of random numbers in CSS?
Published: 2021-04-10 09:32:06

New rand() function in CSS3 like math.rand() in JavaScript would be so good. There's rand with Sass, but it generates only static values. And there is an option of random numbers for CSS using JavaScript snippets. It isn't so cool and requires code. Definitely rand() in CSS3 is highly demanded, e.g. as calc().
Day 27 of 100DaysOfSwiftUI
Tags: swift
Published: 2021-04-10 09:27:55

I just completed day 27 of 100DaysOfSwiftUI. I worked on the Better Sleep app. I was able to implement prediction and also improve the UI of the app today.

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

Here's a link to the GitHub repo https://github.com/sanmiAde/BetterSleep
Top 10 Technologies to Learn in 2021 | Trending Technology 2021
Published: 2021-04-10 08:52:45

In this tutorial we will discuss about top 10 Technologies which you should learn.
{% youtube 4pdBhJns2nM %}
*Please Like the video and subscribe the channel👍*


###My Youtube Channel Please support me:###
[Top 10 Technologies to Learn in 2021](https://youtu.be/4pdBhJns2nM)
[Top 10 Programming Languages to Learn in 2021](https://youtu.be/IZHQypmB0iY)

### My Blogs###
[please check it](http://expoashish.blogspot.com/)

####🎥💡🔥AND Subscribe to Our YouTube Channel [bestcodecreator] (https://www.youtube.com/bestcodecreator) 


Thankyou
Game Kartu IDN POKER Asik Beragam dan Tidak Membosankan
Tags: idnpoker
Published: 2021-04-10 08:51:01

Bermain Judi bandar ceme online terpercaya di link resmi <a href="http://45.67.231.87/">IDN POKER</a>. Kamu Akan bisa memainkan beragam macam permainan yg ada.Semua permainan pada situs kami terjamin asli player vs player, Tersedia juga beragam permainan seru, mudah saat daftar dan login, membuat bettor tidak Akan merasa kerepotan dan bosan untuk bermain. kami salah satunya situs selain pkv games. yg telah menjadi agen judi idnplay terpercaya terkenal secara International di Asia. Jika tertarik bermain, maka daftar sekarang juga disini Situs <a href="http://45.67.231.118/">Poker88</a> idn Terbaik
How do you start your project?
Tags: discuss, help, beginners, womenintech
Published: 2021-04-10 08:31:46

Hello everyone,
I have been learning web development for about 2 years with some breaks as I am working as an IT technician and sometimes it can uneasy to get some free time and being dynamic to concentrate on project.

One of my hobbies is taking pictures, I like photography. And recently after making by cv online, I would like make a photo blog using Gatsby.

However, I think that most of the time, I go straight up to the development phase by started the HTML structure. Unfortunately, and I think you guess it, it starts to be messy as I ve made a plan!

I 've started to think about it and I know this is how you have to proceed to be efficient and not being lost like me.

That is what I try to set in mind before starting my project :

1. a sitemap
2. wireframe
3. define graphics
4. development
5. test
6. deployment

If anyone as advices or plan to follow in order to make easier to start a project I would appreciate.

I would be interested also to know how much time you spend on it. Of course, I guess that the first sketch won't probably be the only one and that most of the time, you have to change plans.

Thanks for all your advices
JavaScript Program to Check Leap Year Using Conditional Operator
Tags: html, css, javascript, codenewbie
Published: 2021-04-10 08:03:32

JavaScript Program to Check Leap Year Using Conditional Operator

must support == > https://codepen.io/Bilal1909/pen/dyNzzMz

{% codepen https://codepen.io/Bilal1909/pen/dyNzzMz %}
Use of mental models
Tags: beginners, motivation, writing, learning
Published: 2021-04-10 07:57:13

---
title: Use of mental models 
published: true
description: Models can be powerful tools, but they not always moves us forward. 
tags: beginners, motivation, writing, learning
//cover_image: https://direct_url_to_image.jpg
---

Mental models give us a shorthand to know how things work around us. Our brain constantly creates them to help us managing our life. This is a good thing, if the model is useful and help us move forward!

In software design, people love to invent new terms for already existing things. That is so far okay. Then they re-explain it as it was new and problem happens when they convince others that is available only to certain people...

When a developers says: _I don't know how to do UX. I just implement the code, I am not a creative kind._ This person often times has an image about a UX Designer, who effortlessly comes up with creative ideas and design wonderful screens and exactly knows what the user want. This is not empowering. 

Of course the reality might be different. Still that model exist in the dev's mind and it might block her to level up. 

Useful mental models like performance, authentication ... are super useful, but for some other models we might need to dig deeper to re validate our understanding.
JavaScript functions are first-class objects.
Tags: jsfunctions, functions, functionaljavascript
Published: 2021-04-10 07:27:19

---
title: JavaScript functions are first-class objects.
published: true
description: 
tags: jsfunctions, functions, functionaljavascript
//cover_image: https://direct_url_to_image.jpg
---

In JavaScript, functions are first-class objects (first-class citizens) where they are treated like any other variable. Functions can be stored in variables, can be passed as parameters in other functions, and can be returned from other functions.

1.Storing function in a variable

```js
function division(a, b) {
   return a/b;
}

const res = division;
```
In `const res = division`, we did not execute the function but reference the function.

> Mostly invoking/executing the function requires `()` parentheses in JavaScript. Otherwise, it's a reference to the function itself

Invoking:

```js
console.log(res(21, 7)) //3
``` 

2.Passing function as an argument.

```js
function multiply(a, b, fn) {
  return fn(a,b) * 3
}

const res = multiply(21, 7, division);  

console.log(res); // 9

```
Here `const res = multiply(21, 7, division);` we are referencing `division` function. Clarity, in line `return fn(a,b) * 3` we are not returning a function, we are invoking `fn` (a function reference) which divides `a` by `b` then multiplies 3 and `return` keyword returns the result.  

3.Returning function from another function.

```js
  function division(a) {
    return function (b) {
       return a/b;
    }
  }

  const res = division(21)
  const dividend = res(7) 

  console.log(dividend) //3
```


> 
If you don't understand or confused with what is going on in the above code that's alright, we have been using some advanced concepts there, such as `higher-order functions`, `function closures`, `currying functions`. And those will be explained in detail in the next article. 

If you say "why don't we just do `function division(a, b) { return a/b; }`, it's much simpler ", you are not wrong! But currying gives us a reusability, for example: 

```js
  function division(a) {
    return function (b) {
       return a/b; 
    }
  }

  const res = division(21);
  
  const dividend = res(7);
  console.log(dividend); //3 
  
  const anotherOne = res(3);
  console.log(anotherOne); // 7
  
```

We can keep dividing 21 by other values. Just like wiki said we can nest multiple functions, take one argument.

```js
  function division(a) {
    return function (b) {
       return function (c) {
          return a/b/c; 
      }
    }
  }

  const res = division(12);
  const res2 = res(2); 
  const res3 = res2(2); 

  console.log(res3); //3
```
(Check out the example on JS bin)[https://jsbin.com/dutufuxiza/edit?js,console]

Summary,  functions in JavaScript are values, they can be stored in variables, they can be used in objects as properties or in arrays as an array element and they can be returned or passed as arguments to functions.
Introduction to Database Transaction
Tags: database, sql
Published: 2021-04-10 07:25:07

## Database Transaction

Database transaction is a collection of multiple database operations (ex: `SELECT`, `UPDATE`, `DELETE`, or `INSERT`) as a single unit of work. It represent real-world events of any company. Error handling becomes much simple for an application when using transactions.

We can define where the transaction will begin and when the transaction will end. To start the transaction we use `BEGIN` syntax.

If queries in a transaction ran successfully, then we save the changes using `COMMIT` syntax. If queries in a transaction failed to run, then we revert the changes before the transaction ran using `ROLLBACK` syntax.

Now, let's see the example of a transaction.

## Example

Alice wants to transfer $100 to John. In the database, `ACCOUNT` table stored Alice and John account data.

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

In a transaction, the operations are:

```sql
// Select Alice account data
// Check the balance
SELECT BALANCE FROM ACCOUNT WHERE ID = 1

// Substract 100 from Alice balance
UPDATE ACCOUNT SET BALANCE = BALANCE - 100 WHERE ID = 1

// Add 100 to Alice balance
UPDATE ACCOUNT SET BALANCE = BALANCE + 100 WHERE ID = 2
```

If the operations was success, then we have to commit the transaction using `COMMIT`

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

If one of the operations was failed, then we have to rollback the transaction using `ROLLBACK`

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

## Sources

[Wangde - A Deep Dive into Database Concurrency Control](https://www.alibabacloud.com/blog/a-deep-dive-into-database-concurrency-control_596779)

[Pulkit Gupta - System Design: Database Transactions & ACID compliance (Part 1)](https://medium.com/@pulkitent/system-design-database-transactions-acid-part-1-45de4c350ff2)

[Adam Edelweiss - Relational Database 10 | Database Transaction](https://medium.com/adamedelwiess/relational-database-10-database-transaction-326eea02f87a)

[Hussein Nasser - What is a Database transaction?](https://www.youtube.com/watch?v=P80Js_qClUE)
Some tips for your first job as a developer
Tags: career, beginners, programming
Published: 2021-04-10 07:15:42

## Be honest
Never lie if you don't know something. Let your manager know about it.

## No showing off!
No Manager likes a newbie telling him/her how they should go about the business.

## Be Motivated!
You have to justify your selection in the company and prove you have all that it takes.

## Learn from your teammates
Always learn from your seniors and their experiences.

## Maintain a good rapport with your managers
Apart from working hard and adding value to your organization, it's very important to be on good terms with your managers. It will help you in growing in the organization.

Follow us on Instagram for more such content
https://www.instagram.com/the.ninja.programmer/

Let us know your thoughts in the comments below 👇