teleren/devto huggingface dataset:
Text processing with awk
Tags: bash
Published: 2021-01-16 10:27:36

From Wikipedia:
> AWK is a domain-specific language designed for text processing and typically used as a data extraction and reporting tool. Like sed and grep, it's a filter, and is a standard feature of most Unix-like operating systems.

We can do all sort of things with `awk`, for example suppose that we have a CSV file which contains list of cities, Now we want to take this file and turn it into a JSON file, all we need to do is go to terminal and type this command:

```bash
awk 'BEGIN { 
  print "{ results: [" }
END {
  print "]}\n"
}
{ gsub(/"/, "", $2) gsub(/"/, "", $3) gsub(/"/, "", $4)
  print "{ id: " $1 ", name: \"" $2 "\", countryCode: \"" $3 "\", district: \"" $4 "\" }"
}' cities.csv
```

In fact `awk` is a programming language which means that it `if, loop, variable assignments,...`:

```bash
awk -v date="$(date)" -v title="Report Generated By Sirwan Afifi" -F';' 'BEGIN { 
  SPACE = 50;
  printf("%s \n", title)
  print "{ results: [" }
END {
  print "]}\n"
  for(space = 0; space < SPACE; space++) printf "-";
  printf("\nFound %d results\n", city)
  printf("Report generated at %s\n", date)
  space = 0; do { if (space == 0 || space == 49) 
                      printf "*" 
                  else 
                      printf "-"; space++ 
            } while (space < SPACE);
  print "\n"
}
{ city = city + 1
  gsub(/"/, "", $2) gsub(/"/, "", $3) gsub(/"/, "", $4)
  print "{ id: " $1 ", name: \"" $2 "\", countryCode: \"" $3 "\", district: \"" $4 "\" }"
}' cities.csv
```
Polkadot forecast 2021 to 2025
Tags: blockchain, cryptocurrency, polkadot, investing
Published: 2021-01-19 08:31:35

---
title: Polkadot forecast 2021 to 2025
published: true
date: 2021-01-16 10:17:07 UTC
tags: blockchain,cryptocurrency,polkadot,investing
canonical_url: https://medium.com/coinmonks/polkadot-forecast-2021-to-2025-d2ec0b8310b9
---

[![](https://cdn-images-1.medium.com/max/784/0*Jajss9cfEtPbqdvt.jpg)](https://medium.com/coinmonks/polkadot-forecast-2021-to-2025-d2ec0b8310b9?source=rss----721b17443fd5---4)

This is how Polkadot (DOT) could develop

[Continue reading on Coinmonks »](https://medium.com/coinmonks/polkadot-forecast-2021-to-2025-d2ec0b8310b9?source=rss----721b17443fd5---4)
Encrypt Sensitive Data in Salesforce and Comply with Security Regulations
Tags: salesforce, security, database
Published: 2021-01-16 09:55:51

Find out how with multiple #encryption methods available, #Salesforce ensures #data #security and compliance with existing regulations, such as GDPR5, HIPAA, NYCRR 500, PCI DSS, CCPA. [Read here](https://www.brimit.com/blog/encrypt-sensitive-data-in-salesforce-and-comply-with-security-regulations)
How to change your last commit Author in Git
Tags: git, github
Published: 2021-01-16 09:15:13

The following steps can be used to change Author in Git:
- launch terminal.
- run `git commit --ammend --author="Author's name<email address>"`. This opens the vim editor to edit and save changes.
- press `esc` on your keyboard to switch to command mode.
- press`:` (colon) to open the prompt bar at the bottom of the vim editor.
- type `x` after the colon and press **enter**.

This will save the changes made and exit the vim editor.

visit my [blog](https://judithoiku.tech/) for more related articles.
My javascript / tech / web development newsletter for 16-01-2021 is out!
Tags: javascript, tech, webdev, discuss
Published: 2021-01-16 08:48:36

---
title: My javascript / tech / web development newsletter for 16-01-2021 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:

VanillaJS, JS for visual arts, cool internet history, IoT, IoM, AV1 codec, APIs, cool CES gadgets, smartglasses, Lucasfilm, Trumpban, Web design trends, ESM, web components, Docker, OSS, M1 Linux...

https://markjgsmith.substack.com/p/mark-smiths-podcast-15-01-2021

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
The past, present and the future of database - Online Live Discussion - Alibaba Damo Academy
Tags: database, datascience, machinelearning, sql
Published: 2021-01-16 08:43:49

Happy weekend everyone. Good news for all those who have strong interests in database technology. Now, an open talk upon the past, present and future of database is on. And it's free to join, so why not? 

【Agenda Today】

4:00 pm( UTC +8:00)
 Logistics robot “XiaoManLu" will take you on a tour of the Ali campus

6:00 pm( UTC +8:00)
Talking to Feng Shen, the technical leader of the cloud-native data lake analysis(DLA) on Alibaba Cloud, watching Chinese and British database experts discuss the past, present and future of databases.

At Bilibili #Alibaba DAMO Academy# channel, watch live and win the opportunity to get surprise prizes, come on ~ ~ ~ ~!

【Watch Now】
https://www.youtube.com/watch?v=l9kb3uP2z44&t=3s
Calling Rust from Common Lisp
Tags: commonlisp, rust, interop
Published: 2021-01-16 08:23:25

---
title: Calling Rust from Common Lisp
published: true
description: 
tags: CommonLisp,Rust,interop
//cover_image: https://direct_url_to_image.jpg
---

I didn't do anything fancy. I create C compatible wrapper in Rust, and call the wrapper from Common Lisp using [CFFI](https://www.common-lisp.net/project/cffi/).

My C compatible wrapper functions

```Rust
#[no_mangle]
pub extern "C" fn zstd_line_read_new<'a>(zstd_file_path: *const c_char) -> *mut c_void {
    let r_zstd_file_path = unsafe { CStr::from_ptr(zstd_file_path) };
    let file = File::open(r_zstd_file_path.to_str().unwrap());
    if file.is_err() {
        eprintln!("Cannot open file {}", r_zstd_file_path.to_str().unwrap());
        return ptr::null::<c_void>() as *mut c_void;
    }
    let file = file.unwrap();
    let wrapper = DecoderWrapper::new(file);
    Box::into_raw(Box::new(wrapper)) as *mut c_void
}

#[no_mangle]
pub extern "C" fn zstd_line_read<'a>(reader: *mut c_void) -> *const c_char {
    let wrapper: *mut DecoderWrapper<'a> = reader as *mut DecoderWrapper<'a>;
    let mut line = Vec::with_capacity(BUF_SIZE);
    unsafe {
        match (*wrapper).read_line(&mut line) {
            Ok(len) => {
                if len == 0 {
                    return ptr::null();
                } else {
                    return CString::from_vec_unchecked(line).into_raw();
                }
            }
            Err(e) => {
                panic!(e)
            }
        }
    }
}
```

I added this to Carto.toml

```Toml
[lib]
crate-type = ["cdylib"]
```

It makes Cargo create DLL on Windows or .so on Linux instead of Rust specific library format.

In my Common Lisp code:

```Lisp
(ql:quickload :cffi)
(defpackage :t1
  (:use :cl :cffi))
(in-package :t1)

(define-foreign-library zstd_read_line
  (:win32 (:default "./target/release/zstd_read_line"))
  (t (:default "./target/release/libzstd_read_line")))

(use-foreign-library zstd_read_line)

(defcfun ("zstd_line_read_new" create-zstd-reader) :pointer (zstd_archive_path :string))
(defcfun ("zstd_line_read" zstd-read-line) :string (reader :pointer))

(let ((reader (create-zstd-reader "test1.txt.zst")))
  (loop for line = (zstd-read-line reader)
    while line
    do (print line)))
```

It required Quicklisp for install CFFI. This process doesn't require cbindgen because I define C interface in Common Lisp manually, as you may see at defcfun.

And then it works even on Windows 10.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qbgjuou7jic8ajuu08mb.png)
How can I find people I've message before on Discord?
Tags: help, watercooler, discord
Published: 2021-01-16 07:57:23

[Original post](https://www.reddit.com/r/discordapp/comments/kye87c/how_can_i_findmessage_someone_ive_messaged_before/).


I just wanted to ask if their was a way you could find (and message) people that you've messaged before.

Say I'm in the scenario of someone who isn't in the same server(s) as someone, and I've removed them from my DMs list. And they've changed their username. How could I find them?

<div alt="Thanks! Cheers!">
##<b><center><b>Thanks in advance!<br/>Cheers!</b></center></b>
</div>
A Small Wrong Doc Section (or Correct me if I am Wrong)
Published: 2021-01-16 07:56:28


> Please Feel free to Comment or Point of Errors or Write your Own View Point
Also Correct me if the Article is WRONG or a OLDER one

While I was reading this Article:
(Nginx Doc) [https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/]

I Found a Wrong Description in the Doc at Section:
(Nginx Name Based Https Servers) [https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/#name-based-https-servers]

The Doc says that below Things
(Doc Says) [![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8qer348uanht6k1zebwc.png)]


According to me 
In Simple Words, the `server_name` is the one which will basically checks the SNI as well as the Host Field.

Is it a Old Doc then it should changed.

I will add the Practical Setup to explain about the `server_name` working and basic nginx setup soon...
Enough JavaScript to get you Started : #10 Objects
Tags: javascript, webdev, 100daysofcode, beginners
Published: 2021-01-16 07:27:12

> Everything is Object in JS

### What are Objects ?
👉 Let's forgot about JS objects and talk about real world objects , every object in real world have certain properties and behaviors.

👉For Example : Girlfriend 😁 , yes ! girlfriend is object , girlfriend have properties like hairColor,eyeColor,name,number,address,likes,dislikes etc... 

👉 In JavaScript Object can be defined as group of related properties.

👉 Grouping all the related properties to one thing (ex. Car, GF) makes much more sense , because now it's all stored in one place and is easy to access.

👉 Objects come under category of **composite** data type , which means mix and match of primitive data types.

### How Objects work?

![Artboard – 8.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1610015370516/TkhbmWqkR.png)

👉 as we can see we grouped all the related properties under one variable namely **girlfriend**

👉An object is a collection of properties, and a property is an association between a name (or key) and a value.

### Before making object keep in mind

👉 Objects always work in key value pair **[eg. name:"john"]**

👉 Arrays are always objects in JS.

👉 Functions are always objects in JS.

👉 Objects are always embedded in curly braces **{}**


### Syntax 
```
var object = {
      property : value,
      property2: value,
      ....
}
```

### The Girlfriend Object 😍
```
let girlFriend = {
     name : "alexa",
     surname : "grace",
     likes: ["reading","football"],
     number : 123456789
}
```
👉 We can access object properties using "."

👉 For Example `girlFriend.name` gives output "alexa"

👉 `girlFriend.likes` gives us array `["reading","football"]` as output

<p>Let me know in comment section if you have any doubt or feedback. it's always worth to give time to thriving developer community :) <br>
<br>
Keep Coding ❤
</p>

#### Hey , Let' Connect👋
 [Twitter](https://twitter.com/codarsh) / [Github](https://github.com/WhoAdarshPandya/)
Change Laravel's exception screen code editor
Tags: laravel, php, tooling
Published: 2021-01-16 07:24:08

---
title: Change Laravel's exception screen code editor
published: true
description: Want to use a code editor that isn't PhpStorm on Laravel's exception handling screen? You can configure Ignition to use VS Code and other popular editors.
tags: Laravel,PHP,Tooling
//cover_image: https://direct_url_to_image.jpg
---

One of Laravel's killer features is [Ignition](https://flareapp.io/docs/ignition-for-laravel/installation), a gorgeous error screen made by the good people at [Spatie](https://spatie.be/). Ignition shows the entire call stack, and if you hover over a line of code, you can click a pencil icon to take you to that exact line in a code editor. Unfortunately for me, the default editor is set to PhpStorm and I'm an avid VS Code user.

Thankfully, changing the default code editor is straightforward. Open your project's `.env` file and add `IGNITION_EDITOR` as an environment variable.

```sh
# Supported editors include "phpstorm", "vscode", "vscode-insiders",
# "sublime", "atom" and "nova"

IGNITION_EDITOR="vscode"
```

## Changing other Ignition settings

To see all of Ignition's configuration, visit the [Ignition installation page](https://flareapp.io/docs/ignition-for-laravel/installation) and follow along with the section about publishing configuration files. Running the command to publish your config files will create `config/ignition.php` within your project, which includes full notes about each setting.

If you'd rather just use your `.env` file for configuration, copy the `config/ignition.php` settings into your `.env` file, then delete Ignition's config file when you're done. Everything will continue to work.

I hope this post saved you some time!
In the DeFi track, how does DEX rookie YFX quickly occupy the high ground of decentralized perpetual contracts?
Published: 2021-01-16 07:17:46

The DeFi world is changing rapidly and new gameplay is updating everyday. As the most popular and fastest-developing trading product in the DeFi field, DEX obviously will not miss the fastest-growing derivatives market in the cryptocurrency trading market. In the field of cryptocurrency derivatives, the distinctive perpetual contract has naturally become a high ground for competition in the new battlefield of DEX derivatives.

It is understood that since 2020, at least seven DEX platforms including YFX, DerivaDEX, dYdX, Futureswap, Injective Protocol, MCDEX, and Strike Protocol have announced the launch (or will launch this year) of the decentralized perpetual contract trading market and every of the platforms has adopted different designs in terms of transaction mode, contract mechanism, product specifications and infrastructure, which means all have its own characteristics and strengths.

Compared with several other DEXs, YFX's advantages are particularly obvious and the trading process is more convenient.

1. YFX is the world's first and only decentralized derivatives trading platform that supports 100x leverage trading.
2. YFX is the first platform that launched on the TRON mainnet and the handling fee during transfer and transaction is the lowest among all DEXs.
 3. YFX only supports decentralized derivatives trading and the products are more professional and convenient. 
4. YFX is the world's first cross-chain decentralized derivatives trading platform that supports the four public chains of ETH, TRON, BSC, and Heco. 
5. All funds of YFX are managed by smart contracts. The platform cannot operate any funds of users. All smart contract codes are open source and have been audited and verified by professional institutions. Through smart contracts, users can deposit and withdraw their funds at any time. 
6. YFX is the world's first decentralized contract trading platform that supports USDT、coin and hybrid swap. 
7. YFX’s current trading method adopts an isolated margin trading method, each order is independent of each other, profit and loss are independently settled. 
8. YFX applies the QIC-AMM market maker pool trading method to provide users with extremely high liquidity and extremely low trading slippage. Traders directly trade with QIC-AMM to open and close their position. The depth is a function of the available balance of the LP pool, there is no impermanence loss in the LP pool.
Todo with React Hooks
Tags: react, todo, javascript, hooks
Published: 2021-01-16 06:47:50

I started journey to learn ReactJs. Where ever I go the first major project would be  **ToDo** Application.
So , I have decided to build one with ReactJs.

>you can the speed code at [youtube](https://youtu.be/BjI18tY5TA8) 

I am so bad at styling, so I choose minimal design.

**App.css**
```css
.head{
    text-align: center;
}
.todo{
    margin:10px 10px 10px 10px;
    text-align: center;
    font-size: 140%;
    cursor: pointer;
}
.TodoInput{
    width: 50vw;
    height:4vh;
    border-radius: 4px;
    font-size: 140%;
    margin:auto;
}
```

so the final **App.js** would be
```react
import React,{useState} from 'react';
import './App.css';

export default function App() {

//states
const [todos,setTodos]=useState([]);


const toggleComplete=index=>{
  var newTodos=[...todos]
  newTodos[index].isComplete=!(newTodos[index].isComplete)
  setTodos(newTodos);
}

const addTodo=(text)=>{
  
 const newTodos=[...todos,{todo:text,isComplete:false}];
 setTodos(newTodos);
 
}

const handleClear=e=>{
e.preventDefault();
setTodos(todos.filter(todo=>todo.isComplete!==true))
}
  return (
    <div>
      <h1 className="head">To-Do`s</h1>
      <h4 className="head">Pending Tasks({todos.filter(x=>x.isComplete!==true).length})</h4>
    <hr/>
  <TodoForm addTodo={addTodo}/>
    <hr/>
    <div className="todolist">
      {todos.map((todo,index)=>(
        <Todo 
        key={index}
        index={index}
        todo={todo}
        toggleComplete={toggleComplete}
        /> 
      ))}
    </div>
    <center><button onClick={handleClear}>Clear Completed</button></center>
    </div>
  );
}

//Todo display

function Todo({todo,index,toggleComplete}){
 
  return(
    <div className="todo"
    onClick={()=>toggleComplete(index)}
    style={{textDecoration:todo.isComplete?'line-through':''}}
    >{todo.todo}</div>
  );


}

// Add Todo

function TodoForm({addTodo}){
const [text,setText]=useState("");

const handleSubmit=e=>{
  e.preventDefault();
  addTodo(text);
  console.log(text);
  setText("");
}
return(
  <div>
    <center>
    <form onSubmit={handleSubmit}>
      
    <input
    className="TodoInput"
    value={text}
    onChange={(e)=>setText(e.target.value)}
    placeholder="enter the Todo"
    />
   </form>
   </center>
  </div>
);
}
```
Full Tutorial #4: Setting Up the Authentication Endpoint | Microservices Chat App Using React, Node.js, TypeScript and GraphQL
Tags: react, node, webdev, javascript
Published: 2021-01-16 06:29:14

**About Me:** I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at [Better Coding Academy](https://codebetter.com.au), and as part of what I do, I post videos on our YouTube channel at [https://www.youtube.com/c/BetterCodingAcademy](https://www.youtube.com/c/BetterCodingAcademy).

_(Subscribe for awesome web development content!)_

Part 4 of the Microservices Chat App is here! In this episode, I set up an authentication endpoint inside of the Express server we set up in the previous episode, now allowing us to log users in.

{% youtube 6IiF5e-Po3c %}

Happy coding!

Source code: [https://github.com/lucaschen/microservices-chat-demo](https://github.com/lucaschen/microservices-chat-demo)
Announcing the launch of a FREE React course 🚀
Tags: javascript, react, codenewbie
Published: 2021-01-16 06:27:34

![Learn React Router For FREE](https://gist.github.com/myogeshchavan97/aa75611665802aadfd3ba6bfeb0fe59b/raw/e05cfaf6ffdb0894be8e4884429bc4f1b47955fb/router.png)

Learning React is not easy. It's just a view library so it does not give you everything you need to build large scale apps.
​
So when it comes to learning React, just learning core React is not enough. You also need to use external libraries like Redux for managing complex state, React Router for managing routing and so on.
​
So I have launched a FREE React Router Course! 🥳

What's Inside the course?
* Get hands-on experience by writing and understanding each line of code
* Learn through live Code Sandbox demos in each section
* Learn the basics of React Router
* Learn how to avoid performance issues while creating routes
* Learn why some routes never get rendered by default and how to fix it

and much more...

I can't wait to see you inside. Click the below link to access the course for FREE.

### [​ENROLL ME IN THE FREE REACT ROUTER COURSE​](https://yogeshchavan.dev/react-router-introduction)

Happy Learning!

------

**Subscribe to my [weekly newsletter](http://yogeshchavan.dev/) to get amazing tips, tricks, articles and discount deals directly in your inbox.**


[<img src="https://cdn.buymeacoffee.com/buttons/default-yellow.png" >](https://www.buymeacoffee.com/myogeshchavan97)
Launching my Patreon Page
Tags: productivity, startup, webdev, cloud
Published: 2021-01-16 06:26:05

Hi friends. As the title suggests, this is a blog post announcing the launch of my patreon page: https://patreon.com/vignesh

Here is the introductory video from me regarding the same:

{% youtube 1CQss9SEaao %}

*Excuse me, since I repeatedly used the word Patreon many times instead of Patron in the video 😂

While I truly believe that knowledge should be free for all, I also do believe that it should be sustainable over a long period of time for the creators to keep making amazing content for the community.

This is where a platform like Patreon or Open Collective can really help as creators like me spend the valuable time creating quality content for all of the community.

You might have seen some posts from me in [Dev.to](https://dev.to/tvvignesh) or [Medium](https://medium.com/@tvvignesh) and some live streams from my [Youtube channel](https://www.youtube.com/channel/UCLnTH4GOCB5fXWoOfgklQwA) as well.

While I would love to create content for all, I would also like to have more motivation and incentive to do so over a long term and as you might already agree, money can be a pretty good motivator 😉.. 

Just kidding, but its true.

For all those who cannot afford, all the content will always be available free for everyone, but the patreon members will get access to the content 2 months in advance along with a host of other benefits as outlined in [our tiers](https://www.patreon.com/vignesh).

I don't want to monetize with ADs or paywalls at this point since that might hinder your experience as a user and hence am sticking to Patreon.

I will maintain a consistent schedule to release content. The frequency of the content I release will depend on the number of Patreon members I get. The more the members, the higher the frequency.

You can expect the first video to be released on the first week of February 2021 or as soon as I get 50 patrons, whichever comes first 😉

While I do all of this, I also plan to take up part-time/freelance consultancy/advisory roles as mentioned in the video though it has limited availability since I spend most of my time working on my startup, [Timecampus](https://timecampus.com/).

If you have any expectations on the content, do let me know (even if you don't want to opt in for Patreon). I would like to align with your interests and deliver what is of more value to you in the best way possible more than anything else.

If you have any suggestions or would just like to have a quick chat with me, feel free to reach out to me anytime.

Looking forward to creating awesome content for you.

And if you want to reach out, this is where you can find me:

LinkedIn: https://www.linkedin.com/in/tvvignesh
Twitter: http://twitter.com/techahoy
Medium: https://medium.com/@tvvignesh
Github: https://github.com/tvvignesh
Dev.to: https://dev.to/tvvignesh
Instagram: https://instagram.com/tvvignesh

Cheers,
Vignesh T.V.

PS: I am not sure if Dev.to has tags for these kinds of posts. So, rather tagging it with the kind of content I will be releasing in my page.
Eisenhower Matrix: Make sense of task priority
Tags: productivity
Published: 2021-01-16 05:07:53

A universally applicable yet straightforward to understand tool can help you make sense of task priority. When you are swamped with work, use this tool.

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

https://dzone.com/articles/a-simple-and-universal-prioritization-technique-de