« first day (417 days earlier)      last day (4537 days later) » 

7:00 PM
are you having huge memory problems or what?
 
@Esailija of course, how would I isolate the profile?
just having sluggish responsiveness
 
Nice, just demo'd my project to the rest of the team and they seem to be happy with it. only one bug found in the demo - that's always a plus!
 
make an unit test with the responsive module for the part of app that doesn't respond well
 
stupid FF 3.6
 
user1385191
are you using children?
 
7:02 PM
@MattMcDonald talking to me?
 
When I run my app, take a heap snapshot it's usually 3.x MB , then I refresh and repeat, it becomes 5.x MB, refresh and repeat, it becomes 7.x MB, etc...
 
try waiting for a while, it should go back to normal
if your app is 3mb after loading you certainly don't have any ram problems
 
Both haha. The thing is that i have been troubleing with this for a couple of days. And i would really need some help with. The whole function are supose to work like this: When the user enters the page he/she will see the google map. If the user right clicks on the map a context menu is brought up. There are four types of options avalible in the menu for the user.
The first one is named Start position. If the user clicks on this button in the menu, a start position (orgin) will be declared for the driving directions function that google has in their api's.
And if you pick the checkpoint button a checkpoint will be created, and finally if you click the finishposition button in the menu a point will be created just as the start position on that location and a driving direction line will be placed between those points. When this is done the user has an oportunity to save their "track". Then i want somehow those locations be inserted into a Sql database, probable using code behind c#
 
@jondavidjohn are you using jQuery?
 
would elm.dataset break FF 3.6?
 
7:05 PM
@Esailija that's almost It haha
 
var handleDeletes = function(event) {
    if (!confirm('Are you sure you want to delete the following item?\n\nID:\t' + this.dataset.itemID + '\n\nThis operation cannot be undone.')) {
        event.preventDefault();
    }
};
works in newer versions - FF 3.6 doesn't confirm.. just submits the event
 
@Esailija yes in a few places, refactored a lot of it out.
 
user1385191
dataset most likely will
 
user1385191
store it in another object instead
 
looks like i'll have to. damn. hidden inputs here i come!
 
7:09 PM
It's pretty hard to say anything if you don't have any idea where to look in your code for the bottlenecks
you could search the web for most common pitfalls and see if they ring any bells
 
@rlemon dataset doesnt work in ff<6
I think
You can always do this["data-itemID"]
Or write a wrapper dataset(node).itemID
 
@Raynos meh - hidden inputs work as well. I'm just storing two id's anyways.
 
or reinvent jQuery.data =D
 
@Esailija I'm surprised no one suggested I include 1.7.1 (~100kb) just so I can use .data
 
well doing jQuery.data yourself is like 20-30 lines IIRC
 
7:16 PM
21 mins ago, by Ryan Kinal
@Parek WebMethods
 
@RyanKinal huh?
 
@RyanKinal an ugly but effective solution
 
@Raynos Yep. And easy to implement.
 
It basically sets up file based / method routing
xhr.open("POST", "file.aspx/webMethodName");
 
I have reinvented it myself a couple of times actually, no shame in it =)
 
7:18 PM
@Esailija its 20 lines
 
@Raynos but why was he posting that to me? What does that have to do with data-*
 
@rlemon but why you trolling
 
@Raynos, no removeData though ? =)
 
He posted it to parek
@Esailija who needs removeData. That's what the GC is for :D
 
I mean the store object will just keep collecting unique keys that are no longer used
 
7:19 PM
@Raynos my bad - when I initially moused over it I though it was highlighting my last post - looked like it was in reply to.. kinda thing.
 
user1385191
just use an object
 
I want to see whether pd.Name()(domNode) works
it would give an elegant solution to the problem
 
1
A: Is using multiple replaces in a JS function 'good' practice?

Andy EIt's not particularly bad practice to use more than one replace function. In fact, the fastest compatibility implementations of trim use multiple replace statements because it's faster to have two separate regular expressions for searching at the start and end of strings than a combined expressi...

sigh at OP's comments.
 
hurr durr your answer isn't instantly usable by blind copy paste
 
user1385191
still can't downvote comments
 
7:26 PM
yeah seems a bit of an oversight
 
user1385191
it's not an oversight
 
user1385191
it's by design
 
you can comment total crap and it will be live and well unless there are many upvoted comments
well just saying, though I haven't considered the upsides of not being able to downvote
 
user1385191
what annoys me the most is utter crap comments with lots of votes
 
user1385191
and you can only reply
 
7:32 PM
yeah that bugs me too.
 
just flag them.
put in 'other' and for a reason put 'just plain wrong'
 
user1385191
won't fly
 
CAM
7:47 PM
Phonegap
anyone use it before?
ok
I am getting this
uncaught referenceerror
 
and what is the message
 
Uncaught ReferenceError: Problem was not defined
 
1
Q: Which events are the most intensive?

aepheusWhich events are the most resource intensive to have attached? Is a mouseover "worst" than a click? Are there any events that are known to be really harsh on the browser? I have my sights on IE7 mainly, as we are seeing performance issues there. We use event delegation where we can. Alternate qu...

^ all three answers posted seem to think mouseover is actually mousemove.
 
@AndyE this reminds me
 
user1385191
ugh, I've seen mousemove's damage first hand
 
user1385191
7:59 PM
seems like hundreds of calls a second
 
// does not have to walk chain
document.addEventListener(ev, function (ev) {
  // do delegation
  ev.stopImmediatePropagation();
}, true);
// has to walk entire chain
document.addEventListener(ev, function (ev) {
  // do delegation
  ev.stopImmediatePropagation();
}, false);
@AndyE is delegation with capture phase noticably more efficient?
 
user1385191
don't kill the event
 
user1385191
don't do it
 
isnt onscroll pretty bad too
 
@MattMcDonald why not?
 
user1385191
8:00 PM
using the capture just hijacks the event if you're going to kill it
 
@MattMcDonald I think that's the intention
 
The idea is that document is a top level event mediator that delegates all real events to everything else
 
$(document).scroll(console.log.bind(console ));
and scroll away!
 
user1385191
Never use event.stopPropagation(). You have no idea which unrelated object in the page may depend on the arrival of that bubbling event.
 
do it on a SO question page, jQuery already included
 
8:02 PM
@Raynos noticeably might be a stretch, but perhaps not if you're bound to every element in the chain.
 
hey, i'm looking for a keyword or phrase that describes when two values are very near one another but not equal for example -70.55144619999999 and -70.5514462
 
If I'm writing a library, I like to squeeze as much performance as possible, even micro-optimizations.
 
how would i google for how to handle cases like this?
 
@Keyslinger proximal?
 
that sounds good... googling...
 
8:04 PM
epsilon
add ieee 754 google.com/…
 
@MattMcDonald thats not always true .. for example , if you have a modal window ( the floating JS <div> ) , then it makes sense to stop events from leaving said window
 
okay, i'm struggling because i sometimes get a slightly higher number and sometimes a slightly lower number
 
epsilon's related, but I think he wants a word for "within epsilon of each other"
oh, wait. He's just looking to search. never mind
 
for example i want both 70.55144619999999 and -70.5514462000001 to be changed to -70.5514462
 
user1385191
8:07 PM
Number.prototype.toFixed or Number.prototype.toPrecision
 
hhhmmmm
 
@Keyslinger, those are for output, of course.
 
@MattMcDonald I hate it when advice goes along the lines of "Never use this feature that was defined for a very specific purpose". It's like saying "Never use eval". Guns don't kill people.
 
meaning they return strings
 
8:09 PM
@co
 
why not use new Function for the 2 cases eval is ever needed
 
@codelahoma i don't understand the distinction
 
user1385191
@Esailija why obfuscate the purpose of the code?
 
you don't want to go around adjusting actual numerical values during calculations. That just introduces more error.
 
how is it obfuscation :O
 
user1385191
8:10 PM
eval does as it says
 
@Esailija What's the difference between new Function and eval?
 
any vars in new function will not be global in any case
 
@codelahoma oic
 
and for a templating engine you want to return a function anyway
so I guess it's just JSON for old browsers
where it doesn't really matter
as long as you sanitize it before
 
@Esailija new Function does not evaluate code in the global scope. Indirect calls to eval do.
 
8:13 PM
in those 2 cases I mentioned, global eval isn't needed
 
@Esailija: the point remains. When people say "don't use eval", they mean it to apply liberally to all eval-like methods, including new Function().
 
ah ok
 
For setTimeout and setInterval, it's certainly true. You shouldn't use the eval-like overloads of those methods.
 
but hey, IIRC, I have fooled a question at least once with new Function when the question was so ridiculous that eval was the only solution that would satisfy the op
 
/me punches setInterval
 
8:17 PM
Thanks all!
 
/setInterval punches back.... punches back.... punches back.... punches back.... punches back.... punches back.... punches back.... punches back....
7
 
@rlemon wish I could upvote that...
 
heh there needs to be more and less dots inbetween each one :P
 
@AndyE , So outside the 2 cases where you cannot do the job without eval-like, what are the other use cases where it cannot be avoided
jQuery used to do globalEval without eval-like at all
 
@Loktar nahh, somewhere in the middle just add ....does nothing for 3 cycles.... punches back....
 
CAM
8:21 PM
I will be back I need to rebuild.
 
lol
I almost didn't star your comment because it was punching me but I reconsidered.
 
@Esailija perfectionkills.com/global-eval-what-are-the-options – jQuery uses script insertion for globalEval, which is about as eval-like as you can get (although without a return value).
 
I mean I only brought it up because global eval is possible without eval-like
so that's not a use case for eval-like
and latest jQuery doesn't use script insertion anymore
 
@Esailija: correct, they use "indirect eval" in newer versions.
any form of script execution is eval-like, which just means invoking the compiler to parse and execute the script.
 
not in the context where people say never use eval
that would mean not running any scripts ever
 
8:31 PM
Well, yes and no. Of course, you wouldn't expect people to not run scripts at all. But I'm referring to script execution from within a currently executing script.
 
@MattMcDonald Its about stopping propagation down the capture chain
 
@AndyE, nice tip in your comment :D just look how elegant it is now compared to the first answer
 
@Esalija: yup, it's just one of those things. I always use var i=max; while (i--) {} instead of for (i=0; i<max; i++) {} where order isn't important, too.
 
which makes me rage for using a global variable to cheese the code to look simple
 
lol yeah
@Raynos is it for dom-shim?
 
8:42 PM
Hi everyone
I need some help with this question: stackoverflow.com/questions/8419915/…
 
@methuselah: that's an answer, not a question :-P
 
I am trying to store the value in a variable and not a field
 
0
Q: Accessing text field within iframe from parent document and store for use

methuselahI have two documents - main.html (parent document) and enterKey.html (child document). Within main.html <script> ... </script> <iframe id="key" src="enterKey.html"></iframe> Within enterKey.html: <input id="sbox" type="text"> I am trying to access the value en...

 
@AndyE sorry I've already received an answer
But the problem is that I would like to store the value in a variable and not a field
 
@methuselah: relax, I'm just kidding. Is there some reason @Blender's answer isn't right for you?
 
8:46 PM
I'm confused as to why he decided to store the answer in a field and not a variable
Because I want to use the variable to search through an array of records
 
lol, I just voted to close a question, found the dupe link and took a brief look at the top voted answer and thought "close enough". After voting to close I looked at the other questions' answer again and it was one of mine.
 
Which question?
 
shalom all
 
9:06 PM
do form names need to be unique?
errr. what i mean to ask is, like you can have an array of checkboxes with name='foo[]' can I have an array of forms.
 
getElementsByName method naming suggests that no but who knows
 
@rlemon why not? they can all submit to diff places
 
i want to iterate over them using document.forms
 
user1385191
what is the purpose?
 
> This attribute names the element so that it may be referred to from style sheets or scripts. Note. This attribute has been included for backwards compatibility. Applications should use the id attribute to identify elements.
 
9:10 PM
they each will have the same onsubmit verification - they have the same contents minus values (and action)
 
user1385191
interesting bit in the HTML 5 spec:
 
user1385191
> The name attribute represents the form's name within the forms collection. The value must not be the empty string, and the value must be unique amongst the form elements in the forms collection that it is in, if any.
 
does this mean as long as the form name an a child elements name do not conflict i'm cool?? ;)
 
I can't find anything that says "don't do it"
 
2
Q: Getting a collection of input values

KomboI have a function that sets text input's to "" whenever they are clicked/focused on. It works fine when I hard code defaults values into an array, however I'd like to not do this and instead get a collection of the default values so I can use it across several pages without having to add values t...

^ lol at first comment
 
user1385191
9:20 PM
sigh
 
user1385191
even the answer is wrong
 
is it not .defaultValue
 
user1385191
bingo
 
user1385191
...which reflects the value attribute and vice versa
 
yeah, defaultValue is the way to go. I up voted the accepted answer without reading the question thoroughly.
 
9:23 PM
He also gave a shit answer with 8 upvotes before and I commented but I cba again because he don't listen.. and he's had a bad day :P
 
user1385191
I giggled reading his variable name
 
well not completely shit but not 8upvotey answer
 
@AndyE no. Its just wondering whether its a good technique to have all events go through document in capture and then killed
 
update @Incognito worked well in chrome - FF on the otherhand.. RE: duplicate form names
 
It just seems like a nice way to short circuit the computational expense of the event system
 
9:35 PM
@Raynos: I don't see the harm if you're in control of the code.
 
guise i am so sick 8(
le suck
 
should i fake concern now ?
 
no, i just wanted to complain :>
 
Maybe you'll die, and then you won't be ill ever again!
 
good lil troll
 
9:39 PM
@Zirak lol harsh much?
 
what i really want is to smoke a cigarette, im not sure whats worse being sick or not being able to smoke
 
It's the truth. Being alive means that you're capable of being sick (or showing the symptoms of sickness). Ergo, if you're not alive (alive is boolean, so !alive === dead), you can't be sick, or show symptoms of sickness.
Death is, in a way, the ultimate medicine
Which reminds me: I quit Ruby.
 
before you can do that you must first assert that you understand death
and that test will fail
 
I don't have to understand the philosophical or spiritual implications of death, just the biological ones.
 
so what is undead? FILE_NOT_FOUND?
 
9:43 PM
or rather, death would return undefined
 
@ThomasBlobaum my problem is the world deals in truthy, so !alive == dead; // room for interpretation
 
but you are using vars that you dont know the contents of
 
I think Esailija has a point. I think a bitmasked mortality is required.
 
It's a global. You don't have to know what it is or its contents, you just have to know it exists.
 
lmao
why remove =(
 
9:47 PM
var dead = jQuery.globalEval; // ????
;)
just for you @Esailija
 
cheers
 
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF I've been looking for some "magic" variable in this code for the past hour.
 
which code
 
it's not even code man
it's bullS**T
some report some guy wrote like 3 years ago
he's left me nothing but magic surprises through the years to deal with
hard coded constant "BASICPERSON" gets the word "FRENCH" added onto the end of it.
but I can't grep any of the files for either of these values
or the database
v.v
 
lol
 
10:00 PM
I'm done with it, thing can go rot in a fire. I'm going to forget about this crap with booze.
cheers all
 
searching / filtering a table - what is more common (if you had to hard code in one functionality) searching for the exact phrase, or any of the words.
 
both with higher preference to exact matches :P
 
@Esailija version 2.0
so exact phrase it is then.
 
does anyone know a good place to go for help with Jquery/AJAX/DOM ?
 
Depends
can you ask intelligent questions?
 
yes
did you think my last question was intelligent?
 
You can ask for advice here, you know
 
@TylerShambora : no , that was not the impression we got , not really
 
10:37 PM
shucks
 
11:14 PM
Was Esailija here recent?
 

« first day (417 days earlier)      last day (4537 days later) »