Skip to content

Instantly share code, notes, and snippets.

View danielsaad's full-sized avatar

Daniel Saad Nogueira Nunes danielsaad

View GitHub Profile
@danielsaad
danielsaad / Source Code
Created July 30, 2012 19:19
Realloc copy operations
#include <stdio.h>
#include <stdlib.h>
const int REALLOC_SIZE = 10000;
const int IT = 1000000;
int main(){
void* ptr=NULL;
void* last;
int n=0;
@danielsaad
danielsaad / Países em Guerra.cpp
Last active August 29, 2015 14:24
Código do problema Países em Guerra. Implementem o algoritmo de Dijkstra
#include <climits>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
const int infinity = INT_MAX;
const int BLACK = 2;
const int GREY = 1;
/*
* File: 1234.cpp
* Author: daniel
*
* Created on 2 de Agosto de 2015, 20:31
*/
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
/*
*
*/
#include <iostream>
int main(){
std::cout << "Hello World\n";
return 0;
}
@danielsaad
danielsaad / memusg
Last active September 17, 2015 13:39 — forked from netj/memusg
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <[email protected]>
# Created: 2010-08-16
set -um
# check input
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; }
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class valorHora{
public:
int valor;
int j;
void* aux,*tmp;
tmp = vet[i];
for(j=i;j<tam-1;j++){
aux = vet[j+1];
vet[j+1] = tmp;
tmp = aux;
}
var express = require('express');
Livro = require('../models/livroModel');
//Livro = mongoose.model('Livro');
var router = express.Router();
router.route('/')
.get(function (req,res){
Livro.find({}, function(err,livro){
if(err){
var express = require('express');
var port = process.env.PORT || 8080;
var app = express();
var mongoose = require('mongoose');
var Livro = require('./app/models/livroModel');
var bodyParser = require('body-parser');
mongoose.connect('mongodb://127.0.0.1/Livros', function(err) {
if (err) throw err;
});