« first day (3581 days earlier)      last day (1361 days later) » 

12:06 AM
sorry JBis, but I need Wietbot with me now, since he is now processing my messages 😃
the ip blacklisting appears to happen on certain machines running in the AWS data center, which only run node-js applications
building the chat client application in jvm avoids the blacklist entirely...
I could ask SO if they would revoke the blacklists so node-js applications also work at least 99% of the time, but I wonder if they will do it
 
1:04 AM
@Wietlol huh?
 
2:03 AM
Anyone know how to debug when a react context consumer isn't receiving updates? I have a provider that has the value of a firebase object and it updates from null -> object when firebase initializes, and this code works when i tested it by itself (its in a component library i made). When I tried using the component in another project, the consumer doesn't receive the updates to the firebase object
I even checked using the react dev tools and in the component tree the provider has the updated value of the firebase object, but it doesnt propagate down to the context consumer
 
 
6 hours later…
7:39 AM
@qwerty 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
@qwerty 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
 
Anyone know how to compile the SCSS in Vue SFC files into one CSS file, as opposed to one CSS file for each component? Using webpack with these rules...
 
1 message moved to Trash can
 
    {
        test: /\.vue$/,
        loader: 'vue-loader'
    },
    {
        test: /\.s[ac]ss$/,
        use: [
            {
                loader: 'file-loader',
                options: {
                    name: '[name].css',
                    outputPath: '../css/', // Relative to /js folder
                },
            },
            {
                loader: 'sass-loader',
            }
        ],
    },
 
@JBis in basic terms, Wietbot is now processing messages of users
it replaces emote codes like :stuff: to an emoji
to do that, it requires to be able to edit messages posted by users, and the only way I know of that is by being logged on as that user
so, I tried to make a simple chat client application
one that I, as Wietlol, can just host and share the endpoints with Wietbot
then, Wietbot can edit my messages 😄
I thought I should do this in node-js... because... it starts up faster than Java applications
but I kept receiving IP blocked messages from SO login
the outbound IP addresses that the applications use is based on their containers
turns out that the IPs being blocked are from containers running node-js
so, instead of doing the node-js version, I just made it in JVM, which now does work 😄
to use the feature
1, I must have hosted that web service and shared the endpoints with Wietbot
2, Wietbot must be listening in the channel I want to write the emotes in
so, Wietbot is now lurking here :D
^ I do need to expand the database with more emote codes though
 
 
5 hours later…
1:08 PM
would it be bad practise to couple my logging with my custom error classes? So basically log within the error class?
module.exports = class AppError extends Error {
  constructor(message, cause) {
    // Calling parent constructor of base Error class.
    super(message);

    // Saving class name in the property of our custom error as a shortcut.
    this.name = this.constructor.name;
    this.cause = cause || undefined;

    //add logging lib and log here??

    // Capturing stack trace, excluding constructor call from it.
    Error.captureStackTrace(this, this.constructor);
  }
};
 
@Montasser 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.
@Montasser 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 message moved to Trash can
 
Hello everyone please how can i using node js insert a json object to sqlite3 DB?

I did this :

db.serialize(() => {
db.run(`INSERT INTO patients VALUES`, JSON.stringify(patient));
})
 
1:46 PM
err
what does the docs say about that
 
2:02 PM
from what i see, that's not at all valid syntax
you passed a sql query, a param, but the didn't specify where in the sql query the param should be,
does it even support storing json?
 
Hi all
Is it possible for an iframe element hosted by another domain to provide a JS API such that those hosting it can get information/interact w/ the iframe?
For security, an iframe is locked down pretty tight -- the host can't interact w/ its contents easily. But how does YouTube do its API?
 
yes
ish
!!mdn postmessage
 
i wouldn't call it providing a JS API, but it allows communication back and forth between cross-domain windows.
 
Is it not possible in react to have a context inside of a npm package that you have a consumer for?
I had code for a firebase provider/context so i could access firebase functions easily through my app, and then I moved that code to a package so i could reuse it easily between projects. Inside that package I have a layout component that wraps all my pages, and inside that layout is the context Provider. It also has a consumer and its consumer gets the value of firebase, but any consumers down the tree in my original project dont get the value, despite them having the same context type
Or is it possible for a parent to re-render but not the child? That's the only thing I can think of thats causing a higher level consumer to update and not the lower ones
 
Thanks for the answer :)
 
3:01 PM
@Montasser 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
@Montasser 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
@Montasser 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
 
:50129634 Thanks for your answer , Here i fixed this :
db.serialize(() => {
db.prepare("INSERT INTO users(uid, first_name, last_name, birthsex, code, birth_date)
VALUES (?, ?, ?, ?, ?, ?)").run(JSON.stringify( user)).finalize();
});

But it all is inserted now in column

 but i gets all in one column :/

});
 
3:24 PM
right
you passed one string
one value
for multiple params it expects an array of values
it sounds like you don't actually want json
 
I do want to insert JSON as it is what i get from a cloud API in my console log

But i just don't know how to insert a json object to sqlite3 DB.

Thanks for the answer
 
but... if your table is setup to store the data in columns, that's... not json
 
Would using webpack break a react context?
I.e. In my package where I use my context it works fine, but then the whole package is built with webpack and then imported in another project and then that react context doesnt update
 
:50130675 Thanks a lot for your help man I did it the following :

 db.serialize(() => {
                db.prepare("INSERT INTO patients(uid, first_name, last_name, birthsex, code, birth_date) VALUES (?, ?, ?, ?, ?, ?)").run(
                  user.uid,
                  user.first_name,
                  user.last_name,
                  user.birthsex,
                  user.code,
                  user.birth_date).finalize();
              });
I know it is a forced way but it is ok with me
Here is what i was trying to do : https://stackoverflow.com/questions/63265853/insert-json-object-to-sqlite-database

But now since i found the answer that is ok. Thanks your hint was so helpful
 
3:41 PM
Hey, I'm trying to use `replace()` with regex on Hebrew characters.
Of course, it's not working.

Someone familiar ?
 
@SpazaM code?
 
a = "אדם הולך אדמה"
wordToHighlight = "אד"
a.replace(new RegExp(`\\b${wordToHighlight}`, 'gi'), `*${wordToHighlight}*`)
let's say even without the \b (begging of a word), the replacement is not correct.
 
I'm wondering if someone can suggest a website that has a sample server for making HTTP *POSTS*.

I want to use a sample HTTP *POST* in a Stack Overflow question -- to help demonstrate a concept.

Any recommendations?
 
||> a = "אדם הולך אדמה"
wordToHighlight = "אד"
a.replace(new RegExp(wordToHighlight, 'gi'), `*${wordToHighlight}*`)
 
@JBis "*אד*ם הולך *אד*מה" Logged: `` Took: 0ms
 
3:54 PM
@User1973 i dont understand your question
@SpazaM i think it might have to do with the fact that Hebrew goes left to right, but not too sure
 
user1973 wants a dummy site they can make post requests to and get a response
 
i mean you can post to anything
Every message your sending is doing a post request to SO
await fetch("https://chat.stackoverflow.com/chats/17/messages/new", {
    "credentials": "include",
    "headers": {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:79.0) Gecko/20100101 Firefox/79.0",
        "Accept": "application/json, text/javascript, */*; q=0.01",
        "Accept-Language": "en-US,en;q=0.5",
        "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
        "X-Requested-With": "XMLHttpRequest",
        "Pragma": "no-cache",
        "Cache-Control": "no-cache"
@SpazaM right to left *
 
4:09 PM
@JBis yes you are right, i reversed the string ... wrong "highlighting"
maybe I should encode the characters to Unicode and then make the regex ?
 
4:30 PM
@JBis Thanks. That helps. Will look into it.
 
@SpazaM try it
People who know lerna. I'm defintitly screwing something simple up. I have my lerna monorepo all setup, but whenever I go to install a package via npm install I get an error because npm can't find the local packages in the npm registry. I've run lerna bootstrap but the issue still persists. Currently the only way to install an npm package is to manually add to package.json and rerun lerna boostrap.
 
5:18 PM
fixed
running npm install on this computer so many times has def shortened the life span
 
posted on August 05, 2020 by Srinivas Sista

The beta channel has been updated to 85.0.4183.59 for Mac, Windows and Linux platforms 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 about common issues. Google Chrome S

 
6:17 PM
@JBis yarn + workspaces
lerna handles script execution, workspaces handles dependency resolution
 
6:39 PM
@forresthopkinsa right now im just using lerna for both
i've heard about yarn workspaces, never tried it tho
 
yarn ws is really straightforward and it works well with lerna
 
 
1 hour later…
7:53 PM
Is anyone available to assist me with this javascript issue I am having to populate an HTML Table
 
@zgoforth 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.
 
I am trying to sort my table rows based on a "Program" attribute and each Program will have subrows with all information related to that Program
0
Q: Organize HTML Table (with jQuery?)

zgoforthI have a searchable HTML table, that retrieves SharePoint list items from a multiple subsites, and everything about it is nearly perfect. The one issue I am facing is that the "Program" item keeps printing every time the function runs through/loops, but I only want it to print the "Program" heade...

Been kicking my butt trying to figure it out
 
Hi 0/
Is this channel still alive?
(Guess not)
/shrug
Life goes on
 
This b dead
 
8:09 PM
!!choose dead or alive
 
dead
 
neither
Kevin B
 
8:26 PM
If any of y'all can, please take a look at that Question I posted above. I am getting bent over by it and need to figure it out for a work project.
 
i read through the question, and it didn't seem to really mention anything about sorting
 
??
I didn't mean sort literally, the question mentions everything I am trying to do. Row with Subrows per "Program". Sorry just wasn't sure what terminology would fit there
 
i would make the data match the table structure you want, then just loop
ez
[
  { name: 'Program 1', data: [...]},
  { name: 'Program 2', data: [...]},
  { name: 'Program 3', data: [...]}
]
 
8:58 PM
 
9:29 PM
@Subin 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
@Subin 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
 
I have a library which uses Promises to send messages, handle response and send message again : github.com/subins2000/p2pt/…

For this, the promise `resolve` function is stored into array. I was wondering if this would cause a memory leak and is there a way to figure out if there is actually a `resolve` function (i.e there is a .then) ?
 
multi-line code pieces need to be in their own message
 
hows it going folks
 
ah okay @KevinB thanks for pointing out
 
ohhi
 
9:31 PM
lib.send(peer, 'hello')
    .then(([peer, msg]) => {
        return peer.respond('how are you ?')
    })
    .then(([peer, msg]) => {
        return peer.respond('byeee')
    })
 
@Subin 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.
 
Oh, and, no ```,just 4 spaces
chat formatting is a bit different from main
 
Oh, new here in chat, thanks. I have the sample better here : github.com/subins2000/p2pt/blob/master/test/basic.js#L42
With callbacks, I could just check if the argument is a function to store it or not. But Promise always has a resolve whether or not there's a tailing .then. I want to use .then, because it looks nice
 
i wouldn't call it a leak, if you're purposely storing it, that's purposely consumed memory, no?
 
I'm concerned if storing resolve when there is actually no .then later will be a waste of memory. The resolve in such cases looks like a pseudo function callback
 
9:40 PM
you can't know what methods would be used on a given object in the future
well, other than from the PoV that you're the one writing the code
 
new Promise((resolve, reject) => {
  console.log(typeof resolve)
});
Oh, then is there a way to know if resolve is actually empty ? Size check ?
 
hmm... not sure what you mean
 
Running the code sample above consoles 'function' even though we haven't mentioned it (given a .then later)
 
yes
it will always be function
.then does not modify that code in any way
it creates a new promise, or returns the same one
 
Yes, so I want to know if it's a function that does nothing implying there's no .then later and then only store resolve in alist of callbacks
 
9:44 PM
why would a .then not exist make the resolve not matter?
something is happening that involves resolving the promise, right?
 
Sorry, meant that if there is only a .then, store the resolve
like for sending a message not expecting a response, there would be no .then
lib.send('msg')
 
right, but, that shouldn't change how you create the promise
you can't see the future, so you need to create it to support the occasion that it gets used, if there's a possibility it will be used.
 
here's where it's storing : https://github.com/subins2000/p2pt/blob/master/p2pt.js#L207

hmm, so maybe add an extra param to `send()` saying expecting a response ?
 
couldn't hurt, but i don't think it's necessary
as long as it gets called and removed eventually
 
if there was a way to know that pseudo resolve has nothing in it like sizeof(func) === 0, would've been cool
I guess storing pseudo resolves won't hurt much in memory usage
 
10:04 PM
Thanks @KevinB :)
 

« first day (3581 days earlier)      last day (1361 days later) »