Search Results - JustLinux Forums


Search:

Type: Posts; User: jim mcnamara

Page 1 of 4 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    5
    Views
    2,627

    Right after the fork, both processes are...

    Right after the fork, both processes are identical - they are almost complete clones.

    There is one important exception - fork() returns a zero to the child process. It returns the pid of the...
  2. Replies
    8
    Views
    939

    There are several very good books on Unix...

    There are several very good books on Unix programming (There is no such thing as a Linux-only api like there is in Windoze for NT and XP)

    In Unix there are system calls - this book does a good job...
  3. try tr - maybe something like this cat...

    try tr - maybe something like this


    cat junkfilled | tr -d '\t' | cleanfile

    will get rid of tab chars for example.

    tr supports classes of chars - [:alphanum:] and you use these with
    -c -d...
  4. Replies
    13
    Views
    1,738

    Consider creating a file of your points - looks...

    Consider creating a file of your points - looks like you can represent things with either char or bitmaps - to save memory. The smaller the impact on virtual memory, the faster your code will run.
    ...
  5. This applies throughout all of Unix- and perl is...

    This applies throughout all of Unix- and perl is just one instance of it.
    Whenever you open a file for append, you can ONLY write to the end of the file, no matter where you seek. Seek will not...
  6. Replies
    6
    Views
    1,244

    I like www.codeguru.com

    I like www.codeguru.com
  7. Replies
    3
    Views
    765

    fgetc, getc are good choices: char chy; ...

    fgetc, getc are good choices:


    char chy;
    int ch;
    printf("\nDo You whish for another calculations [Y|N]: ");
    ch=fgetc(stdin);
    chy=ch;
    printf("chy=%c\n",chy);
  8. Replies
    12
    Views
    1,421

    I'm confused. popen calling /bin/bash is...

    I'm confused.

    popen calling /bin/bash is practically the same as just shelling out another process - except that you're handicapped. You can either read output with popen, or send input to your...
  9. That's actually production ksh stuff. I'm...

    That's actually production ksh stuff. I'm assuming it translates okay to BASH.
  10. Simple SQL to get a value from a table in a shell...

    Simple SQL to get a value from a table in a shell variable:



    UIPW="username/password@myoracle"
    result=(echo |
    "$UIPW
    set head off
    select blah from table...
  11. There are MFC libraries for Unix boxes. It...

    There are MFC libraries for Unix boxes. It sounds like you have one.

    Believe it or not Microsoft has some information on porting MFC apps to Unix.

    ...
  12. #include pid_t pid char...

    #include <unistd.h>
    pid_t pid
    char *args[11]={"arg one", "option two"};
    ...........

    pid=fork();
    if (pid==0){ // in child process
    execve("path/to/myprog", args);
    // we do...
  13. Replies
    10
    Views
    7,536

    struct sockaddr { unsigned short...

    struct sockaddr {
    unsigned short sa_family; /* address family */
    char sa_data[14]; /* up to 14 bytes of direct address */
    };



    This is how sockaddr is...
  14. Replies
    5
    Views
    656

    Try something like this: #!/bin/ksh #...

    Try something like this:


    #!/bin/ksh
    # script: ptest
    # parameters:
    # $1 - IP address to ping
    # $2 - duration in hours
    #
    # figure how long to keep doing this
  15. Compiler options, plus the code should not have a...

    Compiler options, plus the code should not have a main() in it.
  16. Replies
    11
    Views
    904

    I could also be a NULL pointer to some variable,...

    I could also be a NULL pointer to some variable, but it looks like a function pointer is aimed nowhere.

    In either case, this is likely to be a plain old-fashioned bug. It probably has very little...
  17. Replies
    5
    Views
    3,156

    All of our HP-UX boxes have bash.

    All of our HP-UX boxes have bash.
  18. www.boost.org has a smart pointers class. These...

    www.boost.org has a smart pointers class. These work only in C++, but you can read about how they are implemented. Smart pointers know how long an array is and the starting address of the array.
    ...
  19. Replies
    11
    Views
    904

    first off, for gdb to work, the code has to be...

    first off, for gdb to work, the code has to be compiled with symbols in the code

    for C -


    gcc -g myprog.c -o myprog
    gdb myprog


    Most production code is not compiled debug, so trying use...
  20. Never hard code passwords; never, never su...

    Never hard code passwords; never, never su paswords. It's like saying, here trash my system.
  21. Replies
    3
    Views
    925

    Did you try uniq nbtscan -s : -v...

    Did you try uniq



    nbtscan -s : -v 192.168.6.30-254 | grep -e "computername" -i | \
    sort | uniq -d | awk -F: '{print $1}'



    Or something along those lines
  22. since I hate typing assume your known_value is an...

    since I hate typing assume your known_value is an md5 hash result 16 bytes long: 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d ff 11 11
    Try:


    #include <stdio.h>

    int main(int argc, char *argv[]) {
    ...
  23. Unless you are running only on BSD systems,...

    Unless you are running only on BSD systems, consider using memcmp() instead. bcmp() may go away in the future.

    This help at all?



    unsigned char test_value[17];
    ....................
    if ( !...
  24. Replies
    4
    Views
    602

    We need to know - Oracle? MySql? Access? what...

    We need to know - Oracle? MySql? Access? what database?

    Not all SQL is the same, especially date functions.
  25. FWIW - Always profile before you try any...

    FWIW -

    Always profile before you try any optimization, whether by changing your code, or asking the compiler to speed things up. Try changing your code based on what the profiler finds is a...
Results 1 to 25 of 90
Page 1 of 4 1 2 3 4