Uvicorn & Gunicorn
Uvicorn and GunicornUvicorn and Gunicorn are important concepts when developing applications in Python. However, there are many concepts to be aware of in order to fully understand Uvicorn and Gunicorn. The following is a brief summary of the necessary concepts, and the details will be dealt with separately later.Necessary ConceptsStarletteStarlette is a Web application server that can run asynchronously. Starlette runs on top of Uvicorn.FastAPIFastAPI provides many features on top of Starlet...
Gas optimization in Solidity, Ethereum
I’m sorry but my English is terrible. I hope you understand that generously.Recently, I was developing a toy project named Blind Market. It’s a simple P2P trading application using smart contract. I was making a contract using Solidity, and the trade stage proceeded in the order of pending, shipping, and done. The problem was appeared in done phase. The problem was that when I tried to close the transaction by paying the price raised by the seller in msg.value, the following error occurred.Pe...
P2WPKH
P2WPKHP2WPKH란 비트코인 내에서 가장 일반적인 스크립트 형식으로 비트코인 프로토콜에 대한 지불 거래 유형이다. 주소는 1로 시작하는데, 세그윗을 지원하는 새로운 주소 3 또는 bc1로 시작하는 주소보다 훨씬 비싸다. https://mirror.xyz/0xA1d9f681B25C14C1eE7B87f1CF102E73cA3ad4d9/egjhNVklgy_LgZmcTXXAOTBa6ePBqO3Ja9ZSoDIad-8 즉, 비트코인 주소가 1로 시작하면 P2PKH 주소를 사용하고 있는 것이다. 공개키의 간단한 해시이며, 이 해시를 주소로 사용하는 것이다. 이것은 원래 비트코인 주소 형식이었으며 오늘까지도 충실히 작동한다. 레거시 주소는 세그윗과 호환되지 않지만, 여전히 문제없이 P2PKH 주소에서 세그윗 주소로 BTC를 보낼 수 있다. 그러나 레거시 주소 트랜잭션이 더 크기 때문에 P2PKH 주소에서 전송하는 평균 속도는 세그윗 주소에서 전송할 때보다 더 높은 요금이 발생할 수 있다....
<100 subscribers
Uvicorn & Gunicorn
Uvicorn and GunicornUvicorn and Gunicorn are important concepts when developing applications in Python. However, there are many concepts to be aware of in order to fully understand Uvicorn and Gunicorn. The following is a brief summary of the necessary concepts, and the details will be dealt with separately later.Necessary ConceptsStarletteStarlette is a Web application server that can run asynchronously. Starlette runs on top of Uvicorn.FastAPIFastAPI provides many features on top of Starlet...
Gas optimization in Solidity, Ethereum
I’m sorry but my English is terrible. I hope you understand that generously.Recently, I was developing a toy project named Blind Market. It’s a simple P2P trading application using smart contract. I was making a contract using Solidity, and the trade stage proceeded in the order of pending, shipping, and done. The problem was appeared in done phase. The problem was that when I tried to close the transaction by paying the price raised by the seller in msg.value, the following error occurred.Pe...
P2WPKH
P2WPKHP2WPKH란 비트코인 내에서 가장 일반적인 스크립트 형식으로 비트코인 프로토콜에 대한 지불 거래 유형이다. 주소는 1로 시작하는데, 세그윗을 지원하는 새로운 주소 3 또는 bc1로 시작하는 주소보다 훨씬 비싸다. https://mirror.xyz/0xA1d9f681B25C14C1eE7B87f1CF102E73cA3ad4d9/egjhNVklgy_LgZmcTXXAOTBa6ePBqO3Ja9ZSoDIad-8 즉, 비트코인 주소가 1로 시작하면 P2PKH 주소를 사용하고 있는 것이다. 공개키의 간단한 해시이며, 이 해시를 주소로 사용하는 것이다. 이것은 원래 비트코인 주소 형식이었으며 오늘까지도 충실히 작동한다. 레거시 주소는 세그윗과 호환되지 않지만, 여전히 문제없이 P2PKH 주소에서 세그윗 주소로 BTC를 보낼 수 있다. 그러나 레거시 주소 트랜잭션이 더 크기 때문에 P2PKH 주소에서 전송하는 평균 속도는 세그윗 주소에서 전송할 때보다 더 높은 요금이 발생할 수 있다....
Share Dialog
Share Dialog
함수를 호출할 때에, 우리는 값에 의한 호출을 하기도하고 참조에 의한 호출을 하기도 한다.
함수가 호출될 때 메모리 공간 안에서는 함수를 위한 공간이 생성된다. 그리고 함수가 종료될 때, 해당 공간은 사라진다.
int main(void)
{
// 스택변수 a는 Stack Frame에 지역변수로서 할당이 된다.
int a;
a = 4;
return (0);
}
Call-by-value는 말 그대로 값에 의한 호출이다. Call-by-value는 인자로 받은 값을 복사하여 처리를 하는데,
복사된 인자는 함수 안에서 지역적으로 사용되는 local value(지역변수)가 된다.
#include <stdio.h>
int add(int a, int b)
{
printf("a_ptr = %p\n", &a);
printf("b_ptr = %p\n", &b);
return (a + b);
}
int main()
{
int a = 4;
int b = 6;
int c = add(a, b);
printf("a_ptr = %p\n", &a);
printf("b_ptr = %p\n", &b);
return (0);
}
// 주소값이 다르다.
/***************************
a_ptr = 0x16b76322c
b_ptr = 0x16b763228
a_ptr = 0x16b763268
b_ptr = 0x16b763264
***************************/
Call-by-reference는 참조에 의한 호출이다. 변수의 레퍼런스(주소)를 인자로 전달해서
인자로 전달된 변수의 값도 함께 변경할 수 있다.
프로그래밍 구조상 Call-by-value에 비해 메모리적인 우위가 있다고는 하지만, 요즘에는 기기의 성능이 다 좋아서 큰 상관은 없다.
그러나 많은 연산이 들어갔을 때에는 Call-by-value는 과부하의 원인이 될 수 있다.
반대로 Call-by-value는 원래 변수를 터치하지 않고 복사하기 때문에 불변성을 유지할 수 있다는 장점이 있다.
Python의 경우 함수의 호출 방식으로 call-by-assignment를 사용한다.
모든 것을 객체로 취급하는 Python에서는 객체를 크게 두 종류로 구분지을 수 있다.
Immutable : int, float, str, tuple
Muttable : list, dict, set
Immutable 객체가 인자로 전달되면 처음에는 call by reference로 받지만, 값을 변경시키면 call by value로 동작한다.즉 함수 내에서 formal parameter 값이 바뀌어도 actual parameter는 불변성을 유지한다.
반대로 Muttable 객체는 처음부터 call by reference로 동작한다.
함수를 호출할 때에, 우리는 값에 의한 호출을 하기도하고 참조에 의한 호출을 하기도 한다.
함수가 호출될 때 메모리 공간 안에서는 함수를 위한 공간이 생성된다. 그리고 함수가 종료될 때, 해당 공간은 사라진다.
int main(void)
{
// 스택변수 a는 Stack Frame에 지역변수로서 할당이 된다.
int a;
a = 4;
return (0);
}
Call-by-value는 말 그대로 값에 의한 호출이다. Call-by-value는 인자로 받은 값을 복사하여 처리를 하는데,
복사된 인자는 함수 안에서 지역적으로 사용되는 local value(지역변수)가 된다.
#include <stdio.h>
int add(int a, int b)
{
printf("a_ptr = %p\n", &a);
printf("b_ptr = %p\n", &b);
return (a + b);
}
int main()
{
int a = 4;
int b = 6;
int c = add(a, b);
printf("a_ptr = %p\n", &a);
printf("b_ptr = %p\n", &b);
return (0);
}
// 주소값이 다르다.
/***************************
a_ptr = 0x16b76322c
b_ptr = 0x16b763228
a_ptr = 0x16b763268
b_ptr = 0x16b763264
***************************/
Call-by-reference는 참조에 의한 호출이다. 변수의 레퍼런스(주소)를 인자로 전달해서
인자로 전달된 변수의 값도 함께 변경할 수 있다.
프로그래밍 구조상 Call-by-value에 비해 메모리적인 우위가 있다고는 하지만, 요즘에는 기기의 성능이 다 좋아서 큰 상관은 없다.
그러나 많은 연산이 들어갔을 때에는 Call-by-value는 과부하의 원인이 될 수 있다.
반대로 Call-by-value는 원래 변수를 터치하지 않고 복사하기 때문에 불변성을 유지할 수 있다는 장점이 있다.
Python의 경우 함수의 호출 방식으로 call-by-assignment를 사용한다.
모든 것을 객체로 취급하는 Python에서는 객체를 크게 두 종류로 구분지을 수 있다.
Immutable : int, float, str, tuple
Muttable : list, dict, set
Immutable 객체가 인자로 전달되면 처음에는 call by reference로 받지만, 값을 변경시키면 call by value로 동작한다.즉 함수 내에서 formal parameter 값이 바뀌어도 actual parameter는 불변성을 유지한다.
반대로 Muttable 객체는 처음부터 call by reference로 동작한다.
No comments yet