|
Posted by Onideus Mad Hatter on 11/19/34 11:20
On Sun, 3 Jul 2005 14:31:56 +0100, "Richard Cornford"
<Richard@litotes.demon.co.uk> wrote:
>> using screen width stamping as I'm
>> doing now may be "better" in design,
>Which it why it would have been the method of choice from the outset. At
>least for anyone which the understanding needed to make the choice.
Yes Richie, yer perfect...REALLY. *snicker*
>> however in actual function it's mostly meaningless unless
>> people are going to the site and constantly resizing
>> their browser.
>One person re-sizing their browser could potentially impose the same
>load on the server as 2 people loading the page in differently sized
>browsers an nearly the same time.
Fixed your error! ^_^
>Beta testing doesn't happen until you have a proposed final product, you
>are still somewhere in the prototyping stage.
There you, arguing semantics again...oh well, it's not like you've got
anything else to complain about.
>> Now are you gonna tell me that you shell out 700+ line
>> posts for EVERY person who comes along with some new
>> idea or concept? No...of course not.
>Irrelevant as it isn't a new idea.
....well actually Richie, it is. No one, anywhere has EVER thought of
doing what I did before. There have been alternative methods like
oversizing an image and then bluring it to get a slightly less shitty
resize, however the implimentation that I came up with, which works
flawlessly, has NEVER been thought of by ANYONE but me. Oh but hey, I
freely encourage you to try and post any proof you can find to the
contrary. `, )
>> ...of course, I do have to be a bit discerning. After all,
>> some of what you've said has been true,
>What you perceive as not true is just the proportion that has gone over
>your head.
Oh so that big part you snipped out where you fucked up and though
that browser resizing was simply a matter of down scaling, that just
"went over my head", eh? Tell me, which specific part of that whole
you == wrong went over my head?
>You notice that when I expand on what I mean to the point
>where you grasp the idea you promptly go off and implement it.
Actually Richie, everytime you suggest something its always like
verbose and full of shit. It's only after you interpret your bullshit
ideas into the simplest form possible that I simply go and do it. I
don't need your code, Richie, I just need you to explain your concept
as straight forward as possible. I'm a programmer, I can figure it
out on my own, trust me.
You know what you remind me of Richie? This:
:var browser=false;
:if(document.images) browser=true;
:
:if (browser){
:var object=new Array();
:
:object[Image']= new objectdata(100,50,"test1.jpg","test2.jpg","Image");
:
:}
:
:function objectdata(hsize,vsize,replaceimg,restoreimg,mess)
:{if(browser)
:{ this.mess=mess;
: this.simg=new Image(hsize,vsize);
: this.simg.src=replaceimg;
: this.rimg=new Image(hsize,vsize);
: this.rimg.src=restoreimg; }}
:
:function ReplaceOrig(name)
:{if(browser)
:{window.status=object[name].mess;
:document[name].src=object[name].simg.src;}}
:
:function RestoreOrig(name)
:{if(browser)
:{window.status="";
:document[name].src=object[name].rimg.src;}}
:
:<img src="test1.jpg" NAME="Image" OnMouseOver="ReplaceOrig('Image');return true;" OnMouseOut="RestoreOrig('Image');">
Boy back in 2001 when I picked up that script off some "JavaScript
expert" site I was doin ALL my image flips like that...until, you
know, I suddenly realized that "expert" was as full of shit as you are
and then just did this:
:<img src="test1.jpg" onMouseOver=" this.src='test2.jpg' " onMouseOut=" this.src='test1.jpg' ">
Fuckin amazing isn't it? Yeah, gotta love you self professed experts,
you're masters of bullshit.
Seriously Richard, when you first mentioned using the width you
trailed off into a fuckin FOUR PARAGRAPH spiel of bullshit about it
that involved PHP, JavaScript and about a half dozen other
things...when really, all I had to do is was change the word
"starttime" to the existing variable "screen_w".
If you were a REAL "expert" then you would have figured that out right
off the bat Richie...hell I only had to skim yer FOUR PARAGRAPHS of
bullshit to realize it.
>> however much of what you've said falls into the realm of
>> "poor programming practice"...like yer deal with using eval().
>Yes, I have seen that going over your head at leas three times now. Your
>eval call does nothing, and you will not find a single real programmer
>who would call a function knowing that it would do nothing in all
>possible circumstances of the call. You may describe this as "poor
>programming practice" as often as you like, but only to the effect of
>flagging yourself as someone who doesn't know what they are talking
>about.
If the function does nothing then there's nothing wrong with my using
it as a means of properly discerning from integers and strings.
That's something a GOOD programmer would like to do at all times,
Richie.
>> It's JavaScript, kiddo, not javascript.
>No it is "javascript" or "Javascript".
Sorry kiddo, it's not.
>"JavaScript" is Netscape's
>trademark name for their original language and their standardised
>ECMAScript implementations, and so only applies to scripting
>environments using versions of the Spidermonkey and Rhino script
>engines. "javascript" is the common generic term for all ECMAScript
>implementations, thus encompassing JScript and all others found in web
>browsers. Technically they are all referred to as ECMAScript because
>that is the standard they all implement, but the common term tends to be
>used in non-technical discussions.
JavaScript is the accepted word usage, Cupcake. Maybe you've just got
a hard on for Microsoft or something, but it's JavaScript, and
anything that's IE specific is JScript.
>Javascript source? The function keyword is all lowercase in case
>sensitive javascript and the dash (subtraction operator) is not in the
>set of characters allowed in an Identifier (which a function name must
>conform to).
>
>Assuming what you had written wasn't a sequence of syntax errors, and
>instead was viable javascript source code, it still wouldn't contribute
>to rendering writing "tack the current time on the end of the file name"
>(or, more practically
>"tack_the_current_time_on_the_end_of_the_file_name") in any way
>effective because the statement in English would not call the function
>you could have created. It also does nothing toward freeing the author
>to write instructions imprecisely because it is a precise instruction
>(as the function still performs a precise set of actions, the function
>name is still one precise and unambiguous sequence of character) and any
>authoring imprecision would be expected to accommodate "append the
>current time to the file URL" in addition, along with many other
>permutations. It would never be practical to write a function for each
>and every possibility.
>
>You could do:-
>
>window['tack-the-current-time-on-the-end-of-the-file-name'] =
>function(){
> filename = filename + starttime;
>};
>
>But you would then get a runtime error trying to call it as:-
>
>tack-the-current-time-on-the-end-of-the-file-name();
>
>- and calling it as:-
>
>window['tack-the-current-time-on-the-end-of-the-file-name']();
>
>- would not even be close to being able to express an instruction as a
>natural statement in English.
....wow, you just like COMPLETELY missed the humor of my response...and
then you went and dove off the deep end into some long winded bullshit
explanation of worthless tripe. Congratulations Richie...now ya see
is why you never manage to accomplsih anything. ^_^
>>>Tell that to the computer, they see it as binary digits,
>>>which is about as black and white as things get.
>> ...actually most computers employ trinary operators in
>> quite a number of hardware applications
>Implementing higher level functions in hardware is normal, but they are
>still made out of numbers of transistors so ultimately binary and
>inevitably deterministic..
Go do some research on electron resonant tunneling structures, kiddo.
><snip>
>> Yes Kiddo, you can choose not to use the eval
>> function if you like...
>
>I can choose to know enough to see when a function call is utterly
>useless, and not call that function as a result.
And yet for all you supposedly know you couldn't just say, "replace
starttime with screen_w". Instead you said:
=====
If you have ensured that all HTTP request for images are going to be
served by the server, and the server re-scales the image for each and
every request, you have made the performance of the server the
limiting factor. And as you are asking it to do a great deal to serve
each request. The result will not scale up at all well.
I knew from your comment above that if you jumped you would jump in
the wrong direction. It is the inevitable consequences of you not
understanding what you are dealing with.
In practice you want those intervening HTTP caches (and browser caches
for that matter) to be caching as much as they practically can.
Because that reduces your (heavy in this case) server load and server
bandwidth. What you don't want is to have those caches serving images
that have been scaled to one size when you are expecting another. That
is; you want the caches to see each individual size of image as a
distinct resource, but see request for images of the same size as the
same resource. And you certainly do want them to cache all of the
images that they are willing to.
You achieve that by passing the dimension information on the query
string of a GET request, so a request for "img.php?width=120" is
distinct from a request from "img.php?width=320", and you send HTTP
headers that will encourage the caching of the images. Thus both
images get cached as distinct entities but any subsequent requests for
"img.php?width=320" get served from the cache, but with the correctly
scaled image. Instead of your server flogging its guts out scaling
images all the time, eventually the majority of image requests will be
served instantly by caches without even impacting on your server.
Easy isn't it when you understand how it works? And if you were a
fraction of the expert you claim to be you could have been doing that
from the outset, instead of having to have it laid out on a palate for
you by a "spoon fed educated moron" like me.
=====
Now really Richie, yer trying to bitch about my use of eval? After
all your pointless repetition and inane verbage you might wanna
consider not throwing any more stones in your glass house.
>Granted novices often find javascript's loose typing initially
>confusing,
Actually it's just the opposite really, n00b.jobs tend to do a lot
better in JavaScript because you can pretty much fuck everything up
and it'll still work.
>> ...which would just be fucking stupid because yer gonna burn
>> through hard drives like most people go through cheeseburgers
>> at McDonalds.
>Ah yes, I remember now, serving images form hard disks is such a
>reckless practice that there is not a single HTTP server out there that
>does it ;-)
>
>Don't worry about it, once you get your head round this idea you will be
>as eager to implement it as any of my other suggestions.
Well let's do some SIMPLE math, Richie. Now let's be generous to your
stupidity and say that the minimum screen width that anyone is using
is 640 and let's say the maximum is 1024...that means that by using
your method you would need to create and have on you drive 384
different images for every SINGLE image. So if you had a site that
had say, 100 pictueres on it, you would need to create 38,400
pictures...let's say each averaging about 25KB each, that works out to
nearly a gigabyte of space...of course, that's not the REAL problem,
is it Richie? It's that whole "caching" concept that you don't quite
comprehend. In this case we're talking about the server though. Now
Richie, how do you plan to get your magic server to cache all 38,400
images? I mean, holy shit, we're talkin a gigabyte of memory JUST for
caching the images! Oh yeah Richie, what a BRILLIANT plan you've come
up with! Why didn't I think of it before?!
Oh but then you're always rambling on about how we need to take
EVERYTHING into account, just because it's not likely to happen
doesn't mean that it won't, so using YOUR LOGIC, let's consider the
WHOLE scope of my program.
minimum screen width=1
max screen width=infinity
So you would need to create infiity graphics, each averaging about
25KB each, which works out to an infinity of HD space that in order to
cache in the servers memory would require an infinite amount of
memory...WOW...this really is SUCH a good idea, Richie! ^_^
>>>comp.lang.javascript would be the obvious choice. There you can expect
>>>to find an informed opinion on the subject eval use, but you wouldn't
>>>dare.
>> Actually comp.programming would be a far better choice.
><snip>
>Fine by me, but you didn't did you?
I didn't? Are you sure?
>Because for all your puff and
>bluster you know full well that your definition of "good programming
>practice" will elicit the ridicule it deserves in any forum where you
>will find programmers.
Well no one there has complained yet. Why don't I ask you the second
question I asked them, we'll see who can come up with a better
response...you...or them. `, )
=====
>I guess you never programmed for ZX Spectrum... It puts your brains
>under the right angle once and for a while :-)
I prefer Mt. Dew to put my brain into the right angle.
I decided to try it my own way first and fix what I had, this is the
result:
http://www.backwater-productions.net/_test_platform/game/index.html
: char_l_img = 1;
: char_r_img = 1;
: char_ar_img = 0;
: char_al_img = 0;
: start_pos = 300;
: nav4 = window.Event ? true : false;
: left = null;
: right = null;
: attack = null;
: pos = "rightface";
:
: function move_left()
: {
: start_pos = start_pos - 5;
: char_l_img++;
: if ( start_pos == 25 ) { start_pos = 30; }
: if ( char_l_img == 5 )
: {
: char_l_img = 1;
: window.clearInterval(left);
: left = null;
: pos = "leftface";
: }
: document.getElementById("char_div").style.left = start_pos + "px";
: document.getElementById("char_img").src = "l" + char_l_img + ".gif";
: }
:
: function move_right()
: {
: start_pos = start_pos + 5;
: char_r_img++;
: if ( start_pos == 540 ) { start_pos = 535; }
: if ( char_r_img == 5 )
: {
: char_r_img = 1;
: window.clearInterval(right);
: right = null;
: pos = "rightface";
: }
: document.getElementById("char_div").style.left = start_pos + "px";
: document.getElementById("char_img").src = "r" + char_r_img + ".gif";
: }
:
: function attack_right()
: {
: char_ar_img++;
: document.getElementById("char_img").src = "ar" + char_ar_img + ".gif";
:
: if ( char_ar_img == 3 )
: {
: char_ar_img = 0;
: window.clearInterval(attack);
: attack = null;
: }
: }
:
: function attack_left()
: {
: char_al_img++;
: document.getElementById("char_img").src = "al" + char_al_img + ".gif";
:
: if ( char_al_img == 3 )
: {
: char_al_img = 0;
: window.clearInterval(attack);
: attack = null;
: }
: }
:
: function move(e)
: {
: if (nav4) { whichCode = e.which; }
: else { whichCode = event.keyCode; }
: if( whichCode == 100 ) { if ( !left ) { left = window.setInterval('move_left()', 35); } }
: if( whichCode == 102 ) { if ( !right ) { right = window.setInterval('move_right()', 35);} }
: if( whichCode == 32 )
: {
: if ( !attack && pos == "leftface" ) { attack = window.setInterval('attack_left()', 75);}
: else if ( !attack && pos == "rightface" ) { attack = window.setInterval('attack_right()', 75);}
: }
: }
:
: document.onkeypress = move;
The trick I found was to set the interval variables to null and then
only allow it to engage the function if they were. And then at the
end of each function it would reset the interval back to null so it
could engage again. Essentially the earlier way I had it was just
running dozens of the same interval every time the key was pressed.
>The onkeydown starts the process of movement regulated by your internal
>timer.
>
>The onkeyup stops the process of the movement and clears the timer.
Hrmmm...timers...I'll try that later, see if it works any better than
my current methodology.
>As the PC/Mac keyboard approach sucks from the very beginning, it's
>impossible to reach a "PC Game" functionality w/o your own keyboard
>driver (so say you could hold a key to keep moving forward and press
>other keys to shoot/kick the enemies).
I find it works better if I alter my keyboards repeat delay settings
to the shortest setting. The major problem with my current ver is
that if a key is held down and you push another key once, then
everything just stops, so like you said, only one button at a time
essentially.
>But a primitive movement is fairly simple:
<snip>
Will using onkeydown eliminate the prior problem I mentioned, or does
it function just like onkeypress?
And if it works no differently what about combining the two? For
example what if I used onkeydown for the movement, but then in the
move function could I include an onkeypress function that would handle
the sword movement. Or do the functions onkeydown and onkeypress
cancel one another out (or rather, take the place of one another)?
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
[Back to original message]
|