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="ISO-8859-1"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="/"> | |
<html> | |
<body> | |
<table border="1"> | |
<tr bgcolor="#9acd32"> | |
<th>Curso</th> | |
<th>Modalidade / Campus</th> |
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
x = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 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
def lerInt(n) | |
n.times.map do | |
gets.to_i | |
end | |
end | |
vetor1 = lerInt(3) | |
vetor2 = lerInt(4) | |
vetor3 = vetor1 + vetor2 | |
print vetor3 |
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 Dado | |
def rolar | |
return 1 + rand(6) | |
end | |
end |
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
# Escreva uma classe, chamada Ponto, que representa um ponto no | |
# plano cartesiano. A figura abaixo mostra quais atributos e métodos | |
# da classe. | |
class Ponto | |
attr_reader :x, :y | |
def initialize(x,y) | |
@x = x | |
@y = y |
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 Bomba | |
attr_reader :x, :y, :ativa | |
def initialize(janela) | |
@janela = janela | |
@icon = Gosu::Image.new(@janela, 'bomba.png', true) | |
@y = -rand(200) | |
@x = rand(@janela.width-60) | |
@ativa = true | |
end | |
def update(laser) |
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 main.scala | |
import math.{ abs, min } | |
import Int.MaxValue | |
case class Map(val airports: Seq[(Int, Int)] = Seq(), val clouds: Seq[(Int, Int)] = Seq()) { | |
def addAirports(coordinates: Seq[(Int, Int)]) = Map(airports ++ coordinates, clouds) | |
def airportAt(coordinate: (Int, Int)) = airports.exists(_ == coordinate) |
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 main.scala | |
import math.{ abs, min } | |
import Int.MaxValue | |
case class Map(val airports: Seq[(Int, Int)] = Seq(), val clouds: Seq[(Int, Int)] = Seq()) { | |
def addAirports(coordinates: Seq[(Int, Int)]) = Map(airports ++ coordinates, clouds) | |
def airportAt(coordinate: (Int, Int)) = airports.exists(_ == coordinate) |
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
# Questao 1 | |
"Programacao de Computadores".size | |
# ou | |
"Programacao de Computadores".length | |
# Questao 2 | |
media = (8.12 + 7.45) / 2.0 | |
"A sua media foi de "+ media.to_s + " este ano!" | |
# ou como será visto mais adiante ... |
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.io.*; | |
import java.net.*; | |
public class ServidorHttp { | |
public static void main(String args[]) { | |
ServerSocket s = null; | |
try { | |
s = new ServerSocket(7896); | |
// right now the stream is open. | |
while (true) { |
OlderNewer