teleren/devto huggingface dataset:
Cypress 💚 Iframes
Tags: cypress, javascript, todayilearned, beginners
Published: 2022-02-28 14:29:44

Hello,

If you've ever used Cypress, you probably know that testing Iframes isn't always easy. Especially when you want to test a child iframe contained in a parent iframe.

That's why [I created an example](https://github.com/mkubdev/cypress-nested-iframe) on one of the ways it could be used in this context 🌌

---
 
⚙️ An example of how to use [Cypress](https://www.cypress.io/) to target nested elements within iframes.

With limited iframe support from Cypress [[Issue #136](https://github.com/cypress-io/cypress/issues/136)], the following workaround in this repo allowed to target elements and interact with iframes during tests.

## Explanation

The solution is to create an iframe command that returns a promise upon iframe loading completion. These commands, aliased as `iframe()`, can be chained together to deal with nested iframes.

- Javascript:

```js
// support/commands.js

Cypress.Commands.add('iframe', { prevSubject: 'element' }, $iframe => {
  return new Cypress.Promise(resolve => {
      $iframe.ready(function() {
        resolve($iframe.contents().find('body'));
      });
  });
});
```

Here is an example of usage:

```js
// One iframe
cy.get("#iframe").iframe().find("#target").type("HELLO WORLD");

// Nested iframes
cy.get("#firstFrame").iframe().find("#secondFrame").iframe().find('#target').type('HELLO WORLD');
```

- Typescript:

```ts
// support/commands.ts

declare namespace Cypress {
  interface Chainable {
    iframe(): Chainable<Element>;
  }
}

Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe: JQuery<Element>) => {
  return new Cypress.Promise<Element>(resolve => {
    $iframe.ready(() => {
      resolve($iframe.contents().find('body'));
    });
  });
});
```

Here is an example of usage (same as javascript):

```ts
// One iframe
cy.get("#iframe").iframe().find("#target").type("HELLO WORLD");

// Nested iframes
cy.get("#firstFrame").iframe().find("#secondFrame").iframe().find('#target').type('HELLO WORLD');
```

## Links

[The Github repository](https://github.com/mkubdev/cypress-nested-iframe)
[Cypress.io](https://www.cypress.io/)
Debugging In Java #1.
Tags: dayoneofdebugging, java
Published: 2022-02-28 14:20:33

**Day 1**:
Debugging - is a methodical way of finding bugs and fixing bug in a software. We run a program and debug interactively by placing breakpoint.

Shortcuts-
F5-Step into(Control go into next break point).
F6-Step over(line by line).
F7-Step return(go back (opp of step into)).
F8-Resume.
7 Types Of JavaScript Datatypes
Published: 2022-02-28 14:20:14

Hey Everyone, Welcome To My Post 😎
7 Types Of JavaScript Datatypes :

- Numbers - Include Numerals.

- Strings - Include Letters, Words, Numbers, Punctuations etc. put in a single quote or double quote.

- Boolean - Two Types Of Possible Values, True or False.

- Null - Represents Absence Of Value.

- Undefined - Represents Lack Of Defined Value. Variables That Are Declared But Not Initialized To A Value Will Have The Value Undefined.

- Symbol - When Speaking About Symbols There's Much More To Say. I Want To Keep This JavaScript Series As Light As Possible So, Beginners Can Also Understand. If You Want To Learn More About Symbols, Feel Free To Check Out These Sites : [FreeCodeCamp](https://www.freecodecamp.org/news/how-did-i-miss-javascript-symbols-c1f1c0e1874a/), [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) Or You May Research On Your Own.

- Object - The Object Is A Complex Data Type That Allows You To Store Collections Of Data. 

Here, I Tried To Make It Simple For That Even Beginners Can Understand.
To Know More About These All Check Out : [W3Schools](https://www.w3schools.com/js/js_datatypes.asp), [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures).

Thank You For Your Most Valuable Time.
Have A Nice Day 🙂.
Redux
Tags: javascript, redux, react
Published: 2022-02-28 14:17:30


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

**

## What is Redux?
**

Redux is a predictable state container that allows you to create JavaScript apps that act reliably across client, server, and native contexts and are simple to test.

While it's most commonly used with React as a state management tool, it may be used with any other JavaScript framework or library. It's only 2KB in size (including dependencies), so you don't have to worry about it increasing the asset size of your application.

The state of your application is stored in a store with Redux, and any component can access any state that it requires from this store.


**When is Redux used?**

Recently, one of the most heated disputes in the frontend community has centered around Redux. Not long after its publication, Redux became one of the most hotly debated subjects. Many people favored it, but others highlighted major flaws.

Redux enables you to manage your app's state in a single location, making updates more predictable and traceable. It makes it simpler to reason about changes in your app. However, all of these advantages come with tradeoffs and limits. It may appear that it adds boilerplate code, making simple operations more difficult; nevertheless, this is dependent on the design selections.



**How Redux works**

Redux's operation is straightforward. There is a central store that holds the application's full state. Each component can access the saved state without needing to send props from one component to another.

There are three construction blocks: actions, stores, and reducers. Let's go over what each of them performs in more detail. This is crucial since it helps you grasp the benefits of Redux and how to apply it. We'll construct a similar example to the login component previously, but this time in Redux.
TexCreate v2.0 Announcement
Tags: mkprojects, tex, programming
Published: 2022-02-28 14:07:31

TexCreate is one of my biggest project, and it's going to be even bigger. I haven't put an update for a while since v1.6, so what's going on in v2.0?

Here is a list of some of the things going to be added: 
- Added `tex-rs` backend 
- Support for `MaTeX` language option 
- Option for building project as zip 
- Custom templates (will take a while to implement)
- Better documentation 
- New `config.toml`
- Migrate command to go from v1.0 to v2.0

Compared to other versions of TexCreate, this will take a while to implement, and I will be switching to a workspace environment for the project. I feel like these changes will cause v2.0 to be the last major update, but yet again I thought the same with v1.6.0.

If you're interested in joining this project, please comment below or email me at [mustafif0929@gmail.com](mailto:mustafif0929@gmail.com)
Getting started with Realm for React Native Using Expo Template, Enhanced
Tags: realm, reactnative, expo, mongodb
Published: 2022-02-28 13:58:52


{% youtube 5BwIpiC2H4E %}
- https://www.youtube.com/watch?v=5BwIpiC2H4E

## Overview
Simple [Expo React Native](https://expo.dev/) application to quickly get started with [React Native RealmDb API](https://docs.mongodb.com/realm/sdk/react-native/), based on the [starter template](https://github.com/expo/examples/tree/master/with-realm) that is provided by Realm. I added a few things, specifically [**working with relationships in RealmDB**](https://docs.mongodb.com/realm/sdk/react-native/examples/define-a-realm-object-model/#define-relationship-properties) since it was really what I was looking for before I started to create the video.

## 📝 Application Notes
- Added relationships so there is a project and a project has mutiple tasks associated with it
- added and additional screen which lists the Projects
- Added React Navigation so that we could move between the screens
- Added a new screen that lists all of the Projects that are in the application
- Added the project name to the task list
- Added the number of tasks associated with the Project to the project list
- Added try catch block to capture errors from the `realm.write` blocks
- Added code to delete the child `Task` objects of the `Project`
- I think that the introduction of the Realm Context is mising some helpful support documentation and links along with how to use the new `useQuery` function.
- I also think that the documentation on relationships is extremely lacking and I did my best to create something that will show it better

## Source Code
{% github aaronksaunders/ReactNativeRealm-Expo-Template %}

## Links
- https://www.mongodb.com/community/forums/t/what-are-realm-relationships/147823
- https://docs.mongodb.com/realm/sdk/react-native/examples/define-a-realm-object-model/#define-relationship-properties
- https://stackoverflow.com/questions/69711011/is-there-a-way-to-present-one2many-relation-in-correct-way-in-realm
Was ist der Unterschied zwischen der Call- und Apply-Methode?
Published: 2022-02-28 13:53:11

Der Unterschied zwischen **call u. apply** besteht darin, wie die Argumente an die aufgerufene Funktion übergeben werden. In apply werden die Argumente als Array und bei call getrennt durch ein Komma übergeben. 

```javascript
const object1 = {
    result: 0
}
const object2 = {
    result: 0
}
function reduceAdd() {
    let result = 0
    for (let i = 0, len = arguments.length; i< len; i++){
        result += arguments[i]
    }
    this.result = result
}
reduceAdd.apply(object1, [1, 2, 3, 4, 5, 6]) //21
reduceAdd.call(object2, 1, 2, 3, 4, 5, 6) //21
```
PHP vs Python: Which is better for Web Development
Published: 2022-02-28 13:48:36

In today`s coding world, there are tons of programming languages to learn.  But Among so many languages, let us discuss the key differences between[ PHP vs Python](https://www.ateamsoftsolutions.com/php-vs-python/).  Despite being an old language, [PHP](https://www.ateamsoftsolutions.com/php-vs-python/) still comprises 79. 8% of all web applications that nearly translates to 20 million websites and 2 million web servers. 

 It is an open-source server-side scripting language used for dynamic web development and can be embedded into HTML codes.  PHP is an  easy to learn language.  It is highly compatible since it can be integrated with multiple programming languages such as HTML, Javascript and supports different databases like MySQL, PostgreSQL, Oracle, etc.  In simple words, PHP creates dynamic web pages. 

 Python is a high-level, object-oriented programming language with built-in data structures and dynamic semantics.  Python supports different modules and packages, which allows program modularity and code reuse.  This programming language comprises multiple pre-built libraries, Resulting in simple application development.  The language consists of an interactive shell encouraging users to test functions before implementation process. 

 In simple words, python has interpreted high-level functional programming language.  PHP vs Python Purpose Developers use PHP for building dynamic websites.  Used by developers to create for rapid application.  PHP vs Python Frameworks PHP has numerous frameworks, which helps in building website quickly. 

 PHP vs Python Main Features It is an open-source language with the characteristics of easy deployment and continual improvements.  It is an open-source language with advanced features like Dynamic typing and high portability.  It helps developers build a website with high performance.  PHP vs Python Popularity Language of choice for web development. 

 Does not support database connectivity as broadly as PHP.  Now you must be wondering which programming language is the best choice isn`t it? The two programming languages that is PHP and python serve different purposes.  As discussed, PHP is widely used in web development and python is used for performing a series of tasks in [software or web development](https://www.ateamsoftsolutions.com/). 
.
Full format disk with EFI protected partition
Tags: efi, format, protected, erase
Published: 2022-02-28 13:45:22

---
title: Full format disk with EFI protected partition
published: true
description: Full format disk with EFI protected partition
tags: 'efi, format, protected, erase'
cover_image: 'https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/cover.jpg'
canonical_url: null
id: 1004112
---

###### :postbox: Contact :brazil: :us: :fr:

[Twitter](https://twitter.com/campelo87)
[LinkedIn](https://www.linkedin.com/in/flavio-campelo/?locale=en_US)

---

## Disk management

- Type **disk management** on start menu, or 
- Right-click computer **manage > disk management**
- Open run window (**Win + R**), type **diskmgmt.msc** and press **Enter**.

Choose disk partition and click delete button. But for some EFI protected partitions, like this...

![Image 1](https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/img1.png)

...you might see messages like below.

![Image 2](https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/img2.png)

Then you can use a command line to fully format your disk.

## Diskpart

Open your command prompt or powershell as admin. And type **diskpart**

![Image 3](https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/img3.png)

So you can type **list disk** to list all available disks.

![Image 4](https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/img4.png)

Select the correct disk to format.

![Image 5](https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/img5.png)

So you can type clean to erase all disk.

![Image 6](https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/img6.png)

And now the disk is fully formated.

![Image 7](https://raw.githubusercontent.com/campelo/documentation/master/posts/windows/full-format-drive/assets/img7.png)

## Typos or suggestions?

If you've found a typo, a sentence that could be improved or anything else that should be updated on this blog post, you can access it through a git repository and make a pull request. If you feel comfortable with github, instead of posting a comment, please go directly to https://github.com/campelo/documentation and open a new pull request with your changes.
Finally understanding the factory design pattern
Tags: typescript, javascript, programming, tutorial
Published: 2022-02-28 13:43:06

When I was studying Computer Science, I remember my professor trying to explain factories so enthusiastically about the subject that I honestly felt bad for not fully understanding it at the time.

To be honest, I understood the concept, but the UML diagram didn't quite relate to how I could use it to create better code, and now, years later, I finally have the same enthusiasm about the topic that my professor had. Because nowadays I find myself needing to create factories from time to time.

## What are factories

The factory is a design pattern listed by the famous GOF design pattern book.
the factory is a creation pattern that informs ways to abstract object instantiations in a way that reduces couple and make the code simple

Factories are very common and work as a base to many other patterns.

## Code example

Let's create some simple examples to show the pattern. These examples are created using typescript but can be translated into any language.

```ts
class ControllerFactory {
	static create() {
		const repo = new DatabaseConnection();
		const service = new Service(repo);
		const authenticator = new Authenticator();
		return new Controller(service, authenticator);
	}
}
```

In this first example, we use a factory to abstract all the logic to create a controller. This means that whoever uses the controller doesn't need to know anything about how the object is being created and its dependencies.

This abstraction means that eventually, we can change the steps of creating an object without changing everywhere the object is being used.

Now let's create a more complex example.

```ts
interface Message {
	send(): void;
}

class EmailMessage implements Message {
	send() {
		// ...
	}
}

class TelegramMessage implements Message {
	send() {
		// ...
	}
}

class MessageFactory {
	static create(type: 'email' | 'telegram'): Message {
		if (type === 'email') return new EmailMessage();
		if (type === 'telegram') return new TelegramMessage();
	}
}

class Application {
	main() {
		const message = MessageFactory.create('email');
		message.send();
	}
}
```

In this example, we create a factory that can decide which object needs to be created depending on the strategy passed. The factory will always return a Message, but depending on the type, this message can behave completely differently from one to another, which is the principle of the strategy pattern by the way.

## Conclusion

So, all in all, the factory pattern is one of the most common patterns when working with object-oriented programming, and the goal is to abstract all the logic needed to instantiate an object.
Creating a simple interface to interact with and allowing you to select the right object that needs to be used.
Pulsar with FLiP-Py
Published: 2022-03-01 16:43:19

---
title: Pulsar with FLiP-Py
published: true
date: 2022-02-28 13:43:00 UTC
tags: 
canonical_url: 
---

Let's get FLiP-Py!

[https://dzone.com/articles/pulsar-in-python-on-pi](https://dzone.com/articles/pulsar-in-python-on-pi) 

 <iframe src="https://dzone.com/articles/pulsar-in-python-on-pi"></iframe>
HashiConf Europe returns to Amsterdam June 20-22
Tags: devops, security, opensource, cloud
Published: 2022-02-28 13:39:51

We are excited to announce that [**HashiConf Europe**](https://hashiconf.com/europe) is back June 20-22, 2022, and will once again take place in the heart of Amsterdam’s Westerpark. 

HashiConf Europe is HashiCorp’s annual European community conference where developers, system engineers, architects, and security professionals from organizations of all sizes gather in person and online to share how the products in HashiCorp’s product stack help them provision, secure, connect, and run their business-critical applications.

This year you can join us in Amsterdam or virtually. Registration is now open. 
We hope to see you there!

[Register here](https://hashiconf.com/europe).
Why is it important to know about JavaScript?
Tags: javascript, beginners, webdev, tutorial
Published: 2022-02-28 13:33:45

JavaScript. The almighty! Almost everyone on the block of web development or even for someone who is exploring the tech world has heard about JavaScript. JavaScript is one of the languages that has stayed high in demand since the day it was born.

JavaScript is being used almost in every application that we use every day. There are over 1.8 Billion websites in the world and 95% of them use JavaScript.

The question is What makes JavaScript stand out from the rest? Here are a few factors stating the popularity and importance of JavaScript. Let’s begin!

1. JavaScript is the ONLY language that the browser understands.
Many scripting languages were created earlier to run in the web browsers, but due to JavaScript’s ease of use and cross-platform compatibility, it became the obvious choice of the browser vendors and the development community to use it for the development of the Web.

2. Easy to access and Learn.
To write basic code in JavaScript all you need is a browser. Since JavaScript is supported by every browser, therefore you can start to code right away.
For Instance, if you use Chrome, `ctrl+shift+i` opens the Console where you can enter your first line of JavaScript!

3. Adds Dynamic behavior to the Websites.
Almost every single interactive behavior that exists on the web page can be done using JavaScript. For Example :
Using the Hamburger Menu
Show or hide information with a click of a button
Carousel of images being displayed
Timer or a count-down on the website etc...

4. Javascript is used across the development stack.
JavaScript is the most important tool for Web Development. With the knowledge of JavaScript, you can develop both the Front End and Back End of the website.
The most popular stacks, MEAN and MERN, are completely dependent on JavaScript.

5. Community Support is Massive.
There is a lot of Community Support available for JavaScript, if you are a beginner there is a very little chance that you might encounter a problem that hasn’t occurred before.
There are a lot of really good resources available online for you to get started on your journey to learn more about JavaScript.

These are some of the reasons why I consider everyone should know about JavaScript. JavaScript is here to stay, so it is beneficial for everyone to know about it.
Redux-Toolkit
Tags: javascript, react, reactnative, programming
Published: 2022-02-28 13:31:50


What is Redux?

Redux is an anticipated state compartment intended to assist with composing JavaScript applications. It acts reliably in client, server, and local conditions. It is generally utilized as a state-the-board instrument with React. It can likewise be utilized with some other JavaScript system or library. Redux, the condition of the application is kept in a store, and every part can get to any express that it needs from this store.


When to use Redux:

Redux allows you to oversee application status in a solitary spot and make application changes more unsurprising and unmistakable. This makes it simpler to reason about changes in the application. Typically when the application scale increments, dealing with the state of the application turns into an issue. Revival is utilized to tackle this issue.

Why use Redux?

While utilizing React-Redux, the states never again need to go up. This makes it more straightforward to distinguish which activity causes which change. Utilizing Redux doesn't need the part's youngster part to give any state or technique to dividing information between themselves. This enormously improves the application and works on support.

Redux makes the state predictable:

In Redux, the state is unsurprising 100% of the time. Assuming a similar state and activity are passed to a minimizer, a similar outcome is constantly created in light of the fact that minimizers are unadulterated capacities. The state is additionally unchanging and is rarely different. This makes it conceivable to carry out strenuous undertakings like boundless fix and re-try.

Redux is maintainable:

Redux is severe with regards to how to code ought to be coordinated, which makes it more straightforward for somebody with information on Redux to get the design of any Redux application. This by and large makes it simpler to keep up with. This additionally helps isolate business rationale from part trees. For enormous scope applications, it's basic to keep applications more unsurprising and viable.

Debugging is easy in Redux:

Redux makes it simple to troubleshoot an application. By logging activities and states, it is straightforward coding mistakes, network blunders, and different types of bugs that could come up during creation. Redux DevTools likewise makes it simple to exploit every single Redux proposition.

Performance Benefits:

Respond Redux carries out numerous presentation improvements inside so your own associated part just rerenders as the need should arise.
Aprendizado de Máquina - Tom M. Mitchel
Tags: machinelearning, translation
Published: 2022-02-28 13:29:37

Olá, eu vou começar a traduzir o livro "**Machine Learning**" de _Tom M. Mitchel_, desta forma estudo e amplio o acesso à esse material.

Não tenho interesse em comercializar, ou qualquer forma de remuneração por esta tarefa, assim posso fazer no meu tempo e sem pressão.

A ideia é fazer por partes (tópicos), conforme a necessidade de conteúdo que preciso disponibilizar em outro projeto.

Abraço, Ana.

A fonte do arquivo original é:
https://www.cin.ufpe.br/~cavmj/Machine%20-%20Learning%20-%20Tom%20Mitchell.pdf