Posts by iuridiniz • 272 points
7 posts
-
1
votes1
answer215
viewsA: Preventing Jframe from being moved on screen
Moving windows is the window manager, if you remove the title bar, it will make it difficult to move, although it is still possible in other ways (in linux for example, some task managers allow you…
-
0
votes3
answers655
viewsA: How to use a dictionary value to call a specific Python function?
I don’t know exactly what you want to do, but the simplest answer for you is: # nome = menuOpt[1] globals().get(nome)() But it is good not to let the code die if the name does not exist or if the…
-
2
votes2
answers350
viewsA: How to get the set of all Python arguments?
You can do: import inspect def func(a, b, c): frame = inspect.currentframe() #equivalente a sys._getframe(0) args_names, _, _, locals_ = inspect.getargvalues(frame) args = [locals_[i] for i in…
-
1
votes1
answer342
viewsA: Query in mysql GROUP BY listing and adding at the same time
Tries: SELECT nome, SUM(nota) AS `soma` FROM ps GROUP BY nome; DB: id | nome | nota ----+-------+------- '1', 'iuri', '10' '2', 'iuri', '80' '3', 'diniz', '4' '4', 'diniz', '10' '5', 'diniz', '6'…
-
3
votes2
answers1700
viewsA: Query to return only higher values
You should have mentioned which query you used, but try: SELECT contrato, MAX(ano) AS 'max_ano' FROM c GROUP BY contrato; or: SELECT contrato, MAX(ano) AS 'max_ano' FROM c GROUP BY contrato ORDER BY…
-
1
votes1
answer97
viewsA: How to use setText from a service running in java?
How you are running code on a thread separate, it is necessary that all interface requests are executed in the thread which is responsible for the interface since android UI is not "thread-safe".…
-
0
votes1
answer239
viewsA: How do I open a Service from a Broadcastreceiver?
You just need to start the service on onReceive the class that implements Broadcastreceiver: import meu.pacote.com.o.servico.MinhaClasseServico; import android.content.Context; import…