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> | |
int compare_int(const void * a, const void * b) | |
{ | |
return (*(int*)a - *(int*)b); | |
} | |
int var_list[] = { 50, 20, 60, 40, 10, 30 }; |
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> | |
int compare_int(const void * a, const void *b) | |
{ | |
return ( *(int*)a - *(int*)b ); | |
} | |
int var_list[] = {3,8,1,4,6,0,88}; |
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> | |
#include <string.h> | |
#include "max6675.h" | |
max6675 device; | |
void iniciaMAX6675(volatile unsigned char *port, const char so_mask, const char sck_mask, const char cs_mask) | |
{ |
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> | |
#include <string.h> | |
#include "mcp3201.h" | |
mcp3201 device; | |
void iniciaMCP2301 (volatile unsigned char* port, const char dout_mask, const char clk_mask, const char cs_mask) | |
{ |
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
#!/bin/bash | |
# Este programa cria uma virtual host e sua pagina de apresentação | |
# OBS: OS HOSTS CRIADOS TERAO NOME FINAL .COM.BR | |
# Utilizicao | |
# sudo ./apache_creator.sh app porta 8383 | |
# ou | |
# sudo ./apache_creator.sh | |
www=/var/www/html/ |
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
#!/usr/bin/python | |
# Este programa cria uma virtual host e sua pagina de apresentação | |
# OBS: OS HOSTS CRIADOS TERAO NOME FINAL .COM.BR | |
# Utilizacao | |
# python create_virtual_host.py app_name porta 8080 | |
# ou | |
# python create_virtual_host.py | |
import sys |
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 simplejson as json | |
import webbrowser | |
import httplib2 | |
from apiclient import discovery | |
from oauth2client import client | |
from apiclient.discovery import build | |
from apiclient.discovery import build | |
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
/*This gist only compare C way to get a timestamp clock_monotonic against C++11 way.*/ | |
#include <iostream> | |
#include <time.h> | |
#include <chrono> | |
#include <ctime> | |
void get_clock_time_us_time_h(unsigned long &val){ | |
struct timespec ts; | |
clock_gettime(CLOCK_MONOTONIC, &ts); |
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
cmake_minimum_required(VERSION 2.8) | |
project(project CXX) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
find_package(Boost 1.40.0 COMPONENTS filesystem system REQUIRED) | |
file(GLOB SOURCE_FILES src/*.cpp) | |
add_executable(${PROJECT_NAME} ${SOURCE_FILES}) |
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 <iostream> | |
#include <vector> | |
#include "publisher.h" | |
int main(const int argc, const char **argv) | |
{ | |
std::vector<std::string> message; | |
for(auto i = 0; i < 10; i++) | |
message.push_back("test message " + std::to_string(i)); |
OlderNewer