teleren/devto huggingface dataset:
Terminal: Copy Current Path
Tags: bash, beginners, tutorial, zsh
Published: 2022-06-22 13:28:48


## TLDR: 
Create this alias into your .aliases/.zshrc/.bashrc or where ever you store aliases for easier use later.
```
alias cpwd="pwd | tr -d '\n' | pbcopy && echo 'pwd copied to clipboard'"
```

Recently I have been spending a little more time using the terminal for work and have had a few instances where I needed to copy the current directory I am in. Now in most cases you could just use the mouse to highlight and copy the directory you need, but I am ~~pretty lazy~~ motivated to try and make this a little easier as I suppose there could be a time where using a mouse is not an option.

## Parts Breakdown
## pwd: print working directory
```
$ pwd
/User/(username)
```
Prints the current directory path you are in.

---
## tr: translate characters
```
tr -d '\n'
```
This will copy standard input to the standard output with substation or deletion of selected characters.

The pwd command above will produce the working directory string but it will have a line return character '\n' appended to it.

We use the -d command to signal that we want to delete a character off the string and '\n' to signal which character we wish to delete.

---
## Copying to system clipboard
Depending on if you are on OSX or Windows the copy command could be different

_Windows_
- **clip**

_OSX_
- **pbcopy**

this will copy text to the system clipboard (by default).

---
## echo: Writes to the standard output.
```
echo 'pwd copied to clipboard'
```
This part is not needed I just personally like to have something in my commands that will tell me that the command was at least executed.

---
## Pipe it all together
All of these above commands are used with a pipe '|' which will feed the 'output' of one command to the next.

So the flow will be the following.

1. pwd prints out the working directory
2. That output is now fed to our **tr** argument which will remove the trialling newline character
3. finally that entire string will be placed into our clipboard for use with the help of pbcopy/clip.
4. Then an echo at the very end will just print to the screen that the command has been executed

## Final

Now this is far from the only way to do this, I believe a popular way would be to just use **xclip** but that may take an install and I tried to find a way to use only what is available by default.

I hope that someone may find his useful. What are some of the things you have learned in the terminal that has saved you time/made things easier? Let me know! 😃
STEPS OF PROGRAMMING
Tags: codenewbie, computerscience, programming
Published: 2022-06-22 13:39:25

Data's are the raw materials in programming.There are many programming languages such as JavaScript,C++,python and c etc.For example 20,"name",'a' etc are data's of various types.Programming is giving instructions to computer on how to do a task.The steps of programming are:
- Collecting data's.

- Arrange data logically.(Data structure & algo)

- Do operations on arranged data according to our task.

- Get the output.
Hire Front-end Developers In India
Tags: hirefrontenddevelopers, hirefrontenddevelopersin, hirefrontenddeveloperremotely
Published: 2022-06-22 13:37:55

For front end engineering requirements, [Hirefrontenddeveloperindia](![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xn0ompwiqsa4yyl5o9md.png)
 ) can be of a great help. Our developers are highly experienced and knowledgeable in technologies such as reactjs, angularjs, vuejs, and many others. From our in-house developer team, you can hire our talented and skilled developers/team, to work on your project requirements. Our developers have got polished after working on various projects from different industries. Hire from us to create an imaginary brand for your business.
How to start a Django project
Tags: beginners, python, django
Published: 2022-06-22 13:31:36

Hello! 
In this post I'll show you how to start a project using python and Django. 

For this tutorial, you have to have python already installed in your computer. 
 
Step 1: Create a directory for your project and enter it:
```
mkdir project_name
cd project_name
```

Step 2: Create a virtual environment in your project folder: 
Unlike node.js, where the node_modules folder is created automatically when you run the command to start a project (yarn init or npm init), when using python and django, to have your project dependencies installed locally in your project directory instead of globally in your computer, you have to create your own virtual environment from scratch. 

```
python -m venv venv

```

Step 3: Activate your virtual environment:

```
source venv/bin/activate
```

Step 4: Install the basic dependencies: 

```
pip install djangorestframework black ipython
```
I like using djangorestframework because it makes rest API development so much easier, and already installs django automatically. 

Step 5: Create a file named requirements.txt, so that pip knows which dependencies to install if you run your project in another machine: 

```
pip freeze > requirements.txt
```

Step 6: Start your project; 

```
django-admin startproject name_of_your_project .
```

Since we already  prepared the environment in our directory, I like to use the dot in the end of the start project command, to tell django to start the app in my current folder. If I don't use it, django makes another directory inside my current directory, which in our case is unnecessary. 

Extra tip: Don't forget to create a gitignore, and put the venv directory in it, as well as the pycache, and your db.sqlite3 (once your run your migrations, django automatically generates a file named db.sqlite3, which is NOT recommended to upload to git)


That's it for today, I hope I helped you in some small way!
Which is the popular CAD application used in the mechanical design industry in India & why?
Tags: career, autocad, mechanicalautocad
Published: 2022-06-22 13:26:41



Mechanical engineering is the field in which the mechanical engineers build mechanical parts of various machinery items. But before the manufacturing and testing of these items, they usually made it on digital canvas in the form of 2D and 3D designs. These 2d and 3d designs are constructed on special applications like AutoCAD.

AutoCAD is mainly a 2d and 3d design and drafting application and offers many types tools kit. You can draw anything on it from mechanical part to big infrastructure design on it. Currently every company needs a designer who has good command on this revolutionary application. So it is must for every mechanical engineer to learn this software application. You can learn this application from the online free video but the available series on YouTube are incomplete. That’s why join you should join Cad Training institutes who offers AutoCAD course for mechanical engineers.

Where you can learn AutoCAD?

There are many CAD Training Institute are available nowadays who are offering different types of course on AutoCAD. But if you want to get professional training with portfolio development. Then join institute like CAD Training institute in Delhi. Because this institute offers the best course [AutoCAD Mechanical Course](https://www.cadtraininginstitute.com/best-autocad-mechanical-course/).

Quick glance on AutoCAD Mechanical course

It is a 2 months duration course. In which you will learn following things.
* First you will be familiar with interface of autocad
* After it you will learn basic geometry
* Setting of draft
* Coordinates and snapping
* Basics of autocad
* Object properties
* Tools and utility
* Isometric views
* Elevations
* Visual design
* Primitives of solid
* 3d mesh objects modifications
* Mapping
* Motion path etc.

This is the glance on things and topic that you will learn in the following mechanical course.

Let’s take a look at the important joining benefits of a professional AutoCAD Training Institute. These benefits are
* Training from highly experienced experts both of industry and of teaching.
* Professionally designed course
* Resume and portfolio development session-you will get classroom assignments and final projects that at end of this course will become your portfolio.
* Computer lab and lab In-charge facility for students practice.
* Weekly doubt session
* Workshops and industrial trips
* Classes are available on different modes like fast-track, regular, online and offline.
* Feedback's and surveys for giving students where they can freely share their complaints and suggestions.
* Good management staff
* Internship programs to develop professional ethics in students
* Lifetime placement support

Get set and go for certified training with [CAD Training Institute in Delhi](https://www.cadtraininginstitute.com/).
Wednesday Links - Edition 2022-06-22
Tags: java, jvm, security, kotlin
Published: 2022-06-22 13:22:14

Data Oriented Programming in Java (22 min)💾
https://www.infoq.com/articles/data-oriented-programming-java

SIMD accelerated sorting in Java - how it works and why it was 3x faster (26 min)➡️
https://jbaker.io/2022/06/09/vectors-in-java/

JFR Configuration Improvements (1 min)✈️
https://inside.java/2022/06/13/sip055/

Creating a more comprehensive dependency graph with build time detection (3 min)🕸️
https://github.blog/2022-06-17-creating-comprehensive-dependency-graph-build-time-detection/

Spring Data MongoDB SpEL Expression Injection Vulnerability (2 min)💉
https://spring.io/blog/2022/06/20/spring-data-mongodb-spel-expression-injection-vulnerability-cve-2022-22980

Exploring GraphQL’s performance tradeoffs (10 min)🚄
https://blog.allegro.tech/2022/06/graphql-perf-tradeoffs.html

Gradle Public Roadmap (45 sec)🛣️
https://blog.gradle.org/roadmap-announcement

Introducing Kotlin Build Reports (4 min)📝
https://blog.jetbrains.com/kotlin/2022/06/introducing-kotlin-build-reports/

Solutions Architect Tips: How to Design Around Serverless Service Limits (8 min)λ
https://betterprogramming.pub/solutions-architect-tips-how-to-design-around-serverless-service-limits-15e12b5c4235

What Is Negative Engineering? (10 min)🔋
https://future.com/negative-engineering-and-the-art-of-failing-successfully/
Is it easier for a data analyst to transition into SWE or data engineering?
Tags: anonymous, discuss, career
Published: 2022-06-22 13:17:01

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment or if you want to ask your own anonymous question._ 

***


I'm pretty early in my career, and I'm just curious to know what avenues I could possibly go down. Data analyitics is really interesting to me, but knowing what roads I could choose from here, and which would be best for my career. Which is an easier road to transition to? What are the hurdles in choosing either one? Thanks to the whole DEV community in advance.
Github copilot is out of beta, would you use it ?
Tags: discuss, programming, productivity, github
Published: 2022-06-22 13:13:08

From the Github copilot doc page :

> You can use GitHub Copilot to get autocomplete-style suggestions from an AI pair programmer as you code.

Essentially, Github copilot is a pair programming buddy, fueled by AI. It is compatible with most IDE and support languages such as JS/TS, Python, Ruby, GoLang.

Now that the free beta is closed and the final product is released, would you consider using it ? What do you think of the pricing ?
Introduction to the File System Module ('fs') in Node.js
Tags: javascript, node, webdev, tutorial
Published: 2022-06-22 13:06:22

https://www.youtube.com/watch?v=dtTnWxfH19U

The File System Module ('fs') in Node.js allows you to interact with the file system using JavaScript. This tutorial shows you how to write and read a file asynchronously and synchronously.
INTRODUCTION TO DATA STRUCTURES AND ALGORITHMS
Published: 2022-06-20 00:27:18

With the rise of technology use ,data structures and Algorithms is a big requirement for all software engineers.
_So what is Data structures and algorithms and why are they important for all software engineers?_

Data Structures is a particular way of organizing data in a computer so that it can be accessed and used effectively. Just like in real life,we choose different storing assets like containers depending on what we want to store and how we want to access them.
 
Data structures are divided into 2 two types, **Linear and non-liner** data and we get to choose what data structure to use with regards to what we what it to achieve.
**Liner data structures** are further listed to Array,Stack ,queue and linked lists.
Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. Following are the important terms to understand the concept of Array.

1. Element − Each item stored in an array is called an element.
2. Index − Each location of an element in an array has a numerical 
index, which is used to identify the element and they start at 0.

Following are the basic operations supported by an array.

1. Traverse − print all the array elements one by one.
2. Insertion − Adds an element at the given index.
3. Deletion − Deletes an element at the given index.
4. Search − Searches an element using the given index or by the value.
5. Update − Updates an element at the given index

EXAMPLE
Given an array of integers, find the sum of its elements.
In this scenario we are going to 1st add all the elements till we reach the end of the array the display the final answer as Sum.

```
function simpleArraySum(ar) {
    // Write your code here
    let n = ar.length;
    let sum = 0;
 for(let i = 0; i < n; i++){
     sum = sum + ar[i]
; }
return sum
;} 
```
Closures and useEffects
Tags: react, javascript, useref, useeffect
Published: 2022-06-22 12:49:57

```
import { useState, useEffect} from "react";

export default function App() {
  const [count, setCount] = useState(0);

   useEffect(() => {
     setTimeout(() => {
       console.log(" ", count);
    }, 3000);
   }, []);

  return (
    <div className="App">
      <p>{count}</p>
      <button onClick={() => setCount(count + 1)}>Click Me </button>
    </div>
  );
}
```
The above code will display the value of count when the component renders. In the meantime if we click the button and try to change the value of count. The value of count changes but the log will contain the value zero. This also happens when you are working with async function.

We can get around this problem by using useRef hook. The code is as follows.

```
import { useState, useEffect, useRef } from "react";

export default function App() {
  const [count, setCount] = useState(0);
  const countRef = useRef(0);

  countRef.current = count;

  useEffect(() => {
    setTimeout(() => {
      console.log("useRef", countRef.current);
    }, 3000);
  }, []);

  return (
    <div className="App">
      <p>{count}</p>
      <button onClick={() => setCount(count + 1)}>Click Me </button>
    </div>
  );
}
```
using the above block of code we can get the current value of the variable while logging it to the console
Puzzle-3
Tags: c, programming, beginners
Published: 2022-06-22 12:39:11

## Can you guess the output without the help of code editor ?

**Comment the output in the below comment section.**

```
#include <stdio.h>
struct student {char name[20]; int age;};
int main()
{
    struct student stu1 = {"anita", 10}, stu2 = {"anita", 20};
    if(stu1 == stu2)
       printf("Same");
    else
       printf("Not same");
    return 0;
}
```
Release Notes 22.06.22 - New Table Pagination and Minor Improvements
Tags: devops, network, webdev, release
Published: 2022-06-22 12:32:34

We're excited to present you with the latest release of Syntropy Stack. Our team has been tailoring the product to better align with upcoming features, and we hope these aesthetic and functional updates will also improve your Syntropy Stack experience today.

We are releasing quite a few exciting improvements, including the brand new pagination for Endpoints, Connections and Audit tables (see the screenshot below). Above it we’re introducing a bunch of fixes related to both - functional and visual aspects of the platform including duplicated services appearing after consecutive CONTAINER_INFO events or visual issue with the provider icons.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0tvmtcqhtchjwb4uwz5z.png)
As we progress our technology and grow the ecosystem, we listen closely to our community to build tools that matter. If you have any feedback or ideas, let’s talk on Discord.

## Improvements
- Improved Workspace invitation delivery mechanism
- Significant improvements to Audit Log response speed
- Improvements to the reCAPTCHA mechanism
- Implemented endpoint tag length validation
- Improved pagination in Endpoints, Connections and Audit tables
## Fixes
- Fixed duplicated services appearing after consecutive CONTAINER_INFO events
- Fixed Access token deletion
- Fixed visual issues with provider icons
- Fixed improperly trimmed long workspace names
- Fixed Audit log pagination & filtering issues
- Got rid of duplicated scrollbars in both token description and rules table areas
- Fixed the visualization of locked endpoint fields
- Fixed overlapping data values in the latency charts
- Fixed broken user flow from Thresholds page, resulting in 404

## Getting Started
Get started with Syntropy Stack with our three-minute [quick start video](https://vimeo.com/499558754), or follow the [documentation](https://docs.syntropystack.com) for more details. Use Syntropy Stack to streamline your container and multi-cloud deployments and automate network orchestration.

## Getting Involved
Our community helps us identify the right problems to solve for our users. Whether you’re an active user of one of our products or just getting started, [join our community on Discord](https://discord.com/invite/HxW6DbUeMn)! We love to foster communication among developers. Also, don’t hesitate to send us a message if you have feedback or need assistance. We're happy to help!
Importing...
Tags: react, softwareengineer, coding, import
Published: 2022-06-22 12:32:32

One of my favorite things to learn on React is importing. What is importing? Let me explain to you in simple terms. 

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

You may create a page and render it but if it is not imported, then your computer wouldn't know what you are trying to say. 


Let's say I have an **App.js** as my main page. But I also created another component called **NavTitle.js**. If I want to add all my work from **NavTitle.js** to App.js, then I must import. 
Next, you are going to add where in the file NavTitle.js is located. 
Example: **_import { NavTitle } from './NavTitle.js';_**


__Think of import as someone who is the life of the party that you just have to bring with you everywhere. _
_
Help me Out on SSR and CSR!!
Published: 2022-06-22 12:26:14

I've started to wrok with api and web dev. But I'm confused between server side rendering and client side rendering. 
Following are my concerned questions right now

- How to work with Api and crud?

- Difference between ssr and csr with real example?

- Can we do the same thing on server side and client side while working or there any limitions {about logic}?

- Can't find decent content to understand these concepts/ If you have any please share in comments
What kind of content performs the best on SaaS blogs?
Tags: saas, saasblog, contentmarketing
Published: 2022-06-22 12:23:55

If you want to grow your SaaS blog, you have to pay attention to the types of blog posts you publish. While there are dozens of formats, there are a few that can generate referral traffic for your blog, help grow your email list, and, ultimately, increase users for your product.

**1. How-to guides**

- People are always searching for solutions to problems they encounter while carrying out their day-to-day operations. You can capitalize on this. All you need to do is highlight your target customer's pain points and then create a series of how-to guides with actionable solutions.

- Having identified some of your audience's problems, you could create how-to guides where you'd outline actionable steps they can take to overcome these roadblocks.

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

**Some topics you could cover are:**

1. How to write a 1000-word article in an hour or less
2. How to overcome writer's block forever
3. How to write catchy headlines (even if you're a total beginner)

**2. Checklists**

- We all want to do things faster and more effectively. So, highlighting specific tasks your target customers do regularly and creating a checklist they could work with is a fantastic way to provide value for your audience with content.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3371yf29d5n3hegc4jqi.png)

- Since checklists are sought-after resources, these types of blog posts have the potential to perform well in search engines, driving free organic traffic to your website. Checklists are perfect for lead magnets such as content upgrades. Try designing a printable version of the checklist and then offer it as an opt-in incentive.

**3. Comparison posts**

- Comparison posts are one of the best blog formats for SaaS companies, as they help potential buyers make decisions. These blog posts usually pit two or more similar products against each other, evaluating them on various features. You can compare the products based on a specific use case or angled toward a certain type of user.

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

- The comparison post format works well mid-funnel, where potential users are researching their options. The goal is to win over potential customers. You have the opportunity when creating these posts to spotlight key solutions that your products offer but perhaps your competitors' products don't.

> [**_UUKI_**](UUKI.live)