teleren/devto huggingface dataset:
CDI scope
Published: 2024-05-18 20:15:45

Java'da CDI (Contexts and Dependency Injection) scope, bir bean'in yaşam süresini ve hangi durumlarda yeni bir instance'ın oluşturulacağını belirleyen bir mekanizmadır. CDI scope'lar, bean'lerin uygulama içindeki farklı kullanım senaryolarına göre nasıl yönetileceğini tanımlar¹.

CDI'de kullanılan bazı yaygın scope'lar şunlardır:

- **@RequestScoped**: Bean, bir HTTP isteği boyunca yaşar ve her yeni istek için yeni bir instance oluşturulur².
- **@SessionScoped**: Bean, bir kullanıcının HTTP oturumu boyunca yaşar ve oturum sona erene kadar aynı instance kullanılır².
- **@ApplicationScoped**: Bean, tüm uygulama boyunca yaşar ve tüm kullanıcılar arasında paylaşılır. Uygulama çalıştığı sürece tek bir instance oluşturulur ve bu instance tüm kullanıcılar tarafından kullanılır².
- **@Dependent**: Varsayılan scope'dur. Bean, bir başka bean'e bağımlı olarak yaşar ve onun yaşam döngüsüne bağlıdır. Yani, bağımlı bean ne zaman yaratılırsa ya da yok edilirse, dependent scope'daki bean de o zaman yaratılır veya yok edilir².
- **@ConversationScoped**: Bean, bir kullanıcının birden fazla istek boyunca yürüttüğü bir "konuşma" süresince yaşar. Konuşma kapsamı, geliştirici tarafından kontrol edilen sınırlar içinde birden fazla istek boyunca uzatılabilir².

Bu scope'lar, bean'lerin oluşturulması, kullanılması ve yok edilmesi süreçlerini yönetir ve uygulamanın performansını ve bellek kullanımını optimize etmeye yardımcı olur. Ayrıca, uygulamanın farklı bölümlerindeki bean'lerin birbiriyle nasıl etkileşime gireceğini de belirler¹².

Kaynak: Bing ile konuşma, 18.05.2024
(1) An Introduction to CDI in Java | Baeldung. https://www.baeldung.com/java-ee-cdi.
(2) 23.8 Using Scopes - Java Platform, Enterprise Edition: The Java EE .... https://docs.oracle.com/javaee/7/tutorial/cdi-basic008.htm.
(3) Java EE CDI bean scopes - Java Code Geeks. https://www.javacodegeeks.com/2013/04/java-ee-cdi-bean-scopes.html.
(4) Using Scopes - The Java EE 6 Tutorial - Oracle. https://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html.
(5) undefined. http://java.sun.com/xml/ns/javaee.
(6) undefined. http://www.w3.org/2001/XMLSchema-instance.
(7) undefined. http://java.sun.com/xml/ns/javaee/beans_1_0.xsd.
What sets this gaming platform apart from other free online Android games that require no download?
Tags: game, mobilegame, androidgames, gamedev
Published: 2024-06-03 17:36:38

This [**gaming platform**](https://medium.com/@adreeshelk/how-to-play-hundreds-of-games-on-your-lock-screen-without-downloading-anything-4f03e0173441?utm_source=referral&utm_medium=Medium&utm_campaign=Nostra) have revolutionized the world of free online Android games by offering a unique and unparalleled gaming experience that requires no download. Unlike many other platforms that require users to go through the hassle of downloading and installing games, Games are instantly accessible, allowing players to dive into the action with just a simple swipe on their lock screen.
One of the key features that sets this [**gaming platform** ](https://nostra.gg/articles/evolution-of-mobile-games.html?utm_source=referral&utm_medium=article&utm_campaign=Nostra)apart is their seamless integration with Android devices. By leveraging the lock screen functionality, This gaming platform provide a convenient and immersive gaming experience that fits perfectly into users' daily routines. Whether waiting in line, commuting, or taking a short break, players can easily access their favorite  this gaming platform without the need for time-consuming downloads or installations.
Moreover,  This gaming platform boast an extensive library of high-quality titles across various genres, catering to the diverse interests of Android users. From classic games like sudoku and chess to action-packed adventures like Wothan the Barbarian and Fruit Katana, This gaming platform offer a wide range of [free online Android games](https://medium.com/@adreeshelk/publishing-on-a-robust-gaming-platform-key-considerations-for-developers-1c8888f80d91?utm_source=referral&utm_medium=Medium&utm_campaign=Nostra) that cater to both casual and hardcore gamers.
Another aspect that distinguishes this gaming platform from other free online Android games is their commitment to delivering top-notch graphics, engaging gameplay, and immersive narratives. This gaming platform collaborates with talented game developers to create visually stunning and captivating games that rival the quality of traditional downloaded titles. By leveraging advanced technology and optimization techniques, Nostra ensures that players enjoy smooth, lag-free gaming experiences without compromising on visual fidelity or performance.
Furthermore, This gaming platform foster a vibrant gaming community where players can connect, compete, and interact with one another. Through leaderboards, challenges, and social features, This gaming platform encourage players to engage with the platform, share their achievements, and discover new titles based on their preferences and gaming history.
In a world where instant gratification and convenience reign supreme, This gaming platform have set a new standard for free online Android games. By eliminating the need for downloads and offering a diverse selection of high-quality titles, This gaming platform has created a gaming ecosystem that is accessible, engaging, and truly revolutionary."
packagemain.tech - Newsletter about Backend, Cloud, DevOps, APIs...
Tags: backend, cloud, devops, api
Published: 2024-06-03 17:31:19

---
title: packagemain.tech - Newsletter about Backend, Cloud, DevOps, APIs...
published: true
description: 
tags: backend, cloud, devops, api
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mkf7uembk3lz1p1pugpc.png
# Use a ratio of 100:42 for best results.
# published_at: 2024-06-03 17:30 +0000
---
The Backend is the backbone of any modern application. It handles data storage, user interactions, complex calculations, and much more.

Mastering this side of development opens doors to exciting opportunities, but it can be hard.

The [packagemain.tech](https://packagemain.tech) newsletter is here to help!
What are your goals for week 23 of 2024! Mid year edition.
Tags: discuss, motivation
Published: 2024-06-03 17:30:18

 It's week 23 of 2024.  It's June at Virtual Coffee we are doing mid year check ins. Are you on track to meet your goals for the year?

## What are your goals for the week? 

- What are you building? 
- What will be a good result by week's end?
- What events are happening this week? 
  * any suggestions for in person or virtual events?
- Any special goals for the quarter?

{% embed https://dev.to/virtualcoffee/monthly-challenge-mid-year-check-in-recharge-and-refocus-for-an-amazing-second-half-2k4c %}


### Last Week's Goals
 
- [:white_check_mark:] Continue Job Search. Applied and hoping to hear back.
- [:white_check_mark:] Project work. 
- [:x:] Blog.
- Events.
  * [:white_check_mark:] Thursday online job Fair.
- [:white_check_mark:] Run a goal setting thread on Virtual Coffee Slack.
- [:white_check_mark:] Clean up from Renaissance Faire * 90% done, stuff is clean but needs to be stored.
- [:white_check_mark:] Yard Work

 

 
### This Week's Goals


- Continue Job Search. 
- Project work.
- Blog.
- Work on DEV Frontend Challenge
- Events.
  * I am Not a Robot with @Nickyt And Gant.
  * Thursday Virtual Coffee.
- Run a goal setting thread on Virtual Coffee Slack.
- Assess my mid year progress.
- Yard Work


### Your Goals for the week 

Your turn what do you plan to do this week? 

- What are you building? 
- What will be a good result by week's end?
- What events are happening any week? 
  * in person or virtual?
- Got any Summer Plans?



```html
-$JarvisScript  git commit -m "Mid year already!"
```
JavaScript Class Constructors
Tags: webdev, javascript, beginners, programming
Published: 2024-06-03 17:28:57

In JavaScript, a class constructor is a special method in a class that is called when an object is created from the class. It is used to initialize the object's properties and set the initial state of the object.

Here is an example of a simple class constructor in JavaScript:
```
class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }
}
```
In this example, the `Person` class has a constructor that takes two arguments, `name` and `age`. When a new `Person` object is created, the constructor is called, and the `name` and `age` properties are set.

For examples:
```
let person = new Person('John', 30);
console.log(person.name); // Output: John
console.log(person.age); // Output: 30
```
Here are some key points about class constructors in JavaScript:

- The constructor is called when an object is created from the class using the `new` keyword.
- The constructor is responsible for initializing the object's properties.
- The constructor can take arguments, which are passed when the object is created.
- If no constructor is defined, a default constructor is created automatically.

Here are some more examples of class constructors in JavaScript:
```
class Car {
  constructor(make, model, year) {
    this.make = make;
    this.model = model;
    this.year = year;
  }
}

let car = new Car('Toyota', 'Corolla', 2020);

class Point {
  constructor(x, y) {
    this.x = x;
    this.y = y;
  }
}

let point = new Point(10, 20);
```
Constructing Objects Using Constructors
Tags: java, programming, learning, beginners
Published: 2024-06-03 17:28:02

A constructor is invoked to create an object using the **new** operator. Constructors are a special kind of method. They have three peculiarities:

- A constructor must have the same name as the class itself.
- Constructors do not have a return type—not even **void**.
- Constructors are invoked using the **new** operator when an object is created. Constructors play the role of initializing objects.

The constructor has exactly the same name as its defining class. Like regular methods, constructors can be overloaded (i.e., multiple constructors can have the same name but different signatures), making it easy to construct objects with different initial data values.

It is a common mistake to put the **void** keyword in front of a constructor. For example,

`public void Circle() {
}`

In this case, **Circle()** is a method, not a constructor.

Constructors are used to construct objects. To construct an object from a class, invoke a constructor of the class using the **new** operator, as follows:

`new ClassName(arguments);`

For example, **new Circle()** creates an object of the **Circle** class using the first constructor defined in the **Circle** class, and **new Circle(25)** creates an object using the second constructor defined in the **Circle** class.

A class normally provides a constructor without arguments (e.g., **Circle()**). Such a constructor is referred to as a _no-arg_ or _no-argument constructor_.

A class may be defined without constructors. In this case, a public no-arg constructor with an empty body is implicitly defined in the class. This constructor, called a _default constructor_, is provided automatically _only if no constructors are explicitly defined in the class_.
Installing with PNPM is 56% faster than NPM
Published: 2024-06-03 17:23:13

I'm surprised I don't see recommendations to use PNPM over NPM more often. Over the past couple of months, I've been reading guides and tutorials daily, and I've only seen it recommended in one project, [homepage](https://github.com/gethomepage/homepage#:~:text=Then%20install%20dependencies%20and%20build%20the%20production%20bundle%20(I%27m%20using%20pnpm%20here%2C%20you%20can%20use%20npm%20or%20yarn%20if%20you%20like)%3A).

Since I started using PNPM while learning React, I've noticed a significant speed increase. PNPM conducts a daily benchmark comparing its performance to NPM. You can check it out here: [PNPM Benchmarks](https://pnpm.io/benchmarks).

Have a great day!
Free Notion Style Avatar Generator
Tags: notion, avatar
Published: 2024-06-03 17:13:14

I built a free tool this weekend for Notion lovers[(Notion Avatar)](https://iconbuddy.com/notion-style-avatar-generator).


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5b9bioino6h6v32t9t6l.png)](https://iconbuddy.com/notion-style-avatar-generator)

Notion style Avatar generator, A online Notion style avatar free generator tool to make profile with head, eyes, nose, eyes, glasses, hair, & head parts, also easily customize background color.

Checkout here → [https://iconbuddy.com/notion-style-avatar-generator](https://iconbuddy.com/notion-style-avatar-generator)

Let me know your feedback on this. Thanks
Senior Growth is Brutal
Tags: watercooler
Published: 2024-06-03 17:02:55

Hello everyone, better that I get this out in the open, being a senior dev still involves a hell of a lot of personal growth, contrary to my initial belief that the great seniors I see are PERFECT, they probably (and i say that with a heavy question mark) go through the same journey of learning, and apparently I am doing many many things, even knowing some of these things are not great behaviours, but doing it anyway, I won't lie, I'm not going to frame it that I am not messing up, but the failing, is being caught if only by me, I am trying not to do it again because you know why it's bad.

It's a painful process, I've never felt so much imposters syndrome in my entire career and I am grateful and hopeful that my colleagues are patient, I certainly am going through a phase of the junior senior, and I hope it stops soon... Even being a bad developer at time to time, taking shortcuts... Because GSD!

I want to be positive but I just need a win soon to validate my lizard brain 🧠 

Rant over, you don't have to understand it I just needed to vent
2486. Append Characters to String to Make Subsequence
Tags: php, leetcode, algorithms, programming
Published: 2024-06-03 16:57:45

2486\. Append Characters to String to Make Subsequence

Medium

You are given two strings `s` and `t` consisting of only lowercase English letters.

Return _the minimum number of characters that need to be appended to the end of `s` so that `t` becomes a **subsequence** of `s`._

A **subsequence** is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

**Example 1:**

- **Input:** s = "coaching", t = "coding"
- **Output:** 4
- **Explanation:** Append the characters "ding" to the end of s so that s = "coachingding".\
  Now, t is a subsequence of s ("**co**aching**ding**").\
  It can be shown that appending any 3 characters to the end of s will never make t a subsequence.

**Example 2:**

- **Input:** s = "abcde", t = "a"
- **Output:** 0
- **Explanation:** t is already a subsequence of s ("**a**bcde").

**Example 3:**

- **Input:** s = "z", t = "abcde"
- **Output:** 5
- **Explanation:** Append the characters "abcde" to the end of s so that s = "zabcde".\
  Now, t is a subsequence of s ("z**abcde**").\
  It can be shown that appending any 4 characters to the end of s will never make t a subsequence.

**Constraints:**

- <code>1 <= s.length, t.length <= 10<sup>5</sup></code>
- `s` and `t` consist only of lowercase English letters.


**Solution:**

```
class Solution {

    /**
     * @param String $s
     * @param String $t
     * @return Integer
     */
    function appendCharacters($s, $t) {
        $i = 0;

        foreach(str_split($s) as $c) {
            if ($c == $t[$i]) {
                if (++$i == strlen($t)) {
                    return 0;
                }
            }
        }

        return strlen($t) - $i;
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
WezTerm: an actually good config key binding recipe
Tags: terminal, wezterm
Published: 2024-06-03 16:54:01


While [WezTerm][wez] is a great terminal with sane defaults, it doesn't provide
the default key binding to open the configuration file and edit it. That is
understandable, everyone may have their own preference for that. Here we will
figure out the recipe that would work everywhere and abide by modern standards.

_The original article was posted at my homepage: https://eugene-babichenko.github.io/blog/2024/06/03/wezterm-open-config/_

In my opinion, the proper way to go is to open the configuration file with the
editor specified in the `EDITOR` environment variable. I am also using macOS
most of the time, so the most natural key binding to configure something is
`Cmd+,`. In many applications this key binding is universal for all operating
systems.

It is easy to find out where the WezTerm configuration file is located: there is
always the `WEZTERM_CONFIG_FILE` variable. Also there is always the
`WEZTERM_CONFIG_DIR` variable that should allow us to specify the working
directory for our editor.

The problem with the `EDITOR` variable is that it may not be immediately
accessible to WezTerm config via `os.getenv("EDITOR")` if it was specified in
your shell configuration (e.g. `.bashrc`) and not it some other magical place.
To solve this we will obviously need to load our editor inside the shell, which
is conveniently accessible via the `SHELL` variable.

Considering all of the above, we end up with the code like this:

```lua
local wezterm = require("wezterm")
local config = wezterm.config_builder()
config.keys = {
  {
    key = ",",
    mods = "SUPER",
    action = act.SpawnCommandInNewWindow({
      cwd = os.getenv("WEZTERM_CONFIG_DIR"),
      args = { os.getenv("SHELL"), "-c", "$EDITOR $WEZTERM_CONFIG_FILE" },
    }),
  },
}
```

This greatness of this specific recipe is that it will work regardless of your
preferred shell end editor as long as the `EDITOR` variable is set. The `-c`
flag is accepted by all major \*nix shells. Also, regardless of the fact your
editor is running with an shell, the window will close immediately after you
close the editor. And of course, you can swap `SpawnCommandInNewWindow` with
`SpawnCommandInNewTab` or any custom `SpawnCommand` call.

[wez]: https://wezfurlong.org/wezterm/
Start and Stop Timer
Published: 2024-06-03 16:53:57

```JS
const App = () => {
  const [count, setCount] = React.useState(0);
  const [isCount0, setIsCount0] = 
  React.useState(true);
  const [id, setId] = 
  React.useState(true);
  
  
  React.useEffect(() => {
    console.log("Inside useEffect");
    // setIsCount0(false);
    setCount(0);
     const newId = setInterval(() => setCount((prev) => prev + 1), 1000);
    setId(newId);
    console.log("id = ",id)
  }, [isCount0]);
  
  
  const clearTimer = () => {
    // console.log("cleartime", id);
    
    clearInterval(id);
    setCount(0);
  }
  
  
  const startTimer = () => {
    if(count!=0)
    {
      console.log("start timer");
      clearInterval(id);
    }
    setIsCount0((prev) => !prev);
  }
  
  return(
    <div>
      <h3>Count : {count}</h3>
      <button onClick = {clearTimer}>Stop timer</button>
      <button onClick = {startTimer}>Start timer</button>
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));
```
A course on Automating boring staff
Tags: python, programming, beginners
Published: 2024-06-03 16:53:08

I was navigating the confines of Udemy when I came across a Python course that powerfully caught my curiosity: [Automate the Boring Stuff with Python Programming](https://www.udemy.com/course/automate/). It lasts about nine and a half hours, it's somewhat old, but it captivated me from the first minute.

![Course Certificate](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6d4jab6q715eow49enki.png)

Above, you can see my certificate, freshly minted and ready to show off on my LinkedIn profile. Many people with too much free time might object with something like, "but the course lasts less than 40 hours, it must be very bad or incomplete." To these types of individuals, I would say that a course is not worth more or less based on the amount of time it takes.

Sometimes there are 4-hour courses that explain everything in a concise and specific manner, and then there are those famous 60-hour courses where 10 are theory and 50 are excruciating practice. Halfway through the course, you realize that you're repeating most of the concepts. It's like those cartridges with 999 games, where 800 were the same but changed Mario's outfit color (yes, I also went through that golden era).

The course is basically a video and practice translation of the book of the same name. Although it is several years old (it uses a version of Python from 2015), it remains a gem to admire and is also great for taking the first steps in Python.

## The content
It should be noted that the entire course is in English, but even if you don't have a strong command of the language, you can understand everything that is happening because Al Sweigart (the course creator) constantly executes commands in the console, demonstrating their results.

As for the course content itself, we have different sections covering all the fundamentals of Python:
- Control structures
- Conditional structures
- Functions
- Loops
- Lists and Dictionaries
- String Handling
- File Handling
- Debugging (it hurts a bit because he does it with the Python Shell)

After explaining the basics, the fun begins: Automation.
- Web Scraping
- Reading and writing Excel, Word, and PDF files
- Sending and reading emails
- Automating GUI

It is worth noting that at the end of the GUI chapter, he shows a script that plays a sushi preparation video game by itself.

## Conclusions
The main reason I recommend a course that is already several years old is because of its quality. Al Sweigart explains with love and dedication in every line of code he writes. It is designed for people who want to get into development, but it can surprise even experienced individuals. I got it for free during some sort of sale, if you know about it, don't hesitate to mention it in the comments!
Support My YouTube Channel - devDive with Dipak!
Tags: coding, javascript, webdev, learning
Published: 2024-06-03 16:51:40

Hey Dev Community! 👋

I hope you're all doing well and enjoying your coding journey. As some of you might know, I've recently started a YouTube channel called **devDive with Dipak** where I share my knowledge and passion for full-stack development, coding problem-solving, and much more!

🔗 **[Check out my YouTube channel here!](https://www.youtube.com/@DevDivewithDipak)** 🔗

I'm reaching out to my amazing 9000+ followers here on Dev.to to kindly ask for your support. If you enjoy my content, please consider subscribing to my channel and hitting the like button on my videos. Your support means the world to me and will help me continue creating valuable content for the community.

Here's a quick list of what you can expect on my channel:
- **Full-Stack Development Tutorials**
- **Coding Problem Solving Sessions**
- **Practical Examples and Hands-On Projects**
- **Daily Short Videos with Programming Quotes and Tips**

Your subscription and likes not only boost my motivation but also help the channel grow and reach more people who might benefit from the content. So, if you find my posts here helpful, you'll definitely love the videos I share on YouTube.

Thank you for your continued support and for being such an awesome community!

Happy coding! 🚀

Best regards,  
**Dipak Ahirav**