« first day (247 days earlier)      last day (4702 days later) » 

9:01 PM
@ChrisMarisic Want a side bet that > 75% of the people on the chat.SO I trust will pass it.
 
@ChrisMarisic SOLID?
 
user1385191
I look forward to a day when I interview someone about JS
 
@Raynos and who do you trust? like 5 people?
 
@MattMcDonald oh me me me
@ThomasShields myself.
 
user1385191
9:03 PM
my first question: "what is the DOM and what does it do?"
 
@Raynos lol. nice.
 
@MattMcDonald its that annoying thing I hate. I use jQuery. hi-five!
 
user1385191
then I give them something to code
 
user1385191
if they're competent, I stick with them and ween them off of libraries
 
In computer programming, SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Robert C. Martin in the early 2000s which stands for five basic principles of object-oriented programming and design. The principles when applied together intends to make it more likely that a programmer will create a system that is easy to maintain and extend over time. Overview {| class="wikitable" style="width: auto; font-size: 95%; table-layout: fixed; line-height:1.25; margin-left: auto; margin-right: auto;" |...
 
9:04 PM
Guys I'm looking for for some good source code to learn different styles in good JS design: stackoverflow.com/questions/6417146/…
 
@Nathan oh DUH i knew that.
 
@Nathan lol whered that image come from?
 
dunno... I just pasted the wikipedia url.
I guess I am familiar with all those concepts but hadn't heard of the SOLID acronym.
Meh.
 
@MattMcDonald I remember when I was applying for job in J2EE - I've nearly finished it (5 minutes tops)
 
user1385191
I value a good work ethic and willingness to learn over anything else
 
9:07 PM
@MattMcDonald few months later, boss told me it was "designed" as non-solvable :)
 
-1
A: Jquery selector for <link> elements in <head>

Tomalak Geret'kalFrom the documentation of the feature you're using for $(string) (which is the function jQuery( html, [ownerDocument] )): When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, we use the browser's .innerHTML ...

 
WTF is up with all the anonymous, commentless downvotes on perfectly reasonable and well-documented answers today?
 
Read those. Then read backbone/underscore.
@TomalakGeretkal -1 for ranting :D
 
@Raynos Pfft :P
 
9:13 PM
can anyone explain the downvote (or why there would be one): stackoverflow.com/questions/6417466/…
 
@Neal Well, you didn't answer the question.
 
@Neal i think OP wanted to know which of the buttons submitted the form, not which are able to submit it.
so that's actually a very legitimate downvote.
 
and now there is another one
FFS, another tagged title
 
@Raynos keyframesandcode looks like jus a code viewer, or is there some comment a la literate programming that I'm missing?
 
What is with that question -.-
@Hubert I'm saying read the source. Have fun :D
 
user1385191
9:16 PM
wait, so the OP has link element nodes in the head tag and can't find them?
 
@MattMcDonald not in the page DOM. he's got $('<html><head><link /></head></html>') or equivalent, and can't find the link.
 
@Raynos thanks
 
user1385191
oh yuck
 
yes
I'm loathed to suggest a "fix" because I can't think of one that isn't horrid
so I left it at an explanation and a subtle prod to not attempt this sort of nonsense in the first place
that's worth a coward's downvote nowadays, apparently >.<
 
@MattMcDonald why doesnt e.target or e.srcelement work with submit
 
user1385191
9:19 PM
what's the event?
 
submit event
 
user1385191
and your problem is Event.target !== a submit button you clicked?
 
yes
nor is srcelement
 
user1385191
this is the expected behavior, let me grab some documentation on it
 
> The submit event occurs when a form is submitted. This event only applies to the FORM element.
 
9:23 PM
@ThomasShields both submit!
thats the answer lol
 
@Neal headesk
 
@Neal ...
 
what?
 
@Hubert if you want something less vague to learn I can point you to a more useful tutorial
@Hubert I can defiantly recommend The garden
 
@Neal No, it's not. When you submit a form, at most one submit button was responsible for that action occurring.
 
@Neal You're getting confused because there are two buttons, either of which may be that one button. But that's not the question.
 
@TomalakGeretkal yes. but in the example the OP provided both submitted
 
@Neal That's not possible.
 
@TomalakGeretkal it did. did u try it?
im in chrome 12
 
@Neal As I said, only one button can submit a form [at one time].
Isn't this really very obvious?
How do you click on two buttons at once?
 
9:27 PM
@TomalakGeretkal you dont! holf f-- lol either button submits the form
 
user1385191
what you do is listen for an onclick for the submit button
 
Jesus christ man
 
user1385191
because that will fire before on the onsubmit
 
????????
 
@Neal: Either button can submit the form. When the form is submitted, at most one of those buttons was responsible. You cannot click two buttons at the same time. The OP wants to know, on form submission, which of the two buttons was responsible.
I don't see why you're confused here.
 
9:28 PM
@MattMcDonald I dont trust that it has <command> and <menulist> thats not html
@TomalakGeretkal did anyone mention he should use two forms. One submit button per form
 
@Raynos Let's not get carried away. Apparently we're having enough trouble as it is with the basics of the question.
 
@TomalakGeretkal "How to know which button submit the form? and display it in the alert()" That is bad english. i cannot be penalized for reading it the way i did lol
 
user1385191
no need, just use event delegation
 
@Neal Yes, you can. Everybody else understood it.
@Neal That he mentioned alert() immediately gives away that he's after a programmatic, onsubmit solution. It's very clear.
 
@TomalakGeretkal im pretty sure I am included in everybody -- and i did not
 
9:30 PM
@Neal I said "everybody else ". Clearly there is an issue with your English comprehension here.
 
@MattMcDonald you can use event delegation? how
 
@TomalakGeretkal there is none that i know of
 
@Neal None what?
 
im done. gotta work..
 
@Neal :D have fun. Sorry you get picked on.
 
9:31 PM
@Neal I suggest you have a lie down...
 
anyone know why i would get downvoted here...? is there a downvoter jerk doing his rounds? stackoverflow.com/questions/6417543/…
 
@ThomasShields downvote for complaining :D
 
@ThomasShields Starting to think that there might be.
 
@ThomasShields ahhh dont do that! then everone in the chat decides to vote you down for asking a menial question...
...
 
I just wanna know how to improve my answer
 
9:32 PM
<div id="video"> deserves a slap.
 
@ThomasShields so did I, but instead of telling me why, everyone here decided to do a vote down...
 
@Raynos lol. @TomalakGeretkal scary music @Neal lol @Raynos i was just using that as an example
@Anybody else i can ping?
 
@Neal It's like you completely ignored my very thorough explanation of what you did wrong. 4 people didn't downvote you for fun.
 
@ThomasShields <-- you forgot to ping urself
 
user1385191
 
9:33 PM
@Neal oh, right...
 
@TomalakGeretkal as i said. im done
period
 
@ThomasShields @KamilTomšík @Raynos @Neal SOLID design principles: Single responsibility, open-closed, liskov's substitution principle, interface segration, dependency injection
 
no more
kaput
 
@Neal Go take a break. You're not thinking straight!
 
@ChrisMarisic we got that far already ;)
 
9:34 PM
im going to a free play soon w00t hehe
 
@Neal good night neal
 
user1385191
you draw the conclusion that clicking a submit button submits the form
 
@ThomasShields There that's everyone
 
@MattMcDonald :D
 
i saw 100 msgs and my responses, i didnt read through all of the 100
 
9:34 PM
@Raynos lol its not night here
 
@MattMcDonald meh. Why bother with submit buttons if your going to block the submit
 
@ThomasShields lol did it ding when u pinged urself?
 
@ChrisMarisic yes :)
 
just use normal buttons
 
@Neal yes.
 
9:35 PM
so my primary test
is define all of those
 
@Neal @ThomasShields hmmm how did u reply to urself?
 
@Neal inspect the message div/td/whatever and pull the message id
 
after that, its about either show me a violation of this, then explain why it's bad
 
@Nathan showed me, i think
 
or show me a usage of htis, and explain why its good
 
9:36 PM
what is the real utility of writing type="text/javascript" in script tags ?
 
@ChrisMarisic cool
 
@Neal ahhh cool
 
@Oddantfr MIME type. so the browser knows what it is.
 
@Oddantfr theres other kinds of scripts
 
@Oddantfr telling the browser that the tags contain Javascript...?
 
9:36 PM
@Oddantfr for the user (browser)
 
ok
 
@Oddantfr and IE can get finicky when you don't include it; to the point of not even loading it.
 
@Nathan who said that?!?!
 
i think the only one interpreted by the browser is text/vbscript?
only other
 
@ChrisMarisic well you can specify JS version too
 
9:37 PM
@Thomas good point
 
@Nathan haha u ddnt do it
 
@Oddantfr HTML5 spec says you should do it. So you do it.
 
user1385191
with buttons: jsfiddle.net/r6Pfv/1
 
user1385191
try commenting out the onsubmit handler.
 
and therefore writing language="javascript" is the same right ?
 
user1385191
9:38 PM
no
 
guys, you're too much focused on html :)
 
user1385191
the language attribute was used for versioning
 
so what's the function of language attribute ?
ok
 
rofl i forgot that even existed
that was like 1999 web days
 
@ChrisMarisic you mean language ?
 
9:39 PM
supplying the specific version of JS you wanted it to run
 
@MattMcDonald Yes of course <button> submits the form. I meant <input type="button" />
 
<script type="butterfly"></script>
 
@Oddantfr no. Language is deprecated
 
lol ok got it
 
user1385191
ah, you noticed my typo too
 
user1385191
9:40 PM
language: Deprecated. This attribute specifies the scripting language of the contents of this element. Its value is an identifier for the language, but since these identifiers are not standard, this attribute has been deprecated in favor of type.
 
Just do <script type="text/javascript"> ... </script>
@KamilTomšík it's good to use valid HTML5
 
@MattMcDonald I don't doubt on your link but for curiosity what is your source ?
 
according to the IANA, text/javascript is actually obsolete...you're supposed to use application/javascript iana.org/assignments/media-types/text/index.html
 
@Raynos it's good to generate valid html ;)
 
9:41 PM
@Oddantfr prolly from the W3C itself. I can't see @MattMcDonald quoting from anybody else. :)
yep, i was right.
 
user1385191
I pulled it from a SO answer, actually
 
@ThomasShields good point number 2
 
oooh.
@Oddantfr how many good points until i get ice cream?
 
I'm going to take a break from stackoverflow for a bit
 
@Raynos how long is a "bit"?
cuz if you're being literal here, you should be back by now.
 
9:43 PM
Hey all, maybe someone can offer a recommendation on organizing javascript. Basically, I am validating names. There are 8 scenerios but there is a key factor that distinguishes the 8 scenerios. The 8 scenerios would have "&W" as a deliminter, or "&H" as a delimiter or "&" as a delimiter. This is my object:
 
I never understood why people feel the need to advertise when they're "leaving SO"
 
var NameValidator = {

first_middle_last_with_first_middle : function(txt){

var regex = /^\w{1,}\s\w{1}\s\w{1,}\s&W\s\w{1,}\s\w{1}$/;
alert(regex.test(txt));
},

first_middle_last_with_first : function(txt){
var regex = /^\w{1,}\s\w{1}\s\w{1,}\s&W\s\w{1,}$/;
alert(regex.test(txt));
},

first_last_with_first_middle : function(txt){
var regex = /^\w{1,}\s\w{1,}\s&W\s\w{1,}\s\w{1}$/;
alert(regex.test(txt));
},

first_last_with_first : function(txt){
var regex = /^\w{1,}\s\w{1,}\s&W\s\w{1,}$/;
alert(regex.test(txt));
 
if you've had enough, just don't load up the website any more..?!
@JohnMerlino Scenarios.
 
I want to reuse the function names, but have a layer that groups scenerios. Should I do a third layer property or is there something better?
 
CR*()&P
why would mousemove have a major memory leak?
i posted this code a while ago here:

$(function() {
     var $document = $(document);
     $document.mousemove($.proxy(page.change_state, page));
     $document.click($.proxy(page.mouse_click, page));
})
 
user1385191
9:44 PM
uh because it fires hundreds of times a second
 
@ThomasShields well I think you've got it right now that was 2 great news
 
now our client is complaining about memory being eaten up
@MattMcDonald -- so how do we fix it?
 
@Oddantfr awesome. :)
 
lol
 
user1385191
what is your code doing, exactly?
 
9:45 PM
@MattMcDonald youve seen it before:
 
var page = {

    updated: false,

    change_state: function(e)   {
        var self = this;
        if(!this.updated){
            debugConsole.log('Moved mouse');
            setTimeout(function(){
                self.updated = false;
            },
//                10000); //10 seconds
//                120000); //2 minutes
                300000); //5 minutes
            this.updated = true;
            $.ajax({
                url: 'comet/update.php',
                success: function(data){
 
NameValidator.GroupW.first_middle_last_with_first_middle('ROGELIO P DIAZ &W CLUADIA L'); NameValidator.GroupH.first_middle_last_with_first_middle('ROGELIO P DIAZ &H CLUADIA L'); NameValidator.Group&.first_middle_last_with_first_middle('ROGELIO P DIAZ & CLUADIA L');
 
adding lots of listeners and deleting the element after
 
Thats how I would want to call them
 
9:46 PM
plus the client is using IE
right?
 
Is there a way to do namespace or something
 
@JohnMerlino: Perhaps you should post a question properly?
 
user1385191
oh no
 
This is all chrome
 
user1385191
you're calling AJAX onmousemove
 
9:46 PM
getting noisy in here
 
user1385191
dies inside
 
@MattMcDonald only if there was no move in the past 5 minutes
 
@TomalakGeretkal I dont. I feel the need to mention that as a room owner I'm going for a bit. Hence also suggestion that other people pick up the minor amount of moderation involved wiht it
 
this is code u helped create a few weeks ago
 
user1385191
oh ok
 
9:47 PM
@Raynos Ah, ok.
 
@MattMcDonald so why would this be eating memory, or is this not it?
 
user1385191
there's still no need to add a setTimeout onmousemove
 
looks legit
 
@Neal memory leak depends on browser
 
user1385191
oh wait hold on
 
9:48 PM
its only getting fired if its not updated
 
@MattMcDonald theres nothing wrong with ajax on mousemove. I use it for real time mouse movement streaming
 
@Thomas anyway i read that should continue write text/javascript for IE support
 
@Oddantfr you should do it anyway -.-
<script> is not valid
 
so what
google does it
lol
they also dont quote their attributes
 
user1385191
well, let me step through this code
 
user1385191
9:51 PM
when you click, you add a timeout as soon as you move your mouse
 
user1385191
you're not clearing or nulling the timeout anywhere
 
user1385191
so hundreds can pop up
 
user1385191
give Page a property of timer
 
user1385191
set that value to the timeout when you're setting the timeout
 
only if this.updated == false
 
9:53 PM
@MattMcDonald remember this is not the only js on the page. this is just where im looking right now
 
user1385191
do an if block before you set the timeout, clearing the timout if it exists
 
right
 
user1385191
with volatile events like onmousemove, you have to null/clear your variables on each iteration
 
I dont really have a question. I would like to know if anyone things this is a bad design pattern:
var NameValidator = {

GroupW : {

first_middle_last_with_first_middle : function(txt){

var regex = /^\w{1,}\s\w{1}\s\w{1,}\s&W\s\w{1,}\s\w{1}$/;
alert(regex.test(txt));
},

first_middle_last_with_first : function(txt){
var regex = /^\w{1,}\s\w{1}\s\w{1,}\s&W\s\w{1,}$/;
alert(regex.test(txt));
},

first_last_with_first_middle : function(txt){
var regex = /^\w{1,}\s\w{1,}\s&W\s\w{1,}\s\w{1}$/;
alert(regex.test(txt));
},

first_last_with_first : function(txt){
var regex = /^\w{1,}\s\w{1,}\s&W\s\w{1,}$/;
It seems a little repetitive and too simple, just being nested properties
 
How do i find out the memory size of a js object?
 
9:57 PM
"design pattern" :D
it reeks. That code smells. Smells bad
 
@Raynos, I'm glad you can tear it apart. But do you actually want to say why you think it reeks?
 
loves the smell of regex in the morning.
 
@JohnMerlino those static regular expressions feel hideious
they are also feel very similar
 
@Nathan sadist
 
Maybe something like
 
9:59 PM
anyone?
 
have a good night everyone
 
user1385191
 
@Neal i sure don't know
 
user1385191
click and move the mouse around
 
user1385191
watch the logs pile up
 
10:00 PM
@MattMcDonald thats bc u have nothing to block it
 
var GroupW = function (options) {
  var regex = "";
  for (var i = 0, ii = options.length; i < ii; i++) {
    switch (options[i]) {
       case "middle":
         ...
         break;
       ...
    }
  }
}
 
@MattMcDonald how do i get the memory size of a js object?
 
user1385191
I don't know
 
I recommend you build that regular expression dynamically. And cache the whole function.
 
lol
 
user1385191
10:01 PM
my point is that because you're not clearing the timeouts, they stack up
 
yeah thats what I was thinking since they are so similar. Thanks for response
 
user1385191
which is likely the leak
 
@Neal use a debugger. Chrome has one
 
you can use chromes profiler
to see whats going on
 
1
Q: Should I rely on externally-hosted services?

MattisI am wondering over the dangers / difficulties in using external services like Google Chart in my production state website. With external services I mean them that you can't download and host on your own server. (-) Potentially the Google service can be down when my site is up. (+) I don't hav...

 
10:01 PM
@Raynos it doesnt tell u mem size
 
@JohnMerlino if it's significantly more complicated you might want a real parser like jison
@Neal it does
 
user1385191
 
user1385191
notice how only one log shows up
 
@Neal its called heap snapshots
 
@Raynos i see, but it doent give object names, so its kinda useless...
 
10:03 PM
It does if you know how to use it :D
 
idk what (roots) is
... ive gtg
its been fun
 
byes
 
:P
@raynos you use mongodb?
@Raynos *
 
10:31 PM
did everyone just leave work or something?
 
not me...
 
@ChadScira not rly
i switched to couch but use abstractions
 
i heard it isnt as fast
 
I need an audio player to embed in my page, what do you guys propose ?
 
@ChadScira I lazy load / cache my database in RAM
So speed doesnt really bother me
 
10:44 PM
got it
 
i'll optimise it when it needs optimisation
I need to write a lazy loaded backbone collection
 
makes total sense, some applications dont need optimization
i need to do spacial queries that satisfy two rules and im kinda stuck
spatial*
i need to do a lat/lon with a radius
but the result also has a distance rule
so there are two distance rules on each end, which makes it a bit more complex
 
I see
load all records into RAM :D
filter the array
 
lets say i have 30 million items
 
get more ram
 
10:54 PM
lolz
then i guess i can go back to mysql
 
it was a joke
 
you see my query though?
 
I dont know how this should be done
I dont know anything about nosql
 
something like this
{location: {$within: {[[0,0], 10/2]}}
but i also need the results to satisfy their own max distance rule
i dont even know whats better
i was using temp tables in mysql to do it
 

« first day (247 days earlier)      last day (4702 days later) »