teleren/devto huggingface dataset:
OOP Clone Objects
Tags: programming, oop, beginners, hasanelsherbiny
Published: 2023-11-13 17:38:00

when you Jump into the world of OOP in which parts of your application should act as objects, following this concept will get us to need to copy data from object to another object for example creating a clone of the same object right?
in this case we have two types of copying

## Value Copy Vs Reference Copy
as you know every object is actually a memory allocation for your data.

- Reference Copy
the copy of my object will have the same address of the memory so any change to the copy will be applied to the original object.
- Value Copy
we only need the data to be duplicated into a brand new object (with new memory address) so any change to the copy will not affect the original one.

## Default Behavior 
by default if your object is a class then any copy to the object is Reference Copy.
and if the object is struct then any copy to the object is Value Copy.

## Special Scenarios 
commonly we use classes more than structs but also we may have some particular cases in which we need to value copy objects of classes.
so lets assume that we have class Person 

```
 public class Person
 {
     public string Name { get; set}
     public string Age { get; set}
 }
```

## 1. data allocation (copy Constructor)
in this method we simply add constructor in which takes the object as input and copy properties values into the new property

```
 public Person(Person person)
    {
        Name = person.Name;
        Age = person.Age;
    }

```
this sounds very straight forward but it has some drawbacks first it's quite difficult if your class has many properties and any change to these properties require maintenance, but it's also giving you control over what to copy and what not to.

## 2. implementing ICloneable interface
sometimes your language can give you out of the box solutions for cloning objects in C# for Example Your class can implement ICloneable interface to indicate that class is cloneable.

```
  public object Clone()
    {
        var person = (Person)MemberwiseClone();
        return person;
    }
```
in theses two solutions you had access to the class of object you want to clone, but some cases you may not have access to this class for example if this object if from library.

## 3. Serialization
using the concept of serialization you can transform your object into another form (string or binary) then deserialize back into an empty object

```
     var serialized = JsonConvert.SerializeObject(source);
     var newObject=JsonConvert.DeserializeObject<T>(serialized);
```
this is great idea specially when you don't have access to the code as mentioned before, but in some specific cases this solution would fail, for example if the object is not serializable.

## 4. Self AutoMap
if your code already using automapper solution you can make a good use of it to self map your object to a new object

```
var newObject=ObjectMapper.Map<Person>(source);
```
this littlie trick would work with almost no drawbacks.
Serverless development experience for embedded computer vision
Tags: computervision, programming, machinelearning, tooling
Published: 2023-11-13 17:26:27

I am thrilled to share the release of Pipeless 1.0. A new version of Pipeless that was rewritten from scratch to bring significant improvements in performance, flexibility, and development experience.

[Pipeless](https://github.com/pipeless-ai/pipeless) is an open-source computer vision framework that ships everything you need to build and deploy computer vision applications really fast.

As you will see below, the amount of changes in this new version is significant. We changed from how you write code to how you configure streams. However, those changes led to an **incredible user experience**.
We have redesigned Pipeless taking into account all your feedback to create a new internal architecture that is much more powerful and flexible, and that can support most of your use cases.

Pipeless 1.0 is a significant step forward in our initial vision of **bringing the development experience from serverless frameworks to embedded computer vision**.

You can get started with Pipeless 1.0 in just seconds following the [getting started guide](https://www.pipeless.ai/docs/docs/v1/getting-started).

## What's new?

- ⚡ 8x faster using just 20% of the resources. Moved to a single lightweight component approach from the former multi-component approach.
- ✨ Multi-stream support. You can now process any number of streams within a single Pipeless instance.
- 👩‍💻 Migrated from Python to Rust with multi-language support. You can now write processing hooks in many programming languages, including Python, Rust, and more to come.
- 🛠️ Dynamic stream configuration. No more config files. Add, edit, and remove streams instantly via the CLI or a REST API without restarting Pipeless.
- 🕸️ Highly parallelized. Your code is executed in a highly parallelized environment, reaching lightning speeds and saving you headaches. You write simple functions, Pipeless takes care of parallelizing its execution.
- ⛓️ Chain any number of processing steps. Those can include inference with different CV models, simple RGB modifications, or whatever you need.
- 📁 Structured and highly reusable user code. Pipeless now helps you create well-structured code based on filesystem routing that is highly reusable and parallelizable.

## How to try it?

Get started with Pipeless 1.0 in just seconds by following [this guide](https://www.pipeless.ai/docs/docs/v1/getting-started).

## Want to help?

If you would like to contribute, join our community either on [Discord](https://discord.gg/K2qxQ8uedG) or [GitHub discussions](https://github.com/pipeless-ai/pipeless/discussions) and let’s chat!

{% cta https://github.com/pipeless-ai/pipeless %}
Consider supporting our work by starring the Pipeless’ GitHub repository
{% endcta %}
The JavaScript Riddle: Cracking the Code of typeof null
Tags: javascript, typeofnull, javascriptmystery, codequirk
Published: 2023-11-13 17:21:16

# Introduction:
JavaScript, a language known for its versatility, has a little surprise that can puzzle developers. It has to do with the `typeof` operator when used with the value `null`. Oddly, instead of saying `null`, it says `object`. In this article, we'll dig into why this happens, where it came from, and how developers can deal with this unexpected twist.

# Historical Context:
In the early days of JavaScript, the language was crafted with a simple set of types: "undefined," "boolean," "number," "string," "object," and "function." When the null value was introduced to represent the intentional absence of any object or primitive value, a small design mistake (or perhaps a necessity at that time) occurred. Consequently, when using typeof with null, instead of identifying it as null, it mistakenly reports "object" due to this historical design hiccup.

Despite recognizing this as a mistake, correcting it poses challenges. JavaScript has a commitment to maintaining backward compatibility, and altering the behavior of typeof null might break existing code that relies on this historical quirk. So, developers are encouraged to be aware of this behavior and use other means, such as strict equality (===), to accurately check for null values. This reflects the evolution of the language and the complexities that can arise from decisions made in its early development stages.

> According to the ECMAScript specification (the rules that govern JavaScript), null is officially defined as the special value that represents the deliberate absence of any object (you can find this in ECMA-262, section 11.4.3).
[ECMA-262 - section 11.4.3](https://262.ecma-international.org/5.1/#sec-11.4.3)


# Let's inspect what the NULL actually is:

Even though the result of `typeof null` might seem odd, it's crucial to know that `null` isn't really an object like other things in JavaScript. It's a basic value, a special one that shows there's no specific object available. So, despite what `typeof` might say, null is more like a simple placeholder for the absence of an object.

### Have a look at the below code snippets:

```javascript
console.log(typeof null);  // Outputs: "object"
console.log(null instanceof Object);  // Outputs: false
```
The `instanceof` operator, commonly used for determining an object's type, reveals that null is not an instance of the Object constructor.

# Conclusion:
Let's sum it up in simpler terms. The odd behavior we observed is like a peculiar artifact from JavaScript's past. Don't let it throw you off! Think of it as a little surprise left by the language's creators.

So, how do you handle it? Well, just use a trick you probably already know: strict equality. Instead of relying on typeof, stick with === when you want to check if something is null. It's like saying, "Hey, are you exactly null? No funny business!"
Music Monday — What are you listening to? (Synth Heroes Edition 🎹)
Tags: music, discuss, watercooler
Published: 2023-11-13 17:18:17

_cover image source: [Giphy](https://giphy.com/gifs/daft-punk-get-lucky-54ZSJMeNkaNsA)_

**Last week, I asked y'all to share [your favorite guitar heroes](https://dev.to/devteam/music-monday-what-are-you-listening-to-guitar-hero-edition--3595), and this week we're turning our attention to another awesome instrument — the synthesizer. Oh, the synthesizer... quite possibly the most versatile instrument to ever exist! It can buzz or it can breathe. It can squelch, hiss, & squeal in one moment, then quietly hum the next. You can make it sound as natural as a bird whistling or as otherworldly as an alien spaceship. It's been used to mimic string instruments, percussion, wind, brass, piano... it's also been used to conjure up sounds that were previously impossible. A mainstay in popular music since the 1970s, you can hear some form of synth across pretty much everything we listen to today. So, what synth-heavy songs have been catching your ears? What about the heroes — the keyboard players and synthesists behind those soaring synth lines? I wanna know what kinda synth music you're into!**

![A cartoon of Bob Moog standing in the middle of 3 synthesizers. His arms are crossed and he's looking directly at us like a boss.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ffasba29d4a6fvq3ok3s.gif)

***

## How we do 

In this weekly series, folks can chime in and drop links to whatever it is they've been listening to recently + browse others' suggestions. You can follow the suggested genre if you'd like, but don't feel confined to it; you're free to suggest whatever you wanna. 🙌  

If you're interested in having other discussions about music, consider following the aptly named [#music discussions](https://dev.to/music-discussions) organization.

{% embed https://dev.to/music-discussions %}  

***

Alright fellow synth enthusiasts, this one is for you! _Note: you can embed a link to your song using the following syntax `{% embed https://... %}`. This should work for most common platforms!_

Looking forward to listening to y'all's suggestions! 🎶
Week 2 November, TDRecap
Tags: ai, news, career
Published: 2023-11-13 16:57:27

From Green Jobs to Cyber Sales: A Recap of Last Week's Headlines Unveils a Dynamic Week of Innovation, Collaboration, and Controversy!


1.https://bit.ly/3MFJm6W
2.https://bit.ly/3FUIAzc
3.https://bit.ly/3sqEAU4
4.https://bit.ly/472ZCXP
5.https://bit.ly/3sfQ0Kn
6.https://bit.ly/40C7LjB
7.https://bit.ly/3FPLbKG
8.https://bit.ly/3snLmtP
9.https://bit.ly/49BZ5ha
10.https://bit.ly/49CggiT
SheMagazine USA: Beena Yusuf's Canvas of Creativity
Tags: shemagazine, fashion, magazineusa, beenayusuf
Published: 2023-11-13 16:40:33

SheMagazine USA, curated by the visionary **[Beena Yusuf](https://shemagazineusa.com/)**, stands as a testament to innovation and style in the ever-evolving world of fashion and lifestyle. Since its inception in 2018, this isn't just a magazine; it's a manifestation of Beena Yusuf's creative prowess and commitment to redefining the narrative.

Under Beena Yusuf's guidance, **[SheMagazine USA](https://shemagazineusa.com/)** transforms into a vibrant canvas where fashion meets art, and every issue unfolds as a unique masterpiece. Beyond the conventional, the magazine is an exploration of individuality, diversity, and contemporary living. Beena Yusuf's touch is evident in every carefully curated feature, making SheMagazine
🚀The Netflix DevSecOps Project 🚀
Tags: sonarqube, docker, kubernetes, netflix
Published: 2023-11-13 16:42:44

Hi connections.
I'm thrilled to announce the completion of a DevSecOps project ✨ . The goal was to set up a cloud-based Netflix clone.

## 🚀 **The Netflix DevSecOps Project **🚀

Phase 1: Initial Setup and Deployment
✅ Launch EC2 (Ubuntu 22.04):
Provisioned an EC2 instance on AWS with Ubuntu
22.04.
✅ Connected to the instance using SSH.
✅ Clone the Code:
 Updated all packages and cloned the application code
from GitHub.
Install Docker and Run the App Using a Container:
Set up Docker on the EC2 instance.
Built and ran the Netflix clone application using Docker
containers.
Get the API Key:
Obtained the TMDB API key for the application.
Phase 2: Security
✅ Installed SonarQube and Trivy for vulnerability
scanning.
✅ Integrated SonarQube with the CI/CD pipeline.
Phase 3: CI/CD Setup
✅ Installed Jenkins for automation.
✅ Configured Jenkins plugins and tools for the CI/CD
pipeline.
Created a Jenkins pipeline for application deployment.
Phase 4:Monitoring
Installed Prometheus and Grafana for monitoring.
✅ Set up Node Exporter to collect system-level metrics.
✅ Configured Prometheus to scrape metrics from Node
Exporter.
Created Grafana dashboards for visualization.
Phase 5: Notification
 Implemented email notifications in Jenkins for alerts.
Phase 6: Kubernetes
 Created a Kubernetes cluster with node groups.
 Monitored Kubernetes with Prometheus and Node
Exporter.
Phase 7: Cleanup
Terminated AWS EC2 instances that were no longer
needed.
 [Github](https://github.com/SwapnilM24/DevSecOps-Project_netflix)

[Linkdin](www.linkedin.com/in/swapnil-m-278848171)

`Tools used: 🛠
`
```
Jenkins
Docker
SonarQube
Trivy
Email
Prometheus
Grafana
Kubernetes
ArgoCD

```

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



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



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



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/llay9anekvjruwyfekkh.png)
Hearts Ablaze
Tags: books, story, news
Published: 2023-11-13 16:34:05

"Hearts Ablaze" by Dr. Rita Thornton is a powerful book that guides you on a journey toward healing and freedom from abusive relationships. If you've ever felt trapped in such a situation, this book offers hope and a roadmap to recovery.

Key Takeaways:
Acknowledging the Truth: The first step towards healing is recognizing the truth about the [abusive relationship](https://a.co/d/fRReitJ).

Empowering Resilience: Discover your inner strength to overcome the scars of abuse and embrace a positive life.

Healing Spirituality: Understand the deep connection between spiritual well-being and the path to recovery.

Transformative Steps: Learn how to rebuild your life after leaving an abusive relationship, creating a future rooted in self-love and growth.

Dr. Rita Thornton, a survivor of abuse and a respected figure in the music industry, shares her personal journey of healing. Her expertise as a Christian leader, professor, and abuse survivor infuses this guidebook with empathy and wisdom. Through her insights, you'll learn to identify signs of abuse, summon the courage to break fre, and build a life founded on strength and positivity.

"Hearts Ablaze" is not just a book on recovering from an abusive relationship, but a lifeline for women seeking refuge. It offers a transformative journey, providing the courage, wisdom, and support needed to escape abuse and step into a life ablaze with newfound freedom and strength. Get your copy today to begin your journey toward empowerment and healing.
Revitalize Your Memories with Remini for iOS A Transformative Photo Enhancement App"
Published: 2023-11-13 16:15:25

In the era of digital photography, capturing moments has become easier than ever, but not every photo turns out perfect. Blurry images, low resolution, and old photographs often lack the crispness and clarity we desire. Fortunately, [Remini for iOS](https://reminiapks.org/remini-for-ios/) steps in as a game-changer, offering a powerful solution to breathe new life into your cherished memories.
Remini, short for "reminisce," is an innovative photo enhancement app designed to elevate the quality of your images through advanced artificial intelligence (AI) technology. The app's primary mission is to sharpen and enhance photos, making them clearer and more vibrant. Its intuitive interface ensures that users can effortlessly transform their pictures with just a few taps.
One of Remini's standout features is its ability to upscale low-resolution images without compromising quality. Whether you're dealing with an old family photograph or a pixelated snapshot, Remini employs sophisticated AI algorithms to enhance details and produce stunning results. This capability makes it a go-to tool for breathing new life into nostalgic images that may have lost their clarity over time.
Remini's effectiveness lies in its AI-based restoration and enhancement techniques. The app analyzes the image, identifies areas that need improvement, and intelligently applies enhancements to create a visually striking result. Users can witness a noticeable difference in sharpness, color accuracy, and overall image quality.
Beyond its core functionalities, Remini also offers various filters and editing options, allowing users to customize their photos according to their preferences. Whether you want to adjust brightness, contrast, or apply artistic filters, Remini provides a user-friendly platform to express your creativity.

**In conclusion, 
**
Remini for iOS emerges as a must-have app for anyone seeking to revitalize their photo collection. With its powerful AI-driven enhancements, the app not only restores old memories but also elevates the quality of every image, turning ordinary photos into extraordinary keepsakes. Embrace the transformative capabilities of Remini and rediscover the joy of reminiscing through crystal-clear, visually stunning photographs.
Choosing tech stack for side project
Tags: webdev, programming, productivity, learning
Published: 2023-11-13 16:05:05

I agonized over the tech stack I should use to build the project. To streamline the process and avoid falling into procrastination, I time-boxed the entire exercise. When I reached ~80% of allocated time, I knew I needed to make a decision soon. Prior to that, I tried to answer different questions:

- What should backend be written in? I recently picked up Rust, and it would be great to battle test it.
- Should this be API + client or monolith? I was tempted by Next.js as I wanted to try it for some time, and it offers a bit more sensible development experience than pure React.
- Where should I host it? I thought about using AWS as it would be a nice learning opportunity.

At some point, I realized that I couldn't answer these questions without understanding why I wanted to build this project. I knew that my project's features can be implemented with any tech I choose. Now I needed to set my own priorities, and realize what's in this project for me. The main thing here was understanding that I really care about getting this project to production. In the past, when I built something, it was because I wanted to learn or try new tech. This time, I cared about putting it out into the world.

Phrasing this as my highest priority simplified a lot of things. Now, having multiple options on the table I could simply ask myself "Which one will allow me to ship faster and not hate myself in the future if I need to extend it?". I still going to learn a lot from building it, but at least 80% of stack is familiar, which with limited resources I have gives me a good starting point to get where I wanna be with this.

As for decision itself I decided to go with Ruby on Rails. Why?

- Ruby <3
- it's framework I know best
- it offers great development experience
- it's made with bootstrapped projects in mind, perfect for solo/small team development
- with web views I can use it to develop mobile apps and I might need it for my product
- monolith just makes sense for solo development, I don't wanna jump between repos
- it's a good opportunity to dive deeper into Hotwire (a modern HTML-over-the-wire solution)

Of course Rails comes with some downsides but if I experience major ones it will mean that my project is at a stage where it is successful enough, and those are good problems to have. First I need to get there and Rails is the fastest way for me.

As for other tools, I'm gonna stick to Heroku for hosting to limit time I need to allocate into infrastructure management. Might move it to AWS at some point, but for now, my aim is to keep things simple and concentrate on development.

Let me know what is your decision process in similar situations.
DAY4: Python day 6&7
Published: 2023-11-13 15:55:25

**Python day6**

- create function using `def` keyword

-tip: can ident a whole bock by pressing`command`+`]`
- the `while` loop 

**End of the lesson project**

- Reeborg's world 

- escaping a maze by following the right edge
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2vfnuxz2f2sfcbyxlwj.png)


```
def turn_right():
    turn_left()
    turn_left()
    turn_left()
    
def navigate():
    if right_is_clear():
        turn_right()
        move()
    elif front_is_clear():
        move()
    else: 
        turn_left()
    
while not at_goal():
    navigate()
     
```

**Python day7**

- full class dedicated to creating a game of Hangman!
```
import random
import hangman_words
import hangman_art

#TODO-1: - Update the word list to use the 'word_list' from hangman_words.py
#Delete this line: word_list = ["ardvark", "baboon", "camel"]
word_list = hangman_words.word_list
chosen_word = random.choice(word_list)
word_length = len(chosen_word)

end_of_game = False
lives = 6

#TODO-3: - Import the logo from hangman_art.py and print it at the start of the game.
print(hangman_art.logo)
#Testing code
print(f'Pssst, the solution is {chosen_word}.')

#Create blanks
display = []
for _ in range(word_length):
    display += "_"

while not end_of_game:
    guess = input("Guess a letter: ").lower()

    #TODO-4: - If the user has entered a letter they've already guessed, print the letter and let them know.
    if guess in display: 
       print (f"You have already entered {guess}.")
   

    #Check guessed letter
    for position in range(word_length):
        letter = chosen_word[position]
        print(f"Current position: {position}\n Current letter: {letter}\n Guessed letter: {guess}")
        if letter == guess:
            display[position] = letter

    #Check if user is wrong.
    if guess not in chosen_word:
        #TODO-5: - If the letter is not in the chosen_word, print out the letter and let them know it's not in the word.
        lives -= 1
        print(f"{guess} is not in the word.")
        if lives == 0:
            end_of_game = True
            print("You lose.")

    #Join all the elements in the list and turn it into a String.
    print(f"{' '.join(display)}")

    #Check if user has got all letters.
    if "_" not in display:
        end_of_game = True
        print("You win.")

    #TODO-2: - Import the stages from hangman_art.py and make this error go away.
    print(hangman_art.stages[lives])
```