« first day (4023 days earlier)      last day (936 days later) » 

3:45 AM
Hello world. Is there a non-daemon vnc server solution?
 
 
7 hours later…
11:00 AM
I remember running to this piece of weirdness around 2004 or 2005, when I was first learning Python, and being quite taken aback. Unsurprisingly, it's still contentious.
2978
Q: "Least Astonishment" and the Mutable Default Argument

Stefano BoriniAnyone tinkering with Python long enough has been bitten (or torn to pieces) by the following issue: def foo(a=[]): a.append(5) return a Python novices would expect this function to always return a list with only one element: [5]. The result is instead very different, and very astonishin...

This isn't immediately important for me, but does anyone remember the techniques to determine whether a library being linked to (say in C or C++) is actually being used? I know it's common for unnecessary linkage to happen.
 
 
2 hours later…
1:29 PM
@FaheemMitha it's one of a handful of well-known pitfalls
 
 
2 hours later…
3:49 PM
@AndrasDeak I can't immediately think of any others.
 
4:30 PM
Hi folks. Ran into this little curiosity by accident.
foo(bar) &> xxx
The left side is obviously nonsense, but the error message does not appear to go to either standard output or error. At least, I could not figure out how to capture it.
For the record, the error message is:
> bash: syntax error near unexpected token `bar'
Anything with brackets has a similar effect. I'm thinking that Bash is interpreting it as a subshell, perhaps? Though I rarely use subshells, and can't remember anything about it off-hand.
Somehow I had got the notion that everything goes to standard output or standard error. But perhaps it's going to standard error, but the syntax error is not allowing me to capture it?
 
I think it is going to stderr, but you can't capture it because it isn't the output of running the command: no command was run, the shell failed to understand what you want it to do. So adding &> doesn't capture this since that would only affect the output/error of actually running something, or trying to.
Compare with:
$ bash -c 'foo(bar)'
bash: -c: line 1: syntax error near unexpected token `bar'
bash: -c: line 1: `foo(bar)'

$ bash -c 'foo(bar)' &> xxx
$
 
4:49 PM
@terdon Yes, I guessed it might be something like that. So is there a way to throw an error in that situation? In this case I'm actually running the command via Lua, and trying to capture the stdout and stderr and then erroring out with that. But clearly that's not a bulletproof approach.
OK, perhaps the more relevant question is - can I capture the stderr in this situation, and if so, how?
 
That looks like some kind of hyperlink. Is there a question on one of the Stack sites that you think we could help with?
Also wondering why you've posted it here and to codereview's chat room?
 
@JeffSchaller it is a survey ... so there is no channel where you can reach various channels or users in general ... with good visibility ...
 
posting surveys on SE is generally considered spam and subject to deletion
 
How then can I know the opinion of the users?
 
I believe the Meta sites are the location for that; you post a question for discussion and the Answers are voted on
 
5:00 PM
@JeffSchaller this opinion does not matter?
@JeffSchaller I do not seek votes, I seek to know the opinions of each user of the community.
 
There appears to be some vaguely related discussion here.
17
Q: How do I capture the exit code / handle errors correctly when using process substitution?

GlutanimateI have a script that parses file names into an array using the following method taken from a Q&A on SO: unset ARGS ARGID="1" while IFS= read -r -d $'\0' FILE; do ARGS[ARGID++]="$FILE" done < <(find "$@" -type f -name '*.txt' -print0) This works great and handles all types of filename varia...

But it feels a bit over my head.
 
or those who can participate in a survey
 
When I see too many symbols on one line, I become terrified.
 
@Arcanis-TheOmnipotent you're right that my opinion doesn't matter (very much); see:
18
Q: Are research survey questions expected to be handled with close votes?

gnatThis question (probably soon to be deleted) made me wonder what would be the right way to handle surveys like that: I'm doing a worker interview for High School and I want to be a computer programmer. What is your job title? What is your work history? ... What are the duties of a b...

 
Simple question: does bash try to start a subshell if it sees foo(bar)?
 
5:05 PM
@JeffSchaller Look, I'm speculating that users misuse or abuse negative votes ... but I have no proof, since the decision-making or criteria used is only known by the user; ignoring that there are already rules on the sites ... then I want to give a value to that opinion of the active and current user on the sites ... it is not a survey on personal data.
 
@Arcanis-TheOmnipotent there's been a lot of discussion (more than I know of) on the various Meta sites around this; see for starters:
1202
Q: Encouraging people to explain downvotes

ChrisF Note: If you're looking for a simple explanation as to why comments aren't required on downvotes, see Why isn't providing feedback mandatory on downvotes, and why are ideas suggesting such negatively received?. I used to get "upset" (though that is too strong a term) when I got downvoted wit...

If you feel like you've been unfairly targeted, wait 24 hours for the automatic system to check them, then raise a custom flag and explain the situation to the site's moderator(s).
@FaheemMitha it doesn't look like it gets that far; of course, the source code is available, so you could just trace your way through it (knowing that it ends in "syntax error near unexpected token")
(a subshell would attempt to execute bar and I would have expected it to say something about that instead of a token parsing error)
 
@JeffSchaller I imagine I could learn quite a lot of Bash if I did that. But I was hoping someone could just tell me.
@JeffSchaller Agreed.
I'm tempted to post it to U&L, and hope people don't throw things at me.
 
@FaheemMitha I mean, it sounds like a fun rabbit hole and all, but it smells like an XY problem :)
 
@JeffSchaller No XY here. I just accidentally typed some gibberish, and it was run as part of a much larger program.
 
throwing nonsense at a shell doesn't sound terribly useful, so my suggestion would be to start with your higher-level purpose here
 
5:13 PM
And my program didn't stop for the gibberish. But I'd like it to.
@JeffSchaller See above, and below.
Basically, I'd like to bulletproof my error returning approach. Did I mention it's being run via Lua?
 
you did, and I suspect if you described it in a Question, you could attract the right attention
 
In case anyone is wondering why I typed that rubbish, it was the sort of semantic mixup when you are working with three languages simultaneously. (Not my fault, just the nature of the beast.)
@JeffSchaller OK, I'll consider it. Thanks.
 
@Arcanis-TheOmnipotent I agree 100% with @JeffSchaller, please don't post surveys in random rooms, that won't be well received. One thing though, I had a look at your survey and you might want to change "publications" to "posts", since nothing on the SE network is considered a "publication".
So this will be confusing to anyone who reads the survey unless they are aware of the broader meaning of publicación in Spanish.
 
Just to tried to use some Python 3 syntax in Lua. That's the trouble with trying to write 4 languages at the same time. Again, not my fault.
I spent some time wondering why I was getting an error, too.
 
5:26 PM
@terdon i have update it XD
 
yay, much better! :)
But yeah, there have been LOADS of discussions over the years and most of the active users are clearly in favor of downvotes and there is a very, very clear consensus that requiring comments is unhelpful. In my experience (and I've been on SE for more than a decade now), leaving a comment with your downvote is a sure way to be attacked, have the OP hound you around the network complaining, and have your own posts downvoted in revenge.
 
@terdon I understand that the action has been considered spam and I withdraw from doing so; but I do not see why the google login seems suspicious to them the idea is that it is a single answer per user such as the SE network login ... and I do not understand why knowing the opinion of the users seems to them a bad idea.
 
I often, usually even leave comments with my downvotes, but I have more then enough rep not to care about retaliation. I completely understand why others don't want to do this.
@Arcanis-TheOmnipotent Because this is a classic example of spam. It's the same as emailing people your survey. Unless you know that people want to receive it, it is spam.
 
I mean, a little introduction (of yourself, and the topic) never hurts, either. Starting with "Hi guys help me with this" + shortened link really puts me on the wrong foot.
 
So going into random rooms on chat.SE and posting links to a survey will almost certainly be received negatively. People tend to react negatively to any kind of "chat room bombing", any kind of attempt at mass messaging with no context.
 
5:32 PM
(consider your audience; why are these chat room members interested in this topic?)
 
I would suggest you do as Jeff said: go to the main meta (Meta Stack Exchange) and post there, explaining what you are trying to do and link to your survey. That way, if anyone wants to, they can go and fill it out.
 
I'm not so sure that a MSE survey post would be well-received (given my search results earlier), but I admit I don't have my thumb on the pulse of MSE.
 
Not a survey post, a post explaining what Arcanis is trying to do and linking to the survey.
 
I think there's plenty of prior discussion around the idea, and -- having not clicked on the random link myself -- think you might have more luck having an on-site discussion
 
But yes, that would also most likely not be well received since there have been so, so many discussions about downvotes and comments.
 
5:34 PM
and that
 
it is a problem: MSE only serves to know if they agree or disagree with something; when I am not interested in knowing if they agree with something;
I am not looking for votes neither positive nor against. I seek to know the individual opinion of each user; Given the structure of the SE network this is complicated unless I go to each chat I have tried to know personally the opinion of those who participate and their opinion about personal criteria and how they implement negative votes ... I am not interested in knowing if 5 years ago 5 moderators created a community wiki; I want to hear from users today.
chck that:_
-7
Q: survey-type question can be opened in META?

Arcanis - The OmnipotentA survey-type question can be opened in META to find out the opinion of the community about what they consider and what use they give the negative vote ??? regardless of what the site standard already says ??? or can external tools be used ??? example: https://forms.gle/TsbLerwS2YZXRCrC6

 
The users who care most about SE tend to vote and post on MSE, so my best recommendation is to read through the Q&A's there related to voting.
 
@Arcanis-TheOmnipotent Well yes, that is asking about asking, it isn't asking a question. But the main point I want to get across is that knowing the opinion of every user is not a right, it is a privilege that can only be offered by each user. I understand that you might want to know what userX feels, but that doesn't mean you have the right to send unsolicited requests for information.
 
Apparently U&L doesn't have the tag. I was a little surprised, but decided not to create it. Comments on clarity etc, appreciated -> unix.stackexchange.com/q/673253/4671
 
@terdon ok, help me improve my post in META ??? I don't know how to express myself XD
 
5:48 PM
@Arcanis-TheOmnipotent Well, if you want to post this, don't ask whether you can post a survey question. Just explain why you feel that the dozens of previous discussions don't cover you, explain why you want to ask for individual member's opinions, and then link to your survey.
 
(I still think you'll get a better response if you ask your questions on-site and ask Answerers to respond to them on-site, but that's just my opinion)
 
You really should spend some time understanding the arguments in favor of downvotes and against requiring comments for downvotes though. This is a subject that has been discussed at very, very great length. You might (might) be able to get a good response if you show that you know these arguments, you've tried to understand and you still need something more.
 
it seems to me like you're trying to get the (registered) opinions off-site, which (IMHO) is an uphill battle -- against the idea of SE
 
yeah, that too
 
@terdon it can not :(
 
5:57 PM
@Arcanis-TheOmnipotent OK, there you go then. I'm afraid it won't be possible to do what you want unless you can do it within the tools offered by Stack Exchange.
 
Hmm. Actually, @FaheemMitha, you might be better off asking your LUA question on Stack Overflow instead of here. It isn't really a *nix question, it's a LUA question ("how do I get stderr in LUA natively?"; note that you are using 2>&1 construct which won't help. I would have guessed that the pipe:read("*all") would have gotten it, but it seems not).
 
it is completely absurd; they practically crack that a user knows the opinion of the community and the site does not offer a viable tool ...
 
:59363910 You may think it is stupid, but I really, really appreciate that SE does not offer ways for every random user to contact me.
 
5:59 PM
@terdon Well, the error is originating from shell, and Lua is just trying to grab it.
 
And you are asking about one of the most fundamental features of the SE network. People who object to downvotes most likely don't spend much time in SE.
 
@terdon zorry for the word... i am using google translate .. XD
 
@Arcanis-TheOmnipotent no te preocupes
@FaheemMitha Yeah, so the question boils down to "how do I grab stderr in Lua". Seems like a better fit for SO.
 
Any way that I can grab it in the shell context could be translated to Lua. But I don't currently know of a way to grab it in shell.
@terdon No, if I could grab it in shell, I would be good.
Lua doesn't have magical properties. Most of it is just a thin layer over C.
Sure, I could ask on SO. But I thought I'd try here first.
 
@FaheemMitha It isn't about magic. It is about grabbing the standard error of sh itself and not the standard error of the command you are trying to run within the spawned sh shell.
 
6:02 PM
@terdon I'm not clear on the distinction here, sorry.
BTW, is it still possible to migrate from U&L to SO?
 
@terdon a good tiitle for my post in meta i going to dellete it and reformulate????
 
Basically, you have two things: 1) a system call, in LUA that calls your default shell and tries to run a command. This is what is producing the error. 2) a command that is running within a spawned sh shell. This is not actually giving any error because it is the shell itself (1) that fails.
@Arcanis-TheOmnipotent I don't really know. I don't think it is a good idea to post it at all, since I don't think there is anything at all new to be said about downvotes. So I can't really help, sorry!
 
Well, I have one comment that thinks I should be approaching it from the Lua end.
 
@FaheemMitha yes, exactly.
 
@terdon Running that command on bash directly gives that error. Leaving Lua out of the picture.
I'm at least as interested in knowing how to trap that error in a purely shell context. I think that was the first part of my question.
Not that it's life-or-death or anything.
 
6:07 PM
I just see Unix.SE is now having sponsorship from amazon?
 
@Pandya yes -- unix.meta.stackexchange.com/questions/5846/… came out a few days ago
 
@Pandya AWS, but yes.
 
@JeffSchaller ohk
 
@FaheemMitha Yes, but if you want to know how to trap that, then you might want to remove Lua from the equation. Here's how to get it in the shell:
 
6:12 PM
@AndrasDeak Huh, I don't know most of these. I guess I don't really know Python. <sobs>.
 
terdon@tpad ~ $ bash -c 'foo(bar)' 2>err
terdon@tpad ~ $ cat err
bash: -c: line 1: syntax error near unexpected token `bar'
bash: -c: line 1: `foo(bar)'
 
Would such sponsorship affect the traffic on the site?
 
Though lazy binding is really just a feature, not a gotcha.
Binding varies so much between languages, it would be a mistake to assume behavior.
@Pandya Why would it?
@terdon Excuse my ignorance, but what does bash -c do vs the normal mode of typing the command?
 
Btw, may I ask following Q?
Btw, for how much time they're sponsoring? — Pandya 1 min ago
 
@Pandya I think you already did. :-)
Oh, maybe it spawns a subshell?
 
6:15 PM
@FaheemMitha Haha
 
@FaheemMitha It allows you to capture the stderr of the shell itself instead of only the command being run by the shell.
 
@Pandya I don't know if AWS has linked towards U&L, but I don't see any obvious change in the site's traffic analytics
 
@terdon Yes, I see that. But is it spawning a subshell?
Presumably a temporary subshell.
 
The issue is that 2> redirects the stderr of a command but here there is no command because the shell instruction itself was malformed. So the error is being produced by the bash parent shell itself.
 
@FaheemMitha I thought if that increase traffic on site from Amazon users or some linking refers to I am not sure....
 
6:16 PM
Oh, bash -c "command just means "open a new bash shell and run command in it"
 
@terdon Yes, I see. One could use that bash -c construction inside Lua, I suppose.
 
@JeffSchaller ok
 
@FaheemMitha Or use whatever native way Lua has to capture the standard error for its system calls.
 
@terdon So, spawning a subshell? Or does spawning have a different meaning?
@terdon If it had something, that's what I would be using.
 
@FaheemMitha Yes, it would launch a new shell. That's what lua is doing too.
 
6:17 PM
Though I suppose it doesn't hurt to ask on SO, if it comes to that.
@terdon OK, but I still don't understand. So, I'm typing wkhtmltopdf searchpath(foo.html) foo.pdf 2>&1 1> /tmp/lua_vyOiay on my terminal and I get an error. But there is only one instance of Bash here, the one I'm typing it on.
Where is there a parent or child shell process?
 
@FaheemMitha Yes, and you are not capturing the standard error of the bash instance. You are instead trying to capture the standard error of wkhtmltopdf searchpath(foo.html) foo.pdf .
Try this: run bash 2>err
 
@terdon That's a different standard error?
 
In the shell that opens (you won't see a prompt)
type foo(bar)
Then press Ctrl+C and see what you now have in the err file
@FaheemMitha exactly
19 mins ago, by terdon
Basically, you have two things: 1) a system call, in LUA that calls your default shell and tries to run a command. This is what is producing the error. 2) a command that is running within a spawned sh shell. This is not actually giving any error because it is the shell itself (1) that fails.
terdon@tpad ~ $ sh 2>err
foo(bar)
terdon@tpad ~ $ cat err
sh: line 1: syntax error near unexpected token `bar'
sh: line 1: `foo(bar)'
 
@terdon OK, I think I see. But there should be some way to capture the standard error of bash itself, within bash.
 
@FaheemMitha Maybe there is, but that's not what your question is asking :) That would indeed be 100% on topic here.
 
6:25 PM
I suppose the shell itself doesn't often give an error. Only for syntatic errors.
@terdon It was implied. :-)
 
gotta go, see you all later
 
Implied in 2, to be precise.
> What can I do (if anything) to make sure that I collect the stderr string, and interrupt my TeX program as it should be interrupted?
Any Bash solution could simply be passed on to Lua. Problem solved. Though an Lua approach would work as well, assuming there is one.
Can someone confirm that U&L questions can (still) be migrated to SO, please? I know it used to be possible.
 
@FaheemMitha U&L questions can still be migrated to SO (it doesn't even take a diamond moderator)
 
@FaheemMitha some of them are fairly obscure, to be fair
 
6:30 PM
One of the nice things about Common Lisp is that all those sorts of things are absolutely transparent. And you can often customize them as you like.
Though I suppose it can be confusing for the people reading your code.
@JeffSchaller Oh. So I could do it myself?
 
@FaheemMitha well, that's the shortest route! You delete the U&L post and you post it on SO. But I don't think you can migrate it alone -- it'd take a majority of close-voters to say "close - off-topic - migrate to SO"
@Arcanis-TheOmnipotent as someone who likes to see well-written questions & answers, consider a more specific title than "Another post about downvotes but from a different context". What is it about this post about downvotes that's unique from all of the others? (don't tell me; edit the post)
(imagine you were someone who was interested about SE and was simply scrolling through the list of questions; there's nothing about that title that tells them anything about what's behind it)
((ok, the word "downvotes", but there could be a lot more))
 
@JeffSchaller OK, so I can't do it myself. Noted.
Oh dear. I think I upset someone.
eval is not evil, and that example of mine should be safe. Of if you think it's not -- prove it. — Uncle Billy 8 mins ago
Regardless, I don't think I will ever learn to love eval.
 
it's like anything else -- as long as you understand what it's doing, you can use it carefully. I suppose that's extra-important if you're intending to throw garbage at the shell :)
 
6:45 PM
Well, in most languages, you're just running a string. Which just seems like asking for trouble.
I suppose it's fine for people who never make mistakes.
 
we ask the shell to parse & run a string all the time
 
The shell is as powerful as eval. And shell is as bad on its own as eval.
Compare python where you can't wipe your disk without doing it on purpose, but evaling a string makes it possible. So in python, eval reallly is evil.
Of course a more objective tske is "Eval really is dangerous" (again, in python)
s/tske/take/
 
 
1 hour later…
8:07 PM
I'm confused by this comment. But it's late now. I'll look at it again tomorrow.
But the interesting thing about this is that this error doesn't appear to go to standard output : no it goes, as you asked, to wherever 1 was pointing to originally, ie BEFORE you redirected 1 to the file (usually: 1 was outputing to the terminal, so stderr(2) goes there). if you want to collect both error and output in the same file to then send it to the user (and also do other things with it as you can re-read the file) : cmd... >the_file 2>&1 (which means: redirect stdout to the_file. now redirect stderr to wherever stdout currently is directed to, which is also the_file.). — Olivier Dulac 3 mins ago
 
@FaheemMitha they're pointing out a common misunderstanding; the 2>&1 is a point-in-time redirection; that stderr is redirected to where stdout is now, and then you later move stdout (leaving stderr pointing at the "old" stdout)
 
which might be a non sequitur in context
 
@JeffSchaller Yes, but the error in question isn't going to standard output or error, as I verified, and which doesn't seem to be in contention.
At least not the standard output/error of that particular Bash instance.
 
@FaheemMitha right; because the command never gets off the ground; it's the parent process that's reporting the failure
 
@JeffSchaller Correct. Honestly, I'm not currently understanding his comment, because it's late and my brain has partially shut down. But it also doesn't seem like it would be relevant.
 
8:19 PM
@FaheemMitha goodnight :)
 
Not quite yet.
 
Isn't it something like 2 AM for you?
 
Olivier's comment is irrelevant, yes
 
and good morning to Michael! :)
 
@AndrasDeak It is, yes.
Trying to write a guest review before the time for doing so expires. Though I'm not really sure why I'm bothering.
 
8:24 PM
Just to confirm, will it be too late tomorrow today at 10 AM?
 
@AndrasDeak Apparently I've got 11 hours to do it. Which means I could do it tomorrow, but it's cutting it kind of fine. And I have yoga class in the morning.
 
And the suggestion to use eval is the right one under these constraints, though I'm sure there will be Lua bindings for the stdlib functions you need
 
But I have a template, so could take as little as 5 minutes, if I focus. Though usually I'm very bad at writing these things, because I always think I should pretend to be interested in the guests.
 
when you're more awake and less busy I'd be interested to hear what guests you're talking about
 
Can someone help me solve a mount issue?
Got a drive that is read-only for some reason
 
8:27 PM
@MichaelHomer Thank you for the comments. I would have thought that Lua could capture the Bash standard error if asked nicely. Though perhaps eval is indeed the way to go. Though @terdon's approach with bash -c seems similar and would probably also work.
@AndrasDeak I run an Airbnb. I thought you knew. Though it's been mostly dead since March 2020. When the pandemic hit.
 
Ah, no, I had no idea.
 
My bad.
 
not really, I lurk on and off here and you have no responsibility to broadcast your living situation anyway :P
 
@MichaelHomer Ah, yes. I use that library. Did you have a specific thing in mind?
 
8:31 PM
There is no meaningful difference between running the command with eval, popen (which is running sh -c anyway), or layering in another bash -c
 
@MichaelHomer Oh, if popen is running sh -c, then one should be able to grab the error at that level.
 
@FaheemMitha It has fork, exec, dup, pipe, etc, so you can use those
 
@AndrasDeak I've mentioned it here numerous times before, so I guess I assumed people knew.
@MichaelHomer OK. Well, I'll take a look tomorrow.
@AndrasDeak Honestly, it's not worth the work. Though if you are very isolated (and I am), it's one way to meet people. Including people one would never meet in a thousand years under normal circumstances. Particularly international people.
I've described it to people as a Window to the World.
 
8:45 PM
Coming from you that sounds scary ;)
 
Wow, the guest left a detailed review. "The stay was fine."
I see theirs when I submit mine.
@AndrasDeak Scary?
 
Because of your relationship with windows
 
I was just looking at my reviews (which are public). Mostly they are quite flattering. I'd almost forgotten about them.
My days of hosting international travellers seems like a hundred years ago, though in actual fact it's just been a year and a half, give or take.
@AndrasDeak Meaning MS?
 
yes, it was a joke
 
Though I'm usually quite nervous when reading them, because you never know when someone will decide to post something nasty. It's happened.
I wonder if this explain_fork thing (which I have never heard of before), is relevant. linux.die.net/man/3/explain_fork
And also has no hits on U&L, incredibly.
At least according to Google. That rarely happens.
 
 
1 hour later…
10:13 PM
@terdon are you there?
 
10:26 PM
6
Q: Planned SEDE maintenance scheduled for Oct 15, 2021 and Oct 16, 2021 15:00-17:00 UTC (11a-1pm ET)

Tom LimoncelliDue to ongoing planned network upgrades, data.stackexchange.com (a.k.a. SEDE or the Stack Exchange Data Explorer) may be unavailable for up to 2 hours on Friday and Saturday morning this week. Likely considerably less. Friday, Oct 15, 15:00-17:00 UTC (11am-1pm ET) Saturday, Oct 16, 15:00-17:00 ...

 

« first day (4023 days earlier)      last day (936 days later) »