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
@(artigos: Vector[models.Artigo]) | |
<h3>@artigos.length Artigos Científicos</h3> | |
<ul> | |
@artigos.map { artigo => | |
<li> | |
<a href="/artigo/@artigo.codigo/"> | |
@artigo.titulo | |
</a> | |
</li> |
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
@(artigos: Vector[models.Artigo]) | |
<h3>@artigos.length Artigos Cientificos</h3> | |
<ul> | |
@artigos.foreach{ artigo => | |
<li> | |
<a href="/artigo/@artigo.codigo/"> | |
@artigo.titulo | |
</a> | |
</li> |
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
/* | |
Implementação de QuickSort de Kernighan/Pike. | |
Adaptado para Scala, demonstrando o idioma imperativo. | |
Autor: Jose Fonseca (jfonseca@literati.com.br) | |
Projeto Literati.com.br - Letrados em TI | |
*/ | |
import scala.collection.mutable.ArrayBuffer |
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 scala.collection.mutable.ArrayBuffer | |
import scala.io.Source | |
var buf = new scala.collection.mutable.ArrayBuffer[String]() | |
buf += "Primeiro item" | |
val origemDados = Source.fromFile("/usr/share/dict/words") | |
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
var contador = 0; | |
val filename = "/usr/share/dict/words" | |
val origemDados = Source.fromFile(filename) | |
for (linha <- origemDados.getLines() ) { | |
contador = contador + 1; | |
} | |
println("Temos " + contador + " palavras no dicionário em " + filename) |
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
#!/opt/scala/bin/scala | |
!# | |
// todos os imports de programas compilados | |
// sao permitidos | |
import scala.sys.process._ | |
import scala.util.matching.Regex._ | |
// iniciamos o programa diretamente, | |
// sem definir um objeto ou funcao main |