teleren/devto huggingface dataset:
Securing Your Applications Anywhere with F5 and Hashicorp Vault
Tags: security, applications, vulnerabilities, terraform
Published: 2024-02-28 17:00:00

In today's rapidly evolving digital landscape, the deployment and security of applications have become more crucial than ever. Traditional application deployment methods, which can take weeks or even months, are no longer sufficient. Modern applications require modern solutions that provide consistent security controls and policies regardless of where they are deployed.

![](https://victorleungtw.com/static/7bc85e36cc8faf98ccc8e80544642d37/a9a89/2024-02-29.webp)

## The Evolving Security Landscape

The security landscape has been changing dramatically, with the number of Common Vulnerabilities and Exposures (CVEs) found in the last four years surpassing the total of the previous decade. This surge in vulnerabilities has led to increased investments in addressing CVEs, with a significant focus on protecting applications from these threats.

CVEs can have a profound impact on organizations, leading to an increase in alerts, risk analysis, and the need for standby resources. Additionally, they often result in unplanned or out-of-band patches, further straining IT resources and budgets.

## Addressing the Challenge with F5 and Hashicorp

To stay ahead of the curve in this evolving landscape, organizations need a robust framework for patch management, golden images, and hardening. This is where F5 and Hashicorp come into play, offering solutions that can address these challenges effectively.

### Centralized Management with BIG-IP Next

F5's BIG-IP Next provides centralized management of instances, acting as a Single Source of Truth and enabling control access from anywhere. This simplifies the management of application delivery and security, ensuring consistent policies across all environments.

### Enhancing Workflows with Terraform

F5 BIG-IP Solutions for Terraform support customers in their digital transformation journey. However, one challenge is the high domain knowledge required for BIG-IP. By leveraging Terraform, organizations can improve their workflows through automation, using it as a layer of abstraction to simplify the management of BIG-IP configurations.

### Dynamic Certificate Management with Vault

Hashicorp Vault plays a crucial role in dynamic certificate management, offering a cloud-agnostic solution that is fully automated. This ensures that there are no downtime or outages caused by expiring certificates. Additionally, Vault enhances security by enabling the use of short-lived certificates, reducing the risk of exposure.

## Conclusion

In summary, securing applications in today's ever-changing landscape requires a modern approach. By leveraging the combined strengths of F5 and Hashicorp Vault, organizations can ensure consistent security controls and policies, streamline their workflows, and stay ahead of emerging threats. This not only protects their applications but also supports their digital transformation initiatives.
Software Development Concepts project! - Codecademy Project
Tags: beginners, softwaredevelopment
Published: 2024-02-28 16:27:20

Hi! I started studying IT to improve my knowledge and to become a professional in this field. I started with the IT introduction course on the "Codecademy" website, where I was asked to create a software concept. Therefore, this article is dedicated to that project!

**Plan and write the algorithm**

1 - Create a string variable "text" and input the value of the text that we plan to search through
2 - Create a string variable named "pattern" and input the value of the pattern thet we are looking for in text
3 - Create a "match_count" variable and set it to 0
4 - Decision: Have we finished searching the text value?
  *If no, continue to step 5
    *If yes, continue to step 7
5 - Iterate to the next word in "text" variable
6 - Compare value of "text" to the value of "pattern". Decision: Are they equal?
     *If yes, go to 7
     *If no, go back to step 5
7 - If "match_count" is equals to the lenght of the patern: pattern found! otherwise: pattern not found!

**Draw a Flowchart**

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

**Test the Chart**

I will conduct an analysis to make sure it works as expected.

**Produce Pseudocode**

define text
define pattern
create a match_count variable and set it to 0
if the entire text hasn't been searched:
iterate to the next character of the text
if the entire pattern hasn't been searched:
if this character from the pattern is equal to the character from text:
increment the match_count variable
if match_count is equal to the length of the pattern:
pattern found!
otherwise:
pattern not found!


With the pseudocode done, I conclude this article!
Thank you for giving me some of your time and for reading my article to the end!
This is my first project, so I found it to be a bit chalanging but at the same time very interesting!
I would apreciate sugestions and comments that would help to improve this project!
Build a Python File Mover
Tags: beginners, programming
Published: 2024-02-28 16:25:08

**Why should I try this mini task?**

We are going to learn how to move many files using the magic of Python, taking advantage of iterations. This article explores a Python script that automatically moves all JPG files from your desktop to a new folder named "screenshots.". 

#**Steps**

* Find your Desktop path: use <u>pathlib </u>to identify the location of your desktop folder. You can try any other folder in your computer!

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

* Create a folder in your desktop to save all files in it: Check if the folder exists on your desktop. If not, it creates it using mkdir(exist_ok=True). This ensures the script doesn't encounter errors if the folder already exists.

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

* Look for JPG files: Iterates through all files on your desktop using <u>iterdir().</u>. To move all JPG files, you need to look If a file ends with the ".JPG" extension.

`for file_path in desktop_path.iterdir():
    if file_path.suffix == ".JPG":`

* Move the files: Build a new path for the file within the new folder you just created. Finally, move the file to the new location using replace().

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

Just to check out, you can use print() to get a list of all files moved in the process. 

This script provides a basic solution for organizing your desktop. You can adapt it to handle different file types or modify the destination folder name based on your needs.


Thank you for reading!
~jor
@dynamicMemberLookup
Tags: dynamicmemberlookups
Published: 2024-04-11 08:23:47

---
title: @dynamicMemberLookup
published: true
date: 2024-02-28 16:17:39 UTC
tags: dynamicMemberLookupS
canonical_url: https://wesleydegroot.nl/blog/post/@dynamicMemberLookup
---

Let's delve into the fascinating world of Swift's `@dynamicMemberLookup`. This attribute, introduced in Swift 4.2, provides a powerful mechanism for accessing properties and methods dynamically even those that aren't known until runtime.

## What is `@dynamicMemberLookup`?

At its core, `@dynamicMemberLookup` instructs Swift to call a **subscript method** when accessing properties.  
This method, called `subscript(dynamicMember:)`, is required. Here's how it works:

1. **Attribute Definition** : You mark a type (such as a struct or class) with `@dynamicMemberLookup`.
2. **Subscript Method** : You implement the `subscript(dynamicMember:)` method within that type. This method takes a string parameter representing the name of the requested property and returns any value you like.

## Use Case: Dynamic Properties

Let's make a simple example. Imagine we have a `Person` struct that reads its values from a dictionary:

```
@dynamicMemberLookup
struct Person {
    private let properties = [
        "name": "Wesley de Groot",
        "city": "Haarlem"
    ]

    subscript(dynamicMember member: String) -> String {
        return properties[member, default: ""]
    }
}
```

In this case:

- The `@dynamicMemberLookup` attribute ensures that our type handles dynamic member lookup.
- The `subscript(dynamicMember:)` method looks up the member name in the dictionary and returns its value.

Now, we can access properties that don't actually exist as direct properties on the `Person` type:

```
let wesley = Person()
print(wesley.name) // Prints "Wesley de Groot"
print(wesley.city) // Prints "Haarlem"
print(wesley.pet) // Prints an empty string
```

Even though `name`, `city`, and `pet` are not actual properties, they are looked up at runtime.  
This feature bridges the gap between Swift's strong type safety and the more relaxed behavior of dynamic languages like PHP and JavaScript.

## Conclusion

`@dynamicMemberLookup` is a powerfull attribute to create easier to read code, it can be used on arrays and therefore also for [JSON](https://github.com/saoudrizwan/DynamicJSON)!

Resources: [https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes#dynamicMemberLookup](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes#dynamicMemberLookup)
can programming language work together?
Published: 2024-02-28 16:11:12


It is true that programming languages can cooperate in a variety of settings. The following are some ways that programming languages can work together: 



1. Interoperability: Interoperability is a feature of several programming languages that enables smooth data sharing and communication.



 Developers can utilize the advantages of various languages in a single project by utilizing APIs, libraries, or frameworks to facilitate communication between languages such as Python, Java, and C#. 



2. Integration: To take advantage of their distinct features and capabilities, programming languages can be combined into a single project. 



For example, a web application may use Python or Ruby on Rails for the back-end functionality and HTML, CSS, and JavaScript for the front end. Because of this connection, programmers may create intricate systems that take advantage of the advantages of several languages. 



3. Polyglot Programming: This type of programming entails employing several different languages within of one codebase. 



With this method, developers can select the optimal language for every system component based on readability, performance, and maintainability, among other considerations. 



For data processing and analysis, for instance, a data science program might utilize Python, and for jobs requiring high performance, it might employ C++. 



4. Language Interpreters and Runtimes: Certain programming languages have specialized environments or platforms in which they are meant to run. 



However, programs written in multiple languages can coexist by using language interpreters and runtimes to bridge the gap between various contexts. 


For instance, programs written in different languages, such as Java, Kotlin, and Scala, can execute on the same platform thanks to the Java Virtual Machine (JVM). 



To sum up, programming languages can cooperate and function together in a variety of ways, allowing programmers to create intricate and potent systems that take advantage of the advantages of multiple technologies and languages.



 The particular needs and limitations of each project determine which languages and integration techniques are best.
How Do You Drop Your Body Fat Percentage
Tags: healthydebate, diet, fitness, fat
Published: 2024-02-28 16:08:17

To drop [body fat percentage](https://d2diet.com/how-do-you-drop-your-body-fat-percentage/) without losing much weight, focus on strength training and maintaining a balanced diet. By incorporating muscle-building exercises and consuming enough protein, you can reduce body fat while preserving muscle mass.

This targeted approach helps improve body composition and promotes a leaner physique. A combination of resistance training and mindful eating habits can effectively lower body fat percentage without drastic weight loss. Making sustainable lifestyle changes that prioritize muscle retention and fat loss will lead to long-term health benefits and an overall fitter appearance.

Emphasizing strength training and nutrient-dense foods can help you achieve your body composition goals without sacrificing too much weight.
https://d2diet.com/how-do-you-drop-your-body-fat-percentage/
How can i detect screen is recording in React Native
Tags: reactnative, java, programming
Published: 2024-02-28 15:55:54

Hi guys, 
I have an app that play music, I would like my music is private so i don't want user can use 'screen record' to record the screen or my music in React Native i have do this in MainActivity.java

`getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
        WindowManager.LayoutParams.FLAG_SECURE);`

it make my screen go dark but user still record my music :(
Issue with p-togglebutton
Tags: angular, webdev, react, css
Published: 2024-02-28 15:55:50

Hi,
I am adding the angular component togglebutton (https://primeng.org/togglebutton) in an application and whenever I uncheck the button the column of a table in my webpage changes its size (increasing it). when I check the button again, the column size changes again (decreasing it).
Is there any issue related to this behavior already noticed before?
I did not use any custom code, just the basic usage configuration of the angular togglebutton component.
I built this platform to help you find well-planned projects and experienced partners.
Tags: webdev, devops, tutorial, productivity
Published: 2024-02-28 15:53:29

In a world where anyone can pitch an idea online, it can be overwhelming to find projects that are well-thought-out and ready for action. 

Many projects are pitched by unexperienced people wich lack clarity, feasibility, or a solid plan, making it hard to take it seriously and investing your time on. 

And for the other side it's hard to find people who have the experience and dedication for your project.

That why I created [https://www.craftit.site](https://www.craftit.site/) to make the search a little bit easier.
How to Start Learning Something(coding) New
Tags: try, code, discuss, beginners
Published: 2024-02-28 15:49:01

Hello Guys 
Lets Start Discussing how to learn Something New

Basically i am talking about anything skill but this relates to coding also so take a coffee and sit for some time patiently i have something nice for you so lets begin 

Start...

So if you are going to learn something new first start with the basics because without basics no matter how hard you try to expert in anything you will never gonna succeed i bet you.

Please if basics takes time more time and in some cases extra more time give that time no matter how months it takes how pain you suffer mently always remember, you don't have to worry you have to just keep patience and keep doing i know now you gonna say that my friend or my sameage guy learn so fast why i wait to learn basics to go for next things that is next to basics but if you not move according to your pace or your speed of learning you gonna punish yourself in future for long time I BET, believe me dude.

Keep doing again and again until you don't know the basics
confidently.

Then after you clearly learn the basics go for next thing whatever you are learning you will definetly succeed, And i again bet.

THATS IT BYE 
THANKS 🎉🎉🎉

End.
Create Stunning Presentations Effortlessly with Simplified's AI Doodle Presentation Maker
Tags: aidoodlepresentationmaker, freeaidoodlepresentationmaker
Published: 2024-02-28 15:37:32

[Simplified's AI Doodle Presentation Maker](https://simplified.com/ai-presentation-maker/doodle) is the ultimate tool for those who want to make their presentations more engaging and memorable. Let your creativity shine as the AI brings your ideas to life.
Protobuf doesn't store information correctly windows
Published: 2024-02-28 15:36:10

System used : Windows 10
Protobuf version : 3.21.12
Language : C++ (ISO C++14 using Visual Studio 17 2022)

I'm getting started with protobuf and just tried to reproduce the tutorial [](https://protobuf.dev/getting-started/cpptutorial/). I'm trying to create manually the class adressbook and print its attributes directly using the method PrintDebugString(). However, I could not see the names. It seems that the information is corrupted somewhere. Could someone give me some directions? 

```
#include <iostream>
#include <fstream>
#include <string>
#include "addressbook.pb.h"
using namespace std;

// Main function:  Reads the entire address book from a file,
//   adds one person based on user input, then writes it back out to the same
//   file.

int main(int argc, char* argv[]) {
    // Verify that the version of the library that we linked against is
    // compatible with the version of the headers we compiled against.
    GOOGLE_PROTOBUF_VERIFY_VERSION;

    tutorial::AddressBook address_book;

    tutorial::Person* personne = address_book.add_people();

    personne->set_id(7);
    *personne->mutable_name() = "Bobb";
    *personne->mutable_email() = "bobb@mail.com";
    
    tutorial::Person::PhoneNumber* phone_number = personne->add_phones();
    phone_number->set_number("4154251");
    phone_number->set_type(tutorial::Person::PHONE_TYPE_HOME);

    phone_number = personne->add_phones();
    phone_number->set_number("7159851");
    phone_number->set_type(tutorial::Person::PHONE_TYPE_MOBILE);

    address_book.PrintDebugString();

    // Optional:  Delete all global objects allocated by libprotobuf.
    google::protobuf::ShutdownProtobufLibrary();

    return 0;
}
```

The output is as follows

```
people {
  name: ""
  id: 7
  email: ""
  phones {
    number: "4154251"
    type: PHONE_TYPE_HOME
  }
  phones {
    number: "7159851"
    type: PHONE_TYPE_MOBILE
  }
}
```
Micro frontends in 1 minute
Tags: tutorial, microfrontends, javascript, learning
Published: 2024-02-28 15:33:42

I'm a big fan of reading docs & manuals before I try things especially when they are a bit more complex (advanced). However I know how much joy and motivation it gives when you get first positive experience fast (e.g. running working example). That's why I've decided to look into micro learning where you might scratch the surface, experience if it's for you and get some insights what's next if you want more.

Today I want to give you short introduction to micro frontends architecture starting from project structure setup. Following the words above let's get working example first. I will use real-life example - we will create a banking app consist of micro frontends.

## 🕒 Time start

First of all let's create an empty (None) NX workspace:
```
npx create-nx-workspace@latest
```
and get into it:
```
cd bank-mfe
```
Then let's add some framework to the NX workspace:
```
nx add @nx/angular
```
Now let's create apps folder to store all our micro frontends:
```
mkdir apps
``` 
and get into it: 
```
cd apps
```
It's time to create our micro frontends: 
```
nx g @nx/angular:host shell --remotes=account,payment,investment,mortgage,pension
```

## 🕒 Stop the time!

You did it! Your project consist of micro frontends! Now you can start and see it in browser by: 

```
nx serve shell --open
```
If you actively develop/change given micro frontend remember to serve it with `devRemotes` like: 
```
nx serve shell --open devRemotes=account
```

## 👨‍💻 Link to code example

Code example: https://github.com/sebgos/bank-mfe 

Video: https://www.youtube.com/watch?v=Vyi8pjuuky0

I have used:
- https://nx.dev/
- https://angular.io/
- https://code.visualstudio.com/

Curious to get more insights on micro frontends? Let me know in the comments!
Guard Clauses no C#
Tags: tutorial, csharp, dotnet, braziliandevs
Published: 2024-02-28 15:33:36

Guard Clauses, ou Cláusulas de Guarda, são práticas de programação que previnem a execução de métodos sob condições inadequadas, promovendo uma política de retorno antecipado. Elas identificam e tratam problemas imediatamente por meio de exceções quando condições específicas não são satisfeitas.

### Implementação de Guard Clauses em .NET

Existem duas maneiras principais de implementar Guard Clauses em .NET:

- **Personalizadas:** Criando métodos estáticos em classes estáticas para verificar condições específicas e lançar exceções quando necessário. Isso centraliza a lógica de validação e melhora a legibilidade do código.

```csharp
public static class Guard
{
    public static void IsNotNull(object value, string parameterName)
    {
        if (value == null)
            throw new ArgumentNullException(parameterName, "O valor não pode ser nulo.");
    }

    public static void IsGreaterThanZero(int number, string parameterName)
    {
        if (number <= 0)
            throw new ArgumentException("O número deve ser maior que zero.", parameterName);
    }
}
```

- **Bibliotecas .NET:** Utilizando pacotes NuGet como `Guard.Net` e `Ardalis.GuardClauses`, que oferecem uma variedade de métodos prontos para uso, simplificando a implementação.

```csharp
// Usando Guard.Net
Guard.Argument(username, nameof(username)).NotNull().NotEmpty();

// Usando Ardalis.GuardClauses
Guard.Against.NullOrEmpty(email, nameof(email));
Guard.Against.InvalidEmail(email, nameof(email));
```

### Refatoração com Guard Clauses

A refatoração de códigos para incluir Guard Clauses elimina aninhamentos excessivos e torna as pré-condições explícitas, facilitando a manutenção e a compreensão do código.

#### Antes:

```csharp
public void ProcessOrder(Order order)
{
    if (order != null)
    {
        if (order.Items.Count > 0)
        {
            if (order.TotalAmount > 0)
            {
                Console.WriteLine("Pedido processado.");
            }
            else { throw new Exception("Valor total deve ser maior que zero."); }
        }
        else { throw new Exception("O pedido deve ter ao menos um item."); }
    }
    else { throw new Exception("O pedido não pode ser nulo."); }
}
```

#### Depois:

```csharp
public void ProcessOrder(Order order)
{
    GuardAgainstNullOrder(order);
    GuardAgainstEmptyOrder(order);
    GuardAgainstZeroValueOrder(order);
    Console.WriteLine("Pedido processado.");
}
```

### Conclusão

Guard Clauses são essenciais para desenvolver software robusto, seguro e de fácil manutenção. Elas permitem uma validação eficiente e direta das entradas de métodos, alinhando-se com a filosofia de design fail-fast. A escolha entre implementações personalizadas ou bibliotecas prontas depende das preferências e necessidades específicas do projeto. Adotar Guard Clauses é um passo crucial para melhorar a qualidade do código e a resiliência dos sistemas de software.