Skip to content

Commit 93dfdce

Browse files
committed
small fixes
1 parent b6ffe2b commit 93dfdce

File tree

8 files changed

+66
-13
lines changed

8 files changed

+66
-13
lines changed
Loading
Binary file not shown.

docs/works/tools-and-tales/form-experiments/2015/pc-exp/index.en.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ title: "Processing Experiments"
77

88
>date: 2015
99
10-
## 1. Probabilistic Cellular Automata
11-
<iframe width="600" height="337" src="https://www.youtube.com/embed/azb5f9-QGdA?si=kZqp1gi7g2mTl_EN" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
10+
## 1. Langton's Ant
1211

13-
## 2. Langton's Ant
1412
<iframe width="600" height="337" src="https://www.youtube.com/embed/uCb9OZUHJTg?si=fx4vVNNHoBnWJIvu" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1513

16-
## 3. Probabilistic Langton's Ant
14+
## 2. Probabilistic Langton's Ant
15+
1716
<iframe width="600" height="337" src="https://www.youtube.com/embed/fPR9XPtcowg?si=swZ-xgh-0Ei8_EJh" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1817

1918
[:material-arrow-left-bold: project list](../../index.md){ .md-button }

docs/works/tools-and-tales/form-experiments/2015/pc-exp/index.ko.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ title: "프로세싱 실험들"
77

88
>날짜: 2015
99
10-
## 1. Probabilistic Cellular Automata
11-
<iframe width="600" height="337" src="https://www.youtube.com/embed/azb5f9-QGdA?si=kZqp1gi7g2mTl_EN" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
10+
## 1. Langton's Ant
1211

13-
## 2. Langton's Ant
1412
<iframe width="600" height="337" src="https://www.youtube.com/embed/uCb9OZUHJTg?si=fx4vVNNHoBnWJIvu" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1513

16-
## 3. Probabilistic Langton's Ant
17-
<iframe width="600" height="337" src="https://www.youtube.com/embed/fPR9XPtcowg?si=swZ-xgh-0Ei8_EJh" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
14+
## 2. Probabilistic Langton's Ant
1815

16+
<iframe width="600" height="337" src="https://www.youtube.com/embed/fPR9XPtcowg?si=swZ-xgh-0Ei8_EJh" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1917

20-
[:material-arrow-left-bold: 프로젝트 목록](../../index.md){ .md-button }
18+
[:material-arrow-left-bold: 프로젝트 목록](../../index.md){ .md-button }

docs/works/tools-and-tales/form-experiments/index.en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ title: "Form Experiments"
109109
- [__Processing Experiments (2015)__](./2015/pc-exp/index.md)
110110

111111
---
112-
![pc-1](../../../assets/tools-and-tales/form-experiments/2015/pc-exp/pca-img.png){width=200}
112+
![pc-1](../../../assets/tools-and-tales/form-experiments/2015/pc-exp/pc1.png){width=200}
113113

114114
</div>
115115

docs/works/tools-and-tales/form-experiments/index.ko.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ title: "형태 실험들"
109109
- [__프로세싱 실험들 (2015)__](./2015/pc-exp/index.md)
110110

111111
---
112-
![pc-1](../../../assets/tools-and-tales/form-experiments/2015/pc-exp/pca-img.png){width=200}
112+
![pc-1](../../../assets/tools-and-tales/form-experiments/2015/pc-exp/pc1.png){width=200}
113113

114114
</div>
115115

docs/works/tools-and-tales/tools/til/2410.ko.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "TIL - 2024. 09."
2+
title: "TIL - 2024. 10."
33
---
44

55
[:material-arrow-left-bold: 이전 페이지](../index.md){ .md-button }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "TIL - 2025. 03."
3+
---
4+
5+
[:material-arrow-left-bold: 이전 페이지](../index.md){ .md-button }
6+
7+
## _2025. 03. 01_
8+
9+
### python 여러 라인 및 공백 입력 받기
10+
11+
입력 관련 글들을 찾아서 돌아다니다가 아래와 같은 방식으로 입력을 받는 것이 가능하다는 것을 알게 되었다.
12+
13+
``` py
14+
# 입력 예시:
15+
# 1 2
16+
# 3 3 3 3 3
17+
18+
a, b, *l = map(int, open(0).read().split())
19+
print(a, b, l)
20+
21+
# 출력 예시:
22+
# 1 2 [3, 3, 3, 3, 3]
23+
```
24+
25+
파이썬 숏코딩에 유용하게 사용될 수 있어보인다.
26+
27+
### python map 함수를 사용하여 만든 객체를 한 번 밖에 순회할 수 없음
28+
29+
[공식 문서에 있는 map에 대한 설명](https://docs.python.org/3/library/functions.html#map){:target="\_blank"}에 따르면 당연한 이야기일 수 있겠다.
30+
31+
```txt
32+
Return an iterator that applies function to every item of iterable, yielding the results.
33+
```
34+
35+
예를 들어, 아래와 같은 일이 일어난다.
36+
37+
``` py
38+
# 입력 예시:
39+
# 1 2 4 111 7
40+
41+
l = map(int, input().split())
42+
print(max(l)) # 111
43+
print(max(l)) # ValueError: max() arg is an empty sequence
44+
```
45+
46+
첫 번째 max함수에서 map에서 인자로 받은 `input().split()` 안에 있는 아이템을 순회하면서 `int`를 먹이고, 그 값으로 max값을 찾았는데, 이 과정에서 모든 아이템을 순회해버려서 다시 max를 부르려 하니 arg로 빈 시퀀스가 들어왔다고 하는 것이다.
47+
48+
이를 피하려면 다음과 같이 코드를 작성하면 된다.
49+
50+
``` py
51+
l = [*map(int, input().split())] # 리스트로 만들어버린다.
52+
print(max(l)) # 111
53+
print(max(l)) # 111
54+
```
55+
56+
[:material-arrow-left-bold: 이전 페이지](../index.md){ .md-button }

0 commit comments

Comments
 (0)