9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] starting to write native code
@ 2004-03-16 13:23 cej
  2004-03-16 13:28 ` David Presotto
  0 siblings, 1 reply; 3+ messages in thread
From: cej @ 2004-03-16 13:23 UTC (permalink / raw)
  To: 9fans

hi, all!

I'm trying to read-in a matrix of floats, rows separated by
newline, columns by blanks:

0.000026 0.000019 0.000003 ... 0.000051
0.000022 0.000059 0.000003 ... 0.000033
0.000024 0.000011 0.000053 ... 0.000021
...

my idea is to use s_read_line() and s_parse(),
or am I [completely] wrong? Or is Brdline() and strtok() the way?
I usually look how others write code, however, i haven't
grepped much of those from /sys/src/cmd...
so, if somebody could just push me the right direction.
thanks, regards,

++pac.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] starting to write native code
  2004-03-16 13:23 [9fans] starting to write native code cej
@ 2004-03-16 13:28 ` David Presotto
  2004-03-16 15:01   ` rog
  0 siblings, 1 reply; 3+ messages in thread
From: David Presotto @ 2004-03-16 13:28 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 65 bytes --]

Given that sizes are fixed, I'ld use Brdline, tokenize, and atof.

[-- Attachment #2: Type: message/rfc822, Size: 2461 bytes --]

From: <cej@gli.cas.cz>
To: <9fans@cse.psu.edu>
Subject: [9fans] starting to write native code
Date: Tue, 16 Mar 2004 14:23:59 +0100
Message-ID: <ACCF003CBA3D09458207DB0CB86AD17D066316@XMAIL.asuch.cas.cz>

hi, all!

I'm trying to read-in a matrix of floats, rows separated by
newline, columns by blanks:

0.000026 0.000019 0.000003 ... 0.000051
0.000022 0.000059 0.000003 ... 0.000033
0.000024 0.000011 0.000053 ... 0.000021
...

my idea is to use s_read_line() and s_parse(),
or am I [completely] wrong? Or is Brdline() and strtok() the way?
I usually look how others write code, however, i haven't
grepped much of those from /sys/src/cmd...
so, if somebody could just push me the right direction.
thanks, regards,

++pac.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] starting to write native code
  2004-03-16 13:28 ` David Presotto
@ 2004-03-16 15:01   ` rog
  0 siblings, 0 replies; 3+ messages in thread
From: rog @ 2004-03-16 15:01 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 68 bytes --]

and even if the line lengths weren't fixed, there's always Brdstr.

[-- Attachment #2: Type: message/rfc822, Size: 4515 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 65 bytes --]

Given that sizes are fixed, I'ld use Brdline, tokenize, and atof.

[-- Attachment #2.1.2: Type: message/rfc822, Size: 2461 bytes --]

From: <cej@gli.cas.cz>
To: <9fans@cse.psu.edu>
Subject: [9fans] starting to write native code
Date: Tue, 16 Mar 2004 14:23:59 +0100
Message-ID: <ACCF003CBA3D09458207DB0CB86AD17D066316@XMAIL.asuch.cas.cz>

hi, all!

I'm trying to read-in a matrix of floats, rows separated by
newline, columns by blanks:

0.000026 0.000019 0.000003 ... 0.000051
0.000022 0.000059 0.000003 ... 0.000033
0.000024 0.000011 0.000053 ... 0.000021
...

my idea is to use s_read_line() and s_parse(),
or am I [completely] wrong? Or is Brdline() and strtok() the way?
I usually look how others write code, however, i haven't
grepped much of those from /sys/src/cmd...
so, if somebody could just push me the right direction.
thanks, regards,

++pac.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-16 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-16 13:23 [9fans] starting to write native code cej
2004-03-16 13:28 ` David Presotto
2004-03-16 15:01   ` rog

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).