teleren/devto huggingface dataset:
12章35
Published: 2024-04-23 07:45:01

このJavaコードでは、クラス`A`と`B`があり、`B`は`A`を継承しています。それぞれのクラスに`print()`という同名のメソッドがありますが、これらのメソッドは`private`で宣言されているため、オーバーライドされません。その代わり、各クラスは自身の`print()`メソッドを持っており、外部から直接アクセスすることはできません。

クラス`A`の`public void a()`メソッドは、`A`の`print()`メソッドを呼び出して`"A"`を出力します。一方、クラス`B`の`public void b()`メソッドは`B`の`print()`メソッドを呼び出して`"B"`を出力します。

メインメソッドでは、`B`のオブジェクトを生成して、`b.a()`と`b.b()`を呼び出しています。`b.a()`が呼ばれると、オブジェクト`b`の型（`B`）にかかわらず、`A`の`a()`メソッドが呼び出され、`A`の`print()`メソッドが呼ばれ`"A"`が出力されます。`b.b()`が呼ばれると、`B`の`b()`メソッドが呼ばれ、`B`の`print()`メソッドが呼ばれ`"B"`が出力されます。

したがって、メインメソッドが実行されると、まず`"A"`が出力され、次に`"B"`が出力されます。これが答えAが正しい理由です。

コメントを加えたコードを書き出して説明します：

```java
public class A {
    private void print() { // Aクラスのprintメソッドはprivateなので、Aクラス内からのみアクセス可能
        System.out.println("A"); // "A"を出力する
    }
    public void a() { // Aクラスのpublicメソッドaは、クラス外からもアクセス可能
        print(); // Aクラスのprintメソッドを呼び出し、"A"を出力する
    }
}

public class B extends A {
    private void print() { // BクラスのprintメソッドはAのメソッドをオーバーライドしていない。Bクラス内からのみアクセス可能。
        System.out.println("B"); // "B"を出力する
    }
    public void b() { // Bクラスのpublicメソッドbは、クラス外からもアクセス可能
        print(); // Bクラスのprintメソッドを呼び出し、"B"を出力する
    }
    
    public static void main(String... args) {
        B b = new B(); // Bクラスのインスタンスを作成
        b.a(); // Aクラスのメソッドaを呼び出し、Aクラスのprintメソッドを実行するため"A"が出力される
        b.b(); // Bクラスのメソッドbを呼び出し、Bクラスのprintメソッドを実行するため"B"が出力される
    }
}
```

このように、メインメソッドでは`"A"`が先に出力され、次に`"B"`が出力されるため、答えはAです。

##　追記
AクラスとBクラスをprotectedまたはpublicで装飾するとオーバーライドが成立し、「B」「B」と表示されるようになる
INTRO : Apache Cassandra
Tags: datascience, database, nosql, apachecassandra
Published: 2024-04-23 07:40:50

Introduction:
- **Apache Cassandra Overview:** Positioned as a cornerstone in distributed databases, Apache Cassandra offers robust solutions for high availability, fault tolerance, and scalability.
  
1. **Understanding Apache Cassandra:**
   - **Open-Source & Distributed:** Apache Cassandra is an open-source, distributed database system, known for its decentralized architecture.
   - **Elastic Scalability:** Cassandra's architecture enables it to seamlessly scale across multiple nodes, catering to varying workloads.
   - **Fault Tolerance:** Renowned for its fault tolerance, Cassandra ensures uninterrupted availability even in the face of node failures.

2. **Data Distribution and Replication:**
   - **Decentralized Approach:** Cassandra excels in distributing and replicating data across multiple data center clusters.
   - **Resilience:** This decentralized approach enhances resilience against node failures, ensuring continuous operations.
   - **Performance Enhancement:** Data distribution and replication enhance read and write performance by distributing the load.

3. **Data Organization in Apache Cassandra:**
   - **Table Structure:** Data in Cassandra is organized into tables grouped within keyspaces.
   - **Partitioning:** Each table consists of partitions, with each partition containing multiple rows.
   - **Clustering Key:** The clustering key determines the order of data within a partition, facilitating efficient querying and retrieval.

4. **Dynamic Table Partitions:**
   - **Scalability Feature:** Cassandra dynamically adjusts partition sizes based on the number of entries.
   - **Seamless Workload Handling:** This dynamic scaling feature ensures optimal performance and resource utilization, accommodating varying workloads effectively.

5. **Cassandra Query Language (CQL):**
   - **Primary Interface:** CQL serves as the primary interface for interacting with Apache Cassandra clusters.
   - **SQL-Like Syntax:** Offering a familiar SQL-like syntax, CQL simplifies querying and manipulating data.
   - **Execution Options:** CQL queries can be executed programmatically using licensed Cassandra client drivers or through the Python-based CQL shell client.

Conclusion:
- **Empowering Development:** Mastering Apache Cassandra enables developers to build robust, scalable, and fault-tolerant applications.
- **Understanding Key Aspects:** Knowledge of distributed architecture, data organization principles, and CQL empowers developers to leverage Cassandra's full potential.
- **Meeting Evolving Needs:** By harnessing Apache Cassandra effectively, developers can address the dynamic requirements of modern applications in today's demanding digital landscape.
AI-based document Summarization
Tags: webdev
Published: 2024-04-23 07:38:17

Hey Devs 👋

Do you know? 

Document summarization is one of the top ways companies use AI for documents, reports, emails, and other content daily. Unlike manual summarization, which is time-consuming and resource-intensive, AI-powered document summarization can help save time and resources - [Source](https://blog.box.com/ai-summarization-definition-and-best-practices)

Are you building an application that requires functionality to summarize documents using AI?  You can try ApyHub's AI Summaze Documents API can help applications quickly scan through lengthy documents (PDF, DOC, and ODF) to extract the key points and provide a summary in the required length.

Try out the ApyHub API here: https://apyhub.com/utility/ai-summarize-documents
Let's talk about EPIC and USER STORIES
Published: 2024-04-23 07:35:17

In Agile methodology, epics and user stories are both tools used to manage and prioritize requirements, but they serve different purposes and levels of granularity:

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

1. **Epic**:
   - An epic is a large, high-level requirement or feature that typically cannot be completed within a single iteration or sprint. It represents a significant chunk of work that may need to be broken down into smaller, more manageable user stories.
   - Epics provide a way to capture and track large-scale initiatives or goals for the product. They are often used for long-term planning and roadmap development.
   - Epics are usually defined at the beginning of a project or during the early stages of product planning. They help stakeholders understand the scope and direction of the project without getting into detailed implementation specifics.
   - Examples of epics might include "User Authentication System," "Enhanced Reporting Module," or "Mobile App Integration."

2. **User Story**:
   - A user story is a small, concise description of a specific piece of functionality or requirement from an end user's perspective. It represents a single unit of work that can be completed within one iteration or sprint.
   - User stories typically follow a specific format, often referred to as the "As a [user role], I want [goal], so that [reason/benefit]." This format helps ensure that user stories are focused on delivering value to the end user.
   - User stories are used to capture detailed requirements and functionality, allowing Agile teams to prioritize and implement features incrementally based on user needs and feedback.
   - User stories are usually written collaboratively by the development team and stakeholders, often during backlog grooming or sprint planning sessions.
   - Examples of user stories might include "As a registered user, I want to reset my password so that I can regain access to my account" or "As an admin user, I want to generate monthly reports so that I can track project progress."

In summary, epics represent large-scale initiatives or features at a high level, while user stories are smaller, more detailed requirements that can be implemented within a single iteration. Epics help provide context and direction for the project, while user stories enable Agile teams to deliver incremental value to users in a focused and iterative manner.
How to Replay any request in Chrome 📤 🔄 📤
Tags: webdev, javascript, programming, tutorial
Published: 2024-04-23 07:27:35

Have you ever wanted to quickly modify a browser request and resend it?

If you haven't, here are some reasons why you might want to eventually! It's important to keep trying new things and adding more tools to your tool belt.

1. **Debugging and Testing**: This can include altering headers, query parameters, or body content to see how changes affect the response.
2. **Security Testing**: Penetration testers use manual modification of requests to test for vulnerabilities such as SQL injection, XSS (Cross-Site Scripting), and access control issues.
3. **API Interaction**: When working with APIs, you might manually modify requests to test API endpoints for correct responses and error handling.
4. **Educational Purposes**: Learning how web technologies work often involves manually altering requests to better understand HTTP protocols, client-server interactions, and web application behaviors.

Firefox has always made this super simple. You can just right-click on any request and either resend it, or modify and resend it. 

![Resending a request in firefox](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6yq5uwzer46vb5sw8in.png)


With Chrome it's a bit more work. Here is a quick demo to showcase what I mean, before I go through the steps involved.

![Resending a request in the browser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qwvgkz3ke5o7qm26iqo4.gif)

Here are the steps to resend a request in Chrome!

1. Right-click on the request and click copy -> copy as fetch. You could also copy it as a curl request, but you might run into other issues if you try to rerun the request outside of the context of the browser you are currently in.
2. Open your console, on your browser. You might have to type "allow pasting" in order to allow pasting. Before you paste, add an `await ` so that the request is awaited.
3. Hit enter and watch the request happen! If you go back into your Network tab, you will see that the request was successful!

This is how you would resend the exact same request. If you want to edit the request, you would just need to do that between steps 2 and 3! edit the raw fetch request that you had pasted into the console. 

That is essentially it! Just remember to use your new found power for **good**, since you are no longer bound by the restrictions of frontend UI. You can modify request payloads from the browser, to include what you want. This is also why it is super important to verify request payloads on your backend and not your frontend.

Hope this helps and that you've learned something new. Cheers!

Oh and one last shameless plug. If you work in an agile dev team and have meetings for your sprint retrospectives, or planning poker, consider checking out my app [Kollabe](https://kollabe.com)!
"Code for Earth: Uniting Tech & Nature on Earth Day"
Tags: frontendchallenge, devchallenge, css
Published: 2024-04-23 07:27:05

_This is a submission for [Frontend Challenge v24.04.17](https://dev.to/devteam/join-us-for-the-next-frontend-challenge-earth-day-edition-52e4), CSS Art: Earth Day._

## Inspiration

As Earth Day approaches, I'm filled with a renewed sense of inspiration and purpose. Our planet's largest civic event is not just a day on the calendar; it's a powerful reminder of our collective responsibility to protect and cherish the incredible natural world we call home. I'm thrilled to be part of this Frontend Challenge, where we're not only showcasing our technical skills but also celebrating the beauty and importance of Earth Day. Bringing back the CSS Art and Glam Up My Markup prompts adds a creative twist, allowing us to merge our passion for frontend development with our love for the planet. And with the added prize category dedicated to Earth Day, there's even more motivation to craft something truly special – something that not only dazzles the eyes but also speaks to the heart. I can't wait to see the amazing entries that emerge from this challenge, each one a testament to our commitment to making a positive impact on our planet. Let's code with purpose, creativity, and a deep reverence for the Earth we all share.

## Demo 
Preview link --> https://chic-kataifi-30bf4c.netlify.app/
Code --> https://github.com/KarthiKey-Dev/Earth-day-landing-page

## Journey 

Throughout the Earth Day Frontend Challenge, I focused on blending creativity with technical skills while keeping sustainability in mind. I learned how to make my code more efficient and eco-friendly, aiming to create visually impressive designs that raise awareness about environmental issues. I'm proud of how I made my project interactive, encouraging users to get involved and take action. Moving forward, I want to continue using frontend development to inspire positive change, creating simple and impactful experiences that make a difference.
Unveiling React Native 0.74: What's Inside the Latest Release?
Tags: reactnative, bridgelessnewarchitecture, mobile
Published: 2024-04-23 07:26:23


🎉 Big News!

🚀 React Native 0.74 has Arrived with Major Updates!

## Here's what's included:

**Yoga 3.0 Integration:** 

Improved layout engine for more predictable styling.

- Support for `position: static`
- Support for `align-content: space-evenly`
- Improvements to layout correctness
- Yoga’s JavaScript bindings are now distributed as an ES Module
- Fixes several crashes in Java bindings
- Some existing Yoga APIs have been removed

**Default Bridgeless New Architecture:** 
The app should run seamlessly in Bridgeless mode, provided that it was running with the old architecture before, ensuring a streamlined development experience.

**Batched onLayout Updates:** 
Reduced re-renders for smoother performance.

**Yarn 3 as Default Package Manager:** 
Enhanced project management capabilities.

---

## Key Insights: What Developers Need to Know?

1. Introduction of Yoga 3.0 for improved layout rendering.
2. Default adoption of Bridgeless New Architecture for streamlined development.
3. Implementation of batched onLayout updates for smoother performance.
4. Yarn 3 as the default package manager for new projects, enhancing project management capabilities.
5. Minimum Android SDK requirement bumped to version 23 (Android 6.0) for improved compatibility and performance.
6. Removal of deprecated PropTypes, reducing app size and memory overhead.
7. API changes to PushNotificationIOS, preparing for its relocation to a community package.
8. Various other breaking changes and enhancements across platforms.

---

## Key Benefits: What Users Can Expect?

**Enhanced Performance and Stability:** Expect smoother operations and improved reliability in your React Native projects.
**Optimized App Size for Better User Experience:** Users will enjoy faster downloads and more available storage space, resulting in enhanced overall satisfaction.

---

For detailed upgrade instructions and a full list of changes, refer to the official React Native documentation. 
{% embed https://reactnative.dev/blog/2024/04/22/release-0.74 %}

Happy coding!😊👩‍💻👨‍💻
what is BFC?
Published: 2024-04-23 07:25:57

## What is BFC?
BFC (Block Format Context) refers to the formatting context of a block-level element. It defines how elements are laid out and interact with each other within a block structure.

## The characteristic of the BFC
In web design and front-end development, BFC has the following characteristics and effects:

1. In the vertical direction: it is arranged from top to bottom, which is consistent with the arrangement method of the document flow.

2. In the BFC, the margins of two adjacent containers up and down will overlap.

3. The floating elements will be calculated for height by the parent.

4. The area that forms the BFC will not overlap with the floating elements.

## The method to generate BFC

1. Floating Elements: the value of the Floating Elements is not None;

2. Position Elements: the value of the Position Elements is absolute or fixed;

3. Flexible Elements: the value of the Flexible Elements is flex or inline-flex;

4. Overflow Elements: the value of the Overflow Elements is not visible;


## The role of BFC
1. solve the overlapping problem of margin: the BFC is an independent area, and the internal elements and the external elements don't affect each other, turning two elements into BFC elements after, the overlapping problem is solved;

2. solve the collapse problem of margin: set overflow: hidden 
for the parent element;

3. solve the problem of height collapse: when the children are set floating attribute, the parent element will have a height collapse problem, that is, the height of the parent element will become 0. if you want to solve the problem, you should turn the parent elements into a BFC. The common method is to set overflow: hidden for the parent element.
Validation VS Verification
Published: 2024-04-23 07:25:22

Validation and verification are two fundamental processes in quality assurance and quality control, often used in the context of software development, but applicable to various domains. Here's the difference between them:

1. **Verification**:
   - Verification answers the question, "Are we building the product right?"
   - It involves checking whether the software meets the specified requirements and whether it adheres to the standards and guidelines defined for its development.
   - Verification activities include reviews, inspections, walkthroughs, and testing at various stages of the development process.
   - The focus of verification is on ensuring that the software is being developed correctly according to the predetermined specifications and requirements.

2. **Validation**:
   - Validation, on the other hand, addresses the question, "Are we building the right product?"
   - It involves evaluating whether the software fulfills the customer's needs and expectations and whether it solves the intended problem or provides the desired functionality.
   - Validation activities include user acceptance testing (UAT), beta testing, prototyping, and demonstrations to stakeholders.
   - The focus of validation is on ensuring that the software meets the user's actual needs and that it delivers value in the real-world context.

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

In summary, verification is about confirming that the software is being developed correctly according to the defined specifications and standards, while validation is about confirming that the software meets the user's actual needs and expectations and delivers the intended value. Both verification and validation are essential for ensuring the quality and success of a software product.
１２章32
Published: 2024-04-23 07:22:06

抽象クラス`Item`の異なるバージョンが示されており、それぞれのメソッドがどのように宣言されているかが少し異なります。

### 選択肢A
```java
abstract class Item {
  public abstract int calcPrice(Item item); // これは抽象メソッドです。メソッド本体（実装）がなく、サブクラスによって実装されなければなりません。

  public void print(Item item) { /* do something */ } // これは具体的なメソッドです。中括弧の中に実装があり、「何かをする」とコメントされています。
}
```
このクラスでは、`calcPrice` メソッドが抽象メソッドとして宣言されており、サブクラスでのオーバーライド（具体的な実装）が必要です。一方で、`print` メソッドは具体的な実装が提供されており、サブクラスでそのまま使用することも、オーバーライドすることもできます。

### 選択肢B, C, D
B, C, Dの選択肢にはいくつかの問題があります：

- 選択肢BとCでは、`calcPrice` メソッドは抽象メソッドとして宣言されていません。これはJavaでは許されていない実装です。抽象クラスには、メソッド本体なしに宣言される抽象メソッドが含まれていなければなりません。
- 選択肢Cでは、`print` メソッドに `final` 修飾子が使用されていますが、これは抽象クラス内で具体的なメソッドに `final` を使用することは問題ありません。ただし、これはクラスが抽象的であるという事実とは関係がありません。
- 選択肢Dでは、メソッドに実装（中括弧で囲まれたコード）が提供されているにもかかわらず、メソッドが抽象として宣言されています。これはJavaの文法に反しています。抽象メソッドは実装を持つことができません。

したがって、正しい選択はAであり、その理由は、抽象クラスであるにもかかわらず、正しく抽象メソッドが宣言されており、具体的なメソッドも適切に含まれているからです。
Smoke Testing VS Sanity Testing
Published: 2024-04-23 07:20:28

Sanity testing and smoke testing are both preliminary tests performed during the software development life cycle, but they serve different purposes:

1. **Smoke Testing**:
   - Smoke testing is conducted to ensure that the critical functionalities of the software work correctly and that the build is stable enough for further testing.
   - It is usually performed early in the development cycle, often right after a new build is deployed, to check for major issues.
   - Smoke tests are broad and shallow, covering the most critical features of the application without going into detailed testing.
   - The primary goal of smoke testing is to determine whether the software is ready for further, more detailed testing. If the smoke test fails, it indicates that there are major issues that need to be addressed before more in-depth testing can be performed.

2. **Sanity Testing**:
   - Sanity testing is a narrow and deep approach to testing, focusing on specific functionalities or areas of the application that were modified or added recently.
   - It is often performed after a specific change or enhancement is made to the software to ensure that the recent changes haven't introduced any major issues.
   - Unlike smoke testing, which checks the overall stability of the software, sanity testing verifies the specific functionality or feature under consideration.
   - The primary goal of sanity testing is to verify that the recent changes or enhancements haven't adversely affected the core functionalities of the software.

In summary, smoke testing is a broader test to ensure the overall stability of the software build, while sanity testing is a narrower test focused on specific functionalities or changes. Both types of testing are essential in ensuring the quality and stability of the software product.
How can we store data in storage using Capacitor JS with Angular?
Published: 2024-04-23 07:19:19

I read [this](https://capacitorjs.com/docs/guides/storage#:%7E:text=For%20storing%20large%20amounts%20of%20data%20and%20accessing,should%20work%20in%20Capacitor%2C%20including%20capacitor-sqlite%20and%20cordova-plugin-sqlite.) documentation, which is capacitor JS provided

This is my code for storing the data in capacitor js.

`/*
 * this function is used for the set Value
 */
async setUser(data: any) {
  await Preferences.set({
        key: 'value',
        value: JSON.stringify(data)
  });
}

/*
 * this function is used for the get-Value
 */
async getUser() {
  const user: any = await Preferences.get({ key: 'value' });
  this.UsersDetails = user.value;
}`
This is working fine when my app is running in the background. When I trash my app in the background and call for getUser(). It's giving a null value. It's not work.

Can anyone suggest if I am missing anything, or is there any other way available to Store the data in Capacitor JS?
Understanding Kubernetes: part 51 – Kubernetes 1.30 Changelog
Tags: kubernetes, devops, docker, beginners
Published: 2024-04-23 07:08:18

---
title: Understanding Kubernetes: part 51 – Kubernetes 1.30 Changelog
published: true
description: Serie of sketchnotes about Kubernetes. Explaining in a visual way Kubernetes principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Kubernetes in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqkkpq9jlneukqqaph3c.jpg
---

Understanding Kubernetes can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Kubernetes. I think it could be a good way, more visual, to explain Kubernetes (and others technologies).

We continue the serie of Sketchnotes about Kubernetes, with a focus on what's new in the new version of Kubernetes: v1.30.

![kubernetes 1.30](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqkkpq9jlneukqqaph3c.jpg)
![kubernetes 1.30](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k7g3x7toyc4vh83qclh2.jpg)
![kubernetes 1.30](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pj1zlwybmi274t6jxgyu.jpg)
![kubernetes 1.30](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvevf2hiqljozy1oxaqd.jpg)

[Kubernetes 1.30 Complete changelog](https://kubernetes.io/blog/2024/04/17/kubernetes-v1-30-release/)

If you are interested, I published an entire illustrated book about Kubernetes, available in paperback on [Amazon](https://www.amazon.fr/dp/B0BB619188/ref=cm_cr_arp_d_product_top?ie=UTF8) and in digital version on GumRoad: ["Understanding Kubernetes in a visual way"](https://gumroad.com/aurelievache#uCxcr).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).