Posts by André Martins • 1,481 points
98 posts
-
-2
votes1
answer46
viewsA: Method that returns False and to While True
There are some basic errors of interpretation in your code, in case you need to have a stop control. follow the example. import java.util.Scanner; public class AcoesParada { Double saldo = 0D;…
-
1
votes1
answer59
viewsA: How to use String to quit while repetition?
add before the end of the while. System.out.println("Deseja sair? digite sair"); String s = teclado.next(); if (s.equals("sair") || s.equalsIgnoreCase("sair")) { nota = -1; } remembering that its…
javaanswered André Martins 1,481 -
0
votes3
answers41
viewsA: Problems adding multiple elements to Arraylist
Your code needs a little tweaking. just set the list type, modified the change in the for to loop, after all it is always good to remember to close the resource. public static void main(String[]…
javaanswered André Martins 1,481 -
1
votes1
answer27
viewsA: Doubt how to display the result using Joptionpane
An alternative is to store the result in a variable and then use public class Loja0001 { public static void main(String[] args) { String[] produto = new String[6]; produto[0] = "cola = 5,00";…
-
0
votes2
answers166
viewsA: Doubt with "Return" in functions (java)
The fact is if you’ve determined a kind of return that needs to be met, it’s a Java rule, at least as far as I know. may even be scammed as I will show but it is not interesting. The scenario that I…
javaanswered André Martins 1,481 -
10
votes2
answers97
viewsQ: Is it correct to program returning exceptions to the expected event?
When we are developing a software we can go through situations where something happens that we are not expecting and usually when it happens in many programming languages we can treat it within…
-
1
votes2
answers175
viewsA: Return of prime numbers?
Prime numbers are numbers larger than 1 (one) and are divisible only by the number 1 (one) and by itself, that is if in any case we obtain the rest division equal to zero from its predecessors it…
-
1
votes1
answer267
viewsA: How to create and write txt file in java?
In the java.io package we have everything we need to work with reading and writing files. Example 01 of file writing: public class TesteEscritaDeArquivo_1 { public static void main(String[] args)…
javaanswered André Martins 1,481 -
2
votes1
answer232
viewsA: Error while trying to connect Mysql database to eclipse using JDBC
Let’s create a connection using Mysql, the first thing you need to check is if your database is active, as it is using mysql you can use a software or even the terminal of your computer to do this,…
-
0
votes1
answer75
viewsA: Recover value in localstorage
To work with Storage you need to set your data in your Storage and then you can recover the data. to set a Storage Location you can do as below: localStorage.setItem("alunos",…
-
0
votes2
answers43
viewsA: Count of boolean values
Another option is to make the comparisons by the values of each radio, is very similar to the answer of @Augusto Vasques but with some different peculiarities. // selecionamos todos os inputs sex…
javascriptanswered André Martins 1,481 -
0
votes2
answers89
viewsA: Searching for letters in an array created by random numbers
it is very unlikely that this test crash, when we have an algorithm with many conditions a good request would be to decrease these conditions in your test. let tabNombres = []; let tabLettres = [];…
-
2
votes2
answers58
viewsA: Creation of local server with express
To start a server using the express framework we need: define the port const porta = 3003 import the express const express = require('express') assign to the app or other constant of your preference…
-
1
votes2
answers73
viewsA: How to access a variable from another function?
In javascript we have the scopes of variables, we should keep in mind that we should: 1) restrict to the maximum the use of that scope, but what that scope is? The global scope is where you can have…
-
0
votes1
answer99
viewsQ: Future of Javascript, how can I know about possible language innovations/abilities?
It is a fact that Javascript has grown a lot in recent years and has become bigger and bigger, but what would be the paths to stay tuned in relation to the new Ports? We have the MDN What are the…
javascriptasked André Martins 1,481 -
1
votes1
answer51
viewsA: Modify Paginate in Laravel 5.8
To change the amount to be displayed create a variable in your controller protected $totalPaginas = 30; then an example could be your index page, which I I suppose that could bring all the results…
laravelanswered André Martins 1,481 -
0
votes1
answer42
viewsA: Arrayindexoutofboundexception error when trying to store values in the array
It would be better to separate the class from the execution, you mixed things up a bit. you are trying to add the total to the vector Notas at position 5? double calcularMedia() { //aqui total =…
-
0
votes4
answers140
viewsA: Exercise: Quick replacement
Let’s understand what the function replace does? the function takes two parameters the first for search and the second for substitution let nome = "noite" console.log(nome.replace("noite", "dia"))…
-
3
votes2
answers1285
viewsQ: How to define private attributes in a constructor function using javascript
In javascript we can have the constructor functions that are of type Function, with them we can instantiate objects as in the following example: function Pessoa(nome="Usuário Anonimo", idade = 00,…
-
1
votes3
answers2267
viewsA: How to draw objects from an array?
When it comes to random numbers, you can use the Math.Random() method, which has a numbering between zero(0) and one(1), e.g.: 1.x numbers or 0.x numbers, in order not to bring only this variant and…
-
1
votes1
answer38
viewsA: Check if imput is Int in a netbeans interface
Thinking about input conditions in java, how can we verify if a given value is Integer? Integer.parseInt(valor) of course java is a strongly typed language and this helps on inputs, but when it…
-
0
votes2
answers111
viewsA: Return initial condition after false
You may be using a repeat loop, I just put the while (true), when it is false it ends. public static void main(String[] args) { boolean saida = true; while (saida) { Scanner s = new…
javaanswered André Martins 1,481 -
0
votes1
answer488
viewsA: AJAX in the Laravel
Hello one way you can do this is by using Axios which is an http client created in js. but if I just say it will become very vague then I’ll make a very simple example. Step 1: Create a model and…
-
-1
votes1
answer474
viewsQ: Problem with Cors Laravel project 5.5 and Vuejs
In an Laravel project using the features of an API I have some logos and I have my endpoints in the Laravel.php api file <?php Route::post("auth", "Auth\AuthController@authenticate");…
-
0
votes2
answers538
viewsA: How to pass parameters from Component to vuex in an Laravel and vuejs project?
Only a lack of key for a certain value. traded this: this.$store.dispatch('editCategories',this.id,{name: this.category.name}) therefore: this.$store.dispatch('editCategories',{id:this.id,name:…
-
0
votes2
answers538
viewsQ: How to pass parameters from Component to vuex in an Laravel and vuejs project?
I am using in my project Vuex with modules and Axios to work with the API created in Laravel, how to pass parameters in an edition of a data recovered from an API I have my Store export default {…
-
3
votes2
answers78
viewsQ: Is it correct and or indicated to merge in a 5.x Laravel project with the components developed in Vuejs 2 all within the same directory?
It is known that the integration between Laravel and Vue is good, however it would be indicated to use the Vue components within a Modular project? each time the application grows will be more tied…
-
5
votes1
answer147
viewsQ: Is it correct to leave the responsibility of freight calculation at the front end?
We all know the agility that certain code written on the front end has and makes our applications faster. It would be correct to calculate a freight at the front end of the application and send this…
-
-1
votes1
answer37
viewsQ: How to change a variable value only when radio buton is checked
In the archive .php there is a certain variable. <?php $freteselecionado = "<script>document.write(checado)</script>"; So I have two input of the kind radio to receive the value.…
-
0
votes1
answer194
viewsA: Delete function kills session in Laravel 5.5
The problem that was happening is that the function register() in class RegisterUser when registering a user it was automatically logged in to the system, and I always registered and tried to…
-
1
votes1
answer194
viewsQ: Delete function kills session in Laravel 5.5
When deleting a selected user, other than the currently logged in user, the function modeloReferenciadoPorObjeto->delete() of Laravel is terminating the logged-in user session. public function…
-
0
votes1
answer677
viewsA: Not to pass an element ID through the Laravel URL
I did a slightly different example in a simple way as one can delete a certain data from a table. in Controller I did <?php namespace App\Http\Controllers; use App\Empresa; use…
-
0
votes2
answers569
viewsA: Return False or True
Your code does not have much logic, to do this exercise just think about the rest of the division, if the rest of the division of the first by the second is zero then it is multiple. public class…
-
0
votes1
answer188
viewsQ: Update with hasMany relationship for two inputs at the same time in Windows
Well the problem that happens is this, have in my application the phone field that is present in a relationship for personFisica then a person has a hasMany relationship for phones and that in turn…
-
1
votes1
answer93
viewsQ: Problem returning data in view with Laravel 5
I’m trying to bring data to a view and I’m not succeeding. I have my class of Person. class Pessoa extends Model { public function telefones() { return $this->hasMany(Telefone::class); } and in…
laravel-5asked André Martins 1,481 -
-2
votes3
answers926
viewsA: PHP-Mysql Error Return: Call to Undefined Function
Hello a way to make a successful connection could be done using PDO. http://php.net/manual/en/intro.pdo.php <?php class PDOUtil { private static $conexao = null; public static function…
-
0
votes1
answer617
viewsQ: Problems configuring routes on apache2 server with Laravel 5.1
I was doing a local project and always ran it with php artisan serve and everything was going perfectly now that I am going up the project to a machine of the digitalocean I am having problems with…
-
0
votes1
answer1233
viewsQ: Document root Apache 2 cannot find routes from the Apache
Assuming we are on a linux server we have the following password. the root Document pointed to <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/laravel/public…
-
0
votes1
answer305
viewsQ: how to import a play framework 2.5 project into the eclipse
Hello how could I import a lay framework project into the eclipse, in previous versions only the eclipse command within the project was enough but now the documentation is a little confused in this…
-
0
votes1
answer409
viewsQ: Problem with select and use of ajax in Laravel 5
I am trying to implement a select with ajax in Laravel 5 have the following situation. a state model class class Estados extends Model { protected $table = 'estados'; public function cidades() {…
-
0
votes0
answers136
viewsQ: Run cycle of Migrations ordered in Laravel 5, how to change it?
I’m starting to use that framework and I realized that the migrations when not created in a time cycle for execution there can be several errors, this is normal? For example if you create a…
-
2
votes1
answer1061
viewsQ: Artisan command not to lose data from database
Hello I am starting to work with Laravel 5 and I am having a problem when I run the migrate commands the data is lost in the database, this is expected? the command php artisan migrate works on the…
-
2
votes1
answer1996
viewsQ: how to configure the eclipse IDE to fully read a 5 Standard project
When you create a project with Composer and import into the eclipse Workspace some files do not appear as . env . gitignore or . json alguem knows how to configure the eclipse to be able to read and…
-
1
votes1
answer943
viewsQ: Orange Permissions 5 using Homestead
I’m using Laravel 5 with a Homestead box using Vagrant and virtualbox for this, as demonstrated in the framework documentation: http://laravel.com/docs/5.1/homestead#installation-and-setup the…
-
1
votes0
answers157
viewsQ: Problem with PHP XAMP on MAC OS X
I put XAMPP php in the path and this error is showing: PHP Warning: PHP Startup: Unable to load Dynamic library '/Applications/XAMPP/xamppfiles/lib/php/Extensions/no-debug-non-zts-…
-
1
votes0
answers70
viewsQ: Continuous delivery
Since when we develop a system in local PHP without any kind of framework just using the paradigms of Object Orientation, what is the best way to deliver this system continuously or is delivery in…
-
1
votes1
answer606
viewsQ: User control with PHP permissions
Good people took a system developed in PHP with mysql database running and passed me the task of creating user profiles or a tool for the system administrator to put what he wants the user to see,…
-
1
votes1
answer528
viewsQ: Vagrant related problem while running Vagrant up on mac os x
I am trying to bring a box to run as a test system however I am not succeeding, I am using mac os x Yosemite and have already installed the virtual box and the same is in the following way…
-
1
votes0
answers38
viewsQ: problem when moving images to a directory on the server
I am trying to move an image to a particular directory of the public_html server/ I do not know what may be happening, because it is a linux server and just a chmod 775 public_html/uploaded pointing…
-
1
votes1
answer149
viewsQ: Responsive image, does not redeem correctly
I’m developing a website, and an image is not resizing as I expected, I have the image: <div class="cover"> <div class="cover-image" style="background-image :…