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.atalho; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Modifier; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.mockito.Mockito; | |
import net.sf.cglib.proxy.Callback; |
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
import java.util.Calendar | |
class Data (val data: Calendar,val ultimo:Int) { | |
import Data.Conjuncao | |
def mais(num: Int) = { new Data(data,num) } | |
def menos(num: Int) = { new Data(data,-num)} | |
def meses = { data.add(Calendar.MONTH, ultimo); this } | |
def meses(e:Conjuncao):Data = meses |
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.vraptor.scala; | |
import java.io.File; | |
import javax.servlet.ServletContext; | |
import javax.servlet.http.HttpServletRequest; | |
import br.com.caelum.vraptor.ioc.Component; | |
import br.com.caelum.vraptor.ioc.RequestScoped; | |
import br.com.caelum.vraptor.resource.ResourceMethod; |
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.teste; | |
import java.util.Set; | |
import javax.validation.ConstraintViolation; | |
import javax.validation.Validation; | |
import javax.validation.Validator; | |
import javax.validation.ValidatorFactory; | |
import org.hibernate.validator.constraints.ScriptAssert; |
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
//para compilar o exemplo faça => scalac arquivo.scala -Xexperimental | |
package br.com.caelum.dynamic | |
import java.util.{GregorianCalendar, Calendar} | |
import java.text.SimpleDateFormat | |
case class Contato(val nome: String, val email: String, val nascimento: Calendar) { | |
override def toString = nome + ";" + email + ";" + new SimpleDateFormat("dd/MM/yyyy").format(nascimento.getTime) | |
} |
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
import scala.reflect.api._ | |
import scala.reflect.runtime._ | |
import scala.reflect.runtime.Mirror._ | |
object Pimps{ | |
implicit def pimp(str:String) = new { | |
def test = println("hello") | |
} | |
} |
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 ExemploMaisComum { | |
private static List<Integer> numeros = Arrays.asList(1,2,3,4,5,6,7,8); | |
//passando por todos os números, a não ser que você programe a parada | |
public static void main(String[] args){ | |
List<Integer> achados = new ArrayList<>(); | |
for(int n : numeros){ | |
if(n % 2 == 0){ | |
achados.add(n); | |
//poderia parar aqui, é claro :). | |
} |
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 helpers | |
import java.io.File | |
import java.io.FileInputStream | |
import play.api.libs.concurrent.Execution.Implicits._ | |
import org.apache.commons.io.FilenameUtils | |
import org.apache.commons.io.IOUtils | |
import fly.play.s3.BucketFile | |
import fly.play.s3.S3 | |
import fly.play.s3.S3Exception |
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
@(elements: helper.FieldElements) | |
<div class="form-group @if(elements.hasErrors){ has-error }" draggable="true"> | |
<div class="col-sm-2"> | |
<label for="inputNumero" class="control-label">@elements.label</label> | |
</div> | |
<div class="col-sm-10"> | |
<input type="text" class="form-control" name="@elements.name" value="@elements.field.value" id="@elements.id"> | |
</div> | |
</div> |
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
<servlet> | |
<servlet-name>springmvc</servlet-name> | |
<servlet-class> | |
org.springframework.web.servlet.DispatcherServlet | |
</servlet-class> | |
<init-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value> | |
/WEB-INF/spring-context.xml | |
</param-value> |
OlderNewer