Search:

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

Page 1 of 9 1 2 3 4

Search: Search took 0.10 seconds.

  1. Replies
    6
    Views
    600

    [SOLVED] Re: Calculations in a shell script

    Here you go:



    TWOWEEKSAGO=$( expr $(date +%U) - 2 )
    echo $TWOWEEKSAGO


    Or, alternatively:
  2. Replies
    14
    Views
    681

    Re: forks and C - help !

    Huh! Welp, I learned something today.

    I thought that what I was describing was the default behavior because shells send SIGHUP to their child processes when they die -- turns out you have to set...
  3. Replies
    14
    Views
    681

    Re: forks and C - help !

    No, I didn't. I was commenting on how fork() works in Linux. If the OP wants to guarantee that the child processes get an opportunity to run, (s)he needs to use wait().

    Causing the parent program...
  4. Replies
    14
    Views
    681

    Re: forks and C - help !

    The parent process needs to call wait(...) or waitpid(...) for each of the forked child processes.

    If the parent doesn't wait for the children to complete, it will exit before they get a chance...
  5. Re: process behind extracting text from html

    Hrm -- I'm not sure I understand what you're asking. Could you try to be a little more specific?



    The short answer is "no". Without writing a pretty complicated program that could take in the...
  6. [ubuntu] Re: Looking for basic to advance shell script books.

    Welcome to the forums!

    This book will teach you POSIX shell scripting -- a set of shell commands that will work with a lot of different shells (bash, tcsh, ksh, etc).

    This book will teach you a...
  7. Re: process behind extracting text from html

    Sounds like a fun script. :D



    import urllib # Library that does web page requests
    # Request a given web page
    page = urllib.urlopen("http://dictionary.reference.com/browse/example")
    # Read...
  8. Re: Calculating square root and squared number

    Feel free to ask for help on smaller parts of your problem. (How to make a function, what a parameter is and how to pass one, etc.) At the moment you seem to be asking us to write the code for you,...
  9. Re: process behind extracting text from html

    There are a variety of approaches to this, and which one you might pick depends heavily on a number of factors. How complex is the HTML being read? What would you like to do with the text once you've...
  10. Re: Calculating square root and squared number

    I strongly suspect that the reason you haven't been helped on this already is that it sounds like a homework problem. Is that the case?
  11. Replies
    17
    Views
    759

    Re: [C] Memory deallocation question

    Absolutely correct. Poorly worded on my part, good catch!
  12. Replies
    17
    Views
    759

    Re: [C] Memory deallocation question

    I've drawn some ASCII diagrams to illustrate what's happening at each point in the code.





    [ ] <--- a
  13. Replies
    6
    Views
    1,670

    Re: GUI Programming with ' C '

    Here's a pretty comprehensive explanation that includes example code.
  14. Re: [regex] Match a specific image within

    Your post reminded me of an article that I read a long while back that warned of the complications inherent to trying to parse HTML using regular expressions.

    If you aren't too tied to the idea...
  15. Re: Seriously, this should NOT be hard!!! -- Python CGI

    You can have your CGI script simply provide a Location header as its sole output.

    e.g.


    #!/usr/bin/python
    print("Location: /some/thank_you/page.html\n")


    Note that if you output anything...
  16. [SOLVED] Re: Reverting back to home after Java is done.

    Other useful directory navigation tricks:

    Return to your home directory

    cd

    Return to the previous directory (not necessarily the parent directory)

    cd -
    (Note: this only works one time....
  17. Replies
    2
    Views
    282

    [SOLVED] Re: python noob questions

    Both signs do different things depending on their context, but I'll take a guess as to where you're seeing them.

    When printing, a comma is used to separate each item in a list of parameters you'd...
  18. [all variants] Re: Good place to start learning the bash shell better?

    Isn't it so satisfying when you manage to get it done in one command? :D

    I'd like to mention that there is a valuable distinction to be made between 'Learning Bash' and 'Learning common Unix...
  19. Re: Find and replace a field containing '' to NULL using awk or sed

    cat yourfile.txt | sed "s/''/NULL/g" > newfile.txt


    That will replace all '' instances with NULL. Or do you only want to change the 59th field? (i.e. Do you want the 43rd field to stay as ''...
  20. Replies
    842
    Views
    57,135

    Poll: Re: Chaos Rarely Breeds Order

    With respect to the issue of a "one linux" movement, I think you'll find that your proposal is rather impractical. Consider this example:

    I'm a huge fan of Arch Linux. Do you know what packages it...
  21. [SOLVED] Re: [C++] rand() - Same Ten Digits Printed -- Random?

    Yup! I can't imagine ever running into a scenario in which I needed something more random than /dev/random.
  22. [SOLVED] Re: [C++] rand() - Same Ten Digits Printed -- Random?

    o_O Wow! That would be very impressive. I am assuming you're talking about hardware on computers used by, say, well-funded astrophysics labs? I have yet to see cosmic-radiation-interpreting modules...
  23. [SOLVED] Re: [C++] rand() - Same Ten Digits Printed -- Random?

    Entirely true! :D

    I'm not saying that /dev/random is easily predictable. I'm saying that while computers follow a very, very complicated procedure to produce random numbers, they're still...
  24. [SOLVED] Re: [C++] rand() - Same Ten Digits Printed -- Random?

    /dev/random also uses a pre-defined way of producing "random" numbers. To be truly random, there would have to be absolutely no way of predicting what the next number it would spit out would be. If I...
  25. Replies
    18
    Views
    5,748

    [ubuntu] Re: Printing to PDF

    In OpenOffice Writer:

    File --> Export to PDF
Results 1 to 25 of 216
Page 1 of 9 1 2 3 4