Search:

Type: Posts; User: Rany Albeg; Keyword(s):

Page 1 of 7 1 2 3 4

Search: Search took 0.28 seconds.

  1. Replies
    12
    Views
    2,065

    [SOLVED] Re: Help with Valgrind's output.

    Bachstelze,
    You've been very helpful.
    Thank you.
  2. Replies
    12
    Views
    2,065

    [SOLVED] Re: Help with Valgrind's output.

    I see,
    So for conclusion I understand that there is no way to make a generic code both for strings and other data types that will implement 'rds_vecotor_add' ?

    I think I should choose another...
  3. Replies
    12
    Views
    2,065

    [SOLVED] Re: Help with Valgrind's output.

    Thank you, this certainly clarifies the problem.
    And yes, if I call 'rds_vector_add' with a third parameter equals to 7 Valgrind doesn't give the "Invalid read of size 1" error.

    But this is...
  4. Replies
    12
    Views
    2,065

    [SOLVED] Re: Help with Valgrind's output.

    This is the loop

    for(i=0;i<vec->vp;++i)
    {
    printf("%s\n",(char*)vec->objs[i].data);
    }

    But, I get same error even if I just printf a single element, say at index 0
  5. Replies
    12
    Views
    2,065

    [SOLVED] Re: Help with Valgrind's output.

    Hi, thanks for the feedbacks.
    I read here http://www.cprogramming.com/debugging/valgrind.html , under "Finding Invalid Pointer Use With Valgrind" that the reason to this error is because I'm trying...
  6. Replies
    12
    Views
    2,065

    [SOLVED] Help with Valgrind's output.

    Hello all,
    I'm using Valgrind to test a short program I just wrote.
    Valgrind say that there are not memory leaks and that the heap summary is fine, which is what I was looking for to see, but it...
  7. Replies
    5
    Views
    381

    [SOLVED] Re: Help freeing allocated memory.

    Thank you.
  8. Replies
    5
    Views
    381

    [SOLVED] Re: Help freeing allocated memory.

    First, thank you for responding to my question.
    Problem is partially solved.
    I tried to free a memory that I didn't even allocated.

    I ran the program with valgrind as suggested and I can see...
  9. Replies
    5
    Views
    381

    [SOLVED] Help freeing allocated memory.

    It has been a long time since I wrote something in C, and I'm trying to build a vector.
    I wrote its constructor and its 'add' method.
    Now I want to test it and free the allocated memory after using...
  10. Replies
    22
    Views
    964

    Re: Batch file renaming, unusual query

    This is my version, assuming that the contents of the zip files is files names with the prefix 'Zoom Karaoke - '.
    It will rename the all zip files in the current directory to the name of the first...
  11. Replies
    22
    Views
    964

    Re: Batch file renaming, unusual query

    There is a -c option for unzip to extract file to stdout.
    I suspect that the output will show you only a representation of files and not file names themselves.
    So just like you do not parse 'ls'...
  12. Re: First BASh Script Ever. Please Critique. :)

    Extensive use of echo && echo bla , instead of printf "\n%s" "$arg".
    printf and echo are both Bash built-ins.

    I got pretty bored while trying to read this script.
    Try to be more specific.
  13. Re: [regex] Match a specific image within

    rany:~/Desktop$ grep -o "http://[^\']*" your_text
    http://www.example.com/url_a.php
    http://www.example.com/url_a.png
    http://www.example.com/images.php?src=url_b
    http://www.example.com/image.png...
  14. Re: Bourne-shell script - finding and replacement in any web page code

    This is how you can store the output of a command in a variable

    output="$(command 2>&1 >/dev/null)" # Save stderr, discard stdout.
    output="$(command 2>&1 >/dev/tty)" # Save stderr, send stdout...
  15. Re: SH/BASH: How to display the last 5 emails using IMAP GMAIL into the console?

    WTF, are you on drugs?
  16. Replies
    7
    Views
    520

    Re: A little help with a bash script

    This is just a syntax.


    echo "${array[@]}" will output all array elements properly quoted, and
    echo "${#array[@]}" will output the number of elements.

    You might want to check the difference...
  17. Replies
    7
    Views
    520

    Re: A little help with a bash script

    It is shorter but not necessarily better.
    If you'll check ''man test'' you'll see:


    Your solution seems to work but it doesn't look good.
    Maybe someone more experienced than me will also tell...
  18. Replies
    7
    Views
    520

    Re: A little help with a bash script

    Hello.
    First of all you missed the space after '[' and before ']'.
    Second, I suggest you to use [[ instead of [ if you are writing for Bash.
    No word splitting or glob expansion will be done for [[...
  19. Replies
    5
    Views
    1,769

    Re: Please help me in structures in C

    strupr is unknown.
    you can use something like:


    void upcase(char *p)
    {
    while(*p != '\0')
    {
    if(*p >= 97 && *p <= 122)
    *p -= 32;
  20. Re: how to check the execution time of a programme

    Real is wall clock time - time from start to finish of the call. This is all elapsed time including time slices used by other processes and time the process spends blocked (for example if it is...
  21. Replies
    2
    Views
    523

    Re: bash script variables

    I think the problem is by invoking another instance of Bash.
    .
  22. Replies
    9
    Views
    552

    Re: virtual function???

    nvteighen,
    You should get a medal on this explanation, thank you!
  23. Replies
    4
    Views
    352

    Re: question about developing a program

    If it is CLI manipulated the best way is to write a Bash script for this task.
    Good luck, and come back if you need help with that.
  24. Re: SH/BASH: How to display the last 5 emails using IMAP GMAIL into the console?

    Taken from ''curl --help''

    -u/--user <user[:password]> Set server user and password

    I don't recommend you to hardcode your password.
  25. Re: SH/BASH: How to display the last 5 emails using IMAP GMAIL into the console?

    curl -u username --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if /<name>/; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'

    Will prompt the user for a password and will...
Results 1 to 25 of 153
Page 1 of 7 1 2 3 4