teleren/devto huggingface dataset:
PHP 8.0, 8.1, 8.2, 8.3... what's new?! CheatSheet.
Tags: php
Published: 2024-04-18 19:49:32

The idea of this note is to write down PHP 8+ what's news briefly, so they are visible all at once on a single page. Like a **cheat-sheet**.

Keep in mind that these are just the basic features, see each version's link for more details.

[PHP 8.0 What's new](https://www.php.net/releases/8.0/en.php)
- **Named function arguments** (i.e. `arg_name: value`, instead of filling preceding default arguments)
- **Attributes** (instead of DocBlock comments)
- **Constructor property promotion** (properties in constructor instead of normal declaration)
- **Union types** (i.e. `int|string $varname`)
- **Match expression** (to replace some of `switch-case`)
- **Nullsafe operator** (instead of nesteds ifs)
- **Saner string to number comparisons** (i.e. `0 == 'somestrval' // not true anymore`)
- **Consistent type errors for internal functions** (internal functions throws typed exceptions now)
- **Just-In-Time compilation** (2x performance in some specific long-running applications)
- and [more](https://www.php.net/releases/8.0/en.php#consistent-type-errors-for-internal-functions)

[PHP 8.1 What's new](https://www.php.net/releases/8.1/en.php)
- **Enumerations** (enums)
- **Readonly Properties** (for VO and DTO)
- **First-class Callable Syntax** (to get a reference to any function, i.e. `$fn = strlen(...);`)
- **New in initializers** (for nested attributes)
- **Pure Intersection Types** (`Iterator&Countable $value` but not `A&B|C`)
- **Never return type** (to be clear that function returns nothing)
- **Final class constants** (cannot override functions and inherit classes)
- **Explicit Octal numeral notation** `// TODO: add some description below`
- **Fibers**
- **Array unpacking support for string-keyed arrays**
- and [more](https://www.php.net/releases/8.1/en.php#performance_improvements)

[PHP 8.2 What's new](https://www.php.net/releases/8.2/en.php)
- **Readonly classes**
- **Disjunctive Normal Form (DNF) Types**
- **Allow `null`, `false`, and `true` as stand-alone types**
- **New "Random" extension**
- **Constants in traits**
- **Deprecate dynamic properties**
- and [more](https://www.php.net/releases/8.2/en.php#other_new_things)

[PHP 8.3. What's new](https://www.php.net/releases/8.3/en.php)
- **Typed class constants**
- **Dynamic class constant fetch**
- **New `#[\Override]` attribute**
- **Deep-cloning of readonly properties**
- **New `json_validate()` function**
- **New `Randomizer::getBytesFromString()` method**
- **New `Randomizer::getFloat()` and `Randomizer::nextFloat()` methods**
- **Command line linter supports multiple files**
- and [more](https://www.php.net/releases/8.3/en.php#other_new_things)
Goffin Cockatoo Information
Tags: birds, parrot
Published: 2024-04-18 19:40:46

In the realm of avian wonders, few creatures captivate the heart and mind quite like the Goffin Cockatoo. With its charming disposition, inquisitive nature, and remarkable intelligence, this feathered marvel has earned a special place in the hearts of bird enthusiasts worldwide. Join us as we embark on a journey to explore the fascinating world of the Goffin Cockatoo, delving into its unique characteristics, behaviors, and the joys of sharing life with such a delightful companion.

A Portrait of Elegance:
Named after the Austrian naturalist Johann Friedrich Goffin, the Goffin Cockatoo (Cacatua goffiniana) is a small to medium-sized parrot native to the Tanimbar Islands in Indonesia. Adorned with a soft, salmon-pink crest atop its head and snowy white feathers that exude elegance, this cockatoo is a vision of beauty in motion. Its expressive eyes radiate intelligence and curiosity, hinting at the vibrant personality that lies within.

Intelligence Unveiled:
One of the most remarkable traits of the Goffin Cockatoo is its exceptional intelligence. Renowned for their problem-solving abilities and aptitude for learning, these birds possess a keen intellect that rivals some of the most intelligent animal species on the planet. Whether it's mastering complex tasks, solving puzzles, or learning to mimic human speech, Goffin Cockatoos never cease to amaze with their cognitive prowess. Their insatiable curiosity drives them to explore their surroundings, eagerly engaging in activities that stimulate their minds and satisfy their intellectual cravings.

Charm and Personality:
Beyond their intelligence, [Goffin Cockatoos for sale](https://avianparrotforsale.com/product/goffin-cockatoo-for-sale/) are celebrated for their charming personalities and affectionate demeanor. With proper socialization and care, these birds form deep bonds with their human companions, displaying a level of loyalty and affection that is truly heartwarming. They thrive on attention and interaction, eagerly seeking out opportunities to play, cuddle, and engage in social activities. Their playful antics and endearing quirks add a sense of joy and laughter to any household fortunate enough to welcome one into their midst.

Challenges and Rewards:
While the Goffin Cockatoo's intelligence and personality make it a delightful companion, they also come with their own set of challenges. These birds require a considerable amount of mental stimulation and social interaction to thrive, and their high energy levels can be demanding for inexperienced bird owners. Additionally, their loud vocalizations and potential for destructive behavior when bored or understimulated require patient training and understanding. However, for those willing to invest the time and effort, the rewards of sharing your life with a Goffin Cockatoo are immeasurable.
2 UX tips for self-typing text effect
Tags: ux, frontend
Published: 2024-04-18 19:33:55

---
title: 2 UX tips for self-typing text effect
published: true
description: Two UX tips when implementing self-typing text effect
tags: ux, frontend
cover_image: https://raw.githubusercontent.com/tameemsafi/typewriterjs/HEAD/preview.gif
# Use a ratio of 100:42 for best results.
# published_at: 2024-04-18 19:29 +0000
---
Self-typing text effect in interfaces is mainstream, especially after AI bots are becoming more and more popular... |

However, developers can ignore at least two problems that can degrade the user experience. 

I give these two tips when implementing this effect:

✍️ 1) If it's fake real-time, add the ability to skip the effect. In 99% cases, a text which should be displayed is already loaded in users browsers before showing. Waiting while the effect will finish can be time-consuming and nerve-wracking. A text should be able to be available immediately, if possible.

This can be done by clicking on the text area or on a special button. 

✍️ 2) Not correct auto-translation of such text. Check that a browser translator works correctly, and what code ends up pasted in the HTML? Even ChatGPT can throw an error if you translate the page into a language other than English while printing text.

To solve this problem, you can replace the DOM node after all the text has been shown. Or better customize your tool and printing technique for each character and text.

I solved these problems on my site. You can take a look (actual on April 2024). https://artemshar.space

As for tools, I think there are many ready-made solutions, but I used the https://www.npmjs.com/package/typewriter-effect, which is good and deserves a star.
Mastering Java Libraries, Packages, and Modules
Tags: java
Published: 2024-04-18 19:29:26

Java is a powerful language that offers a rich ecosystem of libraries, packages, and modules to help developers build efficient and scalable applications. Understanding how to leverage these components is essential for any Java developer.

#Java Libraries
A Java library is a collection of precompiled classes and interfaces that provide a foundation for developing Java applications. Libraries can include everything from data structure implementations to utility functions for handling common tasks.

**Example: Apache Commons IO**
![Apache Commons IO](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30ahsihakf1y7ur1chrs.png)

#Java Packages
Packages in Java are used to group related classes and interfaces together. This organization helps in maintaining a clean namespace and avoiding name conflicts.
**Example: Creating a Custom Package**
![Creating a Custom Package](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mesnexc042huvadgxun2.png)

#Java Modules
Introduced in Java 9, the module system provides a higher level of encapsulation and dependencies management. A module is a self-describing collection of code and data.
**Example: Defining a Module**
![Defining a Module](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrwpyb5b6a6fjnvpxhpg.png)

#Best Practices

- Use libraries to avoid reinventing the wheel.
- Organize your code into packages for better maintainability.
- Adopt modules to manage dependencies and ensure strong encapsulation.

#Conclusion
By effectively using libraries, packages, and modules, Java developers can create modular, maintainable, and efficient applications. As you continue to explore Java, keep these tools in mind to enhance your development process.

---

This article is just a starting point. For a deeper dive into Java’s capabilities, consider exploring “The Java Workshop” book for more insights and practical examples.
Why do modern projects prefer Microservices architecture?
Tags: developer, learning, beginners, dotnet
Published: 2024-04-18 19:11:29

In the recent years we have seen more companies and developers recommending microservices architecture for development. So in this article lets look into the reasons for this. Before we dive into the applications and advantages of microservices lets get to know what is microservices
## **What is microservices?**

Microservices is an architectural development approach in which a large application can be broken down into small services, and each of these services is able to function independently and can be deployed and scaled individually. These functions communicate with each other using methods like HTTP, message bus, or [gRPC](https://grpc.io/). Each microservice will also have its own database, which would enhance the [loose coupling](https://www.techtarget.com/searchnetworking/definition/loose-coupling) of these services.
## **Advantages of Microservices.**

1. **Scalability :** The microservices can be added, removed, updated and scaled anytime according to the needs of the user since each service runs independently.
2. **Technology Flexibility :** It gives the user the freedom to choose any programming language or platform for each of the services. This also helps the developers to choose the technology stack that would enhance their specific business needs.
3. **Managing Teams :** Each microservice can be divided among different teams, and each team has the opportunity to build the service without any dependency issues. This boosts team collaboration, agile development, and results in faster implementation of projects.
4. **Faster Deployments :** Microservices architecture eliminates the need to build the entire project before deployment because you only need to build the microservice where you had a change which results in faster deployments and releases.
5. **Easy to Understand :** The codebase is structured in a way that facilitates ease of understanding for any individual working on a specific module, thus reducing burden of understanding the entire project.
6. **Fault Isolation :** Large applications can continue to function smoothly with microservices even in the event of a failure in a module, due to its low coupling with other services.

![Differences between microservices architecture and monolithic architecture ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jb49sbobb2otnt4kxb8r.jpg)
## Over to you

As you have read, microservices is one of the most powerful development architectures that you must follow in order to enhance the quality, security, scalability, and efficiency of your product. Microservices are currently used by popular tech firms like Netflix, Amazon, and Oracle. But even with all these wide range of advantages that microservices possess over the traditional architecture models, it is always wiser to choose an architecture based on the business requirements of your project.

So, that's all, guys!😉

Be productive and continue learning!💪
To develop custom plugins
Tags: cozechallenge, devchallenge, ai, machinelearning
Published: 2024-04-18 19:10:39

# Import necessary libraries
from coze import Plugin

# Define the custom plugin class
class WelcomePlugin(Plugin):
    def __init__(self, welcome_message):
        self.welcome_message = welcome_message

    def execute(self, user_id):
        # Logic to send the welcome message to the user
        send_welcome_message(user_id, self.welcome_message)
        return {"status": "success", "message": "Welcome message sent"}

# Function to send the welcome message
def send_welcome_message(user_id, message):
    # Assuming there's a function to get user details
    user_details = get_user_details(user_id)
    # Assuming there's a function to send a message
    send_message(user_details['contact_info'], message)

# Example usage
if __name__ == "__main__":
    # Create an instance of the plugin with a custom welcome message
    welcome_plugin = WelcomePlugin("Welcome to Coze Trailblazer!")
    # Execute the plugin for a specific user
    result = welcome_plugin.execute(user_id="12345")
    print(result)
Set cron job in cpanel
Tags: webdev, programming, beginners, tutorial
Published: 2024-04-18 18:44:37

Setting up a cron job in cPanel is relatively straightforward. Here's a step-by-step guide:

[How to set a cron job by using the terminal in Ubuntu Server](https://dgihost.com/index.php/2024/04/18/how-to-set-a-cron-job-by-using-the-terminal-in-ubuntu-server/)

**Log in to cPanel:**
Go to your cPanel dashboard. You should have received login credentials from your hosting provider.

**Locate the Cron Jobs Icon:**
In cPanel, search for the "Cron Jobs" icon. It's usually located in the "Advanced" or "Metrics" section, depending on your cPanel theme.

**Access the Cron Jobs Page:**
Click on the "Cron Jobs" icon to access the Cron Jobs page.

**Choose Cron Job Settings:**
On the Cron Jobs page, you'll see options to set up cron jobs. You can select from common settings like "Common Settings," "Minute," "Hour," "Day," "Month," and "Weekday."

**Enter the Command:**
In the "Command" field, enter the command you want the cron job to execute. This could be a PHP script, a shell script, or any other executable command. Make sure the command is correct and complete.

**Set the Schedule:**
Choose the schedule for your cron job using the "Common Settings" or specify the exact timing using the "Minute," "Hour," "Day," "Month," and "Weekday" fields.

**Save the Cron Job:**
Once you've entered the command and set the schedule, click on the "Add New Cron Job" or "Add Cron Job" button to save your cron job.

**Verify the Cron Job:**
After saving, you should see a confirmation message indicating that the cron job has been added successfully. You may also see a list of existing cron jobs on the Cron Jobs page.

**Test the Cron Job:**
It's a good practice to test your cron job to ensure it's working as expected. You can do this by running the command manually or waiting for the scheduled time to see if it executes.

**Monitor and Manage Cron Jobs:**
You can monitor and manage your cron jobs from the Cron Jobs page in cPanel. Here, you can edit, delete, or disable cron jobs as needed.

[How to send a token with every request using HTTP headers?](https://dgihost.com/index.php/2024/04/17/how-to-send-a-token-with-every-request-using-http-headers/)

[Which encryption is used to secure the token key?](https://dgihost.com/index.php/2024/04/17/which-encryption-is-used-to-secure-the-token-key/)

[How to set a cron job by using the terminal in Ubuntu Server](https://dgihost.com/index.php/2024/04/18/how-to-set-a-cron-job-by-using-the-terminal-in-ubuntu-server/)

That's it! You've successfully set up a cron job in cPanel. Make sure to regularly review and update your cron jobs as necessary.

Thanks for reading,
Dgi Host.com
Consejos para escribir la mejor carta de agradecimiento por una donación
Published: 2024-04-18 18:34:09

La creación de [cartas de agradecimiento atractivas por donaciones](https://whydonate.com/es/blog/carta-de-agradecimiento-por-donacion/) es crucial para fomentar relaciones con los donantes y asegurar un apoyo continuo. Comienza expresando sinceramente gratitud por la contribución y resaltando su impacto en tu causa. Personaliza cada mensaje para que los donantes se sientan valorados y apreciados. Mantén la carta concisa y clara, evitando promociones innecesarias o solicitudes de donaciones adicionales. Reconoce la importancia de los donantes recurrentes o patrocinadores ofreciendo agradecimientos especiales. Utiliza plantillas personalizables para agilizar el proceso manteniendo un toque personal. Recuerda enviar los recibos de impuestos por separado para mantener un tono cálido en tus cartas de agradecimiento. Siguiendo estos pasos, puedes transmitir eficazmente aprecio y cultivar conexiones duraderas con tus donantes, fomentando un apoyo continuo para tu causa.

Referencia: https://whydonate.com/es/blog/carta-de-agradecimiento-por-donacion/
463. Island Perimeter
Tags: leetcode, php, programming, algorithms
Published: 2024-04-18 18:22:02

463\. Island Perimeter

Easy

You are given `row x col` `grid` representing a map where `grid[i][j] = 1` represents land and `grid[i][j] = 0` represents water.

Grid cells are connected **horizontally/vertically** (not diagonally). The `grid` is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).

The island doesn't have "lakes", meaning the water inside isn't connected to the water around the island. One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.

**Example 1:**

![island](https://assets.leetcode.com/uploads/2018/10/12/island.png)

- **Input:** grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]]
- **Output:** 16
- **Explanation:** The perimeter is the 16 yellow stripes in the image above.

**Example 2:**

- **Input:** grid = [[1]]
- **Output:** 4

**Example 3:**

- **Input:** grid = [[1,0]]
- **Output:** 4

**Constraints:**

- `row == grid.length`
- `col == grid[i].length`
- `1 <= row, col <= 100`
- `grid[i][j]` is `0` or `1`.
- There is exactly one island in `grid`.

```
class Solution {

    /**
     * @param Integer[][] $grid
     * @return Integer
     */
    function islandPerimeter(array $grid): float|int
    {
        $m = count($grid);
        $n = count($grid[0]);

        $islands = 0;
        $neighbors = 0;

        for ($i = 0; $i < $m; $i++) {
            for ($j = 0; $j < $n; $j++) {
                if ($grid[$i][$j] == 1) {
                    $islands += 1;
                    if ($i + 1 < $m && $grid[$i + 1][$j] == 1) {
                        $neighbors += 1;
                    }
                    if ($j + 1 < $n && $grid[$i][$j + 1] == 1) {
                        $neighbors += 1;
                    }
                }
            }
        }

        return $islands * 4 - $neighbors * 2;
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
Day 18/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-04-18 18:02:43

🚀 **Today's Learning:**

🌟 DSA

- Insert Interval
- Merge Intervals

🌟 Dev

- Different Package managers

🔍 **Some Key Highlights:**

DSA

For the "Insert Interval" algorithm, we start by iterating through the intervals and adding them to a result list until we find the correct position to insert the new interval. Once we find the correct position, we merge the new interval with overlapping intervals if any, and add the merged interval to the result list. Finally, we add any remaining intervals after the inserted one, if there are any.

Now, for "Merge Intervals", we first sort the intervals based on their start values. Then, we initialize a merged list with the first interval. We iterate through the sorted intervals, and if the current interval overlaps with the last interval in the merged list, we merge them by updating the end value of the last interval in the merged list. If there's no overlap, we add the current interval to the merged list. This process ensures that we merge all overlapping intervals efficiently.

DEV

Node.js and Yarn are both package managers commonly used in JavaScript development. Node.js, being a runtime environment for executing JavaScript code, comes bundled with npm (Node Package Manager) which allows developers to install and manage packages. npm maintains a centralized repository of JavaScript packages, making it easy to share and reuse code. Yarn, on the other hand, was developed by Facebook to address some of the shortcomings of npm, such as performance and reliability. Yarn uses the same registry as npm but employs a different algorithm for dependency resolution, resulting in faster and more deterministic installs. Yarn also introduces features like parallel package downloads and offline caching, enhancing the overall development experience. Despite their differences, both Node.js/npm and Yarn serve the same purpose of simplifying package management in JavaScript projects, offering developers flexibility in choosing the tool that best fits their workflow and requirements.

 #100daysofcode #1percentplusplus #coding #dsa
SwiftUI WhatsApp Clone
Tags: ios, swift, swiftui, tutorial
Published: 2024-04-18 17:48:23

Hello iOS community, I started a new tutorial series where we will be building a WhatsApp clone using swiftui and firebase. In this tutorial series you'll learn to:
📝 Send text messages
🎙️ Record and send voice messages
🖼️ Send image messages
🎥 Send video messages
😊 Express yourself with emoji icons
🔓 Sign in and Sign out effortlessly
🔄 Update your profile with ease
...and a lot more!
Playlist link: https://www.youtube.com/playlist?list=PLZLIINdhhNsdNKi1Gnrg36bodvJFJFj-7
Hope you enjoy it.
CRİSP-DM
Published: 2024-04-18 11:01:43

CRISP-DM, yani Cross-Industry Standard Process for Data Mining, veri madenciliği projelerini yönetmek için kullanılan bir metodolojidir. Endüstri genelinde geniş çapta kabul görmüş bir standart olan CRISP-DM, bir proje boyunca izlenmesi gereken aşamaları tanımlar ve her aşamanın neyi içermesi gerektiğine dair önerilerde bulunur.

CRISP-DM metodolojisi altı ana aşamadan oluşur:

**İş Anlayışı (Business Understanding):** Bu aşama, projenin hedeflerini ve gereksinimlerini belirlemeyi içerir. İş problemlerinin tanımlanması, hedeflerin belirlenmesi ve bir proje planının oluşturulması bu aşamada gerçekleştirilir.

**Veri Anlayışı (Data Understanding):** Bu aşama, kullanılacak verinin toplanması ve anlaşılmasını içerir. Verinin yapısı, kalitesi ve içeriği hakkında bilgi edinilir. Veri keşfi ve verinin ilk incelemesi bu aşamada yapılır.

**Veri Hazırlığı (Data Preparation):** Bu aşama, modelleme için verinin hazırlanmasını içerir. Veri temizleme, dönüştürme ve entegrasyonu gibi işlemler bu aşamada gerçekleştirilir.

**Modelleme (Modeling):** Bu aşama, çeşitli modelleme tekniklerinin seçilmesini ve uygulanmasını içerir. Ayrıca, parametre ayarları gibi teknik gereksinimler de bu aşamada belirlenir.

**Değerlendirme (Evaluation):** Bu aşama, oluşturulan modelin veya modellerin değerlendirilmesini içerir. Modelin iş hedeflerine ne kadar iyi ulaştığı ve beklenen sonuçları ne kadar iyi tahmin ettiği bu aşamada incelenir.

**Dağıtım (Deployment):** Bu aşama, modelin iş süreçlerine entegre edilmesini ve sonuçların ilgili paydaşlara sunulmasını içerir.

CRISP-DM, genellikle döngüsel bir süreç olarak düşünülür. Yani, bir projenin sonunda genellikle yeni iş veya veri anlayışı elde edilir ve bu da yeni hedeflere veya daha fazla analize yol açabilir. Bu nedenle, bir proje genellikle bir kez tamamlandığında bile CRISP-DM döngüsüne geri döner.