Posts by jlHertel • 4,733 points
114 posts
-
0
votes1
answer28
viewsA: How to check the state of a Gtk::Radiomenuitem object?
The solution to the problem was to use a wrapper from the sigc++ library itself. The method sigc::bind serves to pass extra arguments and serves exactly for the purpose I was needing. To solve I…
-
0
votes1
answer28
viewsQ: How to check the state of a Gtk::Radiomenuitem object?
I am building a dynamic menu using Gtkmm. The menu is built as follows: Gtk::RadioButtonGroup appRadioGroup; bool groupInitialized = false; Gtk::Menu *driverSubMenu = Gtk::manage(new Gtk::Menu);…
-
12
votes0
answers192
viewsQ: How to write programs that support internationalization using cmake?
I am writing a small software in c++ and I would like to be able to translate it into other languages. Looking quickly over the internet the most accepted tool in linux environments is the GNU…
-
1
votes1
answer81
viewsQ: How can I pass a Descriptor file to another process?
Recently I read a post by Peter Hutterer explaining about a new protocol called inputfd that is intended to pass a file Descriptor directly to other processes without the interaction of the…
-
27
votes1
answer7017
viewsA: What is the POSIX?
What is? POSIX, as the name suggests, is a standard for determining common interfaces between operating systems. POSIX is nothing more than a way to dictate several expected features of an operating…
-
1
votes0
answers84
viewsQ: How to configure Symfony in Windows?
I have an application written in Symfony 3 that I want to publish in a Ubdomain. The application is currently hosted in Ocaweb. My main website is this: example.com The goal is to create a specific…
-
2
votes1
answer785
viewsA: Unlink: No such file or directory
As you can see in this asks in Soen, the problem is that the operating system expects the spaces to be escaped. Another problem I see is the use of non-ASII characters such as ç. To remedy the…
-
3
votes1
answer458
viewsA: identify when the form is sent by the Submit button
When receiving forms on the server it is interesting to always redirect the user at the end of the processing, so that he cannot press the refresh key in the browser. Usually I follow the following…
-
1
votes1
answer82
viewsA: How to check if the user is logged in 1 hour ago or logged in
I’ll assume you know how to make the bank appointment and get the return. Whereas you saved the bank’s return on the variable $retorno: $zonaTemporal = new \DateTimeZone('America/Sao_Paulo');…
-
9
votes1
answer6958
viewsA: What would be a PID?
What would be the PID? The PID means Process IDentification. It is a number that the kernel gives to each process to be able to identify them. It is through PID that we can kill an application for…
-
3
votes1
answer185
viewsA: Help in logic to not overlap a band of schedules already exists at the base
You can check each time using the clause BETWEEN from the database. To correctly handle dates when the start time is lower than the end, we must add a period. Take an example: SELECT COUNT(*) AS qtd…
-
0
votes1
answer393
viewsA: Encoding treatment in XML
It seems to me that the server is always forcing data compression, leaving the data flat only when the client shows no support for it. You can tell the server that it does not support data…
-
4
votes1
answer342
viewsA: PHP error: "Can’t use Function Return value in write context"
You’re making a syntax error. To access arrays you must use [ and not (. Change your code to look like this: public function sumQuantidadesPorProduto() { $quantidades =…
-
2
votes1
answer1364
viewsA: OCI8 in PHP 7.0 with Xampp 32bit
Your problem is related to ABI used in the compilation of the DLL. It is very likely that the DLL provided in the PECL is incorrect. Download the correct DLL for your php version here.…
-
0
votes2
answers96
viewsA: How to check if last item was registered today?
You can refer to today’s date using the command BETWEEN. SELECT * FROM myTable WHERE created_at BETWEEN '2017-03-15 00:00:00' AND '2017-03-15 23:59:59' This will bring back the records that have…
-
8
votes2
answers373
viewsA: What is the purpose of the Model folder of the Inphinit framework?
I would like to know what is the purpose of the Model folder? Normally in web applications we use a form of project organization called MVC. (MOdel-View-Controller) Model Classes related to database…
-
1
votes0
answers156
viewsQ: What is the advantage of passing the parameter type in bindValue?
Observing the reply of this question, I noticed that the user recommends to pass the parameters by the function bindValue, indicating the type of parameter. There is a various types of parameters…
-
1
votes2
answers508
viewsA: load in css and jquery
Your problem is that PHP is still sending the answer to the browser, and for this reason, the page has not finished loading. A more interesting strategy is to open your empty report, show the div…
-
1
votes2
answers62
viewsA: MYSQL: sort by specific Rows within SELECT
You can use a BETWEEN in the smoothly sorted command. A simplified example of how I could do: SELECT * FROM graficos ORDER BY ( IF(`date` BETWEEN '2017-02-20' AND '2017-02-23', 1, 50) ) Note that…
-
1
votes2
answers572
viewsA: mysql with single PDO result
You are calling the function fetchAll within a loop. The function fetchAll will return an array with all results. In your case, you should be returning the following array: $resultado = array(…
-
1
votes3
answers90
viewsA: How to do more than one select in the same query in different BD tables?
Your function is causing an error. After calling the function mysqli_query you can call the function mysqli_error to check if there was any problem. As for your query, I suggest using a more…
-
4
votes5
answers227
viewsA: What are strings started with @inside PHP comments?
As the user @bfavaretto has already responded in the comments, the symbol of @ is used as a directive for documentation software. Let’s see the phpDocumentor. This software will read your code and…
-
3
votes3
answers362
viewsA: how best to create a cookie for the user voting system to vote once
First you should understand what are all possible options you have at your disposal. Cookies It’s the simplest option to use. Your PHP script will set a cookie in the user’s browser with the date…
-
2
votes1
answer55
viewsA: PDO exec returning false
To construct a PDO object you must pass the construction options separated by a comma point in the first argument. In your code you are separating the options by comma. Try to build the object as…
-
1
votes3
answers134
viewsA: Why do libraries use "! function_exists('function')" always when there is a statement of a function?
Usually this type of check serves more to make a polyfill, ie, have a function that does something if it does not exist. A common use I see for these cases is how much support for multi byte. Let’s…
-
2
votes2
answers2210
viewsA: View associative array elements with foreach
You can loop inside each other: $usuarios = array( array("nome"=>"José", "idade"=>32, "profissao"=>"Médico"), array("nome"=>"Rafaela", "idade"=>28, "profissao"=>"Dentista"),…
-
2
votes4
answers135
viewsA: Remove items an array containing only 1 character
You can use the function array_filter. Example of use: $filtrado = array_filter($arr, function($item) { if(strlen($item) <= 1) { return false; } return true; });…
-
3
votes1
answer2168
viewsA: Set DOM paper size PDF
You can use the method set_paper (versions 0.6 or earlier) or the method setPaper (in versions 0.7 or higher) stating the size you want. In class Dompdf\Adapter\CPDF have all the options. I’m…
-
2
votes3
answers205
viewsA: Doubt about HTML input attributes
As user Thiago has already answered, you can use the attributes min and max HTML5. The only problem is that they will not work in older browsers. In these cases it is always interesting to use a…
-
1
votes2
answers576
viewsA: What is Initialization Vector?
As Jeferson has already responded, the Initial Vector serves to initialize your encryption vector. Imagine that you have an algorithm that always manages the sequence 1,2,3,4. In order for it to…
-
3
votes3
answers2181
viewsA: Error "class Domdocument not found" when trying to run Phpunit
Some Linux distributions separate the DOM extension into another package to make the installation cleaner and more organized. I don’t remember the name of the package in Ubuntu, but it’s something…
-
0
votes2
answers135
viewsA: How to sort a select by bringing results of 2 in 2
You can add up the amount of records and use this in a mathematical formula. The only problem with this is that you are limited to the four priorities you have set, but if they are fixed in your…
-
-1
votes2
answers1095
viewsA: How to take values within multiple tags
There are several ways to search for elements in an HTML document. First you should note that your HTML is invalid, because the attribute id should be unique throughout the document. You can use…
-
3
votes2
answers125
viewsQ: Should I use int_least8_t or int_fast8_t?
I am studying the limits of types that c++ 11 brought and I noticed that there are officially several types of integers. In addition to the Joint Declaration int now I can declare: int8_t…
-
3
votes0
answers621
viewsQ: Call to Undefined Function fastcgi_finish_request()
I have a Linux server where php is configured with Nginx + fcgi. The function fastcgi_finish_request works correctly as expected. I have another machine with Windows 10, configured with apache +…
-
2
votes1
answer83
views -
1
votes1
answer983
viewsA: SQLSTATE[42000]: Syntax error or access Violation
As I have answered in your another question your problem is the equality of parameters. Try changing the equality symbol by the command IS NULL. Your consultation would look this way: $consulta =…
-
4
votes3
answers596
viewsA: How to optimize SQL to filter results
Based on Paulo Santos' answer, you can use a single query to verify the value of the parameters. It is also worth remembering that we should not concatenate the variables directly, but rather use…
-
4
votes4
answers1233
viewsA: What is the correct order to use the PHP header and ob_start functions?
The interesting use of ob_start is to store the information that would be sent to the browser in a temporary memory cache. There is no official recommendation on the subject, but I point out that…
-
5
votes3
answers953
viewsA: How do you relate the hash which is also called the python dictionary to the encryption hash function?
The hash is a mathematical algorithm that will take one string and transform into another, so that it is not possible to reverse. The hash is usually used in encryption to save passwords, as you may…
-
2
votes1
answer2373
viewsA: Fatal error: Call to a Member Function getId() on string
Your code is setting twice the category, one as an object and the other as the content of $_POST["categoria_id"]. Try to change your product-altering routine to look like this:…
-
1
votes4
answers1114
viewsA: How to create multiple folders with mkdir
In addition to the answers already cited, if you use composer and the components of Symfony you can use the FileSystem. This component allows you to do these tasks of creating directories, changing…
-
6
votes1
answer138
viewsQ: Why is Offloading for the GPU a good idea?
I follow some forums on the Internet and I realize that recently there has been much talk of holding Offloading tasks for the GPU. Mozilla has implemented a new engine for its browser called Servo.…
-
9
votes1
answer256
viewsQ: What is an unrolling?
In this question I asked about optimization and performance that the compiler performs. Among the highlighted items, users commented that the compiler makes an optimization called loop unwinding or…
-
1
votes2
answers502
views -
2
votes3
answers100
viewsA: Search first name in mysql field before MYSQL space
Like the @rray already answered, you can make a select by formatting the field, but this can take some of the performance. For a more performative solution, I recommend using a clause BETWEEN as…
-
1
votes1
answer1004
viewsA: html contains invalid utf-8 Character(s) MPDF 6.0
The content of your PDF is in an incorrect character encoding. The function utf8_encode makes a conversion of charset from your php to UTF-8. Obviously this will break from server to server, because…
-
2
votes2
answers1510
viewsA: file_get_contents(): Content-type not specified assuming application/x-www-form-urlencoded
The problem with your code is that you are adding an extra parameter to the array instead of concatenating. Change this code: $options = array('http' => array( 'method' => "POST", 'header'…
-
4
votes4
answers1354
viewsA: XML returned by web service with encoding error
You are already receiving the data incorrectly and therefore it will be virtually impossible detect the coding that information is coming in. My recommendation is that you check the routine that is…
-
2
votes2
answers136
viewsQ: How does -O3 optimization break some programs?
When compiling my own programs, I have the freedom to change some flags compiler and start using optimization -O3. This optimization manages to break some programs. I understand that the compiler…