« first day (2137 days earlier)      last day (3035 days later) » 

13:00
any mongob users on?
if I ask for some/inner/module.js, it's dependencies should be crawled and only those should be bundled
not some/index.js
which I didn't even ask for
and is a totally wrong assumption to make
@Loktar lmao "his technique was flawless"
@Mosho that's an issue you'll have to bring up with webpack then
there are no assumptions. what webpack includes is all dependent on how the modules reference each other.
so if 'some-module/index' references all other files, it'll includes them all, and if 'some-modules/specific/feature' does not, it won't
references = require(), define(), etc.
13:10
In webpack, how do you define a module dependency in the config?
Sort of like a shim in require JS -- angular needs jQuery to load first, etc
with the imports and exports loaders, I think..
github.com/webpack/docs/wiki/shimming-modules has the info you seek, but I am looking for a better example
github.com/webpack/imports-loader has better info and shows using an alias to package up the 'shim' into your web.confing without it being inline in your require().
Perfect, thanks!
or.. not an alias.. module.loaders,
yea, that makes modules available in the gloabl scope to ALL.
13:20
ah okay. so it could conflict?
maybe, but you don't always want any modules you have to shim once to be in global.
though, I ProvidePlugin({ $: 'jquery' }) so that $ is available int he browser console
they're gonna regret that
my favourite one :3
Dicks out for Harambe
13:29
You are kids
It's called gorilla glue because Harambe was the glue that held our nation together
it's called gorilla glue because it is made from gorilla
@rlemon ;_:
harambe is out there waiting to put together some furniture
13:30
that's trying to hold a straight face with a laugh-cry-tear
@rlemon the grammar ruined the joke
Eh fuck. I accidentally starred that and someone followed before I unstarred.
@BadgerCat "Thanks <3" filled out your form :D If you send me a card I'll send you one back!
@SterlingArcher If you send me a card, I'll send it back with the names swapped.
@rlemon there's going to be so many tentacles in 2020 Olympics
@littlepootis that's like poking on facebook lol
Quick question: I don't think it's possible, can I detect a device reboot or device uptime in js?
nope.
depends on your definition of js, really.
I'm not sure if you can -- for security reasons of course
13:40
> require("fs").readFileSync("/proc/uptime").toString()
'4062.56 31200.49\n'
NodeJS might be able to
If node, then yes
Node can get client uptime?
w3.org/TR/battery-status you could guess with the battery status
@MattCowley yes
13:42
@MattCowley no, node can only get its own servers uptime
Thought so.
I'll take "Bands that don't look anything like what they sound like for $200, Alex"
What a good song though.
Pretty sure the frontman may be God
Anyone know any sites that take a url and show you all console errors? (I'm on mobile and not having console sucks balls)
ah crap
I managed to route my drawer links to the content, but I messed up. i need to route my drawer links to new sets of tabs!!!
Can anyone help me correct this?
13:52
How to access an object which is wrappen by an array and which again is wrapped by object ?
sha
@Shashi so the array is one of the obj properties?
so first there is a Object then inside that there is an key which holds array, and inside that array collection of objects
here is the link
okay
whats your current access line?
also, that's not the entire object, is it?
if it is, then if you can access Product ID of Products of the over-arching object
if not, you can still access it
1 message moved to Trash can
@Shashi Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
My head is spinning
13:55
you sure it isn't a string?
shoot, I didn't catch that dude
How does jsconsole work? I did :load then my url and bugger all happened
can you try doing it again with formatting
1 message moved to Trash can
@Shashi Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
-_-
I got it, thanks @Shashi pastery.net/nxmpcn
try to use pastery from now on @Shashi
13:56
sure, thanks
Hello Guys,
I'm using DataTable server side for listing record. I just want to know is there a that i can get what are the coloum user has sorted?

For Example user has sorted a record table by username, then i have to get the index of that coloum and store it into the database.
2 secs, looking now
@RaunakGupta Welcome to the JavaScript chat! Please review the room 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.
sure take your time
@Shashi where's the actual project?
13:57
its on localhost
@Shashi I can't test a line in my console with some <pre> text
oh
local machine server
2 secs, i'll crack out a project and try accessing one of the properties. Anything in specific?
@RaunakGupta Would love to help but a bit confused what you are trying to achieve.
@rlemon How do I use it, :load then my url did nothing.
nope, I just need to first acces those first Product array and then brands and from there on will be doing filters
13:59
@MattCowley: i have to store the sorted coloum index in the db so that if user visit again then it will be same as he left it.
@MattCowley read their docs
you load it on your page
@rlemon Poop, again, on mobile, don't have access.
hey guys. i have a script which takes input (x) and passes it to another js script. any ideas how can I do this with a while Loop?
var child = require('child_process');
var inputs1 = child.spawn('node', ['inputs.js']);
var x = 10;
inputs1.stdin.write(x.toString());
inputs1.stdin.end();
inputs1.stdout.on('data', (data) => {
	console.log(data.toString());
})
// while (x < 10) {
// 	inputs1.stdin.write(x.toString()); // This gives errors...
// 	inputs1.stdin.end();
// }
@RaunakGupta Best doing it with cookies? Or do a post call via Ajax to a server side script that stores it in the DB.
@Shashi products[0].ProductName picked up Sony for me
I'd like to know where you get results from
14:01
5 mins ago, by rlemon
you sure it isn't a string?
JSON is transmitted as a string, not an object literal
@matt i'll use the browser storage, and after very 5min ill run the ajax that will save the data into user table
@Shashi if you wanted to wrap it in results, you'll have to have the correct JSON notation for that.
@MattCowley
not sure if the lib used converts it automagically
most do
14:02
@MassDebates I am trying to get it in angular $scope.product object, but it always says "unexpected token" :
@MassDebates how would I do that ? any examples ?
@RaunakGupta Cool. Ajax and PHP are easy, Google it or ask here if you need further help. Edit: pha who needs jquery.
xhr is easy
you don't need jQuery
@Shashi I don't know
@Shashi I need more info
@MattCowley, i just want to know how to grab that event, i did't find that in google.
console.log(typeof results)
see if it is actually an object
14:04
/*
	Function to simplify native XHR request. created by Robert Lemon

	url: nodejs route to send to
	data: data string template
	method: POST/GET/PUT
 */

function xhr(args) {
	return new Promise((resolve, reject) => {
		const hr = new XMLHttpRequest();
		hr.open(args.method || 'POST', args.url);
		hr.onload = () => {
			if( hr.status >= 200 && hr.status < 300 ) {
				return resolve(hr.responseText);
			}
			reject({
				message: hr.statusText
			});
		};
		hr.onerror = () => {
			reject({
				message: hr.responseText
XHR ftw
ew, what shitty code
Right? Who's the dickmaster that wrote that shit?
who wants to help me optimize some codes? :P
@RaunakGupta Which event, sorry I'm slightly lost.
gist.github.com/rlemon/6e7f8218e129afed676eea4a150d55bf I'm parsing an image and then matching colour blocks to 'dnc_codes' (large definition, I can give examples but should be irrelevant) and putting that into a array or arrays
14:06
ok @MattCowley np, I'm using DataTable server side for listing record. I just want to know what are the coloum user has sorted.
how much slower is having arrays of arrays vs generating a new image matrix (1d) ??
> errorMsg += " We may not have the best security, but it's better than that!"
fuck I'm not the best security coder lol
	return 	Math.sqrt(Math.pow((clr2.r - clr1.r), 2) +
			Math.pow((clr2.g - clr1.g), 2) +
			Math.pow((clr2.b - clr1.b), 2))
ohh and this is known slow af
@rlemon Use typed arrays
some maths people maybe can show me a better way?
14:07
@RaunakGupta Never used DataTable, if the user has sorted it, surely it's in the url, a cookie or a request, or capture the sorting event?
@copy UInt32?
@rlemon sqrt lookup tables all the way
@rlemon Yes
@OliverSalzburg I'll have to look up what that is :D (I have an idea)
You can do new Uint32Array(imagedata.data.buffer) to get a view on the image data
14:09
ok @MattCowley, as it is a server side so no url is fired but i got the point it will be in ajax request . Thanks alot man this idea will help me.
@MattCowley thanks, is there a way i can credit you, this is my first chat so i dont know.
@RaunakGupta Not that I know of, dw.
@MassDebates I just want to iterate through products and display it and same for brands
@MassDebates then I need a filter that filter through product based on brands, but first need to figure out how to display that product lists
Anyone here good with iOS web apps?
Is there any JS control for iOS web app settings.
Like changing the title or icon etc
@MattCowley Wouldn't that just be the title of the page and the favicon (or equivalent)?
@MattCowley you need some kind of wrapper to make that happen
14:21
@OliverSalzburg Nah, you set the icon title when you add it to the home screen, it is independent of the webpage title once set.
@OliverSalzburg As for the icon, i think again it is independent.
Let's play the, "How much cancer does this code give you?", game. github.com/ndugger/vorge/blob/master/src/entities/character/…
To my understanding, you use rel="apple-touch-icon-precomposed" to specify that icon
@OliverSalzburg Yeah. I think it takes that on adding to home screen the saves that icon.
If it doesn't use the page's title attribute, then I don't know about that part
@MattCowley Well, regarding the icon in general, I always found this to be a great resource: github.com/audreyr/favicon-cheat-sheet
@ndugger switch ( true ) { case dir === Common.compass.north: <- you've actually invented a construct I've never once seen before, so that's cool
14:25
@ssube I wanted to do a switch because there's actually 4 more cases for northEast, southEast, southWest and northWest, and writing that many if's just seemed abusive.
oh, yeah, that's absolutely where you should use a switch
I've just never seen anybody switch on true and then compare the switch value in each case
I learned it from someone in here
it may have been @rlemon
@ndugger switch(dir) ?
that is the strangest flow control I've ever seen
@copy actually, yeah, that would make more sense... lol
14:27
yea not me :D
@OliverSalzburg Just did some more googling, it seems if you change the url for the icon in the meta tag it'll update on a device reboot...
I still am breaking
@ssube i often do it this way too.. sometimes it feels more readable
using switch (true) makes more sense when you're doing other things
@ndugger You should put the break on its own line, and what's up with the (this.x | 0)
14:28
as copy pointed out, I don't need to do that here
@ndugger other things like what?
@ndugger i like this one "somethingSomethingDynamicWalkingFrameBasedOnNumberOfFrames" haha
@ssube things like checking if something is an instance of something, like...
switch ( true ) {
    case foo instanceof Foo ...
    case foo instanceof Bar ...
}
@copy bitwise operators--nothing wrong there
@ndugger Do you use it for rounding or to treat undefined as 0?
@copy rounding
14:31
bitwise rounding isn't great
It doesn't round uniformly around 0
I'm flooring
or for very large values
I thought bitwise was faster
It's not the same as floor, it's truncation
> [0.9 | 0, -0.9 | 0]
[ 0, 0 ]
14:32
@ndugger it can actually be slower, if the number was already a float (you're forcing it to bail to int)
@copy fair, but that's not different as far as what I'm after in this case
I never remember if floor goes down or toward 0 anyway.
@ndugger If x can't be negative, it's okay. But also what ssube said
Yeah, my coordinates can't be negative, so it's fine.
@Luggage down (first int < val)
14:34
I'll have to run some performance testing to see if one is faster than the other
@ndugger will they ever go over 4.2b?
Well, remind me of that when I need it. :)
@ssube nope
will they ever be decimals before you round them and are you using integer math after?
yes and yes
14:35
where are you using the imath stuff?
uhhhhhhhhhhhh, let me find
it's pretty unlikely that rounding coordinates will be a performance problem for a long time, but bitwise trunc leaves you with an int from then on, so if you use that int with any floats in math you'll just have to promote it back to float and waste that time
Maybe I don't need to floor my x and y right there...
I'll test this when I get home
I believe JS follows the same width rules as C and friends for math, that every operand has to be promoted to the width of the most-precise one (so int + int + float will convert everything to float then add)
I might have got ambitious with making sure I was dealing with integers in my coordinates
14:39
that or they demote every operand to the narrowest, which is worse
All I knows is that 2D canvas has a hard time with floats for coordinates, so I wanted to make sure that I was dealing with ints, but I feel like the math is already there to make it an int, and flooring it is overkill... I'll have to check later
just make sure you don't mix floats and ints, is really the tldr
gets bad
> Floor it?
anyone work with the html5 camera api ?
lemon has
14:50
things are pretty murky on what is/isn't supported
the biggest piss off was when they required https
great, now my little toy apps have to be signed
bastards
Yeah but like, dat security mate
everyone make some burner gifs
@ndugger what do you mean?
hard time as in blurry?
i guess it works on localhost but throws a fit otherwise
but yeah, sucks -- i'm trying to play around with it in codepen, no dice
14:55
@JoshuaLonganecker localhost is considered secure
always
So guys, my new favorite show is without a doubt, Rick and Morty
as a developer i should be able to ignore warnings like that
I'm sure there is a flag if you dig deep
Steph put it on last night and I was laughing so hard I woke up the baby in the basement
@SterlingArcher you sonofabitch
we've been recommending it for months
I see how it is
hoes before bros
:(
14:57
does anybody know of a quick way to strip out react attributes from html?
trying to do a quick codepen to do some live tweaks and I've got a mess here
@SterlingArcher yea. It's the new futurama.
This is where I lost my shit lol
@ndugger I just use the following gets rid of all blurriness
x = 0.5 + xcoord << 0
y = 0.5 + ycoord << 0
14:58
It's a trick when your boss says "if you are bored, take a look at X"
@rlemon I saw one episode before, and it was great, but I always forget when it's on lol
:(
nope
@SterlingArcher hulu has them for free, youtube has them for $
hoes before bros? i texted you this morning D:
you don't need to screw with your actual coords, you just change the rendering to full/half pixel
guess i'll work local, sounds much easier for this
@JoshuaLonganecker neat, but I'm fine with setting up https
14:59
was just kinda a piss off when i noticed

« first day (2137 days earlier)      last day (3035 days later) »