Search:

Type: Posts; User: Compyx; Keyword(s):

Page 1 of 10 1 2 3 4

Search: Search took 0.07 seconds.

  1. Replies
    6
    Views
    481

    Re: Question about a makefile

    The brute-force solution is to issue:

    make -B
    This will rebuild all targets, regardless of timestamps.

    Ofcourse, this will get very annoying/timeconsuming when working on large projects, so a...
  2. Replies
    13
    Views
    4,562

    [SOLVED] Re: Error installing TCL in Ubuntu 10.10

    Pick the appropriate .deb file for your architecture and download it (in my case, I run 64-bit Ubuntu 10.04, so I downloaded tcl8.0_8.0.5-8.1_amd64.deb).

    Open a terminal and go to the location you...
  3. Replies
    21
    Views
    2,960

    Re: Convert number to Binary? in C

    Your 'highest bit' code doesn't do what you meant it to do; you left out CHAR_BIT:


    result = value >> (sizeof(unsigned int) * CHAR_BIT - 1);


    The sizeof operator yields the size of its...
  4. Replies
    15
    Views
    735

    Re: issapce problem in this snippet

    Never, ever use gets(), use fgets():


    fgets(s, 100, stdin);


    Also note the only portable values to return from main are 0, EXIT_SUCCESS and EXIT_FAILURE.
  5. Replies
    4
    Views
    612

    Re: Baisc JavaScript Form Validation Help

    What you should do is remove onclick="validate();" from the submit button, and add onsubmit="validate();" to the <form> tag.
    And the validate() function should look something like this:

    ...
  6. Replies
    4
    Views
    612

    Re: Baisc JavaScript Form Validation Help

    There's not a lot of context to determine what could be wrong, but I'll give it a shot.

    Normally when doing client-side form validation with Javascript, you use the 'onsubmit' event of the form to...
  7. Re: Python: Generator object has no attribut __next__()

    The method is called 'next', no leading or trailing underscores.
  8. Replies
    2
    Views
    4,506

    Re: Prototype function definition

    That's were the error is occuring, like the message said, old-style (pre-ANSI) parameter declarations mixed with prototyped (ANSI) function definition.
    Two quick solutions here: either remove the...
  9. Replies
    2
    Views
    717

    Re: Mysqli problems....

    I have used both, and I prefer the newer mysqli over mysql. Mysqli allows for an OO approach to querying databases, which leads to cleaner code (IMHO). That said, these days I prefer to use PEAR's...
  10. Replies
    3
    Views
    1,875

    Re: Memory use after bash for loop

    But it isn't really a leak, the memory is freed by bash when bash exits. Of course, it would make sense to free the memory used by a loop after the loop has finished, but there may be reasons why the...
  11. Replies
    3
    Views
    1,875

    Re: Memory use after bash for loop

    This issue has been reported on launchpad: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/82123. It seems the bash maintainers don't see this as a problem, so I don't expect this will get fixed...
  12. Replies
    2
    Views
    254

    [SOLVED] Re: Deal with files with spaces in their names

    You can tell find and xargs to use '\0' to delimit filenames, rather than whitespace. Find needs the option '-print0' and xargs needs the option '--null'.

    Example:


    find /usr/src -name *.c...
  13. Replies
    9
    Views
    8,967

    Re: Implementing BBcode

    +1

    Although a simple BBcode parser isn't that hard to write, there are still a lot of pitfalls, such as users embedding html code in their posts (which needs to be filtered out), and...
  14. Replies
    5
    Views
    1,433

    Re: Simple C for loop question.

    Don't rely on that. In a boolean context, NULL is indeed false, but NULL isn't always all-bits zero. A implementation is allowed to, for example, declare NULL as (void*)0xDEADBEEF.

    A '0' numeric...
  15. Replies
    7
    Views
    1,171

    Re: Good BASH Tutorial

    Thanks for taking the time to explain your views. The abs guide is indeed very inconsistent in its examples, perhaps because many people contributed code snippets. (it should be the authors job to...
  16. Replies
    7
    Views
    1,171

    Re: Good BASH Tutorial

    Any particular reasons for this? I know it tends to experiment a lot and isn't very clearly written, but I found it to be quite useful as a reference. It does often fail to mention portability...
  17. Re: How should I lay out doxygen documentation?

    Doxygen expects a documentation block to belong to whatever comes after it, so the documentation goes before the function definition. There are exceptions though: preprocessor conditionals. Doxygen...
  18. Replies
    7
    Views
    1,171

    Re: Good BASH Tutorial

    http://tldp.org/LDP/abs/html/
  19. Replies
    1
    Views
    848

    Re: mysql date default to todays date

    MySQL doesn't support function calls as default values, only constants. However, for this particular problem, you can change the field type to 'TIMESTAMP':



    create table users(
    -> id int...
  20. Replies
    14
    Views
    5,055

    Re: Reverse strstr() ?

    I was playing with the same idea, would work fine for just a few searches on smallish strings. But it would add a lot of overhead for large strings with a lot of searches.

    A good example of 'When...
  21. Re: bash script to iterate through files and add a line

    As tomazzi already mentioned, sed has the -i/--in-place option:



    for f in * ; do
    sed -i '1s/^/Subject:Your Daily Book Part, Tarah.\n/' "$f"
    cat "$f"
    done
  22. Replies
    8
    Views
    519

    Re: Backend DB first, then user interface?

    I would also recommend designing the database first, once the database back-end is set up properly, the front-end tends to write itself since the database design dictates the design of the front-end....
  23. Replies
    35
    Views
    1,471

    Re: C: pass-by-reference vs. passing a pointer

    Since void is an incomplete type, applying the sizeof operator to void is a constraint violation, which requires a diagnostic. At least that's what I make of it, though I'm not that well versed in...
  24. Replies
    35
    Views
    1,471

    Re: C: pass-by-reference vs. passing a pointer

    I assume you mean unsigned char *, which is close to the generic pointer type pre-ANSI, which was char *.
  25. Thread: awk & sed

    by Compyx
    Replies
    4
    Views
    368

    Re: awk & sed

    It depends on what you want. As far as I know Awk doesn't have any built-in statistical analysis tools/functions, but since Awk is a full-fledged programming language with support for floating point...
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4