in reply to Re^3: Hashes, Arrays, Comparing Values to Elements
in thread Hashes, Arrays, Comparing Values to Elements

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^4: Hashes, Arrays, Comparing Values to Elements

Replies are listed 'Best First'.
Re^5: Hashes, Arrays, Comparing Values to Elements
by hangon (Deacon) on Dec 01, 2008 at 06:31 UTC

    Trihedralguy,
    Grandfather is wise. So is Your Mother. They are trying to teach, not disrespect you. I had to actually look at your web site to understand the problem. After some quick troubleshooting:

    The problem does not appear to be server side or network latency. I get pings well under 100ms to your domain. Using Firefox with Live HTTP Headers plugin, you can see an almost instantaneous request-response cycle followed by a few seconds before the page update renders.

    Looking at the HTML source, you are rendering around 300 <div> tags, each having an anchor tag with empty href (generated on line 70 of your Perl code). First, I would remove the unused anchors. You may also want to try building the image with a table instead of divs and see if that renders any faster. Finally the javascript library you are using may also be a factor. Check if they have a mailing list or forum to help you with it.

Re^5: Hashes, Arrays, Comparing Values to Elements
by Your Mother (Archbishop) on Dec 01, 2008 at 03:22 UTC

    you have shown me nothing but disrespect.

    I know it can feel that way but it just isn't true. Don't conflate yourself with your code. Most everyone really does want to help here and the easier it is to help, the more help you'll get.

    Your problem description in your OP is difficult to follow. It sounds like you're either making a color table or live mixing some sort of palette map; or maybe something else altogether. If the first is the case, you should Google for algorithms for color tables; you'll find a few such pages here too. If you're trying to live mix a palette, that might be tricky and you should back up and describe what you want the user to see first and then the way you're trying to do it (this is the XY thing; someone asking for instructions on using a chisel when what the problem really calls for is a sander).

Re^5: Hashes, Arrays, Comparing Values to Elements
by GrandFather (Saint) on Dec 01, 2008 at 02:25 UTC

    You seem to misunderstand my intent. I am trying to help you in several ways. However there are issues at several levels here and you may not be connecting the help I'm trying to give with the appropriate issue.

    Re: Hashes, Arrays, Comparing Values to Elements was an attempt to address your understanding of hashes and also to suggest a way of presenting questions at PerlMonks that will help both you and us understand and reproduce the important aspects of your problem. The code I offered was not a direct attempt to solve your css generation problem.

    Re^3: Hashes, Arrays, Comparing Values to Elements tried to explain what an XY question is and to suggest that you have a higher level issue (the perceived speed problem) that really ought be addressed at a much higher level than the hash oriented question. I suspect that "making the script faster" may not be the real issue at all, but you need to tell us what the bigger picture is for that to be clear.


    Perl's payment curve coincides with its learning curve.