« first day (1298 days earlier)      last day (3661 days later) » 

6:39 AM
milestone1 3k points reached yipeeeeeeeeeeeeeeeeeeeeeeee
 
slm
7:20 AM
@Ramesh - congrats!
 
 
2 hours later…
9:47 AM
@slm you don't need the parentheses here, that's your Perl-fu bleeding over :)
Also, you will return the largest number which is not necessarily the longest.
 
 
1 hour later…
11:17 AM
@terdon - you don't need any of that stuff at al.. Just printf and tr.
 
@mikeserv Show me
Ah, reading your answer now
 
printf \\r%s $(tr -sc 0-9 \ )
 
@mikeserv That won't work, it simply joins all digits together.
 
Not at all.
 
Ah, no hang on.
testing again
 
11:20 AM
Any sequence of characters that is not a number becomes a single space.
You could use anything in $IFS though. And you don't even have to -squeeze because $IFS will do that anyway, but tr is faster at it than the shell is.
 
@mikeserv Heh, that's a clever use of printf. Won't print the longest though, only the last one:
echo 0000000000000000000000000012341234askdlfm0000000000012 | printf "\r%s" $(tr -sc 0\\n-9 \ )
That returns 0000000000012
Also, the actual string being printed includes both numbers, they're just not shown cause of the \r so that might break scripts downstream.
 
There's something wrong with that...
The byte string includes the \\r's too - but he asked how to print them.
Anyway, read takes care of that if you want to save it.
 
@mikeserv True but they are being printed, just not shown.
 
They're being printed over.
 
The more important issue is that you're not printing the longest number, you're simply printing all of them and displaying the last one.
 
11:24 AM
With the right terminal setting they completely disappear.
I know theres something wrong with your output - that shouldn't happen. I have to test that.
 
@mikeserv You're not testing for the longest string
 
I don't have to.
You had a \tab in yours somehow.
 
@mikeserv Yes you do, that's what the Q is asking for,
@mikeserv:
echo 0000abc00 | printf "\r%s" $(tr -sc 0\\n-9 \ )
returns 00 not 0000
Well, it actually returns \r0000\r00 but that's the second problem.
 
That's what happens when you save it - I have to just the \\033 home escape instead.
It'll just take a second to remember whatt that is.
 
Save it? No, that's what's actually printed, run it through od -c to check.
Anyway, the most important issue is that you;re not doing what the question asks for. It's a shame cause that's a damn fine trick, just not an answer to the problem.
 
11:46 AM
You have some crazy character in there - was it a control m?
That's why it was broken. I can fix that too - just need one more tr.
 
@mikeserv No I don't. It's just that your solution does not look for the longest number it prints all of them, and the \r makes only the last one visible. That's not what the OP was asking for.
 
slm
12:10 PM
@terdon thanks, what number isn't the the largest and also longest? I cannot find an example that sort -n doesn't deal with.
 
@slm 0000000000001 and 2
 
slm
@terdon - there's one
 
Or 0.0000000000001 and 2
 
slm
when he said strings I took it to mean literal strings of numbers
no decimals
 
@slm Fair enough, but he also said:
> Note: I am looking for the longest continuous sequence of numbers, not for the numerically higher value
 
slm
12:13 PM
yeah I read that 50 times trying to make sure I was working right 8-)
hadn't thought of 00000's
 
Heh, great Q&A on backticks by the way, going for your 100?
 
slm
trying
my wait A is "waiting" at 84. Maybe this one. Starting to feel like ahab
@terdon - got any other strings?
$ for i in $(echo $str0 | grep -oP "\d+");do a=$(echo "$i" | wc -c); echo "$a $i";done|sort -n | tail -1|cut -d" " -f2
0000000000001
seems like I might be able to do it without the for loop
 
 
1 hour later…
1:35 PM
@slm awwww :)
@slm That should work perfectly, it also catches 00000100000000 and the like.
 
2:23 PM
@slm, Thanks :)
 
2:45 PM
@Ramesh Hey, yes, well done!
 
I threw a race into the close queue again because I think the older dupe should be closed instead. Here's the old one, get it closed first:
7
Q: How can you determine which process scheduler is being used?

davebI.e. is it the O(1) scheduler, the CFS scheduler, or an older one?

 
@TAFKA'goldilocks' Huh? Why? The old one looks better and already has answers.
 
@terdon No, the newer has a better answer because it actually explains the issue (there is not more than one scheduler), whereas the old one does not, although the old one could be read as presuming you understand this already.
 
3:13 PM
@TAFKA'goldilocks' Ah, I see, sorry, I had not really read it.
voted
 
@terdon, Thanks a lot :)
 
 
2 hours later…
5:15 PM
17
Q: Is programming, in a game, on topic here?

EnderSometimes, within a game you find programmable entities. A great example are the Turtles of Computer Craft, a minecraft mod. If I had a question about programming Turtles, or anything else that's programmable, WITHIN a game, is that on topic or off topic?

Interesting, and related to our "is C on topic" question
 
 
4 hours later…
8:48 PM
-1
Q: How to set up a cron entry that runs at 00 and 30 after the hour?

WesI have a cron entry that runs every 30 minutes - */30 * * * * /home/myuser/myscripts.sh How to set this up such that it runs exactly at 30 minute intervals but also exactly at (for example) 3:00 PM, 3:30 PM, 4:00 PM, 4:30 PM and so on. So I'm not only interested in the 30 minute interval ...

... does */30 really mean something different than 0,30 ?
man 5 crontab isn't fully clear
/n syntax is non-standard but common extension, so I can't just check the spec
but it appears to work that way on my system
 
@derobert debian?
 
Yeah, I tested on Debian
 
> For example, ``0-23/2'' can be used in the hours field to spec‐
ify command execution every other hour
don't say anything about *
> so if you want to say every two hours'', just use */2''.
ok apparently it does
 
A field may be an asterisk (*), which always stands for ``first-last''.
so actually, it does say that */30 means at 00 and 30
 
9:01 PM
on Debian at least. No idea about the weird versions of crond that may exists on, say, Ubuntu. Or Arch.
 
@derobert apparently
let me check ubuntu patches, but I doubt they changed anythin
 
I doubt Ubuntu is different
 
slm
@Braiam Too little info to do anything with it. If he fills in more info I'll take it
 
@slm Probably OP failed to fix the network config. At least on Debian, you'd have to change the MAC address that corresponds to eth0 in the udev config
 
slm
@derobert - yeah
 
9:05 PM
is so good being free of university!
now only 2 exams left (finals, but I can be exonerated of 1) and one presentation I have to listen
@slm if you write [unix.se] the thing is automagically converted to Unix & Linux in the comments ;)
 
slm
muhaaahhhh
thanks
 
 
2 hours later…
@Braiam oh dear...
 
@derobert Braiam really does have an evil streak... :)
That's pure geek baiting that is.
 
@terdon no it's not. this is real:
 
@strugee Yeah, exactly. I love that one, you should have seen the face of my Physicist housemate when I showed him :)
 
Hah
 
10:59 PM
<3 xkcd
 
It's OK. It's a 1-rep, brand-new AU user, who has probably already destroyed his system. Won't be back to answer followups.
 
VTC'ing!
on the xkcd topic... apparently there's an spanish translation of the thing!
I didn't knew!
 
@Braiam, is there a meta post on meta.se explaining the new orange thingie? Is that all review items?
 
@Braiam really. that's awesome.
 
@Braiam Really? Where?
 
11:06 PM
BEHOLD! THE XKCD IN SPANISH! es.xkcd.com
@terdon I presume since they removed the 10k flag queue, and now replaced it with the LQ review queue... I have to presume too many things but was expected... I think
 
@Braiam Yeah, that's what I thought but it's not mentioned in the close 10k Q.
 
12
A: Notify users of possible reviews on toolbar

Anna LearAs of a few minutes ago, we are replacing the pending suggested edit count in the top bar with the number of pending reviews for diamond moderators and folks with the "moderation tools" privilege (i.e. 10k users on graduated sites and whatever that level's at on betas): We are excluding the Cl...

 
And that is so weird in Spanish. Good translation though, and in "proper" Spanish, not your strange dialects, they wrote coño!
 
@terdon yeah, through I think that some nuance may be lost :/
 
Always is. And I just noticed I forgot to add a :P at the end of my last post, I hope you knew it was implied.
 
11:10 PM
well, I think the guy translating is either Argentinian or Spanish
"venga ya" is a exclusive phrase of those countries
 
@Braiam Not at all, it's also used in Spain.
 
@terdon how is that different from what I've said?
 
@Braiam It isn't, I misread what you said as Argentinian Spanish, I missed the and
 
you mean the "or"
 
@Braiam Hmm, I think it's time for bed...
Thanks for the meta post by the way, just what I was looking for.
It's not active on U&L yet.
 
11:16 PM
if (items_in_review > 10) { show() }
 
@Braiam Ah, makes sense.
 

« first day (1298 days earlier)      last day (3661 days later) »