2014/1/14-2/5 [Computer/SW/Languages/C_Cplusplus] UID:54763 Activity:nil | 1/14 Why is NULL defined to be "0" in C++ instead of "((void *) 0)" like in
C? I have some overloaded functtions where one takes an integer
parameter and the other a pointer parameter. When I call it with
"NULL", the compiler matches it with the integer version instead of
the pointer version which is a problem. Other funny effect is that
sizeof(NULL) is different from sizeof(myPtr). Thanks.
...
|
2009/4/30-5/6 [Computer/Theory] UID:52923 Activity:nil | 4/30 Sorting question! I have n sorted arrays of doubles. What's the
fastest way to sort them into 1 big sorted array?
\_ as mentioned below: you are describing one half of mergesort
\_ You really have to ask this question?
\_ You don't know either, huh?
\_ If three are n sorted arrays of m doubles each, I think the fastest
...
|
2009/1/26-2/1 [Computer/SW/SpamAssassin] UID:52462 Activity:nil | 1/26 Can somebody show me a procmail rule which drops email from
users {foo, bar, baz}@{host1,host2,host3}.berkeley.edu.
I dont want to have to create a rule set like this for
each combination:
:0:
* ^From: cfengine@host.berkeley.edu
...
|
2009/1/21-26 [Computer/SW/Languages/Java, Computer/HW/Memory] UID:52436 Activity:nil | 1/21 If I have a linked list of structs and many of those structs have
members that are structs then what is the best way to free() the
memory when I am done with them? I thought I would walk the list
and do a free() on each member of each struct, but that generates
errors like free(): invalid pointer, presumably because I don't
always allocate memory in each struct. No, I never took a class in
...
|
2008/7/14-16 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:50557 Activity:moderate | 7/14 Shell Programming question: I want to call a script with 1 arg
and have it figure out whether $1 is a MAC address or an IP address
and then do call the appropriate function. What is the best way
to do this, given that sh/bash/ksh do not have something like
the =~ in perl. Check for exit status of grep, or is there a
a better way? For the moment, let's just say the two tests are:
...
|
2008/7/11-13 [Computer/SW/OS/Misc] UID:50541 Activity:kinda low | 7/11 Does anyone know a way to find out all the environment variables for
a running process aside from ps? I'm doing this on AIX, and while
ps eww <pid> gives some of the environment vars, it seems to stop at
2000 characters or so.
\_ have you tried ps ewww? That works in some flavors of Unix.
\- agree with ps -e. otherwise, on AssOS, /proc/<pid>/environ ...
...
|
2008/6/9-12 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Security] UID:50194 Activity:nil | 6/8 CSUA code guru please help. I need to see my random number
generator with a good seed (I just need random 18 bit
identifiers). The usual time(NULL) is OK, except my program
might be invoked faster than once a second, and seeding using
time() produced the same result. I tried clock() but it seems
to return 0. My program needs to be run in Linux/DOS (Watcom
...
|
2008/3/10-13 [Computer/SW/SpamAssassin] UID:49412 Activity:nil | 3/10 Is there a reliable way to control spam on soda?
Can someone write an "any undergrad can do it" level FAQ? Thanks.
\_ echo "/dev/null" > ~/.forward
\_ I use Thunderbird to check my soda mail.
\_ Forward to gmail. Let google's spam filter work for you.
\_ I use spamassassin. I just checked and it caught all but one of
...
|
|