teleren/devto huggingface dataset:
JavaScript | Mutability vs Immutability
Tags: javascript, mutability, immutability
Published: 2022-11-23 18:03:13

In JavaScript whether a variable is mutable or immutable it depends on its type and there are only two types of variables in which data is stored: primitive and reference.

## Primitive Type (Immutability)
All the JavaScript primitive types that are the atomic values stored to a variable, which are the following:

* Number
* Boolean
* String
* Null
* Undefined
* Symbol

Following is an example of how these primitive types are stored in JavaScript:
```
let dog = "Chopper";
let dog2 = dog;

dog = "Cody";
console.log(dog2); // Expected output: Chopper
```

The variable 'dog2' is created as a new space in memory and is allocated with the same value as the variable 'dog', it is not a reference. Modifying the first variable won't change the value stored in the second variable because it is not a reference. This is a perfect example of **Immutability** in JavaScript.

## Reference Type (Mutability)
This type is more complicated than simple and atomic values, they consist of multiple properties and are stored as references in memory. In JavaScript exist the following reference types:

* Array
* Object
* Function

Following is an example of how these reference types are stored in JavaScript:
```
let dog = {name: 'Chopper', age: '5'};
let dog2 = dog;

dog.name = "Cody";
console.log(dog2); // Expected output: {name: "Cody", age: "5"}
```

The variable 'dog2' is created as a new variable, but only as a reference to the first object. Modifying the first variable affects the value shown when printing the second variable because it is a reference to the first object. This is a perfect example of **Mutability** in JavaScript.
New Employment and Business opportunities appeared again
Published: 2022-11-23 17:57:03

New Employment and Business opportunities appeared again when there is so much recession and layoffs across the World.When big tech giants like Wipro, Infosys and Social Media giants like Twitter and Facebook are following layoffs and reducing employees strength then there is a place to grab the new benefits. So do not miss this opportunity visit the link below to check it out:
https://sites.google.com/view/employmentopportunities/home
Beautify HTML online for free
Tags: beautifyhtml, html, htmlbeautifier
Published: 2022-11-23 11:52:46

[HTML Beautifier](https://toolsincloud.com/html-beautifier) allows you to beautify your HTML in just 1 click. Simply input your HTML and let us do the further magic to beautify it.

What is the [HTML Beautify Online tool](https://toolsincloud.com/html-beautifier)?
HTML Beautify is an online tool that helps you to Beautify your HTML. With its easy-to-use interface and powerful features, HTML Beautifier makes formatting and beautifying your HTML code a breeze.

How to [Beautify HTML online](https://toolsincloud.com/html-beautifier)?
Open ToolsinCloud's free and online HTML Beautifier.
Now paste the HTML content you want to Beautify.
Click on the Beautify button and let us work our charm to Beautify your HTML.
Copy the Beautified content.

What are some of the Pros and Cons of HTML Beautifier?

Pros:
Lets You See Unclosed Tags.
Lets You See Unclosed Elements.
Lets You See Missing Elements.
You can use it to make sure that any unclosed tags are removed. 
You can use this tool to make sure that your HTML tags are closed correctly.
You can also use the HTML Beautifier to make sure that there are no missing elements in your document.

Cons:
Limited to Viewing Only the Structure of Your Document
This is a great tool for viewing the structure of your document. However, it can only show you the structure of your document and not the content. You’ll be unable to view the content of your document with the HTML Beautifier.
This means that you’ll have to make sure that you don’t forget to add any closing tags or any other elements that are missing from your document before you send it out. check out this tool for removing line breaks.

Why Choose Us?
Good Quality
Toolsincloud is providing the best qualitative conversion rate fully free. To get the highest quality for HTML Decoding make sure your document is correct in format. Our powerful tool will Beautify your HTML in seconds.

Supported Platforms
Our website supports every operating system in the world such as "Windows, Mac, and Linux". Also, we have cross-browser support features. For decoding HTML, you don't need to use any specific version of the browser.

Cloud-Based Performance
Toolsincloud is a fully online based application and it allows you to Beautify HTML fully free. The conversion process will totally be done on our server.

What are other queries solved?
- [HTML beautifier](https://toolsincloud.com/html-beautifier)
- [HTML code beautifier](https://toolsincloud.com/html-beautifier)
- [Beautifier HTML](https://toolsincloud.com/html-beautifier)
- [HTML beautifier code](https://toolsincloud.com/html-beautifier)
Tier v0.5.2
Tags: webdev, javascript, programming, stripe
Published: 2022-11-23 17:44:01

We just [released v0.5.2](https://github.com/tierrun/tier), with some exciting new enhancements and features.

- **Switch preallocations**: The `tier switch -c` command now preallocates switch accounts which means after the first switch account is created, subsequent uses of `tier switch -c` should be noticeably faster, like, complete in 10us fast! This is because it can now avoid waiting on slow API calls to Stripe.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1669166841281/-hh3FSdDl.png)

- **Plan immutability**: Plans are now 100% immutable, as was originally planned. To upgrade all existing Tier plans to be 100% immutable, please run `tier pull | tier push` - 2 times; The second should produce output saying `[plan already exists]`, which is your confirmation the migration was successful.

- **Deep links**: Push now outputs deep links to the corresponding prices in Stripe.

- **Clean command**:  We added the `tier clean -switchaccounts` command. As you might guess, it cleans up accounts in Test Mode that were created by the switch command. The full command takes a duration of time for specifying the maximum age to use when considering an account for removal. Please see `tier clean -h` for more information.

Please head over to [https://tier.run/releases](https://tier.run/releases) to check out more changes and install options. As always, `brew upgrade tierrun/tap/tier` works too!
Dynamic provisioning of Persistent Volumes using Amazon EFS CSI driver in EKS.
Tags: devops, kubernetes, eks, aws
Published: 2022-11-23 17:27:11


EFS CSI driver supports both static and dynamic provisioning.

dynamic provisioning creates an access point for each pv under the hood. This means you have to create an Amazon EFS file system manually and provide it as input to the storage class parameters. it will not create the EFS automatically.

sample manifest file for dynamic provisioning

— -

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: my-efs-sc-1
provisioner: efs.csi.aws.com
parameters:
provisioningMode: efs-ap
fileSystemId: fs-01207d73335d8dbb5####PLEASE UPDATE FILESYSTEM ID
directoryPerms: “700”

— -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: efs-claim-1
spec:
accessModes:
— ReadWriteMany
storageClassName: my-efs-sc-1
resources:
requests:
storage: 50Gi
— -
apiVersion: v1
kind: Pod
metadata:
name: efs-app-1
spec:
containers:
— name: app
image: centos
command: [“/bin/sh”]
args: [“-c”, “while true; do echo $(date -u) >> /data/out; sleep 5; done”]
volumeMounts:
— name: persistent-storage
mountPath: /data
volumes:
— name: persistent-storage
persistentVolumeClaim:
claimName: efs-claim-1
snaptook is a social Sharing site | Meet New People
Published: 2022-11-23 17:19:53


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ny8qtg6p5zpi3foj915g.png)snaptook is a social Sharing site, Its helps Meet New People  & share present life with phatos  videos and chat with friends!
[visit Snaptook](https://www.snaptook.com)
【Laravel】How important it is to set "fillable" or "guarded" in model files
Tags: laravel
Published: 2022-11-23 17:12:53

*Version of Laravel ...8.83.26

In Laravel, when you make model you need to add "fillable" or "guarded" to store/update records.
The columns that are set in "$fillable" are supposed to be mass assigned. "$guarded" is opposite. (These are used to block malicious request in mass assignment.) 

Here is an example code for controller and model.
```
//BookController.php
public function store(Request $request){
  $book=Book::create($request->all());
...}
```

```
//BookModel.php
...
use Illuminate\Database\Eloquent\Model;

class Book extends Model
{
    protected $fillable=[
        'title','author'
    ];
}
```
In your browser, you input the title and author of the book and click "submit" button.

##What happens if you forget to add "$fillable" or "$guarded"?##
If you forget to add "$fillable" or "$guarded", you will get an error as below. That means, you **must** set either of them.

> [2022-11-23 08:23:14] local.ERROR: Add [title] to fillable property to allow mass assignment on [App\Models\Book].

##What happens if you have misspelling in $fillable?##
If you have a misspelling...('autor' should be 'author') in "$fillable", for example,
```
    protected $fillable=[
        'title','autor'
    ];
```
you will get an error, of course.

> [previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field 'author' doesn't have a default value at...

##What if you set "$guarded"?
On the other hand, if you set "$guarded",
```
    protected $guarded=[
        'title','author'
    ];
```
you will have an error because you tried to store(insert) data into the DB despite that data in the columns ('title','author') are not supposed to beassigned.

> [2022-11-22 09:54:04] local.ERROR: SQLSTATE[HY000]: General error: 1364 Field 'title' doesn't have a default value (SQL: insert into `books` (`updated_at`, `created_at`) values (2022-11-22 09:59:33, 2022-11-22 09:59:33)) 

##Tips##
Those error massages always start with "Field '<column name>' doesn't have a default value." So, if you find this phrase in your error log, check your "$fillable" or "$guarded" settings in model files to make sure that you did not forget to set them, or the name of the columns are correct.
PLINDER-DATING & MAKE FRIENDS
Published: 2022-11-23 17:05:13

Plinder is a dating App for chat with match and make friends
 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sf8kxos5gzuget44cl0q.png)
Plinder dating app have creative desine,its make grate experiance to user. [visit Plinder](https://plinderdating.com/)
social networking site with microblogging connect people
Published: 2022-11-23 17:03:00

twipil  social  site to connect people day tody life and chat

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfihzao1pn368p2ixx8k.png)
[visit Twipil](https://twipil.com/)
Naspäť na predchádzajúcu stránku v Ionic (ver.5) aplikácii
Tags: ionic
Published: 2022-11-23 17:01:42

Ak potrebujem v Ionic (ver.5) aplikácii pridať na stránku funkcionalitu návratu na predchádzajúcu stránku možno to urobiť aj nižšie popísaným spôsobom.
V Ionic aplikácii mám vytvorenú nejakú stránku, napr.:

```
http://localhost:8100/removed
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ik3s5sp8821hdg0s9e18.JPG)
a na tejto stránke chcem v jej záhlaví (v pravej časti, lebo v ľavej už mám ikonku na zobrazenie aplikačného side-menu) umiestniť ikonku šípky, kliknutím na ktorú sa vrátim na predchádzajúcu stránku aplikácie (stránku z ktorej som tu prišiel).
Súbor s layout-om stránky, tj.HTML kód v súbore "removed.page.html" upravím/doplním takto:

```
<ion-header>
  <ion-toolbar color="primary">
    <ion-buttons slot="start">
      <ion-menu-button></ion-menu-button>
    </ion-buttons>
    <ion-title>Removed buddies ({{ pageContent?.Rows }})</ion-title>
    <ion-buttons slot="end">
      <ion-button (click)="previousPage()"><ion-icon name="arrow-back"></ion-icon></ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>
```
a ešte v súbore logiky stránky, tj.v "removed.page.ts" je potrebné doplniť volanú funkciu "previousPage()", ako aj použitie "NavController", ktorý zabezpečuje samotnú navigáciu v Ionic aplikácii. Upravený/doplnený kód vyzerá asi takto:

```
import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
@Component({
  selector: 'app-removed',
  templateUrl: './removed.page.html',
  styleUrls: ['./removed.page.scss'],
})
export class RemovedPage implements OnInit {
  pageContent = null;
  constructor(
    private navCtrl: NavController,
  ) { }

  ngOnInit() {
    ...
  }

  // naspat na predchadzajucu stranku:
  previousPage()  {
    this.navCtrl.back();
  }
}
```
Stránka teraz bude vyzerať:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ej2tr5woovlkn9jy7c13.JPG)
a po kliknutí na ikonku šípky ma to vráti na predchádzajúcu stránku v aplikácii.
Rough intro to GCC (Hello, World!)
Tags: c, linux, alx
Published: 2022-11-23 17:00:00

> Write a script that runs a C file through the preprocessor and save the result into another file.
The C file name will be saved in the variable $CFILE
The output should be saved in the file c

That's the first task starting my journey learning C, aside setting up your environment and all. Seems pretty straightforward... till I keyed in *man gcc* in the terminal. The output? Lets just say I read half-way and gave up. Ended up getting a [book on GCC](https://www.amazon.com/Introduction-GCC-GNU-Compilers/dp/0954161793) which in my opinion did a better job breaking down the commands and flags eli5 style.

Anyways, C programs go through 4 compilation stages;
- Preprocessor
- Compiler
- Assembler
- Linker

## Preprocessing

In the preprocessing stage, macros and header files are expanded i.e. you see what you added to the files. Macros? Header files? You see their source codes.
By the way, the preprocessing step creates a file with .i extension. To pass a c file through a preprocessor, the flag you are looking for is `-E`, command;
```gcc -E foo.c```

## Compilation
Next step is the compilation stage. Here, the preprocessed file is passed through a compiler, which in turn creates source file with an extension '.s', which contains assembly code. The flag here is `-S`, same command used as the preprocessor but the flags are swapped. Do note though that using the flag will not create an object file, that's the job of the assembler.

## Assembler
Third stage, the assembler. This is where assembly code goes from barely understandable except by those who learnt about it before I was born to being unreadable by virtually anyone on this planet, unless you are a robot or someone who's dedicated their life following the ways of the machines.
The assembler takes the source file and turns it to an object file which contains machine code. To invoke the assembler, use ```as foo.s -o foo.o``` This will generate the object file 'foo.o'.

## Linker
The final stage is the linker. There's a lot going on under the hood here but the short of it is you invoke gcc followed by the object file one wishes to compile, like this;
``` gcc foo.o```
The command generates an executable called a.out. To run the executable, point to the path where the executable is located, followed by the executable name on your terminal. Hit enter and the results of your C file should display on your terminal.


Back to the question, following the instructions, you'll realize you need two commands/flags. One for passing the file through a preprocessor, another for naming the output of the file
In summary, the answer's; ```gcc -E $CFILE -o c``` Hopefully the rest of the task makes perfect sense to you (except the advanced task maybe, had to check the man page and wikipedia to figure it out).

P.s: Blog post(s) are kinda like a journal to me and I am not in any way looking to educate anyone. It's not in me. Besides, there are lots of materials out there (I will gladly share the ones I used, they'd be mostly books, the occasional diving into the man pages and maybe stackoverflow and stackexchange).
How to prepare your custom images dataset for a deep learning model
Tags: deeplearning, computervision
Published: 2022-11-23 16:57:20

Almost all the deep-learning tutorials out there teach how to build models using already set or inbuilt datasets, but what if you want to train a model to recognize you and maybe your family's faces, a dataset for that purpose is not readily available on the internet.
The ability to organize and build your own image dataset to solve your problem is a demonstration of expertise. 
In this article, you will learn how to prepare your own dataset of raw images, which you can then use for your own image classification/computer vision projects.

## Steps 
1. Gather and organize your images.

For example, if I want to build a model that recognizes humans(faces) and nonhumans, I put all the human images in one folder and all the nonhuman images in another folder. The two folders are then put into one main folder.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9q3vt10oadl2ngcpi77l.gif)

2. Open a jupyter notebook and import the cv2, PIL, and pathlib.

```
import cv2
import PIL
import pathlib
import numpy as np
```

You can find out more about [cv2 here](https://docs.opencv.org/4.x/), or about [PIL here](https://pillow.readthedocs.io/en/stable/) and about [pathlib here](https://docs.python.org/3/library/pathlib.html)

3. Specify the route to the folder and create a Path object from it

```
images_dir = "/path/to/your/images_directory"

images_dir = pathlib.Path(images_dir)
```
4. Create two objects, one containing the image classes lists and another containing the class labels 

```
class_images = {
    'human': list(images_dir.glob('human/*')),
    "nonhuman": list(images_dir.glob("nonhuman/*"))
}

class_labels = {
    "human": 0,
    "nonhuman": 1
}
```

5. Initialize X and y to empty python lists. Convert each of the images to a numpy array, resize it to a standard size and append it to the X list. Also, append the corresponding image class label to the y list.

```
X, y = [], []

for image_name, images in class_images.items():
  print(class_images.items())
  for image in images:
    img = cv2.imread(str(image))
    resized_img = cv2.resize(img, (256, 256))
    X.append(resized_img)
    y.append(class_labels[image_name])
```
6. Finally convert X and y to numpy arrays and split each into train and test sets 

```
X = np.array(X)
y = np.array(y)

from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
```

There you go, now you have your custom image train and test datasets, however, if you want your model to perform better and learn quicker, there are a few other things you may want to do for your image datasets, for example, rescaling and augmentation. These are however out of the scope of this article, if you are interested in that subscribe to my newsletter so that you don't miss out on the upcoming article that will cover how to do them. 

Also, follow me on [twitter(juma_shafara)](https://twitter.com/juma_shafara) where I share other programming stuff.
Ganache Issue-Not showing the available networks
Published: 2022-11-23 16:53:15

Hi all,
Iam trying to connect Ganache in mac, when i started Ganache ,its not showing the available accounts and open the server screen - unable to select the host name. It has only one option "hostname of the server  0.0.0.0 - All Interfaces."


I've tried

Restarting Ganache
Restarting Computer
Uninstalling from Applications and Reinstalling Ganache
Downloaded Ganache from (https://trufflesuite.com/ganache/)
 

FYI:i have installed truffle suite 
Truffle v5.5.20 (core: 5.5.20)
Ganache v7.2.0
Solidity v0.5.16 (solc-js)
Node v16.15.1
Web3.js v1.7.4


Anyone has idea how resolve this issue.

Thanks in Advance
Laxmi 





![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2lshgxlknkm2d345h16a.png)
Let's make an angular in the beach
Tags: webdev, programming
Published: 2022-11-23 16:43:57

install angular cli

`npm i -g @angular/cli`

`ng new x-web`

create .gitignore
`touch .gitignore`


`ng g m features/records --routing`
`ng g c features/records`
`ng g s features/records`

`ng g m components/x-table`
`ng g c components/x-table`

import your httpClientModule




Sorry, I'll have to go.
Mental health issues and entrepreneurship: how to manage both.
Published: 2022-11-23 16:43:56

---
title: Mental health issues and entrepreneurship: how to manage both.
published: true
description: It's no secret that mental health is a topic that is often ignored or swept under the rug. For young entrepreneurs, this can be especially true. After all, when you're hustling to make your business dreams a reality, who has time to focus on their mental health, right? Wrong. 
tags: 
cover_image: https://media-exp1.licdn.com/dms/image/C4D22AQE0vYzF0qm_2Q/feedshare-shrink_800/0/1669220807281?e=1672272000&v=beta&t=4OuyZeaqdWr5MtfI7RVMXVAkHC7xmbB_bj7KjJq8WHU
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-23 16:39 +0000
---

It's no secret that mental health is a topic that is often ignored or swept under the rug. For young entrepreneurs, this can be especially true. After all, when you're hustling to make your business dreams a reality, who has time to focus on their mental health, right? Wrong.

Severe mental health illnesses can have a major impact on young entrepreneurs. In fact, according to a recent study, nearly 1 in 5 entrepreneurs suffer from some form of mental illness. That's a staggering statistic.

What's even more alarming is that mental health illnesses are often left untreated in entrepreneurs. This is due to a number of factors, including the stigma that surrounds mental health, the lack of understanding about mental health, and the lack of resources available to entrepreneurs.

If you're a young entrepreneur struggling with a mental health illness, know that you're not alone. There are resources and support available to help you. Seek out a therapist or counselor who specializes in treating entrepreneurs. Join a support group for entrepreneurs with mental health illnesses. And most importantly, don't be afraid to reach out for help. Your mental health is just as important as your business.
Announcing the official launch of the Lagoon Community on Discord!
Tags: community, discord, contribute
Published: 2022-11-23 16:35:49

We’ve been working on building up the Lagoon community, and we decided it needs one official home. Over the years we’ve been spread out over RocketChat and Slack, but we’re excited to announce that the official home of the Lagoon community is on Discord! We chose Discord because we feel it’s a low barrier to entry, easy to use, and has a lot of great features. 

We hope you’ll join us and your fellow Lagoon users and help us grow the community into a place where people can find support, share ideas, and contribute back to the Lagoon project. 

Join the Discord here: https://discord.gg/te5hHe95JE

Read more about the community and our guidelines here: https://docs.lagoon.sh/community/discord/
Free Online Chat- make friends-chat & date-Doitchat
Published: 2022-11-23 16:35:37


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

Free online chat site talk With Free Discussion chat rooms and make also date people online free.
Doitchat is a web-based free Online Chat- [make friends](https://doitchat.com/)-chat & date.
🔴 Save the date! Luos keynote live on Discord on November 29th 2022
Tags: opensource, eventdriven, microservices, luos
Published: 2022-11-23 16:25:58

🔴 Luos is hosting a live keynote on November 29th 2022 on Discord at 9:00 am PT (6:00 PM CEST)

⏩ [To participate](https://discord.gg/luos?event=1044974451055411261)

Save the date for this special event where Nicolas Rabault will present the new version 2.7!