> >If you can get to old CACMs see `Minimal Perfect Hash Functions Made Simple'
> >by Richard J. Cichelli, Comm. of ACM, Jan 1980. AFAIK gperf uses some
> >variation of that algorithm and may have some details. A minimal perfect hash
> >function is only worth it (IMHO) when the set of input keys
This caught my eye:
> Besides, there is no such thing as a
> perfect hash ... at least not one that has a small enough index range
> to be useful in a table lookup.
If you can get to old CACMs see `Minimal Perfect Hash Functions Made Simple'
by Richard J.
Marc sent me this:
> > > > pushl %ebp
> > > > movl %esp,%ebp
> > > > subl $8,%esp
> > > >
> > > This might not be of interest to the rest of the mailing list
> > > but what is the purpose of the subl instruction used before
> > > calling functions? Is that where the return
> > #include
> >
> > int foo() {
> > open("file", O_RDONLY);
> > return 0;
> > }
> > int main() {
> > int x;
> > x = foo();
> > return 0;
> > }
> >
> > results in:
> >
> > foo:
> > pushl %ebp
> > movl %esp,%ebp
> > subl $8,%esp
> > addl $-8,%esp
> >
> why not just bind to the port and then spawn off some processes (like 20
> in his case) to do the accept(), once the accept() returns successfully just
> take care of the request, close the connection and then goes back
> to accept(). Simple, easy, and even scales pretty well. Since
> it's fr
> What's the best approach for a simple web-server(never more the 10 clients)
> ? Is it using pthread and a thread per connection . Or to make a
> non-blocking single thread server. Can people show me some simple examples
> of the 2 techniques ?
>
> And what's the pro's and con's for the 2 method
Allow me add something to what the FAQ-Xt says.
I find it more convenient to immediately call a non-static
function as shown below (using a slightly modified example
from the FAQ).
class Icon {
public:
Icon(Widget*);
private:
static void static_callback(Icon*)
A couple of useful packages can make this much quicker.
mkid from ports/devel/id-utils builds a database of symbols
given a source tree. Then you can use gid to grep for a
symbol, lid to get a list of files that havea symbol etc.
mkid knows about c, c++ and may be some other languages.
If you w
> date: 1999/06/19 19:49:32; author: green; state: Exp; lines: +25 -21
> Miscellaneous dd(1) changes: mainly fixing variable types (size_t,
> ssize_t, off_t, int, u_int64_t, etc.). dd(1) should now work properly
> with REALLY big amounts of data.
>
> Should be a -stable candidate by now (3 mont
> date: 1999/06/19 19:49:32; author: green; state: Exp; lines: +25 -21
> Miscellaneous dd(1) changes: mainly fixing variable types (size_t,
> ssize_t, off_t, int, u_int64_t, etc.). dd(1) should now work properly
> with REALLY big amounts of data.
>
> Should be a -stable candidate by now (3 mon
PR bin/6509 (submitted in May 1998) already has a patch to
fix this but it was rejected because off_t was assumed by the
bug fixer/submitter to be a quat (int64_t). I can't even get
an IDE disk below 2G byte easily! And we are still years
away from zettabyte disks. So I don't see the point of
b
PR bin/6509 (submitted in May 1998) already has a patch to
fix this but it was rejected because off_t was assumed by the
bug fixer/submitter to be a quat (int64_t). I can't even get
an IDE disk below 2G byte easily! And we are still years
away from zettabyte disks. So I don't see the point of
bl
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>>
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>
Any use of str{,n}cat makes me gag. In the past I have used
a composable function that may be of interest. Composable in
the sense that the result can be immediately used as an arg
to another call and it doesn't have the O(N^2) behavior of
strcat. Such a function can be totally safe. Something
Any use of str{,n}cat makes me gag. In the past I have used
a composable function that may be of interest. Composable in
the sense that the result can be immediately used as an arg
to another call and it doesn't have the O(N^2) behavior of
strcat. Such a function can be totally safe. Something
101 - 116 of 116 matches
Mail list logo