Necessity. A few months ago, I was playing with a webcam. My roommate and I thought it would be cool if we could archive the activity that went on during a day.

Instant perl project! I ended up writing a piece of code that, after 2 rounds of modifications, ran two processes, one to take a picture every nth interval of time, and the other to clean up. The pictures were stored in a tree such that every 24 hours, it would loop back and overwrite the previous day's pics, but the cleanup process was used to insure that all old pics really were removed. This was necessary since it used the sleep() command and it wasn't guaranteed to take exactly 5 pictures per minute every minute.

It's been sitting idly waiting for more work, though. I'd like to modify it so it's not as intense on the webcam server end. It may also have to do with the webcam software, which I don't have much control over. In the end, though, it's a pretty cool little script since you can specify what server you want to hit, so if there's a webcam out on the web that spits out a live feed, but only a single frame per hit on the server, this will let you effectively build a 24 hour period archive.

Oh yeah, if you tell it to stop, as in 'wackyass.pl stop' at the command line, it will kill the archiving process, and within the next minute (whenever the cleanup process wakes up) it will do last minute cleanup and then kill that process.

I guess if you want to have something to do, like I do sometimes, find a stupid little pet project to work on. Look for the smallest necessity, and then take it to a grand level. I know next time I am actually looking for work, I'm going to use that script to demonstrate what my code is like.

ALL HAIL BRAK!!!


In reply to RE: Where do your code ideas come from? by PsychoSpunk
in thread Where do your code ideas come from? by Macphisto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.