Posts by Laércio Lopes • 4,352 points
169 posts
-
0
votes3
answers267
viewsA: Create a Bath file that performs the DIR of a folder or sets of folders that the user chooses
Your code is correct, just skip the line before the command dir and of pause. Thus remaining: @echo off set /p pasta=digite uma pasta: dir %pasta%>>c:\conteudo2.txt if exist %pasta% goto…
-
2
votes1
answer261
viewsQ: Contact form with textarea next to inputs
I want to put the contact form with the inputs on the left and the textarea on the right side as in the image below, I can do the expected result with the float:left but so my layout ends up…
-
1
votes1
answer302
viewsQ: Save current date -X days in a variable
I have a folder that every day thousands of log files are saved and when you need to search a file by date and time is a sacrifice. I have to do a routine to save the current files in a folder named…
-
0
votes1
answer2306
viewsA: Script to check running process and finish or not
The command wmic process where name="monitor.exe" | find "monitor.exe" /c returns the amount of file processes monitor.exe running. In order to be able to check the amount of processes running we…
-
2
votes1
answer47
viewsA: Select 5 thousand rows from a table
Simply group the result by the names of the municipalities using the group by. Try with this query: SELECT nome, AVG(cota_fpm) FROM economia GROUP BY nome;…
selectanswered Laércio Lopes 4,352 -
0
votes1
answer160
viewsQ: Problem with full Outer Join filtering with Where
Friends, I have a database with the following tables: guys id | nome 1 | Duplo 2 | Triplo availability data | tipo | ocupado | manutencao | referencia 01/03/2018 | 1 | 1 | 0 | 54684 01/03/2018 | 1 |…
-
0
votes1
answer28
viewsQ: Check codes that are not in the database with a query
I know I can check codes that are in one table and are not in another with the following query: SELECT cod FROM tabela1 WHERE cod NOT IN (SELECT cod FROM tabela2) But how can I check the records…
-
1
votes1
answer2811
viewsA: Upload an entire folder via FTP using DOS
Using the command ftp native to Windows it is only possible to send files, if the folder you want to send contains sub-folders, these folders will not be sent. To copy multiple files from a single…
-
1
votes2
answers168
viewsA: Grouping invoices in php mysql delay
To select all columns when the student only has an invoice with the status 'a_winning' it is necessary to use the function group by combined with having. Follows query: SELECT id, id_aluno, valor,…
-
4
votes1
answer269
viewsA: Error inserting data into PHP PDO database
Explaining: As the error message already says, the problem is that you are not specifying the column names in the Insert. To make the Insert in a table without specifying the columns, you must place…
-
1
votes2
answers1385
viewsA: Edit inside a modal
If the data that the user will edit is already being displayed in the table can use this code example below: $('body').on("click", ".edit", function() {…
-
2
votes1
answer356
viewsA: Batch file to create another batch file
Yes, just put the controls after the echo and use the symbol > to specify the name of the file you want to create. You can specify any extension, the content will always be written in plain text.…
-
0
votes1
answer94
viewsA: ajax counter and save in bank
You can place your page that will receive the requests from ajax for whenever it is required to update in the database the value for one more and print the updated value. The SQL command would be…
ajaxanswered Laércio Lopes 4,352 -
1
votes1
answer1194
viewsA: How to know if the scrollbar is active and its size?
Know if you have scroll To find out if the window has scroll compare document height to window size. View this code and change the height of the div to see who identifies when you have scroll: let…
-
0
votes3
answers41
viewsA: Count sql results in table with or without values
What you can do is unite the results of categories that have no active ads with the category count that has active ads with this query: select subcategoria.nome, coalesce(count(anuncios.id)) as…
-
3
votes1
answer558
viewsA: Clear only one row of a batch file
Really erase has no way. What can be done is give command cls and reprint on screen without the second line. Example: @echo off echo 1 echo 2 echo 3 pause rem Apaga tudo que foi impresso. cls echo 1…
-
3
votes1
answer1234
viewsA: Calculate two times in a batch variable
The code you are using is this: @echo off rem Inicio do procedimento. set STARTTIME=%TIME% rem Coloque o procedimento que deseja medir o tempo. pause rem Fim do procedimento. set ENDTIME=%TIME% set…
-
1
votes1
answer172
viewsA: Determine an amount of time to respond to something in Batch
Yes, it’s possible to do that. Create a file with the following commands: @echo off rem Programado o desligamento em 2 minutos (120 segundos) shutdown -s -t 120 rem Esperando entrada do usuário, se…
-
2
votes2
answers81
viewsA: How to check dates in Javascript?
A good way to do this is to create new date objects with the values of the Start Date and End Date fields, the key used for this is new Date(). Once done the check is quite simple, just check if one…
javascriptanswered Laércio Lopes 4,352 -
3
votes1
answer85
viewsA: Display link icon only according to screen size
The best practice to modify the style depending on the screen size is by media queries. This CSS hides the text and displays only the icon when the page width is less than or equal to 768 pixels, as…
cssanswered Laércio Lopes 4,352 -
1
votes1
answer42
viewsA: Fastest way to use CSS
A CSS file with just these instructions below weighs 75 bytes: .testando1, .testando2, .testando3, .testando4, .testando5 {display: none;} Another file with these weighs 138 bytes:…
cssanswered Laércio Lopes 4,352 -
3
votes3
answers451
viewsQ: Insert character at last cursor position inside input
I have the following code: $('#mais').click(function(){ $('#console').val($('#console').val() +"+"); }); $('#menos').click(function(){ $('#console').val($('#console').val() +"-"); }); <script…
-
2
votes2
answers1901
viewsA: Textarea increase according to text
I believe what you want is to do without just associating an element as it is within the function by taking the element by id. You can use the this and change the function as below: function…
-
2
votes1
answer456
viewsA: Return quantity of SQL grouped items
To count the records it is necessary to use the aggregation function count(). Look at this query: SELECT `setor`.`set_setor` as age_status_texto, `prospect_agendamento`.`age_status`,…
sqlanswered Laércio Lopes 4,352 -
0
votes2
answers2849
viewsA: Remove all White Spaces from Textarea
This code causes two spaces to be replaced by one and the line break is removed allowing the user to use only one space to separate the text. $(function () { $('#texto').on('input', function () {…
-
4
votes2
answers1593
viewsQ: How to insert sequence in non-automated field
I need to insert records in a table with data from another continuing the sequence of a column that already exists in it, but the column I want to continue the sequence is not auto-incremented and…
-
3
votes1
answer69
viewsA: How to select columns in which years are equal in Oracle?
You have to extract the year from the date field with the function Extract, can use this query: SELECT EXTRACT(year FROM dt_nascimento) as ano, count(*) as quantidade FROM clientes GROUP by…
-
1
votes3
answers1292
viewsA: How can I manipulate CSS from parent element to clicked element?
You can do what you want, you need to select the parent item with the function parent() when you click on the child elements: //para pegar o click nos filhos da div $('.tel, .email,…
-
6
votes2
answers1104
viewsA: Problem with group by
To use the group by it is necessary to use an aggregation function such as count, max, min, sum... If you want to obtain the last date of admission, exit and dispensation grouped by the ID, you can…
-
0
votes2
answers229
viewsA: As per Javascript Variable within an html value?
With the selection of tag input with the value "aff". Just add the following statement: $('input[value="aff"]').val(ArmazenaEmails[c]); Thus remaining: console.log(ArmazenaIds);…
-
9
votes4
answers9155
viewsA: Change the background of input filled in by Chrome autocomplete
You can change the CSS of the fields that are filled automatically with the following code: /* Cor de fundo do autocomplete */ input:-webkit-autofill { -webkit-box-shadow: 0 0 0 30px white inset; }…
cssanswered Laércio Lopes 4,352 -
4
votes2
answers103
viewsA: Simplify value comparison on an input
A good way to make that comparison is with array but since you don’t want to believe that the second option is by regular expression. function valida(){ campo = $("#nome");…
-
1
votes2
answers153
viewsA: Hide everything but the clicked element
I edited your code because as you want a different operation than the bootstrap offers it is better to remove the attributes data-toggle, data-parent and href of the links. Follow an example of your…
jqueryanswered Laércio Lopes 4,352 -
4
votes3
answers394
viewsA: Is it possible to remove the option all files in the file explorer?
Using HTML only Is not possible. This is because file search window in tag input file is from the Operating System. The attribute accept reports to the Operating System the type or types of files…
htmlanswered Laércio Lopes 4,352 -
2
votes1
answer1222
viewsA: How to enable/disable windows 7 devices through a . bat or other file type?
You can disable and enable devices with Devmanview per command line. To disable a device you can do with the following command: devmanview.exe /disable "Nome do Dispositivo" To enable:…
-
3
votes2
answers1323
viewsQ: Get CSS by Javascript
Is there any way to get the list at all CSS applied to an element by Javascript? Example: Let’s say I have the following element HTML: <div id="mega">Content</div> I also have the CSS:…
-
4
votes1
answer135
viewsQ: Tour Virtual 360 - Google Maps
I’ve done some map integrations with the Google Maps API for Javascript in some customers, I checked that the types of maps conform to the basic map documentation are those below: roadmap- Displays…
-
1
votes1
answer580
viewsA: Deleting records marked with checkbox
This code sends by ajax the id’s that you want to delete: View comments function coletaDados() { var ids = document.getElementsByClassName('editar'); coletaIDs(ids); } function coletaIDs(dados) {…
-
1
votes1
answer716
viewsA: How to use a Javascript variable in a php page via ajax
In my view it makes no sense for you to redirect to the same page that is sending the data via ajax. If it were so just make a basic form with the following code: <form action="carrinho.php"…
-
0
votes2
answers128
viewsA: Code for javascript to display div only in one screen size x, Ex: pc
I tested this code and it worked in identifying whether I was accessing from a desktop or not: function eDesktop() { if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera…
javascriptanswered Laércio Lopes 4,352 -
5
votes2
answers3041
viewsQ: Include task in Windows task scheduler via batch
I do the configuration of several types of backups per batch, the codes are not pertinent to this question, but what it takes is always configure them by the Windows Task Scheduler. There are some…
-
3
votes2
answers1391
viewsA: Check if the program is running on Windows
I answered that question when I had the tag cmd. This code checks if the Notepad is open, if it is running the command chcp 65001: @echo off set programa=notepad.exe tasklist /FI "IMAGENAME eq…
javaanswered Laércio Lopes 4,352 -
2
votes1
answer34
viewsQ: Comparison being repeated gradually in different records
In my code below I have a table that shows some data and a button to edit. When I click the edit button once it works normally, open the modal with the input's completed and the Javascript…
-
0
votes2
answers1048
viewsA: How to add delay to Display:block
Cannot add transition to events: display and visibility. The explanation is: Both visibility: Hidden; and display: None; do not respond to Event handlers, while opacity allows handlers to be called.…
-
1
votes1
answer789
viewsA: Javascript/Jquery/HTML Mobile Button
With the library jQuery UI you can by any element as draggable, is better for a div because so you don’t need to prevent the default button action. $(".move").draggable(); .move { display:…
-
1
votes1
answer1377
viewsQ: Selecting row information in an HTML table
I have the following code: var clicado = null; $('.clicado').click(function(){ clicado = $(this).val(); $('#mostrarId').html(clicado); }); <script…
-
3
votes3
answers1863
viewsQ: Get original image dimension with Javascript
I have an image uploaded to my HTML page inside tag <img>, there is some way to know size of her original archive by Javascript? Let’s say I want to give one console.log(larguraImagem,…
-
1
votes2
answers258
viewsA: Create interactive grid with CSS
There is a way to do this without needing to Javascript. In this example below replace the images small by miniature and large by the big image. To div large images is adjusted to 500x375 pixels, so…
-
1
votes2
answers427
viewsA: Difficulty creating summation column in mysql
First you have to put the calculation you want to be done in the query (a.vl_comis - a.desc_comis) as total_valor_bruto with the function sum which is to sum up all the results and put the group by…
-
2
votes1
answer294
viewsA: Error Code: 1054. Unkowm column
Unable to use the alias in the clause where, instead make your query like this: select suasColunas from suaTabela where (Valor - (select Visibilidade)) <= 500…