in reply to Where do your code ideas come from?

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!!!

  • Comment on RE: Where do your code ideas come from?

Replies are listed 'Best First'.
RE: RE: Where do your code ideas come from?
by Macphisto (Hermit) on Oct 17, 2000 at 06:49 UTC
    PsychoSpunk,
    First of all you got a ++ because you responded with a valid reply, but even if I didn't do that, you'd get a hell of a ++ for the ALL HAIL BRAK!!! Ahh, space ghost...How far did you get with the webCam program? Did you use any modules or did you write it from scratch?

    I should be getting my laptop back tomorrow ( forty days it was gone... ) so my programming projects should kick into gear since I'll have it where ever I am. We'll see if Best Buy will actually give me the thing back or not.

    Macphisto

    Everyone has their demons....
      Wackyass is the program. Take a look. This is the first full program I've put on PM. Good luck with Best Buy, they're evil. My roommate works there, and the only good thing he credits them with is the discount he gets.

      If anybody wants to play with Wackyass, feel free, I'd love to get more ideas on it, where to take it. I left it pretty much doing its thing since it was pretty good at getting the job I wanted done. I wanted to play with it some more, and maybe tie it into a thumbnail catalog or something. Basically, I wanted to get it to do archiving and searching.

      ALL HAIL BRAK!!!

        Heh, it was going great until the server crashed. Better get to work on that!

        A couple of my projects are derived from my friends projects. PsychoSpunk wrote the cool script to archive the whole site, but I whipped out the front page which did the autoreload of the current picture. (OK, so that only took like 10 minutes). But when he expands it to autogenerate thumnail pages for the last 24 hours, I'll probably help generate the base HTML for the script to run.

        Aparantly I'm the only one of my friends who like HTML, because another friend was involved in creating some Web BBS Software, but the interface is nonexistent, so I'm working on that for him.

        The same friend almost convinced me to start in on the Freenet Project. But I decided against that one for various reasons.

        I have started on a personal project inspired by a graph problem I've been working on, but it might be too big for me. So I like to solve random problems as well.