« first day (2410 days earlier)      last day (2760 days later) » 

03:43
Ugh, I've been sick for the last five days
sick of javascript?
me too
never
03:57
@KendallFrey roborecall is amazing
04:30
do you get motion sickness playing VR?
no but i did scream playing dreadhalls
just read an article suggesting that the military uses VR as a form of torture
a clockwork orange - VR edition
05:07
@rlemon
heh
@SterlingArcher You know I vape too, right?
And for exactly that reason
nice
 
2 hours later…
06:49
hey can you guys recommend me a javascript 2d physics engine
there's a few that come back from the googles but there's a lot of them and some of them are a bit dated
you can do 2D stuff in unity too.
(albeit it may be overkill but ... )
These look interesting
https://github.com/schteppe/p2.js
https://github.com/liabru/matter-js
eh "wrecking ball" demo. it reminded me to Miley
07:16
-1
Q: How to hide/show form elements after an option is selected?

Kumar AbhirupI'm making a form where an event information is in input. But here, If we select the option marriage, then 2 fields should appear. If we select session, then a single field should replace other two fields. I have written the code below and I got no good result when executed. <form class="ta...

Am I the only one seeing un-formatted code ?
@derp If you find an up-to-date comparison of those engines or write one yourself please link us to it, this would be interesting
@derp dated? You mean they actually released a 1.0?
Back in the day, we only had a single rigid body 2D physics engine for the whole settlement. You could use it for an indie game project once a week and you liked it!
08:14
My ng repeat looks something like this {{"name :" body.name}}
how can I style the 'name' part (which is just text"
I've a dilemma ...
@MaartenWachters Why is it part of the expression in the first place?
firefox doesn't allow events being dispatched on disabled elements. Now, this disabled element is a date. I have hooked a custom event on it which in a given state is disabled, but auto-updates if another date element gets changed.
if not disabled, it works fine
(it's to select a date range, but in some states, it only expects one day max)
an approach is to mimick the disabled behavior with CSS so that it would dispatch the event in firefox
@OliverSalzburg prntscr.com/fan8k1 To show it like that
or use hidden field. But that isn't so clean because the value in the input is still not updated
08:19
As if I'm going to click a shitty prntscr link
08:51
Lol its just a lightshot link
but doesnt matter, fixed it anyways
how do I make a dependency injection for data access?
For example, I want to use mongo, mysql or postgres
1 message moved to Trash can
@GokhanDilek 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
Hi all, I'm seraching over the stackoverflow how to solve autocomplite="off", because none of solution posted does not work for me.
I used this for password <app-control model="ctrl.passwordData.newPassword" label="{{'New password' | translate}}" render-as-password-input="true" autocomplete="new-password"></app-control>
@Andrej 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.
08:56
@GokhanDilek I don't see how that desire is solved by DI
> none of solution posted does not work for me
Sounds like you're set then
Can I ask for some help here: stackoverflow.com/questions/44098059/…
      const acc_no = method_info(editable, method,  "account_no")
      const ifsc_code = method_info(editable, method,  "ifsc_code");
      const swift_code = method_info(editable, method,  "swift_code");
      const account_name = method_info(editable, method,  "account_name");

      this.state = {
        account_name: account_name,
        ifsc_code: ifsc_code,
        swift_code: swift_code,
        acc_no: acc_no,
        acc_no_conf: acc_no,
        method: "bank_acc",
        error: false,
better way to do this ?
method info returns the value from the method object if its editable else
returns " "
09:18
@SterlingArcher is this the dude from Attack Attack!?
09:31
@nonerth Given that that module seems to construct a CLI invokation for the GM binaries, a lot more factors come into play here
I'd look for a different library right away
I mean its a pretty big library, and it supports (from what they say at least), unicode characters
plus after searching through the issues on github, I did not encouter any similar to mine which means that perhaps am missing something.
@programmingandroid 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.
ok thanks @CapricaSix, can you run a socket server if you have ssh access on a shared hosting plan?
can anyone tell me the video that comes after this one? youtube.com/watch?v=wW_jSwVcXuM #StrongLoop #loopback
They were talking about making a full fledged app using angular and stuff...
09:46
@nonerth Maybe you're not aware of the implications of invoking a binary in the way this library does. GM probably handles Unicode just fine. That NodeJS wrapper on the other hand...
@deostroll are those..... hashtags?
Yes am not indeed aware of the implications. So what should I do if its the wrapper's fault?
yes...just to give an indication that its loopback
@nonerth Use a library that works in a different way
So I cant do it with this library uh?
Looking through the issues I've seen people use gm for unicode chars as well though
09:53
@nonerth Well, the problem is that they generate a string and pass that to the OS so that it starts the application with that string as arguments. So there are several additional layers where text encoding can be an issue
They apparently use cross-spawn to spawn the child process. No idea if that might even invoke the command through the shell
Okay I understand roughly what you are saying I guess I got to look for another lib. I am hesitant cause gm did the job well and I've been using it for a few weeks already so I'll have to make a few changes
peshaps I'll go with this one github.com/Automattic/node-canvas
@nonerth Well, you could also see what command line the library actually generates. Then you could invoke that command line manually and see where the problem lies
You could determine if its an issue with the NodeJS wrapper or GraphicsMagick itself
haha, I am actually doing that now xd
Then you might even be able to fix the issue yourself
That would probably be best for everyone
https://github.com/themaawaa/FitBuddy/blob/master/client/app.js

What am I doing wrong with my for loop? It's endlessly stuck in logging 'wuut'
10:06
What's wrong with your for loop, is the for loop
You'd want a comparison in the condition, not an assignment
infact.. same problem with your inner for loop..
Also, use DI hints
it's for( <starting index> ; <condition when loops ends >; < what happens with the index at end of loop body > ) {
I'm afraid I don't understand :/
for(
    let i = 0;  // start with i = 0. It can be another value, like i = 2 which means "start at 2"
    i < array.length; // ending condition. If the outcome is true, then loop continues. Otherwise the loop stops.
                Here the loop stops only if i is equals or greater than array.length
    i++ // the "index modifier". At the end of the for -loop body, this is called. It can be i-- or --i or ++i or i = i + 5 or whatever
}
you can see
for(let i = start;  i < foo; ++i) {
    <statements>
}

as

let i = start;
while (i < foo) {
      <statements>
      ++i;
}
10:14
Oooh okay
Got it now
Thanks :)
10:31
@rlemon Hey buddy , pls unban me from caprica , thank you.
@samuelscarlett 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.
10:57
@OliverSalzburg How would you solve it then?
my doc.getElementsByClassName returns an empty HTMLcollection, no error thrown. codepen what is wrongk here?
11:13
@Loktar ikr
11:30
@GokhanDilek Abstraction
@OliverSalzburg Need an example to better understand it
@GokhanDilek If you want to replace one component with another, they need to have the same interface. You can achieve that by placing abstractions in front of them
When they have the same interface, then can you switch them out against each other in a DI approach
@RaisingAgent either wrong classname, or element with such class name doesn't exist or invalid classname
@OliverSalzburg Thanks. I would appreciate some example code
I think that's me there at the bottom
11:43
@GokhanDilek You won't get any from me, if that's what you're suggesting ;)
This is a basic concept, you'll find tons of examples online
@OliverSalzburg like? :)
In software engineering and computer science, abstraction is a technique for arranging complexity of computer systems. It works by establishing a level of complexity on which a person interacts with the system, suppressing the more complex details below the current level. The programmer works with an idealized interface (usually well defined) and can add additional levels of functionality that would otherwise be too complex to handle. For example, a programmer writing code that involves numerical operations may not be interested in the way numbers are represented in the underlying hardware (e.g...
That is just a concept to understand
Once you do understand it, you can probably grab some preexisting implementation of a database access abstraction
First thing Google spits out: github.com/nodetrine/dbal
Hello everyone ! :) Does anyone knows like whether its safe and OK to use any experimental feature in ES6/7 (stage-0 to stage-2 proposals in ECMA specification) ? I wonder what will happen suppose if they withdraw that proposal going forward for some reason for e.g. decorators (which is in stage-2 I guess)?
12:00
I have a working date range slider built with bootstrap library in AngularJS but i want to be able to configure it to run with Angular Materials. I tried it with md-slider but it could not create ranges. I am using rz-slider directive for creating the directive. here is the fiddle of the code working with bootstrap :

fiddle

https://jsfiddle.net/agamb/954eve2L/1619/
@KarelG it was in the for loop^, the i was 3 at start, but y was 0 so it would only count up to the number entered (-3).
had a question
how is parseInt(0x1001abcd', 16) valid?
Does if (x === y === z === a === b === v ===m) { } work? If they are all the same it is true, otherwise false
yes, why not ?
it goes left to right. but i wouldn't do that. hard to debug
I just want to check if 1 value is different than all the others
and then say ("ur values are sh*t")
:)
12:07
@shortCircuit do you have an extra ' there?
@RaisingAgent it just groups them and checks final equality.
1 === 1 === true; // true
1 === 1 === 1; // false
@suraj sorry a little mistake, "0x1001abcdz"
because the first 1 === 1 is evaluated then compared against the last === true
z is not valid hex
@shortCircuit that should give an error
12:09
yeah
I didn't think that would work honestly. I figure it would have evaluated x === y, found it true or false, then performed true/false === z..
@rlemon thats bad then :/
but it doesn't. heh
check the ecmascript specs then
i want this script to work with angular material and angularjs. it currently works with bootstrap

var app = angular.module('rzSliderDemo', ['rzModule', 'ui.bootstrap']);

app.controller('MainCtrl', function ($scope, $rootScope, $timeout, $modal) {
var date1 = new Date(2017, 3, 1);
var date2 = new Date();
var day;
var dateArray = [date1];
while(date1 <= date2) {
day = date1.getDate()
date1 = new Date(date1.setDate(++day));
dateArray.push(date1);
}
$scope.slider = {
minValue: dateArray[0],
maxValue: dateArray[dateArray.length-1],
@RaisingAgent you can use .every()
!!> let arr = [11,11,11,11,11]; arr.every( e => e === arr[0]);
12:14
@KarelG true
!!> let arr = [11,99,11,11,11]; arr.every( e => e === arr[0]);
@KarelG false
don't forget to check the length though
@KarelG ^^Thanks, that will work. I wrote if (aX[0] !== aX[i]) { /* do x*/ } now
Why do you need to check equality of several variables?
12:17
If 1 is different my code wouldnt work
Wouldn't it make more sense to deal with an array anyway?
it is an array
User input?
Kind of
other developers applications input, triggered by users
just to find the error faster, in the future, should it ever happen
sanity check
12:19
yes :-)
!!> new Set([11,11,11,11,12]).size === 1
@rlemon false
!!> new Set([11,11,11,11,11]).size === 1
@rlemon true
Sanity check, gotcha. I get that. :)
@rlemon this is brilliant btw
12:23
I'm trying to compare 2 arrays and filtering out duplicates where name + lastname already exists https://github.com/themaawaa/FitBuddy/blob/master/client/app.js

I have a logical error that I just cannot seem to find
@MaartenWachters too much going on, and with bad formatting to make it even harder to read
if we're finding duplicates in an array, our code should not involve async fetches and angular
@rlemon How does this work? isnt the size bigger than 1, in both cases?
Look up what a "Set" does. It's all about unique members
@RaisingAgent it's a set, so it only keeps unique values
Anyone here familiar with yarn?
I'm trying to introduce it to one of our projects, and it fails consistently with Couldn't find a package.json file in path/to/root/of/project/1 when I call yarn from the CLI.
12:28
I've been using yarn for a few weeks, and know all the basics.
@MaartenWachters I can't see a problem with the code logic-wise, but you should seriously consider rewriting
Any idea what that's about?
assuming there IS a package.json, I don't know. I've never had that problem.
@Neil Yea, just read through mdn... it is brilliant!
@Luggage There is
npm i in the same directory works as expected.
12:30
@Neil I don't see what is wrong with the way it is written
And where does that 1 come from? :/
maybe it's missing from one of the directories in node_modules?
@MaartenWachters do you have ids to represent each record? That would make this sort of checking straightforward
ohh, i just assumed /1 was part of the correct path.
12:31
@Luggage No
It's the correct path to the root of the project, then with /1 at the end
yarn install --check-files yields the same result
@MaartenWachters the filtered list should just be a byproduct of the list, right? So just apply the filter to the new list
Sorry, never ran into that. Hopefully someone else has
Are there so many results?
@MaartenWachters I don't think I'm stupid, but I hav trouble reading all thoose concerns in one block of code
especially with random indentation.
Those are the things we think need re-writing.
just line 9-16 has the indentation issue.
i want to replace ui-bootstrap with angular material but as soon as i do it the slider disappears. if somebody could look into the problem?
https://jsfiddle.net/agamb/954eve2L/1619/
12:38
i have a put request to update a payment method, should i send the whole payment method payload again and replace it in db, schema is (info(jsonb) , id, method), so should i send the whole payload or send the edited things
@Prakhar sending everything would be more robust imho
Put the existing values in hidden inputs and resend all of it
okay
thanx
and should i add more validation on backend like, if someone has the token and sends gibberish
Server-side, you can just ignore parameters if you wish for existing payments
@Neil but thats what i'm trying to do (and failing)
Did you just seriously suggest that it's good practice to populate values the user is NOT editing on the client and then use them on the server-side?
12:41
@MaartenWachters it looks like you're trying to adapt new data to an existing filtered list. That's not what you were trying to accomplish?
What I am trying to accomplish is check an already existing array and filter out duplicates and udpate the bpm
@Luggage so i should figure the changed values and send them in put and add one more validation on backend that checks if the keys of the data are acceptable (like account_no,etc)
and save
For example an array could have (name, surname and bpm), if the name and surname are the same they already exist in the filtered list, so all it has to do is update the timestamp and bpm
not show another entry
@MaartenWachters don't do that. Just save the list, and recreate the filtered list from scratch
But the filtered list gets built every refresh
thats the thing
it iterates over the existing array
12:45
Prakhar wether you need all values or just changed values is your choice. But sometimes people use PATCH instead of PUT when you accept partial object. But you are right about validating the allowed changes on the server-side.
What sorts of problems do you get? No updates?
No, duplicates
@Luggage thanks
@Luggage So I did all that research on the couple suggestions for JS based chart stuff. They decide they want a standalone ASP .NET 4.5 web app using the native chart stuff because it's a stream, and that can be put into a PDF.
what native chart stuff?
12:54
4.5 has a built in chart class.
Let's you define multiple chart areas, series, chart types.
i see. I forget your original requirements
I was looking for a JS solution.
I use react and d3 to make svgs that I put in PDFs
So the "that can be put into a pdf" is really a lose requirement
Yea, I opted not to use d3 because it was a bit more in depth in terms of the overall capabilities. I was concerned someone coming behind me wouldn't know what the hell to do with it if the reqs changed.
if the .net thing is client-side then i suspect it makes svgs, too?
12:56
JPGs
ahh, i see.
oh. they might look like shit in pdfs if they get printed.
I argued that.
did you test?
I also pointed out that the image type as a whole means dick in the long term, since we can always manipulate that.
Lol, no. They have me building the standalone app instead of letting me make a demo of that first.
if you are printing 96 dpi charts in a 600 or 1200 dpi laser printer people will laugh at you.
12:57
And by standalone, I mean they have an almost 20 step progressive build up to the standalone app.
but you can just make larger jpgs to help that, some.
Worst case, I can convert them to PNG easily enough.
pngs are still pixels. that wasn't the issue
I know.
But at least with PNG, I can create a somewhat larger image that'll be marginally cleaner than JPG.
Hopefully. Maybe.
I'm just the code monkey
yea.. not what i meant
if you print an image at screen resolutions on paper, it'll look very pixelated.
13:00
Oh, yea.
be it jpg, png, even uncompressed bitmap
99% of the time these pdfs aren't printed.
They're just downloaded and emailed around, which is why I shake my head.
@MaartenWachters Try just writing output stupidly into the console then. There is bound to be a difference that you haven't taken into consideration. (Spaces at the end maybe?)
13:02
Because holy hell, if they start emailing a pdf with five chart images on it multiple times and forwarding it, that'll start eating up space quick in jpg or png format.
maybe. not sure how much space the images take up
morning everyone
It'll vary depending on the data in the charts, but on the high end, with a 1s update, if there's a drive time of 30 minutes that's 1800 data points alone.
@Trasiva < 100k mine is for 5 pages: drive.google.com/file/d/…
87kb
Yea, but they're svgs, right?
13:06
yes.
well.. they might be a lot more compact than an svg in PDF form. I don't know
Soon as I can, I'll have to try downloading a chart and see the size with a normal trip. Though I'm not sure the image size will change based on the number of data points.
as svg, they'll be big files full of hundreds of <line x="..." />
maybe the .net library has that option
Maybe, I haven't gotten that far yet. I had to step back from that to fix something else that they broke because they insisted on trying to be cute with jQuery on another page.
hehe
Someone learned what query selectors are, and decided they needed to use them -everywhere- with getElementById
13:09
roll back that commit.
and fire them.
I wish I could, I don't have either power.
And it's the intern.
freshly college educated. He/she probably knows more than you. Better give them some room.
Who is now sitting at his desk chastened, and reading up on actual JS/ES6.
He just finished his Sophomore year, lol. But he did think he knew more than me.
(motocycle gang): "Our intern just welded training wheels on all our bikes."
Key word being did. I was not very subtle in enlightening him that when I was his age, I was writing code for a three letter agency that had real life impact.
13:12
is it wrong to use querySelector('#...' over getElementById(...) ?
it might not be as efficient, but it's "valid" i guess.
especially if the selector is dynamic or isn't always an id
@KarelG it's bad and you should feel bad
bad != wrong
false
He was doing it with jquery, so he was just doing that bullshit $(#<%elementID%>[input=radio])
13:14
I would use the latter too, even with dynamic id.
Oh ... that changes the situation
Yea, he wasn't using querySelector
@GNi33 yup!
I wouldn't mind that.
I'd have just prodded him to fix it to be more logical.
still no reason to move TO querySelector.
Probably does a quick parse to check for id selector and then calls the equivalent of getElementById under the hood anyway.
13:15
or combine an id with [input=*]
Not likely much slower, but not "nice"
But if you're gonna do really stupid crap, and then tell me that your two years of college supercede my ten years job experience, plus additional six years of personal dev prior to that. I'm going to knock your ass down.
@Luggage I agree, but I still would have rather that than the garbage I'm cleaning up right now.
whoa. Why are YOU cleaning it up?
When my dog shits on the floor, I make him shampoo the carpet.
Welcome to my entire project
It's a meteor cleanup
Especially now that it failed a pen test
@rlemon @KendallFrey mind postponing to 5? I mean, you can start whenever but I'll probably make it until at least 5
13:17
@Luggage Because it was code that somehow got made live and breaks a large component on one of our pages. So it needs to be fixed yesterday.
@Mosho so I'm not picking you up?
"And I wanna see the dog dish clean by tomorrow!"
@rlemon I cheated on you last night. I played video games with a more canadian canadian than you
his accent was so thick
i couldn't help it
Kendall?
s/accent/fur/
13:18
nah some random on CoD zombies
Was his name Justin?
@rlemon mm, I can just get dropped off at your place
He was yelling at this kid because he was screwing us up, it was like "Kid I'm aboot to fuck up your day" and if he came into my area, he warned me, and immediately apologized
Was there syrup coming out of your mic?
13:20
"if you come into the MP40 room just let me know" "I'm coming into your room in about 10 seconds, im soory"
Because if not, he wasn't Canadian enough and should apologize.
i was dying
@Trasiva I could taste it, for sure
We should teach you a Canadian accent
@rlemon You hear that? He was tasting someone else's syrup.
cool
13:22
see? he's so upset he can't even be mad
what a canuck
playing ksp then gotta clean my kitchen before kendall comes over and then eventually mosho :P
@rlemon lmfao
@rlemon You having a mini-meet before the actual meet?
I SAW THAT
lawd
Took a week off and I'm still doing work, what gives
13:34
You're on vacation and doing work? Whyyyyyyyyyy?
Because I like to just bend over apparently.
Say it with me 'If you'd like me to work during my scheduled off time, I'd like those days reimbursed.'
Oh, it's not work work. I'm building something for a friend
If it's a big project, I hope they're paying.
It's not big, but it's quite bespoke.
13:45
Oh man, once of our sub-contractors went to the hospital over the weekend because his cancer took a wild turn D:
And he still showed up for the scrum today.
I'm about to cry
PDF libraries for JavaScript... Mozilla's pdf.js is for viewing them, things like jsPDF are for making new ones. Does anybody know if there's one out there that both loads existing PDFs (via a base64 string) and lets you edit it and update the PDF to a new base64 string?
You shouldn't need to edit PDFs
I don't know details but he seems depressed. Idk if it's fightable or not, so I'm not sure how bad it really is but it's really upsetting.
Why not?
Those are the requirements for what I'm building - be able to open a uploaded pdf, highlight or circle something, and save it back to the server
13:49
@neilsimp1 Because that's not what they're for. If you need to edit them, you should be thinking about a different format.
I don't disagree, but technically it should be possible. And that's what I'm being asked to do.
i got in trouble once for shoving pdf.js into a project once
its BIG
Again, it's not a format for editing.
The only one that technically allows it is the form thing in adobe
have any of you guys used codeacy?
codespiracy
13:53
But it is possible. See pdftron.com/webviewer/pdfnetjs/samples.html - Stamp Annotation from Image sample
this lets you highlight, insert text, etc.
and shit @SterlingArcher that sounds super rough
maybe he just wants to be around people
Maybe, I definitely wouldn't be
But we were supportive
@neilsimp1 Then use that...
> By converting all supported document types into a web-optimized XPS based file, called XOD, the WebViewer is able to deliver consistent results in viewing different document types
well, that's a workaround i was going to say. But hey, you can use that lib
13:56
The problem with PDFNetJS is that it's HUGE, way way bigger than pdf.js, and the application I'm running it in (Siebel) won't serve some of the file types that it requires. There's a file called PDFNetC.js.mem which is a binary file that Siebel won't serve
got posted earlier today
hmm @neilsimp1 are you able to reduce down the problem space a bit?
13:57
go pick your vacation
ie are users only able to highlight certain parts?
@derp What exactly do you mean?
like certain parts of the pdf or is it wherever they feel like
because if its only certain parts, i'm thinking along the lines of sending some sort of request to the server
and then the server generates a new pdf and tells the client when that pdf is ready
Yo ! Is there a way to split export default, from .vue file? I just want to separate all methods etc from the view
@WorkingPig Yeah, don't export default.

« first day (2410 days earlier)      last day (2760 days later) »