« first day (3993 days earlier)      last day (938 days later) » 

2:09 AM
I hope all ye fellow Canadians voted today!
 
 
1 hour later…
3:22 AM
@McMidas Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. 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
1 message moved to Trash can
 
in Trash can, 2 mins ago, by Mc Midas
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Custom Tags</title>

  <script "text/javascript">

	document.getElementById("form1").addEventListener('submit', functSubmit);

	function functSubmit(event) {
		var msg = document.getElementById("input1").value;
		alert(msg);
	}
  </script>

</head>

<body>

  <form id="form1" action="#">
    <label for="input1">This text will be passed in CustomeEvent</label>
    <input id="input1" type="text" value="default">
    <input type="submit" id="bt1">
 
 
1 hour later…
4:41 AM
Hi All
Im facing one challenge about validating the Facebook url
the user submits a FB url, I need to check if the URL is valid, what I do is I make a axios call to this FB URL and rely on the response.
the problem is, some invalid url are not resolved by browser and it shows content not available. But in the service FB return status 200
can anyone suggest what could be the best approach to validate if the user has entered a valid reachable FB url
 
@TheJOKER /facebook\.com.+/ is a valid facebook url
more seriously, what does "valid" mean? if someone enters a url to a private resource, does that count as valid?
 
 
1 hour later…
5:59 AM
@FélixAdriyelGagnon-Grenier with valid I mean like below
this is valid https://www.facebook.com/1000/videos/1274022233055012/
but this is not https://www.facebook.com/3/videos/1274022233055012/
as if I try to access the second one, FB shows the page content not available, but the HTTP status for this request if 200
 
6:14 AM
@TheJOKER both these urls are hidden behind login
for instance, try opening them in an incognito window.
 
7:05 AM
@FélixAdriyelGagnon-Grenier that is just for example, but what I mean is, suppose Im giving some incorrect facebook URL, that pattern is right but the videoId/postId is incorrect
in that case too, FB returns status code 200
how do I check whether this has valid content or not
 
7:25 AM
@TheJOKER those urls are not meant as API so indeed there is no way to be sure they are valid - other than interpreting the result of the and thus parsing the javascript/html.
You'll have to look into proper apis like: developers.facebook.com/docs/video-api/guides/get-videos
 
 
1 hour later…
8:31 AM
hi guys. i have a question which i asked here:
https://stackoverflow.com/questions/69265478/while-loop-is-not-working-in-useeffect-hook
 
@cagri 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.
 
it is about react-native.
I would be very happy if you check
 
8:45 AM
Are you sure the while loop never executes? Did you add a console.log('test') inside the loop?
But besides that, it is very very bad to have an infinite loop. I'm also wondering where you get "sleep" from, that is not javascript
 
yes. i added an alert inside the loop but it never alerts
i created a method called sleep. at the top of the code section you can see it.
 
did the alert outside the loop (but in the function getPosition) trigger? Same for inside the actual useEffect
@cagri uh oh...
I can see that the interpreter doesn't like you, that way it never "sleeps" - the answer given to you is proper but I'll try to explain what happens
First loop starts, then it starts a promise a promise isn't executed on the spot but rather "once the interpreter thinks it is ok to execute".
Next you call sleep(7000) (notice there's nothing stating the promise has to be executed). Sleep calls setTimeout and sets a timeout for 7 seconds to execute () => { } -- "do nothing".
Notice that sleep/setTimeout never stops the code from running it just adds another operation to be executed in 7 seconds.
So after you gave the commands "execute a promise once you have time, and after 7 seconds execute a function that has nothing" immediately the next iteration of the while loop commences.
This creates another promise (that doesn't have to wait for it to be executed) and makes another timer (without waiting on the timer to finish).. Etc etc.
 
ok i got it thanks. but...
what if i created the sleep method like this:
const sleep = (milliseconds) => {
setTimeout(() => { const a = 1}, milliseconds)
}
i know it is a bad way but i just wonder the theory
 
no that still has the same problem
you are creating lots of "parallel" ways to execute
while you should wait for a promise to finish, then set the timeout, then wait for the timeout to finish and then use the promise again (or use setinterval)
function getPosition() {
        GetLocation.getCurrentPosition({
            enableHighAccuracy: true,
            timeout: 15000,
        })
            .then(location => {
                const { latitude, longitude, altitude, accuracy } = location
                setPosition({ lat: latitude, lon: longitude, alt: altitude, acc: accuracy })
                alert("latitude: " + latitude + "\nlongitude: " + longitude)
                setLoading(false)
                setTimeout(() => {getPosition()}, 7000)
 
9:15 AM
Thanks man. I got it now.
 
Hi Paul
Intriguing to see someone trying to "sleep" on an event-driven language ;o
 
Yes @KarelG we know you are the best.
 
no that would be me
 
@KarelG's index is 1. but @paul23's index is 0.
 
so, he's a zero while I'm the first? That's a 🥇 for me! Woo hoo!
 
9:28 AM
depends on your perspective. I think he is at the top of the list
 
 
7 hours later…
4:02 PM
hmm anyone got a good reason why I would choose mysql over postgresql (and vise versa)
 
@paul23 Licensing? MySQL is free provided it can be replaced with another RDBMS in your application. So, if your application only works with MySQL, you have to pay. PostgreSQL is free.
Other than that, I've heard good things about Postgre but I've not used it enough. It has some facilities to store unstructured data (or something along those lines).
 
hello everyone, i m stuck with deeplinks in capacitor project, after getting the token from the browser page, it is not redirecting back to the app
have checked all the related links but nothing seems to work
 
With that said, MySQL isn't bad, either. I've used it more and...well, it works. There isn't much more to it. I'm not aware of anything special that makes it much better than others. Nor anything special that makes it much worse.
 
Well all those things considered: we use sqlite for integration testing and thus are limited in what we do anyways
 
@paul23 that's a terrible idea tbh
your tests should run on the same database as used in production
 
4:12 PM
the url scheme when entered in the browser, opens up the app and when running the capacitor project it does not redirect to app
 
Well it's not really integration testing more like unit testing with the database there to be just a "mock"
 
and honestly, supporting multiple RDBMS is a bad idea for almost all but very basic applications, because you're stuck with the lowest common denominator between all databases you support
 
as it was easier to use sqlite3 and fill that than to write/abstract everythign to mocks
 
why not just use postgres there as well?
you can even fire up a standalone instances really easily
 
cause setting up a database in memory is not trivial with postgres I think?
especially with 1000s of tests (and having to throw away the db to prevent side effects
 
4:14 PM
this is an implementation in python that inits a DB in /tmp just for the tests. probably easy to do in JS as well
and you can create multiple databases within the postgres instance to avoid having to re-run the expensive parts
or just use nested transactions to keep all tests separate on a single database and set of tables
but even with separate databases - you can create your tables once, and then create additional databases with the initial one as a template, so they'll have the same tables (not sure if/how much faster this is compared to running the CREATE TABLE etc. statements in each database)
 
hmm
 
4:32 PM
MySQL is not free?
GNU licensed
but nonetheless I prefer PostgreSQL
@paul23 I use an embedded db for testing :D
 
 
1 hour later…
5:39 PM
posted on September 21, 2021 by Prudhvikumar Bommana

 The Dev channel has been updated to 95.0.4638.17 for Windows, Linux and Mac 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. Prudhvikumar Bommana Google Chrome

posted on September 21, 2021 by Harry Souders

Hi, everyone! We've just released Chrome 94 (94.0.4606.52) for iOS: it'll become available on App Store in the next few hours. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Harry Souders Google Chrome

 
5:57 PM
posted on September 21, 2021 by Srinivas Sista

The Chrome team is delighted to announce the promotion of Chrome 94 to the stable channel for Windows, Mac and Linux.Chrome 94 is also promoted to our new extended stable channel for Windows and Mac. This will roll out over the coming days/weeks. Chrome 94.0.4606.54 contains a number of fixes and improvements -- a list of changes is available in the log. Watch out for upcoming 

 
6:24 PM
@KarelG me too but this is a super interesting article eng.uber.com/postgres-to-mysql-migration
cc @VLAZ ^
I still prefer postgresql however
 
Hey
Is it possible to center align text within a tooltip?
Or can no styling be applied
 
6:42 PM
an alt text or title tooltip? not that i'm aware of. but i wouldn't be surprised if there were some stylings that could affect it that I've just never touched.
Should you center align a tooltip?
 
Hi guys, I am working with React source files and I was wondering whether this exception be thrown around in a react app github.com/facebook/react/blob/…
function getSVGAttribute(attributeName) {
  return el => {
    if (el.namespaceURI !== 'http://www.w3.org/2000/svg') {
      throw new Error('Not an SVG element.');
    }
    return el.getAttribute(attributeName);
  };
}
 
7:08 PM
A title tooltip @KevinB
I tried adding text-align: center; to my .title css class, as well as
.title > .title-inner {
    text-align: center !important;
}
and nothing
 
7:31 PM
i mean
i coulda told you that wouldn't work
those styles are for dom elements, not psudo elements like tooltips
 
That makes sense...
Grouping this table by Capabilities of the response. Which has a results array. Need to figure out how to post each sub result as its own row instead of CSV all in one row
 
7:57 PM
posted on September 21, 2021 by Krishna Govind

Hi, everyone! We've just released Chrome 94 (94.0.4606.50) for Android: it'll become available on Google Play over the next few days. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 
Hey anybody here to help me out
 
@m-naeem66622 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.
 
 
1 hour later…
9:17 PM
@JBis Interesting read, thanks. That's useful information to consider but personally I've never needed these details. Not that they aren't important but the Uber's usage is more complex where DB can be a huge bottleneck. And it's specific to their usage. Perhaps if there are a lot less writes and more reads there would be a different result.
At any rate, so far, I've not had this situation.
 

« first day (3993 days earlier)      last day (938 days later) »