Re: [9fans] fyi: plan9port & el capitan

2015-10-08 Thread Hugo Rivera
ahh, thanks.

2015-10-08 20:32 GMT-04:00 Ryan Gonzalez <rym...@gmail.com>:
> The newest OSX version: http://www.apple.com/osx/whats-new/.
>
> On October 8, 2015 6:57:15 PM CDT, Hugo Rivera <uai...@gmail.com> wrote:
>>
>> Who is el capitán?
>>
>> 2015-10-08 19:06 GMT-04:00 marius eriksen <mar...@monkey.org>:
>>>
>>>  works great. and the split view feature is fantastic with full screen
>>> acme.
>>
>>
>>
>>
>
> --
> Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.



-- 
Hugo



Re: [9fans] fyi: plan9port & el capitan

2015-10-08 Thread Hugo Rivera
Who is el capitán?

2015-10-08 19:06 GMT-04:00 marius eriksen :
> works great. and the split view feature is fantastic with full screen acme.
>



-- 
Hugo



Re: [9fans] Gawk in 9front-ports

2015-07-09 Thread Hugo Rivera
Arnold,
I am not sure who I am addressing either :-) Just wanted to know where
this gawk port was heading.
The thing is that I use a slightly modified version of Plan 9's awk.
In this version, I added all the math functions from C and replaced
the random number generator by the Mersenne twister.
As a comment, from my experience gawk is generally faster than Plan
9's awk, but I believe the latter is more reliable (it crashes less
often than gawk).
Please, let me (us) know about the future of awk in 9front.

2015-07-09 4:49 GMT-04:00  arn...@skeeve.com:
 Hi Hugo. I'm not sure who you're addressing. Jens did the port.
 I maintain gawk.

 Removing bloat unfortunately isn't going to happen in the mainline
 code base since there are backward compatibility issues.

 However, I'm happy to incorporate portability changes to make porting
 to Plan 9 easier, if they're reasonable.

 HTH,

 Arnold

 Hugo Rivera uai...@gmail.com wrote:

 Let me understand. Are you going to modify the current gawk version
 according to your needs (perhaps removing some of the bloat you
 mention)? or are you going to port gawk as it is?

 2015-07-08 2:22 GMT-04:00  arn...@skeeve.com:
  Hugo Rivera uai...@gmail.com wrote:
 
  Why do you want gawk on plan9?
 
  I appreciate knowing about portability issues. :-)
 
  I use awk a lot (on plan9 and elsewhere) and I wonder what reasons do
  you have to use gawk over plan9's awk.
 
  Many features and extensions over standard awk. Different people will
  assign different levels of value to said features and extensions.
  A partial list:
 
  - The previously discussed dynamic plug-in facility
  - And awk-level debugger
  - A statement count profiler (and a pretty printer)
  - True arrays of arrays
  - Many more built-in functions and variables. In retrospect, some of these
are just bloat and I'd have been better off without them.
 
  Arnold
 



 --
 Hugo




-- 
Hugo



Re: [9fans] Gawk in 9front-ports

2015-07-08 Thread Hugo Rivera
Let me understand. Are you going to modify the current gawk version
according to your needs (perhaps removing some of the bloat you
mention)? or are you going to port gawk as it is?

2015-07-08 2:22 GMT-04:00  arn...@skeeve.com:
 Hugo Rivera uai...@gmail.com wrote:

 Why do you want gawk on plan9?

 I appreciate knowing about portability issues. :-)

 I use awk a lot (on plan9 and elsewhere) and I wonder what reasons do
 you have to use gawk over plan9's awk.

 Many features and extensions over standard awk. Different people will
 assign different levels of value to said features and extensions.
 A partial list:

 - The previously discussed dynamic plug-in facility
 - And awk-level debugger
 - A statement count profiler (and a pretty printer)
 - True arrays of arrays
 - Many more built-in functions and variables. In retrospect, some of these
   are just bloat and I'd have been better off without them.

 Arnold




-- 
Hugo



Re: [9fans] p9p on openbsd/amd64

2015-07-07 Thread Hugo Rivera
I did not know that. Thanks a lot.

2015-07-06 20:32 GMT-04:00  s...@9front.org:
 Hi,
 I am using p9p for some time now, and I find very difficult to work without 
 it.
 I have a box with openbsd/amd64 installed and I would like to have p9p on it.
 Can someone explain to me, in a more or less detailed fashion, what
 should I do to compile and run p9p on such machine?
 I wrote many c programs in my life, some of them useful for myself,
 but I do not know how to port software.
 Saludos,

 Plan9port is in the OpenBSD ports tree. You can either install the package
 or build the port from source.

 More information here:

 http://www.openbsd.org

 sl




-- 
Hugo



Re: [9fans] Gawk in 9front-ports

2015-07-07 Thread Hugo Rivera
Why do you want gawk on plan9?
I use awk a lot (on plan9 and elsewhere) and I wonder what reasons do
you have to use gawk over plan9's awk.

2015-07-06 22:37 GMT-04:00 Jens Staal staal1...@gmail.com:
 There was a recent discussion about that it would be nice to have gawk on
 Plan9.

 The latest upstream version of gawk can now be built via 9front-ports. I
 think/hope I built/ported it correctly, but it would be nice with
 critique/feedback/testing.

 I noticed in the Arch linux package that gawk comes with a couple of dynamic
 libraries and a header. Are those also interesting to include in the Plan9
 package (then as static libraries ofcourse)?



-- 
Hugo



[9fans] p9p on openbsd/amd64

2015-07-06 Thread Hugo Rivera
Hi,
I am using p9p for some time now, and I find very difficult to work without it.
I have a box with openbsd/amd64 installed and I would like to have p9p on it.
Can someone explain to me, in a more or less detailed fashion, what
should I do to compile and run p9p on such machine?
I wrote many c programs in my life, some of them useful for myself,
but I do not know how to port software.
Saludos,

-- 
Hugo



[9fans] lost vac score

2014-08-25 Thread Hugo Rivera
Hi,
I've lost my last vac fingerprint and I am unable to unvac anything.
How do I recover it?
Gracias de antemano.

-- 
Hugo



Re: [9fans] lost vac score

2014-08-25 Thread Hugo Rivera
great, it works. Thanks

2014-08-25 15:57 GMT-04:00 David du Colombier 0in...@gmail.com:
 I've lost my last vac fingerprint and I am unable to unvac anything.
 How do I recover it?

 You can run the dumpvacroots script which will
 dump all the Vac scores from your Venti server.

 /sys/src/cmd/venti/words/dumpvacroots

 --
 David du Colombier




-- 
Hugo



Re: [9fans] c++

2012-11-22 Thread Hugo Rivera
Great, you have my admiration, for what's worth. I truly mean that, no
sarcasm or anything alike. It would be much better if I could offer my
support instead, and maybe some day I could try to do something
similar as you are.

2012/11/22  lu...@proxima.alt.za:
 Of course, it depends on the problem considered. But I think the big
 problems in the world have little to do with programming languages,
 particularly c++, which is the topic at hand.

 Well, in the unequal world of long-post-apartheid rural South Africa
 where I live, my hope is to teach unspoilt, but also uneducated kids
 programming using Go on a Plan 9 platform (the teaching, mostly).
 Doing the same in C++ or Java would demand much more effort on my part
 and much more powerful resources than I have at my disposal.
 Eventually, we may get over these obstacles, but by then I'm hoping
 the ability to solve problems using Go will already be an asset for
 the kids.

 Am I delusional?  Maybe, but it's worth a try.

 ++L





-- 
Hugo



Re: [9fans] Acme: the way the future actually was

2012-09-14 Thread Hugo Rivera
I knew it because I read the paper :-)

2012/9/14 erik quanstrom quans...@quanstro.net:
 On Fri Sep 14 10:12:24 EDT 2012, charles.fors...@gmail.com wrote:

 Probably never heard of Oberon either.

 neither is knowledge of oberon ubiquitous among 9fans, who may
 not realize that acme itself is a copy.

 - erik




-- 
Hugo



Re: [9fans] the `Look' command in Acme

2012-05-17 Thread hugo rivera
True, but I think he refers to remove it from the tag only, since
every time you have to use a Look command you have to retype it
followed by the pattern.

2012/5/17 Lucio De Re lu...@proxima.alt.za:
 i've removed the `Look' command from Acme's tag, as i found no use for it.
 anything i'm missing?

 It's a convenient mechanism to search for patterns that may be
 misinterpreted.  I use it a lot when the pattern I'm looking for
 happens to match a filename.

 ++L





-- 
Hugo



Re: [9fans] trailing newline in awk

2012-01-26 Thread hugo rivera
Seems impossible to do in awk, but I could be wrong. In ssam is easy:

% ssam -ne 'y/.+\n/p' file

prints the last line if it's missing the line feed.

2012/1/26 dexen deVries dexen.devr...@gmail.com:
 hi list,

 can't wrap my head around this: in an awk script, how to take some action if a
 file lacks last trailing Line Feed?

 i want to modify files with contents like:
 text LF
 text LF
 text

 and leave undisturbed files with content like:
 text LF
 text LF
 text LF

 in other words, i want to either:
  - match line that is empty and is last line of file (awk doesn't seem to take
 any action on such line), or, alternatively,
  - match a line that is last line of file and lacks terminating LF.

 --
 dexen deVries

 [[[↓][→]]]

 Already many of the mutants disguised as human beings are walking the streets
 of Earth's cities.
  -- Music Instructor, ``Electro City''




-- 
Hugo



Re: [9fans] venti backup

2012-01-23 Thread hugo rivera
OK, thanks a lot for your help!

2012/1/20 David du Colombier 0in...@gmail.com:
 Does the presence of the trailer imply that I should add an extra
 block to the arenas backup?
 If my last arena is

 arena='arenas059' [31676186624,32213057536)

 then I should backup 32213057536+8192 bytes instead of 32213057536?

 No, the trailer is located at the end of the arena,
 just after clump info.

 The second number you see is the start of the next arena.
 It is preceded by two blocks:

  - the arena header of the next arena,
  - the arena trailer of the precedent arena.

 32213057536/8192 = 3932258

 In you example, arenas060 start at 3932258, so the header of
 arenas060 is 3932257 and the trailer of arenas059 is 3932256.

 You should really backup from 1048576-8192 (start of arenas00,
 including header) to 32213057536-2*8192 (end of arenas059,
 including trailer).

 Like many Venti tools, checkarenas check each arena header
 and trailer and verify they match. So you should be confident.

 --
 David du Colombier




-- 
Hugo



Re: [9fans] venti backup

2012-01-20 Thread hugo rivera
There's something weird going on. First checkarenas reports

% venti/checkarenas -v /dev/da1s4
arena='arenas00' [802816,537673728)
version=5 created=1265030300 modified=1265248834 sealed
score=f383ebf9edefe8d37733c8caba6ff53e8b5517b0
clumps=82,908 compressed clumps=22,812 data=669,897,790
compressed data=531,617,136 disk storage=536,840,340

that's only 98 blocks of 8192 bytes, not 128 as you mention.
Anyway, I run fmtarenas on fa and then if I

% 9 dd -if /dev/da1s4 -of fa -bs 8192 -iseek 98 -oseek 98 -count 65536

or

% # this doesn't make sense but I've tried it, nevertheless
% 9 dd -if /dev/da1s4 -of fa -bs 8192 -iseek 128 -oseek 128 -count 65634

I get

2012/0120 11:57:10 err 2: arena set has wrong magic number: 
expected ArenaPartMagic (0xa9e4a5e7)
venti/buildindex: can't init venti: can't initialize venti: fa: arena
set has wrong magic number:  expected ArenaPartMagic
(0xa9e4a5e7)

when I run buildindex, and checkarenas says the same thing.


2012/1/20 David du Colombier 0in...@gmail.com:
 To clarify things.

 You backup is correct, but it's not necessary to backup the
 first 128 blocks of the arena partition. Its only contains
 the Venti configuration and the ArenaPart structure.

 Here is an example of what I described in my precedent message.

 Create an arena partition at least as big as your original
 one, and format it:

 % dd -if /dev/zero -of arenas.img -bs 8192 -count 4194304
 % venti/fmtarenas arenas arenas.img

 Then copy your Venti arenas from the beginning of arenas00
 (128*8192) to the end of arenas059 (3932258*8192):

 % dd -if /dev/da1s4 -of arenas.img -bs 8192 -seek 128 -oseek 128 -count 
 3932258

 Of course, '/dev/da1s4' can be 'fa' in your example.
 If you removed the first 128 blocks, you don't have
 to use '-seek'.

 Finally, write the Venti configuration, rebuild the index
 and Bloom filter, and start Venti.

 --
 David du Colombier




-- 
Hugo



Re: [9fans] venti backup

2012-01-20 Thread hugo rivera
Thanks a lot, David, for your detailed reply.
I've followed your indications and now I am able to recover from my
venti backup :-)
I must confess that I am puzzled, because some sizes and most seeks
for dd are off by 1 block from what I expect. Particulary,
why do you
% dd -if arenas2.img -of arenapart -bs 8192 -count 97
% dd -if arenas1.img -of arenas -bs 8192 -iseek 97 -count 65536
when the first arena starts after 98 blocks from the beginning of the file?

2012/1/20 David du Colombier 0in...@gmail.com:
 that's only 98 blocks of 8192 bytes, not 128 as you mention.

 Sorry, I got confused. It's 98 blocks on arena partition and
 128 blocks on isect partition.

 I just tried. This is what I did.

 The goal is to manually recopy the first arena from
 the first Venti (arenas1.img) to the second Venti (arenas2.img).

 It will work for you as long as you adjust the partition
 names, the number of arenas and the sizes.

 # first venti

 % dd -if /dev/zero -of arenas1.img -bs 8192 -count 131072
 % dd -if /dev/zero -of isect1.img -bs 8192 -count 16384
 % dd -if /dev/zero -of bloom1.img -bs 8192 -count 8192
 % venti/fmtarenas arenas arenas1.img
 % venti/fmtisect isect isect1.img
 % venti/fmtbloom bloom1.img
 % echo 'index main
    isect isect1.img
    arenas arenas1.img
    bloom bloom1.img' | venti/conf -w arenas1.img
 % venti/fmtindex arenas1.img
 % venti=127.1
 % venti/venti -c arenas1.img -m 20 -h tcp!127.1!8000
 % vac /sys/src/9/pc
 % hget http://127.1:8000/index
 index=main version=1 blocksize=8192 tabsize=524288
    buckets=16287 div=263706
    sect=isect for buckets [0,16287) buckmax=215 arena=arenas0 at index 
 [1048576,537903104)
    arena='arenas0' on arenas1.img at [802816,537673728)
    version=5 created=1327069595 modified=1327069627
    written: clumps=669 compressed clumps=600 data=4,251,763 compressed 
 data=1,174,341 storage=1,216,488
    indexed: clumps=0 compressed clumps=0 data=0 compressed data=0 storage=0
 % venti/sync
 % Kill venti | rc
 % bc
 802816/8192 = 98
 537673728/8192 = 65634
 65634-98 = 65536

 # second venti

 % dd -if /dev/zero -of arenas2.img -bs 8192 -count 65633
 % dd -if /dev/zero -of isect2.img -bs 8192 -count 16384
 % dd -if /dev/zero -of bloom2.img -bs 8192 -count 8192
 % venti/fmtarenas arenas arenas2.img
 % venti/fmtisect isect isect2.img
 % venti/fmtbloom bloom2.img
 % echo 'index main
    isect isect2.img
    arenas arenas2.img
    bloom bloom2.img' | venti/conf -w arenas2.img
 % venti/fmtindex arenas2.img
 % dd -if arenas2.img -of arenapart -bs 8192 -count 97
 % dd -if arenas1.img -of arenas -bs 8192 -iseek 97 -count 65536
 % cat arenapart arenas  arenas2.img
 % rm -f arenapart arenas
 % venti/buildindex -b arenas2.img
 0 clumps, 16,287 buckets
 2012/0120 14:29:29 read index
 venti/buildindex: brand-new index, no work to do
 2012/0120 14:29:29 arena arenas0: 669 entries
 % venti=127.1
 % venti/venti -c arenas2.img -m 20 -h tcp!127.1!8000
 term% hget http://127.1:8000/index
 index=main version=1 blocksize=8192 tabsize=524288
    buckets=16287 div=263706
    sect=isect for buckets [0,16287) buckmax=215 arena=arenas0 at index 
 [1048576,537903104)
    arena='arenas0' on arenas2.img at [802816,537673728)
    version=5 created=1327069595 modified=1327069627
    written: clumps=669 compressed clumps=600 data=4,251,763 compressed 
 data=1,174,341 storage=1,216,488
    indexed: clumps=0 compressed clumps=0 data=0 compressed data=0
    storage=0

 Honestly, I think you should just use venti/wrarena to write
 backed up arenas to a running Venti. It's much easier.

 --
 David du Colombier




-- 
Hugo



Re: [9fans] venti backup

2012-01-20 Thread hugo rivera
Does the presence of the trailer imply that I should add an extra
block to the arenas backup?
If my last arena is

arena='arenas059' [31676186624,32213057536)

then I should backup 32213057536+8192 bytes instead of 32213057536?

2012/1/20 David du Colombier 0in...@gmail.com:
 This is because each arena have an header (ArenaHead) and a trailer
 (ArenaTrail) we would like to copy. The header, in particular, is located
 just one block before the start of the arena.

 --
 David du Colombier



-- 
Hugo



Re: [9fans] venti backup

2012-01-19 Thread hugo rivera
Just to make sure I could rebuild things in case I should, I've tried
to recover everything from my backed up arenas, but I failed. I am not
sure if things go wrong because the backup per se is wrong or I am
making a mistake while recovering from the backup (or both).
So this is how I create the back up of my active arenas

% venti/checkarenas -v /dev/da1s4
output supresed
arena='arenas059' [31676186624,32213057536)
version=5 created=1326893834 modified=1326893851
clumps=34,617 compressed clumps=17,908 data=274,318,099
compressed data=198,689,879 disk storage=200,870,750
% 9 dd -if /dev/da1s4 -of fa -bs 8192 -count 3932258 #
8192*3932258 = 32213057536

Then I create a zeroed file for the bloom filter and another for the
index section. After I format those files I run

% venti/buildindex -b venti.conf
2012/0119 17:11:41 err 2: invalid ending address in arena table
venti/buildindex: can't init venti: can't initialize venti:
/home/hugo/tmpventi/fa: invalid ending address in arena table

It seems that the backup I create is not correct, am I right?

2012/1/17 David du Colombier 0in...@gmail.com:
 I've backed up all my *active* arenas in to another disk, just to be
 safe. The man page says that the index and the bloom filter may be
 rebuilt if lost. So it seems sufficient to backup my arenas, am I
 right?

 Yes, you can rebuild the index and the Bloom filter
 with 'venti/buildindex -b'.

 --
 David du Colombier




-- 
Hugo



[9fans] venti backup

2012-01-17 Thread hugo rivera
Hello,
I've backed up all my *active* arenas in to another disk, just to be
safe. The man page says that the index and the bloom filter may be
rebuilt if lost. So it seems sufficient to backup my arenas, am I
right?
saludos,

-- 
Hugo



Re: [9fans] venti backup

2012-01-17 Thread hugo rivera
Great. Thanks.
I hope I will never need to use my backed up arenas :-)

2012/1/17 Steve Simon st...@quintile.net:
 So it seems sufficient to backup my arenas, am I
 right?

 Yes, exactly, I haev done this several times.

 It might take a few hours and some studying of manuals
 but the arenas are all you need.

 -Steve




-- 
Hugo



Re: [9fans] awk reading?

2011-12-19 Thread hugo rivera
I agree with Ruda.

2011/12/19 Rudolf Sykora rudolf.syk...@gmail.com:
 On 19 December 2011 11:27, dexen deVries dexen.devr...@gmail.com wrote:
 just yesterday i've got a glimpse of awk's power and neatness. it's good, 
 it's
 useful and i want to dig deeper. what's recommended online reading on awk?

 I believe one of the best pieces is the book by Aho, Kernighan and Weinberger.
 Reads well, isn't too long. (as is usual for Kernighan)

 Ruda




-- 
Hugo



[9fans] troff book

2011-12-02 Thread hugo rivera
Hi,
soon I'll begin to write my thesis and I am planing to use troff. I
previously wrote some documents with it, mostly with the ms macro,
which I think I'll use for the thesis. Can you advice some book about
troff with some introduction on how to write troff macros?
Saludos y gracias,

-- 
Hugo



Re: [9fans] troff book

2011-12-02 Thread hugo rivera
Thanks for the feedback. I'll have a look at some of those books.

2011/12/2 Steve Simon st...@quintile.net:
 By far the best books on troff (IMHO) are the pair by Gehani and Lally,
 Document Formatting and Typesetting on the Unix system, volume 1 and 2.

 They are out of print but available from alibris.com and somtimes on
 amazon new  used.

 -Steve




-- 
Hugo



Re: [9fans] troff book

2011-12-02 Thread hugo rivera
I think I'll reconsider using troff for my thesis, because some math
is sure to come across. But learning more about troff is indeed
useful.

2011/12/2 simon softnet ph.soft...@gmail.com:
 By the way, I am currently forced to use LaTeX.
 It's because formulas look nicer, and also because my current
 supervisor asks me to.

 I was thinking of writing a program that accepts a file formated with
 -ms or -me macros and translates it to LaTeX equivalent macros. This
 way, I would hopefully have the best of both worlds: the elegance of
 troff syntax and the neatness of TeX output.
 Is anyone interested in helping me out?

 Simon.

 On Fri, Dec 2, 2011 at 11:24 PM, simon softnet ph.soft...@gmail.com wrote:
 I have written my bachelor's thesis (80 pages with graphs, tables,
 diagrams, equations, etc..) in pure troff -me.
 It went as smooth as I could ever hope for.
 LaTeX is much more difficult to use, IMO.

 Simon.

 On Fri, Dec 2, 2011 at 10:02 PM,  tlaro...@polynum.com wrote:
 On Fri, Dec 02, 2011 at 10:45:24AM -0800, John Floren wrote:

  There was even a bunch of connections last week because somebody was
  looking for TeX on phones... (I don't know why, but the community marvel
  named TeXlive didn't seem to be the first choice in this case...)
 

 Ah, I think that was due to me... I read
 http://news.ycombinator.com/item?id=3264341 and suggested that they
 take a look at kerTeX :)

 Yes, you were one of the two (the other one has identified himself
 now... ;)). [I suspected this from the initials of the author of the
 mail.]

 And for others, BTW, if LaTeX sure works, it's because John was
 brave enough to try and not to give up after initial errors.

 Thanks!
 --
        Thierry Laronde tlaronde +AT+ polynum +dot+ com
                      http://www.kergis.com/
 Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C





-- 
Hugo



Re: [9fans] line numbers in troff

2011-06-07 Thread hugo rivera
Thanks a lot.

2011/5/19 Charles Forsyth fors...@terzarima.net:
 .nm 1 turns on line number mode
 .nm 0 turns it off
 .nn N turns it off for the next N lines
 .nm 1 M   numbers every M lines following

 there are other options

 -- Mensaje reenviado --
 From: hugo rivera uai...@gmail.com
 To: Fans of the OS Plan 9 from Bell Labs 9fans@9fans.net
 Date: Thu, 19 May 2011 15:09:23 +0200
 Subject: [9fans] line numbers in troff
 Hello,
 usually, when writting drafts for somebody else to review, its useful
 to have line numbers printed at the beginning of each line.
 How would you implement that in troff? I never written a macro in
 troff, so some basic pointers would be enough for me (e.g. some good
 troff book).
 Thanks,

 --
 Hugo




-- 
Hugo



[9fans] line numbers in troff

2011-05-19 Thread hugo rivera
Hello,
usually, when writting drafts for somebody else to review, its useful
to have line numbers printed at the beginning of each line.
How would you implement that in troff? I never written a macro in
troff, so some basic pointers would be enough for me (e.g. some good
troff book).
Thanks,

-- 
Hugo



[9fans] acme Local command on p9p

2011-02-23 Thread hugo rivera
Hello,
the man page for acme on p9p reads

Local In the Plan 9 acme, this prefix causes a command to be run in
acme'sown file name space and environment variable group. On
Unix this is impossible...

is there any other way to define environment variables for acme while
it's running?
On plan9, Local var=val sets var and then all other commands I execute
with a middle click see $var. On some ocasions this is very useful.

-- 
Hugo



Re: [9fans] acme Local command on p9p

2011-02-23 Thread hugo rivera
That doesn't work. I think it's because the environment variables that
acme sees are those that already existed when it was called, and not
those created afterwards.

2011/2/23 Gabriel Diaz gd...@9grid.es:
 hello

 probably there are a better ways, like rc maintainng a `namespace`/env fs,
 so it reads that fs creating the environment correspondant to that namespace
 when started or simmiliar, but in lunix way (and with other shells) you can
 use one script to launch acme that executes the arguments of the Local
 script after the acme launch :-?
 start_acme.sh
 #/bin/bash
 acme 
 while a=read(named_pipe_or_simmilar); do
    $a
 done;

 And Local
 #!/bin/bash
 echo $*  named_pipe_or_simmilar
 So Local export var=var could make var available
 Also not sure if plumber would help you instead of using pipes.
 My corporate pc barely allows me to reply emails, so this is not tested ;)
 gabi

 On Wed, Feb 23, 2011 at 11:39 AM, hugo rivera uai...@gmail.com wrote:

 Hello,
 the man page for acme on p9p reads

 Local In the Plan 9 acme, this prefix causes a command to be run in
 acme'sown file name space and environment variable group. On
 Unix this is impossible...

 is there any other way to define environment variables for acme while
 it's running?
 On plan9, Local var=val sets var and then all other commands I execute
 with a middle click see $var. On some ocasions this is very useful.

 --
 Hugo






-- 
Hugo



[9fans] rc file name matching

2011-02-16 Thread hugo rivera
Hi,
In rc
*hola*
matches any file that contains the word 'hola'. Is there any way to
match all the files that don't contain 'hola' in its name? with awk
and grep it's easy, but I can't figure out with rc.

-- 
Hugo



Re: [9fans] rc file name matching

2011-02-16 Thread hugo rivera
Thanks Erik.

2011/2/16 erik quanstrom quans...@labs.coraid.com:
 On Wed Feb 16 09:59:31 EST 2011, uai...@gmail.com wrote:
 Hi,
 In rc
 *hola*
 matches any file that contains the word 'hola'. Is there any way to
 match all the files that don't contain 'hola' in its name? with awk
 and grep it's easy, but I can't figure out with rc.

 match=()
 for(i in *)
        ! ~ $i *hola  match = ($match $i)

 - erik





-- 
Hugo



Re: [9fans] rc file name matching

2011-02-16 Thread hugo rivera
I am not restricted to rc only. I was doing something similar to you,
but then it occurred to me that perhaps there was an easy way to do it
with rc; apparently there isn't ☺

2011/2/16 Anthony Sorace a...@9srv.net:
 I hadn't thought of erik's answer. I usually end up doing something
 like cat `{ls | grep -v hola} or the like. I find that easier to read,
 unless you're really restricted to literally using just rc for some reason.





-- 
Hugo



Re: [9fans] ACME: can't open file

2011-01-28 Thread hugo rivera
Hi,
that should work with *existing* files.

2011/1/28 Nyan Htoo Tin nyanhtoo...@gmail.com:

 Hi, I'm newbie to plan 9, I followed a newbie-guideline for plan 9.
 http://docs.google.com/viewer?a=vq=cache:QmcfceZ7SaEJ:www.quanstro.net/newbie-guide.pdf+plan+9+newbiehl=enpid=blsrcid=ADGEESgTqzYeNZOLhG2K94Rvow-B5QW7fca_kmbC2_aLHOYpZddUl27h_fpgZcy46k8CSKJ9CXoZVzGiEK0uCamT85OSZuUJjf3EuJe4DtkzATf3NhPMYS3PCVzt0nj4PQl7pIgfbOAMsig=AHIEtbShZDoLJxZOeKbCGxgKuQx_B_yndApli=1
 section 3.2
 When I tried acme hello.c, there's an error saying:
 can't open hello.c: 'hello.c' file does not exist

 I'm running plan 9 on virtual box. Host OS is fedora.

 Thanks  Best Regards,
 Nyan





-- 
Hugo



[9fans] slides and troff

2010-10-28 Thread hugo rivera
Hello,
I'm using Uriel's macros for creating slides with groff (I'm unable to
make p9p's troff to work). The slides look fine, but I can't add slide
numbers at the bottom of each slide (which I expected to get, since
the slide macros seem to modify the ms macro). I've been messing
around with troff code, trying to get the slide numbering, but no
results so far (I can't get the footer example from Osanna's user
manual to work, given my inexperience with troff coding). Any help is
appreciated.

-- 
Hugo



Re: [9fans] proceedings

2010-10-13 Thread hugo rivera
http://9fans.net/iwp95e.pdf:
The requested URL /iwp95e.pdf was not found on this server.

2010/10/13 erik quanstrom quans...@quanstro.net:
 raw proceedings posted www.9fans.net/iwp95e.pdf





-- 
Hugo



[9fans] print conversions

2010-08-16 Thread hugo rivera
Hi,
I'm trying to print floating point numbers, but I get one extra digit
when I use the g verb. Quoting from print(2),
... and precision is the maximum number of significant digits for g
and G conversions.; so I expect
print(%.2g\n, 1234.567);
to produce
1.2e+03
but I get
1.23e+03
it seems that print(2) uses printf rules for setting the number of
decimals, which will produce the number of significant digits plus
one. I guess that the man page or the implementation needs to be
corrected, but I could be wrong.
Saludos

-- 
Hugo



Re: [9fans] regexp doubt

2010-07-15 Thread hugo rivera
Thanks to you, guys.

2010/7/14 Russ Cox r...@swtch.com:
 thanks for tracking this down.
 fixed in p9p, with some extra names.
 sam needs the same changes.
 libregexp is okay.

 http://code.swtch.com/plan9port/changeset/239be7f74189

 russ





-- 
Hugo



Re: [9fans] regexp doubt

2010-07-14 Thread hugo rivera
Yes, I'm using acme from p9p.

2010/7/13  blstu...@bellsouth.net:
 I think you have found a real bug.

 I created a new window containing

    x x+ x- xy

 and I executed Edit ,x/x[ +\-]/d
 and sure enough it doesn't delete x-.

 Interesting.  Is that in p9p acme?  I just tried it in 9vx
 and it did delete everything except the xy.

 BLS






-- 
Hugo



[9fans] regexp doubt

2010-07-13 Thread hugo rivera
Hi,
can someone tell me why the regular expression /stat[abc]?[ ;\-]/
doesn't match the string stat- in acme? I expect it to match, where
does my mistake lie?
Saludos,

-- 
Hugo



Re: [9fans] regexp doubt

2010-07-13 Thread hugo rivera
2010/7/13 Vinu Rajashekhar vinuthe...@gmail.com:

 On Tue, Jul 13, 2010 at 8:26 PM, hugo rivera uai...@gmail.com wrote:
 It's the [abc]? I guess, it says that you want an a, b, or c after stat.

not really, since there's a '?' REP operator there. And it actually
matches strings like stat;
-- 
Hugo



Re: [9fans] regexp doubt

2010-07-13 Thread hugo rivera
I wasn't searching, but using it with acme's x command.

2010/7/13 erik quanstrom quans...@labs.coraid.com:
 On Tue Jul 13 11:13:03 EDT 2010, uai...@gmail.com wrote:
 Hi,
 can someone tell me why the regular expression /stat[abc]?[ ;\-]/
 doesn't match the string stat- in acme? I expect it to match, where
 does my mistake lie?
 Saludos,

 if you are doing a b3 search, you want

        :/stat[abc]?[ ;\-]/

 just the leading : is missing.

 - erik





-- 
Hugo



Re: [9fans] regexp doubt

2010-07-13 Thread hugo rivera
both of them yield a

regexp: malformed `[]'

error.
I forgot to mention and I had an alternative solution from the
beginning /stat[abc]?([ ;]|-)/
I'm just wondering the reason the original version failed.

2010/7/13 Rodolfo (kix) k...@kix.es:
 Can you try:

 /stat[abc]?[ ;\\-]/

 I am not sure (and I do not have acme here), but probably the problem
 is with the backslash.

 You can try this too:

 /stat[abc]?[ ;-]/



-- 
Hugo



Re: [9fans] regexp doubt

2010-07-13 Thread hugo rivera
maybe I'm using a buggy version of acme, because /stat[abc]?[- ;]/
also fails with a malformed error. And according to the regexp(7)
man page, you should be able to precede a '-' with a backslash.


2010/7/13  blstu...@bellsouth.net:
 both of them yield a

 regexp: malformed `[]'

 error.
 I forgot to mention and I had an alternative solution from the
 beginning /stat[abc]?([ ;]|-)/
 I'm just wondering the reason the original version failed.

 As I recall, if you're going to include a hyphen in a character
 class, it has to be the first character so that it isn't taken to
 indicate a range.

 BLS




-- 
Hugo



Re: [9fans] xml

2010-06-30 Thread hugo rivera
Now that I had a closer look to xml files, I think I get the main idea.
From my point of view, xml doesn't seem so bad after all (please,
please, this is just an uninformed opinion) but perhaps in the future
I'll be able to see its defects.

-- 
Hugo



[9fans] xml

2010-06-28 Thread hugo rivera
If you haven't heard of XML yet, you must be living under a rock!  -
Programming in the .NET Environment
Taken from the fortunes file. I guess I must be living under a rock,
but I don't know what xml is, or pragmatically, what is it for.
Please, understand that I'm not trying to start a flame war in here,
but I'd really appreciate if someone could explain xml to me. I've
read the wikipedia entry but doesn't help me a lot, and for the first
time in my life I saw some xml code today, in a program that I need to
use and, hopefully, understand.
I know this subject isn't plan 9 related, but 9fans is my best
resource for CS questions.

-- 
Hugo



Re: [9fans] portability question

2010-06-17 Thread hugo rivera
Thanks for the feedback.

2010/6/16 Bakul Shah bakul+pl...@bitblocks.com:
 On Wed, 16 Jun 2010 11:11:09 +0200 hugo rivera uai...@gmail.com  wrote:
 Can someone clarify why the program included outputs 'AB00' (as I
 expect) on 32 bit systems and 'AB00' on 64 bit systems?
 where all those 1's came from? what's the portable way of doing this?
 sorry for newbie questions like this.


        unsigned long l;
         unsigned char c;

         l = 0L;
         c = 0xAB;
         l |= c  24;
         printf(%lX\n, l);

 For use of C on non-plan9 machines I would recommend
 downloading the last draft of the C9x standard as a ready
 reference.  Google for n843.

 As per Section 6.5.7 of C9x, both operands of  must be of
 integer type and the result type is that of the left
 operand. Since sizeof c  sizeof(int), it is promoted.  Now
 6.3.1.2 says if an int can represent all values of the
 original type, the value is converted to an int. So c is
 first converted to an int which means c  24 is an integer
 and -ve. Since an int is smaller than a long (in your case)
 it is promoted to a long. Changing the |= statement to

         l |= (unsigned)c  24;

 should give you what you want.





-- 
Hugo



[9fans] portability question

2010-06-16 Thread hugo rivera
Can someone clarify why the program included outputs 'AB00' (as I
expect) on 32 bit systems and 'AB00' on 64 bit systems?
where all those 1's came from? what's the portable way of doing this?
sorry for newbie questions like this.


   unsigned long l;
unsigned char c;

l = 0L;
c = 0xAB;
l |= c  24;
printf(%lX\n, l);


-- 
Hugo



Re: [9fans] portability question

2010-06-16 Thread hugo rivera
2010/6/16 Lucio De Re lu...@proxima.alt.za:
 On Wed, Jun 16, 2010 at 11:11:09AM +0200, hugo rivera wrote:

         printf(%lX\n, l);

 Would you try %luX?  It may work better?

no, or at least not as I intend. It produces '2868903936X' on 32 bit
linux and '18446744072283488256X' on 64 bit. According to printf(3),
an 'l' should work with both unsigned and signed long quantities.

--
Hugo



Re: [9fans] testing...

2010-05-06 Thread hugo rivera
I got it.

2010/5/6 EBo (sandien) e...@sandien.com:
 My ISP is migrating email clients and this is apparently breaking my
 subscriptions...  Just a test to see if I can get through...

  EBo --







-- 
Hugo



Re: [9fans] MPI

2010-04-01 Thread hugo rivera
2010/3/31 EBo e...@sandien.com:
 Other than that, you might want to download some of the models which use MPI
 and possibly play with them.  Depending on the size of the codebase this might
 scare you off a bit, but I actually find playing with the GCM WRF and RegCM3
 rather enlightening once I got past the initial frustrations...  On second
 thought I never got over my frustrations, but this brings me to a pet peve --
 if you are looking into modeling and are not a computer scientist by training,
 PLEASE, PLEASE, PLEASE at LEAST sit in a course on algorithms and data
 structures, and possibly another one in software engineering.  For all the
 theoretical physicists, ecologists, biologists, sociologists, and economists I
 have worked with, I have yet to meet one which have had more than a practicum
 in FORTRAN and/or C/C++.  If you already have a CS background, you come to
 understand why some of the code still makes me twitch...

I must admit that, in general, physicist, astrophysicists and
astronomers are very bad programmers. I've worked with all those
breeds and we really suck. Maybe the fact that I've read, and solved
almost all the exercises from the practice of programming
 and KR's the c programming language will make you feel better.
Currently I'm going through Aho et al. the awk programming language,
and then I'm planning to move to The Unix Programming Environment.
Coming back to the subject, I'll start with your recommendations and
Andrew's. Probably this is just a newbie talking, but it seemed to me
a kind of problem easily solved with file servers and 9p; but again,
this was only my first impression.
Thanks to all for the feedback.

-- 
Hugo



[9fans] MPI

2010-03-31 Thread hugo rivera
Hi,
I'm about to start a course that goes by the title of Computational
Physics, and as I was having a look at the items that we are going to
cover, and saw that there's an Introduction to parallel computing and
parallel programming with Message Passing Interface (MPI). Some of
you 9fans may be familiar with this protocol, any comments on it? can
you recommend a book on this topic (not MPI, but concurrent stuff in
general)? how plan9 solves this problem, if at all? Any feedback is
welcome ☺
If you consider this message as noise, please, disregard it.
Saludos,

-- 
Hugo



Re: [9fans] Plan ? (was: native install)

2010-03-30 Thread hugo rivera
I agree with Steve.
I like the community approach to this matter: if plan9 doesn't have
what you need, do it yourself; if you do something that might be
useful for others share it and see what happens.
Being a newbie myself I find very hard to write my own utilities, but
that's a good way to learn ;-)


2010/3/30 Steve Simon st...@quintile.net:
 No one's willing to spearhead a General Purpose 9 experiment, and no
 one's interested in collaborating on and contributing to such a project?

 If you want [general purpose], you know where to get it. seems to
 be the period that ends all such discussion.

 I wouldn't quite agree, the discussions usually end one of three ways:

 - somone wants somthing like gnome, and are encouraged to run linux.

 - somone wants the community to port smthing like gnome and noone is
  interested so they get bored and go away.

 - somone wants to write some code to solve a problem they have with plan9
  and the just get on with it and tell the list when its done.

 An example:

 I need SVN support at work, cinap has wrapped up his linuxemu with the snv
 client and the apropriate shared libraries (thanks cinap). This allows me to
 continue using plan9 (as I do every day, all day).

 In parallel I now have written a webdav client which I hope will become
 a DeltaV/SVN client for plan9. I feel its worth writing as I think it is
 interesting to try and fit the plan9 file model to SVN's version control 
 model.

 I wanted it, I got on with it and wrote it.

 I can't help but wonder: where's the crux of the inertia?

 An interesting question. If you can garner enthusism from the list
 perhaps you can be the one to spearhead a new burst of enthusism?

 -Steve





-- 
Hugo



Re: [9fans] Plan ? (was: native install)

2010-03-30 Thread hugo rivera
I don't agree. I think that more than one person can be involved in
any given project.


2010/3/30 Gabriel Diaz Lopez de la Llave gd...@rejaa.com:
 hello

 This way (dot-it-your-self-way) we will only have one-man projects. . .

 slds.

 gabi





-- 
Hugo



Re: [9fans] quote o' the day

2010-03-26 Thread hugo rivera
2010/3/25 Francisco J Ballesteros n...@lsub.org:
 In fact, we have both printed on paper hanging from the wall of the corridor
 near our office. Let's hope they learn.

This is a great idea. I think I'll copy it :-)

-- 
Hugo



Re: [9fans] float overflow

2010-03-26 Thread hugo rivera
great! now I can throw all the garbage I want to my program :-)
Thanks a lot.

2010/3/26 Federico G. Benavento benave...@gmail.com:
 garbage in, garbage out

 lotte% echo 1.75e308+1.75e308 | hoc
 hoc 730809: suicide: sys: fp: numeric overflow fppc=0x3004
 status=0xb988 pc=0x3a75
 lotte%

 if you want to keep feeding garbage to your program disable the exceptions

 see getfcr(2)

 or http://plan9.bell-labs.com/magic/man2html/2/getfcr

 setfcr(getfcr()~(FPINVAL));

 feel free to turn division by 0 trap too



-- 
Hugo



Re: [9fans] float overflow

2010-03-26 Thread hugo rivera
2010/3/26 ron minnich rminn...@gmail.com:
 yes, so I wonder, under what circumstances would you want this
 non-useful output? Are you going to do further computation with the
 number that you can not represent? I almost prefer the Plan 9 behavior
 in this case ...

Well, I was expecting this question :-)
But I don't actually have a good answer. It just felt wrong to let the
program crash.

-- 
Hugo



Re: [9fans] float overflow

2010-03-26 Thread hugo rivera
Uf, I didn't have any idea of the risks implied.
Thanks for correcting me ;-)

2010/3/26 ron minnich rminn...@gmail.com:
 http://en.wikipedia.org/wiki/Fail-fast

 says it better than I can.

 ron





-- 
Hugo



Re: [9fans] using acme/Mail from plan9port in Linux

2010-03-23 Thread hugo rivera
I configured mailfs so now I can read email, thanks.
But writing mail is not going so well:

$ cat $PLAN9/log/smtp.fail
myhost Mar 23 11:21:44 bad network /net/net!my.smtp.server!smtp (my.smtp.server)
myhost Mar 23 11:28:06 bad network /net/net!my.smtp.server!smtp (my.smtp.server)
myhost Mar 23 11:34:20 bad network /net/net!my.smtp.server!smtp (my.smtp.server)

after using marshal to send messages. The file
$PLAN9/mail/queue/hugo/E.XX contains a very similar error

smtp: bad network /net/net!my.smtp.server!smtp (my.smtp.server)

I've been playing around with files inside $PLAN9/mail/lib but no
success so far. Any tips are welcome! :-)

2009/11/21 Mathieu Lonjaret mathieu.lonja...@gmail.com:
 On Sat, Nov 21, 2009 at 10:33 PM, Lorenzo Bolla lbo...@gmail.com wrote:
 Hi all,
 can anyone point me to a document (if any) that explains how to use
 acme/Mail to read e-mail in Linux?
 I couldn't find any useful information in the plan9port distribution and it
 does not work out-of-the-box.
 Thanks for your help!
 L.

 1) build and install mailfs
 cd $PLAN9/src/cmd/upas/
 mk install
 cd nfs
 mk install

 2) configuration
 cd $PLAN9/log; chmod 666 smtp smtp.debug smtp.fail mail smtp
smtp.debug smtp.fail mail
 cd $PLAN9/mail/lib
 edit rewrite
 optionnally edit remotemail

 3) authentication
 factotum
 factotum -g 'proto=pass service=imap server=your.imap.server
 user=you_there !password?'

 4) run it!
 mailfs -t your.imap.server (-t is for tls)
 button 2 exec on  'Mail' in acme (without the quotes)
 (you need the plumber running for everything to work as expected in acme)

 hth,
 Mathieu





-- 
Hugo



Re: [9fans] using acme/Mail from plan9port in Linux

2010-03-23 Thread hugo rivera
Great! now it works. Thank you very much; you answered in the exact
moment, otherwise frustration would have been too great :-)
One last thing (I hope): when I'm reading the mail on my imap server
with nedmail, and I want to save a message, I get

: 3 w /tmp/3
!message disappeared

and nothing gets written. Do you have any idea what's causing this?
and even better, how to solve it :-)

2010/3/23 Mathieu Lonjaret mathieu.lonja...@gmail.com:
 Hello,

 if you haven't done so yet, you need to edit the
 $PLAN9/mail/lib/rewrite file like that:

 # send all mail to the gateway or mail server, $smtp,  for delivery
 ([^!]*)!(.*)    |       $PLAN9/mail/lib/qmail '\s' 'xxx.xxx.xxx.xxx' 
 '\...@\1'

 where xxx.xxx.xxx.xxx is the ip address of your smtp.  I think once I
 had some resolution problem, that's why I set it by ip here instead of
 by name.  Works fine enough so I never bothered to do it by name
 afterwards.

 hth,
 Mathieu


 -- Mensaje reenviado --
 From: hugo rivera uai...@gmail.com
 To: Fans of the OS Plan 9 from Bell Labs 9fans@9fans.net
 Date: Tue, 23 Mar 2010 12:18:56 +0100
 Subject: Re: [9fans] using acme/Mail from plan9port in Linux
 I configured mailfs so now I can read email, thanks.
 But writing mail is not going so well:

 $ cat $PLAN9/log/smtp.fail
 myhost Mar 23 11:21:44 bad network /net/net!my.smtp.server!smtp 
 (my.smtp.server)
 myhost Mar 23 11:28:06 bad network /net/net!my.smtp.server!smtp 
 (my.smtp.server)
 myhost Mar 23 11:34:20 bad network /net/net!my.smtp.server!smtp 
 (my.smtp.server)

 after using marshal to send messages. The file
 $PLAN9/mail/queue/hugo/E.XX contains a very similar error

 smtp: bad network /net/net!my.smtp.server!smtp (my.smtp.server)

 I've been playing around with files inside $PLAN9/mail/lib but no
 success so far. Any tips are welcome! :-)

 2009/11/21 Mathieu Lonjaret mathieu.lonja...@gmail.com:
 On Sat, Nov 21, 2009 at 10:33 PM, Lorenzo Bolla lbo...@gmail.com wrote:
 Hi all,
 can anyone point me to a document (if any) that explains how to use
 acme/Mail to read e-mail in Linux?
 I couldn't find any useful information in the plan9port distribution and it
 does not work out-of-the-box.
 Thanks for your help!
 L.

 1) build and install mailfs
 cd $PLAN9/src/cmd/upas/
 mk install
 cd nfs
 mk install

 2) configuration
 cd $PLAN9/log; chmod 666 smtp smtp.debug smtp.fail mail smtp
smtp.debug smtp.fail mail
 cd $PLAN9/mail/lib
 edit rewrite
 optionnally edit remotemail

 3) authentication
 factotum
 factotum -g 'proto=pass service=imap server=your.imap.server
 user=you_there !password?'

 4) run it!
 mailfs -t your.imap.server (-t is for tls)
 button 2 exec on  'Mail' in acme (without the quotes)
 (you need the plumber running for everything to work as expected in acme)

 hth,
 Mathieu





 --
 Hugo





-- 
Hugo



Re: [9fans] using acme/Mail from plan9port in Linux

2010-03-23 Thread hugo rivera
Thanks a lot!

2010/3/23 Russ Cox r...@swtch.com:
 I have no idea if this is related but in the early days with gmail it would
 automaticially remove messages when they where downloaded so they disappeared
 as fast as you tried to read them.

 Perhaps your imap server is doing somthing similar?

 That was with POP3, not with IMAP.

 As to the original question, when I run acme Mail on
 plan9port I don't bother to set up the upas mail queues,
 which frankly I don't trust on top of a Unix file system.
 Instead you can create a $HOME/bin/pipefrom that
 sends the mail via the system mailer, maybe even
 on another machine.

 This is my current version, which is a bit more complex
 than it needs to be, but you get the idea.  You could
 drop the ssh if you trust your local mail installation
 to be configured properly.

 Russ

 #!/usr/local/plan9/bin/rc

 host=swtch.com  # where to relay via ssh

 if(! ~ $#upasname 1)
        upasname=rsc+boun...@swtch.com

 echo $* /home/rsc/pipefrom.log
 . /usr/local/plan9/bin/9.rc

 if(~ $1 -x){
        shift
        echo $*
        exit 0
 }
 if(~ $1 -*){
        echo 'cannot deal with options' [1=2]
        exit 1
 }

 ipaddr=`{/sbin/ifconfig | sed -n 's/.*inet addr:([^ ]*) .*/\1/p'}
 if(~ $#ipaddr 0){
        echo not online [1=2]
        exit offline
 }

 exec ssh $host sendmail -f $upasname $* rsc+out...@swtch.com





-- 
Hugo



Re: [9fans] 9vx and email

2010-03-18 Thread hugo rivera
yes, I meant 9vx. So I'll try to do it with p9p's mailfs.
Thanks.

2010/3/18 Russ Cox r...@swtch.com:
 your subject says 9vx and email, but your message
 didn't mention 9vx.  assuming you are actually using
 9vx, it's important to note that the mail system depends
 heavily on lock files, and the #Z file system in 9vx,
 which is what gives you access to the host file system,
 does not support lock files.  you'll only get the right
 behavior if you're using a native plan 9 file system like
 fossil or kfs or a network connection to one of those
 to hold the /mail/queue directory tree.

 russ





-- 
Hugo



[9fans] 9vx and email

2010-03-17 Thread hugo rivera
Hello,
I've been searching through the man pages and 9fans archive and I am
unable to figure out how to correctly setup plan9 to read and write
mail. I've added my mail servers in different places (i.e.
/rc/bin/termrc, /lib/ndb/local, /mail/lib/rewrite.gateway), ran
factotum, ran upas/fs but I'm unable to read or write mail. Can anyone
point me in the right direction?
saludos,

-- 
Hugo



Re: [9fans] plan9 on qemu and 9vx

2010-03-14 Thread hugo rivera
It seems that 9vx has become a lot more stable than before. The last
time I used it to write anything in C was like 8 months ago, and the
instability issues I had in mind are dated from back then. So I'll
give it another try and perhaps it will become my main plan 9
platform.

2010/3/13 ron minnich rminn...@gmail.com:
 I build 9vx from source and routinely have it running for days, until
 I need an ubongo reboot in fact. Don't know how to figure out what's
 different but I do know that gcc/glibc/distros in linux universe are
 so variable, literally week to week, that the build environment is
 very unstable. That might be an issue with any prebuilt version, or a
 version you build yourself -- you really can't win.

 ron





-- 
Hugo



Re: [9fans] plan9 on qemu and 9vx

2010-03-13 Thread hugo rivera
2010/3/13, Tim Newsham news...@lava.net:
 Are you running the latest from sources, or are you using
 the prebuilt binary?  There are important stability fixes
 in the sources that aren't in the binary (unless its been updated
 recently).


Prebuilt binary, downloaded on Feb/22/2010.

-- 
Hugo



[9fans] plan9 on qemu and 9vx

2010-03-12 Thread hugo rivera
Hello,
I have a Slackware installation running on my box. On top of it, I
often use qemu to run plan9, but it's inconvenient to constantly keep
track of the things I do there, like C programs, because many of them
are also useful under Slackware (then I compile them under linux with
p9p's 9c). So the approach I've taken is to run 9vx and invoke
% aux/listen1 -tv tcp!192.168.1.2!12345 /bin/exportfs
from there. Then, from plan9 inside qemu, I run
% import -A tcp!192.168.1.1!12345 /usr/hugo /n/temp
and then bind anything I want inside /n/temp to my namespace in plan9.
That way I don't need to keep track of anything I do inside qemu.
But the next step I want to take is to run just a terminal with qemu,
probably using the plan9 iso image, and have 9vx as my fileserver. Do
you know if this is even possible? I'm not sure it is since 9vx is not
actually plan9. Can you offer me some hints on how to do it?
Saludos a todos,

-- 
Hugo



Re: [9fans] plan9 on qemu and 9vx

2010-03-12 Thread hugo rivera
9vx crashes on me quite often, and qemu doesn't. That's the only
reason I use qemu, otherwise I'd also be stuck with 9vx too :-)

2010/3/12 ron minnich rminn...@gmail.com:
 Unless there's some compelling reason to use qemu (I can't think of
 one) why not just use 9vx exclusively? I've made a transition over the
 years:
 qemu
 xen
 kvm
 lguest
 9vx

 And am stuck at 9vx ...

 ron





-- 
Hugo



[9fans] rc strings

2010-03-11 Thread hugo rivera
Hi,

% n=`{echo 'a   b'}

sets n to a list containing two elements, 'a' and 'b'. How can I set n
to a single string 'a   b'? note that I must execute external
commands, so the obvious solution

% n='a   b'

doesn't work for me.
Saludos,

-- 
Hugo



Re: [9fans] rc strings

2010-03-11 Thread hugo rivera
 cant you just use $n ?

No, because the number of spaces in between is important. But I found a solution

% ifs='
' n=`{echo 'a   b'}

works fine. Sorry for the noise.


-- 
Hugo



Re: [9fans] rc strings

2010-03-11 Thread hugo rivera
Yes, works just as I needed.
Thanks.

2010/3/11 roger peppe rogpe...@gmail.com:
 what about this?
 ifs='
 ' n=`{echo 'a    b'}

 or

 ifs='' n=`{echo 'a    b'}

 if you don't mind the newline character being in the string.


-- 
Hugo



Re: [9fans] Check out my photos on Facebook

2010-03-03 Thread hugo rivera
2010/3/3  lu...@proxima.alt.za:
 Is it just me, or do others also find that having to subscribe to
 facebook to access its database is poor netiquette?

 And asking an entire mailing list membership to join so as to see some
 pictures even more so?

I doubt he did it on purpose.

-- 
Hugo



Re: [9fans] venti problem

2010-02-01 Thread hugo rivera
Thanks for the links, now everything is working (apparently), but I
have no idea what was the source of my error(s).

2010/1/29 maht maht-9f...@maht0x0r.net:
 Hi Hugo,

 I did this only yesterday and am working on a backup script to go from SMB
 share on Debian - cifs on plan9 running in Qemu on XP - venti running on
 Debian (the process works, just I haven't made a script yet).

 http://maht0x0r.blogspot.com/2010/01/venti-on-linux-via-p9p.html

 and when I'd finished mycrotiv told me he already had a script for it

 http://sphericalharmony.com/plan9/makeventi





-- 
Hugo



Re: [9fans] Q: awk omit cols

2009-11-19 Thread hugo rivera
I think
awk '{$1=;print}'
should do what you want, provided that you don't care about leading spaces.

2009/11/19 Peter A. Cejchan tyap...@gmail.com:
 On Thu, Nov 19, 2009 at 9:52 AM, Russ Cox r...@swtch.com wrote:
 awk '{print substr($0, 1+length($1)+1)}'


 Big thank you, Russ, however, wouldn't it be smarter if we had some
 kind of 'not' operator here...? Sometimes, especially when you write
 the script by hand it is easier to delete few fields than to
 explicitly write out all those remaining... IMHO...

 ++pac





-- 
Hugo



[9fans] acme bug?

2009-11-16 Thread hugo rivera
% cd /sw/somedir
% 9 ls | 9 wc -l
2712
% pwd
/sw/somedir
right click on /sw/somedir, and acme's window is empty. What's going on?

-- 
Hugo



Re: [9fans] acme bug?

2009-11-16 Thread hugo rivera
I am not sure where this came from:
% whatis cd
fn cd {if(builtin cd $1){if(flag i)$PLAN9^/bin/9 awd || status='';status=''}}
but I don't think awd(1) has something to do with the problem.
I think is something else, and maybe I was wrong and doesn't even has
anything to do with acme. I have no clue on what's going on:
1.- Start with acme showing all files in a directory (~3000). They all
happen to be png images. They are all correctly shown in acme's
window.
2.- Write
for(i in *){ name=`{echo $i | 9 sed 's/png/jpg/'}; convert $i $name}
somewhere in your tag and then execute it using your mouse button 2.
(That's imagemagick's convert utility)
3.- Write
rm *.png
and execute it using your mouse button 2.
4.- Execute a Get in your window. Now all files are gone (according to acme).
5.- Write 9 ls in your tag and execute it. You get all your jpg files.
6.- I am puzzled.

2009/11/16, Mathieu Lonjaret mathieu.lonja...@gmail.com:
 See awd(1)


 -- Mensaje reenviado --
 From: hugo rivera uai...@gmail.com
 To: Fans of the OS Plan 9 from Bell Labs 9fans@9fans.net
 Date: Mon, 16 Nov 2009 15:03:57 +0100
 Subject: [9fans] acme bug?
 % cd /sw/somedir
  % 9 ls | 9 wc -l
  2712
  % pwd
  /sw/somedir
  right click on /sw/somedir, and acme's window is empty. What's going on?

  --
  Hugo




-- 
Hugo



Re: [9fans] acme bug?

2009-11-16 Thread hugo rivera
 is the /sw/somedir directory in the namespace of acme?

yes.

-- 
Hugo



Re: [9fans] dup(3)

2009-10-19 Thread hugo rivera
Thanks for your feedback.

-- 
Hugo



[9fans] dup(3)

2009-10-16 Thread hugo rivera
I am having a hard time understanding the dircp script and the dup(3)
device. What's exactly the purpose of writing
@{builtin cd $1  tar cf /fd/1 .} | @{builtin cd $2  tar xTf /fd/0}
instead of
{builtin cd $1  tar c .} | {builtin cd $2  tar xT}
I also had a look to the pdf2ps script, and there, it seems to be
useful given that you must  provide a file trough the option
arguments. But for me this looks like a very narrow application for
the device. What other uses dup(3) might have?
Saludos

-- 
Hugo



[9fans] handling output

2009-10-01 Thread hugo rivera
I've been wondering for a while if there's some way to multiplex (if
this is the correct term) stdout for a given program:
% ls @ {grep regexp1  file1 } @ {grep regexp2  file2}
where @ is an operator that would copy ls stdout to two (maybe more)
different file descriptors. Probably some syntax is required
(something like @[1=3]).
I think a c program can be written to accomplish this, but I'd like to
hear your opinion about it. Am I on the right path or just talking
rubbish?
Saludos

-- 
Hugo



Re: [9fans] handling output

2009-10-01 Thread hugo rivera
Great, thanks.
Looks like plan 9 guys have thought about everything useful ☺ (and
that I didn't do my homework).

2009/10/1, roger peppe rogpe...@gmail.com:
 2009/10/1 hugo rivera uai...@gmail.com:

  I've been wondering for a while if there's some way to multiplex (if
   this is the correct term) stdout for a given program:


 that's what tee does.

  e.g.
  ls | tee {grep regexp1  file1} {grep regexp2  file2}




-- 
Hugo



Re: [9fans] handling output

2009-10-01 Thread hugo rivera
shame on me, I didn't know about it.

2009/10/1, matt maht-9f...@maht0x0r.net:
 Tee part of the POSIX standard

 http://www.opengroup.org/onlinepubs/9699919799/utilities/tee.html



  hugo rivera wrote:


  Great, thanks.
  Looks like plan 9 guys have thought about everything useful ☺ (and
  that I didn't do my homework).
 
  2009/10/1, roger peppe rogpe...@gmail.com:
 
 
   2009/10/1 hugo rivera uai...@gmail.com:
  
  
  
I've been wondering for a while if there's some way to multiplex (if
   
   
this is the correct term) stdout for a given program:
  
  
   that's what tee does.
  
   e.g.
   ls | tee {grep regexp1  file1} {grep regexp2  file2}
  
  
  
  
 
 
 
 





-- 
Hugo



Re: [9fans] sed oddity

2009-08-19 Thread hugo rivera
Sadly things like sed are out of my reach; I have no idea how to
program languages.
Thanks for the reply.

2009/8/18, erik quanstrom quans...@quanstro.net:
  is there some reason why sed doesn't check for write errors on its
   stdout? (or at least it doesn't report them)


 /n/sources/patch/sederrors

  while i agree that sed seems more complicated that i would
  like when debugging, eating errors seems like the wrong thing
  to do.  it seems easy enough [2]/dev/null if the old behavior
  is wanted.

  the problem was that B* functions (Bopen, Bputc, Bputrune, Bterm)
  were not consistently being checked for errors.

  i wonder if it would make sense to add a -error() member
  to Biobufhdr.  since most programs just want to quit if they
  have a bio error, they could just quit there without needing
  lots tedious error checking.

  perhaps -error could just be a boolean.


  - erik




-- 
Hugo



Re: [9fans] Inserting Special Characters into Acme

2009-08-17 Thread hugo rivera
I'd have another window holding the special characters, and just
copy-paste them in the lines you want to (mouse chords are the key for
doing this quickly). Obviously this makes sense only if you have to
insert few special characters per file, and not to many files.
But if you want to add them at the end of each line I think that
,s/$/SP/g
should work. Replace SP for any string of characters you need.

2009/8/17, Aaron W. Hsu arcf...@sacrideo.us:
 Is there some way to insert special characters into Acme text windows?
 Specifically, I want to do some file editing and put CRLF line endings into
 some files, or around specific lines. Is there a way to do this regularly,
 just typing, I'd also like to know a bulk or Edit command to do it, also.

 Aaron W. Hsu


  --
  Of all tyrannies, a tyranny sincerely exercised for the good of its victims
 may be the most oppressive. -- C. S. Lewis




-- 
Hugo



Re: [9fans] make slides in plan 9

2009-08-17 Thread hugo rivera
I have no idea about tex on plan 9, but I've always used beamer on
linux, maybe it's included on plan 9.

2009/8/17, xiangyu xiantingma...@gmail.com:
 Hi, everyone:
  How to make slides in plan 9 ? I always use ConTeXt in linux, but
  it doesn't contained  in the TeX  distrbutions that plan 9 provides.
  so how to make slides in plan 9 ? I'm looking forward  for the
  answer..thanks first !!




-- 
Hugo



Re: [9fans] 9p fids and references

2009-07-31 Thread hugo rivera
OK, thanks.

2009/7/30, roger peppe rogpe...@gmail.com:
 2009/7/30 hugo rivera uai...@gmail.com:
   [...] there's no way two different files point to the

  same data structure (but maybe two different fids do?) so reference
   counting is unnecessary, am I right?


 no, because a file can be opened several times.
  when you open a file you get a new fid.

  so if you've got resources associated with the file,
  as opposed to resources private to the fid,
  you have to reference count them (or poison any
  fids that point to the file, if you *really* want the
  resource to go away)




-- 
Hugo



[9fans] data analysis on plan9

2009-07-09 Thread hugo rivera
Hi,
since I discovered plan 9, about two years ago, I've been constantly
amazed by its simple yet quite powerful design.
From one year now, I am looking forward to move to plan 9 as my main
OS, but I am not able to do so because it lacks the data analysis
tools available in some other systems, like linux.
Because my work involves dealing with data coming from experiments in
astro-particle physics, I am more or less tied to data analysis
software like the R programming language, Python's Numpy, Cern's ROOT
and even gnuplot. While using them, I realized that most of the time I
deal with text files that go here and there as input or output of
small specific programs that perform a given task (I don't know if
this is the result of my Unix/Plan 9 background or just a
coincidence). Say I have a command 'clean' that removes undesired
points from a body of data, and another command 'four' that performs
the FFT; so they are used together as
clean data.txt | four  results.txt
so it occurred to me that one can create single commands to interact
among them to perform some analysis on data, just like in the original
Unix style. Awk can be used as glue among them, with some other small
glue utilities. Plotting data is another thing that I would like to
integrate into this, since plots are quite frequent while analysing
data, but I am not sure how.
Also, something similar to GSL (http://www.gnu.org/software/gsl/)
would be invaluable or maybe even indispensable.
Maybe some day I'll start to write some commands for plan 9 to begin
working on it, but I want to convince myself that this is worth the
time spent.
What do you think of this? my main concern is that perhaps the do one
thing well design falls short for data analysis. I've never seen
people work like this on data analysis before (but I do not think I am
the first to do it) because in general, they tend to use large data
analysis frameworks. I'd really appreciate some feedback on this from
people working on data analysis and also from the plan 9 community
(otherwise I wouldn't be writing here :-)
Saludos

-- 
Hugo



[9fans] Joining multicolumn files

2009-07-02 Thread hugo rivera
Hi,
I've always joined multiple column files in plan 9 using pr(1).
Say you have file A:
columnA1 columnA2 columnA3
and file B:
columnB1 columnB2 columnB3
so, using pr(1), I get another file C:
columnA1 columnA2 columnA3 columnB1 columnB2 columnB3

This worked fine until now: I have a number of files with a number of
columns on each (4-5 columns in 4 files). So, when I try to join the
columns in these files on a single file using pr(1), the resulting
output contains some of the columns, but the columns further to the
right are deleted partially or completely. I've changed some of the
parameters, like setting -w 200, but the output is still incomplete
and has missing columns, plus the ones existing have more spaces
between them. I know that pr(1) is a formatting utility, but is there
a better way to do this? maybe awk? (I have no clue on how to do this
with awk). On linux there is a paste(1) command that does exactly what
I need just join the columns with out caring the line size or spacing.
Saludos
-- 
Hugo



Re: [9fans] Joining multicolumn files

2009-07-02 Thread hugo rivera
Thanks Russ.
I have tryed it yet, but now I know where to start from.

2009/7/2, Russ Cox r...@swtch.com:
 #!/bin/rc
  awk 'BEGIN{
 for(;;){
 $0=;
 ok=getlineARGV[1];
 x=$0;
 if(!(getlineARGV[2])  !ok)
 break;
 print x   $0
 }
  }' $1 $2


  Russ




-- 
Hugo



[9fans] Sam commands in acme

2009-06-26 Thread hugo rivera
Hi,
I am trying to select all c comments from within a file using acme,
but I am unable to do it properly. The command x/\/\*.*\*\// is the
closest I could get, but it doesn't work with comments that span over
more than one line. This raises a question for me: somewhere, I cannot
recall where, I read that commands in sam (and therefore acme) aren't
line oriented but selection oriented, so, shouldn't '.*' match newline
characters also? why it doesn't? I expected '.*' to work with newline
characters since it works for spaces and tabs, and the three of them
are white space, among others.
And finally, what command I should use to select c comments without
regard if they are several lines long or just one?
Saludos
-- 
Hugo



[9fans] Another acme question

2009-06-26 Thread hugo rivera
Hello,
I have another problem with acme.
Lets say I want to check the spelling in all the comments in a c file,
so I execute:
Edit ,x/\/\*.*\*\//  spell   (nevermind this doesn't work for more
than one line comments)
and nothing happens. This doesn't mean that my spelling is good, since
I saw some misspelled words that spell(1) recognizes if I
echo '/* mispelled cument */' | spell
However, the output of
Edit ,x/\/\*.*\*\//  cat
appears in the corresponding +Errors window. I also did a
Edit ,x/\/\*.*\*\//  {cat | spell}
and nothing happens either.
What am I missing?

-- 
Hugo



Re: [9fans] Sam commands in acme

2009-06-26 Thread hugo rivera
I tested the command you suggested (,x/\/\*/.,/\*\//) and it works as
I wanted, thanks. But there's something I still don't understand and
is the meaning of that comma in there. As far as I know, the comma is
a  mark that delimits the addresses that acme understands, but I do
not know how a comma is interpreted inside a regexp. I'd really
appreciate if you could clarify this matter to me.

2009/6/26 yy yiyu@gmail.com:
 2009/6/26 hugo rivera uai...@gmail.com:
 Hi,
 I am trying to select all c comments from within a file using acme,
 but I am unable to do it properly. The command x/\/\*.*\*\// is the
 closest I could get, but it doesn't work with comments that span over
 more than one line. This raises a question for me: somewhere, I cannot
 recall where, I read that commands in sam (and therefore acme) aren't
 line oriented but selection oriented, so, shouldn't '.*' match newline
 characters also? why it doesn't? I expected '.*' to work with newline
 characters since it works for spaces and tabs, and the three of them
 are white space, among others.

 You could use (\n|.) to match any character including newlines
 (regex(6) says that a new line is not cosidered any character, and
 as a matter of fact, \n is part of the sam language, not of regex
 itself). However, since the longest possible regex will be matched,
 then you will also match the end of the comment, so for example in:
 /* comment 1 */
 bar
 /* comment 2 */
 you will match everything, I don't think that is what you want.

 And finally, what command I should use to select c comments without
 regard if they are several lines long or just one?

 Edit ,x/\/\*/.,/\*\//c/COMMENT/

 The possibility of modifying the dot is powerful. Many times it is
 much easier than finding an huge regex.

 Saludos
 --
 Hugo



 Un saludo,


 --
 - yiyus || JGL .





-- 
Hugo



Re: [9fans] Sam commands in acme

2009-06-26 Thread hugo rivera
Yes, you are right. Now I understand it, I missed the / after \*, so I
was thinking that the comma was inside the regexp.
Thanks a lot :-)

2009/6/26 Rudolf Sykora rudolf.syk...@gmail.com:
 2009/6/26 hugo rivera uai...@gmail.com:
 I tested the command you suggested (,x/\/\*/.,/\*\//) and it works as
 I wanted, thanks. But there's something I still don't understand and
 is the meaning of that comma in there. As far as I know, the comma is
 a  mark that delimits the addresses that acme understands, but I do
 not know how a comma is interpreted inside a regexp. I'd really
 appreciate if you could clarify this matter to me.

 I think, the comma is not in a regexp. The 'x' command syntax is
 x/regexp/command
 and the comma is a part of the command: choose the area from the dot
 (included) to the '*/'

 Ruda





-- 
Hugo



[9fans] crontab equivalent

2009-06-23 Thread hugo rivera
Hi,
sorry for the lazy question, but sometimes it's easier to post to
9fans than to think or to seek for info.
Is there any crontab equivalent in plan 9? I mean, is there a way to
execute something regularly at a given time period?
Saludos

-- 
Hugo



Re: [9fans] crontab equivalent

2009-06-23 Thread hugo rivera
OK, thanks.

2009/6/23 erik quanstrom quans...@coraid.com

 On Tue Jun 23 11:23:14 EDT 2009, uai...@gmail.com wrote:
  Hi,
  sorry for the lazy question, but sometimes it's easier to post to
  9fans than to think or to seek for info.
  Is there any crontab equivalent in plan 9? I mean, is there a way to
  execute something regularly at a given time period?
  Saludos

 cron(8) should be what you want.

 - erik




--
Hugo



[9fans] plan 9 regexp

2009-06-03 Thread hugo rivera
Hello,
I am experimenting with some regexp implementations (namely the one
from the practice of programming) and I am a little disoriented by
the use of the '?' operator in plan 9's grep:
say I have the following input

bbb
ab
b
bb
b
aaabb


which I feed into grep with

grep 'a+bb?'

which should match at least one 'a' followed by one or two 'b'. So,
grep's output is

bbb
ab
b
aaabb

which really surprised me at first, since I wasn't expecting the first
line. After some thought, I realized that the 'b' and the 'bb'
patterns, contained in the first line of input, match the regexp, so
grep prints the line.
But then, how exactly the '?' operator is useful for grep? I was
thinking that it was good to filter lines that contain more characters
that desired, but it is not.
Saludos
-- 
Hugo



Re: [9fans] plan 9 regexp

2009-06-03 Thread hugo rivera
OK, thanks for the answers. This shows my lack of imagination.
Saludos

-- 
Hugo



Re: [9fans] plan 9 regexp

2009-06-03 Thread hugo rivera
you are right, but the original post read

 grep 'a+bb?'

so you get at least one 'a' and one or two 'b'.

2009/6/3 Wu JIANG albert.w.ji...@gmail.com:
 actually, a+ means at least one 'a', b? means zero or one 'b'.

 On Wed, Jun 3, 2009 at 10:56 AM, hugo rivera uai...@gmail.com wrote:

 Hello,
 I am experimenting with some regexp implementations (namely the one
 from the practice of programming) and I am a little disoriented by
 the use of the '?' operator in plan 9's grep:
 say I have the following input

 bbb
 ab
 b
 bb
 b
 aaabb
 

 which I feed into grep with

 grep 'a+bb?'

 which should match at least one 'a' followed by one or two 'b'. So,
 grep's output is

 bbb
 ab
 b
 aaabb

 which really surprised me at first, since I wasn't expecting the first
 line. After some thought, I realized that the 'b' and the 'bb'
 patterns, contained in the first line of input, match the regexp, so
 grep prints the line.
 But then, how exactly the '?' operator is useful for grep? I was
 thinking that it was good to filter lines that contain more characters
 that desired, but it is not.
 Saludos
 --
 Hugo






-- 
Hugo



Re: [9fans] plan 9 regexp

2009-06-03 Thread hugo rivera
great, thanks for the answer ;-)

2009/6/3 Wu JIANG albert.w.ji...@gmail.com:
 Sorry, I misunderstood your question in the first place. I think one example
 can be good to show how ``?'' is useful somehow in grep.

 Suppose I have a file, I want to find out a keyword ``produce'', but I know
 that the word ``produced'' might also be the word that I am interested (stem
 process in information retrieval or nlp). So I use the pattern produced?
 to find all the words useful to me.

 I hope this can be helpful at least a little bit. :-)

 On Wed, Jun 3, 2009 at 4:11 PM, hugo rivera uai...@gmail.com wrote:

 you are right, but the original post read

  grep 'a+bb?'

 so you get at least one 'a' and one or two 'b'.

 2009/6/3 Wu JIANG albert.w.ji...@gmail.com:
  actually, a+ means at least one 'a', b? means zero or one 'b'.
 
  On Wed, Jun 3, 2009 at 10:56 AM, hugo rivera uai...@gmail.com wrote:
 
  Hello,
  I am experimenting with some regexp implementations (namely the one
  from the practice of programming) and I am a little disoriented by
  the use of the '?' operator in plan 9's grep:
  say I have the following input
 
  bbb
  ab
  b
  bb
  b
  aaabb
  
 
  which I feed into grep with
 
  grep 'a+bb?'
 
  which should match at least one 'a' followed by one or two 'b'. So,
  grep's output is
 
  bbb
  ab
  b
  aaabb
 
  which really surprised me at first, since I wasn't expecting the first
  line. After some thought, I realized that the 'b' and the 'bb'
  patterns, contained in the first line of input, match the regexp, so
  grep prints the line.
  But then, how exactly the '?' operator is useful for grep? I was
  thinking that it was good to filter lines that contain more characters
  that desired, but it is not.
  Saludos
  --
  Hugo
 
 
 



 --
 Hugo






-- 
Hugo



[9fans] plan 9 floating point representation

2009-05-20 Thread hugo rivera
Hi,
I am learning a bit about floating point representation and I am
wondering about how plan 9 does this.
According to IEEE 754 (I think) the convention used by C for single
precision floating point numbers is to use 24 of the 32 bits available
for the significand and 8 bits for the exponent. It seems to me that
plan 9 follows this convention but I am still kind of puzzled about
the base of the exponent. I've been experimenting (on a 386) a while
and it looks like a base 4 to me, which is kind of strange, since I
was expecting a base 2 or 10. I think I got something wrong, but I
would appreciate if someone can explain this to me to have a better
idea of how this works. It looks to me that this stuff is very machine
dependent (or language?), is it?
The point of all this is to classify raw data (4 byte length)
according to their magnitude, I don't really care about the
significant. This is just an exercise for me, since there are other
easier ways to do it.

Saludos
-- 
Hugo



Re: [9fans] plan 9 floating point representation

2009-05-20 Thread hugo rivera
thanks, I'll study it with care.
Saludos

2009/5/20, Jonas Amoson jonas.amo...@home.se:

  Hello Hugo,


  Done some experiments with the indivudual
  bits in Lunix, and would be very surprised
  if it is not handled the same under Plan 9,
  given the same hardware architecture.

  The exponent is stored in base 2, but What
  might be a bit confusing, is that it is not
  stored using two's complement, but rather
  using a bias. If you have an exponent of 8
  bits (in a 32-bit IEEE float) an exponent of
  zero is represented by '1000' or 127.
  Simply add the desired exponent, whether pos
  or neg. -1 will be 126, +1 will be 128.

  This link explains the whole thing in more detail:
  http://steve.hollasch.net/cgindex/coding/ieeefloat.html

  /jonas

  -Ursprungligt Meddelande-
From: hugo rivera [uai...@gmail.com]
  Sent: 20/5/2009 11:50:51 AM
  To: 9fans@9fans.net
  Subject: [9fans] plan 9 floating point representation

  Hi,
  I am learning a bit about floating point representation and I am
  wondering about how plan 9 does this.
  According to IEEE 754 (I think) the convention used by C for single
  precision floating point numbers is to use 24 of the 32 bits available
  for the significand and 8 bits for the exponent. It seems to me that
  plan 9 follows this convention but I am still kind of puzzled about
  the base of the exponent. I've been experimenting (on a 386) a while
  and it looks like a base 4 to me, which is kind of strange, since I
  was expecting a base 2 or 10. I think I got something wrong, but I
  would appreciate if someone can explain this to me to have a better
  idea of how this works. It looks to me that this stuff is very machine
  dependent (or language?), is it?
  The point of all this is to classify raw data (4 byte length)
  according to their magnitude, I don't really care about the
  significant. This is just an exercise for me, since there are other
  easier ways to do it.

  Saludos
  --
  Hugo

  .




 ___
 Eniro Supersök - är vad det heter




-- 
Hugo



Re: [9fans] venti question

2009-05-13 Thread hugo rivera
I am trying to use buildindex but I run into trouble:
1.- the man page and the usage displayed by the command are
inconsistent. According to the man page, buildindex takes two
arguments and may take two options

venti/buildindex [ -B blockcachesize ] [ -Z ] venti.conf tmp

but execute buildindex with no arguments and you get

usage: buildindex [-bd] [-i isect]... [-M imem] venti.conf

options -b -d -i -M are not described in the man page and I have no
idea what they are supposed to do (although I can imagine the use of
-i and -b), and there's no tmp file required anymore.
2. I edited my venti.conf, so now it looks like

index main
isect /apollo/hugo/isect0
isect /apollo/hugo/isect1 # -- new line, not found in the
original venti.conf
arenas /apollo/hugo/arenas0
arenas /apollo/hugo/arenas1 # -- new line, not found in the
original venti.conf

but when I ran

venti/buildindex -i isect1 $home/lib/venti.conf

I got

err 2: mismatched number index sections: found 2 expected 1
venti/buildindex: can't init venti: mismatched number index sections:
found 2 expected 1

so I removed the isect1 line from my venti.conf and executed

venti/buildindex -i isect1 $home/lib/venti.conf

and got

1,731,717 clumps, 63,903 buckets
2009/0513 10:35:35 read index
warning: did not find index section isect1
2009/0513 10:35:35 arena arenas00: 236950 entries
2009/0513 10:35:36 arena arenas01: 317534 entries
2009/0513 10:35:36 arena arenas02: 69564 entries
2009/0513 10:35:36 arena arenas03: 231390 entries
2009/0513 10:35:37 arena arenas04: 246845 entries
2009/0513 10:35:37 arena arenas05: 65202 entries
2009/0513 10:35:38 arena arenas06: 65204 entries
2009/0513 10:35:38 arena arenas07: 77445 entries
2009/0513 10:35:38 arena arenas08: 65197 entries
2009/0513 10:35:38 arena arenas09: 65189 entries
2009/0513 10:35:38 arena arenas010: 126699 entries
2009/0513 10:35:39 arena arenas011: 137570 entries
2009/0513 10:35:39 arena arenas012: 26928 entries
2009/0513 10:35:39 done arenaentries=1,731,717 indexed=0 (nskip=0)

which complains about not finding isect1, so I am quite confused now.
I also tried some other combinations, but I always got the mismatched
number of index sections error. I saw Steve's article, but he uses
the syntax described in the man page which, if given to my buildindex
version, produces the usage output on screen. Note that I am using
p9p.
Any help appreciated.

-- 
Hugo



Re: [9fans] venti question

2009-05-13 Thread hugo rivera
2009/5/13, Steve Simon st...@quintile.net:
  I would suggest you try again from scratch.

I did, and now everything is working now with twice as many arenas :-)
I just extracted some files from march 15, and everything seems to be
working just fine.
I reformatted the indexes and called fmtindex with the new venti.conf.
Then I tried to extract something but then it couldn't find an entry
with my vac key, so then I built the index again with buildindex and
my venti.conf, and now it works again.
I saw that fmtindex has a -a flag to add more arenas to the index, but
I wasn't sure to use it from the beginning since it looks it's just
useful to add arenas and not indexes.
Thanks for the help


-- 
Hugo



  1   2   >