teleren/devto huggingface dataset:
Achieving Reusability With React Composition
Tags: javascript
Published: 2023-01-17 07:43:29

React Composition is a development pattern based on React's original component model where we build components from other components using explicit defined props or the implicit children prop.

In terms of refactoring, React composition is a pattern that can be used to break a complex component down to smaller components, and then composing those smaller components to structure and complete your application.

**Accordion Component**

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

const Accordion = () => {
  const [expanded, setExpanded] = useState(false);

  const toggleExpanded = () => {
    setExpanded((prevExpanded) => !prevExpanded);
  };

  return (
    <div>
      <button onClick={toggleExpanded}>
        Header <span>{expanded ? "-" : "+"}</span>
      </button>
      {expanded && <div>Content</div>}
    </div>
  );
};

export default Accordion;
 ```

```
 import React from "react";
import Accordion from "./components/Accordion";

const App = () => {
  return <Accordion />;
};

export default App; 
```

**Editable Component**

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

const Editable = () => {
  const [editable, setEditable] = useState(false);
  const [inputValue, setInputValue] = useState("Title");

  const toggleEditable = () => {
    setEditable((prevEditable) => !prevEditable);
  };

  const handleInputChange = (e) => {
    setInputValue(e.target.value);
  };

  return (
    <div>
      {editable ? (
        <label htmlFor="title">
          Title:
          <input
            type="text"
            id="title"
            value={inputValue}
            onChange={handleInputChange}
          />
        </label>
      ) : (
        <>Title: {inputValue}</>
      )}
      <button onClick={toggleEditable}>{editable ? "Cancel" : "Edit"}</button>
    </div>
  );
};

export default Editable;
```

```
import React from "react";
import Editable from "./components/Editable";

const App = () => {
  return <Editable />;
};

export default App;
```

Let's explore one similarity between these two components.

**Problem:** Notice how both the Accordion component and the Editable component share the same functionality, where both are dependent on a boolean and a function to update that boolean — in other words, a toggle functionality.

**Solution:** We can use a custom hook that will allow us to reuse this toggle logic in both components, and in any new component added in the future.
Things You Need to Know About IQOS Heets
Published: 2023-01-17 07:38:24

If you’re a fan of smoking and looking for an alternative, then you must have heard of IQOS Heets. These are special heat-not-burn tobacco products that come in a wide range of flavors. They are designed to give smokers the same satisfaction as a traditional cigarette, but without all the harmful chemicals that come with it. If you’re curious about trying IQOS Heets but don’t know where to start, this blog post is for you! Here we will discuss everything from the different types of flavors available to tips on how to get started with using these products. 

IQOS Heets come in a variety of flavors, including menthol and cherry. Each flavor has its own unique taste that can be tailored to your preference. Menthol is great for those who want a classic cigarette flavor while cherry is perfect for those who prefer something more sweet and fruity. If you’re feeling adventurous, there are also other unique flavors such as Turkish Delight, Cola Ice and Caramel Coffee available at Matsu.

## How to Start Using IQOS Heets 

The first step when using IQOS Heets is to make sure that your device is charged and ready to go. Once your device is charged, it’s time to choose which flavor you would like to try first! It’s important to remember that each flavor has its own unique taste so it might take some trial and error before finding one that best suits your preference. Then, place the HEET into the holder chamber and press the button on top of the device until you hear it click into place - this means it's securely locked in place. Now all you have left to do is enjoy! 

It’s important to remember that due to their higher nicotine content, IQOS Heets should not be used by those under 18 years old or pregnant women. If you experience any adverse side effects after using this product consult with your doctor right away.  	

Conclusion: 
IQOS Heets offer a much safer alternative than cigarettes without sacrificing taste or satisfaction. With their wide array of flavors from menthol and cherry, there really is something for everyone! When using these products make sure that your device is always charged before use and never use them if you are under 18 years old or pregnant women as they contain higher nicotine content than other alternatives on the market today. Make sure to check out [IQOS Heets in Sharjah](https://matsu.ae/sharjah/) – for more information about these amazing products!
How to quickly delete duplicate rows in CSV, Excel, Markdown tables?
Tags: markdown, excel, csv, table
Published: 2023-01-17 06:45:05


If you're working with CSV, Excel, or Markdown tables, you may run into issues with duplicate rows. This could be because you entered duplicate data manually, or because you imported duplicate data from another source. Whatever the reason, removing duplicate rows is an important data cleansing task. This article will show you how to quickly remove duplicate rows in CSV, Excel, and Markdown tables using a few different methods.

### 1. Online form tool [recommended]

You can use an online tool called "Table Convert" to remove duplicate rows. This tool helps you easily check and remove duplicate rows in CSV, Excel, Markdown tables. Just open https://tableconvert.com/excel-to-excel in the browser, then paste or upload the content to be deduplicated in the data source, and click the "Deduplicate" button of Table Editor to complete the deduplication easily and quickly Heavy, as shown in the figure:
￼
![Delete duplicate rows in CSV, Excel, Markdown tables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86uzrihq92ove0ylnrrm.png)


### 2. Delete duplicate rows in Excel
Deleting duplicate rows in Excel is a very simple matter. First, open your Excel file and select the column you want to check for duplicate rows. Next, click the "Data" menu and select "Remove Duplicates." Excel will pop up a dialog box for you to select the columns you want to delete duplicate rows from. Click OK and Excel will delete all duplicate rows.

### 3. Delete CSV Duplicate Lines with Python
If your data is stored in CSV files, you can use Python to remove duplicate rows. First, you need to install the pandas library. Then, use the following code to read the CSV file and remove duplicate rows:

```python
import pandas as pd

data = pd.read_csv("your_file.csv")
data = data. drop_duplicates()
data.to_csv("your_file.csv", index=False)
```

This code reads the CSV file, removes duplicate rows, and writes the cleaned data back to the original file.


Summary: Removing duplicate rows in CSV, Excel, and Markdown tables is an important data cleaning task. By using the above methods, you can easily check and remove duplicate lines in these files and make sure your data is accurate and useful.
Consistency - How to be consistent
Tags: beginners, webdev, javascript, python
Published: 2023-01-17 06:30:26

Consistency is a key trait to achieving success in any area of life, whether it be in personal or professional pursuits. It is the ability to consistently show up and do the work, even when it is difficult or uncomfortable. Here are a few tips on how to be consistent:

1. Set clear and specific goals. Consistency starts with having a clear idea of what you want to achieve. Set specific and measurable goals for yourself, and make sure they align with your values and priorities.

2. [Create a routine](https://www.northshore.org/healthy-you/how-to-start-a-new-routine-and-stick-to-it/). Consistency is easier to maintain when you have a routine in place. Identify the tasks and activities that are most important for achieving your goals, and schedule them into your day.

3. Make it a habit. Habits are formed by repeating a behavior over and over again. Make consistency a habit by consistently doing the things you need to do in order to achieve your goals, even when you don't feel like it.

4. Stay accountable. It's easy to let consistency slip when you're not held accountable. Find a accountability partner or group, or simply tell someone about your goals and ask them to check in on your progress.

5. Stay motivated. Consistency can be challenging, especially when progress is slow or when you encounter obstacles. Stay motivated by reminding yourself of the reasons why you set your goals in the first place, and celebrate small wins along the way.

6. Reflect and adjust. Consistency is not a one-time effort, it's a continuous process. Reflect on your progress and adjust your approach if necessary. Remember that consistency is about progress, not perfection.

In summary, consistency is a powerful tool for achieving success. By setting clear and specific goals, creating a routine, making it a habit, staying accountable, staying motivated, and reflecting and adjusting your approach, you can build consistency into your life and achieve the things you want to achieve.
Dart cascade notation (..) and usage in list
Published: 2023-01-17 04:05:13

A bit introduction: according to dart.dev: 

Cascades (.., ?..) allow you to make a sequence of operations on the same object. In addition to accessing instance members, you can also call instance methods on that same object. This often saves you the step of creating a temporary variable and allows you to write more fluid code.

```
var paint = Paint()
  ..color = Colors.black
  ..strokeCap = StrokeCap.round
  ..strokeWidth = 5.0;
```
The constructor, Paint(), returns a Paint object. The code that follows the cascade notation operates on this object, ignoring any values that might be returned.

The previous example is equivalent to this code:

```
var paint = Paint();
paint.color = Colors.black;
paint.strokeCap = StrokeCap.round;
paint.strokeWidth = 5.0;
```

You can also not assign the value and just run some functions.
Let's play around and see these examples:

```
class Cat {
  String sound() => 'hi';
  String sound2() => 'hi2';
}

void main() {
  // Create a Cat instance
  final cat = Cat();
  
  print(cat.sound()); // 'hi'
  print(cat..sound()..sound2()); // Instance of 'Cat'
 

  print([]..add(1)); // [1]

  print([].add(1));
  // Error: This expression has type 'void' and can't be used.
  // You can't print void value.
  
  [].add(1); 
  // The array is [1].The add method returns 
  // void and the value is not assigned to any variable.
  


  List<int> num = [1];
  num.add(2); 
  num.add(3); 
  print(num);
  // [1,2,3]
  
  // It is equivalent:
  List<int> num2 = [1]..add(2)..add(3);
  print(num2);
  // [1,2,3]

}
```

Finally, I find this link useful when encounter errors of 
'Cannot add to an unmodifiable list' or 'The default value of an optional parameter must be constant': 

https://stackoverflow.com/questions/66550202/how-to-add-to-an-existing-list-got-unsupported-operation-cannot-add-to-an-unm

Basically it means the 'const' keyword makes the list unmodifiable. You can use spread operator(...) or List.from() to make a new array to solve this problem.

`chat.messages = [...chat.messages, message];`
`chat.messages = List.from(chat.messages)..add(message)`;
How Do I Hire a Full Stack Software Developer?
Tags: devops, webdev, programming
Published: 2023-01-17 06:15:27

## Components of the Main Full Stack Layer

Everyone should be aware of the below-mentioned three fundamental layers of software development:-

1. Frontend or Presentation Layer
2. Backend or Business Layer
3. Database Layer

A full-stack developer isn’t always an expert in all three domains, but he or she can work in, comprehend, and supervise them. So, by employing a full-stack software developer, you’re getting a one-stop shop that can handle all of your software needs.

## Full-Stack Developers by the Stack

There are various types of [full-stack developers](https://www.infiraise.com/hire/hire-full-stack-developer/), just as there are various types of software engineers. Here are the primary types of full-stack developers based on the specific stack to make you understand:-

1. MEAN STACK
2. MERN STACK
3. LAMP STACK
4. LEMP STACK
5. Full-Stack Elixir
6. Full-Stack Python
7. Full-Stack Django
8. Full-Stack Java
9. Full-Stack Ruby on Rails

As a result, you should hire a full-stack developer based on the language you’re using for development. If your project calls for an Angular front-end and a Node.js back-end, for example, you’ll need to hire a MEAN stack developer.

## Why Do Companies Require a Full Stack Software Developer?

[Full-stack software developers](https://www.infiraise.com/hire/hire-full-stack-developer/) aren’t always specialists in all of the layers. Some people may excel at the front end but have limited familiarity with the back end. So, why do firms hire full-stack developers in the first place, and why are they in such high demand? It turns out that there are a couple of rational reasons for this.

## What Full-Stack Developers can Perform?

Because of the following qualities, full-stack engineers are in high demand:

1. Ability to code computer programs, online applications, or 
   mobile apps.
2. Collaborate with other developers and team members on the 
   development process (including product managers, project 
   managers, and C-level executives).
3. Investigate technological difficulties at every level.
4. Describe testing methods for a variety of applications.
5. Debugging and analyzing database queries
6. Quality assurance testing codes for app validation and 
   compatibility across needed devices.
7. Keeping an eye on key KPIs and taking action when necessary.
8. Creating a plan for future needs and expressing it to senior 
   management.

As a result, [full-stack engineers](https://www.infiraise.com/hire/hire-full-stack-developer/) aren’t limited to coding. They are in charge of a variety of responsibilities, including overseeing and communicating, both of which are management-related tasks. Apart from that, they’re excellent developers on both sides of the tiers. By hiring a full-stack software engineer for your company, you’re effectively hiring a top-level employee capable of their own work and outstanding development services.


Article Source: https://www.infiraise.com/how-do-i-hire-a-full-stack-software-developer/
Getting Started with the .NET MAUI ListView
Tags: csharp, dotnet, dotnetmaui
Published: 2023-01-17 05:55:38

Learn how easily you can create and configure Syncfusion MAUI ListView using Visual Studio 2022 and .NET 7.0. In this video, the ListView control was added to the project using the Syncfusion .NET MAUI ListView NuGet package. I'll also demonstrate how to select items in the list, change its layout, and add a header and footer.

**Product overview**: https://www.syncfusion.com/maui-controls/maui-listview

**Download an example from GitHub**: https://github.com/SyncfusionExamples/getting-started-with-the-dotnet-maui-listview

**Refer to the following documentation**: https://help.syncfusion.com/maui/listview/getting-started

**Check out this GitHub example**: https://github.com/syncfusion/maui-demos/tree/master/MAUI/ListView

{% youtube EFo2zIFw60Q %}
Emmet Cheat Sheet
Tags: emmet, vscode, webdev
Published: 2023-01-17 05:55:07

## Child: >
> nav>ul>li
```
<nav>
	<ul>
		<li></li>
	</ul>
</nav>
```

## Sibling: +
> div+p+bq

```
<div></div>
<p></p>
<blockquote></blockquote>
```

## Climb-up: ^
> div+div>p>span+em^bq 
```
<div></div>
<div>
	<p><span></span><em></em></p>
	<blockquote></blockquote>
</div>
```
> div+div>p>span+em^^bq 
```
<div></div>
<div>
	<p><span></span><em></em></p>
</div>
<blockquote></blockquote>
```
## Grouping: ()
> div>(header>ul>li*2>a)+footer>p 
```
<div>
	<header>
		<ul>
			<li><a href=""></a></li>
			<li><a href=""></a></li>
		</ul>
	</header>
	<footer>
		<p></p>
	</footer>
</div>
```
> (div>dl>(dt+dd)*3)+footer>p 
```
<div>
	<dl>
		<dt></dt> 
		<dd></dd> 
		<dt></dt> 
		<dd></dd> 
		<dt></dt> 
		<dd></dd>
	</dl> 
</div>
<footer>
	<p></p>
</footer>
```
## Multiplication: *
> ul>li*5

```
<ul>
	<li></li>
	<li></li>
	<li></li>
	<li></li>
	<li></li>
</ul>
```
## Naming and numbering: $
> ul>li.sample$*5
```
<ul>
	<li class="sample1"></li>
	<li class="sample2"></li>
	<li class="sample3"></li>
	<li class="sample4"></li>
	<li class="sample5"></li>
</ul>
```
> h$[title=topic$]{Headline $}*3
```
<h1 title="topic1">Headline 1</h1>
<h2 title="topic2">Headline 2</h2>
<h3 title="topic3">Headline 3</h3>
```
> ul>li.item$$$*5

```
<ul>
	<li class="item001"></li>
	<li class="item002"></li>
	<li class="item003"></li>
	<li class="item004"></li>
	<li class="item005"></li>
</ul>
```
> ul>li.item$@-*5

```
<ul>
	<li class="item5"></li>
	<li class="item4"></li>
	<li class="item3"></li>
	<li class="item2"></li>
	<li class="item1"></li>
</ul>
```
> ul>li.item$@3*5 

```
<ul>
	<li class="item3"></li>
	<li class="item4"></li>
	<li class="item5"></li>
	<li class="item6"></li>
	<li class="item7"></li>
</ul>
```

## ID and CLASS attributes
> '#header'
```
<div id="header"></div>
```
> .title

```
<div class="title"></div>
```
> form#search.wide

```
<form action="" id="search" class="wide"></form>
```
> p.class1.class2.class3

```
<p class="class1 class2 class3"></p>
```

## Custom attributes
> p[title="Hello world"]

```
<p title="Hello world"></p>
```
> td[rowspan=2 colspan=3 title]

```
<td rowspan="2" colspan="3" title=""></td>
```
> [a=‘value1‘ b="value2"]

```
<div a="value1" b="value2"></div>
```

## Text: {}
> a{Click me}

```
<a href="">Click me</a>
```
> p>{Click }+a{here}+{ to continue}

```
<p>Click <a href="">here</a> to continue</p>
```

## Implicit tag names
> em>.class

```
<em><span class="class"></span></em>
```
> ul>.class

```
<ul>
	<li class="class"></li>
</ul>
```
> table>.row>.col

```
<table>
	<tr class="row">
		<td class="col"></td>
	</tr>
</table>
```
Cypress Tutorial For Beginners : Part 4 ( Cypress Download File )
Tags: webdev, beginners, tutorial, programming
Published: 2023-01-17 05:43:45

In this video cypress tutorial for beginners, We are going to learn how to download file in cypress and create our script to check cypress downloaded file.

Cypress is a JavaScript test automation solution for web applications.
 It enables teams to create web test automation scripts.
This solution aims to enable frontend developers and test automation engineers to write web tests in the de-facto web language that is JavaScript.

{% embed https://youtu.be/TUyuYEgj6oo
 %}

Cypress also supports the Mocha test framework so the core technologies in which you would develop your web test automation are Java Script on top of Mocha.

It is a test automation tool that enables developers to automate web browser testing.
The Selenium WebDriver protocol enables sending commands in various development languages like Java, Java Script, C#, Python, and others from the test environment (IDEs) to a selected desktop browser (Chrome, Firefox, Edge, Safari).

-----------------------------------------------------
👪 Join our Community - http://bit.ly/learntesting2019

✅ Automation Community - https://thetestingacademy.com

🐦Follow us on Twitter  - https://twitter.com/itstechmode

📖 Like us on Facebook - https://www.facebook.com/scrolltest

🎤  Listen to our Podcast - https://anchor.fm/thetestingacademy

------------------------------------------------------

#automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest

🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -
https://scrolltest.com/go/edureka


✅Learn Jenkins for QA -
https://bit.ly/learnjenkins-p1


✅Programming Java -
https://bit.ly/learnjava2020-p1


✅Test Automation - 
https://bit.ly/learnautomation2020


✅API Testing - 
https://www.learnapitesting.com


✅Cypress Tutorial with LIVE Projects -
http://cypresstutorial.com
jQuery Drag And Drop Div Example
Tags: javascript, jquery, html, bootstrap
Published: 2023-01-17 05:30:00

in this article, we will see a jquery drag and drop div example. For this example, we are using sortable js. 

Sortable is a JavaScript library for reorderable drag-and-drop lists. You can reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework is required.

So, let's see draggable div jquery, draggable li element in jquery, jquery sortable list, sortable drag and drop javascript, sortable js, drag and drop element jquery, sort li in jquery, recording div using jquery, reordering li using jquery.

Also, you can install SortableJS.

> Step 1: Add HTML

In this step, we will add HTML like the below code example.

```
<html>
	<head>
		<!-- Latest compiled and minified CSS -->
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>

		<!-- Latest Sortable -->
		<script src="http://SortableJS.github.io/Sortable/Sortable.js"></script>
	</head>
	<body>
        <h2>jQuery Drag And Drop Div Example - Techsolutionstuff</h2>
		<input type="checkbox" value="1" name="autoSubmit" id="autoSubmit" checked="checked">Auto Sort
  
		<ul id="sortable-list" class="ui-sortable" unselectable="on" style="-moz-user-select: none;">    
		    <li title="1">Item 1</li>
		    <li title="2">Item 2</li>
		    <li title="3">Item 3</li>
		    <li title="4">Item 4</li>	
		    <li title="5">Item 5</li>
		    <li title="6">Item 6</li>
		  </ul>
		  
		<input type="hidden" name="sort_order" id="sort_order" value="1,2,3,4,5,6" />
		  
		Last order: <span id="sort-result"></span>
	</body>
</html
``` 

> Step 2: Add CSS

Now, we are adding CSS for the layout.

```
#sortable-list li {
  list-style: none;
  background-color:#e5e5e5;
  border-bottom: 1px solid #f8f8f8;
  padding:7px;
  margin:7px;
  width:15%;
  text-align:center;  
}
ul{
  display:flex;
}

#sort-result {
  color: brown;
}

h2{
  text-align:center;
  margin-top:50px;
}
body{
  width:60%;
  margin:50px
}
``` 

> Step 3: Add Javascript

In this step, we use the sortable() function to sort the li element.

```
<script>
var submit = $('#autoSubmit'),
      list = $('#sortable-list'),
      sortInput = $('#sort_order');

var fnSubmit = function(save){
    var sortOrder = [];
    list.children('li').each(function(){
        sortOrder.push($(this).data('id'));
    });

    sortInput.val(sortOrder.join(','));
    
    $('#sort-result').text(sortOrder);   
};

/* store values */
list.children('li').each(function() {
	  var li = $(this);
  
    //store value and clear title value
    li.data('id',li.attr('title')).attr('title','');

});

/* sortables */
list.sortable({
  opacity: 0.7,
  update: function() {
    fnSubmit(submit[0].checked); //.checked return boolean
  }
});

</script>
```

Output:

![jQuery Drag And Drop Div Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ip6v87801feosj91shl5.png)