« first day (2391 days earlier)      last day (2779 days later) » 

00:00
huh TIL
I have a soft spot for ejs, it's what I used with express before I took the React pill
also, I finally found the proper cable \o/
now I can unbrick my arduinos hopefully.
Its what I still use with express
it's your typical code + templating language. A classic type of tool.
do you still need it with es6 template strings though?
i suppose they are less powerful and don't allow loops and stuff though :/
@derp try making a full webpage with es6 template string
00:05
@KendallFrey ho-lee-shoot. small world. gfycat.com/TightAmazingImpala
lemme share a snippet
this was on /r/holdmybeer
need? i guess not. but if you are doing anything big, it probably has many niceties. Also syntax highlighting probably works a lot better.
that's a pub in Waterloo
Do you have to use redux? It doesn't look fun
00:07
no
you don't have to use shit, and i think it's better to learn bare-back
thank god
bare-back is the best
@Luggage that's what they taught in the 70's.
many didn't survive.
RIP
Too soon.
00:08
Way too soon.
@derp I can make all <tr> in a single line but the code will be even more unreadable.
@Shrek why not separate the table contents into a ${tableContents} which is composed of several ${tableRows}
try :D
This was done in a hurry, I'm sure I can do that but maintaining multiple levels of that becomes a pain
I can move all of this to a function that just accepts the inputs
which itself calls tableRow
but then I'm making a templating engine using functions
but i do get your point and most templating libraries do give you a for loop of some sort
I was just going to suggest you let it accept arrays in body[] to handle children
also sanitizing input
00:13
hahaha true
i eventually replaced this with jade / pug
we'll just add in a nice user message for them not to use ' or " characters xD
and the code is way more elegant :P
do you have that handy?
might as well use hyperscript
00:14
@derp nothing special there vanilla jade / pug
its almost their for loop example (have a look)
oh that is cool!
00:17
hi
I'm prolly gonna end up with a React SPA
but meh.
back to work
i like how you don't have to type the tag twice
what about Angular?
whats wrong with that?
Still lots of Pug in my code
But it'll all be React one day.
would you recommend using Pug?
00:19
No.
Its a tool
just like pug
or react
if it suits your use case, use it.
as much as Jquery suits a use case? :P
yep
My use case is finding a nail for this bloody hammer.
What you are asking is equivalent to should I use my Car, My bike, public transport or USS Enterprise NCC-1701-D
to goto the next room.
00:23
you know why react?
compared to angular?
i thought angular is now cool now
depends on the team
oh and the problem you are trying to solve
I can only imagine how difficult it'd be working in a large team with angular
@monners it'd be more like
!!giphy battlefield
lol how so?
if anything wouldnt it be easier in angular cause the framework is all there
00:24
@Rolando React is a library, Angular is a framework. React gives you more explicit control, but you'll have to roll your own logic for most stuff that angular gives you straight out of the box.
Also, React is JavaScript-first, Angular is HTML-first
React is JavascriptX first 2.9
both can work and work well though, depends on the people
angular is typescript first?
React is life
if you have a bunch of people that don't care, you'll end up with a bowl of spaghetti regardless of what you use
00:26
OMG that!
Tasty spaghetti
I can't have spaghetti :(
I'm dying to eat meat.
gluten free spaghetti?
it doesn't need meat.
sure
00:28
a while ago, our teams were looking at options for a UI rewrite
It doesn't ?
one team chose ember because they wanted their decisions pre made
meatballs are an option. A common option..
I've only eaten it with meat, and oh boy that was so delicious.
Ember sux
so does vue
00:28
and another team chose angular because there a guy had done angular before and could provide expertise
fry eggplant and put that on top. Then you have eggplant parmesan
now i want chicken parmesan
🐔 🍝
@Shrek can you have seafood
because spaghetti marinara
I can't eat meat :|, here.
01:39
i might be wrong about this
but is startdistance and endDistance simply take the sqrt of somethign you just squared?
the end result being a Math.abs essentially?
don't sqrt, compare squares.
01:56
yeah @Shrek just tested it, the sqrt and squaring is redundant
not entirely sure of the geometry of your problem but i suspect you're missing another square within the sqrt
02:08
I don't think there needs to be a loop at all
I think a binary search would offer much better results then what he is doing
what is he trying to do?
Trying to maintain a timeline by keeping snapshots of past states and interpolating between them
for example you can take snapshot from 0 - 1s at 50ms
and then ask for the state at 775ms
it'll interpolate between 750 and 800 ms snapshots to generate the 775 state
and it works out the curve for each variable based off previous values?
This is linear
ah okay
that's pretty cool
02:14
it is a re-implementation of
which takes a different approach
at (elapsedTime: number) {
                    const lowerEndTime = toFrameTime(elapsedTime, interval);
                    const higherEndTime = lowerEndTime + interval;
                    const higherEnd = states.get(higherEndTime);
                    const lowerEnd = states.get(lowerEndTime);

                    if (higherEnd && lowerEnd) {
                        const lerpDelta = elapsedTime - lowerEndTime;
                        return new Proxy({}, ProxyHandler(lowerEnd, higherEnd, interpolate, lerpDelta));
I'm cheating with maps, but I'm bound to run into data corruption if I do this.
the god at valve take a very interesting approach for this github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/…
02:35
also the gods at Valve need better code editors
03:26
hi
has someone created custom modules?
04:05
Sure, once. But that was a long, long time ago
module.export = function () {...}
 
2 hours later…
06:23
I had an issue writing a server config for webpack in Node but have already solved it :)
is it possible to convert a string into a stream with chunks?
 
1 hour later…
07:52
hmm i was using SO search with -[jquery] aaand ... got questions jQuery answers. :/
08:20
good morning
Well not that good :P
I am being annoyed by CORS ^^
But anyways morning
08:40
i'm annoyed by jira
;_:
Not a javascript expert, seemed like the apache configuration blocked the headers to be set
user6820627
@MikeM. What server side language are you using?
PHP
but it's fixed now, I didn't really get from which side the issue was.
09:04
Hello everyone
Can anyone help me regarding LMS+Scorm?
@HaseebKhan what and what?
ah yes
a new day, a new react library
09:34
@BenFortune I was hoping for a fractal rendering library...
Quick question lads... Which is the better shallow copy for an array? [...array] or array.slice()?
09:55
@Cerbrus this is my question link if you can help me, please
https://stackoverflow.com/questions/43754554/moodle-scorm-course-resume
@Chris i like the first one
@Chris What ever you end up using, add a comment explaining your intent.
10:31
@littlepootis ... really?
10:47
with .filter I'm right in saying you can use promises to return a value?
.filter(article => checkValueWith(article))
function checkValueWith(articleData) {
        return self.pool.query('Select * from `articles` WHERE title=? OR url=?', [articleData.title, articleData.url]).then((res) => {
            if (res.length > 0) {
                return true;
            } else {
                return false;
            }
        });
    }
Not natively, but Bluebird supports it
Though it'll work with Promise.all I think
hmm it's just at the moment it it keeps inserting the same record
.then(res => res.length > 0)
oh and return the length below?
.filter(article => checkValueWith(article).then((res) => {
                        return res > 0;
                    }))
You'll need to return all the values first, then filter
10:52
function checkValueWith(articleData) {
        return self.pool.query('Select * from `articles` WHERE title=? OR url=?', [articleData.title, articleData.url]).then((res) => {
            return res.length;
        });
    }
because filter is sync right?
ugh
Not sure how I do this then
Guessing you're not using Bluebird?
I am
Then it should work
10:54
@lix ohaaaaai o/
Hey!
How are you?
It just can't be right
like everytime I reload calls it keeps saying there's around 300-400 new articles
in the space of a minute lmao
fine fine ^^
@BenFortune does it remove it from the list when returning true or false?
Good to hear dude
codesses and coders, how does one solve Yarn lockfile conflicts? I sort of trash it and re-run Yarn, but dunno if there's something niftier
Falsey values are removed
10:57
that exsplains
res > 0;
returns true
Wouldn't trust me with your database, you'll have 20k duplicate records
This is so strange
It's still pulling 400 odd records
each time
Basically @BenFortune if you remember a while ago you helped me with the article pulling script, well the data grew so quickly it caused memory issues when holding those articles in a map. So I've changed everyting to be pulled out the database when needed so I could make the datasets used smaller to save memory
One of the issues I now have is filtering articles inside of the database doesn't seem to work at all :/
I included the other function I made that gets all the sources to try and perform a sync filter once it gets all the records for that source
From what I can tell while the checkValueWith function is working correctly it's not removing the articles with the .filter
11:17
Why aren't you doing what I told you ._.
maybe I misunderstood ben? :-(
Been working on this one function since yesterday and I'm going crazy
Where should I be using that then?
@lix .filter()'s callback cannot be async.
It must synchronously return a value, and the resulting array would be based on whether that value is truthy or not.
A Promise is an object, which is always truthy.
That would exsplain why I'm getting wonky results
I guess I should take all the results and create an array with all of the true's/ falses
then pass that array into my filter
Which way is better for shallow copying an array? array.slice() or [...array]?
actually I'm just stuck that won't work either
11:28
@Chris Depends whether you prefer compatibility or idiomaticity
I find the second one more obvious
@KendallFrey, I guess performance
Then try jsperf
good idea. I actually searched for this question but couldnt find it on SO
Perhaps a worthy question
Perhaps easily testable things aren't worthy questions.
@KendallFrey well the question would be more than just performance. A general comparison of the two
Anyway, thanks for your input :)
11:34
@BenFortune I read back through what you've said and I gather I need to promise.all all of the values and use the resulting array to carry out my filter?
Because filter is iterative meaning if I provide => array it will go through the second variable also?
Yeah. But if you're using Bluebird it supports asynchronous filtering
wouldn't that just make my example above work?
I have var Promise = require("bluebird");
Only if your underlying promises also use Bluebird (from your query).
Otherwise you can just call Promise.resolve() on it to convert it to a Bluebird promise
ahh so it's likely my .filter is not actually bluebird
actually your 100% right
the mysql-promise library is being used
I had someone trying to promote their product on my youtube video. That means I'm popular, right?
11:39
or not actually as that lib just wraps stuff in bluebird promises
@KendallFrey, just tried jsperf. Slice is approx 80% faster than the destructor. Thought I'd share
11:57
I'm still really lost
Feel like I'm just going around in circles with nothing working
@BenFortune No, not necessarily
You can use the static Promise.filter() method to asynchronously filter any thenable.
@MadaraUchiha Could you help me figure my problem out?
@lix 'fraid not, I'm at work with lots to do
Maybe in a few hours though, if you'd be active.\
@MadaraUchiha I'll ping you in like 3-4 hours if I've still not got it working? :-)
@lix Sounds good 👍
12:15
morning everyone
Hiya
A quick question...
@Chris IIRC .slice has some internal optimizations
@MadaraUchiha Ah, good to know
@KarelG, oh ok. Thanks
@Mathematics A quick answer
12:27
slow answer from me
what's the best way to store the initial value in a html form as a variable in your js?
@JohnSumner 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.
just defaultvalue I'm guessing?
@corvid thank you, but it is too late
@littlepootis thanks that helped lol
zed
zed
A bit of help, I have a node.js server application. When I run babel app -d build the ES6 gets built into build folder, however the node_modules are not included.
12:30
@JohnSumner const muhValue = document.querySelector('#muhInput').value;
zed
zed
Why is that happening? What's the expected way of importing the modules? Isn't build a folder that can be shipped?
@BenFortune const initial = [...form.elements].map(element => ({id: element.id, value: element.value}));
\o/
@rlemon Value, singular!
in a form, not element.
the value of a form is the sum of its elements.
const initial = [...form.elements].map(({id, value}) => ({id, value}));
12:39
shut up fancy pants :D
it's 8am here
Git gud
@zed You don't normally compile files from node_modules with babel.
zed
zed
Do I just copy them @Luggage?
If they're in node_modules, they should already be compiled
12:48
Is this for server or browser?
zed
zed
server
if for server, you just leave them there.
zed
zed
So I'd have node_modules and build folders?
where are your files before they are put in build/ ? src/ ?
zed
zed
yea
12:49
so, yes. src/, build/ and node_modules/
zed
zed
perfect.. thanks
@BenFortune That reminds me of my time in dark souls
Is seeing completion from TS in data-bind="" attribute inside a .pug file too much to ask?
I guess so.
Good morning all, I was wondering if anyone has some Grade A+ cache busting tips? Right now we're looking at adding ?ver=[assemblyversion] to each of our js files, is there an easier way?
That's a fine way.
or a build date, etc.
12:59
Oh date would be easier to read
@JohnPavek Do you have any build steps?

« first day (2391 days earlier)      last day (2779 days later) »