Posts by novic • 35,673 points
1,265 posts
-
1
votes1
answer116
viewsA: Foreach of a Class properties and display in the View
An example to clarify your doubt: Class public class People { public int Id { get; set; } public string Name { get; set; } } View: @model WebApplication1.Models.People @foreach(var property in…
-
0
votes1
answer230
viewsA: Filter results using 3 tables in Laravel 5.8?
In the method cursos class SiteController must have the following signature: class SiteController extends Controller { public function cursos($id_categoria_curso, $id_atuacao_area) { } } this will…
-
1
votes1
answer103
viewsA: How to assign jQuery value to a textarea
Yes, but, you didn’t put the names correctly Document.getElementById takes the element by the id, example: Html: <button id="btn" /> Javascript: var btn = document.getElementById("btn"); //…
-
1
votes2
answers1094
viewsA: Typeerror: Cannot read Property 'Concat' of Undefined - Typescript?
Since you are using the superset typescript use the type Array (which is the Generic type) as follows, minimal example: class Produto { constructor(public id: number){ } } class Category {…
-
2
votes2
answers528
viewsA: What does the error "Cannot implicitly convert "void" to "int" refer to?
Console.Writeline is to display information on screen in a program Console Application, to pick up values typed on the screen the command is Console.Readline. Your code can be made like this: public…
-
3
votes1
answer57
viewsA: Datediff calculating only time
It’s a date that comes from a database so it should already be in the correct format, so do it: $dt1 = date_create('2019-10-01 15:00'); $dt2 = date_create('2019-10-02 10:00'); and with method diff…
-
2
votes1
answer54
viewsA: Expression generation for EF with dynamic properties
The intention is to pass a code so you know how this works under the table, extracted code - Dynamic Query Expressions With Entity Framework and altered a small part by me to run data nullable,…
-
1
votes1
answer153
viewsA: Laravel, when performing a query per model, how to say that a hasManyThrough relationship must contain these items?
Your choice about the type of relationship through your image of the tables and relationships does not match hasManyThrough, but, as a relationship N:M many for many. I consider a duplicate, but I…
-
1
votes3
answers326
viewsA: Convert date string without punctuation in Date Javascript format
Well, there is also a guy who can format this for you and also check if this really is a valid date with the library Moment.js, example: sdata = '201909091504' var result = moment(sdata,…
-
1
votes1
answer1551
viewsA: Error handling in js Node
Problem: the id recovered is a different type than the method findById understands, in this case this method needs a Objectid (mongoose.Schema.Types.ObjectId) to fetch information from the bank…
-
0
votes2
answers208
viewsA: Value Textarea does not work React
The problem is how you’re doing, unnecessarily variable code with the same name doing different things, to simplify I’ve put together a minimal example: class App extends React.Component {…
-
0
votes1
answer82
viewsA: Variable value in tabs inside a modal - Javascript
From what I can tell you want to fill out the td with some number, follows example: $(function() { $(".btn-lg").click(function() { const id_codigo = 1; $.each($(".modal-body #id_td1"), (index, item)…
-
1
votes2
answers280
viewsA: How to write this query using Eloquent?
Of that SQL: SELECT * FROM `movimentacoes` WHERE nome LIKE '%pattern%' AND grupo_id = id AND (custo_id != 0 OR custo_id IS NULL); To Eloquent Model: return $this->movimentacoes…
-
0
votes1
answer104
views -
2
votes1
answer121
viewsA: How to perform a consultation in the bank applying "exceptions" with a relationship?
You can do it like this: All the Role except for the number 2 bring the relationship of usuários, example $users = Role::where('id', '<>', 2)->users; bringing all users except what has…
-
3
votes1
answer44
viewsA: ASP.NET C# Age passed by the url
When a request is made as shown in your example it is returned in the line: var idadePax = Request.QueryString["idade"]; a given text with values separated by comma, for example: 44,50,80 Then you…
-
1
votes1
answer44
viewsA: How to exchange one image for another depending on the time?
I’m pulling the rss instagram a market profile, but I want the 10:00 from morning until 00:00 (midnight) it displays the photo of the first post, and that from the 00:01 until 9:59 in the morning it…
-
1
votes1
answer31
viewsA: Field Autocomplete Error - Laravel
Needs a layout of return as follows: [{id: 1, name: "texto"}, ... ] then on the return of his method of controller such change in the method select of DB: public function searchService(Request…
-
1
votes1
answer42
viewsA: Assigning a text within JAVASCRIPT methods?
With an example simple, you can add a Different Text, in its code as demonstrated just below: getSW(); function getSW() { $.getJSON("https://swapi.co/api/films/?format=json", function(json) {…
-
4
votes4
answers1946
viewsA: Incorrect Date/Time Formatting Nan/Nan/Nan Nan:Nan:Nan
A very simple solution would be like this, creating an object Date with the command val: var data = eval("/Date(1566322265000)/".replace('/','new ').replace('/','')); //Somente a data…
-
3
votes1
answer263
viewsA: Warning message in Javascript does not work
You were using the String template of wrong way the correct to concatenate is within the string put the dollar between brackets and the variable, example: a soma dos valores é : ${s} var n1 =…
javascriptanswered novic 35,673 -
0
votes2
answers47
viewsA: Is it possible to manipulate an ID in the CSS via another ID?
I made an initial configuration for an element <p> where it will cover the entire area of the page and when hovering the mouse on the image the element <p> will change the color and thus…
-
0
votes1
answer482
viewsA: Laravel - How to override the validation message?
Analyzing the code and what the Larable us provides to validate data with customized classes What you’ve done is just the way it is, it works that way, of course there’s a way around can add…
-
0
votes1
answer119
viewsA: How to make an auto sum function in javascript
From the comments I understood that you want to add values and bring to another input I decided to explain with a minimal example: function change() { let v1 =…
-
1
votes1
answer435
viewsA: I close the connection, and can no longer connect Nodejs Mysql
Your code is in the wrong stream, because it works like this, if any error has not results and if you have results has not error need to put a if to make this decision, following his example: try {…
-
0
votes2
answers2021
viewsA: Sum with dates and strtotime in PHP
The right thing would be: <?php $d1 = "2019-09-23 12:30:00"; // Data e hora que o atendimento começou $d2 = "+ 1 hours"; // Tempo esperado para finalizar o atendimento $teste = strtotime($d1 .…
-
2
votes1
answer1811
viewsA: How to use React-Native-web?
There is a way before success for a running solution, has an example of how it would be a minimal example to run and to work a manual installation must be created. 1) Install packages for operation:…
react-nativeanswered novic 35,673 -
0
votes1
answer123
viewsA: Jsonproperty(Propertyname) does not recognize and assign values to the object
The ClientPart is a array (a list), so your type model is wrong, should be as in the example below: public class Representante { [JsonPropertyName("sellerCode")] public int SellerCode { get; set; }…
-
1
votes3
answers81
viewsA: Array reading
You need to take the amount of list items by property ShippingSevicesArray, example: person.ShippingSevicesArray.length and then use the same code: const person =…
javascriptanswered novic 35,673 -
9
votes2
answers145
viewsA: How to get all interfaces of an object?
A recursive process needs to be implemented to search for the most internal implementations, as in the example below: public static ArrayList<String> SetInterfaces(Class<?>[] interfaces,…
-
0
votes1
answer32
viewsA: How to change Json object?
In your code, it has not been specified which item will be changed in the Qtd and in the exclusion also was not passed the item that should be excluded, example: <input type="button" value="+"…
-
0
votes1
answer21
viewsA: Filter json data in php
It’s simple, use it json_decode and pass in the second parameter true to create a array associative of that json, example: <?php $json = '{ "max_new_quota": 21474836480, "username":…
-
2
votes2
answers2901
viewsA: How to take the value of select
I guess I was just about to solve, when you create a variable area and its method of modification setAddArea (React Hooks) you have already done where the value of the selection will be, and as…
-
2
votes1
answer1073
viewsA: Slim Framework 4 with Eloquent ORM
You need to do some steps like adding connection settings to the file settings.php of the briefcase app as follows: <?php declare(strict_types=1); use DI\ContainerBuilder; use Monolog\Logger;…
-
0
votes2
answers430
viewsA: "Value Below was evaluated just now" - React (Vibrantjs)
You’re accessing it wrong, it would be: paleta.paleta.DarkMuted.hex, because in the map was placed paleta to bring each item and inside is the id and the paleta and the normal continuation as…
-
1
votes1
answer632
viewsA: Radio input check - Javascript
I need to verify which of 3 different Radios is selected for a check. To check if one of input type=radio was selected do the following code: function escolhido() { var res = ''; const items =…
-
1
votes1
answer397
viewsA: Changing text depending on the value returned from the Reactjs table api
You need to resolve this issue as described in the component documentation React-table which is by resolveData as a minimum example shown below: const columns = [ { Header: 'Name', accessor: 'name'…
-
1
votes1
answer1619
viewsA: How to read an XML file with PHP?
No need to put source what is returned is all that is within that root, example: <?php $link = "https://api.vulpi.com.br/media/feeds/linkedin.xml"; $xml = simplexml_load_file($link); foreach($xml…
-
2
votes2
answers55
viewsA: Javascript does not change the <div>
You have several problems with your code, for example, with document.getElementById is rescued the input and its value must be indicated in the function (input.value), the test consequently does not…
-
2
votes1
answer33
viewsA: Pass the value of a key when creating or after creating the array
A minimal example of how to create this solution using map instead of reducer: const animais = { "types": [{ "objid": 100196, "animal": "dog", "type": "adult", "tags": "AA 96 87" }, { "objid":…
-
0
votes2
answers93
viewsA: How to implement two Request to validate individual and legal fields?
In itself RequestFormif you can create the decision you want and you don’t need to create two for validation one with one if inside you can have the same effect, example: <?php namespace…
-
0
votes1
answer502
viewsA: REACT ERROR == EXTERNAL API PAGINATION
I will suggest a minimum example so that you can adapt to your code in a very simple and objective way, which only brings the pagination data when requested. const PokemonCard = (props) => {…
-
1
votes1
answer39
viewsA: Newtonsoft catch part of JSON
That kind of information is in the format JSON to extract the information with the package that is attached to your question you need to have a set of classes, following the example below: public…
-
2
votes1
answer210
views -
1
votes2
answers69
viewsA: What is the difference between these two statements?
The first is declaration of type var ponto1: Ponto, I mean, you’re just saying that the variable ponto1 is the type Ponto and there is no one instance, but the other var ponto2 = Ponto(x: 1, y: -1)…
-
5
votes4
answers99
viewsA: Simplify value localization in arrays in PHP
Could use array_filter to filter information and in_array to search if there is a similar code, example: <?php $records = [ ["id"=>"1", "name"=>"Alpha"], ["id"=>"2", "name"=>"Bravo"],…
-
1
votes1
answer26
viewsA: dropdow list MVC, with selected item
Actually you are already doing this because you are passing the third parameter just make an adjustment in the View and use DropDownList, example: @Html.DropDownList("RamoAtividadeId", null, null,…
-
3
votes1
answer83
viewsA: Counting amount of results of a Split()
When you make a Split of a text of this format (Sim,Não,Talvez) will return a array simple and immutable with the amount of information generated by this condition and to know the quantity use…
-
1
votes1
answer68
viewsA: Name a given id field inside a @foreach
Utilize $loop->iteration which will make available the position of each item of that foreach, example: @foreach($buildings as $building) <input type="checkbox" id="campo{{ $loop->iteration…
-
4
votes1
answer27
viewsA: Insert numbers before variable
Need to concatenate with the . as follows, ($telefone = '351'.$telefone;), example: $telefone = '351'.$telefone; $query = 'INSERT INTO raddb.Utente (telefone) VALUES (?)'; $stmt = $conn->prepare(…