« first day (901 days earlier)      last day (4039 days later) » 

12:00 AM
@XCritics Uh, just use Express, seriously.
 
@XCritics, dude I told you how yesterday
I don't think you understand even the concept of what you want to do, so you're probably just better off using express.
 
12:14 AM
Hello I have a noob question.
 
0
Q: What's involved in making a wordsearch game?

moomoochooQUESTION What's involved in making a wordsearch game? I know that there is a lot involved in making a wordsearch game so the purpose of this question is to break it down into manageable, researchable components that I can research on my own. I'm particularly interested in how to select and veri...

 
@Noah Have you read the rules: rules.javascriptroom.com
 
The javascript code such as that found here: jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/…
Where do I put this code?
Inside <script> tags?
 
user2157210
this is not noob question
 
posted on April 04, 2013 by Peter Beverloo

There have been some interesting movements in the browser landscape lately: Opera moving away from Presto, Chromium for Android and Firefox Mobile making a stronger stand on mobile platforms. Web Platform has less fragmentation right now than it ever had before. Today, the Chromium project introduced Blink: an new open source rendering engine based on [...]

 
12:22 AM
any ideas?
 
that is definitely a noob question...
yes you put it in a script tag
and you need to include jquery too
 
so including the modules that they have is not enough?
 
you've got that code running in the jquery domready handler, you need jquery for that to work
it's also using jquery for other things it seems
 
can you explain the syntax $(function () { } );
 
12:27 AM
it doesnt look like a normal javascript function that can be called from a button for instance
 
wat
 
ok so it seems this is jQuery specific. I'll read more up on it.
 
It's not just jQuery specific. It is jQuery.
$ is jQuery
!!> $ === jQuery
 
@phenomnomnominal Ok I shall try it out!
 
!!hello?
 
12:30 AM
oh i didn't know that, ok
 
user2157210
@david holy shit why do you even answer on this crap
 
user2157210
he can learn it by himself in like 10 minutes
 
How do you do crossed out text in Markdown?
 
like this
Three dashes
Or maybe <del></del>
Which is HTML
 
12:37 AM
---this---
 
that
i try to help people if i think they can be helped
sometimes that works out well
sometimes i abandon helping them halfway through
if they're lucky i will say something like 'wat' to signal the change
 
room topic changed to JavaScript: All about ECMAscript and its various libraries. Please read the rules: rules.javascriptroom.com [ecmascript-5] [javascript] [the-game] [this]
 
if they're unlucky, i will smoothly flow from constructive assistance into trolling, and they won't know what's happening
 
12:56 AM
Arg, lost a book.
I hate it when I do this
 
lost... a book?
like a whole real book?
 
Yeah. Think I left it at the gym, but they can't find it
 
thats how I lost my mp3 player two days ago
grrr
damn thiefs !!!!!!!!!
 
1:27 AM
check it
protip: name requires you hit the button, input takes [enter] only
 
Didn't work
 
1:49 AM
works for me
 
And me. Need to hit enter though. The button doesn't work
 
Still not working for me
 
what browser?
yea the button isn't hooked up
for the chat that is
 
2:11 AM
Say uuuhm. I'm making my first very basic game. I have a variable that gives the angle in degrees towards which the player is moving. This variable is then converted to radians to calculate the X and Y parameters of the movement. Is there a value I can attribute to the angle to signify "not moving", or does the nature of the angle force me to create a variable just for that that I'll set to true on KeyDown and to false on KeyUp (with conditions etc.)?
 
I usually use a velocity variable and multiply the components by that
so your x direction would be Math.cos(player.angleInRadians) * player.velocity
set the velocity to 0 and your player stops moving
but keeps its direction
 
Oh, okay. That sounds smart. Thanks.
 
2:31 AM
@rlemon Chrome on Windows.
Only thing I can see is that myName isn't set?
 
are you wolo
wololo *
 
i am wololo
and france
 
nope, I was sadfasdf and phenomnom
 
2:33 AM
strange
chrome windows for me too
works on my gf pc as well
 
Didn't work on iOS either, might be my connection at work, though I can't think why we'd be blocking WebSockets?
 
return playerMoving*speed*Math.sin(angleRad);
If playerMoving equals 0, is there a possibility the above will give something other than zero? (Like 0.000000124 because of some calculation error)
 
0 * anything is 0
 
I know, but sometimes 1+1=2.00000000014, so that's what I'm worried about.
 
Yes, but with 0, it's safe
 
2:47 AM
Great. Thanks. Wouldn't want my player slowly shifting around randomly when immobile.
					if(Math.round(playerMovX)==0) {
						playerMoving=0;
					}
					else if(Math.round(playerMovX)>0) {
						playerMovAngle=90;
					}
					else if(Math.round(playerMovX)<0) {
						playerMovAngle=270;
					}
In this, I'm not sure but let me check: Rounding the two else if's is irrelevant, right?
 
only if playerMovX is an integer
 
hello friends
 
I mean.
 
If playerMovX is 0.45, playerMoving will be 0
 
Just met a guy who's telling me about this new company he's a part of
 
2:51 AM
If it rounded does NOT equal zero, then necessarily, there's no risk about taking the raw values for the two other checks. Is my logic okay?
 
"What do you do?"
"We're a geek news site. I just applied a WP template and messed around a bit"
 
Also, rounding to the unit is a bit TOO round. How can I round to, say, the closest hundredth?
 
You could do +number.toFixed()
 
+?
Also, does toFixed round or truncate?
 
Rounded
toFixed returns a string, so the + casts it back to a number
 
2:54 AM
Okay. And why PLUS number.toFixed()?
 
Hmm, but that will remove the decimals...
 
He's going places.
 
number.toFixed(2).toFloat()?
 
@SomeKittens, sounds, like it, you should ask for a job :P
toFloat isn't a thing
 
@phenomnomnominal Oh yes, this sounds like the ideal place to work!
 
2:56 AM
Lucky, I wish I had such an opportunity
 
toFloat isn't a thing?
 
parseFloat()
 
Aaaah.
 
you pass it a string, it's not a method
 
Sheesh, the JS course is far behind me if I forgot it.
 
3:01 AM
hm. Can someone tell me why this code isn't executing?
 
Prolly not.
 
!!> +010;
 
Try calling webGLStart manually
 
@phen Waaaaait. if(thing.toFixed(2)==0) is the very same as if(parseFloat(thing.toFixed(2)==0)), right? I mean, 0 == "0", right?
 
3:05 AM
@Crowz where is initGL defined??
 
@phenomnomnominal it's not.
 
then that's why it wont run
 
@Ariane why are you doing all this crazy toFixed stuff? can't you just say if (playerMovX > -0.5 && playerMovX < 0.5)?
 
@Ariane, yeah you should be doing that
 
okay, now I seem to be getting a javascript warning.
 
3:06 AM
@david perfectionism or something?
 
@Crowz, you haven't got initGL or initShaders defined?
You're never getting the webgl context from the canvas.
I'm going to assume you're doing the LearningWebGL tutorials?
 
@phenomnomnominal yeah pretty much. I'm somewhat familiar with OpenGL and WebGL sounds awesome
 
You need the shaders still
 
Commented out
 
Yes, but you actually need them?
 
3:10 AM
Oh I tried copying and pasting his code and it still didn't work
 
lol
 
Big surprise
 
^
 
					if(playerMovX<0.05 && playerMovY>-0.05) {
						playerMoving=0;
					}
					else if(playerMovY>0) {
						playerMovAngle=180;
					}
					else if(playerMovY<0) {
						playerMovAngle=0;
					}
This is good, right?
 
I mean as in deleted what I did and copied and pasted everything
 
3:13 AM
looks alright, the real question is, will it blend does it run?
 
I just want to get it to show something
 
rolls eyes
2 mins ago, by phenomnomnominal
Big surprise
 
@Crowz are there errors?
 
:8652468
if (!gl) {
	alert("Could not initialise WebGL, sorry :-(");
}
Definitely going wrong there
 
What browser are you using...
 
3:15 AM
I take it the silence regarding my case means it IS good?
 
google chrome
 
What OS
 
Windows 7 64 bit
 
And that alert is firing?
 
I'm running it from notepad++, could that be a problem?
Yeah the alert goes off
 
3:16 AM
What do you mean running it from?
As in not in the browser?
 
as in "launch in chrome"
Well this is interesting...
 
If it's running in chrome it should be fine
 
"Hmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card."
 
Well that's why it isn't working then.
 
posted on April 04, 2013 by schulzedirk

Using clipping and masking from CSS.

 
3:30 AM
seems to work now, in some ways
 
Saaaay. In Actionscript (though I'm hoping/thinking JS would be the same) is it normal for a Key Down event to keep firing repeatedly when a key is held?
 
Yes, in Actionscript that happens
 
Do you know how to remedy to that?
 
keypress ?
 
3:37 AM
Key press would be press then release right?
 
Key press is pressing a key, you have keyUp too
my AS is rusty though, I'm sure this was askes in SO before
 
I'll look around
......Whilst the MOUSE_DOWN event works fine, the KEY_DOWN just has to repeat endlessly. So I need to set a variable per key. What a pain.
 
If you've got access to jQuery in the project, couldn't you just use the $.once() method?
 
Those both sound like awful ideas.
 
@monners I'm doing ActionScript. There's no Javascript and even less Jquery. :p
@phen Save me then. D:
 
3:49 AM
@Ariane, what is the actual root problem you are trying to solve?
 
My KEY_DOWN event fires continuously, repeatedly, when a key is held down, but I need it to work like MOUSE_DOWN: be fired when the key is pressed down, and that's it.
And I just realized a variable per key would do nothing.
 
@phenomnomnominal I fixed my problem with stylesheets btw, wanna know how easy it was :D?
 
@Ariane Just change a boolean when the key changes.
@XCritics, I know how easy it was, show me anyways
 
@phenomnomnominal

link(rel='text/css' href='asd.css')
to
link(rel='stylesheet' href='asd.css')

:D
 
@phen It's directional keys to move a character, and I've used a switch to determine the key.. I don't think this can work at all.
		private function keyboardKeyDown(event:KeyboardEvent) {
			switch(event.keyCode) {
				case 65: //A
				case 37: //Left
					playerMoving=1;

					if(playerMovX<0.05 && playerMovY>-0.05) {
						playerMovAngle=270;
					}
					else if(playerMovY>0) {
						playerMovAngle=225;
					}
					else if(playerMovY<0) {
						playerMovAngle=315;
					}
					break;

				case 87: //W
				case 38: //Up
					playerMoving=1;

					if(playerMovX<0.05 && playerMovX>-0.05) {
						playerMovAngle=0;
					}
					else if(playerMovX>0) {
Gosh, didn't expect such length
 
3:52 AM
@XCritics, you still haven't solved your actual issue
 
@phenomnomnominal but.. but.. The css now works on the page!
 
What about JS
Or an Image
 
nice, meta programming (similar to AOP) is awesome you can add functions in runtime =D
 
i'm not sure, let me try them both
 
So you don't need to declare whole bunch of functions into memory in the beginning
 
3:53 AM
@Ariane, just make it so it only does stuff if the keyCode changes
 
It's also pretty similar in functional programming I guess, you can expand behaviour of a function during runtime =P cool cool
 
@phen but if the player is moving diagonally, the function will be firing repeatedly in alternance for each key, which brings back the issue.
 
@TemporaryNickName i think it's only in some functional languages
@Ariane add or subtract velocity on keyDown
 
@Ariane, maintain a map of the keys that are pressed then
 
eg: if key is left velocity.x -= 1; if key is up velocity.y -= 1;
same on keyUp, undo what you did in keyDown
 
3:56 AM
@andho What? Velocity? It's a fixed value.
 
Language I am learning at school is amazing
 
@phen A map? Wha?
 
@Ariane it's 0, 1 or -1 for each x or y
 
in order to expand a function's behavior, all you need to do it function += something
 
@TemporaryNickName which one
@TemporaryNickName nifty
 
3:57 AM
it's designed by my lecturer so no one here will recognise it =(
 
@Ariane, keysPressed = [89, 88, 67]
@Ariane, although I'm sure there must be another event you can listen for?
 
@and We must be misunderstanding each other. I have three variables that define movement. Angle, speed and Moving.
@phen I'll look again.
 
@Ariane oh like a car then, okay maybe not
 
@phen When I type KeyboardEvent. and wait for the code indicator to appear, I only have KEY_DOWN and KEY_UP that appear.
 
@phenomnomnominal I guess I taught myself how to handle the requests, cause now I have javascript working
 
4:00 AM
This is so messed up.
 
does all (directional) keys change these variables?
 
Who needs express when you got balls of steeeeeeeelll (gotta say it like duke nukem)
 
let the keyUp and keyDown set some value. Let something else interpret these values for movement @Ariane
 
@andho Oh but that's what Ido
But it's still incredibly messed up to have code run again and again and again uselessly.
 
@phenomnomnominal github.com/Gacnt/Node-Tests check out the requestHandler / app.js
 
4:03 AM
@XCritics, yeah so you had to do what I told you
But they're hardly generic
 
@phenomnomnominal I guess so, I didn't really realize I was doing just that, but, I guess I did :D
 
Anyway, I'll leave this problem aside for now since it's just bad for performance and probably not bugging the code.
 
What do you mean?
 
@Ariane the only code that runs again and again should be the one that does the movement. Others should occur on key events
 
@Ariane What I'm telling you is that the key event itself runs again and again by its own accord.
 
4:04 AM
The way you're doing it, you'll have to add a new function for every single JS or CSS file.
 
@phenomnomnominal Yeah I came to that realization very swiftly
 
So you need to generalise them
Take the request path
 
Anyway let's drop it for now, there's a more important issue
 
Find the extension
If its a static type, set the content type, then read the file and send it back
 
what do you guys use for automated dom tests? I understand jsdom or cheerio can do it. But if i want to test events I have to go with zombie.js.
 
4:09 AM
Oh gosh. My movement is so messed up. My character never stops moving once I start it and it doesn't go in the right direction at all. Gotta revise my angles and stuff. Gotta be a mistake. :p
Aaargh, I don't know how to debug it at all. Does someone volunteer to help me out?
 
I would, but I'm allergic to actionscript
 
:c
 
Would I be right in assuming you're trying to program a Flash game?
 
Yes.
 
@Ariane i could look at your code and suggest a refactoring
but nothing more
 
4:15 AM
Suggest a refactoring?
 
@Ariane i'll tell you if there is a better way you can structure your code
 
There's not point in refactoring if tests are failing
 
Not quite what I'm looking for right now. Won,t teach me why it's not working right at the moment...
Okay, a test to see if I'm not too dumb
		private function keyboardKeyUp(event:KeyboardEvent) {
			var playerMovAngle:uint=0;

			switch(event.keyCode) {
				case 68: //D
				case 39: //Right
				case 65: //A
				case 37: //Left
					if(playerMovY<0.05 && playerMovY>-0.05) {
						playerMoving=0;
					}
					else if(playerMovY>0) {
						playerMovAngle=180;
					}
					else if(playerMovY<0) {
						playerMovAngle=0;
					}
					break;

				case 83: //S
				case 40: //Down
				case 87: //W
				case 38: //Up
					if(playerMovX<0.05 && playerMovX>-0.05) {
 
Does flash only accept AS as input?
 
is there something that does not make sense in this function
No idea, but probably.
 
4:18 AM
nothing makes sense in this function :P
@Ariane it helps to look at your code in the right perspective
 
It's presence in a JS chat room makes even less sense
 
@Ariane nobody knows the logic behind this code
 
@monners that bit of code I have just poster I'm quite sure it's totally valid in JS too.
 
> All about ECMAscript
 
@monners read the room topic
 
4:19 AM
@Ariane, not quite - event:
 
ALMOST then.
 
Well, I stand corrected
 
Very close
 
@andho playerMovY and X are the player's current movement speed on these respective axes. playerMovAngle is the current angle of the movement, clockwise and 0 being north. playerMoving answers the question "Is the player currently in movement?"/"Should the player move?"
 
so if the player is moving too slow, and the player presses left, the character should stop
 
4:22 AM
This is a key UP function
 
if the character is stationary, the pressing left will turn the player 180 degrees
 
No no
If the character is currently not moving on the Y axis, then releasing the Left key will make the character stop.
 
oh yeah it's >0
so if the player is moving down then he should turn 180 degrees
 
>0 is towards the bottom I believe. Point 0,0 is always top left.
So if the player was moving downwards when you released the Left key, then its angle becomes 180°, which is south.
So, I'm not crazy, this makes sense?
 
yes you are crazy, this code doesn't reveal intent
 
4:26 AM
Intent?
I don't get you at all.
 
@Darkyen, someones been asleep all day
:P
 
Look, @andho I'll accept your offer on making suggestions on my code. I just can't find the error and no one else seems to be intent on helping.
 
@Darkyen - Another prefix?!?!
 
@monners nah
like mozilla no prefixes
but thats now dunno what will happen in 5 months
@phenomnomnominal dude i just woke up
 
4:31 AM
@andho actually never mind. I had a flash. What if I messed up and inverted sin and cos for X and Y? Boom, code fixed.
 
@Darkyen Oh, sweet
 
@monners PS am damn sure google by doing so is doing nothing but stopping there code going back to webkit
 
Working perfect except that for some reason up and down are reversed. Gotta look into this.
 
which is pretty good business
 
I never looked this kind of html
-1
Q: Rich texteditor unable to provide color for text in IE-8 IE-9

vuduongI'm have the question : i'm use rich text editor <input style="width: 119px;" class="color {hash:true}" value="000000" onChange="fontEdit('foreColor','#'+this.color)" /> txtboxload(); //var text_ed=[:text_ed:]; var ifrm = document.getElementById('textEditor'); ifrm ...

 
4:32 AM
but sad open source step
 
@Darkyen Anything that decreases MS' browser market share is fine by me
 
gives google flexibility though
 
@Darkyen, did you even read any articles?
It has nothing to do with that
 
@monners MS IE 10 is a decent browser
@phenomnomnominal Dude shut the fuck up
2
 
No, you're being a disphit.
2
 
4:34 AM
stop being brain dumb
i read all of them
even the google faq
@phenomnomnominal you are being brainwashed
 
if u kill somebody
 
Ah well. It's more or less working. I'll ask the teacher tomorrow about why north and south are reversed.
 
will u say it in public hey hooe i killed him !
 
And I have just the right timing, because the atmosphere is becoming pretty awful.
 
4:35 AM
in realistic cases NO :P
 
Bye-bye~ (and thanks)
 
It has nothing to do with that...
 
bleh
 
@phenomnomnominal prepare to be fucking proud of me and want to pay me lots of moneys
 
@XCritics, no.
 
4:36 AM
bye @Ariane :D
don't mind those two
 
i don't like what happened end of story
 
@phenomnomnominal https://github.com/Gacnt/Node-Tests/blob/master/server.js

It now works for any css and js, and as I need more, I'll add more to the switch, but it works great!
 
That's fine, doesn't mean you're damn sure of what you said.
@XCritics, looks good
 
Thanks :D
Are switches costly? Is there something else I might want to use other than a switch?
 
That's pretty much the perfect usecase for a switch
 
4:38 AM
I'm so proud of myself right now :D
 
Your other option would be to have an object with functions for the keys
var staticHandlers = { css: function () { blah(); }, js: function () { blahJS(); }}
and then just do staticHandlers[ext]()
 
I read something like that in the good parts, I'll have to go back and re-read that part
 
Oh
hi
 
oh shit it's raynos
 
@Raynos hello :D
 
4:41 AM
NO U
@david ^
I just come in here to self promote, that's all. ( github.com/Raynos/continuable )
 
@Raynos Hmm
looks complicated
 
Looks cool!
 
it is cool though :P
just complicated
 
does anybody know if it is possible to initiate a chat room with a question's author or send a message?
 
if( the_thing_you_do === "coding by yourself") "Everything is possible"
else "Vampires will be prosecuted"
@agilevic PS if you want to do it in SO chat yes
if you wanna do it with code for your own service you need sessions or generating page on the fly
 
4:48 AM
@Darkyen it's not really complicated at all, compared to promises anyway
 
yeah, in SO. say you are reading a question and want to contact the author privately instead of through comments
 
@Raynos true its just the first sight of it confused me
 
@phenomnomnominal So say I have a JS file with a million lines of text, and it passes through that handleStaticPages function I have, is it still asynchronous because the fs.readfile is async and reads the file then returns when it is ready, or does it being inside the handleStaticPages function make it blocking?
 
@XCritics MILLION LINES OF JS ?
show it to florian :D
i think in a million line of js we can implement linux kernel .. no ? jk
 
I may have exaggerated a bit :D
 
4:56 AM
a byte :P
show the code bro :D
PS whatever you write in JavaScript in node is blocking
whatever is a native calls is non-blocking
 
github.com/Gacnt/Node-Tests/blob/master/server.js @Darkyen look at the handleStaticPages function I made, then read the question I asked phenom
 
should be fine
 
Ok cool
 
5:14 AM
Hi
Can anyone help me with javascript and html5 and ipad question?
 
what questions do you have?
 
@SomeKittens You kickin around?
 
@rlemon, @zirak, @octavian, how dare that dumb bitch say Annie has a moustache!
 
5:29 AM
Question for the public, how might I make a header template in Jade, so I can then include it in another file and just write body content instead of having to write out the html metas, navbar, so on so forth
 
> "xml is like violence, if it doesn't work, use more"
 
@phenomnomnominal Once again, tyvm
All I could see in the jade docs was extend and blocks I thought that was it
 
6:38 AM
BotWat++
 
LOL
@Loktar when you are there ping me this is very very important #life_threatining
 

« first day (901 days earlier)      last day (4039 days later) »