« first day (1443 days earlier)      last day (3735 days later) » 

08:07
@Rafee funny you pinged my two best friends
but you missed my new best friend @Cerbrus
08:18
Hahahaha
m59
m59
@AwalGarg I hope I didn't offend you? So sorry if I did. It was never my intention.
I enjoyed our conversation.
Goodnight!!
Hi!

I got two array, the first is my reference and the second is dynamic, i need to know if any index of the second is an index of the first. Maybe i'm wrong, i'm not efficient in js :/

Here is a sample of my values:

[ 13, 50, 107, 109 ]
[ 10 ]
[ 13, 50, 107, 109 ]
[ 107 ]
[ 13, 50, 107, 109 ]
[ 10 ]
[ 13, 50, 107, 109 ]
[ 10, 110 ]
[ 13, 50, 107, 109 ]
[ 2, 109 ]
[ 13, 50, 107, 109 ]
[ 2 ]
08:34
I don't think I understand. Are you looking for Array#indexOf?
Currently i have try to use loop on my second array an try if the index is indexOf my first array, but that don't work :/
don't use for..in for arrays
how i can do it without loop?
only if something else loops for you
sndAry.some(function(sEl){return fstAry.indexOf(sEl)>-1})?
Build a set to make lookups faster
08:40
@copy or use an object.
Actually, a set is quite simple to build :P
(Not an excuse, in case that's implied)
That's what I meant
@m59 no way man... I enjoyed it too. But I went afk for a while.
or, if both arrays are sorted, you can do it in linear time
this works fine :)
can we improve this code?
*can we
*works
08:41
why oh why? @JanDvorak
improve, in what direction?
improve the execution time
@JanDvorak you have a macro to type that, right?
For anybody who might be interested, I made a small search/replace library in JS : github.com/Canop/groumf
08:45
for learn, i start with javascript :)
thank you for your usefull help, this works perfectly ^^
I'll give you a linear algorithm for two sorted arrays:
overlaps [] _ = False
overlaps _ [] = False
overlaps x@(hx:tx) y@(hy:ty) | hx >  hy = overlaps x ty
                             | hx == hy = True
                             | hx <  hy = overlaps tx y
Is that readable, @Gecko?
Is that valid Haskell?
why not?
08:51
@JanDvorak Clearly not, you haven't declared the overlaps function.
I've not seen that @ syntax before
TIL
@Retsam this is the definition; type declarations only help debugging, and I trust myself
but sure:
overlaps :: Ord a => [a] -> [a] -> Boolean
wait... perhaps it should be named overlapsAsc
@JanDvorak Ah; didn't know that. My knowledge of Haskell is very limited.
Limited to what I was able to figure out in a few hours of experimenting with it in Codewars and looking at some random code samples, actually.
Explicit type declarations are useful for learning and for debugging
oh boy... I needed to do a 'group homework' with some schoolmates of mine for monday
we had to make a little research on an italian region
08:59
"compiles" doesn't imply your function doesn't expect or return some weird typeclass that doesn't make sense yet is actually possible, like "an array of numbers that is also a number itself"
one writes:'It has 617.000 inhabitants', the other 'with less than 600000 inhabitants, this region....' and this is only the beginning
'70% of mountains', 'almost half of it is covered in mountains'
this is all in the same file
0
Q: Type safe string interpolation in swift

Benjamin GruenbaumI have code that looks something like: var link = "http://example.com/images/\(myFoo)_pattern.html" myCustomObject.link = link The problem is that I encountered a strange bug, this link is set from multiple places - sometimes myFoo is an Optional so I end up getting ../Optional('realValue')_pa...

Help please :)
09:15
@dystroy The code is quite hard to understand (especially because of the number of indentations). I don't think it's a good idea to overload a function to work on both strings and DOM elements and accept a third parameter that does different things depending on the type of the first argument
And the matching algorithm looks dubious (hard to tell the performance characteristics)
That's also basically a solved problem (for instance Aho Corasick)
o(infinite) - It halts for every input (I think)
09:37
one guy wrote !860 instead of 1860 -_-
I don't want to live in this nation anymore
Typos are always a good reason to commit suicide
or to emigrate
Too mild
Destroy the world
Stop the world, I want to leave!
09:48
@SomeGuy problem was that that should have been the final copy to send to the teacher
and it was a good thing that I stopped them in time and checked
@towc that's nothing... I once assumed 1km to be equal to 1024m in a mathematics paper ;p
@AwalGarg that would be one kim
3
if this is how most italians in my city do their job, I guess that I have a reson to leave
My teacher still doesn't get why "1024"
@AwalGarg lol
09:49
@JanDvorak haha
hi
@AwalGarg how are u?
09:53
@getlost how are u?
how am I?
how are?
@copy Hard to read ? I didn't think so but I note it. As for the problem, I wanted something simple and light enough for replacements in the browser with a thesaurus of about 75000 multi-words expressions and able to operate on HTML nodes, not simply texts. Thanks anyway for the name Aho Corasick, I knew this general approach but not the name.
10:37
Noone ?
@BenjaminGruenbaum ?
2 hours ago, by Benjamin Gruenbaum
0
Q: Type safe string interpolation in swift

Benjamin GruenbaumI have code that looks something like: var link = "http://example.com/images/\(myFoo)_pattern.html" myCustomObject.link = link The problem is that I encountered a strange bug, this link is set from multiple places - sometimes myFoo is an Optional so I end up getting ../Optional('realValue')_pa...

Uuuugh, worst Sunday ever (my Sundays are like most of you guys' Mondays)
11:14
Why?
11:25
@SomeGuy After a 5 day holiday+weekend, take a 4 hour packed (after holidays) bus ride, followed by a crapton of work I have to do, while all I want to do is sleep
I've had a fun day yesterday
what is done()?
@TylerW A function.
or rather, a function call
it belongs to JS or node?
11:30
node is JS
done is a method that jQuery promises have
hmm. im working with express for first time.. and after i save a user .. this one tutorial is calling done(). not sure exact meaning of it
!!tell tyler google javascript promise tutorial
i dont think im using jquery ... or maybe i am haha
oh! this guy is using async module.. i guess thats it!
ok cool
thanks
12:07
2
Q: What is the inverse of a promise?

BergiA promise represents a value that might become available in the future (or fails to do so). What I am looking for is a data type which represents an available value that might become unavailable in the future (possibly due to an error): Promise a b = Either<PENDING, Either<value a, error b>> ??...

Interesting question
12:35
Ahoy hoy
13:01
@BenjaminGruenbaum Hi
So basically, I sent Barbara Liskov a cold email with a link to the question :P @Bergi (that's the rude part)
Wondering what she has to say about it, couldn't think of a better way to ask :)
Uh i see, thanks:-)
Not a very polite thing to do I guess, especially it's her research from 18 years ago, but I'm still interested.
Let's hope she's still in the field :-)
I should probably email mark and ping kris on IRC while I'm at it.
13:09
Actually I had hoped the question would be better received from an FRP view, but I guess the Promise community is more active on SO :-)
Tag it haskell and replace the word promise with the Par monad :P Or tag it C# and replace Promise with Task, or tag it Scala and replace Promise with Future, any of those would work.
I had considered it tagging Haskell, but thought the question should rather be language-agnostic
May I should try :-)
The problem is that your requirement is hard to explain in terms of monads etc
Yes. Maybe the actual question I should have asked is "How are dynamic collections of reactive elements represented in functional reactive programmeing"...
That's what I'm currently trying to implement
None of the FRP papers I looked into (Push-pull FRP, fran, Flapjax, Scala.React) did mention something about it
But I guess this is rather off-topic in the JS chat
13:27
@rlemon So chat decides to change, and bot goes down? pfft
Neat, avatar-in-completion
@Zirak Why did you leave me!
@monners You got pregnant
@Bergi naa, JS chat isn't very strict
how can I put it on hold AngularJS with AJAX requests?
@EpokK What do you want to put on hold?
If you mean a question, please post the link to it :-)
13:41
@Zirak Well excuse me for being allergic to latex!
I search a method to stop my ajax request and stock this, when I have a data, I can start my precedent request
@monners Oh, so now you're allergic to latex, but when it was kinky-peanut-butter-and-gimp day...
@Zirak Those five days in the hospital meant nothing to you???
Considering how I've spent those five days in a bed next to you because of 4 broken ribs and a bruised testicle: No.
You knew the safe word, just like everyone else!
13:46
When the safe word is in Korean, that doesn't help much, now does it?
I thought we all agreed to cater to the most predominant ethnic group
@rlemon Another thing to glance as is ROOM_USERS_BY_ID. They have a lot of history for some reason.
@Bergi I found
:D
@monners Do you know what exactly was the problem with the bot?
14:04
@Zirak Too much sexual innuendo?
I was under the impression that it forgot all regular/past users and so was greeting everyone, all the time
@monners (yeah good, blame the bot for my ignorance... I don't care)
ok, I'm running a test version (beer! is the prefix), ping me if something goes wrong
beer! hi
@Zirak PING!!!
...what?
@Zirak Y U NO ANSWER?
14:14
@AwalGarg That didn't make much sense. Use the !!/help command to learn more.
Don't ping me if you're being stupid
sry
beer! summon 1
@AwalGarg Registered; need 1 more to execute
pls move to sandbox
14:17
@Zirak STUPID IS JUST WHO I AM
lol Benjamin's account got hacked by rlemon :D
1 message moved to Java
"Whoops"
why java?
in Java, 1 min ago, by Awal Garg
lol Benjamin's account got hacked by rlemon :D
@BenjaminGruenbaum wtf?
14:18
@BenjaminGruenbaum why?
Java is right next to "Bin" and "Trash can" in rooms to move to :/
this confirms what I said... rlemon is hacker!!
@Unihedron sorry , answered in Java
@Unihedron his account is hacked.
4 messages moved from Java
Well, problem solved! :)
14:19
take your messages back! :P
message move war !! ye ye
That wouldn't be fair, we have a shit-ton of automation for that from spammers :P
@cipi : Any ideas for this :
3
Q: How to get video height and width from a MP4 URL with client-side only?

user2284570I'm writing a user script for downloading videos. The flash player of the web site use a JSON file. The purpose of my script is to get the url of the video by downloading and parsing the video according to the web page. Currently it can download an extract the URL of the videos successfully. The...

> ended 21 hours ago. Grace period ends in 2 hours
hahahaha
@AwalGarg : What do you find funny. I know he will not get it.
14:40
This question had a bounty worth +50 reputation from user2284570 that ended 22 hours ago. Grace period ends in 1 hour
I wonder which post gets the auto-bounty..
14:52
@user2284570 this is a general problem with the DOM, there are APIs you need but it doesn't expose - what you need to do is make an XHR for the data and only read the first part (get a onreadystatechanged with status === 3 event), then feed it into a blob, and feed that into a video tag.
Hopefully, the first chunk will be enough, you might want to keep feeding chunks until it successfully loads it, that might work.
@user2284570 your other alternative would be to emscripten a library that can read the SPS on its own.
QUnit, yes or no (or what else?)
Oh wait, I'm an idiot, @user2284570 just use Flash that'd be far simpler.
@SecondRikudo mocha
@user2284570 the vast majority of users still have flash, Flash trivially has libraries built in that do this.
@BenjaminGruenbaum I wouldn't want to introduce Flash into my code just for that little thing
@SecondRikudo what would you do?
It's a 15 LoC flash solution or medding with emscription/ writing a parser for a non-trivial video format. Sometimes pragmatism wins.
"On the Internet, nobody knows you're a dog" is an adage which began as a cartoon caption by Peter Steiner and published by The New Yorker on July 5, 1993. The cartoon features two dogs: one sitting on a chair in front of a computer, speaking the caption to a second dog sitting on the floor. As of 2011, the panel was the most reproduced cartoon from The New Yorker, and Steiner has earned over US $50,000 from its reprinting. == History == Peter Steiner, a cartoonist and contributor to The New Yorker since 1979, said the cartoon initially did not get a lot of attention, but later took on a life of...
TIL
15:04
posted on September 28, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Finishing Augie this week. Crazy.

@BenjaminGruenbaum lol @ the nyan reporter
@rlemon I mean, cool.
.. erm. inorite
15:08
@rlemon Touche
That reminds me, I kinda want to learn how to play the ukulele
@BenjaminGruenbaum mocha looks pretty sweet
Up until now I've rolled my own little testing frameworks, but I've lately been needing something more robust
@SecondRikudo yeah, it's like adding hot chocolate to your java
I built three (four?) mocha clones, it's just pointlesss to do :P
They also have built in promise support which is nice.
15:16
@BenjaminGruenbaum Which promise though?
@SecondRikudo A+
Anything defined as Promise?
Ah
A thenable, anything with a then
@BenjaminGruenbaum So it can accept bluebird promises if I already have them?
@BenjaminGruenbaum here's an interesting case
Say I have an array of 10 promises
15:24
@SecondRikudo are BB promises A+?
Some of them might reject, but I do want do issue an .all() with the array of promises that resolved
Is that possible?
Promise.settleAll
or settle, can't remember
Benjamin already has an answer for that...
4
A: Get states of tasks ran by bluebird.all().spread()

Benjamin GruenbaumIf you want to handle the case they're good/bad together: Require bluebird... var Promise = require("bluebird"); // Run two tasks together Promise .all([Git.getRemotes(), GitFtp.getFtpRemotes()]) .spread(function (remotes, ftpRemotes) { // Something cool }).catch(function(err){ //...

@FlorianMargaine for what it's worth I probably have 5 :P
Here, another one
15:27
Yeah, .settle it is
1
Q: What to use instead of Promise.all() when you want all results regardless of any rejections

jfriend00I'm using the Bluebird promise library in a node.js project. I have two operations that both return promises and I want to know when both are done, whether resolved or rejected and I need the return values from both. I'm reading the contents of multiple files and some of the files may not exist...

I'll just have to filter those with isRejected
Awesome
More dupes
2
A: Bluebird Promise.all - multiple promises completed aggregating success and rejections

Benjamin GruenbaumYou'd use .settle: Promise.settle([p1,p2,p3,p4]).then(function(results){ results.forEach(function(result){ if(result.isFulfilled()){ // access result.value() } else { // access result.reason() } }); });

Another, slightly trickier question
@BenjaminGruenbaum Mjolnir
I am using 3 different APIs in my code
API A can accept an array of 10 IDs as search, B can only accept one ID at a time, and C can accept up to 100
@SecondRikudo naa, they're all slightly different, I guess
15:29
Hmmm, now that I think of it, a simple [].chunk followed by .map can solve it pretty decently
@BenjaminGruenbaum He heart you
> And this is also a valid url
http://example.com/"><script>alert(document.cookie)</script> (http://in3.php.net/manual/en/function.filter-var.php#108769)
hahaha
15:48
@Zirak ^ if you haven't seen that yet, you might enjoy it.
16:01
@BenjaminGruenbaum Neat, thanks
16:54
anyone here used google recaptcha?
@Bergi I got Kris to look at your question and the other people from #promises, they'll probably have smarter stuff to say.
if we look at the recaptcha on the gmail signup page, it looks fine uptil a width of 192px but I can't get it below 312px or it gets distorted. Anybody has any idea?
@AwalGarg 192 < 312
@JanDvorak I meant it is usable upto 192px on the gmail signup page... but I can't get mine to work below 312px.
(mine = the one I use from their api)
how do such weird problems manage to find me? pathetic!
17:20
don't worry; I've managed to survive two major traffic hiccups in one day, all the while having forgotten my camera at home
@BenjaminGruenbaum Yes, but This is a userScript; and the key point is to bring the platform to peoples who can't get flash or an HTML5 browser; Or live outside EU.
The target was stackoverflow.com/users/191164 tell he have a high knowledge in Java and H.264; and wrote an incredible answer on a similar question.
> An empty div with ID recaptcha_image. This is where the actual image will be placed. The div will be 300x57 pixels.
what on earth?
300px wide???
fucking shit they don't know users view the web on mobile too?
the entire viewport width of iphone 4 is merely 320px
17:53
iphone 6+ is 412px wide in the web browser. Large for a phone
@rlemon @BenjaminGruenbaum adweek.com/adfreak/…
18:06
... i want it
I just got one of these for under my desk
gonna see how hard it is to type while walking stepping
ha! I overwrote thier code.. finally it looks good on the iphone now... fuck yeah!
wo
@rlemon let me know
@rlemon Notice me senpai
The fix was just changing loadUsers to a CHAT.RoomUsers.all().forEach(...) and altering bot.users in that. I have a dev bot running (beer!) so far without problem (but also haven't had the chance to welcome anyone)
test in production
!!live
@rlemon And on this day, you shall paint eggs for a giant bunny.
18:18
she's running, just was 'dead'
!!die
meh, just changed the invocation pattern to !!.
bot.isOwner reports stuff correctly. I want one correct welcome and pushing.
They still have the chat variable in a closure, i r sads
@balpha It'd be awesome if the chat variable was exposed, we could do lots of neat stuff with it
what was teh problem?
They no longer have a window.users dictionary, but CHAT.RoomUsers, which has some functions on it for retrieving several users or one, stuff like that.
ah
fun on the bun
Just a matter of adjusting to a new "API"
TheThingThatGetsDataFromTheServer still exists, so I'm happy
18:26
I can't wait till the new civ is out
seems like it's been forever since preorder started
..nvm, gnight
@rlemon Beyond Earth?
yup
We should play, I also preordered
Alpha Centauri was one of THE games of my childhood
nice
as long as you are quick player
18:29
Alongside Rogue Squadron and Homeworld.
hate playing civ5 mp because one full turn can take like 20 minutes
do you play simultaneous?
no, just the regular type
Simultaneous is much better
18:47
Evening!
0
Q: Do not modify scope even using a function that modifies the scope

Ionică BizăuMaybe the title sounds a little bit weird (please improve it) -- but I need a solution for the following scenario. I have the following code: var Foo = function () { this._hello = "world!"; }; Foo.prototype.bar = function () { console.log(this._hello); }; var f = new Foo(); f.bar(); // =>

^- Any idea?
@IonicăBizău apply and call don't change the global scope, they just determine the this value
If you *always* want `this` to be a specific object, see `Function..bind`
!!tell IonicăBizău mdn Function.bind
@Zirak Yes, but somehow I need an alternative to:
var Foo = function () {
   var self = this;
   self._hello = "world!";
   self.bar = function () {
      console.log(self._hello);
   };
};
this.bar = this.bar.bind(this)
How bind can help here?
Why you'd want to do that...I don't know
18:56
Just for not having all the code wrapped in one function.
If that's not possible I will probably use this method.
1 min ago, by Zirak
this.bar = this.bar.bind(this)
@Zirak Trying out :-)
var Foo = function () {
    this._hello = "world!";
    this.bar = this.bar.bind(this);
};

Foo.prototype.bar = function () {
    console.log(this._hello);
};

var f = new Foo();
f.bar(); // => "world!"
f.bar.apply(this); // => "world!"
Post an answer, @Zirak :-)
nah
You enjoy
m59
m59
@SomeGuy regarding that tweet, you might be interested to know that a lot of Hindu's are inclined to believe in God (Yahweh/Jesus) because the gods they know of can't compete with His power :)
welp, Heroku has gotten worse
this is good news
19:07
How so?
for runnable, I guess
@SomeKittens why?
Well, yes, but worse in what way?
it's harder to create an instance for a git thing you've already created
had to manually edit .git/config
after using heroku's toolbelt to 'clone' the app elsewhere.
m59
m59
How does Runnable make money?
at least they finally auto-detect a node app instead of requiring me to manually create a Procfile
@m59 We pitch things to VC's
m59
m59
19:11
ah
ugh
this "business model" makes me sick...
@m59 We intended to generate revenue with 2.0 (which is what I've been working on)
@FlorianMargaine That was more joke than reality - we've got a solid plan to generate $$$ and are on target
m59
m59
@SomeKittens if the believers that I meet with all abandon the faith so that I have no role here, I'd jump all over the opportunity to work with you. I think I'd thrive with a team and Runnable looks awesome. However, the prerequisite really works against our mutual goals heheh.
@Zirak bind thing works so nice. I used it here. Thanks!
@SomeKittens k
19:15
@IonicăBizău I don't know why you'd want to do that, but have fun
@SomeKittens master of orion for me, but AC/Civ are a close second
good memories
@Zirak The use case is the following: http.createServer(server.serve).listen(port). So, serve method was being called not with the right scope.
Then just bind there, no need to lock all of your functions.
@FlorianMargaine (and yes, I hate the "We don't know how we'll make money" crowd too)
@Zirak I know, but I want to make the usage as simple as possible.
19:18
Locking down your functions is, I think, stupid, but your call.
You're incurring an unnecessary detour with every function call
Isn't that so good in memory terms?
It's not just logically unsound, it makes your functions less flexible, and it's a fair bit slower
I agree.. Probably I will find another solution.
Thanks anyway
...I always liked such hacks. :-)
19:37
> Parents+sister go with our 3 bikes to take the dog for a long sunday-evening-walk. They stumble across a friend and decide to dine in town with them.
Father mails me:'Want to come to dine with this friend?'
Me:'Sure, where?'
15mins later
Father:'this adress:_____'
Me:'Ok, 30 mins at max'
Father:'Perfect'
Me:'Where's my bike?'
Father:'We used all the bikes'
Me:'So I am supposed to do 10 miles at 9:30pm by foot?'

FML
eat all the cheetos as revenge
@SomeKittens that was the plan XD
except we don't have cheetos
Pee on the carpet
but they just re-stocked the fridge with cheese
They've just or they just?
19:51
@towc Quit your family, I'm in Germany now.
@BadgerGirl :DDD
112
A: What's wrong with Dr Seuss?

tobyinkWhat's wrong with Dr Seuss he asked? To find an answer, I've been tasked. His books on cats are widely read, In libraries, schools, or just in bed. Is it because he writes such blubber that turns a child's tongue into rubber? Nonsense words and silly rhymes Confusing children at bedtimes. Or ma...


« first day (1443 days earlier)      last day (3735 days later) »