« first day (3859 days earlier)      last day (1072 days later) » 

5:08 AM
Hi all !
 
 
2 hours later…
6:39 AM
@JBis: I sent you a GH invite to this room's github repo. Check the issues in there ;-)
 
 
2 hours later…
8:09 AM
Hey guys. I have asked a question about Express REST API and Mongoose last nihht but I couldn't get any answers. I would like to share my question here.
0
Q: Express REST API router and Mongoose schema design

M. Çağlar TUFANI'm learning how to create REST API with Mongoose (MongoDB). I'm trying to develop an Express REST API with Mongoose. What I'm trying to do is simple but I'm not sure which way to design both REST API end points and Mongoose schemas. I have users schema for now, and each user object has only user...

 
 
1 hour later…
9:32 AM
@JBis hmm I have no idea sorry!
 
10:23 AM
Hmm I currently have a system where -when selecting to create something using a template- the frontend reads a template, and then sends commands to the backend "as if" it is the user who updates the separate fields.
I am now wondering should I move this logic to the backend?
And just say "make this new stuff out of template xyz" instead of handling that on the frontend?
 
 
1 hour later…
11:26 AM
hiyo
 
11:38 AM
@phenomnomnominal oh look it's Craig - hi!
 
11:55 AM
Welp
I just debugged a program for 4 days
over this tiny piece of code.
Forgot that I decided to add properties to my textures... so I was throwing an object into my THREE.js renderer, instead of a texture
Good lord
Ya know sometimes I wonder if theres such thing as sanity
 
Hello, I have a d3.js problem. If anyone can help, that would be great.
Trying to make an bar chart.
 
@DarkRunner you should probably explain your issue
People usually wont go out of their way to look through your project, find an error, and give you a fix
 
 
1 hour later…
1:22 PM
Hello
 
1:35 PM
Need someones input on my reverse lookup and why my Object.keys() is returning undefined
                    var today = moment().format("MM/DD/YYYY"); // "05/10/2021"
                    console.log(today);

                    var result = Object.keys(data).find(key => data[key] === today); // "Monday"
                    console.log(result);

                    var todayStatus = result ? data[result + 'Status'] : 'n/a';
                    console.log(todayStatus);
In my data.d.results, the Keys I am looking for (Monday/Tuesday/Wednesday/Thursday/Friday) are storing the date in an ISO String, and I am looking for it based off of a formatted string? Could that possible be an issue
 
2:16 PM
10 messages moved to Trash can
@BeerusDev does data have a "MondayStatus" key?
 
It has a Monday Key and a MondayStatus key
 
are you sure?
seems odd that the same object would have date keys, day keys, AND daystatus keys
 
1: "User"
2: "Monday"
3: "MondayStatus"
4: "MondayLocation"
5: "TuesdayStatus"
6: "TuesdayLocation"
7: "WednesdayStatus"
8: "WednesdayLocation"
9: "ThursdayStatus"
10: "ThursdayLocation"
11: "FridayStatus"
12: "FridayLocation"
13: "Tuesday"
14: "Wednesday"
15: "Thursday"
16: "Friday"
17: "Sunday"
18: "Locations"
19: "Department"
console.log(Object.keys(data));
 
where is 20: "05/10/2021"
under Monday?
 
It is under monday
 
2:25 PM
Where does your undefined occur
 
Well you ught to just print the whole object...
 
var today = moment().format("MM/DD/YYYY"); // "05/10/2021"
                    console.log(today);

                    var result = Object.keys(data).find(key => data[key] === today); // undefined
                    console.log(result);

                    var todayStatus = result ? data[result + 'Status'] : 'n/a'; //n/a
                    console.log(todayStatus);
 
JSON.stringify(data)
 
each current output is commented out beside the line
 
print the whole object.
 
2:30 PM
The results are already in JSON format. It is a array of objects (15 to be exact at the moment)
 
....
Print the whole object
Add console.log(JSON.stringify(data)) to the line above var result .....
And show that output
 
^
you clearly know where the undefined is
 
You expect us (but also yourself) to be magical and just guess what's in there... Always start with printing the data that is faulty.
 
it should be super easy to just look at the object and understand why that happened.
javascript isn't magic
it does what it's told to do
 
{
  "User": {
    "Id": 79,
    "Title": "Beerus Dev"
  },
  "Monday": "2021-05-10T04:00:00Z",
  "MondayStatus": "P",
  "MondayLocation": "Office",
  "TuesdayStatus": "P",
  "TuesdayLocation": "Office",
  "WednesdayStatus": "P",
  "WednesdayLocation": "Office",
  "ThursdayStatus": "P",
  "ThursdayLocation": "Office",
  "FridayStatus": "P",
  "FridayLocation": "Office",
  "Tuesday": "2021-05-11T04:00:00Z",
  "Wednesday": "2021-05-12T04:00:00Z",
  "Thursday": "2021-05-13T04:00:00Z",
  "Friday": "2021-05-14T04:00:00Z",
returned before var result with console.log(JSON.stringify(data));
 
2:36 PM
now check the statement data[key] === today against what you expect to happen on "monday"
"Monday" of the data is that really "05/10/2021" as you expect it to be?
I think you can see the problem already :P
 
I stated that in my question, if it was because it is being stored as an ISOString
 
so you knew that already?
 
i mean
 
I wasn't sure if it would cause issues or not
 
"A" isn't equal to "B"
so..
 
2:39 PM
undefined as the result of a find operation means it isn't found.
 
var today = moment().format("YYYY-MM-DD");
var today = moment().toISOString();
 
Do you think that would work?
 
I have tried both of these
 
yes
but take the first one: how would today look then?
 
"today" won't match the strings in your json
 
2:41 PM
Like "2021-05-10" right?
 
yes
 
but 2021-05-10 is not equal to 2021-05-10T04:00:00Z
 
const array1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

array1.reduce((accumulator, currentValue) => {
  return accumulator.then(() => {
    return new Promise((resolve, reject) => setTimeout(() => {
      console.log(currentValue);
      resolve(undefined);
    }, 1000))
  })
}, Promise.resolve(undefined))

I am doing this and trying to print out numbers sequentially by having 1 second delay, and it works fine. Now, because I am new to Promises and I want to absolutely grasp the logic, I want to ask something about the `resolve(undefined)` part. When I change it to `resolve()` (when I pass nothin
 
@Silidrone 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
 
since the times are always +4 hours, create a datetime using today's date at +4 hours
 
2:42 PM
Similarly if you are not exactly at 4 am utc when doing the command toIsoString() would return something like:
2021-05-10T01:10:11Z - which isn't equal to 2021-05-10T04:00:00Z right?
So you have to do something more clever
You could do the brute force of checking against the start of the string like:
key => typeof data[key] ==== 'string' && data[key].startsWith(today)
 
@Silidrone resolve simply resolves the promise with what you pass to it. passing nothing to it is the same as passing undefined.
 
Or a more robust solution would be to use moment, first create a moment of the data strings and then use momentjs to check if the dates refer to the same date.
 
When you call a function with undefined, the function has no way of determining whether nothing was passed or if undefined was passed.
 
that would be like:
 
@Silidrone using your code, changing undefined to (blank) doesn't change the output.
 
2:47 PM
key => {
    const v = moment(data[key]);
    return today === v.format("YYYY-MM-DD");
}
while in both cases indeed using var today = moment().format("YYYY-MM-DD");
 
2:59 PM
@Cerbrus thank you :)
 
np
 
@paul23 brute force method worked
Thank you
 
Morn everyone o/
 
Happy Monday
 
My router allocated James' computer's IP address to another device before it could request a static lease. And then the router wouldn't allow me to release the IP address. So I had to change James' IP address and then change all the IP forwarding rules. Pain in the ass. But now he's good.
right james?
|| echo yup
 
3:09 PM
yup
 
3:20 PM
@KevinB indeed I ran it twice before the other one finishing that's why it got messed up.
 
3:48 PM
@BeerusDev they woudl both work, the brute force is just less robust if data changes format - while the other method has momentjs as "glue" to make it work with many data formats.
 
4:39 PM
Yet another boring monday, how yall?
 
posted on May 10, 2021 by Bindu Suvarna

Hi, everyone! We've just released Chrome 90 (90.0.4430.78) for iOS: it'll become available on App Store in 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. Bindu Suvarna Google Chrome 

 
 
2 hours later…
6:44 PM
this node code
return Promise.all(promises)

gives me error
(node:87688) UnhandledPromiseRejectionWarning: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
 
cool
 
7:06 PM
my bad
 
Jay
Hey guys
I have an issue. I have content returning reponse.data.pageName

I have the pageName set in a var and wondered how I can fetch:

response.data.[pageName from var]
 
response.data[pageName]
 
Jay
ok what if the var is set in reactJS componentDidMount but I am trying to get it in: const mapStateToProps = (state) => {
 
i don't understand the context
but that's how you access a data property using a variable with the property's name
if the variable is elsewhere you'll have to deal with that
 
7:40 PM
posted on May 10, 2021 by Srinivas Sista

The Stable channel has been updated to 90.0.4430.212 for Windows, Mac and Linux which will roll out over the coming days/weeks. A full list of changes in this build is available in the log. Interested in switching release channels?  Find out how here. 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

 
7:58 PM
 
i don't get it
 
9:34 PM
posted on May 10, 2021 by Krishna Govind

Hi, everyone! We've just released Chrome 90 (90.0.4430.210) for Android: it'll become available on Google Play over the next few weeks. 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

 
10:02 PM
1 message moved to Trash can
If there's an open source library (you don't own/manage) that works, but you want to make the API simpler/better in a non-backwards compatible way. Is it better to fork and do your own thing, or make a PR, or make an issue?
 
depends on how strongly you feel about using it with said change
 
I'd very much like the change implemented, but I don't think it's right to basically remake the entire project in a PR
 
well, for example, there was a markdown library that i wanted to use a while back, but i need a few additional features. tables, float left/right, etc, and there was little chance the owners would add those features. clearly that's a case for forking rather than doing a pr
 
But lets say there is a bug in what you forked and the original people update the original repo, isn't it a pain to pull those changes?
 
can be
never happend in my case, they ended up abandoning the project pretty soon after i started using it
(we still use it)
think it was called Showdown, or similar
 
10:18 PM
Is it okay to store JWT in local storage ?
 
56
A: How safe is JWT?

Sunil D.Only the server should know the "secret" that is used to generate the JWT. If someone modifies the data contained in the JWT, the server will fail to decode it. So the server can trust any JWT that it can decode. However, if a hacker got access to your computer, they could see the JWT that is st...

 
Thanks
 
10:31 PM
So webpack 5 decided to remove auto polyfilling for node native modules
How am I supposed to pollyfill now? Can babel handle it?
i fucking hate frontend
 
11:00 PM
using browserify instead
 

« first day (3859 days earlier)      last day (1072 days later) »