Posts by Pedro H. N. Vieira • 503 points
10 posts
-
1
votes1
answer391
viewsA: How can a colormap of a surface be mapped to a scalar function?
Translated answer (original): In principle there are two ways to color a Plot surface in matplotlib. Use the argument cmap to specify a colormap. In this case the colour will be chosen according to…
-
2
votes1
answer391
viewsQ: How can a colormap of a surface be mapped to a scalar function?
Translation of question I asked in the OR: I have a scalar function that represents the electrical potential on a spherical surface. I want to plot , for a given radius, the surface and map its…
-
-1
votes2
answers911
viewsA: How can I use two methods in one line in python?
If the Keys of a dictionary are numbers (float or int), list(dict.keys()) returns an ordered list of them. Example: d=dict({5.1:"asd", 2.3:"bbjs", 4.0:"sdad", 3.6:"dsf"}) list(d.keys()) Out[54]:…
-
0
votes1
answer867
viewsA: Python Compare month list to base list and show both
I suppose it’s something like that: meses = ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'] valores = {'jan' : 12, 'fev' : 15, 'ago' : 10} for mes in meses: if…
pythonanswered Pedro H. N. Vieira 503 -
0
votes1
answer97
viewsQ: Concurrent list modification can cause "java.lang.Illegalargumentexception"?
I have a multi-threaded program that makes concurrent modifications to an unsynchronized list (by bad design decision). Sometimes, in a seemingly unpredictable way, I get…
-
2
votes1
answer2358
viewsA: My . jar files generated by Eclipse are not opening
Probably, when creating the file, the "Launch Configuration" option is selected the wrong class...…
-
0
votes1
answer1079
viewsA: Insert background image in Jpanel
I found a solution that consists of finding the absolute path of the image from the path from which the program is running; and adding to it the relative path of the image. Adapting to your program,…
-
1
votes2
answers821
viewsA: Jcombobox inside a Joptionpane
The question is not very clear. It seems that you want something to happen by clicking the button. In this case, use OptionDialog, that returns a int and, from the value returned, do something.…
-
2
votes1
answer99
viewsQ: Why is it that when I change the size of the window, the components are gone?
I built an application using windowbuilder eclipse. In it, when clicking with the mouse, a picture is drawn according to the last selected button. However, when I change the window size, all the…
-
28
votes5
answers1775
viewsQ: Why is it bad practice to have int attributes?
I saw in the answer to that question /questions/17015/qual-o-uso-de-uma-variável-estática-ou-final-em-java/17136#17136, that: It is bad practice to have int attributes, unless they are "constant" or…