teleren/devto huggingface dataset:
Strict Mode
Tags: javascript, codenewbie, programming, react
Published: 2023-09-09 13:19:14

Using **strict mood** to write **secure** JavaScript.

**Strict Mode** makes it easier for us developers to avoid accidental errors.

<br />
Without the `strict mode` being active it's hard for me to guess where my code is broken.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozgil6hb53z3px3j0f4i.png)

<br />
**Strict Mode** also introduce a short list of variable names that are reserved for features, that might be added to the language a bit later.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tf3j2b6k9o82kbkaipbj.png)

<br />

## Summary:
**Strict mode** allows the JavaScript interpreter to make some optimization that it **can't** do when using non-strict mode.
With that said under `strict mode` your code may well run faster. 
Plus strict mode makes the rules of the language clearer so you are less likely to make a wrong assumption about your code.
Many people using `strict mode` without even knowing it since ES modules are inherently strict. 
So if you're writing code in modules, which is generally how modern JavaScript is written these days, you're using it.

I hope that help clarify what strict mode is and how helpful can be.
npm hack to remove unused transitive dependencies
Tags: javascript, npm, node, security
Published: 2023-09-09 13:13:09

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

Unused dependencies can be a pain in javascript project. For example your use `foo` package in your project. And `foo` package depends on `bar` package. Sometimes code from `bar` is unused in your project, but there is no way to remove it.

I've created an empty [dry-uninstall](https://www.npmjs.com/package/dry-uninstall) package to «solve» an issue with unused transitive dependencies:

```json
{
  "overrides": {
    "foo": {
      "bar": "npm:dry-uninstall"
    }
  }
}
```
It uses hack in `overrides` section of `package.json` to replace `bar` dependency of `foo` with an empty index.js:

```javascript
module.exports = {};
```

### Reasoning

The main reasons why this could help are:

1. **Bundle size.** When tree-shaking does not work for some reasons.

2. **Simplified Build.** There was a long time when installing mongodb required kerberos package. That itself required to build native add-on modules, and it can be painful.

3. **Security.** Replace the vulnerable packages, to be sure that the code is never used.

4. **License Issues.**

### Sample: Removing momentjs package from simple-node-logger

You've created a minimal project that uses [simple-node-logger](https://www.npmjs.com/package/simple-node-logger), simple multi-level logger for console and files:

```javascript
// index.js
const SimpleLogger = require('simple-node-logger');
const appender = new SimpleLogger.appenders.ConsoleAppender();

const manager = new SimpleLogger();
manager.addAppender(appender);

const log = manager.createLogger();
log.info('this is a simplelog statement');
```

Check the size of bundle (**~383 KB**)

```
    esbuild index.js --bundle --platform=node --outfile=index.dist.js
    
      index.dist.js  383.7kb
```

### Removing momentjs

Update timestamp format code to remove the momentjs dependency:

```javascript
// index.js
appender.formatter = function(entry) {
    const fields = this.formatEntry( entry, appender);

    return fields.join( appender.separator );
};
appender.formatTimestamp = (ts) => {
    return ts.toString();
};
```

Override `momentjs` with `dry-uninstall` in `package.json`

```json
{
  "dependencies": {
    "simple-node-logger": "^21.8.12"
  },
  "overrides": {
    "moment": "npm:dry-uninstall@0.3.0"
  }
}
```

Check the size of bundle (**~241 KB**)

```
    esbuild index.js --bundle --platform=node --outfile=index.dist.js
    
      index.dist.js  241.7kb
```

Saved around 140 kb, not bad.
How to Watch UFC 293 Adesanya vs Strickland Live Online
Published: 2023-09-09 13:11:15

How to Watch UFC 293 Adesanya vs Strickland Live Online. HERE’S How To Watch UFC 293 Live Stream FREE on Reddit Sat, 9 Sep. 

[**Watch UFC 293 Live Stream Online**](https://kayo.fightepass.com/how-to-watch-ufc-293-adesanya-vs-strickland-live-online)

UFC 293 Live streaming Israel Adesanya vs. Sean Strickland Fight for free on Reddit, including where to watch the UFC middleweight title championship online. UFC biggest fight in a years-long heads to Sydney, Australia this weekend. Adesanya vs. Strickland is going to be one of the biggest MMA events of 2023, but as a PPV, it’s airing on ESPN, so now’s the time to sign up. Also you can watch Fight of the century with ESPN+.
What you learning about this weekend?
Tags: codenewbie, discuss, learning, beginners
Published: 2023-09-09 13:00:00

Hey folk! 👋

What ya learning on this weekend?

Whether you're sharpening your [JS](https://dev.to/t/javascript) skills, making PRs to [your OSS repo of choice](https://github.com/forem/forem) 😉, sprucing up your portfolio, or [writing a new post](https://dev.to/new) here on DEV, we'd like to hear about it.

Have a good weekend and don't work too hard!

![Person reading a book... the book moves out of the way and the person has a really weird-looking head made out of paper mache](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4cfx4ef4ck2sz7i8pv2.gif)
We are aware that education is not universal
Tags: dumpsmedia
Published: 2023-09-09 11:31:34

Various Educational Options: We are aware that education is not universal. To meet the needs of a [Dumps Media](https://dumpsmedia.com/) diverse audience, we have curated a selection of educational resources. We have you covered with Salesforce certification guides that improve your career prospects and certification exam dumps that help you pass exams. Our blogs also cover a wide range of subjects, so there's something for everyone, whether [DumpsMedia](https://dumpsmedia.com/) you're an experienced professional or just starting out in education.

Click Here For More Detials>>>>>>>> [https://dumpsmedia.com/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bvwj2qxafl73abrobb0a.jpg)](https://dumpsmedia.com)/
Laravel 10 Ajax Multiple Image Upload with Preview Tutorial
Published: 2023-09-09 12:30:17


To display image previews after a successful upload, you can use a <div> element with the id='preview'. You can also use a button within the form for uploading the selected files.

When sending the Ajax request, you need to segregate the array of images. Then you can append images one by one to the form data.

You can do it using this tutorial on how to upload multiple images with preview using Ajax in Laravel 10.

## Laravel 10 Ajax Multiple Image Upload with Preview Tutorial

To upload multiple images using Ajax with preview in Laravel 10, you can follow these steps:

- Install Laravel Fresh Setup.
- Set up database credentials.
- Create a multiple image upload route.
- Generate an image controller by command.
- Create a multiple image upload preview blade view.
- Implement jQuery Ajax Code to Show Multiple Image Preview
- Start the development server.

Read More [Laravel 10 Ajax Multiple Image Upload with Preview Tutorial](https://www.tutsmake.com/laravel-10-ajax-multiple-image-upload-tutorial)
Let's make FAQ sections (no JS)
Tags: webdev, javascript, codenewbie, tutorial
Published: 2023-09-09 12:15:15

When it comes to designing user-friendly and informative websites, Frequently Asked Questions (FAQ) sections play a vital role in providing answers to common queries. With HTML's `<details>` tag and a bit of CSS, you can create interactive and collapsible FAQ sections that enhance user experience. In this guide, we will walk you through the process of building a clean and functional FAQ section.

## **HTML `<details>` Tag: The Foundation**

The HTML `<details>` element is used to create a disclosure widget that can be toggled open and closed. Each `<details>` element typically contains a `<summary>` element, which serves as the visible heading for the section.

Here's a basic structure for an FAQ item:

```html
<details>
  <summary>Question goes here?</summary>
  <p>Answer goes here.</p>
</details>
```

## **Building the FAQ Section**

Let's create a simple FAQ section with a few questions and answers. Here's an example:

```html
<div class="faq-section">
  <details>
    <summary>How do I create an account?</summary>
    <p>Creating an account is easy. Click on the "Sign Up" button, fill in the required information, and you're all set!</p>
  </details>
  
  <details>
    <summary>Can I reset my password?</summary>
    <p>Yes, you can reset your password by clicking on the "Forgot Password" link on the login page. Follow the instructions sent to your email.</p>
  </details>
  
  <!-- Add more FAQ items here -->
</div>
```

## **Styling with CSS**

To make your FAQ section visually appealing and user-friendly, you can apply some CSS styles. Here's an example of how you can style the FAQ section:

```css
html {
  font-family: system-ui;
}


/* Style the summary element */
details summary {
  cursor: pointer;
  font-weight: bold;
  background-color: #f0f0f0;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin: 10px 0;
  list-style: none;
  position: relative;
}

/* Style the content inside the details element */

details summary::after {
  content: '+';
  font-weight: 700;
  display: inline-block;
  position: absolute;
  right: 10px;
  margin-top: -7.5px;
  font-size: 1.5rem;
  
}

details[open] summary::after {
  rotate: 45deg;
  right: 7.5px;
}


/* Show the content when the details is open */
```

In this CSS code:
- We style the `<summary>` element to give it a button-like appearance.
- We remove the default arrow before the summary using `list-style`
- We made a plus sign (+) to make it different than the default
- And make it rotate when the detail is opened.

{% codepen https://codepen.io/EasewithTuts/pen/VwqpmmL %}


## **Conclusion**

With the HTML `<details>` tag and some CSS styling, you can easily create interactive and visually appealing FAQ sections for your website. Users can click on questions to reveal answers, keeping the content organized and accessible. Feel free to customize the styles and add more questions and answers to meet your specific needs.
Multiple Image Upload With Preview in Laravel 10
Published: 2023-09-09 11:59:54

You can use the HTML file input field to select files and upload multiple images at the same time. You can use jQuery to display the preview of images before uploading them into the database and folder in laravel 10 apps.

## Multiple Image Upload With Preview in Laravel 10

To upload multiple images with preview in Laravel 10, you can follow these steps:

- Install Laravel 10 application.
- Configure the database with the app.
- Build the photo model and migration.
- Create routes.
- Create a controller using Artisan Command.
- Create Blade views.
- Write jQuery code to show multiple image preview.
- Start the development server.

Read More [Multiple Image Upload With Preview in Laravel 10](https://www.tutsmake.com/laravel-10-multiple-image-upload-with-preview)
Laravel 10 Multiple Image Upload With Validation Tutorial
Published: 2023-09-09 11:24:42

In laravel 10, You can use the “request” facade to get multiple images on controller and use validation rules like images, mimes, and max into it to validate multiple image before store in database in laravel 10.

## Laravel 10 Multiple Image Upload With Validation Tutorial
To upload multiple images in Laravel 10, you can follow these steps:

- Install Laravel 10 Application.
- Configure Database.
- Create Photo Model & Migration.
- Create Routes.
- Create Controller using Artisan Command.
- Create Blade View.
- Start Development Server

Read More = [Laravel 10 Multiple Image Upload With Validation Tutorial](https://www.tutsmake.com/laravel-10-multiple-image-upload-example-tutorial)
MariaDB Installation Made Easy: A Guide for Arch-Based Linux Users
Tags: mariadb, database, sql, opensource
Published: 2023-09-09 11:21:28

# MariaDB: A Brief Introduction

MariaDB is an open-source relational database management system (RDBMS) derived from MySQL. It is crafted to be a swift, scalable, and dependable database system, well-suited for diverse applications. MariaDB is widely chosen for web development, data storage, and numerous software projects owing to its performance and comprehensive feature set.


## Installing MariaDB on Arch-Based Linux

You can easily install MariaDB on Arch-based Linux distributions, such as Arch Linux and Manjaro, using the Arch User Repository (AUR) and the `yay` package manager. Here's how to do it:

1. Open a terminal.

2. Update the package repository information:
## Installing MariaDB with pacman Package Manager

You can easily install MariaDB on Arch-based Linux distributions, such as Arch Linux and Manjaro, using the `pacman` package manager. Here's how to do it:

 - Open a terminal.

 - Update the package repository information:

   ```bash
     sudo pacman -Syu
   ```
After Updating the packages:
 - Install MariaDB using pacman: 

   ```bash
     sudo pacman -S mariadb
   ```

 - Database Initialization

``` 
sudo mariadb-install-db --user=MySQL --basedir=/usr --datadir=/var/lib/mariadb
```

 - During the installation process, you will be prompted to confirm the installation and resolve dependencies. Please review and proceed with the installation.

 - After completing the installation, enable and start the MariaDB service:

  ```bash
    sudo systemctl start mariadb
   ```
 - To enhance the security of your MariaDB installation and establish the root password, by executing the following command:
   ```bash
      sudo mariadb-secure-installation
   ```
 - MariaDB is now installed and operational on your Arch-based Linux system. You can access it using the below command:
  ```bash
   mariadb -u root -p
   ```
Congratulations! You have successfully installed MariaDB on your Arch-based Linux system using the `pacman` package manager. You can now utilize it to create your applications and projects.

Thanks for reading!
Stay tuned for more content!
Laravel 10 File Upload Rest Api Postman Tutorial
Published: 2023-09-09 11:14:47

In this tutorial, i will teach you how to upload file via API using postman in laravel 10.

## Laravel 10 File Upload Rest Api Postman Tutorial

To upload a file using Laravel 10 and Postman, you can follow these steps:

- Install Laravel 10 app.
- Configure Database with Ap.
- Make migration and model.
- Make API route.
- Generate API controller by Artisan.
- Run development server.
- Test Upload File Api in Postman

Read More on [Laravel 10 File Upload Rest Api Postman Tutorial](https://www.tutsmake.com/laravel-10-multiple-image-upload-via-api)
Kubernetes - Basics
Tags: kubernetes, k8s, architecture
Published: 2023-09-09 11:06:29

Features:
1. Container management - Can manage docker containers and other vendor containers as well so it is container-native orchestration tool.
2. HA - Create a container on a healthy node if any container goes down.
3. Scaling & Load Balancing - Scale containers based on load and other various parameters, hence balancing the load.
4. Rolling Update - Update containers without impacting and support many other update strategies.  
5. Rollback - Rollback updates if something went wrong without impact.

Architecture:

K8s Cluster has two main nodes:

1. Master node (Control Plane): Manages nodes and whole cluster.
2. K8S Nodes/ Minions (Worker Nodes): Actual worker nodes where Pods are scheduled to run containers.

Cluster Components:

1. API-Server- Api server facilitates the communication with Kubernetes cluster through the `Kubectl` command. We provide the `manifest yaml` file through Kubectl and API-server works accordingly. It interacts with `scheduler`, `Controller`, and `Key-value store` (etcd).
2. Controller- Manages the health of the cluster and controls everything. Suppose 100 nodes are defined in the manifest file then the controller keeps track to ensure that 100 nodes are running. 
3. Scheduler- Schedules the nodes/pods in the cluster according to the manifest file.
4. Key-value store (etcd) - This is the true source of information and store nodes information in the form of Key-value. Any node information can be fetched from this store.
4. Kublet- Kublet is like a manager on a minion node. API-Server interacts with Kublet to deploy the containers. The Kublet interacts with the controller and reports everything about the minion node. All the decisions are then taken by the controller.
5. Pod- Pod is the wrapping around the container. A pod is a basic unit in a Kubernetes cluster. `We do not deploy a Container, always a Pod is deployed and Container runs inside Pod. A pod can have multiple Containers but in general, a single Pod contains a single Container as a best practice.` Pod is assigned an IP that is shared among Containers running inside Pod. A pod is also the scaling unit in Kubernetes.
6. Kube-Proxy- Kube-Proxy acts like a network brain of the cluster and manages the network communication within the cluster.
7. Runtime- Every node has its own runtime that might differ from other nodes. The most commonly used runtime is docker. This runtime is used to run the containers.

Interaction with a K8s Cluster:

1. API: Everything happens through API requests. 
2. Native Libraries: If you are a developer and have a used case to manage the cluster using a coding language then you have native libraries to interact with the cluster.
3. Kube controler (kubectl): This is the main and most used way to connect with a k8s cluster and get the job done.
Python GUI
Published: 2023-09-09 10:46:05

There are too many Python GUI Apps in my githup profile.

If you wanna to improve yourself at Python GUI and interface programs you can look at my gitHup profile :) </>

gitHup repo: [gitHup](https://github.com/yusufceker/python-gui-apps)
e-mail: yckr44@gmail.com

`print("See you...")`
Adding the Layers - Neural Networks Part 1.5
Tags: ai, python, neuralnetworks, beginners
Published: 2023-09-09 10:45:24

We have worked with a single neuron in the previous blog, now let us look at the code part

## Coding Neurons in Python

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

We can calculate the value using Python's `dot product`, Here's how

**Dot product**

![Dot product equation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bddtstfusoktxhy9d66g.png)

So the output of a neuron can also be calculated as

![Implementing neuron calculation using dot product](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knq2yl586sm21uuuyrc2.png)

**Implementation in Python**

```python
import numpy as np

inputs = [1, 2, 3, 2.5]
weights = [0.2, 0.8, -0.5, 1.0]
bias = 2

output = np.dot(inputs, weights) + bias
print(output)
```

## Working with Layers

Now that we have found a way to calculate the output of a neuron we can move up by calculating the output of a layer with 3 neurons. The inputs for all three neurons will be the same the input is the output of the previous layer so the only way for us to influence the output of each neuron is with the help of weights and biases. We will pass weights as a 2D array of shapes `(3,4)`, and biases as an array of shape `(4,)`.


![Layer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5yyaowz53wwu34r1jabm.png)

```python
import numpy as np

inputs = [1, 2, 3, 2.5]
weights = [[0.2, 0.8, -0.5, 1.0],
          [0.5, -0.91, 0.26, -0.5],
          [-0.26, -0.27, 0.17, 0.87]]
biases = [2, 3, 0.5]

output = np.dot(weights, inputs ) + biases
# output [4.8  , 1.21 , 2.385]
```

> Note: It is important to note that weights are passed before inputs as the shape of weights is `(3,4)` and inputs is `(4,)`. If we were to put inputs before weights the `(4,)` and `(3,4)` will clash and give an ERROR as 4 doesn't match with 3.

---

**Previous Part**
[Neural Networks describe the World!! - Neural Networks Part 1](https://dev.to/vishalkamath/neural-networks-describe-the-world-neural-networks-part-1-39np)

---

GitHub: [https://github.com/Vishal-Kamath](https://github.com/Vishal-Kamath).
LinkedIn: [https://www.linkedin.com/in/vishalkamath853](https://www.linkedin.com/in/vishalkamath853)
Medium: [https://medium.com/@vishalkamath853](https://medium.com/@vishalkamath853)
Twitter: [https://twitter.com/VishalKamath853](https://twitter.com/VishalKamath853)
Social network analysis using graph databases
Tags: apacheage, postgressql, opensource, database
Published: 2023-09-09 08:42:12

**Introduction:**
An effective toolkit for delving into the world of social network analysis is provided by the combination of Apache AGE, PostgreSQL, and open-source database technologies.
In this article, we'll examine the potential of graph databases to decipher the intricacies of social networks, concentrating on the best methods and tools for the job.

**Building Data Models: Best Practices**
It is crucial to follow certain best practices when using graph databases to model social network data:

- Finding Important Parties Recognize the key players—people, groups, and the links between them—in the social network.

- Specifying Node and Edge Properties: Define node and edge properties to record crucial data including user profiles, connections, and interactions.

- Maintaining Consistency: To improve data model clarity and consistency, adopt consistent naming standards for nodes, edges, and properties.

**Best Practices for Social Network Querying**
Consider the following approaches to efficiently query social networks recorded in graph databases:

- Making Use of Graph Algorithms: Analyze social networks using graph algorithms to find trends, influencers, and community structures.

- Embracing Cypher Query Language: Create accurate and potent queries by utilizing the Cypher query language, which has been tuned for simple and effective graph database querying.

- Enhancing the performance of queries Reduce the amount of data retrieved for each query and use caching techniques to increase query speed and efficiency.

**Social network analysis tools include:**
Through graph databases, there are numerous tools that make it easier to explore and analyze social networks. Here are a few well-known choices:

- Gephi: A flexible platform for network study and visualization that is appropriate for social networks and other sorts of networks.

- A specialist platform made for detailed network analysis and visualization, with an emphasis on biological and social networks, is called Cytoscape.

- Graph Data Science Library in Neo4j: a complete library with a wide range of tools and algorithms created for deep graph data analysis, such as social network analysis.

- Apache AGE: A ground-breaking add-on that effortlessly interacts with PostgreSQL, allowing the development of graph databases by utilizing the reliable relational database architecture.


**Conclusion**
In conclusion, the combination of Apache AGE, PostgreSQL, and open-source database technology gives data analysts and researchers a powerful toolkit for sifting through the complex realm of social network analysis. Professionals can discover insightful patterns in networks and a deeper grasp of the social fabric that binds people and groups by following best practices and utilizing potent technologies.