teleren/devto huggingface dataset:
JQ Cheat Sheet
Tags: jq, cheatsheet, json
Published: 2021-06-28 09:35:00

JQ is a lightweight and flexible command-line JSON processor. This is a cheatsheet of commands and function that I’ve found useful for quick reference. You can  [get full JQ Cheat Sheet Here](https://cheatsheetmaker.com/jq-cheat-sheet) .

## Common usages

Here are some common ways jq is utilized.

### Piping from curl

\# get the Astronomy Picture of the Day (APOD)
curl -s https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY | jq
(Note that piping to jq with no jq script will just format and colorize the JSON. Nice!)

### From a JSON file

Just pass the file path after the jq script.

```
jq '.name' package.json
``` 

### In a chain of pipes
You’ll probably want to use the -r (raw) command if you’re using it in a pipeline or saving the output to a variable. -r gets rid of formatting like quotes and spaces for single values. For objects, it outputs valid JSON so it will have quotes.

```
# this downloads the latest APOD and saves to a file
url="https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY"
curl -o apod.png "$(curl -s $url | jq -r '.hdurl')"
``` 

## Common selectors

### Get a named property


```
echo '{"id": 1, "name": "Cam"}' | jq '.id'``
# 1
``` 


``` 
echo '{"nested": {"a": {"b": 42}}}' | jq '.nested.a.b'
# 42
``` 

### Get an array element by index


```
echo '[0, 1, 1, 2, 3, 5, 8]' | jq '.[3]'
# 3

``` 

### Get an array element’s property

```
echo '[{"id": 1, "name": "Mario"}, {"id": 2, "name": "Luigi"}]' | jq '.[1].name'
# Luigi
``` 

### Slice an array

Slices an array on by index.

```
echo '["a", "b", "c", "d"]' | jq '.[1:3]'
# ["b", "c"]
``` 

Either the first or last index can be omitted to go from the begining or end.

```
echo '["a", "b", "c", "d"]' | jq '.[1:]'
# ["b", "c", "d"]
``` 

Creating a new object

The syntax looks like this: { myPropertyName: .propertyFromJSON }

```
echo '{ "a": 1, "b": 2 }' | jq '{ a: .b, b: .a }'
# { "a": 2, "b": 1 }
```
Laravel Domains Panel
Tags: php, laravel, package
Published: 2021-06-28 09:34:30

---
title: Laravel Domains Panel
published: true
description: A Laravel Tool to internal domains, subdomains and URLs status check.
tags: PHP, Laravel, Package
//cover_image: https://direct_url_to_image.jpg
---

My company has released a tool for the internal control of domains, subdomains, certificates and URLs status.

https://github.com/nitsnets/Domains-Panel

The software is Laravel 8 + PHP 8 + MySQL 8.

Repository README is in spanish, but is easy to follow all steps:

1. Create the MySQL database.

2. Clone the repository.

    ```

      git clone https://github.com/nitsnets/Domains-Panel.git
      
    ```

3. Launch first time composer install with (remember to use PHP 8.0 binary).

    ```

      composer install --no-scripts && composer install
      
    ```

4. Configure the .env file with the necessary data.

    ```

      cp .env.example .env
      
    ```

5. Generate the application key.

    ```

      php artisan key:generate
      
    ```

6. Regenerate the cache.

    ```

      composer artisan-cache
      
    ```

7. Launch the initial migration.

    ```

      php artisan migrate
      
    ```

8. Launch the seeder.

    ```

      php artisan db:seed --class = Database\\Seeders\\Database
      
    ```

9. Configure the cron task for the user related to the project:

    ```

      * * * * * cd /var/www/status.domains.com/httpdocs && php artisan schedule:run >> storage/logs/artisan-schedule-run.log 2>&1
      
    ```

10. Create the access user (User registration is only available from the terminal).

    ```

      php artisan user:create --email=user@domain.com --name=Admin --password=StrongPassword2
      
    ```

11. Configure the server for web access with `DOCUMENT_ROOT` in public.

As design pattern we are using a custom domains pattern with factories instead dependency injection: https://github.com/nitsnets/Domains-Panel/tree/master/app/Domains

Feedback is welcome :)
English Learning Tips for Beginners
Tags: spoken, english, training
Published: 2021-06-28 09:18:32

Seven Mentor is one of the best training providers. you can observe the amazing atmosphere of computer networking is to understand the digital world with new technology. English speaking course helps one to reinforce his/her English skills and thus, improve their personality. Many students enroll in Spoken English courses to speak fluent English.

There are sort of the way you'll learn English by yourself. Learning English by yourself are often a challenge but it's possible. There are ways you'll improve your reading, writing, listening and speaking skills — albeit there's no-one physically around you to help you practise.

Get more info: https://www.sevenmentor.com/ 

English Learning Tips for Beginners
Listen to English a day. hear English radio.
• Make an English/ESL friend. structure conversations.
• Read English stories. Start with children's books.
• Write down new words. Start a notebook for brand spanking new words.
• Keep an English diary.

Some Reasons Why Improving Spoken English Skills is vital
Some people might consider spoken English as only one piece of “English learning.” But there’s actually tons of importance there to Spoken English Course in Bangalore
By improving your spoken English skills, you gain tons of advantages:
• You actively practice almost everything you recognize, including pronunciation, grammar 
and vocabulary.
• you'll answer native English speakers (rather than only listening).
• you'll make new friends through great conversations.
• Your English will sound more “natural” (native) rather than sounding such as you are using 
phrases from textbooks.
• you'll confidently run through any real-life situations where English communication is 
required, like getting to school, work or the grocery.

For more info visit at: https://www.sevenmentor.com/spoken-english-classes-in-bangalore
What is BIG O notation ?
Tags: algorithms, computerscience, datascience
Published: 2021-06-28 09:07:50

<h1>What is Big O notation ?</h1>


Ans: 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pc41vnsqkjz6tkzy6kyv.png)

No No, I am not talking about this Big O 😂😂

So in the field of programming, One of the most important things that you have to know is that how to make your code efficient, and by efficient I mean readable and scalable!

To measure how good a code is we use the **BIG O NOTATION**

<h2>What is Big O notation ?</h2>

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whp6kq0wgna39bqqtesm.png)
 

<h3>Big O notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by Paul Bachmann, Edmund Landau, and others collectively called Bachmann–Landau notation or asymptotic notation.</h3>


As in the given figure, there are a total of 7 types of Big O notations: 


1) O(1) Constant- no loops 

2) O(log N) Logarithmic- usually searching algorithms have log n 
   if they are sorted (Binary Search)

3) O(n) Linear- for loops, while loops through n items

4) O(n log(n)) Log-Linear- usually sorting operations

5) O(n^2) Quadratic- every element in a collection needs to be compared to every other element. Two
nested loops

6) O(2^n) Exponential- recursive algorithms that solve a problem of size N

7) O(n!) Factorial- you are adding a loop for every element

{% twitter 1409126072872968192 %}

*As given in the graph the best notation to use is the O(1) or O(log n) and on the other hand the worst one to use is O(n!)* 

As a Developer, you need to be able to find which notation will save you the best amount of time as well as be readable to other developers. If you are able to do this you will be a  superstar at your company !!!!

Happy Coding 🚀
Need some learning resource
Tags: cpp, crow, webdev, help
Published: 2021-06-28 08:57:06

Recently I got interested in back end web development with C++  & found a framework named crow which is written in C++. I liked it but I couldn't find enough learning resource for this framework on Google , YouTube , SO and other places. Also the official repo of this framework is not that well documented. Is there anyone who can provide me with some good tuts , blogs or videos on this framework ? 

Thanks in advanced.
Best Ways To Optimize React Sites
Published: 2021-06-28 08:56:43

React Performance Optimization is easy to achieve with the following simple steps.

- Using **React Hooks** and working with functional programming
- Use **React.memo** for Component Memorization
- Using the **shouldComponentUpdate** Life Cycle Event
- Using **Lazy Loading** of React Components
- Use **React Fragments** to Avoid Extra Tag
- Do Not Use **React Inline Function Definition**
- Avoid Async Requests in **componentWillMount()**
- **Bind Function** Early in Constructor
- **Arrow Functions** vs **Binding** in Constructors
- **Avoid Using Inline Style** Attribute
- Optimize **Conditional Rendering** in React
- **Don’t Derive Data** in the Render Method
- **Create Error Boundaries** for the Components
- **Immutable Data Structures** for Components
- Using a **Unique Key** for Iteration
- **Throttling** and **Debouncing** Events
- Using **CDNs** for **External Resources**
- **CSS Animation** Instead of JavaScript Animation
- Enable **gzip Compression** on the Web Server
- Use **Web Workers** for CPU Extensive Tasks
- **Server-Side Rendering** of the React Component

#Some Videos To Refer <br /><br /><br />

{% youtube o-alRbk_zP0 %}

#Some article's and Links To Refer

`10 Ways to Optimize Your React App’s Performance`
{% medium https://blog.bitsrc.io/10-ways-to-optimize-your-react-apps-performance-e5e437c9abce %}

{% post https://dev.to/sagar/things-should-be-considered-while-writing-your-react-components-3n4a %}

{% post https://dev.to/harshdand/react-performance-optimization-tips-4238 %}
How to Choose the Best Task Management Software for Your Workplace

Tags: productivity
Published: 2021-06-28 08:56:32

A hectic schedule has become a norm these days. But, at times, it can be an outcome of poor task management at the workplace. How can you get rid of this? Well, an best task management software can be your answer. As per the PMI survey, around 10 cents on every dollar is wasted due to poor task management. It is fair to mention that a robust task management system can boost performance and your team can manage tasks more effectively.

The best task management tool can enable your team to streamline important tasks, automate repetitive processes, and enhance coordination among colleagues. Here we are going to discus the top tips to select the right project tracker tool or task management app for your workplace. But before digging deep, let’s go through three key reasons we should use task management software at the workplace.

<h2>Why Should We Use Task Management Software?</h2>
A PMI research has revealed that as many as 66% of companies that use task management software can complete projects within their predefined budget. Simply put, it is necessary to select the right task management solution for leveraging the benefits of proper task and time management.

<b>Here are the major reasons for using feature-rich task management software.</b>

<h3>1. Brings Automation</h3>
Task management software can automate boring, recurring and mundane tasks. It is easy to prioritize tasks and check the status of multiple projects in the real time using this software. Your team members can focus more on other important stuff with the help of a task management tool.

<h3>2. Real-time Task Monitoring  </h3>
A task management system is designed to enable employees to track their progress and other employees’ tasks. Real-time task monitoring characteristic assists the project manager to keep the entire team on the same page and improves coordination. A task management solution can give a constant overview of every task to meet the deadline for all the projects.

<b>Original Source : <a href="https://www.taskopad.com/blog/best-task-management-software-for-your-workplace/">Best Task Management Software</a></b>
Organization of records in files 
Tags: database, tutorial, programming, mysql
Published: 2021-06-28 08:53:07

> Hello everyone
This is my first ever post in dev community. I am dilsha by the way. I am just learning through this community and sharing whatever I learn to contribute the things I learn. Lets start.

Types of organization of records in a file 
* Sequential file organization
* Heap file organization
* Hash file organization
* Clustered file organization

So the first one in our list is **Sequential organization** , as the name suggests this is nothing but searching throughout the file using a key which is not necessarily a primary key. Insertion is also pretty simple as we find the record after which we have to add the new record by using this search key.

And if there is a free record that is a empty record before the place we are gonna insert, then the new record takes the place of the empty record.

Then comes **Heap file organization**. Here the records are placed on the order of inserting them So the insertion in this case is pretty simple just copy the last inserted record into a buffer then the new record is inserted then again the block is rewritten.

However the deletion became complicated deleting the large chunk of records resulted in a waste of storage space. So a much efficient way was to insert a new column named deletion marker with a boolean value maybe. For example if the value is 0 then it is deleted and the search algorithms don't take them while searching and inserting.

_Thanks for reading . The next two types will be discussed in the next post._
npm packages-outdated
Tags: showdev, npm, node, javascript
Published: 2021-06-28 08:50:34

 *Check if all your dependencies in all your NodeJs projects are up to date.*

* Repo - [https://github.com/luctst/packages-outdated](https://github.com/luctst/packages-outdated)
* Doc - [https://www.npmjs.com/package/packages-outdated](https://www.npmjs.com/package/packages-outdated)

---

> **Note** - For the purpose of this exemple i will be using this path `/Users/lucas/dev/` which include some of my projects. 

## 1. Folder with subfolders:
![Kapture 2021-06-28 at 10.35.30](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ck7siu0k644xav76pcx2.gif)

## 2. Single folder:
![Kapture 2021-06-28 at 10.48.12](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfm21wkusspm53pppb35.gif)
Array.prototype.map() expects a return value from arrow function
Tags: react
Published: 2021-06-28 08:46:44

import React, { useState, useEffect } from 'react';
import { Table } from "react-bootstrap";

export default function Users() {
    const [data, setData] = useState([])
    useEffect(() => {
        let url = "https://jsonplaceholder.typicode.com/users"
        fetch(url).then((response) => {
            response.json().then((result) => {
                console.warn(result)
                setData(result)
            })
        })
    }, [])
    return (
        <div>
            <h1>User Component</h1>
            <Table striped bordered hover>
                <thead>
                    <tr>
                        <th>Id</th>
                        <th>Name</th>
                        <th>Email</th>
                        <th>Address</th>
                    </tr>
                </thead>
                <tbody>
                    {
                        data.map((item) => {
                            <tr>
                                <td>{item.id}</td>
                                <td>{item.name}</td>
                                <td>{item.email}</td>
                                <td>{item.address.street}</td>
                            </tr>
                        })
                        
                    }
                </tbody>
            </Table>
        </div>
    )
}
How to Create a GDP Per Capita Country Comparison in AR in 15 Minutes or Less [Tutorial]
Tags: tutorial, beginners, showdev, augmentedreality
Published: 2021-06-28 08:40:19

Looking to build an augmented reality (AR) GDP per capita country comparison application? Use this simple GDP Per Capita Comparison demo application created with Unity, AR Foundation, and echoAR. The full demo can also be found on echoAR’s [GitHub](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-GDP-Comparison).

![1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1624869306289/pYK1glz9U.png)

## Setup

* Clone the [Unity+ARFoundation with echoAR](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-example) example code.
* Follow the instructions on the  [documentation page](https://docs.echoar.xyz/unity/adding-ar-capabilities) to [set your API key](https://docs.echoar.xyz/unity/adding-ar-capabilities#3-set-you-api-key).
* [Add the 3D assets](https://docs.echoar.xyz/quickstart/add-a-3d-model) from the [assets](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-GDP-Comparison/blob/main/assets)  folder to the console.
* [Add the metadata](https://docs.echoar.xyz/web-console/manage-pages/data-page/how-to-add-data#adding-metadata) listed in the the [metadata](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-GDP-Comparison/blob/main/metadata.csv) file to the hologram.
* Overwrite the existing `echoAR/CustomBehaviour.cs` script with the new [CustomBehaviour.cs](https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-GDP-Comparison/blob/main/CustomBehaviour.cs) file. Feel free to add more countries to the list in the script.

![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1624869465718/xhVcbWxwN.png)

## Run
* [Build and run the AR application](https://docs.echoar.xyz/unity/adding-ar-capabilities#4-build-and-run-the-ar-application).

## Real-time updates
Update the value of the metadata associated with the sphere model and notice that the size of spheres in the AR scene changes automatically. Adding/Deleting countries also updates automatically.

![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1624869497011/TYPY_CWM7N.png)

## Learn more
Refer to our [documentation](https://docs.echoar.xyz/unity/) to learn more about how to use Unity, AR Foundation, and echoAR.

## Support
Feel free to reach out at support@echoAR.xyz or join our [support channel on Slack](https://join.slack.com/t/echoar/shared_invite/enQtNTg4NjI5NjM3OTc1LWU1M2M2MTNlNTM3NGY1YTUxYmY3ZDNjNTc3YjA5M2QyNGZiOTgzMjVmZWZmZmFjNGJjYTcxZjhhNzk3YjNhNjE).

![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1624869534992/SU-1v9ye9.png)

******
> echoAR (http://www.echoAR.xyz; Techstars ’19) is a cloud platform for augmented reality (AR) and virtual reality (VR) that provides tools and server-side infrastructure to help developers & companies quickly build and deploy AR/VR apps and experiences.


![5.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1624869550626/i7ZsdO7m4.png)
Learn how to generate unique post slugs in Node.js
Tags: node, adonisjs
Published: 2021-06-28 08:31:30

I recently released a package called [lucid slugify](https://github.com/adonisjs/lucid-slugify) which helps you generate unique slugs from your Lucid models.

In this video, I share the reasoning behind creating this package and also how you can use the package in your AdonisJS apps.

{% youtube Lz1Q1fHnOKw %}
Help me.Even without typing in the box still it's showing the result as Even
Published: 2021-06-28 08:23:02

#Code
```<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TEST</title>
</head>
<body>
    
    <input type="text" id="even" required placeholder="enter a number"><br>
    <input type="button" value="Get Results" id="getResult" onclick="evenfun()">

<script>
function evenfun(){
    var num = document.getElementById("even").value=0;
    
    if(num %2 == 0){
        document.write("Even");
    }else {
        document.write("odd");
    }
}
<script>
</body>
</html>```
ระบบ "เร็วพอ" คือเท่าไร 
Tags: ux, api, response, systems
Published: 2021-06-28 08:20:12


ว่าด้วยเรื่องของ "ความเร็ว" ของระบบใดๆ นั้นเป็นปัจจัยที่สำคัญอย่างหนึ่งที่หลายๆบริษัทต้องการให้ระบบมีความเร็วมาก แต่ก็ยากที่จะบอกได้ว่า เร็วมากนั้นคือเท่าไร

หากเรามองในมุมมองของผู้ใช้งานระบบ ซึ่งมีขีดจำกัดของความอดทนต่อการตอบสนองของระบบ ผลจากการสำรวจปฏิกิริยาของผู้ใช้งานที่มีต่อการตอบสนองของระบบ
ดังตารางข้างล่าง


| ระบบตอบสนองภายในเวลา       | ปฏิกิริยาของผู้ใช้               | 
| :-------------------------|:-------------------------- | 
| 0 - 100 มิลลิวินาที           | รู้สึกว่าระบบตอบสนอง**ทันทีทันใด** |
| 100 - 300 มิลลิวินาที         | สัมผัสได้ว่าระบบ**ล่าช้าเล็กน้อย**   |
| 300 - 1000 มิลลิวินาที        | สัมผัสได้ว่าระบบ**กำลังประมวลผล**  |    
| 1 วินาที+                   | เริ่มสลับไป**คิดเรื่องอื่น**ระหว่างรอ | 
| 10 วินาที+                  | ไปทำอย่างอื่นแระ**ไม่รอแล้ว**  | 


การตอบสนองของระบบในช่วงเวลา 100 มิลลิวินาที - 1วินาที  
ระบบไม่จำเป็นต้องแสดงสิ่งใดเป็นพิเศษให้ผู้ใช้งานรับทราบว่าระบบกำลังทำงานอยู่

ถ้าหากระบบตอบสนองอยู่ในช่วงเวลา 1 วินาที+ หรือ 10 วินาที+ ผู้ใช้งานจะมีความสามารถในการจดจอให้ความสนใจกับระบบน้อยลงหรือกระทั้งถึงขีดจำกัดของผู้ใช้และผู้ใช้จะหาสิ่งอื่นทำระหว่างรอระบบประมวลผล ในช่วงเวลานี้ระบบ**ควรจะต้องแสดงผลบางอย่าง** เพื่อบอกให้ผู้ใช้ทราบว่าระบบกำลังทำงานและคาดหวังว่าระบบจะทำงานเสร็จเมื่อใด หากไม่อย่างนั้นผู้ใช้จะไม่รู้ว่าต้องคาดหวังอะไรจากระบบ


คำถามที่น่าสนใจคือ ระบบของเราต้องการความเร็วแค่ไหนเพราะอะไร


Facebook page: https://www.facebook.com/AnuchitO.rice
Github: https://github.com/AnuchitO

Ref: https://www.nngroup.com/articles/response-times-3-important-limits/
http://aosabook.org/en/posa/high-performance-networking-in-chrome.html