On Tue, 2007-12-18 at 17:55 +1100, Peter Hardy wrote:
I've got a sixpack of beer for a working PostScript variant. :-)
drop this in a file called count.ps
%!PS
/count { 0 { currentfile read { (,) 0 get eq { 1 add } if } { 20
string cvs print (\n) print stop } ifelse }
Hi all,
I hope my post is ok as I am not sure where to post it or what web-sites I
should be looking at.
I wanted to find out if there are jobs available in Australia for a junior
Linux systems admin more than likely in the Sydney area.
I do not have any Linux certifications but I am working
On Dec 18, 2007 5:21 PM, Peter Hardy [EMAIL PROTECTED] wrote:
On Tue, 2007-12-18 at 16:09 +1100, Jeff Waugh wrote:
Here's a starting point. What's a more optimal way to perform this task? :-)
sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
Tuesday afternoon shell optimisation party!
quote who=[EMAIL PROTECTED]
I hope my post is ok as I am not sure where to post it or what web-sites I
should be looking at.
I wanted to find out if there are jobs available in Australia for a junior
Linux systems admin more than likely in the Sydney area.
I do not have any Linux
On Tue, 18 Dec 2007, [EMAIL PROTECTED] wrote:
Hi all,
I hope my post is ok as I am not sure where to post it or what web-sites I
should be looking at.
I wanted to find out if there are jobs available in Australia for a junior
Linux systems admin more than likely in the Sydney area.
I do
This one time, at band camp, Jeff Waugh wrote:
Hi all,
Here's a starting point. What's a more optimal way to perform this task? :-)
sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
Tuesday afternoon shell optimisation party!
You want to count the total number of characters in a file, not
This one time, at band camp, Jeff Waugh wrote:
quote who=Robert Thorsby
sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
Something like the following might be close:
awk 'BEGIN{FS=,}{$0~,$:i=i+NF?i=i+NF-1}END{print(i)}' input.txt
Close in what sense, the syntax error, the length, or the
This one time, at band camp, Peter Miller wrote:
Cascade Premium, please.
Zing!
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
quote who=Jamie Wilkinson
sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
Tuesday afternoon shell optimisation party!
You want to count the total number of characters in a file, not including
newlines, that are on lines that don't start with a comma.
That's an... interesting... reading
Jeff Waugh wrote:
Does it have to be in shell? :-)
No sir! But shell usually wins.
On my 1 GHz / 1 GB powerbook, the python one-liner
I just submitted runs 5 x faster than the original.
But what does 'shell' really mean? python,perl, etc.
are external to the shell as surely as sed,tr,wc.
Jamie Wilkinson wrote:
This one time, at band camp, Jeff Waugh wrote:
Hi all,
Here's a starting point. What's a more optimal way to perform this task? :-)
sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
Tuesday afternoon shell optimisation party!
You want to count the total number of
Jeff Waugh wrote:
Traditionally it has been quick command line combos, but there are always
offerings in more conventional and esoteric forms. Such as brainf*ck this
time.
I enjoyed the bf and postscript the best so far.
Any INTERCAL skilz out there?
cheers
rickw
--
On Tue, 2007-12-18 at 12:59 +1100, Alan L Tyree wrote:
Is there anything that I need to look for in these USB to serial
converters? Any special software needed?
We (AARNet) use the Keyspan USA-19HS. They are about $49 from the
distributor.
We selected them mainly for continuity of supply --
quote who=Rick Welykochy
Jeff Waugh wrote:
Does it have to be in shell? :-)
No sir! But shell usually wins.
On my 1 GHz / 1 GB powerbook, the python one-liner I just submitted runs 5
x faster than the original.
Ah yes, well there are different definitions of optimisation, and all are
Rick Welykochy wrote:
Jamie Wilkinson wrote:
This one time, at band camp, Jeff Waugh wrote:
Hi all,
Here's a starting point. What's a more optimal way to perform this task?
:-)
sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
Tuesday afternoon shell optimisation party!
You want to
On Tue, Dec 18, 2007 at 11:32:23PM +1030, Glen Turner wrote:
Personally, when configuring routers these days I use a Bluetooth-serial
dongle, which I hang off about 10cm of shortened Cisco console cable.
Gets rid of the cable across the computer room floor, which is always a
trip hazard when
Andrew Bennetts wrote:
If you want to avoid reading the whole file into memory:
python -Sc import sys; print sum(l.count(',') for l in sys.stdin) input.txt
Yes. That's much better. Slurping the input into memory doesn't
scale well.
And they said TIMTOWTDI applied only to perl.
cheers
On Tue, Dec 18, 2007 at 11:57:39PM +1100, Jamie Wilkinson wrote:
This one time, at band camp, Jeff Waugh wrote:
quote who=Robert Thorsby
sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
Something like the following might be close:
awk
On Dec 18, 2007 4:47 PM, Jeff Waugh [EMAIL PROTECTED] wrote:
quote who=Martin Visser
perl -e 'while(){$a+=s/[,]//g};print $a\n' input.txt
Do I win??
Oddly, perl very rarely wins these. ;-)
This must come close:
perl -00 -ne 'print tr/,//' input.txt
--
Norman Gaywood, Systems
Hi All,
In spite of being a staunch fan of configuring X with vi, i am looking
for a graphical configuration tool for Xorg. Especially one with good
multi-head support. So i am wondering if anyone has any thoughts.
Generally i am a debian man, but am willing to go with suse, fedora etc.
Not
Norman Gaywood wrote:
Oddly, perl very rarely wins these. ;-)
This must come close:
perl -00 -ne 'print tr/,//' input.txt
Timing test: say the above takes time 1.0
then the following takes time 0.46 ...
python -Sc import sys; print sys.stdin.read().count(',')
both are much much faster
[EMAIL PROTECTED] wrote on 19/12/2007 11:34:30 AM:
Norman Gaywood wrote:
Oddly, perl very rarely wins these. ;-)
This must come close:
perl -00 -ne 'print tr/,//' input.txt
Timing test: say the above takes time 1.0
then the following takes time 0.46 ...
python -Sc import sys;
On Wed, Dec 19, 2007 at 12:46:51PM +1100, Scott Ragen wrote:
[EMAIL PROTECTED] wrote on 19/12/2007 11:34:30 AM:
Norman Gaywood wrote:
perl -00 -ne 'print tr/,//' input.txt
I nominate the perl soln as the winner so far: runs like
a bat of out hell and is the most easy to understand.
Scott Ragen wrote:
I have to disagree. Whilst it may be fast, its not 100% correct.
Most of the time it would probably work, but if there are any blank lines,
it outputs the current count, and starts again.
Consider the following file contents:
--file contents--
this,is,the,first,line
Norman Gaywood wrote:
There is also the slightly shorter, tending to perl ugly instead of
perl neat:
perl -0777 -pe '$_=tr/,//' input.txt
Let's get rid of one character:
perl -0777 -pe '$_=y/,//' input.txt
cheers
rickw
--
_
Rick Welykochy || Praxis
On Wed, Dec 19, 2007 at 12:34:02AM +1100, Rick Welykochy wrote:
Jeff Waugh wrote:
Does it have to be in shell? :-)
No sir! But shell usually wins.
On my 1 GHz / 1 GB powerbook, the python one-liner
I just submitted runs 5 x faster than the original.
But what does 'shell' really mean?
On Wed, Dec 19, 2007 at 12:34:02AM +1100, Rick Welykochy wrote:
No sir! But shell usually wins.
On my 1 GHz / 1 GB powerbook, the python one-liner
I just submitted runs 5 x faster than the original.
I think C usually wins, the version below is 25 times faster than the
python version (from
On Wed, Dec 19, 2007 at 02:50:55PM +1100, Ian Wienand wrote:
[ C version ]
Here's one in lex; ripped off from the flex info page.
I'd be interested in its performance compared to straight C.
No doubt worse, just curious how much worse.
$ cat count.l
cat count.l
int num_commas = 0;
%%
,
On Wed, Dec 19, 2007 at 02:51:34PM +1100, Matthew Hannigan wrote:
Here's one in lex; ripped off from the flex info page.
I'd be interested in its performance compared to straight C.
No doubt worse, just curious how much worse.
Similar to the Python version
[EMAIL PROTECTED]:/tmp$
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I have a driver for the Lucent winmodem which is available as a deb for
i386, but I can't find one to run on 64bit debian. Is one available or
am I better off installing the 32bit Debian on my daughter's AMD X2
system and running the one I have?
I've personally never had a problem with SaX2 (X config tool in yast2)
and it's dual-head/Xinerama options, though it doesn't have a
web-based interface. I'd think success with multi-head on any distro
depends a lot on the graphics card (my geforce 6200 with proprietary
nvidia drivers works
Would you be better of to scan ebay for an old EXTERNAL modem, plug that into
the RS232 port of you computer and run 64Bit debian?
jobst
On Wed, Dec 19, 2007 at 03:51:45PM +1100, Heracles ([EMAIL PROTECTED]) wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I have a driver for the
32 matches
Mail list logo