« first day (2540 days earlier)      last day (1583 days later) » 
06:00 - 21:0021:00 - 23:00

6:14 AM
@Kusalananda yeah there are definitely times when I’d like to disable my hammers to start a vote instead of insta-closing
@StephenKitt I think this one was warranted though.
@Kusalananda oh yes I wasn’t commenting on the specific question, just the use of hammers in general
@StephenKitt I know, and I agree.
2 hours later…
8:00 AM
Q: Delete folders from FTP which are 100 days older

Sourabh SomvanshiI am using the below mentioned code to delete folders from FTP which are older than 500 days. I am using the find command. The find command does not filter the folders as per expectation. The find command traverses through all the folders but does not deletes the files. I referred all other posts...

at least he did not post the credentials for internet server address
@Archemar yeah... and I had thought the first output line would have been enough clue
3 hours later…
11:49 AM
Just did a 174 commit merge of a feature branch into our develop branch at work. It's the biggest feature merge I've done so far. Scary stuff! (not really, we do proper feature testing)
3 hours later…
3:02 PM
@Kusalananda, nice answer to that while loop question...I didn't know read -p set the 'REPLY' variable if not specified
@sebasth @Archemar sounds like plenty of people need to learn about expect. :-(
@derobert or the full extent of lftp commands (which include find)
I wonder where the idea you can use a heredoc like that came from...
reminds me of the series of incredible heredoc questions we had a few months ago
3:22 PM
Hi, folks.
@StephenKitt Incredible as in very good?
Or as in hard to believe?
@FaheemMitha hard to believe
@StephenKitt Ah
Q: Executing scripts in a shell terminal directly as stdin without heredocuments

BeniaIs there a way to execute scripts in a shell terminal directly as stdin without heredocuments? The reason I avoid heredocument is this method considered by many Bash programmersa as archaic and easily conflicting with common shells, and non cosmetic in case of long heredoc strings presented in t...

and other similar questions by the same user
Having read the WP page on heredocs and kin, I'm still fuzzy what they are and what they are good for. Not that it really matters.
3:37 PM
@FaheemMitha they let you feed a command multiple lines on stdin fairly easily.
3:58 PM
@derobert you mean a multi-line command?
@FaheemMitha no, a command expecting input from its standard input, and where you want to provide multiple lines
@StephenKitt Oh, sorry.
And you can't use a file?
@FaheemMitha in situations where you don’t want to use a file, yes
for example, when trying something on the command line
or in a script, where having the input to the command in the script makes it more understandable than in a separate file
@Jesse_b Yeah, there are a few things that have defaults that not many seems to know about. Another one is for thing; do ...; done, which will loop over "$@".
Nice...another way to handle positional parameters :)
4:10 PM
@StephenKitt Also useful for outputting usage info in a script as a complete document directly instead of as multiple echo or printf calls.
I use them for my help output as well:
@Kusalananda indeed, that too
@StephenKitt as a hammerless person, I wonder: if it's impossible for you to cast a non-hammer close-vote, would Flagging it be an appropriate measure?
@JeffSchaller to get it on the queues? perhaps
(assuming you wanted to get it into the queue for further review)
4:22 PM
is it possible to suggest a duplicate with a flag?
/me goes off to try
Don't think so.
@StephenKitt two ways!
@StephenKitt I don't think so. I mean yes, it is, but for those users who don't have the rep to vote to close. Once you get the rep, you need to vote to close but before you reach it, you can flag.
at least, for my non-hammer self; there's Flag-Dupe, or Flag-Closed-Dupe
ah yes, it is possible
4:23 PM
Really? Still? Even for you high-rep folk?
@StephenKitt It is?
So it is.
@terdon yes, “I am flagging to report this question as a duplicate”
I have closing-rep, but no hammers, and I see two dupe-close routes
But does that register as a flag or as a close vote, I wonder?
4:24 PM
dupe-flag routes rather -
I might be using that instead of close on some questions...
wow @JeffSchaller you get the special badge “I taught a mod something” (ignoring the high-rep users alongside)
@terdon I asked my question of Stephen because I'm boggled how Gilles doesn't show up on the top stats pages;I wonder if they have so many hammers that typical close-votes aren't possible any more (assuming they want community review)
so my hope, to maintain my sanity, was that they were flagging instead of "Closing", or I'm just completely wrong again
I think that'll just cast a close vote. Guess we just need a question to try it on....
@StephenKitt I'm going to hang that badge in my virtual lobby
4:27 PM
@JeffSchaller does the initial close count for the stats? I thought that was just close votes from the queues
@StephenKitt ok
@StephenKitt a great clarifying question; I'd be a little surprised if a close-vote did not count as a close/review stat, but ... I'm used to being surprised by thing I don't know here
@StephenKitt pffft, that one's trivial to get!
@terdon OK it’s just a bronze badge then :-P
@JeffSchaller pretty sure they only count as review stats if done from the review queue
4:28 PM
The flag-close options look really similar to the typical close-options
@JeffSchaller I don't know that he reviews much. I don't, for instance. Since I spend so much time on the site, I tend to see most posts directly so I didn't need to review even before becoming a mod. And since being modded, I am leery of the review queues since I usually don't want to hammer stuff closed if the community can deal with them.
@derobert Yes. Unfortunately.
@terdon that in combination with derobert's statement would explain the situation
I don't review at all. Too hard to make a decision.
@FaheemMitha you can always skip the hard ones :-/
but... but... there are badges to be earned
4:30 PM
I fell into the review queues from the "what are these badges?" thing
@StephenKitt Hmm. Maybe I could sell those badges.
@FaheemMitha for highly valuable Internet points
Think of your virtual lobby!
or helping the site, either way :)
@StephenKitt Yes, those.
That seems an unfortunate side effect of earning a gold hammer; there's a disincentive to cast a vote as it's a larger effect -- so skipping altogether or deciding that it's immediately closeable. Although I suppose there's still candidates for both of those types.
4:34 PM
@JeffSchaller that makes me think of the X-Wing patches
First that I was thinking of was Whose Line Is It Anyway :)
Which is amazingly still on the air. And mostly with the same people!
4:49 PM
Drew Carey?
Last time I saw it, it was with Aisha Tyler
who was the host before Drew, though? I thought there was another
dang. Wish there was a way to search my U&L "inbox". I'm pretty sure Stephane improved one of my "tr" suggestions, but how am I going to find that
a SEDE search for Stephane's "tr" comments joined with posts authored by me??
@JeffSchaller I forget, that was probably when it was British.
In case anyone was wondering about the heredoc discussion, this is why: codereview.stackexchange.com/q/174019/23451
now I've seen it all ... well, a lot more. A PS1 that calls python!?
If you want mercurial anything - that opens a python process too, as I understand it...
5:05 PM
Hmm... A python invocation on every prompt... And here I was wondering if caling hostname in my prompt was a good thing or not.
Well, I do most of my work on a diskless system, and firing up a heavy interpreter takes a second or so...
I have a split brain when it comes to "extra" calls like this. I appreciate the efficiency, but 99% of the time, the computer is waiting for me, so I feel less bad giving it something to do.
@JeffSchaller When it's specifically about something like the prompt, I'm one of those people that would be happy with just PS1='$ '... I don't quite get the prompt pimping thing.
Off topic question: is there a perception in the United States that Amazon customer service is getting worse?
It was never good
@FaheemMitha You're still having issues with Amazon over that SSD thing?
5:18 PM
but yes
@Kusalananda Oh, no. I've given up on that.
I don't much blame amazon though. It's the parcel service's fault but they have good contracts I guess because they are never held accountable
I've been having issues with something else. They have something called ebanking here where you can deduct money from your bank account to pay for stuff. I've been using it for stuff. And it stopped working, and the morons in CS keep assuring me it will be working in a day or two.
It's been 2 weeks.
Anyway, my question was about the US version.
yea well that is all service jobs. "Say anything to get them off the phone"
@FaheemMitha How's Amazon connected to this?
5:20 PM
@Kusalananda It's the service they offer?
Didn't know.
The bank in question tells me that things are ok with them. And I believe it, because it works for other services.
The problem is probably at Amazon's end. But I haven't been able to talk to anyone I can have an actual conversation with.
Just think about the engineers behind the scenes trying to fix it :p. I'm sure it was their intent to have it fixed in 2 days.
But anyway, one more time, was asking about the US service.
@Jesse_b Who says anyone is trying to fix it?
It's OK. The folks at Yahoo support still haven't figured out what SSL or TLS are. Thankfully their managed to figure out how to replace an expired certificate on their own, only took it being expired for the better part of a month.
5:22 PM
Well as someone who works for a large amazon competitor I would like to believe they are that irresponsible but I doubt it
I've called three times and written once. It's very frustrating.
But that's expected, they're owned by Verizon now.
@derobert I'm not sure how that is relevant.
You wanted to know how customer service in the US is...
Though I have no idea where that customer service actually is.
The weird thing is, I was able to use that exact method now when there was a problem with another method. I went in, modified it, and that method that they keep telling me, doesn't work, worked!
Maybe the key is to deliberately fail the order using another method. Though that is completely bananas.
@derobert I was asking about Amazon specifically.
They're getting very big now.
5:24 PM
@Kusalananda I'm with you; although I'm rather used to seeing my current username, hostname, and $PWD -- for situations where I'm sshin'g and su'ing and 'cd'ing around
Actually, they've been very big for awhile.
It wouldn't be surprising if they forgot what made them successful.
Which was good customer service. At least in part.
I haven't had to contact Amazon support in a long time. Except maybe to return something, but they've been good about that.
@Jesse_b Hmm? This is Amazon India.
It's probably that they are trying too much. Amazon has a foot in basically every type of business available right now, they are probably stretched very thin
Anyways, I abandoned the Python exec in a PS1 because (I didn't time or test it much but) it takes too long.
5:25 PM
Not Amazon US. They're not really the same company.
Every time I contact amazon support I'm pretty sure it goes to amazon India :p
The interface is the same, of course.
@Jesse_b For your sake, I hope not.
@derobert Do you still buy from them, then?
@AaronHall takes too long to get right, or to execute each time?
Yea, it could be Nepal or Bangladesh. I'm not great with accents.
And @Jesse_b, it's really not that hard, even in India, to get a purchase method working. Like this e-banking this. I mean, it used to work. With no problem.
5:28 PM
People in the US are no longer willing to work, we don't really employ people anymore
I can't get any sensible info from customer service. It's like talking to a wall.
@Jesse_b Pardon?
@FaheemMitha Yes, quite a bit
@derobert ok
I'm sure it's some application that they recently purchased from a small company and then cleaned house and now nobody knows how to manage it
@Jesse_b Cleaned house? You mean the people who used to run it were fired?
And you are talking about my netbanking issue, right?
5:30 PM
@JeffSchaller getting it right is easy, but the variance in running time is pretty large. it kinda hangs.
Bottom line. I'd really prefer not to think about my online purchasing so much.
@FaheemMitha, Yes. It's just a guess but in my limited experience with acquisitions, generally the goal is to eliminate all employees from the acquired company and just retain their technology
unprimed, half a second, primed, 2 hundredths of a second.
@Jesse_b How wonderful.
@AaronHall I imagine starting up Python and loading all the modules takes a while. If you started up Python on login, and then just queried it for the prompt (using just bash builtins) over a socket... that'd probably work and be quick.
5:32 PM
@Jesse_b btw, who do you work for? If it's not a secret? If it is, please excuse me asking.
Joyent. We are a cloud provider
I already tested it, then I waited... then tested it again, time reported half a second.
@Jesse_b BTW, note that you can reply to messages in chat. Unless you are on a phone, which might be harder.
Though I can't imagine why anyone would be using a phone willingly.
user and system time, really small, real time was pretty big
I mean, for this sort of thing.
5:33 PM
@AaronHall Yeah, but if you left it running and made it into a server, you'd only have to pay that startup time once...
I wasn't following. What's all this about Python and prompts?
@FaheemMitha Is this right? Thanks and sorry...I can see how that would be confusing otherwise.
And when you mention server, just rewriting it in shell is much more maintainable...
@Jesse_b Exactly. There is also a plugin, on Chrome at least, that makes that easier.
@AaronHall That may well be. But if you were really dedicated to using Python to compute your shell prompt, that's how you'd solve the slowness.
5:35 PM
I can dig up a link on request. Actually, not much digging necessary.
35 mins ago, by Aaron Hall
In case anyone was wondering about the heredoc discussion, this is why: https://codereview.stackexchange.com/q/174019/23451
@AaronHall eek
the old aphorism comes to mind... "To a man with a hammer..."
I'd really stick to Bash here. Though I like Python and am not a "shell" person.
You'll get murdered with Python's overhead here. It's not really designed for this sort of thing.
I remember I used a script once for adding Mercurial stuffs to prompts.
It was a nightmare.
Yeah, I abandoned it.
But it worked well to prototype what I wanted to do.
5:40 PM
Python has really slow startup.
Its biggest admirers would never claim its virtues include speed.
10 mins ago, by Aaron Hall
@JeffSchaller getting it right is easy, but the variance in running time is pretty large. it kinda hangs.
The only mainstream scripting type language that is slower is R.
Which is really horribly slow, because the people who founded the project didn't have much of a clue.
And have even admitted it.
Though I'm not so sure how Perl stacks up. Especially startup times.
I think everyone should take some time to watch "Citizenfour". Really worth watching.
Perl's pretty fast AFAIK, but the executable line noise aspect makes it write once kinda code...
5:44 PM
You get to see the heads of the NSA openly lying to Congress, for example. Incredible.
@AaronHall Not sure what you mean.
@FaheemMitha it's practically a meme: perl executable line noise <-- now clickable search
@AaronHall You mean the syntax? I was just talking about speed, and startup times.
@FaheemMitha Perl is fairly fast to start up, unless you use Moose. Moose takes forever.
@derobert Faster than Python, then?
@AaronHall That goes for any language you don't understand. It is perfectly possible to write clear and easy to understand Perl code. If everyone could just please stop trying to craft "one-liners" with it all the time.
5:47 PM
@FaheemMitha Not sure.
@Kusalananda but if you get it all on one line, it runs faster! :D (yes I know that's a fallacious thought)
@AaronHall Blugh
$ time python -c 'print "hello world"'; time perl -E 'say "hello world"'
hello world

real    0m0.017s
user    0m0.010s
sys     0m0.007s
hello world

real    0m0.004s
user    0m0.004s
sys     0m0.000s
Did that a few times, got similar numbers. So Python startup time is ~4x longer.
(I spent 11 year writing a 50k+ line API for bioinformatics in Perl)
@derobert Hmm. Good to know.
5:48 PM
systemd-analyze python?
@Kusalananda You poor fellow.
... and a lot less consistent, actually.
or what's that "blame" flag
@derobert sometimes I get more than half a second....
So might be a bit more than 4x
5:49 PM
@FaheemMitha Best job I've had, so far...
@Kusalananda Oh? Do you like writing Perl?
That's python2. Python3 is slower...
@derobert So I hear. Try R too.
@FaheemMitha I've lost the touch now, but yes, it was nice.
+1 for perl :)
5:50 PM
@Kusalananda hmm
@AaronHall Curious on what system—that's obscenely slow.
@FaheemMitha This is it: github.com/Ensembl/ensembl
Unless we're talking a 486...
But I'm doing it on a server that's handling a lot of other things. My first perl run took .2 seconds of real time... in spite of .002 user and .007 of sys
@Kusalananda Looks like a big project.
5:51 PM
@AaronHall Ah, that could explain it. Very loaded system.
repeat perl calls take .002s...
@FaheemMitha EU funding, has been running since 2000.
@Kusalananda I don't see you among the contributors, though.
Maybe a user name I don't recognise.
$ time echo "hello world"
hello world

real    0m0.000s
user    0m0.000s
sys     0m0.000s
@FaheemMitha I see myself in the history of some files. It was moved to Git after I left. Before that, we used CVS.
5:54 PM
time for ((i=0; i<100; ++i)); do python3 -c 'print("hello world")'; done (etc.) gives me 2.174s for python3, 1.329s for python2, and 0.272s for perl.
@Kusalananda I see. Did they screw up attribution?
Anyways, my Python prototype looked pretty good, then I just needed to redo in shell.
@derobert Big difference!
@FaheemMitha Yeah. The CSV repository had broken histories too.
So 4.8x and 8x start up time differences
5:54 PM
@Kusalananda Too bad.
@FaheemMitha Here's a minor one: github.com/Ensembl/ensembl/commit/…
Using dash -c 'echo hello world' gets 0.112s, and of course just echo hello world gets 0.003.
Three cheers for shell.
@Kusalananda Is the date correct?
So perl is pretty good, but using shell builtins is still a few orders of magnitude faster. As expected.
@FaheemMitha 2010, yes. I worked there between 2003 and 2014.
5:57 PM
Plus, I ain't learning no perl.
@Kusalananda I see. Long time, indeed.
@AaronHall Yes, that's my motto too.
@FaheemMitha All of my 30s, exactly. Well, and a year extra.
my ticket on that was closed with a "won't fix"
talks big, but immediately goes to do a perl tut as soon as he can procrastinate
@AaronHall I keep looking at Lisp... and for an entry-level project that I could apply it to.
Been doing that for the last 20 years...
@Kusalananda learn you some emacs, that'll get you started... :D
6:00 PM
Bah. The tool of the GNU people.
that's gnus to me.
OTOH, if you were to have your Python program open a Unix socket, and then enter a look where it reads one line from it (the CWD) and then writes back one line (the prompt)... I bet your loop would run in under 1ms, and the echo/read on the shell side would keep the total prompt time to well under 10ms.
Not that you shouldn't learn Perl ☺
I'd rather do the socket server with my procrastination time.
@AaronHall You could write a promptd daemon.
Make it part of systemd even.
6:03 PM
all this to echo $?
@Kusalananda That's sad. What Lisp flavor?
I didn't know you were a fan.
Common Lisp, but it's such a huge language.
This should be the next IOCCC -- slowest and largest program to echo $?
@JeffSchaller Nah, we'd clearly replace $? with some binary equivalent that if the command doesn't shut down properly we toss the last day or so of $? (like the journal)
6:04 PM
@Kusalananda Oh, Common Lisp? interesting.
What is your expertise level?
[ "$SHLVL" -gt 1 ] && shell_level="($SHLVL)"
PS1_INSIDE='${debian_chroot:+($debian_chroot)}${shell_level}\u@\h:\w$bad\$ '
        retcode=\$? ;
        if [ 0 -ne \$retcode ]; then
                bad=\" [\\\$?=\$retcode]\"
                echo \"$RED$PS1_INSIDE$NORMAL\"
                echo \"$PS1_INSIDE\";
... that's what I do to echo $?
You sure you don't just want to write a new shell that does it?
AaronHall could write a shell in Python. People have done such things for Perl....
@FaheemMitha Not very high in CL. And I'm damaged by C and other similar languages. I know the basics and I'm able to do simple stuff. But getting it to do something that is useful is a bit beyond me. Most tutorials does'nt talk about interfacing with files and the rest of the system.
But the Python shell he writes would have to have a configurable prompt, so that he could "shell out" to bash to echo $?
6:07 PM
My initials are ACH - so BACH shell...
As long as it's not the PDQBACH shell. ;-p
@Kusalananda if you're not damaged enough by C, then you "should" see ioccc.org
@JeffSchaller I've seen it in the past. Some of those programs are quite neat. I haven't looked at it for ages though. Thanks for the link!
I wonder why they stopped in 2015. Well, the news says otherwise... but no news in 2017.
All the participants were committed to psychiatric wards
6:12 PM
@JeffSchaller Unlikely. I think they were committed to the C++ standards committee instead.
who knows the standards better?!
I'm so bad at chat threading; sorry
AFAIK the C standard remains relatively sane, so they didn't send them to that committee. Hence, must have been the C++ one.
Maybe they all registered for codegolf.stackexchange.com
@JeffSchaller endoh3 from 2015 is a PDP-11 emulator!?
@Kusalananda I spent some time in 2012 learning CL. It's super cool. But the implementations are a bit lacking. As is the general community infrastructure.
6:16 PM
@Kusalananda link; quote: "Strictly speaking, this program does not comply with any C specification for the same reason. But I believe it is reasonably portable."
Though it's not hard to get help with CL. People are quite helpful.
lol: "Note: the program writes a binary to stdout"
@FaheemMitha I might get back to it later, or to Scheme or something similar.
@derobert They who?
I certainly appreciate the creativity involved
6:17 PM
@FaheemMitha IOCCC
@Kusalananda Scheme isn't terribly practical.
@derobert oh
The International Obfuscated C Code Contest? Eww.
Isn't that like a tautology?
Not really. C is a pretty straightforward, though low-level, language.
Now I want to write a prompt with C compiled from a heredoc by gcc.
the gcc should fail with a warning, then set a debug trap to actually execute the program to produce the output
@AaronHall I did see a question somewhere (probably not on U&L) if it was possible to craft a C program that would compile and run itself just like a script, just by having the correct #!-line in the source code.
6:23 PM
don't want to use disk space, though, so create & destroy a ramdisk for it all
@JeffSchaller Extraordinarily, all parentheses match up. But still...
@Kusalananda right?! I apologize in advance for your mental health :)
@JeffSchaller No, I was wrong. They don't. My subconcious instinct was right.
@Kusalananda I believe one's in the /* ... */ comment
@JeffSchaller I see three in comments.
Never mind.
6:46 PM
@Kusalananda Do you ever write CL code these days? For practice or recreation?
con... fusal.
@FaheemMitha No, not since a couple of years. When I did, it was to tickle my brain.
@Kusalananda It's a shame more people don't use it. But network effects are strong. And they seem to mostly work against Lisp.
BTW I really like shell functions.
I wonder if I'm qualified to start answering any questions on the main site yet...
I can write new answers to old questions when I see there's a lack of quality in the existing answers...
@Kusalananda The only problem with Lisp is that skidding feeling you get when all the usual landmarks have been removed. I'm not a fan of the descendants of Algol, but that syntax does make it easier to keep track of where you are.
In Lisp you basically get a pile of parens, all looking exactly alike.
6:57 PM
@FaheemMitha seems like everytime I mention that the syntax of C and Java etc... languages comes from Algol nobody knows what I'm talking about.
@FaheemMitha Indentation helps with that, but yes, some of the Lisp code I've written is write-only.
@AaronHall Apparently you just met an exception.
Nope, because you mentioned it first.
@FaheemMitha Algol, I've never used it, but I do know of it and it's influence on e.g. sh.
@Kusalananda Sure. And I expect it's just a matter of getting used to it. And developing different navigational tools.
The thing is that we're used to depend on certain things. And when those things are taken away, it's hard to adjust.
6:59 PM
The only reason it's not do .. od in the shell is because the od utility already existed.
Hmm! Is it just me, or does this seem like a bug in bash's handling of (negative) numbers? I found an earlier reference to a similar case
@JeffSchaller It's an octal number problem I think.
The leading zero indicates an octal number, but then you get 8 and the shell errors out.
@Kusalananda but they're specifically prefixing the 10# to "force" base-10
echo $((10#009)) is 9, but echo $((009)) fails; that's not exactly the case here
@JeffSchaller But to compute ${basename}+10 first...
... then to convert.
@Kusalananda does the + come first, or the 10#{basename}?
if the +10 happened first, -008 would --> 2
7:08 PM
Well hosetly I don't know. but it seems resonable to believe that the 10# would operate on the number produced by the addition.
I love it. A good question from Tim :) real code, real consequences, surprising results, clear question
Yeah. I'm upvoting it now.
7:38 PM
Liberates himself from the von Neumann programming style
1 hour later…
8:55 PM
@derobert even with expect it imho easily gets rather messy if you doing anything more complex
06:00 - 21:0021:00 - 23:00

« first day (2540 days earlier)      last day (1583 days later) »