« first day (3939 days earlier)      last day (1234 days later) » 

00:50
 
2 hours later…
02:49
@paul23 I disagree. I use ORMs to bridge the gap between SQL and OOP. Most queries I do with ORMs are simple to do in SQL, it's just annoying to write or more importantly more annoying to map to a proper data structure. I would only use SQL directly for optimizations. However, I've never really had to do anything other than basic CRUD operations with maybe 1 or 2 joins.
However, my experience with db backed applications is limited to very simple models and relationships.
 
4 hours later…
06:32
Hello
@AbdulrahmanHatem 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.
how are you
I wish you are all fine
07:31
thanks
08:24
session axios express different server problem :'(
  const whoThat = () => {
    axios.get('http://localhost:3001/isLoggedIn',{withCredentials: true}).then(x=>{console.log(x.data)})
  };
  const logIn = () => {
    axios.get('http://localhost:3001/login?name=HideThePain',{withCredentials: true}).then(x=>{console.log(x)})
  };
Server:
    app.use(cors())
    app.use(bodyParser.json());
    app.use(cookieParser())
    app.use(session({
        secret: "hide the pain very well my boi",
        resave: false,
        saveUninitialized: false,
        store: store
    }))
    app.use(cors({
        origin:['https://localhost:3000', 'http://localhost:3001'],
        methods:['GET','POST'],
        credentials: true // enable set cookie
    }));
@Suisse 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
server routes:
app.get('/login', function (req, res) {
    let name = req.query.name as string;
    req.session.user =  {name: name,email:'',password:'', description:'', teamsize:0, isLoggedIn: true, };
    res.send('You are now logged in! => isLoggedIn:' +  JSON.stringify(req.session.user));
});
app.get('/isLoggedIn', function (req, res) {
    res.send(JSON.stringify(req.session.user));
});
08:52
tried everythiiing not working -.-
when I call /login and /isLoggedIn on the same server it works.. on login I can set the session on isLoggedIn I can get the session...
09:17
everythiiiing?
@Cerbrus lol his reply on my comment; Yes, but calm, ok? ... I was not even ... angry
I don't think he fully realizes how interaction on the internet works...
10:02
buuut Kaaarl that is not ok
you know, there's a "live caption" in Microsoft Teams
it works very well with most things, but not so much with names. Especially mine
Karel is often shown as "Carlos" or "Carl" or "Karl" or "Karla" or "Carol"
it never got it right. It has a typical pronunciation which is not so "normal" in English.
@Suisse still.... what is your question?
😃
 
1 hour later…
11:16
A custom/freetext field hooked up to some autocorrection/autocompletion/ML stuff? Sounds like a typical Microsoft Feature/Bug.
Or Apple.. or Google..
11:37
depends
in mobile devices, the virtual keyboard has a feature to give you some suggestion for auto-complete
then you have auto-correction, which is a feature of that virtual keyboard as well. However, some editors / browser setting allows to auto-correct your text
then you have a page-specific auto-complete, where on entering some characters in an text input, it generates a little list with options that matches with your entry
ML is mostly used for auto-correction. There is not lots of fancy stuff required for auto-complete
11:53
@KarelG I was repeating Karl the Lamas words... but Kaaaarl you don't kill people...
2
my session problem is solved.. client was on https - server was on http...
12:04
nice
or noice?
😉
12:22
I have a craving only hands can satisfy
@KarelG hmm.. as a mobile developer for several years now, i'd need to be blind to not notice that "feature" :<
What I mean is if you type in everything correctly and it comes out as something different (not user side) it's most likely some "service"/feature no one ever asked for and not the browser/electron/softkeyboard. If it's already changing your name while typing and/or before sending (user input) it's probably not teams fault.
Dynamic:

data.Days.flatMap(t => t.Days).forEach((dayArray) => {
 debugger;
if (moment(dayArray.Date).isBetween(searchMon, searchFri, undefined, '[)')) {
console.log(dayArray);
switch (dayArray.Day) {
this logs Day Array as just Monday Tuesday Wednesday Thursday Friday
Static:
transformedResults.flatMap(t => t.Days).forEach((dayArray) => {
                          if (moment(dayArray.Date).isBetween(searchMon, searchFri, undefined, '[)')) {
                          console.log(dayArray)
                            switch (dayArray.Day) {
this logs

{
  Date: "07/29/2021",
  Day: "Thursday",
  Location: "Meeting at Client",
  Status: "TRV"
}
I don't understand
13:09
Hi
@FaisalSharif 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.
@FaisalSharif 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
1 message moved to Trash can
   jQuery( document ).ajaxComplete(function() {
		my_fun();
	});

	function my_fun(argument) {
		jQuery('.bookable').on('click', function(event) {
			event.preventDefault();
			month = jQuery(this).data('month');
			year = jQuery(this).data('year');

			date = jQuery(this).find('font').html().match(/\d+/);
			finaldate = date[0];

			productID = '<?php echo $product_id ?>';

			$.post('/customAjax.php', {
				date: finaldate,
				month: month,
				year: year,
				productID: productID,
			}, function(data, textStatus, xhr) {
this code sends multiple or double requests on everyclick
13:36
@FaisalSharif yeah, you're creating my_fun each time you have completed an ajax request
so that click listener is set each time you're calling my_fun
Hi i fixed this issue thanks :)
i missed off() function
14:28
Hello friends, finally got the chat privilage ;D
@TEhubSLV 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.
hi
!!mdn harold
!!joke
3 SQL statements walk into a NoSQL bar. Soon, they walk out
They couldn't find a table.
14:55
@KevinB a daily "what's in MDN" session?
is that your shot?!?
i think it's odd that it returned a literal text file
better than an error
|| mdn isArray
somehow it cannot be found when I called it
ok, got a mini-derp
 
1 hour later…
16:23
hmm removing disable effect on an input
I just do element.disabled = 0
or false
but a co-worker just used (was doing codereview) element.removeAttribute('disabled')
I am intrigued if that is better or not
It's better
disabled is technically a property. It's either present or not: <input disabled />. It can also sort of work as an attribute - something with a value <input disabled="true" /> however the latter thing is a bit of a hack. It works because disabled is present, the value is irrelevant.
Even <input disabled="false" /> will disable the element.
but ...
if you do that by js ... it gets "undisabled"
Removing the property is the correct way. Perhaps .disabled = 0 or .disabled = false also removes it but I prefer when operations are explicit. I don't really want to go look up the specs to see if setting .disabled = 0 is official and whether it's supported in all browsers.
Might be a hack that some browsers added. Might not be.
is a boolean attribute
eh, gotcha use false to make it more right. 0 is just a lazy thing from my end
16:47
guys if there is question on SO asking "what is concept X" and I open another question titled "show practical example when concept X is needed?" is it duplicate?
17:01
I would probably say no. Just related
posted on July 29, 2021 by Richard Lau

Notable Changes CVE-2021-22930: Use after free on close http2 on stream canceling (High) Node.js is vulnerable to a use after free attack where an attacker might be able to exploit the memory corruption, to change process behavior. You can read more about it in https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22930 Commits [499e56babe] - build: fix label-pr workflow (Michaël Zasso)

@g-moniava Note that it might be closed as too broad or opinion based. You have to be careful how you word it.
@VLAZ I would word just this way "please can you show me practical example when concept X is useful"?
posted on July 29, 2021 by Richard Lau

Notable Changes CVE-2021-22930: Use after free on close http2 on stream canceling (High) Node.js is vulnerable to a use after free attack where an attacker might be able to exploit the memory corruption, to change process behavior. You can read more about it in https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22930 This releases also fixes some regressions with internationalization i

17:18
What is the technical difference between Object.key & Object[key]
don't you mean Object.keys ?
object[key] gives you a value at that given key
i assume he means foo.bar vs foo["bar"]
Object.keys(obj) gives you all keys in an array
aah
the bracket notation will convert whatever you pass to it to a string
17:26
which, in poorly controlled environments, can result in functions being ran that have side effects
just like any other string coercion
i tend to avoid needing bracket notation
This may be stupid but I am wondering if I am calling my object in updateOutsideContent wrong. It works perfectly fine in my JSFiddle/static example
{
        "Department": "IT",
        "Employee": "Beerus Dev",
        "Days": [{
                "Day": "Monday",
                "Date": "07/26/2021",
                "Status": "PTO",
                "Location": "Vacation"
            },
            {
                "Day": "Tuesday",
                "Date": "07/27/2021",
                "Status": "P",
                "Location": "Office"
            },
            {
                "Day": "Wednesday",
                "Date": "07/28/2021",
                "Status": "PTO",
@BeerusDev 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
But in my dynamic example, the Keys don't have "Key" instead its Key: "Value"
Another part of me thinks that could mean nothing at all
17:30
it means nothing
object keys are all strings
Gotcha
it is useful if you have something dynamic
I just don't understand how they can be the same exact structure, and static example transformedResults.flatMap()(data structure) is a function. And in my dynamic example data.flatMap() (data structure exact same as transformedResutls) is not a function
though, i second guess myself with that statement
can't symbols be object keys?
they aren't strings
!!mdn symbol
17:33
@VLAZ :D
Yes
I will see if it is worth to keep the question depending on interest
@VLAZ
that is dynamic structure
Ooops
I didn't see that one
                      if (moment($('#dpicker').val()).isBetween(searchMon, searchFri)) {
                        console.log(data);
                        data.flatMap(t => t.Days).forEach((dayArray) => {
                            debugger;
                          if (moment(dayArray.Date).isBetween(searchMon, searchFri, undefined, '[)')) {
                            console.log(dayArray);
                            switch (dayArray.Day) {
                              case 'Monday':
                                console.log(dayArray.Status);
17:34
@VLAZ Yeap that one looks Duplicate
what is flatMap?
that's not a standard array method
@KevinB it is?
oh..
it is
!! mdn flatmap
17:35
tf is that
It's like .map() but flattens the result. Presumably if you're mapping into arrays.
See my working example on 602 jsfiddle.net/BeerusDev/okn1e3tf/4
> [1, 2, 3].flatMap(x => [x, x])
if you're getting flatMap isn't a function, it's not due to your data structure.
It creates an array of each Day and works perfect, I finally got it working in fiddle, but when I moved back to dynamic usage, it got all jacked up
17:37
it's because data isn't consistently an array.
|| [1, 2, 3].flatMap(x => [x, x])
@VLAZ [ 1, 1, 2, 2, 3, 3 ] Logged: [ ] Took: 0ms
@VLAZ it seems mine is duplicate of that one, so IMHO I should delete
my
I can do data.Days.flatMap() and still leaves dayArray undefined
question
17:38
@g-moniava You can re-post the answer on the dupe.
@BeerusDev you have a console.log there
@g-moniava I'd personally suggest you delete the answer and dupe-close the question.
As in, delete the answer and move it to the dupe.
I know I have a console.log there
Are you referring to the data one or dayArray
@VLAZ NO I will just delete my question. But my answer seems easier to digest to me than the ones in that question
IMHO
Some of the answers in the dupe are frankly terrible.
Yours is much more practical.
Some of the answers in the dupe don't even talk about curry but just partial application.
17:40
@BeerusDev examine its output, you are getting an object, judging from what I am seeing
flatmap is for arrays
so .Days is missing
@VLAZ Yeah I also like my answer it is practical and easy to digest something I would like to see when I was learning currying
but then you say ... it leaves dayArray undefined?
that shouldn't be possible
wait
why do you want to flatMap here?
17:41
uh, shouldn't you be returning stuff to flatMap's callback?
.flatMap(t => t.Days) should be .map(t => t.Days) ?
nah i'm still mis-reading lol.
but even then, data is an object
is the solution not just data.Days.forEach(...) ?
if data was an object it wouldn't reach the debugger
17:43
what the fuck is data them
if dayArray is undefined, then your flatmap is creating an array of undefined values.
Sike damnit
i don't understand why you need flatMap, or even map
Days is an array
just loop over it
Wow
Ohhhh
I am an idiot
it was stopping at Monday because of the debugger
!!facepalm
17:50
!!mdn facepalm
An error occurred with the request.
Must be in the new ES2020 thats why not available
@KevinB @KarelG thank you two. You have no idea how much stress you just relieved off my back
18:30
posted on July 29, 2021 by Prudhvikumar Bommana

The Dev channel has been updated to 93.0.4577.18 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

 
3 hours later…
21:42
posted on July 29, 2021 by Prudhvikumar Bommana

The Chrome team is excited to announce the promotion of Chrome 93 to the Beta channel for Windows, Mac and Linux. Chrome 93.0.4577.18 contains our usual under-the-hood performance and stability tweaks, but there are also some cool new features to explore - please head to the Chromium blog to learn more! A full list of changes in this build is available in the log. Interested in switching re

22:05
Anyone know if Chrome (or Firefox) has built in security for executing functions which have functions inside from the dev console? I was trying to run a function that had some other functions inside (including a return promise) which was failing preflight for some reason but when the function was bound to a button it worked (cost me around 60 minutes of debugging) -- anyone know why this may have happened?
not that i'm aware of
certainly not one that would cause a preflight failure
Ren
Ren
23:00
Anyone online?
23:26
posted on July 29, 2021 by Bethany Nicolle Griggs

Notable Changes Say hello to V8 9.2 The V8 engine is updated to version 9.2.230.21. It notably introduces the new Array.prototype.at method: const array = [1, 2, 3]; console.log(array.at(-1)); // Prints: 3 Contributed by Michaël Zasso - #39470 Other notable changes CVE-2021-22930: Use after free on close http2 on stream canceling (High) - #39423 Node.js is vulnerable to a use after f

posted on July 29, 2021 by Ben Mason

Hi everyone! We've just released Chrome Beta 93 (93.0.4577.15) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome


« first day (3939 days earlier)      last day (1234 days later) »