« first day (2909 days earlier)      last day (2261 days later) » 

02:40
@Rick Have you seen NerdCubed's rant on that?
m59
m59
02:52
Hello
EHLO
m59
m59
It's been a looong time. :)
How long?
m59
m59
Seems like years since I used to hang out in here a lot.
I'm working on a problem and I thought of this room as reasonably likely to have some developers familiar with graph theory.
Nov 20 '17 at 1:27, by m59
@Mosho That happened to me recently! I forgot how I fixed it :/
almost a year
02:56
\o
:)
Welcome!
if it's quick, I'll take a crack
m59
m59
And that was just two sentences! haha
o/
It's related to DAGs and topologically sorting them
I'll try to get some helpful words out and maybe prod at me to get on the same page
My use case is a dependency graph in which some dependencies are what I am abstractly calling "dead ends"
As they are "consumed" (which is actually a function call to them), they let me know that they are not to be traversed further, i.e. their dependencies will not be used
Not sure how to describe this any better
The sort has to be sort of progressive
Is this trying to determine a loading order for an arbitrary dependency graph?
m59
m59
sounds like it, maybe
loading order, considering any item may be a dead end
03:01
I think it's a fairly common problem for library loading
m59
m59
so the outside world has to tell it to find the next one, then the outside world looks at that one, and then if it's a dead end, add it to the dead ends and asks for the next possibility
Does it make sense how that different from a normal topological sort, though?
So I know we're on the same page?
You could normally just pass in the graph and get it back sorted and all is well
I can't do that because of the potential dead ends, and I can't remove them because I don't know whether they are dead ends until the sort is already going
No, I'm not sure what the difference is
By dead end do you mean anything that doesn't reference anything else?
m59
m59
[ 1, [ ] ],
[ 2, [ 1 ] ],
[ 3, [ 2 ] ],
[ 9, [ ] ],
[ 7, [ 6 ] ],
[ 4, [ 3 ] ],
[ 5, [ 2, 3, 4 ] ],
[ 6, [ ] ],
[ 10, [ 1, 2, 3, 4 ] ]
In this graph, the sort will determine that 2 is the next in line after 1
right?
Wait that's not even a connected graph
m59
m59
mmmm, It's not a directed acylic graph?
03:04
I mean technically speaking maybe
m59
m59
I had a program draw it for me. I'm pretty confident about it
but 6,7 form their own isolated subgraph
m59
m59
From what I understand, a DAG can have multiple source nodes
I don't personally need the sort to handle it, but just trying to be technically proper.
9 is also chilling all on its lonesome
oh yeah
m59
m59
03:06
Yeah, I made this example have lots of edges for testing
edge cases***
So I don't understand what you're actually trying to do
m59
m59
haha poor word choice there, sorry
So, back to what I was saying
the sort start out as 1, 2
Are we at least on the same page about that?
that's a topological sort so far
m59
m59
Yes, good
Here's the thing. My real world use case, when I "use" 2, it may or may not opt out, so to speak
I need to know to ask it
but I can't use its dependencies if it opts out
If it does opt out (it's a dead end), and the sort already includes its dependencies, then the sort is invalid
either that, or I'm making up problems
so opting out of 2 would opt out of 3, 4, 5, 10?
m59
m59
03:08
yeah, unless there's another path to them that doesn't opt out
m59
m59
10 would get called for sure, since it has 1 and 1 didn't opt out in this example
and so on
So it sort of just snips all incoming edges
m59
m59
My first question is whether this sounds like anything that's already a thing...or is my solution a good one?
In that I wrote a topological sort that you can keep asking for the next item and tell it about dead ends when you find them
I wonder if there's some better abstraction / approach some genius came up with a hundred years ago
This is a whole new subject to me. No idea what I'm doing.
I don't know of any existing concept for this, but I'm not familiar enough with graph algorithms to really say
What's your solution?
m59
m59
03:12
In a nutshell
  const sort = Sort(graph)
  sort.deadEndNodes.add(2)
  const sorted = [ ...sort ]
I have no idea what that represents
Adding dead ends to a sorted graph still yields a sorted graph
m59
m59
or more specifically, you can call sort.next() to get the next possible dependency, and then if it's a dead end, sort.deadEndNodes.add(thatNode)
and then call sort.next() again
It isn't sorted until the generator is done yielding
I guess you'd say it's a lazy sort?
A selection sort?
m59
m59
sort.next() // 1
sort.next() // 2
sort.deadEndNodes.add(2)
sort.next() // etc
Again, dead ends won't impact the sort order
m59
m59
03:16
they do, though
How?
Aside from neutral permutations
m59
m59
hmm...
Are you saying I could just sort it then check if any of a node's dependencies precede it and if all of them are dead ends, the sort still works anyway?
If so... wow I really did make up a whole problem to solve for no reason.
I'm still not sure what the actual problem is
If you want a topological sort with dead ends taken into account, that's just a topological sort
If you want to shake out unused deps, that's probably simplest done with a second pass
m59
m59
hmm. I'll have to write a test comparing and see. Too hard for my brain. I thought I did that and had this problem, but now I'm doubting it all.
lol
I'm gonna go sleep, bug me about it again tomorrow
m59
m59
03:23
oh good grief I think you're right :/
  [ 1, 2, 3, 9, 4, 5, 6, 10, 7 ]
  [ 1, 2, 9, 6, 10, 7 ]
The outside world can just keep up with the dead ends so that, if 2 were dead and 3 is encountered, all of 3s dependants (which is just 2) are dead ends, so it will be ignored.
Will that seriously be the case no matter what?
How did you know that?
And goodnight, catch ya tomorrow perhaps
Thanks a ton
03:39
@KendallFrey no you have a link
04:20
Hi, I have started a development on ejected react-native app. Do I need restart when any changes is make?
Hi all
I am trying to use the DataTable module from JQuery
First time the table displays perfectly
but when i change the input data and re-submit the page again, the table reinitialize again and clobber the table data
i tried to use some code which check if DataTable object is initialized or not but it is not solving the issue
any suggestion will be appreciated.
Hello everyone, I've hit a wall and need some help. I have a webpack(webpack 4) config js file and the main section that I want to show is this
1 message moved to Trash can
@LuisAverhoff Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
04:39
Alright, I've placed the code in hastebin so that it is much better to look at. Anyways, the main problem that I've been having is that if I take out the include that is in the object that handles web font files, webpack compiles successfully but if I include it, then it says that resolve is not defined for postcss-loader but for other loaders it is fine. hastebin.com/yebubomuru.js
Don't know why it is the case and the error message doesn't really help as I don't see any connections between postcss-loader and url-loader even though the include is the one causing the issue.
04:49
yep, even if I take all my loaders off except the one that includes the fonts, it throws resolve not defined. Oh by the way, I forgot to mention that I'm using webpack 4.
05:01
Quick question, what do you call this shape: lh3.googleusercontent.com/…
I'm looking for something a bit more specific than start
*star, not start
Squeegee start
star
Okay thanks!
It's amazing how easy it is to just hit that "t" button every single time.
IKR
it's probably muscle memory
I suffer from it
Like funciton
God I hate that
05:07
I want to type console.clear, but get console.loeag
Once I got console.clog
that was embarrassing
I went to type titanic because my class wanted to watch it on youtube but i was using a keyboard I wasn't used to so i typed titsNic
Your class must've loved that one
05:09
they did, I got awkward cause there was a girl I liked there. that sucked
I just facepalmed after that
foobar but on a monday, "boobfart"
If I ever typed without deleting at least every two seconds it would probably look like this:
I'm blanking. Never mind
Okay
haha
when moving between C# and JS where there's a console class, you type console.log in C# and get tons of errors and have absolutely no idea why cause it's syntactically correct. that gets irritating
I mainly go back and forth between JS and PHP. There is no logical reason why there can't be dot notation in PHP
05:14
there isn't??? that sucks!
I've used PHP before but I had no Idea what the difference between a dictionary and a list was, so I had no idea about OOP
I've been using VB recently, and it's so different to any other mainstream language but even it has dot-syntax
Well you could say JS is copying PHP becuase of the arrow syntax
because
05:16
yeah, but nah, they are two different things, I reckon they're closest to Java's Lambda functions
Don't do Java
Except in the morning
;)
Or anytime actually
I don't drink coffe, I drink black tea every now and then
Java's good
Which one?
05:18
I use 10.0 because it came with the latest IntelliJ update, so I just go with it
There's a whoosh
where did I go wrong?
A whoosh is what I call when someone doesn't get a pun I make, and it goes whooshing over their head
I know what a whoosh is, but I'm asking what your pun was
You said Java's good, I said which one, like coffee or the language.
Not a big whoosh
Generally the size of the whoosh is in direct proportion to the stupidity of the pun
I thought that one was a bit out of place
Oh, very scientific
the whoosh speed is inversely relative to the direction of the conversation
True
A turtle-whoosh!
multiplied by an exponential magnitude of the pun intensity multiplied by its reciprocal of pun strength by pun obscurity
wow, that went places
The ratio of pun obscurity to general laughter directed at the guy who got whooshed is also more or less inverse
05:26
that is true
reaction strength value
function determineWhoosh(pun){
  let punIntensity = pun.intensity;
  let punObscurity = pun.obscurity;
  let bystanders = window.bystanders;
  let punStupidity = (punObscurity * punIntensity) / 100;
  let conversationDirection = window.convDirection;

  let whoosh = {};

  if(bystanders.length > 3){
    whoosh.intensity = bystanders.laughter;
  } else {
    whoosh.intensity = New GeneralChuckle();
  }

  whoosh.speed = conversationDirection / punObscurity;

  return whoosh;
}
This has been taken to its logical conclusion
05:44
hi
Haha
that is amazing!
whooshmeter.js
<div class = "x" onclick="f1()">

</div>

<div class = "x" onclick="f1()">

</div>

When I click the first div class it is alright.

when I click the second div class, onclick for first div is also called.

How to stop this?
06:35
@JacobSchneider I'd be surprised if this weren't already a jQuery plugin
@Neil
@Breathing What makes you think both are getting called?
Is it getting called twice?
yes
I have a whole view
and those 2 divs are in separate partial views
So to be clear, you click on the first div and f1 gets called once
Click on the second div, and f1 gets called twice?
I know it is called twice via document.ready
no
06:46
I need a mcve for that problem
\o
yes
neil
f1 is called twice
@Breathing f2? You never even mentioned an f2
sorry
ah ok
Well let me help you out. What you describe is not possible unless you're registering onclick events elsewhere in your program
06:47
@KarelG it is a big flow
In other words, check your javascript that you're not subscribing to click event in any way, or if you are, that you remove it properly
I have a button when I click on it, it
loadpartialview1()
loadpartialview2()
both the views have same pagination class
$(document).ready(function () {
        // your on click function here
        $('.pagination a').click(function (event) {
      //do stuff
}
I click on pagination of view1 its $(document).ready(function () { //onclick function is called
when I click on pagination of view2 its $(document).ready(function () {} is called
along with $(document).ready(function () {} of view1
@Breathing No.
it's because my final view has 2 class  with name pagination
You don't need 50 different .ready functions
Think of $(document).ready as your main
Calling it after page load, at best, will do nothing..
Unless you're dealing with multiple javascript files I suppose, no reason to do it like that
06:54
my each partial view has it's own .ready function
Also, technically anything underneath .pagination a is going to trigger that function call
So if your div is underneath, it'll trigger both "onclick" events
nope, my divs are not underneath that class.
Well I doubt if you've discovered a browser bug
Somewhere you're subscribing to onclick twice..
anyways, so my partial view shouldn't have .ready functions?
well I suppose you could argue for them if you mean to modularize it, sure
But only if each is in its own file
07:01
yes it is
those 2 divs are siblings of each other
ok, well are you registering click events anywhere in your program aside from .pagination a?
07:24
no where else
Then the div is underneath .pagination a
Something isn't true that you're telling me. We've found the dead body, we've found the weapon, we know the motive, but the killer is in Malibu.. something doesn't add up here.
07:49
all problem is caused due to Html.PagedListPager
need to add different class
08:07
Hi guys
can I do an angular question?
!!welcome Doflamingo19
@Doflamingo19 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
09:07
grrrr I fail to write a test suite for URL filter that handle redirects
how would you test that?
I guess you would parse the resulting page
mocking
09:31
@KarelG how dare you mock me!
I'm thinking of reviving my old C++ project
@Neil so that I can stub you with self-desired answers!
!! refactor in C++ or rewrite in Rust?
@BartekBanachewicz refactor in C++
reroll
that wouldn't be fair
!! refactor in C++ or rewrite in Rust?
@Neil rewrite in Rust
There you have it
09:39
nah you have to respect the gods of RNG
if a button is disabled, still click event can run on it?
@Breathing that's an interesting question, but the more pressing one is "why do you care"
smells bad design
If you have a blink tag on a webpage that nobody visits, is it blinking?
09:41
hehehe
ok. figured out
@BartekBanachewicz because I see it happening
somehow. Somewhere .... https got changed into http so the test fails because my filter expects https. Odd thing is that there is a filter that does http to https. Something in my unit test is reversing it. WHAT-THE-HELL 😬
I don't even know how you would go about doing that
Maybe that's the default unless specified otherwise
Hi guys, I'm building an app with ionic and firebase and I'm stuck with a problem which I can't find a solution. The problem is with notifications. I'm using FCM to send notification and it received in all registered devices but when someone clicked the notification it opens up the app but crashes the seconds it opens. I've already put a question about it. The link is:- stackoverflow.com/questions/52607760/…
09:46
@shubhamarora Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
@shubhamarora there isn't a high chance to get someone who ran into this particular issue here - I recommend getting some rep (by answering questions) and starting a bounty or contacting Google support.
But... maybe
@Breathing can it? Yes. Should it? No
I can dispatch any event on any element for any reason.
@Neil I started limiting my internet access for an hour before bed time - will report how it works out in two weeks
@BenjaminGruenbaum why!? ლ(ಠ_ಠ ლ)
I see it happening
@Breathing Make a MCVE please
so to stop it should I stop it inside the click function?
09:54
@Neil my dad is diabetic and blue light is correlated to bad glucose regulation. It's also not great for falling asleep - I also do it in the morning because I've found it's very hard to wake up to a ton of notifications after having a week without internet.
I am very happy with it so far - but I've only been doing it for a week. It's great so far at actually going to sleep when you expect to and having good mornings - but that's just my personal experience and different people will likely experience it differently.
@BenjaminGruenbaum Well I respect that.
Though if you happened to stop by for two hours instead of one, nobody will lynch you for it ;)
@BenjaminGruenbaum does his glucose meter send data to your device so that you get a blue screen?
(I am trying to connect that with "blue light"
this last shows disabled
but if I click on it. The on click function runs on the pagination li elements
10:03
@KarelG no, "blue light" is light screens (like computers and phones emit)
For example: ncbi.nlm.nih.gov/pmc/articles/PMC5487588 (first google result, though on rats)
It also has other (non diabetes related) negative effects on some people.
ah that blue light. Yes. I also avoid use of my phone before sleep.
I just talk or read a book for a while.
Yeah, I haven't done that until recently - I like it.
they say you should be at least half a meter away from your monitor
most people are a lot closer than this
10:19
*measures it* ok at me
But I agree with you. Sometimes they are too close
If I see a person whom is facing too close of a screen, I sometimes say "are you going to creep into it?"
I suppose that's normal, but it's also bad for the eyes
They say you should keep the monitor away half a meter and every hour or so, give your eyes a "break" and look at something far away
If you don't do the latter, your eyesight will gradually get worse with time
@Neil I don't do that - but baby steps - there are lots of good habits I don't have lol
my bad habit is that it happens that I sit on my current chair for eg 2 hours like right at this moment
10:34
Get a new chair
I have zero tolerance for those rigid 90° angle chairs
I have a good chair
I can't work on one of those
it is just that it is bad. You should not be motionless for a hour or longer
It's got to be an office chair and preferably one which lets me lean back ever so slightly
@KarelG Pfff.. do you even program?
same problem happens at standing desks. You consume more energy but you are not in motion. So you have to swing (do a pirouette?) from time to time
10:36
I spend 8 hours a day in the same position basically
not good :P
are you even taking lunch at your desk?
Well I take a break for lunch of course
But still 4 and 4
I just drink a lot so that I have to go to wc often, giving me a reason to get off my ass
I'm trying to be better about that. I bring an apple to work everyday and I use that as an excuse to get myself up to wash it
and coincidentally, people with an urge to pee makes better decisions
10:38
I would have assumed that people who needed the urge to pee but have just gone would be better at making decisions
@Neil thank you
@KarelG Not sure if deciding whether or not you want 16 euros now or 35 after 30 days is an accurate way to determine your decision making skills
maybe needing to pee just makes you less prone to diverge in immediate rewards
@Breathing your welcome. Not sure what I did though
that is what the article says
doh
Sam
Sam
10:57
Hi guys, anyone here worked with JWT based authentication?

« first day (2909 days earlier)      last day (2261 days later) »