teleren/devto huggingface dataset:
Dart Immutability with copyWith
Tags: dart, flutter, learning, tutorial
Published: 2024-01-16 07:53:46

Before we talk about `copyWith` let's first understand what is Immutability in programming. 

## Immutability
In programming, this is the state of an object where we don't allow changes after initialization.

![Immutability-is-no-changes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpnsfkdo7wwfpq547v7f.png)

Having an immutable object allows predictability and maintainability in our code. You no longer need to concern yourself about which area might be affected if you alter the object.

Now, Dart is rich in this immutability feature. For object immutability, we can use its method `copyWith`. 

## copyWith
An instance method of a Class that returns a new instance with the properties from the initialized Class. These returned properties can be either modified or not. 


Here's an example with a Shirt class:


```dart
enum ShirtSize {
  S,
  M,
  L,
  XL,
}

enum ShirtType {
  streetWear,
  formal,
  casual,
}

class Shirt {
  final String id;
  final ShirtType type;
  final ShirtSize size;

  const Shirt({
    required this.id,
    required this.type,
    required this.size,
  });

  @override
  String toString() => "ID: ${id} - Type: ${type} - Size: ${size}";

  Shirt copyWith({String? id, ShirtType? type, ShirtSize? size}) => Shirt(
        id: id ?? this.id,
        type: type ?? this.type,
        size: size ?? this.size,
      );
}
```

We created a class Shirt with an instance method of `copyWith`. The `copyWith` method returns a new instance of Shirt, allowing overriding of the properties `id`, `type`, and `size`.

Let's say we have a collection of casual shirts that we want to add to our list.

```dart
void main() {
  final List<Shirt> casualShirts = [];
  final casualSmall = Shirt(
    id: "0ABC1",
    type: ShirtType.casual,
    size: ShirtSize.S,
  );
  final casualMedium = casualSmall.copyWith(size: ShirtSize.M);
  final casualLarge = casualSmall.copyWith(size: ShirtSize.L);
  final casualExtraLarge = casualSmall.copyWith(size: ShirtSize.XL);

  casualShirts.addAll([
    casualSmall,
    casualMedium,
    casualLarge,
    casualExtraLarge,
  ]);
}
```
In the example above, we first have a casual shirt with a Small size. This will act as our base instance in creating the remaining sizes. We can use the `copyWith` method to modify only the `size` property from our base instance while retaining the `id` and `type` properties. 

After adding all our casual shirts to our list, let's try printing our list of casual shirts to verify. 

```dart
...

/// Check the override method toString 
/// in our Shirt Class.

casualShirts.forEach(print);

ID: 0ABC1 - Type: ShirtType.casual - Size: ShirtSize.S
ID: 0ABC1 - Type: ShirtType.casual - Size: ShirtSize.M
ID: 0ABC1 - Type: ShirtType.casual - Size: ShirtSize.L
ID: 0ABC1 - Type: ShirtType.casual - Size: ShirtSize.XL
```

Using `copyWith` prevents external code from needing to know the actual implementation, keeping coupling loose. I hope with the example that we had, you can see the advantage of using this pattern when working with data in larger apps.
Solving Pandas .to_sql Double Quotes Issue When Writing to Database
Tags: python, database, dataengineering, tutorial
Published: 2024-01-16 07:49:55

I have found a solution to the frustrating issue of using pandas to save a dataframe into a database and finding that the column names are encased in double quotes. 

By **setting the column names to uppercase** before writing the dataframe to the database, the double quotes problem can be completely circumvented. 

```python
df.columns.str.upper()
```

When creating the table structure in the database, please ensure that your column names are in uppercase.

```python
CREATE TABLE table_name
(
    COLUMN1     VARCHAR2(50),
    COLUMN2     VARCHAR2(50),
    COLUMN3     Integer
);
```
---
## Explore more

{% embed https://dev.to/luca1iu %}


Thank you for taking the time to explore data-related insights with me. I appreciate your engagement.

{% cta https://www.linkedin.com/in/lucaliu-data %} 🚀 Connect with me on LinkedIn {% endcta %}

{% cta https://twitter.com/Luca_DataTeam %} 🎃 Connect with me on X {% endcta %}


{% cta https://www.instagram.com/luca1iu?igsh=MmJneDFpdjNtYWU1&utm_source=qr %} 🌍 Connect with me on Instagram {% endcta %}
Find the Top Mobile App Development Services
Tags: mobileappdevelopment, topmobileappdevelopment
Published: 2024-01-16 07:44:33

In this blog, we explore the key factors to consider when searching for [custom mobile app development services](https://www.anayatglobalworks.com/mobile-app-development-services) and how to find the perfect match near you.

![Top mobile app development services](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5eg2075v82sku4a6ohx.jpg)
When it comes to making a lasting impression on your target audience, one size does not fit all. Custom mobile app development services offer solutions that align with your business goals and user expectations. These services focus on understanding your unique requirements, ensuring that the final product reflects your brand identity and values. [Top mobile app development services](https://www.anayatglobalworks.com/mobile-app-development-services) are at the forefront of technological advancements. They leverage the latest tools and frameworks to create cutting-edge applications that deliver a seamless user experience. Whether it's integrating AI, AR, or VR, these services ensure that your mobile app stands out in a crowded market.

Collaboration is key when developing a mobile app, and having a team that is accessible can make the process smoother. Searching for [mobile app development services near me](https://www.anayatglobalworks.com/mobile-app-development-services) is a practical approach to finding a local partner. Proximity not only facilitates communication but also allows for face-to-face meetings, fostering a stronger and more efficient development process.

Choosing the right mobile app development services is a critical decision for the success of your business. Opting for custom solutions, staying abreast of technological trends, and considering proximity can make all the difference. So, whether you're a startup with a groundbreaking idea or an established business looking to enhance your mobile presence, investing in top mobile app development services is a strategic move that promises long-term success.
VLAN
Tags: beginners, networking, network, security
Published: 2024-01-16 07:41:16

##Introduction
First , No more wait I will be keep on posting content from now on . Lets start so in order to know about VLAN's we need to understand basics of the switch 

###Purpose of Switch and VLAN
Switches are placed between your router and devices for multiple uses but main purpose is for isolation between organizations and departments (just like subnetting but at an earlier stage) then within that comes our hero VLAN and its main purpose is.... same as switch and subnetting which is isolation . I know it might be confusing [ It will :) ] 

###WorkFlow

![Flow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04748c4nq28g4xc2zqg4.png)

As you have seen , First step is the router then switch then comes our VLAN .Lets break it down with an example , Consider you have an office which has multiple departments and each department has multiple teams under it . 

Office - Router
Department - switches
Teams  - VLAN 

Now you see why we need so much isolation , While doing R&D I had a doubt why use VLAN we can just add mutiple switches right ? No , Think about the space and cost and we are using VLANs to have separate broadcast domains under the same switch (same department has mutiple teams under it)

##How do they communicate
Each VLAN has a tag (like an identity for it) . Consider a router which has two switches A & B and each switch has 2 VLANs ( Switch A - A1 , A2 ) and ( Switch B - B1 , B2 ). 

* If devices under a VLAN has to communicate , they can communicate directly as they are under same broadcast domain.(Like a team sitting in a same room can communicate directly)

* If devices in VLAN A1 has to communicate with A2 then they send the MAC address of the device they wanna communicate to the switch (A) then the switch identifies that the MAC address specified in the packet belongs to it but different VLAN so it redirects to that VLAN and goes to the particular device

* If devices in VLAN A1 wants to communicate with B1 or B2 ( different switch ) , Initially they will send the packet to the switch then the switch identifies it belongs to different  switch and adds the VLAN Tag of A1 and sends to the router , the router checks the destination IP address in its routing table and check to which VLAN does it belong (In our case B1 ) so it adds B1's VLAN Tag and checks for the switch it belongs and forwards to it then the switch B check the VLAN Tag and forward to the specific VLAN and then to the device.

##Conclusion
Its a hell of a topic and there are still much details to cover , I have just added what is it ? , How does it work and whats the purpose of it . If you have any doubts or clarification comment down below , I will be addressing it ASAP

![Okay BYE](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pwbs0qxh8f67dqalyu6e.gif)

Be Nice in comments :)
Javascript Roadmap?
Tags: webdev, javascript, developers, programming
Published: 2024-01-16 07:31:21

As a beginner in web development specifically frontend, which topics of java-script are must do and which ones can be done later on or are of less significance from frontend pov? I thought it will be better to take advice here before diving into this huge and important topic so do tell your advice on this !! It will be very helpful for me saving me a lot of time in which i can explore and taste some other domains. Happy coding!
The Benefits Of Investing In Jute Bags
Published: 2024-01-16 07:26:32

As the jute bags wholesale are manufactured from natural fibers they can be used multiple times. While you need to dispose of the plastic or paper bags after some period of time, the [jute beach bags](https://www.richiebags.com/beach-bags/) are designed to be reused. However, getting these bags manufactured from jute and cotton bag manufacturers is a great choice to ensure you get great quality material at an affordable price.


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

Most people are of the opinion that jute beach bags are expensive. However, that's a wrong impression and a complete myth that needs to be busted. Jute beach bags are quite affordable and a great choice in the long run. While initially, jute bags might appear expensive, as they are durable and strong, they can serve you for years without much maintenance. Consider switching to a jute bag rather than randomly buying plastic and paper bags. Moreover, a jute bag is a one-time investment and is designed to last for years. Definitely a must-buy.
1/15/24
Tags: beginners, roblox, gamedev, learning
Published: 2024-01-16 07:26:08


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sd0admtexv9bpvudj52z.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyc35z05sqnq3gws7w43.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8o6l7s3shajtl0qh19ec.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwzbvhllzu2yhmu9f065.png)
Didn't have much time to do much today.
But I watched a video and took notes on lighting and I think it looks awesome.
I'm gonna be working on a big model which will be a core part of the map/ game. I have a pretty good vison right now.
I also added a river and a cool secret area.
Getting Exception Postgres Server restart
Tags: postgres, database
Published: 2024-01-16 07:20:07

Dear PostgreSQL Team,
 
I am writing to inform you that our PostgreSQL database service is currently down. We are experiencing an unexpected interruption, and we are seeking your expertise to help us resolve this issue promptly.
We would greatly appreciate your immediate attention to this matter. If there are specific steps we should follow or additional information you require, please let us know as soon as possible.
Your assistance in resolving this issue is crucial, and we are confident in your expertise to help us bring the PostgreSQL database back online.
 
Here are some details about the current situation:
1) checking the status:-
/apps/postgresdb/pgsql/bin/pg_ctl status -D /apps/postgresdb/pgsql/data
pg_ctl: no server running



2) Starting the server
/apps/postgresdb/pgsql/bin/pg_ctl start -D /apps/postgresdb/pgsql/data
waiting for server to start....2024-01-15 11:15:08.010 GMT [] LOG:  listening on IPv4 address "0.0.0.0", port 
LOG:  listening on IPv6 address "::", port 
LOG:  listening on Unix socket "/tmp/.s.PGSQL."
LOG:  database system was interrupted while in recovery at 2024-01-15 10:51:44 GMT
HINT:  This probably means that some data is corrupted and you will have to use the last backup for recovery.
FATAL:  the database system is starting up
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  redo starts at 0/
FATAL:  could not access status of transaction
DETAIL:  Could not read from file "pg_xact/0001" at offset 204800: Success.
CONTEXT:  WAL redo at 0/7A845458 for Transaction/COMMIT: 2023-12-30 23:26:16.017062+00
LOG:  startup process (PID 2731458) exited with exit code 1
LOG:  aborting startup due to startup process failure
LOG:  database system is shut down
 stopped waiting
pg_ctl: could not start server
Examine the log output.

could you pls share the steps for recover postgres dump and server restart steps.
Download Besharam Bewaffa Hindi song
Published: 2024-01-16 07:15:44

 [Download Besharam Bewaffa Hindi song](https://moonymusics.blogspot.com/2024/01/download-be-prak-beshram-song.html)

 The lyrics of the Hindi song Ghamgin Bishram

Download Be Prak Beshram song

Download the song free download named Bashram with direct link

Download New Music B Praak - Besharam
 Download Song Rafiq Shahidim

Listing
New song download Niwad Hakad



To download the new song Bishram named Beshram and view the song text, refer to the following article...


The lyrics of the song Beshram Bi Prak

Oh Mainu Jihde Karke Chaddeya

Heart Apne Cho Kadheya

Mainu Jihde Karke Chaddeya

Heart pleases me

Ohnu Chadd Ditta

This hall has a nail

Oh Besharam Oh Behaya Oh Bewafa

Oh Tera Ki Haal Ae

Oh Tera Ki Haal Ae

Oh Besharam Oh Behaya Oh Bewaffa

Oh Tera Ki Haal Ae

How are you?

What are you doing now?

Log yeh jaisa kehte hain

What are you like now?

Log yeh jaisa kehte hain

Chadar badalti hai hai

Aur Shaks Badalte Hain

Chadar badalti rehti hai

Aur Shaks Badalte Hain Hain

Ya cloud gaya ae tu
Download Song Rafiq Shahidim
Published: 2024-01-16 07:15:08

[** Download Song Rafiq Shahidim**](https://moonymusics.blogspot.com/2024/01/download-song-rafiq-shahidim.html)

now from media musikfa ♫ download song friend I saw Shahid Behesht in your eyes with the voice of Abu Dhar Rouhi with text and the best quality ♫

Download Old Music BY : Abozar Roohi | Refighe Shahidam With Text And 2 Quality 320 And 128 On Music-fa

Download the song Rafiq Shahidam Abuzar Rouhi

Muzikfa • Download the song Rafiq Shahidam Abuzar Rouhi

 DownloadSong My Heartbeat My Sleep Vessel


Play songs online

Download the song with 320 quality

Download the song with 128 quality

Archive of special and best songs

The text of the song Rafiq Shahidam Abuzar Rouhi

──┤ ♩♬♫♪♭ ├───

I am dying for my country, my blood and veins are Iranian! As long as we are in the world, we are white!For every seat in the country; Did we give seventy-two martyrs of Ain Ammar?!I am Ammar, an Iranian Ammar, from the Suleimani generation!I am Mirza, the same mountain of zeal, Mirza Koch Gilania decade of the nineties; whose role model is a martyr! Haj Qasim reminded me; If it's love, it's easy to fall in love!A decade of eighties; that Haj Qasim and DiheI am Ali Landi; I mean Hossein Fahmida!I am Salman, the same Salman Mena of Iranian origin...

Musicfa download the song of Rafiq Shahidem Abuzar Rouhi

Haj Qasim reminded me; One should die for love!

Haj Qasim reminded me; It's twenty past one, it's the hour of love...

I'm Ali Landi! I mean Hossein Fahmida...

A decade of eighties! that Haj Ghasimo has seen...

A decade of the nineties! whose role model is a martyr! I saw heaven in your eyes!The office that had your photo! I bought...My martyred friend! Let's drown and sit...We will see you with your flight! We are the people of Imam HosseinMy martyr friend, O zealous man! Count me in! For the emergence! Count me in...All kinds! Count me in!
Let's dive a bit deeper into each step of the MediatR architecture
Tags: softwaredevelopment, dotnet, csharp
Published: 2024-01-16 07:11:42

In MediatR architecture, each task is represented by a Request, sent to the corresponding Handler by the framework. However, MediatR acts like a pipeline, not directly passing the Request to the Handler.

![MediatR Framework](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ba7c7zz7f9npjormlkd3.png)

Instead, it goes through one or more middlewares, called Pipeline Behaviors, in three steps:


![Pipeline Behavior in MadiatR](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8xuaaxgr30ob7whtzb61.png)

**1. Pre-Processing:**
In the Pre-Processing step, the incoming Request is handed over to the Pre-processor. This is like the front door of the MediatR pipeline, where the Request is checked, validated, and possibly transformed before proceeding further.
The Pre-processor can perform tasks such as ensuring the Request is in the right format, validating user input, or making any necessary adjustments to the Request data.

**2. Next Step:**
Assuming the Pre-Processing step succeeds, the pipeline moves to the Next Step. Here, a delegate decides what comes next in the pipeline.
This could be another middleware instance, adding another layer of processing, or the final destination, which is the Handler responsible for carrying out the core logic related to the Request.
Think of it as passing the baton in a relay race; the Request smoothly moves to the next phase of processing.

**3. Post-Processing:**
After the core logic (handled by the Handler) is executed, the pipeline reaches the Post-Processing step. This is the last stage before the result is sent back to the client.
In Post-Processing, actions like logging the outcome, making final adjustments to the Response, or handling errors are performed.
It's the place where you tie up loose ends, ensuring that everything is in order before the processed data is sent back to the client.

**Important Notes:**
If there's an issue during the Pre-Processing (e.g., validation failure), the process immediately goes back, bypassing the Next and Post steps. This quick exit ensures that only valid Requests proceed through the entire pipeline.
On the other hand, when everything goes smoothly, the logic is executed, and the Post-Processing step is not extensively used for validation-related tasks. It focuses more on actions needed after the Request is validated and processed.
In essence, the MediatR pipeline is a carefully orchestrated sequence of steps, each playing a vital role in ensuring efficient and organized handling of Requests, from validation to execution and finalization.
Key Features for a Successful Food Delivery App Development
Tags: development, developer, fooddeliveryapp, appdevelopment
Published: 2024-01-16 07:09:34

In today's fast digital world, food delivery apps are a big part of our daily routine, making things easy and quick. To make a food delivery app successful, we need to think about important features that make users happy. Let's look at some key things for a good food delivery app.

**Easy to Use:**
Make the app simple for people to use. They should easily find what they want, order food, and know where their delivery is. For easy to use food delivery app development, you can hire [best food delivery app development company](https://theninehertz.com/services/on-demand-app-development/food-delivery).

**See Your Order in Real-Time:**
People like to know where their food is. Using GPS helps users see their order from the time it's made at the restaurant until it reaches their door. This makes them trust the app more.

**Different Ways to Pay:**
People like to pay in different ways. The app should let them use credit cards, digital wallets, or even pay with cash. This makes it easier for everyone.

**Make It Personal:** 
Let users make their profiles special. The app should remember their favorite orders, where they want food delivered, and how they like to pay. This makes ordering quick and easy.

**Easy Search and Filters:** 
People want to find the food they like easily. The app should let them search for a type of food, set a price range, and choose dietary preferences. This way, they quickly find what they want.

**Helpful Customer Support:**
Good customer support is important. If users have questions or problems, there should be quick and helpful support through chat, email, or phone. This keeps users happy.

**Keep Things Safe:**
Keeping user information and payments safe is a must. The app should use strong security measures to protect data. This builds trust with users.

**Help Restaurants Too:**
Work well with restaurants. Give them an easy way to manage orders, change menus, and see how they are doing. This makes the app work smoothly for everyone.

**Let Users Share Their Thoughts:**
Users should be able to share their experiences. Good reviews bring in new users, and feedback helps improve the app. This builds a community of trust.

**Useful Promotions and Rewards:**
Give users special offers, discounts, and rewards for being loyal. Send them updates about new restaurants or special deals. This keeps users interested and happy.

**In Conclusion:**
Making a **[good food delivery app](https://theninehertz.com/services/on-demand-app-development/food-delivery)** needs careful attention to what users want, how the app works, and keeping everything safe. By including these important features, developers can create an app that not only meets but exceeds user expectations. Keeping an eye on feedback and improving the app over time will lead to success in the competitive world of food delivery services.
Install php in linux server
Tags: php, linux, ubuntu, nginx
Published: 2024-01-16 07:08:08



```
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2-fpm php8.2-mysql php8.2-curl php8.2-xml php8.2-opcache php8.2-mbstring php8.2-zip
```


```
systemctl status php8.2-fpm.service
● php8.2-fpm.service - The PHP 8.2 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php8.2-fpm.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-01-16 12:54:56 WIB; 1h 11min ago
       Docs: man:php-fpm8.2(8)
    Process: 1268 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.2/fpm/pool.d/www.conf 82 (code=exited, status=0/SUCCESS)
    Process: 14147 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS)
   Main PID: 1102 (php-fpm8.2)
     Status: "Processes active: 0, idle: 2, Requests: 6, slow: 0, Traffic: 0req/sec"
      Tasks: 3 (limit: 9211)
     Memory: 62.1M
     CGroup: /system.slice/php8.2-fpm.service
             ├─ 1102 php-fpm: master process (/etc/php/8.2/fpm/php-fpm.conf)
             ├─14162 php-fpm: pool www
             └─14163 php-fpm: pool www
```