Posts by Carlos Andrade • 727 points
46 posts
-
0
votes1
answer37
viewsQ: How to check if all objects are present?
Is there a method in ruby that checks whether all objects are present? It would be something to avoid the following use: if @stretch_source.present? && stretch_target.present? Or would this…
-
0
votes0
answers98
viewsQ: No return with shell_exec in PHP
Recently the need arose to take advantage of some functions of a program with pascal language compiled with "fpc" in PHP, the same runs perfectly by the terminal in Debian, the program is very…
phpasked Carlos Andrade 727 -
1
votes1
answer989
viewsQ: How to call an inherited form precedent through the standard form?
In my application made in Delphi 7, is created some Runtime objects in the standard form, as buttons manipulate record, procedures and common functions. There is one standard form of queries,…
delphiasked Carlos Andrade 727 -
0
votes1
answer181
viewsA: How to store the returned field value with the "Insert" command in a variable?
I decided to publish the same question on Stack Overflow version in English because it is very urgent in a solution. I got an answer and I decided to post here in case I can help someone in the…
-
1
votes1
answer611
viewsA: Restore Minimized Application (Login)
In the "Bordericons" property of the login form, just leave marked as "True" the parameters "biSystemMenu" and "biMinimize". Still in the login form declare the following Procedure: ... private {…
delphianswered Carlos Andrade 727 -
0
votes1
answer181
viewsQ: How to store the returned field value with the "Insert" command in a variable?
I have a Procedure that performs the "Inserts" and "updates" in the tables. The need to create it was to try to centralize all check functions before entering or updating records. Today the need…
-
3
votes1
answer565
viewsA: Display BLOB text
You can change the function of obtaining the data to ibase_fetch_assoc. It already has a parameter that causes it to show the data of the "Blobs" fields instead of the Ids. For this you must inform…
-
0
votes1
answer573
viewsQ: "gen_id()" or "select max()" for Auto Increment in a PK field?
Currently I use a Trigger with this SQL code to get an Auto Increment to be assigned in the primary key field (PK) of the tables: create or alter trigger TRI_CLIENTES_BI for CLIENTES active before…
-
2
votes2
answers142
viewsQ: How to delete a certain line of code warning?
How to correctly suppress warnings generated by PHP in a given line of code? I tried using "@", but still the warning is generated in the log. Excerpt from the code that is generating the Warning:…
phpasked Carlos Andrade 727 -
1
votes1
answer40
viewsQ: How to reference the object property created with `with Tedit.Create(Self)`?
How to reference the property of a purpose created with with TEdit.Create(Self), and the use of this will be used in another object that is also being created as with TSpeedButton.Create(Self)?…
-
1
votes1
answer212
viewsA: PHP/Mysql Select total balance of 1 client in the table
Use the "sum" function to sum values of a given field: $sql = mysql_query("SELECT sum(saldo) FROM clientes WHERE ID = 1"); Edit: If the "ID" field contains a primary key (PK), you should search by…
-
-3
votes3
answers810
viewsA: Avoid multiple PHP Notice: Undefined index: inside a loop for
I might as well suggest you to disable PHP warning messages in your script in this way: ini_set('display_errors', FALSE); But it would not be very convenient, because the most appropriate thing is…
-
0
votes1
answer297
viewsA: Open email client with attachment file
The "mailto" protocol does not offer this feature, mainly because it is local and may vary from device to device. The "Javascript" level is also not possible because of security issues and inability…
-
0
votes4
answers17451
viewsA: How to check Postgresql logs?
No, the Postgresql log will only record exceptions and warnings. If you are referring to changes in the table structure, it will be more difficult unless you create a log in your own application. If…
-
0
votes1
answer197
viewsQ: Accent code page in Command Prompt
When updating my system application, a command line is called to execute a script to update the database. The script calls the tool Isql of Firebird sending as parameter the file that contains the…
-
2
votes3
answers76
viewsA: How to do sub-consultation with Pdo
There are N ways to select two or more tables, I will cite two examples: Example 1: $ranking = $pdo->query("SELECT ue.id, ue.nome, u.banido FROM usuarios_emblemas ue, usuarios u where…
-
0
votes2
answers200
viewsA: url friendlies category subcategory
If you only have a Search Script in the tables, remove the previous rules and leave only this: RewriteRule ^produtos/categoria/(.*)/subcategoria/(.*)$…
htaccessanswered Carlos Andrade 727 -
1
votes2
answers343
viewsA: Dynamic url with php
Add this rule: RewriteRule ^produtos/(.*)$ /categorias.php?id_categoria=$1 [NC,L] And to make the call, the url would be: produtos/categoria Edited: In your case it would be: RewriteRule…
htaccessanswered Carlos Andrade 727 -
3
votes2
answers1350
viewsA: Add seconds to time - Excel
All you have to do is divide the number of seconds you want to add by the total number of seconds that corresponds to a day, which is 86400 seconds (24 hours * 60 minutes * 60 seconds). You’ll get a…
excelanswered Carlos Andrade 727 -
0
votes3
answers6545
viewsA: Run script written in Python in windows (No python installed)
One solution would be for you to distribute along with the executable, some files needed for the execution of the Script on Windows. You can get these files by downloading the embedded package…
-
1
votes1
answer706
viewsA: "include" in javascript or something similar to reduce code size
The code in question you can write in PHP and then include the Script in others who will use the functions. Example: funcoes.php <?php var valorComSoma = 0; $('#boxCom .valor-rep').each(function…
-
1
votes4
answers45
viewsA: How to pass a text from the database to display it as a link on a website
You must use the tag <a> and assign the value of $row_artigos[3] to the attribute href. Example: echo '<a href="'.$link.'">'.$row_artigos[3].'</a>'; Edited: $link =…
-
4
votes1
answer6123
viewsA: Add link to image by *.CSS file
In CSS there is no property that can manipulate the element’s image file img. If that’s really the need I suggest you trade for the element div and specify the image in CSS Example: CSS: #div_img {…
-
1
votes2
answers170
viewsA: Are there limits to the use of logical operators in the Mysql query?
You can add as many operators as needed in your query, there are no limits, and you can improve conditions by isolating each one by placing them in parentheses. Your example: $sql = "SELECT * FROM…
-
2
votes2
answers627
viewsA: criticise error when CEP is invalid (via CEP )
There may be other, more simplified methods, but in this way it also works. Just convert to String the return of the error that is in JSON and do the check: if (JSON.stringify({erro: true}) ==…
-
1
votes1
answer44
viewsA: Upload Profile Image not saved
As I mentioned in the comment above, the variable $pasta is only receiving the directory and not the file name. Change your code to the following and see if it works: $tmpName =…
phpanswered Carlos Andrade 727 -
1
votes2
answers940
viewsA: Change command prompt properties in c
From what I understand, you will have to change these properties in the Windows registry. For each property there is a DWORD value. Be very careful when changing these values, some invalid data may…
-
0
votes3
answers122
viewsA: file_get_content in part specifies the content of the sitemap
This will only work if the content of sitemap is really in the structure of your example. But if it is different you will have to adapt the code. <?php $sitemap =…
phpanswered Carlos Andrade 727 -
0
votes3
answers4627
viewsA: How to return empty record from a Select?
Trying here, I remembered the UNION I’ve used in some cases. I made an adaptation in Select and ended up working, but still I consider the answer of @Sidon the most appropriate, I only decided to…
-
1
votes3
answers4627
viewsQ: How to return empty record from a Select?
I’m creating a system in PHP and in it has a Script which selects the data of the module requested by the user. The Script creates the form to view and edit the data according to the information of…
-
1
votes0
answers48
viewsQ: Run Debian program compiled on Ubuntu with Lazarus
When I compile any source developed on Lazarus on Ubuntu, it normally runs on Lazarus, but on Debian with the command ./Programa, gives the following error: "Segmentation failure". The program can…
-
0
votes2
answers3834
viewsA: Change Text Color in Jquery
Set a class in your "div" so it looks like this: <div class="div_result" id="add9" align="middle">HIGH</div> Function to scan all class Divs and change text color: function…
-
1
votes2
answers107
viewsA: Javascript stops working and only returns with empty cache?
The browser cache is precisely to optimize a web application, taking advantage of the content of the page so that it is not necessary to reload some resources every time the page is updated. What I…
javascriptanswered Carlos Andrade 727 -
1
votes3
answers655
viewsA: How to manipulate part of the href attribute of a link using Javascript in Wordpress?
If use jquery follows the code: newlink = $(".azul").attr("href").replace("#",""); $(".azul").attr("href",newlink);
-
-1
votes1
answer963
viewsQ: What is the best connection method between PHP and Firebird?
I use the functions ibase_ to connect and manipulate data on Firebird with the PHP. I saw that many people also use pdo_firebird. The version of Firebird that I use is 2.5. After all, I am using the…
-
2
votes3
answers76
viewsA: Is there any difference in performance depending on what you seek?
The performance of the search result will depend on the amount of records it will return. For example, if you just want records that have the word amor and if there are 1000 records that start with…
-
0
votes1
answer296
viewsA: php and email sending ajax
See that regardless of the value that mail return, the result is being true, because of return true; at the end of your code. The documentation of mail informs the following: Returns TRUE if the…
-
0
votes1
answer259
viewsQ: Receive Firebird Exception message in PHP
My script PHP is not receiving the message from exceptions which are generated by Firebird. I have a class that connects to BD, runs sql and disconnects. Debugging the script, I saw that the…
-
1
votes1
answer529
viewsA: Access Denied when entering value in windows registry by Python
Try this way: def inserir1(nome,path): key = OpenKey(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Run', 0, KEY_ALL_ACCESS) key = CreateKey(HKEY_CURRENT_USER, keyVal) SetValueEx(key,…
-
1
votes3
answers596
viewsA: Delphi 7 apps in windows 8
Any version of Indy from 9 will run without the need for DLL distribution on any existing windows version to date. What differs the version of the Indy component is only the features it offers.…
-
1
votes1
answer59
viewsQ: Failed to restart Firebird by PHP
I have a virtual server with Linux-Debian operating system, which is configured as Nginx web server and Firebird database. I have a script that performs a Firebird restart routine and executes it…
-
3
votes1
answer179
viewsA: need to put an extra left Join in this query
I made some modifications to your code and based on this I advise you to review them, the way you use can generate many inconsistencies, such as repeated records and delay in the return of data. The…
-
1
votes1
answer463
viewsA: Assign value to a Select by the text of the option via Webbrowser
I just found out, a little change in the function line to: if (AHTMLElement.item(I, I) as IHTMLOptionElement).text = AValue then I only changed the property "value" to "text" Even so thank you all!…
-
2
votes1
answer463
viewsQ: Assign value to a Select by the text of the option via Webbrowser
I need to set the value of a field Select of a page that is loaded into the Twebbrowser component in Delphi 7. This procedure I can do in other fields where values are equal to the options texts,…
-
-1
votes4
answers127
viewsA: Redirecting in PHP
If you have been using Dreamweaver, it should be saving some extra characters at the beginning of your code. Do the following: Open your php file and go to Save As and uncheck: Include Unicode…
-
3
votes0
answers653
viewsQ: Nignx startup error: ngx_master_520 the Event was not signaled for 5s
I am trying to set up an SSL certificate on my web server that uses Windows 2008 RC2 and Nginx. I always come across an error in the log file and this causes Nginx to not run. The error is: Error in…