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 se fazer um projeto físico de um banco de dados, não basta apenas obter uma estrutura de dados apropriada para armazenamento, mas sim é preciso ser estudado e para isso desenvolver de uma maneira a garantir um resultado eficiênte no final. | |
Conhecendo as consultas, transações e as aplicações executadas pelo banco de dados, conseguimos realizar análises de desempenho e tomar decisões de projeto físico e significativas. Fazendo uma especificação dos arquivos que serão acessados pela consulta, os atributos nas condições de seleção, junção e cujos valores sao recuperados pela consulta é possível traçar os pontos para otimização. | |
Além disso, para cada transação é preciso especificar os arquivos que serão atualizados, tipo de operação e aqueles atributos onde as condições de seleção de uma exclusão ou de atualização são especificadas | |
Não basta aplicarmos todas estas condições sem levar em conta a frequencia em que cada consulta e transação serão realizadas, uma vez que seria ineficiênte realizar para cada u |
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
if (key === 90) | |
{ | |
console.log(this.opts.buffer) | |
if (this.opts.buffer !== false) | |
{ | |
e.preventDefault(); | |
console.log(this.getBuffer()); | |
} | |
else if (e.shiftKey) | |
{ |
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
private static void estadosIniciais(List<Estado> estados) { | |
HashSet<Estado> set = new HashSet<Estado>(); | |
for (Estado estado : estados) { | |
List<Estado> conjuto = estado.getEstadosConjunto(); | |
if (conjuto != null && conjuto.size() > 0) { | |
for (Estado parte : conjuto) { | |
set.add(parte); | |
} | |
} else { |
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
private static void criaNovoEstado(Estado estado, Automato automato, String terminal) { | |
String nomeAFND; | |
Estado novoEstado; | |
List<Estado> transicoes; | |
List<Estado> conjunto = estado.getEstadosConjunto(); | |
List<Estado> listE = new ArrayList<Estado>(); | |
if (conjunto != null) { | |
for (Estado parte : conjunto) { |
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
-- Consulta: News Feed | |
-- Descrição: Busca todos os posts dos blogs que o usuário segue | |
SELECT posts.* | |
FROM posts_with_actions posts | |
JOIN blogs ON blogs.id = posts.blog_id | |
JOIN relationships ON relationships.followed_id = blogs.id AND relationships.follower_id = 7 | |
ORDER BY created_at DESC | |
-- Consulta: Blog posts |
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
-- Tabela: Actions | |
-- Descrição: Guarda todas as ações feitas num post. Ex: like (1), reply (2), share (3) | |
CREATE TABLE actions | |
( | |
id serial NOT NULL, | |
text text, | |
creator_id integer, | |
post_id integer, | |
kind integer 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
-- Visão: Posts with Actions | |
-- Descrição: Retorna a tabela posts com as colunas número de likes, shares (reblogs) e replies | |
CREATE OR REPLACE VIEW posts_with_actions AS | |
SELECT p.id, p.title, p.content, p.blog_id, p.creator_id, p.published_at, | |
p.url, p.image_path, p.created_at, p.updated_at, | |
sum( | |
CASE | |
WHEN a.kind = 1 THEN 1 | |
ELSE 0 |
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
// Programa válido Sintáticamente | |
programa testeValido; | |
// Declaração de variáveis | |
inteiro quant; | |
real[5] probabilidades = @idQualquer; | |
cadeia[falso][@dimensao] texto; //semânticamente inválido |
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 simbolos; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import gals.SemanticError; | |
import gals.Token; | |
import utils.Logger; |
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 simbolos; | |
public class Simbolo { | |
private String nome; | |
public Simbolo() { | |
} | |
public String getNome() { |
OlderNewer