Posts by Nelson Teixeira • 1,408 points
50 posts
-
0
votes3
answers173
viewsA: Mysql query return with PHP+Javascript
The problem is that when clicking the button, in addition to the call from $.post also made the form’s Ubmit. In the case as the action is null, it seems to 'fade all'. There are 3 ways to solve…
-
3
votes1
answer35
viewsA: I’m trying to play the values of the "arquivos_b64" array in the textarea but I can’t. In the console.log the values are displayed
The problem is that vc is using an asynchronous function (onloadend). This code at the end: document.getElementById('anxUpload').value = arquivos_b64; is executed immediately as soon as the script…
-
0
votes1
answer245
viewsA: Utopian Tree Exercise, Tree of Life etc. etc
You forgot the Return for case 0. Change to: function alturaArvoreUtopica (ciclos) { var altura = 1; if (ciclos == 0) { altura = 1; return altura; // aqui } else { for (var i=1; i<=ciclos; i++) {…
-
1
votes1
answer564
viewsA: Icons do not appear correctly
According to this answer from Stackoverflow in English: https://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource the problem is that…
-
0
votes2
answers53
viewsA: How to select a specific contact form to format in CSS
put it like this: form#4831.wpcf7-form { position: absolute; width: 250px; top: 165%; left: 65%; text-align: center; background-color: rgba(89, 89, 89, 0.5); background-size: 300px 442.95px; } #…
-
0
votes3
answers555
viewsA: No Return Json to Ajax
Looking at the code quickly I saw something that if it is present in the code that you are running may actually be the cause. It is the last line: echo json_encode($arr);insira o código aqui delete…
-
5
votes2
answers4340
viewsA: Send checkbox with ajax jquery php
Vc can get checkbox values to send by ajax like this: html: <div class="input-group"> <label for="servicos">NECESSITA EMBALAGENS?</label> <div class="checkbox">…
-
2
votes2
answers9106
viewsA: Remove array element in C
Think of how you would do if it were a series of real objects. Imagine 10 coins lined up on the table. You remove one of them and move the others to her place. You don’t start from the beginning of…
-
0
votes2
answers71
viewsA: Tool for working in a group
Look, when I read your question, I found this situation strange. How do you say that you develop web as a team and do not understand a simple process like this ? Even if you didn’t use a versioning…
ftpanswered Nelson Teixeira 1,408 -
1
votes4
answers1133
viewsA: Return a sum in separate rows in mysql
Ready: select (sum(valor) from tabela where operacao = '01') - (sum(valor) from tabela where operacao = '02') saldo I am considering that the operating field is a varchar/string. If it is numeric…
-
5
votes2
answers2809
viewsA: What is Copyright really?
Legally you have all the rights to anything you create. So if you create a software (or a book, or a screen, or whatever) it is automatically protected by law and no one can afford that software for…
-
2
votes1
answer65
viewsA: Generate merge and branch charts in GIT?
I recommend gitk. He’s free and capable of things like this:…
-
0
votes2
answers250
viewsA: Save data to various tables
do so: if (mysql_query("INSERT INTO cad_paciente VALUES (NULL, "$nome_paciente", "$nome_doutor"))) { if(mysql_affected_rows() == 1){ echo "Registro efetuado com sucesso<br />"; } } however,…
-
0
votes3
answers139
viewsA: Best way to write a Javascript function
As far as I know, the best way is to use point notation for normal object use and square notation when we’re going to modify the object programmatically.. In your case therefore the 1st notation is…
-
1
votes3
answers60
viewsA: Does not concatenate the If
various errors. Put the arrow line printing before write and use () after getHours etc.So: var tempo=new Date(); var hora=tempo.getHours(); var min=tempo.getMinutes(); var seg=tempo.getSeconds();…
javascriptanswered Nelson Teixeira 1,408 -
1
votes4
answers1228
viewsA: Alternative to sed with Powershell
Short answer No, the Unix/Linux shell is much more powerful than Windows. Long answer Because of these things recently Microsoft announced that it will put bash as the native Windows shell in future…
-
1
votes4
answers5422
viewsA: I can’t center an ul inside the div
experiment with this css instead of text-align: center: margin: auto;
-
0
votes1
answer78
viewsA: Change email destination by clicking a select option on a form
Just add the change you want in Function function alteraAction(valor) { if (valor == "Segunda Opção") { $('#idFormulario').attr('action', 'novaaction.php'); $('#email').val('[email protected]'); } }…
-
0
votes2
answers343
viewsA: How to use store with Doctrine
That I know only using native query, so: $results = $this->getConnection()->query("SELECT NOME_DA_PROCEDURE()") ->fetchAll();
-
1
votes1
answer121
viewsA: how to use the SUM within an ORDER BY (mysql)
Try it like this: SELECT DISTINCT a.id, a.unidade, a.posicao, a.nome, a.peso, sum(b.qtd) quant FROM produtos a, produtos_pedidos b WHERE a.id = b.id_produto and b.id_pedido IN (13,12,11) GROUP BY…
mysqlanswered Nelson Teixeira 1,408 -
2
votes2
answers124
viewsA: Get more SQL-rated records
try like this: SELECT supermercados.nome, AVG(comentarios.avaliacao) as avaliacao FROM supermercados, comentarios WHERE supermercados.id = comentarios.supermercado group by supermercados.nome ORDER…
-
2
votes3
answers328
viewsA: SQL - Query in a single table with null values
See if that works for you: SELECT Data, Servico FROM controle_equipe WHERE ((Data >= #4/1/2016#) And (Data <= #5/2/2016#)) OR Data Is Null;
-
0
votes1
answer60
viewsA: mouse Hover Javascript
This is an example. Elaborate in more detail from it. var canvas = document.getElementById("diamond"); var context = canvas.getContext("2d"); var diamond = function (x,y){ x = x || 0; y = y || 0;…
-
0
votes2
answers47
viewsA: Count script - Sqlserver
So it works: select count(*) num_chamadas_distintas from ( select distinct numero from telefone ) chamadas_distintas
-
1
votes1
answer1463
viewsA: Fetch parameter from URL
Instead of $_REQUEST use $_GET or $_POST depending on the type of request.
phpanswered Nelson Teixeira 1,408 -
1
votes3
answers9533
viewsA: Remove whitespace between array values
The best way to do this is to use the array_map function. So: function removeEspacos($str) { return str_replace(' ', '', $str); }; $narr = array(); foreach($arr as $a) $narr[] =…
phpanswered Nelson Teixeira 1,408 -
36
votes1
answer8303
viewsA: How to sign a PDF digitally?
Short answer: Get a digital certificate from a certification body (Ex.: SERPRO). You have to pay and renew periodically. Use the certificate primary key in conjunction with the pdf to create a…
-
0
votes2
answers3887
viewsA: How to use a switch inside a switch?
If you go that way, soon this switch will be a book :) Use functions instead of sub-switches. type before main function define: void nomeDoQueFazNoSubSwitch() { <coloque aqui o sub-switch> };…
-
1
votes6
answers1578
viewsA: Is it good practice to use constructors (or magic methods) in interfaces?
In my view imposing this obligation is not necessarily wrong. It depends on the purpose of the interface in question. If you think that all classes that will inherit that interface should be built…
-
2
votes1
answer2339
viewsA: Check if a variable is numeric or string
If you are using GCC you can use typeof. It returns a string with the type of the variable. Ex.: #include <iostream> std::cout << typeof(int&) << '\n'; // int You can also use…
c++answered Nelson Teixeira 1,408 -
3
votes4
answers7995
viewsA: Accentuation is unreadable on the page
I did a test using the goal you passed and the body only with "Test". With UTF-8 it worked and with ISO-8859-1 it failed. Put in a test.html file just the following: <html> <header>…
-
3
votes5
answers444
viewsA: PHP array types and values
The $pessoas->nome indicates that people are an object. Already $pessoas['nome'] indicates an array. You can transform the names present in objects into arrays (as long as they are not static)…
-
2
votes6
answers10949
viewsA: How to measure code performance in PHP?
I made a small class for time measurement. Maybe it will be useful to someone: class TemporizacaoHelper { private $inicio; public function __construct() { $this->inicio = microtime(true); }…
-
1
votes1
answer1253
viewsA: How to call two mysql tables in the same php page?
Just copy this code to the other div, with a mysql_query and a mysql_fetch_array for each one. With mysql_query you got the data for this right ? then.. get the data for each table in the other Ivs…
-
0
votes1
answer97
viewsA: Conexões Clonadas
Usually you use the pg_connect resource for all connections. But you don’t necessarily have to follow this rule. You can create a connection for each "action". I would do different: instead of a…
-
-3
votes5
answers206
viewsA: Problems sending many variables through _GET
First in the client using javascript pass the whole form in json format to PHP and then on the server, first decode the json and then parse the result.
phpanswered Nelson Teixeira 1,408 -
1
votes1
answer170
viewsA: How to change the background image of a Wxdialog?
It doesn’t. This version of wxWidgets you’re using is pretty old. As far as I know, all development is focused on 3.0+ versions. This version 2.8 you are using will no longer receive improvements.…
-
0
votes3
answers677
viewsA: Function with reference passage
Change the code to: if (contEsq > contDir) d* = contDir; else d* = contEsq; and tell me if it worked.
-
7
votes2
answers2312
viewsA: Scan the machine/server using php
Considering that your PHP server is Linux (hardly has PHP installation on Windows), how to get the information you want: IP: $_SERVER['SERVER_ADDR'] Host name: $_SERVER['SERVER_NAME'] Latest boot:…
phpanswered Nelson Teixeira 1,408 -
1
votes3
answers788
viewsA: Get line from a file
The 1st line is easy, just use fgets as you are already using. To get the last line without having to read the whole file use the Reversefile class of this Stackoverflow response here:…
phpanswered Nelson Teixeira 1,408 -
2
votes1
answer294
viewsA: String or Cursor in Oracle PLSQL
No. The cost of creating a cursor for the database is much higher than handling the strings
-
2
votes1
answer627
viewsA: Best IDE Designer GUI
wxWidgets is excellent and quite complete. Vc also has several other component libraries to choose from. A good page to start is this: https://en.wikipedia.org/wiki/List_of_widget_toolkits this…
c++answered Nelson Teixeira 1,408 -
5
votes1
answer828
viewsA: Delete data without refreshing the page
Using the Submit button using HTML will always call whatever is in the action and reload the page. An alternative method is to loop in javascript all input fields (inputs, selects, etc) through some…
-
0
votes2
answers198
viewsA: Semantical Error - Doctrine createQueryBuilder
Do so: $query = $this->doctrine->getManager() ->createQuery('SELECT c.nmComputador, c.teIpComputador, log.data, log.usuario FROM SuaBundleOndeEstaoAsEntidades:log JOIN log.idComputador c');…
-
0
votes3
answers199
viewsA: How to capture the result of an execution of doctrine2?
You can turn on the Doctrine SQL log in the application and check the database to see if the records are there. If the flush has not been made the records will not appear in the bank. If you are…
-
0
votes3
answers523
viewsA: Call post on the page that is shown
The post-single div, has no id or name. It makes me think that you should be using a javascript that locates the div and shows it. Just that, as you are making a loop for all posts on: <?php if (…
-
6
votes1
answer982
viewsA: Save space, SVG, Base64 or regular images?
SVG images are images vector while png, jpg and etc. images are images matricial. An SVG image is nothing more than a text file with an XML describing arcs, positions, gradients, fills, etc. Try…
-
1
votes2
answers1381
viewsA: Capture Variable Image Content
Can do using jquery with ajax like this: var img = App.canvas.toDataURL("image/png"); $.ajax({ type: POST, url: 'urlpagina.php' data: { imagem : img, } }).done(function( res ) { // res conterá a…
-
0
votes1
answer69
viewsA: Validation of javascript fields
Yes, there are many components on the web for this. I use the Masked Input Plugin for jQuery, but there are many others like the jQuery Mask Plugin. Place jQuery Mask on Google that you find…
javascriptanswered Nelson Teixeira 1,408 -
5
votes1
answer574
viewsA: Eclipse erased my entire project
Not directly in Eclipse. To recover you need to give a Undelete in the files. For this immediately turn off your computer, better if you go straight to the button without going to the turn off,…
eclipseanswered Nelson Teixeira 1,408