« first day (1879 days earlier)      last day (3070 days later) » 

12:00 AM
just finished watching the clip
kinda makes me sad that I could do better tbh
 
today yea, in 1965 not likely
 
anytime I see people younger than me doing the thing I'm specialized in better than me... I just want to go in a corner and cry XD
 
the resources were not widespread. there was no easy way to obtain the knowledge to do these things at those ages.
@towc yea, remember who you are talking too
 
well, you're from the dinasour era, you don't have feelings
 
I'm ~twice your age and you are doing stuff with animations I can't do
I've been programming longer than you've been alive.
 
12:02 AM
@rlemon Want a competitive edge? Try transform.js!
 
btw, what were your interests at my age?
 
programming.
gaming.
pogs
 
!!google pogs
 
hockey
 
12:03 AM
...pogs
 
well pogs were a little earlier :P
 
You had to go and google fucking pogs.
 
I haven't seen pogs in years
 
like gradeschool.
 
Thanks for fucking making me feel old.
 
12:03 AM
@Trasiva always a pleasure ;)
 
Excuse me, I have to go walk my dinosaur.
 
man, I remember when marbles were the shit
 
btw, how bad is it really to feel old?
 
carrying my marble sac to school
 
like, in teenager feelings...
nostalgia? Anger? contempt?
 
12:04 AM
@towc you are much more conscious of the fact that you will one day die.
mortality didn't really hit me until 23
I was invisible before that
 
@rlemon Dude, and the cat's eyes were the like...the bee's knees.
If you got a perfect CE, EVERYONE wanted to trade for it.
 
nahh man. pearls
blue pearls to be exact
those were the rage
 
@rlemon does that make you feel kinda unsatisfied or makes you become more of a YOLO guy?
 
@towc depends on the person
 
you
 
12:06 AM
I'm more realistic about how quick time passes
 
@rlemon Must have been a location thing. Pearls were stupidly common around here.
 
in rxjs, I have a flatMap that is returning the same data twice if I make the selector async. If I remove async, it correctly returns data once.
 
when I was 10, 30 minutes was enough time to play and have fun.
now at 29, 30 minutes can pass on the can.
 
oh, so that thing just gets intensified...
 
yea, time passes quicker as you get older
 
12:07 AM
do you feel like you're drowning on lack of time more often?
 
@towc I've almost died on three separate occasions. Now I look at life, and don't even hesitate to try something new, and try to say yes to as much stuff outside my almost non-existent comfort zone. Life flies before your eyes as you age.
 
relative ofc.
@towc yes and no
 
I'm tired of immutable.js and its tentacles in my code
 
I mean, now I work 40 hours a week.. time is precious.
 
return observer.flatMap(async function(item) {
    console.dir(item);
});
Prints item twice for every item.
return observer.flatMap(function(item) {
    console.dir(item);
});
Prints item once for every item.
 
12:07 AM
@towc I wouldn't say drowning. I'd say I'm more appreciative of my free time.
 
50 LOC, all the immutability I need
 
@rlemon Invisible, huh?
 
you guys should write me some life tips and things I should know before becoming a dinosaur :)
 
@Mosho ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
That was harder than I care to admit to remember how to properly type.
 
@rlemon According to my simple theory of how time passes, half my life is already gone :(
 
12:08 AM
I honestly care
 
what is another way of counting some particular subsets of a set ? except exponential complexity
 
@Trasiva u wot
 
@NathanJones why flatMap?
 
@SarvagyaAgarwal be more specific
 
@KendallFrey I honestly have no idea why that was the spell correct there.. clearly I meant indestructible
 
12:09 AM
@towc it sounds like he's trying to get help with an interview
 
@Mosho Yeah, but your algorithm sucks
 
@Mosho Someone doesn't read Lovecraft.
 
@KendallFrey that is mostly correct
 
@rlemon I would have guessed invincible, but ok
 
@copy nice, why?
 
12:09 AM
@KendallFrey nope :D would be a good guess.
 
@Mosho It makes much more copies than necessary
 
@SomeKittens because I'm returning data from a Promise. Actually, I'm making multiple async calls in one flatMap...that's probably a no-no, right?
 
in my head i said indestructible.. my hands sometimes do different things.
 
!!afk Cry havok! And let loose the hogs of war!
 
@copy can you give an example?
 
12:10 AM
@NathanJones can't tell without seeing more but there is Observable.from(promise)
 
@SarvagyaAgarwal The set of all subsets of a set is exponential in the number of solutions, you can't make it faster than that.
 
I assume you're using that?
 
it makes copies only of what is being changed
I mean, it's obviously not immutablejs or mori
 
@Trasiva WHATEVER FARM ANIMALS OF WAR!!!!
 
but I made some benchmarks and it annihilates both for those basic operations
 
12:11 AM
@towc got an hour on your hands right now?
 
@SomeKittens I'm in another place where certain conditions determine what should be returned. I make the first async call, and depending on what the result is, I make another async call to retrieve the data.
 
@rlemon well, it's past midnight and I have an exam in 8h, counting on having a run in a nearby wood. I guess I do
 
@NathanJones yup, with you there. Nothing horrible yet
 
I'll add it to my list ;)
actually, I'm going now
 
return observer.flatMap(async function(item) {
    let testObj;
    if (detect(item) === 'dibels') {
      testObj = new Dibels(item, promptOpts.testId);
    }

    if (promptOpts.table === 'Test Results') {
      console.log('in test results');
      let studentTests = await getMatchingStudentTest(item['Student Primary ID'], item['School Year'], promptOpts.testId)
      if (!studentTests.rows.length) {
        console.log('returning test results csv');
        return await testObj.toTestResultsCsv();
 
12:13 AM
@Mosho Make an array with 1 million elements, then change 1000 random elements in it
 
@SomeKittens But I keep getting two of everything
 
@NathanJones using async there is undefined behavior
 
@KendallFrey : well the number of elements in the set can be as many as 10^5 in the problem i am trying to solve. Maybe there is some kind of trick involved .
 
not recommended - you've already got an async abstraction in Observable.
 
@copy so you mean it's not lazy?
 
12:15 AM
@SomeKittens that's what I was afraid of...whenever I try to refactor that code, however, it turns into callback gobbledeguck
 
@Mosho No, your versions needs to create a new array of 1 million elements on every change
 
yeah, it would need to create such an array anyway, at least once
so if I bunch those changes, then it's 1001 changes
instead of 1001000
 
Yeah, but you can't throw the other 999 arrays away
 
@NathanJones getMatchingStudentTest returns a promise?
 
@ton.yeung He's an egotistical nerd, ignore him.
@SarvagyaAgarwal What exactly are you trying to do?
 
12:17 AM
@copy I can implement .withMutations
 
If you need to output 100000 combinations, there's no way to do it in less
 
@Mosho Still, you'll have at least two arrays with 1 million elements
 
@SomeKittens yes, it's a call to a promisified node-oracle execute function.
 
@ton.yeung fair nuff
 
youtube.com/… lol watch this for like 30 seconds from here on in.
 
12:18 AM
@copy best I can do though while keeping native objects/arrays only
right?
 
Well, yes
 
@rlemon ha
 
then it's good enough for me. we don't typically deal with huge collections
 
return observer.flatMap((item) => {
  let testObj;
  if (detect(item) === 'dibels') {
    testObj = new Dibels(item, promptOpts.testId);
  }

  if (promptOpts.table === 'Test Results') {
    console.log('in test results');
    let studentTests = getMatchingStudentTest(item['Student Primary ID'], item['School Year'], promptOpts.testId)
    .then((studentTests) => {
      if (!studentTests.rows.length) {
        console.log('returning test results csv');
        return testObj.toTestResultsCsv();
drat
 
@copy thanks for the tips
 
12:20 AM
darn
 
@NathanJones ^^^
 
@SomeKittens so I can still use then() just fine, but not async-awaity goodness?
 
@rlemon SterlingArcher is afk: home thyme
 
12:22 AM
@NathanJones I dunno, haven't done much with async/await. It might work just fine.
did my snippet work?
 
@KendallFrey : I have a photo(black and white) given in form of 10 pixels(1-D array of characters 'b' and 'w' b means black and w means white).
I also have N filters. Each filter is a 1-D array(size 10) consisting of '+' and ' - ' . You can pick any subset of these N filters and apply them on the photo .
applyting a filter : if the ith character of the filter is '+' invert the ith pixel in the photo else nothing happens. We need to output the number of different subsets of filters we can choose to convert the photo into all black .
 
@SomeKittens possibly...I'm still getting errors from somewhere else
 
@NathanJones lemme know
 
Doing a Frozen-themed ES2015+ talk called "The new ECMAScript standard never bothered me anyway"
 
12:28 AM
open with, "so, how fast is Taylor Swift?"
 
How do i know the reason of being kicked ? so i dont repeat whatever it is i did wrong
 
@SomeKittens still getting TypeError: Cannot read property 'then' of undefined setTimeout(function () { throw err; });
 
@SarvagyaAgarwal are you pinging people with nonsense without first gaining interactions with them? (I didn't kick you, just speculating)
 
!!afk going home
 
1:08 AM
@SarvagyaAgarwal Ah, this sounds very similar to the subset sum problem.
In this case, the photo is no different than a filter, where black is - and white is +
then you want the subsets which have an even number of + at each index
I suppose the main photo has the restriction that it must be part of the solutions
 
1:57 AM
@NathanJones just published a few changes to make working with Gustav in TypeScript a lot easier
 
@SomeKittens NathanJones is afk: going home
 
2:09 AM
@ton.yeung yep
it's a function that takes a parameter (done) without a type and returns a Workflow
 
2:21 AM
nope, just saying that the function I'm passing in will return a Workflow
so later on, when I try to call workflow-y things on the returned value, TS is ok with it
it's a little redundant there but I have tslint cranked a bit high
 
the parens around done threw me off
 
@ndugger TS is pickier about those, especially when declaring return types.
 
really? odd
 
@ton.yeung I'm pushing the lambda, which is executed later.
 
I'd prefer it as (done : Workflow => { ... })
lame
 
3:15 AM
How do I store a variable value outside the promise? I mean, I have the following:
var new_brand = {};

models.brands.create( req.body.brand )
    .then( function ( brand ) {
        //Returns the brand created
        //I want to assign `brand` to `new_brand`
        new_brand = brand;
    } );

models.products.create( req.body.product )
    .then( function ( product ) {
        //Here's where I want to send the new_brand var
        response.json( {product: product, brand: new_brand} );
    } );
 
 
1 hour later…
4:32 AM
Why not put both promises into Promise.all? Then you can get both brand and production and be certain that both are created.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
 
 
1 hour later…
5:35 AM
Anyone using grunt here? Is it that its tasks api is something that makes it slow? Or is it the way plugins are written, for instance grunt-contrib-less. Heard it makes some temporary files before commiting to the target path...
 
@Jhawins Existence is futile!
 
m59
@deostroll I think it's not really that it's slow, but that there are faster ways
I never really thought about it, but I'm guessing that something like gulp is faster because it uses streams, so it's able to process code in chunks rather than loading the whole file and then processing.
 
@Shmiddty ohai
 
@m59 Interesting... but I think we are seeing too many syntactic sugar in too short a span.
 
m59
5:48 AM
actually, I dunno what I even just said.
I have a terrible headache :)
@Sheepy whaaaaat. Nah man. That's something a language just ought to have.
 
exactly...I thought so...
doesn't it mean that streams need be part of all those critical grunt plugins like watch, concat, etc...
 
@m59 It is not bad. But that doesn't mean we have to have it asap. ES4 had many nice new syntax too.
At least elvis and spaceship operators are better defined and easy to switch over.
 
6:03 AM
okay, now I have a question reg clusters in node... this article says that we might get a message "Application running" 4 times. I don't understand that part...I mean we are calling app.listen(3000) but what is the point of calling that 4 times...(4 being the number of cpus)...
 
6:23 AM
@Sheepy Would you please make a simple example?
 
> The Shoveller: All right, I'll take point, you two flank. Let's triangulate.
The Spleen: Equilateral or isosceles?
 
@SomeKittens Ohio
 
DOM
6:39 AM
I want to create organization chart using javascript. Can anyone suggest me any Javascript library for create organization chart?
 
@DOM 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.
 
hias
 
m59
6:55 AM
@Sheepy I'm stupid and tired. |> makes some code easier to reason about and that's a huge win for me.
 
Hi
I am writing a small plugin/library where I require to select a sibling element to an element
I tried the following which isn't working
^ ofcourse the selector is wrong, but I need something like that only
I mean I must use querySelector function only
 
anyone know how to kill a npm forever daemon?
 
7:15 AM
@m59 There is a reason that Java does not have getter setter, a very common feature, and why many universities prefer it this way. Adding features to a language is likely to make us happy, but more toy is not always an overall win.
Look at C++. Look at the number of array functions in PHP. Guess what happened when I wrote (a+=b, c) here a few days ago.
Or Perl. They even have an "defined or" operator. Must have made many Perl programmers happy.
 
0
Q: Select only the element relative to the target element using querySelector

Mr_GreenI am writing a small library where I am in need of selecting a relative element to the targeted element through querySelector method. For example: HTML <div class="target"></div> <div class="relative"></div> JavaScript var target = document.querySelector('.target'); // Something like this ...

 
I checked it.. I didn't find anything useful for me in this case
 
I think he need a CSS engine, like the one jQuery has, and make considerable modification.
 
not like jquery selector
 
7:23 AM
o/
 
B + E Any E element that is the next sibling of a B element (that is: the next child of the same parent)
 
I just need a way to able to get relative element like using this
 
@Mr_Green Not like, that is why you will need considerable modification. CSS is not designed for relative selection. XPath is.
 
@rism the B must be specific
 
Then as above grab the parent:nth-child
 
7:24 AM
@Cerbrus o/
 
document.querySelector('.main:first-child + div');
Always something for everyone in the docs
 
@rism I updated
check my post
 
7:40 AM
uuhhh when did jsfiddle get a redesign?
 
rism, either you didn't understand or trolling..
 
Can I use Promise.all in node.js?
 
which do you think more likely?
 
@feniixx Yes. Why not?
node[Enter]Promise.all[Enter] - Doesn't take much keys to confirm it.
 
7:52 AM
@Sheepy I didn't understand your comment.
why will I mention this more than once?
even if it is not related to my library, I don't see a reason where I can mention it more than once
 
@Sheepy I'm getting some strange behavior, is it ok to have a promise all inside a promise?
 
@Mr_Green Your target may be ".thistle" - which includes "this"
 
The thing is that I need an ID beforea insert data in three diff tables, I'm using sequelize by the way
 
@Sheepy that is why I am replacing only "this " (with space)
I can make it more precise if I use regex
 
@Mr_Green This is where you are better served with a proper selector parsing engine
Which, of course, is probably too big of an investment
given your needs
 
7:55 AM
yeah
 
@Mr_Green Now you are steering towards parsing HTML with regx. CSS is simpler, but not that simple.
 
I'm curious, though, how jQuery pulls it off
 
jQuery implements a proper parser. And a selector engine to run it. All in javascript.
 
otherwise, I will not use "this" to target but some stupid and never going to used string
like "asdfasdfad"
 
Not about selector parsing, but the part where you can do $('.target:first').find('+ .relative')
The .find() with a relative selector
I looked at the source but there's so much abstraction going on I'm not sure I can make any sense of it
 
7:57 AM
wasn't aware of that
 
@Mr_Green It's undocumented, so I don't blame you
 
Like I said, they have a parser and a selector engine. With those two you can support many non-native features.
 
that is what I require but using only JavaScript. But the solution which I found will work
 
I'm pretty sure you can't use a parser to evaluate a selector
But forget it, I'm just letting my mind wander
 
Hmm. Did I not say selector engine?
 
8:00 AM
@BoltClock of all least, I can use it in my library. with providing good documentation :)
 
guest271314 just isn't getting a clue
I was going to explain the downvote but his impatience turned me off
 
guest and a guy here "rism" didn't understand my explanation
 
I think the question itself is not that great either - it appears to set a box that obviously violates the spec. The answer you have kind of jumps out of the box, too.
 
I hope I could have explained the question clearly in my post. but honestly, the solution which I posted will work great for my library.
 
Yes. Nothing personal, but this is the kind of question that make me think I am wasting my time answering any new questions. Every word the asker didn't border to write, waste ten times more effort from good willed answerers.
 
8:08 AM
I can just say.. I tried my best to explain (because I needed a answer)
 
I thought the question was fairly clear - how do you grab an element relative to an Element instance with a selector?
 
@Mr_Green I know...
 
@BoltClock will updated with this title. thanks
 
@BoltClock Then it'll surely be a dup? I don't see much dup flag...
 
8:11 AM
@Sheepy I bet it's a dupe. Dupes are just notoriously hard to find at times
 
hmm
 
Yeah, I personally understand the question to be very specific, instead of generic enough to have lots of dups.
 
should I delete it now? I got the answer anyway
 
@Mr_Green You can't delete it anyway. Answers have been posted, with one upvoted
 
Opps. My fault. Should I delete the answer? I don't mind.
(But not that eager either, because I can't find a dup that explains the limit of qs/qsa)
 
8:13 AM
damn, my brain is on a fritz
I read it as "ButtLocks" instead of "BoltClock"
 
hello
 
I wouldn't delete it. It's a useful answer - to a useful question
It's just too bad it can't be done without jumping through a series of hoops, that's all
 
Ok. I'll just leave it there. it already comes up firsrt when I google "querySeletor relative stackoverflow"...
So true. I still remember why browsers opposed relative selectors in CSS. Because "they are slow" and "browser's css engine doesn't work that way (at the time)".
 
I'll bet that the slowness comes from simply having to run more than one complex selector per element - and it's not the selectors themselves that are inherently slow. Moz said they could explore simple use cases like :has(~sibling) and :has(>child), but I don't know if they've gotten around to it yet. It should be fairly trivial to check if an element has sibling A or has child B. Of course, things like :has(~A > B:not(:only-child)) are obviously problematic
The two examples I quote cover the vast majority of use cases
 
Let's just say CSS engine has many optimisations, now even more so than when the subject selector was first proposed.
Just like JS engines, actually. If you can run js code, surely it must be easy to run the "eval" function? They do the same thing!
 
8:33 AM
Anyone good at english who can help me out correct my english presentation a bit? It's not even 100 words.. will highly appreciate.
 

 English Language & Usage: Multi-Layer

Not for the faint of heart or those easily triggered by Englis...
 
@BoltClock Some started making a list of common questions at stackoverflow.com/tags/javascript/info at some point but it's not very extensive
I rarely mark things as dupes these days because I cba searching 90% of the time
 
CBA?
 
can't bother ? I can't guess the third one
 
8:37 AM
can't be arsed
 
dat arse
 
Damn, using slang in acronyms doesn't make it easy for us poor non natives...
 
Similar: cbb = can't be bothered
So you're pretty much on point @DenysSéguret
 
@DenysSéguret I'm not a native speaker either :p
I thought it was a pretty common acronym but it might have falled out of fashion
 
8:41 AM
@ivarni You're a young gamer then ?
 
@DenysSéguret I'm in my mid 30s
(mid being middle)
 
That's young seen from here :)
(kid)
 
(grandpa)
 
I am a baby
 
@ivarni cba is mostly brit talk
At least that's where I first heard it
 
@tereško Thanks Obama
 
@tereško wow
 
basically we are back at the year-1920 level of medical options, when it comes to bacteriological infections
 
Maybe that's what we need to combat over-population?
 
@tereško Penicillin was discovered in 1928
So, make that 1930 ;-)
 
8:58 AM
@Cerbrus I know
 
@tereško I googled it :P
 
meh, nano-bots to the rescue.
 
@rism that tech is about 20 years away from human trials
 

« first day (1879 days earlier)      last day (3070 days later) »