teleren/devto huggingface dataset:
Swift: Associated types.
Tags: swift, mobile, ios, programming
Published: 2023-02-04 07:32:23

Associated types in Swift work closely together with protocols. You can literally see them as an associated type of a protocol: they are family from the moment you put them together.

It's a bit more complicated to explain how associated types work but once you get the hang of it, you'll be using them more often. Protocols allow us to define a common interface between types

[Declaration](https://dev.to/sergeyleschev/swift-associated-types-declaration-bp6)
[Example](https://dev.to/sergeyleschev/swift-associated-types-example-51ea)
[Contraints](https://dev.to/sergeyleschev/swift-associated-types-constraints-3aj6)
[Conforming a protocol to a protocol](https://dev.to/sergeyleschev/swift-conforming-a-protocol-to-a-protocol-pok)

Associated Types in Swift are a powerful way to define code that can be reused among multiple different types. Practice is required to get the most out of it but once you understand the principle you can easily reuse a lot of code.

---

**Contacts**
I have a clear focus on time-to-market and don't prioritize technical debt. And I took part in the Pre-Sale/RFX activity as a System Architect, assessment efforts for Mobile (iOS-Swift, Android-Kotlin), Frontend (React-TypeScript) and Backend (NodeJS-.NET-PHP-Kafka-SQL-NoSQL). And I also formed the work of Pre-Sale as a CTO from Opportunity to Proposal via knowledge transfer to Successful Delivery.

🛩️ #startups #management #cto #swift #typescript #database
📧 Email: sergey.leschev@gmail.com
👋 LinkedIn: https://linkedin.com/in/sergeyleschev/
👋 LeetCode: https://leetcode.com/sergeyleschev/
👋 Twitter: https://twitter.com/sergeyleschev
👋 Github: https://github.com/sergeyleschev
🌎 Website: https://sergeyleschev.github.io
🌎 Reddit: https://reddit.com/user/sergeyleschev
🌎 Quora: https://quora.com/sergey-leschev
🌎 Medium: https://medium.com/@sergeyleschev
🖨️ PDF Design Patterns: [Download](https://sergeyleschev.github.io/sergeyleschev-design-patterns.pdf)
Modular Import in Page Objects
Tags: testing, qa, automation, cypress
Published: 2023-02-04 07:14:54

Ahoy, mate!

This topic may be useful for test automation engineers who'd like to make their code look better!

I wrote about [Page Objects in Cypress](https://hackernoon.com/cypress-with-page-object-model) earlier - take a look if you haven't already! Modular import isn't a new thing, and if you haven't heard about it and its profits before - you can find more in an article from @fahadaminshovon :
{% link https://dev.to/fahadaminshovon/-how-to-use-indexjs-fileproperly-302f %}

Source code of project from this article on **GitHub**: https://github.com/bormando/swag-tests/pull/2/files

In short, it structures your code better, let's see how...

-----

#How it was

It's pretty usual, when during a test you navigate from one page to another. In that case you need to import all pages involved into that spec file:

```
import AuthPage from '../pages/auth.page'
import ProductsPage from '../pages/products.page'
```

But what if that test involves more pages? And usually spec file combines multiple test suites - which probably means A LOT of pages if we combine all tests.

-----

#How to improve it

We can declare a folder that contains page objects to be a module (and technically it is). To do that, simply add `index.js` file in the (`page`) folder.

This file is an "entry point" of our "pages" module. You say there what would you like to export from the module, like this:

```
export * from './auth.page'
export * from './products.page'
export * from './cart.page'
```

`*` means <u>everything</u>

If you'd like to export ready-to-use page instances in [Cypress](https://www.cypress.io) with this structure, you'll need to rewrite exports as well:

```
import Page from './page'
...

export const CartPage = new class extends Page {
  ...
}
```

Code above says that new instance of the class will be created when you'll import this page in your tests. It's a bit different than `default` export like this:

```
export default new CartPage()
```

`default` export lets you set any name you like when you import whatever you do, while the other construction sets a specific name for the instance that you export.

#How it looks now

Now you don't call every page file to import the page you need:

```
import {AuthPage, ProductsPage} from '../pages'
```
`pages` folder is a module now and you name objects you'd like to get from there that were exported.

This practice may be used with other modules as well, like [Page Elements](https://hackernoon.com/writing-better-tests-with-cypress-page-elements).
How Agile is the Key to Thriving in an Unpredictable World?
Tags: agile, product, software, development
Published: 2023-02-04 07:07:19

In today's fast-paced and ever-changing business environment, it can be challenging for organizations to plan and execute projects effectively. The COVID-19 pandemic has only accelerated this trend, with companies facing unprecedented levels of uncertainty and having to quickly adapt to new realities. In this unpredictable world, a traditional, rigid approach to project management simply won't cut it. That's where Agile project management comes in.

Agile project management is a flexible, iterative approach that prioritizes adaptability over predictability. Instead of following a rigid plan, Agile teams focus on delivering small increments of value in short, iterative cycles. This allows teams to quickly respond to changing priorities and unexpected challenges, and continuously refine their plans based on feedback and new information.

One of the key benefits of the Agile approach is that it promotes cross-functional collaboration and teamwork. Agile teams are made up of members with diverse skills and perspectives, and the methodology emphasizes the importance of working together to solve complex problems. This creates a culture of continuous learning and innovation, where everyone is encouraged to bring their ideas to the table and work together to find creative solutions.

Another key advantage of Agile project management is that it places a strong emphasis on customer satisfaction. Agile teams prioritize delivering value to end users, and they are quick to respond to customer feedback. By focusing on delivering real value to customers, Agile teams can build stronger relationships and gain a competitive advantage in an unpredictable world.

Finally, Agile project management provides greater visibility and transparency, which is especially important in today's fast-paced and rapidly changing business environment. Agile teams use real-time data and metrics to track progress and make informed decisions, and they regularly engage in retrospectives to reflect on their work and identify areas for improvement. This allows Agile teams to continuously improve and stay on track, even in the face of unexpected challenges.

In conclusion, the Agile approach to project management is the key to navigating an unpredictable world. By embracing change, promoting cross-functional collaboration, focusing on delivering value to customers, and providing greater visibility and transparency, Agile teams can quickly adapt to new challenges and continuously drive business success.
Amiclear Reviews 2023
Published: 2023-02-04 07:04:52

https://techplanet.today/post/amiclear-reviews-shocking-customer-report-2023-must-see-before-buy
https://twitter.com/amiclearprice
https://www.facebook.com/profile.php?id=100089678095541
https://www.pinterest.com/pin/1009510072701089338/
https://colab.research.google.com/drive/1z8Y7jXPoPYi5sdmPdH-RtHo4zV0t-2Ea
https://www.linkedin.com/events/amiclearreviews-shockingbloodsu7027519230677770241/
https://www.ivoox.com/podcast-amiclear-blood-sugar-formula-2023_sq_f11820796_1.html
https://medium.com/@amiclearprice
https://amiclearprice.company.site/
https://soundcloud.com/amiclearprice
https://managementmania.com/en/blog/tdeorirtn-lee/amiclear-reviews--heathy-blood-sugar-formula-2023
https://forum.techtudo.globo.com/perguntas/582075/amiclear-reviews-warnings-do-not-buy-until-you-see-latest-customer-report-2023
https://www.outlookindia.com/outlook-spotlight/bliss-skin-tag-remover-reviews-deceit-2023-ingredients-and-buyers-feedback-about-bliss-skin-tag-removal--news-257935
https://www.outlookindia.com/outlook-spotlight/neurotonix-reviews-neuro-tonix-negative-effects-and-health-risks-exposed-here--news-255891
https://www.outlookindia.com/outlook-spotlight/glucotrust-reviews-canada-scam-alert-2023-customer-feedback-and-warnings-you-need-to-know--news-255424
https://www.outlookindia.com/outlook-spotlight/red-boost-reviews-update-2023-cheap-ingredients-truth-exposed--news-255091
Buenas prácticas en desarrollo de software
Tags: desarrollodesoftware, buenaspracticas, planificacion, documentacion
Published: 2023-02-04 07:01:23


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/42u1v36wzvkg9dy9hwo4.png)
El desarrollo de software es un proceso complejo y requiere de mucha planificación y ejecución adecuada para garantizar un producto de alta calidad. Aquí hay algunas buenas prácticas que deben seguirse para lograr un buen desarrollo de software:

1. Planificación: Antes de comenzar el desarrollo, es importante tener un plan claro y detallado de lo que se desea lograr. Este plan debe incluir los objetivos, el alcance, los requisitos del usuario, el plazo de entrega y el presupuesto.

2. Documentación: La documentación es esencial para un buen desarrollo de software. Todos los procesos y decisiones importantes deben ser documentados para que sea fácil de seguir y mantener.

3. Pruebas: Las pruebas son una parte esencial del desarrollo de software. Todos los componentes del software deben ser probados exhaustivamente para asegurarse de que cumplen con los requisitos y funcionan correctamente.

4. Codificación limpia: Es importante escribir código limpio y bien estructurado. Esto ayuda a mantener el software fácil de leer y de mantener, y a reducir los errores y los problemas de compatibilidad.

5. Control de versiones: El control de versiones es esencial para el desarrollo de software. Permite realizar un seguimiento de los cambios realizados en el código y hacer copias de seguridad fáciles.

6. Colaboración: La colaboración es clave en el desarrollo de software. Es importante trabajar en equipo y compartir ideas para lograr un producto de alta calidad.

7. Seguridad: La seguridad es un aspecto crítico en el desarrollo de software. Es importante tomar medidas para proteger los datos y asegurarse de que el software sea seguro y cumpla con los estándares de seguridad.

Siguiendo estas buenas prácticas, se puede lograr un desarrollo de software eficiente, de alta calidad y con una buena documentación. Al final, esto asegurará un producto final sólido y satisfactorio para los usuarios.
new EyeDropper API in Chrome
Published: 2023-02-04 06:53:09

The EyeDropper API in Chromium-based browsers like Edge or Chrome can be a powerful tool for developers who want to sample colors from web pages and images. This API allows you to pick a color from a web page or image and get the color code for use in your own designs.

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

## Feature Detection and Browser Support

> Before you start using the EyeDropper API, make sure it's available in your browser.

The EyeDropper API is supported in Chromium-based browsers as of version 95.


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

## Using the API
- To use the EyeDropper API, you first need to create an EyeDropper object and then call its open() method:

```javascript
const eyeDropper = new EyeDropper();
```

- The `open()` method returns a promise that resolves after the user selects a pixel on the screen. The resolved value provides access to the pixel's color in `sRGBHex` format `(#RRGGBB)`. If the user leaves the EyeDropper mode by pressing the esc key, the promise is rejected.

```javascript
try {
  const result = await eyeDropper.open();
  // The user selected a pixel, here is its color:
  const colorHexValue = result.sRGBHex;
} catch (err) {
  // The user escaped the EyeDropper mode.
}
```

- If the app's state changes in a substantial way, the EyeDropper mode can be canceled. For example, if a popup dialog appears and requires the input of the user, the EyeDropper mode should be stopped. To cancel the EyeDropper mode, you can use an AbortController object's signal and pass it to the `open()` method.

const abortController = new AbortController();

```javascript
try {
  const result = await eyeDropper.open({signal: abortController.signal});
  // ...
} catch (err) {
  // ...
}

// And then later, when the EyeDropper mode needs to be stopped:
abortController.abort();

```

Here's a reusable async function that puts all the steps together:

```javascript
async function sampleColorFromScreen(abortController) {
  const eyeDropper = new EyeDropper();
  try {
    const result = await eyeDropper.open({signal: abortController.signal});
    return result.sRGBHex;
  } catch (e) {
    return null;
  }
}
```


### References (Read More about the EyeDropper API here)
- [https://developer.chrome.com/articles/eyedropper/](https://developer.chrome.com/articles/eyedropper/)
- [https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper)


In conclusion, the EyeDropper API in Chromium-based browsers is a convenient tool for developers who want to sample colors from web pages and images. With its support for feature detection, promise-based functionality, and AbortController objects, it's an easy and effective way to get the color information you need.
Why Partially Decentralized Systems are still Centralized?
Tags: blockchain, decentralization, centralization, web3
Published: 2023-02-04 06:52:36

In recent years, the term "decentralization" has become increasingly popular, particularly in the blockchain and cryptocurrency space. However, it is important to understand that not all decentralized systems are created equal. In fact, many so-called "decentralized" systems are only partially decentralized and are still inherently centralized.

A fully decentralized system is one in which there is no central authority or central point of control. Instead, all participants have equal say in the decision-making process and the system operates based on consensus. On the other hand, a partially decentralized system is one in which there is still a central authority, but the authority is lessened compared to a fully centralized system.

The issue with partially decentralized systems is that they still have a central point of control, and therefore, are vulnerable to the same issues that centralized systems are. For example, a partially decentralized system may be susceptible to a single point of failure, where if the central authority fails, the entire system fails. Additionally, the central authority may have the power to make unilateral decisions, which may not align with the desires of the participants in the system.

One of the biggest issues with partially decentralized systems is that they often use a hybrid model of centralization and decentralization, which can be confusing for users. This can lead to misunderstandings about the true nature of the system, and may result in users mistakenly believing that their data and assets are secure when they are not.

Another issue with partially decentralized systems is that they are often controlled by a small group of individuals or organizations. This means that the system may be susceptible to manipulation and control by this small group, and the decisions made by this group may not align with the interests of the wider community.

In conclusion, it is important to understand that a partially decentralized system is still a centralized system, and that it is vulnerable to many of the same issues that fully centralized systems are. If you are looking for true decentralization, it is important to look for a fully decentralized system that operates on a consensus-based model, where all participants have equal say in the decision-making process.
Kerassentials - Nail Fungus Benefits, Ingredients, Uses & Side Effects?
Tags: webdev, javascript, beginners, programming
Published: 2023-02-04 06:37:12

When you have Kerassentials determined your everyday caloric intake, you should re-evaluate your eating routines. Try to eliminate the foods and beverages loaded with sugar and fat. These do nothing to help turn your body in a belly Fat Burner. Instead, you might want to consume foods with a lot of protein, complex carbohydrates, fiber, vitamins, and minerals. Economical boost your metabolism and https://kerassentialsfacts.wixsite.com/kerassentials
https://www.instagram.com/kerassentialsresult/
https://www.scoop.it/topic/kerassentials-info-by-kerassentials-fact
https://twitter.com/kerassentialsf1
Factory Method Design Pattern
Tags: webdev, javascript, beginners, programming
Published: 2023-02-04 06:34:07

_Please read my previous article i discussed the[ Factory Design Pattern ](https://dev.to/youssefghonem/factory-design-pattern-20kp)in C# with example before read this._
**What is Abstract Factory Design Pattern?**

> Define an interface for creating an object, but let the subclasses decide which class to instantiate. The Factory method lets a class defer instantiation it uses to subclasses.

when we need to **create the object** (i.e. instance of the Product class) **without exposing** the object creation logic to the client.
 في المقال اللي فات وضحت ان الفاكتوري باترن  بيستخدم اثناء الكرييت الاوبجيت بتاعك والاهميه بتاعه هي انه بيخفي الامبلمنتيشن بتاعك عن الكلاينت
وكان فيه مشكلتيين في الفاكتوري 
tight coupling between the Factory and violates the open/closed design principle
هشرح على نفس المثال بتاع الكريديت كارد 
Create a interface with the name ICreditCard and (MoneyBack, Titanium, and Platinum) classes implementing the ICreditCard.
![A pie chart showing 60% responded "Yes", 70% responded "No" and 10% responded "Not sure"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7doyc80f2ugb7h5qcz4i.png)
هنا بدأت اعمل امبلمينت للفاكتوري وهو اني اكريت لكل انتيتي فاكتوري خاص بيه وهو المسؤل عن كريت الاوبجيت بتاعه واقدر اكتب اي لوجيك انا عايزه براحتي 
![A pie chart showing 60% responded "Yes", 70% responded "No" and 10% responded "Not sure"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvm4hnhks1831cwjasy9.png)
Consuming the factory Method in the Client Code (program.cs):
If you want to create an instance of the Platinum CreditCard then call the **Create** method of the **PlatinumFactory** instance

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ydhcmyyuqswyhbhjsag1.png)
_code reference:https://github.com/YoussefGhonem/DesignPattern_

---

_I am going to discuss the Abstract Factory Design Pattern in C# with an example. In this article, I try to explain the Factory Method Design Pattern in C# step by step with an example. I hope this article will help you with your needs. I would like to have your feedback. Please post your feedback, question, or comments about this article._

[facebook](https://www.facebook.com/profile.php?id=100087460623369)
[linkedIn](https://www.linkedin.com/in/youssef-ghonem-37213216a/)
Website Day 1
Published: 2023-02-04 06:04:44

So yesterday I took on the challenge to actually get started on my own personal portfolio website. I got started with the design and decided that I will add the content later on when all the heavy lifting has been done. So I went to Dribble to look for some design themes.
And the one I finalised is Neobrutalism. I am very trashy at design and know just about enough for it to pass. But this time I wanted to make the website look actually half decent. Neobrutalism follows the design of having sharp edges, bright colours, and bold strokes, which is quite different from what we see on modern websites today.
I then came across a website called dodonut.com whose colour palette I really liked, so I took out the most used colours and got to work.
I added a header, a basic introduction, my socials, and an about section all following the same pattern. I then realised that having a scroll progress on the header would be good so I looked up some code to do it and put it in.

```
const [completion, setCompletion] = useState(0)

    useEffect(() => {
        const updateScroll = () => {
            const progress = window.scrollY
            const scrollHeight = document.body.scrollHeight - window.innerHeight
            if (scrollHeight){
                setCompletion(
                    Number((progress / scrollHeight).toFixed(2)) * 100
                )
            }
        }
        window.addEventListener('scroll', updateScroll)
        return () => window.removeEventListener('scroll', updateScroll)
    }, [])

    return completion
```
This completion variable is a value between 0 and 100 depending on where you are on the page, now putting a transform property on an empty div adds a nice effect to show scroll progress.

```
<div
    style={{ transform: `scaleX(${completion / 100})` }}
    className={styles.progress} />
```
I then pushed these changes to the GitHub repo and despite how little you can see, this took a substantial amount of time.

> The reason people code is still a mystery. To put oneself through so much pain to achieve so little goes against human intuitiveness. Yet so many of us do it on a daily basis and reap happiness out of it. Humans are truly a weird race - Abeer Rao 2023
This week’s newsletter is out! (04-02-2023) - An accelerator for the accelerator & a leash for the leash
Tags: javascript, tech, webdev
Published: 2023-02-04 05:58:16

---
title: This week’s newsletter is out! (04-02-2023) - An accelerator for the accelerator & a leash for the leash
published: true
description: Another week of great javascript, tech and web development links.
tags: javascript, tech, webdev, discuss
---

An accelerator for the accelerator & a leash for the leash

https://markjgsmith.substack.com/p/mark-smiths-newsletter-04-02-2023

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Coding: The Art of Bringing Your Ideas to Life
Tags: webdev, code
Published: 2023-02-04 05:55:45

Have you ever wondered how websites, mobile apps, and software are created? The answer is coding. Coding is the process of writing instructions for computers to understand and carry out specific tasks.

As technology continues to advance, the demand for skilled coders is on the rise. Coding is no longer just a tool for computer scientists and engineers, but a valuable skill for people in a variety of industries. From finance to healthcare, coding is changing the way we live and work.

So what is it that makes coding such a valuable skill? For starters, it teaches problem-solving skills. When coding, you must think logically and systematically to find solutions to complex problems. This skill is not only valuable in a technical setting, but in everyday life as well.

Another benefit of coding is the ability to bring your ideas to life. Whether you want to create a website for your business, build a mobile app, or design software, coding is the key to making it happen. With coding, the sky's the limit.

If you're interested in learning to code, there are plenty of resources available. Online courses, tutorials, and forums are a great place to start. Practice is key to becoming a successful coder, so don't be afraid to dive in and start building your skills.

Coding can be challenging, but it's also incredibly rewarding. As you progress, you'll find yourself feeling more confident in your abilities and proud of the projects you've built.

So why not give coding a try? Whether you're looking for a new career, a hobby, or just a way to bring your ideas to life, coding is the perfect place to start. Get ready to embark on a journey of creativity, problem-solving, and endless possibilities.