Posts by Bacco • 93,720 points
1,184 posts
-
2
votes2
answers726
viewsA: Disable maximum popup button
Use the option resizable=no: window.open('http://endereco', 'aio_radio_player', 'width=720,height=355,location=no,menubar=no,scrollbars=no,resizable=no,fullscreen=no'); I added a few more parameters…
-
5
votes4
answers1156
views -
4
votes2
answers157
viewsA: How to create a property on an existing object of an http request?
You turned the string into an object. Need to turn into string again before uploading: request(url, function (error, response, body) { let result = JSON.parse(body); result['teste'] = 'teste';…
-
5
votes1
answer520
viewsA: Format csv via php
Your mistake is here, you’re concreting everything into one string: fputcsv($output,array($chamado.";".$nome.";".$telefone.";".$tentativa.";".$dataconvertida)); Correct way: // .--- Array de campos…
-
2
votes2
answers659
viewsA: Digitally sign documents using Citizen Card Digital Mobile Key
The "Frequently Asked Questions" of the website, available at https://www.autenticacao.gov.pt/cmd-faqs mentions this: I can install the Digital Mobile Key authentication mechanism on my web service?…
-
6
votes2
answers2893
viewsA: Change date and date time format in Mysql
First of all, I agree with @Wallace that the ideal is to treat in the application, but as you asked, the answer would be: You can’t change natively But you can change the language of the functions…
-
10
votes5
answers35616
views -
25
votes2
answers9028
viewsA: Insert character in a specific position
PHP already has native function for this: $resultado = substr_replace($original, '.', $posicao, 0); Parameters: String original Characters to be inserted in position Position (positive from the…
-
3
votes1
answer52
viewsA: Value duplication in PHP directory listing
The code is full of redundancies, but I’ll focus on the problem: // Adicione arquivos à lista de arquivos ... // AQUI: // Você adiciona o ítem nos arquivos: if($info['extension'] != ''){…
-
4
votes2
answers349
viewsA: Invert id sequence in a table
I do not believe that reversing the Ids is the best solution, but as it was what you asked, follows: Back up your data if you have any problems with the following steps; check which is the largest…
-
6
votes3
answers4835
viewsA: It is possible to concatenate numbers of type int
For a general solution, see the @Maniero response. If you really need this right, it compensates for a specific function of yours. for int output, see at the end of the answer Generating a string:…
-
7
votes1
answer60
viewsA: An app’s background color ratio x energy efficiency
Depends on screen technology. Screens with background lighting spend more on black, screens with led in the "pixels" spend more on white, but both are irrelevant near other factors. See this image,…
-
3
votes1
answer262
viewsA: Mysql - Clause problem WHERE `column` != NULL [BUG? ]
The NULL is a figure created to represent a value undefined or unknown, therefore it cannot be compared to anything (nor compared to null even). Either it is null, or it is not. To take it…
-
6
votes1
answer430
viewsA: Use missing ids
If you want performance, a very simple way to find free numbers is this: SELECT a.num - 1 AS livre FROM frutas AS a LEFT JOIN frutas AS b ON a.num - 1 = b.num WHERE b.num IS NULL AND a.num > 1…
-
6
votes3
answers81
viewsA: Simultaneous consultation and amendment
You’ve already assumed the right principle: that SELECT does not provide for the desired purpose. It is a very common mistake, including what we see in codes here on the site: to have no change…
-
6
votes1
answer1205
viewsA: "Syntax error, Unexpected 'if' (T_IF)", even without apparent error
Almost every code editor has an option to show spaces and line breaks, if you enable the option in your editor during editing (at least when this type of problem arises), it will probably find these…
-
3
votes1
answer68
viewsA: PHP function in file_get_contents URL
Following the same logic: $ws1 = file_get_contents('http://10.0.0.0:1111/bids/all/'.$obj->auction_id.'/'.$php2); // Barra ---^ // Outra variável ---^ In PHP you use the . to concatenate (join)…
-
6
votes2
answers571
viewsA: Perfect centralization of elements using Transform:Translate <style>
Here are some corrections and simplifications, in "order of appearance": Removed the syntax error from the original question, it had a = remaining in the statements; Added width, height, and removed…
-
7
votes1
answer105
viewsA: Mount an ALTER TABLE script
You can use the CONCAT, generating a query for each table_name: SELECT CONCAT( 'ALTER TABLE ', table_name, ' ALTER COLUMN REV smallint;') AS linha FROM information_schema.columns WHERE table_name…
-
4
votes2
answers466
viewsA: box-shadow pick up the four corners of the image
Complementing the answer of colleague @hugocsl, has a fourth parameter besides Blur, which may be interesting for your case. It says how much the shadow will "advance" before beginning the…
-
7
votes1
answer1124
views -
3
votes2
answers73
viewsA: Result of an online MYSQL search, not column
It is not a complete solution, but it is already a starting point. If I can take a sample of the data in SQL Fiddle, and give more details on the question, I can edit the answer and elaborate better…
-
5
votes2
answers2502
viewsA: Input limiting file type
Just use the accept: <form action="/action_page.php"> <input type="file" name="pic" accept="image/*"> <input type="submit"> </form> To determine the type, you need to know a…
-
2
votes2
answers56
views -
8
votes2
answers1322
viewsA: I understand a parallel run using Fork. How does Fork work?
Note that different from threads, the fork() creates a completely independent process. For OS, they become two executables running in parallel, not two processes of the same executable. The part…
-
3
votes3
answers302
viewsA: Submit form with buttons outside it
Tip: both demos use the excellent debug tool "httpbin" to show the results With JS: A simple solution is to link the action to click() and not to Submit: $("#tres").click(function() {…
-
8
votes2
answers207
viewsA: Does the PHP Datetime class support the creation of dates in the Brazilian format?
YES, SHE SUPPORTS. To format in DD MM AAAA you can use -, . and \t, but not /: $datetime1 = new DateTime('01-04-2018'); // poderia ser 01.04.2018 também $datetime2 = new DateTime('10-04-2018');…
-
4
votes1
answer41
viewsA: I want to show an element after a week using PHP
"After a week" assumes you know of some way when you started counting this week. Literal date Having the desired date, the base code is this: <?php if( date( 'Y-m-d' ) >= '2018-04-20' ) {…
-
5
votes4
answers81
viewsA: Succinct conditional structure with multiple comparisons
If the if continue on things that are not a return false: if (!$a && !$b && !$c) { return true; } ... outros statements ... Alternative to the whole question code, in PHP, if it will…
-
4
votes1
answer261
viewsA: Make a DIV appear only at a certain time
Basically this: <?php $horaatual = time() % 86400; $horade = 18 * 60 * 60; $horaate = 24 * 60 * 60 - 1; // Tirei um pra ficar 23:59:59 if ($horaatual >= $horade and $horaatual <= $horaate)…
-
4
votes2
answers523
viewsA: File encoding in ASC II
The spelling is "ASCII". Abbreviation for "American Standard Code for Information Interchange", which is "American Standard Code for Information Exchange". In principle there is nothing to convert.…
-
4
votes1
answer1004
viewsA: FOUND_ROWS() from Mysql is a function that runs relative to local or global session?
Your doubt is a valid concern, good indicator that you are reasoning to program, anticipating situations. The functions as FIND_ROWS, last ID inserted and others of the same type are almost all…
-
4
votes2
answers348
viewsA: CSS tab system with 2 lines of tabs - code using "float"
A very simple solution is to separate the UL from the contents and respective checkboxes. The basis is the example below, I did not stylize for you to clearly see that the content "floats" and works…
-
10
votes1
answer52
viewsA: Problem with $_POST and IF
To know if one text is contained in another is used strpos. if ( strpos( $_POST['mensagem'] , '12' ) !== false ){ echo 'vc digitou 12'; } Important: note the use of !== false, for if the string is…
-
3
votes2
answers33
viewsA: Transform: Translate is compatible with which browsers?
According to Caniuse.com, this is the current situation: Note that this graphic is from 2D Transforms as a whole, which includes Translate. The items marked with [1] do not support CSS Transform in…
-
4
votes1
answer45
viewsA: Best Type Mysql to count the accesses
Counting is numerical, and are integer and positive values. The appropriate type for this, therefore, is INTEGER UNSIGNED (whole WITHOUT sign). In this family, we have these possibilities: TIPO…
-
15
votes3
answers971
viewsA: How to find "Happy Numbers" within an interval?
Adapted from Rosetta Code for Sopt: https://rosettacode.org/wiki/Happy_numbers#Javascript Licence to reproduce the document: https://www.gnu.org/licenses/fdl-1.2.html I changed the track to 0-50 and…
-
7
votes1
answer5276
viewsA: How do I use power in C++?
Is not Pow, is pow. Upper and lower case make a difference in C++ And the library is math: #include <math.h> int main () { printf ("5 ^ 3 = %f\n", pow(5.0, 3.0)); return 0; } See working on…
-
6
votes2
answers1719
viewsA: How to search two words in the same Mysql field
First of all, the ideal would be if the tag text were separated from the field, it would be a more scalable solution. If you really want to use textual search, the solution goes through something…
-
1
votes1
answer1017
viewsA: How to make the image occupy 100% of the screen. pyqt5 -python
You can scale the image, and use it as the background palette: oImage = QImage("fundo.png") sImage = oImage.scaled(QSize(700,500)) #use o tamanho do fundo palette = QPalette() palette.setBrush(10,…
-
5
votes3
answers325
viewsA: Why is this php calculator not working?
Does not work because it was not programmed to work. First of all, let’s put a name on select and fix item 4: <select name="operacao"> <!-- aqui eu pus um "name" --> <option…
-
8
votes1
answer52
viewsA: How can I set a value in a specific variable in a function with optional attributes?
It has many ways, depends on the desired effect. The normal is you for always the options on the right, precisely to be able to omit: function foo($requerido, $opcional = 12) { ... } But if standard…
-
5
votes1
answer229
viewsA: What’s if __name__ == '__main__': if the kivy can run the application without this line of code?
It is important to remember that in addition to being able to run a module directly, Python has the directive import to add other modules in the same application. When starting a module, some…
-
3
votes3
answers84
viewsA: how best to make a case_sensitive query
It’s a mistake to use BINARY for this case, if you are storing passwords. By the way, passwords should not be stored in DB. The BINARY completely ignores Unicode and character equivalence, so a Á…
-
5
votes1
answer213
viewsA: PHP - knowing which form was pressed
Just create a HIDDEN field to know the right POST, and use the same name on both buttons: printf(" <div> <form method='post' action='$link'> <p>pagina->…
-
5
votes3
answers745
viewsA: How to put link border without increasing menu size
box-sizing There’s a property that controls this, the box-sizing: box-sizing: border-box; When used according to the line above, it causes the measure of the element to include the border. In other…
-
5
votes3
answers250
viewsA: Delete repeated records in PHP
One possibility is to add this line into your query: GROUP BY P.id Attention to position, in SQL the clauses have specific order: ... WHERE P.isActive=1 GROUP BY P.id -- ou T.idPointOfSale, claro…
-
3
votes1
answer43
viewsA: WHERE do SQL returns unwanted values
If the OR is only in the Y, needs parentheses, if any y = 2 returns, regardless of the values of f and h. Other than that, you have to see if JOIN is correct, it would be better not to use equal…
-
1
votes1
answer613
viewsA: Layout and CSS problems in IE 10 and 11
Note: this was originally posted by the author in the body of the question. Well, after much pilgrimage I found a @media that solved the problem @media screen and (-ms-high-contrast: active),…
internet-exploreranswered Bacco 93,720 -
5
votes1
answer148
viewsA: Set the array pointer within a function
The problem is that when making new assignment within the function, you are not taking advantage of the original pointer, but creating a new one (which is discarded in the return). In these cases, I…