Posts by novic • 35,673 points
1,265 posts
-
0
votes1
answer48
viewsA: How to return the values of a public List<Weather>?
The feedback of this information is a json in the following format: { "coord": { "lon": -46.64, "lat": -23.55 }, "weather": [ { "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d"…
-
2
votes1
answer85
viewsA: Mount Array with categories and subcategories that are in the same table
According to the first example: First you need to filter the data you have categoria_id === null, example: $arrayCategoria = array_filter($array, function ($item) { return…
-
1
votes1
answer47
viewsA: Correct LINQ search syntax in MVC
The initial problem is not the LINQ, and how your code is being organized. Your code is spelled wrong LINQ, but, it is also unnecessary to use it, follow the minimum example created by me that…
-
1
votes1
answer30
viewsA: How to sort a list of objects through a custom criterion (no order by)?
I would make a junction between the three types with the method Concat of Linnum filtering the parameters in sequence, example: using System; using System.Collections.Generic; using System.Linq;…
-
1
votes1
answer56
viewsA: Why do I receive "user" as indefined?
No two properties were set in the component state usuario and mensagem and for that reason this.state.usuario and this.state.mensagem do not exist and therefore the message undefined, that is, not…
-
2
votes1
answer291
viewsA: Typeerror: values.reduce is not a Function
You need to show the sum, then you need to do the same as Javascript does with the method reduce where your default syntax: array.reduce(callback( acumulador, valorAtual[, index[, array]] )[,…
-
0
votes1
answer42
viewsA: How to insert a new associated key within PHP Multidimensional Array
That’s a array which has two positions and each position of that array contain two more array, then it has to be two for, this solves your problem: <?php $array = [ [['total_arrematado' => 27,…
-
1
votes1
answer92
viewsA: Add values of two inputs within an array?
The this.setState when invoked does not change the value of the component variables and shows, you have to update every component for this to occur, but in the second parameter can be written a…
-
0
votes1
answer23
viewsA: I can’t insert a Dropdown box in C# . Net Core, is there a type conversion error?
The error happens because the wrong type is being sent to View, make that statement new SelectList and pass the properties as required and upon being sent to your View the type is already correct to…
-
1
votes1
answer68
viewsA: How to paginate an Laravel 7 array?
In the documentation of Laravel, yet Paginator as mentioned in your question, in case the edition was specified LengthAwarePaginator, then create an instance following the whole namespace which is…
-
1
votes1
answer43
viewsA: Doubt about while loop on C?
It’s a silly mistake in scanf was placed a line break (\n) and don’t need giving this problem: #include <stdio.h> #include <stdlib.h> void main(){ int num = 1, maior = 0, menor =…
-
4
votes1
answer110
viewsA: Conditional structure (if Else) javascript
You need to take the amount within the function, because, the way it is doing only the first time the page loads the value is changed and then no more, actually also lacked specify the property…
-
0
votes1
answer153
viewsA: How to get the array value at the moment of clicking with Vue JS
How you need to get the index of this list (that most of the time is not the best option, the correct is that each line has its own natural identifier), in the v-for also write the in the code you…
-
0
votes2
answers56
viewsA: How to insert a List<> into a Listview C#?
How to insert items into a component Listview of Windows Forms? In his method ListViewData.Items.Add accepts an instance of the class Listviewitem which shall be loaded with the information…
-
0
votes1
answer52
viewsA: Deserialize JSON with null Safety in C#
You have the settings to ignore values null as described in documentation: Example: var options = new JsonSerializerOptions { IgnoreNullValues = true, WriteIndented = true }; jsonString =…
-
0
votes1
answer55
viewsA: API items do not appear in the Table
With the amount of doubts I decided to exemplify how your code should be, was created a fake of JSON and at the time of creation of the loaded component, then in the method render() the data…
-
0
votes1
answer106
viewsA: Laravel - Doubt about @foreach?
There is, the @continue @foreach($listaProdutos as $key => $listaProduto) @if(...) @continue @endif @endforeach References: Blade Templates - Loops How to break a foreach loop in English view?…
-
1
votes1
answer220
viewsA: Mysql LIKE condition in PHP PDO
It is a classic error when starting with PDO, in your SQL make these changes in the location where you have LIKE: "SELECT po.post_id, po.*, cat.*, (SELECT COUNT(*) FROM post_galeria WHERE…
-
1
votes1
answer29
viewsA: How do Textinput print number 1 every time you press Buttom?
You have a problem with your code React-Hooks in your code, you cannot start the same state was with component (see my example). Basically, the code is to concatenate the existing values with a text…
-
1
votes1
answer50
viewsA: JSX element does not load using this.state.list.map
At no time in your code is the last state of the variables created in the question being stored. Relevant points: this setState is the method responsible for changing the state of some variable or…
-
0
votes1
answer39
viewsA: Catch the lowest and highest value of a category with the count and ID
The first column has been set aside as stated in your comment that can be ignored, so to have the same question result, you have to work with Subconsultation to have the Id of Valor Minor and…
-
0
votes1
answer401
viewsA: onChange on React not working!
When to change an object contained in the state of a component in React I particularly like to separate the assignments so as not to have the problem of confusing what is to be changed, and the…
-
0
votes1
answer268
viewsA: Problems using React Context
Your code is totally wrong, because when you create a React.Context means that you want several components to share the same state, functions, etc. To make this work, you create a Context and a…
-
1
votes1
answer35
viewsA: How to serialize Object for yaml in . NET?
There are packages that can solve your problem: Yamldotnet.Netcore Base Class: public class ExampleObject { public int Id { get; set; } public string Name { get; set; } } public class Example {…
-
4
votes1
answer48
viewsA: How to remove a word from a string and all the other subsequent ones?
With regex (I don’t particularly like it) works with this essential modification which is to remove the double quotes that surrounds your test, because there it tests a text the way it is written…
-
0
votes2
answers49
viewsA: Query to return minimum amount of "different" values
Yes, with the command Union, even creating the query Builder without compiling the sql, example: $a = Cliente::where('status', 'novo')->take(20); $b = Cliente::where('status',…
-
2
votes1
answer197
viewsA: Component is rendered again whenever some input state is changed
Use with component and function memo that prevents such reengineering: const Email = React.memo(({value, setValue}) => { return ( <div> <div style={{height: 20}}>{value}</div>…
-
0
votes1
answer855
viewsA: How to use props in Styled-Components?
Is using the Styled-Components wrong way, don’t need to pass inside the props value just pass the value that this property already exists, example: import styled from 'styled-components'; export…
-
1
votes1
answer42
viewsA: Javascript string?
The fatherly way is to read each position of that string and check the match, example: var test = 'a'; var texto = "stackoverflow pt-brasil"; var busca = 0; for(let i = 0; i < texto.length; i++)…
-
2
votes1
answer119
viewsA: How to make each element of a number array multiply each of its digits within a substring?
A path not worrying about validations and this is a minimal example: var numero = '102181952'; var tamanho = 3; var listaNumeros = []; for (var i = 0; i < numero.length; i += tamanho) { let s =…
javascriptanswered novic 35,673 -
0
votes2
answers631
viewsA: React js - Update a Parent component list/array through the Child component state
The code is so confused and the idea is very simple to implement that it is better for me to develop a minimal example than to tidy up your own, when working with states like this where components…
-
1
votes1
answer524
viewsA: Integrating Google Maps with React JS
That way there are some problems one of them is that the component is not loaded yet and with that the variables also not, do the normal way of the javascript is very problematic, should follow as…
-
2
votes2
answers362
viewsA: useState does not work as expected
The component state updates are not as simple as they seem, they are asynchronous, in short it takes a while to happen and the variables with the new states need to be monitored to make some…
-
1
votes1
answer62
viewsA: How to construct an array with 2 subtotals to insert the data into a graph in Reactjs
A long way to solve this problem is as follows: create a array with the day without repetition create a array with the company without repetition with these two information make the interaction of…
-
0
votes2
answers241
viewsA: I cannot change font size in C# (Property or indexer 'Font.Size' cannot be Assigned to -- it is read only)
This property is read-only as stated in the error itself: Property or indexer 'Font.Size' cannot be assigned to -- it is read only if you want to change the font size of the form it has to be by the…
-
3
votes1
answer205
viewsA: Two error connection in the Entity Framework class constructor?
In the injection of addiction, there is a conflict, he cannot decide which is the DbContextOptions which is to instantiate, an easy way to solve this is to type the DbContextOptions<> so that…
-
1
votes1
answer166
viewsA: Is it possible to disrupt an object inside another object?
By characteristic every object in javascript has chave and valor and in the example quoted in your question the format is invalid. The valid format is: const c = {teste1:{teste2:{teste3:1}}} and its…
-
0
votes1
answer32
viewsA: With regard to React
You have to give a studied how it works React, the way to change screens, variables, etc. Really before entering the world React give a studied in html, javascript and css at least the basic not to…
-
1
votes1
answer63
viewsA: Just open the clicked modal?
Was used in this example the React Bootstrap to display Modal, so what I do has a variable to control when the modal will be displayed (variable show) and I also have another variable to load the…
-
0
votes1
answer198
views -
1
votes2
answers41
viewsA: Object map does not return all data
Way to rescue only the videos is to interact in each position and key copy your videos and transfer to one array example: const global = [ { "id": 1, "slug": "futebol", "name": "Futebol", "videos":…
-
0
votes1
answer74
viewsA: If ternary in jsx is not working
The problem is that the state is not global, and therefore its Auth.getAuth() will always return false, that is, as you import this code into the component it will get its initial state, there is a…
-
-1
votes1
answer188
viewsA: How to convert a string to a direct number from the prompt?
With parseInt (parses a string argument and returns an integer in the specified base) to convert the value and isNaN (determines whether the value is Nan or not) to check whether the parse happened…
-
0
votes1
answer65
viewsA: The page keeps updating even using preventDefault() in javascript
The event is in the wrong place, the event submit is from the form (</form>), then, look for the form that in the example case I put a class todo-form (<form class="todo-form">), to add…
javascriptanswered novic 35,673 -
1
votes3
answers732
viewsA: Compute sum and subtraction in Javascript
Basically failed to pass in the function the type of operation and at the time of the method call pass what operation you want to do, example: function somaSubtracao(num1, num2, operacao) { if…
javascriptanswered novic 35,673 -
0
votes1
answer180
viewsA: Browse map array with tsx
To use within an interaction method (map) several components need to work or with a <div> or with <React.Fragment> in the example below the excerpt from the very basic code that proves…
-
0
votes1
answer41
viewsA: Why can’t I trigger a function in a <div/> daughter tag in React?
Here there is no way to install the package Unform, but, from what I noticed that you do not know how to work with forms and buttons contained in <form>. The button of the type submit will…
-
0
votes1
answer155
viewsA: How to create multiple React components dynamically using Hooks?
Proposing a example of creation of component as follows: will enter the value inside the box and by clicking the button Create several boxes will be created. This example is as simple as possible,…
-
1
votes2
answers1463
viewsA: create dynamic select with Reactjs + Hooks
I understand your difficulty is how to make the relationship between the two <select> and I decided to develop a minimum example, showing the dynamics when choosing the unit Ederativa load the…
-
1
votes1
answer54
viewsA: CSS does not access HTML subclasses in React
The question is whether you’re going over the props correctly to the component Banner?, with all this I decided to exemplify so the component Banner has the following code: function…