« first day (3582 days earlier)      last day (1349 days later) » 

12:11 AM
posted on August 06, 2020 by Ben Mason

Hi everyone! We've just released Chrome Beta 85 (85.0.4183.59) 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

 
 
7 hours later…
7:23 AM
posted on August 06, 2020 by Bindu Suvarna

Hi, everyone! We've just released Chrome Beta 85 (85.0.4183.61) for iOS: it'll become available on App Store in next few days. You can see a partial 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

 
 
1 hour later…
8:50 AM
good day everyone i have two questions, first i am trying to use es2016 syntax with nodejs that is import/export rather than require/module.export what i did so far was to add "type": "module"to package.json and it works but i still have to specify the file extension eg import fish from 'animals/fish.js' is there a way to not indicate the extensions since i am only working with js files no ts files.
my second question is would it be possible to use redux on the sever side (nodejs) and if so how do i set it up? a link would be helpful thanks.
 
 
2 hours later…
10:44 AM
@BobbyAxe 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
@BobbyAxe 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
 
after much experimentation i have been able to set up redux on the sever side, my question now is how do i get the dispatch keyword to be global eg in react i can do
return (dispatch) => {
    dispatch({type: MASTER_APP_STATUS_PROCESSING});
}
but now, i set it up on the server(nodejs) i have to do store.dispatch({type: MASTER_APP_STATUS_PROCESSING}); not that there is anything wrong with this but will like to understand better.
 
11:20 AM
am using the thunk middleware but it just doesn't work on the sever as i understand it is what gives me the ability to do return(dispatch)=>{dispatch({})}
 
 
2 hours later…
1:18 PM
Good day, who can assist me with better understanding control break logic for a certain issue I am facing
JamesBot
 
2:03 PM
Hello everyone,

I made a constraint on an SQLITE field and it works, but i am getting the error in Error format. How can i using javascript get the error to be hidden or in console log please
 
@Montasser did you post a question so I can see the code
Essentially just a console.log(err); you can use a catch function aswell
 
@zgoforth No i did not because i made the constraint using a migration in Knex SQLITE. And i effectively i have a console.log inside a catch, but i get the standard Red Error Message if the constraint is true, which is true, but i want to hide it. Thank you
 
Why would you want to hide it? Just curious
 
Sorry maybe i did not explain myself well, By hiding it i mean not removing it, but making it show in console or in another way, instead of having :
Error
Uncaught Exception
Error: SQLITE_CONSTRAINT : UNIQUE Constraint failed: field

Because the thing is i made a constraint on an sqlite field to be unique, so i when i add my first set of values it works (good) , then when i add the same ones again it gives this error (good which means it takes it as unique). So what i thought about is for user experience , the user should not see such an error when the app runs
@zgoforth I have a catch and console log err but since i am not treating the unique constraint case on the main code maybe that it is why the error is caught by the main process i guess
 
I invited you to a chat
 
3:10 PM
I need help with a control break function that is not working for some reason. May be syntax?
 
possibly
or logic
most likely logic, if you're not receiving a syntax error
 
Here is the code concatenating my data I am pulling to populate this table.
.then(([r1, r2, r3]) => {
const objItems = r1.concat(r2,r3);
console.log(JSON.stringify(objItems));
console.log(objItems);
var tableContent =
'<table id="deliverablesTable" style="width:100%" border="1 px"><thead><tr colspan = "5"><td><strong>Program</strong></td>' +
"<td><strong>To</strong></td>" +
"<td><strong>Date Submitted</strong></td>" +
"<td><strong>Approved</strong></td>" +
"<td><strong>Notes</strong></td>" +
"<td><strong>Deliverable</strong></td>" +
"</tr></thead><tbody>";
for (var i = 0; i < objItems.length; i++) {
tableContent += "<tr>";
tableContent += "<td>" + objItems[i].Program + "</td>";
tableContent += "</tr>";
tableContent += "<tr>";
tableContent += "<td> </td>";
tableContent += "<td>" + objItems[i].To + "</td>";
tableContent += "<td>" + objItems[i].Date + "</td>";
tableContent += "<td>" + objItems[i].Approved + "</td>";
tableContent += "<td>" + objItems[i].Notes + "</td>";
tableContent += "<td>" + objItems[i].Deliverable + "</td>";
tableContent += "</tr>";
There is it posting to a HTML table. I cannot figure out how to add in the conditional if statement for the table population
for example if (i=="Program1") post everything else related to program 1 under it. or if it = Program 2 or Program 3 to do the same thing
Is it even possible to use a control break for that? Or a continue
 
i don't think a control break would help
 
Whys that?
 
you need to keep up with whether or not the program of the given line has already been added to the table, and if it has, skip adding the program cell.
 
3:24 PM
Or what/how would you suggest going about that. I cannot figure it out to save my life I have been researching/testing things to make it work for two days... sad I know
How would that work
 
a variable and an if statement will suffice
 
Could you provide an example. Sorry I am still newish to javascript and have difficulty catching on
 
if currentprogram isn't equal to previousprogram, print programline
 
would I add that directly under the for loop?
 
both in and before
 
3:26 PM
?
why twice
 
the variable that's storing the state (which program was previous) should be defined before
it should exist before the loop starts
otherwise...
it doesn't exist
if statement though doesn't need to exist twice.
 
how would I read from JSON array pulled from objItems to set that == to currentprogram
 
err
by using the same value you are using to print the program?
it's an object/array, not json
 
Pardon my stupidity/lack of knowledge. Still learning, but would you mine taking a look at this. It has all the information and the object array/what it is grabbing. May be more helpful + I put a bounty on it. stackoverflow.com/questions/63232566/…
 
I'm not interested in providing code, which would be required for a good answer imo
 
3:36 PM
Would it be alot to add.
Im assuming that is why. I didn't think I would need to add much to fix it.
 
no, it's like 4 lines of code
 
wow.
ok
hm
var currentprogram = objItems[i].Program; ?
 
it's an introduction to state management essentially
that is needed, though without the var. the var would go before the loop. it's the variable that keeps the "state", it keeps track of what program was used in the previous iteration
then on each iteration, you check to see if the program of that iteration matches it. If it doesn't, you update the state and output a program row
 
Ill do some research on that. Thank you. If anyone else in here could take a look at my post/question and hopefully provide a decent answer that would be a huge burden off my shoulders
@KevinB ok. I think I understand what you are getting at, I am going to do some research and see if I can't fiure it out
 
👍
I look at it this way... figuring out this problem, is a gateway to solving a whole lot of other similar logic problems. I'd rather help you reach that, than just provide working code
 
3:42 PM
I don't know if any of my questions made much sense, but i would like to know how can i pass the redux-thunk middleware globally for nodejs
 
@KevinB Oh I 100% agree. And I appreciate that. It is just I am in a time crunch for this project and it is making me want to pull my hair out
 
sorry, i like to stay away from redux
 
okay
i guess my question should be, if i can pass a function to all scopes using express()
something towards the lines of app.use()?
 
if (objItems[i].Program == ' AMMO')
 
app.use can alter req by adding/modifying properties on it, or it can update a store/module/object/array etc that is used by other things
if that's what you're asking
 
3:48 PM
if "AMMO" is the current program, would this be something along the lines of the right direction
 
Yes, now you just need to be able to make 'AMMO' dynamic
 
okay so i have to attach the function to the request
 
I thought it already is, Program 1 = AMMO I just put that in instead of actually using program name just for example
 
var previousValue = '';
for (let i = 0; i < 10; i++) {
  if (objItems[i].value !== previousValue) {
    outputHeaderRow(objItems[i].value);
    previousValue = objItems[i].value
  }
  outputRow(objItems[i])
}
using your looping condition ofc
i was just lazy
this also assumes our array is sorted by objItems[i].value, otherwise this won't work
 
That is how it is sorted.
Does this make my tableContent += "<tr>";
tableContent += "<td>" + objItems[i].Program + "</td>";
tableContent += "</tr>";
tableContent += "<tr>";
tableContent += "<td> </td>";
tableContent += "<td>" + objItems[i].To + "</td>";
tableContent += "<td>" + objItems[i].Date + "</td>";
tableContent += "<td>" + objItems[i].Approved + "</td>";
tableContent += "<td>" + objItems[i].Notes + "</td>";
tableContent += "<td>" + objItems[i].Deliverable + "</td>";
tableContent += "</tr>";
obsolete?
Bc that was what was initially in my for loop
 
3:58 PM
morning o/
 
it only really replaces the first 3 lines of it. or, wraps them, rather
the functions i used aren't necessary, more or less pseudo code
 
|| formatting zgoforth
 
Invalid command! Did you mean: formatting, forkingmouse, format? Try help for a list of available commands..‍.‍.‍.‍.‍.‍.‍.‍
@zgoforth 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.
 
|| starspam
 
!stars {1}
 
4:00 PM
lol
 
the star feature is not meant to be used as a "like" feature. Please respect it
 
Relax
"Star this message as useful"
The message was useful
Bot
 
SO and this room have a different definition of the use of stars.
 
Grumpy
 
4:39 PM
@KevinB
Question
 
just ask
 
I fixed the issue I was having with the grouping of the array prior to the loop. So now it does exactly what I want it to do. Is it possible to sort within an already sorted array of objects
@JBis how can i post a screenshot in here to show what I am talking about? Imgur link?
 
4:55 PM
theres an upload button next to the send button or imgur link
if you are sending a screenshot of code, don't. Use a gist or something.
 
It isnt of code its of my output
And I do not see an upload button
See how I have sorted by program. I am making the rows with Programs expand/collapsible that way a million items arent showing at once. My supervisor also wants me to sort/group like I did there for the Deliverable within the Program.
queue jeopardy thinking music
 
5:59 PM
Forget the previous question. Anyone know how to make table rows expandable/collapsible youtube.com/watch?v=svGUH4zSJTU I found this video that seems helpful but its all hardcoded the table I mean so its hard to follow
 
6:41 PM
posted on August 06, 2020 by Daniel Gagnon

The Beta channel has been updated to 85.0.4183.57 (Platform version: 13310.40.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 fe

 
@JBis are you familiar with collapsible/expandable table rows
 
6:57 PM
@PranavVempati hello
 
7:18 PM
Vuetify has some really slick data table components
Not sure if that helps you at all but I thought I'd mention it
 
@zgoforth i dont do frontend stuff without a framework anymore, but that vid seems pretty simple
 
I miss Vue
 
7:33 PM
maybe i'm just not used to it, but i really don't like logic in html tags. Biggest reason i've stayed away from angular and vue.
 
Does react do weird optimizations around making copies of variables? I have a functional component that has 2 state vars, one is an array users, and the other is currentUser. When i click a user, i do setCurrentUser({...user}) to set a copy, yet when I change currentUser the value in users changes too. Has anyone ran into that?
 
jsx is definitely easier to pick up but I think logical html ends up being clearer
imperative vs declarative
 
@ROODAY my guess is you have subobjects. ... makes a shallow copy
 
so if I have users = [{}, {}. {}], and i do currentUser = {...users[0]} will still point to that reference?
 
and jsx does force you to write weird code a lot, like using && or empty ternaries for what should just be an if
 
7:39 PM
||> const a = {foo: "test", bar: {abc: "test2"}};
const b = {...a};
b.foo = "bla";
b.bar.abc = "test3";
console.log(a);
console.log(b);
 
@JBis undefined Logged: {"foo":"test","bar":{"abc":"test3"}}, {"foo":"bla","bar":{"abc":"test3"}} Took: 1ms
 
observe that abc has changed to test3 in both objects
 
Hmm I even tried object.assign and I had the same issue, isn't that supposed to deep copy?
 
however, foo has only changed in b
No. Deep copies in JS are a huge pain the ass.
 
:(
Alright I'll try some other methods, but thanks for pointing out that copying isn't as simple as I thought
 
7:40 PM
tl;dr use a library for deep copying
 
I'm gonna get yelled at for this, but if your lazy and you just have data (no functions, etc.), you can do b = JSON.parse(JSON.stringify(a))
 
!!echo stahp
 
stahp
HAMMAHTIME!
 
if you know for certain that you only have primitive data (no functions) and no circular data then yes, serialization works
 
hai
i have some doubts on rsa encryption in javascript.
i have a public key generated in x.509 format,which is encoded with a Base64.
so what are the javascript libraries i should look for, to decode the public key and then encrypt as RSA public key
please give some suggestions.
Im still learning about these concepts, i hope the question is not bad.
Thank you!
 
7:42 PM
That could work here, as I do just have objects. And i see now why it affected my case, cuz I modify the subobject roles of the user, which you pointed out will be the same reference
 
@shelby 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.
 
in node.js?
 
@JBis gotcha
 
@forresthopkinsa it feels very php'y to me
logic in html that is
 
no, not in node.js
 
7:46 PM
I think JSX is closer to PHP than proper templating hahah
 
      var sortedObj = {}
objItems.forEach(item => {
  var program = item.Program;
  delete(item.Program); //remove this line to keep the program in the item data
  if (!sortedObj[program]) {
    sortedObj[program] = [];
  }
  sortedObj[program].push(item);
});
@KevinB I figured it out, but now if I wanted to do the same thing inside of that with my deliverables item, how would I do that?
 
JSX kinda blurs the lines, because it's really just real HTML hiding behind JS objects hiding behind HTML syntax.
 
well yeah you have true HTML mixed into all of these systems, it just ends up being a question of whether you want to mix languages and context-switch
Angular and Vue have very similar templating systems but I think Vue does it a lot better
JSX provides for a very shallow learning curve but it ends up producing weird code in the end
Think about server-rendered JSX. It's not so different from PHP
 
Before I can conclusively say which I think is better, I need to experience environments other than web. I'd like to understand how stuff is handled natively on various platforms (in swift, java, etc.).
 
That's fair. Native platforms, fwiw, are typically very imperative by default
 
7:58 PM
You should try React with MobX. Looks very similar to vue (kinda).
You can manipulate state directly (x = value) instead of using setX(value)
 
Funny you mention that, the most recent project I've collaborated on is in fact a React/MobX project :)
 
hehe, true. But we've still used useState hook instead of useLocalStore
 
something like this (first example), mobx-react.js.org/state-local
 
Hmmm
MobX would benefit greatly from more thorough documentation
 
8:07 PM
wouldn't everything? ;)
 
hahaha fair
 
user11867287
8:38 PM
Any knows of a smart way to keep an eye on new pages of a webserver?
(In Node.JS)
 
Hi! Do anyone of you know how to keep trailing spaces un a string in ReactJS?
I have to split a string like "Hello, Mike, is my name" by the name, so the first string must be "Hello, " but it always show as "Hello,"
 
8:54 PM
got code?
how does the trailing space manifest itself?
 
I have to do 2 `text-overflow: ellipsis` and have the string in center to give:
"... this is my content SPLITTEDVALUE and the last part of my content ..." so I split my string with SPLITTEDVALUE and the 2 parts are "... this is my content " and " and the last part of my content ..."
{info.contexts.map((context: string) => {
            const ctx = context.split(info.match)
            return (
              <div
                className="context-item"
                key={`${info.hash}-context-${context}`}
              >
                <span className="sensitiveInfos-context" title={context}>
                  <span className="context-start">{ctx[0]}</span>
                  <span className="sensitive-info">{info.match}</span>
                  <span className="context-end">{ctx[1]}</span>
so .context-start and .context-end have text ellipsis. But the trailing space of ctx[0] or the starting space of ctx[1] is not kept
 
just to confirm
check the html rendered in the browser, does it have a space
i'm betting it does
 
yes but it don't show
it didn't keep it in the display
but in the code, the space is there
 
right
so it's a css/html problem
that means we can significantly simply this problem
 
I tried with &nbsp; and other code like this
Ty for your help btw :) really appreciated
      .sensitiveInfos-context {
        display: flex;
        font-family: ${(props: SensitiveInfoProps) => props.theme.textFont};
        font-size: 14px;
        line-height: 22px;
        color: ${(props: SensitiveInfoProps) => props.theme.colors.textColor};
        text-align: center;

        & > span {
          display: inline-block;
          white-space: nowrap;

          &:first-child {
            direction: rtl;
            text-align: left;
            text-overflow: ellipsis;
            overflow: hidden;
this is the CSS for this part
 
9:02 PM
are you getting an extra space between "<name>" and ", is my name"
 
no, there's no space at all
 
err
i forgot to modify classNAme
still not applying
huh
 
I think the problem is not the HTML but React rendering
 
it's not reading the sass
i'm pretty sure this isn't a react issue, react shouldn't be trimming your string, and if you see the space in the rendered html, it's there
the only thing that can affect it at that point is css
here's with your css as scss, works, but getting likely not the result you're seeing
or maybe it is?
 
9:13 PM
white-space: nowrap; -> white-space: pre-wrap;
 
This is what it looks and it's code
 
22
Q: CSS flex box last space removed

GuesserBy setting the display of an item to flex I am finding the last space is removed from a text string so. <div class="has_flex"> Some text <a href="link">Link</a></div> Becomes <div class="has_flex"> Some text<a href="link">Link</a></div> .has_flex { display: flex; } <div class="no__...

 
prewrap breaks the ellipsis
 
that's the problem though
that is why your space is going away.
 
I really need it. Should I align boxes with float?
 
9:15 PM
inline-block as the same problem
as does block
 
ok, thank you a lot for your help. I think I'll just detect if it has a trailing/starting space, if so, giving a class who gives a margin-left/right of 1ch
 
 
1 hour later…
10:43 PM
Hey, can somebody help me with something? I've got a promise setup that requests the server in one central function, let's call it "get", and looks like this
        return getApi("...")
            .then(result => {
                return result?.data ? (result.data) : null
            })
            .catch(e => {
                toast.error(e);
                return Promise.reject("error in graphql");
            })
 
@Martin. 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
 
function getPost calling this function should have some .then(...) too, but SHOULD NOT BE CALLED if error is catched. This is working, but I am getting

Uncaught (in promise) error in graphql into console
However, in my function, let's say getPost, calls

get("getSomeApi").then(data => console.log(data));
I don't want this last then to happen, but I also want to avoid the problem. Is there any other way to suppress the error than just adding .catch() to the getPost chain?
 
11:10 PM
@Martin. why don't you want to add catch() ?
you need to handle the error somewhere, where do you want to handle it?
 

« first day (3582 days earlier)      last day (1349 days later) »