« first day (2435 days earlier)      last day (2738 days later) » 

21:01
Has anyone seen the Guardians of the Galaxy Vol. 2
@tholo the movie yes
list.sort(function(a, b) {
  return compareActive(a, b) || compareType(a, b) || compareNames(a, b);
});

function compareActive(a, b) {
  if (a.active === b.active) {
    return 0;
  } else if (a.active === true) {
    return -1;
  } else {
    return 1
  }
};

function compareNames(a, b) {
  return a.name.localeCompare(b.name);
};

function compareType(a, b) {
  if (a.type === b.type) {
    return 0;
  } else if (b.type === 'manager') {
    return 1;
  } else if (a.type === 'manager') {
    return -1;
Bingo
Nice
Now it should be real clear how to add new sort criteria and change the order.
Those other compare() functions might be able to be shortened, but I don't think there is a good reason to. They are nice and readable the way they are
shortening them at all will probably make them harder to read.
21:07
makes sense. strangely enough, there is not much documentation on sorting this way
because all the sort() function cares about is the final -1, 0 and 1. The rest of our structure, the compare()s, are all our internal organization.
Do these interventions slow down sort?
interventions?
I mean time complexity
1,0-1
We are adding no 'time complexity' (if I understand what you mean) with our structure/organization. The sort only runs once.
21:15
you are right, sort internally runs different algorithms, merge sort, quick sort. as an abstraction just seems like we are coercing a result without seeing it in action.
No complaints from me. this clearly an awesome solution to a lot of problems.
21:32
just realized I said something stupid disregard the previous statements
Yeah, what?
!!wat
I mean the part where I say merge sort quicksort as an abstraction
21:44
oh :)
🚽
.sort() might use quick sort or any other algorithm internally. The reason you return -1, 0 or 1 is so that you are only answering the question "which of these two comes first". That question is asked by the internal algorithm as many times as it needs to do the full sort.
!!!!afk
@tholo That didn't make much sense. Maybe you meant: afk
Luggage what would I do if you were not here
21:48
someone else would answer or you'd have to go do more reading.
I don't know this due to magic, it took time.
True that
maybe, usually, you have to work on something that requires this type of knowledge.
May I ask how old you are?
The reason I ask is that I started programming at ~12 and am now 37.
I barely even remember what is was like to just start.
29
So I have a bit of a head start.. :)
21:54
Oh.. if I only was smart enough to start at ~12
I didn't say I was GOOD at 12 or did any projects work mentioning.
Non-programmers always overestimate how hard it is to write code.
Nevertheless, starting at ~12 is a great advantage
It's mostly our fault for using needless jargon
I can assure you most programmers do not know how to utilize sort in this fashion
21:55
@Arrow, it comes with time, a lot of practice and patience...
They do / should, actually. You'll see, in time, that there is nothing much going on there.
anywho..
I like the effort you are putting in this @Luggage, nice going man
ty. some days I am patient. Some days I would have not been.
Yeah..
have you ever used bind to curry
21:59
I use bind and sometimes that resembles currying...
I read somewhere that you can curry with bind. I found it strange
sort of, yeah
IIRC the technical meaning of curry is the conversion from (a, b, c) => d to a => b => c => d
yeah, bind is very much like currying, but not quite
i.e. converting a function from one form to another, rather than a style on its own
I use .vindaloo()
22:02
.korma() for the faint-hearted
vindaloo looking that one up
as long as it has [Symbol.spinach]
sweet, no npm package named vindaloo, yet. Now to come up with an idea
This is how good projects start right? a name?
abso-lutely
@Luggage I thought that's where good ideas die
22:03
module.exports = Function.prototype.bind;
hehe
ha ha ha
I can be the next leftpad
"This will be a revolutionary library! It needs a snappy name... 4 days later What the FUCK should I call this piece of shit?"
you could make more money with a service-naming service than any of the named services
22:05
inb4 "there are two hard things in computer science"
the best way to name something is to combine two unrelated things. AdMobs, four-squares, purple farts.
or three
YellowDog, BlueRhino
PurpleScream
internal names for software at my old job: SpiceWeasel, BrainSlug, HypnoToad
22:08
where'd you work, Mars?
those are all futurama things
I know :)
the servers where Philip, Turanga, Hermes
ohh, right, got it.
We had servers named after LOTR characters once
Right now we have one named ArthurDent
nice.
Slartibartfast
22:10
That's as far as our interesting company culture goes
My favorite server name was a puppetmaster for developer machines, called Gru.
Yup. :)
I should start using discworld names (besides Luggage, since that's me)
you just need some category with a long wikipedia list. Football teams, Greek deities, etc.
How did you settle on luggage anyway, I might change mine to Lord vetinari
I just liked the character.
nothing more to it than that.
22:15
This is a list of articles that are lists of list articles on the English Wikipedia. In other words, each of the articles linked here is an index to multiple lists on a topic. Some of the linked articles are themselves lists of lists of lists. == General reference == Lists of academic journals Lists of important publications in science Lists of unsolved problems == Culture and the arts == === Literature === Lists of books Lists of 100 best books Lists of banned books Lists of The New York Times Fiction Best Sellers Lists of The New York Times Non-Fiction Best Sellers Publishers Weekly...
@Arrow I use the domain name pearwoodtech.com :) there is nothing there (on the root name) so don't bother going
I just needed a name to set up google apps
or.. whatever they call it now
G suite.
You Heroku generates names for you
for those that don't read the books, the character Luggage was made of 'sapient pearwood'
well, it's my email address (for work), too, so I wanted a name I chose, not random
nice. just read the wiki.
Question related to Webpack:

I need to bundle my Node.js server side code with the node_modules to generate server.js. I am able to generate the bundle but when I run the server, it throws an error “Error: Could not find package.json up from: /”

My directory structure:

`
package.json
webpack.config.js
node_modules/
server
- index.js
- apiCallbacks/
-- logger.js
`

After debugging, I noticed that this may be because webpack is not able to resolve the node_modules require’d in logger.js. The node_modules require’d in index.js do not have any issues. If I do not require logger.js in index.
22:23
Have you tried creating a package.json?
npm init
Since I have been barred from asking questions, I find it is actually better to answer other people's questions.
Well, be careful. Your answer to the sorting question the other day was wrong and deserves more downvotes.
well, I fixed it
ok, cool
22:33
Ya, I don't sell poison, By the way, that wrong answer I had previously was based on another stack overflow question that had 4+ points
Not everyone on SO knows what they are talking about. :)
s/SO/everywhere/
Ya that's the problem, people associate the result with internal consistency
When it comes to the currying, I've seen a guy once currying in 4 layers..
currying is not terribly useful in every day JS. It can be with some styles, but don't get too obsessed
also, it's just a certain USE of more general features, like bind()ing, closures, anonymous functions.
I know, I'm using it in Scala...
22:36
ah, ok.
When it comes to the JS, I've seen people 'overusing' it, that's all.
The ends do not justify the means because they are inconsistent. Either you have the knowledge and can point these things out like you can, or you doubt and seek to find holes in your assumptions.
Has anyone tried: ramdajs.com
i'm aware of it, but never used it for anything
22:47
The developer, from my team is talking about it for days now
praising and shit..
in my work (traditional corporate internal LOB app) it doesn't feel terribly useful.. much of what it does can be done in a line of two of code. Plus I aleady use lodash which has SOME overlap.
but.. I could see it being useful some some people. It's supposedly more friendly to a functional style of programming due to the argument orders, but I can't confirm that.
Yeah lodash, or Lo-Dash
I've always been wondering why John-David Dalton didn't contribute to underscore, yet he created a superset of underscore
i think there are internal differences in how they work.
like.. he wanted to make it different for a reason.
Yeah, that's why I've assumed as well
Also, I don't think they are compatible any more
22:52
This seems interesting
that video wasn't as good at the other AI videos on computerphile channel..
that looks cool, the visual processor and assembly thing.
23:08
US, east coast.
It's 1 am here
is (0) the same as noop
elaborate please
no. (0) is the same as 0
23:14
what's the shorthand for noop then
ugh. do i want to click that?
there is none. where do you need a noop?
when creating a new function on the prototype
ohh, vintage space. Lemme guess. People are talking about where they want to put their rockets?
() => {}
@Luggage It's Amy Shira Teitel, the video is cool
@Luggage That came up several times. One guy kept obsessing about wanting to see her pussy with a tampon string hanging out
23:16
jesus
(Daniel Stadler)
omg
yeah, some people have problems
I mean.. I have my thoughts about her, too, but I have more class than to post that on her channel.
she doesn't need that shit.
yeah i'm out
that's horrific
23:17
I don't have those thoughts.
wow
there need to be repercussions for that shit. In real life people get punched and learn to keep their mouths shut.
..
I like to keep my mouth open
you probably use it to breathe too
23:21
doesn't everyone?
I'd like to think that I am the same person online as off.
@Luggage I know I'm not, but I'm generally ok with that
I definitely say more offensive things online, because I don't have to have a filter
well, you aren't a gross asshole online (at least not here), so..
prove it
23:22
const noop = () => {}
const proto = Function.prototype
IRL i'm shy and awkward
just use [blab, blah, blah, wow].filter(x=> !x)
IRL I'm fat
I don't have to be fat online
i'm all of those things
ok, so we're different online, but I don't use being online to get away with trying to hurt people
23:23
all of my tinder pics are manufactured angles to help visually reduce how fat I am
and I don't think you do, Kendall. you do a little, nick, but, not to youtube comment levels :)
That's not the same. Being 'fat' is a psychical appearance, whether being an asshole is more a matter of fear, self-assurance, or having responsibility.
Because, when you say some things online, under the nickname, you are rarely held responsible like IRL
@ndugger use the context aware tool
Here's the thing about saying offensive things online that people don't get. Just because it's funny, and my demeanor makes it seem like I'm serious, it doesn't at all mean that I believe it. And that's most trolls and offensive online personalities
@ndugger, that is a correct point, but trolls do it because it makes them smile, and they don't care if they make anyone else sad
23:26
there should be completely free reign to say whatever pops into your head on the internet.
at least online, IRL, that's different
@tholo If something a troll said online makes you sad, get a therapist; I have one, and it's great
but don't even for a second do I care if someone online gets offended. They can turn off their computer and go do something else
There is a difference between being american psycho and umm trolling right
Good one. I've never said it made/make me 'sad', I was making a general reference.
So was I
23:27
Oh, great, than we are on the same spot.
But not all people are the same, some people take it more personal
That's on them
and if you do it to make someone offended, then you are the one who is selfish
exactly - "that's on them", selfish :)
I'm not gonna walk on eggshells around everyone just because there's a potential that there's that one person who will get offended
If someone comes in and talks shit, that doesn't bother me. If someone that I consider to be an online friend tried to piss me off on purpose for theri own jollies, that is worse.
but I love pissing people off online
Getting mad over something on the internet is trivial and funny to me
23:28
I was happy with the conversation revolving around noop
There is a ver big difference between walking on eggshells and not abusing your trust to hurt people that you have infiltrated.
No one should walk on eggshells, but it completely another thing.
Nothing is safe from my memes
Is walking on eggshells offending someone on their ethnicity, of religion?
and making it on purpose
I'm just giving a reference, nothing personal.
There is also a difference between giving someone some shit and trying to really trick them into getting angry.
23:29
I'm walking on sunshine, wo-oah
Yeah, back to noop
@Luggage I grew up tricking my little brother getting angry. I've had some practice
Waste of time, if you ask me... waste of energy and time
waste of energy and time to get mad on the internet
It's the last bastion of free speech
true
user1197918
23:31
Hi guys, sorry to interrupt you. Would you help me out for a very quick question about sending push notifications in async ?
@Madhatter Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
but that is a reaction, not the action
@Madhatter, sure go ahead :)
user1197918
thanks
user1197918
here :
1 message moved to Trash can
@Arrow Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
23:34
Array.prototype.log = function() {
  this.forEach(function(item) {
    console.log(item);
  })
}

[1, 2, 3, 4, 5, 6].log()
I get log undefined
Don't monkeypatch objects you don't own with strange, custom methods
well how should I not monekypatch it
@Arrow If that's literally your code, add a semicolon after the } ending your function
log([ 1, 2, 3 ])
just make a regular function
can't 4 min are up
23:37
Interview question? Naughty!
Otherwise it's Array...log = (value[1, 2, ...]).log()
yep that fixed it
:)
user1197918
Is anyone familiar with async ?
!!welcome Madhatter
The library, or the concept, or the new syntax?
23:38
@Madhatter Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
user1197918
concept
Everyone
user1197918
yeah sorry i am beginner
user1197918
var users = [1,2,3,4,5...]

SendPushNotification(userId)
user1197918
SendPushNotification is async
user1197918
23:39
how to send notifications to users in a specific order ?
promises
user1197918
yeah
user1197918
do you know an example of code that could help me out please ?
user1197918
here SendPushNotification return true if completed
user1197918
link to code is fine ;)
23:45
@Madhatter What are you trying to accomplish
hey I'm not banned anymore
yay
you were banned?
yeah
what for?
from that starred message from earlier :/
where @KendallFrey posted the weird job description
23:46
was it cum-related?
yep
user1197918
@Arrow send notifications to user sin a specific order
A mod must have done it
user1197918
@Arrow
since no one saw any flags I'm guessing
23:47
@Loktar I did what?
One person came in becaseu of a flag a while ago
@KendallFrey remember that image from earlier?
no
maybe
which
the job description
23:47
4 hours ago, by PeeHaa
for the flag
I never asked what was flagged (and can't see it myself)
ah well damn maybe it was a flag I guess
I know the message
that makes me feel better lol
you said, "add cum and it's a party"
it was for 30 mins, not a big deal was just surprised
@ndugger yea
23:48
I think you're thinking of someone else, I don't recall posting that
That is one of those offensive truths that I agree people shouldn't get angry about :)
I'd love to take credit though
@KendallFrey I guess it was someone else
ooh lmao it was @ndugger
9 hours ago, by ndugger
user image
it was pretty funny regardless
Are you looking to leave target, @ndugger?
Nope
23:54
ohh, just being hassled by a recruiter anyway?
I love the team, love the project, and love how low-key it all is and how cushy it is
Yeah, I get a shit ton of recruiter emails every day
at least 4

« first day (2435 days earlier)      last day (2738 days later) »