teleren/devto huggingface dataset:
JavaScript, Garbage collection
Published: 2023-03-14 08:06:58

Memory management in JavaScript is performed automatically and invisibly to us. We create primitives, objects, functions… All that takes memory.

What happens when something is not needed any more? How does the JavaScript engine discover it and clean it up?



Reachabilty


The main concept of memory management in JavaScript is reachability.

Simply put, “reachable” values are those that are accessible or usable somehow. They are guaranteed to be stored in memory.

1. There’s a base set of inherently reachable values, that cannot be deleted for obvious reasons.
For instance:

: The currently executing function, its local variables and parameters.
: Other functions on the current chain of nested calls, their local variables and parameters.
: Global variables.
(there are some other, internal ones as well)

These values are called roots.

2. Any other value is considered reachable if it’s reachable from a root by a reference or by a chain of references.

For instance, if there’s an object in a global variable, and that object has a property referencing another object, that object is considered reachable. And those that it references are also reachable. Detailed examples to follow.
How To Modify String In Python?
Tags: webdev, javascript, programming, python
Published: 2023-03-14 08:04:22

This article will teach Python modify strings with examples, hopefully fulfilling education needs.

In Python, strings can be manipulated using built-in methods.

**[Python Modify Strings](https://mrexamples.com/python/python-modify-strings/)** In Upper Case

Strings returned by upper() are always capitalized:

**Edit Strings In Lower Case**

A lower() method returns a string that is in lower case:

**Remove Whitespace**

When you **[modify Python strings](https://mrexamples.com/python/python-modify-strings/)**, you often want to eliminate whitespace before and/or after the string text.

Using strip(), any whitespace at the start or end of a string is removed:

**[Learn More](https://mrexamples.com/python/python-modify-strings/)**
HTML Editors: What They Are and Why They Matter
Tags: webdev, html, javascript, programming
Published: 2023-03-14 07:55:32

The purpose of this article is to examine what HTML editors are, why they are useful, and what types are available.

**[HTML editors](https://mrexamples.com/html/html-editors/)** are tools that allow you to write and edit HTML code easily and efficiently.

**HTML Editor: What Is It?**

An HTML editor is a software application that allows you or any developer to create and edit HTML code.

**[HTML editors](https://mrexamples.com/html/html-editors/)** can be standalone applications or web-based tools that allow you to edit code directly in a web browser.

They provide features like syntax highlighting, code completion, and debugging, which make it easier for you to write clean and efficient Html code.

**Learn HTML Operating TextEdit or Notepad**

Utilizing a professional HTML editors allow for the creation and modification of web pages.

There are tons of html code editors available online from simple text editors to feature-rich integrated development environments (IDEs).

**Some popular HTML editors include:**

Atom
Sublime
Gedit
textpad
And more
But if you want to learn HTML, we advise using a simple text editor such as windows Notepad on your pc or TextEdit (Mac).

We are of the opinion that learning HTML via the use of a basic text editor is an effective method when we talk about HTML editors.

Notepad or TextEdit may be used to help you develop your first website if you follow the instructions below.

**Step 1: Open Notepad (PC)**

**Windows 8 and subsequent versions:**

Launch the Windows 8 Start Screen (the window symbol at the bottom left on your screen). Type Notepad.

**Windows 7 or a previous version:**

Launch Notepad by going to Start, then Programs, then Accessories.


**[Read Full Article ](https://mrexamples.com/html/html-editors/)**
Read OTP SMS- Expo / React Native (Android)
Tags: reactnative, opensource, android, readsms
Published: 2023-03-14 07:54:01

OTP (One Time Password) is a kind of passwordless authentication, which enables user identity verification, granting access to an app/website without the need to remember passwords.

As of now reading incoming OTP SMS on native Android applications is available out of the box, that is not the case for applications developed in Expo targeting Android platform.

_Note: Our focus with this article is strictly to reading incoming OTP SMS in Expo on Android._

**@maniac-tech/react-native-expo-read-sms has been developed to resolve this very limitation on Expo on Android.**

## Read incoming OTP SMS:
We will make use of [@maniac-tech/react-native-expo-read-sms](https://maniac-tech.com/expo-read-sms/) to read incoming SMS in apps built using Expo on Android. These SMS will then be matched with our regex to derive the OTP value if any. You can find the sample app repo mentioned at the end of the article.

### The Code

Step 1. Import the library with the following functions into your app:
``` 
    import {

     checkIfHasSMSPermission,

     requestReadSMSPermission,

     startReadSMS,

    } from “@maniac-tech/react-native-expo-read-sms”;

```
Step 2. Check if the app has required SMS Permissions (READ_SMS, RECEIVE_SMS):
`const permissionState = await checkIfHasSMSPermission();`

The return value of _checkIfHasSMSPermission_ is either false (when permissions are not present), or an object (when permissions are present)

Step 3. Considering that the initial value of the permission will be false, we need to request for user permission:

`requestReadSMSPermission();`

This function will show the native UI seeking SMS Permissions, like this:


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



Step 4: Once the user has allowed the permissions, we can start listening to incoming SMS:

```
startReadSMS(successCallbackFn, errorCallbackFn)
```

As per the documentation of the library:

The function startReadSMS, accepts two parameters a success & a error callback.

```
    const successCallbackFn( status, sms, error) {

    if (status === “success”) {

    console.log(“Success in success callback”);

    // Run a regex of your OTP Message and process it as per your application logic

    if (OTPRegex.test(sms)){

    // OTP matched

    }

    } else {

    console.log(“Error in success callback”);

    console.log(error);

    }

    }

    const errorCallbackFn = (status, sms, error) => {

    console.log(“Error Callback!”);

    console.log(“Start Read SMS failed”);

    };
```


Step 5: Voila!! We can now read incoming OTP SMS in Expo on Android !!

You can find the sample app using the library on GitHub here.

Find the library on npmjs here.

Feel free to contribute and raise issues/feature tickets on GitHub.
Learnings from my first Monetised Side Project — https://hire.win
Tags: product, showdev, challenge, 100daysofcode
Published: 2023-03-14 07:39:28


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

Being a freelancer has many Pros and cons. I have been into freelancing since the last 4 years now and have worked a lot on client projects.

Working for clients had been fairly simple in terms of earning. I utilised my coding and communication skills to make sure I make quality delivery and keep my clients happy. At the end, I was paid for the hours I worked. Simple, isn’t it?

But I was always curious, while development costs are too high, how are my clients able to make up and earn from the products we developed for them? I wanted to be in their shoe and explore what the process of building a product from scratch feel like.

And here I am having built a full-fledged product having not many but a few paying customers and a lot of customers on the Free Plan — https://hire.win

I used to take a lot of interviews and interact with recruiting managers and I always wanted a simple tool to make the interviewing process simpler. So, I decided to build it myself and release it to the world!

Guess what, I listed the product on Product Hunt and it was ranked #4 Product of the day out of around 100 products launched on the same day! As they say, hard work does pay off some day or the other. I was happy, the product was welcomed well by the audience!

In simpler terms, hire.win is an Applicant Tracking System (ATS) which helps list job posts, provides an instant careers page, lets candidates apply to the job, and let interviewers and hiring managers handle the rest of the process from scheduling interviews to interviewing to submitting score cards.

Firstly, I learnt a lot of new terms like Product-Market Fit, Go to Market (GTM), and a lot more as I started to build Hire.win 😀

But, what I truly learnt from my product building experience was — making a decision. Whether to build a feature at this stage or to skip it? How urgent is this feature and what would be the impact on customers? There were multiple questions that I had to ask myself and then make a decision. Frankly, making the decision was harder then building the feature itself!

Deciding the monetisation strategy and to work on the subscription models was even more difficult. Designing the landing page of the product seemed like solving a math puzzle! Literally, all these things are more difficult than building the product itself!

Once I went through all the processes, building from scratch to launching the product, I had a lot of learnings to take from my product building journey!

Lastly, do check the product at https://hire.win and let me know your suggestions in the comments below. Also, if you are in need of any app to use in your day-to-day life and can’t find it already on the web or app store, do let me know and I’ll see if I can spend some time and launch a free version.

Thanks for reading!

—Vivek
Managing Docker-Platform using Docker SDK/CLI.
Published: 2023-03-14 07:33:02

The Docker CLI is a command-line interface that allows you to manage Docker from the terminal. It is **built using the Docker SDK** **for Go** and provides a user-friendly interface for running Docker commands.

Docker-SDK: is the official Go library for Docker's API. It provides a simple and easy-to-use interface for interacting with Docker. You can use it to create and manage Docker containers, images, networks, volumes, and more.

So they communicate in this direction:
Go-Lang -> Docker-SDK/CLI -> Docker-Platform

The key difference between Docker CLI and Docker SDK is that Docker CLI is a command-line tool that is designed for manual interaction, while Docker SDK is an API that is designed for programmatic interaction. Docker CLI is primarily used by system administrators and developers to manage Docker resources, while Docker SDK is primarily used by developers to build Docker-based solutions and applications.

The difference b/w Docker SDK and CLI is same as the difference b/w Python' SDK and CLI
ie, Python has a rich set of libraries and frameworks that is used to develop applications, whereas Python CLI on the other hand, is a command-line tool that allows users to interact with Python in a terminal or console environment.

In summary, Docker CLI provides a simple and powerful command-line interface for managing Docker resources, while Docker SDK provides a programmatic way of interacting with Docker for developers who want to build custom Docker-based solutions and applications.
Create Stunning Posters and Flyers with Poster App Lab!
Tags: poster, postermaker, graphicdesign, design
Published: 2023-03-14 07:20:09

Do you want to make eye-catching posters and flyers online? Poster App Lab offers a simple online flyer and [poster maker](https://posterapplab.com) that will help you create eye-catching designs.

You can create beautiful visuals for business, events, and personal projects with our powerful, user-friendly platform. You can quickly customize templates and add text or images to make them stand apart from the rest.


Poster App Lab gives you a range intuitive design tools to help you create posters and flyers that are perfect in color, font sizes, etc. You can upload your own photos and logos to personalize the designs.


Our platform is perfect to use for business, individuals, event organizers, and anyone who wants to quickly and easily create professional-looking [posters](https://poster-maker-app.blogspot.com/2023/02/the-ultimate-guide-to-poster-maker.html). Poster App Lab provides everything you need to promote a product, have a party, or show your creativity.


Avoid boring and generic flyers and posters. Sign up for Poster App Lab today, and you can create striking designs that will amaze your audience.
Responsive Web Design Services in Milwaukee
Tags: responsivewebdesign, responsivewebdesignmilwaukee, webdesignmilwaukee, webdesign
Published: 2023-03-14 07:19:03

**Responsive web design services in Milwaukee** are becoming increasingly popular as businesses look for ways to make their websites more accessible to all devices. Responsive web design is the practice of creating a website that adapts to the size of the user’s screen, providing an optimal viewing experience across all devices. This approach ensures that **websites are designed** to be compatible with any device, regardless of screen size, resolution, or orientation.

At Ricoh Technologies, we specialize in providing **[responsive web design services in Milwaukee](https://69thedeal.com/milwaukee-responsive-web-design/)**. Our team of experienced web designers and developers utilize the latest technologies, such as HTML5, CSS3, and JavaScript, to create websites that are optimized for mobile devices. We understand the importance of having a website that looks great and functions properly on all devices, and we work to ensure that your website is responsive and user-friendly.

We also understand the importance of SEO and can help you optimize your website for the search engines. Our team of SEO specialists can provide you with keyword research, link building, and content optimization to ensure that your [website is ranked highly](https://69thedeal.com/milwaukee-responsive-web-design/) in the search engine results.

Whether you are looking for a website that is optimized for mobile devices or for a fully responsive website, Ricoh Technologies can provide you with the services you need. Contact us today to learn more about our [responsive web design services in Milwaukee](https://69thedeal.com/milwaukee-responsive-web-design/).
The Toast Sandwich and the Magic of Callback Functions
Tags: javascript, beginners, webdev, tutorial
Published: 2023-03-14 07:17:08

This was a tough topic for me to wrap my head around, but finally, I understood it. Let me tell you a story that will help you understand callbacks and asynchronous programming.

You are in the mood for a yummy toast sandwich with cheese and vegetables. There are two steps to it:

1.First, make two bread toasts ( function toastBread() )
2.Make the sandwich ( function makeSandwich() )

You start by putting the bread in the toaster and setting the timer for two minutes. But what should you do during those two minutes? You decide to start preparing the fillings for the sandwich by chopping up some vegetables and cheese.

Now, here's the problem: How will you know when the bread is done toasting? You don't want to burn it! This is where asynchronous programming comes in.

When you put the bread in the toaster, you also tell the toaster what to do once the bread is done toasting. This is where the callback function comes in. When you put the bread in the toaster, you also tell the toaster what to do once the bread is done toasting. This is the callback function that you pass as an argument to the toastBread() function. In our case, the callback function is the second step of making the sandwich: makeSandwich().
```
function **toastBread**(here we have to tell this function what to do after bread is done toasting _as a parameter_ - lets call this as _callback_) 

function toastBread(callback) {

  // Put the bread in the toaster
  // Set the timer for 2 minutes
  // Start the timer
  // When the timer is done, call the callback function
  setTimeout(() => {
    callback();
  }, 2000);
}

function makeSandwich() {
  // Assemble sandwich with toasted bread and fillings
}

// Make the toast first, and then make the sandwich
toastBread(makeSandwich);
```
Now, here's the important part: the toastBread() function is an example of an asynchronous function. It means that the function doesn't block the rest of the code from executing. Instead, it starts a timer and lets the code continue executing. When the timer is done, the callback function is called.

So, while the bread is toasting, you can continue preparing the fillings for the sandwich, without waiting for the toastBread() function to complete. 

When the 2 minutes are up, the toaster calls the callback function, which in our case is makeSandwich(). This function is now executed, and the sandwich is assembled using the **toasted bread** and **the fillings** you prepared earlier.

So, in summary, the callback function is a way to tell a function what to do once a certain task is complete. It allows you to execute code in a specific order, and helps to avoid situations where you have to wait for one task to complete before moving on to the next one.

And that, my friends, is how you can make a sandwich. So next time you're hungry and in a hurry, remember to toast your bread with a callback function!
Become a more valuable team member - Habits in our life
Tags: programming, productivity
Published: 2023-03-14 07:12:43

I have been living my whole life hearing of habits. Do a "21 day challenge" to form a habit. 

"Do this for 30 days and it will become a habit."

I would constantly hear this from every post on Instagram, every article on the internet, and some of my favorite youtubers.

I tried to do this for a while, but I never really got the results I wanted. I would do a 21 day challenge, and then I would stop. I would do a 30 day challenge, and then I would stop. I would do a 60 day challenge, and then I would stop.

This didn't make sense to me. I knew I had to work on my habits if I was to get anything done.

I picked a book called Atomic Habits by James Clear. I read it and I was blown away. I had never heard of this book before, but it was a game changer for me.

I learned of the 1% rule. This rule states that if you do something 1% better every day, you will be 37 times better in a year.

The best example I got was that of an aeroplane. When you change the knot of an aeroplane just slightly, if you were heading to the east, you would end up in the west. That was my mind blown moment.

I started to apply this to my life. I started to do 1% more work every day. I started to do 1% more exercise every day. I started to do 1% more reading every day.

All this I started with the two-minute rule. The two-minute rule states that if you can do something in two minutes, you should do it right away. This is because it takes more energy to start something than to continue it.

I started to do this with coding. I would do 1% more coding every day. I would do 1% more reading every day. 

I also incorporated this into my fasting. I would do fasting for 18 hours consistently. 18 hours was my sweet spot and I could do it consistently. 

In 3 years, I have lost a lot of weight. I have done better coding projects than I ever thought I could. I have read more books than I ever thought I could. I have done more exercise than I ever thought I could.

It's a journey and I am still on it. The simple rule works. If you do 1% more every day, you will be 37 times better in a year.

Happy learning!
Share Your Coding Milestones! 💻🚀
Tags: discuss, beginners, codenewbie
Published: 2023-03-14 07:00:00

Coding can be a challenging journey, and it’s important to celebrate our accomplishments along the way. So today, we’d like you to share your coding milestones with us! 

Have you completed a difficult project recently? Learned a new programming language, perhaps? Or maybe you finally grasped a particularly difficult concept or mastered a new skill. We want to hear about it.

Share your achievements with the community. Let's encourage and support each other as we continue on our coding journey!
Me and SeekMIDI: Programming in Perl
Tags: perl, midi, beginners
Published: 2023-03-14 06:58:19

A little bit about me, since I just joined: My name is Avery Adams, and I've played with some Perl since about 2016, when I started my simple graphical MIDI sequencer SeekMIDI. I was dormant in Perl for a long while and am just starting to get my programming skills back in shape.

I've been trying to keep up with the Perl Weekly Challenges to learn new skills, and it's taught me a lot and showed me how other programmers write their Perl code. You might even see me blog about one of my solutions here, or you might see an occasional update about SeekMIDI.
Handling Import Errors
Tags: opengauss, database
Published: 2023-03-14 06:57:22

**Scenarios**
Handle errors that occurred during data import.

**Querying Error Information**
Errors that occur when data is imported are divided into data format errors and non-data format errors.

**·** Data format errors

When creating a foreign table, specify **LOG INTO **error_table_name. Data format errors during data import will be written into the specified table. You can run the following SQL statement to query error details:

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

Table 1 lists the columns of the error_table_name table.

Table 1 Columns in the error information table

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

**·** Non-data format errors

A non-data format error leads to the failure of an entire data import task. You can locate and troubleshoot a non-data format error based on the error message displayed during data import.

**Handling Data Import Errors**
Troubleshoot data import errors based on obtained error information and descriptions in the following table.

Table 2 Handling data import errors

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/64mwdwak78o17k5lmo4u.png)
Working with Databases-Creating and Managing Views
Tags: opengauss, database
Published: 2023-03-14 04:32:31

**Background**
If some columns in one or more tables in a database are frequently searched for, an administrator can define a view for these columns, and then users can directly access these columns in the view without entering search criteria.

A view is different from a base table. It is only a virtual object rather than a physical one. Only view definition is stored in the database and view data is not. The data is stored in a base table. If data in the base table changes, the data in the view changes accordingly. In this sense, a view is like a window through which users can know their interested data and data changes in the database. A view is triggered every time it is referenced.

**Managing Views**

**·**Creating a view

Run the following command to create MyView:

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


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

**·** Querying a view

Run the following command to query MyView:

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

**·** Viewing details about a specified view

Run the following command to view details about the **dba_users** view:

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

**·** Deleting a view

Run the following command to delete **MyView**:

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