Posts by KaduAmaral • 11,472 points
313 posts
-
3
votes4
answers706
viewsA: Place a url in the text field and show it in a DIV next door
Just create the widget with the image URL: // SEM jQuery // Executa a ação ao sair do campo, também pode usar `onkeyup` // para ser executado tada vez que uma tecla é solta (mas não vejo…
-
1
votes3
answers2504
viewsA: include php does not work
Put your include out of class, so: <?php error_reporting(-1); ini_set('display_errors', 'On'); $ds = DIRECTORY_SEPARATOR; require_once __DIR__."{$ds}..{$ds}..{$ds}controller{$ds}conexao.php";…
-
1
votes3
answers7829
viewsA: Put external font on website
For the code below, the source must be in the same folder as the CSS file, if it is in a different directory it is necessary to reference it correctly. @font-face{ font-family: "edosz"; src:…
-
0
votes2
answers1463
viewsA: Receive php Json values in Javascript for Chart.js charts
You have to do this in the role of callback, the same where you’re doing that each. jQuery(document).ready(function($){ /* call the php that has the php array which is json_encoded */ $.ajax({ url:…
-
3
votes4
answers17968
viewsA: Remove elements from a Python List
Use the statement del: >>> a = [-1, 1, 66.25, 333, 333, 1234.5] >>> del a[0] >>> a [1, 66.25, 333, 333, 1234.5] >>> del a[2:4] >>> a [1, 66.25, 1234.5]…
-
1
votes1
answer301
viewsA: How to assign a single nickname to 2 columns of different tables?
What you’re trying to do has no logic to the programming. If you have two different dice in two columns, giving them the same name will cause you to lose the reference of one of the two. For…
mysqlanswered KaduAmaral 11,472 -
0
votes3
answers215
viewsA: Leave current page highlighted in a page selection menu?
You can do it with jQuery (or pure Javascript if you like): jQuery(document).load(function($){ var page = window.location.pathname; // remove qualquer parâmetro de url // por exemplo de…
-
21
votes6
answers2843
viewsA: What is the correct term to call someone who makes HTML code?
There are several terminologies that are not wrong, but some are more suitable than others. In computing, a programmer, developer, or software engineer refers to someone who does computer…
-
1
votes1
answer2147
viewsA: Sending link by email with Phpmailer
Apparently it’s a mistake of syntax html. Repair your code: <p>Parabéns! Surgiu um pretendente para o(a) ".$partner_name.". Para ver o pretendente, clique no link baixo. <br> <a…
-
5
votes1
answer812
viewsA: Higher value in an array in PHP
The logic is quite simple, just use two variables and check if the value of the width/length is greater than what is in the variable, if it stores the new value width/length in it. Example: //…
-
1
votes1
answer390
viewsQ: ELSE IF in calculated Sharepoint field
How to use a structure ELSE IF in a calculated Sharepoint field, for example: = IF([Nota]>=80,"A") ELSEIF([Nota]>=70,"B") ELSEIF([Nota]>50,"C") ELSEIF([Nota]>=30,"D") ELSE("E")…
sharepointasked KaduAmaral 11,472 -
1
votes1
answer390
viewsA: ELSE IF in calculated Sharepoint field
For this it is necessary to nest several IFs: =IF([Nota]>=80; "A"; IF([Nota]>=70; "B"; IF([Nota]>50; "C"; IF([Nota]>=30; "D"; "E" ) ) ) ) Code idented just for understanding, I’m not…
sharepointanswered KaduAmaral 11,472 -
3
votes4
answers140
viewsA: How to add class to the first <img src=""> of a set
If you have already selected several elements, use first(), as in the example: $imgs = $('img'); $imgs.first().addClasse('classe'); If you want to select it only for this, pass as parameter in the…
jqueryanswered KaduAmaral 11,472 -
2
votes1
answer1297
viewsA: Grab sequential ID based on last entered
To do this control you need to have a field where control was the last user used. I suggest doing a normalization in your bank by changing the field periodo passing the data to a table and storing…
-
2
votes1
answer84
viewsA: How can I correctly use a PDO object for a selection query
You receive the data from statement, through the method fetch: $row = $stm->fetch(PDO::FETCH_ASSOC); On the blog Devmedia, has an article Introduction to PHP PDO, that would be a good read. $stmt…
-
10
votes5
answers169
viewsA: What is the fastest is_null($y) or $y == null?
Phrase Security The question that really must be asked is this:, "Which is safer to use?". For example, the following expressions: "oi" == null => false "" == null => true 0 == null => true…
phpanswered KaduAmaral 11,472 -
0
votes1
answer1124
viewsQ: Advantages/Disadvantages Magento x Opencart x Other Open eCommerce
I am with a project to start and I would like to know what advantages, disadvantages, resources and etc. I mean, main differences between open source e-commerce platforms: Magento Opencart Other…
-
1
votes5
answers364
viewsA: Hierarchy between CSS styles
@Chun is right when he said that his HTML "hierarchy" should not be implemented like this. However solving the "problem", you can include "priorities" in your selectors, example: .tema-1 .btn,…
-
2
votes1
answer330
viewsA: CSS Media Queries (several statements followed)
There is no standard rule, and that answer may even be based on opinion. But you can separate it into different files and use the media rule on attribute media tag link: <link…
-
1
votes1
answer85
viewsA: Problem with flash games cache
To disable browser caching, you can combine some meta tags: <!-- Informa ao navegador que não é pra armazenar nenhum tipo de cache Teoricamente só essa opção já resolveria o problema Versão HTTP:…
-
7
votes2
answers1209
viewsQ: Can Enum values only be integer?
Studying C#, I came across a situation, I want to receive a value (string) by the console. And then compare it to the value of a Enum. For example: [Serializable] public enum Command { Exit =…
-
2
votes2
answers185
viewsA: Explode() 'manual' in PHP
Just as you said yourself, the problem is that you are comparing a single char, with a set of char. You can solve this as follows: if(strpos(substr($str, $i), $divideBy) === 0) The previous…
-
1
votes2
answers1007
viewsA: Multi-language system
There are some features that you can detect the language by IP if it is the user’s first visit to your site. (This kind of service can be unstable, there are other paid ones that are much more…
-
5
votes1
answer5481
viewsA: PHP Error: "Notice: Uninitialized string offset"
The error is happening because you are checking a position of string which does not exist, for example: $textobase = "oihoi"; // Texto: oihoi // Tamanho: 5 // Posições: [ // 0 => o // 1 => i…
phpanswered KaduAmaral 11,472 -
5
votes2
answers367
viewsA: How do I use a CSS from the site url?
Answer Impossible to do that. Because? Parameters in the URL are sent to the server, where your source code is, so in your code you will decide what to do with the parameter. If you can’t mess with…
-
3
votes1
answer2933
viewsQ: Sending a message to a local network broadcast via UDP
I made a question about P2P connection, then with one of the answers the question arose: How to send a message on a local network via UDP in style broadcast, without a specific recipient? With this…
-
15
votes2
answers1506
viewsQ: How is the algorithm of a P2P application?
There are several P2P programs, I know that the concept is that each computer is like a client and server at the same time, and that they communicate with each other. On this type of communication:…
-
1
votes1
answer14553
viewsQ: How to send local network messages on Windows
How could I exchange messages with another computer (both Windows system) on a local network without server intermediation. It would be possible using the command prompt?
windowsasked KaduAmaral 11,472 -
1
votes2
answers937
viewsA: How to add multiple date ranges as php
You can accomplish this using the method diff of the object Datetime: $datetime1 = new DateTime('2009-10-11'); $datetime2 = new DateTime('2009-10-13'); $interval = $datetime1->diff($datetime2);…
-
8
votes4
answers2688
viewsA: How to add the ninth digit, fixed, using jQuery Mask?
Solutions: You can add the 9 manually when the user is typing the phone: $('#telefone').mask('(00) 00000-0000').on('keyup', function(event){ event.preventDefault(); var v = this.value;…
-
2
votes3
answers235
viewsA: how to treat different index/templates for the same site?
For this problem has tens/ hundreds maybe even thousands of possible solutions. I will post a structure that I used. Structure \ |__ Templates\ | |__ Default\ | | |__ css\ | | |__ js\ | | |__ img\ |…
-
4
votes8
answers794
viewsA: Mapping an array with possible subarrays as elements
You can create your own mapping: Array.prototype.hasObject = function(){ for (i in this) if(typeof this[i] == "object") return true; return false; } Array.prototype.flatten = function(){ if (typeof…
-
0
votes1
answer156
viewsA: Tabbed Scroll - Stop setInterval with jQuery.mouseup
I fixed by changing the code of: timeout = setInterval(function() { move = getLeftPosi(); move = move < -10 ? -10 : move; if (move >= 0) { clearInterval(timeout); return false; } else {…
-
3
votes3
answers878
viewsA: image and hr side-by-side
To stand side by side you can use the display:inline and adjust the height with margin: margin:29px 0 0; display:inline; Example: .linha{ height: 3px; width: 250px; border-width: 0; color: #d29e1d;…
htmlanswered KaduAmaral 11,472 -
1
votes2
answers3779
viewsA: How to show an image every 5 seconds javascript
You can accomplish this by manipulating DOM objects, removing the previous image and creating a new one instead. Javascript var i = 1; var id = 'imagem' // Intervalo em milissegundos (1s == 1000ms)…
javascriptanswered KaduAmaral 11,472 -
8
votes1
answer347
viewsA: How to distinguish FALSE from empty string?
Use the triple operator !== or ===: if ($line !== FALSE) { /* Correto */ } The double operators == and != compares only the value itself, whereas the triple operators !== and === also compares the…
phpanswered KaduAmaral 11,472 -
0
votes1
answer156
viewsQ: Tabbed Scroll - Stop setInterval with jQuery.mouseup
I need to implement tabs in my application, and when they exceed the area limit, I need to have the option to scroll them (horizontal scroll). I created the buttons of scroll ←, → and programmed so…
-
0
votes1
answer102
viewsA: PHP - print_r in xml is bringing Class name
In the method __contruct there is no return, because the return is the object. What you can do in this case is create a method. class Cliente { public static function Get($requisicao) { //Endereço e…
-
0
votes1
answer70
viewsA: Weekly Reservation
I worked with an agenda a few days ago, the logic is as follows: Give the start date and end date option. Make a query in the bank searching the schedules: $sql = "SELECT * FROM agendamento WHERE…
-
1
votes1
answer114
viewsA: Differences between SELECT, Count and Empty to work DB data
In fact none of these options mentioned in the question has a good performance. Because it is performing the operation twice, in the if and in data manipulation. It is better to store the entire…
-
13
votes3
answers7767
viewsA: Send email with CCO in PHP
Correct form To send an email With Hidden Copy (CCO) or Blind Carbon Copy (BCC), simply add to the email header the following instruction $emailoculto = '[email protected]'; $cabecalho .= "Bcc:…
phpanswered KaduAmaral 11,472 -
4
votes2
answers6350
viewsA: View and edit registered data
How To Do To enable editing you need a variable to select the user and leave their data in the form. First of all take all your PHP code and put before the HTML code. Now start the variables going…
-
1
votes3
answers125
viewsA: mysql UPDATE, does not receive function value in PHP
(ALWAYS) Validate the variables before performing any operation with the database: // Valida se a variável está vazia if (empty($_GET['assunto'])) die('Assunto não informado.'); // Recebe todos os…
-
1
votes3
answers1920
viewsA: Search database information by selecting a field
Use an ajax request to send the request with the selected user data: // <select id="usuario">...</select> // Instrução será chamada assim que o campo usuario for alterado…
-
1
votes2
answers75
viewsA: Numerical value definition in PHP Constants
Yes, even PHP uses some numbers in constants such as constant error levels. echo E_ALL; echo PHP_EOL; echo E_NOTICE; echo PHP_EOL; echo E_DEPRECATED; echo PHP_EOL; echo M_PI; // Constante matemática…
phpanswered KaduAmaral 11,472 -
3
votes3
answers22753
viewsA: Error in select using mysqli_query
The error reported: Warning: mysqli_query() expects at least 2 Parameters, 1 Given in F: XAMPP htdocs Pap2 quarto.php on line 67 It’s because we’re missing the link Mysqli by parameter, previously…
-
5
votes1
answer556
viewsA: Displaying an image instead of two using og:image
This can be a facebook cache. Using Debug Tool, you can clear the cache by clicking the button Fetch new Crape information. To find out the last time the URL information was updated, you have the…
-
2
votes1
answer1109
viewsA: Modal bootstrap does not open as dynamic link
The modal keeps the content of the first request, so the first one you open will be permanent until the page reloads. To fix the problem create an alternate toggle that redos the load.…
-
1
votes1
answer39
viewsA: Conflict in custom list view templates in Sharepoint
I solved the problem as follows: I added a webpart editor-type script on the page with the following code: <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(function(){ var…
-
0
votes1
answer39
viewsQ: Conflict in custom list view templates in Sharepoint
Problem I have two custom lists with ListTemplateType = 100. When I insert the two on a page the last one overwrites the first one, then it stops working, working only the last one. I tried to add…