Posts by Vinicius Gabriel • 567 points
33 posts
-
0
votes1
answer57
viewsQ: Is there any Pattern related to the typing or not of values in the return of JSON in API’s?
I wonder if there is any problem involved in passing the values of the keys in JSON all as string or if there is any justification to always keep the original types of data? My question is based on…
-
0
votes1
answer174
viewsQ: Format conversion 0001-01-01T00:00:00Z from time field. Time
I’m using the ORM Gorm for a project, and in the columns referring to the dates, according to documentation, it is necessary to set the type team. Time in Structs fields that abstract dates. The…
-
0
votes1
answer64
viewsA: Software Modeling
In a way it may seem "hardcore" the idea of inserting 7 columns as boolean, but analysing the other possibilities as for example use only a column string or some numerical type to "decode" the…
-
1
votes1
answer47
viewsQ: Start process with custom name via command line
There is a process in my application that today whenever it runs keeps the name of the function as the name of the process in background. However to perform some mapping, I wanted to customize the…
-
0
votes1
answer118
viewsQ: Return of JSON column from the bank in Golang
I am creating a function to return the data of a query that involves SELECT, however there is a column that stores a JSON, and in return comes a number structure, someone could explain to me what…
-
1
votes1
answer222
viewsA: Merge JSON Postgresql column data when performing UPDATE
I ended up finding the solution to my problem. To merge any JSON key that is after the 1st level o operador de concatenação '||' does not serve, it can merge only keys in the first level, after that…
-
1
votes1
answer222
viewsQ: Merge JSON Postgresql column data when performing UPDATE
The scenario is as follows, I have a JSONB type column in my database where a JSON structure is saved. What I need is that when this structure is updated, it will update only the keys that have been…
-
1
votes1
answer439
viewsA: How to post in XML in Reacjs
Welcome to the Sopt! Well, considering your problem, I understand that you are working with an API that expects to receive the format x-www-form-urlencoded, however your request with Axios is always…
-
0
votes3
answers362
viewsA: How to insert a new key associated with a new value at the end of a PHP Multidimensional Array
So, in the case that exemplified the 'X' issue is the fact that in the value array there is no fixed name for the new key that will be added to your initial array. That would be a solution: foreach…
-
1
votes1
answer229
viewsA: How to calculate the product of multiplication of the elements of an array of numbers?
Welcome to the Sopt! Well, considering the level of the question you presented, I believe you should be learning the bond for correct? I will leave here a solution that I believe is more in line…
javaanswered Vinicius Gabriel 567 -
0
votes1
answer1102
viewsQ: Calling a Controller X function via a Controller Y (Codeigniter)
Hello! Well, I’ve got the following question on my head. Today I have a routine in CRON that runs a certain function of a Controller X of my application. However, I would like the user to perform…
-
1
votes1
answer60
viewsQ: Code pattern for function calling
I don’t quite remember where, but I think it was in some discussion on a topic here in the same OS, referring to that in the statement of if, or any other function of the language itself must be…
-
0
votes2
answers243
viewsA: Aggregation of Codeigniter objects 3
You can enter the following structure within the Ticket class constructor: public function __construct($paramsSolicitante) { if (isset($paramsSolicitante)) { $solicitante =…
-
0
votes1
answer117
viewsA: Problem when requesting API using Xmlhttprequest
Try to insert this header after what you have already entered before submitting the request: xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
-
1
votes1
answer249
viewsQ: Track AJAX requests in progress
I am working on a page where I have an update button, when clicking on it runs a series of AJAX requests to complete the data available on the screen (4 requests to be more exact). Should the user…
-
1
votes3
answers933
viewsA: Treat error return in codeigniter
For handling bank errors you can create a new class CI core with Ci_model extends and create a function to generate an object with the return of success and/or error. Example of the function in the…
-
1
votes2
answers37
viewsA: Do one or more searches in the database with php
You can concatenate several LIKE or any other checks with AND or other logical mysql operators. For example: SELECT * FROM principal WHERE ip LIKE '%".$buscar."%' AND nome LIKE 'nome' AND setor LIKE…
-
0
votes1
answer726
viewsA: Handling request message in Ajax HTTP Status Code
You can use the function fail request via AJAX, in your case at jQuery. It would look something like this: $.ajax(settings).done(function (response) { console.log(response); _RecurrentPaymentId =…
-
2
votes3
answers76
viewsA: How an array comes from the database in an input
You can use the foreach, in your case I understood that you would be showing the value in your correct input? The structure of the foreach is foreach($array as $linha){ } It will perform an…
-
2
votes1
answer779
viewsA: Result split with decimal place without rounding php
You can use any of the following functions below: floor(($numero*100))/100; intval(($numero*100))/100;
-
0
votes2
answers1222
viewsA: How to get out of git listing?
Hello! CTRL+Z It can solve your problem. This command suspends the processes in question, to end them you can just type q
gitanswered Vinicius Gabriel 567 -
0
votes2
answers42
viewsA: Element Superior to Input
In case your DIV as mentioned is only the you can get the following code to get to it (considering that the class I will use reference does not change):…
-
0
votes1
answer2728
viewsQ: Determine recursive Python derivative calculus
I need to create an algorithm so that it determines in N times the derivative of a X function. However I still have some problems to implement recursive functions, I still can’t get a good idea of…
-
0
votes3
answers1163
viewsA: How to separate HTML from PHP
I believe that a first step for you to understand this better would be to study architecture MVC, which is one of the most common software architectures. It will already open up several horizons for…
-
1
votes1
answer34
viewsA: Find div that contains image and add class for CSS recognition
To go through all elements with the class 'skuFiltro', you can use: $('.skuFiltro').each(function(index, element) { var img = element.querySelector("img"); if(img != null){…
-
3
votes2
answers383
viewsA: Subtraction of arrays
It has two viable options, the first, and what I believe to be better and more "clean" is with the map function(): var resultado = A.map(function(element, index) { return element - B[index]; }); The…
-
2
votes1
answer96
viewsQ: Scope of PHP variable
So, I’ve been banging my head for a while now with a basic question of scope, but I couldn’t figure out why. In the function below, I am trying to access a position of the object that is running at…
-
0
votes4
answers79
viewsA: Find names in 2 different tables
From what I understood of your question and taking into account the syntax you have already used, to search all of the 2 tables that have the same value of the variable $name, you can do: select *…
-
1
votes2
answers34
viewsA: Refresh page when deleting
Within the Confirmdelete() function you can insert the following: location.reload(true); The 'true' flag serves to reload the page with the server version, if you leave the true parameter out, it…
-
0
votes1
answer38
viewsA: Take user in query and add variable in email
Apparently there’s nothing wrong with your code. The $existentEmail variable should already have the return of all columns of the table Model_usuarios with the e-mail specified. In the code you are…
-
1
votes1
answer45
viewsA: Alternative to Nusoap Class
Particularly I have always used the native PHP library (which is available for both php5 and php7) for creating SOAP webservices, follow documentation: http://php.net/manual/en/book.soap.php. I…
-
1
votes1
answer117
viewsA: Jquery How to add input values in real time?
You can use jQuery’s keyup() function, to perform an action whenever any number is inserted in an input. Documentation of the keyup: https://api.jquery.com/keyup/.…
-
0
votes2
answers116
viewsA: To disable textarea when select is set to value false
For handling DOM states it is recommended that you use javascript instead of PHP. Since you have placed a jQuery tag, I believe you already know the library, here is an example of how you could…