code logs -> 2020 -> Mon, 01 Jun 2020< code.20200531.log - code.20200602.log >
--- Log opened Mon Jun 01 00:00:37 2020
00:55 Kindamoody is now known as Kindamoody[zZz]
01:02 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
02:09 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
02:09 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
02:37 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection closed]
02:38 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
02:38 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
02:54 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
02:54 mode/#code [+o himi] by ChanServ
03:34 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
03:50 Degi [Degi@Nightstar-jua0mt.dyn.telefonica.de] has quit [Ping timeout: 121 seconds]
03:58 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
03:58 Degi [Degi@Nightstar-v7cgj9.dyn.telefonica.de] has joined #code
06:41 Vorntastic [uid293981@Nightstar-ks9.9ff.184.192.IP] has joined #code
06:41 mode/#code [+qo Vorntastic Vorntastic] by ChanServ
07:48
<&[R]>
Man, xs is nice sometimes, but other times it's just... WHYYYYYYY
07:49
<&[R]>
var = `` \n {if {./tst.js >[2=1]} { echo GOOD } else { echo BAD }}; echo $var
07:50
<&[R]>
So that's just a little test I made, tst.js will randomly write something to stderr then exit(1), or write something to stdout and exit(0)
07:50
<&[R]>
I wanted to both capture the output AND the exit code
07:51
<&McMartin>
Whoof. I think I can make Python subprocess do that but it's *not* easy to multiplex on two streams at once like that.
07:51
<&[R]>
So I've got to shove the entire thing into a blockquoted bit with an if/else inside that which outputs special values
07:51
<&McMartin>
Well. It's easy in that it's one spell you incant, but it's not a trivial spelll.
07:51
<&[R]>
IIRC bash just provides the exit value in a special variable
07:52
<&[R]>
Which of course makes that entire thing heaps easier
07:52
<&[R]>
McMartin: I didn't need to capture each stream independantly
07:52
<&[R]>
Just the exit code and all output (stderr+stdout)
07:54
<&McMartin>
Right, there are some dumb things that Python (or C!) can burn you with if you're careless about that, though come to think of it, you don't need to feed it anything in stdin so the problem is ultimately self-solving
07:54
<&McMartin>
(If you need to send data in in response to a prompt from stdout, say, if you haven't drained stderr the program might be blocked on output *to* stderr and you'll both deadlock.)
07:55
<&[R]>
Yeah
07:55
<&McMartin>
(So you basically need a poll-select loop in C, and I think the master control routine in Python subsprocess is called "communicate")
07:55
<&[R]>
node.js is pretty lulzy about how it handles spawning a sub-process
07:55
<&McMartin>
Also can you tell I've been drilling for job interviews
07:56
<&[R]>
You basically have one option: here's a module, it will spawn your sub-process and give you three streams. Two are outputs, one is an input. Have fun.
07:56
<&[R]>
Which is nice if you want to actually take full advantage of that
07:56
<&[R]>
But sucks if you just really want something much simpler
07:56
<&McMartin>
Hm. node I/O is async, though, right? It won't hit this problem because when you try to write or read you're just taking a future back right away and the next one comes in as they are
07:57
<&McMartin>
My intuition is that this should suck less than poll/select
07:57
<&[R]>
Yeah, it's async
07:57
<&[R]>
Just the streams interfaces aren't super great
07:57 * McMartin nods
07:57
<&[R]>
(Also their insanity actually varies between versions)
07:58
<&McMartin>
One of the things I learned from trying to do the Advent of Code stuff in C is that scanf is frickin' hax
07:58
<&[R]>
I've actually had to rewrite a module 5? times now because the stream behavior changed how it buffers shit
07:59
<&[R]>
At one point it was "we won't even start things until you hook up a handler", then it was "yeah, you have to tell us when you want to start the stream", then "you might want to tell us to pause the stream ASAP, then say go after you've setup handlers"
08:00
<&[R]>
Though that paticular library was a WTF to begin with
08:01
<&[R]>
It was actually two libraries, written by the same guy IIRC
08:01
<&[R]>
First one: generic FastCGI handler, one request provided three streams (guess what they were)
08:02
<&[R]>
Second one: PHP-fgi specific stuff, but that one would smash the stderr and stdout streams together, then provide you the result of that
08:02
<&[R]>
Except it also used that smashed together stream internally to handle reading headers
08:03
<&[R]>
Well, if PHP needs to bitch about something serious (like it can't find the file you asked for) it's going to write to stderr, then possibly write the headers
08:03
<&[R]>
Header parse code *really* did not understand that
08:03
<&[R]>
So it'd eat that error silently, then do something completely bizare
08:18 Kindamoody[zZz] is now known as Kindamoody
08:19 celticminstrel [celticminst@Nightstar-ovl74f.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
09:59 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
11:00 catalyst_ [catalyst@Nightstar-v6lb30.cable.virginm.net] has quit [[NS] Quit: -a- IRC for Android 2.1.55]
12:37
< Yossarian>
oh I forgot about cdecl.c
12:52
< Yossarian>
Just asking out loud, what is the preferred formatting of tabs in a code document?
12:57
<~Vorntastic>
If you are using a major framework, follow its style guide. Otherwise do whatever the hell you want so long as you always do that
13:00
< Yossarian>
Go with the flow. Thoughts on softtabs spacing of 4?
13:04
<~Vorntastic>
It's fine
13:07
< Yossarian>
Minor details. That's one of my problems.
13:08
< Yossarian>
I'm interested in the details that don't even concern me. It's like, if I don't know how it all works I get nervous.
13:09
< Yossarian>
And sometimes details that might concern me so I can do proper error checking, I guess.
13:21
< Yossarian>
I'm having some memory problems remembering good advice I got here. I have to start taking my health more seriously.
13:29 celticminstrel [celticminst@Nightstar-ovl74f.dsl.bell.ca] has joined #code
13:29 mode/#code [+o celticminstrel] by ChanServ
14:05 Attilla [uid13723@Nightstar-2dc.p8m.184.192.IP] has joined #code
14:05 mode/#code [+o Attilla] by ChanServ
14:54 Kindamoody is now known as Kindamoody|out
14:59 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
14:59 mode/#code [+qo Vornicus Vornicus] by ChanServ
15:25 Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
15:26 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
16:39 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
16:41 Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
17:00 Vorntastic [uid293981@Nightstar-ks9.9ff.184.192.IP] has quit [[NS] Quit: Connection closed for inactivity]
20:07 Kindamoody|out is now known as Kindamoody
21:45 Kindamoody is now known as Kindamoody[zZz]
22:46 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
23:32 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
23:49 Attilla [uid13723@Nightstar-2dc.p8m.184.192.IP] has quit [[NS] Quit: Connection closed for inactivity]
--- Log closed Tue Jun 02 00:00:38 2020
code logs -> 2020 -> Mon, 01 Jun 2020< code.20200531.log - code.20200602.log >

[ Latest log file ]