jetbrain 브레이크 포인트 / breakpoints / break point / 인텔리제이 / intellij break / suspend / 방법 /
IntelliJ breakpoint
Suspend
- All : breakpoint 에 thread 가 걸리면, 모든 thread 가 suspend 된다.
- Thread : breakpoint 에 thread 가 걸리면, 그 thread 만 멈추고(suspend) 나머지는 그냥 동작한다.
jetbrain 브레이크 포인트 / breakpoints / break point / 인텔리제이 / intellij break / suspend / 방법 /
Suspend
Zen of python 의 내용은 프로그래밍을 하는 사람에게 유용한 정보라고 생각된다. 특히나 여럿이 해야 하는 대단위 프로젝트에서는 더더욱 중요하다고 생각한다. 그래서 정리를 좀 해본다.
컴퓨터 프로그래밍 할 때의 가이드라인 같은 것들이 있는데, 그중에 python 을 만들때 영향을 준 가이드라인이라고 한다. 총 19개이다.
이것을 Tim Peter 라는 사람이 1999년 python mailing list 에 올렸다고 한다.
TypesScript 에서 object
Type 은 primitive 를 배제한 type 을 이야기 한다. 그래서 generic parameter 로 <P extends object>
를 사용했는데, primitive 를 paramter 로 넘기면, error 가 발생한다.
TypeScript 에서 Object type 도 있는데, 이녀석은 null
, undefined
를 제외한 모든 녀석을 포함한다. 그런데 이 type 은 사용하지 말라고 한다.
다음글에서는 {}
과 unknown
의 차이를 알려준다.
{}
은 string index 가 된다(k["foo"]
), 단 --noImplicitAny
에서는 에러가 난다.{}
은 null
, undefined
를 포함하지 않는다. unknown
은 포함한다.{}
은 object
에 할당된다. unknown
은 안된다.any
는 모든 것을 포함한다. 여기에는 unknown
도 받을 수 있고, never
도 받을 수 있고, 다 가능하다.
keyword: history date / linux history command / how to add date to the history / 히스토리에 date 넣는법 / 날짜 시간 넣는법 / 어떻게 넣지 / how to add date to the history
~/.bashrc
또는 /etc/bash.bashrc
에 아래의 변수를 추가하면 된다.
HISTTIMEFORMAT="%F %T: "
markdown to html libraries / how to / 어떻게 / 변경
다음 중 가장 star 가 많은 것을 사용했다.
npm i marked --save
npm i @types/marked --save-dev
Marked Documentation 에서 사용법을 확인할 수 있다.
아래처럼 사용하면 된다.
import { marked } from 'marked';
const html = marked.parse('# Marked in Node.js\n\nRendered by **marked**.');
github issue 가져오기 / fetching / download / crawling / crawl / 이슈
아래 간략한 code 가 있다. auth 를 하고, issue #10 을 가져오는 code 이다.
import { Octokit, App } from "octokit";
(async () => {
// Create a personal access token at https://github.com/settings/tokens/new?scopes=repo
const octokit = new Octokit({ auth: `my-personal-access-token` });
// Compare: https://docs.github.com/en/rest/reference/users#get-the-authenticated-user
const {data: {login}} = await octokit.rest.users.getAuthenticated();
// --------------------------------------------
// 모든 이슈를 가져올때
const iterator = octokit.paginate.iterator(octokit.rest.issues.listForRepo, {
owner: login,
repo: "my_repo",
per_page: 100,
state: "all",
});
// iterate through each response
// iterate through each response
for await (const { data: issues } of iterator) {
for (const issue of issues) {
console.log("Issue #%d: %s", issue.number, issue.title);
console.log("Issue Body: %s", issue.body);
// comments
const {data: commentsList} = await octokit.rest.issues.listComments({
owner: login,
repo: "my_repo",
issue_number: issue.number,
})
for (const comment of commentsList) {
console.log(`url=${comment.html_url}`)
console.log(`created_at:${comment.created_at}, updated_at:${comment.updated_at}`)
console.log(`body=${comment.body}`)
}
}
}
// --------------------------------------------
// 특정 이슈를 가져올 때
// gh api repos/mygitid/my_repo/issues/10
console.log("Hello, %s", login);
octokit.rest.users.getAuthenticated();
const resp = await octokit.rest.issues.get({
owner: login,
repo: "my_repo",
issue_number: 10,
})
console.log(`issue body=${resp.data.body}`)
})()
whl / linux 패키지 tag / manylinux / manlinux2014 /리눅스 패키지 / 휠 패키지 이름 / 네이밍 / naming
이 글에서는 python linux package 이름에 있는 manylinux
가 무엇을 뜻하는지 알아보려 한다.
위처럼 manylinuxYYYY 등이 보인다. 이것에 대한 설명은 다음 링크에 잘 나와 있다.
내용은 linux 의 경우 배포판(distribution) 에 따라 설치 가능여부가 달라서, 그것에 따라 많은 wheel 을 만들어야 했다. 이유는 PEP 513 에 설명되어 있는데, wheel 이 사용하는 library 들 때문이었다.
그래서 제한된 library 를 써서 되도록 많은 linux 에서 사용 가능하도록 package 의 tag 를 만들었다.
For these reasons, to achieve broad portability, Python wheels
- should depend only on an extremely limited set of external shared libraries; and
- should depend only on “old” symbol versions in those external shared libraries; and
- should depend only on a widely-compatible kernel ABI.
그래서 만든것이 manylinux1 이라 한다. 그런데, 이것이 linux 가 시간이 흐르면서 새로운 library version 을 쓰게 되면서, manylinux2010, manylinux2014 까지 왔다. 그러다가 이것을 glib 의 버전에 맞춰서 표기하는 manylinux_x_y
까지 오게 됐다고 한다.
아래는, 위 글에서 가져온 표이다.
manylinux tag | Client-side pip version required | CPython (sources) version embedding a compatible pip | Distribution default pip compatibility |
---|---|---|---|
manylinux_x_y | pip >= 20.3 | 3.8.10+, 3.9.5+, 3.10.0+ | ALT Linux 10+, RHEL 9+, Debian 11+, Fedora 34+, Mageia 8+, Photon OS 3.0 with updates, Ubuntu 21.04+ |
manylinux2014 | pip >= 19.3 | 3.7.8+, 3.8.4+, 3.9.0+ | CentOS 7 rh-python38, CentOS 8 python38, Fedora 32+, Mageia 8+, openSUSE 15.3+, Photon OS 4.0+ (3.0+ with updates), Ubuntu 20.04+ |
manylinux2010 | pip >= 19.0 | 3.7.3+, 3.8.0+ | ALT Linux 9+, CentOS 7 rh-python38, CentOS 8 python38, Fedora 30+, Mageia 7+, openSUSE 15.3+, Photon OS 4.0+ (3.0+ with updates), Ubuntu 20.04+ |
manylinux1 | pip >= 8.1.0 | 3.5.2+, 3.6.0+ | ALT Linux 8+, Amazon Linux 1+, CentOS 7+, Debian 9+, Fedora 25+, openSUSE 15.2+, Mageia 7+, Photon OS 1.0+, Ubuntu 16.04+ |