Re: Mandatory locking?

1999-08-22 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Greg Lehey writes: Why should it be made unavailable ? >>> >>> So that certain multiple accesses can be done atomically. >> >> You don't need that. You initialize a index to 0, and whenever the >> sector with that index is written, you increment it. >> >> At

Re: Mandatory locking?

1999-08-22 Thread Poul-Henning Kamp
In message <19990823152849.h83...@freebie.lemis.com>, Greg Lehey writes: >> Why should it be made unavailable ? > >So that certain multiple accesses can be done atomically. You don't need that. You initialize a index to 0, and whenever the sector with that index is written, you increment it. At

Re: anybody love qsort.c?

1999-08-22 Thread Christopher Seiwald
Archie's mod to qsort: | >- if (swap_cnt == 0) { /* Switch to insertion sort */ | >+ if (n <= 32 && swap_cnt == 0) { /* Switch to insertion sort */ As Akira Wada points out, this eliminates the benefit of the optimization in the first place, which is to let isort take over if the data is

ls(1) options affecting -l long format

1999-08-22 Thread Sheldon Hearn
Hi folks, Chris Costello recently committed (and then backed out at my request) a change to ls(1) that made -n (numeric ID's instead of names) imply -l (long format). The OpenGroup Single UNIX Specification is quite clear on the following issue: -g, -n and -o all imply -l. Of course, the OpenGr

Re: Mandatory locking?

1999-08-22 Thread Daniel O'Connor
On 23-Aug-99 Greg Lehey wrote: > I'm a little surprised that there's any objection to the concept of > mandatory locking. In transaction processing, locking is not > optional, and if any process at all can access a file or set of files > without locking, you can't guarantee the database integ

Re: from number to power of two

1999-08-22 Thread Ollivier Robert
According to Brian F. Feldman: > -O lets you do explicit inlining, and -O2 enables -finline-functions. You meant -O3 of course. -O3Optimize yet more. This turns on everything -O2 does, along with also turning on -finline-func- tions. -- Ollivier ROB

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Monday, 23 August 1999 at 8:47:34 +0200, Poul-Henning Kamp wrote: > In message <[EMAIL PROTECTED]>, Greg Lehey writes: > >>> Why should it be made unavailable ? >> >> So that certain multiple accesses can be done atomically. > > You don't need that. You initialize a index to 0, and whenever t

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 22:04:38 -0700, Matthew Dillon wrote: > >> Somehow you need to get a lock. >> >>> You mean have one program make a fcntl call that causes other >>> programs to return an error or block if they try to open that >>> file while the first program holds an open d

Re: Mandatory locking?

1999-08-22 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Greg Lehey writes: >> Why should it be made unavailable ? > >So that certain multiple accesses can be done atomically. You don't need that. You initialize a index to 0, and whenever the sector with that index is written, you increment it. At any one time you kno

Interesting ssh + X + tcp_wrappers problem

1999-08-22 Thread Doug
I've been doing some housecleaning lately and I finally decided to set up a one-way ssh authentication from my workstation to my gateway machine. I set up the ssh keys and that was all good. Then I went to start an X app on the gateway expecting it to just pop up on the workstation's X dis

Re: Mandatory locking?

1999-08-22 Thread Daniel O'Connor
On 23-Aug-99 Greg Lehey wrote: > I'm a little surprised that there's any objection to the concept of > mandatory locking. In transaction processing, locking is not > optional, and if any process at all can access a file or set of files > without locking, you can't guarantee the database inte

Re: from number to power of two

1999-08-22 Thread Ollivier Robert
According to Brian F. Feldman: > -O lets you do explicit inlining, and -O2 enables -finline-functions. You meant -O3 of course. -O3Optimize yet more. This turns on everything -O2 does, along with also turning on -finline-func- tions. -- Ollivier RO

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 22:04:38 -0700, Matthew Dillon wrote: > >> Somehow you need to get a lock. >> >>> You mean have one program make a fcntl call that causes other >>> programs to return an error or block if they try to open that >>> file while the first program holds an open

Re: Mandatory locking?

1999-08-22 Thread Matthew Dillon
:Somehow you need to get a lock. : :> You mean have one program make a fcntl call that causes other :> programs to return an error or block if they try to open that :> file while the first program holds an open descriptor? : :Correct. I suppose it's worth discussing what the default s

Interesting ssh + X + tcp_wrappers problem

1999-08-22 Thread Doug
I've been doing some housecleaning lately and I finally decided to set up a one-way ssh authentication from my workstation to my gateway machine. I set up the ssh keys and that was all good. Then I went to start an X app on the gateway expecting it to just pop up on the workstation's X dis

Re: Mandatory locking?

1999-08-22 Thread Matthew Dillon
:Somehow you need to get a lock. : :> You mean have one program make a fcntl call that causes other :> programs to return an error or block if they try to open that :> file while the first program holds an open descriptor? : :Correct. I suppose it's worth discussing what the default

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 22:07:04 -0400, Garrett Wollman wrote: > < said: > >> Correct. I suppose it's worth discussing what the default should be. >> Should they get EAGAIN or block? Obviously you'd want a way of >> specifying which, but there would have to be a default for >> non-lock-aware

Re: Mandatory locking?

1999-08-22 Thread Garrett Wollman
< said: > Correct. I suppose it's worth discussing what the default should be. > Should they get EAGAIN or block? Obviously you'd want a way of > specifying which, but there would have to be a default for > non-lock-aware programs. I think I'd go for blocking; it's less error > prone. I'd be s

Re: from number to power of two

1999-08-22 Thread Bakul Shah
The best I can come up with is this: /* kk+1 k * given n, return 2 such that 2> n >= 2 */ inline unsigned long n2power2(unsigned long n) { /* `smear' the highest set bit to the right */ n |= n>>1; n |= n>>2; n |= n>>4; n |= n>>8; n |= n>>

Re: What does unp stand for?

1999-08-22 Thread Brian F. Feldman
On Sun, 22 Aug 1999, Bill Fumerola wrote: > On Sun, 22 Aug 1999, Zhihui Zhang wrote: > > > In file uipc_usrreq.c, there are many routines beginning with unp_. For > > example, unp_connect(), unp_bind(), etc. What does unp stand for? > > > W. Richard Stevens wrote a book Unix Network Programmi

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 22:07:04 -0400, Garrett Wollman wrote: > < said: > >> Correct. I suppose it's worth discussing what the default should be. >> Should they get EAGAIN or block? Obviously you'd want a way of >> specifying which, but there would have to be a default for >> non-lock-awar

Re: mmap mapped segment length

1999-08-22 Thread Wes Peters
Matthew Dillon wrote: > > :Now I've got to go figure out what *I've* screwed up. I fstat the file > before > :mapping it and pass S.st_size as the map length. Is there any reason why > :mmap would return non-NULL but map less than the requested size? > : > :Scratching my head, > > Note tha

Re: Mandatory locking?

1999-08-22 Thread Garrett Wollman
< said: > Correct. I suppose it's worth discussing what the default should be. > Should they get EAGAIN or block? Obviously you'd want a way of > specifying which, but there would have to be a default for > non-lock-aware programs. I think I'd go for blocking; it's less error > prone. I'd be

Re: What does unp stand for?

1999-08-22 Thread Bill Fumerola
On Sun, 22 Aug 1999, Zhihui Zhang wrote: > In file uipc_usrreq.c, there are many routines beginning with unp_. For > example, unp_connect(), unp_bind(), etc. What does unp stand for? W. Richard Stevens wrote a book Unix Network Programming often refered to by UNP, which includes his improved v

Re: from number to power of two

1999-08-22 Thread Bakul Shah
The best I can come up with is this: /* kk+1 k * given n, return 2 such that 2> n >= 2 */ inline unsigned long n2power2(unsigned long n) { /* `smear' the highest set bit to the right */ n |= n>>1; n |= n>>2; n |= n>>4; n |= n>>8; n |= n>

What does unp stand for?

1999-08-22 Thread Zhihui Zhang
In file uipc_usrreq.c, there are many routines beginning with unp_. For example, unp_connect(), unp_bind(), etc. What does unp stand for? Thanks. -- Zhihui Zhang. Please visit http://www.freebsd.org -

Re: What does unp stand for?

1999-08-22 Thread Brian F. Feldman
On Sun, 22 Aug 1999, Bill Fumerola wrote: > On Sun, 22 Aug 1999, Zhihui Zhang wrote: > > > In file uipc_usrreq.c, there are many routines beginning with unp_. For > > example, unp_connect(), unp_bind(), etc. What does unp stand for? > > > W. Richard Stevens wrote a book Unix Network Programm

Re: mmap mapped segment length

1999-08-22 Thread Wes Peters
Matthew Dillon wrote: > > :Now I've got to go figure out what *I've* screwed up. I fstat the file before > :mapping it and pass S.st_size as the map length. Is there any reason why > :mmap would return non-NULL but map less than the requested size? > : > :Scratching my head, > > Note that

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 17:31:44 -0700, Matthew Dillon wrote: > >> Questions: >> >> 1. Do we have some form of mandatory locking? If so, what is it? > > No we don't, unless you count the ad-hoc lockout in the master/slave pty > interface :-). > >> 2. Would it make sense to implemen

Re: Mandatory locking?

1999-08-22 Thread Matthew Dillon
:Questions: : :1. Do we have some form of mandatory locking? If so, what is it? No we don't, unless you count the ad-hoc lockout in the master/slave pty interface :-). :2. Would it make sense to implement System V's fcntl semantics? :They're rather tacky: you set the setgid bit a

Re: from number to power of two

1999-08-22 Thread Brian F. Feldman
On Sun, 22 Aug 1999, Nick Hibma wrote: > > Unfortunately the kernel is compiled with -O which does not include > inlining (dunno about explicit inlining, but don't think so). > > Nick -O lets you do explicit inlining, and -O2 enables -finline-functions. Anyway, I think the simple solution to th

Mandatory locking?

1999-08-22 Thread Greg Lehey
I've just found a need for mandatory locking in Vinum, and I'm wondering how to implement it. If I understand things correctly, our fcntl locking doesn't perform mandatory locking, though System V does if you set the file permissions appropriately. Questions: 1. Do we have some form of mandator

Re: What does unp stand for?

1999-08-22 Thread Bill Fumerola
On Sun, 22 Aug 1999, Zhihui Zhang wrote: > In file uipc_usrreq.c, there are many routines beginning with unp_. For > example, unp_connect(), unp_bind(), etc. What does unp stand for? W. Richard Stevens wrote a book Unix Network Programming often refered to by UNP, which includes his improved

What does unp stand for?

1999-08-22 Thread Zhihui Zhang
In file uipc_usrreq.c, there are many routines beginning with unp_. For example, unp_connect(), unp_bind(), etc. What does unp stand for? Thanks. -- Zhihui Zhang. Please visit http://www.freebsd.org

Re: Mandatory locking?

1999-08-22 Thread Greg Lehey
On Sunday, 22 August 1999 at 17:31:44 -0700, Matthew Dillon wrote: > >> Questions: >> >> 1. Do we have some form of mandatory locking? If so, what is it? > > No we don't, unless you count the ad-hoc lockout in the master/slave pty > interface :-). > >> 2. Would it make sense to impleme

Re: Mandatory locking?

1999-08-22 Thread Matthew Dillon
:Questions: : :1. Do we have some form of mandatory locking? If so, what is it? No we don't, unless you count the ad-hoc lockout in the master/slave pty interface :-). :2. Would it make sense to implement System V's fcntl semantics? :They're rather tacky: you set the setgid bit

Re: from number to power of two

1999-08-22 Thread Brian F. Feldman
On Sun, 22 Aug 1999, Nick Hibma wrote: > > Unfortunately the kernel is compiled with -O which does not include > inlining (dunno about explicit inlining, but don't think so). > > Nick -O lets you do explicit inlining, and -O2 enables -finline-functions. Anyway, I think the simple solution to t

Mandatory locking?

1999-08-22 Thread Greg Lehey
I've just found a need for mandatory locking in Vinum, and I'm wondering how to implement it. If I understand things correctly, our fcntl locking doesn't perform mandatory locking, though System V does if you set the file permissions appropriately. Questions: 1. Do we have some form of mandato

Re: select/poll implementation

1999-08-22 Thread Nate Williams
> I had always wondered how select/poll worked (actually see the end of the > mail to see the broader question), so I pulled up select() and family > and started reading and chasing stuff around. I think that I fully > understand (much praise to whoever wrote most of that, it was incredibly > easy

Re: select/poll implementation

1999-08-22 Thread Nate Williams
> I had always wondered how select/poll worked (actually see the end of the > mail to see the broader question), so I pulled up select() and family > and started reading and chasing stuff around. I think that I fully > understand (much praise to whoever wrote most of that, it was incredibly > eas

Re: font edit tools

1999-08-22 Thread Dan Nelson
In the last episode (Aug 22), Sergey Babkin said: > Alexey M. Zelkin wrote: > > > > hi, > > > > Which tools can be used to edit syscons fonts ? > > Any of the tools you use to edit the DOS fonts. > My favorite one it Evafont by Pete Kvitek. But > there were a lot of tools floating around. I lik

Re: from number to power of two

1999-08-22 Thread Peter Wemm
Peter Dufault wrote: > > It seems that all the solutions are too generic and slow. As I only have > > to check the numbers 0-32 (actually 1-32), a block of if statements is > > almost as fast as a table look up in 33 elements. > > I doubt it - use the table for a small fixed size set then > use Wa

Re: font edit tools

1999-08-22 Thread Ollivier Robert
According to Sergey Babkin: > Any of the tools you use to edit the DOS fonts. > My favorite one it Evafont by Pete Kvitek. But > there were a lot of tools floating around. I know do the opposite. I modify the font with XmBDFED in BDF format then generate the syscons font with a small Perl script.

Re: I2C/SMBus/LPBB

1999-08-22 Thread Nicolas Souchu
On Sat, Aug 21, 1999 at 02:46:51AM -0400, Mike Nowlin wrote: > > >I had sent this message to -stable about a month ago, never heard anything >-- so am trying it here. Hmm lpbb seem to fail completly then... I have to give it a try. Ask me again if I fail to remember. I'm a bit busy. Thanks for

Re: font edit tools

1999-08-22 Thread Dan Nelson
In the last episode (Aug 22), Sergey Babkin said: > Alexey M. Zelkin wrote: > > > > hi, > > > > Which tools can be used to edit syscons fonts ? > > Any of the tools you use to edit the DOS fonts. > My favorite one it Evafont by Pete Kvitek. But > there were a lot of tools floating around. I li

Re: from number to power of two

1999-08-22 Thread Peter Wemm
Peter Dufault wrote: > > It seems that all the solutions are too generic and slow. As I only have > > to check the numbers 0-32 (actually 1-32), a block of if statements is > > almost as fast as a table look up in 33 elements. > > I doubt it - use the table for a small fixed size set then > use W

Re: font edit tools

1999-08-22 Thread Ollivier Robert
According to Sergey Babkin: > Any of the tools you use to edit the DOS fonts. > My favorite one it Evafont by Pete Kvitek. But > there were a lot of tools floating around. I know do the opposite. I modify the font with XmBDFED in BDF format then generate the syscons font with a small Perl script.

Parallel Video Interfaces

1999-08-22 Thread The Evil Anti-Rick
Is anyone doing any work to support parallel video interfaces like the Snappy or Gotcha cards? I have Snappy card, and I would like to put it to use as part of an internal video security system. --R. Pelletier, Sys Admin, House Galiagante To Unsubscribe: send mail to majord...@freebsd.org with "

Re: I2C/SMBus/LPBB

1999-08-22 Thread Nicolas Souchu
On Sat, Aug 21, 1999 at 02:46:51AM -0400, Mike Nowlin wrote: > > >I had sent this message to -stable about a month ago, never heard anything >-- so am trying it here. Hmm lpbb seem to fail completly then... I have to give it a try. Ask me again if I fail to remember. I'm a bit busy. Thanks for

Parallel Video Interfaces

1999-08-22 Thread The Evil Anti-Rick
Is anyone doing any work to support parallel video interfaces like the Snappy or Gotcha cards? I have Snappy card, and I would like to put it to use as part of an internal video security system. --R. Pelletier, Sys Admin, House Galiagante To Unsubscribe: send mail to [EMAIL PROTECTED] with "uns

Re: Async NFS exports?

1999-08-22 Thread Matthew Dillon
:> buffer cache is able to keep abrest of the write-rate. :> :> Hmm, interesting. I see another optimization I can do to fix the :> buffer cache saturation case in CURRENT on the client. The COMMIT rpc's :> aren't being issued async. : :You need to track the return value of the c

Re: Async NFS exports?

1999-08-22 Thread Doug Rabson
On Fri, 20 Aug 1999, Matthew Dillon wrote: > :> Just to be clear... I am wondering if mounting (on the NFS _server_) a > :> partition (that is exportable) as async will have any performance > :> benefits to the NFS clients? > : > :As a first guess, probably not unless you have a large number of a

Re: Async NFS exports?

1999-08-22 Thread Matthew Dillon
:> buffer cache is able to keep abrest of the write-rate. :> :> Hmm, interesting. I see another optimization I can do to fix the :> buffer cache saturation case in CURRENT on the client. The COMMIT rpc's :> aren't being issued async. : :You need to track the return value of the

Re: Async NFS exports?

1999-08-22 Thread Doug Rabson
On Fri, 20 Aug 1999, Matthew Dillon wrote: > :> Just to be clear... I am wondering if mounting (on the NFS _server_) a > :> partition (that is exportable) as async will have any performance > :> benefits to the NFS clients? > : > :As a first guess, probably not unless you have a large number of

Re: font edit tools

1999-08-22 Thread Sergey Babkin
Alexey M. Zelkin wrote: > > hi, > > Which tools can be used to edit syscons fonts ? Any of the tools you use to edit the DOS fonts. My favorite one it Evafont by Pete Kvitek. But there were a lot of tools floating around. -SB To Unsubscribe: send mail to majord...@freebsd.org with "unsubscrib

font edit tools

1999-08-22 Thread Alexey M. Zelkin
hi, Which tools can be used to edit syscons fonts ? Any references are welcome! -- Sincerely Yours, | phan...@crimea.edu (primary) Alexey Zelkin | phan...@scorpion.crimea.ua (home) | ICQ: #6196584, FIDO: 2:460/12.26 To Unsubscribe: send mail to majord...@freebs

Re: font edit tools

1999-08-22 Thread Sergey Babkin
Alexey M. Zelkin wrote: > > hi, > > Which tools can be used to edit syscons fonts ? Any of the tools you use to edit the DOS fonts. My favorite one it Evafont by Pete Kvitek. But there were a lot of tools floating around. -SB To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe f

Re: from number to power of two

1999-08-22 Thread Tommy Hallgren
--- Kazufumi-MIT-Mitani skrev: > "Daniel C. Sobral" wrote > > > That technique is O(ln(n)), where n is the number in question. > > > > Frankly, for numbers up to 32, a table will wield the best results, > > and might actually be smaller than some of the suggestions given so > > far. > > Count

Re: from number to power of two

1999-08-22 Thread Nick Hibma
Unfortunately the kernel is compiled with -O which does not include inlining (dunno about explicit inlining, but don't think so). Nick On Sun, 22 Aug 1999, Peter Dufault wrote: > > It seems that all the solutions are too generic and slow. As I only have > > to check the numbers 0-32 (actually 1

font edit tools

1999-08-22 Thread Alexey M. Zelkin
hi, Which tools can be used to edit syscons fonts ? Any references are welcome! -- Sincerely Yours, | [EMAIL PROTECTED] (primary) Alexey Zelkin | [EMAIL PROTECTED] (home) | ICQ: #6196584, FIDO: 2:460/12.26 To Unsubscribe: send mail to [EMAIL PROTECTED] with "u

Re: from number to power of two

1999-08-22 Thread Kazufumi-MIT-Mitani
"Daniel C. Sobral" wrote > That technique is O(ln(n)), where n is the number in question. > > Frankly, for numbers up to 32, a table will wield the best results, > and might actually be smaller than some of the suggestions given so > far. Counting n as bit, it is O(n) :p Unrolling the loop,

Re: from number to power of two

1999-08-22 Thread Peter Dufault
> It seems that all the solutions are too generic and slow. As I only have > to check the numbers 0-32 (actually 1-32), a block of if statements is > almost as fast as a table look up in 33 elements. I doubt it - use the table for a small fixed size set then use Warner's "(n) ? (1 << (ffs(n) - 1))

Re: from number to power of two

1999-08-22 Thread Tommy Hallgren
--- Kazufumi-MIT-Mitani <[EMAIL PROTECTED]> skrev: > "Daniel C. Sobral" <[EMAIL PROTECTED]> wrote > > > That technique is O(ln(n)), where n is the number in question. > > > > Frankly, for numbers up to 32, a table will wield the best results, > > and might actually be smaller than some of the s

Re: from number to power of two

1999-08-22 Thread Nick Hibma
Unfortunately the kernel is compiled with -O which does not include inlining (dunno about explicit inlining, but don't think so). Nick On Sun, 22 Aug 1999, Peter Dufault wrote: > > It seems that all the solutions are too generic and slow. As I only have > > to check the numbers 0-32 (actually

Re: from number to power of two

1999-08-22 Thread Kazufumi-MIT-Mitani
"Daniel C. Sobral" <[EMAIL PROTECTED]> wrote > That technique is O(ln(n)), where n is the number in question. > > Frankly, for numbers up to 32, a table will wield the best results, > and might actually be smaller than some of the suggestions given so > far. Counting n as bit, it is O(n) :p U

Re: from number to power of two

1999-08-22 Thread Peter Dufault
> It seems that all the solutions are too generic and slow. As I only have > to check the numbers 0-32 (actually 1-32), a block of if statements is > almost as fast as a table look up in 33 elements. I doubt it - use the table for a small fixed size set then use Warner's "(n) ? (1 << (ffs(n) - 1)

Re: IDE quirk in 3.2-STABLE kernel ?

1999-08-22 Thread Daniel C. Sobral
Chris wrote: > > I am glad to hear from Soren that this 'misconfiguration' will be > supported in 4.0 > As always when a misconfiguration (read 'not to spec') is used enough > then it quickly becomes somewhat of a de facto standard. Old message, but still in need for reply. Yeah, like isa shared

Re: from number to power of two

1999-08-22 Thread Daniel C. Sobral
John-Mark Gurney wrote: > > > Shift a bit until it becomes greater than (or less than) the number > > in question. > > ummm, didn't you read his post?? he wanted a O(1) routine, NOT a O(n) > routine... That technique is O(ln(n)), where n is the number in question. Frankly, for numbers up to 32,

Re: IDE quirk in 3.2-STABLE kernel ?

1999-08-22 Thread Daniel C. Sobral
Chris wrote: > > I am glad to hear from Soren that this 'misconfiguration' will be > supported in 4.0 > As always when a misconfiguration (read 'not to spec') is used enough > then it quickly becomes somewhat of a de facto standard. Old message, but still in need for reply. Yeah, like isa share

Re: from number to power of two

1999-08-22 Thread Daniel C. Sobral
John-Mark Gurney wrote: > > > Shift a bit until it becomes greater than (or less than) the number > > in question. > > ummm, didn't you read his post?? he wanted a O(1) routine, NOT a O(n) > routine... That technique is O(ln(n)), where n is the number in question. Frankly, for numbers up to 32

select/poll implementation

1999-08-22 Thread Jay Nordwick
I had always wondered how select/poll worked (actually see the end of the mail to see the broader question), so I pulled up select() and family and started reading and chasing stuff around. I think that I fully understand (much praise to whoever wrote most of that, it was incredibly easy to read)

select/poll implementation

1999-08-22 Thread Jay Nordwick
I had always wondered how select/poll worked (actually see the end of the mail to see the broader question), so I pulled up select() and family and started reading and chasing stuff around. I think that I fully understand (much praise to whoever wrote most of that, it was incredibly easy to read)

Re: from number to power of two

1999-08-22 Thread Nick Hibma
It seems that all the solutions are too generic and slow. As I only have to check the numbers 0-32 (actually 1-32), a block of if statements is almost as fast as a table look up in 33 elements. Cheers, Nick On Sun, 22 Aug 1999, Mark Murray wrote: > > Does anyone know an inexpensive algorithm

watching defects on scsi disks...

1999-08-22 Thread John-Mark Gurney
I was wondering if someone would like to clean up a bit of shell scripting I wrote to attach a report of the defect list to the daily output... it works great so far and thought I might as well share this w/ the rest of people... once it gets cleaned up, I have no problems w/ committing it to the

Re: from number to power of two

1999-08-22 Thread John-Mark Gurney
Mark Murray scribbled this message on Aug 22: > > Does anyone know an inexpensive algorithm (O(1)) to go from an number to > > the next (lower or higher) power of two. > > > > 1 -> 1 > > 2,3 -> 2 > > 4,5,6,7 -> 4 > > 8,9,10,11,12,13,14,15

Re: from number to power of two

1999-08-22 Thread Mark Murray
> Does anyone know an inexpensive algorithm (O(1)) to go from an number to > the next (lower or higher) power of two. > > 1 -> 1 > 2,3 -> 2 > 4,5,6,7 -> 4 > 8,9,10,11,12,13,14,15 -> 8 > etc. > > So %1101 should become either %1 or %1

Re: from number to power of two

1999-08-22 Thread Nick Hibma
It seems that all the solutions are too generic and slow. As I only have to check the numbers 0-32 (actually 1-32), a block of if statements is almost as fast as a table look up in 33 elements. Cheers, Nick On Sun, 22 Aug 1999, Mark Murray wrote: > > Does anyone know an inexpensive algorithm

watching defects on scsi disks...

1999-08-22 Thread John-Mark Gurney
I was wondering if someone would like to clean up a bit of shell scripting I wrote to attach a report of the defect list to the daily output... it works great so far and thought I might as well share this w/ the rest of people... once it gets cleaned up, I have no problems w/ committing it to the

Re: from number to power of two

1999-08-22 Thread John-Mark Gurney
Mark Murray scribbled this message on Aug 22: > > Does anyone know an inexpensive algorithm (O(1)) to go from an number to > > the next (lower or higher) power of two. > > > > 1 -> 1 > > 2,3 -> 2 > > 4,5,6,7 -> 4 > > 8,9,10,11,12,13,14,15