Posts by Hiago Souza • 5,837 points
240 posts
-
2
votes2
answers60
viewsA: Problems displaying an array of functionalities in a Main class
You’re trying to run a println in a method that returns nothing (void) follows below the excerpt: //Usando o foreach percorra funcionarios da empresa. for (Funcionario f: empresa.funcionarios) {…
javaanswered Hiago Souza 5,837 -
1
votes2
answers102
viewsA: Trouble with the $ at the angle!
Hello the $ according to the example shown shows that it is a jQuery plugin that you want to use. To make use of the jQuery you need to include it in your HTML. For this you just need to include the…
angularanswered Hiago Souza 5,837 -
11
votes4
answers455
viewsQ: What is the difference between parseint() and operator + before a string?
I saw a colleague convert a string to integer using the syntax var a = +"10" but I always used the parseInt() and the line is usually like this var a = parseInt("10"). Why when placing the operator…
-
1
votes1
answer343
viewsA: Acessiblidade Angular
I met people, Valdeir Psr gave me a light in the comments. For me to notify the user, I just put the attribute role with the value alert and the attribute aria-live with the value assertive in my…
-
1
votes1
answer343
viewsQ: Acessiblidade Angular
Hello I’m developing a project and implementing accessibility in it. So far so good, the screen reader works is everything ok. My problem is when I exit screen A and go to screen B, screen B has a…
-
0
votes2
answers159
viewsA: My if is not working as expected
For his var_dump apparently the first index of its vector $mt has the value null in the column entry_type. In other words, how null is not página he will fall into your else. For safety I advise you…
-
1
votes1
answer298
viewsA: How to Set PHP 7 Variable for POST?
First you need to send the data by the verb http POST I’ll leave an example using standard HTML form. Example HTML form <form action="nome-do-seu-php.php" method="POST"> <input type="text"…
-
-1
votes3
answers7042
viewsA: Angular 6 date and time in English
For this you can use the interpolation followed by the pipe date. Example in HMTL: {{ variavelComAData | date: 'dd/MM/yyyy hh:mm:ss' }} For more details see Datepipe documentation in angular Docs.…
angularanswered Hiago Souza 5,837 -
0
votes2
answers115
viewsA: Sort object array with relation to each other
Hello apparently is one of logic, I did it the way below and it worked. Following example: positions.sort(function (a,b) { if(a.prev <= b.prev && a.next <= b.next) { return -1; } else…
-
0
votes1
answer97
viewsA: How to return the data obtained from a Request outside the scope of the function?
You can make use of Promises since your method is asynchronous. I leave below an example of how it could be done. The way you’re working: const tempo = () => { return new Promise((resolve,…
javascriptanswered Hiago Souza 5,837 -
0
votes2
answers192
viewsA: Remove a CSV line by position - PHP
In your php file do not count the lines of the file, already deal with no for the line you want to remove. Example <?php $removerLinha = $_POST["deletar"] - 1; $meuArray = Array(); $file =…
-
0
votes1
answer197
viewsA: How do I show the msg "Login Successfully" to the user?
To display the messages you can use the ToastController the documentation is available on the Ionic framework Example of use of Toastcontroller constructor(private toast: ToastController) {} Login…
-
8
votes3
answers6965
viewsA: Typed and untyped programming languages
Typing itself is a feature of each language being compiled or not. A good example is PHP itself. As of php 5 it has 2 types of typos (arrays and objects with class names). Already with php 7 it…
-
1
votes3
answers69
viewsA: standard argument in javascript function
For safety, I think you better inform in the method builder. The example arg = arg || "valor padrão"; would generate an instability if the parameter type were Boolean or a numeric, "if you reported…
javascriptanswered Hiago Souza 5,837 -
1
votes0
answers39
viewsQ: Send a blob to a webservice
Hello, it may sound like Jr. the personal question but I’ve tried searching the internet and nothing. I have the following scenario: A. NET API provided by a company to which I have to submit a…
-
0
votes1
answer111
viewsA: Mysql - Best selling cars report using View
Follows below the select that you can use to generate your View. Note: Remember to change the values of :menorData and :maiorData for the range you want. SELECT c.PLACA as Placa,…
mysqlanswered Hiago Souza 5,837 -
-1
votes3
answers67
viewsA: Problem with select php mysql
The file listing method does not have the closure of the tr. Correct example public function listarArquivo(){ try{ $id_usuario = $this->id; $query = new DbFunctions();…
-
1
votes1
answer31
viewsA: Login with validation does not work
Taking out the bank credentials, I believe it’s Case Sensitive’s problem. Try it the way below: <?php ini_set('display_errors', true); error_reporting(E_ALL); if (!empty($_POST) &&…
-
1
votes2
answers1967
viewsA: How to send current screen resolution to PHP (on first load)?
Look I do not understand why you want this information in PHP, but here is an example of how it could be done... Create a file called detectScreen.php and include it on your main page: <?php…
-
1
votes2
answers214
viewsA: Popular dynamically select form
Your for is going through once more, and I also believe that the method append will not work on elements of type select, try to modify the innerHTML his. Below is an example: for(var i = 0; i <…
javascriptanswered Hiago Souza 5,837 -
0
votes2
answers1034
viewsQ: Measure distance from multiple points using Google
I’m working on an app where the user can see the closest establishments to it. In the bank I keep the latitude and the longitude, and in mobile I recover the user’s position. I made a LIMIT in SQL…
-
0
votes3
answers5033
viewsA: Find Strings in Text Files in PHP
Hello you can make use of the file_get_contents together with the strpos and the strtolower of PHP. Here is an example of how it can be done: <?php $arquivo =…
-
1
votes0
answers28
viewsQ: Javascript Calculo Estranho
I am trying to run the following calculation in Javascript, 78.98 * 10 and the result returned is always 789.8000000000001 my question is where did this come from 0.0000000000001? I tried several…
-
0
votes1
answer694
viewsQ: Using Input or declaring in metadata?
have the following doubt: Today as far as I have seen there are 2 ways to receive information in an Angular Component. But I doubt the question "performance". The example below I import the Input…
-
2
votes1
answer57
viewsA: Can creating multiple sessions affect user performance?
When you create a session in PHP, it creates a cookie in the browser that is returned to you in every request. This session data is not sent to the user, he receives a code and forwards it to his…
-
3
votes1
answer849
viewsA: Listing the most offensive querys in Mysql
You can make use of the query below: select * from sys.`x$statement_analysis` It will bring you information about which query is most executed, latency, average latency, number of times it was…
-
2
votes1
answer7151
viewsA: Change input text type=file with filename
Follow a simple example, so you can make an adaptation. Document <div class="form-group"> <label for="fupload" class="control-label label-bordered">Clique aqui para escolher um…
-
0
votes3
answers1285
viewsA: Return checkbox checked PHP
If the checkbox marked are in a column in the bank you will have to use the explode. Example <?php $pdo = db_connect(); $sql = "SELECT * FROM cor_fundo"; $query = $pdo->prepare($sql);…
-
2
votes2
answers1061
viewsA: How to redirect to HTTPS?
Put the script below in a file that is included by all pages: if($_SERVER["HTTPS"] == "on") { header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]); exit(); } After that it…
-
6
votes2
answers4463
viewsA: Sum in sql update
You’re trying to add a string, try it the way below: UPDATE `cadastro` SET `pontos` = `pontos` + 1 WHERE id = 102; Remember that to work the column points must be of a numeric type. Example: int,…
mysqlanswered Hiago Souza 5,837 -
2
votes1
answer286
viewsQ: Does typescript support an implementation equivalent to trait?
I am developing a project using Ionic, and would like to better organize my classes. Below is an example of how I would do with PHP: <?php trait comportamento { public function ficarTriste() { }…
-
1
votes1
answer192
viewsA: Recaptcha Validation in PHP
You can check the g-recaptcha-response in the Submit of your form. function validaCaptcha() { if(document.querySelector('#g-recaptcha-response').value == '') { alert('Resolva o desafio do captcha…
phpanswered Hiago Souza 5,837 -
0
votes1
answer318
viewsA: change JSON.stringify data
You can make the conversion to object: $('.form').submit(function () { var dados = jQuery(this).serializeArray(); var obj = {}; $.each(dados, function (i,obj) { obj[obj.name] = obj.value; });…
-
12
votes5
answers1163
viewsA: PHP only connects to Mysql?
Using the PDO library, it is possible to connect with 12 types of databases. List: CUBRID MS SQL Server Firebird IBM Informix Mysql MS SQL Server Oracle ODBC and DB2 Postgresql Sqlite 4D For more…
-
1
votes1
answer108
viewsA: How to pass data from database to combobox?
Do your while on variable $data because it is she who made the Query execution <?php ... $dbconn = mysqli_connect($servername, $username, $password, $dbname)or die("Failed to connect to…
-
1
votes2
answers1743
viewsA: Is there any way to clear cache in the client’s browser?
You can create dynamic names for the files, so the browser will force the download. Example: <script src="https://cdn.meucdn.com/js/meu-arquivo.js?v=<?php echo $version_js;…
-
6
votes1
answer1414
viewsA: REST API versioning. Is there a way to do it and what would be the best option?
You may be using a VCS (Version control systems) to manage your versions in the case GIT (I prefer) or SVN, we can assume that the structure change of an api would be a new branch, and every version…
-
2
votes3
answers471
viewsA: Does the CSS "! Important" property influence website performance?
It shouldn’t have any effect on performance really. Viewing the Firefox CSS parser at /source/layout/style/nsCSSDataBlock.cpp#572 I think this is the relevant routine, trying to replace this CSS…
cssanswered Hiago Souza 5,837 -
6
votes3
answers1691
viewsQ: Why does Javascript return Infinity instead of error when dividing by 0?
When I divide any value by zero, Javascript, returns me Infinity. My question is why Infinity? Infinity is set in Javascript, but I could not find a use for it in any case. Can anyone tell me also,…
-
1
votes1
answer53
viewsA: How to ignore an empty row in a table
You can solve this by using the continue and the empty php. Example <table class="table table-striped" id="tblGrid"> <thead> <tr> <th align="left">Observações</th>…
phpanswered Hiago Souza 5,837 -
3
votes1
answer837
viewsA: Change src of an image
Well, if you’re using jquery put an identifier in the tag img ai when you need to update the image use jQuery attr $("#id_da_image").attr("src", "novoEndereco"); Practical example (jQuery): <!--…
-
2
votes3
answers45
viewsA: Click UL to A
You have to set a fução to callback. Example: $(".submenu ul").click(function() { $(this).find('a').trigger("click"); }); Structure of HTML: <ul> <li class="submenu"> <ul>…
jqueryanswered Hiago Souza 5,837 -
1
votes1
answer121
viewsA: Use php to set column width depending on while result
Do it by php using a control variable, and then just print it in the container: Example: <?php $result_categorias = "SELECT * FROM categorias ORDER BY ordem ASC"; $resultado_categorias =…
-
0
votes3
answers2794
viewsA: Sum values of two inputs and show in third
Missed you put the ids in the "input" fields which is the location you want to retrieve/inputar the value... Example: <div class="form-group" id="formvalor"> <!-- Campo para somar -->…
-
1
votes1
answer46
viewsA: Click working wrong
Below is the possible answer to your problem. When creating the event $('#add').click you’re telling jQuery that every time there’s a click in any type of element in your document that contains the…
-
1
votes1
answer18
viewsA: Insertion of dimanically created inputs
Well I believe your question is how to recover this in PHP is this? To do this add [] after the tag name of your input. I’ll leave an example: $(document).ready(function(){…
-
2
votes1
answer39
viewsA: Change page Divs and specific Ids with calculations
Below is an example of how to do: $(function() { try { var valor = parseFloat($('#mostra_total').html().replace(',','.')); var frete7 = parseFloat($('#frete7').html().replace(',','.')); if((valor -…
jqueryanswered Hiago Souza 5,837 -
4
votes1
answer36
viewsA: mysql subquerie
Work with joins, is more practical and confuses less. Try to put in the tables to better orient yourself. Working example: SELECT c.nome_cliente, e.operacao, l1.nome_livro as livro_1, l2.nome_livro…
-
1
votes0
answers136
viewsQ: Geolocation and HTTP requests in the background with Ionic 2
I’m creating an app with Ionic 2 in this application I need to take the geolocation of the device and make HTTP requests to a web service that I have published. I used Sqlite to store the…
-
1
votes1
answer585
viewsA: Slim framework error: called require.. /Slim/Slim/Slim.php';
From what I understand you’re making use of the Commodore! Then try to load using the autoload of Poser, below is the example below: <?php require_once __DIR__ . '/vendor/autoload.php'; $app =…