Posts by Peter • 1,009 points
46 posts
-
1
votes2
answers1034
viewsA: Measure distance from multiple points using Google
Even if solved, here an SQL function that I use to calculate distance between points. NO SQL DETERMINISTIC BEGIN RETURN FLOOR(1000*(6371*2*ASIN(SQRT(POWER(SIN((src_lagps - dest_lagps)*pi()/180/2),2)…
-
0
votes2
answers2523
viewsA: SQL - Merge order table and products
2 options: INNER JOIN LEFT OUTER JOIN With inner join SELECT campo_tabela1,campo_tabela2 FROM TABELA_1 INNER JOIN TABELA_2 ON idx_tabela2 = idx_tabela1 In this case you will get SO results in the…
-
1
votes2
answers552
views -
0
votes1
answer51
viewsA: PHP Warning: imagettftext(): Could not read font
Take a look at the document captchac_config.php, line 44. Has information saying that if Cfontused = 1 (what is the case), the module will randomly choose a "source" in the folder defined in…
-
0
votes1
answer98
viewsA: PHP function to run in Javascript code even if the Distance variable is greater than 0
PHP is a "server-side" language so it runs on the server-side, it creates data (HTML, JS...) and the result is sent in the browser. The browser will show this on the user screen, and will run…
-
0
votes4
answers4316
views -
5
votes2
answers279
viewsA: How does a black box test work?
There are 3 types of tests: Black box White box Gray box Test in black box It means testing only the functionality of the application, IE, see if it does what it should do, without seeing the code.…
-
1
votes2
answers109
viewsA: How can I view BD (Mysql) images(url) in Android Studio
To see on android an image when vc has URL: URL url_img = new URL("http://meu_servido.com/image.jpg"); Bitmap data_bmp = BitmapFactory.decodeStream(url_img.openConnection().getInputStream());…
-
0
votes3
answers260
viewsA: Problem in PHP+Mysql query using LIKE
$tab_consul[0] = "10"; $tab_consul[1] = "8"; $tab_consul[2] = "14"; // Collar tudo junto, com "," entre os dados $string_in = implode(",",$tab_consul); // Uso de IN para ter os valores de…
-
2
votes3
answers2082
viewsA: Documentation at the beginning of a project working alone
I will answer with my example. I’m working on a project with 150 tables and about 2,000 PHP pages. We know, in the area of "quality", that the cost of maintenance and corrections can go up to 100…
-
4
votes3
answers2527
viewsA: How to determine the sort of accented characters in Mysql?
Well, I’m going to ask you a question because from William Nascimento’s answer I found the answer. The problem is not a COLLATE problem but a problem between Mysql and PHP. We know that PHP does not…
-
7
votes3
answers2527
viewsQ: How to determine the sort of accented characters in Mysql?
My table uses "utf8-general-ci" so all accents are OK. But when I have for example Aa, Ac and Áb and I want to filter "in alphabetical order", the result is: Aa Ac Áb About Excel, the result is: Aa…
-
-1
votes5
answers6499
viewsA: Save the binary content of an image in the database
"How do I get the bytecode of an image at upload time to store it in the blob field of the mysql without the need to save the image in ftp?" There are many things in the question. Uploading images…
-
1
votes1
answer230
viewsA: How to recover records that have been updated?
When you have an update, the data is modified then the previous version is lost. From this, everything depends on what you consider as "history". It can be the totality of the data, only part of the…
-
2
votes1
answer444
viewsA: Importing p/ Mysql from TXT
Basic solution // Abrir documento fonte $name_src = "nome_documento.txt"; $h_src = fopen($name_src,"r"); // Leitura linha depois linha até o final while (($str_src = fgets($h_src)) !== false) { //…
-
1
votes2
answers740
viewsA: Call javascript onsubmit does not "hold" the Submit until it gives confirmation of shunning
Basic example. HTML: <a href="delete.php?id=45454" onClick="return confirm_delete('John');"> <img src="../../../images/icones/effacer.png" border="0" alt="Deletar"> </a>…
-
1
votes3
answers1132
viewsA: Delay in loading PHP page with image
Before trying to optimize, need to know what happens. In the case of PHP and Mysql (the other BDD), we have 4 points: treatment time on the BDD side PHP side processing time data transmission time…
-
1
votes1
answer549
viewsA: Refer to number of Mysql returns
Your result is normal. To get the result you expect, you must do it this way: $query_select = "SELECT count(*) as total FROM TAB"; et then read the result this way (after mysqli_fetch_array)…
-
0
votes4
answers1270
viewsA: How to notify Web Api user with Signalr?
It seems that you will have a customer (A) that will connect for example to 14H00. Another client (B) will send a message on the server for example at 15H00. What do you want to do and send…
-
0
votes3
answers1147
viewsA: Upload to another server error
move_upload_file only serves in case of use of an "uploaded file". in your case: 1-check the right of Acceso 2- Use copy() Example (php.net): <?php $file = 'example.txt'; $newfile =…
-
3
votes2
answers2622
viewsA: What to save in a login session?
The problem is that the cookie is in the visitor’s machine and is available easily and anyone can edit it. Imagine my id is "Peter". I’m on your site, with login. I’ll take a look at Cookie and see…
-
1
votes2
answers254
viewsA: How to detect if my site has been visited by a search engine?
If you use $_SERVER['HTTP_USER_AGENT'], it means you want to put a test on each page. Type: $a = $_SERVER['HTTP_USER_AGENT']; if ($a == motor de busca) { // Vamos sair daqui } // se chegamos aqui, e…
-
3
votes1
answer98
viewsA: Change in image density (IPR)
Hmm... classic question... I will try to explain why this is not "directly" possible. DPI stands for DOT PER INCH. This and the density not of the image, but of the "Macine" that will allow to…
-
1
votes2
answers736
viewsA: How to return global variable within a Requesttask class
You are in front of a major problem of Android: the concept of Async. Unlike iOS that authorizes block the user, Android, with the Async system, does not allow. Even if you use a global variable in…
-
0
votes2
answers71
viewsA: Requesting to download the file in the middle of the run
In this case, I think increasing Timeout time is not a good option. If the problem is the INSERT number, instead of making 34,000 you can make one just like this: INSERT INTO example (example_id,…
-
0
votes2
answers178
viewsA: Problem in my notification system
The Android document indicates, about Sharedpreferences "This data will persist Across user Sessions (Even if your application is Killed)". Translation: "This data persists between sessions, even if…
-
1
votes2
answers1252
views -
1
votes1
answer405
viewsA: How to capture errors and exceptions to send to BD with PHP?
Caution: minimum PHP 5.2 <?php // ======================== // Log PHP // ======================== // Chamada quando vai ter Error function call_fatal_handler() { // Déf. $err_file = "nao_sei";…
-
5
votes1
answer267
viewsQ: Change HTTP User Agent
When an Android app sends a post to a web server (like a PHP page), this page receives an HTTP-Useragent type "Apache-Httpclient/UNAVAILABLE (Java 1.4)". I wonder if you have a solution to change…
-
0
votes4
answers3553
viewsA: How to get the next element in a PHP foreach
Using a basic array, there is no difficulty (you need to read the index $x and $x+1). But with an associative array (what I think and the case here) and a bit more complicated. After searching, here…
-
-1
votes1
answer512
viewsA: $_POST returns Undefined index
It works: <form action="go2.php" method="post"> <input type=text name="valor.test.op" value="" /> <input type="submit" value="Login"> </form> And on the PHP side <?php…
-
1
votes3
answers777
viewsA: Sum amount of repeated PHP variables
Instead of putting the result in $everything, the easy option would be to use in a "$everything" table. Here a solution, very basic. // Init quantidade foreach ($items as $item) { $product_id =…
-
0
votes1
answer337
viewsA: INNER JOIN WITH OR CLAUSE
Quick response (you will need to test): SELECT linha._id, linha.numero_onibus, linha.nome, percurso1.nome as the_nome_caso_1, percurso2.nome as the_nome_caso_2 FROM linha LEFT OUTER JOIN percurso as…
-
1
votes1
answer586
viewsA: How to add postgres library to eclipse/android
You’re talking about Posgresql ? About Android, there is not enough space so we do not use Mysql Posg, but sqlite. In case you need to communicate with a web server (with Posgrsql or Mysql). And…
-
1
votes1
answer80
viewsA: Computer clock
Take a look at this: clock_getres, clock_gettime, clock_settime And here: http://man7.org/linux/man-pages/man2/clock_gettime.2.html int clock_getres(clockid_t clk_id, struct timespec *res); The…
-
2
votes2
answers1749
viewsA: Draw a pixel-by-pixel image
I find it difficult to take pixels randomly because you strong chance to forget some. This is what happens in the solution given by jsantos. The solution is to place all pixel coordinates (x, y) in…
-
3
votes2
answers1253
viewsA: How to add a javascript variable in PHP?
It is not possible like this. You need to understand the concept: HTML and JS are language client which means their execution is done on your computer. PHP is a server language, which means the PHP…
-
1
votes2
answers5118
viewsA: Upload android images to Server folder
The manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.androidexample.uploadtoserver" android:versionCode="1"…
-
1
votes1
answer161
viewsA: jQuery File Upload - Angularjs
Point 1: Do an "echo" of the value of $upload['tmp_name'][$index] to see what you have Point 2: Check well that you are recovering value with $_FILE because from PHP5, simply use input name does not…
-
4
votes4
answers23882
viewsA: How to create a permissions control system
I’m working on a site in PHP that has but the least 6500 possibility of access. The principle is a "variation" of an "Assembly Language" concept and we call this Xgen. Each page of the site has a…
-
1
votes3
answers6817
viewsA: Recover Mysql Table
I do not know if it can help, but here the translation of a document that explains how to do: Before you begin, you must stop the WAMP. On your old server (in your external SD/USB key) or stored…
-
0
votes4
answers1270
viewsA: How to notify Web Api user with Signalr?
A server cannot call a client because the Internet is based on a system of small mesangem: connection, transmiçao, cuts connection etc... Then it is the client that will call the server. What you…
-
0
votes3
answers4238
viewsA: How to find the internal IP?
Michel Melo says that his client will have "a machine with a server". In this case, it means that, for example, has a WAMP or a MAMP on the machine. Using this server, locally the client will put…
-
1
votes1
answer204
viewsA: How to make editable template in ASP.Net MVC?
The "template" principle is simply a "search replace" principle. For example, vc makes an HTML document with: <b>Ola senhor XX_NOME_XX, tudo bem?</b> Aqui na cidade de XX_CIDADE_XX, tudo…
asp.net-mvc-5answered Peter 1,009 -
3
votes2
answers2934
viewsA: Search for nearby strains
Using PHP’s GEOIP functions, you may have "but least" an idea of the weight’s position (GPS). In the case of an Android-like app the iPhone and but easy. After that, in your data table with…
-
7
votes3
answers8812
viewsA: How to determine the user’s approximate location by IP?
Take a look here: http://php.net/manual/en/function.geoip-record-by-name.php We use this on our website (www.ansb-brasil.org). If u write using the contact form, when the site thanks you, it…