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
| #include <stdio.h> | |
| #include <mpi.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| int main(int argc, char* argv[]){ | |
| int rank, size, i, j, k, tag = 0; | |
| MPI_Status status; | |
| MPI_Init(&argc, &argv ); |
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
| int** array = (int**) malloc(sizeof(int*) * lines); | |
| array[0] = (int*) malloc(lines * columns * sizeof(int)); | |
| for(i=1; i<lines; i++) | |
| array[i] = &(array[0][i*columns]); |
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
| # encoding: utf-8 | |
| separator: ";" | |
| product: | |
| fields: | |
| - name: 'neighborhood' | |
| header: 'BAIRRO' | |
| - name: 'build_status' | |
| header: 'STATUS' | |
| - name: 'header_image' |
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
| #include <stdio.h> | |
| #include <mpi.h> | |
| #include <string.h> | |
| int main(int argc, char* argv[]){ | |
| int rank, size, i, tag = 0; | |
| MPI_Status status; | |
| MPI_Init(&argc, &argv ); |
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 Duck { | |
| def quack = println("Quack quack") | |
| } | |
| class Person { | |
| def quack = println("The person imitates a duck") | |
| } | |
| def test(duck: { def quack }) = duck.quack |
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
| trait Swimmer { | |
| def swim() = println("Swimming...") | |
| } | |
| abstract class Bird { | |
| def fly() = println("Flying...") | |
| } | |
| class Duck extends Bird with Swimmer { | |
| def talk() = println("Duck duck") |
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
| // classe Carro com os parâmetros separados por "," e seus tipos separados por ":" | |
| class Carro(modelo: String, ano: Int, var valor: Float = 0){ | |
| // definição do método a partir do operador "=" inline | |
| def detalhes = printf("CARRO: " + modelo + "\nANO: " + ano + "\nVALOR: " + valor) | |
| // tipo de retorno do método declarado no final da assinatura | |
| def alterarValor(valor: Float): Float = { | |
| this.valor = valor | |
| return this.valor | |
| } | |
| } |
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
| // classe Carro com os parâmetros separados por "," e seus tipos separados por ":" | |
| class Carro(var valor: Float = 0, modelo: String, ano: Int){ | |
| // definição do método a partir do operador "=" inline | |
| def detalhes = printf("CARRO: " + modelo + "\nANO: " + ano + "\nVALOR: " + valor) | |
| // tipo de retorno do método declarado no final da assinatura | |
| def alterarValor(valor: Float): Float = { | |
| this.valor = valor | |
| return this.valor | |
| } | |
| } |
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 my.company.app | |
| import net.scage.ScageScreenApp | |
| import net.scage.ScageLib._ | |
| import net.scage.support.{State, Vec} | |
| import com.weiglewilczek.slf4s.Logger | |
| import net.scage.support.tracer3.{TraceTrait, ScageTracer} | |
| import net.scage.support.physics.ScagePhysics | |
| import net.scage.support.physics.objects.{StaticLine, StaticBox, DynaBall} |
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 my.company.app | |
| import net.scage.ScageScreenApp | |
| import net.scage.ScageLib._ | |
| import net.scage.support.{State, Vec} | |
| import com.weiglewilczek.slf4s.Logger | |
| import net.scage.support.tracer3.{TraceTrait, ScageTracer} | |
| object Snake extends ScageScreenApp("Snake") { | |
| private val log = Logger(this.getClass.getName) |