teleren/devto huggingface dataset:
What is API Latency
Tags: api, webdev, tutorial, beginners
Published: 2022-12-31 21:49:32

## What is API latency?
Latency in an API refers to the time it takes for a user's query to be processed and for a response to be returned. A lower latency means a faster response time and a better user experience.

## What is the response rate?
Response rate measures the total time it takes for a server to fulfill a request, including the API latency, or the time it takes for information to be transmitted from the server to the requesting party. It is important to optimize response rate to improve the overall user experience. Latency is a component of response rate but is not the only factor that contributes to the response time measurement.

## What is server response time?
Response time refers to the amount of time it takes for the server to process a request and send back a response to the client. A shorter response time can lead to a better user experience and can be a key factor in the performance and efficiency of an API. It is important to monitor and optimize server response time to ensure that the API is functioning effectively and efficiently.

### What is a good server response time?
Typically anything less than 300ms would put you in the best 20% of sites, and **less than 200ms would put you in the best 10%**
_source_[](https://www.littledata.io/)

### What is a bad server response time?
Server response time of more than 830ms would put you in the worst 20% of sites, and **more than 1.1 seconds would put you in the worst-performing sites**.
_source_[](https://www.littledata.io/)

## Overview of APIs latency rate vs response rate
The time it takes for a request to be fulfilled by an API server, including the time it takes for the requested information to be transmitted, is known as the response rate. The API latency rate refers specifically to the time it takes for the requested information to be transmitted from the server to the requesting party.

## What causes high latency?
The speed at which a server responds to a request for information through an API can be affected by a variety of factors, such as the server's capacity and processing power, the number of requests being made at a given time, and the efficiency with which those requests are managed. High latency rates, or slow response times, can negatively impact user satisfaction and may be caused by server overload, a bottleneck of requests, or other issues.

## How can the latency of an API be monitored?
There are various methods for monitoring the latency of an API, such as a ping test or using web service HTTP/HTTPS monitors. These tools can provide information about API latency, response times, loading times, and other relevant metrics to help understand the user experience.

## Some ways to reduce latency
These include optimizing server hardware and capacity, using efficient algorithms and data structures, minimizing the distance between the server and the requesting party, and minimizing the amount of data sent over the network.
Basic Steps to become a Successful Web Developer...
Published: 2022-12-31 21:18:16

Are you thinking about becoming a web developer? It's a great career choice – there's a high demand for skilled web developers, and you can work on a wide variety of projects, from small websites to large web applications. But where do you start? Here are some basic steps to follow as you embark on your journey to becoming a successful web developer:

**1.** Learn the basics of HTML and CSS. HTML (Hypertext Markup Language) and CSS (Cascading Style Sheets) are the building blocks of the web. HTML is used to structure content on the web, while CSS is used to style and layout that content. You can learn these languages through online tutorials and resources, or by taking a class at a local community college or coding bootcamp.

**2.** Build your portfolio. As you learn and practice your skills, start building a portfolio of your work. This can be a simple website that showcases your projects and tells a little bit about yourself. Having a portfolio will not only help you showcase your skills to potential employers, but it will also give you a place to document your progress and accomplishments as you continue to learn and grow.

**3.** Learn a programming language. While HTML and CSS are important for creating the structure and style of a website, you'll need to learn a programming language like JavaScript, Python, or Ruby to add interactivity and functionality to your websites. There are many resources available for learning these languages, so choose one that interests you and start learning.

**4.** Stay up to date with the latest technologies. The world of web development is constantly evolving, so it's important to stay up to date with the latest technologies and best practices. This might mean learning new programming languages, frameworks, or libraries, or simply keeping an eye on the latest trends in web development.

**5.** Join a community. Web development can be a solitary pursuit, but you don't have to go it alone. There are many online communities and forums where you can connect with other web developers, ask for help, and share your knowledge. You can also attend local meetups or join a professional organization to connect with other professionals in your field.

> **Becoming a successful web developer takes time and dedication, but with the right resources and a little bit of hard work, you can turn your passion for web development into a rewarding career.**
 

A successful web developer needs to have a strong work ethic in addition to technical expertise and problem-solving capabilities. You can take the first step on your path to becoming a great web developer by carrying out these simple steps. You will need to put in a lot of time, effort, and hard work, but with the correct attitude and a devotion to lifelong learning, you may accomplish your objectives and have a fulfilling career in the tech sector.
How to SSH login to a server without being prompted for the password
Tags: ssh
Published: 2023-01-04 04:10:14

---
title: How to SSH login to a server without being prompted for the password
published: true
date: 2022-12-31 18:55:15 UTC
tags: SSH
canonical_url: https://davidloor.com/2022/12/31/how-ssh-login-server-without-being-prompted-password/
---

![boy in white t shirt sitting on chair in front of computer](https://i0.wp.com/davidloor.com/wp-content/uploads/2022/12/pexels-photo-4709285.jpeg?resize=800%2C533&ssl=1)

You purchased a new server, and want to SSH login into it, so you use the command `ssh remote_username@server_ip_address` , and you are prompted for the password of the remote\_username. if you would need to enter the password a couple of times is ok, but if you need to SSH login multiple times that is a pain.

`ssh-copy-id` is a command that is used to install your public SSH key on a remote server. This allows you to use SSH key-based authentication to log in to the remote server without having to enter a password.

To use `ssh-copy-id`, you will need to have an SSH key pair. If you don’t have an SSH key pair, you can generate one using the [`ssh-keygen` command](https://www.ssh.com/academy/ssh/keygen). Once you have your SSH key pair, you can use the `ssh-copy-id` command to install your public key on the remote server.

The syntax of the command is as follows: `ssh-copy-id remote_username@server_ip_address` You will be prompted for the remote\_username’s password one the last time, and after that, you won’t be prompted for the password anymore.

## Example of use of the command ssh-copy-id

```
ssh-copy-id david@mynicesite.com
```

This would install your public SSH key on the remote server at mynicesite.com, using the username “david”.
Everyone NEEDS to use this API!!
Tags: node, javascript, api, typescript
Published: 2022-12-31 18:54:08

Before this blog post I would like to say 2022 was a great year, but now it is time to move on to 2023 so I wish you all a Happy New Year and hope you achieve your goals this year. Me personally wish to get into the nitty gritty of machine learning and make some income off of my programming ventures as I couldn't get much success during these 3 years.

With that out of the way I can say my new years eve challenge is over as I built this meme api before the clock struck 12AM. I am right now eating cake at 12:18AM writing this post and am thrilled to say that this api is done. Learned about a new hosting provider which is great alternative to heroku as heroku removed the free tier which was quite sad to see. **render.com** is phenomenal as it takes very little effort to get an api running.

The API is quite simple and I will be using it for my personal projects aswell since it is something i've always wanted but never found. The API gets the current most popular memes from some of my favorite subreddits and will be pretty useful for my fun challenges like this one.

Here is the API: https://rapidapi.com/scupdev/api/memeco

The name was inspired by some of the new company domains which have switched from .com to .co which looks quite aesthetic in my opinion.
Let's dive a little in to function selectors in solidity
Tags: solidity, web3, programming, blockchain
Published: 2022-12-31 18:46:30

Function selector is how we tell them smart contract which function to run. It is the first 4 bytes which we get from the functions name and it is used when calling low level functions like `call` on a contract and asking it to run a function.

For example `function foo(){ }` has selector `0xc2985578`

Side Note: The function selector is most probably unique for a contract. It is just 4 bytes and that is not a lot of data and thus there can exist another function which has a totally different name but same selector. But that is neither here nor there, so let's move on.

To build a selector in solidity:

1. convert the function name to bytes
2. then get its keccak256. this gives us a 1 way hash which has fixed size
3. now take the first 4 bytes of that hash.

```
bytes4(keccak256(bytes("foo()")))
```

![bytes4(keccak256(bytes()))](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/az5gxz1y1g5br178dx72.png)

Now, this is good, but most likely the function also takes input params and the values of the input also need to be encoded in to bytes and added to the selector.

So let's say we have a function like `foo(uint256)` which we want to call with value of `1`. then we can get the encoded value like this

```
bytes4 prefix = bytes4(keccak256(bytes("foo(uint256)")))
uint a = 1;
bytes32 suffix = bytes32(a);
bytes memory ans = abi.encodePacked(prefix, suffix);
```

and this gives us `0x2fbebd380000000000000000000000000000000000000000000000000000000000000001`

So this worked, but there is `abi.encodeWithSignature` which is an easier way to get the selector with values all encoded in bytes for us to use.

![abi.encodeWithSignature](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8usv7m19szgjdi80kv5p.png)

And there is another helper function `abi.encodeWithSelector` which takes the selector from us and just encodes and appends the inputs for us.


![abi.encodeWithSelector](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fktur75wrilslojl0b7.png)

And finally the same can be done in javascript using `ethers.js`. We can build an `interface` with just the function whose selector we want and call `getSigHash` to get the selector

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

Ethers also supports encoding input values as well

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

So thats it. now you know how to encode & build function selectors with & without inputs, from solidity & from the frontend.
ChatGPT: 20 Fun Ways to put this Clever AI to work.
Tags: ai, chatgp
Published: 2022-12-31 18:10:44

**CHATGPT Your Go-To source for fun and innovation**

ChatGPT the AI Companion that offers Endless Entertainment Options.

Here are 20 ideas for entertaining uses of ChatGPT.

    Have ChatGPT help you come up with ideas for things to do or places to go.

    Use ChatGPT to create a choose-your-own-adventure style story.
    Have ChatGPT play the role of a character in a role-playing game.
    Use ChatGPT to generate jokes or puns.
    Have ChatGPT help you write a letter or email.
    Use ChatGPT to generate ideas for new recipes or meal plans.
    Have ChatGPT write a short story or poem.

For more ....

[ChatGPT 20 Fun Ways to use it](https://www.javaoneworld.com/2022/12/chatgpt-20-fun-ways-to-put-this-clever.html)

Follow me for such well written article.

Happy coding.
AI generated code creates a new security attack vector
Tags: ai, security, webdev, discuss
Published: 2022-12-31 18:10:10

My new best friend ChatGPT has so far helped me to write a blender plug-in even when I have no python experience and I know that it works, but I can’t test it or understand if any of this code is secure in terms of python idiom.

So there in lies the “why” we need experienced people to operate factory machines, it’s one thing to spew out code but you still need experience to quality control and sanity check, something AI still has to work hard on.

However here’s the issue, I’m happy to release my blender plugin without that experience, for all I know I have to trust this AI is not injecting malicious code unintentionally and that’s interesting isn’t it. 

There are no human errors in AI because there are no humans but it may still be possible for a bad actor to inject nasty bits of code that might not be checked to the same degree… this code suffers from the aging product problem, I didn’t write it but I must trust my peers and that’s the trust that could be exploited and it’s new and kind of scary 😦
Why Node.js is so popular ?
Published: 2022-12-31 17:53:28

Node.js is a popular platform for building server-side applications and has gained widespread adoption in recent years. There are several reasons why Node.js has become so popular:

- It is built on top of JavaScript: Node.js uses the same language as the web, making it easy for web developers to pick up and use.
- It is lightweight and efficient: Node.js uses an event-driven, non-blocking I/O model, which makes it lightweight and efficient for building scalable network applications.
- It has a large and active community: The Node.js community is large and active, with thousands of open-source packages available to use. This means that developers can easily find solutions to common problems and build upon the work of others.
- It has strong corporate support: Node.js has strong corporate support from companies like IBM, Microsoft, and Netflix, which helps to ensure its long-term viability and continued development.
- It has a fast development cycle: The non-blocking I/O model of Node.js allows for fast development, allowing developers to quickly build and deploy applications.

Overall, Node.js is a powerful platform for building server-side applications that is easy to learn, efficient, and supported by a large and active community. It is no surprise that it has become so popular in recent years.
Best free logo maker for dev & SVG Crop online
Tags: webdev, beginners, productivity
Published: 2022-12-31 17:46:39

[wix logo maker](https://www.wixlogomaker.net/) helps me with my studies since it's free. They don't need registration and supply an SVG vector file for future usage. This tool is excellent for students or freelancers.

&
[crop svg online](https://www.wixlogomaker.net/svgcrop/)- Remove blank space from around any SVG
RecyclerView Micro-Byte Blog
Published: 2022-12-31 17:12:06

**What is a Micro-Byte ?**
Micro Bytes are similar to Bytes but shorter learning experiences where readers can learn a topic by doing the Micro-Byte.
**NOTE:** Bytes are larger and the Micro-Bytes need not be this extensive.
It is used as a detailed guide that meets the following criteria:
Teaches an important concept very clearly with learn-by-doing exercises i.e. learning by executing tasks in a hands-on way.
- Roughly takes 1 hour of learning time for learners to go through it.
- Has custom illustrations/imagery to explain concepts.
- Neatly formatted for easy consumption.
- Entertaining and engaging with a unique spin/angle to learn the topic.

**Implementation Of RecyclerView**
A RecyclerView is a view group that displays a list of scrollable items. It is an improved version of the ListView and the GridView classes provided by the Android framework.
Nowadays, RecyclerView is used in every Android Application, like 
Instagram, facebook, twitter etc to display lists of scrollable items. 
![RecyclerView](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5d8ajdsg977x1tlsddj.png)

- By this micro-byte you will learn how to implement RecyclerView
 with custom adapter to show a list of images etc according to your requirement and how you can build "apk" of your application.
- In this micro-byte, we have 5 activities
  1. Install and Setup Android studio
  2. How to create project in Android Studio
  3. Creating an Activity or Interface for RecyclerView
  4. Creating a CustomAdpater,POJO class etc
  5. Build apk of your android application
By followiing these 5 activities, you will easily implement RecyclerView in you android project.


**Why we need RecyclerView in Android Application?**
Reasons why the RecyclerView widget is often used in Android applications
**1. Performance:**The RecyclerView is designed to be more efficient than the ListView and the GridView widgets in terms of memory usage and scrolling performance.
**2. Customization:**The RecyclerView provides a number of customization options. You can specify the layout manager to control the way the items are displayed, and you can use custom item decorations to add dividers and margins to the items.
**3. Flexibility:** The RecyclerView is a flexible view group that can be used to display a variety of data types and layouts. It is not limited to displaying simple lists of text, and you can use it to display a grid of images, a calendar view, or any other type of data.
**4. Ease of use:** The RecyclerView is relatively easy to use, especially when compared to the ListView and the GridView. It requires you to implement a few key classes and interfaces, but it provides a lot of functionality out of the box.

Overall, the RecyclerView is a powerful and flexible view group that is well-suited to a wide range of applications. It can help you to improve the performance and customization of your Android app, and it is a good choice for displaying lists of data.

**Link to Micro-Byte :** [click here](https://github.com/Crio-Bytes/IBD-2022-Master-Repository/tree/main/Implementation%20of%20RecyclerView)
CodePen Designs - 14 : Sunrise and sunset
Tags: codepen, css, design, codependesigns
Published: 2022-12-31 17:21:34

### We are excited to introduce our new series that will explore the best design ideas from the Codepen community. 

We will be publishing these each day and hope you find them insightful and inspiring as we showcase some of the most talented designers in this space.

---


#### Codepen Design - 14

<p>This is based on a really old pen and more recent work-in-progress I made about the sun, now finished for the Codepen Challenge - Sun.</p>

{% codepen https://codepen.io/TheBrutalTooth/pen/ZEjQzzw %}


---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

5. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)


---
---
Shortest Path Planning using wavefront Propagation
Tags: java, processing, algorithms
Published: 2022-12-31 17:00:11

This algorithm is guaranteed to find the shortest path 
 
![Demonstration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tai6ifrhnf42q2tjihth.gif)

The basic idea is to explore all possible neighboring cells and calculating the minimum cost (represented by their d-value) of getting to that cell.
If the d-value of a cell is -1, that means it's a obstruction

![Updating d-values](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/80an9isiv8alwvuavi2a.gif)

This is the class that handles most of the computing
```
// Wrapper class for tuple
class tuple implements Comparable<tuple>{
    public int x,y,d;
    tuple(int a,int b,int c){
        x = a; y = b; d = c;
    }
    @Override
    int compareTo(tuple other) {
      return this.d - other.d;
    }
};
```
The d-values are computed by the **updateAllDvalues()** function and the shortest path is computed by the **drawRetracePath()** function.

[Source Code](https://github.com/DarkMortal/Processing-Projects/tree/main/Wave_Propagation)
If you like this short project, consider following me on GitHub
【Next.js】How to apply .scss to Next.js project
Tags: nextjs
Published: 2022-12-31 16:33:35

Version of Next.js....13.1.1

I made an app with React.js before and remade it with Next.js. I reused the .scss files that were used for my React.js project. This is how to apply a set of .scss files to Next.js project.

##1.Install scss into your project directory.##

```
npm install sass --save-dev
```
##2.Make "scss" directory in "styles" directory and place .scss files in it.##
Make sure make the root .scss file that imports the rest of .scss files. (In my project, I named "index.scss.")

##3.In _app.tsx file, import the root .scss file.##
Then, your .scss files are applied.
```
import '../styles/scss/index.scss';
```
##Where to place images that are used for .scss files##
Place the image files in "public" directory. In your .scss files, you can write a path to the image files with a relative path.

```
// styles/scss/index.scss
background-image:url("./../../public/img/earth.jpg");
```
Design, Develop & Market
Tags: webdev, tutorial, devjournal, beginners
Published: 2022-12-31 16:17:42

Hey everyone!

I'm excited to announce that I have started a LinkedIn newsletter called "Design, Develop & Market" where I'll be sharing all my experiences and secrets on design, development, and marketing for free.

I believe in the power of sharing knowledge and helping others grow in their careers, and that's exactly what I aim to do through this newsletter.

If you're interested in staying up-to-date on the latest trends and techniques in these fields, make sure to subscribe to my newsletter.

I can't wait to share my insights with all of you and help you take your skills to the next level.

See you on the other side!

M.

[https://www.linkedin.com/newsletters/design-develop-market-7013453145892634624/](https://www.linkedin.com/newsletters/design-develop-market-7013453145892634624/)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7dj1f474b3m73e4rizv.jpg)