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
-Xms740m -Xmx1024m -XX:MaxPermSize=512m |
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
o = [[id: 1, nome: 'jose'], [id: 2, nome: 'maria']] | |
o.collect{ it << [idade: 10*it.id] } | |
println o |
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 RecursiveMap{ | |
public static TreeMap<String, String> routeCalculation (Map<String, TreeMap<String, Integer>> cityMaps, TreeMap<String, String> rota) { | |
//Map<String, ArrayList<String>> mapping = TrainsInformation.drawAllRoutes(cityMaps); | |
String originCity = rota.get("ORIGIN_CITY" ); | |
String destinationCity = rota.get("DESTINATION_CITY"); | |
String distance = rota.get("DISTANCE" ); | |
String max = rota.get("MAX" ); | |
String routeMapping = rota.get("ROUTE_MAPPING" ); | |
Integer parsedDistance = Integer.parseInt(distance); |
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
from google.appengine.api import users | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp.util import run_wsgi_app | |
from google.appengine.ext import db | |
from google.appengine.ext.webapp import template | |
from google.appengine.api import memcache | |
# Set the debug level | |
_DEBUG = True |
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) ', |
OlderNewer