Posts by novic • 35,673 points
1,265 posts
-
0
votes2
answers224
viewsA: My state react, doesn’t it work?
Really you are starting, the state of the component as it was created will not work, it is isolated to only one location and in it can have several states in the case so exemplify: state =…
-
1
votes2
answers249
viewsA: Input component is not changing the state value
How did you use the template typescript for coding and on the component TextInput used in your project has defined types that is Readonly<TextInputProps> that in the particular case can be…
-
0
votes2
answers365
viewsA: How to check for spaces before, in the middle and at the end of a string using Regex in C#?
Basically in his regex enter what is required (numbers and letters) ^[a-zA-Z0-9]*$, example: using System; using System.Text.RegularExpressions; public class Program { public static void Main() {…
-
0
votes1
answer193
viewsA: Convert json object to php array?
You are sending wrong information to the backend and so do not have the expected result, the correct is the following: var dados = `post_id=${post_id}&pergunta=${pergunta}`; why, you chose to…
-
0
votes1
answer73
viewsA: Laravel Create composite key for pivot table?
You need to create a rule for this table with the command: php > php artisan make:rule TestRule after giving this command the code is created in: app\Rules, open the file and start your encoding:…
-
0
votes1
answer66
viewsA: Display the input id data?
There are several problems in your code, but I will propose a usual and correct example: Route::get('exibeInformacaoDenuncia/{id}', 'AdminDenunciaController\InformacoesController@exibe')…
-
3
votes2
answers184
viewsA: Change image src with javascript
It seems that it remains to study a little more, in the comparison has to be at least 2 equal for loose test (only tests the value) or 3 equal when you want to test type and value (which is…
-
2
votes1
answer116
viewsA: First value in a map function in javascript
From what I can understand, if you want to print the first item in one way and the others in another way an example of a very simple code is: function App() { const [tarefas, setTarefas] =…
-
1
votes1
answer43
viewsA: Div in React is not appearing
I can see that you are passing the value on props in case it should be within the component (children) as follows: const DropWrapper = () => { return ( <Div> { col.map((col, index) =>…
-
0
votes2
answers116
viewsA: Generate Log by day date C#
Basically in the file name put as follows: @"\Debug\log" + DateTime.Now.ToString("ddMMyyyy") + ".txt" the formatting specified in your question. Final example: private void Log(string mensagem) {…
-
1
votes3
answers1189
viewsA: How to structure React Js folders and files?
React Js is the foundation of components, right? Yes, according to the website itself: Component Based - Create encapsulated components that manage your own state and then combine them to create…
-
0
votes1
answer61
viewsA: Is it possible to have more than one "post" route in a controller. NET?
When the template the default methods are created get, put, post and delete with their delegates specific programming. To add a new method post it is necessary to create a method that differs from…
-
2
votes1
answer63
viewsA: Yup Mixed does not work notRequired or nullable
That expression will always come falso if it contains no selected file, then, I believe a very basic logic would be to test if the file does not exist, returns true, if it exists return the other…
-
2
votes1
answer51
viewsA: I cannot bring json information to html
The problem is because every interaction of the objects contained in this array there is another object named after pokemon And I think I’m confused about that, but you always need to look at the…
-
0
votes2
answers91
viewsA: Problems traversing Javascript object
Your JSON is an object where each key of this object also represents another object, quite different than interacting on one array of objects that with the map is easy, but how to solve this problem…
-
0
votes2
answers48
viewsA: How to recover data from localstore?
To redeem the item from localStorage use the method getaway and how a text has been saved and this represents an object as demonstrated in your question needs to be converted again to an object with…
javascriptanswered novic 35,673 -
0
votes2
answers47
viewsA: When I use the <Link> it from this route error, what can it be?
In your example code, there is no <Link>, I think you’re putting the <Link> outside the <BrowserRouter> and this is not allowed, as it is in the documentation and the documentation…
-
0
votes1
answer80
viewsA: Logic problem - React does not calculate
Several problems encountered in your code, typos that generated in debug of javascript: Uncaught Typeerror: this. Setstate is not a Function At Caixaeletronico.calculate (:62:22) At Object.Vh…
-
0
votes1
answer85
viewsA: Pass state between components without hierarchy
This is a way to program a link between components where they share the same data and when the button increments or decreases the action is clicked to program the state variable count in those with…
-
0
votes1
answer209
viewsA: Return of onPress within Components
Their function pass names are all wrong, there’s no way to work anyway and in fact they’re not working at all, because if the name is wrong logically it shouldn’t work at all, pay attention, when…
-
0
votes1
answer128
viewsA: React-JS -useState, useEffect
Basically with React Hooks: import React, { useState, useEffect } from 'react'; import Api from '../../services/api.jsx' import './style.css' function Main() { const [products, setProducts] =…
-
0
votes1
answer19
viewsA: Compare the number of rows of a list in a Viewbag
Do it like this: var lista = _supplierAdvertImageRepository .GetSupplierAdvertImage(obj.SupplierAdvertID, obj.SupplierID); ViewBag.Imagens = lista; ViewBag.Quantidade = lista.Count(); In the View…
-
1
votes2
answers1867
viewsA: Create an algorithm, in JS, to list all primes smaller than or equal to N
Concept: To identify a prime number we must divide it successively by prime numbers such as: 2, 3, 5. . . and check whether the division is exact (where the rest is zero) or not exact (where the…
-
1
votes2
answers92
viewsA: Does pushing inside a for loop not increment a declared Let in its scope?
The reason is because you didn’t put the increment (l++) and therefore of loop infinite, basic example: var numeros = [4, 5, 6]; var n = []; for (let l = 0; l < numeros.length;l++) {…
-
0
votes1
answer25
viewsA: How to exchange the value of Select - Materil UI
Basically, a minimal example: import React, { useState } from "react"; import { Select } from "@material-ui/core"; import MenuItem from "@material-ui/core/MenuItem"; function App() { const [value,…
-
1
votes1
answer29
viewsA: Difficulty catching a json element with php
Missed typing one of the keys to the arrays that is data and the final solution: echo $data["data"]["charges"][0]["code"];
-
0
votes1
answer240
viewsA: Add attribute to a json
To pass an object with more attributes, just copy the data with the technique Spread Operator as in the example: const data = { 'id': 1, 'name': 'example 1' } const finalData = { ... data, source:…
-
1
votes2
answers96
viewsA: How to call a method not defined in the abstract class, but in the class that inherits it
The name of the class construction method is missing a s that is construct, but, the correct thing is you implement the method hello within the class B because it is she who implements the…
-
0
votes1
answer70
viewsA: Status of the array not updated with Sort
I decided to make a minimum example of sorting by field value, where your order starts from the smallest to the largest and when pressing the button changes from the largest to the smallest value:…
-
2
votes3
answers199
viewsA: Compare values of two arrays and generate a third with the unique javascript values
Utilize filter with includes, where this filter will be satisfactory only when it has contained the tested value, example: var todos = [08072020105842, 08072020110953, 8072020104528]; var fechado =…
javascriptanswered novic 35,673 -
0
votes1
answer295
viewsA: How to change a state of a Component in React navigation
When using the React-navigation and need to handle related operations should use in your documentation the guide Navigation Events, at these events can be written update solutions as you are asking…
-
0
votes1
answer34
viewsA: Fill inputs by pasting only one
I think that solves your problem, he takes the line break and mounts a array with 4 positions and add the values in the others </textarea>, paste text and focus to the other element:…
-
1
votes1
answer22
viewsA: How to get the parameters of a closure in php
To get the parameters of an anonymous function can be done with Reflectionfunction, example: <?php $fs = function($val, $val2){ return $val + $val2; }; $reflection = new ReflectionFunction($fs);…
-
1
votes2
answers38
viewsA: How to add an iframe via JS?
The code snippet document.getElementsByClassName brings a array of information to work with your code need to indicate position, in this example I know you have a position so [0] and after…
-
0
votes1
answer162
viewsA: How to edit the CSS of an image Link made by <a>
Wouldn’t it be putting a a img and configure, follows example that when you do not have in this configuration the image comes normal, example: a img { border-radius: 50%; } <a> <img…
-
2
votes3
answers1423
viewsA: useState does not update - Reactjs
The state variable needs to be monitored to have its changes and this is easily solved with the use of useEffect with a Paramento of array containing its variable to be monitored, a simple example:…
-
0
votes2
answers59
viewsA: Can you take out the word "null" and just type on the screen "word not found" ? (using match)
Just make sure res within a decision structure, example: if (res) document.write(res + "</br>"); Complete code: function carrega() { var texto = document.getElementById("txt").innerHTML; var…
-
0
votes1
answer280
viewsA: How can I separate a button and a text field into components - React JS
I believe there are better ways to do it, the way you did it is wrong because the state this.state.message is not part of the Component <Botao />, a minimum change to lower or upper case…
-
2
votes2
answers2446
viewsA: Error code Parsing error: Unexpected token, expected ","?
In the resolution of a javascript with the return for a variable need not use {} as shown in the minimum example below: function Item(props) { const aleatorio = parseInt (Math.random () * props.max…
-
2
votes1
answer109
viewsA: C# Function convert string to xml
Basically, another needs to be created XmlDocument and create the attributes of that previous for children of the new: var MihaString = "<MeuXML Info01=\"teste 0121245\" Info02=\"2020-01-14\"…
-
1
votes2
answers165
viewsA: "setState" problem using React
From the comments, I understood that your doubt is to remove an item from a list, if yes, the example below can facilitate your understanding, example: function App() { const [tarefas, setTarefas] =…
-
0
votes1
answer1015
viewsA: How to read specific information from a JSON file in Reactjs?
Is used in its code a map who has a callBack passing through each element of the array, but, you only want the position 0 of array through his commentary, example: <>…
-
1
votes1
answer87
viewsA: More than one array value for Where Eloquent
Directly as it is in the code will not work, have to have a logic, a way to analyze the parameters, example in the code below has been analyzed if the data comes in a array simple and the other if…
-
0
votes1
answer279
viewsA: Return total documents from a Mongodb Collection?
The Package driver created for Mongodb only offers a method to count the amount of documents from a collection with the return type long, was thus written and so should be used. Code:…
-
1
votes2
answers256
viewsA: Adding a value to an object array with reduce
That way it would return an object with the sum: var items = [ { name: 'Batata', points: 23, }, { name: 'Pizza', points: 50, }, { name: 'Tacos', points: 60, }, ]; const reducer = (a, b) => {…
-
0
votes1
answer84
viewsA: Mysql key creation error
Basically the solution is this: SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE,…
-
2
votes2
answers199
viewsA: Get JSON return from URL in VB.NET
Install the package by Nuget: Newtonsoft.Json or via Package Manager: PM> Install-Package Newtonsoft.Json and write the following code to convert the text json for object Data Class Date:…
-
4
votes1
answer880
viewsA: Compute Principal Diagonal Sum of a Javascript Matrix (Node)
It seems that lack concept, then: Square matrix is a special type of matrix that has the same number of rows and the same number of columns, and every square matrix has two diagonals: Main Diagonal…
-
2
votes1
answer1301
viewsA: Validating password confirmation in Yup with React
By the method oneOf following the example: validationSchema: Yup.object({ password: Yup.string().required('Password is required'), passwordConfirmation: Yup.string() .oneOf([Yup.ref('password'),…
-
1
votes1
answer489
viewsA: Render Dynamic Input Values - Vuejs
I didn’t get your code, because, you’re going the wrong way, the example below will show you how render items from a simple form with a text box. This minimal example will give you a north that can…