« first day (922 days earlier)      last day (4025 days later) » 

12:19 AM
refugium up and running with the shreds of macroalgea I have left
 
made up words
 
new phone doesn't have pics of what the macro used to look like :/
was this type, but nice big perfectly round guy
these are mexican turbo snails
they are great for eating algae in tanks.... unfortunately.. they took a liking to that specific macroalgae
^ this is what is left after they ate it all in like a week :/
i'm going to leave it in the refugium for a few months and see if it grows back
next time on rlemon fish talk: my fat ass guppie still hasn't given birth. what gives?
 
12:41 AM
Perl is written in base64
 
Silly XKCD, using same id's multiple times.
 
1:07 AM
@potatosalad Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@rlemon I once helped a buddy do some house repair after his salt water tank busted and went all over the flooring.. Talk about a mess, it was a big ass tank
 
 
1 hour later…
2:15 AM
Hi
Can i access to all variables in a scope? like window.onload scope?
 
No
 
@BigPoppa Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
3:10 AM
0
Q: Can someone please tell me what these ad codes are for?

chrisWhat do they do etc? I've been getting some odd redirects on a website and was wondering if these had anything to do with it? Would these codes do anything that I would notice or something in the background? SCRIPT TYPE="text/javascript" SRC="http://ad.adserverplus.com/st?ad_type=pop&ad_size=0x0&...

 
 
2 hours later…
4:49 AM
Cute typo:
> You might want to change 'Fail' to 'Fall'
 
Hello there !!
I need help working with arrays... :)
 
@JanDvorak good morning
 
@Darkyen o/
 
@Darkyen morning
 
@LittleChild sure, ask
 
4:54 AM
Uhm.. I have an array of string which contains all the winning patters for a game of tic-tac-toe
`var winningPatterns = ["123","159","147",
"258","357","369",
"456","789"];`
Now, to be able to check if the user has made any of that pattern, in any order, I need to be able to extract each character from the elements of winningPatterns
How do I do that ?
splice is an option but it modifies the array
@JanDvorak what other option do I have ?
 
something like for(var i=0; i<9; i++){var pattern = winningPatterns[i]; for(var j=0; j<3; j++){var letter = pattern[i]; ... ?
 
see, consider pattern 258
I must be able to extract 2, and 5 and 8
 
You can index into string using square brackets
alternatively, if you're worried about compatibility, use charAt
 
I will resort to charAt because that is what I am used to in Java
I am new to javascript
Thank you so much :)
 
Could someone look at my answer and tell me how it could be improved?
 
5:02 AM
@Jack: "This is wrong; the variable is part of the closure scope whether you use it or not"
V8 optimizes it
 
@zerkms Yes, v8 does.
 
So - that's wrong
 
Yes and no .. I suppose I could be more accurate.
 
More importantly, oldIE doesn't
More exactly, jScript doesn't
 
Rephrasing that part now :)
@JanDvorak You mention IE only, but in terms of garbage collection, both IE and Mozilla use the same kind ... is there reason to believe Mozilla is still better with this?
 
5:10 AM
You could test
but firefox isn't version-locked, so...
 
Not sure how to test memory leaks ...
 
do that million times and check process memory?
 
create one and see if the browser crashes
or thrashes
 
Softened the first paragraph; I'll check on Mozilla as well, but that will have to wait until I have some time to waste ;-)
 
5:28 AM
lol
 
user2157210
6:20 AM
mornin
 
6:40 AM
Yo room am i really a vry bad dveloper ? Please ping and respond
 
0
Q: Repetitive Drawing in Javascript & Canvas

Shawn StricklandCreating an HTML5 page using canvas and javascript to draw a set number of musical staves on the page, spaced a pre-determined amount in between. What I have is re-drawn on top of the canvas 10 times, and what I really need is something that's spaced out apart every time the loop is drawn. I tr...

 
user2157210
@Darkyen yes
 
6:53 AM
Goooood Morning.
 
moroning
hey how do i fire when footer appears in page scrolling down?
 
Good morning
 
Java and JavaScript are similar like and Script are similar
 
7:10 AM
SO chatBot needs a coffee
 
7:45 AM
how to remove the class from the parent of currenttarget
 
yay
I have 2k on programmers.se
@AvinashGarg currentTarget.parentNode.classList.remove('');
 
@AvinashGarg 1) fetch currenttarget; 2) fetch its parent; 3) remove one of its classes; which one do you need help with?
 
8:14 AM
@gfcarv Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
do you guys know of some "lib" that undoes everything prototypejs does on basic elements and arrays and such?
 
8:24 AM
@FlorianMargaine dunno sounds a lil like underscore "_.js"
is that what you are looking for ?
 
then i dunno, make your own if doesnt exists :-)
 
prototypejs adds a lot of crap on built-in objects
they get out when you for..in on objects, and gives a lot of drupal bugs
 
@mikedidthis Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
so I think there must be someone who already did this: revert everything prototypejs added
0
Q: PrototypeJS: Is it possible to remove or undo its global modifications?

AndrewIs it possible to kill all non-original extensions from prototype, such as array.each, array.map, function.bind, etc? This question states that there is no version of noConflict, but I'm not looking to reclaim the $. I want to remove everything that prototype did to the host objects.

fu @ThiefMaster
I don't like your answer
 
8:29 AM
Prototype is crap anyway
 
I know
but we have to include it in an ESI block, not our choice
and it fucks up everything in our site
 
@FlorianMargaine for(i in Object.prototype) delete Object.prototype[i]
then hunt down the bugs you cause in Prototype
 
@ThiefMaster Prototype.js is crap
 
@FlorianMargaine @ThiefMaster Of course it's possible... Run prototypejs in another context and pass messages...
 
iframes are inconvenient due to other reasons
 
8:37 AM
Like, run prototypejs and prototypejs code in an iframe, and postMessage
That would work
 
the block is really integrated in the website, iframes would be really inconvenient
 
What does the block do?
 
Please help
Can anyone Please tell me how to bound bump with in 2 meters.

Actually my bump works even when two users are not near to each other.
 
Doesn't prototypejs add stuff on built in objects' prototype meaning a hasOwnProperty check should take care of the for... in ?
@Avin WAT? Why are you telling us your bump works?
 
@benja For
@BenjaminGruenbaum bump is an api for transfering api over network and i am using that
but thing is i am not getting any way to bound it location
 
8:43 AM
@FlorianMargaine Also possible, call prototype in an anonymous function area, pass it decorated a decorated version of all the globals (Like, a decorator over Object, NodeList, Element etc), that seems like a lot harder than running a different context
 
that actually sounds like a great idea
@BenjaminGruenbaum yeah, but drupal has tons of bad code
 
@FlorianMargaine Solution: Don't use it?
 
Array[x] .something = "something";
does that create a object with something as a parameter at array[x] ?
 
@BenjaminGruenbaum as if I had a choice :P
 
@FlorianMargaine I'd probably run chrome with experimental JS support, add a Proxy over all global objects (Objects in window) and monitor which objects were changed. Then pass those
@OliverSchöning No, that adds something to the Array native constructor method
 
8:45 AM
@BenjaminGruenbaum what?
@BenjaminGruenbaum yeah I'll see
 
But I can acess the value at array[x] then I guess?
 
:(
 
@FlorianMargaine Array[3] = "something" doesn't create an object, it adds a property to the Array object (Which also happens to be a function acting as a constructor)
@Avin Not many mobile developers here, try the iOS or android rooms
@Avin also, your question is still not very clear at all
 
hmmm thanks buddy
 
oh yeah
my bad :>
 
8:47 AM
ok
 
@OliverSchöning Array is a special object in JS, array is not
 
@OliverSchöning you will be able to access it later, but I really suggest against adding properties to Array or Object, more over, I'm also against using globals
I should start code with Object.seal and Object.freeze on globals :)
> Freezes an object: that is, prevents new properties from being added to it; prevents existing properties from being removed; and prevents existing properties, or their enumerability, configurability, or writability, from being changed. In essence the object is made effectively immutable. The method returns the object being frozen.
That's stupid though, what I'd like is for it to throw an exception if I try to modify the object
Wait, wtf, apparently it does throw an exception in strict mode ^_^
!!> var a = {b:3}; Object.freeze(a); a.g = 15; a.g
 
@BenjaminGruenbaum "undefined"
 
user2157210
could write your own exceptions
 
Nope, no TypeError
@Nexxpresso How? The only way to get that to work isn't implemented in most browsers yet
 
user2157210
8:51 AM
hm
 
user2157210
how is a good question let me think about that
 
(hint: it's impossible to detect arbitrary property access in JavaScript without Harmony Proxies)
 
user2157210
so you cant hook into that :(
 
You can, just not in production code, I do that when debugging code a lot (Proxies) it's really really useful
JS should have debug mode (like a lot of other languages) which exposes a lot stronger form of reflection to you
 
@rlemon "next time on rlemon fish talk: my fat ass guppie still hasn't given birth. what gives?" ahahaa
 
9:04 AM
If you need your IDE's code generation tool, then your language is too verbose
 
Does anyone know why using .val() on form fields might break the form?
 
It should not modify anything unless you pass an argument...
 
@BillyMathews Create a fiddle
 
dudess, can someone help me to choose the right answer here stackoverflow.com/questions/16189735/… ?
they all seems good to me, don't know which could be better
 
@okok What does jQuery have to do with the question?
Thanks
 
9:08 AM
@BenjaminGruenbaum my old mistake, i edited a lot of times cause of bad english
it seems to me that Vadim explains all deeply
nope?
 
@okok Probably, both of the answers are good but not great
 
@BenjaminGruenbaum yep, don't know if to wait for other answers or to accept one of these :P
i think no one will answer in the meantime
 
You won't likely be getting more answers, both answers are good
 
yep, but i don't know who to accept :(
 
Not to mention setTimeout is not a JavaScript method but a browser method (Or a Timers method in node.js)
 
9:11 AM
ok i go for Vadim which seems explainingmore clearly
@BenjaminGruenbaum thanks
 
@okok read the second link, it contains the actual algorithm timers go through (part that srarts with "The setTimeout() method must run the following steps:" )
 
@BenjaminGruenbaum jsfiddle.net/8GL2m
the form works untill you click ship to a different address
 
@BenjaminGruenbaum yep thanks i'm reading ;)
 
anywhere wheere it uses .val
breaks it
camography.org/checkout <- this page..
 
@BillyMathews you know, you have access to form fields when selecting the Form element, right?
Also using Array( ... ) is silly, just use [ ... ]
 
9:16 AM
@BenjaminGruenbaum I don't understand, please educate me.. :s
 
new Array(1,2,3,4,5) // 2 legs bad
[1,2,3,4,5] // 4 legs good
//Also why are you checking this
$('.wpsc_checkout_table.table-2').css('display') == 'none'
 
What's the difference between defining an array and using [ ... ]?
 
$('.wpsc_checkout_table.table-2').is(':hidden') //better
//keeping a variable for state, probably even better
No difference, one is literal notation, one is constructor
Wait a minute... why the heck do you have a table there?
 
Ok, and how do I have access to the form fields when selecting the form element?
I didnt understand that bit
and it's not my code
 
!!/tell BillyMathews mdn HTMLFormElement
 
But if you fill out this form it works fine untill you show/hide the second table (I traced it down to definitely being .val())
 
Chances are, you have duplicate field names in the same form, or something like that, I've got to go to a work meeting, sorry
The fiddle looks short enough to ask as a question in SO though
 
No worries, thanks anyway
 
Hey guys, can anyone help me with this? pastie.org/private/0c8ixfzezawspaemonw7w
basically, in S.prototype.slideNext(e), I want to access the instance's panel
 
0
Q: Does element.childNodes[] behave as a link list in javascript?

Romantic ElectronI have an element object and it has some children appended to it via the appendChild(Node) method,I know I can access them with element.childNodes[index].Now if I remove some element from it by selecting them by their id will the element at index i+1 be at index i if I removed the one at index i...

 
9:31 AM
@JezenThomas this.panel?
 
@JanDvorak if I do console.log(this.panel) in S.prototype.slideNext(e), I get 'undefined'
 
o/
 
@JezenThomas how is slideNext called?
 
at the end of S.prototype.build(), I'm attaching a click handler with S.prototype.addEvent(obj, type, fn)
S.prototype.addEvent(slider.next, 'click', function(e) {S.prototype.slideNext(e)});
I thought the first parameter should be the object property
as opposed to doing S.prototype.addEvent(next, 'click',...
 
When you do this, the context of slideNext will be S.prototype
 
9:37 AM
Waiting for some one to call me stupid
 
@JanDvorak do you know how I should change it?
 
ahh.. I think I figured it out
with your help, Jan Dvorak
 
@JezenThomas do share, I couldn't work it out.
 
somebody plz say sumthing abt my question
 
9:44 AM
@rom
 
yesh @mikedidthis
 
@mikedidthis I think when I do S.prototype.slideNext(e), I'm adding the slideNext(e) function to each instance of the S class. So when I attach the click handler, I should actually do S.prototype.addEvent(slider.next, 'click', function(e) {slider.slideNext(e)});
 
@JezenThomas Thanks. Handy to know.
@RomanticElectron Personally I would create the array again once I have removed the elements I don't need by id. I think you may have issues with the index other wise.
 
hey any CSSer here?
 
Is view.jquerymobile.com/1.3.1/dist/demos down or is it just punishing me with a 404 for trying to see what it looks like with JavaScript disabled...
 
9:55 AM
and i need to add another background image: background-image: url('../img/rays-home.png') no-repeat center -80px ;
and i don't know where the f put it :P
 
It is best to use for jQuery custom events?

$(document).bind('customEvent');

or

var Events = {}; $(Events).bind('customEvent');
 
Wow.
@okok Have you looked at how CSS3 multiple background images are structured? It's just a comma.
 

« first day (922 days earlier)      last day (4025 days later) »