Posts by MarceloBoni • 6,385 points
228 posts
-
0
votes1
answer56
viewsQ: How to change the standard typography class in a formcontrollabel - material-ui | React?
I would like to change the default properties of a formControlLabel of body for caption. I tried something like this and it worked: <FormControlLabel value="all" control={<Radio…
-
3
votes1
answer81
viewsQ: Function call <Function>`<Parameter>`
I am currently studying Webcomponents, Polymer, Litelement and so I came across this feature of creating the template using Litelement that I had never seen before:…
-
2
votes1
answer79
viewsA: How to change all values of a JSON array?
There are a few ways to do this, but what I recommend is the use of Array.prototype.forEach()¹ var cookie = [{ "domain": ".nada.com", "flag": true, "expiration": "1595998766" }, { "domain":…
javascriptanswered MarceloBoni 6,385 -
2
votes2
answers107
viewsQ: Use "Array.prototype.filter" to list what you do and what is not part of the condition
Is there any way to make one filter in an array and retrieve what it does and what is not part of the condition? For example the following object: { "data": [ { "item": 1 }, { "item": 2 }, { "item":…
-
2
votes3
answers444
viewsA: Factorial from 0 to 20 using For
I would make some structural and logical changes to your code: #include <stdio.h> int main() { int cc, cf, acc; long fat; // <1> for (cc = 0; cc <= 20; cc++) { fat = 1; // <2>…
-
2
votes1
answer262
viewsQ: Make Google-Hartbar Preview Start From Scratch
I have a chart of google Charts on the system that may come zeroed, in case it comes zeroed I need to start from 0, but I’m not able to configure, I tried to use viewWindow.min but it doesn’t work.…
-
5
votes2
answers470
viewsQ: What are the dangers of accepting a branch merge with Behind commits?
Sometimes when I make one merge request in a project, it appears that there are commits Behind, I understand that, this happens due to the fact that at the time of creating my branch, based on the…
gitasked MarceloBoni 6,385 -
2
votes2
answers44
viewsA: I’m trying to make a little picture slide
That way it works: var cont = 0; var imgs = []; var refrescar = 1; imgs[0] = "https://www.w3schools.com/html/pic_trulli.jpg"; imgs[1] = "https://www.w3schools.com/html/img_chania.jpg"; function…
javascriptanswered MarceloBoni 6,385 -
5
votes1
answer478
viewsQ: How to find out which path is followed by a function in js
Explaining my scenario, using emberjs, and it encapsulates each Component within a Controller that will be encapsulated inside a Router, and still has a scheme of Model, Mixins, Helpers, when there…
javascriptasked MarceloBoni 6,385 -
2
votes0
answers177
viewsQ: Google Barchart, create Bar with 2 Annotations
I own the following structure of a google barchart: google.charts.load('current', { packages: ['corechart', 'bar'] }); google.charts.setOnLoadCallback(drawMultSeries); function drawMultSeries() {…
-
0
votes1
answer312
viewsQ: Working with datepicker on ng-bootstrap
I’m working with this component example: https://stackblitz.com/edit/angular-ytr3qa I need to add three features. The first I believe has to do with class, as in this example, if the day is outside…
-
1
votes2
answers96
viewsA: Insert more than one record into a table
The syntax for inserting more than one record in the google fusion API is another, as can be seen in: https://developers.google.com/fusiontables/docs/v2/sql-reference#insertRow INSERT To insert one…
phpanswered MarceloBoni 6,385 -
0
votes2
answers96
viewsQ: Insert more than one record into a table
Currently, I am following the stages of official source of api. And in the current state of the project, I’m getting table information, changing and entering data, no errors. However, I would like…
phpasked MarceloBoni 6,385 -
0
votes1
answer31
viewsQ: Problem aligning with responsiveness
I would like to align the x button in the upper right corner of the image vide image and example: .teste { overflow: hidden; display: inline-block; margin-bottom: 5px; vertical-align: middle;…
-
6
votes1
answer324
viewsQ: Mounting a query with Laravel
I’m studying the structure of the Laravel from this example already ready => beast. In the project there is the repository userRepository with the following structure: <?php namespace…
-
2
votes1
answer210
viewsQ: Data Recovery Problem in a Portable Application
My table is as follows: ╔════════════════════════╗ ║ USER ║ ╠═══════════╦════════════╣ ║ Id ║ Integer ║ ║ Name ║ String ║ ║ Address ║ String ║ ╚═══════════╩════════════╝ I have some data already…
-
0
votes1
answer578
viewsA: PHP with java script and css
I’d do it somehow: var conversao = { "Temperatura": ["Celsius", "Fahrenheit"], "Peso": ["Quilograma", "Grama"], "Comprimento": ["Quilômetro", "Metro", "Centímetro"] }; var de = ""; var para = "";…
-
0
votes2
answers50
viewsQ: Delete and recreate variables in the same scope of different functions
I am creating logs for any time my system has an unexpected behavior, where it will not necessarily crash my system, for example an improper access using an unknown token or an attempt to Force, my…
phpasked MarceloBoni 6,385 -
0
votes1
answer498
viewsA: Simple query of Mysql
I’ll be taking over the following table: CREATE TABLE `aluno` ( `id_aluno` int(11) NOT NULL, `nome` varchar(250) DEFAULT NULL, `status` int(2) DEFAULT NULL, `documento` varchar(250) DEFAULT NULL,…
-
2
votes1
answer482
viewsA: Sum of days on a date
I believe that’s what you need: // Quando houver uma alteração no valor do input days jQuery('#days').change(function() { // Se o valor do input datepicker estiver vazio, não faz nada…
-
0
votes1
answer1168
viewsA: SQLSTATE[HY093] error: Invalid Parameter number: Parameter was not defined,
Your error is in passing data array: $dados = array( 1 => $c['nome'], 2 => $c['sobrenome'], 3 => $c['email'], 4 => $c['telefone'], 5 => $c['senha'], 6 => $c['data_cadastro'], );…
-
1
votes3
answers139
viewsQ: Get the last "word" of a PATH with different URL formats
I am creating a function that gets the last "word" of a requested url in php, without considering parameters and considering the root as index. Examples: URL http://www.teste.com.br/ EXPECTATION…
phpasked MarceloBoni 6,385 -
0
votes3
answers97
viewsA: Problem trying to get value from an array
Have almost certainty that its biggest problem is in the querystring, you’re passing her, most likely thus: request = function() { $.ajax({ url: "https://requestb.in/1fzmwxx1", type: "POST", data: {…
-
3
votes1
answer125
viewsA: Record communication data of the person
I think it made a big mess in the way you pull the data to insert into the table, can simplify using foreach, see how: $IdPessoa = 1; $IdTipoRamal = 1; $IdTipoTe = 3; $IdTipoCe = 4; $IdTipoEmail =…
phpanswered MarceloBoni 6,385 -
1
votes1
answer1136
viewsQ: Count values if values in two columns of the same row are specified
I have two tables in excel, Suppliers and History: I need to count how many times supplier A made mistake A, supplier A made mistake B... and so on, I thought I’d build something with CONT.SES, but…
excelasked MarceloBoni 6,385 -
2
votes5
answers1513
viewsA: Skip Record within a while
All the answers already satisfy your need, but I also propose a different approach: while($pessoa = mysqli_fetch_object($query)){ if( in_array($pessoa->tipo, array(/* 2,...outros valores que…
-
2
votes1
answer759
viewsA: How to add a value to the current in each row of a mysql table?
When you want to do a sum update (among other operations) of a column in all rows of a table, just reference the column itself in the update without defining a where (this will cause all rows in the…
-
1
votes1
answer81
viewsQ: Strange behaviour of Rand() function
By the definition in documentation echo rand() // Imprime algo completamente aleatório echo rand($min, $max) // Imprime algo em um range entre min e max In a code, inside a loop, I accidentally…
-
0
votes4
answers457
viewsA: 4x4 matrix with 20 elements
Another way (I don’t know if more elegant) to get what you want: contador = 0 def foo(x): global contador if x > 10: contador += 1 return x matriz = [[ foo(int(input())) for i in range(4)] for i…
-
0
votes2
answers110
viewsA: Doubt with loop of repetition
Another possible solution: <?php $num1 = 5; $num2 = 4; for($num2; $num2 > 0; $num2--){ echo $num1; if($num2 != 1) echo " + "; } ideone…
-
5
votes3
answers1214
viewsA: How to style the input type search "clean" icon?
Maybe a solution is just the opposite, disable the icon and use a custom background, see: (function() { document.querySelector(".fundo").onclick = function() { document.querySelector(".fundo").value…
-
3
votes2
answers1693
viewsA: Make PHP show sum and multiplication
Actually, it’s just a syntax error... <?php class Calculadora { # Definindo função soma public function somar($num1, $num2){ $resultado=$num1+$num2; return $resultado; } # Definindo função…
phpanswered MarceloBoni 6,385 -
1
votes2
answers160
viewsA: PHP algorithm 1,2,3,4 = 1 + 2, 2 + 3, 3 + 4
I don’t know if it’s ideal, or if that question has dup, but a way that can make: $Ids = array(1, 2, 3, 4); for($i = 1; $i < count($Ids); $i++) { echo $Ids[($i-1)]." + ".$Ids[($i)]."<br/>";…
-
2
votes2
answers663
viewsA: Random photo with javascript
Its function almost works the way this, the only problem is how it invokes it, the event onload should only be assigned to elements that consume external resources, such as: frames, images, and…
javascriptanswered MarceloBoni 6,385 -
1
votes2
answers1055
viewsA: Convert seconds to timestamp?
Personally I would prefer to work with the function DateTime native to PHP You would have to set the date to 01/01/1970, the rest he would do the conversion... echo…
-
1
votes1
answer505
viewsQ: Problem using json_decode() and json_encode()
I have these string examples I get as urlencoded POST: data%5Bst_cartaodetalhes_recb%5D=TID%3A+000000%0ACart%E3o%3A+0000%2A%2A%2A%2A%2A%2A%2A%2A0000%0AAutoriza%E7%E3o%3A+0%0ABandeira%3A+ Another…
phpasked MarceloBoni 6,385 -
1
votes2
answers562
viewsA: method $.find() in pure javascript
With jquery var elemento = $('.preview').find('img').attr('src'); console.log(elemento); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div…
javascriptanswered MarceloBoni 6,385 -
2
votes1
answer642
viewsA: Make DIV disappear with Javascript
There are several syntax errors in your code, never, ever, under any circumstances, from the same id to more than one element (at least in my head it doesn’t come where it might be useful) as you…
javascriptanswered MarceloBoni 6,385 -
5
votes4
answers196
viewsA: Similar function to indexof() in Javascript
Benchmark of the proposed functions, should more arise, I update. Chrome Version 57.0.2987.133 (64-bit) Firefox Version 51.0 (32-bit) Opera Version 43.0.2442.1144 (64-bit)…
javascriptanswered MarceloBoni 6,385 -
3
votes2
answers99
viewsA: Formula values do not match
Given the following formula for calculating compound interest given an initial value and a monthly investment value: Source: https://money.stackexchange.com/a/26187 It would be something like this:…
-
1
votes2
answers110
viewsQ: PHP logic problem
I have the following structure in PHP: <?php header('Content-Type: application/json; charset=utf-8'); error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_STRICT);…
-
1
votes1
answer856
viewsA: exercise Floating point error
Testing the following code and only by 2.13 for 2.20 #include <stdio.h> int main () { int i; double x; i = 1; x = 0.; printf("exec %1li",i); printf("x = %2.20lf\n",x); while ( x != 1.0 ) {…
-
8
votes2
answers1555
viewsA: Show zero on the left using the Tostring method
0134.ToString("D4"); So somehow it must pass how many elements exist in the integer, if for example its integer is 00134, the first element would not appear, it would be necessary to change D4 to D5…
c#answered MarceloBoni 6,385 -
1
votes1
answer74
viewsA: Doubt about logic, ifs with multiple checks
My opinion. Briefly, that would be enough: if (!"0".equals(estudante1.getOutTotal())){ itens.add(estudante1); } if (!"0".equals(estudante2.getOutTotal())){ itens.add(estudante2); } And if only one…
javaanswered MarceloBoni 6,385 -
0
votes1
answer120
viewsA: Left Join returning only certain fields
It would be something like this: SELECT id_agendamento, hora, nome_medico, nome_paciente FROM tb_agenda AS agenda INNER JOIN tb_agendamento AS agendamento ON agenda.id_agenda = agendamento.id_agenda…
sqlanswered MarceloBoni 6,385 -
1
votes3
answers758
viewsA: How to add a number with a string
I set up a more comprehensive function that accepts type strings gonc4lo1 and make a sum of these numbers in the middle of the word beyond the mao2 function calcular() { var mao1 =…
javascriptanswered MarceloBoni 6,385 -
0
votes1
answer119
viewsQ: Free up server memory space when idle
I have a code sort of with this structure: package main import ( "html/template" "net/http" "log" ) func main() { http.HandleFunc("/",taltal) http.ListenAndServe(":8080",nil) } func check(err…
golangasked MarceloBoni 6,385 -
4
votes6
answers28831
viewsA: How to limit an input of type Number to only 3 characters?
There are several ways to achieve the desired effect. But the ideal is to create a validation in back-endand if the input has somehow been passed with more than 3 characters, return an error. For…
-
1
votes1
answer158
viewsA: Format values from one array into another
To obtain the desired array, given the initial array, one of the first steps would be to do, which in mathematical language we call transposição da matriz Given a matrix A of type m x n, it is…
-
4
votes1
answer329
viewsA: How to leave a <div> with the same operation as a radio button?
In this example I’m using bootstrap just to beautify $(function() { $('div.product-chooser').not('.disabled').find('div.product-chooser-item').find('span').on('click', function() {…