teleren/devto huggingface dataset:
Navigating Object-Oriented Waters: Understanding Inheritance and Polymorphism in Dart
Tags: programming, tutorial, flutter, dart
Published: 2023-08-25 02:30:00

Greetings, fellow Flutter enthusiasts! In the ever-evolving landscape of Dart, we find ourselves at the threshold of two essential concepts: Inheritance and Polymorphism. These are the building blocks that add depth and flexibility to our coding journey. Let's embark on a voyage of comprehension, as we unravel the intricacies of inheritance and polymorphism in Dart.

Inheritance: Building Upon Foundations
Imagine inheritance as a legacy passed from generation to generation, where new knowledge builds upon the wisdom of the past. It's the foundation that allows us to create new things while retaining the essence of what came before.

Creating a Subclass: Expanding the Horizon
Inheritance lets us create a new class that inherits attributes and behaviors from an existing class. It's akin to taking the knowledge of a master and applying it to your own craft:

```
class Animal {
    String name;

    void speak() {
        print("$name makes a sound");
    }
}

class Dog extends Animal {
    Dog() {
        name = "Dog";
    }
}

```
Extending Functionality: Unveiling New Possibilities
Like adding new chapters to an already fascinating story, we can extend a subclass with additional features:

```
class Cat extends Animal {
    Cat() {
        name = "Cat";
    }

    void purr() {
        print("$name purrs softly");
    }
}

```

Polymorphism: The Art of Flexibility
Polymorphism is the ability of different objects to respond in their own unique way to the same message. It's like having multiple instruments that can play harmoniously in an orchestra.

Creating a Melodic Ensemble: Embracing Diversity
Polymorphism allows us to store objects of different classes in a single collection, making our code adaptable and concise:

```
List<Animal> zoo = [Dog(), Cat()];

for (var creature in zoo) {
    creature.speak();
}

```

Applying the Wisdom: Inheritance and Polymorphism in Flutter
Incorporating inheritance and polymorphism into your Flutter projects brings a new layer of structure and adaptability. Subclasses let us build upon existing blueprints, while polymorphism enables us to handle diverse objects seamlessly.

As you integrate these concepts, let them resonate through your Flutter creations. Embrace the power of inheritance, extend your classes, and watch as polymorphism enriches your coding endeavors.

May your journey through Flutter be marked by clarity and coding finesse! 🚀



Video: https://youtu.be/FAvVWNfHuk0 (in Hindi)
Making API Calls to Fetch Weather Data in Swift
Tags: swift, programming, tutorial
Published: 2023-08-25 01:37:50

In this unit, we will delve into the practical aspect of working with Weather APIs in Swift. We will learn how to make API calls to fetch weather data and handle the responses effectively.

## Understanding HTTP Requests and Responses

HTTP stands for Hypertext Transfer Protocol. It is a protocol used for transferring data over the internet. An HTTP request is made to a server from a client, and the server responds to the client with an HTTP response.

There are several types of HTTP requests, but the one we are interested in for fetching data from a Weather API is the GET request. A GET request is used to request data from a specified resource.

## Making GET Requests in Swift

In Swift, we can make GET requests using the URLSession class. Here's a basic example of how to make a GET request to a Weather API:
```swift
let url = URL(string: "https://api.weatherapi.com/v1/current.json?key=YOUR_API_KEY&q=London")!

let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
    if let error = error {
        print("Error: \(error)")
    } else if let data = data {
        // handle data here
    }
}

task.resume()
```
In this example, we first create a URL object with the URL of the Weather API. We then create a data task with this URL, which will send a GET request to the API when resumed.

## Handling API Responses and Errors

The data task's closure is called when the GET request is complete. It has three parameters: data, response, and error. If an error occurred during the request, the error parameter will contain an Error object, and data and response will be nil. If the request was successful, data will contain the data returned by the server, response will contain a URLResponse object with information about the server's response, and error will be nil.

To handle the data returned by the server, we can use the JSONDecoder class in Swift to decode the data into a model object. Here's an example:
```swift
let decoder = JSONDecoder()
if let weatherData = try? decoder.decode(WeatherData.self, from: data) {
    // use weatherData here
}
```
In this example, we first create a JSONDecoder object. We then call its decode(_:from:) method, passing in the type of the model object we want to decode the data into and the data itself. If the method call is successful, it returns a model object with the decoded data.

By the end of this unit, you should have a solid understanding of how to make API calls in Swift and handle the responses. This knowledge will be crucial for fetching and handling weather data in your weather application.
Setting Up a Free Weather API
Tags: swift, programming, tutorial
Published: 2023-08-25 01:36:53

In this unit, we will guide you through the process of setting up a free weather API for your Swift application. APIs, or Application Programming Interfaces, are crucial for fetching real-time weather data for your application. Let's dive in!

## What is an API Key?

An API key is a unique identifier used to authenticate a user, developer, or calling program to an API. It is essentially the "password" for making API calls. When you sign up for a free weather API, you will be given an API key. This key must be included in all API requests to validate your requests.

## How to Set Up a Free Weather API

There are several free weather APIs available, such as OpenWeatherMap, Weatherstack, and Climacell. For this guide, we will use OpenWeatherMap as an example.

- Create an account: Visit the OpenWeatherMap website and sign up for a free account. After signing up, you will receive an email to verify your account.
- Get your API key: Once your account is verified, log in to your account. Navigate to the 'API keys' tab. Here, you will find your API key. Remember to keep this key secure, as it is unique to your account.
- Understand the API documentation: Each API has its own set of rules defined in its documentation. The documentation for OpenWeatherMap can be found on their website. It includes information about the available endpoints, how to make requests, and the structure of the responses.

## Integrating the API Key into Your Swift Application

Now that you have your API key, you can integrate it into your Swift application. Here's how:

- Create a new Swift file: In your Xcode project, create a new Swift file. You can name it API.swift.
- Define your API key and base URL: In the API.swift file, define two constants - one for your API key and one for the base URL of the API. The base URL is the main part of the API endpoint, without the specific parameters. For OpenWeatherMap, the base URL is `http://api.openweathermap.org/data/2.5/`.
```swift
let apiKey = "your_api_key"
let baseURL = "http://api.openweathermap.org/data/2.5/"
```
Remember to replace "your_api_key" with your actual API key.

By the end of this unit, you should have a good understanding of how to set up a free weather API and integrate it into your Swift application. In the next unit, we will learn how to make API calls to fetch weather data.
Introduction to Weather APIs
Tags: swift
Published: 2023-08-25 01:35:15

APIs, or Application Programming Interfaces, are a set of rules and protocols for building and interacting with software applications. They define the methods and data formats that a program can use to communicate with other software or components. In the context of weather applications, Weather APIs are a crucial component that allows the application to fetch real-time weather data from various sources.

## Understanding APIs

At its most basic level, an API is a contract between two software applications, stating, "If you give me this input, I will return this output." APIs are used everywhere in software development. They allow different software systems to communicate and share data with each other, regardless of how each system is built.

## The Role of Weather APIs

Weather APIs play a crucial role in weather applications. They provide the application with access to a vast amount of weather data, including current weather conditions, forecasts, historical weather data, and more. This data is typically sourced from various meteorological sources around the world and is updated in real-time.

## Overview of Different Weather APIs

There are numerous Weather APIs available today, each offering different features, data types, and levels of detail. Some of the most popular ones include:

- OpenWeatherMap: Offers a wide range of weather data, including current weather, forecasts, and historical data. It also provides various other data, such as UV index, air pollution levels, and more.
- Weatherstack: Provides real-time weather data, forecasts, and historical weather data for any location in the world. It also offers additional features like weather maps and severe weather alerts.
- Weatherbit: Offers a comprehensive range of weather data, including current conditions, forecasts, historical data, and more. It also provides other meteorological data, such as soil data, air quality, and weather maps.
## Choosing the Right Weather API

Choosing the right Weather API for your application depends on several factors, including:

- Data Requirements: What type of weather data do you need? Do you need forecasts, historical data, or other types of data?
- Coverage: Does the API provide data for the locations you're interested in?
- Update Frequency: How often is the data updated? Real-time weather applications typically require data that is updated frequently.
- Cost: Many Weather APIs offer free tiers, but these often come with limitations, such as a limited number of API calls per day. If your application requires a high volume of API calls or additional features, you may need to consider a paid plan.

In the next unit, we will guide you on how to set up a free weather API and integrate it into your Swift application.
I created a brute-force tool, learn concurrency programming.
Tags: java, programming, concurrency, beginners
Published: 2023-08-25 01:00:19


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

Parcel is a brute-force tool, which can be very easily configured for different purposes. Currently, it confirmed as IMAP mail brute-force tool.
This project uses concurrent architecture, with synchronization on common resources. Also, it can save results into text files.
All control logic is very generic and needs no change, when you want to configure this software for your own automation purposes.
This project can be used only in educational purposes, on your own accounts! The author is not responsible for your dangerous actions.

https://github.com/Rudolf-Barbu/Parcel/
How to create a desktop entry in linux?
Tags: linux, desktop, application
Published: 2023-08-25 00:27:21

If you use Linux, you might often find yourself using the terminal to run programs and scripts for your daily tasks. But it can be a bit of a hassle. Luckily, there's a alternative – creating something called a "Desktop Entry." A desktop entry lets you start programs from your start menu with just a few clicks. All you have to do is follow these simple steps, and you're good to go:

To start with creating Desktop Entry for a program , you have to mess up with terminal for a while.

> All the desktop entries have `.desktop` as extension.

### Create a new .desktop file
- Open your terminal or press `Ctrl+Alt+T` 
- Create a new desktop file using a text editor. You can use `nano` or `vim` or any text editor you like.
- The syntax of the command should be something like this :
```
vim application_name.desktop
```

### Define Entry Properties
- `[Desktop Entry]` - Every desktop entry starts with this keyword.
- `Name` : Name of the application.
- `Exec` : Path of the executable file.
- `Type` : Set it to `application`
- `Icon` : Path of the application logo.

### Add optional information
- `Comment` : A brief description of the application.
- `Categories` : Categories that describe the application(e.g., **Development**, **Office**)
- `Terminal` : Set it to `false` if the application doesn't require terminal.
- `StartupNotify` : Set it to `true` to show a notification when the application starts.

### Set permissions
- Make the `.desktop` file executable using the `chmod` command: 
```
chmod +x application_name.desktop
```

### Move the file
- **For system-wide access** : Move the file from current directory to `/usr/share/applications`
- **For user-specific access** : Move the file from current directy to `~/.local/share/applications`

### Refresh Desktop Environment
- If needed, refresh the desktop environment.
 Typically the command to refresh desktop is : 
```
sudo update-desktop-database
``` 

Finally, your `application_name.desktop` would look like this:
![Desktop Entry Properties](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nhcirbal53mzfkfbnonu.png)
And there you have it! By following these steps, you'll have your very own application shortcut in the start menu using the magic of .desktop files.
Oracle PIVOT Command - Turn Rows into Columns
Published: 2023-08-25 00:21:39

Discover the technical prowess of Oracle's PIVOT command, a robust feature that efficiently converts rows into columns.

This blog post delves into the syntax, use cases, and practical examples to illustrate how PIVOT simplifies data analysis and reporting in Oracle databases.

## Understanding the PIVOT Command

The PIVOT command is an extension of the SQL SELECT statement in Oracle. It lets you rotate rows into columns, effectively transposing data to achieve a more structured and readable output.

The PIVOT command works by aggregating data based on specified criteria and then rotating the unique values from one column into multiple columns.

```sql
SELECT *
FROM 
(
   SELECT column1, column2, column3
   FROM your_table_name
)
PIVOT
(
   aggregate_function (column_to_aggregate)
   FOR pivot_column
   IN (list_of_values)
)
```

- `aggregate_function`: This is the SQL aggregate function used to summarize the data. Commonly used functions include _SUM_, _COUNT_, _AVG_, _MAX_, _MIN_, etc.
- `column_to_aggregate`: The column whose values will be aggregated based on the specified aggregate function.
- `pivot_column`: The column containing unique values will be rotated into new column headers.
- `list_of_values`: A list of distinct values from the **pivot\_column** that you want to become new columns.

### Use Case Scenario

Assume we have a table called "PRODUCTS" with the following structure.

```sql
SELECT * FROM PRODUCTS;

DATE       PRODUCT     SALES_QUANTITY
---------- ----------- ----------------
2023-07-01 Keyboard    10
2023-07-01 Mouse       15
2023-07-02 Keyboard    8
2023-07-02 Mouse       12
```

_Table PRODUCTS_

We can use the Oracle **PIVOT** command to pivot this data and obtain a summary of sales quantities for each product on different columns:

```sql
SELECT *
FROM 
(
    SELECT DATE, PRODUCT, SALES_QUANTITY
    FROM PRODUCTS
)
PIVOT
(
    SUM (SALES_QUANTITY)
    FOR Product
    IN ('Keyboard', 'Mouse')
);

```

_SQL with PIVOT_

In this example, the PIVOT command will transform the original data, displaying the sales quantities of each product as separate columns.

```sql
SELECT * FROM PRODUCTS;

DATE       Keyboard    Mouse
---------- ----------- ----------------
2023-07-01 10          15
2023-07-02 8           12
```

Now, you have a more structured and readable output, making it easier to analyze and interpret the sales quantities for each product on different dates.

The Oracle PIVOT command simplifies this data transformation process, enhancing the efficiency of your data analysis and reporting tasks.

## Conclusion

The Oracle **PIVOT** command is a powerful tool for data transformation, simplifying the process of converting rows into columns in a query result.

So, next time you find yourself facing the challenge of transposing data, consider harnessing the power of Oracle's PIVOT command to make your work more efficient and effective.
Content & Tooling Team Status Update
Tags: puppet, community
Published: 2023-08-31 20:27:59

---
title: Content & Tooling Team Status Update
published: true
date: 2023-08-25 00:00:00 UTC
tags: puppet, community
canonical_url: https://puppetlabs.github.io/content-and-tooling-team/blog/updates/2023-08-25-status-update/
---

## Hello Again!!

As the sun sets on another week of collaboration and innovation, We would like to extend a warm welcome to this Friday’s update. Our shared journey continues to be one of remarkable growth and progress, and it is my privilege to share some noteworthy contributions and developments that have illuminated our path. Specific to the Belfast Office, this Monday is a bank holiday so if you ping us you shouldn’t expect a response until the Tuesday.

### Modules

In alignment with our enduring dedication to furnishing robust and all-encompassing solutions, we are delighted to unveil a substantial augmentation to our [puppetlabs-apache](https://github.com/puppetlabs/puppetlabs-apache) module. We are elated to introduce support for the log\_forensic module, an inclusion that holds the potential to heighten the security and auditing proficiencies of our infrastructure. This module facilitates the implementation of forensic logging for the client requests directed to server.

We are pleased to announce that our efforts to enhance the [puppetlabs-apache](https://github.com/puppetlabs/puppetlabs-apache) module have resulted in the successful addition of support for configuring ciphers along with their respective SSL protocols. This crucial update enables us to precisely define SSLCipherSuite configurations within the module, fostering a more secure and tailored approach to our encryption settings.

### ERB to EPP Migration Progress:

As we approach the final phase of this transition, The contributions of team members have been instrumental in bringing us closer to a more streamlined and optimized template system. We have started observing the positive impact that EPP templates bring in terms of readability, maintainability, and template management efficiency.

### Firewall

The Firewall [pr](https://github.com/puppetlabs/puppetlabs-firewall/pull/1145) is finally done and is up and accepting reviews! Anyone who has some free time feel free to come and have a look. The current plan is to have it merged and released out by next week and you can expect a more detailed blog post about the various changes made within it around that same time.

## Tooling

Nothing much to say this week. While we have gotten a lot done in the background there is not much ready for us to announce.

### Puppet.DSc

One thing to note is that there has been a recent change to our [Puppet.Dsc](https://github.com/puppetlabs/Puppet.Dsc) generated modules. As part of a recent discussion they have been downgraded from the supported badge, to the approved one. This has been done mainly to highlight the fact that the generated modules are merely wrappers for existing Dsc coe and as such issues that come up regarding them are most often on the dsc side and as such not something we can fix ourselves.
Why I chose grid over flex
Published: 2023-08-24 23:55:46

Grid doesn't have plenty properties which make it simple to understand compare to flex with plenty properties and values main this guy is too complicated and confusing at times
My grid is very straight forward, just understand column and rows your free to go
The grid columns and rows gap is my joy giver o my God you won't understand the joy I get when ever I get this gap on my sections compare to flex justify-content property with center, start, end etc values.
I can't end this content without my fraction values in grid, this value is my best value in all grid value. When you give your grid-row-template property 1fr 2fr... you will just see your imagination right in your front you. What do you have to say about grid?
ESLint-config-sheriff reaches version 14.4.0!
Published: 2023-08-24 23:24:04

Hey devs!

I'm thrilled to announce the release of `eslint-config-sheriff` version 14.4.0!
What’s so special about it, I hear you ask? 
This release mark a major milestone for the Sheriff project.
The whole codebase was transitioned in a monorepo and the docs were remade from the ground-up.
Curios about the new changes? Check out the blogpost here: https://www.eslint-config-sheriff.dev/blog/sheriff-reboot.

## What’s Sheriff? A little bit of history

Sheriff is a comprehensive and highly opinionated Typescript-first ESLint configuration.
The project started 1 year ago, back in October 2022, emerging from personal needs to have a stable ESLint configuration across all my personal and job-related projects. I was quickly amazed by the immediate community support that it gathered, and it keeps growing!

I truly see Sheriff as a community effort, because it wouldn’t be possible without the efforts of the people that work everyday on ESLint and all the community-maintained ESLint projects out there. 

You can learn everything about the project in the brand-new docs, here https://www.eslint-config-sheriff.dev.

## Back to the present

Starting from the next major release in v9.0.0, ESLint will officially move to the FlatConfig by default and the eslintrc configs will be fully deprecated.
If you're looking for a quick and easy way to transition to FlatConfig without a hassle, Sheriff has got your back, for all you busy devs out there that don’t have the time to tinker with ESLint configs allday.

Give it a try!

If you want to support the project consider leaving a star or contributing to the project!