Posts by Don't Panic • 4,006 points
76 posts
-
0
votes1
answer373
viewsQ: Remove partition from table
Using the mysql documentation, I created the partition based on a year field. ALTER TABLE minhatabela PARTITION BY HASH (ano_referencia) PARTITIONS 10 To make a possible rollback, how I would drop…
-
0
votes1
answer326
viewsQ: Multi-color background
I need to make a responsive web page with bootstrap 4. Having in the middle of the page a purple region ( HEX #A544A7). I tried with linear-gradient, but it got degraded and that’s not what I need.…
-
1
votes2
answers705
viewsQ: SQL Error: Can’t reopen table
I have a problem when performing an SQL using a temporary table. I need to bring the data da ultima alteração where the opportunity has been changed. However, this date comes from several tables for…
-
4
votes1
answer55
viewsA: Correct way to give value to a PHP variable
Allocation Operators The left operand takes the value of the right expression That is, you can chain several variables receiving the same value, because the left variable will receive the value of…
phpanswered Don't Panic 4,006 -
4
votes2
answers1431
viewsA: Download file directly from FTP
One possible solution is to use the Library Client URL See how it works: //Configuração de conexão com o FTP $ftp_arquivo = "pasta/pasta/meuarquivo.txt"; $ftp_host = "199.99.854.99"; //exemplo…
-
3
votes1
answer120
viewsA: Error while creating table
The name of the Foreign key you have defined as u_id_fk is already stated in the table postagens. Name of Foreign key is unique, table independent. Create another name for u_id_fk on the table…
mariadbanswered Don't Panic 4,006 -
2
votes1
answer114
viewsA: Create Trigger automatically
After a few searches, I found a solution that meets what I need to solve. I made some changes directly in Javascript that solved my problem. Before using the regular expression, I broke the text…
-
0
votes1
answer114
viewsQ: Create Trigger automatically
I created a code that creates a trigger automatically to Mysql. But my function still has flaws, one of which is that it is accepting the statements of PK's and FK's as if they were table fields.…
-
3
votes2
answers130
viewsA: PHP How do I multiply hours with the amount of times it will be repeated?
You can do the same solution in two ways. Directly in Mysql using conversion functions TIME_TO_SEC and SEC_TO_TIME SELECT SEC_TO_TIME( TIME_TO_SEC('00:01:50') * 5 ) as TEMPO_TOTAL Doing in PHP…
-
32
votes4
answers2561
viewsA: What’s wrong with gluttonous philosophers?
Dinner of the Philosophers Description of the problem: Five philosophers are sitting around a circular table for dinner. Each philosopher has a dish to eat noodles. In addition, they have hashis…
-
2
votes1
answer111
viewsQ: implode() vs substr()
Taking into account the codes below: $str = ''; for ($i = 30000; $i > 0; $i--) { $str .= 'STRING QUALQUER, '; } $str = subtr($str,0,-2); and that $sArr = array(); for ($i = 30000; $i > 0;…
-
2
votes1
answer551
viewsA: In PL-SQL how to partially add a value?
By understanding the question it is necessary to remove the totalizer within the loop of repetition. Make some logical adjustments such as: Separate what is a business rule into a specific block No…
-
2
votes1
answer616
viewsA: In pl-sql can I assign the SUM value to a variable?
Use the clause INTO : Example: SELECT sum(COLUNA) INTO VARIAVEL from TABELA The sum result will be assigned to the variable you declared. More information:…
-
5
votes2
answers842
viewsA: Change position of two characters in javascript
In Javascript it is possible to do the same way, but it is necessary to break the string for array previously using the functions of split and then unite with Join. Because the string is immutable…
javascriptanswered Don't Panic 4,006 -
1
votes1
answer378
viewsA: Error creating file in oracle
When you encounter an ORA-00972 error, the following error message will appear: ORA-00972: Dentifier is Too long. Translation: ORA-00972: the identifier is very long Looking I found the reference…
-
1
votes4
answers1033
viewsA: How to get PHP session id with jQuery?
Use this Javascript function to find the session ID based on regular expression: function session_id() { return /PHPSESSID=([^;]+)/i.test(document.cookie) ? RegExp.$1 : false; } Or if you prefer to…
-
1
votes1
answer291
viewsQ: Calculation function with dynamic cursor
I am trying to create a database function that when receiving a parameter value that contains a certain value it creates a cursor with the specific table. Follows DELIMITER $$ drop function if…
mysqlasked Don't Panic 4,006 -
3
votes1
answer949
viewsA: Data being repeated when using INNER JOIN on Oracle
You need to group the data to return 1 record of each. group by example: select a.nm_nome from aluno a inner join matricula ma on (ma.nr_rgm = a.nr_rgm) inner join classe c on (c.cd_classe =…
-
2
votes0
answers33
viewsQ: Calculation problem
I’m performing some calculations in the Front-End to not need to request for the Back-End. But I came across the following problem in the calculations. In the JS: 490 * 60 / 60 = 490 490 / 60 * 60 =…
-
4
votes1
answer5206
viewsA: Remove simple javascript quotes
Only using the replace() is enough: var a = "joao's empreendimento"; var b = a.replace(/'/g, ''); console.log(b); Example: https://jsfiddle.net/85bnxq5x/…
-
1
votes3
answers399
viewsA: Transforming DD/MM/YY into PHP timestamp
You can use the strtotime(), example: $timestamp = strtotime(str_replace('/', '-', '08/11/2017')); Watching the Supported Date and Time Formats Using strptime() $a = strptime('08/11/2017',…
-
6
votes1
answer7312
viewsA: What’s the difference between a charge test and a stress test?
Difference between load test and stress test Differs in the capacity limit of a system. As the cargo test intends to find out what is the capacity of use, processing, access etc. of a system, the…
-
21
votes1
answer2331
viewsQ: What is it and what is PCA, LDA, ICA for?
I’m conducting a survey on Facial Detection and Recognition for future implementation, my research has reached the algorithm of Viola Jones and reading more I came to the concepts of: PCA -…
-
3
votes1
answer2740
viewsA: How to use LIKE with OR on Oracle?
You need to adjust your SQL to the conditions: SELECT 'O dependente ' || InitCap(Nome) || ' é dependente do funcionário de código: ', Matricula FROM Dependente WHERE Nome LIKE 'T%' OR Nome LIKE…
-
19
votes5
answers60507
viewsA: DISTINCT and GROUP BY, what is the difference between the two statements?
They have semantic differences, even if they have equivalent results in their specific data. GROUP BY allows you to use aggregate functions such as AVG, MAX, MIN, SUM, and COUNT. Other hand DISTINCT…
-
3
votes4
answers3827
viewsA: Percentage Mask
Using the basis of @Lucascosta’s reply, I switched to the form I needed: Removed % of mask and assigned to Blur and Focus triggers $('.numero').mask('Z#9V##', { translation: { 'Z': { pattern:…
-
0
votes4
answers3827
viewsQ: Percentage Mask
I need a percentage mask with the library jQuery Mask Plugin v1.5.4. What I am trying to do is that the user can report a value from -99.99 to 99.99. I’m trying like this:…
-
1
votes4
answers506
viewsA: Ajax, limit time even giving Reload on page
As I said, you can define several ways. Some are a little safer and others less, it will depend on your need. Basic code for changes: <?php require_once dirname(__DIR__) . DIRECTORY_SEPARATOR .…
-
3
votes3
answers1120
viewsA: Enable Submit button if CPF is valid
Change .keypress for .keyup that will work better. Remove Return false, or you’ll never be able to enter a value, especially with a alert interfering with the typing. $("#cpf").keyup(function(){ var…
-
3
votes1
answer64
viewsA: How to perform a bind_param() with SELECT UNION ALL
Your problem is that in your SQL in part: AND YEAR(data_pg) = ? AND UNION ALL There is a AND before UNION ALL and therefore generates error. Because there was a failure to prepare SQL. A good…
-
10
votes2
answers532
viewsA: What is the first programming language or technology used for dynamic pages?
History: The pre-1994 web When the Internet became user-friendly (user-friendly) in the 1990s, there was no such thing as the back-end. The Internet of the time contained basic forms of HTML code,…
httpanswered Don't Panic 4,006 -
1
votes2
answers273
viewsA: Turn decimal into PHP binary
Use of str_pad: for ($i = 0; $i < 4; $i++) { $mascara_binario[$i] = str_pad(decbin($mascara_decimal[$i]), 8, "0", STR_PAD_LEFT); echo $mascara_binario[$i]; } He will fill the missing zeros (0).…
-
2
votes1
answer50
viewsA: $_GET does not receive more than one variable
The problem is not that $_GET does not receive the value, but in its function: function autorizar($conexao, $id) { if($resp == 's') { $sqlAtrib = "UPDATE cursos SET exibirCurso='s' WHERE idCurso =…
getanswered Don't Panic 4,006 -
2
votes1
answer55
viewsA: Get only part of the Cookie string
First you should use the urldecode to remove URL characters from your string. $var = urldecode("%22u%3D859186139894337536%22"); After that you can use the function filter_var that will filter your…
-
1
votes1
answer365
viewsA: Javascript redirect and set cookies
In the PHP manual of setcookie(): Way (path) The path on the server on which the cookie will be available. If set to/, the cookie will be available throughout the domain. If set to '/ foo /', the…
-
2
votes1
answer78
viewsA: Problem with window.Location
In your PHP you forgot to set the position redirect that you make the comparison on JS. 1 == a.redirect ? window.location = "index.php" : .... Then just set a value for it in your PHP that will…
-
8
votes2
answers699
viewsA: What would be a tree and a forest?
In programming, what would be a tree? In graph theory, a tree is a connected graph (there is a path between any two of its vertices) and acyclic (no cycles). It would be the same principle of N-ary…
-
17
votes1
answer11672
viewsA: What is a stress test?
Stress test is performed to subject the software to extreme situations. Basically, the stress test is based on testing the software limits and evaluating its behavior. Thus, it is evaluated up to…
-
6
votes2
answers758
viewsA: What does the return of the INSERT 0 1 bank mean?
Extracted from the page in the manual : Exits On successful completion of a command INSERT it returns a form command tag: INSERT [oid] [Count] The [Count] count is the number of rows entered. If the…
-
2
votes2
answers50
viewsA: How to solify the incompatibility of the mobile menu symbol with some browsers?
Apparently, the reason is that no source on the system where the running browser contains the encoding for "" The alternatives are: Use an image instead. Use a downloadable font with @font-face.…
-
15
votes1
answer7529
viewsQ: Prim and Kruskal algorithm
The two algorithms serve to generate a Minimum Generating Tree of a Graph. In the Prim Generates a single tree Throughout the algorithm, the set X is always a tree In the Kruskal Generates a forest,…
graphasked Don't Panic 4,006 -
3
votes1
answer1901
viewsQ: MOD in Assembly
I need to make a comparison to see if the number X is PAR or ODD. I store the number in the AX register. How do I know that AX content is even or odd? Note: I store a number from 1 to 99.…
-
33
votes2
answers844
viewsQ: Memory Position Array
I’m doing an implementation of a game on Assembly in the Proteus. I draw two random numbers from 1 to 99 and need to generate on the LCD an image referring to the numbers I generated. Example: If I…
-
14
votes4
answers2496
viewsQ: Performance of COUNT(*) and COUNT(1)
What’s the difference between COUNT(1) and COUNT(*) in an SQL query. For example: SELECT COUNT(1) FROM USUARIOS; and SELECT COUNT(*) FROM USUARIOS; Is there any difference of interactions within…
-
1
votes1
answer198
viewsA: Redirect www htaccess with segment in url
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] Source…
-
2
votes3
answers63
viewsA: Reorder variables by throwing the blanks to the end
There are many Sorting algorithms to solve your case. But let’s go to the classic Bubble Sort How it works: This algorithm traverses the list of ordinable items from start to finish, checking the…
phpanswered Don't Panic 4,006 -
2
votes1
answer228
viewsA: Using Foreach in PHP
The use of the second way refers to the passage by reference, that is, if you change the value it contains in $value will change at the memory position of the array being traversed. To better…
-
1
votes1
answer749
viewsA: json php + javascript
In sending I suggest already put the return in JSON $.post("http://bonusdogeronimo.com.br/rtv/indez.php", { email : $("form #email").val() }, function(result){ if(result.status == "valid"){…
-
5
votes2
answers2792
viewsA: What status code to use when there is no database record to return on an HTTP request?
Use the 404 Behold in this blog. He explains very well. Summary of blog comments on the return 204: 204 No Content Not extremely useful as a response code for a Browser (although, according to HTTP…
-
0
votes1
answer38
viewsA: I can’t find the error of this Stored Procedure
Correction: For all IF the inclusion of a END IF; as below: delimiter $$ create procedure reposta(out mensagem varchar(100)) begin if (new.codigo_veiculo != null) then set mensagem = "Algum veículo…