Jump to content

eggrock

Members
  • Content count

    36
  • Joined

  • Last visited

Community Reputation

0 Neutral

About eggrock

  • Rank
    Family Friend
  1. Interesting that 105 seems to be dead now. Coincidence? (kidding, not insinuating Anything. At. All.)
  2. Thanks Bruce. What is considered excessive for CPU/memory? These manipulate images up to 1280x1024 ([edit: reduced to 512x512 until I put throttling in]) and can make several passes. The longest it runs is a few seconds, (7 at most) but during that time it's doing nothing but math.
  3. That's why I'm asking...
  4. 'scripts' I've got a couple of scripts I'm working on that can be CPU intensive. Left to itself Perl WILL suck up all available CPU resources, so I need to know whether or not I need to write in speedbumps for my scripts.
  5. eggrock

    Javascript - Settimeout & Recursion

    Thanks for your reply David, I appreciate it.
  6. eggrock

    Javascript - Settimeout & Recursion

    This wound up working; setTimeout does operate (or execute) in a global scope--which makes sense since it's an event--so the declaration/initialization of 'count' and 'delay' need to be external to the function as well, or else the local scope overrides the global scope and I get undefined values as a result. With everything in a global scope there's no need for looping with the exception of the recursive function call: >var newsitem = new Array(); var delay = 7000; var count = 0; newsitem[0] = "some news"; newsitem[1] = "more news"; function newsbar() { var newsmsg = "News: " + newsitem[count]; document.newsform.newsinput.value=newsmsg; count++; if(count >= newsitem.length) { count = 0; } news=setTimeout("newsbar()", delay); } That's still a bit unclear because the tutorials and explanations I've seen indicate that 'count = 0' is the same as 'var count = 0', so there must be a check for a predefined global before a local is created. [edit] And the results are here: http://up-nort.com/test/cfbtest1/index.html - Still playing around with layout, backgrounds and such but once the javascript is done it's all layout and server side (the latter is complete as well).
  7. eggrock

    WSJ-like Photo

    Oops. Had totalchoice.com enabled, not totalchoicehosting.com... My bad.
  8. eggrock

    WSJ-like Photo

    The 'add noise' filter in Photoshop can give you that effect but since the size of that pic is so small you won't get a very realistic effect. Not to mention that, after six years of owning Photoshop I'm still a complete n00b. This is an example; I didn't crop the background, just added noise and set to grayscale:
  9. eggrock

    Javascript - Settimeout & Recursion

    One answer I got elsewhere was to change >news=setTimeout("newsbar(count, delay)", delay); to this >myCmd = 'newsbar(' + count + ', ' + delay + ')' news = setTimeout(myCmd, delay) And make count global, or at least external to the function call. With some other tweaks and messing around, count will start at 0, increment and then roll over back to 0 when it reaches the value of the total number of array elements. Exactly what I want. Trouble is, 'newsitem[count]' still doesn't display correctly; it doesn't change at all on the web page. So I guess what I'm really after is something that explains EXACTLY how Javascript handles variables and why you need to do this funky string concatenation to pass things along. The latter probably has to do with how quotes are handled. It doesn't act like I expect it to--you know, C, Perl, reverse Polish notation on HP calculators. I've been using W3 schools and code samples from various places but the documentation is far from complete.
  10. Using the following code, I expect to have varying bits of information placed on the page every few seconds: >function newsbar(count, delay) { var newsitem = new Array(); newsitem[0] = "some news"; newsitem[1] = "more news"; for (i=0;i<newsitem.length;i++) { if(count==i) { document.newsform.newsinput.value=newsitem[i]; count++; if(count>=newsitem.length) { count = 0; } news=setTimeout("newsbar(count, delay)", delay); } } } The script is called in the body tag, eg <body onload="newsbar(0, 5000);">, and placement is in a text input box (form name is 'newsform' and the input name is 'newsinput'. A couple problems: - Even though I pass '0' (as count) in the onload tag, array element 1 displays. This tells me that 'i' is being incremented differently than I'd expect; guessing as soon as 'i++' is encountered. Not a huge deal. - The big problem is, when setTimeout is used to call newsbar again, count (and probably delay) are undefined. I don't know what's going on there. Every example I see on the web is either passing a string to the function (which works in my case) or nothing at all. No actual variable values are passed so this has to be yet another feature *coughidiocycough* of Javascript, or maybe just a quirk of setTimeout or whatever, I dunno. For efficiency's sake I can probably initialize that array externally to the function but since I'm basically illiterate when it comes to Javascript I'm playing it safe for now. The rules in Javascript are so incomprehensible I'm willing to sacrifice elegance and efficiency in the name of functionality.
  11. eggrock

    Homogenizing Browser Displays

    Okay, here's a rough outline of a test page: Test Page If you View->Source you'll see a bunch of 'empty' <div> tags, eg: <div class="bgtopleft"></div> I put the CSS into it's own file for right now; all class 'bgtopleft' does is set an image at a certain point. The login form is in its own <div> and is also absolutely placed, as well as the score table at the bottom. The source & CSS is a rough draft; it's going to be dynamically generated eventually. Is that acceptible/efficient/preferred to set things this way?
  12. eggrock

    Homogenizing Browser Displays

    Would applying position/right/top to a <div> be good practice? The entire form will be in a particular area and other content in other areas. I didn't try to use the IMG BB tag, just entered the URL (and had the URL tag applied automatically.) But yes, hotlinking protection is on...
  13. eggrock

    Homogenizing Browser Displays

    Crap, thumbs don't work here. Grrr.. That image is only 17k.
  14. eggrock

    Homogenizing Browser Displays

    Yeah, that's odd. It's an image so there's probably some security setting or another that won't allow .png's to be opened directly. Try it without the BB code. [edit] Dunno the image size commands in BB so I didn't link it directly.
×