« first day (1542 days earlier)      last day (3631 days later) » 

00:29
hit it with a spatula
Tried that
It hit back
setInterval(hitFileServerWithSpatula, 1000);
00:49
Anyone familiar with kendo UI? stackoverflow.com/questions/27771420/…
01:40
hi . i have a question?
@osmanRahimi 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.
what is difference between jquery and angular js?
@osmanRahimi Holy Fucking Jesus.
@osmanRahimi jQuery is a library that helps with DOM manipulation. Angular is a framework for building single page apps.
01:42
It's the difference between being able to type a question into a search engine, and existence as a vegetable.
AAAAH MY HAT
NOOOOOOO
@mintsauce did you not know that we're a search engine?
My New Year's Resolution is to be more grumpy.
@phenomnomnominal I think I forgot!
@mintsauce must be all that grumpiness getting in the way of thinking straight.
@SomeKittens thanks
01:45
:-D
Uh, I mean, >:-()
I think we should all be more grumpy
room topic changed to CantankerouScript: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angular is on topic here stop asking. Don't ask to ask just ask. [ecmascript] [es6] [javascript]
user2620028
i can definitely be more grumpy
CantankerouScript is what you have to write to pass JSLint.
Haha precisely
The Grumpy Parts.
01:54
Anyone have any ideas why app.get("/", ...) works but app.get(path.join("", ""), ...) doesn't work? The latter spits an error; "Cannot GET /", but that's exactly what the former is doing... kinda odd, if you ask me.
ping me if you have a clue. I'm getting off for the night
wait...
`exactly' in the sense of being exactly the same? Or in the sense of being something completely different?
nope, still need help. bye
 
1 hour later…
03:02
hello everyone
"All the nudity in the world can't help me now." -Somekittens (Posted for your viewing by Mrs. Skittens.)
What's the story behind that? ._.
03:22
@Shea Kittens must have gotten over his never-nude condition
No, that's silly. Kitties can't be nude with all that fur.
Maybe Mrs. Skittens shaved him
:O
I'll bet that's it
Must be a San Fran thing
Who knows what those hipsters get up to when no one's looking
Yeah, I blame all of the coffee shops
04:06
@Zirak Familiar with that word
04:18
@SomeGuy "bildungsroman"
Haha, now there's a fancy word!
04:42
@SomeGuy I'm on to the third Hitchhiker's Guide book.
I'm like 70% through the second, but I'll probably read something else before continuing with the series
Slacker
Haha, yeah, I don't read much during the holidays
You have holidays in India?
I thought it was just 24/7 study and/or work!
Yeah, when they've got to clean the factories
04:45
Kinda like the Japanese, but without the amazing food
Hahaha
05:02
05:16
@monners we probably have more holidays.
@SomeGuy Lets declare a new religion, then beg for minority rights and diss the government for being rude by not giving us a holiday on <the date you have always wanted> bam one more holiday ?
@darkyen00 Haha
 
2 hours later…
08:13
room topic changed to JavaScript: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angular is on topic here stop asking. Don't ask to ask just ask. [ecmascript] [es6] [javascript]
@phenomnomnominal Please keep the room name professional
(Write anything you want in the description though :P)
hi all
I have a little problem with some jquery... I have 4 selects, like this : <select class="mapSelect" ...
I get them this way : myCollection = $(".mapSelect");
the item i get with : myItem = myCollection.splice(0,1); gives me a [object HTMLSelectElement] back, but seems like i can't get its id... i'm tryin to do myItem.id, but does not work... .val() neither...
@Julo0sS First of all, myItem = myCollection[0]?
And second, you know you're not using jQuery anymore, right?
Once you do that
If you want to stay with jquery, use .eq()
08:28
@SecondRikudo that seems to be the problem then... but, even if i use ".value" which is js, it does not work... returns "undefined" oO
@SecondRikudo i'll try this...
Maybe it's not the element you think it is
Try console.logging it, Chrome should allow you to see which element is it by hovering it with the mouse.
@SecondRikudo solved it, with myCollection[count] ... and value works then... strange...
thx
function getSvgFileData(url){
	var rawFile = new XMLHttpRequest();
	var myData;
	var myUrl = url+'?t='+(new Date().getTime());
	var myDiv = document.createElement("div");
	rawFile.open("GET",url,false);
	rawFile.onreadystatechange = function(){
		if(rawFile.readyState === 4){
			if(rawFile.status === 200 || rawFile.status == 0){
				myDiv.innerHTML = rawFile.responseText;
				myData = myDiv.getElementsByTagName("svg")[0];
			}else{
				console.log("STATUS NOT 200");
				console.log("SVG PATH : "+path);
i'd like to call ".done" on the function result... but seems to fail if I keep the function as is... can you tell me what I'm doing wrong pls?
like : "myData = getSvgFileData(myUrl); myData.done(function(){});
08:49
@Julo0sS XHR is async, you can't return from it.
721
Q: How to return the response from an Ajax call?

Felix KlingI have a function foo which makes an Ajax request. How can I return the response from foo? I tried to return the value from the success callback as well as assigning the response to a local variable inside the function and return that one, but none of those ways actually return the response. f...

You probably want to use Promises
09:05
thx for help, i'll have a look at this
@darkyen00 Hahaha good stuff
09:30
Hello everybody
@dystroy o/
@dystroy hi
10:28
You can ditch promises by using an event system
the problem with ajax is that it loads asynchronously, but you can circumvent that by coding some of your functions to be event driven
Just.. what? Asynchronous is a problem? Ditching promises for events? :/
you can't return anything from an asynchronous call if the function you return it to is synchronous. It's long gone and has forgotten about the async function. The trick is to not use a synchronous function for your async call. If you do that you can "return" it no problem.
one way to do it is to have some synchronous code that ends by calling an async function. When the async function is done you can make it call a function that takes over where the sync request ended. Makes sense?
basically you can just create and even that's triggered by ajax returning data and continue from there
@Eirinn Why do you have the air of someone who is saying something groundbreaking?
...I'm getting the feeling I'm not doing anything to help all of a sudden?
Basically, you're promoting this:
doSomethingAsync(function (result) { Events.trigger('some-event', result); });
Yes?
10:36
@Eirinn this is the most basic way to handle asynchronicity. But it's also the source of the so famed callback hell which is often JS and is an absolute nightmare as soon as you start doing complex operations involving many asynchronous chained operations. There are a few solutions, a good one is to use promises.
That really depends on your solution
Promises are almost always a better solution
A better one is to use generators
"ok"
@phenomnomnominal well, you don't always have to chain many asynchronous operations. When what you do is simple, using promises don't make your code simpler. I don't use promises client side
10:38
No but not using promises would mean that any further code would tend to not use promises, which would eventually mean async mess as the codebase evolves.
Sometimes breaking out ajax data is simply just a good idea, especially if you're working with multiple sources
@Eirinn promises let you keep a synchronous-like flow in your code while still remaining async. Continuation passing is just a bad way to program, anyone can assert this after doing it for a while
"anyone"? :)
offloading a process and going parallel can sometimes really speed things up man :)
Yes, anyone.
In fact UI code is often naturally event driven. You might not need promises in that code. Logic code do benefit promises (or generators) more.
@Eirinn That's not really related to events/callbacks vs promises/generators, it is ?
10:41
Parallel != asynchronous. And promises are still asynchronous.
yeah it is.
I ditched promises and generators for continuation passing not that long ago. I don't think continuation passing is a bad idea while ES6 is not yet standard. It's simple, and with appropriate planning (the same you need for using promises effectively) it doesn't look too bad, either.
@RoelvanUden 6to5
I guess "anyone" is out the window now
Not everyone wants a build pipeline for their code.
10:43
@RoelvanUden continuation passing isn't specific to JavaScript, so why would the ES6 standard have anything to do with it?
well that and sometimes shifting a few things in seemingly synchronous code (or re-using) is tremendously annoying
Just because you can't use generators yet, doesn't mean you should do CPS
But it does take planning, for sure
@phenomnomnominal ES6 introduces native Promises and (ab)usable generators/iterators for nicer control flow. All that without additional libraries or code compilation steps, at which point, it makes all the more interesting. :-)
Existing A+ libraries have the same syntax, why not use them ?
10:45
If you're gonna wait for JavaScript to stabilize and then be up to the spec in browsers, you're gonna be waiting a long time
(CPS can be parallel btw)
I'm with @phenomnomnominal on taht one
@Eirinn synchronous code can be parallel too.
yeah, it can
Sounds like you're saying big words without knowing what they mean... It's annoying
sorry let me rephrase that
yeah, it "can"
10:47
When working with JavaScript you have to deal with the fact that you're always going to have to be backwards compatible to a certain extent. Writing worse code because a feature isn't implemented in all browsers yet is silly when you can use something that will eventually be.
or might eventually not, specs change :/
Yeah, es5 changed a lot recently
Yes but there's a long period, say ~5 years between standards being formalized and browsers that don't support said standard being obsolete.
Long live supporting IE6. That said, I like to code without dependencies. CPS because everyone can read it and requires nothing makes sense for certain scenarios. I don't ask y'all to agree on the choice, but it is a valid choice and not "bad" per-see.
5 years is probably on the low side of an estimate
Fuck IE6, but what about IE9? It will be a long time before we can all stop supporting that.
10:50
don't forget compatability modes and forced docs >_<
@RoelvanUden I don't agree it's a valid choice.
at least Microsoft is ditching IE now, although it can't change the past. And honestly, the newer IE are ok.
I think it's not a valid choice.
2vs2 then
Most regulars will argue promises over CPS. Because of reasons, I suppose.
10:53
or because CPS doesn't solve callback hell when you have multiple chains of asynchronous operations
And argue generators over promises. Weird people.
The right tool for the right time. Neither @RoelvanUden nor I are arguing that it's the best way to do things always. That's you guys and promises :)
@RoelvanUden have you ever inherited a project in CPS? Or even just gone back to one in a years time?
Isn't it the 3rd time I'm saying generators over promises?
inb4 Monads
10:55
@FlorianMargaine probably more
@phenomnomnominal I actively develop and maintain a CPS project in node, and actively maintain CPS-style browser-based software at work, as well.
@BartekBanachewicz happy new year! How was the SO break? :)
@RoelvanUden that's not what I asked
That is what you asked.
naw he asked if you ahd inherited another person's code
10:57
No, I asked if you'd inherited one.
@dystroy phew thanks, I thought I was just ignored
I maintain CPS-style browser crap at work, I didn't write that.
CPS is horrible to inherit without a code plan, and fine with one
Functions are named and never more than 3-deep nesting. Not bad.
I don't think I've been this short time on a board either before being insulted either, i think I'll reward myself with lunch.
11:00
@FlorianMargaine hi :) Quite well, I'd say. I've spent a lot of time with my family. Trying hard to get back into working mode again
@Eirinn Insulted how?
I was wondering that too. Is it when I said "sounds like you say big words without knowing what they mean"?
@BartekBanachewicz great
@BartekBanachewicz if you need a troll receiver discussion partner to get back to work, hit me up
haha, contrary to popular belief, my work doesn't consist only of trolling discussing on SO :D
@BartekBanachewicz just what 80, 90%? :)
11:06
33
Oh hi @BartekBanachewicz long time no seen
@Eirinn oh boy...
@BenjaminGruenbaum hi hi hi
@Eirinn oh boy...
I like you can't return anything from an asynchronous call if the function you return it to is synchronous in particular
almost like M a -> a
CPS is completely manageable, just to be clear here.
@BartekBanachewicz yeah, but you can return an M a that's the whole point of promises, and of values with contexts in general.
@RoelvanUden it's a shame because you're smart. You know how to use CPS, but you also clearly know that coroutines are the superior solution, I wonder why you're arguing against them
11:09
13 mins ago, by Bartek Banachewicz
inb4 Monads
"returning an M a" is kinda the point here, agreed. And is the point being missed, no?
Promises are monads?
@Eirinn promises and event emitters complement each other, they abstract different stuff. They're almost mutually exclusive. A promise is a special case of an event emitter exactly like you can think of a getter that returns a single value as a special case of an iterable.
Monads are more general than that
[tag:cv-pls] http://stackoverflow.com/questions/27778268/getting-e-after-float
(my first cv-pls in weeks)
(I still don't know what monads are... I think I know the concept, just that I don't understand the definition)
11:10
Oh... It seems I forgot how to do that...
@FlorianMargaine monads represent a value + context, promises are a value + context where the cotnext is time. Although promises in JS are monadic but not monads.
@FlorianMargaine There's 101 implementations of promises and you could prolly find some that don't satisfy monad laws, but otherwise they fit the monadic scheme of returning computations. TLDR in practice (IOW simplified simplistic explanation), yeah.
No more tags in this chat ?
@dystroy multi line markdown still sucks on SO
Oh yeah, it's a multiline thing.
Also, am I the only one who hates when OP accepts an answer but doesn't upvote -_-?
11:12
And your definition still doesn't help ftr :P
@FlorianMargaine they are a more general way of expressing what promises and other contextful computations are and how you can interact with them in a similar way.
@FlorianMargaine I didn't try to explain monads, you just asked if promises are monads and I said yes.
On mobile and gotta go
Let's try later
11:12
Just say the Imitation Game btws. Very cool. Nice little digestible summary of an amazing mans life. Didn't quite give enough weight to his accomplishments, but the movie would probably have been too technical if they had done it justice.
@FlorianMargaine I'm not arguing against them. I'm arguing that CPS isn't always an inferior choice as some would like to make people believe. It has advantages in being simple, without dependencies, and clearly understood by everyone (even beginner and less talented programmers). I just don't agree with the statement that "Promises are always a better choice".
@FlorianMargaine don't worry we have the whole 2015 for that :D
All I said is that most of what Eirinn said is kind of wrong :P
3
@BenjaminGruenbaum Well... I'm sure I did that at least once or twice. An answer might be correct and still not good
11:13
@RoelvanUden no, beginners don't understand CPS. Benji most up voted answer wouldn't exist otherwise
cv-pls'd question answered. answer upvoted within a second.
@RoelvanUden I don't agree with "promises are always a better choice" either.
36 mins ago, by phenomnomnominal
Promises are almost always a better solution
@FlorianMargaine link?
To be fair, there's an "almost" in there.
11:14
@RoelvanUden "dependencies" is kind of a flawed argument, especially when one of the most prominent pro-js arguments is ease of deployment with dependencies. (because of npm/browserify and whatnot)
"How to return from ajax"
Oh. That.
@RoelvanUden Also, promises are simpler (they're native) the language itself comes with tools to aggregate and race them and they don't have any more dependencies - if anything with promises tools are opt-in and with callbacks you almost always have to use async.
Gotta go for real now
That said promises model something very specific, they model a single value + time and bad things happen when you use them for anything else.
Want to model an event emitter with a promise? Too bad. Should've used an observable.
11:16
or ListT Promise :-D
@BartekBanachewicz You'd be surprised how many don't use any kind of package management. Especially in my work field it's really quite uncommon to think about JS deployment strategies (Isn't JS that thing you do in the browser to move some DOM elements? :P)
@JanDvorak actually not the same thing :P
@BenjaminGruenbaum a list of promises might work, wouldn't it?
@JanDvorak how would a list of promises model a stream of click event?
@RoelvanUden WRT your (...) - not really. I believe it ceased to be that quite some time ago for quite some people. And when your needs grow, so should your needs for dependencies; it's only natural that even client-only JS codebases eventually will need more complex builds.
11:18
@BenjaminGruenbaum each promise is a promise of the next event. You wait for each promise in turn in order to get a stream.
@JanDvorak I've realized I haven't ever used ListT
@RoelvanUden there are maybe 4-5 things you can use promises for in the browser in most cases. Those are usually ajax, animations, RPC, timers, ready events etc. With most of what you model in the browser you need event emitters since things fire more than once (text value change, mouse click, mouse enter/leave etc).
I want to.
Also inb4 FRP guys.
@BenjaminGruenbaum For the moment you need ES6. Since many work on IE9 (and I even go back to IE6), you need dependencies. Then you need to argue that promises are easier, and explain them to people that don't get it. Promises aren't easy for all. I simply went back to CPS in my hobby project because of the dependencies, but 6to5 might make me try again.
11:19
@BartekBanachewicz damnit I was just typing that :P
Also, I want to meet a situation where IoT [] or ListT IO would help
there's no IoT
@RoelvanUden how is "bluebird" all the dependencies?
I never know if I don't understand @BartekBanachewicz because he's speaking haskell or because he's speaking the strange language of the young people...
It's "a" dependency, if you target IE6 you better have jQuery.
11:20
!!urban inb4
@CapricaSix are you asleep?
@dystroy it's ancient 4chan for "the topic I'm saying next will be discussed here shortly"
It's still a dependency. I'm talking about people who don't even use libraries other than jQuery you know. There are tons of them, and you may need to work with them. You can't go around making things all fancy because you'd be the only understand.gin.
@BartekBanachewicz I'm pretty sure I've seen one, but I'll recheck
26
Q: Why is there no IO transformer in Haskell?

DavidEvery other monad comes with a transformer version, and from what I know the idea of a transformer is a generic extension of monads. Following how the other transformers are build, IOT would be something like newtype IOT m a = IOT { runIOT :: m (IO a) } for which I could make up useful applica...

11:21
There's a word for writing worse code instead of educating people - technical debt.
3
@RoelvanUden jQuery ships with promises and does the 5 things I talked about with promises by the way - the exception is ready events which are a promise internally but not externally.
What did I see then? Was I thinking about transformed IO?
maybe it was just (applicative) functor instance for IO
I don't use the applicative style, actually. Should I?
What applicatives aren't monads?
@JanDvorak I'm finding more and more uses for it these days
11:23
@RoelvanUden that said - writing code with less sound abstractions in order to make it easier is definitely a valid thing to do - look how popular PHP is.
any one good with AngularJS Directives: stackoverflow.com/questions/27778421/…
@JanDvorak Can't recally any in particular on the top of my head, but for some scenarios not implementing Monad instance is easier IIRC
im trying to creative Directive for Option SELECT dropdown.
Applicative style comes naturally when you realize you need/want fmap
@BartekBanachewicz Mostly for own types then? Thanks.
11:25
@JanDvorak Not really. I was thinking stuff like weird data containers for example.
how can I "merge" 2 pdo queries (already executed)?
I'm not sure about that though so don't believe me and read up on that yourself.
@BartekBanachewicz sparse maps? Are they applicative?
@BenjaminGruenbaum Thank you. That is pretty much the point I've been trying to make, but for some reason, many don't want to affirm. There is a lot to be said for keeping things as simple as possible.
0
Q: AngularJs Directive for crossbrowser SELECT Dropdown

STEELI'm trying to create below Cross-browser dropdown ; Currently this is my HTML: angular.module('myapp', []). run(function($scope) {//temporory stuff $scope.ips = ["AARPOperatingFunds", "SomeBigTitle", "IhatezIE8", "ILoveFFDeveLoperEdition", "GiveMeSomeLove"]; }); <script sr...

11:27
@RoelvanUden not simple, easy. Big difference there. I believe promises are simpler but callbacks can be easier to grasp initially.
There's also the fact more JS developers know callbacks already which is a perfectly valid point on its own
Also since you work at a C# shop I'd expect people to be familiar with Tasks but not with callbacks - but for the general case easy code has plenty of merits.
Otherwise Haskell or LISP would be the most popular language for web development and not PHP
Exactly. :-)
It's (way) easier to implement callbacks from scratch => they came earlier => more familiarity.
Is it correct to write LISP or Lisp?
I saw it both ways plenty of times.
IIRC FORTRAN is spelled all caps because it appeared before the advent of small/big letters
so is COBOL
11:29
You should sneak good abstractions into your code when possible though, just saying.
@BartekBanachewicz Write Haskell :-)
oh wait "Fortran (previously FORTRAN"
COBOL is an acronym right?
g2g, sorry
something something business oriented language
11:30
> Lisp (historically, LISP)
!!wiki cobol
@BenjaminGruenbaum Crappy and Old Business Oriented Language
categorically outdated?
LISP is an old lisp, Common Lisp is usually called Lisp
11:31
Catastrophically outrageous
Every time I talk about cobol I think of that badass picture of Grace Hopper in uniform - so hardcore.
Casually overrated?
@FlorianMargaine I thought Lisp was clojure and CL was common lisp.
(I am, just being annoying of course :P)
My Mom used to code in COBOL back in the days.
@BenjaminGruenbaum it's also thus, depends on the context
11:32
@dievardump your mom did lots of things she regrets back in the days.
3
@dievardump I think my mom washes the dishes with one of those
When you speak with me, I mean Common Lisp when I say Lisp
*Your mom is so old she coded in COBOL*
I'm not sure this one would work very well
Fuck this lazy markdown implementation !
Yeah. I have friends my age who code in COBOL.
COBOL actually has both monads and objects.
@FlorianMargaine they probably make a lot of money
11:33
@BenjaminGruenbaum so does @dievardump's mom
@BenjaminGruenbaum not really. I thought that too.
Hello
@phenomnomnominal Aha, man, I say so much crap about my mom that this look like compliments.
@FlorianMargaine Oh, then why do they do it?
@BenjaminGruenbaum so does F#, as a more modern example
11:34
@dievardump seriously though, she's a lovely woman
A few of my friends were offered to work in COBOL or on Lotus Notes and were said they would be rare and expensive. It looked like a trap.
@BartekBanachewicz so does Scala, but neither are 50 years old :D
@phenomnomnominal That's what all the man of Internet who never met her say.
@dystroy yeah, it can be a career killer.
I am setting disabled property to true for img tag but it only working on IE. In firefox its not working. Can someone give me a alternate solution?
11:36
sorry -
Sorry img tag
what should do a disabled on an img ?
@dievardump It turns into text (not really)
@Chets what's the goal ? What do you want to happen ?
Property disabled= true
Need to disable img tag in all the browsers
@dystroy
11:37
You mean you want to hide the image ?
suspense is killing me
No just make it disable so no one will click it
@dystroy
what happens when you click an image
It allow me to click
Don't kill @dystroy bro, tell him what you need your disabled image to do.
11:39
@Chets should it forcefully move your mouse cursor away?
Do you have an event handler of some kind on that images (maybe added through onclick="...) ?
An image does not do anything on a click except if you tell it to.
Does it get selected?
Yes it have onclick event handler added in design
So, remove that onclick event handler
11:41
Yes that is one solution but i need it further
@Chets you are not making sense
The img element does not have a disabled property
So you're actually writing invalid HTML
If you want to not do anything when an image is clicked, remove all click event handlers from it
I have created a common function to make img disable, following is the code
list = document.getElementsByTagName("IMG");
count = list.length;
for (x = 0; x < count; ++x) {
ctl = list[x];
ctl.disabled = true;
ctl.tabIndex = -1;
}
The fact that it has an onclick attribute is bad on its own, just remove it.
11:43
Alternatively, you could set a flag that is checked when the onclick event is fired.
@Chets img does not have a disabled property. It does not do anything.
@Chets disabled does not exists n img elements. that won't work. Find a real solution.
Please don't try to hack around another hack.
@SecondRikudo Its working fine in IE 9 and 11
ctl.onclick=44; should do the job
11:44
Everyone knows you need at least three hacks before it is okay
@Chets That's 10 years that nobody expect something to work in another browsers when it works in IE.
@phenomnomnominal There's alredy 3 4 implicit global variables, it's on a good track
@Chets IE sucks.
@dystroy ctl.onclick=44; is working
5
@Chets Please don't.
11:51
for fuck sake
@dystroy Please don't troll the newbs
@Chets set ctl.onclick to null or something, not to 44.
Ok thanks
hell, you shouldnt be attaching events directly to a tag at all
@dystroy keep trolling the newbs. If they get too good they might take our jobs one day.
3
Well... What's the problem with 44 ?
11:54
heh
Can I star http://chat.stackoverflow.com/transcript/message/20783149#20783149 ?
I just love it.
@dystroy I hope you're not seriously asking, my sarcasm detectors are in the shop getting repaired.
@dystroy It's not 42.
@Chets ignore the negativity, people here are just very upset when they hear people write code that caused them bugs. It's all trying to help.
@Chets You should explicitly declare your variables (including x) with var : this will prevent bugs
> Because of these three differences, failure to declare variables will very likely lead to unexpected results. Thus it is recommended to always declare variables, regardless of whether they are in a function or global scope.
11:58
And everyone else - you should probably read the last 40 lines of chat here :P
Thanks to all of you

« first day (1542 days earlier)      last day (3631 days later) »