Posts by D. Watson • 898 points
61 posts
-
-1
votes2
answers55
viewsQ: How to remove an array from within another array by filtering those that have the X value in a specific key in Nodejs?
I’m starting at Node.js and have a little difficulty dealing with array/json, I’m in the learning process yet. Assuming the following array of arrays: Base array that should be filtered: [ { "id":…
-
0
votes1
answer59
viewsQ: How to style child components through parents and components already created by @material-ui
I’m creating a sidebar and I’m using the Drawer from @material-ui and followed the first source-code of this link (https://material-ui.com/pt/components/drawers/): import React from 'react'; import…
-
0
votes1
answer85
viewsQ: How to make a select if repeat integer 1 time for each month in a dynamic date range?
Assuming I have sales that happened in the month of May. I could make the following select: SELECT * FROM Vendas WHERE MONTH(Data_Venda) = 5 Assuming the month of June happened and now I have sales…
-
1
votes3
answers89
viewsQ: How to reference only the first occurrences of an A tag using jQuery?
I have the following HTML: <div class="block_content_inner"> <div class="details_block"> <b>Title:</b> "Titulo do Filme" <b>Genre:</b> <a…
-
0
votes1
answer573
viewsQ: Is there any kind of IFERROR in SQL Server?
Assuming the following script: DECLARE @var1 VARCHAR(100) = 'Stackoverflow'; DECLARE @var2 VARCHAR(100) = '10'; SELECT 1 * @var1; SELECT 1 * @var2; If you execute the first select, we will receive…
-
3
votes1
answer330
viewsQ: Is it possible to delete a repository on Github using Git codes?
I have a repository on Github that’s public and it has 33 commits, but I no longer have access to Github’s email and password (so I can’t delete the repository from Github), but I still have access…
-
0
votes1
answer532
viewsQ: SELECT DISTINCT in JSON column in postgresql
I have a table that has 2 columns, id (int auto_increment) and Resp (json). In this table I have duplicate values in the column Resp, something like that: id | resp…
-
0
votes1
answer302
viewsQ: How to escape quotes from a json key in Postgresql?
I have a function that receives JSON’s, it turns out that it is possible for the user to put as follows: Normal: '[{"nome":"João Carlos"}, {"nome":"Maria Silva"}]' Problem: '[{"nome":"João -…
-
0
votes2
answers745
viewsQ: How to create an attribute for an HTML tag? Something similar to the existing "required"
I have a page with several <input> and some of them are mandatory, these <input> are not in a tag <form>, therefore, I believe that the required cannot work in this situation. I…
-
0
votes1
answer916
viewsQ: When is it valid to use XACT_ABORT() in a script that is already using TRY/CATCH?
Assuming the following code: /* DROP TABLE #Teste; CREATE TABLE #Teste(id INT); INSERT INTO #Teste VALUES(1); CREATE TABLE LogErros(id INT IDENTITY(1,1) PRIMARY KEY, nomeTransaction VARCHAR(100),…
-
2
votes1
answer354
viewsQ: Problem with the basics of creating a sidenav using Materializecss
I’m learning to materializecss and I’m trying to create a sidenav, but I’m having problems, I wonder where, follow the little code: <!DOCTYPE html> <html> <head>…
-
0
votes1
answer425
viewsQ: How to set the time of a "timestamp" to 23:59:59 in postgresql?
I have in a cell that contains only the date, in case 2018-07-11, I need to make a select that will bring this cell so: 2018-07-11 23:59:59, it is possible to do this?…
-
1
votes2
answers828
viewsQ: Doubt when creating table with dates in postgresql
I have the following table structure: I would need to create a 3° table that would look like this: I have the smallest and longest date in one table and in another table I have changes made, I would…
-
2
votes1
answer690
viewsQ: Postgresql autoincrement skips 1 value when Insert is done by a function
I have the following function in Postgresql: CREATE OR REPLACE FUNCTION ve.geraHistorico() RETURNS VOID AS $$ DECLARE i INTEGER := 1; id INTEGER; dataCad TEXT; dataFec TEXT; qtd INTEGER := (SELECT…
-
0
votes2
answers115
viewsQ: Is it possible to change the "href" of the <link rel="stylesheet"> of an iframe or even change the class/style an iframe element?
I need to change the CSS of a iFrame, but researching here, I discovered that it is not so simple as, soon, I saw that the iFrame that I wish to stylize, has a <link rel="stylesheet"…
-
1
votes2
answers145
viewsQ: Problem when calculating percentage using parseFloat and toFixed
I want to do something very simple, but as simple as it is, I’m not getting it. I have an input that receives the cost value, an input that calculates and shows the profit margin in % and an input…
-
0
votes2
answers286
views -
2
votes2
answers234
views -
0
votes1
answer740
viewsQ: How to capture the return of an AJAX that is inside a function?
I have a screen where lists the Marks registered in the system, as soon as the user opens this screen, the list of brands should happen. I already have AJAX done and it was working, but I wanted to…
-
0
votes1
answer134
viewsQ: How to capture the value of a JSON key (from an AJAX) using Jquery?
I have the following AJAX: $("button[name='btn-editar-marca']").on('click', function(){ $.ajax({ type: "GET", url: "../ajax/ajax.marcas.php", data: {"ajax-params": 2, "Id_Marca":…
-
1
votes2
answers50
viewsQ: Select only 1 record per month with an aggravating factor that prevents the use of Group By
I have the following table: I need to bring only the oldest customer sale, regardless of the type of sale, however I need the sale guy to come on select, before I had a similar doubt and helped me…
-
1
votes1
answer78
viewsQ: How to select only 1 record per month with SQL
I have a sales chart and would like to select customers' sales, but if the customer made more than one sale per month, I would like you to bring the oldest just, how could I do that? I don’t have an…
-
15
votes3
answers4552
viewsQ: Use VARCHAR(255) for all fields or choose the best size for each field?
Assuming the following fields (for example): Nome, Rua, Cidade ,UF. The Nome would be the client’s name. There are people with 2 short names or people with 5 or more names, so it is possible to have…
-
0
votes2
answers255
viewsA: Collapse mother close the child Collapse also, but do not open together in bootstrap 4
"I could" do it this way: <li> <a href="#" data-toggle="collapse" data-target="#submenu-3"> <i class="fa fa-lock"></i><span>Segurança<i class="fa fa-angle-down…
-
0
votes2
answers255
viewsQ: Collapse mother close the child Collapse also, but do not open together in bootstrap 4
I have the following menu: When I click on collapse mãe "Security": Opened the collpase mãe and inside it is the collapse filho "Users", let’s click on collapse filho "Users": So far everything is…
-
2
votes3
answers536
viewsQ: How to show quantity of sales per month payment in SQL Server
I’m getting the following result: Mes | QtdPorMes 1 | 124 2 | 102 3 | 84 4 | 32 I’d need it to stay that way: Mes | Boleto | Cartão | Total 1 | 100 | 24 | 124 2 | 82 | 20 | 82 3 | 34 | 50 | 84 4 |…
-
0
votes1
answer472
viewsQ: SELECT TOP that brings all the results, something like TOP all, exists in SQL Server?
During my studies, I tried to sort the records and put those that are NULL in the end, I did it this way: SELECT tbl1.firstname, tbl1.mgrid FROM ( SELECT TOP 100 firstname, mgrid FROM HR.Employees…
-
0
votes1
answer46
viewsQ: Can including files and repeating <html> and <body> tags cause problems?
Assuming I have a file called home.php and he’s got the following codes: <html> <head> <p>Head do home.php</p> </head> <body> <span>Body do…
-
3
votes3
answers61
viewsQ: How to capture background value: url('URL') using jQuery?
I have the following code: <div class="chatUsers" name="chatUsers" id="1"> <div class="chatImageUser" style="background:…
-
1
votes1
answer1736
viewsQ: To update a project from Bootstrap v3 to Bootstrap v4 just change the files?
I have a project that was done using the Bootstrap v3, however I would like to update it to version 4, for this, just change the files or it will be necessary to rewrite again?
-
0
votes1
answer731
viewsQ: How to select a specific HTML tag when there is no id or name and (rarely has a class) using jQuery?
I have the following HTML code: <div class=""> <table> <tbody> <tr>TITULO DO BOX</tr> </tbody> </table> <table class="classeTable"> <tbody>…
-
0
votes1
answer41
viewsA: How to take the value that is loose inside a div and ignore the values that are inside other tags inside the div, using jquery?
Solution: $("#tabela > tr > td").clone().children().remove().end().text().trim(); This link helped me to solve the problem and has an explanation of the use of each function:…
-
0
votes1
answer41
viewsQ: How to take the value that is loose inside a div and ignore the values that are inside other tags inside the div, using jquery?
I have the following HTML: <tr> <td> VALOR PARA SER PEGO <span>Esse valor não é pra ser pego</span> <span>Esse valor também não é pra ser pego</span> </td>…
-
1
votes3
answers538
viewsQ: How to take the value of each TD inside each TR dynamically using jQuery?
I have the following sample HTML: <tr> <td>Futebol</td> <td>Campo</td> </tr> <tr> <td>Volei</td> <td>Quadra</td> </tr>…
-
0
votes2
answers441
viewsQ: How to make an image fit the size of the div by the background-image: url(') using javascript or css.
I have a div which has size 200x300 and one which has 50x100, the 2 div will receive the background-image: url('') which the user informs, but he can put an image with size 1280x720, so the image…
-
1
votes1
answer104
viewsQ: background-color does not work when it is used in "classList.toggle()"
I have the following codes: HTML: <div class="barraLateral" id="barraLateral"> <ul class="menuVertical" id="menuVertical"> <li name="liCat" onclick="darkTheme()"><i class="mdi…
-
1
votes1
answer40
viewsQ: Attribute "display" keeps changing over and over, the idea was to change only 1 time and stop. (fadein and fadeOut with pure JS)
I took this fadein and fadeOut code with pure Javascript on the internet and gave a small adapted, but I have a problem. I have a login card appearing for the user, in case he click on the "CREATE…
javascriptasked D. Watson 898 -
0
votes2
answers353
viewsQ: Change class and item id when receiving event click with pure javascript
I have the following line: <li id="fecharMenu"> <i class="mdi mdi-window-close mdi-24px" id="iconFecharMenu"></i> <a href="#"></a> </li> When the user clicks on…
javascriptasked D. Watson 898 -
2
votes2
answers1544
viewsQ: How to add a line break after a certain amount of characters?
I have a variable that receives a text, I would like to insert a line break in that text after character number 40 in jQuery. That line especially: $(".chat").append('<li class="other"><div…
-
2
votes1
answer197
viewsQ: Difference between connecting tables with WHERE and with INNER JOIN
I was learning SQL and came across the following instructions: SELECT tbl_Livros.Nome_Livro, tbl_Livros.ISBN_Livro, tbl_Autores.Nome_Autor FROM tbl_Livros, tbl_Autores WHERE tbl_Livros.AutorID_Livro…
-
1
votes1
answer1730
viewsQ: How to tab a PHP echo?
I have the following code that generates a code of a insert automatic for me. My system is a kind of generator querys I’m just passing the parameters. I pass the parameters on a page and give the…
-
1
votes1
answer22
viewsQ: How to mount a string with each item of an array that can have 1 value or multiple values?
I got the following array at the moment: array (size=3) 0 => string 'ketchup' (length=7) 1 => string 'mustard' (length=7) 2 => string 'barbecue' (length=8) I’d need to put together a phrase…
-
1
votes1
answer98
viewsQ: You need to double-click the button to add input dynamically with jquery
I have the following script: $(document).ready(function() { var i = 0; $("#add_row").click(function() { if(i <= 5) { $('#addr' + i).html("<div><input type='text' name='cirurgia'…
-
0
votes2
answers1823
viewsQ: Side menu with 100% height does not match the size of the div "content"
I have the following structure at the moment: So far so good, the side menu has height: 100% and is going to the end of the page. In the content, we have 8 inputs that are not enough to reach the…
-
1
votes1
answer802
viewsQ: How to place a div with page content on the side of the vertical menu that came included?
I have the following structure for now: The side menu came by include_once 'menu.php' and the page we’re looking at is home.php. CSS from the menu: .longBarVertical { width: 180px; min-height: 100%;…
-
1
votes1
answer1892
viewsQ: Which bootstrap 4 files should be included in a project?
I downloaded the files from Bootstrap 4 and came the following files: CSS folder: - bootstrap.css - bootstrap.css.map - bootstrap.min - bootstrap.min.css.map - bootstrap-grid -…
twitter-bootstrapasked D. Watson 898 -
2
votes4
answers707
viewsQ: Function . click does not work on buttons that were dynamically generated by the . html function?
I have the following code: var nReqAJAX = nReqAR $.ajax({ type: "POST", url: "../controller/ajax.selectItemRequisicaoPesquisar.php", data: {'numeroRequisicao': nReqAJAX}, dataType: "JSON", success:…
-
0
votes2
answers3475
viewsA: Return last characters from a string in PHP
I made this function to test and is returning me the last 8 elements of a string: $get = $_GET['id']; if(2==2) { echo ultimos8($get); } function ultimos8($value) { $var = $value; $tamanhoVar =…
-
1
votes1
answer75
viewsQ: Is this type of security validation validated? (Varios if verifying if the VALIDATE is true)
The following is correct to validate whether input values are validated? if(!empty($_POST)) { if(filter_input(INPUT_POST, 'hemocomponenteBolsa', FILTER_VALIDATE_INT)) { if(filter_input(INPUT_POST,…
-
1
votes1
answer6582
viewsQ: How to put input and label side by side with bootstrap?
I have the following HTML structure: <div class="col-xs-4"> <div class="form-group"> <label for="vencimentoBolsa">Vencimento:</label> <input type="text"…