'잡동사니'에 해당되는 글 13786건

  1. 2022.09.24 병원 투어
  2. 2022.09.23 golang package main
  3. 2022.09.23 golang REST client
  4. 2022.09.23 Xeon 열쇠고...리?
  5. 2022.09.22 한국 대통령 미국 의회에서 망언?
  6. 2022.09.22 2020년형 올데이 그램 써멀패드 작업
  7. 2022.09.21 ipc 성능 비교
  8. 2022.09.21 posix message queue
  9. 2022.09.20 zeroMQ
  10. 2022.09.16 jquery ajax delete가 없다?

어우.. 돈돈돈 ㅠㅠ

 

구강검진이라 난 별로 안나왔지만

애들 구강 검진+치료 에서 왕창 깨짐

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

100MBps 지만 그래도 행복해!  (0) 2022.09.28
김치 냉장고 지름  (0) 2022.09.25
비데 교체  (0) 2022.09.12
오랫만에 자전거 그리고  (0) 2022.09.11
연휴의 시작  (0) 2022.09.08
Posted by 구차니
Programming/golang2022. 9. 23. 15:45

main을 지정해주어야 실행가능한 바이너리로 빌드 되는 느낌.

 

// 파일 생성되지 않음
$ go build client.go

// 강제 생성
$ go build -o client client.go
$ ls -al
-rw-rw-r--  1 minimonk minimonk    7014  9월 23 15:42 client
-rw-rw-r--  1 minimonk minimonk     102  9월 23 15:41 client.go

$ file client
client: current ar archive

$ ar -t client
__.PKGDEF
_go_.o

 

빌드시 static link가 기본이라 그렇지 main 패키지가 아닌 파일은

단순 object로 빌드가 되어 용량이 적게 나온다.

'Programming > golang' 카테고리의 다른 글

go mod init 과 go build  (0) 2022.09.27
golang 함수 인자에 함수 넣기  (0) 2022.09.27
golang REST client  (0) 2022.09.23
golang 'go doc'  (0) 2022.09.15
golang main arg, getopt  (0) 2022.09.15
Posted by 구차니
Programming/golang2022. 9. 23. 15:06

 

[링크 : http://golang.site/go/article/103-HTTP-POST-호출]

 

net/http 패키지에 Get() Post() 명령등을 사용하면 간단하게 보낼수 있는 듯.

resp, err := http.Get("http://example.com/")
...
resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf)
...
resp, err := http.PostForm("http://example.com/form",
	url.Values{"key": {"Value"}, "id": {"123"}})

[링크 : https://pkg.go.dev/net/http]

 

Put() Delete()는 http.NewRequest()를 이용하여 http.MethodPut / http.MethodDelete 타입으로 만들어 주면

기본 모듈로도 충분히 구현 가능한 것 같다.

func put() {
    fmt.Println("3. Performing Http Put...")
    todo := Todo{1, 2, "lorem ipsum dolor sit amet", true}
    jsonReq, err := json.Marshal(todo)
    req, err := http.NewRequest(http.MethodPut, "https://jsonplaceholder.typicode.com/todos/1", bytes.NewBuffer(jsonReq))
    req.Header.Set("Content-Type", "application/json; charset=utf-8")
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        log.Fatalln(err)
    }

    defer resp.Body.Close()
    bodyBytes, _ := ioutil.ReadAll(resp.Body)

    // Convert response body to string
    bodyString := string(bodyBytes)
    fmt.Println(bodyString)

    // Convert response body to Todo struct
    var todoStruct Todo
    json.Unmarshal(bodyBytes, &todoStruct)
    fmt.Printf("API Response as struct:\n%+v\n", todoStruct)
}

func delete() {
    fmt.Println("4. Performing Http Delete...")
    todo := Todo{1, 2, "lorem ipsum dolor sit amet", true}
    jsonReq, err := json.Marshal(todo)
    req, err := http.NewRequest(http.MethodDelete, "https://jsonplaceholder.typicode.com/todos/1", bytes.NewBuffer(jsonReq))
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        log.Fatalln(err)
    }

    defer resp.Body.Close()
    bodyBytes, _ := ioutil.ReadAll(resp.Body)

    // Convert response body to string
    bodyString := string(bodyBytes)
    fmt.Println(bodyString)
}

[링크 : https://www.soberkoder.com/consume-rest-api-go/]

'Programming > golang' 카테고리의 다른 글

golang 함수 인자에 함수 넣기  (0) 2022.09.27
golang package main  (0) 2022.09.23
golang 'go doc'  (0) 2022.09.15
golang main arg, getopt  (0) 2022.09.15
golang json  (0) 2022.09.15
Posted by 구차니
개소리 왈왈/컴퓨터2022. 9. 23. 14:36

일단은 전체를 하려니 너무 투박하고 무거워서

무게를 조금 줄일겸 깔끔하게 만들려고 뚜껑을 떼었으나

2세대 샌디 기반이라 인듐 솔더 된 모델이다 보니 잘 떼어지지 않을건 예상했으나

 

두둥!! 거의 모든 실리콘과 일부의 실리콘 - PCB 연결부분이 뜯겨져 버렸다.

 

 

조금 더 손을 보니, 더 구려지는 효과가... OTL

1000번 사포 이런걸로 살살살 밀면 좀 광택이 나려나?

 

일단은 아래 구멍을 좀 더 넓히고, 하단의 실리콘 부서지거나 다칠걸 고려해서 순간접착제를 부어서 굳히거나

투명 레진을 부어야 하나 갈등 중. 그것도 아니라면.. 접착식 아스테이지?!

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

ai 그림  (0) 2022.11.07
로지텍 M185  (0) 2022.09.26
2020년형 올데이 그램 써멀패드 작업  (0) 2022.09.22
HDMI to USB (capture)  (2) 2022.08.01
USB to HDMI.. 다른 제품  (0) 2022.07.29
Posted by 구차니

처음부터 되서도 안되고 잘 할거라고 생각도 안했지만

하.하.하.

 

내 생에 내 입에서

박근혜가 차라리 나았다 소리가 나오게 될 줄이야.

 

 

지금 국회에서 이 xx들이 승인 안 해주면 바이든이 x 팔려서 어떡하나

[링크 : https://v.daum.net/v/20220922204418464]

Posted by 구차니
개소리 왈왈/컴퓨터2022. 9. 22. 12:30

다시 뜯어보니 그램이나 플렉스 알파나.. 블로워 팬 낮은건 노답인 것 같고(풍량이 어림도 없을..)

 

코어는 꽤 큰 편인데 히트 파이트 하나만으로 식히려고 하니 가능할리가?

 

중앙 약간 왼쪽의 흰색 프라스틱 지지대 높이 까진 올라야 밑판에 닿을수 있을 것 같다.

 

굴러 다니는(?) GELID 서멀패드를 대충 달라서 찹!

 

찹찹!

 

밑판을 조립했다 빼내니 밑판에 써멀이 달라붙었다. 높이는 문제 없다는 의미니 조립 고고!

 

 

이전에 남겨 놓은게 없어서 비교 자료가 없어서 아쉽..

아무튼 가만 냅둬도 60은 기본으로 넘었는데 조금은 양호해진 느낌.

밑판이 좀 많이 멀고 재질도 마그네슘인가 그래서 알루미늄보단 열전도가 떨어지는 느낌?

 

아무튼.. 이 녀석.. 30도 이하로 떨구긴 글러 먹은 듯

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

로지텍 M185  (0) 2022.09.26
Xeon 열쇠고...리?  (0) 2022.09.23
HDMI to USB (capture)  (2) 2022.08.01
USB to HDMI.. 다른 제품  (0) 2022.07.29
USB3.0 to HDMI  (0) 2022.07.28
Posted by 구차니
Linux API/linux2022. 9. 21. 19:08

zmq는 이런데서는 확 떨어지는 구나

 

Shared Memory > MQ > UDS > FIFO > Pipe > TCP 이런식인데

POSIX Message Queue가 생각외로 성능이 잘 나와서 놀랍다.

IPC Message rate
Pipe 36539 msg/s
FIFOs (named pipes)  26246 msg/s
Message Queue  67920 msg/s
Shared Memory  3821893 msg/s
TCP sockets 22483 msg/s
Unix domain sockets  40683 msg/s
ZeroMQ  15414 msg/s

 

[링크 : https://stackoverflow.com/questions/50171306/message-queue-vs-tcp-ip-socket-which-ipc-is-faster-in-linux]

'Linux API > linux' 카테고리의 다른 글

SIGPIPE  (0) 2022.10.17
linux ipc 최대 데이터 길이  (0) 2022.10.11
posix message queue  (0) 2022.09.21
zeroMQ  (0) 2022.09.20
파일 존재유무 확인하기  (0) 2022.02.11
Posted by 구차니
Linux API/linux2022. 9. 21. 19:01

4세대 벤치에서는 mq가 udp sock보다 빠르다고

https://the-linux-channel.the-toffee-project.org/index.php?page=8-tutorials-research-socket-overhead-in-linux-vs-message-queues-and-benchmarking

https://reakwon.tistory.com/m/209

'Linux API > linux' 카테고리의 다른 글

linux ipc 최대 데이터 길이  (0) 2022.10.11
ipc 성능 비교  (0) 2022.09.21
zeroMQ  (0) 2022.09.20
파일 존재유무 확인하기  (0) 2022.02.11
select, poll, epoll  (0) 2021.11.02
Posted by 구차니
Linux API/linux2022. 9. 20. 14:43

ZMQ 혹은 0MQ 라고도 쓰는것 같은데 접속 모델부터 좀 찾아 보는 중

 

REQ-REP는 단순(?)한 요청-응답 모델이고

PUB-SUB는 서버에 의한 broadcast 모델 pipeline은 아직 모르겠다.

REQuest-REPly
PUBlisher - SUBscriber
PUSH- PULL (pipeline)

[링크 : https://soooprmx.com/zmq의-기본-개념들/]

[링크 : https://makersweb.net/opensource/19422]

[링크 : https://zeromq.org/]

 

Figure 2 - Request-Reply Figure 4 - Publish-Subscribe Figure 5 - Parallel Pipeline
Figure 6 - Fair Queuing    
   

[링크 : https://zguide.zeromq.org/docs/chapter1/]

 

Shared Queue (DEALER and ROUTER sockets)
In the Hello World client/server application, we have one client that talks to one service. However, in real cases we usually need to allow multiple services as well as multiple clients. This lets us scale up the power of the service (many threads or processes or nodes rather than just one). The only constraint is that services must be stateless, all state being in the request or in some shared storage such as a database.

[링크 : https://zguide.zeromq.org/docs/chapter2/]

 

Request-Reply Combinations
We have four request-reply sockets, each with a certain behavior. We’ve seen how they connect in simple and extended request-reply patterns. But these sockets are building blocks that you can use to solve many problems.

These are the legal combinations:

REQ to REP
DEALER to REP
REQ to ROUTER
DEALER to ROUTER
DEALER to DEALER
ROUTER to ROUTER

[링크 : https://zguide.zeromq.org/docs/chapter3/]

 

Messaging Patterns

Underneath the brown paper wrapping of ZeroMQ’s socket API lies the world of messaging patterns. ZeroMQ patterns are implemented by pairs of sockets with matching types.
The built-in core ZeroMQ patterns are:
  • Request-reply, which connects a set of clients to a set of services. This is a remote procedure call and task distribution pattern.
  • Pub-sub, which connects a set of publishers to a set of subscribers. This is a data distribution pattern.
  • Pipeline, which connects nodes in a fan-out/fan-in pattern that can have multiple steps and loops. This is a parallel task distribution and collection pattern.
  • Exclusive pair, which connects two sockets exclusively. This is a pattern for connecting two threads in a process, not to be confused with “normal” pairs of sockets.
XPUB socket
Same as PUB except that you can receive subscriptions from the peers in form of incoming messages. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix are also received, but have no effect on subscription status.
XSUB socket
Same as SUB except that you subscribe by sending subscription messages to the socket. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix may also be sent, but have no effect on subscription status.

[링크 : https://zeromq.org/socket-api/]

 

int zmq_device (int device, const void *frontend, const void *backend);
ZMQ_QUEUE starts a queue device
ZMQ_FORWARDER starts a forwarder device
ZMQ_STREAMER starts a streamer device

Queue device
ZMQ_QUEUE creates a shared queue that collects requests from a set of clients, and distributes these fairly among a set of services. Requests are fair-queued from frontend connections and load-balanced between backend connections. Replies automatically return to the client that made the original request.

This device is part of the request-reply pattern. The frontend speaks to clients and the backend speaks to services. You should use ZMQ_QUEUE with a ZMQ_XREP socket for the frontend and a ZMQ_XREQ socket for the backend. Other combinations are not documented.

Refer to zmq_socket(3) for a description of these socket types.

Forwarder device
ZMQ_FORWARDER collects messages from a set of publishers and forwards these to a set of subscribers. You will generally use this to bridge networks, e.g. read on TCP unicast and forward on multicast.

This device is part of the publish-subscribe pattern. The frontend speaks to publishers and the backend speaks to subscribers. You should use ZMQ_FORWARDER with a ZMQ_SUB socket for the frontend and a ZMQ_PUB socket for the backend. Other combinations are not documented.

Refer to zmq_socket(3) for a description of these socket types.

Streamer device
ZMQ_STREAMER collects tasks from a set of pushers and forwards these to a set of pullers. You will generally use this to bridge networks. Messages are fair-queued from pushers and load-balanced to pullers.

This device is part of the pipeline pattern. The frontend speaks to pushers and the backend speaks to pullers. You should use ZMQ_STREAMER with a ZMQ_PULL socket for the frontend and a ZMQ_PUSH socket for the backend. Other combinations are not documented.

Refer to zmq_socket(3) for a description of these socket types.

[링크 : http://api.zeromq.org/2-1:zmq-device]

'Linux API > linux' 카테고리의 다른 글

ipc 성능 비교  (0) 2022.09.21
posix message queue  (0) 2022.09.21
파일 존재유무 확인하기  (0) 2022.02.11
select, poll, epoll  (0) 2021.11.02
Unhandled fault: external abort on non-linefetch  (0) 2021.05.25
Posted by 구차니
Programming/jquery2022. 9. 16. 14:40

ajax에서 DELETE로 하면 된다고 해서 해보는데 크롬에서 보면 자꾸 POST로 보내는 것 같기도?

아무튼.. 다시 해보니 되긴한데 머가 잘못되었던 걸까...

 

jquery 문서에는 1.9.0에 추가된 기능으로 POST GET PUT 과 같은 방법을 입력한다고 되어있는데

왜 DELETE가 언급이 안되어 있는걸까?

 

method (default: 'GET')
Type: String
The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)

type (default: 'GET')
Type: String
An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0.

 [링크 : https://api.jquery.com/jquery.ajax/]

'Programming > jquery' 카테고리의 다른 글

jquery ajax auth  (0) 2023.07.27
jquery-cookie 라이브러리  (0) 2022.09.05
jquery 우클릭 가로채기  (0) 2019.06.04
jquery ajax json flask  (0) 2019.01.07
jquery this 버튼 checked  (0) 2019.01.07
Posted by 구차니