Posts by Rafael Costa • 374 points
33 posts
-
0
votes1
answer58
viewsA: PHP xdebug3 with Docker in Ubuntu 20.04 does not work
This is an example of a Docker-Compose with two networks, a bridge and an external one, in your case you can test how to bridge. version: '3' services: app: build: . entrypoint:…
-
1
votes1
answer266
viewsQ: Floating promise check in Typescript Eslint (no floating Promises)
I have the following method: async sync({model, event, data}: {model: string, event: string, data: Category}) { if (model === 'category') { switch (event) { case 'created': await…
-
1
votes1
answer41
viewsQ: Error handling a method called by a go routine
When we have a method like this: func (vu *VideoUpload) ProcessUpload(concurrency int, doneUpload chan string) error { in := make(chan int, runtime.NumCPU()) returnChannel := make(chan string) err…
golangasked Rafael Costa 374 -
1
votes1
answer49
viewsQ: Separation of responsibilities for implementation
I would like to ask a question about the separation of responsibilities in an application. I created an API on Node to practice the concepts and I’m refactoring the code to suit best practices, so I…
software-architectureasked Rafael Costa 374 -
0
votes2
answers2175
viewsQ: Typescript error: Object is possibly 'null'
I have the following component in Angular: import {Component, OnInit} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; @Component({ templateUrl: './course-info.component.html'…
-
0
votes1
answer389
viewsA: How to make a Dynamic Checkbox with React Hook?
I do not know if I understood the idea well but I believe that you should use the useEffect so that in the loading is updated the state, imagining that the information comes from a bank, when the…
-
2
votes1
answer161
viewsA: How to create an "Asset" Vscode directory in a Flutter project
Just create a folder and name it as Assets. Remember that in Flutter you need to edit the pubspec.yaml file by adding the folder name there and be careful with the indentation otherwise it gives…
flutteranswered Rafael Costa 374 -
-2
votes3
answers814
viewsA: "code ." does not work on linux Mint (zsh terminal)
Run this command on your terminal to check where the VS Code binary is: which code By default it must be on /usr/bin/code Then you change its PATH to use this directory…
-
-2
votes1
answer87
viewsA: Help with Spread Operator in React
The spread function is just this, it will keep everything that already exists and add the new record, if Voce wants it not to keep and just add the new, remove the spread: function processRow(value)…
-
1
votes2
answers113
viewsA: Prevent screen scrolling when opening modal in Reactjs
No need for Jquery, Voce can do so: const class = isModalVisible ? "class1" : "class2"; Hence Voce puts the class variable in the class property of JSX, for example: return( <tr key={_id}…
-
1
votes1
answer31
viewsA: Problem in displaying score
I could not understand well what you are trying to do, but the findViewById is not for you to look for the correct answer, is for you to relate to the view that was created, for example, an…
android-studioanswered Rafael Costa 374 -
0
votes1
answer158
viewsA: Problem importing function in React Native
If you are using VS Code and hover the mouse over the import path (./src/screens/login/login) it displays the full path, if not displaying the import is going the wrong way. Can’t say because you…
-
0
votes2
answers362
viewsA: useState does not work as expected
I believe that if you put a useEffect to perform the function when mounting the components solve your problem: import React, {useState, useEffect} from "react"; import "./styles.css"; import * as…
-
0
votes1
answer79
viewsA: using useEffect, setState and Sort for Array
The state is being changed normally and useMemo and Slice I believe they are unnecessary: https://codesandbox.io/s/stackoverflow-students-kj4lt?file=/src/App.js:583-584 import React, { useState,…
-
0
votes1
answer120
viewsA: Mongodb query returns empty array
Instead of using parameter, use query that looks better, what is wrong is that the parameter is probably not arriving at the query because it is a String and then what you can do to test is to make…
-
1
votes1
answer294
viewsA: Error when connecting API to Flutter (Dio)
VIEW return Scaffold( appBar: AppBar( title: Text('Users'), ), body: Container( child: FutureBuilder<List<User>>( future: _placeHolderService.getUsers(), builder: (context, snapshot) {…
-
0
votes3
answers51
viewsA: How to exit the condition loop in this register with Mongoose/Express
Actually I think the problem is in Postman, the body type of the request is text and should be Json
-
0
votes3
answers51
viewsA: How to exit the condition loop in this register with Mongoose/Express
Tries to assign separately: router.post('/create', (req, res) => { const email = req.body.email; const password = req.body.password; if(!email || !password) res.send({ error: 'Dados…
-
1
votes1
answer146
viewsQ: Recover a branch in Git
I checked out an old commit from an application and the following message appeared: You are in 'Detached HEAD' state. You can look Around, make experimental changes and commit them, and you can…
gitasked Rafael Costa 374 -
1
votes1
answer57
viewsQ: Error in useEffect accessing API data
I have the following hook that runs the API calls smoothly, returning the information and updating the components normally, but it brings some connection errors in the console, I believe these…
-
-1
votes1
answer238
viewsA: React Native Flatlist is not rendering results
<View style={styles.listItem}> <FlatList data={posts} keyExtractor={item => item.id.toString()} renderItem={({ item }) => ( …
-
0
votes2
answers45
viewsA: Internal link problem using pure Javascript
I believe that querySelectorAll would have to be like this: const menuItems = document.querySelectorAll('a.menu');
-
-1
votes2
answers228
viewsA: Separating elements from an array for sequelize query
In your query, try sending the reply message as a JSON, for example: res.send({id_mensagem: id_mensagem}); That way he’ll send each id_message as an object and then you can access each other’s…
-
-2
votes2
answers164
viewsA: Javascript - User Data Doubts
If already returns true or false, you do not need to specify this in its body. just give a user;
javascriptanswered Rafael Costa 374 -
1
votes2
answers71
viewsA: OnClick button does not respond
You have to use an addeventlistener to monitor the button click event, in it you pass the event type and the function that is called
javascriptanswered Rafael Costa 374 -
0
votes2
answers83
viewsA: List to frontend values of multiple tables
Pq Voce does not take the: "pp" and the: "pc" and calls directly date.Partida.designation and date.Chegada.designation
-
0
votes1
answer24
viewsA: Perform an update on Mongo DB grouped fields
I did as follows, I do not know if it is ideal or if it is possible to update with grouping in the same method: router.get("/private", async (_, res) => { try { const accounts = await…
-
0
votes1
answer24
viewsQ: Perform an update on Mongo DB grouped fields
I have a Node application that connects to Mongodb, in it I have an endpoint using express that returns me the largest balances grouped by agency: router.get("/private", async (_, res) => { try {…
-
0
votes1
answer481
viewsQ: Create JSON files relating arrays
I have two json files, one with id, status and acronym and the other with the state id and the cities of that state. I read these files and recorded the content in arrays, but I need to create a…
-
1
votes1
answer53
viewsQ: Array is empty outside the function scope even though it is declared in the global scope
I’m starting in Javascript and Nodejs and I’m not able to understand pq even I declare an array in the global scope, when I try to access it outside the functions where I made the map the array…
-
-1
votes1
answer80
viewsQ: Function does not remove HTML content when input text content is removed
Guys I did this function that when you load the screen the tabfoundUsers starts empty and as I change input text users are filtered, but when I remove all content from the input does not empty the…
javascriptasked Rafael Costa 374 -
1
votes1
answer36
viewsQ: Use includes() in a filter()
The function below is rendering all user names, I need to include in it a way to filter the rendered users according to what is typed in an input text, I tried to use includes() but I’m not getting,…
-
2
votes1
answer25
viewsQ: Test for the absence of duplicate tuples
I saw in a SQL book the following query: select T.course_id from course as T where unique (select R.course_id from section as R where T.course_id = R.course_id and R.year = 2009) I am unable to…