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
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
<appender name="sysout" class="org.apache.log4j.ConsoleAppender"> | |
<layout class="org.apache.log4j.PatternLayout"> | |
<param name="ConversionPattern" | |
value="%d{HH:mm:ss} %5p [%-20c{1}] %m%n" /> | |
</layout> | |
</appender> |
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
0: ldc #2; //String select u from | |
2: astore_1 | |
3: new #3; //class java/lang/StringBuilder | |
6: dup | |
7: invokespecial #4; //Method java/lang/StringBuilder."<init>":()V | |
10: aload_1 | |
11: invokevirtual #5; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; | |
14: ldc #6; //String User as u | |
16: invokevirtual #5; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; | |
19: invokevirtual #7; //Method java/lang/StringBuilder.toString:()Ljava/lang/String; |
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
0: ldc #2; //String | |
2: astore_1 | |
3: iconst_0 | |
4: istore_2 | |
5: iload_2 | |
6: sipush 30000 | |
9: if_icmpge 37 | |
12: new #3; //class java/lang/StringBuilder | |
15: dup | |
16: invokespecial #4; //Method java/lang/StringBuilder."<init>":()V |
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
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
apply id: 'nome-projeto' | |
version = '0.1-SNAPSHOT' | |
repositories { | |
mavenCentral() | |
mavenRepo urls: 'https://repository.jboss.org/nexus/content/groups/public/' | |
} |
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.com.caelum; | |
import javax.persistence.Entity; | |
import javax.persistence.EntityManager; | |
import javax.persistence.EntityManagerFactory; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.Id; | |
import javax.persistence.ManyToOne; | |
import javax.persistence.Persistence; |
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
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
// apply plugin 'war' | |
version = '0.1-SNAPSHOT' | |
compileJava { | |
options.encoding='UTF-8' | |
} |
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
@WebServlet(urlPatterns = { "/chat/*" }, asyncSupported=true, loadOnStartup = 1) | |
public class ChatServlet extends HttpServlet { | |
private Queue<AsyncContext> clients = new ConcurrentLinkedQueue<AsyncContext>(); | |
private BlockingQueue<String> messages = new LinkedBlockingQueue<String>(); | |
private int contador; | |
static { | |
System.out.println("tomcat carregou?"); | |
} |
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
class LRUCache extends LinkedHashMap<String, String> { | |
private int tamanho; | |
public LRUCache(int tamanho) { | |
super(3, 0.75f, true); | |
this.tamanho = tamanho; | |
} | |
protected boolean removeEldestEntry( | |
java.util.Map.Entry<String, String> eldest) { |
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
#lang racket | |
(define (pontos x) | |
(define (soma-lista x) (apply + x)) | |
(define (strike? x) (= (length x) 1)) | |
(define (spare? x) (= (soma-lista x) 10)) | |
(define (pontos2 jogada-anterior jogadas) | |
; devolve a proxima jogada, que pode ter um ou dois lances | |
(define (proxima-jogada) | |
(if (= (first jogadas) 10) |
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
Query query = session.createQuery("select sum(p.valor) " + | |
"from ParcelaDeAula as p where " + | |
"p.contrato.dataDeCriacao <= :data " + | |
"and " + | |
"(p.dataDePagamento >= :data " + | |
"or (p.situacao = :situacao and (p.dataDePagamento = null and p.dataOriginalDeVencimento >= :data)) " + | |
")"); | |
query.setParameter("data", data); | |
query.setParameter("situacao", SituacaoDeParcela.PAGO); |
OlderNewer