piping

C++: Read from stdin as data is written into pipe

浪子不回头ぞ 提交于 2021-02-11 11:22:01
问题 I have two C++ programs: one that prints a message to stdout, and the other that listens to stdin and prints all content from the stream. They are named out and in respectively. out.cpp: #include <iostream> using namespace std; int main() { cout<<"HELLO"; usleep(1000000); cout<<"HELLO"; } in.cpp: #include <iostream> using namespace std; int main() { string input; while(cin>>input) { cout<<input; } } As it currently stands, piping the data from out to in waits for two seconds, then prints

C++: Read from stdin as data is written into pipe

Deadly 提交于 2021-02-11 11:22:00
问题 I have two C++ programs: one that prints a message to stdout, and the other that listens to stdin and prints all content from the stream. They are named out and in respectively. out.cpp: #include <iostream> using namespace std; int main() { cout<<"HELLO"; usleep(1000000); cout<<"HELLO"; } in.cpp: #include <iostream> using namespace std; int main() { string input; while(cin>>input) { cout<<input; } } As it currently stands, piping the data from out to in waits for two seconds, then prints

C++: Read from stdin as data is written into pipe

こ雲淡風輕ζ 提交于 2021-02-11 11:19:50
问题 I have two C++ programs: one that prints a message to stdout, and the other that listens to stdin and prints all content from the stream. They are named out and in respectively. out.cpp: #include <iostream> using namespace std; int main() { cout<<"HELLO"; usleep(1000000); cout<<"HELLO"; } in.cpp: #include <iostream> using namespace std; int main() { string input; while(cin>>input) { cout<<input; } } As it currently stands, piping the data from out to in waits for two seconds, then prints

How to close an unbounded and piped stream request in node?

杀马特。学长 韩版系。学妹 提交于 2021-01-29 04:26:21
问题 My node/express application has an endpoint that's proxying a stream of data from an internal service, which is using server-sent events. This means the internal service will continue to stream data in eternity until the connection closes. It works well, but when the browser closes the connection to my node app, the piped connection to the internal service stays open, causing the internal service to have a lot of open/unused connections. So I'm trying to force close the piped connection when

How to close an unbounded and piped stream request in node?

自古美人都是妖i 提交于 2021-01-29 04:22:20
问题 My node/express application has an endpoint that's proxying a stream of data from an internal service, which is using server-sent events. This means the internal service will continue to stream data in eternity until the connection closes. It works well, but when the browser closes the connection to my node app, the piped connection to the internal service stays open, causing the internal service to have a lot of open/unused connections. So I'm trying to force close the piped connection when

r piping image_annotate doesn't work as expected

你说的曾经没有我的故事 提交于 2021-01-28 06:13:03
问题 I am trying to using magick to create an animated gif from a bunch of images. It works just fine but I wanted to annotate text (basically the file name) to each image before creating the gif - and that doesn't work. I can't find the cause of the error (below) - not sure if it is the piping notation, the map function, or something else. library(purrr) library(magick) #set working directory with a couple of png's #This works: image_read("image1.png") %>% image_annotate("Text") #and this works

entering password into openssl command from shell script

不羁岁月 提交于 2020-06-12 08:28:50
问题 I am trying to convert a p12 to a pem from a shell script without any user input. I can have the password as a variable within the script. so when I call: openssl pkcs12 -in *.p12 -out cert.pem -nodes The terminal prints "Enter Import Password:" and waits for input. I tried to pipe the password in with: echo $PASS | openssl pkcs12 -in *.p12 -out cert.pem -nodes as well as trying to use a flag with the openssl command but can't figure out how to do this. 回答1: This one liner worked for me-

R: Using piping to pass a single argument to multiple locations in a function

蓝咒 提交于 2020-01-24 12:04:33
问题 I am attempting to exclusively use piping to rewrite the following code (using babynames data from babynames package: library(babynames) library(dplyr) myDF <- babynames %>% group_by(year) %>% summarise(totalBirthsPerYear = sum(n)) slice(myDF, seq(1, nrow(myDF), by = 20)) The closest I have gotten is this code (not working): myDF <- babyNames %>% group_by(year) %>% summarise(totalBirthsPerYear = sum(n)) %>% slice( XXX, seq(1, nrow(XXX), by = 20)) where XXX is meant to be passed via pipes to

Using dplyr, how to pipe or chain to plot()?

佐手、 提交于 2020-01-12 18:36:11
问题 I am new to dplyr() package and trying to use it for my visualization assignment. I am able to pipe my data to ggplot() but unable to do that with plot() . I came across this post and the answers including the one in comments, didn't work for me. Code 1: emission <- mynei %>% select(Emissions, year) %>% group_by(year) %>% summarise (total=sum(Emissions)) emission %>% plot(year, total,.) I get the following error: Error in plot(year, total, emission) : object 'year' not found Code 2: mynei %>%

Piping process output to new process

懵懂的女人 提交于 2020-01-11 07:29:12
问题 I am having issues piping the output from the rtmpdump process to ffmpeg and I believe the issue is my process is stealing the output of rtmpdump. In my research I have heard of trying to use a cmd.exe process and run rtmpdump.exe as a /C command within that, but this issue is I lose reference to the rtmpdump.exe process that is spawned from that, and I need to be able to manage multiple rtmpdump processes within my program and selectively kill certain ones at times. I initially tried