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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by SkiLift

  1. SkiLift

    sed replace with spaces in line

    Try this: $SED "s/${START_AC}/${DEST_AC}/g" $ALEPH_START > $ALEPH_START_TEMP
  2. SkiLift

    memcmp versus strcmp, why is memcmp faster?

    You're right about unrolling it yourself! My bad about memcmp and structs...I actually do know better than that :)
  3. SkiLift

    memcmp versus strcmp, why is memcmp faster?

    memcmp(str1, "Z", 2) is a great idea to get rid of the strlen, but is harder to read or understand what's going on and why (for maintainability). I like the strcmp because of the readability. I would use the memcmp if I did not have to add either the strlen or the memcmp(str1, "Z", 2) trick...
  4. SkiLift

    memcmp versus strcmp, why is memcmp faster?

    Ooops...missing a open paren before the first strcmp in the first code block.
  5. SkiLift

    memcmp versus strcmp, why is memcmp faster?

    During a code review, I was told to change my strcmp to a memcmp, because strcmp is too expensive. I'm pretty sure he is correct, but I was wondering why. The loop gets moderate use. Here is the old code: if (!(lWordIndex == 0 && strcmp(str1, "Z") == 0 || strcmp(str1, "X") ==...
  6. SkiLift

    memcmp versus strcmp, why is memcmp faster?

    Why is memcmp faster than strcmp?
  7. SkiLift

    Need String filtration help.

    The 'cut' command is underrated: echo "cRanjan_abc_xyz@foo.com" | cut -d\@ -f1
  8. SkiLift

    CRTSQLCI - precompile error on SQL CONNECT

    Does anyone know why the code below compiles ok on v4r2 but does not compile on v5r1? The error msg is below the code. It seems to require a USING clause now, when before it did not. BTW, the last else stmt passes compile, ie, you can connect without a user or pw, so the security reason does...
  9. SkiLift

    Command to display all references of executable file?

    I seem to remember a Unix command that has an executable file as its one argument. The command displays all the references of the executable, for example: globol variables, function calls, etc... Does anyone know of such a command? It is similar to 'ldd'.
  10. SkiLift

    text file edit - multiple lines to one line

    Here is another way using a shell script #!/bin/bash if [ "$#" -ne 1 ] ; then echo "USAGE: $0 file" exit 9 fi MASK=$(grep "ipNetmask" "$1") if [ "$?" -ne 0 ] ; then echo "In file does not have ipNetmask" exit 1 fi WORK=$(grep "ipNetwork" "$1") if [ "$?" -ne 0 ] ; then echo "In file...
  11. SkiLift

    Will hpux 11.11 build run on 11.0?

    Does anyone know if I compile and link on hpux 11.11 and copy the program to hpux 11.0, is it guaranteed to work?
  12. SkiLift

    TruUnix 5.1 - binaries 32 or 64 bit

    I understand that TruUnix5.1 is a true 64 bit machine. On other machines, like solaris 8 and Aix 5.1, I can compile and link in 32 bit or 64 bit mode. I can use the "file" command to see if binaries are 32 or 64 bit. For Ex: $ file lib/libsqlplus.so lib/libsqlplus.so: ELF 64-bit MSB...
  13. SkiLift

    compiler and pointer addition...

    Add the typecast to target (see boldface below), it will work. target=datastore.Orbit->Epoch; target= (DS_GEP_Epoch)target + (v->epoch_number)*(sizeof(DS_GEP_Epoch)); temporary=datastore.Orbit->Epoch + ((v->epoch_number)*(sizeof(DS_GEP_Epoch)));
  14. SkiLift

    compiler and pointer addition...

    Yes, I tried a simple test with 'target' as a void ptr and it leterally adds one, see first listing. Then I tried it with type casting 'target' to an int and it worked, see listing 2. /* listing 1 ---------------------------*/ #include <stdio.h> void *target=NULL; int *myint=NULL; int...
  15. SkiLift

    compiler and pointer addition...

    My guess is that if you change target to be of type DS_GEP_Epoch, then it will work. I base this on the rules of pointer arithmetic, like adding one to a char ptr adds sizeof(char) to the address; but adding one to a int ptr adds sizeof(int) to the address. I'm not sure what is added to a ptr...

Part and Inventory Search

Back
Top