Posts by Cahe • 1,085 points
26 posts
-
1
votes1
answer185
views -
3
votes1
answer136
views -
3
votes1
answer145
viewsA: How can Qdialog lock a Qmainwindow?
If I understand correctly, the behavior you want can be obtained by changing the property WindowModality of his QDialog: dialog.setAviso("Digite um nome.");…
-
3
votes1
answer153
viewsA: Two Forms working on the same resultset
With HTML5: Master form: <form id="search_form" method="post" action=""> <input type="text" name="search_query" /> <input type="submit" /> </form> Supplement to the form…
-
3
votes3
answers540
viewsA: Colo allocate a memory based on the size the user typed
There is a way to do what you want, but the performance of the code is questionable depending on the situation. #include <stdio.h> #include <stdlib.h> #define ALLOCATION_STEP 5 int…
-
0
votes3
answers1501
viewsA: Read objects saved in.dat file
The error is that you are not saving an object of the type DateAddress in the file, but actually a pointer to a DateAddress. Your file .dat is getting something like: A4 FE 22 00 4 bytes…
-
2
votes2
answers2936
viewsA: How to duplicate a div by clicking on another
As explained by Paulo Roberto in this question, you can use the function jQuery.clone. Just navigate the elements correctly: $('.contatoBtMais').click(function(e){ var f = $(this).parent().parent(),…
-
2
votes2
answers156
viewsA: Why do I have to assign the value of the prepare method to a variable and only then instantiate execute? in Pdo
Because $db is an instance of the class PDO and it represents a connection with the database. Already $stmt in turn is an instance of the class PDOStatement, which in simple terms represents a…
-
3
votes2
answers141
viewsA: Error making a Post
When passing data directly to the Eloquent::create you’re making a Mass Assignment, it is considered unsafe by the fact that the user can enter data as he wants in his table. To prevent Laravel from…
-
3
votes6
answers12772
viewsA: How to locate a value in an array with a specific structure
Even if the question is partially resolved, I will leave an example of an alternative implementation of the function array_search where you can "filter" a member of an array by certain values:…
-
1
votes4
answers28026
viewsA: Accent in mysql select displaying question sign " "
Assuming your old DB was also configured with utf8_general_ci, then the error might be in the backup. Check that the backup files were also saved as UTF-8.
-
1
votes2
answers238
viewsA: Return values through a class derived from the same Parent
That way you did it is impossible. When modulos and controllers inherit from system each class follows a different path and the two do not relate. Whether there is a common method that will be used…
-
8
votes2
answers123
viewsA: Handle missing variables in array
$array = array(); if(isset($a)) $array[] = $a; if(isset($b)) $array[] = $b; // . . . In the above way only the variables that exist will be added in the array.…
-
5
votes3
answers238
viewsA: How to stop three loopings for in C
The first answer that came to mind, I’m pretty sure there’s some more sophisticated way to do that. int i, j, k; int stop = 0; for(i = 0; i < 10; ++i) { for(j = 0; j < 10; ++j) { for(k = 0; k…
-
6
votes2
answers331
viewsA: How to order animations with jQuery?
Add a callback to the first animation, then use the second. $(document).ready(function(e) { $('.mini_botao').click(function(){ $(".logo_1").animate({marginTop: '-150px'}, 1000, function() {…
-
1
votes4
answers1237
views -
3
votes1
answer539
viewsA: Function to when clicking on word hide div
Remove page element after fadeOut //fechar box $("#close-link").click(function(){ $('.element').fadeOut(function(){ $(this).remove(); }); });…
-
3
votes3
answers1419
viewsA: Make Backspace when pressing "+" key
I’m not sure if it’s the proper way, but I think it should work: var t = $(this).val(); $(this).val(t.substr(0, t.length-1)); #Edit How you are using Event keypress, just try with: if (unicode ==…
-
3
votes2
answers3501
viewsA: Pass javascript data to a php array
As you have not made it clear which part exactly you were struggling with, I will leave a full example and explain it. First we create the following HTML page. <form id="dataForm"> <select…
-
1
votes2
answers2445
viewsA: Json is not getting the data
There are 2 errors preventing your script from working properly Here on this line: data: "produto_id="+ $("select[name='nome']").val(), To catch the value of the selected option use the selector…
-
5
votes4
answers11111
viewsA: Converting float to char array in C/C++
In pure C you just need to use the function sprintf which works in the same way as the printf but instead of sending the output to the console you can save it in a variable. In C #include…
-
3
votes3
answers121
viewsA: Problem with the C
The ideal would be to give a little more study in the language, to avoid posting here every error that the compiler presents.
-
4
votes4
answers1095
viewsA: Why can’t I release memory?
It turns out that when you use the operator delete memory is not actually deleted, it is only marked as "free" for use, the pointer is also not modified, it is your duty to assign NULL pointer to…
-
1
votes4
answers864
viewsA: How to set Background-image with SVG hosted elsewhere
Apparently it is not working because the remote server from where you are trying to get the image is sending the file with incorrect headers, this causes the browser to ignore the improper image.…
-
13
votes9
answers37388
viewsA: What should I use in CSS, id, or class?
Classes are used to distribute properties on multiple page objects, since 1 class can be used by infinite objects and each object can have infinite classes. Already the ID is a more reserved…
-
2
votes2
answers342
viewsA: Function to generate INI from Array
Apparently PHP does not have a native function for this, you have to create your own function. Take a look at the first answer to this international OS question:…