Suggestions on mimicing fgetc and fseek with F90

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hi all,

I know that many compilers have hooks to the C routines fgetc and fseek. 
      I'  However, I was hoping to use standard F90 I/O to do this.  I 
read data files that vary from 3MB to 45MB in size.  So sometime the 
whole file is read to access data.  Other times I seek into the file to 
pluck a few bytes out.

Would something like the following be practical

To mimic reading a file in a fgetc fashion

character(1) c1
character(100) text100
open(iunit, fname='foo', form='formatted',access='sequential')

do i =1,100
   read(iunit,'(A1)',advance='no')c1
   text100(i:i) = c1
end do


The to do a seek followed by a read I was thinking of something like the 
following that would read characters starting at the 300th character and 
stopping at the 399th character.

character(1) c1
character(100) text100
open(iunit, fname='foo', form='formatted',access='direct',recl=1)

j = 1
do i =300,399
   read(iunit,rec=i)c1
   text100(j:j) = c1
   j = j +1
end do


Does this seem like a reasonable approach?  Are there any known speed 
issues with this approach?  Fgetc and fseek are working for me now, but 
I would like to removed the non-standard fortran calls.

Thanks in advance,

Mike Sutton

0
Reply mws116 (5) 10/26/2005 1:30:49 AM

See related articles to this posting


m sutton <mws116@usa.com> wrote:

> To mimic reading a file in a fgetc fashion
....
> do i =1,100
>    read(iunit,'(A1)',advance='no')c1
>    text100(i:i) = c1
> end do

Perhaps I misrecall (as I don't tend to do things like this, so I'd have
to check to be sure), but I don't think this will ever read past the end
of the first record.

> The to do a seek followed by a read I was thinking of something like the
> following that would read characters starting at the 300th character and
> stopping at the 399th character.
> 
> character(1) c1
> character(100) text100
> open(iunit, fname='foo', form='formatted',access='direct',recl=1)
> 
> j = 1
> do i =300,399
>    read(iunit,rec=i)c1
>    text100(j:j) = c1
>    j = j +1
> end do
> 
> Does this seem like a reasonable approach?  Are there any known speed
> issues with this approach?  Fgetc and fseek are working for me now, but
> I would like to removed the non-standard fortran calls.

Many, many issues. Start with the fact that you aren't guaranteed to be
able to open an arbitrary file as direct access at all, though you
probably can on most current systems. Then there is the problem that,
even if you can do such an open, the conversion between the resulting
"record numbers" and file position is not well-defined and portable. In
particular, you are likely to find "surprises" in switching between
unix-like systems (where end-of-record for text files tends to be a
single byte), vs dos/windows-like systems where it tends to be two bytes
(and we'll ignore vms-like systems where things are more different than
that).

Oh, and your read is unformatted, while the open is formatted. I'll
assume that is just a typo; in any case it is easily fixed.  You can
concievably do character data either way, but you do need to be
consistent, and each has a slightly different set of subtle portavility
issues.

Yes, reading character-at-a-time can have speed issues. So can direct
access in general (it can turn off some read-ahead optimizations). They
might not be significant enough to worry about for your application;
that part is hard to tell. If you are doing formatted I/O, then pretty
much by definition, you aren't going to be going blazingly fast anyway,
the format processing might dwarf anything else, and you probably aren't
dealing with gigabyte-sized files.

All those "issues" aside, it might work adequately for you. Things
aren't as bad as, on rereading the above, I've made it sound. Might even
be the best current approach for your application, all things
considered. But don't think that this will make your code perfectly
standard-conforming, portable, and bullet-proof.

Come f2003 compilers, I think you'll want to look at stream I/O, but the
day for that is not quite yet here.

-- 
Richard Maine                    | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle           |  -- Mark Twain
0
Reply nospam47 (9747) 10/26/2005 3:29:55 AM

In message <1h50833.ighhr11xx8akyN%nospam@see.signature>, Richard Maine 
<nospam@see.signature> writes
>Come f2003 compilers, I think you'll want to look at stream I/O, but the
>day for that is not quite yet here.
>

Richard has perhaps forgotten (or chosen to ignore) the fact that the 
g95 compiler (which you can download free from www.g95.org) implements 
the F2003 Stream I/O specification in all its glory.  I wrote some notes 
on how it works at here:
  http://www.star.le.ac.uk/~cgp/streamIO.html



-- 
Clive Page
0
Reply junk3604 (64) 10/27/2005 5:57:42 PM

In article <gfAaskCWURYDJw7P@page.demon.co.uk>,
	Clive Page <junk@page.demon.co.uk> writes:
> In message <1h50833.ighhr11xx8akyN%nospam@see.signature>, Richard Maine 
> <nospam@see.signature> writes
>>Come f2003 compilers, I think you'll want to look at stream I/O, but the
>>day for that is not quite yet here.
>>
> 
> Richard has perhaps forgotten (or chosen to ignore) the fact that the 
> g95 compiler (which you can download free from www.g95.org) implements 
> the F2003 Stream I/O specification in all its glory.  I wrote some notes 
> on how it works at here:
>   http://www.star.le.ac.uk/~cgp/streamIO.html

Perhaps, Richard noticed that the OP specifically requested a
"standard F90 I/O to do this".

-- 
Steve
http://troutmask.apl.washington.edu/~kargl/
0
Reply kargl (773) 10/27/2005 6:16:12 PM

Clive Page <junk@page.demon.co.uk> wrote:

> In message <1h50833.ighhr11xx8akyN%nospam@see.signature>, Richard Maine
> <nospam@see.signature> writes
> >Come f2003 compilers, I think you'll want to look at stream I/O, but the
> >day for that is not quite yet here.
> 
> Richard has perhaps forgotten (or chosen to ignore) the fact that the
> g95 compiler (which you can download free from www.g95.org) implements
> the F2003 Stream I/O specification in all its glory.

A little bit of both (forgotten and chosen to ignore). I had forgotten,
though your mention reminds me that I did see mention of this feature
being done. I was "ignoring" it in that the poster seemed to have
interest in portability, and having the feature in one or two compilers
doesn't yet get you there.

Still, your point is well taken. And g95 is running on enough different
platforms that you do have at least a certain kind of portability with
it today (with more in the future as other compilers implement this).

-- 
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain
0
Reply nospam47 (9747) 10/27/2005 6:21:10 PM

In message <djr5hc$cra$1@gnus01.u.washington.edu>, Steven G. Kargl 
<kargl@troutmask.apl.washington.edu> writes
>Perhaps, Richard noticed that the OP specifically requested a
>"standard F90 I/O to do this".
>
Well maybe that's the explanation.   Of course there really isn't such a 
thing, as F90 didn't support it.  There are three solutions as far as I 
know:

(1) Use g95 which is a Standard F90 compiler supporting stream I/O 
conforming to the latest Standard.  So far this solution isn't very 
portable because I don't know of other compilers which have added this 
F2003 feature, but no doubt more will be along soon.  But it seems to me 
to work well, and is the most future-proof.

(2) Use some other Fortran90 compiler which has stream or binary I/O as 
a proprietary extension.  Not, in my opinion, as good as (1).

(3) Do it using formatted direct-access with RECL=1, which works with 
many compilers but is awkward to use (though it can be wrapped in a set 
of subroutines), inefficient (I suspect), and not totally portable.




-- 
Clive Page
0
Reply junk3604 (64) 10/27/2005 9:55:58 PM

Clive Page wrote:
> In message <djr5hc$cra$1@gnus01.u.washington.edu>, Steven G. Kargl 
> <kargl@troutmask.apl.washington.edu> writes
> 
>> Perhaps, Richard noticed that the OP specifically requested a
>> "standard F90 I/O to do this".
>>
> Well maybe that's the explanation.   Of course there really isn't such a 
> thing, as F90 didn't support it.  There are three solutions as far as I 
> know:
> 
> (1) Use g95 which is a Standard F90 compiler supporting stream I/O 
> conforming to the latest Standard.  So far this solution isn't very 
> portable because I don't know of other compilers which have added this 
> F2003 feature, but no doubt more will be along soon.  But it seems to me 
> to work well, and is the most future-proof.

I reckon (1) is the way to go .... along with a request to one's compiler vendor (assuming 
one also has a licensed compiler along with g95) to start adding f2003 features. I mean, 
that's what upgrade/maintenance fees should be for, no?  :o)  I would think the addition 
of the f2003 access="stream" feature on I/O would be one of the more easier additions to 
make to current compilers (seeing as most of them have it as extensions under a variety of 
different names) if it hasn't been done already.

<aside>
Apart from allocatable components of derived types, one of the other things I'm hanging 
out for in f2003 is the PROTECTED attribute for module variables (I wouldn't think that 
would be difficult to implement either, but it's probably the total opposite).
</aside>

Questions from managers can be answered with your future-proofing argument. It might also 
stimulate a bit more groundswell for faster development of, and transition to, f2003 
compilers.

Anyway... it's getting late. ehem.

cheers,

paulv

-- 
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
0
Reply paul.vandelst (1947) 10/27/2005 10:25:15 PM

Clive Page wrote:
> In message <djr5hc$cra$1@gnus01.u.washington.edu>, Steven G. Kargl
> <kargl@troutmask.apl.washington.edu> writes
>> Perhaps, Richard noticed that the OP specifically requested a
>> "standard F90 I/O to do this".
>>
> Well maybe that's the explanation.   Of course there really isn't
> such a thing, as F90 didn't support it.  [...]

Well, all of the functionality of *formatted* streams was
already supported in F90.  The F2003 formatted stream
feature adds nothing to the capability of the Fortran
language.

-- 
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies."   --  C. A. R. Hoare


0
Reply jamesgiles (2210) 10/27/2005 11:11:42 PM

Thanks for the ideas.  For now I will stick with fgetc & fseek even 
though they are not standard.  I have to support the Sun, CVF, PGI and 
SGI compilers.  These are the compilers that the users have.

I have not tried g95 or gfortran yet.  It looks like gfortran does not 
support fgetc and fseek.

Mike Sutton
0
Reply mws116 (5) 11/2/2005 3:32:36 AM

In article <orW9f.5760$Kv.1971@newssvr22.news.prodigy.net>,
	m sutton <mws116@usa.com> writes:
> 
> I have not tried g95 or gfortran yet.  It looks like gfortran does not 
> support fgetc and fseek.
> 

It's on the gfortran TODO list.

-- 
Steve
http://troutmask.apl.washington.edu/~kargl/
0
Reply kargl (773) 11/2/2005 6:02:13 PM

>  Apart from allocatable components of derived types, one of the other things I'm hanging
> out for in f2003 is the PROTECTED attribute for module variables (I wouldn't think that
> would be difficult to implement either, but it's probably the total opposite).

Sun f95 has supported the PROTECTED attribute for more than three years
now.
It was not difficult to implement.  It did require extensions to Sun's
module file
format, and they were not done correctly; but that was a matter of
process, not
technology.

Bob Corbett

0
Reply robert.corbett2 (862) 11/3/2005 9:43:53 AM

> (1) Use g95 which is a Standard F90 compiler supporting stream I/O
> conforming to the latest Standard.  So far this solution isn't very
> portable because I don't know of other compilers which have added this
> F2003 feature, but no doubt more will be along soon.

Sun f95 has had stream access for more than three years now.

Bob Corbett

0
Reply robert.corbett2 (862) 11/3/2005 9:45:27 AM


robert.corbett@sun.com wrote:
>> Apart from allocatable components of derived types, one of the other things I'm hanging
>>out for in f2003 is the PROTECTED attribute for module variables (I wouldn't think that
>>would be difficult to implement either, but it's probably the total opposite).
> 
> 
> Sun f95 has supported the PROTECTED attribute for more than three years
> now.
> It was not difficult to implement.  It did require extensions to Sun's
> module file
> format, and they were not done correctly; but that was a matter of
> process, not
> technology.
> 
> Bob Corbett
> 
There's a potential gotcha in PROTECTED variables.  The
standard basically says they can't be defined (or undefined)
outside of the module.  That's easy enough for the compiler
to enforce in the USEing routine, but not if they are
passed on to an external subroutine.
       use some_module, only : a_protected_variable
       call some_random_external (a_protected_variable)
and you're on your own.  There's no guaranteed compiler
help with the protection.

Dick Hendrickson

0
Reply dick.hendrickson (1286) 11/3/2005 5:23:50 PM

Dick Hendrickson wrote:
> 
> 
> robert.corbett@sun.com wrote:
> 
>>> Apart from allocatable components of derived types, one of the other 
>>> things I'm hanging
>>> out for in f2003 is the PROTECTED attribute for module variables (I 
>>> wouldn't think that
>>> would be difficult to implement either, but it's probably the total 
>>> opposite).
>>
>>
>>
>> Sun f95 has supported the PROTECTED attribute for more than three years
>> now.
>> It was not difficult to implement.  It did require extensions to Sun's
>> module file
>> format, and they were not done correctly; but that was a matter of
>> process, not
>> technology.
>>
>> Bob Corbett
>>
> There's a potential gotcha in PROTECTED variables.  The
> standard basically says they can't be defined (or undefined)
> outside of the module.  That's easy enough for the compiler
> to enforce in the USEing routine, but not if they are
> passed on to an external subroutine.
>       use some_module, only : a_protected_variable
>       call some_random_external (a_protected_variable)
> and you're on your own.  There's no guaranteed compiler
> help with the protection.

Hmm. How is this different from the case where one does:

   call some_random_external(1)

   subroutine some_random_external(j)
     integer j
     j = j+1
   end subroutine some_random_external

?? (If at all)

If, in your
    use some_module, only : a_protected_variable
    call some_random_external (a_protected_variable)
example, the external routine modifies the protected variable, what happens upon return to 
the calling routine? I.e what value does "a_protected_variable" contain?

cheers,

paulv

-- 
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
0
Reply paul.vandelst (1947) 11/3/2005 5:34:19 PM


Paul Van Delst wrote:

> Dick Hendrickson wrote:
> 
>>
>>
>> robert.corbett@sun.com wrote:
>>
>>>> Apart from allocatable components of derived types, one of the other 
>>>> things I'm hanging
>>>> out for in f2003 is the PROTECTED attribute for module variables (I 
>>>> wouldn't think that
>>>> would be difficult to implement either, but it's probably the total 
>>>> opposite).
>>>
>>>
>>>
>>>
>>> Sun f95 has supported the PROTECTED attribute for more than three years
>>> now.
>>> It was not difficult to implement.  It did require extensions to Sun's
>>> module file
>>> format, and they were not done correctly; but that was a matter of
>>> process, not
>>> technology.
>>>
>>> Bob Corbett
>>>
>> There's a potential gotcha in PROTECTED variables.  The
>> standard basically says they can't be defined (or undefined)
>> outside of the module.  That's easy enough for the compiler
>> to enforce in the USEing routine, but not if they are
>> passed on to an external subroutine.
>>       use some_module, only : a_protected_variable
>>       call some_random_external (a_protected_variable)
>> and you're on your own.  There's no guaranteed compiler
>> help with the protection.
> 
> 
> Hmm. How is this different from the case where one does:
> 
>   call some_random_external(1)
> 
>   subroutine some_random_external(j)
>     integer j
>     j = j+1
>   end subroutine some_random_external
> 
> ?? (If at all)
I don't think it's fundamentally different.  It's a
programming error, and one which compilers generally
have trouble diagnosing.

> 
> If, in your
>    use some_module, only : a_protected_variable
>    call some_random_external (a_protected_variable)
> example, the external routine modifies the protected variable, what 
> happens upon return to the calling routine? I.e what value does 
> "a_protected_variable" contain?

Unless I missed something in the standard, it's undefined.
The rule is ultimately a boy scout one, "Thou shalt not mess
up a protected variable".  If you do, your program is non
standard and anything can happen.

Protected variables might be stored in read-only memory,
or they might be passed-by-value, but you can't count it.

Dick Hendrickson
> 
> cheers,
> 
> paulv
> 

0
Reply dick.hendrickson (1286) 11/3/2005 5:45:09 PM

Paul Van Delst wrote:
> Dick Hendrickson wrote:
....
>> There's a potential gotcha in PROTECTED variables.  The
>> standard basically says they can't be defined (or undefined)
>> outside of the module.  That's easy enough for the compiler
>> to enforce in the USEing routine, but not if they are
>> passed on to an external subroutine.
>>       use some_module, only : a_protected_variable
>>       call some_random_external (a_protected_variable)
>> and you're on your own.  There's no guaranteed compiler
>> help with the protection.
>
> Hmm. How is this different from the case where one does:
>
>    call some_random_external(1)
>
>    subroutine some_random_external(j)
>      integer j
>      j = j+1
>    end subroutine some_random_external
>
> ?? (If at all)
>
> If, in your
>     use some_module, only : a_protected_variable
>     call some_random_external (a_protected_variable)
> example, the external routine modifies the protected variable, what
> happens upon return to the calling routine? I.e what value does
> "a_protected_variable" contain?

I think that's the point Dick was making.  In both cases the
call is illegal.  But, the standard doesn't require implementations
to detect or report the violation.  And in fact, actual compilers
seldom will.  It's not just a "quality of implementation" issue
since detecting this can actually cause significant degradation
in quality (specifically efficiency).  It's one of those where
it's up to the individual programmer to be aware of the
problem and not do the illegal call.

(In your example above of passing a literal constant, I support
a change in the standard anyway.  The rule should be that when
you pass literals or named constants the compiler should use
call-by-value semantics for that argument.  That is, the procedure
may cause the dummy argument to be redefined or become
undefined but the caller ignores any change in value.  That's
already a very common behavior of implementations when the
actual argument is an expression.)

-- 
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies."   --  C. A. R. Hoare


0
Reply jamesgiles (2210) 11/3/2005 5:54:09 PM

Dick Hendrickson <dick.hendrickson@att.net> wrote:

> Paul Van Delst wrote:
> > I.e what value does "a_protected_variable" contain?
> 
> Unless I missed something in the standard, it's undefined.

I'll quibble with that answer. I think that what you have is illegal
code in that case. This in the category of illegal code for which
anything can happen. "Anything" encompasses a lot more than just the
value of the variable being undefined. For example, the code might well
abort wkith some kind of error. It might even fail to compile. You can't
count on the compiler detecting such things, but it is certainly allowed
to, and one could imagine scenarios in which it might be possible.

When the standard says that the value of a variable is undefined, that
at least ties down the effects to that variable. Illegal code doesn't
tie things down that much.

I'm sure that Dick knows all this stuff and was probably just speaking
loosely. My elaboration is just for other readers.

-- 
Richard Maine                     | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov            |       -- Mark Twain
0
Reply nospam47 (9747) 11/3/2005 7:03:03 PM

Dick Hendrickson wrote:
| Paul Van Delst wrote:
| 
|| Dick Hendrickson wrote:
|||| 
||| There's a potential gotcha in PROTECTED variables.  The
||| standard basically says they can't be defined (or undefined)
||| outside of the module.  That's easy enough for the compiler
||| to enforce in the USEing routine, but not if they are
||| passed on to an external subroutine.
|||       use some_module, only : a_protected_variable
|||       call some_random_external (a_protected_variable)
||| and you're on your own.  There's no guaranteed compiler
||| help with the protection.
|| 
|| 
|| Hmm. How is this different from the case where one does:
|| 
||   call some_random_external(1)
|| 
||   subroutine some_random_external(j)
||     integer j
||     j = j+1
||   end subroutine some_random_external
|| 
|| ?? (If at all)
|
| I don't think it's fundamentally different.  It's a
| programming error, and one which compilers generally
| have trouble diagnosing.
| 
| Protected variables might be stored in read-only memory,
| or they might be passed-by-value, but you can't count it.
 
There is a likely difference in implementation though.
For constants (and expressions?), it's fairly easy for 
compiler to put them in read-only memory (CVF and IVF
do that by default and you'll get a run-time error if
you try Paul's code). 

However, for protected variables compiler can't do that 
because it couldn't know when it will be (legally) written 
by module procedures or (illegally) written by outside 
procedures, and one can't mark OS memory pages as 
"full access for these routines and read-only for others".

So, the bottom line is that it *is* a programmer's error
but I wouldn't be optimistic that compilers would be able
to catch it in all situations (but, for example, if dummy
argument j of some_random_external had an INTENT(INOUT)
declared & explicit interface provided, a compile-time 
error would be justified).
-- 
 Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.
0
Reply jdujic (694) 11/4/2005 7:47:59 AM
comp.lang.fortran 11047 articles. 36 followers. Post

17 Replies
207 Views

Similar Articles

[PageSpeed] 30


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

f90
Hi everybody... Please someone help me about F90. Send me a F90 program which solves the Van der Pol equation with forth order runge-kutta method and saves the datas in a .text or .dat file. Tenks... In article <1165953170.338360.275960@79g2000cws.googlegroups.com>, mercialago@hotmail.com says... > Hi everybody... Please someone help me about F90. Send me a F90 program > > which solves the Van der Pol equation with forth order runge-kutta > method and saves the datas in a .text or .dat file. Tenks... I would think that you would learn a lot more about F90 if you did yo...

fseek
On thinking about the "replace a word in a file" thread, I wondered how easy it would be to accomplish the same thing with only one file pointer. This led me to some questions... "For a text stream, offset must be zero, or a value returned by ftell (in which case origin must be SEEK_SET)." If offset is a value returned by ftell (which returns the current file position), and origin is SEEK_SET, then fseek() sets the position to the current position. What is the point of doing so? And, more importantly, why can't text streams be fseek()'ed randomly like a...

suggest
Matlab 7 suggest me the following Use the DIMENSION input argument to prod instead of using transpose (') p3=prod(p2'); What Does it mean? "Andrea" <cigen@hotmail.com> wrote in message news:Qti5d.4802$O9.409037@news4.tin.it... > Matlab 7 suggest me the following > Use the DIMENSION input argument to prod instead of using transpose (') > p3=prod(p2'); > > What Does it mean? > > down columns is the first dimension, across rows is the second dimension, etc. Just use 1, 2, ... In article <Qti5d.4802$O9.409037@news4.tin.it>, &qu...

fgetc
#include <stdio.h> int main ( int argc, char *argv[] ) { if ( argc != 2 ) /* argc should be 2 for correct execution */ { /* We print argv[0] assuming it is the program name */ printf( "usage: %s filename", argv[0] ); } else { // We assume argv[1] is a filename to open FILE *file = fopen( argv[1], "r" ); /* fopen returns 0, the NULL pointer, on failure */ if ( file == 0 ) { printf( "Could not open file\n" ); } else { unsigned char x; ...

fseek
I am definitely doing something wrong with fseek()... I'm trying to break a binary file into parts, and I'm getting errors when I try to read and write the file with an offset of a number.. Heres a snippet of my code: x=fopen(fx,'r') x_dec=fopen(fx_dec,'w+') fseek(x,0,'eof'); a=ftell(x) frewind(x); fseek(x,5,'bof'); datax=fread(x,20,'real*8','b') I open the file and the file I am going to write the snippet to.. Find eof indice number, .. rewind the file again and fseek it to a certain area in the file. When I try to fread it like t...

suggestions?
Hello, I have to get euro prices in a dialog. My solution would be a text field initially filled only with an euro sign (undeleble) that accept only digits, an optional comma and optional 1 or 2 digits for cents. Even if the field is left blank, I want to check all data (there are also other components) when the user push an OK button. How can I do this? I am a bit confusing with JFormattedTextFields, JTextFields, NumberFormat and DecimalFormat classes. Thanks, Gaetano <gaetanoortisi@yahoo.it> wrote in message news:1142199267.915920.282230@e56g2000cwe.googlegro...

Suggestion
Hello there, i'm trying to implement "osnaps" in my view (2d or 3d). Osnaps allow to force the input to a point when the mouse is near a sensitive vertex (i.e. start or end point of a line) I have found 3 possible methods, but I don't know which one could be the most efficient. - Get all possible osnap points and compare them in World space with the current mouse position (not so good). - Get all possible osnap points and compare them in View space with the current mouse position (better) - Use opengl selection mode with a big enought viewport. Anyway I should do selection ...

Your Suggestion
Dear All I want your suggestion on below implementation so that i can have the most optimised solution for the below Lets assume I have the data to encode at the transmitter and decode at the reciver. suppose we have high range of data varing from -infity to + infinity what i decide is that i take the certain range of the above and do the encoding into the 5 bit. like the below operation : 00000 -12 00001 -4 00010 0 00011 4 ...

suggestion
Hi group users, I'm writing this, since I am extremely confused about how to configure network time sync for an embedded system I'm working on. Possible time sources for the box are: 1. onboard RTC (used at boot to start-up system clock) 2. NTP server (optional and configurable: used as soon as reachable for synchronisation) 3. local GPS connected to serial line (an alternative to NTP: used as soon as it fix ad send timestamps) When first thinking about the time sync problem, I was pleased to learn that ntpd was able to handle the time data from the GPS as a special time source, tog...

What Do You Suggest?
Hey all im looking to buy at laptop at the end of the summer and was looking for some advice I've done some perliminary research and found although the cheaper Acer's look good on paper, they're actually shit. So i figure it must be a Dell or something else i want. I want to be able to play my games on it, so it needs a good graphics card perfrably 64mb. And at least 512ram. im looking for speed to be over 2ghz and hardrive at least 30gig. My budget is between �800 and at absolute stretch �1100 but would be happy with something more in the �900-1000 range. Also i would at leas...

any suggestion?
Hi, just wondering beside autocad, what other program do you guys > prefer to use for doing 3d stuff?? By comparing 3d studio MAX & > Rhino 3D, > which one is the beter one?? I'm currently using both autocad and > Rhino 3D, & find out that you could export you autocad file to > Rhino and do rendering there... Since Rhino's rendering is much > more > nicer... Also, what program do poeple usually use for making 3 > d animation?? > hope to hear any suggestion form any of you =) thx!~ "tarepanda" <bearbearduck@yahoo.ca> wrote in message n...

Some suggestions
Dear, I have two suggestions which I think would be useful in ruby. First of all, I have noted that a sleeping thread (a thread that was ..stop'ed) does no longer have the method .stop... This means that one must use thread.stop unless thread.stop? I would suggest implementing a stop method on a sleeping thread that is basically a noop. Secondly, I have noticed that the strip/lstrip/rstrip methods of String do not take a string with the possible characters to remove. Possibly this could be changed, and then have as default value " ". What I mean is: "aaabbbccc".ls...

Any suggestions?
Hi, Okay, I was wondering if anybody has any better ideas on how to implement this.... This is for updating a progress bar. (As far as I've tried this is working) I'm taking the output from: " ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding. input: 13 - Mrs. Robinson.mp3 (44.1 kHz, 2 channels, MPEG-1 Layer III) output: 13 - Mrs. Robinson.mp3.wav (16 bit, Microsoft WAVE) skipping initial 1105 samples (encoder+decoder delay) Frame# 8575/8575 192 kbps L R " The only line I really care about is the last line with Frame#. By the way, this is...

Suggestion...
Can you suggest a good c# book? ============================================================ http://www.photohide.com Hide your face on your personal photos for free! ============================================================ On Wed, 24 Mar 2010 22:18:01 +0100, "Massimo Antonini" <m.antonini78@gmail.com> wrote: >Can you suggest a good c# book? Are you a beginner or an expert? Are you learning C# as your first programming language or are you adding C# to your existing portfolio of languages? rossum The second one you said.... ============================...

Any suggestions...
Decided to install SUSE 9.1 Personal on my free 40GB partition tonight... I really wish I had just stuck out for Gentoo at this point. Seriously, Gentoo and Red Hat are the only two distro's I've installed on this box that didn't end up f*ing up my windows installation... Really, is it two much to ask to install it as dual boot and still be able to boot into XP? So, here's the situation - install SUSE 9.1 on my free 40GB partition. I even let it install Grub to the MBR (though, I usually don't). Reboot, finish the config. Try to boot into Windows - blammo, just a bl...

Suggestion
Given Apple's latest financials, change the name of the group to: mp3.apple.ipod.advocacy In article <gv5f42drco3phqsbnkcv7cqb4v2d51nb5g@4ax.com>, tom_elam@earthlink.net wrote: > Given Apple's latest financials, change the name of the group to: > > mp3.apple.ipod.advocacy Here's a suggestion. Get a fucking life you dumb-fuck wintroll. tom_elam@earthlink.net wrote: > Given Apple's latest financials, change the name of the group to: > > mp3.apple.ipod.advocacy yawn. hint: your ignorance is showing again. "Mojo" <windoze_sucks@mic...

Any suggestions?
fortran command for c command strcopy(infile, argv[1]) Here's some stuff that works with gfortran... don't know how standard it is. character(32):: s integer:: nRows, nCols ... if (command_argument_count() .ne. 4) then ... call getarg(1, s) open(unit = 10, file = s) call getarg(2, s) read (s, *)nCols call getarg(3, s) read (s, *)nRows sara_patty wrote: > fortran command for c command strcopy(infile, argv[1]) "sara_patty" <k_partha@yahoo.com> wrote in message news:a1177166-50e6-4202-8c6f-f7dd59e39537@41g200...

your suggestions
Dear all, I am wondering whether you may offer me some suggestions on modelling the distribution of some variables. I have three expenditure variables: health expenditure (>=0), food expenditure (>0, can't be zero) and other expenditure (>=0). My questions are (1) what will be appropriate distributions for these three variables? I am thinking about gamma distribution, but food expenditure cann't be zero, so the gamma might not fit. (2) what will be appropriate distributions of measurement errors of these three variables? normal distribution? Any comments are highly ap...

suggestions on how to do this
The problem I have is as follows: I have a recursive function b(k) b(k) = -(A/k**2)*(b(k-2) - b(k-5)) k<0, b(k)=0 k=0, b(k)=1 k=1, b(k)=0 eg. b(2) = -A/4 b(3) = 0 b(4) = A**2/64 note that as k increases b(k) can itself be a sum of terms in powers of A rather than a single power of A in the examples above. Summing all terms and equating to zero gives: F= sum b(k) = 0 for all k = 0, infinity When this is expanded I get a polynomial F(A). I want to determine the coefficients of the polynomial so that I can find the roots of the function F up to a specified order of A. I ha...

suggest me
I need to buy a new computer,should I buy a laptop or desktop computer? And what kind of brand is the better choice? ...

Suggestions
Hi, The following SELECT statement works fine and returns what I need as one of the columns in my query. I have to create more than 10 of the selection statements like this and then UNION them into a final query. What I want to do is to have an example to show me how create a function to pass the column name and the table name to create the query. SELECT LN_NR, ROUND(CAST(amountTotal AS DECIMAL(7, 2)) / positionTotal, 0) AS AverageYearsinPresentPosition FROM (SELECT SURV_YY_DT, LN_NR, SUM(TOT_PSTN_OFFCR_NR) AS positionTotal, SUM(TOT_YY_PSTN_NR) AS amountTotal ...

Suggestions
Hi all, Im a fresh graduate from wright state university, OHIO, USA. My master's degree concentrated towards VLSI designing(3.9 GPA). I really want to build my career on FPGA Design, Testing and Fault tolerance. My course structure concentrated on all VLSI/digital design aspects and VHDL, Verilog programming languages, B square logic which compliments FPGA designing. One of my courses directly dealt working with Xilinx based XC2V100 FPGA chip and implementing two real time projects(GPP-general purpose processor and change making machine). I was involved in an individual project where I h...

suggestion
Would it be a good idea if [string is double -strict] returned 0 for an argument of Inf, rather than 1, which is now the case? -- *********** To reply by e-mail, make w single in address ************** At Fri, 04 May 2012 12:51:28 -0700 Ian Gay <gay@sfuu.ca> wrote: > > Would it be a good idea if [string is double -strict] returned > 0 for an argument of Inf, rather than 1, which is now the case? Why should it do that? Inf is a 'valid' double (as is Nan), in a sense. All strict implies is that the string has a non-zero length, since an empty string matches all types...

Suggestions
This was posted in 2003: "Selwyn Hollis" <selwynh@earthlink.net> wrote in message news:bgcupq$9qi$1@smc.vnet.net... > > Print preview should certainly be near the top of any wish list. (But > > if you're fortunate enough to have a Mac w/OS X, printing to PDF is > > almost as good.) > > > > To any such wish list I'd also add, in no particular order: > > > > * antialiasing of graphics!! > > * flexible top/bottom cell margins > > * serious undo functionality > > * real unicode support (on t...