This file contains 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
/** | |
* | |
* Grafos com lista de adjacências | |
* | |
* Vetor que contém somente as arestas existentes (com alocação dinâmica) | |
* | |
* @Author: Reinaldo Antonio Camargo Rauch | |
* @Date: 2014-10-22 19:22:46 | |
* @Last Modified by: reinaldo | |
* @Last Modified time: 2014-11-05 20:15:07 |
This file contains 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
procedure TFmRelChequesEmissao.FormCreate(Sender: TObject); | |
begin | |
with IbqChequeEmissao do | |
begin | |
Active := False; | |
With FmReports do | |
begin | |
ParamByName('st').Value := DtpInicio.Date; | |
ParamByName('ed').Value := DtpFim.Date; | |
end; |
This file contains 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
-- ----------------------------------------------------------------------------- | |
-- View que retona o id do cliente e a quantidade de solicitações que este | |
-- cliente tem | |
-- ----------------------------------------------------------------------------- | |
CREATE VIEW vw_count_compras_clientes AS | |
SELECT | |
-- id do cliente | |
id_cliente, | |
-- conta a quantidade de solicitações do cliente | |
count(id_solicitacao) as qtd_sol |
This file contains 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
// Config. by: kANN<3 | |
// | |
// | |
cl_showfps 1 | |
fps_max 125 | |
//bind de compras | |
clear | |
echo "+=====================================================+" | |
echo "| NUM | / | * | - |" |
This file contains 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
/** | |
* Explicando expressões: | |
* | |
* (![]+[]) -> ! tem precedência em cima do concatenador "+" então ![] vira | |
* false e por conta do + vira string e o array vazio vira string | |
* vazia, tudo isso virando a string 'false' | |
* | |
* ([![]]+[][[]]) -> em [![]], ![] avalia-se como false e vira [false]. [][[]] | |
* o array mais interno converte-se para o número 0 ao passo | |
* que está sendo tratado como índice de um array vazio e |
This file contains 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 Data.List | |
media :: Fractional a => [a] -> a | |
media l= let (t,n) = foldl' (\(!b,!c) a -> (a+b,c+1)) (0,0) l in t / n | |
desvios :: Fractional a => [a] -> a -> [a] | |
desvios xs m = [ a - m | a <- xs ] | |
powtwo :: Fractional a => [a] -> [a] | |
powtwo xs = [ a ^ 2 | a <- xs ] |
This file contains 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
data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show) | |
treeInsert :: (Ord a) => a -> Tree a -> Tree a | |
treeInsert x EmptyTree = Node x EmptyTree EmptyTree | |
treeInsert x (Node a left right) | |
| x == a = Node x left right | |
| x < a = Node a (treeInsert x left) right | |
| x > a = Node a left (treeInsert x right) | |
treeElement :: (Ord a) => a -> Tree a -> Bool |
This file contains 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 <stdlib.h> | |
#define ITERACOES 10000 | |
double calcPi() { | |
long int a = 1, b = 2; | |
double result = 1; | |
for (int i = 0; i < ITERACOES; i++) |
This file contains 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
/** | |
* Função para imprimir um array de 2 dimensões e de inteiros | |
* @param matriz A matriz à ser imprimida | |
* @param x tamanho de colunas da matriz | |
* @param y tamanho de linhas da matriz | |
*/ | |
void imprime_matriz_int(int matriz[][4], int x, int y) { | |
int i, j; | |
// itera sobre as colunas da matriz |
This file contains 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 (argument) { | |
var mysql = require('mysql'); | |
var db = mysql.createConnection('mysql://root:amigen@localhost/bestuse_main'); | |
db.query('SELECT * FROM customers', function (err, res) { | |
if (err) { throw err; } | |
for (var i = 0; i < res.length; i++) { | |
console.log(res[i].orgname); |