« first day (3635 days earlier)      last day (1296 days later) » 

12:03 AM
maybe
it could optimize the stack memory footprint
but I think your graph itself is an issue on its own
meanwhile I am yelling at material ui
 
 
7 hours later…
7:31 AM
Go figure that @mr5 and @Wietlol would be here to 🤣
Anybody here know a thing or two about vue?
 
 
1 hour later…
mr5
8:37 AM
@Squirrelintraining :D :D :D
drop vue and write it from scratch like a real hardcore programmer.
 
Sir, yes sir o7
 
9:37 AM
node experts around?
1
Q: How can node use more than 100% CPU if it is single threaded?

avckI am running an express.js server. When I send some load the cpu usage spikes to over 140%. I understand that since the system I am running the server on has 4 cores so it can go upto 400% as well. My question is: How can node.js application consume more than 100% despite being single threaded? ...

can't understand the fact that cpu usage is over 100% from node
 
@Mooshua - thanks for checking in. ;-) I had insufficient time to move ahead on the weekend with that tutorial I found on Medium. But I think I'll be able to make some time either today or tomorrow and get started at least.
 
 
2 hours later…
11:21 AM
Hey all, got a question, I always 2nd guess myself when I see someone else code. In particular someone had written on our project code that takes the form value (always a number) and when they reference it they are always doing something like this e.g. parseFloat(+radius).toFixed(2), my question is why would they do that because as far as I know and can tell the + does absolutely nothing. Am I missing something here or is it just bad coding?
 
@Elijah Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
11:39 AM
I want to interact with the html code /for example getting all tags from a specific class, can I do that wihtout the browser console
Im using Webstorm
found the answer, im using the debugger
 
12:18 PM
Hello
 
@Elijah that is an unary operator and casts the value of the radius to a number
See it as Number(radius)
 
$.ajax({
		url: requestUrl,
		type: "POST",
		contentType: "application/json;odata=verbose",
		data: JSON.stringify(item),
		headers:{
			"Accept":"application/json;odata=verbose",
			"X-RequestDigest":$("#__REQUESTDIGEST").val()
		},
		success: onSuccess,
		error: onError,

	});
why does this tell me unexpected token @ ($.ajax({
 
check its documentation. You're not using it correctly
 
I got it
right before I called it, I had var requestUrl = _spPageContextInfo.webAbsoluteUrl+"/_api/web/lists/getbytitle('"+listname+"')/items";
but instead of ; at the end I had ,
 
even then, its use is not correct
o wait
I need to check it
sorry. my mistake
 
12:40 PM
I was missing } from saveDelivDetails() function
 
1:14 PM
Hello here.

I'm having a small trouble with transitionning using css class.
I'm making a small slider. Before going from one slide to the other, I set classes on the slides :

beforeTransition (add class on slide to prepare the css)
outgoing.classList.add('before-leave')
incoming.classList.add('before-enter')

transition:
outgoing.classList.add('active-leave');
incoming.classList.add('active-enter');

afterTransition:

outgoing.classList.remove('before-leave', 'active-leave');
incoming.classList.remove('before-enter', 'active-enter');
 
Is there any clean, native way of 'unfolding' an array into two groups?

const numbers = [1, 2, 3, 4];
const [even, odd] = numbers.unfold(num => num % 2 === 0);
// even should be [2, 4], odd should be [1, 3]

// ugly implementation with reduce
const [even, odd] = numbers.reduce(([a, b], num) => num % 2 === 0
	? [[...a, num], b]
	: [a, [...b, num]], [[], []]);
 
1:57 PM
I don't know why but there is a database only using TypeScript types: github.com/codemix/ts-sql
 
2:18 PM
I wish there were more options for "dependencies" not only "standard and dev"
like in our application which is written in typescript dev dependencies contain all typescript information. - To compile it (it's not part of the published code).. However it also includes sqlite3 which is used for testing.
However when building I only need the typescript types, not the sqlite3 stuff, yet it tries to install sqlite3.
This is especially a pain since we use alpine linux, which doens't have prebuild sqlite3 libraries, so they have to be build from source.. Which is slooow.
 
if only npm was as powerful as a real package manager...
:p
 
I created an ajax POST request to send a new list item to one list to make sure it works because I was having issues in my other script that includes initializing a DataTable and a GET request (but those two aspects functioned perfectly). The new POST ran but nothing was showing in the console and it didn't send the item like I figured to the list
 
@Wietlol you can do that?
 
nope
 
Like I can add another node next to devDependencies with "buildDependencies"?
oh bummer
 
2:23 PM
I mean... not by absolutely replacing npm
 
:|
 
This POST method is bending me over... Ive read like 4 articles with similar issues and none of them suffice
 
3:27 PM
@orrburgel Thanks for this one
data:image/gif;base64,R0lGODlhAQABAAAAACw=
Perfect for what I needed it for
codepen.io/SkylerSpark/pen/PoNLxvE its just a template image
Simple enough
I know there are other alternatives, but its also just interesting to see the smallest parseable gif
Though it doesnt seem to behave the same as my gif
 
Just got a POST request to partially work, but it changed my List name?? -.- Why won't it add a new item like I am trying to get it to do...
 
Node/Angular Question,
If the command ng serve will Build and serve your app, rebuilding on the fly when files change, what command do you run to stop it from doing that?
 
Hey just curious... Anyone know why javascript's Ascii To Base64 and Base64 To Ascii methods are REVERSED
for example... this code here, even though it uses atob it converts base64 to ascii
document.querySelector(".baseRight").addEventListener("click", () => {
	var base64el = document.querySelector("#Input");
	var asciiOutput = window.atob(base64el.value);
	document.querySelector("#Input").value = asciiOutput;
});
which is stupid
atob sounds like ascii to base64...
but its the reverse
like what drunkie made the atob and btoa methods
 
I see how it is
ascii to binary
base64 is considered the "ascii" portion
the kuck?
.-.
Well thats just
Ya know what, why fight it, its their standard. They can do whatever they want with it ffs lol
 
it can't be changed
it is what it is
 
it is what it is....
:P
 
@KevinB So this damn POST Request. I am not getting it to execute the success command which is good. But it updates the list name, not adding a new item to the list which confuses me.

The Request Payload shows everything I entered that it tried to send to the list, but doesn't even post to the list, just alters the List Name
{__metadata: {type: "SP.Data.AMMODeliverablesListItem"}, Title: "updated title", Program: "AMMO",…}
Approved: "True"
Date: "2020-09-07"
Deliverable: "Meeting Minutes"
Notes: "Example Notes"
Program: "AMMO"
Title: "updated title"
To: "example@example.com"
 
Hi Guys
 
3:54 PM
Hey
 
can someone help me in this?
0
Q: Smooth flowing scroll effect for grid

Anuj KaithwasI've recently found an example of smooth scrolling and transformation on this site, https://www.wonderlandams.com/work and I'm not able to understand how to get the same effect. So far I've come up with a few plugins like ScrollReveal but it just doesn't achieve this particular and specific effec...

pretty please?
butting my head over it since 2 days and i am damn sure it's simple, for my simpleton brain
 
I take it back from first message, I am using PATCH method instead of POST now
 
4:10 PM
Hey, how can I use a number between 0 - 99 to get a unicode character
and also do it in the reverse
 
hey .. how can I get values from a Set?
when I do mySet.values() then its an iterator
but how can I get for example the first element??
 
338
Q: Getting an element from a Set

foobarWhy doesn't Set provide an operation to get an element that equals another element? Set<Foo> set = ...; ... Foo foo = new Foo(1, 2, 3); Foo bar = set.get(foo); // get the Foo element from the Set that equals foo I can ask whether the Set contains an element equal to bar, so why can't I get t...

 
@MisterSirCode console.log(String.fromCharCode(189));
@MisterSirCode. "myString".charCodeAt(0); //to get the charcode for first char "m"
@bigchungus ha ha .. thats in java .. this is a javascript room brooo plllliiis
 
well
charcode can output really anywhere from 0 - 40000
idk the exact numbers
 
@Suisse my apologies, quick search im in a cram with this damn POST req
 
4:23 PM
but Im looking to convert character from 0 - 9F
utf-8 style
 
Anyone know if its easier to pass an oAuth token or RequestDigest value for POSTing information
Holy shiiit
I fixed my POST request :O
Anyone have a clue why when it POSTS to the List, it returns "True/False" for the Approved column which should be "Yes/No", and the Date column yields yyyy/mm/dd instead of mm/dd/yyyy
 
 
2 hours later…
6:18 PM
Wow, this room's been quiet for 2 hours?? Sign of the zombie apocalypse
Devs are being eaten alive and can't post questions
 
i mean
it's been quiet for a few years now, comparatively
2 hours of silence is normal now
 
Kevin
Scenario
function PostItem() {
            return getFormDigest("https://siteurl.sharepoint.com/sites/Projects/USMC/AMMO/Lists/AMMODeliverables/").then(function(digestData) {
                console.log(digestData.d.GetContextWebInformation.FormDigestValue);
				var item = {
					"__metadata": { "type": "SP.Data.AMMODeliverablesListItem" },
					"Title": "updated title",
					"Program": $("#dProgram").val(),
					"Deliverable": $("#dDeliverable").val(),
					"To": $("#dTo").val(),
					"Date": $("#dDate").val(),
how would I properly define the if statements with the input, would dProgram be correct?
or would it be #dProgram
 
technically, window.dProgram should exist... but never rely on that
select the element like a normal person
also, when in a .then callback, always return further promises to it
return $.ajax({...
that way anything waiting on it will also wait on the ajax call
 
do that for every call?
 
yup
 
6:28 PM
there is going to be 8 total
 
and there's no way to consolidate to one?
 
@KevinB whats that considered? since its a HTML DOM as the input, wouldn't I select it in the same manner
 
if you're just posting to a different list each time, you can have a map of value -> list name and then just supplement the correct list name based on the value
!!mdn getelementbyid
 
I have been looking and looking to consolidate, but can't seem to come across anything relative to my issue. You can only call one url per request
 
6:30 PM
nice span james
right, but that url is a string
 
var AMMO = document.getElementById("AMMO");
 
and strings can be concatenated
well, no
you expect ammo to be a string, right?
so you'll need to get the input's value...
why am i explaining this
 
Yes its a text box entry on my HTML form
so it is a string
 
document.getElementById("AMMO"); doesn't return a string.
 
6:33 PM
@KevinB Couldn't resist being dramatic :)
 
Something like...
var someElement = document.getElementById("id");
var someElementToString;

if (someElement.outerHTML)
    someElementToString = someElement.outerHTML;
else if (XMLSerializer)
    someElementToString = new XMLSerializer().serializeToString(someElement);
 
: /
 
Kevin youre a genius
found a post of yours from 9 years ago on another website.
 
ugh
did you find the jquery forums
 
haha
 
6:41 PM
i'm still technically a mod there
 
ya, but the more I am looking at it doesnt seem like the same issue :(
 
so, lets just look at your code
if (dProgram == "AMMO"){
what is dProgram
 
DOM element from my HTML form
 
"Program": $("#dProgram").val(), suggests to me that dProgram is a dom element with an id of dProgram
what's funny, is,
in that line of code, you just demonstrated how to select an element, and how to get it's value
and yet... instead of doing that, you went with whatever this is:
var someElement = document.getElementById("id");
var someElementToString;

if (someElement.outerHTML)
    someElementToString = someElement.outerHTML;
else if (XMLSerializer)
    someElementToString = new XMLSerializer().serializeToString(someElement);
 
That isn't in my code. I just found that
Because you said to my prior response that it isn't returning a string
 
6:44 PM
$("#dProgram") doesn't return a string
which is loosely equivalent to document.getElementById('dProgram') (minus the fact that ti returns a jquery collection, not a dom node)
 
ugh
@KevinB I understand what I did, but I am still quite confused on what that has to do with :50564240
 
That if statement makes no sense to me
dProgram isn't defined anywhere, so i can only assume it's window.dProgram, which is a dom node
it will never be loosely equal to a string.
 
:50564244 <label for="program">Program :</label>
                    <select name = "program" id="dProgram">
                            <option value = "AHR">AHR</option>
                            <option value = "AMMO">AMMO</option>
It is the dom element with that ID
 
7:17 PM
in PHP, 11 mins ago, by DaveRandom
user image
"My Dad appears to have set himself an alarm to remind him to turn the alarm off"
may be the funniest thing I have seen all day
 
7:38 PM
is this what you were referring to earlier
 
"foo" + somevar + "some more text"
if all that changes between the requests is the url, all you need to change is the... well, url.
 
Got you.
I feel I am close with this one... OR no
var urls = [url1,url2,url3,url4];
for (i = 0; i <urls.length;	i++){
	if($('#dProrgam').val() === 'AMMO')
  	url: urls[0],
} else if ($('#dProrgam').val() === 'DAR-Q'){
	url: urls[1],
}
 
@bigchungus Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
you don't need an if statement
 
Seriously
Wouldn't that work though?
 
7:51 PM
const programMap = {
  'AMMO': 'url1',
  'DAR-Q': 'url2'
};
$.ajax({url: programMap[$('#dProrgam').val()], ...
and, no, your solution won't work
 
damnit
 
you cant put logic in the middle of an object literal
 
gotcha
in respect to your earlier statement. what exactly is foo
Ive seen that a few times across the website and have never seen it before
 
it's like lorem ipsum
meaningless placeholder
 
oh
er dur
@KevinB if I were to execute this, would that just mean I remove the url field from inside the call, that way it pulls from the constant
 
7:59 PM
no
err
yes?
dependinig on what you mean exactly
 
 $.ajax({
                    async: true, // Async by default is set to “true” load the script asynchronously
                    // URL to post data into sharepoint list  or your own url
                    url: "https://baseurl.sharepoint.com/sites/Projects/USMC/AMMO/_api/web/lists/getbytitle('AMMO Deliverables')",
                    method: "POST", //Specifies the operation to create the list item
                    data: JSON.stringify({
would then become
 const programMap = {
  'AMMO': 'url1',
  'DAR-Q': 'url2'
};
$.ajax({url: programMap[$('#dProgam').val()],
                    async: true, // Async by default is set to “true” load the script asynchronously
                    // URL to post data into sharepoint list  or your own url
                    method: "POST", //Specifies the operation to create the list item
                    data: JSON.stringify({
Well, something along those lines
 
yes
 
8:12 PM
var url1 = "https://basurl.sharepoint.com/sites/Projects/USMC/AMMO/_api/web/lists/getbytitle('AMMO Deliverables')/items";
				var url2 = "https://basurl.sharepoint.com/sites/Projects/USMC/DARQ/_api/web/lists/getbytitle('Dar-Q Deliverables')/items";
				var url3 = "https://basurl.sharepoint.com/sites/Projects/USMC/WTBn/_api/web/lists/getbytitle('WTBn Deliverables')/items";
				var url4 = "https://basurl.sharepoint.com/sites/Projects/Army/ODMulti/_api/web/lists/getbytitle('ODMultiDeliverables')/items";
?
 
 
2 hours later…
9:59 PM
so... I am confused about the behavior of my web view and cant figure out what is wrong about how I set it up
basically, I have a flex box with one element that has flex-grow: 1;
inside it, I have a div with a bit of margin
the size of that div is as big as its parent allows it to be
now, I want to display a table inside it, which should scroll (horizontally) when it exceeds the width
however, despite having overflow: auto; it makes the parent div grow
and avoids the scroll bar
 
What should scroll, the table, or the element the table is in
 
the table... I think
wait... I think I found it
with min-width: 0;
 
10:15 PM
?
 
I fiddled with the styles a bit and added min-width: 0;
then it started scrolling properly
after a refresh and only changing the min-width, it works
I guess... that makes... sense
iDunno how, but it must be :)
 
11:04 PM
Is there a way to convert a Date object into a window.performance object?
 
11:31 PM
 

« first day (3635 days earlier)      last day (1296 days later) »