Re: [9fans] rows to cols?

2009-11-13 Thread Richard Miller
> Is there an easy way to transpose the text so that rows become > columns, and vice versa? Delimiter is space. If you know in advance the number of rows & colums, it's easy: term% cat t one two three four five six seven eight nine ten eleven twelve term% tr -s ' ' '\xA'

Re: [9fans] rows to cols?

2009-11-13 Thread Tharaneedharan Vilwanathan
hi, i rustled up a small limbo program (attached) that does the trick. hope this helps. % cat num1.txt one two three four five six seven eight nine % ./trans num1.txt one four seven two five eight three six nine % cat num2.txt one two three four five six

Re: [9fans] MIPS LSB compiler

2009-11-13 Thread Tim Newsham
* A ducktyping of sorts with interfaces and such. On the surface it just saves you a bunch of "extends XXX", but it actually seems to bridge the gap between dynamically typed world and a statically typed one to an extent that makes me rethink whether static typed languages are as

Re: [9fans] MIPS LSB compiler

2009-11-13 Thread Iruata Souza
On Fri, Nov 13, 2009 at 3:48 PM, Tim Newsham wrote: >>   * A ducktyping of sorts with interfaces and such. On the surface >> it just saves >>     you a bunch of "extends XXX", but it actually seems to bridge >> the gap between >>     dynamically typed world and a statically typed one to an extent

Re: [9fans] MIPS LSB compiler

2009-11-13 Thread Tim Newsham
with a more complex type system that you cannot express in go.  A good, simple example is "map".  Go would need generics to support it. $GOOROOT/src/pkg/bytes/bytes.go:248 func ToLower(s []byte) []byte { return Map(unicode.ToLower, s) } I should have been more clear. I mean a generic map of

[9fans] Practical issue on using rc shell

2009-11-13 Thread Maurí­cio CA
Hi, I'm new to plan9 from user space. I've started using rc shell for scripts and, for daily use, I would like to solve a problem. I see that rc isn't built with readline or similar. So, do you use some alternative? Or do you think I can live without it? Thanks, Maurício

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread erik quanstrom
what i find i can't live without is a record of the commands i've typed. sometimes a one-liner from last week is useful. i use the commands - and -- (source: /n/sources/contrib/quanstro/src/history.c) along with the following patch to rc to make it go. - erik ; 9diff fns.h /n/sources/plan9//sys

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread Tim Newsham
Hi, I'm new to plan9 from user space. I've started using rc shell for scripts and, for daily use, I would like to solve a problem. I see that rc isn't built with readline or similar. So, do you use some alternative? Or do you think I can live without it? For scripting it shouldn't be an issue.

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread David Leimbach
On Fri, Nov 13, 2009 at 10:54 AM, Tim Newsham wrote: > Hi, >> >> I'm new to plan9 from user space. I've started using rc shell for >> scripts and, for daily use, I would like to solve a problem. >> >> I see that rc isn't built with readline or similar. So, do you use >> some alternative? Or do yo

Re: [9fans] MIPS LSB compiler

2009-11-13 Thread Andre Guenther
correct me if i am wrong. but isn't the usual MIPS calling convention to store the return pc in R31? you may just want to look at your compiler output. mips has various "branch and link" commands that do a branch and put the returning pc into R31, which is the usual calling convention. lu...

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread Venkatesh Srinivas
The other (Byron Rakitzis) unix port of rc can be linked against either readline or editline. -- vs

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread pmarin
Fortu On Fri, Nov 13, 2009 at 8:02 PM, David Leimbach wrote: > > > On Fri, Nov 13, 2009 at 10:54 AM, Tim Newsham wrote: >>> >>> Hi, >>> >>> I'm new to plan9 from user space. I've started using rc shell for >>> scripts and, for daily use, I would like to solve a problem. >>> >>> I see that rc isn

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread Roman Shaposhnik
On Fri, Nov 13, 2009 at 12:46 PM, pmarin wrote: > fortunately, the unix world is less radical, you can use rlfe > http://per.bothner.com/software/ There's also versatile socat: http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLE_ADDRESS_READLINE Thanks, Roman.

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread Nick LaForge
On Fri, Nov 13, 2009 at 12:46 PM, pmarin wrote: > Fortu > > fortunately, the unix world is less radical, you can use rlfe > http://per.bothner.com/software/ > > pmarin fortunately, plan9 includes a c compiler Nick

Re: [9fans] Practical issue on using rc shell

2009-11-13 Thread pmarin
fortunately, in unix you can run go :). On Fri, Nov 13, 2009 at 10:00 PM, Nick LaForge wrote: > On Fri, Nov 13, 2009 at 12:46 PM, pmarin wrote: >> Fortu >> >> fortunately, the unix world is less radical, you can use rlfe >> http://per.bothner.com/software/ >> >> pmarin > > fortunately, plan9 i

Re: [9fans] dtrace for plan 9

2009-11-13 Thread dave . l
Would this answer your question: http://blogs.sun.com/jonh/entry/the_dtrace_deadman_mechanism Well, it answers the question "What is the DTrace so-called deadman mechanism?" I think. That's a sort of part of a possible solution, which is OK. To be pedantic, it's not a true deadman mechanism

Re: [9fans] rows to cols?

2009-11-13 Thread dave . l
Wow. Excellent us of tools. The smallest arbitrary-columns answer I could come up with was: awk '{if(m < NF)m=NF;for(i=1;i<=NF;i++)r[NR, i]=$i}END {for(i=1;i<=m;i+ +){for(j=1;j<=NR;j++)printf "%s ", r[j,i];print ""}}' t I'm sure there's an insane sed solution out there somewhere for very sma

[9fans] bio(2) and ORDWR

2009-11-13 Thread Lyndon Nerenberg (VE6BBM/VE7TFX)
bio(2) doesn't support files opened for read+write; Looking at the implementation I don't see why it couldn't. Was this excluded for a particular reason? --lyndon

Re: [9fans] bio(2) and ORDWR

2009-11-13 Thread erik quanstrom
On Fri Nov 13 20:13:20 EST 2009, lyn...@orthanc.ca wrote: > bio(2) doesn't support files opened for read+write; Looking > at the implementation I don't see why it couldn't. > > Was this excluded for a particular reason? cf. /sys/src/cmd/upas/common/libsys.c:^/sysopen i believe presotto wrote bot

[9fans] Nice toy

2009-11-13 Thread Bruce Ellis
Any one tried a Asus Eee PC T91? I claim it is the best outta the box $500 computer available (this week anyway). I'm scribbling on it as I speak. Touch/Swivel/Tablet screen, All the usual stuff and gps and tv tuner and ... lotsa stuff I haven't played with. I can't keep up with the eee port. Tota

Re: [9fans] bio(2) and ORDWR

2009-11-13 Thread Bruce Ellis
I believe in those Old Endearing Charms. Contact me off list and I'll explain it. brucee On Sat, Nov 14, 2009 at 1:12 PM, erik quanstrom wrote: > On Fri Nov 13 20:13:20 EST 2009, lyn...@orthanc.ca wrote: >> bio(2) doesn't support files opened for read+write;  Looking >> at the implementation I

Re: [9fans] rows to cols?

2009-11-13 Thread Lyndon Nerenberg (VE6BBM/VE7TFX)
> Is there an easy way to transpose the text so that rows become > columns, and vice versa? Delimiter is space. Perhaps in AWK? If Richard's trick won't work, grab contrib/lyndon/transpose.c. It's dog slow (actually, avl(2) is), but its effectively unbounded for the input dataset size. --lyndon