« first day (1945 days earlier)      last day (3002 days later) » 

8:00 PM
@Mosho perfect.
 
It shouldn't matter if it happens or not; as I said, don't take one step back and then two steps forward. It's a waste of time and effort.
 
@RoelvanUden NNNOOOO IT'S DEAD
 
Yeah :P
 
It was the most amazing thing!
Sorry @Abhishrek, it died
 
Nooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
 
8:01 PM
Imagine a popup which lets you search SO, and it pastes the answer into your code.
 
That sounds incredibly annoying, unless the snippet is exactly what you need
 
It sounds a bit like stacksort
 
@Mosho I guess you could say the Justice League went down in flames.
 
best 24 minutes of my day
 
No solutions please...im trying to learn. Guys, one question though, am I close?
Ay < By && (Ay + A.offsetHeight) > By
 
8:08 PM
@rlemon - listed it, will watch tonight :)
 
collision for divs in the vertical space (without the x collision part)
I know I can google it but I want to figure it out on my own
 
Guys, how do you handle the race conditions when testing event listeners?
 
race conditions?
 
@Asperger first to the finish wins, no tripping, no assistance, must stay on course
 
such as, say, one event sends an ajax request to populate div A, and another replaces div A with div B?
design it so that said race condition can't happen
 
8:15 PM
is it okay or bad practice to test for a variable value being undefined?
 
depends on how you intend to use the value probably. I haven't had much need to do so in my work thus far
 
maybe I could do var isKit = attributes.getAttribute('isKit') || false
 
@corvid - I have no idea if this is best practice or not, but I would maintain a hash of all the loaders with some kind of master test to ensure all the child processes had loaded before moving on
 
yeah that will work
 
I had a lot of that kind of thing in my last project
 
8:17 PM
Would it be possible to move an event listener to somehow run after every other event listener of the same type?
 
if the aggregation manager dispatched it's own event, then yeah
 
@JoJo is isKit meant to just be truethy, or does it actually need to be a boolean
 
promises and rx eliminate the need for anything fancy and hand rolled @corvid
 
well there does not seem to be another attribute if it is another node type so I will just fudge a false
 
@BenjaminGruenbaum Would that work for something like a Node TCP socket though?
 
8:22 PM
@corvid Rx? Definitely.
 
@MikeBoutin I indeed have some friends who went to Quebec. Then they came back.
@rlemon if I ever come to the other side of the Atlantic ocean, it's to come to your wedding
 
lol
okay
 
living on Quebec? wtf man...
 
he said all french people wanna live in Quebec
 
I don't want to spend my days with french wannabes
 
8:26 PM
don't ask me
 
@jhawins uhhhhghhh
 
@Loktar well, he did tag you...
 
... so I should gimp his face..
done and done
 
:Loads GIMP:
 
8:31 PM
thats gross
 
Haha
 
can somebody help me understand this
Please write JavaScript function "mulc" that accepts only one (first) argument and returns a delegate (another function) M. Another function M should accept another one (second) argument and return multiplication of first & second arguments.
 
@Nikanor Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
should my main function actually take two arguments? if i am to use it in returning one
 
no
main function takes one argument
 
8:40 PM
@Nikanor FYI, that's called currying, and there are lots of languages that do it automatically
 
returned function takes one argument and binds the former arugment
 
can you give me example of solving above task
 
so it actually takes two arguments
 
in your case it means mulc(5)(3) evaluating to 15
 
@Nikanor I would love too
but first can you show me what you have tried?
because I would hate to do someone elses homework/task for them
 
8:42 PM
I ask because I am confused by this question, how should it accept only one argument, it must use two arguments
 
well kendall gave you a big hint with the keyword currying
 
Let me show you some more examples
Say you have a function mulc
 
function mulc (onlyOneArgument) { }
 
how about a bad example?
 
the rest is left as an exercise to the reader
 
8:44 PM
@phenomnomnominal :P
 
console.log(mulc(3).M(2)); // 6
 
var multiplyByThree = mulc(3);
var twelve = multiplyByThree(4);
var twentyOne = multiplyByThree(7);
var sixteen = mulc(8)(2);
Does that make sense to you?
 
would you use .bind in a currying function or not? I just looked to see what he would find on google and it isn't quite what I had written :/
 
mulc(3) returns a function that multiplies a number by 3
 
I mean, for efficiency
 
8:46 PM
@rlemon I wouldn't, mainly because I don't know how that would solve the problem
 
I will wait then
 
.bind is used to curry existing functions, not write a "pure" function
 
well yea, I will wait
I don't wanna answer his question
then we can discuss if my method is stupid or not
 
Seems reasonable to me
I'm pretty sure I know what you're thinking, at least.
 
8:48 PM
impressive
 
at first I though he was giving himself a wedgie
 
@rlemon You should probably read the wiki article, since my terminology isn't great, and I'm not 100% clear on what counts as currying
> Currying and partial function application are often conflated.[13] One of the significant differences between the two is that a call to a partially applied function returns the result right away, not another function down the currying chain
 
i've never heard of that term. currying.
 
ugh, fucking finally
I have created an Angular controller that replicates the events coming out of an HTML Media element
 
8:51 PM
@ShotgunNinja put it on github
 
Right now it's very project-specific, but I'm going to be putting it on my blog eventually
 
@phenomnomnominal If your underbritches stretch that much you have other issues.
 
@Trasiva ease of access is important
 
Basically, I was tasked with creating an Angular-based player for OpenTok multi-stream archive files.
 
@phenomnomnominal Dude, you could easily fit three sheep in underbritches that stretchy!
 
8:52 PM
@Trasiva or two cousins!
 
They're zip archives with a bunch of webms and a JSON file containing start/stop times for each video
 
@phenomnomnominal Or a dozen chil...nope, not going there.
 
My controller loads the zip file after requesting it from S3 (where it gets placed by the OpenTok API), opens the zip file in memory, generates the video elements, and slaves them to its own custom event generator.
 
@Trasiva you meant sheeps.
 
It's got support for play, pause, seek (with resume), volume control, and end of stream
 
8:54 PM
1 min ago, by Trasiva
@phenomnomnominal Dude, you could easily fit three sheep in underbritches that stretchy!
 
@FlorianMargaine sheep is the plural of sheep
 
@phenomnomnominal I've never seen an Asian man quite so excited about being naked.
 
@phenomnomnominal weird
 
@FlorianMargaine english is very weird
 
@rlemon bind has poorer performance, probably shouldn't use it for currying
 
8:55 PM
@KendallFrey that's a lie.
 
@Mosho but if it didn't?
conceptually? would it be accurate?
 
@rlemon I clearly demonstrated how stupid bind is to you :P
 
shhhh
 
you could of course use it for currying
I mean, it's possible
 
it doesn't help you though
 
8:57 PM
well yea I know it's possible.
 
crl
made this table selection polyfill jsbin.com/cacarew/edit?html,js,output (for chrome and a bit for firefox that can't do square selections) any suggestion?
 
what's the use case?
 
@rlemon No, bind does partial application: It specifies some arguments. It does not turn a function f(x, y, z) into f(x) -> (y) -> (z)
 
19 mins ago, by Nikanor
Please write JavaScript function "mulc" that accepts only one (first) argument and returns a delegate (another function) M. Another function M should accept another one (second) argument and return multiplication of first & second arguments.
@Zirak Correct, I was telling him about terminology
 
@KendallFrey That's quite simple, no need to go to bind or curry lands
 
crl
8:58 PM
@MadaraUchiha thanks felt that too while reading,
 
@Zirak Indeed, I showed him how
 
@Zirak yea I was just questioning my initial inclination towards the answer
 
crl
s/w/v/
 
@KendallFrey lol I was asked that in an interview once
 
Technically, the question asked isn't actually currying, is it?
 
8:59 PM
9/10 if I'd get asked that in an interview I'd teach the interviewer something
 
A truly curried mulc function would have to support mulc(3, 5) -> 15 ?
 
@Retsam Yes, as Zirak and I both said
@Retsam no, currying the function would mean converting mulc(3, 5) form into mulc(3)(5) form
const curry2 = f => a => b => f(a, b);
curries a function with 2 parameters
 
@Retsam That's done under some implementations
But a "pure" curry only gives you a function accepting just the one argument
 
@Retsam that would be auto-currying or something
that's how they call it in lodash at least :P
 
9:03 PM
@Zirak Are there any languages that allow partial application as well as a clearly non-curried version? Without such crap as .bind I mean.
 
!!tell DomagojSabolic Welcome
 
@KendallFrey Haskell IIRC
 
@DomagojSabolic Welcome to the JavaScript chat! Please review the room rules. Please don'task if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
I already did
thanks
 
@Zirak Haskell really only has partial application
 
9:03 PM
Ah; I guess I'm confusing currying with just the idea of a function that takes arguments one at a time.
 
@KendallFrey F#, Haskell
 
the syntax is such that it looks like a single call with multiple arguments
but it can be deconstructed to partial application
 
crl
I want a composition operator in js
 
me too
and in C#
 
crl
and on my keyboard
° is too high
 
9:05 PM
huh? Partial application is a subset of currying. Multiple partial applications is currying.
 
@crl .
 
crl
oh indeed, but with a space before probably, easier for compiler
 
@Zirak Partial application is what you do after the function has been curried
Haskell does currying automatically, so there are no functions that take multiple arguments at once
tuples and compiler optimizations notwithstanding
 
function currying() { return ['onion','coriander','ginger','chilli','mustard seeds','turmeric','tomato','coconut milk'].map(cook) }
 
I think you wanted reduce
 
9:09 PM
fuck
4
:(
 
okay
 
@Zirak ^
 
crl
what did crash? (jk
 
How am I supposed to get Reputation when I don't know anything!!!
 
learn things
 
9:10 PM
start learning. :)
 
@xZ4FiRx Learn something
 
learn to rephor
 
@KendallFrey meh I started writing out how I also look at "currying" as a special form of partial application but got bored.
@FlorianMargaine Congrats!
 
How am I supposed to make something of my life when all I know is jQuery?
 
21 mins ago, by Kendall Frey
> Currying and partial function application are often conflated.[13] One of the significant differences between the two is that a call to a partially applied function returns the result right away, not another function down the currying chain
In mathematics and computer science, currying is the technique of translating the evaluation of a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument. It was introduced by Gottlob Frege, developed by Moses Schönfinkel, and further developed by Haskell Curry. Uncurrying is the dual transformation to currying, and can be seen as a form of defunctionalization. It takes a function f(x) that returns another function g(y) as a result, and yields a new function f ′(x, y) that takes a number of additional parameters and applies...
 
9:12 PM
@ndugger congrats! you made it!!!!!
 
@ndugger ^
 
@KendallFrey Unless it returns another partial application
 
I clean my toilet with bleach
 
@Zirak thank you. Come join me to the Lisp world!
we have wizard hats!
 
i did it through carrying thanks Kendall
 
9:12 PM
I just need 100 rep to get into this chat room. Some one help me
 
f(x, y, z) = x + y + z
partapp(f, 1)(2)3);
 
@KendallFrey wat
 
@xZ4FiRx err, what?
 
@xZ4FiRx You already are in this chat room; what do you mean?
 
Not this one...
 
9:13 PM
only this one matters.
 
This is the only chat room you'll ever need
 
@xZ4FiRx Aside from the global 20 rep limit, there are no reputation limits on chat rooms on Stack Overflow.
 
@FlorianMargaine I actually wrote a small lisp parser a few days ago. It was fun.
 
I need 100 rep to ask question in the Android chat
 
@Zirak hehe
 
9:14 PM
It can't do much. But boy does it have parentheses.
 
@xZ4FiRx I'm telling you in advance, if your entire goal is to reach the Android room to ask a question, they won't accept you.
 
@xZ4FiRx Maybe you should ask elsewhere
 
^ ^
 
What? Android room made up their own rep cap about asking questions? What a bunch of tools, lol
 
@KendallFrey like, on a website specifically made for questions
 
9:15 PM
@Zirak I can't determine meaning from code with syntax errors
 
> The minimum reputation required for access is 100 points on StackOverflow.
lol, what a bunch of toolbags
 
I just want help from real people.
other rooms are empty
 
they have their own rules for their own reasons
 
that's what you get when you ask a question on stackoverflow
 
@KendallFrey Let's pretend you're not stupid
9
 
9:17 PM
@FlorianMargaine Is there such a thing? I mean truly? Just trying to imagine something like that is causing a Stack Overflow in my brain.
@Zirak That's totally star worthy, haha.
 
@Zirak Let's pretend your code isn't ambiguously broken
2
 
Let's pretend I'm super good looking and have 7 girlfriends
 
my imagination isn't that good
 
:(
 
@ndugger I can't even imagine that on LSD.
 
9:18 PM
Do I smell something burning?
Oh, wait, it's you.
 
Can we stop pretending now? My head hurts.
 
// create a function named f which accepts three parameters: x y and z
// the function named f then returns the sum of x y and z
f(x, y, z) = x + y + z
// COMPRENDRE?

// let's imagine a function named partApp which does partial application
// partApp accepts a function and vararg arguments
// it returns a partially applied function, which can be called with additional
//arguments until all the function's arguments are passed
partapp(f, 1)(2)(3); // WERE YOU DROPPED AT BIRTH?
// COMPRENDRE?
@KendallFrey Better?
 
fuck
 
Also: ramdajs.com/docs/#curry is pretty much what I meant.
 
partapp vs partApp the documentation is a bit inconsistent
 
9:20 PM
I can't balance unbalanced parentheses
 
Does anyone here know anything about Android when it comes to parsing JSON with retrofit and GSON lib? Wrong room, yeah I know....
 
thank you
 
@Zirak no but your parens were
OOOOooooooooOOoooooo
 
now that's weird, because why would partial application also perform currying?
 
Because it's not exactly currying. I could've written the above as: partapp(f)(1, 2)(3)
Currying is the form with one parameter down the line
 
9:22 PM
that's weird
 
But I think that's exactly how Haskell behaves
 
why would partapp specifically use 2 arguments?
@Zirak In what situation?
 
Whadya mean?
 
@Zirak What he means is that partial application works on one level (returns a function that will return a value) whereas currying is more of a recursive/automatic operation
That will keep returning functions as you partially apply more and more.
 
@Zirak I'm assuming that if f(a, b) is valid, f(a, b, c) is invalid. Therefore, partapp specifically uncurries the first two arguments
 
9:24 PM
@xZ4FiRx Why not just make a question on Stack Overflow and tag it with ? It's probably going to be leaps and bounds ahead of asking such an offtopic question in this room.
 
@KendallFrey I think it works in the one I described above
 
You're saying that partial application is when you curry a function, and use some, but not all of the resulting functions? — SpoonMeiser Oct 20 '08 at 11:22
 
@Zirak which one?
Can you write a fiddle?
 
@KendallFrey All of them are valid. It just keeps returning a function accepting less and less arguments until you supply all of them.
 
So it's dynamic in the number of arguments?
 
9:25 PM
@MadaraUchiha Right, and I'm disagreeing in that I view part.app as a form of currying which accept vararg functions instead of unary functions
@KendallFrey It keeps accepting arguments until you supply all of them
 
gross
 
@Trasiva Because people like to ignore my questions
 
// f is a ternary function
f(1, 2, 3) === f(1, 2)(3) === f(1)(2, 3) === f(1)(2)(3)
 
So the chat is my only hope
 
@xZ4FiRx That's not how SO works. If you ask a good question with all the relevant information, someone will answer it. If you ask low quality questions, you're absolutely right that they're going to get dismissed and ignored.
 
9:26 PM
@Zirak but what about variables? f(u) ??
 
@Zirak Now my original question becomes relevant. Are there any languages that explicitly do that?
Haskell's syntax means there's no such thing as applying multiple arguments at once
 
@xZ4FiRx Read this, our own friendly moderator @MadaraUchiha wrote it. It should get you on the right path in terms of asking questions. That's about all the tools I can give you.
 
@KendallFrey Ramda's curry does, as doe functional.js and fn.js
 
They very well may ignore your chat questions too, if they're not particularly interested in answering them.
 
neat
I like how it describes it as an "unusual capability"
 
9:31 PM
I saw partial application used in real code at work today
that was fun
in python, no less
 
Just got my baby back good as new <3
 
Back from the...baby shop?
 
Yes, the baby shop
 
It's where I buy all of my babies
 
How did your baby break?
 
9:34 PM
where else would you buy babies?
 
Babies are a good source of protein, and they haven't built up their muscles yet so they aren't tough and chewy.
 
mini van
 
@FlorianMargaine Baby shops are often unethical and encourage breeding; I prefer to get mine from the local humane society.
 
I only buy babies in the farmer's market. Free-range babies, not those industrial baby farms where they put thousands of babies together.
I also make all the baby oil at home. It feels fresher that way.
 
I get mine cheaply, from overseas
usually girls, they're the cheapest
 
9:36 PM
Yeah but you lose your profit margin on shipping tarifs
 
Depends on what your goal is. If you just want a baby for a single night when you're extra down then sure. But if it's a baby for a fancy occasion? Or you plan on stocking them for some time? Some of the cheaper babies go bad quickly.
Plus, the import tax can be steep.
Anyway @SterlingArcher what was wrong with your baby?
 
You can counter the baby import tax by outsourcing your current babies for a higher GDP.
5
@Zirak oh you know, the usual. Rear end damage
 
That would look beautiful on the star list out of context.
 
@SterlingArcher Oh yeah. That can be quite difficult to fix, especially on the rarer models.
 
@SterlingArcher jesus dude lmao
 
9:38 PM
I once met a guy who had the rear end completely torn and runny.
 
So Sterling's baby had rear end damage... I'm concerned.
 
No but seriously, my Audi was rear ended by a mini van and I just got it back from the shop.
 
Dude, language
 
@SterlingArcher damn wtf dude
that sucks
you good?
 
no man
 
9:40 PM
er wait, this happened a while ago nm
 
This was a couple weeks ago but yeah, no injuries :)
 
he got the minivan
 
I remember hearing about it, lol I thought you got hit again
 
I know, right? .... phrasing!
 
@SterlingArcher no balls scratch at least
 
9:41 PM
omfg
 
Haha
 
@rlemon Maybe he even got angry pirate'd!
 
pegged with a leg?
 
On the bright side the girl who pulled my car up complimented me :D
 
(look it up in the urban dictionary, nsfw)
 
9:43 PM
@Zirak totally lol'd at the "example"
 
So my PM didn't like how complicated bluebird was (despite my working example, and he showed me this module called async, and I think I'm in love.
 
There's also the angry dragon, the donkey punch, strawberry shortcake, ...
@SterlingArcher async is so much more complex than promises
 
I showed him my async await code from SourceUndead and he loved it, but we're not able to use ES6/ES7 (nor transpiling)
 
It's what was used before promises were brought into js-land.
 
For what we're doing it made the code much more readable though
 
9:45 PM
Whatever works for you.
 
Specifically binding values to the next async method
 
@SterlingArcher "dependencies: bluebird"
 
Yeah I saw that lol
 
I prefer promises over async module
 
why not use regenerator with async/await keywords?
 
9:47 PM
setInterval(function() {
	async.waterfall([
		function(callback) {
			var db = mongo.connect(url, function(err, db) {
				callback(null, db);
			});
		},
		function(db, callback) {
			db.collection("characterization").find().toArray(function(err, doc) {
				callback(null, db, doc);
			});
		},
		function(db, doc, callback) {
			doc.forEach(function(index) {
				console.log(index._id);
			});
			callback(null, db)
		}
	],
	function(err, db) {
		db.close();
	});
}, 5000);
This is how I'm using it.
The waterfall method is very nice for binding
 
You're ignoring err :(
 
whoa
if you get a db connection timeout for any reason it's going to take longer than 5 seconds to timeout
 
Oh that's for testing
It's going to be 5 minutes
@Zirak not for long
I'm also going to clean it up and use named functions instead of an array of anons
 
@SterlingArcher Do you really want to do something once per N seconds, or are you polling?
 
Well, we get a 24 hour data collection set to run a control signal on, then every 5 minutes, check the control to the new 5 minute data set for a signal authentication heartbeat
 
9:51 PM
I think mongo has a concept of not closing a cursor
 
For the node module?
 
In general
Search for tailable cursors
 
anybody know how to transfer props to a child in react?
 

« first day (1945 days earlier)      last day (3002 days later) »