Posts by Arthur Siqueira • 1,609 points
92 posts
-
1
votes1
answer203
viewsQ: How to destroy property of an object dynamically?
I’m implementing a chain of responsabilities, and, when the desired object is returned, it continues with the instances of the items after it: const ITEM_SELECIONADO = "EXEMPLO" export interface…
-
1
votes1
answer159
viewsQ: How to create function with dynamic feedback type?
When working with Typescript, I came across a problem. I have a function that returns an object of type ObjetoComposto<any | any[]>, but I would like to define the type of object that will be…
-
1
votes2
answers580
viewsQ: Angular ignores *ngFor in select option
I’m trying to make a field like select in an Angular form with Materialize, and fill it dynamically, but when arriving at the directive *ngFor, Angular now ignores the field: HTML: <!-- campo que…
-
0
votes1
answer255
viewsA: How to break line after button in Angular with Materialize?
To solve the problem, I created in the component’s CSS a class called bloco: .bloco{ display: block; min-width: 10em; } And added the class to both buttons (creating a span to separate them): <a…
-
-2
votes1
answer255
viewsQ: How to break line after button in Angular with Materialize?
Making a small page using Angular, I came across a problem of overlapping two buttons. When they are on screens more than 420 px wide (cell phone in horizontal position, for example), it does not…
-
0
votes1
answer674
viewsQ: How to process JSON that has an object array as property with Observable (Angularjs)?
I have an API that returns objects JSON as follows: { "data": [ { "nome": "objeto1" }, { "nome": "objeto2" }, ] } However, when receiving the objects in the service, I can’t just pick up the…
-
1
votes1
answer522
viewsA: How to dropdown menu in Angular with Materialize CSS?
I was able to make the menu work, but for that, I had to give up Jquery. Just as @Leandrade mentioned in the comments, I couldn’t use Jquery, because it was conflicting with Angular, and I had to do…
-
0
votes1
answer522
viewsQ: How to dropdown menu in Angular with Materialize CSS?
I was doing a small project with Angular (V8.2.5) and Materialize (materialize-css v1.0.0), and decided at a certain point to insert a dropdown menu into a header component. Following the…
-
1
votes1
answer246
viewsQ: Classes with private Javascript properties
I’m starting my programming frontend, and started messing with classes in Javascript (following the standards set out in Ecmascript 6). But I’m having trouble using private property and methods. I…
-
1
votes1
answer45
viewsA: Type system of youtube?
Although the question is a little vague, I recommend using functions JavaScript, as window.focus(), to accomplish the task. I recommend reading a little about the manipulation of media with…
javascriptanswered Arthur Siqueira 1,609 -
3
votes1
answer71
viewsQ: How to set 'default' keys and values for array passed as parameter in PHP?
I did a function that takes several arguments, and I decided to pass them by a array to be executed. Ex: public function funcTeste(array $dados){ return \count($dados); } But this array must have a…
-
-1
votes2
answers172
viewsA: Good practice with Phpunit tests
Start by dividing the test into smaller tests to make it easier to visualize: public function testCreate(){ // code } public function testShowCard(){ // code } public function testUpdateField(){ //…
-
0
votes1
answer236
viewsQ: How to realize the Seed of a Factory within another class with Phpunit/Laravel?
I was studying the framework Laravel, and I was left with the following doubt: there is a way to realize the Seed of a factory within a common project class? It would be like calling command php…
-
0
votes1
answer22
viewsQ: How to create a new instance instead of pointing to the same instance when defining variable?
When defining a variable of type Carbon i cannot copy the object (create new instance with the same properties), just point to the same instance, forcing me to create new objects manually. Example:…
-
2
votes2
answers458
viewsA: Error while clearing buffer in GCC (Ubuntu 18.04)
After reading the article the user anonimo left in the comments, and to access this page, I came across some alternatives to perform the cleaning I needed (and make the computer "forget" that I…
-
2
votes2
answers458
viewsQ: Error while clearing buffer in GCC (Ubuntu 18.04)
I was watching a tutorial of C, and appeared a part about buffer cleaning using the functions fflush and __fpurge. So far so good, but when I tried applying with __fflush, the GCC returns me the…
-
1
votes2
answers107
viewsA: Problem with the include
Have you tried using the relative path? Maybe it works: . = current directory .. = previous directory / = root (systems *nix) ~ = home (also in *nix) Or use the dirname(). ex: require_once…
-
1
votes3
answers92
viewsA: Beginner Language Error C Code Blocks
I can give you a LIST of mistakes that were made there. To begin with, there is no function main(),which makes the code not even executable (if, and only if, the compiler accepts it). Instead of…
canswered Arthur Siqueira 1,609 -
0
votes0
answers99
viewsQ: How to make explicit variable type declaration in PHP?
Taking a course on the Internet, I saw the instructor saying that from PHP 4 (he used 3, so did not test) it was possible to make the explicit declaration of type in object attributes as follows:…
-
1
votes2
answers2051
viewsA: Authentication error sending file to repository on Github
Try to do that: $ git config --global user.name seu_nome_de_usuario $ git config --global user.email [email protected] If it doesn’t work, as you are using HTTPS, try to verify if the password you are…
-
0
votes1
answer262
viewsQ: Command to open the terminal in a specified folder
I am producing some scripts to prepare the desktop, and wanted to leave the terminal in a predefined folder. How to do this? I’ve tried using cd ./pasta_selecionada and cd pasta_selecionada, but…
-
0
votes1
answer37
viewsQ: I need to modify the action taken when closing a Jframe
I am developing an application with persistence in Java for a college job, and I need the system to automatically save the data when closing the application (with a ready function provided by the…
-
-2
votes1
answer83
viewsQ: Laravel does not generate error while processing form with 'post'
I’m taking a course of Laravel, and in the course the instructor used a form that points nowhere to show a mistake of the type MethodNotAllowedHttpException. Until then, fine, but when processing…
-
0
votes4
answers295
viewsA: take only the decimal of a double
You can try a simple conversion: (int) num There are also the methods Math: Math.floor(num): returns a int with the value of double rounded down; Math.ceil(num): same thing, but rounded up;…
javaanswered Arthur Siqueira 1,609 -
0
votes2
answers33
viewsA: Routine doesn’t work
Substitute in.nextLine(); for in.next();
-
2
votes1
answer1911
viewsQ: How to switch between Java 8 and 11 on Ubuntu?
I made a few days ago the transition from Windows 7 to Ubuntu 18.04 LTS, and had some difficulties in the process. Well, let’s get to the details. I installed JDK 11 through the following command:…
-
1
votes2
answers567
viewsA: Is it possible to use the external terminal when running a Java program through Netbeans?
Not only is it possible but it’s super easy, as long as you’re with your environment variables (path) well configured. Also, for smaller applications I consider even easier (I only have problems…
-
0
votes2
answers120
viewsA: How to declare a vector with 2 positions?
When you want to declare an array, use square brackets. Example: double vetor1 []; By declaring its size and content, you can directly enter the data as follows: vetor1 = {x1, x2}; Or you can create…
-
1
votes3
answers67
viewsA: Every time I run always print Invalid login
Use the String class method equals() Notice how I rewrote your program: import java.util.Scanner; public class exercicio5 { public static void main(String[] args) { Scanner sc = new…
javaanswered Arthur Siqueira 1,609 -
0
votes4
answers25024
viewsA: Difference between If and Elif
Basically, a if is the first if, the else is when you want to make him complete some action if the if is false, and elif is when you have a if within a else Example: this code snippet: if(x==1): #…
pythonanswered Arthur Siqueira 1,609 -
1
votes2
answers74
viewsQ: Modify element placement using HTML and CSS
I’m having trouble getting an icon to stand on the side of an element without it overlapping the element. My code: body{ font-family: Times, serif; text-align: justify; background-color: #EBE9E9;…
-
1
votes1
answer32
viewsA: how to create a postgresql table? how do you use alter table and drop table? and what are the differences between Primary key and Foreign key?
Create table: CREATE TABLE tabela ( id INT NOT NULL, nome VARCHAR(15), data DATE, PRIMARY KEY(id) ); Delete table: DROP TABLE tabela; Change table (here it is a little abstract, would have to…
-
2
votes2
answers2004
viewsA: How to create a string array in C?
I believe the error is caused by this: char meses[12] How a char represents a character, when you point to meses[31], or something like that, you’re pointing to something that doesn’t exist. I’m not…
canswered Arthur Siqueira 1,609 -
1
votes2
answers2285
viewsQ: How to change the style of an "input" field of type "range" using only CSS (and maybe some webkits)?
I want to modify a field’s value indicator <input type="range"/>. I want to change the format and color of this indicator, as shown in the following images. This is the field I want to modify.…
-
0
votes2
answers122
viewsA: Check password fields with each other in java in spring
if((campo1.getPassword()+"").equals(campo2.getPassword()+"")){ //verdadeiro }else{ //falso } Try not to use the getText() in fields Jpasswordfield, because it was discontinued for that element.…
javaanswered Arthur Siqueira 1,609 -
2
votes3
answers140
viewsQ: Problems with <Progress> tag stylization in CSS
I’m having trouble styling a tag <progress>. I can not change the internal color and the inner part comes out half "square", sometimes even exceeding the margin. How can I solve? On the left…
-
0
votes4
answers153
viewsA: Public Static Void Does Not Work Properly - NETBEANS
When trying to execute a method, you have to put it inside a 'main'. As you defined the function as 'Static', it is not necessary to instantiate the class to use it: public static void main(String…
javaanswered Arthur Siqueira 1,609 -
2
votes2
answers140
viewsA: Maximum number of classes in Java
At first, there is no "limit", it depends on the complexity of your system. Imagine a bank (financial, in this case). You have several types of accounts: chain saving investment They are all derived…
-
0
votes3
answers479
viewsA: Question how to link between css and html
Insert the following inside the tag <head>: <link rel="stylesheet" type="text/css" href="./caminho_do_css.css"/> I hope I’ve helped ;) p.s.: Guanabara classes are mass hahahahaha…
-
1
votes1
answer197
viewsA: Accent problem ( -jar mysql)
Dude, I don’t know if it helps you, but take a look at your bank and see his "charset" (whether it’s UTF-8 or some other); Also try to use HTML within Java code (a nice hack, but it works). Example:…
-
1
votes1
answer136
viewsQ: How to make a div be positioned as a block in the middle of another div?
At first, the question may sound strange, but my problem is this:: So far, I own the screen below: But what I want to do is create a block, like the one of the structure circled below, like a blog…
-
1
votes1
answer75
viewsQ: How to prevent an object from being instantiated with a certain property?
I want to prevent an object from being instantiated with a certain value (for example, prevent a "battery" object from having a negative value or above 100). How can I prevent the instance from…