repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
damanivu/ClusterDuck-Protocol
Libraries/RadioLib/src/protocols/TransportLayer/TransportLayer.h
<filename>Libraries/RadioLib/src/protocols/TransportLayer/TransportLayer.h #ifndef _RADIOLIB_TRANSPORT_LAYER_H #define _RADIOLIB_TRANSPORT_LAYER_H #include "../../TypeDef.h" /*! \class TransportLayer \brief Provides common interface for protocols that run on modules with Internet connectivity, such as HTTP or MQ...
damanivu/ClusterDuck-Protocol
Libraries/RadioLib/src/ISerial.h
#ifndef _RADIOLIB_ISERIAL_H #define _RADIOLIB_ISERIAL_H #include "Module.h" #include <stdio.h> #include "WString.h" #include "Printable.h" /*! \class ISerial \brief Interface class for Arduino Serial. Only calls the appropriate methods for the active UART interface. */ class ISerial { public: ISerial(Mod...
damanivu/ClusterDuck-Protocol
Libraries/RadioLib/src/modules/ESP8266/ESP8266.h
<filename>Libraries/RadioLib/src/modules/ESP8266/ESP8266.h #if !defined(_RADIOLIB_ESP8266_H) && !defined(ESP8266) #define _RADIOLIB_ESP8266_H #include "../../Module.h" #include "../../protocols/TransportLayer/TransportLayer.h" /*! \class ESP8266 \brief Control class for %ESP8266 module. Implements TransportLaye...
damanivu/ClusterDuck-Protocol
Libraries/RadioLib/extras/ModuleTemplate.h
<gh_stars>1-10 /* RadioLib Module Template header file Before opening pull request, please make sure that: 1. All files MUST be compiled without errors using default Arduino IDE settings. 2. All files SHOULD be compiled without warnings with compiler warnings set to "All". 3. Example sketches MUST be working...
damanivu/ClusterDuck-Protocol
cdpcfg.h
<filename>cdpcfg.h /* * CDP central compile-time configuration * * it will include optional * - cdpcfg-pre.h at the beginning * - cdpcfg-post.h at the end * * to customize your build, you could ... * - edit this file or * - copy it to cdpcfg-pre.h and edit _that_ or * - create a from-scratch cdpcfg-pre.h that...
damanivu/ClusterDuck-Protocol
Libraries/RadioLib/src/modules/SX1231/SX1231.h
#ifndef _RADIOLIB_SX1231_H #define _RADIOLIB_SX1231_H #include "../../TypeDef.h" #include "../../Module.h" #include "../RF69/RF69.h" #define SX1231_CHIP_REVISION_2_A 0x21 #define SX1231_CHIP_REVISION_2_B 0x22 #define SX1231_CHIP_REVISION_2_C 0x23 //SX123...
skyfireitdiy/xmake
core/src/xmake/io/socket_sendto.c
/*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
skyfireitdiy/xmake
core/src/xmake/hash/sha256.c
/*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
skyfireitdiy/xmake
core/src/xmake/os/getwinsize.c
<filename>core/src/xmake/os/getwinsize.c /*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2....
skyfireitdiy/xmake
core/src/xmake/io/file_open.c
/*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
skyfireitdiy/xmake
core/src/xmake/os/rmdir.c
<filename>core/src/xmake/os/rmdir.c /*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
skyfireitdiy/xmake
core/src/xmake/io/pipe_open.c
<filename>core/src/xmake/io/pipe_open.c /*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0...
skyfireitdiy/xmake
core/src/xmake/io/prefix.h
<reponame>skyfireitdiy/xmake /*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unle...
skyfireitdiy/xmake
core/src/xmake/semver/select.c
<reponame>skyfireitdiy/xmake /*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unle...
skyfireitdiy/xmake
core/src/xmake/semver/prefix.h
<reponame>skyfireitdiy/xmake /*!A cross-platform build utility based on Lua * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unle...
koenkooi/meta-minnow
recipes-multimedia/gstreamer/gstreamer-vaapi/gstvideoencoder.h
/* GStreamer * Copyright (C) 2008 <NAME> <<EMAIL>> * Copyright (C) 2011 <NAME> <<EMAIL>>. * Copyright (C) 2011 Nokia Corporation. All rights reserved. * Contact: <NAME> <<EMAIL>> * Copyright (C) 2012 Collabora Ltd. * Author : <NAME> <<EMAIL>> * * This library is free software; you can redistribute it and/or ...
paradoxpj/C-Guide-for-Beginners
BasicImplementations/Prime_Numbers.c
//Program to print all the prime numbers less than a given element #include<stdio.h> main() { int i,n,p,sum; printf("Enter a number!\n"); scanf("%d",&p); for(n=2;n<=p;n++) { sum=0; for(i=2;i<=n/2;i++) { if(n%i==0) sum=1; } if(sum==0) printf("%d\t",n); } }
paradoxpj/C-Guide-for-Beginners
BasicImplementations/Sum_of_array.c
//Program to sum an array #include<stdio.h> main() { int n; printf("Enter the strength of an arrya: "); scanf("%d",&n); int arr[n],i,sum=0; printf("Enter the elements of the array\n"); for(i=0;i<n;i++) scanf("%d",&arr[i]); for(i=0;i<n;i++) sum=sum+arr[i]; printf("sum is %d",sum); }
paradoxpj/C-Guide-for-Beginners
BasicImplementations/Temperature_Converter.c
<filename>BasicImplementations/Temperature_Converter.c #include<stdio.h> main() { float f,c; printf("Enter temperature in degree farheniet\n"); scanf("%f",&f); c=(f-32)/1.8; printf("Temperature in degree celcius is %f",c); }
alex-schneider/mpz
src/mpz_mutex.h
<filename>src/mpz_mutex.h /** * Copyright (c) <NAME> */ #ifndef _MEMPOOLZ_MUTEX_H_INCLUDE #define _MEMPOOLZ_MUTEX_H_INCLUDE /* ==================================================================================================== */ #include "mpz_core.h" /* =========================================================...
alex-schneider/mpz
src/mpz_alloc.c
/** * Copyright (c) <NAME> */ #include "mpz_core.h" /* ==================================================================================================== */ /* PRIVATE STUFF: DECLARATIONS */ #define mpz_memalign(a, s) ({ mpz_void_t *p; (0 != posix_memalign(&p, (a), (s)) ? NULL : p); }) #define mpz_memzero(p, ...
alex-schneider/mpz
src/mpz_alloc.h
<gh_stars>1-10 /** * Copyright (c) <NAME> */ #ifndef _MEMPOOLZ_API_H_INCLUDE #define _MEMPOOLZ_API_H_INCLUDE #include "mpz_core.h" /* ==================================================================================================== */ typedef struct _mpz_pool_s mpz_pool_t; typedef struct _mpz_slab_s mpz_sla...
alex-schneider/mpz
src/mpz_core.h
<reponame>alex-schneider/mpz /** * Copyright (c) <NAME> */ #ifndef _MEMPOOLZ_CORE_H_INCLUDE #define _MEMPOOLZ_CORE_H_INCLUDE /* ==================================================================================================== */ #include <stdlib.h> #include <stdint.h> #include <string.h> /* ==================...
tworkshyd/v2-mcu2
mcu2/memory/memory.h
<filename>mcu2/memory/memory.h /**************************************************************************/ /*! @file hbad_memory.h @brief This module contains base addresses and range for oxygen calibration, ps1, ps2, dps1, dps2, methods to store and retrieve. @author Tworks @defgroup...
tworkshyd/v2-mcu2
mcu2/encoder/encoder.c
#include "../BoardDefines.h" //#include <Wire.h> #include <pins_arduino.h> //#include "../pinout.h"; // Keep track of last rotary value int lastCount = 100; // Updated by the ISR (Interrupt Service Routine) volatile int virtualPosition = 100; // ------------------------------------------------------------------ // ...
tworkshyd/v2-mcu2
mcu2/lcd_display/ctrl_display.h
<reponame>tworkshyd/v2-mcu2<gh_stars>0 /**************************************************************************/ /*! @file ctrl_display.h @brief This Module contains @author Tworks @{ */ /**************************************************************************/ #pragma once #include...
tworkshyd/v2-mcu2
mcu2/debug.h
/**************************************************************************/ /*! @file debug.h @brief This file defines and includes all of the debug related utilities @author Ritesh @date 6/10/2020 Initial revision @{ */ /****************************************************************...
tworkshyd/v2-mcu2
mcu2/encoder/encoder.h
<filename>mcu2/encoder/encoder.h /** * @enum EnumType * @brief An enum description. */ #include "../BoardDefines.h" #pragma once typedef enum { RT_INC=0, RT_DEC, RT_BT_PRESS, RT_NONE }RT_Events_T; void isrEncoderClk(); RT_Events_T encoderScanIsr(); RT_Events_T encoderScanUnblocked() ; RT_Events_T ...
tworkshyd/v2-mcu2
tests/eeprom/memory/memory.h
#include <extEEPROM.h> #include <EEPROM.h> /*!EEPROM I2C Address */ #define EEPROM_I2C_ADDR 0x50 //80 #define EEPROM_DEFAULT_DATA_WRITE_ADDR 0xA //10 #define EEPROM_ADDR 0xC //12 #define EEPROM_MAX_SIZE 4096 //max size of the EEPROM i.e. 4K bytes typedef enum { EEPROM_READ, EEPROM_WRITE } eeprom_ops...
tworkshyd/v2-mcu2
tests/uart/BoardDefines.h
<gh_stars>0 #ifndef __BOARD_INCLUDES_H__ #define __BOARD_INCLUDES_H__ #define VERSION_2_0 0 #define VERSION_2_1 1 #define VERSION_2_2 2 /// Define the Board Here #define BOARD_VERSION VERSION_2_1 #if BOARD_VERSION == VERSION_2_2 #pragma message("Board Version 2.2") #define DebugPort Serial2 #else #pragma me...
tworkshyd/v2-mcu2
mcu2/lcd_display/lcd.h
/**************************************************************************/ /*! @file lcd.h @brief This Module contains all the configurations and Display details @author Tworks @{ */ /**************************************************************************/ #pragma once #include "../...
tworkshyd/v2-mcu2
mcu1/BoardDefines.h
<filename>mcu1/BoardDefines.h #ifndef __BOARD_INCLUDES_H__ #define __BOARD_INCLUDES_H__ #define VERSION_2_0 0 #define VERSION_2_1 1 #define VERSION_2_2 2 /// Define the Board Here #define BOARD_VERSION VERSION_2_2 #if BOARD_VERSION == VERSION_2_2 // #pragma message ("Board Version 2.2") #define DebugPo...
tworkshyd/v2-mcu2
mcu2/BoardDefines.h
<reponame>tworkshyd/v2-mcu2<filename>mcu2/BoardDefines.h<gh_stars>0 #ifndef __BOARD_INCLUDES_H__ #define __BOARD_INCLUDES_H__ #define VERSION_2_0 0 #define VERSION_2_1 1 #define VERSION_2_2 2 /// Define the Board Here #define BOARD_VERSION VERSION_2_2 #if BOARD_VERSION == VERSION_2_2 // #pragma message("Board...
tworkshyd/v2-mcu2
mcu2/state_control/statecontrol.h
/**************************************************************************/ /*! @file Control_StateMachine.h @brief Control StateMachine Module defines the state @author Tworks @defgroup StateControlModule StateControlModule Module is a stateMachine where sensors data and UI param...
tworkshyd/v2-mcu2
mcu1/control_board.h
<filename>mcu1/control_board.h /**************************************************************************/ /*! @file Variables.h @brief Ventilator Driver Module @author Tworks @defgroup VentilatorModule VentilatorModule Module to initialize and deinitialize the ventilator @{ */ /***...
Bobobot/Pacman_visualizer
src/map_container.h
<reponame>Bobobot/Pacman_visualizer<gh_stars>0 #pragma once #include <vector> #include <fstream> #include <string> #include <sstream> #include <limits> #include "map.h" class MapContainer { std::vector<Map> allMaps; int currentMapIndex; int width; int height; public: MapContainer(std::string fileName); Map curr...
Bobobot/Pacman_visualizer
src/pacman_visualizer.h
<reponame>Bobobot/Pacman_visualizer #pragma once #include <SDL.h> #include <SDL2_gfxPrimitives.h> #include <string> #include <vector> #include <sstream> #include "map.h" #include "point.h" static int const FPSTIMER = 0; //using Maze = std::vector<std::vector<char>>; class PacmanVisualizer { int width, height; SD...
Bobobot/Pacman_visualizer
src/point.h
<gh_stars>0 #pragma once struct Point { int x; int y; };
Bobobot/Pacman_visualizer
src/map.h
<gh_stars>0 #pragma once #include "point.h" class Map { public: int currentTick; int currentDepth; std::vector<std::vector<char>> data; std::vector<Point> pacmanTiles; std::vector<Point> ghostTiles; std::vector<char> operator[](int index) { return data[index]; } int getWidth() { return data.size(); } ...
Abellan09/SEI_Project
Jamming/esp8266_deauther-2.1.0/configs/DSTIKE_OLED_v1.5S/A_config.h
#ifndef config_h #define config_h // ===== DISPLAY LIBRARY ===== // #include "SSD1306Wire.h" // =========================== // // ===================== LED CONFIG ==================== // #define NEOPIXEL_LED #define LED_MODE_BRIGHTNESS 10 // brightness of LED modes #define LED_NEOPIXEL_NUM 1 #define LED_NEOPIXEL_P...
Abellan09/SEI_Project
Jamming/esp8266_deauther-2.1.0/configs/DSTIKE_Wristband_Mini/A_config.h
#ifndef config_h #define config_h // ===== DISPLAY LIBRARY ===== // #include "SH1106Wire.h" // =========================== // // ===================== LED CONFIG ==================== // #define NEOPIXEL_LED #define HIGHLIGHT_LED 16 #define LED_MODE_BRIGHTNESS 10 // brightness of LED modes #define LED_NEOPIXEL_NUM ...
Abellan09/SEI_Project
Jamming/esp8266_deauther-2.1.0/configs/MrRobotBadge_Dickbutt_Addon/A_config.h
#ifndef config_h #define config_h // ===== DISPLAY LIBRARY ===== // #include "SSD1306Wire.h" // =========================== // #define DEFAULT_SSID "Dickbutt " + bytesToStr(&(settings.getMacAP()[3]), 3) // ===================== LED CONFIG ==================== // #define DIGITAL_LED #define LED_ANODE false // comm...
wangxaioli/Push
Example/Pushpresent/WLAppDelegate.h
<reponame>wangxaioli/Push // // WLAppDelegate.h // Pushpresent // // Created by <EMAIL> on 09/05/2018. // Copyright (c) 2018 <EMAIL>. All rights reserved. // @import UIKit; @interface WLAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
wangxaioli/Push
Example/Pods/Target Support Files/Pushpresent/Pushpresent-umbrella.h
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double PushpresentVersionNumber; FOUNDATION_EXPORT const unsigned char PushpresentVersionString[];
wangxaioli/Push
Example/Pushpresent/WLSecondPresentViewController.h
<reponame>wangxaioli/Push // // WLSecondPresentViewController.h // PresentPush // // Created by wangxiaoli on 2018/9/4. // Copyright © 2018年 Sunshine. All rights reserved. // #import <UIKit/UIKit.h> @interface WLSecondPresentViewController : UIViewController @end
wangxaioli/Push
Example/Pushpresent/UINavigationController+WLNav.h
<reponame>wangxaioli/Push // // UINavigationController+WLNav.h // PresentPush // // Created by wangxiaoli on 2018/9/4. // Copyright © 2018年 Sunshine. All rights reserved. // #import <UIKit/UIKit.h> @interface UINavigationController (WLNav) - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(voi...
dcrawbuck/Baby-C-Compiler
your_code.c
<gh_stars>0 // <NAME> 2020 // Baby C Compiler #include "your_code.h" #include "symbol_table.h" #include <stdlib.h> #include <stdio.h> #include <string.h> extern void yyerror(const char* s); // Write the implementations of the functions that do the real work here ASTNode* CreateNumNode(int num) { ASTNode* node = (A...
dcrawbuck/Baby-C-Compiler
symbol_table.h
// <NAME> 2020 // Baby C Compiler #ifndef SYMBOL_TABLE_H #define SYMBOL_TABLE_H typedef struct Symbol Symbol; struct Symbol { char* name; int value; int offset; }; Symbol** table; void symbolTableInit(); void insertInto(char* name, int value); struct Symbol* lookup(char* name); void resize(); int getHashValue...
dcrawbuck/Baby-C-Compiler
your_code.h
// <NAME> 2020 // Baby C Compiler #include "symbol_table.h" #ifndef YOUR_CODE_H #define YOUR_CODE_H typedef enum{ASTNODE_ARITH_OP, ASTNODE_LOGIC_OP, ASTNODE_COMPARE, ASTNODE_ASSIGN, ASTNODE_IDENT, ASTNODE_NUM, ASTNODE_IF, ASTNODE_WHILE } ASTNodeType; // Define all operation types (add, mult, etc) here. typedef enum...
dcrawbuck/Baby-C-Compiler
symbol_table.c
// <NAME> 2020 // Baby C Compiler #include "symbol_table.h" #include <stdlib.h> #include <stdio.h> #include <string.h> int items = 0; int size = 100; int offset = 0; int debugPrint = 0; void symbolTableInit() { if(debugPrint) printf("symbolTableInit\n"); table = malloc(sizeof(Symbol*) * size); } void insertInto(...
dcrawbuck/Baby-C-Compiler
driver.c
// <NAME> 2020 // Baby C Compiler #include <stdio.h> #include <stdlib.h> #include "your_code.h" #include "symbol_table.h" #include "code_gen.h" extern FILE* yyin; extern int yyparse(); // A global variable that holds a pointer to the AST root ASTNode* gASTRoot; int main(int argc, char**argv) { if (argc != 2...
dcrawbuck/Baby-C-Compiler
code_gen.c
// <NAME> 2020 // Baby C Compiler #include "code_gen.h" #include "your_code.h" #include "symbol_table.h" #include <stdlib.h> #include <stdio.h> #include <string.h> FILE* output; void GenerateILOC(ASTNode* node) { if (node != NULL) { // Create output file "testx.iloc" output = fopen("testx.iloc", "w"); // S...
dcrawbuck/Baby-C-Compiler
code_gen.h
<reponame>dcrawbuck/Baby-C-Compiler<gh_stars>0 // <NAME> 2020 // Baby C Compiler #include "your_code.h" #ifndef CODE_GEN_H #define CODE_GEN_H // This is the function that generates ILOC code after the construction of the AST void GenerateILOC(ASTNode* node); int Expr(ASTNode* node); int GetNextReg(); int GetNextLoo...
PaulBryden/ROVER
src/arduino/libraries/Anansi/Types.h
#ifndef Types_h #define Types_h #include <iterator> #include <vector> using namespace std; typedef unsigned char byte; typedef struct { byte flags : 3; byte messageID : 5; byte targetService; byte sourceService; byte packetID; byte crc; } packet_header_t; typedef struct { byte numOfPacketsInMessage; byte t...
PaulBryden/ROVER
src/misc/msg_redundant/msg.h
typedef unsigned short int uint_t; typedef struct { unsigned char flags : 3; unsigned char messageID : 5; unsigned char targetService; unsigned char sourceService; unsigned char packetID; unsigned char CRC; } packet_header_t; typedef struct { unsigned char numOfPacketsInMessage; unsigned char typeOfMessage...
PaulBryden/ROVER
src/pi_linux/inc/Service.h
#ifndef Service_h #define Service_h #ifdef NOARDUINO #include <DummyPort.h> #else #include <Port.h> #endif #include <iterator> #include <map> #include <string> class Service { private: byte _id; string _name; std::map<int, int> _portMap; // port id to distance bool _local; public: Service(byte id, string name,...
PaulBryden/ROVER
src/misc/mpq_old/libraries/Msgs/Msgs.h
#ifndef Msgs_h #define Msgs_h #include "Arduino.h" #include <string> #define NO_OF_SERVICES 256 typedef unsigned short int uint_t; /* typedef struct { uint_t id : 8; char *name; uint_t port : 2; uint_t dist : 4; } service_t; typedef struct { service_t *from; service_t *to; char *content; } message_t; ...
PaulBryden/ROVER
src/pi_linux/inc/PacketQueue.h
#ifndef PacketQueue_h #define PacketQueue_h #include <Types.h> #include <Message.h> #include <iterator> #include <deque> #include <Comms.h> #include <PacketHandler.h> class PacketQueue { deque<packet_t> _queue; public: PacketQueue(); void addPacket(packet_t p); void popPacket(); Message check...
PaulBryden/ROVER
src/pi_linux/inc/PacketHandler.h
#ifndef PacketHandler_h #define PacketHandler_h #include <Types.h> #ifdef NOARDUINO #include <cstring> #else #endif #include <Port.h> #include <iterator> #include <vector> #include <Comms.h> class PacketHandler { public: packet_t createPacket(byte flags,byte messageID, byte packetID, byte targetService, byte sourc...
PaulBryden/ROVER
src/arduino/libraries/Anansi/Comms.h
#ifndef Comms_h #define Comms_h #include <Types.h> #ifndef NOARDUINO #include <Port.h> #else #include <Port.h> #endif #include <MessageQueue.h> #include <ServiceTable.h> #include <iterator> #include <vector> #include <SerialPort.h> //extern PacketHandler handle; #include <PacketQueue.h> class Comms { public: s...
PaulBryden/ROVER
src/pi_linux/inc/Message.h
#ifndef Message_h #define Message_h #include <Types.h> #include <PacketHandler.h> #include <iterator> #include <vector> #include <deque> class Message { //private: //byte _messageID; //byte _targetService; //byte _sourceService; //vector<byte> _bodyContent; //message_header_t _messageHeader; //byt...
PaulBryden/ROVER
src/arduino/libraries/Anansi/MessageQueue.h
<gh_stars>1-10 #ifndef MessageQueue_h #define MessageQueue_h #include <iterator> #include <deque> #include <Message.h> class MessageQueue { public: void addMessage(Message m); void addPriorityMessage(Message m); deque<Message> getMessageQueue(); Message popMessage(); int queueSize(); }; #endif
PaulBryden/ROVER
src/misc/msg_redundant/msg_test.c
#include <stdio.h> #include <msg.h> #include <stdlib.h> char *generate_ping(char *data){ packet_message *packetTest=malloc(62); int sizeOfBody=1; //packet_packet packetTest; packetTest->packetHeader.flags=0x00; packetTest->packetHeader.messageID=0x01; packetTest->packetHeader.targetService=0xF1; packetTest->packetHe...
PaulBryden/ROVER
src/pi_linux/inc/PortIPAddr.h
<gh_stars>1-10 #ifndef PortIPAddr_h #define PortIPAddr_h #include <iterator> #include <vector> #include <string> #include <Types.h> #include <Port.h> #include <Comms.h> class PortIPAddr : public Port { public: PortIPAddr(int id); void read(); void handleData(char *data, int dataSize); void write(v...
PaulBryden/ROVER
src/pi_linux/inc/ServiceTable.h
<reponame>PaulBryden/ROVER #ifndef ServiceTable_h #define ServiceTable_h #include <Service.h> #include <MessageQueue.h> #include <iterator> #include <map> class ServiceTable { private: std::map<byte, Service*> _table; public: ServiceTable(); ~ServiceTable(); Service* getService(byte id); void addService(Servic...
PaulBryden/ROVER
src/pi_linux/inc/DummyPort.h
#ifdef NOARDUINO #ifndef DummyPort_h #define DummyPort_h #include <iterator> #include <vector> #include "Types.h" class Port { private: vector<byte> _buffer; string _serial; public: Port(string serial); Port(); int id; void read(); void write(vector<char> serializedPacket); packet_t getPacketFromBuffer(); ...
PaulBryden/ROVER
src/pi_linux/inc/Comms.h
#ifndef Comms_h #define Comms_h #include <Types.h> #include <Message.h> #include <Message.cpp> #ifndef NOARDUINO #include <Port.h> #else #include <DummyPort.h> #include <Port.h> #endif #include <MessageQueue.h> #include <MessageQueue.cpp> #include <ServiceTable.h> #include <ServiceTable.cpp> #include <Service.h> #i...
PaulBryden/ROVER
src/arduino/avr-stl/include/avr_config.h
/* * avr_config.h * Contains values that you can change to customize the way that the library behaves * * Created on: 1 Jan 2011 * Author: <NAME> */ #ifndef __C4BCBBDE_67BC_4bb4_A5E1_7745E49AF0B6 #define __C4BCBBDE_67BC_4bb4_A5E1_7745E49AF0B6 #include <stdlib.h> namespace avrstl { // de...
PaulBryden/ROVER
src/pi_linux/inc/Port.h
#ifndef Port_h #define Port_h #include <vector> #include "Types.h" class Port { public: vector<byte> _buffer; bool _start_last; bool _end_last; bool _packet_start_rcvd; int _id; virtual void read() =0; virtual void write(vector<byte> serializedPacket) =0; virtual packet_t getPacketFromBuffer() = 0; }; ...
PaulBryden/ROVER
src/pi_linux/inc/MessageQueue.h
<reponame>PaulBryden/ROVER<gh_stars>1-10 #ifndef MessageQueue_h #define MessageQueue_h #include <Message.h> #include <iostream> class MessageQueue { deque<Message> _queue; public: void addMessage(Message m); void addPriorityMessage(Message m); deque<Message> getMessageQueue(); Message popMessage(); int queue...
PaulBryden/ROVER
src/arduino/libraries/Anansi/SerialPort.h
<filename>src/arduino/libraries/Anansi/SerialPort.h #ifndef SerialPort_h #define SerialPort_h #include <Port.h> #include <iterator> #include <HardwareSerial.h> class SerialPort : public Port{ public: SerialPort(int id, HardwareSerial *serial); void read(); void write(vector<byte> serializedPacket); packet_t ge...
PaulBryden/ROVER
src/pi_linux/inc/PortPi.h
#ifndef PortPi_h #define PortPi_h #include <iterator> #include <vector> #include <string> #include <Types.h> #include <Port.h> #include <Comms.h> #include <wiringSerial.c> class PortPi : public Port { public: PortPi(int id); void read(); void write(vector<byte> serializedPacket); packet_t getPacketFromBuffer()...
lylwo317/redis-3.0-annotated
deps/hiredis/fmacros.h
#ifndef __HIREDIS_FMACRO_H #define __HIREDIS_FMACRO_H #if !defined(_BSD_SOURCE) #define _BSD_SOURCE #endif #if defined(__sun__) #define _POSIX_C_SOURCE 200112L #elif defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) #define _XOPEN_SOURCE \ 600...
forwardkth/leetcode
first_round/hard/include/minimum_window_substring_76.h
<reponame>forwardkth/leetcode<filename>first_round/hard/include/minimum_window_substring_76.h // Given two strings s and t of lengths m and n respectively, //return the minimum window substring of s such that every character // in t (including duplicates) is included in the window. // If there is no such substring, ...
forwardkth/leetcode
first_round/easy/include/valid_parentheses_20.h
<gh_stars>1-10 // Given a string s containing just the characters '(', ')', '{', '}', // '[' and ']', determine if the input string is valid. // An input string is valid if: // Open brackets must be closed by the same type of brackets. // Open brackets must be closed in the correct order. // Example 1: // Input:...
forwardkth/leetcode
first_round/hard/include/candy_135.h
// There are n children standing in a line. Each child is assigned a rating // value given in the integer array ratings. // You are giving candies to these children subjected to the following // requirements: // Each child must have at least one candy. // Children with a higher rating get more candies than their ne...
forwardkth/leetcode
first_round/easy/include/add_two_nums.h
<gh_stars>1-10 /* * AddTwoNumsSolution.h * * Created on: Jan 29, 2019 * Author: chao */ //Description: //You are given two non-empty linked lists representing two non-negative integers. //The digits are stored in reverse order and each of their nodes contain a single digit. //Add the two numbers and return ...
forwardkth/leetcode
first_round/easy/include/longest_common_prefix_14.h
// Write a function to find the longest common prefix string amongst // an array of strings. // If there is no common prefix, return an empty string "". // Example 1: // Input: strs = ["flower","flow","flight"] // Output: "fl" // Example 2: // Input: strs = ["dog","racecar","car"] // Output: "" // Explanation: There...
forwardkth/leetcode
first_round/easy/include/merge_sorted_array_88.h
<reponame>forwardkth/leetcode<gh_stars>1-10 //88. Merge Sorted Array // You are given two integer arrays nums1 and nums2, sorted in non-decreasing // order, and two integers m and n, representing the number of elements in // nums1 and nums2 respectively. // Merge nums1 and nums2 into a single array sorted in non-de...
forwardkth/leetcode
first_round/easy/include/add_two_nums_smartptr.h
<reponame>forwardkth/leetcode<filename>first_round/easy/include/add_two_nums_smartptr.h /* * AddTwoNumsSolutionSmartPtr.h * * Created on: Feb 4, 2019 * Author: <NAME> */ //Description: //You are given two non-empty linked lists representing two non-negative integers. //The digits are stored in reverse order...
forwardkth/leetcode
first_round/easy/include/palindrome_number_9.h
// Given an integer x, return true if x is palindrome integer. // An integer is a palindrome when it reads the same backward as forward. //For example, 121 is palindrome while 123 is not. // Example 1: // Input: x = 121 // Output: true // Example 2: // Input: x = -121 // Output: false // Explanation: From left to...
forwardkth/leetcode
first_round/easy/include/assign_cookies_455.h
<gh_stars>1-10 // Assume you are an awesome parent and want to give your children some cookies. // But, you should give each child at most one cookie. // Each child i has a greed factor g[i], which is the minimum size of a cookie // that the child will be content with; and each cookie j has a size s[j]. // If s[j] >=...
forwardkth/leetcode
first_round/medium/include/linked_list_cycle_II_142.h
// Given the head of a linked list, return the node where the cycle begins. // If there is no cycle, return null. // There is a cycle in a linked list if there is some node in the list // that can be reached again by continuously following the next pointer. // Internally, pos is used to denote the index of the node ...
forwardkth/leetcode
first_round/easy/include/roman_to_integer_13.h
<filename>first_round/easy/include/roman_to_integer_13.h // Roman numerals are represented by seven different symbols: // I, V, X, L, C, D and M. // Symbol Value // I 1 // V 5 // X 10 // L 50 // C 100 // D 500 // M 1000 // For ...
forwardkth/leetcode
first_round/easy/include/two_sum_II_167.h
<gh_stars>1-10 // 167. Two Sum II - Input Array Is Sorted // Given a 1-indexed array of integers numbers that is already sorted // in non-decreasing order, find two numbers such that they add up to // a specific target number. Let these two numbers be numbers[index1] and // numbers[index2] where 1 <= index1 < index...
forwardkth/leetcode
first_round/medium/include/non_overlapping_intervals_435.h
// Given an array of intervals intervals where intervals[i] = [starti, endi], // return the minimum number of intervals you need to remove to make // the rest of // the intervals non-overlapping. // Example 1: // Input: intervals = [[1,2],[2,3],[3,4],[1,3]] // Output: 1 // Explanation: [1,3] can be removed and the...
forwardkth/leetcode
first_round/easy/include/two_sum_1.h
/* * TwoSumSolution.h * * Created on: Jan 29, 2019 * Author: chao */ //Description: //Given an array of integers, return indices of the two numbers such that they //add up to a specific target. // //You may assume that each input would have exactly one solution, and you may //not use the same element twice...
cdalvaro2/Vibration-Normal-Modes-2D
computational-physics/graphics/MyOpenGL.h
// // MyOpenGL.h // Vibration Normal Modes 2D // // Created by <NAME> on 5/8/12. // Copyright (c) 2012 NEPTUNO. All rights reserved. // #pragma once #include <string> #include "../math/containers/vector.hpp" #include "../math/containers/matrix.hpp" // OPENGL namespace cda { namespace graphics { ...
cdalvaro2/Vibration-Normal-Modes-2D
Tests/TestsTools.h
// // TestsTools.h // Computational Physics // // Created by <NAME> on 15/06/2018. // Copyright © 2018 cdalvaro. All rights reserved. // #ifndef TestsTools_h #define TestsTools_h #define TESTS_TOOLS_DEFAULT_ACCURACY 1E-13 #import "../computational-physics/math/containers.hpp" @interface TestsTools : NSObject ...
cdalvaro2/Vibration-Normal-Modes-2D
computational-physics/math/differential_equations/SolveEDP.h
<filename>computational-physics/math/differential_equations/SolveEDP.h // // Solve.h // Vibration Normal Modes 2D // // Created by <NAME> on 5/8/12. // Copyright (c) 2012 NEPTUNO. All rights reserved. // #pragma once // BOUNDARY CONDITIONS // Condiciones en la función #define BCL_f 0x01 // BCL - Bound...
MichGedd/NDegreesOfWikipedia
include/WebCrawlerManager.h
<reponame>MichGedd/NDegreesOfWikipedia // // Created by micha on 2020-09-20. // #pragma once #include <iostream> #include <queue> #include <string> #include <pthread.h> #include "Graph.h" #include "WebCrawler.h" namespace NDegreesOfWikipedia { struct ThreadData { NDegreesOfWikipedia::WebCrawler *pwc; ...
MichGedd/NDegreesOfWikipedia
include/Graph.h
// // Created by micha on 2020-09-20. // #pragma once #include <iostream> #include <string> #include <vector> #include <unordered_map> #include <stack> namespace NDegreesOfWikipedia { // Struct for graph nodes struct Node { std::string value; // Name of article Node *parentNode; // Pointer ...
MichGedd/NDegreesOfWikipedia
include/WebCrawler.h
// // Created by micha on 2020-09-19. // #pragma once #include <iostream> #include <curl/curl.h> #include <nlohmann/json.hpp> #include <regex> #include <unistd.h> #include <mutex> #include <stack> namespace NDegreesOfWikipedia { inline std::mutex queueMutex = {}; // Queue Mutex inline std::mutex graphMutex...
josephlewis42/personal_codebase
xc/Lab09-DrivingStraight/src/uart.h
<reponame>josephlewis42/personal_codebase #ifndef uart_h #define uart_h void debug(const char values[]); #endif
josephlewis42/personal_codebase
xc/HW07-PID/src/hmc6352.h
<filename>xc/HW07-PID/src/hmc6352.h #ifndef HMC6352_H_ #define HMC6352_H_ #include "i2c.h" typedef enum { SLAVE_ADDRESS=0, MAGNETOMETER_X_OFFSET_MSB=1, MAGNETOMETER_X_OFFSET_LSB=2, MAGNETOMETER_Y_OFFSET_MSB=3, MAGNETOMETER_Y_OFFSET_LSB=4, TIME_DELAY=5, NUM_SUMMED_MEASUREMENTS=6, SOFTWARE_VERSION_NUMBER=7, OP...
josephlewis42/personal_codebase
xc/Lab08-LinkedList/src/bfs.h
/* * bfs.h * * Created on: May 17, 2012 * Author: <NAME> <<EMAIL>> */ #ifndef BFS_H_ #define BFS_H_ # define MAZE_WIDTH 10 # define ELEMENT_COUNT (MAZE_WIDTH * MAZE_WIDTH) # define RANK(row, col) ((row) * MAZE_WIDTH + (col)) # define ROW(rank) ((rank) / MAZE_WIDTH) # define COL(rank) ((rank) % MAZE_WIDTH)...
josephlewis42/personal_codebase
xc/Lab09-DrivingStraight/src/utility.h
#ifndef UTILITY_H_ #define UTILITY_H_ #include <xs1.h> #define TICKS_PER_US (XS1_TIMER_HZ/1000000) #define TICKS_PER_MS (XS1_TIMER_HZ/1000) #define TICKS_PER_SEC (XS1_TIMER_HZ) #define MIN(x,y) (x > y ? y : x) #define MAX(x,y) (x > y ? x : y) #endif /* UTILITY_H_ */
josephlewis42/personal_codebase
xc/Lab07-Rotate90/src/pid.c
#include <math.h> #include <stdio.h> #include <stdlib.h> const double EPSILON = 0.0000001; /** int main(int argc, char** argv) { const double dt = 1.0, setpoint = 50.0; double prev_position = 0.0, error = 0.0, position = 0.0; double integral = 0, derivative = 0, output = 0.0; //sum of errors over time ...
josephlewis42/personal_codebase
xc/HW09-FinalVehicle/src/DistanceControlHelper.c
#include "DistanceControlHelper.h" float find_velocity_mm_per_ms(int width) { return -.0000009948052591 * width * width + .00367823322 * width - 3.246861274; } int find_pulse_duration_ms(int width, int dist_mm) { return (int) ((float) dist_mm / find_velocity_mm_per_ms(width)); }
josephlewis42/personal_codebase
xc/HW09-FinalVehicle/src/hmc6352.h
#ifndef HMC_DRIVER_H #define HMC_DRIVER_H #include "i2c.h" extern const unsigned char HMC6352_SLAVE_ADDRESS; extern const unsigned char HMC6352_MAGNETOMETER_X_OFFSET_MSB; extern const unsigned char HMC6352_MAGNETOMETER_X_OFFSET_LSB; extern const unsigned char HMC6352_MAGNETOMETER_Y_OFFSET_MSB; extern const unsigned c...