« first day (2429 days earlier)      last day (2744 days later) » 
00:00 - 23:0023:00 - 00:00

00:52
!!watch another episode or go to bed already
@Zirak go to bed already
but moooom
01:11
Long weekend!
Good save the Queen
user2620028
@William none
01:37
Not sure what none means. ahh foreign language that makes sense
@Itairozen 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.
I am currently learning to code and I just finished a javascript project, I would like to show it to people who understand it and then can tell me what is wrong or can be done better.

Is there any place I can post it for that reason?
01:58
@Itairozen stack exchange has a code review site: codereview.stackexchange.com
Oh cool! I didn't know that, thank you!
 
2 hours later…
03:49
just read an article on es6 destructuring and im unclear on what aliasing is exactly
@AlexBollbach Need more context such as link to article. MDN doesn't mention "alias" at all.
```
It makes it very quick to pull out a specific property from an object. You’re also allowed to map properties into aliases as well.

var foo = { bar: 'pony', baz: 3 }
var {bar: a, baz: b} = foo
console.log(a)
// <- 'pony'
console.log(b)
// <- 3
```
04:05
@AlexBollbach I think the author mean that the property "bar" is extracted into "a", which (s)he regards as an alias. Technically, this "alias" is totally the same as "var a = foo.bar, b = foo.baz". You can specify the name of the extracted variable, that's what I think (s)he means.
hmm
i guess its just a personal term of art to call it an alias then if MDN doesn't mention it
and yeah i guess its just extracting the objects properties to new ones in the receiving object
05:01
Need help with a angular service fetching json data
05:17
morning room
 
1 hour later…
06:18
anyone use vs code? i cant figure out why it wont break in some js files, but will in others
i can break in the browser to debug there
 
2 hours later…
08:45
why would el.addEventListener('custom:event', callback) not work but $(el).on('custom:event', callback) does? el.addEventListener('change', callback) works
May Anyone tell me some proper way to use EJS in browser. I want help with exactly this question
1
Q: Can I use/include HTML partials, client-side, using EJS (or similar)?

Sprout CoderOn the client, I would like to be able to do something similar to the below : public_html/index.html <html> <head> <script src="ejs-or-similar.js"></script> </head> <body> <div id="some-partial"></div> <script> var partialHTML = Magic.render('partials/some-pa...

09:03
the official website tells you how to do that
you may need to create the partial system yourself
it might be a good idea to pre-fetch at least the contents of the partial, so the whole EJS system is synchronous and you don't need to do weird shit
const partialUrls = [ 'something.ejs', 'something-else.ejs', ... ]
    , partials = {};

// use some promise magic to fetch everything and put response into partials, and finally
.then(init)

// where init is your actual application

function partial( which, context ){
  return EJS.render( partials[which], context )
}
@towc My main concern is related to the promise magic. Let me break the scenario for the magic

1. Do an XHR request for partial1.ejs
2. Add a route in expressJS server side for urls ending with ejs and this route will serve the template file maybe as plain text

Do you think adding one route for serving template is proper way?
09:19
every ejs thing should be in a public asset thing
unless you don't want anyone to be able to use them unless they're doing weird xhr stuff, which is kind of silly
I keep it inside views directory.
Are you saying that I should differentiate server side template and client side template!!
var done = 0;

partialUrls.map( url => {
  var xhr = new XMLHttpRequest;
  xhr.open( 'GET', url );
  xhr.url = url; // for later use. Not clean, but works
  xhr.onload = function(){
    partials[ this.url ] = this.responseText;
    ++done;
    if( done === partialUrls.length )
      init();
  }
  xhr.send();
}
@ankitbug94 -_- absolutely
you're talking about sails, right?
Never heard of sails.
ok, even so
your server side templates should be far far away from your client templates
This is the problem today. Go to sleep one night and next day, tons of things come ;)
09:24
@towc Sounds like you could use fetch and Promise.all
Also, you don't need to save url on the xhr, it's in your scope
@Zirak yeah but I haven't learnt how to use them yet so I said "promise magic". This is what I'd do if this was my problem
@Zirak oh, fair point
just out of curiosity, what would it look like with the promise way?
@Zirak you mean fetch API
Promise.all(
	partialUrls.map(
		url => fetch(url).then(r => r.text())
	)
).then(init);
Something like that
@Zirak And this is how we abandon IE users :D
IE users don't exist
Do a demographics check and know who your users are. Old-version browsers are far and few these days and the onus is on them.
09:31
@Zirak oh, that's pretty neat actually
09:53
Do you know of ant-design?
10:18
hello
Someone could help me for highChartJS, stackoverflow.com/questions/44471981/…
11:13
Hello
I installed so far my first ReactJS application. I want now to register a basic component ( Le'ts call it Message);

Is there someone a good guide/tutorial/example which can guide me to setup the interaction/registration with Componenets?
start by learning about react
@Duikboot react's website has a pretty decent intro
The thing is in the first steps they do it in 1 file. I would like to see how multiple components can be registered.
what accent is this? youtube.com/…
@towc german
11:23
sure? Doesn't feel too much like it
definitely german
well, his name is german tbf...
What's his name?
well, twitter handle in desc is "@maxedapps"
and "Maximilian" in top right corner
british Maxs don't say Maximilian
"schwarzmuller" youtube.com/…
now, that sounds like french to me
that sounds very german
Maximilian Schwarzmüller
Mein Fürher
get it?
11:39
no no, it's french
11:56
it indeed sounds totally german
as in the surname does
Like this company: schwarzmueller.com/en
its german
it's actually french
12:18
Hey, anyone here has experience download files in frontend JS from Google Drive? I'm not sure how to do it.
12:33
is 1 coprime with 1?
> In number theory, two integers a and b are said to be relatively prime, mutually prime, or coprime (also spelled co-prime) if the only positive integer that divides both of them is 1.
yeah
are any 2 numbers that sum up to a prime coprime?
13:05
16:9 + 16:9 = 32:9
I'd rather get a dual monitor
exactly my thought
and tenth of the price probably
but then you'll have a gap/seam right in the middle
You can make this one two workspaces wide, or 3, maybe even 4. more flexible.
(maybe not worth the price today, but a good option some day)
well its cool
yeah I was just about to say that
for $500 I'd totally buy one
in a year, that might be possible.
13:12
@littlepootis Why not buy a dual monitor AND that one?
Stack 'em up
earn the mad props
Maybe then your parents will be proud of you
@Zirak y u no in hackathon?
because you're there
ouch
13:42
you can be a hack any day, why wait for a hackathon?
Waxi's ban ends in a month.
and?
it's already been a year?
it was 6 months, i think
that makes more sense
13:48
Don't bother preparing your round earth arguments, i think we should resolve to not indulge (if he even comes back)
but like most resolutions, we'll end up eating chips and talking about the flat earth
I still think we should do a monthly conspiracy. get a schedule going
I mean.. it CAN be a fun argument, but not after too long of realizing someone is simply incorrigible.
like, this month it is flat earth, next month finland, month after that lizard people in the government
keep it fresh
finland isn't real?
13:50
I tried to do that once, but was making up new conspiracies, and that got tricky.
nope
it's all water
well shit, i can't wait until finland month, then
@Luggage you ever been there?
14:06
USA isn't real.
#FakeCountry
is 26km within the atmosphere? If not, this poor kerbal might be stuck
70km is the top of the atmosphere
26 is very very much inside
should be slowing and falling
excellent, this was meant for unpowered re-entry
just didn't have quite enough fuel to make orbit
ohh, 26km is your periapsis..
yea, that's an aggressive reentry
14:09
I have plenty of engines to burn off :D
yeah, it was 200k at the one apsis and 26k at the other. I hit the edge of atmo at almost exactly 2400m/s and burned off all the engines.
Luckily, it stayed stable and didn't flip until the fuel tanks were at max heat, and the capsule had its own heat shield under that.
So this was not your original re-entry plan?
No, I was hoping the main stage would make orbit, but I did the boosters wrong.
put them on backwards again?
14:27
that I haven't done, but I did wait to light some off, so I was going sideways much more than up
@Luggage Yesterday I learned the Saturn V had some upside-down engines.
15:03
I made a vue thing 😃 codepen.io/towc/pen/dRMbaa
15:17
*:focus { outline: none; }
accessibility maaan
the best user experience is mysterioux, keep them guessing
we need a superhero called accessibility man
at least a sponsor/mascotte
there used to be such a hero, but they found out his real identity and chopped up his family
some people say his personal information was just... too accessible
@ssube 4/10 for effort
15:26
yeah that seems accurate
16:05
@KendallFrey for separating stages?
@Luggage yeah
I do that in KSP, too.
especially side-mounted boosters to prevent collisions
well, those are usually sideways mounted.
If I put separatrons on anything, they're sideways on boosters
Yea. Exactly.
and KSP doesn't require ullage
16:07
not without mods, at least
You don't do it just to 'role play'?
If I want that, I'll install RO
he only role plays space in the bedroom, not the bedroom in space
I don't really do that, but I am slightly saddened when I mess up a burn and have to re-light an engine, knowing that its'nt always realistic for all engines
16:08
I relight engines all the time :3
well, yea. but I see the appeal of trying to pull off a mission with those realistic limitations
or having a more narrow thrust range.
infinitely throttleable engines are ridiculously unrealistic
butt fuck it
I don't see the appeal of mods that add random failures. I can do that myself, thanks.
Does anyone know if it is possible to create a file containing all the @typedef, @name and other JSDoc declarations for InteliJ Webstorm to use on a javascript project file? Just to avoid having all the JSDoc blocks inside the javascript file itself
that very much defeats the value of doc comments
16:12
@ssube Do you happen to know then what is the correct alternative to using doc comments, in respect to the scenario I described?
it doesn't defeat the value of having docs generated in a readable html output or popping up in intellisense
(which vscode just improved)
will the intellisense work if they're in a different file?
no idea if jsdoc supports that
(like a .d.ts file)
not that I know of
well, it might for the es5 class syntax, back when you had to explicitly attach the docs to the function
All I want is to provide any future users of the project with a readable and understandable format that shows the types and structures of certain unknown variables, params, functions etc. but the main javascript itself will be used by end users who won't need that information and I'd really like to have them separated
16:14
oh, you just want to minify your code :)
no no
I really just want the js file intact, but without any doc comments, and another file with all the doc... comments or something like that
jsdoc and friends output some markup/markdown version of the docs that you can distribute
but once the file is opened in webstorm, webstorm itself recognizes the doc file and uses that flavor so that variables and functions don't get "unknown" marked all over the file
so your minified script doesn't need to have any of that, but your development version has the comments intact, and intellisense works
I can't say I'm aware of a way to get intellisense to pull from another file like that
but that's post processing, which -sadly- I cannot use
otherwise it would have made this all way easier
16:16
like it's forbidden?
yep
Quit.
not my policies, but have to abide by them
Give me your boss's phone number.
ah I whish
16:18
Just be glad you are targeting a browser and not x86. Writing assembly sucks.
I can only imagine the nightmare of that
So.. I am being hyperbolic, of course, but I still think it's unreasonable to forbid useful tools like that. :)
I have all the jsdoc comments on the top of the file, all tidy and organized, but the objective is to have all of those in a separate file and the js file clean of jsdoc comments, or at least without the majority of them
stating the type of vars and params is ok, but how those are structured is what we want to remove
What is the concern about leaving them? Size? Wouldn't the user also benefit from the intellisense provided by those docs?
I don't see why you would want to hide docs from a user of code.
you're supposed to put jsdoc next to the stuff it's documenting
16:20
example @typedef {{ {some_property: true, another: 1} }} variable_name
it's not really supposed to go at the top of the file
@Luggage exactly my words, but the orders only work in one direction, so here I am trying to see if such is possible
@ssube I know, it should be where they are being used, but they didn't like to see the sc so cluttered with comment blocks
oh dear
you should not work with anyone who considers comments to be clutter
That one aspect, I understand. A large block of comments all over the code can be ugly or make it harder to fit more relevant code on the screen.
but.. meh.
I just collapse the comment block while I'm working on the body
16:23
(I comment, but well formatted jsdoc can take up a lot of space)
yea. can do that.
all of this would be a breeze if the external libraries existed in webstorm doc libraries, but they are IP and not open to public, so I had to define variable structers and other stuff in the jsdocs
collapsing is a good solution.
most editors can collapse based on indentation
I was trying to find more info on TS and JSDoc together.. like if I could skip the parts of jsdoc that overlap with TS and still generate good docs..
they can, but they don't care about collapsing blocks
16:25
I just use typedoc
ohh, i'll look up typedoc
use json output and you can use gohugo or jq or pretty much anything to format it (handlebars)
it also has html output and a whole theming thing
hopefully i don't have to dick with that.
it was unmaintained for a while and recently got a big update, new website and stuff
last time I worked over angular, it was such a breeze and all the jsdoc comments were allowed in the ts files and now this
16:27
I use the json output because I'm trying to integrate my API docs into my website
I think I can convince Hugo to treat doc pages like blog posts and do some basic search and sitemap stuff
is it possible to create my own "library" where webstorm can lookup the variable structures and other types that would otherwise be in the comment blocks?
and I mean local library
yesterday, by Luggage
user image
React docs search is nice.
there's really nothing you can do without pre-processing the files
darn, guess the header documentation will have to do
and they wanted that at the bottom of the file instead of the top, you wouldn't believe what it took to explain that it doesn't work like that
16:30
this "they" you keep talking about sound like a doctor who villain
only during work, off work they are really great people
they just need to be strict and though because leadership here demands that
being strict and being wrong should not be the same
they could enforce a better set of rules even more easily
I know, I have been trying to set an api standard for the entire company for months, they don't see it as something that would help the workflow the way I see it
Tell that that some guy on the internet said "Restricting tools while simultaneously nitpicking about the exact placement of comments in code is petty, pointless and demonstrates incompetence."
so we now have api points with keys that can be "main_device_id" to "MainDevID" and even "M_D_ID"
16:32
Good docs mean you don't have to read the code. They save time.
all in the same api...
simple json/ajax calls are sometimes a nightmare to handle internally. at least they let me add converters (think that's a good name for it) for external api exposure, that way other services using our api don't have to deal with that soup of nightmare apis
I'm trying to let this go. :)
well gotta get back to work, thanks for the insights guys, I really appreciate it
there are a million good esprima/awk solution, if you can convince them to preprocess the files with make
how it that better than uglify.js?
ohh.. you want to trick them into post-processing?
16:38
I feel like make is an easy sell, then maybe node_modules are on the table, and you can use esprima or uglify
esprima or jsdoc or something just to get the comment text and do stuff with it
17:19
I am looking for an algorithm (data-mining?)
given are multiple datasets of persons.

D1:
name
email
eyecolor


D2
name
haircolor
age


there are thousends of this datasets. how can I determine that D1 describes the same person as D2 ?
17:40
That's quite the abstract and domain-specific question
what are you trying to optimize?
time of setup? time of querying?
Forgive me but wouldn't name be the only matching field?
Unless race is another field there really isn't any trickery you can do.
wtf did S5E1 of archer spoil the rest of the season just like that? That was a dick move
18:00
I have been given an opportunity to start an application from scratch. I don't want to use frameworks like angular or libraries like React. I am really only interested in using vanilla.js. However, it needs it also needs to scale. Are there any well-documented patterns I should be looking into?
yes. Experience
if you want it to be scalable and maintainable, you will practically end up creating your own framework/library
which, by all means, go ahead
it's a great learning experience and will help you later on
I also highly recommend TypeScript for added sanity.
but really, the only realistic way of making it well is if you've used other libraries/frameworks and see what concepts you can borrow and add
chances are, you're going to use a miniature version of something that is already out there
I'm going to assume you're not a coding genius or actually have a shitton of experience
just remember, if this is your job, you want to maximise certain stuff
so don't go experimenting too far and actually get things done
18:07
I know angular really well, which is why I am trying to avoid it
try using vue
or rewrite something like angular but to better fit your needs
Ok, something worth considering.
However, I will also heed @Madra Uchiha and ask this question where there are more people in the room
it's a joke :P
but sure, ask for more opinions, it's rarely a bad idea
unless it's about crimes.
The question is always "what's your goal". Do you want to learn in general? Then as the Cheshire cat said, it doesn't matter what you do. If you want to learn something specific, then read up on it and apply.
Otherwise if you just wanna write the best code in the universe js isn't significantly different in that regard.
18:14
Luggage nice!! There are so many different frameworks out there and so manny different approaches to the problem. Someone suggested I use streaming libraries like bacon.js
to avoid the havoc of dealing with states etc...
Note that bacon's an FRP library, it doesn't help you avoid state
if you want to avoid state learn haskell :3
hi
anyone knows how to allow cross-origin on a website?
Already started learning Haskell. I want to avoid frameworks. because I end up learning the framework
18:24
@Zirak thanks i will check it out!
@Zirak i have added header("Access-Control-Allow-Origin: *"); on my website already but i'm still giving cross-origin frame when i try to access it from a different domain
why would one use skip lists over binary search trees?
143
Q: Skip List vs. Binary Tree

ClaudiuI recently came across the data structure known as a Skip list. They seem to have very similar behavior to a binary search tree... my question is - why would you ever want to use a skip list over a binary search tree?

this is pretty cool: jon.gold
this whole thing is pretty cool: creative-portfolios.com
18:49
has anyone here taken fluoxetine
Jon gold doesn't seem to work on the iPhone
does it make you trip balls?
apparently it's famous for impotency
you won't have kids @iLiveInAPineappleUnderTheSea
certainly not in a pineapple
someone please help me
@iLiveInAPineappleUnderTheSea what is your diagnosis
pleasure talkin to you @towc
18:52
did you also take fluoxetine @mahdi?
@towc what?!
@iLiveInAPineappleUnderTheSea truth is, we're javascript developers
except sterling here, we don't know much about drugs, and we shouldn't be the goto people
if you think you have a problem, talk to a doctor
my life advice is don't do drugs. If you do, don't do it because you feel you need to, do it only when you're sure you just want to
18:55
after seeing the peep show, I now associate sterling with drugs
19:08
Can i ask your support on an angualr 1.6 code issue, please.
Cannot set property 'silos' of null
19:45
what line what's the trace what else?
20:17
line 20
this.silos = args.data;
Cannot set property 'silos' of null
so?
what did you try?
@towc this was issue. I am able to do using function
controller: SiloListController,
But when it is a controller is a class. How can i access the this.silo in $on event subscription fucntion
@towc omg, look at the new avatar. Your soul-mate.
λ
@Luggage we talked to him
21:19
is there any good reason to use React when Vue is around?
Vue just solves everything that react tries to solve, and imo so much better
you liking it better is a reason.
why the hate?
I thought we were friends
a thumb and a rainbow λ floating through space
why do you make everything bait?
do I?
when I'm annoying it's usually meant well
ha
21:44
@towc You sometimes surprise me
How about a simple "to each his own" or "it's subjective" or "try turning the tables and your sentence is still true"
I assume that's... not a compliment?
well sure, you might prefer react, but until someone tells me why, I'm probably not going to figure it out
> is there any good reason to use Vue when React is around?
> React just solves everything that vue tries to solve, and ***imo*** so much better
well, I do have a lot of criticisms for that
@towc That's fine, and to top if off a better sentiment than "this is shitty, mine is better, why do you use shitty?"
More likely to get results
it's more like "I think yours is shitty, imo mine is better. If anyone feels like contradditing me, please do"
let me try that again
what are your criticisms of Vue in comparison to frameworks like React?
22:04
I love me so much right now
I dunno, sterling is so much better imo
user1596138
@towc lmao this is pretty much what the Vue guy said at the conf I went to in reverse
@towc He didn't write my super awesome code
@Jhoverit what did he say was wrong with vue?
user1596138
He said what you said but about React
22:07
did he give any examples?
user1596138
> why use React, this is so much simpler
user1596138
Or something along those lines. I'm mobile
user1596138
He had benchmarks idk. I jus think it's funny everyone tries to make it Vue vs React. Don't worry about it, use React if you want to
user1596138
Facebook actually made a Newsfeed page or something that was entirely Vue
user1596138
I'll see if I can find it.
22:08
@Jhoverit I just use jQuery
user1596138
Well we aren't all that advanced @KendallFrey
ikr
I make jQuery plugins in my spare time
and @ndugger has push access to all my github
omg you can use method syntax with quotes?
obj = {
  'method-name' ( stuff ) { ... }
}
I find that hilarious
22:52
@towc and where did you get this from and what does it accomplish?
you know what method syntax is? You know what quoted literals are?
Yes and yes
well, combine the two
so stuff is Args?
On cellphone sorry for typos
!!> var obj = { 'console-log' ( x ) { console.log( x ) } }; obj[ 'console-log' ]( obj )
22:54
@towc "SyntaxError: missing } after property list"
@towc "undefined" Logged: {"console-log":"function console-log( x ) { console.log( x ) }"}
tadaa
Hmm this must be non standard
I've seen it used in vue because { $route( x ) { ... } } can't happen because { $anything: something} is not a thing but { '$anything': something } is and so is { '$route' ( x ) { ... } }
except it is standard
it's a simple combination of method syntax and quoted properties
00:00 - 23:0023:00 - 00:00

« first day (2429 days earlier)      last day (2744 days later) »