- use a matrix is faster than use a linked list?
For what?
For insertion and deletion no - linked list is faster. For sequential
access they are the same speed (forgetting look-ahead caching). For
random access matrix is faster.
___
On Fri, Apr 23, 2010 at 06:18:46PM +0300, Eitan Adler wrote:
- use a matrix is faster than use a linked list?
For what?
For insertion and deletion no - linked list is faster. For sequential
access they are the same speed (forgetting look-ahead caching). For
random access matrix is faster.
On Friday 23 April 2010 17:40:12 Joerg Sonnenberger wrote:
On Fri, Apr 23, 2010 at 06:18:46PM +0300, Eitan Adler wrote:
- use a matrix is faster than use a linked list?
For what?
For insertion and deletion no - linked list is faster. For sequential
access they are the same speed
hello all
i want to know your oppinions about this:
- use a matrix is faster than use a linked list?
example:
char *szColumnName[10];
unsigned short iColumnAge[10];
struct _llList {
struct _llList *prev, *next;
char szName[64];
unsigned short iAge;
};
2010/4/9 Leinier Cruz Salfran salfrancl.lis...@gmail.com
- use a matrix is faster than use a linked list?
example:
char *szColumnName[10];
unsigned short iColumnAge[10];
struct _llList {
struct _llList *prev, *next;
char szName[64];
unsigned short iAge;
};
Leinier ,
This
On Fri, Apr 9, 2010 at 10:52 AM, Alexander Churanov
alexanderchura...@gmail.com wrote:
2010/4/9 Leinier Cruz Salfran salfrancl.lis...@gmail.com
- use a matrix is faster than use a linked list?
example:
char *szColumnName[10];
unsigned short iColumnAge[10];
struct _llList {
struct
On Fri, 9 Apr 2010, Leinier Cruz Salfran wrote:
hello all
i want to know your oppinions about this:
- use a matrix is faster than use a linked list?
yes.
example:
char *szColumnName[10];
unsigned short iColumnAge[10];
struct _llList {
struct _llList *prev, *next;
char szName[64];
thx for all the great help guys.
cheers,
alex
Carlos A. M. dos Santos schrieb am 2009-07-02:
2009/7/2 Dag-Erling Smørgrav d...@des.no:
Alexander Best alexbes...@math.uni-muenster.de writes:
for (i=0; i sizeof(hdr-nintendo_logo); i++)
fprintf(stderr, %x, hdr-nintendo_logo[i]);
On Tue, 30 Jun 2009 20:21:03 +0200 (CEST), Alexander Best
alexbes...@math.uni-muenster.de wrote:
thanks. now the output gets redirected using . i'm quite new to programming
under unix. sorry for the inconvenience.
so i guess there is no really easy way to output an inhomogeneous struct to
On Wed, 01 Jul 2009 00:06:05 +0200 (CEST), Alexander Best
alexbes...@math.uni-muenster.de wrote:
thanks for all the help. i decided to take the pill and coded all the
fprintfs by hand. here's the result. usually i'd stick to a higher
level languag, but i need C's inline assembly support:
2009/7/4 Giorgos Keramidas keram...@ceid.upatras.gr:
[snip]
s/0x%/%#.2hh/g
--
Igor
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to
Alexander Best alexbes...@math.uni-muenster.de writes:
for (i=0; i sizeof(hdr-nintendo_logo); i++)
fprintf(stderr, %x, hdr-nintendo_logo[i]);
What will this print if nintendo_logo is { 0x01, 0x02, 0x03, 0x04 }?
DES
--
Dag-Erling Smørgrav - d...@des.no
2009/7/2 Dag-Erling Smørgrav d...@des.no:
Alexander Best alexbes...@math.uni-muenster.de writes:
for (i=0; i sizeof(hdr-nintendo_logo); i++)
fprintf(stderr, %x, hdr-nintendo_logo[i]);
What will this print if nintendo_logo is { 0x01, 0x02, 0x03, 0x04 }?
Good catch. It will print
On Tue, Jun 30, 2009 at 7:54 PM, Alfred Perlsteinalf...@freebsd.org wrote:
Hey Alex,
People frown on macros, but this could be a good one:
#define SPRINT(f, fmt) \
do {\
for (_i = 0; _i sizeof(f)/sizeof(f[0]); i++) \
printf(fmt, f[i]); \
On Tue, Jun 30, 2009 at 7:06 PM, Alexander
Bestalexbes...@math.uni-muenster.de wrote:
thanks for all the help. i decided to take the pill and coded all the fprintfs
by hand. here's the result. usually i'd stick to a higher level languag, but i
need C's inline assembly support:
struct
hi there,
i need to output the header of a file to stdout. the header looks like this:
struct Header
{
u_int8_t rom_entry[4];
u_int8_t nintendo_logo[156];
u_char game_title[12];
u_char game_code[4];
u_char maker_code[2];
u_int8_t fixed_val;
On Tue, 2009-06-30 at 18:12 +0200, Alexander Best wrote:
hi there,
i need to output the header of a file to stdout. the header looks like this:
struct Header
{
u_int8_t rom_entry[4];
u_int8_t nintendo_logo[156];
u_char game_title[12];
u_char
thanks. but that simply dumps the contents of the struct to stdout. but since
most of the struct's contents aren't ascii the output isn't really of much
use.
cheers.
Tom Evans schrieb am 2009-06-30:
On Tue, 2009-06-30 at 18:12 +0200, Alexander Best wrote:
hi there,
i need to output the
that works, but i really want to have a pretty output to stdout. i guess i
have to stick with printf and use `for (i=0; i sizeof(XXX); i++)` for each
array in the struct. just thought i could avoid it.
btw. `./my-program | hexdump` works, but if i do `./my-program output`
output is being
2009/6/30 Alexander Best alexbes...@math.uni-muenster.de:
that works, but i really want to have a pretty output to stdout. i guess i
have to stick with printf and use `for (i=0; i sizeof(XXX); i++)` for each
array in the struct. just thought i could avoid it.
btw. `./my-program | hexdump`
should be stdout.
struct Header *hdr = rom;
int new_fd = open(/dev/stdout, O_RDWR);
printf(SIZE: %d\n,sizeof(*hdr));
write(new_fd, hdr, sizeof(*hdr));
close(new_fd);
Igor Mozolevsky schrieb am 2009-06-30:
2009/6/30 Alexander Best alexbes...@math.uni-muenster.de:
that works, but i really
On Tue, Jun 30, 2009 at 08:03:21PM +0200, Alexander Best wrote:
should be stdout.
struct Header *hdr = rom;
int new_fd = open(/dev/stdout, O_RDWR);
printf(SIZE: %d\n,sizeof(*hdr));
write(new_fd, hdr, sizeof(*hdr));
close(new_fd);
Why are you reopening stdout? It should already be
2009/6/30 Alexander Best alexbes...@math.uni-muenster.de:
thanks. but that simply dumps the contents of the struct to stdout. but since
most of the struct's contents aren't ascii the output isn't really of much
use.
How about ./your-program | hexdump ?
--
Igor
2009/6/30 Alexander Best alexbes...@math.uni-muenster.de:
should be stdout.
struct Header *hdr = rom;
int new_fd = open(/dev/stdout, O_RDWR);
printf(SIZE: %d\n,sizeof(*hdr));
write(new_fd, hdr, sizeof(*hdr));
close(new_fd);
You should really be checking what open returns, opening
thanks. now the output gets redirected using . i'm quite new to programming
under unix. sorry for the inconvenience.
so i guess there is no really easy way to output an inhomogeneous struct to
stdout without using a loop to output each array contained in the struct.
cheers.
Rick C. Petty
On Tue, Jun 30, 2009 at 08:21:03PM +0200, Alexander Best wrote:
thanks. now the output gets redirected using . i'm quite new to programming
under unix. sorry for the inconvenience.
No problem; we all had to learn sometime. But what I suggested should
work for every platform that adheres to
Hey Alex,
People frown on macros, but this could be a good one:
#define SPRINT(f, fmt) \
do {\
for (_i = 0; _i sizeof(f)/sizeof(f[0]); i++) \
printf(fmt, f[i]); \
}while(0)
:D
This should allow you to point to any _array_ and print each
wow. thanks. that's looking really nice. i'll change my sources tomorrow after
a good dose of sleep. ;)
alex
Alfred Perlstein schrieb am 2009-07-01:
Hey Alex,
People frown on macros, but this could be a good one:
#define SPRINT(f, fmt) \
do {\
for (_i = 0; _i
Jos Backus [EMAIL PROTECTED] writes:
On Sat, Apr 28, 2001 at 09:32:51PM -0700, Dima Dorfman wrote:
Jos Backus [EMAIL PROTECTED] writes:
void stdin(const Config config); -=== line 99
`stdin' is a global variable which, surprisingly enough, refers to the
standard input stream.
In message [EMAIL PROTECTED], Jos Backus writes:
Yeah, I am just puzzled as to how this can build at all on other platforms
(Linux?), unless they don't define this variable.
Many of them probably have it as an external object, not a #define. I'm
still not sure the code makes any sense.
-s
To
In message [EMAIL PROTECTED] Peter Seebach writes:
: In message [EMAIL PROTECTED], Jos Backus writes:
: Yeah, I am just puzzled as to how this can build at all on other platforms
: (Linux?), unless they don't define this variable.
:
: Many of them probably have it as an external object, not a
[Apologies if this is the wrong list for this type of question.]
I am trying to create a port for a commandline-accessible database tool, but I
am running into the following problem (on RELENG_4 as of today):
=== Building for dbtool-1.3
c++ -DPACKAGE=\dbtool\ -DVERSION=\1.3\ -DSTDC_HEADERS=1
Jos Backus [EMAIL PROTECTED] writes:
void stdin(const Config config); -=== line 99
`stdin' is a global variable which, surprisingly enough, refers to the
standard input stream. Don't name a function after it and your
problem should go away.
To Unsubscribe: send mail to [EMAIL PROTECTED]
In message [EMAIL PROTECTED] Jos Backus writes:
: dbtool.h:99: declaration of `__sF' as array of references
: void stdin(const Config config); -=== line 99
stdin is #defined to be __sF[0].
Warner
To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of
On Sat, Apr 28, 2001 at 09:32:51PM -0700, Dima Dorfman wrote:
Jos Backus [EMAIL PROTECTED] writes:
void stdin(const Config config); -=== line 99
`stdin' is a global variable which, surprisingly enough, refers to the
standard input stream. Don't name a function after it and your
In message [EMAIL PROTECTED] Chuck Robey
writes:
: Does anyone (anyone, that is, who's coded X11 applications) know how you
: handle X11 callbacks to C++ object methods?
OI_add_event(3OI) :-)
Warner
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body
On Wed, 3 Nov 1999, Warner Losh wrote:
In message [EMAIL PROTECTED] Chuck Robey
writes:
: Does anyone (anyone, that is, who's coded X11 applications) know how you
: handle X11 callbacks to C++ object methods?
OI_add_event(3OI) :-)
Uhhh? I've long since got the answer I wanted, but this
In message [EMAIL PROTECTED] Chuck Robey writes:
: Uhhh? I've long since got the answer I wanted, but this seems a complete
: mystery, so I'll bite, what's a OI_add_event? From some package? Can't
: find a man page on it.
OI was a native C++ toolkit that had a nice interface and was ported
to
In message [EMAIL PROTECTED] Chuck Robey
writes:
: Uhhh? I've long since got the answer I wanted, but this seems a complete
: mystery, so I'll bite, what's a OI_add_event? From some package? Can't
: find a man page on it.
OI was a native C++ toolkit that had a nice interface and was
hi,
Does anyone (anyone, that is, who's coded X11 applications) know how you
handle X11 callbacks to C++ object methods?
Thanks,
TDR If you mean Xt (and possibly Motif) - the answer is "very carefully."
TDR The Xt callbacks are C based, so you typically can't directly call a
TDR
[EMAIL PROTECTED] (Chuck Robey) writes:
Boy, I sure wish Java compiled and ran natively. I'd stop using C++
forever.
gcc-2.95.1 + libgcj already works, at least for simple programs. On
FreeBSD 3.x programs seem to work as long as you use statically linked
libraries (shared libraries cause
Chuck Robey wrote:
On Tue, 26 Oct 1999 [EMAIL PROTECTED] wrote:
Thomas David Rivers writes:
If you mean Xt (and possibly Motif) - the answer is "very carefully."
[...]
You're approach would probably work, but there's an easier way.
See topic 28 in the Xt FAQ.
On Wed, 27 Oct 1999, Wes Peters wrote:
Chuck Robey wrote:
On Tue, 26 Oct 1999 [EMAIL PROTECTED] wrote:
Thomas David Rivers writes:
If you mean Xt (and possibly Motif) - the answer is "very carefully."
[...]
You're approach would probably work, but there's an easier
Does anyone (anyone, that is, who's coded X11 applications) know how you
handle X11 callbacks to C++ object methods?
Thanks,
Chuck Robey| Interests include C programming, Electronics,
213 Lakeside Dr.
Does anyone (anyone, that is, who's coded X11 applications) know how you
handle X11 callbacks to C++ object methods?
Thanks,
If you mean Xt (and possibly Motif) - the answer is "very carefully."
The Xt callbacks are C based, so you typically can't directly call a
C++ method.
But,
On 27-Oct-99 Thomas David Rivers wrote:
If you mean Xt (and possibly Motif) - the answer is "very carefully."
Or you could just use a toolkit written for C++ or with C++ shims already.. ie
Qt or GTK..
---
Daniel O'Connor software and network engineer
for Genesis Software -
On 27-Oct-99 Thomas David Rivers wrote:
And, wasn't there a freely available C++ shim for motif floating around
at one time?
I don't know.. My X experience begins and ends with Tk :)
(Don't like Motif either ;)
---
Daniel O'Connor software and network engineer
for Genesis Software -
On Tue, Oct 26, 1999, Thomas David Rivers wrote:
extern "C" {
void
callback_function(arg1)
void *arg1;
{
/* Call the method */
myclass::mymethod(arg1);
As far as I've seen, you can't directly call a class method
without an
Thomas David Rivers writes:
If you mean Xt (and possibly Motif) - the answer is "very carefully."
[...]
You're approach would probably work, but there's an easier way.
See topic 28 in the Xt FAQ.
ftp://ftp.x.org/contrib/faqs/FAQ-Xt
It's not name mangling causing problems, it's lack of
On Tue, 26 Oct 1999, Thomas David Rivers wrote:
Does anyone (anyone, that is, who's coded X11 applications) know how you
handle X11 callbacks to C++ object methods?
Thanks,
If you mean Xt (and possibly Motif) - the answer is "very carefully."
The Xt callbacks are C based, so
On Wed, 27 Oct 1999, Daniel O'Connor wrote:
On 27-Oct-99 Thomas David Rivers wrote:
If you mean Xt (and possibly Motif) - the answer is "very carefully."
Or you could just use a toolkit written for C++ or with C++ shims already.. ie
Qt or GTK..
If I wanted to just get X11 done, I
Then you just stick a C wrapper function around every C++ callback you
want to register, is that it? Seems a bit inelegant, but I suppose, if
the ultimate test of elegance is that "it's the only one that works", then
it's perhaps elegant *enough*.
I believe someone posted a better
On Tue, 26 Oct 1999 [EMAIL PROTECTED] wrote:
Thomas David Rivers writes:
If you mean Xt (and possibly Motif) - the answer is "very carefully."
[...]
You're approach would probably work, but there's an easier way.
See topic 28 in the Xt FAQ.
ftp://ftp.x.org/contrib/faqs/FAQ-Xt
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
On Tue, 26 Oct 1999, Bakul Shah wrote:
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).
Just got out of the shower, where I was wondering why they didn't
On Tue, 26 Oct 1999, Chris Costello wrote:
On Tue, Oct 26, 1999, Thomas David Rivers wrote:
extern "C" {
void
callback_function(arg1)
void *arg1;
{
/* Call the method */
myclass::mymethod(arg1);
As far as I've seen,
56 matches
Mail list logo