This file contains 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
import static groovyx.gpars.GParsPool.withPool | |
def urls = [ | |
'http://groovy.codehaus.org', | |
'http://gpars.codehaus.org', | |
'http://gr8conf.org/' | |
]*.toURL() | |
println withPool { | |
urls.collectParallel { |
This file contains 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
import org.codehaus.groovy.runtime.InvokerHelper | |
class A { String nome; Integer idade } | |
class B { String nome; Integer idade } | |
class C { String nome; Integer idade } | |
A a = new A() | |
B b = new B(nome:'jose', idade: 10) | |
C c = new C(nome:'bira', idade: 99) |
This file contains 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
import java.util.Map; | |
import java.util.HashMap; | |
public class Celular{ | |
public String traduzCaracter(String frase, int posicao){ | |
Map<String, String> dic = new HashMap<String, String>(); | |
dic.put("A", "2"); | |
dic.put("B", "22"); | |
dic.put("C", "222"); | |
dic.put("D", "3"); |
This file contains 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
class UrlProcessor{ | |
public void detalhamentoUrl(String site){ | |
try{ | |
if(site.substring(0, 3).equals("htt")){ | |
java.net.URL url = new java.net.URL(site); | |
String path = url.toURI().getPath().substring(1, url.getPath().length()); | |
System.out.println("protocolo: "+url.getProtocol()); | |
System.out.println("host: "+url.getHost().substring(0,3)); |
This file contains 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 post_to_url(url, params) { | |
var form = document.createElement('form'); | |
form.action = url; | |
form.method = 'POST'; | |
for (var i in params) { | |
if (params.hasOwnProperty(i)) { | |
var input = document.createElement('input'); | |
input.type = 'hidden'; | |
input.name = i; |
This file contains 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
arquivos = | |
[ | |
[ | |
bloco:'1#Dados Origem do Tipo Informação = 1 (Contrato)', | |
detalhes:[ | |
'Tipo Registro | Num | 1 | Identifica o tipo do registro: 0 = Header 1 = Detalhe 9 = Trailer', | |
'Elemento | Char | 4 | Sigla do elemento (centro de custo) ', |
This file contains 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
93#GO#ABADIA DE GOIAS #52137 | |
50#MG#ABADIA DOS DOURADOS #24622 | |
93#GO#ABADIANIA #24615 | |
50#MG#ABAETE #28989 | |
17#PA#ABAETETUBA #5603 | |
32#CE#ABAIARA #5586 | |
39#BA#ABAIRA #2448 | |
39#BA#ABARE #33682 | |
73#PR#ABATIA #15758 | |
75#SC#ABDON BATISTA #44918 |
This file contains 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
l = [ | |
"MUNICIPIO.put(\"50830\",\"1\"); ", | |
"MUNICIPIO.put(\"9465\" ,\"2\"); ", | |
"MUNICIPIO.put(\"35697\",\"3\"); ", | |
"MUNICIPIO.put(\"50919\",\"4\"); ", | |
"MUNICIPIO.put(\"50971\",\"5\"); ", | |
"MUNICIPIO.put(\"35680\",\"6\"); ", | |
"MUNICIPIO.put(\"50964\",\"7\"); ", | |
"MUNICIPIO.put(\"15978\",\"8\"); ", | |
"MUNICIPIO.put(\"50957\",\"9\"); ", |
This file contains 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
/* | |
VERSÃO PARA SERES HUMANOS | |
No dia 18/03/2015 a Galera do DojoRio resolveuresolver o problema o jokenpo elevado a sheldon cooper. O resultado ofi um dojo com várias risadas e um resultado bem antes das 211:00 da noite. | |
*/ | |
plays = ['scissor', 'paper', 'rock', 'lizard', 'spock'] | |
def play(play1, play2){ | |
warning = {i, n -> (i + n) % 5} | |
position = plays.indexOf(play1) | |
play1 == play2 ? 'draw' : play2 in [plays[warning(position, 1)] , plays[warning(position, 3)]] ? 'play1' : 'play2' |
This file contains 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
@Entity | |
@IdClass(PersonKey.class) | |
public class Person{ | |
@Id | |
int taxid; | |
@Id | |
String countryCd; | |
@Transient | |
PersonKey key |