Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Clairvoyant1332

    Speed issue sending UDP data on XP SP2 vs XP SP3

    I've found solution to this issue. Apparently XP SP3 and later throttle back transmission of UDP datagrams that are larger than 1024 bytes (by default). This can be changed by setting the following DWORD registry variable...
  2. Clairvoyant1332

    Speed issue sending UDP data on XP SP2 vs XP SP3

    I have a multicast file transfer program which seems to be having some issues with speed on particular versions of Windows. I had a user of the software email me saying he was unable to get efficient file transfer speeds when running the sender under Vista SP2 or XP SP3, but good speeds on XP...
  3. Clairvoyant1332

    Finding 5000 oldest files from a directory

    Having ls do the sort won't work. It only does it on a per-directory basis, not the entire recursive listing.
  4. Clairvoyant1332

    Finding 5000 oldest files from a directory

    The sort would work if your version of ls outputs the time as 'yyyy-mm-dd HH:MM', although many (like the OP's) output it as 'mon d [HH:MM| yyyy]' (time is displayed if the file is < 6 months old, otherwise year is displayed). Of course, even then you still have to have the full output of the...
  5. Clairvoyant1332

    binary files writing not working as expected

    The prototype for fgets (from the man page) is as follows: char *fgets(char *s, int size, FILE *stream); You would pass the size of the buffer in the second parameter, and stdin for the third. As for trimming the newline, just check the last character in the string, and if it's '\n' zero it out.
  6. Clairvoyant1332

    binary files writing not working as expected

    You're reading in more characters than your buffer can handle. You read in 5 characters, but the buffer is also 5 meaning there's no space for the null terminator. What you really should be doing is using fgets() instead of gets() to read from stdin. fgets() allows you to specify the size...
  7. Clairvoyant1332

    return array of type double from VC to VB

    Looks like I was a little slow myself... :-)
  8. Clairvoyant1332

    return array of type double from VC to VB

    Even though the function doesn't have a return value (i.e. the C function returns void and in VB it's a Sub instead of a Function), that doesn't mean it doesn't return anything. The Sub declaration in VB says that the argument "array" is passed by reference (via the ByRef keyword). This means...
  9. Clairvoyant1332

    Recover root password

    The most straightforward way is to boot the system from CD, mount the root filesystem manually, and clear root's password entry in /etc/shadow. I don't know if an E10K is different than other system in regard to doing that, though. If you have rlogin access from another server, you can also...
  10. Clairvoyant1332

    Automatically download attached files from MS Outlook when new email

    Writing a VB macro on the client is definitely the way to go. I did something similar to this to allow me to run a program or script on my PC when a specially crafted email arrives in my inbox.
  11. Clairvoyant1332

    fork, dup2, and redirection of the stdin/stdout

    I came across an interesting issue related to this. I have a C program which opens a log file, then dups the file descriptor to stderr (fd 2) and closes the original fd. I then can call fprintf(stderr,....); to write to the log file. On Solaris and Red Hat, this works fine. However, when I...
  12. Clairvoyant1332

    Highlighting the text on a button in IE

    This is something I stumbled across once while trying to cut and paste text in IE. This trick works in IE 5.5 and IE 6.0. Open up any web page in IE that contains a standard button. Drag over a portion of the page so that a button is highlighted (or press ctrl-a to select all). Now drag over...
  13. Clairvoyant1332

    How to &quot;daemonize&quot; a Java program

    The idea was to have something that works under either Unix or Windows, which is why I was looking for something within Java to do this. We do have some java apps on production Solaris machines that essentially run "java class &" from a script. However, if an SA needs to manually restart the...
  14. Clairvoyant1332

    How to &quot;daemonize&quot; a Java program

    I kinda figured as much. Thanks for the connfirmation. That said, where would a daemon thread typically be used? Is it just a way to avoid having to wait for certain threads to exit?
  15. Clairvoyant1332

    How to &quot;daemonize&quot; a Java program

    I'm trying to find a way to have a java program put itself in the background, rather than having the shell do it via "nohup java class" or "java class &". I tried creating a sample program that calls setDaemon() as follows: public class jthread extends Thread { public void run() { int...
  16. Clairvoyant1332

    How to &quot;daemonize&quot; a Win32 program

    In UNIX environments, a process can be put in the background by first calling fork(), which creates a new process identical to the caller. The new process then calls setsid() or setpgrp() to detach from the terminal, and the parent process exits. This results in the command issued by the user...
  17. Clairvoyant1332

    Large Numbers arithmetic in C

    I wrote something like that myself once. Here's some source: http://www.tcnj.edu/~bush/longmult.c http://www.tcnj.edu/~bush/bigint6.C The first is C, the second a set of C++ classes. It's not as efficient as GMP, but it at least works. Should give you a good starting point.
  18. Clairvoyant1332

    How can I schedule a script to run every 10 minutes

    You can also have the script call "at" on itself at the end to reschedule. That way, you don't have to worry about it getting killed off while its sleeping.
  19. Clairvoyant1332

    Constant values are visible in the executable file

    An quick way around this is to break up the declaration of the constant. Instead of doing this: char MyConstant[] = "value"; Try this: char MyConstant[6]; MyConstant[0]='v'; MyConstant[1]='a'; MyConstant[2]='l'; MyConstant[3]='u'; MyConstant[4]='e'; MyConstant[5]=0;
  20. Clairvoyant1332

    multi-threaded simple socket server...

    If you have a socket marked as non-blocking and you attempt to either accept() or read() when nothing is available, the function will return -1 with errno set to EWOULDBLOCK (or EAGAIN). If the socket is marked as blocking, then accept() will wait until a connection is established, and read()...

Part and Inventory Search

Back
Top