« first day (1384 days earlier)      last day (3569 days later) » 

11:00 AM
well technically yes
 
@blackbee wrong.
@jAndy :P
 
@blackbee yes
 
Lots of things are painful to do without recursion, in JavaScript too.
 
so number in parameter list and var number ar entirely different beings?
 
@BenjaminGruenbaum I'm not disagreeing. I just meant that at the time, it was revolutionary..
 
11:00 AM
Write a function that makes 5 attempts at an AJAX request in JavaScript.
 
hehe
 
It'd be like how object-oriented programming was considered.. it was supposed to change how we programmed, but in reality, it was a lot of hype
 
That is, given a function in the form ajax(url, callback) create ajaxRetry(url, callback) that retries making the request 5 times before rejecting itself, callback is in the (err, result) format.
 
It did change how you program
 
@Neil it did change how we program.
 
11:01 AM
Not that it doesn't have its uses, but that's all it amounts to.. another tool in the programmer's toolbox
 
recursion is a nice and neat tool
but thats pretty much it
 
Haskell doesn't even have loops
 
@Neil It's a paradigm, not a tool.
 
Call it what you will
 
A discussion over how nice is recursion is a little pointless, no ? It's very nice vs it's just nice...
 
11:02 AM
how can i debug and see if they are same or different
 
In a given full day of programming, I rarely have the need to write a recursive function
 
@Neil too much chatting, not enough programing
 
@Neil if I may ask, what are you working on?
 
It's important to know, like it is important to know how sorting works, but that's all
 
@Neil not even in asynchronous code?
 
11:03 AM
well Benjamin had a valid point.. its probably more common to use, probably more like naturally
 
I don't use switch statements every day
 
Because coding database skins and ui is just one form of programming.
 
like the example with 5 attempts for anything
 
@JanDvorak recursion? No
@BenjaminGruenbaum I don't see the relevance
 
@Neil go ahead and implement my "challenge then", given a function that accepts a callback with the format of function(err,result) write a program that retries it 5 times.
 
11:04 AM
@Neil not even func(){...;setTimeout(func)}?
 
Or n times for that matter.
Here is the ES6 syntax by the way.
 
@JanDvorak It may happen, just not that often
@BenjaminGruenbaum I hope you see that this is possible without recursion, just not smart
 
@Neil I'd like to see you do that.
 
I need to grep a webservice that may page its results. Can you do that without recursion?
 
var retry = Promise.coroutine(function*(fn, times){
    var asPromise = Promise.promisify(fn);
    for(var i = 0; i < times; i++){
        try{
            return asPromise();
        } catch(e){}
    }
    throw new Error("Maximal attempts tried");
}
Now you try to write a version without recursion that doesn't use promises and ES6 coroutines. I'd like to see that.
 
11:06 AM
I wish I understood that :p
 
why is there a generator function @BenjaminGruenbaum
 
vs7
Hey guys ,

I have a small problem with my map ....

here you can see the map on the bottom right: http://googlex.in/nutricia/

Its working well but i need something like : http://candpgeneration.com/toys/PIE3.php
 
I should get into Promises so I understand things when Benj gets talking
 
This is why promises were made.. because recursive callbacks are a nightmare in javascript
 
@jAndy so the return would await.
It'll actually wait for asPromise to complete and then fulfill with that value.
 
11:08 AM
Perhaps that was the only way before, though that doesn't make recursion ideal in this situation
 
@Neil That was an intentionally easy example (retries).
 
@BenjaminGruenbaum it does automatically wait because of that reason ? No yielding required ?
 
@jAndy ah, if you return it does a yield and set done to true on the result.
 
cool stuff
 
It really is.
 
11:12 AM
anyways should be an easy task to accomplish right now, just with more code for done-handlers
 
function fail(cb) { console.log('Failing!'); cb('Err', null); }
function retry(n) {
   var halt = false;
   for(var i=0; i<n && !halt; i++) {
       fail(function(err, success) {
           if(!err) {
               halt = true;
           }
       });
   }
}
As promised, no promises, no recursion
 
That code you just posted... I don't think it does what you think it does.
Where does it even call the function passed to it @Neil ?
 
@BenjaminGruenbaum ?
cb is the callback
 
So it always fails?
 
If it always succeeded, it would be run once, but you're welcome to try
 
11:15 AM
Why don't you just learn how to use recursion instead of avoiding it?
 
It looks like it's calling cb n times and failing, without even waiting for one of them to return a value.
 
It's really not that hard
 
The point is to retry, not to make n requests in parallel.
 
@Meredith Why don't you learn to read up if you don't understand what you're reading. We're having a discussion.
 
Even if it succeeds it's called n times, and it always returns 'Err' in the error.
 
11:16 AM
raised voice was used
 
I know what's going on, but I'm pretty sure you're just trying to avoid recursion because you're scared of it
 
Here's a recursive solution:
 
@BenjaminGruenbaum So pass the function to call. I call fail so that it will retry
 
..and when motherfuckers get scared... bad things happen....
 
@Meredith And you would be wrong.
 
11:18 AM
@Neil it calls the function n times even if the first invocation is good, that's not retrying.
Retrying is:
 
vs7
@JanDvorak do you have any suggestion for it :
I have a small problem with my map ....

here you can see the map on the bottom right: http://googlex.in/nutricia/

Its working well but i need something like : http://candpgeneration.com/toys/PIE3.php
 
 - Make request
 - If that went well - great, return it ! Otherwise, retry and make another request
 - If that went well - great, return it ! ....
 - ... n times ...
 - If all fails fail.
@Neil
function retry(fn, n, cb){
     fn(function(err, result){
         if(err && n > 0) return retry(fn, n - 1 , cb);
         if(err) return cb(err, null);
         return cb(null, result);
    });
}
 
@vs7 "I need something like xxx" is never a good specification
 
function retry(n, totry) {
   var halt = false;
   for(var i=0; i<n && !halt; i++) {
       totry(function(err, success) {
           if(!err) {
               halt = true;
           }
       });
   }
}
function succeed(cb) { console.log('succeeding'); cb(null, null); }
Try that please.. you'll see it gets launched once
If you still insist it is wrong, I will insist to stop talking to you
I've tried it
 
vs7
@JanDvorak Actually i need my map to be smoother
right now its coming as hide show
 
11:21 AM
@Neil ... you DO realize you're using a synchronous function, right?
 
@Neil you assume totry is synchronous
 
vs7
but it should be in animation
 
function succeed(cb) { setTimeout(function(){ console.log('succeeding'); cb(null, null); }) }
@Neil try with this.
 
I just love it when the pros arguing about recursion or not recursion
 
user image
2
There's one guy who's excited by the video chat of Miaou.
 
11:25 AM
That's a cute baby, whose is it?
 
@BenjaminGruenbaum Mine. Strange isn't it ?
(yes, I'm as sure as it's possible to be)
 
@dystroy cute.
 
@dystroy awesome
 
Lol, everyone did you see @BarackObama 's avatar :D
 
@BenjaminGruenbaum Hu ? I didn't
 
11:32 AM
your baby looks a bit asian
 
where? twitter?
 
so cure ^L^
 
@dystroy he has a ridiculously political avatar.
 
@BenjaminGruenbaum Please don't.
 
ahahaha true
 
11:32 AM
oh, that Barack
 
@JanDvorak mapM_
 
I am searching for a message written weeks earlier, that's why I came here.
 
@BarackObama That doesn't really look like US president's message
 
haha gett of me neck Oganja
 
@Neil what has goto to do with anything
 
11:33 AM
@BarackObama sorry, couldn't resist. I was just being amused by how political it is. The usual 'political' avatar here is a JavaScript icon. You don't have to be ashamed or hide your political stands here don't worry.
 
Celebrate good Obama, come on
 
@BartekBanachewicz that's not really a loop, is it?
 
@Neil that's nonsense
 
 
(any more than map is)
 
11:34 AM
@dystroy I don't think this is a good place to talk about politics, especially sensible ones like this :-)
 
@JanDvorak not really. map is pure. mapM_ doesn't have to be
 
no worries NSA are not listening neither are CIA and FBA
 
@BarackObama pretty much since we're all in agreement, the problem is we just don't know what to do about it :D
 
they are just "filtering"
for words like "terrorist" and "bomb"
 
@BartekBanachewicz how does that make it a loop?
 
11:34 AM
@BarackObama Hum... Choosing this avatar doesn't really pass the message you're not here to talk about politics. But I don't really want to speak about that topic here so it's allright
 
did Neil stop talking to you Benjamin :P ?
 
@BenjaminGruenbaum First off lets clarify that I indeed have some Jew and Israeli friends, don't misunderstand the avatar.
 
hackers
espionage
black-ops
under cover
smuggle
 
@BarackObama "I have friends who are X" is such a trope.
 
MIT
NATO
 
@zigi alright, alright. we get it. haha
 
@dystroy I have that on twitter too. It's not that I want to talk about it but wear it wherever I can in sign of solidarity.
 
ok ok. And the strange username ?
 
@dystroy are you Asian?
 
@BarackObama I don't think anyone here offense in it, I just found it amusing.
 
11:37 AM
@zigi Partly but when he doesn't close his eyes my son really really doesn't look asian
 
I am bulgarian but also look asian when I smile
it's just funny how mixed people around the world are
 
@dystroy Well I have hope in Obama actions that's all ;-)
 
@Retsam I'm not a racist, I hate everyone equally.
 
@BarackObama still in 2014 ? oops, sorry, should not speak politics...
 
and we hate you too,
 
11:38 AM
@SecondRikudo Some of my best friends are "everyone"!
 
@BarackObama Thanks Obama!
@Retsam I have no friends. I've killed everyone and anyone I care about hundreds of years ago.
 
@BarackObama While we're talking - I'm just wondering, as someone on the other side what do you feel is the solution? (No judgement, promise)
 
@BenjaminGruenbaum You're free to think whatever you like, no problem.
 
It's tough being strong enough to split mountains :|
 
@BarackObama I mean it, I'm genuinely interested in knowing if you have any ideas on how to solve the current conflict. I think everyone is clear on that Palestine should be an independent country roughly in the 67 borders with full independence. I think everyone agrees that what's going on in Gaza is horrible and what's going on in the surrounding area with the rockets isn't great either.
I think everyone agrees things need to get better and the funny thing is there is no conflict of interests since it's in the benefit of both nations. I just think no one knows how to make it better and in the meantime some bad people are using that to do bad stuff.
It's quite peculiar really, as I said before I personally blame the superpowers, I'm just kind of clueless I guess.
 
11:43 AM
@BenjaminGruenbaum Are the Israeli still building new settlements inside those 67 borders, though?
 
I'd be interested by an opinion too, especially if it comes with some background regarding who has it.
 
@Kippie extremist Israelis are building illegal settlements inside those 67 borders which the country is evacuating. Existing settlements which are included in land swap agreements (giving land for an equal amount of land) are being expanded and in exchange the corresponding Arab settlements are being expanded. The settlements in Gaza have all been evacuated in 2005 in a one sided move.
 
@Kippie Everyone are building everywhere
 
Also remember that I do not represent my government, nor do I agree a lot of what it does.
 
11:45 AM
sorry, was that offensive?
 
@BenjaminGruenbaum Ah, thanks. I knew settlements were still being built, but wasn't sure whether they were illegal or not.
 
rekt
 
I would be happy if my country can move and become a state of America
 
No, of course you don't represent it. We've seen the protests on the news
 
@Kippie there are a lot of people who claim the government is not doing enough to stop them, that part might be true.
 
11:46 AM
than at least Americans would deal with the minorities properly
 
I'm inclined to believe you don't want to be a minority in the states
not in the south anyway
 
I think I can learn the accent there in a few years well enough for people not to distinguish me from their own
 
wat
 
@BenjaminGruenbaum "illegal" settlements, could you clarify on that? What was about the expansions that followed in the centuries after the foundation of Israel? How were those legal?
 
@Cereal in two words - become integrated
 
11:48 AM
@BenjaminGruenbaum Feel like it's not good to talk about it, but if you want it.. Well, put simply give both nations the right pieces of territory, release aggressive grip on Palestine meaning also violence/arrests against children. Palestinians don't refuse Israel existence even after the 1946 incident where violence began. They just want a peaceful living. Occupation of a territory can also happen without violence.
I know that Jerusalem is to Jews what is Medina to Muslims so you're fully entitled to your own piece of country. But palestinians need too. They were there before.
 
@GNi33 Centuries? Wasn't Israel established post WWII?
 
@Retsam That's what the muslims want you to believe
 
woops, I meant decades
 
@zigi I feel you'd be a bit.. disillusioned
 
11:49 AM
how so?
I might be yes,
what I believe is that people are not split properly
 
@Cereal , out of curiousity, have you ever lived in the Southern US?
 
people are split by countries not by lifestyle and intentions
but that can't happen
 
Nope. Just going by anecdote. My dad travels a lot, one of the main places he goes is texas. All I know is he says it's not as um.. open as Canada.

That's not to say it's bad
 
Haha, well also the Bible belt goes through there
 
11:51 AM
@SecondRikudo ?
 
It's like the modern american invasion in native american land, except that Jews are really entitled to their piece of territory. If you are old enough you will remember that Jews and Muslims got along in the same place way before 1940.
 
so it makes people even more conservative
Why are those people so stubborn
can't they do like the Netherlands and Belgium
Having a border that splits cities to belgium and dutch parts
 
@zigi Propaganda, bullshit, money, lots of money.
 
but with no real guards
 
how much does Religion play a role?
 
11:53 AM
yeah, it's allways about the interests of people isn't it
@GNi33 IMO it shouldn't at all
 
@zigi I crossed that one a few years ago when I took a flight from belgium.
 
@zigi The question is, which people.
 
@Cereal The Southern US is one of the most hospitable places in the states. Yes, their politically conservative, but it's not filled with the hateful people that it's often depicted as.
 
those that have the money and are greedy for more
 
@zigi IMO institutionalised religion is a concept that should've been abandoned ages ago
 
11:53 AM
Hamas takes the donation money given to the people of Gaza, and builds tunnels and buys rockets with it...
 
@Retsam I didn't mean to imply that
 
@GNi33 I'm going to take a shot in the dark and say you aren't religious.
 
also marrying four wives, but no one asks me
 
hehe
 
actually I would be glad if I can have children from a few different women (from different races) and allow them to do the same if they want to :D
then I would have mixed children and can see who excels in what
 
11:55 AM
@zigi That's a pretty misconcept you have in the west actually. You have to be a saudi or nigerian to have four wives.
 
vs7
is it possible to get some data by parent from child window ?
?
 
@BarackObama I come from the East
why do you say 'you have in the west'
 
Other than that we Israeli and Palestinian are both semitic people. No need to be hostile to each other. Just do like we did in the old times, peacefully.
 
@Retsam "My invisible cloud-man is better than your invisible cloud-man, because a book written by some drunk dudes about a bazillion years ago says so. Let's fight!"
you get my point
 
^ exactly
 
11:57 AM
@zigi Because these concepts were invented back in fuedal times where the 'east' was Asia and the 'west' was europe
 
Anyone here have any experience with programatically sending a fax?
 
@BarackObama Is there a need to be hostile to not semitic people ?
 
@Kippie my ancestries come from North-East Asia
 
People should be free to believe in whoever or whatever they want. As long as it doesn't result in bullshit like it does since thousands of years
 
and mixed with the Slavic people in the East part of Europe
 
11:58 AM
@JanDvorak well, what's a loop for you?
 
@GNi33 Yeah, I get that you have no understanding of or interest in religion. Do I agree with your point? No not really.
 
@BartekBanachewicz a syntactical construct that evaluates a piece of code multiple times
 
this discussion is getting annoying...
 
@JanDvorak so mapM_ is evaluating a piece of code multiple times
 
@dystroy No of course. We should be hostile to NO ONE. My point is that being both semitic is a stronger reason not to literally destroy each other.
 
11:59 AM
it's not a syntactical construct, though
 
fuck that.
 
array comprehensions might qualify...
 
only lame-ass languages need syntactical constructs
 

« first day (1384 days earlier)      last day (3569 days later) »