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
| -- Cidade | |
| CREATE TABLE cidade( | |
| codigo NUMBER PRIMARY KEY NOT NULL, | |
| nome VARCHAR2(45) NOT NULL, | |
| estado VARCHAR2(2) NOT NULL | |
| ); | |
| --Aluno | |
| CREATE TABLE aluno( | |
| matricula NUMBER PRIMARY KEY NOT NULL, | |
| cpf VARCHAR2(11) NOT NULL, |
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
| public class Consumer extends Thread { | |
| private CubbyHole cubbyhole; | |
| private int number; | |
| public Consumer(CubbyHole c, int number) { | |
| cubbyhole = c; | |
| this.number = number; | |
| } | |
| public void run() { |
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.IOException; | |
| import java.net.DatagramPacket; | |
| import java.net.DatagramSocket; | |
| import java.net.InetAddress; | |
| import java.util.Scanner; | |
| public class Cliente { | |
| public static void main(String[] args) { | |
| try{ |
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.IOException; | |
| import java.net.DatagramPacket; | |
| import java.net.DatagramSocket; | |
| import java.net.InetAddress; | |
| import java.util.Scanner; | |
| public class Cliente { | |
| public static void main(String[] args) { | |
| try{ |
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 Course < ApplicationRecord | |
| has_many :books | |
| 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
| # This file should contain all the record creation needed to seed the database with its default values. | |
| # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). | |
| # | |
| # Examples: | |
| # | |
| # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) | |
| # Character.create(name: 'Luke', movie: movies.first) | |
| course = Course.create({ | |
| "id": 11, |
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
| # GET /courses | |
| def index | |
| @courses = Course.all | |
| render json: @courses | |
| 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
| api :GET/ '/courses', 'Lista todas as disciplinas' | |
| def index | |
| @courses = Course.all | |
| render json: @courses | |
| 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
| class CoursesController < ApplicationController | |
| before_action :set_course, only: [:show, :update, :destroy] | |
| # GET /courses | |
| api :GET, '/courses', 'Lista todas as disciplinas' | |
| def index | |
| @courses = Course.all | |
| render json: @courses | |
| 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
| class BooksController < ApplicationController | |
| before_action :set_book, only: [:show, :update, :destroy] | |
| # GET /books | |
| api :GET, '/books', 'Lista todos os livros' | |
| def index | |
| @books = Book.all | |
| render json: @books | |
| end |
OlderNewer