« first day (3687 days earlier)      last day (1278 days later) » 

2:25 AM
 
 
4 hours later…
6:13 AM
Whats the best way to wait to check if the cookie is set using javascript?
 
@towerofhope 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.
 
 
2 hours later…
7:44 AM
Hi All, I need advice, I'm trying to load JSON obj to Google bigquery but it required JSON path and not obj.
I'm using WIX backend so I can't save the file on the backend and get path.
Any advice ?
https://stackoverflow.com/questions/64901727/load-json-object-to-big-query
 
 
2 hours later…
9:37 AM
Hi
Anyone online ?
 
hey there
 
10:26 AM
Hey neighbours
Want SO dark mode in chat too? Well me too, so I made a meta post!
 
10:38 AM
I need help with onlclick handler of a button
 
which framework
Or like, pure js
 
I want to use 2 handler function alternatively on clicks. But when I change the onlick property in the first handler it is automatically called. So clicking the button one time calls the first handler as I want but the second handler as well
Pure JS
I am new
Would you like to see the code ?
 
10:56 AM
@user123456789 use .addEventListener to have two handlers on a click event. If you want to alternate in between, there is a .removeEventListener
 
11:49 AM
Hi guys! Is possible to block popup that aren't blocked by chrome or ad blockers? I have a problem with a streaming website that will open an ads popup when the play button is clicked and I want to block this ! I'm using a simple content script in a chrome extension that will call the window.open = () => undefined; but seems not have effect :(
 
@user123456789 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.
1 message moved to Trash can
@user123456789 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.
1 message moved to Trash can
1 message moved to Trash can
 
How do I format the code ? ctrl+k is not working
let elem = document.querySelector('.edit-note');
elem.onclick = clickHandler;

function clickHandler () {
  console.log('Button Clicked');
}
 
12:46 PM
https://repl.it/@skylerspark/Yet-Another-Space-Diagram#script.js

Whats a good way to generate noise to cover a background.

I came up with a pretty good system, but it just adds down from the top left to the bottom right corner... which isnt right.
generateStarBackgroundNoise() {
		for (var i = 0; i < 100; i++) {
			var ranX = Math.ceil(Math.random() * 30) * (Math.round(Math.random()) ? 1 : -1);
			var ranY = Math.ceil(Math.random() * 30) * (Math.round(Math.random()) ? 1 : -1);
			this.starPoints.push([i * 10 + ranX, i * 10 + ranY]);
		}
	}
Anyone know a better way that I can do this?
 
1:22 PM
I figured it out
I forgot that when I need to create a grid I need to use dual for loops
	generateStarBackgroundNoise() {
		for (var x = 0; x < 100; x++) {
			for (var y = 0; y < 100; y++) {
				var ranX = Math.ceil(Math.random() * 30) * (Math.round(Math.random()) ? 1 : -1);
				var ranY = Math.ceil(Math.random() * 30) * (Math.round(Math.random()) ? 1 : -1);
				this.starPoints.push([x * 10 + ranX, y * 10 + ranY]);
			}
		}
	}
That generates a perfect map of stars
 
 
1 hour later…
2:24 PM
@User hi guys
I want to make fiverr custom sound notification chrome extension, the problem is how can I test myself hence fiverr not allow multiple account, how can I test it?
Is there anyway like when doing paypal payment gateway we have sandbox to test, Is there any service like this at fiverr?
 
2:50 PM
@MisterSirCode when did you start using tabs and why
@Squirrelkiller good luck!
 
Thanks^^
 
@Squirrelkiller Forrest and I have been trying to create an extension for SE that transforms it into looking like discord but developments been slow
 
@MisterSirCode is that a 8 char length tab? ._.
(tbh I don't care if there is people prefers tabs over spaces, but I'm in the latter group)
 
i use an ide that will transform spaces and tabs into looking how i want it to so i dont really care. The only reason I prefer spaces is because it's easier to share code and view it on github.
 
I've a co-worker that turns all spaces in tabs and commit it as it is, leading to some "friction" of other colleagues that are space-purists.
took me a while to figure out a means to auto-convert it back once it's pushed into our codereview system.
 
3:03 PM
dude needs to fix his edditor
 
you've never met a stubborn person and I want to keep peace in my team. He's a very skilled developer. Only his choice of style is just not a preferred one :P
 
lol
 
@KarelG have you tried an .editorconfig? Also ended that debate in my team. Although unfortunately in that case, the others outvoted me so now we're using spaces. But at least the editorconfig keeps it consistent.
 
you're a tab guy?
like Bill Gates? :P
thing with editorconfig is that when an user has their own config, it has a precedence.
|| shrug
 
¯\_(ツ)_/¯
 
3:18 PM
World Toilet Day (WTD) is an official United Nations international observance day on 19 November to inspire action to tackle the global sanitation crisis. Worldwide, 4.2 billion people live without "safely managed sanitation" and around 673 million people practice open defecation. Sustainable Development Goal 6 aims to "Ensure availability and sustainable management of water and sanitation for all". In particular, target 6.2 is to "End open defecation and provide access to sanitation and hygiene)". When the Sustainable Development Goals Report 2020 was published, United Nations Secretary-General...
 
@KevinB your day has some
🚽
 
@KarelG Really? I thought that's the point of putting an editorconfig file into the project, so it overrides per-user config.
 
it is to share the styling across the whole project members conveniently. However, when rendering a file in github's viewer, it does follow the rules described in that.
yet it does not mean that it has the final call. AFAIK it goes like this
1. own rules
2. .editorconfig
3. IDEA global config

and when let's say that the config has root being set on `false`, it will look for other .editorconfig in the same project. It is a very useful file, but it is not waterproof
a better workaround is to use commit hooks
 
3:40 PM
@JBis @KarelG Ok... So I dont see a difference between tabs or spaces, my IDEs always interpret all of the same: 4 character wide tab
I use JSFiddle somedays, Repl.it other times, and sometimes VSCode
it depends
 
stick with one editor
jeebus
don't come with your school firewall, there is a ST for you
 
@MisterSirCode in that case just go to prefs and choose spaces
you won't notice a difference but the world will
:)
 
@JBis I would, but not all of my IDEs offer that option
 
Does it make sense to use a char(5) to store a list of language codes (en-gb, fr-be etc) in postgresql. Or would it be just more easy to store those also as "text"?
 
3:59 PM
Hello, I have a very peculiar glitch that basically adds the values of two variables together as if they were strings, not numbers. Any idea what might b happening?
 
@paul23 Wy not just store tem in an array (Sorry, h and g key malfunctionin)
omfg
 
...
 
gotta use onscreen keyboard
frickin cheap school computer
 
I'm not flabbergasted by a mistyping. I'm just stunned at how besides the point that was. "Hey to get home fastest, should I turn left or right at the next crossing" -- Your response would be: "why don't you take public transport?"
 
but... its javascript, if you want to store strins, wy not just use an array?
o.m.f.g
Im about done with this fking keyboard
 
4:02 PM
Cause i wish to store them in a database, I'm not talking about storing them in memory.
 
oh, my bad then
i dunno why I bother helping sometimes on here, Im more often a nuisance then anything
:P
 
Not that, you just are both inexperienced and early to pull the trigger.
 
That too
 
its fine
ime quite a bit of a noob myself you know
 
So you answer or ask often before you fully got the complete picture. And because of inexperience you "forget" to realize that there must be a "bigger picture".
 
4:05 PM
Its not that Im a noob. its like he said, Im just inexperienced.

Ive been working with JS nearly... 2 or 3 years now.... I just dont know all situations of use.
and sometimes... (and this might partly be because of my conditions) I just forget a lot of basic concepts
 
@paul23 size matters
max 5 vs "unlimited" + non indexable ect
choice is kinda straightforward here
 
Well biggest "drawback" is that it is never used elsewhere just yet (and there's quite a lot already). All javascript-strings map directly to text in the database. This would hence be the (first) odd one out.
Which will be a major issue if there ever comes a country or language code that consists of more than 2 letters.
 
more than 5 letters you mean? yes
but that's kinda beyond the standard and I doubt that it will change over 5 years.
 
Is it possible for me to generate noise around a radian?

Like, in my current project, Im using a dual for-loop to generate noise for the "Stars" in the backround.

However, I wanted to create a "realistic" asteroid belt.... and I need to generate noise around a radian to be able to achieve that.
 
you can throw in a VARCHAR sillyness
 
4:13 PM
Language and country code are their own iso standard right ;P
 
it's just that someone wants to be special, being different to the general consensus.
 
Actually there exists quite a few languages not part in the iso 639-1: en.wikipedia.org/wiki/ISO_639_macrolanguage Not sure how many native speaker there are for those.. Which use internet.
 
Doesnt the ISO 639-1 standard exist for languages spoken on the internet
The chances of a native speaker of one of the aforementioned languages in that page actually visiting your application or website is highly unlikely in the long term
 
well, if you intend to support those macro language, you can account that for.
yet TEXT is very different than using VARCHAR(10)
 
hey
any idea how you can get Chrome to display a preview of a page's CSS layout? Like the grids, rows and columns
I'd like to get a screen grab of it, but seems you can only see when hovering with dev tools open
 
4:26 PM
err
 
Not right now, currently the router looks at the url: no regex match with [a-z]{2}-[a-z]{2} => default language. Otherwise pick language or show "not found".
 
not sure what you're actually wanting that to look like @BrianJ
 
@BrianJ If youre on windows, use PrtScr (Though its kinda shitty) but I reccomend installing software that can record last 30 seconds, record live footage, or take screenshots without clicking anything.

Something like windows 10's xbox game bar will suffice
 
can someone suggest where I can host my js css files so that I could use as a cdn?
 
if it's all highlighted, it's just one big blue overlay
 
4:28 PM
@NIKHILCHANDRAROY host your sourcecode on github, then use something like JSDelivr to format the headers correctly
 
@MisterSirCode I wanted to say "without clicking? - how would it know, because you blink?". But then I realize that the present has caught up with my future and it's now perfectly acceptable to do that.
 
@MisterSirCode yeah I guess I could take a GIF of my cursor hovering over the layout
 
Anything would work really... I have lots of decent quality mirroring, recording and screenshotting applications available for stuff like that
Though... I have to admit I usually result in just using Snipping tool when I can
Too lazy to remember my screenshotting keybinds
@paul23 oh... so you forgot keybinds were a thing lol
We all have our moments
 
So you bound it to what "magic"? Or another key you might click?
 
@MisterSirCode I am little confuse to use the file like this way, I want to use soundScript.js how can I do by JSDelivr?
for exampl, I want to use raw.githubusercontent.com/nikhilroy2/year_2020/master/November/… this link as a cdn
 
4:36 PM
@NIKHILCHANDRAROY Ok.. So upload your file to a github repo

Copy the link of that file in github.

Paste it in here: https://www.jsdelivr.com/github

And then you get a JSDelivr link with the correct file headers (So your JS and CSS function correctly)
 
how can I do it by JSDelivr?
 
As you can see, if you paste that raw link in JSDelivr, you get This link: https://cdn.jsdelivr.net/gh/nikhilroy2/year_2020@master/November/chrome_fiverr_custom_sound_extension/soundScript.js?token=AGDEZFGDQ3HYSQRSBCQ3JIK7W2PQA

Which contains your javascript. Then just link it the same way you would any other library, using a script source
The issue is that github doesnt format some types of files with the right headers, so if you try to use a .js file directly from github, it probably wont work
 
thanks, working
 
Hmm this says don't use char(n): wiki.postgresql.org/wiki/…
 
4:52 PM
hey guys, you guys know how can i remove border radius classe when the div widht is 100%?
 
I love how some languages have features that Arent deprecated... yet in there... the entire description is just "PLEASE NEVER FUCKIN USE THIS"
Like I get it can be for compatibility or something, but its still funny
 
any help will be nice....
 
@NoobDEV-GBL Ah yes, the "I wish CSS had if statements" conundrum

Check out https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
how you check continually? either add it to an event listener or put it in an animation frame
 
thanks
 
no problem
 
5:05 PM
@MisterSirCode your comment made me laugh hehe :)
 
@MisterSirCode why are you dealing out terrible advice?
@NoobDEV-GBL figure out when the div will be 100% (i assume there is a max width) and add a media query
|| mdn media query
 
@JBis Its not terrible advice, they are asking for help in the javascript room... I gave them a javascript answer
its not deprecated either
 
wrong tool for the job
even if it works
 
|| shrug
 
5:10 PM
¯\_(ツ)_/¯
 
@JBis Also how are you supposed to get the width of a div through a media query
I thought media queries were only for screen and device data
 
usually it looks like this:
.div {
   width: 100%;
   max-width: 1000px;
}
 
alright?
but how does that tie into media queries
 
The css is capping the div at 1000px. So, mathematically, if the screen size is 1000px or less it will be at 100% width (assuming the .div isn't contained by a parent). So just add a media query for 1000px.
 
So... thats an awkward solution that only works for width
and it doesnt even work in EVERY scenario...
Ok then.
 
5:16 PM
Based on context, I assumed that is the situation at hand.
 
lol... My answer is still relevant... and it matches what they were asking for, and it also works in any scenario with mostly every longhand CSS rule (shorthand css rules arent supported inside computed style on every browser)
So why is it "The wrong tool for the job" again..
 
|| shrug
 
¯\_(ツ)_/¯
 
That was pretty funny tho... Like... Media querying css rules? Yeah thought that didnt sound right at first.
 
I created an algorithm to find the sum of primes less than or equal to "num" but not sure if its a good one (beginner). I keep seeing in the console on FCC "potential infinite loop in line3, why is this the case?
function sumPrimes(num) {
  let sum = 0;
  for (let i=0; i<=num; i++){ //find sum of primes less than or equal to num
    if (isPrime(i)){
      sum += i
    }
  }
  return sum;
}

function isPrime(n){ //checks if a number is a prime or not
  let factors = []
  for (let i=0; i<=n; i++){
    for (let j=0; j<=n; j++){ // calculates factors of n
      if (i * j == n){
        factors.push(i)
      }
    }
  }
  if (factors.length == 2){ // if it has only 2 factors -> its a prime!
  return true
  } else {
 
5:35 PM
Is there any way to make a condition when any audio play in webpage?
for example, I don't know where is the sound coming from on the webpage and I wanna replace that audio to different audio, can someone guild me a little bit if posible?
 
6:30 PM
some kind of pixelated space diagram
I wish it was more performant tho
its kinda skipping a few beats and glitching a little
 
6:56 PM
> I hate git. With this I seemed to be a part of a very educated/intelligent community. Just from the fact that one cannot use git without stackoverflow one can derive that git sucks. git is not difficult. It is not documented and thus kind of unusable. Any documentation for git should start with enumerating the objects involved. I have yet to see such a documentation. For nearly everybody it is unclear what are the objects involved, other than working files and remote database.
 
@KevinB Who said that?
 
!!stat 12411795
 
Username: Frank Puck
ID: 10722838
Reputation: 105
Reputation Change Month: 0
Last Accessed: Thu Nov 19 2020 13:53:14 GMT-0500 (Eastern Standard Time)
 
git hater
eecks dee
git is pretty much the one and only versioning system
 
for someone who's supposedly been coding since 92', they sure don't seem to have much of a grasp on how you get help using a CLI
 
7:02 PM
Yeah thats kinda stupid... he says theres no documentation, when theres plenty
and if its too compwicated for poor wittle fwank.... he can just use a UI wrapper... ffs.
like Im an amateur but even I can tell thats a pretty disappointing claim of his
 
7:44 PM
posted on November 19, 2020 by Daniel Gagnon

The Dev channel has been updated to 88.0.4324.9 (Platform version: 13597.5.0) for most Chrome OS devices. This build contains a number of bug fixes, security updates and feature enhancements. Changes can be viewed here. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels? Find out how. You can submit feedb

 
at least he's not suggesting using javascript for a css problem
 
 
 
2 hours later…
9:45 PM
Hello, any idea why my timer program for the 'take a break' website I made will tell you that you've spent 1 minute three times before saying that you've spent 2? (PS: the ridiculously short timings are just for testing purposes, let me know if they are causing the problem)
</script>



<script>
var body = document.getElementById('hide5');
var timeLeft = prompt('How long a break do you want? for example if you want a 5 minute break, input the number 5 in the box below.');
var timeAlert = prompt('When do you want to be notified? for example if you want to recieve an update on your time every five minutes, input five. If you want no notifications until your time us up, hit cancel.')
var counter = timeAlert * 60
function doOver() {
timeLeft = prompt('How long a break do you want? for example if you want a 5 minute break, input the number 5 in the box below.');
 
@LlamaButt 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.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
posted on November 19, 2020 by Lakshmana Pamarthy

The Dev channel has been updated to 88.0.4324.11 for Windows, Mac and Linux platforms. A partial list of changes is available in the log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Google Chrome  Lakshmana Pamarthy

 
 
1 hour later…
10:55 PM
Please upvote my quesiton - stackoverflow.com/questions/64921149/…
 
11:10 PM
.
 
:( I dont know why folks are so mean on SO
I ask a question and folks downvote for no reason.
 
your question is quite unclear to me
however, i dont know angular so im probably not the best person to ask
 
no problem
 

« first day (3687 days earlier)      last day (1278 days later) »