teleren/devto huggingface dataset:
#5 SOLID - Dependency Inversion Principle | Swift | iOS Development
Tags: ios, swift, softwareengineering, developer
Published: 2023-07-15 16:03:14

> - High-level modules should not depend on low-level modules. Both should depend on abstractions.

> - Abstractions should not depend on details. Details should depend on abstractions.


In the example below, the `PaymentService` is a high-level module that provides payment processing functionality. It depends on the `PaymentGateway` abstraction rather than specific implementations like PayPal or Stripe. This allows different payment gateways to be easily swapped without modifying the PaymentService.


```swift

// High-level module (depends on abstraction)
class PaymentService {
    private let paymentGateway: PaymentGateway
    
    init(paymentGateway: PaymentGateway) {
        self.paymentGateway = paymentGateway
    }
    
    func processPayment(amount: Double) {
        // Process payment using the payment gateway
        paymentGateway.processPayment(amount: amount)
    }
}

// Abstraction (does not depend on details)
protocol PaymentGateway {
    func processPayment(amount: Double)
}

// Concrete implementation (depends on abstraction)
class PayPalGateway: PaymentGateway {
    func processPayment(amount: Double) {
        // Process payment using PayPal API
        // Implementation details specific to PayPal
    }
}

// Concrete implementation (depends on abstraction)
class StripeGateway: PaymentGateway {
    func processPayment(amount: Double) {
        // Process payment using Stripe API
        // Implementation details specific to Stripe
    }
}
```

The `PaymentGateway` protocol defines the required behavior for a payment gateway, and the concrete implementations (`PayPalGateway` and `StripeGateway`) depend on the abstraction. This promotes flexibility and allows for future additions or changes to payment gateway implementations.

By applying the Dependency Inversion Principle, you can design your code in a way that reduces dependencies, increases flexibility, and promotes better code organization and maintainability.
DEV Showcase v8
Tags: showdev, codenewbie, help, discuss
Published: 2023-07-15 15:41:00

Welcome to the DEV Showcase - a weekly thread where you can share what you've been working on and get feedback and encouragement from the DEV community.

This is your chance to show off your latest project, share a cool hack or technique you've learned, or ask for advice and feedback from other developers. Whether you're a seasoned developer or just starting out, this is the place to connect with others and get inspired.

Here are a few questions to think about if you're stuck:

- What have you been working on lately?
- What tools or resources have you found helpful?
- Have you learned any new skills or techniques recently?
- What challenges have you faced, and how can the community help you overcome them?
- What are your goals for your project or your career moving forward?

Remember, this isn't a competition or a challenge - it's just a space to share and connect with others. So don't be shy! Share your work and get feedback and encouragement from the DEV community.

We're excited to see what you've been working on, and to support you as you continue to grow and develop your skills.
filmyzilla official website
Tags: filmyzilla, movies
Published: 2023-07-15 15:39:57



[filmyzilla official website](https://www.vsconstructions.org/filmyzilla/)   Filmyzilla is a website that may be of interest to you if you appreciate watching movies of all genres and in a variety of languages. Filmyzilla has become well-known among movie fans all around the world thanks to its large selection of films and the free streaming and download options it offers.Filmyzilla is a public torrent website which leakes pirated Bollywood and Hollywood movies online. The website Filmyzilla org uploads the pirated versions of Hindi, English, Telugu, Tamil, Malayalam films along with Hindi dubbed Hollywood movies.This content is for reference purpose only and The Times of India claims no ownership of this content.

Contact us: admin@vsconstructions.com
https://www.facebook.com/vsconstructions.org/
https://twitter.com/vsconstruction8
Destructuring and Spread Operators: Why and When to Use?
Published: 2023-07-15 14:37:57

Imagine you're a detective trying to solve a crime. You've just received a list of suspects and their corresponding alibis from your informant. However, the list is a mess and it's difficult to find the information you need.

That's where destructuring and spread operators come in. With these tools, we can quickly extract the relevant information from the list and work with it in a more organized and efficient way.

## ⭐ Destructuring

Destructuring allows us to extract values from arrays and objects and assign them to variables in a concise syntax.

### Destructuring an array:

```
const suspects = ['Alice', 'Bob', 'Mallory'];
const [firstSuspect, secondSuspect] = suspects;
console.log(firstSuspect); // 'Alice'
console.log(secondSuspect); // 'Bob'
```

As you can see, we were able to extract the first & second elements of the suspects array and assign them to variables using destructuring.

### Destructuring an object:

```
const suspects = {
 'Alice': 'at the library',
 'Bob': 'at the gym',
 'Eve': 'at home',
 'Mallory': 'at the park'
};
const { Alice, Bob, Eve } = suspects;
console.log(Alice); // 'at the library'
console.log(Bob); // 'at the gym'
console.log(Eve); // 'at home'
```

## ⭐ Spread Operator

The spread operator allows us to add or spread out elements.

### Add elements to an array:

```
const suspects = ['Alice', 'Bob', 'Eve', 'Mallory'];
const newSuspects = ['Frank', 'Gina', ...suspects];
console.log(newSuspects); // ['Frank', 'Gina', 'Alice', 'Bob', 'Eve', 'Mallory']
```

As we can see, we used the spread operator to add the elements from the suspects array to the newSuspects array.

### Spread out elements in an array:

```
const suspects = ['Alice', 'Bob', 'Eve', 'Mallory'];
console.log(...suspects); // 'Alice', 'Bob', 'Eve', 'Mallory'
```

## ⭐ When to Use

1️⃣ When we want to extract multiple properties from an object: Instead of manually selecting each property, we can destructure them into separate variables.

2️⃣ When we want to set default values: If a value is not present in the object, destructuring allows us to set a default value.

```
const { Alice, Bob = "No evidence, but doubtful" } = suspects;
```

3️⃣ When we want to pass object properties as function parameters: Destructuring can be used to unpack object properties directly into function parameters.

4️⃣ When we want to clone an object or array: The spread operator allows us to easily create a copy of an object or array.

5️⃣ When we want to merge objects or arrays: We can use the spread operator to combine multiple objects or arrays into one.

## ⭐ Why to Use

1️⃣ It simplifies the syntax when dealing with data stored in objects and arrays.

2️⃣ Destructuring reduces the amount of code needed to extract data from objects and arrays.

3️⃣ Spread operator helps to make our code more readable and maintainable.

4️⃣ Spread operator provides a simple syntax for combining and copying data structures.

5️⃣ Spread operator provides an easy way to expand elements in iterable objects.
Full Stack open 2023 Part 12
Tags: docker, tutorial
Published: 2023-07-15 15:16:56

In today's world, containers revolutionized how we program and deploy applications.

Docker is the most mature, documented and with the most amazing community containerization engine.

In this post I will share my experiences with part12 of Full Stack open. I feel like the tutorial really helped to introduce me to the main concepts of Docker, that is how to build images with Dockerfile scripts and how to manage containers with Compose.

Throughout the assignments you get to work with Node, Mongo, Redis,Nginx and other images. You also learn about volumes, bind mounts, the Docker network and DNS.

My favorite part was developing directly inside a container.
This has so many benefits when working on a large project. I will consider adding Docker to my workflow.
Learn what is php shopping cart, and there benefits
Tags: productivity, coding
Published: 2023-07-15 14:56:10

A PHP shopping cart is a web application that enables users to browse, select, and purchase products online. It is built using the [PHP programming language](https://knowledgeport.in/courses/php-classes-in-nagpur/), which is widely used for web development. The shopping cart system allows customers to add items to their cart, update quantities, and proceed to checkout, where they can make payments and complete their purchase. 

**Here are five benefits of using a PHP shopping cart:**

1. **Easy customization:** PHP shopping carts are highly customizable, allowing developers to tailor the system to meet specific business requirements. This flexibility enables the creation of unique and personalized online stores.

2. **Seamless integration:** PHP shopping carts can integrate smoothly with various payment gateways, shipping providers, and inventory management systems. This integration streamlines the overall purchasing process and ensures a seamless experience for both customers and merchants.

3. **Scalability:** PHP shopping carts are designed to handle large product catalogs and high traffic volumes. They can easily scale to accommodate growing businesses and support increased user activity without compromising performance.

4. **Security:** PHP frameworks provide robust security features and have a strong community support system. This ensures regular updates, patches, and security enhancements, making PHP shopping carts a secure choice for handling sensitive customer information.

5. **Cost-effectiveness:** PHP is a free to use open-source language. This makes PHP shopping carts a cost-effective solution for businesses, especially small and medium-sized enterprises that may have budget constraints.

In summary, a PHP shopping cart offers easy customization, seamless integration, scalability, security, and cost-effectiveness. These advantages make it a popular choice for businesses looking to establish and manage their online stores effectively.
Writing a Nes Game Day 3 -starting with the code
Tags: asm, 6502, nintendo, programming
Published: 2023-07-15 14:37:46

While looking at all the information that I gathered I saw [this video](https://www.youtube.com/watch?v=XwGj1ciSAtw) with a great example.

If we look at the [Nerdy Nights tutorial](https://nerdy-nights.nes.science/), week 1 and week 2 are an explanation on how the NES system works and **it is a must to understand** what we are going to do. 
Starting from week 3 we start to code BUT, in the tutorial, they are using nesasm to assemble, but I will use C65 so for the sample code I have to go to [James Sheppard github page](https://github.com/JamesSheppardd/Nerdy-Nights-ca65-Translation)

For the next days let's focus on [week 3 code](https://github.com/JamesSheppardd/Nerdy-Nights-ca65-Translation/blob/master/Nerdy%20Nights%20L3/background.asm). I will be copying the code with some comments that I get from the tutorial, Michael Chiaramonte's video and nesdev wiki

The first part of the code is the **header **and it is written simply to tell the emulator that this is a NES game and give some parameters, so if in the future I make this for a cartridge this can be removed.

`.segment "HEADER"       ; Setting up the header, needed for emulators to understand what to do with the file, not needed for actual cartridges
    .byte "NES"         ; The beginning of the HEADER of iNES header
    .byte $1a           ; Signature of iNES header that the emulator will look for
    .byte $02           ; 4 2 * 16KB PRG (program) ROM
    .byte $01           ; 5 8KB CHR ROM 
    .byte %00000000     ; 6 mapper 
    .byte $0            ; 7
    .byte $0            ; 8
    .byte $0            ; 9 TV System 0-NTSC / 1-PAL
    .byte $0
    .byte $0, $0, $0, $0, $0    ; unused`

If you want to understand how this works you can check the documentation [here](https://www.nesdev.org/wiki/INES), but let's talk a little about this code.
The first byte is always NES, we are indicating that this is a NES program.
Then there is a signature header that the emulator will look
Byte 4 gives information about the program rom and byte 5 gives information about the CHR ROM that is helpful for the graphics.
Byte 6 talks about the mapper and how we are going to do scrolling (we will talk about this in the future, I am trying to understand how it works right now).
Byte 9 defines the type of TV system we are using, 0 is NTSC and 1 is PAL.
Then some unused bytes that we have to fill.

Ok, so now we are starting to put our hands in the code and this is what mostly will happen in the next days of this diary
Learn Python From Scratch - with futurecoder
Tags: python, codenewbie, beginners, programming
Published: 2023-07-15 14:22:50

I have recently found a neat new (to me) resource for learning Python. It's called futurecoder and you can find it at https://futurecoder.io.

I was interested to try it out, so I worked through the first few sections and live-streamed the result on my YouTube channel. You can see that here: {% embed https://youtube.com/live/Rtjqq-UtSqg %}

I liked the teaching approach, which was very interactive and encouraged the learner to try things. 

If you're just getting started with Python, I'd recommend checking out either the website or the archived lived-stream on my channel, to see if it's a learning resource that works for you. I'd like to hear what you think of it!
How & when to use redux in react projects?
Published: 2023-07-15 14:18:36

React is the most widely used javascript library according to StackOverflow’s 2021 survey. The ability to break down a larger application into multiple smaller & reusable components is one of the features that made react so popular as it greatly helps organize projects in a modular fashion.

But there’s one thing that may be an issue as projects start to scale. Imagine you are working on a big project. You will likely deconstruct your app into multiple child components and further divide them into smaller and more specific elements. While doing this, we usually use React’s state and props to share data and information across components. But this can quickly get complex and difficult to maintain if our project is big. This is where Redux comes in handy.


Read my full blog with example code

[How and when to use redux in react projects](https://medium.com/@victorbahta/react-and-redux-120aa7c59e68)
What do You want to see on YouTube?
Tags: watercooler, motivation
Published: 2023-07-15 14:17:19

Hello Dev community. I've recently felt renewed excitement about my YouTube Channel. I've been making a few videos, but I'd love to hear from you: what content do you want to see on YouTube? 

My main interests are music, programming, and data, so I mostly want to hear suggestions that touch on those areas, but if you have another area of interest, I'd like to hear about that too.
MUST USE AI TOOL for Finance and Accounting Queries
Tags: beginners, productivity, career
Published: 2023-07-15 13:30:00

When it comes to finance and accounting, having quick and accurate answers to your questions is crucial. Finance Brain is a powerful chatbot designed to provide instant answers to all your finance and accounting queries. 

**[JUMP TO THE LINK](https://www.aiforme.wiki/ai/tools/finance%20brain)**

**Instant Answers at Your Fingertips:**

Finance Brain is built to deliver immediate responses to your finance and accounting questions. Whether you need clarification on financial concepts, assistance with accounting principles, or guidance on financial analysis, Finance Brain is here to help. No more waiting for human assistance or searching through endless resources—simply ask Finance Brain, and you'll receive instant answers.

**24/7 Availability:**

Finance Brain is available around the clock to cater to your finance and accounting needs. Whether it's during business hours or in the middle of the night, you can rely on Finance Brain to provide prompt and accurate responses. This availability ensures that you can get the answers you need when you need them, enhancing your productivity and decision-making capabilities.

**Three Free Questions for New Users:**

To help you experience the benefits of [Finance Brain](https://www.aiforme.wiki/ai/tools/finance%20brain), new users can enjoy three free questions without the requirement of a credit card. This introductory offer allows you to explore the capabilities of Finance Brain and witness firsthand how it can provide valuable insights and support for your finance and accounting inquiries. Take advantage of this opportunity to see how Finance Brain can assist you.

**Unlock the Power of Finance Brain:**

Don't let finance and accounting questions slow you down. Empower yourself with Finance Brain, the instant answer chatbot for all your finance and accounting needs. With its 24/7 availability and quick responses, Finance Brain is your go-to virtual assistant in the world of finance. Access valuable financial insights, clarify complex concepts, and make informed decisions with ease.

Get started with Finance Brain today and enjoy the convenience of instant answers at your fingertips. Ask your finance and accounting questions and unlock the power of Finance Brain's knowledge base and expertise.

**[JUMP TO THE LINK](https://www.aiforme.wiki/ai/tools/finance%20brain)**
Golang Tutorial | Gin HTTP Framework | Golang Gin Framework | Tutorial 3
Tags: webdev, go, programming, tutorial
Published: 2023-07-15 13:28:52

🚀 Exciting News! 🚀
Are you ready to take your Golang skills to the next level? 📈 Join us for Tutorial 3 of our Golang Tutorial series, where we dive deep into the powerful Gin HTTP Framework! 🎉
In this tutorial, we'll explore the ins and outs of the Golang Gin Framework, a lightning-fast web framework that simplifies building robust and scalable APIs. Whether you're a beginner or an experienced developer, this tutorial is packed with valuable insights and hands-on examples to help you master Gin.
🔗 Watch the tutorial here: {% youtube 35NbK00rXic %}
Don't forget to subscribe to our YouTube channel for more exciting Golang tutorials, tips, and tricks! 📺
Get ready to supercharge your Golang development skills with the Gin HTTP Framework! 💪 Don't miss out on this opportunity to level up your coding game. See you in the tutorial!
#GolangTutorial #GinHTTPFramework #GolangGinFramework #Tutorial3 #LearnGolang #CodingCommunity
Trabalhando com Datas em SQL: Funções Úteis e Exemplos
Tags: datascience, sql, beginners, tutorial
Published: 2023-07-15 13:00:00

Olá a todos! Hoje, vamos falar sobre um tópico essencial em SQL - a manipulação de datas. Quer você esteja calculando a diferença entre duas datas ou extraindo partes específicas de uma data, é importante entender como trabalhar com datas em SQL.

**1. Introdução à Manipulação de Datas**

Datas e horas são informações cruciais em muitos conjuntos de dados. Em SQL, temos várias funções para nos ajudar a trabalhar com esses tipos de dados, seja para calcular intervalos, extrair componentes específicos ou formatar a apresentação da data e da hora.

**2. Funções de Data Comuns**

Vamos explorar algumas das funções mais comuns para trabalhar com datas em SQL.

* **GETDATE()**: Retorna a data e hora atuais.
* **DATEDIFF()**: Calcula a diferença entre duas datas.
* **DATEADD()**: Adiciona um intervalo especificado a uma data.
* **YEAR(), MONTH(), DAY()**: Extrai o ano, o mês e o dia de uma data, respectivamente.

Por exemplo, para extrair o ano de uma coluna 'DataNascimento', você usaria: 

```
SELECT YEAR(DataNascimento) FROM Tabela;
```

**3. Exemplos de Uso**

Agora vamos ver alguns exemplos de como essas funções podem ser aplicadas em situações do mundo real.

Suponha que você queira calcular a idade de alguém a partir da sua data de nascimento. Você poderia fazer isso usando DATEDIFF e GETDATE:

```
SELECT DATEDIFF(YEAR, DataNascimento, GETDATE()) AS Idade FROM Tabela;
```

Ou talvez você queira encontrar todos os registros criados no mês passado. Você poderia usar DATEADD e GETDATE para isso:

```
SELECT * FROM Tabela WHERE MONTH(DataCriacao) = MONTH(DATEADD(MONTH, -1, GETDATE()));
```

Compreender e dominar as funções de data em SQL é um recurso valioso para qualquer profissional que trabalhe com bases de dados. Continue praticando, experimentando e aprendendo, e logo você estará manipulando datas com facilidade. Até a próxima!
What you learning about this weekend?
Tags: codenewbie, discuss, learning, beginners
Published: 2023-07-15 13:00:00

Hey y'all 👋

What we all learning on?

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.

Expand your mind! 🤯

![Millie Bobby Brown mimes her mind exploding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0072dd5gp1xozu0mqswu.gif)
IoT Part 2: Connect an IoT device to Azure Raspberry Pi
Published: 2023-07-15 12:50:28

To connect an IoT device to the Azure Raspberry Pi simulator, you can follow these steps:

1.	Set up an Azure IoT Hub:
a. Go to the Azure portal and create a new IoT Hub resource.
![Hub](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rx79wtqegig84j7vfhbs.png)
b. Configure the settings for your IoT Hub, such as name, subscription, resource group, and region.
![Configurations](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gnbs986f59uenuiq96b.png)
c. 
Once the IoT Hub is created, go to its “Shared access policies” section and create a new policy with sufficient permissions (e.g., “registryRead”, “registryWrite”, “serviceConnect”, “deviceConnect”).
d. Take note of the “Connection string - primary key” value; you’ll need it later.
![primaryconnectionkey](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vqrj3nq4gbevxn2vyvt6.jpeg)

2. Open your web browser and search for azure raspberry pi simulator.

3.	Run the Raspberry Pi simulator:
![RPS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b82j43dxukurmsz27nnm.jpeg)
a. Input your code, add logic to start the device simulation and send telemetry data at regular intervals. Input primary connection key on line 15 of the code script.
![PCS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/121vq82f08hxl8yn1sey.jpeg)
b. Test the simulator on your local machine to make sure it’s functioning correctly.
	
4.	Monitor device telemetry in Azure IoT Hub:
a. In the Azure portal, navigate to your IoT Hub resource.
b. Open the “IoT devices” section and verify that your simulated device is listed.
c. Monitor the incoming telemetry data and device events in the “Messages” and “Events” sections.
![ME](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/umhm7oq1f10xowo3pk35.jpeg)

That’s it! You have now connected your IoT device (Raspberry Pi simulator) to Azure IoT Hub. You can explore additional features such as device management, data visualization, and alerts using Azure services like Azure Stream Analytics, Azure Functions, or Azure Logic Apps.
Devops Trends in 2023
Tags: devops, webdev
Published: 2023-07-15 12:35:23

1. Scaling Up Applications Smartly ( security and safety during the process of application development).
2. Private Clouds are Emerging.
3. Integrating AI into Devops.
4. CI/CD — Continuous integration, continuous development, and continuous deployment.
5. Monolithic vs. Microservices (Microservice creates a change in how companies develop their technology infrastructure. A microservice architecture can be built using smaller independent parts of a large and complicated application. )
6. GitOps — Version Control With IaC
7. Security With DevSecOps.
8. Low-Code Application
9. Observability and Response Time.

Do Find out my profiles on [Manjunatha Sai Uppu](https://manjunani.github.io/manjunathasaiuppu)