This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private Handler handler; | |
| @Backgroud public void atualizarEstadoCasa() { | |
| // ir no servidor | |
| // para atualizar a tela vc tem que fazer na thread a UI | |
| atualizarTelaComEstadoDaCasa(); | |
| // agendar uma nova atualizacao | |
| handler.postDelayed(20000, new Runnable() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.post("url-de-quem-trata-post-do-modal.php", $("#id-do-form-do-modal").serialize(), | |
| function(data) { | |
| if (data == "ERRO") { $("#id-do-form-do-modal p#mensagem-erro").val("Ocorreu um erro de validacao"); } | |
| else { | |
| // deu tudo certo, fecho o modal | |
| $("#id-da-div-do-modal").hide(); | |
| $("#id-da-tabela").append("<tr><td>bla</td>"); | |
| } | |
| } | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| print("Enter the number of restarts"); | |
| retries = parseInt(readline()); | |
| print("Enter the number of flips"); | |
| flips = parseInt(readline()); | |
| print("Enter the number of literals"); | |
| num_literals = parseInt(readline()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public java.lang.Object convertToObject(java.lang.Object) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException; | |
| Code: | |
| 0: nop | |
| 1: nop | |
| 2: nop | |
| 3: nop | |
| 4: nop | |
| 5: nop | |
| 6: nop | |
| 7: nop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package br.ufrj.labase.model; | |
| import br.ufrj.labase.model.exception.UnexpectedException; | |
| import java.io.IOException; | |
| import java.io.PrintStream; | |
| import java.lang.reflect.Constructor; | |
| import java.lang.reflect.InvocationTargetException; | |
| import java.lang.reflect.Method; | |
| import java.util.HashMap; | |
| import java.util.Iterator; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public java.lang.Object convertToObject(java.lang.Object) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException; | |
| Code: | |
| 0: getstatic #26; //Field java/lang/System.out:Ljava/io/PrintStream; | |
| 3: new #16; //class java/lang/StringBuilder | |
| 6: dup | |
| 7: invokespecial #17; //Method java/lang/StringBuilder."<init>":()V | |
| 10: ldc #27; //String convertendo... | |
| 12: invokevirtual #19; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; | |
| 15: aload_1 | |
| 16: invokevirtual #28; //Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % slides | |
| member(X, [X|_]) :- !. | |
| member(X,[_|Y]) :- member(X,Y). | |
| append([], L, L). | |
| append([X|L1], L2, [X|L3]) :- append(L1, L2, L3). | |
| add(X, L, [X|L]). | |
| del(X, [X|Tail], Tail). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| from django.core.management import setup_environ | |
| from people import settings | |
| setup_environ(settings) | |
| from people.models import * | |
| usuario = Usuario(email = "flavio.cdc@gmail.com") | |
| usuario.save() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python2 | |
| import sys | |
| for line in sys.stdin: | |
| for s in line.split(" "): | |
| if s.startswith("$(") and s.endswith(")"): | |
| print s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import gobject | |
| import dbus | |
| import dbus.service | |
| import dbus.mainloop.glib | |
| import os.path | |
| APP_ID="pianobar-mediakeys" | |
| pianobar_key_bindings = {} |