« first day (1635 days earlier)      last day (3299 days later) » 

5:00 AM
@TimSalabim The hell is going on with that random function keyword?
 
part of the code i googled haha
 
It's erroring out, isn't it?
 
i don't know, i am lost
trying to learn this and the script which i got to work just isn't working....
 
You shouldn't ever have a function keyword like that without a declaration or expression. Looks like what you're trying to do is an IIFE, which would look like....
(function() {
     ...
})();
 
5:16 AM
@phenomnomnominal Ummm, ok...
 
@phenomnomnominal Leave Britney alone!
 
I FUCKING LOVE BRITNEY
 
help :(
 
The monstrosity is in orbit!
 
5:24 AM
@SomeKittens By the time you've landed something on Mars you could have actually gotten a job at NASA
 
@monners Working at NASA would be neat
 
I hear they get to play with explosives
 
hello i want to use this jsfiddle.net/arunpjohny/FKWE6
i have copied html,css,js files but i am not getting exact thing
 
Any of you guys use Slack at work?
 
I do
 
5:35 AM
I keep pushing for it here, hoping it'll catch on
Most of the company just uses Google Hangouts...
 
I like IRC for these things but I'm also a dinosaur
 
We're using hipchat
It's okay
We're all buddy buddy with the Atlassian guys at the moment it seems
 
@winresh24 Posting the same fiddle every couple of hours isn't going to make us more likely to help you. Try figuring out the problem yourself, and come back with specific questions. It doesn't work is not a valid question.
 
problem is
 
@winresh24 Excuse me?
 
@monners yes?
 
6:12 AM
> You cannot kick suspended users.
 
6:33 AM
Can you kick me
@pleasedont
 
THE
why this doesn't work,

.attr("fill", "00FF00");

but this works

.attr("fill", "red");
 
@THE try .attr('fill', '#00FF00');?
 
@THE .attr("fill", "#00FF00"); //will/should work
 
@AdarshRajput 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.
 
6:37 AM
enabling cross site scripting in Django is easy as removing a line of code
 
THE
thank you guys
it works
 
7:02 AM
say I have a script on <script src="script.js"></script>. It runs normally, but I need to store all of its text as a string on one of its variable. How can I do that?
 
with code
Namely, you select the script tag and look at its text content
 
but since it's external, the innerHTML wouldn't work
Do I need to make ajax call and override type to text?
 
ajax will work
 
ok but theres no easier ways out right?
 
what's the use case for this?
 
7:13 AM
Good programming language characteristic:
Code written in that language feels like you are reading a sentence written in English
 
make a textarea show this code.
 
OK, just checking that it's not an XY problem :)
 
just an off topic question but why did the tags change again to some random "peter-programming" and "es17 (isnt it es6?)"?
 
Don't pay too much attention to the tags...
 
cereal... we-so-excited...
 
7:18 AM
I wish JS and python supported atoms inside JSON for its keys
 
Why is that SO study not starred here ? The findings are very interesting.
3
 
Then you wouldn't spend extra memory to store your keys with strings
but simply with atoms, but still works equivalent to string keys
 
@dystroy it was posted like 5 times already I guess? Not sure though
 
Wow the gender tho
 
@BenjaminGruenbaum And it's not starred ? Or is it just the stupid layout which hides it ? Sorry for the duplicated link, anyway.
 
7:25 AM
@dystroy thanks, good read :)
 
> The more things change, the more likely it is those things are written in JavaScript with NotePad++ on a Windows machine (theme: dark) using Git, and tabs instead of spaces.
:P
 
building user login and logout in Django is easy as just putting phucking
"user.login" and "user.logout"
 
NotePad++ even
 
This is beyond your imagination if you are coming from Spring, Struts and J2EE
 
7:28 AM
@EnglishMaster Welcome to 2001. You just have 14 more years to catch up to.
 
@EnglishMaster Yah, it's pretty good out the box
 
What do they have in 2015? Can you forecast it for me?
 
McFly is stopping by
 
@EnglishMaster IE8
Beta
 
7:29 AM
My instinct tells MS is getting rid of name "IE"
because it has been bashed on Internet too much so instead of building a new & decent browser, they'll just rename an existing one
 
But it evokes such positive emotions
 
And opening the door for endless "300" puns by codenaming the new one Spartan, this already happened
 
so no one will notice they are still using IE but with a different name
 
I felt a little bit sorry for an IE engineer who I saw posted in a comment on a question how they're "trying" (paraphrasing) and that the new IE is pretty awesome.
Things like Modern.IE have come just a little too late (10 years...)
 
THE
how can I make this svg "g", stay still and not drag - jsfiddle.net/nhe613kt/74
 
7:33 AM
@IanClark At least they came around eventually, with stuff like modern.ie/en-us/ie6countdown as well, the game is even in canvas
 
@ivarni Yeh, as I said, I feel a little sorry for them now. But I suppose their complacency in the new internet era was their downfall
 
@IanClark Well, I'd educate people around me IE is the best browser in the world if I was working for MS
because your life is all about money, fame and women
and guns
 
...lots of guns...
 
yeah
and bacon
 
why would someone choose grunt over gulp ?
 
7:44 AM
personally I cba to chase after every new thing that comes around, and since grunt was there first and I frequently reuse my build-scripts between projects I haven't really seen any reason yet to swap
 
@Charly by making AJAX request to that .js file, at document load and store response in string variable.
 
8:11 AM
I am trying to compile the partials from this repository .. github.com/hmps/animate.scss .. my grunt task looks like this:
module.exports = function(grunt) {
  grunt.initConfig({
    sass_files: [{
      expand: true,
      src: ['**/*.scss'],
      dest: './build/css',
      ext:  '.css'
    }],
    sass: {
      dist: {
        files: ['<%= sass_files %>']
      },
      options: {
        style: 'expanded'
      }
    }
});
 grunt.registerTask('default', ['clean:stylesheets', 'sass']);
};
but it is only creating animate.css with
body {
-webkit-backface-visibility: hidden;
}
 
var x = 'index.php?id_category=16&controller=category&in_stock=1'

x.replace(/in_stock=([^&\s]*)/, 'aaa')
"index.php?id_category=16&controller=category&aaa"
can someone explain why I cant replace a PART of regex match ? :(
 
you can use lookaround or you can capture the context
Javascript can't lookbehind, so capture the context
 
hmm stupid me :/
Ill just build the full string back
 
9:04 AM
stackoverflow.com/research/developer-survey-2015#profile-geo this looks incorrect, most devs are from southern parts.
 
@argentum47 what do you mean?
 
in the map of India, it shows a orange circle right at the middle of India, and has no circles in the southern parts. that I believe is kinda incorrect, because the southern region is the hub of all IT companies.
 
oh boy, it's for the whole country ...
 
ow. my bad
 
some circles doesn't seem centered towards their country, but it's to indicate nationalities among SO users.
 
Dan
9:11 AM
I want to make a single sign on system using node.js. Is LDAP the rite way to go for it or is there any other better alternative? Does anyone have any experience/idea regarding this?
 
Yup, just like most russian devs dont live in Sibir :)
 
..or... DO they
?
 
still, 3 people entered North korea, just to joke
it is impossible because the great Leader is the only with internet access
 
@KarelG the obvious conclusion is that Kim is a dirty sock-puppet account swindler
 
9:14 AM
a good one
 
Kim got 20k rep on the first day
 
I'd be interested in how they decided to place the circles. Sometimes it's the capital, sometimes a kind of geometric center, sometimes it just looks random (Spain, UK, France for example...)
 
Yeah, I kinda wondered about that too, maybe they try to avoid collision as much as possible?
 
That was my first idea but that doesn't explain some choices
 
Dont have time (and honestly not a deep enough interrest) to really dig, but it might be done client side since disabling javascript removes the map
in that case...the truth is out there, use the source etc :)
 
simmer down bro.. :D
 
how to reliably test for IE & version using future detection?
 
The future is now
 
you mean feature detection?
 
@mash Uh? What do you mean?
 
9:35 AM
!!s/future/feature/
 
if you mean feature detection, the point is that you don't
 
this whole point of that is that you don't need to know if something is IE or not
 
@mash The feature is now (source)
 
where's my bot
maaaan
 
your bot? You have a bot?
 
9:35 AM
either it supports flexbox or it doesn't (for example)
which is a terrible example btw as there are different implementations of it
 
if(!document.getElementsByClassName) alert("get a proper browser")
2
 
Can I ask about the execution when my loop runs,then it executes the function dosomething,does my for loop will wait until
the dosomething is done,then it will loop again or it will not wait even the dosomething is not yet done ?


var id;

for(var i=0;i<data.length;i++){

id = data[i].d.id;


dosomething(id);


}



function dosomething(id){



//some ajax here sending id to serverside


}
 
@JanDvorak You forgot while(true)
don't let them off the hook that easy
 
@ivarni then they won't be able to close IE
 
but I just wanted to replace the useragent check with something more reliable.... but ok I'll guess I edit all the parts where it checks for the browser to use the specific feature detection
 
9:39 AM
@JanDvorak Ctrl+alt+delete and nuke the entire thing from taskmanager ;)
 
if(!document.getElementsByClassName) {
  alert("get a proper browser");
  document.close();
  document.write("");
}
@ivarni IE users don't know how to use the task manager
 
@mash Yes, useragent check is never going to be very "reliable", it's better to go full feature detection. Use Modernizr or something and check for the features that your site needs. Warn users who have browsers with missing features
 
^ Modernizr is the way to go imho
 
@jemz it will loop again before the async call finished. But making ajax calls in a loop is a bad idea.
 
polyfill for everything (ohh I can really edit messages)
!!s/or/for/
 
9:42 AM
@mash polyfill for everything (source)
 
just edit your message, dude
 
This is an opinionated question which can only receive an opinionated answer, however, nothing stated here was incorrect. Please don't downvote simply because you don't share the same world-view as the author. — Filip Dupanović 2 mins ago
 
@phenomnomnominal, Thank you for the advice
 
Why is he trying to justify an answer that shouldn't be there in the first place?
 
@phenomnomnominal, I have no idea how to change my code without using ajax in loop
 
9:47 AM
@jemz what is your code doing?
 
@jemz you want to only send one ajax request if you already got all the data to send. Just change the serverside
 
hi i have a very small question
I have some id like this custom1,custom2,custom3... so on
now i want to apply some event on each of custom id. Is there any way to give id with regular expression that check custom ends with integer
 
@ShreshttBhatt Use classes.
 
$('custom[\d]')
 
9:53 AM
something like this
$('custom[\d]').click(function(){});
 
interesting argument on the comment section of the answer
 
[id^=custom]
 
@mido22 That argument pops up frequently on meta, not really that interesting tbh
And engaging to "join a battle" is the wrong approach
 
don't declare war. declare variables.
 
@ShreshttBhatt you most likely don't even want to use ids here
 
9:57 AM
good morning
 
@mido22 Not sure what exactly there is supposed to be an “interesting argument”.
 
looking for a good tutorial on how to add a search bar to a google maps with autocomplete based on json data...any suggestions?, i found something on goole but it uses checkbox...
anyone?!?!
 
I'm sorry, but a "tutorial to [do this very specific thing]" doesn't quite exist
 
user3949359
So, in use strict one cannot use undeclared variables. Why does it complain when I'm not using var in front instead?
 
var is how you declare variables in javascript
 
10:02 AM
@Japa use that checkbox thing and replace that with a search bar ?
 
user3949359
@JanDvorak I thought a variable without var is just global, and not local.
 
you must have noticed that I never commented there, any other day, I would have flagged the question as opinion based and left it.
 
@nosille A variable without var is undeclared unless declared elsewhere.
 
@KarelG that´s a great idea...thanks
 
._.
 
10:03 AM
@JanDvorak but did you understand what i want?, what would you recomend?
 
I kind of agree with the answerer here, but wanted to know your opinions.
 
@mido22 My opinion is that it's opinion based and as such by definition off topic, so I DV and VTC but chose not to join the "battle"
 
@Japa grab an autocomplete plugin and see how you can integrate it with google maps
 
There's really nothing to add to that comment thread without violating DRY anyway
 
what do you think of this: jsfiddle.net/KyMCy/5
 
user3949359
10:05 AM
@JanDvorak So, the reason a variable without var is global is because the browser declares it silently in window?
 
@nosille yes
 
@JanDvorak i think it´s very close of what i want...but i want to understand where do i put the ajax call
 
@Japa what ajax call? If you mean for autocomplete, said autocomplete should provide you with the hooks necessary
 
user3949359
@JanDvorak the this binding holds the value undefined in functions that are not called as methods. What does this mean in strict mode context?
 
the ajax call i´m using to get the markers from a j.son file
 
10:09 AM
!!tell nosille eval (function(){"use strict"; return this})()
 
@nosille "undefined"
 
@ivarni, may be wrong title, I just wanted to know other ppls opinion about it, especailly the point where he compares this with stackoverflow.com/questions/5062614/…
 
!!tell nosille eval (function(){return this})()
 
@nosille "undefined"
 
user3949359
@JanDvorak So, if the function is not a property, this is undefined?
 
10:10 AM
Is Cap running in strict mode already?
 
user3949359
What's the purpose?
 
or if you call it as (obj.method)(...)
 
!!> eval("self");
 
or...
 
10:11 AM
@BenjaminGruenbaum TypeError: cyclic object value
 
^ this is the global object
!!> Function("(function(){ return this; })()")()
 
@nosille what should it do instead? Give you access to the global scope?
 
@BenjaminGruenbaum "undefined"
 
I'll... just stop
 
HAMMERTIME!
 
10:12 AM
hahahaha
 
That joke is really getting old.
Also the one with halt
 
HAMMERZEIT!
 
I haven't been here long
 
That's ok :)
 
Trying to setup CoreOS in a vbox, trickier than I thought.
 
10:13 AM
@BenjaminGruenbaum luckily it doesn't pop up that often
 
You have more answers than questions, a pretty decent rep and you don't talk like you pay for internet by the letter - you're already better than most new users.
2
 
@BenjaminGruenbaum you don't mean that.
 
Old doesn’t mean bad.
 
In case of fruit, it does
 
omg. xD
 
10:18 AM
I also have the best name ever. :>
 
@BenFortune your name is KOBRA LEOPARDFORCE?
 
Cue legal name chance.
0
Q: Display text Dot js

cheksi need display text in table. But if content have "\n", my text display in one line. I not understand why. How it work: send ajax to nodeJs code ---> nodeJs get content from Mongo and return ajax responce--> ajax:success display text using Dot js. Content in Mongo look like that "text" : "test...

What a mess.
 
@mido22 That's a 4 year old question, it's irrelevant to bring that up when discussing a question posted today
 
Did you guys hear the recent news about a couple named Burger and King getting married? :D
Burger-King wedding!
 
@RahulDesai I think his first name was Ham
 
and hers was Jo
 
@JanDvorak for real?
lol
:P
 
Ham Burger + Jo King
 
I have a friend with the last name Dover, he's engaged to an Eileen
She's terrified.
 
@BenFortune Is his first name also Ben?
 
vs7
10:23 AM
I am looking for some good HTML5 Canvas Pattern like : googlex.in/quotemaker
 
Joel Burger and Ashley King it is.
 
vs7
Anybody can help me out
?
 
@JanDvorak yes, yes they are
 
Well, I misread the title as meaning a legal action
the joke's on me
 
your point still stands
 
vs7
10:27 AM
any pattern drawing library
?
 
as in something like debuggex has?
 
dogpanzee
 
pukes
 
It's a pugorilla damnit.
 
10:39 AM
!!youtube jasmine
 
what, no I meant e2e
 
THE
11:13 AM
can't find D3 js file
anyone got link to it ?
 
user3949359
When not in strict mode, isn't this referring to the context, instead of window?
 
the context can be window
 
is dist: { .. } just a syntax or has some significance. I see it everywhere in grunt
 
user3949359
@ivarni Ok, why does strict mode make it undefined. What's the rationale?
 
22
Q: Why is "this" in an anonymous function undefined when using strict?

TJ.Why is this in an anonymous function undefined when using javascript in strict mode? I understand why this could make sense, but I couldn't find any concrete answer. Example: (function () { "use strict"; this.foo = "bar"; // *this* is undefined, why? }()); Test in a fiddle: http://js...

 
11:26 AM
@SomeKittens yes
 
11:41 AM
There should be a close vote for "User has made absolutely no attempt to research the given subject".
 
too broad
 
@BenFortune a lot posts will be closed then
 
@KarelG That's the point :)
 
yeah, but it should be open, that people can give hints, tips.
 
No
 
11:45 AM
sadly, there are rep whores giving solutions, that the questioner doesn't learn something new and useful
 
I sometimes post a comment that hints towards a solution while still voting to close, that acheives that
 
if you're IBTL yes
 
Consider this:
0
Q: simple backbone js view not working

alaksandarjesusI just copy pasted my previous code and still my code is not working. I am newbie and all i do is copy and paste from examples. And still its not working. index.html <body> <div id="date">Loading...</div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text...

that shouldn't be allowed to stay IMHO
"I just copy pasted my previous code and still my code is not working. I am newbie and all i do is copy and paste from examples. And still its not working."
Now is it too broad? is it unclear? I think "no effort" would have been a perfect fit here
 
yes, no effort indeed. He doesn't even understand what he did
 
11:50 AM
I just dont see the value of keepign questions like that around for people to give hints
 
SO is a question & answer website, not a question & hint website
 
kendall, people learns more if they find out the things themselves, then being given by others
remember the fishing wisdom
 
that's why you shouldn't give copy & paste answers
 
> All projects, ever, should begin with picking the correct Ruby framework to base your application on. Since we don't know what this application does yet, I added all of them.
Lost my shit
 
11:54 AM
you should give a small sample of code with text explaining how it works
 
true. i aim to give explanation with my answers
unfortunately, my posts comes sometimes after other posts which has the answer too, but without explanation. So i remove my post to prevent discussion of "the other was first"
 
Ugh, don’t do that. If you have a better answer, that’s worth a lot more than being first.
 
Code-only answers should be flagged as low quality anyway.
Or bad ones anyway.
 
That could lead to some declined flags...
 
Stupid crashing Chrome made me lose my plunkr! O___o
 
12:06 PM
@JanDvorak I meant unreadable/undocumented ones.
 
And what is it with the stupid "The package xyz does not satisfy its siblings' peerDependencies requirements!" error message? How about telling me which sibling?
 
It's a complex problem
 
12:26 PM
@BenFortune 30000 commits
 
@BenjaminGruenbaum I implemented the decorator for $log as you suggested: stackoverflow.com/questions/29492138/… Comments are welcome ;)
 
user3949359
What's the purpose of finally {} in the try catch block. It either executes the first block or it stops because of an exception.
 
try { noError() } catch(err) { } finally { alert('done') }
 
I don't really use try/catch, especially in javascript
 
user3949359
@JanDvorak instead?
 
12:32 PM
if something fails, it fails asynchronously
or it's a bug
 
@nosille The same purpose as in other languages?
 
can we use try catch in pure javascript
 
@varadmayee 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.
 
sure you can
 
k thanks @JanDvorak i will look at it
 
12:42 PM
!!canvas work or play or work-play
 
@rlemon play
 
user3949359
Why does this function result in unexpected token return?
 
user3949359
function func () {
   return "foo";
}

if(func() == "foo") {
  console.log("success")
}
 
surrounding code?
 
user3949359
That's all
 
12:49 PM
jsfiddle?
 
user3949359
 
@nosille Runs fine in my Chrome F12 console
and runs fine in your fiddle
 
TWIT
 
user3949359
Strange
 
!!urban twit
 
12:51 PM
@ivarni twit The kind of person that makes a retarded chimp look smart. They often can be found leaving definitions for their own name or the names of their friends on urbandictionary.com
 
o_O
 
TWIT = that's what I thought
 
oh
 
“We also would have accepted ‘a pregnant goldfish’.”
 
can you export only a key of an object in meteor package.js?
 
12:53 PM
How would that work?
 
Like I have Battlenet, which has OAuth authentication and an API wrapper. I just want to export the API wrapper. Like Battlenet.api.achievement({ achievementId: '1234' })
 
dark theme jsfiddle kicks ass
 
How would that work?
 
@rlemon Neat. Except for the missing semicolons
 
Who needs semicolons anyways?
 
12:58 PM
people who use real programming languages
 
> real programming languages
 
Haskell is a real programming language and doesn't need semicolons
nor does ruby or python
 
Well, obviously they aren't real enough
They're just faking it
 
As in, too god to be true?
 

« first day (1635 days earlier)      last day (3299 days later) »