Posts by Hiago Souza • 5,837 points
240 posts
-
0
votes1
answer17
viewsA: Problem with Annotation after updating android studio
The problem was not in the Android Studio update but in proguard. Recently added proguard in the project and no tests were performed with chat. To resolve the problem I added the line below in the…
-
0
votes1
answer17
viewsQ: Problem with Annotation after updating android studio
I have an implementation made with Socket.IO on android. However after I update the android studio, everything stopped working... I created routines to facilitate lib implementation, one of them is…
-
0
votes0
answers25
viewsQ: What happens when an after Insert or after update Rigger fails?
I have a question about triggers. If there is an after Insert or after update Rigger and this Rigger has an SQL routine that cannot be executed or it fails what happens to the updated record /…
-
1
votes0
answers25
viewsQ: Problem with Trigger in select/Insert
Personal I created two entities, where the information of one is manipulated by the other. That is, I own an entity conta and another conta_extrato the balance of the entity account is modified only…
-
0
votes0
answers10
viewsQ: Android Viewholder Classcastexception
I implemented a message listing for a chat. The Sentry is receiving an exception that occurs in production, I have tried to simulate, but without success. Error ClassCastException java.lang.Integer…
-
2
votes5
answers31061
viewsA: Format Float value as currency using Jquery
I believe that the solution of @Tobias Mesquita is the appropriate solution, but I thought of another way, simple to arrive at the expected result, so I decided to share. Follows:…
jqueryanswered Hiago Souza 5,837 -
2
votes1
answer283
viewsA: res.render does not load . handlerbars within route - Node.JS and Handlerbars
Following the documentation of lib, managed to play your problem. It turns out you need to set the view engine using the method app.engine. To solve the problem, just add the content…
-
1
votes2
answers176
viewsA: I can’t redirect with PHP using header()
From the image, I noticed that you make use of the readfile, this method reads a file and writes its contents to the output buffer (output buffer). As a rule, you cannot send a header after you have…
phpanswered Hiago Souza 5,837 -
1
votes12
answers5446
viewsA: How to remove accent in upload with php?
Even though there are several answers, I leave here a new way that I learned and found very cool. function remover_acentos($str) { return preg_replace("/&([a-z])[a-z]+;/i", "$1",…
phpanswered Hiago Souza 5,837 -
0
votes2
answers705
viewsA: How can a javascript code update the server’s direct time?
You can make php itself return the image and apply the whole logic to it. I’ll leave below an example of how it could be done. File that makes the image available <img src="#" alt="imagem…
javascriptanswered Hiago Souza 5,837 -
2
votes1
answer123
viewsQ: Alias created in shell-script does not work
I’m trying to create a alias using a shell-script, but at the end of the execution the alias disappears. #!/bin/sh echo "Configurando ambiente..."; mkdir -p ~/.dna alias teste="node…
-
1
votes1
answer199
viewsA: Return javascript function within another function
The $.ajax will not execute the success before your return, you can work with Promise or with callback functions to get the expected result. Example: Promise quantityDaySurgeries = function () {…
javascriptanswered Hiago Souza 5,837 -
1
votes1
answer1077
viewsQ: Nodejs does not respect the OS daylight saving schedule
I set my Timezone in the nodejs for America/Sao_paulo. But it does not respect the tables of the operating system. I use Ubuntu 18.04 LTS + Nodejs V10. The method getTimezoneOffset of Date me…
-
1
votes2
answers1590
viewsA: Promise {status: "pending"}
There are two ways, either you implement Promise or you modify your Function to use async/await. Example A: buscarUsuario.onclick = async function() { var usuario =…
-
0
votes1
answer126
viewsA: Promises.all are on an infinite loop
When you make use of the notation async it is not necessary to return a Promisse 'cause that happens automatically. Below is a new way to arrive at the expected result, change your method…
-
0
votes2
answers67
viewsA: Angular 2x - Do not perform databinding for 2 equal objects
You must clone the object so it doesn’t occur, follow the examples of how you might be doing it. Method 01 this.produtosOriginal = [ ... this.produtos ]; Method 02 this.produtosOriginal =…
angularanswered Hiago Souza 5,837 -
0
votes1
answer50
viewsQ: Gitlab-CI.yml does not share ratings
I’m trying to automate a build using gitlab-ci.yml, but I’m having some problems. Apparently each Stage creates a new container of the image I chose. I guess I’m new to this CI/CD world so maybe the…
-
1
votes1
answer1001
viewsA: Keep updating select in the page div without refresh mysql php
You may be making use of AJAX for this. I’ll leave an example with jQuery which is a javascript framework that makes this part easier. Myfile.php <?php include("connection.php"); $query = "SELECT…
-
0
votes2
answers75
viewsA: Moment.js When working with night dates for the morning
As you are not specifying a date, it will assume the current date. I believe that the correct is for you to provide the date/time. Below is an example: Javascript…
-
1
votes1
answer54
viewsA: Button continue loading while loading PHP
You can remove the first part of your routine, and do it the way below, just in the location where you call php. Although not testing the example below it shows where you should show the effect and…
-
1
votes2
answers170
viewsA: Error handling JSON data from a PHP API
When trying to access the person.name property php will try to concatenate the $client->person with a name "name" constant. To solve the problem put the value inside keys and quotes, as example…
-
0
votes0
answers146
viewsQ: Failed to stop testeci.service: Interactive Authentication required
I’m trying to restart a service in the successful execution of a JOB in Jenkins. Everything works except the fact that Jenkins can’t execute the command systemctl restart testeci.service. It returns…
-
0
votes1
answer1143
viewsQ: Problem with module resolution
I am trying to create a mapping in a project that is running with Nestjs. But when executing the command npm run start:dev Node returns the error Cannot find module '@entities/user' on the console.…
typescriptasked Hiago Souza 5,837 -
2
votes2
answers66
viewsA: block with css on the mouseover
You can do it the way down: ul.menuAdmin > li > ul { display: none; } ul.menuAdmin > li:hover > ul { display: block } Html <ul class="menuAdmin centralisado"> <li>…
-
7
votes1
answer196
viewsA: src without image does not disappear
The ideal would be the TAG img nor exist in the DOM and not hide the same. As I noticed that makes use of jQuery, I leave below some options with the framework and also an option with CSS (that…
-
0
votes1
answer30
viewsA: Jquey - How to take actions with dynamic elements of a table?
The global id attribute defines a unique identifier (ID) that should be unique throughout the document. How you are inside a foreach will happen to exist 2 ID’s and this cannot occur. In your case,…
-
3
votes1
answer62
viewsA: List alphabetically ordered Mysql records in PHP
It follows a quick script that I did, I could not test, but I believe it works. No foreach you scroll through the database data you can switch to while if you are implementing in such a way.…
-
3
votes1
answer1363
viewsA: Error while trying to run nodemon
There are two ways for you to solve the problem. The first is you install the library nodemon through the command npm install -g nodemon. You can also make the installation as a development…
-
2
votes1
answer65
viewsQ: Catching errors in Messagehandler
Hello I am trying to deal with errors in my application by making use of DelegatingHandler. But I have a problem, I used a try-catch to deal with errors. The try-catch encompasses the SendAsync,…
-
1
votes1
answer50
viewsA: Using another class Return
You need to call the method to make use of it. I leave below a commented example: public int totalFaltasAluno(int matricula) { int totalFaltas = 0; for(Integer item : faltas){ if(item == matricula){…
javaanswered Hiago Souza 5,837 -
3
votes2
answers37
viewsA: loophole
You can create a selector to facilitate your work, in the example below I create an algorithm using jQuery to listen to the keyup and the change of all elements possessing the property data-text-to.…
javascriptanswered Hiago Souza 5,837 -
1
votes1
answer46
viewsA: Reduce PHP code
The $_FILES is a associative array, then you can make use of the foreach and go through all sent items. Example: <?php // criando vetor com as extensões permitidas $extensoesPermitidas =…
phpanswered Hiago Souza 5,837 -
0
votes1
answer150
viewsA: Post php array Insert mysql
before anything else I suggest you take note of this information: Why should we not use mysql type functions_*? What you are sending is a JSON not a Array. The $_POST is an associative array of…
-
0
votes1
answer25
viewsA: PHP ERROR - On the Database Connection
Apparently your HTML is not sending the data. Check that the tag form has the attribute method with the value POST and ensure that within the form there are tags input or select with their…
-
1
votes1
answer150
viewsA: Match a route with "localhost:4200/test-(dynamic parameter)" at Angular 7
In his AppComponent just in the ngOnInit check the window.location.pathname which is what the angular router will scan to find the routes. Remember to insert into the main component of your…
-
1
votes1
answer206
viewsA: Creating a loop with php and mysql
You can work with the Functions Mysql to help you, at the time of Insert just call a programmed function that will already inform you what the next id you can use. I remember that if the id is the…
-
1
votes2
answers184
viewsA: Error: Typeerror: $http.get(...). Success is not a Function
The method get of $http returns a Promise, follows below the correct way to make the call. Controller app.controller('MainController', ['$scope', 'emails', function($scope, emails) {…
-
8
votes3
answers259
viewsQ: Negative lookbehind only works on Google Chrome, is there an alternative to other browsers?
The regex /(?<!,),(?!,)/ has instability in some versions of browsers. I found this regex in the system of the company I work, and I didn’t understand very well the purpose of it. Apparently the…
-
2
votes2
answers79
viewsQ: Detecting if a Setter of a property has been called
Hello I wonder if there is a way to find out if the value of a property has changed. Example public partial class MinhaClasseExemplo { public int Id { get; set; } public String Nome { get; set; }…
-
0
votes1
answer166
viewsQ: Updating only uploaded properties - Entity Framework
I am trying to abstract the methods to save/update the data of my models. I did a generic routine to abstract this operation but I have a little problem. In the scenario below I have the model…
-
0
votes2
answers456
viewsA: block access to a particular directory via htaccess with password
I think what you want is a way to not index the domain home page, you can put an "index.php" to authenticate and create in the same an algorithm to list the folder on the web. Follow a script I…
-
1
votes1
answer53
viewsA: URL with "app" instead of "www"
What you’re looking for is about DNS The DNS (Domain Name System) servers are responsible for locating and translating to IP numbers the addresses of the websites we type. It’s like a calendar. The…
-
0
votes2
answers107
viewsQ: Problem with C#Threadstatic
I own a system where his authentication keeps a token in a Threadstatic property. It turns out that Monday, he started distributing the tokens incorrectly (after windows server update). I made the…
-
0
votes1
answer37
viewsQ: Angular: Problems with Touchevents
I need to detect a touchstart, one touchend and a touchmove to make a selection of days as the user drags his finger on the screen. However touchmove apparently not made for this purpose. As an…
-
1
votes1
answer162
viewsA: Production build problem when using Cryptojs
After suffering a little I managed to solve my problem, I don’t think it was the best way. So if anyone has another solution for that I’ll be modifying the correct answer. What I did to solve the…
-
1
votes1
answer162
viewsQ: Production build problem when using Cryptojs
I have an application written in Angular 6 and there was a need to send a hash to the client. The contractor approved only the use of the library crypto-js. I did the implementation and everything…
-
0
votes1
answer58
viewsA: Notice: Undefined index: $_FILES
To send files multipart with Ajax you need to use the FormData. I edited your script with an example of how to do it. <script> $(function(){ var url = 'Chamadas/adicionarAnuncio.php'; function…
-
1
votes1
answer2078
viewsA: Notice: Undefined index
The problem is because you put the attribute href in the Submit input and does not put the php record. in action form. Remove the add attribute to action and try again. I leave below your edited…
-
0
votes2
answers13578
viewsA: Mysql error "expects Parameter 1 to be Resource, Boolean Given in"
The problem is because the method mysql_query requires a parameter with the database connection. I leave below an example. Remember to modify the data for connection to the database. I leave as a…
-
0
votes1
answer223
viewsA: Spring boot + Angular 6 + Heroku
Maicon the configuration { useHash: true } is being enabled in the routes of your application. Or is the url https://sgm1.herokuapp.com/login is being called as follows…