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 transpor_digrafo(digrafo): | |
digrafo_t = {} | |
for vertice in digrafo: | |
digrafo_t[vertice] = [] | |
for vertice in digrafo: | |
for vizinho in digrafo[vertice]: | |
digrafo_t[vizinho].append(vertice) | |
return digrafo_t | |
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
# coisos globais | |
valor_profundidade_entrada = 0 # contador da profundidade em que os vertices entram da pilha (chamado recursivamente) | |
valor_profundidade_saida = 0 # contador da profundidade em que os vertices saem da pilha (termina sua chamada recursiva) | |
# dicionario com as profunfidades em que cada vertice entrou e saiu da pilha numa lista [profundidade_entrada, profundidade_saida] | |
profundidades_entrada_saida = {} | |
pai = {} # dicionario com os pais de cada vertice na arvore de busca em profundidade | |
aresta = {} # classificacao das arestas na arvore de busca em profundidade do grafo | |
niveis = {} # nivel de cada vertice na arvore de busca em profundidade | |
# conjunto de vertices ainda nao visitados (nunca entraram (e portanto nem sairam) da pilha) | |
nao_visitados = set() |
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
# coisos globais | |
valor_profundidade_entrada = 0 # contador da profundidade em que os vertices entram da pilha (chamado recursivamente) | |
valor_profundidade_saida = 0 # contador da profundidade em que os vertices saem da pilha (termina sua chamada recursiva) | |
# dicionario com as profunfidades em que cada vertice entrou e saiu da pilha numa lista [profundidade_entrada, profundidade_saida] | |
profundidades_entrada_saida = {} | |
pai = {} # dicionario com os pais de cada vertice na arvore de busca em profundidade | |
aresta = {} # classificacao das arestas na arvore de busca em profundidade do grafo | |
niveis = {} # nivel de cada vertice na arvore de busca em profundidade | |
# conjunto de vertices ainda nao visitados (nunca entraram (e portanto nem sairam) da pilha) | |
nao_visitados = set() |
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
from copy import deepcopy | |
# coisos globais | |
valor_profundidade_entrada = 0 # contador da profundidade em que os vertices entram da pilha (chamado recursivamente) | |
valor_profundidade_saida = 0 # contador da profundidade em que os vertices saem da pilha (termina sua chamada recursiva) | |
# dicionario com as profunfidades em que cada vertice entrou e saiu da pilha numa lista [profundidade_entrada, profundidade_saida] | |
profundidades_entrada_saida = {} | |
pai = {} # dicionario com os pais de cada vertice na arvore de busca em profundidade | |
aresta = {} # classificacao das arestas na arvore de busca em profundidade do grafo | |
niveis = {} # nivel de cada vertice na arvore de busca em profundidade |
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
function recurse_delete($path) | |
{ | |
if (is_dir($path) === true) | |
{ | |
$files = array_diff(scandir($path), array('.', '..')); | |
foreach ($files as $file) | |
{ | |
recurse_delete(realpath($path) . '/' . $file); | |
} |
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
sets = {} | |
setsRanked = {} | |
def makeSet(x): | |
sets[x] = set([x]) | |
def find(x): | |
for representative,subset in sets.iteritems(): | |
if x in subset: | |
return representative |
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
clear; | |
clc; | |
disp('zb1(t0, dt, tf, A, B, C, S0, I0)'); | |
disp('dR(1)= (cos(t*%pi/12)+1)*(-A*R(1)-B*R(1)*R(2))+C*R(2)'); | |
disp('dR(2)= -C*R(2)+(cos(t*%pi/12)+1)*(B*R(1)*R(2)+A*R(1))'); | |
disp('zb2(t0, dt, tf, A, B, C, S0, I0)'); | |
disp('dR(1)= A*R(1)-B*R(1)*R(2)'); | |
disp('dR(2)= -C*R(2)+B*R(1)*R(2)'); |
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 com.example.labc.tconversor; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.TextView; | |
import android.widget.Toast; | |
public class MainActivity extends AppCompatActivity { |
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 com.example.labc.imccalculator; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.TextView; | |
import android.widget.Toast; | |
public class MainActivity extends AppCompatActivity { |
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 com.example.labc.conversor_altura; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.SeekBar; | |
import android.widget.TextView; | |
import java.util.Locale; |
OlderNewer