teleren/devto huggingface dataset:
How to go back directory in Nodejs?
Tags: language, node, file, beginners
Published: 2021-09-06 06:17:31

If you are new to Nodejs , you may not know how to use file module completely. I hope this article may help you to find out ways to create better application with Nodejs. 

Nodejs is really fast than other languages' processing .All javascript lovers are now fall in love with nodejs because of its non-blocking feature and robust architecture .

Today ,I am going to show you how we can go back file directory in nodejs . Now ,we will log in console to know where we are running ,using``__dirname``. 
```javascript

console.log(__dirname);//current directory where we open this folder.
```
Now, we get our current directory but you are trying to move your directory _one_ step back.You must use nodejs built in module ``path`` to work with directories. The method ``path.join()`` execute several segments into one path.
```javascript

const path=require('path');
let oneStepBack=path.join(__dirname,'../');
console.log(oneStepBack);//move one step back from current directory

```
If you want to move two step backward from current  working directory, the code will be like this...
```javascript

const path=require('path');
let twoStepBack=path.join(__dirname,'../../');
console.log(twoStepBack);//move two step back from current directory

```
Happy coding!!
Best Digital Marketing Services in Jaipur 
Tags: advertising, marketing, digitalmarketing
Published: 2021-09-06 05:13:06

A digital marketing company can help you to grow your business online and boost your sales. Before choosing the digital marketing company for your business, you need to understand what digital marketing is all about.

Let’s first understand digital marketing.

Digital Marketing is the practice of utilizing a digital platform in the best manner for promoting your business. Digital marketing is a great way to grow your business as it gives an online/digital platform to your business. You can advertise your product or services on various digital channels such as websites, emails, videos, mobile apps and social media channels. Digital marketing has the ability to approach new audiences and convert them into potential customers. Digital marketing is a broad concept & it includes a wide range of marketing activities. We offer a one place solution to our customers for their entire digital needs, from being the creative website designer to the leading digital marketing agency of Jaipur.


Being the leading digital marketing company in Jaipur, we focus on delivering quality services & helps you to generate high revenue. We offer 360-degree digital marketing solutions to our clients. We offer a wide range of services like search engine optimization, social media optimization, pay per click, online reputation management, content marketing, mobile app marketing and more. We at The Cogent use our analytical knowledge to know the business complexities & mix technical & creative expertise of growth-oriented digital marketing practices to deliver the best services in terms of higher ROI & offer clients far better business experience in the digital means. If you want to grow your business through the digital platform and attract your target audience, we can help you with our result-driven digital marketing services.


Why choose us for digital marketing of your business

We have a certified digital marketers expert who understands the business need and the best possible solution to complete the needs.

Our team creates unique result-driven strategies that deliver positive results in a short span of time.
We modify the website to get a higher ranking on Google search results, and you will get long term free benefits of top SERP rankings.
We work intending to grow your business & boost sales.
We deliver support & maintenance services to our clients.
We build a strategy to increase the click-through rate and get more conversions.
How to be a Front-end dev in 2022?
Tags: discuss, codenewbie, webdev
Published: 2021-09-06 05:08:39

To become a front-end dev, first you need to learn HTML,CSS,JS.
Before learning to code in HTML,CSS,JS. Know there roles in web development or in web page.
1.What to learn in HTML?
1.HTML semantic layouts, some of the basic tags like <a>,<p>, <header>, etc....
2.difference between block level and inline tags or elements.
3. div and span elements
5.how to structure the document.

2.What to learn in CSS?
 1.How to Use CSS in web development (inline, internal, external) styling
 2.Then learn the CSS box model (this is a must learn for everyone)
 3. Then the selectors (class, id, universal, etc...)
 4. Learn the combinators(+, ~,>, ).
 5. learn about display property (block, inline, inline-block)
 6.Positon property (absolute, relative, fixed, sticky)
 7. Flex and grid
 8. build a website using HTML and CSS without JS.

3.What to learn in JS?
1. JS basics (data types, variables, functions, for, while, do-while loop, arrays, objects etc...)
2. after learning the above concepts. start practicing it at 
   https://edabit.com/challenges, only for beginners, who just started to learning to code.
3. DOM concepts, if u are using a framework (its not a must)
4. now go through the concepts like hoisting, closure and all the concepts.

Bonus tips, 
 1. u should learn HTML and css, as you work on the real-world projects
 2. In JS, practice try to practice array and object structure most often
 3. in arrays must know methods are filter, map, reduce, push, pop, shift, unshift, slice, findIndex, indexOf and etc..

At last pick one framework or library of JS. (Angular, vue, React ).
DATA. SORTING AND SELECTION.
Tags: database, datascience, ux, discuss
Published: 2021-09-06 03:33:25

I have a webapp that has a process where data is to be sorted at the back end and updated on the front end periodically (That is, data is collected from users for 6 minutes, sorted and a selection is made after meeting certain conditions, then the selection is displayed on the UI for two minutes, making a total of an 8 minute cycle). This process is to be repeated continuously infinitely. 

The issue here now is that my dev says this cannot be done due to the expectation that millions of data may have to be filtered and the system cannot do it within the time frame expected?

Any ideas?
AWS Elastic Beanstalk
Tags: aws, devops, cloud
Published: 2021-09-06 03:33:15

Most if the time developers just want to deploy code and don't want to worry about the infrastructure. This is where elastic Beanstalk comes in it automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring. It is an easy-to-use service for deploying and scaling web applications and services on familiar servers such as Apache, Nginx, Passenger, and IIS.

## AWS Elastic Beanstalk Properties

1. It is a very easy to use service

1. Lets us keep full control over the underlying resources.

1. It is free but you pay for the resources you use

1. It is a managed service  it handles
   1. Instance configuration
   1. Deployment
   1. Monitoring
   1. Load balancing 

Next we will do a hands on how to use AWS Elastic Beanstalk
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 42
Tags: php, javascript, webdev, tutorial
Published: 2021-09-06 03:27:39

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.

In this video,we will be creating the videos table

{% youtube QZlaVd6kv-0 %}

In this video,we will be installing FFmpeg

{% youtube cClt4StEBmA %}


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Announcing the CENNZnet Grants Program
Tags: grants, blockchain, startup, funding
Published: 2021-09-06 02:48:52

Announcing the CENNZnet Grants Program, a resource to empower teams and individuals to get great ideas off the starting blocks on #CENNZnet :rocket:
The program offers NZ$500,000 in funding, dedicated tech & marketing support and connects you to investors and other projects in the ecosystem. 
Learn more and apply here - https://medium.com/centrality/500-000-worth-of-dapp-grants-coming-your-way-1427c682f575.
Autoresizing Textarea element
Published: 2021-09-06 02:45:17

Have you ever been filling out a web form that used single-line text input fields for input that far exceeds the length of the field?  You have to scroll from end to end to verify what's actually been typed.  A textarea field would be far more suitable but even that is clunky with it's fixed size - still requiring scrolling.  I've found a few solutions around the web to make a textarea resize itself based on the contents and I've distilled them all down to the following very easy steps:

1. Add the CSS that makes the "autoresize" class (you can name it anything you want):
```
<style>
.autoresize{
    resize: none;
    overflow-y: hidden;
    overflow-x: hidden;
}
</style>
```
resize:none: hides the resizing handle from the textarea
overflow-y: hidden: prevents the textarea from showing scrollbars when the content overflows or reaches the horizontal boundary of the input
overflow-x: hidden: fixes a little feature in Firefox that adds an additional line at the end of the textarea content when there is only one line.

2. Add the function to make the element size change relative to its content
```
<script>
function autoResize(elem) {
    elem.style.height = 'auto';
    elem.style.height = (elem.scrollHeight-4) + 'px';
}
</script>
```
elem.style.height = 'auto': this resets the size of the textarea element (passed in as 'elem') just before setting it to the size content based size, without this the textarea will increase the size automatically, but it will not decrease the size once it has been increased.
elem.style.height = (elem.scrollHeight-4) + 'px': this sets the textarea to the size of the 'scrollHeight' of the element - this is the size the textarea *would be* based on the size of the content and also adds the padding for the element (4px).  The 4px is subtracted back out or the end result would be cumulative and would increase by 4 additional pixes with every resize.

3. Create the textarea element and add the CSS class created above:
```
<textarea class="autoresize" oninput="autoResize(this)" rows="1"></textarea>

```
Add the "oninput" event listener and point it to the "autoResize" function passing in "this" for the function argument (in this case "this" refers to the textarea element itself).  This fires the function for resizing on every keystroke of text input into the textarea element. When the scrollHeight of the element changes because the line *would* wrap, the autoResize function increases the height of the textarea element.  The same happens in reverse when removing characters, making the textarea element resize down when a line break is no longer part of the current line.

If you add an event listener that captures the "Enter" key and map that to submit the form your textarea is contained by, the autoresize textarea can function just like a text input form element, without scrolling off the edge of the input field.

That's it.  I've tried to make it as streamlined as possible.  Let me know if you know of other alternative solutions.  This one works for me but there may be other ways.
AWS CloudFormation
Tags: aws, cloud, devops
Published: 2021-09-06 01:52:48

AWS CloudFormation is a tool which provides a way to setup your infrastructure as a set of instructions which are followed one by one, by treating infrastructure as code.When you define an AWS template you define all the resources and configuration in the desired amount and AWS CloudFormation creates that template as specified.

## Benefits of using Cloud Formation

1. Makes easy to automate everything.

1. Creating a copy of your stack is a matter of just running your AWS CloudFormation template again

1. It enables you to create, update, or delete stacks across multiple AWS accounts and Regions, with a single operation.

1. Even allows using third-party resource types using CloudFormation Public Registry.

1. One click destroy your whole stack. Makes it easy for testing your stack.

1. You can leverage already created templates for you in the community

1. Makes it easy to visualize everything using automated diagrams of our stack

Next we will do a hands n to setup a basic stack on CloudFormation.
How long is your Maximum Line Length for PEP 8?
Tags: python, pep8, programming
Published: 2021-09-06 01:52:33

# Style Guide

[PEP 8 Maximum Line Length](https://www.python.org/dev/peps/pep-0008/#maximum-line-length)

> Limit all lines to a maximum of 79 characters.

I used to follow this guide and set the default value to 79 characters in Lint.
However, the readability was sometimes compromised to comply with this, so I decided to reread the guide and tune the setting values.

> Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the line length limit up to 99 characters, provided that comments and docstrings are still wrapped at 72 characters.

The rationale for the 79 characters is described as follows.

> Limiting the required editor window width makes it possible to have several files open side by side, and works well when using code review tools that present the two versions in adjacent columns.
The default wrapping in most tools disrupts the visual structure of the code, making it more difficult to understand. The limits are chosen to avoid wrapping in editors with the window width set to 80, even if the tool places a marker glyph in the final column when wrapping lines. Some web based tools may not offer dynamic line wrapping at all.

I see.

Also, in [A Foolish Consistency is the Hobgoblin of Little Minds](https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds) there is a section that says

> However, know when to be inconsistent -- sometimes style guide recommendations just aren't applicable. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask!

# Note

## IDE defaults

VisualStudioCode and PyCharm defaulted to 120 characters per line.

## Other Languages

[Characters per line - Wikipedia](https://en.wikipedia.org/wiki/Characters_per_line)  has a good summary.
There are many languages with 80 characters.

Interestingly, they seem to be derived from typewriters and punch cards.

# How long is my Maximum Line Length for PEP 8?

So, I changed the Maximum Line Length to 90 for the time being because, in our team's standard editors, about 90 characters can be displayed in the one tree tab + two editor tabs.

It's been a couple of months now, and I'm glad I changed it.

I'm thinking of changing it to 99 characters after seeing how it goes.
如何解决箭头函数没有arguments
Published: 2021-09-06 01:26:25

比如我们想要一个function，可以把传入的参数转成一个数组，传统方法代码如下
```
function turnArr(){
  return [].slice.apply(arguments)
}
console.log(turnArr(1,2,3))  // [1,2,3]
```

但如果我们用箭头函数的形式改写的话，发现就报错了，
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1npw7gcw2aqlp9juqw2.PNG)
加个参数进去试试，还是报错
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4b5z5sxw2ewb4q9zfg5.PNG)

为啥不行？原因是箭头函数没有arguments这个类参数数组对象，那么如何解决呢？用[剩余参数](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/Rest_parameters) 
```
const turnArr = (...arguments) => [].slice.apply(arguments)
console.log(turnArr(1,2,3)) //[1,2,3]
```
成功解决了，但是再用这样的写法就啰嗦
```
const turnArr1 = (...args) => args;
console.log(turnArr1(1,2,3)); //[1,2,3]
```
因为arguments是伪数组，而剩余参数确是货真价实的真数组.
How I started my coding journey
Tags: codenewbie, programming, webdev, gamedev
Published: 2021-09-06 01:15:04

Ever since I was very young, I was always into computers. I had always wondered how these things worked, it seemed as though if it were magic. Back in my school days, I was always very excited for the days when we would be having computer classes. Especially the practical ones, because that was the only time when I could actually use a computer since we had none at home back in the day. We were taught most of the basics about computers at school, and with each passing day my passion to know more about them grew.

When I had graduated from high school, I had made up my mind to enroll into a college course where I could learn about programming So I ended up enrolling into a program on Computer Applications. Throughout my college life, I learned about a lot of things starting from the basics of programming where we were introduced about the C language to stuff related to data structures, operating systems, databases , and so on.

Although I learned about so many things, I couldn't still fixate on my mind about what I really wanted to do. Because, computer science is an absolutely vast field. You can do thousands of things starting from developing web apps, to mobile apps, and thousands of other things. 

I had always been a fanatic about games. I always enjoyed playing computer games. So it came up to my mind that I could be developing these games myself that I enjoy playing, so I decided to give it a try. After a bit of research I came to know about game engines that already come with an entirely pre-made framework for us so that we can focus on programming the actual game. So I ended up learning C# and the Unity Game Engine. I did end up making a few basic games which you can play here:

[Link] https://sharemygame.com/@Manoyal/aero-blast
[Link] https://sharemygame.com/@Manoyal/blockanoid3x

Now, if I jump back to the present, then it came to my mind that I should have a portfolio to showcase all of my projects. So I decided to properly learn about web development and truly fell in love with it. Previously I had always relied on things like WordPress but when I actually dove into the realm of Html, CSS and JavaScript I realized how fun it was.

So I did end up making a simple portfolio website for myself which you can check out here:
[Link] https://gaurav-de.netlify.app/

For now, I feel I will explore web development a bit more, and put game development to the side as a 'hobby'. I am looking forward to learning more along this journey!

-Thanks for reading till the end of my first blog.
What is NodeJS?
Tags: node, javascript, api, architecture
Published: 2021-09-06 01:14:05

Nowadays JavaScript is on hype and NodeJS as well. But we should not learn any technology because of it's trend but first understand the core of that technology.

<h2>What is NodeJs ?</h2>
In the past years, we believe that JavaScript can only used in browser but that is not true. JavaScript runs on browser's engine which compiles it and gives us the output.

So a developer Ryan Dahl came up with an idea to run the JavaScript outside the browser and developed NodeJs. 

Chrome uses V8 engine to run JavaScript in browser so for developing NodeJs that engine is used.

While surfing on the net, you can find the definition of  NodeJs is like an asynchronous event-driven JavaScript runtime.

What exactly it means? 
First let's split the words :

<h4>Asynchronous: </h4>
 <p>
Asynchronous means there is no particular sequence of executing the tasks. Whenever the I/O is free, it will execute the task accordingly. For better understanding checkout the below image: 
</p>

![Synchronous](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qv7m874xr6mv9m5lszs0.png)
![Asynchronous](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41brwivsfcivzg9svaus.png)

<h4>Event-Driven: </h4>
<p>
That means whenever any action is called. For example, when button is clicked perform this. That is called event-driven.
</p>

So overall, you get the idea about NodeJs. Our next discussion will be about Why should we use NodeJs?

So till that 😬👇
![Stay tuned](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qy69d1ygk014656sofj7.gif)
CLOSER (Smart virtual Classroom ) 
Tags: elearning, screensharing, courses
Published: 2021-09-06 01:10:20



Learn whatever you want 📕 without leaving home 💒.
💻 Try it out
You can try out CLOSER at [https://closer-classroom.herokuapp.com/]https://closer-classroom.herokuapp.com/)

📣 About Closer
Closer Smart Virtual Classroom is A collaborative web conferencing tool with an online whiteboard, breakout rooms, and screen sharingcapabilities for teachers and tutors who want to conduct highly interactive live online teaching sessions

🚀 Main Features
Online whiteboard : Share with your participants various types of learning resources on the whiteboard and discuss them during your live sessions. Engage your participants in different collaborative activities using the tools for creating, editing and presenting learning content.
Video-conference : See and hear your up to 2 participants simultaneously and experience an interaction which is very similar to face-to-face training.
Screen-sharing :Demonstrate additional software and multimedia applications by sharing your screen with the participants.
Recording : Monitor the work of the tutors in your organisation, analyse your own performance or encourage your learner to revise the learning content by watching the past sessions’ interactive playback.
Post to the class stream : Posts information or a question that you add to the class stream, Comment response to a post or comment, Reply response to a comment that mentions the person who made that comment, Mention classmates or teacher in your post and finally upload file in your post (PDF, Picture …).
Courses : You can add a new course to the class, also u can Modify/Delete/Display it.
🔧 Installation & Usage
Clone the Master branch
Go to Client directory by typing "cd Client" and run "npm install"
Go to Server directory by typing "cd Server" and run "npm install"
Run "node server.js" in the server directory
Run "npm run start" in the client directory
Go to http://localhost:3000 and Enjoy ;)
💡 Devoloped With MERN stack
   

React Js
Node Js
Express Js
Mongo Db

📝 Credit
Created by  NoLimits Team and an amazing community of contributors.

Blazing deployments by  Heroku.

👨‍🚀 Show your support
Give a ⭐️ if this project helped you!

Source-Code : https://github.com/louayyahyaoui/Smart-Virtual-Classroom
Telefe Logo Recreation
Tags: codepen
Published: 2021-09-06 01:07:00

<h3>Go to <a href="https://telefe.com">Telefe</a> for more details.</h3>

<hr>

<h2>🔵🟢🔴 Telefe</h2>

<p><strong>Telefe</strong> is a television station located in <a href="http://fumacrom.com/23H5k">Buenos Aires</a>, Argentina. The station is owned and operated by <strong>ViacomCBS</strong> Through Televisión Federal S.A. Telefe is also one of Argentina’s six nation television network.</p>

<hr>

<p>Our Founder is Héctor Grandiñettí.</p>

{% codepen https://codepen.io/cloneableteam/pen/abwmxve %}
Infografía: Aspectos importantes/generales del diseño de un sistema 
Published: 2021-09-06 00:43:03

![Imagen de Infografía de aspectos importantes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m6s752kis0txnxdlhqp5.png)


Este mapa mental fue creado para una tarea de la Universidad Francisco Gavidia, imagenes extraidas de Wikipedia y del video fuente:
https://www.youtube.com/watch?v=EQ24JCOVCVg