« first day (1430 days earlier)      last day (3818 days later) » 
00:00 - 22:0022:00 - 00:00

00:00
And berating people about it too. Though it is obvious even to me that he doesn't know much about C++.
Self confidence is good to an extent. He kind of goes overboard with it, though.
I was mostly referring to C being rather close to C++ and how rude Linus can be ;)
But that hating was an afterpoint, so to speak.
@Seth Don't get the irony bit, then
@FaheemMitha Where do you think Linus would hang out if he were on SO? Granted, his hate for C++ might extend to not entering a C++ room, but lets say it didn't. He'd fit right in! That was the irony, you comparing them to him.
@Seth Ok. And I don't really seem him hanging out on SE. I think he likes to do non-computer things when not working.
Not that I know much about him. But I've read his blog occasionally. He mentions that he reads a lot.
@FaheemMitha No, I can't see him hanging out on SE either.
00:05
@Seth We're agreed, then. Though De Icaza for example has an account here, though he hasn't been active in years.
@mikeserv yeah. that is for sure.
 
3 hours later…
02:56
@FaheemMitha - I dunno if that is sarcasm, but - admittedly abnormally - I'm not joking. You'll find all kinds of Stephane's going back at least a decade. In the following answer to his question, I quote his own newsgroup email from 11 years ago:
3
A: explanation on chown(1) POSIX spec

mikeservThe Microsoft Interix Unix subsystem (now retired) for its NT kernel dealt a little differently with user and group permissions than some others do: User and group information is stored in the Security Access database. Both users and groups are stored in the same database, but group and user ...

 
3 hours later…
05:30
@mikeserv That change on getopts is fine. I never made the move beyond bash (after sh, csh, ksh, tcsh, all of them a long time ago) to ksh or other alternatives. So I am not surefooted about other shells capabilities. (And since I do anything more than simple in Python, that situation is unlikely to change reps. improve)
@Anthon - thanks. It was a really good answer, and better even than it seemed you knew. getopts, by the way, is really fun to do crazy things with when it comes to array handling.
05:42
@Anthon - also, I don't edit other people's stuff very often, so I never know where the ok line is, you know? Thanks for not getting pissed.
 
2 hours later…
08:04
@mikeserv No, not sarcasm. Not sure why you would think it is. Some people are really good at picking up stuff quickly. That is all. I guess maybe Stefane has been doing it a long time, so I stand corrected. I has the impression that he was youngish (30s) but maybe he got started when he was 12 or something.
man. that damn bell nearly scared me out of my skin.
@mikeserv Sorry. :-)
@FaheemMitha - probably did at 12 or so. who knows? but what gave you the age impression?
I've been reading stuff on the net for rather longer than a decade, and don't recall having run across Stefane's name before, but then I don't do much heavily Unix stuff, like shell scripting.
@mikeserv I think I ran across a web page of his. One sec, let me check.
I think he's been doing google groups since there was such a thing. and all of the usenet stuff.
08:10
@mikeserv Ok, maybe not 30s then. Unless he really did get started at 12.
There is a home page + resume, but it is not connecting here.
Never mind.
When I was in my teens, I had not even heard of Unix. Or emacs. Or,... well, you get the idea.
It is not connecting? Anyway, Ive just seen his name all over - quite often at the bottom of a thread full of confused submitters.
@mikeserv What's the earliest date you have come across? Gosh, I feel just a PI. Just call us the Hardy Boys. Or perhaps the Not-so-Hardy Boys.
I had heard of those things - I used to play with AppleScript as a pre-teen because I had a friend w/ a Mac.
@mikeserv Yes, growing up India, they really didn't have the computer thing here. Or much of anything else, really.
umm. I've never really tallied them... Well, there is a post of his own from not too long ago with a pretty dated reference... Just a sec.
08:23
I can imagine someone 20 years from now coming across old posts by Alex and getting a completely misleading impression of his age.
@FaheemMitha - Follow his link in this post:
4
A: Bash -c with positional parameters

Stéphane ChazelasThat gives you an opportunity to set/choose $0 when using an inline script. Otherwise, $0 would just be bash. Then you can do for instance: $ bash -c 'wc -c < "${1?}"' getlength foo 4 $ bash -c 'wc -c < "${1?}"' getlength bar getlength: bar: No such file or directory $ bash -c 'wc -c < "${1?}"'...

@mikeserv You mean in-ulm.de/~mascheck/various/find/#shell? Didn't see any dates there.
You'll also find many (suggested by) or (thanks to) Stephane Chezalez entries in stuff like the bash wiki and the sed tutorials sprinkled across the net. His emails show up occasionally throughout. I once saw an email - maybe 2010? - from someone else - some excited person - saying "I heard Stephane is posting again..."
Maybe it was earlier
I dunno. I tried finding it again once and never could.
@mikeserv ok. well, I guess I'm not so unixy, which is why I don't know who he is. I've generally avoided shell in the past, for example...
12-11-2002
numerous fixes suggested by Stephane Chazelas (-print0, find /etc/.)
08:32
@mikeserv where is that?
From the changelog
We can also ask him. He sometimes answers stuff like that.
@StéphaneChazelas - how long have you been a guru anyway?
No offense meant - but if you look in the star bar - you'll see @Ramesh wants to be you when he grows up.
@FaheemMitha for example...?
@mikeserv: If this is Stephane's profile
I guess he's a guru right after he graduated :))
09:08
@mikeserv For example? Sorry, don't follow.
09:19
I've been active on usenet since around 1997/1998 up until I moved here. I've learnt a lot there.
@StéphaneChazelas But usenet is not so active now, I think.
@Gnouc Wow. IT mgr for a company that sells software solutions to military and oil industries. That's a helluva laurel.
@StéphaneChazelas: As I guess, you're about 40 years old.
So how do you know all stuff that happen 60 years ago
@StéphaneChazelas - I like the zfs thing. Atomically handling packages/backups is where it is all going I guess.
@FaheemMitha Umm... You say, generally avoided shell in the past, for example... What's the example?
oh. Geez. I dunno how I typed that whole thing without seeing it myself. Sometimes I'm really stupid.
@mikeserv Shell was the example. To be more explicit, I meant I've avoided unixy things. Shell was one example. Other examples would be sed, awk,...
I don't even really know C. I normally use C++ for example. I've learned to hate it, but I still use it.
09:32
I get it now.
I suspect I'd hate C more, though.
C really belongs with Unix, they developed together. C++ is some sort of monstrous mutant.
Like the Hulk, but not nearly as much fun.
09:44
I don't even get what c++ is.
@mikeserv fun in a bottle
@Braiam Word.
Stefane's resume finally downloaded here. I see he describes himself as expert in Unix shella, and Linux expert. Unlike many other resumes I've seen over the years, he actually means the expert bit.
I use the word expert to describe myself sometimes. Purely for marketing purposes.
I think it is a much misused word on resumes. There is a form of inflation in resumes usually. People say they know a language if they picked up a book about it once.
10:38
Does anyone know whose picture/photo this is of?
slm
slm
@mikeserv @FaheemMitha @Gnouc - this is him stephane.chazelas.free.fr
11:01
@slm thanks for the edit, I was not sure to add that or not as I am not sure it will bring the network down in the process (and do not have today to try it out on a virtual machine).
@slm Yes, that page wasn't loading earlier.
slm
slm
11:17
@Anthon - I wrote that as an A but then just merged it with yours. Take it out if you like 8-)
@FaheemMitha - Yeah his resume's there too
@slm Yes, I saw it. Hence my comments re: expert above. As I said, Stephane means it quite literally.
11:44
@slm I did see your removed answer, I managed to get past 10K at some point as well ;-)
BTW Stephane's resume is a bit outdated, born in '75 and 34 years old...
@Anthon Quite. If he is not looking for a job, I suppose there is less reason for keeping it current...
@Anthon do you add questions to tag wikis as well?
@FaheemMitha I am not sure what you are referring to, so probably not
@Anthon E.g. the question link in
 
1 hour later…
slm
slm
13:12
@FaheemMitha @mikeserv BTW, if the user isn't in the chatroom when you @ their name they don't get the msg AFAIK. They have to be in the room to get the pings.
@slm They get it if they've been in the room in the last N hours. I forget the value of N.
Looks like N is two weeks
slm
slm
14:07
@terdon - thanks I can never remember the duration.
Me neither, I asked in TE
14:30
Should we approve suggested edits on closed posts?
slm
slm
@Ramesh - I typically do.
My thinking is that closes are always in a position to be reopened if they're improved enough, so any improvements to them are a step in that direction.
@slm Thanks. I will keep this in mind.
@Ramesh Certainly. Why not?
I thought closed was after being put on hold. Is it not that way?
I mean, when the question is on hold, it has scope for improvement. However, if it is closed, can it still be reopened?
slm
slm
@Ramesh sure they can be reopened
14:35
@Ramesh on hold and closed are the same thing, the name just changes from one to the other after a few days. IIRC the addition of the "on hold" status before closed was to reinforce the idea that a post isn't dead once closed, just in need of editing
if a post isn't salvageable through edits, that is what the low quality flag is for, thus if it is closed and not deleted it is theoretically salvageable and if you can do it, go for it.
15:09
@terdon TE?
@slm I tend to just tab complete the name. If it doesn't tab complete, I tend not to send it. I assume it will only tab complete if the user is actually in the room, but i've not tested that.
@FaheemMitha Secret mod chat room.
@terdon Ooohh. Secret society.
Yup :)
Well, Stephane's name is tab completing, and he is not listed here currently, so I guess that is not true.
Nah, just a place where mods can talk to each other. It's very useful to vet migrations for example or for asking how to deal with specific issues. We don't use it to whine about annoying users. Ever.
15:13
@terdon so, you discuss your plans for world domination?
@FaheemMitha Naturally.
@terdon if I'm not mistaken, is TL as Teacher Lounge
@terdon And are those plans going well? Should we all tremble?
@Braiam Yup.
@FaheemMitha Sorry, I am not allowed to comment.
@terdon damn, I was hoping you'd let something slip.
15:15
Not today pinky.
:-)
Does SE have any mechanism for users to chat privately to each other?
The question I asked about CUPS the other day was ignored. So, let's try again.
I'm trying to set the default printer, but the cups frontends are ignoring it. I've no idea what's wrong. I set it via the frontend, but verified it has changed /etc/cups/printers.conf. I don't know whether this is suitable for the site. This may just be a bug, but a rather strange one, if it is.
Thoughts?
15:31
@FaheemMitha could you check something for me please?
@terdon Sure
Do info coreutils and info Coreutils both work on your Debian?
@terdon yes, they both work.
Thanks.
15:39
@FaheemMitha I would think that a basic prerequisite of comedy is that it be funny. He seems to think it is but...
@FaheemMitha which version of coreutils do you have?
@terdon It's moderately funny. "Do you want to live in a world without Clearcase? Who wants that?"
@terdon 8.13-3.5. Debian wheezy default.
16:04
Am I missing something obvious?
1
Q: Navigating directories within a bash script

Karlovsky120I have this script: echo $HOME cd $HOME cd / cd /usr/local/src/ When I run it like this . script.sh I get this output: /home/user : No such file or directory : No such file or directory : No such file or directory If I run it normally (I added #!/bin/bash before the first line) sh scrip...

Why in the world would the OP be getting these errors? I'm sure there's something he's not telling us.
@terdon I saw the title... I said not worth my effort... maybe that was the best decision
Well, the OP is trying. It's a fair question I'm just wondering what could cause it.
@terdon he's sourcing cd... is that even possible?
@Braiam: Why not? source just execute command from script in sequence
@Braiam Yes actually. sourcing it makes much more sense than executing since it will actually change the parent shell's directory.
16:19
well, zsh is barfing about /usr/bin/test:1: parse error near )'`
I'm sure he's trying to compile something
I tried the OP's script with various shells and couldn't get an error from any of them...
Ah, he got an answer, that's probably it. He has \r in there.
. test.sh
+ . test.sh
++ echo $'/home/braiam\r'
/home/braiam
++ cd $'/home/braiam\r'
: No such file or directory
++ cd $'/\r'
: No such file or directory
++ cd $'/usr/local/src/\r'
: No such file or directory
yep
don't we have "how I debug my script?" question?
16:40
Hi terdon..
@AvinashRaj Hi
i have some doubts in perl. May i ask u?
Sure
@AvinashRaj perl -pi -e 's/\bi\b/I/g; s/\bu\b/you/g;' ;-)
$ cat r
Bone
Mushroom
bug
grass
$ perl -npe '/(?s)Mushroom.*?grass/p' r
Bone
Mushroom
bug
grass
i want to print the lines starting which matches the start pattern Mushroom upto the line which has the end pattern grass.
the above command won't work for me.
I want to do this only through regex.
16:45
Slurp the file instead
you mean this?
perl -0777npe '/(?s)Mushroom.*?grass/p' r
perl -0777pe 's/.*(Mushroom.*?)grass.*/$1/' r
The /p is not the same as in sed. The -p already prints all lines.
it prints the Bone line also.
Ah, yes. Hang on.
Forgot the s:
perl -0777pe 's/.*(Mushroom.*?)grass.*/$1/s' r
You need /s to make . match \n.
it misses the grass line..
16:49
To include grass, use:
perl -0777pe 's/.*(Mushroom.*?grass).*/$1\n/s'  r
What were you trying to do with (?s)?
i think you must know about (?s) modifier.
i want to implement the same regex in perl. I think it could be possible.
wow, terdon works.
sorry.
@AvinashRaj Ah, OK, vaguely but I've never used that format.
i forget to see the grass string which prints like this,
grassavinash@avinash-
Yeah, you need the \n
$ perl -0777pe 's/.*?([^\n]*?Mushroom.*?grass[^\n]*\n).*/\1/s' r
Mushroom
bug
grass
And also i gotta regex tag gold badge in SO..
Thanks :D
16:58
You're welcome.
one more doubt..
i want to print the lines which matches the string foo
$ cat f
foobar
foo
bar
barrrrrrr
bar foo
$ perl -0777pe 's/(.*(?:foo).*)/\1/m' f
foobar
foo
bar
barrrrrrr
bar foo
What i need to do?
@AvinashRaj: Just

perl -nle 'print if /foo/'
Yes, stop using p. That prints all lines by default.
is that possible through above regex?
@AvinashRaj: With simple matching, using regex can cause performance issue.
17:06
why you added l?, this also works..
perl -ne 'print if /foo/'
Just habit probably, it's not needed there.
By the way @Gnouc, great answer on AU!
@terdon: Thanks!
@Gnouc apart from performance, is that possible through regex?
if yes, please let me know..
17:10
I don't understand the reason people don't seem to use Perl anymore.
@AvinashRaj: What do you really mean? /foo/ is also a regex :)
@Gnouc Cause they're silly little fashion victims who believe that using whitespace to format a program is a good idea? :P
@Gnouc (?m) makes dot to match any char except new line. So this regex (.*(?:foo).*) would match the lines which contains the string foo.
so i applied this,
's/(.*(?:foo).*)/\1/m'
And?
How are you telling it to print?
perl -nle 's/(.*(?:foo).*)/\1/m && print' f
foobar
foo
bar foo
@terdon nice..
Though you don't need the s///
17:20
then what's the use of \1
perl -ne '/(.*(?:foo).*)/m && print' f
@AvinashRaj None :)
@Gnouc Because they're using Python?
@FaheemMitha That's what I said!
7 mins ago, by terdon
@Gnouc Cause they're silly little fashion victims who believe that using whitespace to format a program is a good idea? :P
@AvinashRaj there's also no need for //m either
@terdon So I saw.
But I have no idea why you don't want to do the simple perl -ne 'print if /foo/'
17:23
so it uses /m by default. Am i correct?
@terdon I hope you aren't expecting me to support whitespace as syntax.
@FaheemMitha: Python's also nice, its motto opposite to Perl. Try something in both way is great.
@AvinashRaj No, it reads line by line so the m is irrelevant.
@FaheemMitha No, I have more respect for you than that!
@Gnouc Actually, there is something called the Zen of Python.
@FaheemMitha: You mean?
17:25
@terdon Thanks. Because I won't. I was just telling someone yesterday that I thought whitespace as syntax was (on balance) a misfeature. Though it does make the code look better.
@Gnouc Try import this inside a python interpreter.
@terdon it's just an example.. Through this i could be able to figure out the large problems..
He forgot to add "whitespace as syntax sucks".
@FaheemMitha: I know that, but I don't understand why you show that? I guess because I said "its motto" :)
@Gnouc Because you wrote
3 mins ago, by Gnouc
@FaheemMitha: Python's also nice, its motto opposite to Perl. Try something in both way is great.
That's as close to an official motto as Python has, though really it is more like a poem.
Poor Python, insulted by everybody. Yesterday I was briefly on #lisp and someone was sneering at Python and the GIL.
the only time I really dislike pythons whitespace is when I have deeply nested structures that don't neatly nest together (e.g. multiple flows within each nest). Makes it very fun when you open up a file that mixed hard tabs and soft tabs and you aren't sure which indentation stop something belongs at
17:31
awk,sed,perl one liner = 1000 lines of python code..
i think i understood correctly..
if you golf python, you can get 1 line of python too
Yeah, if we have to be honest, there are some great things about python.
But partisanship is funnier.
@casey the whitespace thing is generally problematic, imo. It's particularly annoying when you are trying to cut and paste some python code.
@Braiam No, you can't.
@AvinashRaj No, it isn't.
@casey didn't know you were a python user. Though I suppose it is not surprising.
@AvinashRaj and 1 line of python is at least 100 of java
17:38
in python it takes 3 or 4 lines to do this simple replacement sed 's/,/ /g' file
I'm also not particularly fond of their nutty approach to error handling. If something doesn't behave as you expect, throw an exception - then try to catch it. Screwy. Sensible people check for error conditions.
@AvinashRaj Depends what library you are using. What does that do, replace commas with blank spaces everywhere in a file?
@AvinashRaj true, but how many lines of sed will it take to open an hdf5 file, read a 3d grid and plot it? Sure, sed isn't built to do that, but every tool has its purposes and weaknesses
(the above takes ~6 or 8 lines of python to open/read/plot with publication quality, iirc)
@AvinashRaj the general purpose matcher would take more lines, but i'm positive you could do that with 2 lines max, maybe 1 in python
@casey yep, you're correct :-)
@casey that's cheating, you can't just import parser if sed doesn't do that :P
@casey Dammit, I've made up my mind, stop confusing me with facts!
4
17:44
helo is there any ways to make memcached faster?
Yes, facts can be annoying.
@user965347 We're going to need more details than that.
yeah, i actually developing application that parse each line
for example aaaabbbbcccdddd
that i have to make sure there are no same line
@casey may i know the python code for doing this sed 's/,/ /g' operation?
and i have to store it to memcached
if i using mysql to store line , check line and send it is toooooo slooooooooooooow
but memchached is slow also,
without memcached i produce 30000 line persecond
17:46
what is memcached?
with memcached 5000 lines perseconds
@user965347 you sure isn't your implementation that is slow and not memcached? Why you think memcached is the problem?
What language are you developing in? What does it have to do with *nix?
@AvinashRaj give me a minute
yeah i actually doing serialization , so the object are converted to byte array'
@Braiam thanks
is that has significant impact?
>>> import re
>>> s = "fo,o,o"
>>> m = re.sub(r',', " ", s)
>>> m
'fo o o'
@AvinashRaj that's an interpreter... not fair
but i don't how to open a file and do the above operation on all the lines.
17:49
anyway if you are using top commands
which one is real memory?
VIRT?
@Braiam you mean it could be only possible through a python script?
@AvinashRaj of course
@casey Take your own time..
@Braiam did you know how to do that?
oh, there is separate room for ban hammer..
is there a room for dupe hammer?
18:12
casey@convect so % cat test.csv
test,0,0,1.0,test2,35,xyz,123
casey@convect so % ./csvto%20.py test.csv
test 0 0 1.0 test2 35 xyz 123

casey@convect so % cat csvto%20.py
#!/usr/bin/env python

import sys

with open(sys.argv[1]) as f:
    for line in f:
        print(line.replace(","," "))
@AvinashRaj ^^^ there is one way to do it
its somewhat dirty as it doesn't do any validation on the input file and doesn't even check if one was supplied on the command line.
@casey does it works for multiple lines?
yes
the for line in f processes line by line
with open(sys.argv[1]) as f:
it takes the first argument.
am i correct?
though, change the print() line to this:
print(line.rstrip().replace(","," "))
to chomp the newline before printing, or newlines end up duplicated
@AvinashRaj yes, that is the first positional argument on the command line
argv[0] is the name of the executable
how i use the re.sub function?
like this
30 mins ago, by Avinash Raj
>>> import re
>>> s = "fo,o,o"
>>> m = re.sub(r',', " ", s)
>>> m
'fo o o'
18:19
use it the same way you did above, just use line instead of s
e.g. re.sub(r' ', " ", line.rstrip())
but for a simple op like that, re is unnecessary
which is why I didn't use it
#!/usr/bin/env python
import re
import sys
with open(sys.argv[1]) as f:
    for line in f:
        print(re.sub(r","," ", line.rstrip()))
complex replacement could be done through re.sub. I figured out both. Thanks for your valuable time :-)
not quite the one-liner on the command line you could get out of sed or perl to do the same thing, but not much harder either (i'd have to look up the perl options to wrap my one-liner around a while(<>) or whatever it needs to do for looping over input)
btw @AvinashRaj using the with construct to open the fiie closes the file handle upon exiting the block, so its a bit more useful that it perhaps looks.
(not quite a try block as I had thought)
e.g.
#!/usr/bin/env python
import re
import sys
try:
    with open(sys.argv[1]) as f:
        for line in f:
            print(re.sub(r","," ", line.rstrip()))
except:
    print("usage: {0} <file>".format(sys.argv[0]))
% ./csvto%20.py
usage: ./csvto%20.py <file>
and fwiw, the code I've been pasting is python 3.x, you might need to import from __future__ to get it working on 2.7
@casey only the print needs to be changed
btw... env uses python3?
and in full disclose, don't write a bare except like I did above, that will catch a bad filename or IO errors during the read, or anything else that could be raised by the re matcher
@AvinashRaj ^^^
Why you used this?
except:
    print("usage: {0} <file>".format(sys.argv[0]))
18:31
@Braiam python3 is my system default
@AvinashRaj just as an example, you wouldn't want a catchall except block there. you can ignore it :)
@Braiam % python -V
Python 3.3.5
@casey arch, right?
@Braiam gentoo
okey
needs to remind everyone to put in their "About me" what distro they use
@casey does this code would open the file in readwrite mode?
with open(sys.argv[1]) as f:
@Braiam I switched my default a while back, but afaik if you start a fresh gentoo install these days it is shipped with 3.x as the default
18:34
or we need to give r or w explicitly?
@AvinashRaj open only reads the file, you need write to write the file
@AvinashRaj 'r' is default. using 'w' will truncate the file, for r/w use 'r+' i think
where i need to give r or w?
it is an optional argument in the open call, after the filename
e.g. open(filename [, mode])
with open(sys.argv[1], r) as f:
or
18:38
'r'
with open(sys.argv[1], "r") as f:
to save the changes, i need to open the file in write mode. Am i correct?
with open(sys.argv[1], 'w') as f:
no
@casey @Braiam Bye :-) Gud ni8 ...
if you open with 'w' it will truncate the file
that isn't what you want probably
@casey remember me why I use write() instead of open()
18:45
Hi everyone, quick question. Im doing some research on router vulnerabilities. I'd like to know if I can get a list of devices running on the ARM architecture as opposed to the more popular MIPS
@Braiam open just opens the file, write does the writing
e.g. with open(output, 'w') as f: f.write('blah')
with proper formatting of course
@gandolf You might get more answers from the Super User crowd. Try their chat.
@terdon thanks, ill try them
with open() as f: is equivalent to writing f = open()
@casey right, for some reason I was thinking write was a separated call
18:48
I only use the first form when I'm opening it for short-term use as it ensured the file gets closed at the end of the block and I don't spend a line closing it manually
well, getting syslog-ng to send its logs remotely and an rsyslogd box to read them was surprisingly very easy
I figured I was in for at least a little bit of headache with two different logging daemons involved
 
3 hours later…
21:37
Hi @terdon, you there?
21:50
Yes
Come on, test before posting! I would have downvoted but since it's you I knew you'd fix it.
The SO answer is piping seq only to run parallel many times. He's giving the wget command to parallel directly.
@Ramesh ^
00:00 - 22:0022:00 - 00:00

« first day (1430 days earlier)      last day (3818 days later) »