Posts by Pedro Laini • 2,547 points
75 posts
-
15
votes4
answers17968
viewsA: Remove elements from a Python List
The reference of listaDois is equal to that of the listaUm, when you did listaDois = listaUm. So when it changes one is changing the other. Try to copy the array this way: listaDois = [n for n in…
-
6
votes4
answers18668
viewsA: Javascript money format with Angularjs and jQuery
Use the currency in accordance with that documentation. You can also specify which symbol separates decimal and integer numbers and how many decimal places you want EDIT: This filter is only to…
-
1
votes5
answers26385
viewsA: What is the best practice to know if an Row exists in a SELECT in Mysql?
If only to know EXISTE ROW COM usuario = 'exemplo', I recommend using SELECT COUNT(1) FROM tabela where usuario = 'exemplo'. For the count(1) go through the table, check if the condition is met, and…
-
23
votes2
answers8037
viewsQ: Arraylist x List
What is the difference of declaring ArrayList and List for lists in Java? What are the advantages of using one or the other?
-
0
votes3
answers919
viewsA: String Suffix and Prefix. Take a piece that serves both
I don’t know what the code in C would look like, but let’s take it step by step: 1 Pass string to function 2 Declare 1 array for prefixes and 1 array for suffixes 3 Declare 1 variable to count how…
c#answered Pedro Laini 2,547 -
0
votes5
answers364
viewsA: Hierarchy between CSS styles
So that your configuration is not overwritten, put !important .tema-1 { background-color: green !important; } .tema-2 { background-color: red; }…
-
5
votes1
answer3521
viewsA: Discover the object class in Java
You can do using instanceof As there are few types you need to check can do something like this: for(Object p: parametros){ if(p instanceof Integer){ Util.setParametros((Integer) p); //... } else…
-
3
votes1
answer465
viewsA: Error rake db:create
This is because you are using rake version 10.4.2 and the system is ordering version 10.3.1. You have 2 options: 1) Uninstall the current Gem and install the version the program is requesting. open…
ruby-on-railsanswered Pedro Laini 2,547 -
0
votes3
answers2032
viewsA: Select from the last records sorted by 1 field
You can do it this way too: SELECT TOP 3 FROM TB ORDER BY Data DESC, Nome ASC
-
5
votes6
answers19681
viewsA: How to fix this error "Error cannot resolve Symbol R" in Android Studio
That’s not the root of the problem. The R is an automatically generated class, but only when the project has no error that can prevent it from being generated. Go on Window -> Show view ->…
-
0
votes2
answers1183
viewsA: Add multiple objects to a list
This may be happening because the program is interpreting the object that is in the list and the object that you are adding, as the same object! Thus, it just changes the memory reference of the…
java-eeanswered Pedro Laini 2,547 -
1
votes1
answer75
viewsA: Large Number - How to get the value
You need to know the size of the data you expect to receive. See the table with the data types and their respective size in this documentation Depending on the size of the number you expect, even if…
c++answered Pedro Laini 2,547 -
0
votes2
answers1122
viewsA: Get checkbox values in Datatable with paging
My suggestion in this case is to use JSF... because it has a lot of sample code and in it you can create tables with ease. for example: In the code snippet below, you have a ManagedBean, bean named,…
jqueryanswered Pedro Laini 2,547 -
2
votes4
answers58320
viewsA: Error: Access denied for user 'root'@'localhost' (using password:NO) accessing Website
This error indicates that you are trying to access the database by the root user without entering the password.... Access denied for user 'root'@'localhost' (using password:NO) Check your database…
-
2
votes2
answers2270
viewsA: Separate each number with semicolon(;) in Java
You have any array: list Just do: String myJoinedString = Joiner.on(";").join(list); This code "joins" the elements of your list with the separator ; EDIT: With this code, Joiner does not "leave" a…
javaanswered Pedro Laini 2,547 -
1
votes1
answer151
viewsA: Insert controller into the application from the requested template
What you need is to use a framework that manages your dependencies. So you can separate each controller, service, Directive, into separate files, and manage them to be loaded only when needed. Take…
-
1
votes1
answer153
viewsA: Problems with ngModel required in directive
You don’t need a directive for that to happen. Angularjs has a two-way-data-Binding concept. When you place ng-model in your text field and declare the variable with the same name in your module,…
angularjsanswered Pedro Laini 2,547 -
1
votes4
answers1474
viewsA: service returning result of a $http
If it is information that you will use in global Scope, I recommend declaring the variable in global Scope, and within the function there assign value to it: $scope.retorno; and there in function:…
-
0
votes3
answers369
viewsA: Question about loading modules with requireJS and Angularjs
To make sense think of the following: An application with multiple modules, multiple controllers, directives, services, etc.. If you don’t use require, you need to include all the files at once in…
-
1
votes1
answer188
viewsA: JSON list in Angularjs not displayed
Angular produces and consumes Json objects in its http methods. Therefore, you need to annotate in your Contactource class: @Path("/contatos") @Produces(MediaType.APPLICATION_JSON)…
-
1
votes2
answers771
viewsA: Dynamically manipulate an array with multiple Angular.js controllers
Then you need to declare the array in a global Scope, not within the controllers. Each controller has its own specific Scope, but when you create a variable in global scope (in the module that…
-
1
votes1
answer1157
viewsA: How to display a matrix graphically?
Can you create a panel and set its size, for example 50x50. Then you make a loop within another loop, to be able to make the rows and columns of the matrix and creates for each position a panel new.…
-
0
votes1
answer123
viewsA: save an object list
Create the logic to save a frame and then do: messageFacade.save(message); for(Frame f: listAllFrames){ frameFacade.save(f); }
-
0
votes1
answer961
viewsA: How to update Jtable used data from a database?
1) You need to create a method that returns the list of database elements. 2) Jtable has a Tablemodel, create a class that extends Defaulttablemodel. 3) Create a constructor that receives the list…
-
2
votes1
answer2506
viewsA: Insert data into a table from a Java form (Netbeans+SQL Server)
Jtable has a Table Model... create a class that extends Defaulttablemodel, and assemble your model.. modify the template, then make table.setModel(yourModel) Example: for a class with these…