teleren/devto huggingface dataset:
Day 12: Inheritance
Tags: webdev, javascript, programming, blockchain
Published: 2024-05-13 03:03:55

NKO here. Today's dive into JavaScript was... well, it wasn't exactly a shell exploit, but it definitely involved some re-wiring. We're talking about inheritance, folks. You know, how one object can inherit the traits of another.

So, here's the thing with inheritance in JavaScript: it ain't like the classes you find in those fancy-schmancy languages. Here, it's all about prototypes, these internal blueprints that objects are based on. And guess what? Objects can look up properties and methods on their prototype if they don't have them themselves. It's a whole chain of command thing, a hierarchy you gotta respect.

Now, the extends keyword, that's our way of saying "Hey, new object! You wanna inherit everything from that old object over there?" It's like creating a new branch from an existing family tree. You get all the inherited goodies, but you can also add your own flavor to the mix.

Speaking of adding your own flavor, that's where the super keyword comes in. Think of it as a way to call the constructor function of the parent object, like a courtesy call before you start overriding all its methods. It's all about respect, you know?

And then there's constructor overloading, which sounds fancy but really just means having multiple constructors for the same class. It's like having different entry points depending on what information you need to provide upfront. You gotta be flexible, gotta adapt to the situation, just like when I gotta hack into a system with different access points depending on the security measures.

So, that's the inheritance story for today. It's all about building on top of what already exists, creating new objects with a family history. Just remember, with great inheritance comes great responsibility. You don't want to inherit any bugs or security vulnerabilities, now do you? Until next time, stay safe out there in the digital jungle.
山本仁志（Hitoshi Yamamoto）：国境を越えた金融界の巨人
Published: 2024-05-13 02:50:11

山本 仁志
やまもと ひとし
ヤマモト ヒトシ
Hitoshi Yamamoto


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

プリンストン大学経済学部卒業。
卒業後は、米国のオークツリー・キャピタル・マネジメントに勤務し、ファンドを組み、取引構造と実行、投資評価、コンプライアンス管理などのファンド管理と営業を担当。
事業開発コンサルティングに加え、ベンチャーキャピタル、合弁事業、スピンオフ、プレIPO投資なども手掛けています。
海外では米国、英国に加え、アジアの金融市場でも事業を拡大。 

2005年シティグループ証券入社。
日本の金融業界で20年近くの経験があり、主に日本の政府ファンド、債券、株式市場に参入し、セールスからトレーディングまでさまざまな市場関連の役職を歴任。

2007年より野村證券株式会社に入社し、主に新規事業開発や資産運用コンサルティング業務に従事。富裕層がターゲット。
SAP Basis snippets #5
Tags: sap, sapbasis, telnet, license
Published: 2024-05-13 02:30:00

## Installing license via telnet

Today we will see the steps to install license using telnet.

Login to telnet

```
telnet localhost 5<instance no.>08
```
It asks for your username and password. Give your java administrator username and password.

Now type the below command to add the licensing menu.

```
add licensing
```
To know the hardware id of your sap system, give the below command.

```
mshardwareid
```
The below command displays the SID.

```
mssystemid
```
Download the license .txt file and place it in your host.

To install a license, we use the command.

```
install_license -file <path where the license file is placed>
```
The below command lists out the installed licenses.

```
LIST_LICENSES
```
For deleting we use the command **delete_license**. But we have to pass an additional parameter along with this.

To delete all the licenses, we use the command.

```
delete_license -all
```
To delete a license of particular index as returned by **LIST_LICENSES** command, we use the command.

```
delete_license <index number>
```
Chinh Phục Xì Dách Online – Cổng Game Đổi Thưởng Sunwin
Published: 2024-05-13 02:24:58

Sunwin – Sân chơi cá cược online hấp dẫn
Sunwin là cổng game bài đổi thưởng uy tín, cung cấp đa dạng các trò chơi cá cược hấp dẫn, trong đó có Xì Dách. Với giao diện đẹp mắt, thân thiện cùng hệ thống hoạt động mượt mà, Sunwin đảm bảo người chơi có những giờ phút giải trí tuyệt vời.

Đa dạng trò chơi cá cược
Ngoài Xì Dách, Sunwin còn mang đến cho người chơi nhiều trò chơi cá cược hấp dẫn khác như:

Bắn cá: Trò chơi bắn cá đổi thưởng với đồ họa đẹp mắt, đa dạng chủng loại cá và mức cược phù hợp với mọi túi tiền.
Quay hũ: Trò chơi quay hũ slots với nhiều chủ đề hấp dẫn, tỷ lệ nổ hũ cao và giải thưởng cực giá trị.
Mini game: Các trò chơi mini game giải trí nhẹ nhàng như: Tài Xỉu, Xóc Đĩa, Bầu Cua,… với luật chơi đơn giản và tỷ lệ thắng cược cao.
Hệ thống bảo mật an toàn
Sunwin sử dụng hệ thống bảo mật tiên tiến, đảm bảo an toàn cho thông tin cá nhân và tài khoản của người chơi. Các giao dịch nạp/rút tiền đều được kiểm soát chặt chẽ, ngăn chặn mọi - https://sunwin35.com/game-bai-xi-dach/
Sunwin – Sân chơi cá cược online hấp dẫn
Tags: sunwin
Published: 2024-05-13 02:23:13

Bạn đang tìm kiếm những giây phút giải trí thú vị và gay cấn? Vậy thì game bài Xì Dách (Blackjack) chính là lựa chọn dành cho bạn. Sunwin, cổng game đổi thưởng uy tín hàng đầu, mang đến cho người chơi trải nghiệm Xì Dách online đỉnh cao.

Sunwin – Sân chơi cá cược online hấp dẫn
Sunwin là cổng game bài đổi thưởng uy tín, cung cấp đa dạng các trò chơi cá cược hấp dẫn, trong đó có Xì Dách. Với giao diện đẹp mắt, thân thiện cùng hệ thống hoạt động mượt mà, Sunwin đảm bảo người chơi có những giờ phút giải trí tuyệt vời.

Đa dạng trò chơi cá cược
Ngoài Xì Dách, Sunwin còn mang đến cho người chơi nhiều trò chơi cá cược hấp dẫn khác như:

Bắn cá: Trò chơi bắn cá đổi thưởng với đồ họa đẹp mắt, đa dạng chủng loại cá và mức cược phù hợp với mọi túi tiền.
Quay hũ: Trò chơi quay hũ slots với nhiều chủ đề hấp dẫn, tỷ lệ nổ hũ cao và giải thưởng cực giá trị.
Mini game: Các trò chơi mini game giải trí nhẹ nhàng như: Tài Xỉu, Xóc Đĩa, Bầu Cua,… với luật chơi đơn giản và tỷ lệ thắng cược cao.
Sorting and Searching in Python(looking for help)
Published: 2024-05-13 02:18:48

I wrote this Python code but it is giving me this error shown in the screenshot and I don't know where it is coming from. I am a beginner in Python.

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

Program:
""" 
    This program defines the Album class with the specified attributes and string representation.
    Then, it creates two lists albums1 and albums2, populates them with Album objects,
    and performs various operations like sorting, swapping, copying, adding elements, and searching.
"""
class Album:    # defineing Album class
    def __init__(self, album_name, number_of_songs, album_artist):
        self.album_name = album_name
        self.number_of_songs = number_of_songs
        self.album_artist = album_artist

    def __str__(self):  
       return f"({self.album_name}, {self.album_artist}, {self.number_of_songs})"


def main():
    albums1 = []
    albums1.append(Album("Thriller", 9, "Michael Jackson"))
    albums1.append(Album("Back in Black", 10, "AC/DC"))
    albums1.append(Album("The Dark Side of the Moon", 10, "Pink Floyd"))
    albums1.append(Album("Rumours", 11, "Fleetwood Mac"))
    albums1.append(Album("Born to Run", 8, "Bruce Springsteen"))

    # Print albums before sorting
    print("Albums before sorting:")
    for album in albums1:
        print(album)

    # Swap elements at positions 1 and 2
    albums1[1], albums1[2] = albums1[2], albums1[1]

    # Print albums after swapping
    print("\nAlbums after swapping positions 1 and 2:")
    for album in albums1:
        print(album)

    albums2 = []
    albums2.append(Album("Purple Rain", 9, "Prince"))        
    albums2.append(Album("Like a Prayer", 9, "Madonna"))
    albums2.append(Album("Bridge Over Troubled Water", 11, "Simon & Garfunkel"))
    albums2.append(Album("Achtung Baby", 11, "U2"))
    albums2.append(Album("Nevermind", 14, "Nirvana"))

    # Print albums2
    print("\nAlbums2:")
    for album in albums2:
        print(album)
    # Copy all albums from albums1 to albums2
    albums2.extend(albums1)

    # Add additional albums
    albums2.append(Album("Dark Side of the Moon", 9, "Pink Floyd"))
    albums2.append(Album("Oops!... I Did It Again", 16, "Britney Spears"))

    # Print albums2 after additions
    print("\nAlbums2 after additions:")
    for album in albums2:
        print(album)

    # Sort albums2 alphabetically by album name
    albums2.sort(key=lambda album: album.album_name)

    # Print albums2 after sorting alphabetically
    print("\nAlbums2 after sorting alphabetically:")
    for album in albums2:
        print(album)

    # Search for Dark Side of the Moon
    dark_side_index = albums2.index(Album("Dark Side of the Moon", 9, "Pink Floyd"))
    (f"\nIndex of Dark Side of the Moon: {dark_side_index}")
           
if __name__ == "__main__":
    main()
Cloudforet for Production
Published: 2024-05-13 01:55:26

This guide is for Installation of Cloudforet for Production.

* On-premise Kubernetes
* MongoDB Atlas SaaS

# Architecture


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

# Pre-requisite

### Kubernetes

* Install your own Kubernetes Clusters
 
### Nginx Ingress

https://kubernetes.github.io/ingress-nginx/deploy/

```
helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace
```

### MongoDB Cluster

Case 1) MongoDB Atlas
{% embed https://www.youtube.com/watch?v=feUpigXyVDo %}

Case 2) MongoDB self-hosted (Helm Chart)

### Domain Name

* Prepare your domain name (In this guide, example.com)

### Certificates

https://dev.to/choonho/install-cert-manager-lets-encrypt-443b


### SMTP Server

* For sending email notification

https://www.gmass.co/blog/gmail-smtp/
memegraph - search and explore memes
Tags: netlifychallenge, devchallenge, webdev, javascript
Published: 2024-05-13 02:11:36

*This is a submission for the [Netlify Dynamic Site Challenge](https://dev.to/challenges/netlify): Visual Feast.*


## What I Built
Memegraph is a search engine and recommendation engine for memes using OpenAI CLIP.

Search memes via keywords, explore memes with the same template, and discover memes that are visually similar.

## Demo
Please check it out here - [memegraph.netlify.app](https://memegraph.netlify.app)!

Source available here - [github.com/seanvelasco/memegraph](https://github.com/seanvelasco/memegraph)!

#### Don't know the name of a meme? Just describe the meme!

![Guy Thinking In Bed meme](https://img.sean.app/memegraph_thinking_in_bed_meme.png)

#### Discover memes about your favorite topics

![The Office memes](https://img.sean.app/memegraph_the_office.png)

#### Look up that obscure meme you saw

![Memes about Spongebob and Myers-Briggs Type Indicator (MBTI)](https://img.sean.app/memegraph_as_mbti.png)

#### Discover memes that are visually similar

![Boardroom meme](https://img.sean.app/memegraph_boardroom.png)

#### New way to browse memes

![Memegraph home](https://img.sean.app/memegraph_home.png)


## Platform Primitives

This uses Netlify Image CDN to deliver and transform memes efficiently to enhance user experience. 

Because memes stay the same throughout its lifetime, the cache policy is to cache the memes by default, for the longest amount of time possible. The challenge is, memes are retrieved at random on the homepage, so some memes are cached and some are not.

All the memes are stored in another Blob storage provider, however I plan to migrate them to Netlify Blobs (just need to figure out how to upload in bulk or in batches efficiently).
Stay Updated with PHP/Laravel: Weekly News Summary (06/05/2024 - 12/05/2024)
Tags: php, laravel
Published: 2024-05-13 02:08:28

Dive into the latest tech buzz with this weekly news summary, focusing on PHP and Laravel updates from May 6th to May 12th, 2024. Stay ahead in the tech game with insights curated just for you!

This summary offers a concise overview of recent advancements in the PHP/Laravel framework, providing valuable insights for developers and enthusiasts alike. Explore the full post for more in-depth coverage and stay updated on the latest PHP/Laravel development.

Check out the complete article here https://poovarasu.dev/php-laravel-weekly-news-summary-06-05-2024-to-12-05-2024/
How To Stay Fit Physically And Mentally And Keep Coding
Tags: webdev, beginners, programming, productivity
Published: 2024-05-13 02:05:00

Programming is a physically demanding activity.

I know that you think all you have to do is just sit down in a chair and it should be easy.

But, it is not quite like that.

In fact, if you were to just sit in your chair the whole time, your body will deteriorate so fast you would become a slouch, your back would become hunched over, your body would deteriorate into the shape of the chair.

You will become incredibly unattractive, your eyes will dry out from staring at the computer screen so long.

Your skin is not going to get enough sunshine such that it is going to become all pale and pasty.

And as you get deeper into programming, you start moving into the basement, into buildings without windows.

It just gets darker and darker for you until you eventually become like a Wendigo.

So, you need to understand that good exercise and good sleep are essential for any programmer.

And this is something that I make sure I get for myself.

Everyday, if I were to go program for a long period of time, I am going to make sure that I get my exercise in as well.

And I also have a very good sleep routine.

Also read: [A telltale Sign of An Inexperienced Programmer](https://karlgusta.substack.com/p/a-telltale-sign-of-an-inexperienced)

Not only that, I make sure that when I sit down, I sit with my back straight such that I have a good posture.

Because it is pretty funny. If you were to go to some of these tech companies, you will see a bunch of programmers.

They look really weird.

Their backs are all hunched over, their necks have elongated, as they are peering deeper and deeper into that computer screen.

And their gaze, their eyes just seem to glaze over all the time.

I take a break every 30 minutes.

And I also drink a ton of fluids such that my eyes don't get too dry and I think overall people just need to drink a lot of fluids in general.

For my lunch breaks, I go out and I make sure I get some sunshine on my skin.

You know, these are all good habits that you need to build up as a programmer, to protect your physical body.

It is kind of like a sports star. Sports stars have to go to the gym, hone their bodies, build their muscles, make it perfect for their game.

And it is no different from programmers.

Except programmers are kind of on the opposite end of the scale where their bodies are deteriorating completely with, and almost falling apart, destroyed into the shape of a chair.

And then they just have to protect their bodies and mold it back into a normal baseline so that they don't have to appear too weird.

Rooting for you,

Karl ⛹️

P.S. I'm happy with the reviews. Guys coming from here to buy, thank you. I need only 20 more to close this intake by today midnight. [Join here now.](https://karlgusta.gumroad.com/l/wkubkd)
React Hooks
Published: 2024-05-13 01:36:26

React provides many built-in hooks, such as useContext, useMemo, useRef, and useReducer, among others. These hooks allow developers to manage state, handle side effects, and improve performance in a more concise and efficient manner compared to traditional class components.

The useContext hook, for example, enables components to access and consume values from React's Context API without the need for prop drilling. This simplifies the process of sharing data or functionality across the component tree.

The useMemo hook is useful for memoizing expensive computations, ensuring that a function is only computed when its dependencies change. By caching the result of a computation, useMemo can optimize performance by preventing unnecessary re-renders.

Refactoring class components to use hooks can result in cleaner, more readable code that is easier to maintain and test. Hooks encourage functional programming practices and make it simpler to reason about component behavior.

Leveraging JavaScript hooks in React applications can lead to more efficient development workflows, improved code quality, and enhanced user experiences. By embracing the principles of functional programming and component-based architecture, developers can build robust, scalable applications that are easier to extend and maintain over time.

JavaScript hooks have revolutionized the way developers work with React by providing a more intuitive and declarative approach to managing component logic and state. With hooks, developers can create more modular, reusable, and testable components, leading to a more efficient and enjoyable development experience.

By embracing hooks, developers can take advantage of the full power of functional programming principles in their React applications, resulting in code that is easier to reason about and less error-prone. The flexibility and composability of hooks allow developers to build complex UIs with simple, composable units of logic.

As the React ecosystem continues to evolve, hooks are becoming increasingly ubiquitous in modern React applications. By mastering the art of using hooks effectively, developers can unlock new levels of productivity and creativity in their front-end development work.

Overall, the introduction of hooks in JavaScript has transformed the React landscape, empowering developers to build more robust and performant applications with greater ease and flexibility. With their ability to streamline component logic and state management, JavaScript hooks have become an essential tool for modern web development.
MMOexp: This ceremony alone sees us abashed acclimatized
Tags: games
Published: 2024-05-13 01:28:16

"Fuckers took away my birthmark milk blade didn’t they," apprehend one corruption on a Diablo 4 subreddit post. The Druid's blade assay would actually change its fur blossom to <a href="https://www.mmoexp.com/Diablo-4/Gold.html">Diablo 4 Gold</a> bender the bristles blossom of the abecedarian character, so if you had afire blossom hair, you'd accepting a arrant blossom blade amazing about Chantry afterwards you.

Still on the fence with Diablo 4? You can brawl the ancient 10 hours for chargeless on Xbox this weekend | MMOEXP
　　

The ancient 10 hours of Diablo 4 are playable for chargeless on Xbox over the abutting few days.

October's battery calendar is packed, and again some. This ceremony alone sees us abashed acclimatized about New York in Marvel's Spider-Man 2, bounden through blooming pipes as Elephant Mario in Air-conditioned Mario Bros. Wonder, and activity fast in classic-style Sonic adventitious Sonic Superstars. And as if there weren't already too few hours for <a href="https://www.mmoexp.com/Diablo-4/Gold.html">Diablo 4 Gold for sale</a> all the abecedarian out there, Blizzard is authentic our brawl choices affiliated added difficult by alms Diablo 4 for chargeless this weekend.
Python, 튜플
Tags: python
Published: 2024-05-13 01:21:34

튜플의 요솟값은 한 번 정하면 지우거나 변경할 수 없다. 
```
t1 = ()
t2 = (1,)
t3 = (1, 2, 3)
t4 = 1, 2, 3
t5 = ('a', 'b', ('ab', 'cd'))
```
단지 1개의 요소만을 가질 때는 요소 뒤에 쉼표(,)를 반드시 붙여야 한다는 것과 t4 = 1, 2, 3처럼 소괄호(())를 생략해도 된다는 점

지우거나 변경하려고 할 경우 오류를 반환함

인덱싱
```
>>> t1 = (1, 2, 'a', 'b')
>>> t1[0]
1
>>> t1[3]
'b'
```

슬라이싱

```
>>> t1 = (1, 2, 'a', 'b')
>>> t1[1:]
(2, 'a', 'b')
```

더하기 _ 새로운 튜플을 만드는것

```
>>> t1 = (1, 2, 'a', 'b')
>>> t2 = (3, 4)
>>> t3 = t1 + t2
>>> t3
(1, 2, 'a', 'b', 3, 4)
```

튜플 곱하기

```
>>> t2 = (3, 4)
>>> t3 = t2 * 3
>>> t3
(3, 4, 3, 4, 3, 4)
```

튜플 길이 구하기
```
>>> t1 = (1, 2, 'a', 'b')
>>> len(t1)
4
```
_참조 : https://wikidocs.net/15_
Python, 리스트
Tags: python
Published: 2024-05-13 01:13:09

```
리스트명 = [요소1, 요소2, 요소3, ...]
```

```
>>> a = []
>>> b = [1, 2, 3]
>>> c = ['Life', 'is', 'too', 'short']
>>> d = [1, 2, 'Life', 'is']
>>> e = [1, 2, ['Life', 'is']]
>>> f = list() # 비어있는 리스트
```
인덱싱

```
>>> a = [1, 2, 3]
>>> a
[1, 2, 3]
```

```
>>> a[0]
1
```

```
>>> a[0] + a[2]
4
```
리스트 혼합되어있는 경우 인덱싱

```
>>> a = [1, 2, 3, ['a', 'b', 'c']]
```

```
>>> a[0]
1
>>> a[-1]
['a', 'b', 'c']
>>> a[3]
['a', 'b', 'c']
```

```
>>> a[-1][0]
'a'
```
슬라이싱

```
>>> a = [1, 2, 3, 4, 5]
>>> a[0:2]
[1, 2]
```

```
>>> a = [1, 2, 3, 4, 5]
>>> b = a[:2]
>>> c = a[2:]
>>> b
[1, 2]
>>> c
[3, 4, 5]
```
중첩된 리스트에서 슬라이스

```
>>> a = [1, 2, 3, ['a', 'b', 'c'], 4, 5]
>>> a[2:5]
[3, ['a', 'b', 'c'], 4]
>>> a[3][:2]
['a', 'b']
```
리스트 더하기

```
>>> a = [1, 2, 3]
>>> b = [4, 5, 6]
>>> a + b
[1, 2, 3, 4, 5, 6]
```

```
>>> a = [1, 2, 3]
>>> a * 3
[1, 2, 3, 1, 2, 3, 1, 2, 3]
```
리스트 길이 구하기

```
>>> a = [1, 2, 3]
>>> len(a)
3
```

문자 + 숫자는 안된다

```
>>> a = [1, 2, 3]
>>> a[2] + "hi"

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'

>>> str(a[2]) + "hi"
3hi
```

리스트 수정하기

```
>>> a = [1, 2, 3]
>>> a[2] = 4
>>> a
[1, 2, 4]
```

del 함수를 사용해 리스트 요소 삭제하기

```
>>> a = [1, 2, 3]
>>> del a[1]
>>> a
[1, 3]
```
del 함수와 슬라이싱 기법
```
>>> a = [1, 2, 3, 4, 5]
>>> del a[2:]
>>> a
[1, 2]
```
리스트에 요소 추가하기 - append
append의 사전적 의미는 ‘덧붙이다, 첨부하다’이다. 이 뜻을 안다면 다음 예가 바로 이해될 것이다. append(x)는 리스트의 맨 마지막에 x를 추가하는 함수이다.

```
>>> a = [1, 2, 3]
>>> a.append(4)
>>> a
[1, 2, 3, 4]
```
리스트 정렬 - sort


```
>>> a = [1, 4, 3, 2]
>>> a.sort()
>>> a
[1, 2, 3, 4]
```
리스트 뒤집기 - reverse
reverse 함수는 리스트를 역순으로 뒤집어 준다. 이때 리스트 요소들을 순서대로 정렬한 다음 다시 역순으로 정렬하는 것이 아니라 현재의 리스트를 그대로 거꾸로 뒤집는다.

```
>>> a = ['a', 'c', 'b']
>>> a.reverse()
>>> a
['b', 'c', 'a']
```

인덱스 반환 - index
index(x) 함수는 리스트에 x 값이 있으면 x의 인덱스 값(위칫값)을 리턴한다. 존재하지 않는 값을 리턴하려 할 때, 오류를 발생시킴

```
>>> a = [1, 2, 3]
>>> a.index(3)
2
>>> a.index(1)
0
```
리스트에 요소 삽입 - insert
insert(a, b)는 리스트의 a번째 위치에 b를 삽입하는 함수이다. 파이썬은 숫자를 0부터 센다는 것을 반드시 기억하자.

```
즉 첫 번째 요소인 a[0] 위치에 값 4를 삽입하라는 뜻이다.

>>> a = [1, 2, 3]
>>> a.insert(0, 4)
>>> a
[4, 1, 2, 3]
```
리스트 요소 제거 - remove
remove(x)는 리스트에서 첫 번째로 나오는 x를 삭제하는 함수이다.

```
>>> a = [1, 2, 3, 1, 2, 3]
>>> a.remove(3)
>>> a
[1, 2, 1, 2, 3]
```
리스트 요소 끄집어 내기 - pop
```
pop()은 리스트의 맨 마지막 요소를 리턴하고 그 요소는 삭제한다.

>>> a = [1, 2, 3]
>>> a.pop()
3
>>> a
[1, 2]
```

```
pop(x)는 리스트의 x번째 요소를 리턴하고 그 요소는 삭제한다.

>>> a = [1, 2, 3]
>>> a.pop(1)
2
>>> a
[1, 3]
```

리스트에 포함된 요소 x의 개수 세기 - count

```
>>> a = [1, 2, 3, 1]
>>> a.count(1)
2
```

리스트 확장 - extend
extend(x)에서 x에는 리스트만 올 수 있으며 원래의 a 리스트에 x 리스트를 더하게 된다.

```
>>> a = [1, 2, 3]
>>> a.extend([4, 5])
>>> a
[1, 2, 3, 4, 5]
>>> b = [6, 7]
>>> a.extend(b)
>>> a
[1, 2, 3, 4, 5, 6, 7]
```

_참조 : https://wikidocs.net/14_
１２章６６
Published: 2024-05-13 00:48:51

```java
// Sampleクラスを定義する。
public class Sample {
    // Integer型の引数を受け取り、その値をコンソールに出力するstaticメソッドprintを定義する。
    public static void print(Integer num) {
        System.out.println(num); // コンソールにnumを出力する。
    }
}

// 必要なライブラリをインポートする。
import java.util.List;

// Mainクラスを定義する。
public class Main {
    // メインメソッドを定義する。プログラムのエントリーポイント。
    public static void main(String[] args) {
        List<Integer> list = List.of(1, 2, 3); // 1, 2, 3 の整数を要素とするリストを作成する。
        // リストの各要素に対して、Sampleクラスのprintメソッドを適用する。
        list.forEach(Sample::print); // メソッド参照を使用して、リストの各要素を出力する。
    }
}
```

上記のコードでは、`Sample::print` が `list.forEach` メソッドに渡され、リストの各要素に対して `print` メソッドが呼び出されます。これにより、リストの各要素がコンソールに出力されることになります。

## 追記
Sampleクラスのprintメソッドのstaticの装飾がなければ、
A.のnew Sample()::printが正解となる。