« first day (985 days earlier)      last day (3958 days later) » 

7:00 AM
Everything is weaker than a CNR slap.
 
!!undo 10239546
 
And to that a No.
 
lol
 
7:03 AM
^ that
 
// damn it returned
 
1
Q: Is this use of an array of function names and bracket-notation function calling a hacky/evil solution?

CheapSteaksBackground: I was making a chrome extension that injects movie ratings into theatres' showtimes pages. The problem I was duplicating a lot of code calling similar but just slightly different functions. Sometimes I wanted to do an $(el).prepend, sometimes $(el).append, or $(el).after, or $(el).fin...

 
This seems like an odd question stackoverflow.com/questions/17336536/…
They're not different styles
 
facepalm is strong with this one
 
@Darkyen You'll enjoy this: cheezburger.com/7589532160
 
7:17 AM
Hello good morning to all. Does anyone knows what's happening with twitter api v1.1?
 
What do you mean?
 
well previous i was using that
http://api.twitter.com/1/statuses/user_timeline.json?screen_name=myname&include_rts=true&count=4&callback=twitterCallback2

and i got a message to migrate to twitter api 1.1
now i use this
http://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=myname&include_rts=true&count=4&callback=twitterCallback2

but i get this error twittercallback2({"errors":[{"message":"Bad Authentication data","code":215}]});
why is that happening?
i could not find the problem
 
Did you authenticate beforehand?
 
yes of course
i have authenticate and before
 
Hello, clever people
 
7:21 AM
hello Neil
 
Then sorry, beyond my knowledge of the API.
 
Oh ok, thanks.
 
You should ask on main, somebody might know
Maybe they changed how authentication is done
 
I don't that anyone gonna answer me on main.
 
why not?
 
7:24 AM
because of experience on not getting answers :P
 
Maybe you just had bad luck. Shouldn't deter you from trying
 
you 're wright. But as i have understood here everyone has a different opinion of what is a problem and important. I have taken many negative votes and banned from asking questions over for a month, on past.
That's why i prefer now asking on chat if someone can help me.
 
rather, the community does not like lazy questions
show your research
 
This seems like a valid question
 
we don't like lazers in the chat either
 
7:29 AM
oh, I waver any responsibility for events which may take place following my advice.
 
i am not lazy, every time i ask for help i have already searched and tried a lot to solve it on my own but i could not make it up that's why i am asking for help.
 
Like giant turtles or flumbersnappers.
 
but i don't think it's absolute for everyone that, that's why we use to compare everyone as lazy when we hear an easy or an obvious question
 
0
Q: How should I architect a personal schedule manager that runs 24/7?

Crawford ComeauxI've developed an ADHD management system for myself that's attempting to change multiple habits at once. I know this is counter to conventional wisdom, but I've tried the conventional for years & am now trying it my way. (just wanted to say that to try and prevent it from distracting people from ...

 
@Feeds Sounds like something Erlang would like.
Each activity could be an actor
 
user1125394
7:33 AM
yes more than python or js
 
@Event_Horizon 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.
 
Also, showing your code indicates your level of knowledge and lets the answerers answer the question appropriately.
 
@CapricaSix The thousands bug is still there?
 
@Zirak what bug?
 
The bot checks for # of messages sent in chat to determine whether to welcome the user. It goes to the profile page and looks at the message count in the js room. But there was a bug where, when showed in thousands like 2k, it thought that meant 2 messages.
I remember adding a check for that thousands.
 
7:37 AM
DOes it matter if it's 2 or 2k?
 
2k is 2000, 2 is 2.
Event_Horizon had 1k messages, the bot shouldn't have welcomed him.
 
Dumb question: Whats the name of the javascript standardization file, standards.js or something like that to make IE/Chrome/Firefox act similar/the same? I may just be thinking of an HTML standardizing thing but Its been a while since I've done web dev stuff
 
There ever was such a magical thing?
 
I want it
 
So I'm probably mis-remembering then
 
7:39 AM
I must remember that it's OK to answer as CW if the question is easy but only if it doesn't look too dumb.
I got an error: Cannot read property '0' of undefined — phpcoderx 2 mins ago
 
user1125394
j.....y.js
 
I know theirs some files that fix things across browsers to act similar but I cant remember what its called
 
es5-shim?
 
jquery
 
hey any one can help me... i want to create popup contact us form for this site radio1.myfungenie.com
 
user1125394
7:41 AM
Js is itself a standard no
 
html5-shim? (or something similar)
 
@CoolBoy what are you stuck at?
 
There was Raynos' DOM-shim
 
@FlorianMargaine similar
 
@Event_Horizon you know, there are a lot of things browsers do. JS, DOM, CSS, etc.
 
7:41 AM
@JanDvorak i don't understand
 
@Zirak if only he supported IE8...
 
It was pretty yucky anyway
 
@FlorianMargaine No thats not it, hmm, I'm gonna keep looking around, I swore it was bundled in with twitter bootstrap or something
is there something like Normalize.css except for JS? IE it creates functions that do the same thing as missing functions for other browsers, something to that effect?
 
Yes, a million of them.
That's what we said
 
What would you suggest?
 
7:47 AM
None of them.
 
@Event_Horizon I prefer jQuery
 
jquery isn't gonna solve all my problems if I wrote all the code in pure JS
 
oh, then I'd grab the only one I know
 
@user2204790 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.
 
I'd give up and try incorporate progressive enhancement.
Shimming is a world of pain
 
7:50 AM
I'd just pull together different methods from MDN as I find them missing
and collect them into a single file
 
user1125394
but don't try to support too far browsers, just alert('update your ass') :p
 
@cx err, no alerts.
just hide the main content and show a dismissable dialog
 
I'm only trying to fix it for IE9, it works in FF and Chrome
 
Yea, no alerts for that ... document.write("Update your browser.")
:D
 
@OctavianDamiean ideally, with a 1-ms delay
 
7:52 AM
heh
 
something = (someLongCondition) ? true : false;
 
so as to ensure the page is overwritten
 
sigh
 
well html5shiv fixed it, hmm
 
7:54 AM
@Zirak boolean? :D
 
Happ(y|ier)\?
 
@Zirak some random matches: Happy?
 
@Lokkio 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.
 
You know...this might be a good fizz-buzz type question
 
which one?
 
7:57 AM
> Write a function that, when given true, returns false, and when given true, returns false.
That'll show if they know what return does, what variables symbolically mean, etc
//otherwise, it'd be something like
if (param) {
    return false;
}
else {
    return true;
}
 
if they write a ternary operator, ask them if there's a shorter code to achieve the same
(x)->!x
lambda{|x|!x}
 
Wait...did I say the same thing twice in the question? facepalm
> Write a function that, when given true, returns false; and when given false, returns true.
 
OK, then, (x)->false
//average outsourced Java code:
public static boolean f(final boolean x){
  if(new Boolean(x).equals(Boolean.TRUE)){
    return false;
  }
  if(new Boolean(x).equals(Boolean.FALSE)){
    return true;
  }
  throw new AssertionError("shouldn't get here")
};
 
:-D
 
user1125394
8:07 AM
lol
 
//much better Java code:
public static boolean f(final boolean x){
  return !x
};
 
Why do you label it final!
Hate final. Haaaaate.
 
not really needed here
 
@Zirak why do you hate it ?
 
it does help catch some bugs in larger methods, though
 
8:09 AM
the function itself is not needed
 
@Zirak final is good.
 
Because it's final.
 
if you want immutability.
 
@FlorianMargaine the compiler can defer that from the function body
 
8:10 AM
It's this weird thing people do, like foaming from the mouth to keep others from touching their food.
 
MrF
lol
 
@oPi 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.
 
Mhmm, as it looks I'll have to write my own version of Google Docs.
 
@Zirak do you put it in the same bags as strongly typed variables and private fields ?
 
user1823693
hello
 
8:12 AM
There's no real self-hosted alternative.
 
@OctavianDamiean sounds like a sound plan
 
> C++; a language where your friends can touch your privates but your parents won't even see them
 
It sounds like a really really tough task.
 
@oPi hi
 
user1823693
hi @JanDvorak
 
user1823693
8:14 AM
how are u?
 
@dystroy The same bag as private fields, sorta.
 
not bad, thanks
 
@Zirak if the compiler didn't force you to use final, I fear there would be hard to catch bugs. That's why I don't see it in the same way.
Disclaimer : I don't love final. I just don't care.
 
user1823693
could someone help me with a problem? i think is not complicated but im stuck with this
 
@dystroy I don't like these kinds of arguments. They're "so alligators don't eat us" kind of arguments.
 
8:16 AM
@oPi Please read the rules of the room
 
You had witch doctors going around, distributing magic amulets that stop alligators from eating you.
And they said the amulets worked, because alligators didn't eat you! And if someone was eaten without the amulet, well, that just proves the point, doesn't it?
 
@Zirak you could apply your argument to any situation. It's more of a choice that has been made and a compromise. I don't have an universal solution, between protection and freedom, only specific, more or less good, decisions.
 
It's the same argument as the static type system. And then Scala came and kicked Java in the balls, making people realize that people use Java not because of type safety, but because it's Java and not something else.
No, it can't be applied to anything, because not everything is a magic amulet
 
user1823693
@dystroy
1) i write the most of my code
2) no, im just asking in a forum. If i know any answer i will give it
3) no, but its another tool for me
4) no, im writting a web in php and im not using any cms or framework
 
guys hello :) Since the FireFox 22 update I'm getting this error: NS_ERROR_XPC_BAD_OP_ON_WN_PROTO in my extension a lot. Because firefox won't point me to the exact location in the extension I don't know eevn where to look. I'd appreciate any hint. Thanks
 
8:23 AM
@oPi and yet you didn't read our rules despite them being linked to from the room description and from the greeting by our bot. You didn't even read the greeting message.
 
!!welcome oPi
 
@MeLight searching the exception doesn't turn up anything?
 
@JanDvorak nothing helpful on the first two google pages
 
@oPi 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.
 
user1823693
@JanDvorak just some of them :D
 
user1823693
8:25 AM
okay
 
@MeLight try bisection: remove the first half of your extension and see if the problem persists.
 
user1823693
sorry
 
@oPi good guy :-) Now ask
 
user1823693
hehe okay
 
1
Q: NS_ERROR_XPC_BAD_OP_ON_WN_PROTO Exception in Firefox 22

dpskidmoreI maintain an addon that seems to be having issues with Firefox 22. There is a JavaScript module that uses loadFrameScript, which in turn injects some libraries using mozIJSSubScriptLoader. The file brought in by loadFrameScript looks similar to below: // Create a JS sub-script loader. var loade...

 
8:27 AM
@JanDvorak wish it was that simple.
Just found tha page too
thanks
And he posted the same Q here on stackoverflow :(
Nothing relevant
 
try creating an SSCCE
 
user1823693
lets see: i have a random number of forms with the same name for the controls. One of them is a select control. I had this code
$("#slcTramoViajeCompra").change(function(){
var id=$(this).children(":selected").attr("id");
$(this).parent().find('#hdnTramo').val(id);
});

This is only working with the first select but with none more. So i tried to use it with the live function and it failed so i read that was a deprecated method and i should use on or bind functions.
I did but the problem persist: it only works with the first form, from the second form it fails
 
@oPi forms, or form inputs?
 
user1823693
forms with form inputs
 
@oPi Don't use multiple ids with the same value
 
8:30 AM
Sheldon: Teams are traditionally named after fierce creatures, thus intimidating one's opponent.
Raj: Then we could be the Bengal Tigers.
Sheldon: Poor choice—gram for gram, no animal exceeds the relative fighting strength of the army ant.
Raj: Maybe so, but you can't incinerate a Bengal tiger with a magnifying glass
teehee
The last one is golden. :D
 
^
:-D
 
Unless...
 
It's a very big magnifying glass
 
@oPi live is deprecated - look up on
 
user1823693
@JanDvorak i tried with on and also with bind, same result
 
8:31 AM
@MeLight very big magnifying glasses are difficult to manipulate
@oPi fiddle, then
 
As if fierceness of an animal were determined by its proportional strength and not by its overall strength
 
user1823693
@JanDvorak ok, im on it
 
Shouldn't the ferocity of an animal also depend on the overall ferocity of its pack/group?
 
$(this).parent().find('#hdnTramo') smells. Do you have duplicate IDs?
 
8:33 AM
And bengal tigers are hard to submit into idleness. There are apparently some challenges to this project.
 
@Zirak in which case the soldier ants win over bengali tigers
 
... but, if you compare their poop, the tiger wins again. Not sure how that's relevant but it's a fact.
 
@Zirak I suppose you're right. After all, it's the bengal tigers group and not the bengal tiger group
 
I'm pretty sure that in a fight, if your opponent can win by urinating on your house, he has the upper...uh...hand.
 
s/on/all over/
then ants lose
 
8:35 AM
guys any reason to downvote this stackoverflow.com/questions/17337752/…
 
@ArunPJohny why not use Array#indexOf?
 
user1823693
jsfiddle.net/utwSp this is the fiddle
 
@oPi first off, you didn't select a library in the fiddle. Second, you have duplicate IDs. Fix these.
$("#some-id") always finds at most one element. Guess why?
perhaps use classes instead?
 
user1823693
yes, but i thought that with live it would get the active one
 
how did you use on?
 
user1823693
8:41 AM
yes
 
user1823693
i tried with on and with bind
 
!!tell opi define how
 
@opi how To what degree.
 
user1823693
$("#slcTramoViajeCompra").on("change", function(){
    var id=$(this).children(":selected").attr("id");
    $(this).parent().find('#hdnTramo').val(id);
});
 
user1823693
and the same to bind
 
8:42 AM
$("#some-id").on("event", function(){})` will only pick up the first element
for the same reason the change shortcut does
 
user1823693
so i should use each first?
 
that will not work either
$("#some-id") will always find at most one element
to perform delegation with on, the syntax is $(parent).on("event", "selector", function(event){})
but you should fix your IDs instead
 
user1823693
ok, so i will generate distinct ID's
 
do you need IDs at all?
 
user1823693
no
 
user1125394
8:46 AM
lol
 
user1823693
maybe i dont
 
user1823693
i thought it was a good way to manage this
 
"generate", "IDs" and "HTML" are dissonant together
 
user1823693
yes, but not with php ;)
 
eh?
 
user1823693
8:47 AM
i generate it with php
 
user1823693
depending of some database values
 
If you use javascript to generate your view, you don't need to generate IDs to bind the elements to their data
even if you're building an interactive document rather than a web-app, you can bind data with data- attributes
 
user1125394
there is a long tradition of bad habbits with id
 
user1823693
i didnt contemplate that option
 
Luckily, eval("arr."+key) is gone (except for a temptation with dotted keys)
 
user1823693
8:51 AM
@cx you know...the foibles of each programmer...xD
 
user1823693
so, i will change it to delegate
 
var elem = obj
key.split('.').forEach(function(x){elem = obj[x]})

//vs.

assert(/^\w+(\.\w+)*$/.test(key))
var elem = eval("obj." + key)
the temptation is strong but it feels so dirty
 
user1823693
thanx for the idea @JanDvorak :)
 
especially if you don't care about speed, eval is very tempting to use
if you can trust the caller, even so
 

« first day (985 days earlier)      last day (3958 days later) »