repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
alonf/UniversalACRemote
ArduinoLoopManager.h
// ArduinoLoopManager.h #ifndef _ARDUINOLOOPMANAGER_h #define _ARDUINOLOOPMANAGER_h #include <functional> #include <initializer_list> #include <memory> #include "Singleton.h" #include<vector> class IProcessor { public: virtual void Loop() = 0; virtual ~IProcessor() {} }; typedef std::shared_ptr<IProcessor> proces...
alonf/UniversalACRemote
DHTReader.h
<reponame>alonf/UniversalACRemote<gh_stars>1-10 #pragma once #include <DHT.h> #define DHTTYPE DHT22 class DHTReader { private: DHT _dht; public: DHTReader(); ~DHTReader(); float ReadTemperature(); float ReadHumidity(); };
alonf/UniversalACRemote
IRelectra.h
<filename>IRelectra.h /* * IRelectra * Thanks to <NAME> and Chris from AnalysIR */ #pragma once #ifndef IRelectra_h #define IRelectra_h //#include <IRremoteInt.h> #include <IRsend.h> enum class IRElectraMode : uint8_t { Cool = 0b001, Heat = 0b010, Fan = 0b101, Dry = 0b100, Auto = 0b011 }; en...
alonf/UniversalACRemote
ConfigurationManager.h
<filename>ConfigurationManager.h // ConfigurationManager.h #ifndef _CONFIGURATIONMANAGER_h #define _CONFIGURATIONMANAGER_h #include <algorithm> #include "Singleton.h" #include "WebServer.h" class ConfigurationManager : public Singleton<ConfigurationManager> { friend class Singleton<ConfigurationManager>; private: ...
alonf/UniversalACRemote
ACTypes.h
#pragma once #ifndef ACTYPES #define ACTYPES enum class ACMode { Cool, Heat, Fan, Dry, Auto, Humid, Recycle }; enum class ACFan { Low, Medium, High, Turbo, Auto }; enum class ACExtendedSwingMode { Off = 0, OnFull = 1, On1 = 2, ...
alonf/UniversalACRemote
Configuration.h
// Configuration.h #pragma once #ifndef _CONFIGURATION_h #define _CONFIGURATION_h #define ELECTRA //#define TADIRAN //#define TADIRANTAC290 //Wifi Configuration static const char *SSID = "ACIoT"; //The default configuration access point ssid static const char *password = "<PASSWORD>"; //The default configuration acc...
alonf/UniversalACRemote
Util.h
// Util.h #ifndef _UTIL_h #define _UTIL_h #include <arduino.h> #include <algorithm> #include <vector> namespace Util { void software_Reboot(); //rebot the board template <typename T, std::size_t n> void String2Array(const String &str, T(&arr)[n]) { memset(arr, 0, n); memcpy(arr, str.c_str(), std::min(...
alonf/UniversalACRemote
LedsLogger.h
<reponame>alonf/UniversalACRemote #ifndef _LEDSLOGGER_h #define _LEDSLOGGER_h #include "arduino.h" #include <memory> #include "Singleton.h" #include "ArduinoLoopManager.h" #include <IPAddress.h> #include <queue> class LedsLogger : public Singleton<LedsLogger>, public IProcessor { private: friend class Singleton<Le...
alonf/UniversalACRemote
Logger.h
// Logger.h #ifndef _LOGGER_h #define _LOGGER_h #include "arduino.h" #include "LedsLogger.h" #include "WebServer.h" #include <memory> #include "Singleton.h" #include "ArduinoLoopManager.h" class Logger : public Singleton<Logger>, public IProcessor { friend class Singleton<Logger>; private: LedsLoggerPtr_t _ledsLog...
alonf/UniversalACRemote
IRTadiran.h
<filename>IRTadiran.h #pragma once #ifndef IRTADIRAN_h #define IRTADIRAN_h #include <IRsend.h> enum class IRTadiranMode : uint8_t { Cool = 0, Heat = 1, Fan = 2, Humid = 3, Recycle = 4 }; enum class IRTadiranFan : uint8_t { Auto = 0, Low = 1, Medium = 2, High = 3,...
alonf/UniversalACRemote
WebServer.h
// WebServer.h #ifndef _WEBSERVER_h #define _WEBSERVER_h #include "Arduino.h" #include <ESP8266WebServer.h> #undef ARDUINO_BOARD #define ARDUINO_BOARD "generic" #include <ESP8266mDNS.h> #include <String> #include <memory> #include "WiFiManager.h" #include "Singleton.h" #include "PubSub.h" #include "Ard...
alonf/UniversalACRemote
Singleton.h
// Singleton.h #ifndef _SINGLETON_h #define _SINGLETON_h #include "arduino.h" #include <memory> template<typename T> class Singleton { private: static std::weak_ptr<T> _instance; public: virtual ~Singleton() = default; template<typename... Args> static std::shared_ptr<T> Create(Args&&... args) { auto instan...
alonf/UniversalACRemote
PushButtonManager.h
<filename>PushButtonManager.h<gh_stars>1-10 // PushButtonManager.h #ifndef _PUSHBUTTONMANAGER_h #define _PUSHBUTTONMANAGER_h #include "arduino.h" #include <functional> #include <memory> #include "Singleton.h" #include "ArduinoLoopManager.h" class IPushButtonActions { public: virtual void OnPress() = 0; //called whe...
alonf/UniversalACRemote
WiFiManager.h
// WiFiManager.h #ifndef _WIFIMANAGER_h #define _WIFIMANAGER_h #include "Arduino.h" #include <ESP8266WiFi.h> #include <WiFiClientSecure.h> #include <WiFiUdp.h> #include <vector> #include <array> //#include <map> #include <memory> #include <functional> #include "Singleton.h" #include "ArduinoLoopManager.h" #include <l...
alonf/UniversalACRemote
ACManager.h
// ACManager.h #ifndef _ACMANAGER_h #define _ACMANAGER_h #define RAWBUF 101 #include "Singleton.h" #include "ArduinoLoopManager.h" #include "Configuration.h" #include "Util.h" //#include <map> #ifdef ELECTRA #include "ACElectraController.h" #elif defined(TADIRAN) #include "ACTadiranController.h" #eli...
alonf/UniversalACRemote
ACElectraController.h
<reponame>alonf/UniversalACRemote<filename>ACElectraController.h<gh_stars>1-10 #pragma once #ifndef ACELECTRACONTROLLER #define ACELECTRACONTROLLER #include "ACController.h" #include "Configuration.h" #include "IRelectra.h" class ACElectraController { typedef ACController<ACElectraController> Controller...
alonf/UniversalACRemote
IRTadiranTac290.h
<filename>IRTadiranTac290.h /* * IRTadiranTac290 * Reverse engineering by <NAME> with AnalysIR */ #pragma once #ifndef IRTadeiranTac290_h #define IRTADIRANTAC290_H //#include <IRremoteInt.h> #include <IRsend.h> enum class IRTadiranTac290Mode : uint64_t { Cool = 0b10, Heat = 0b01, }; enum class IRT...
alonf/UniversalACRemote
ACController.h
<filename>ACController.h #pragma once #ifndef ACCONTROLLER #define ACCONTROLLER #include <Arduino.h> #include "ACTypes.h" #include "ACCapabilities.h" /* * TRealACController: * TRealACController.SendAc(ACState state); * void TRealACController.Initialize(); * ACCapabilities TRealACController::Capabilit...
alonf/UniversalACRemote
ACCapabilities.h
#pragma once #ifndef _ACCAPABILITIES #define _ACCAPABILITIES #include "IRTadiran.h" enum class ACCapabilities : unsigned int { None = 0, HasFanModeTurbo = 1 << 0, HasFanModeHigh = 1 << 1, HasFanModeMedium = 1 << 2, HasFanModeLow = 1 << 3, HasFanModeAuto = ...
alonf/UniversalACRemote
ACTadiranTac290Controller.h
<gh_stars>1-10 #pragma once #ifndef ACTADIRANTAC290CONTROLLER_H #define ACTADIRANTAC290CONTROLLER_H #include <IRsend.h> #include "ACController.h" #include "Configuration.h" #include "IRTadiranTac290.h" class ACTadiranTac290Controller { typedef ACController<ACTadiranTac290Controller> Controller_t; ...
alonf/UniversalACRemote
ACView.h
#pragma once #include <String> #ifndef _ACVIEW_h #define _ACVIEW_h #include "Configuration.h" /* * Since the view is different between the AC types, there is a different template for each of them. * In the future, a conditional element can be added to build a complex combined template */ #ifdef ELECTRA c...
alonf/UniversalACRemote
ACTadiranController.h
#pragma once #ifndef ACTADIRANCONTROLLER_H #define ACTADIRANCONTROLLER_H #include <IRsend.h> #include "ACController.h" #include "Configuration.h" #include "IRTadiran.h" class ACTadiranController { typedef ACController<ACTadiranController> Controller_t; private: IRsend _irsend; IRTadiran ...
Lizards/xdg-open-server
main.c
<gh_stars>1-10 #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/un.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/wait.h> #include <X11/Xlib.h> #define run(cmd, ...) { \ if (!fork()) { \ execlp(cmd, cmd, __VA_ARGS__, 0); \ exit(1); \ } \ wait(0); \ } ...
IoanaRoibu/oop-2022
laborator 5/lab 5/Ford.h
<reponame>IoanaRoibu/oop-2022 #pragma once #include "Car.h" class Ford : public Car { public: void SetFuelCapacity(int fuel_cap) override; void SetFuelConsumption(int fuel_cons) override; void SetRainSpeed(int rain_speed) override; void SetSnowSpeed(int snow_speed) override; void SetSunnySpeed(int sunny_speed) ove...
IoanaRoibu/oop-2022
problema2_lab 2/compara_studenti.h
//a header file for the global functions //5 global functions that compares two students in terms of name, grades, average. #include "student.h" #pragma once int compara_nume(Student s1, Student s2); int compara_mate(Student s1, Student s2); int compara_eng(Student s1, Student s2); int compara_ist(Student s1, Student s...
IoanaRoibu/oop-2022
laborator 5/lab 5/Circuit.h
<reponame>IoanaRoibu/oop-2022<filename>laborator 5/lab 5/Circuit.h #pragma once #include "Weather.h" #include "Car.h" #include "Dacia.h" #include "Ford.h" #include "Mazda.h" #include "Mercedes.h" #include "Toyota.h" class Circuit { int lungime; int car_nr=0; Car* cars[6]; int not_finish[6]={0}; Weather weather; i...
IoanaRoibu/oop-2022
laborator 5/lab 5/Car.h
#pragma once class Car { protected: int fuel_capacity, fuel_consumption, average_speed_rain, average_speed_snow, average_speed_sunny; public: virtual void SetFuelCapacity(int fuel_cap) = 0; virtual void SetFuelConsumption(int fuel_cons) = 0; virtual void SetRainSpeed(int rain_speed) = 0; virtual void SetSnowSpeed(...
IoanaRoibu/oop-2022
problema2_lab 2/student.h
<reponame>IoanaRoibu/oop-2022<filename>problema2_lab 2/student.h //a header file for the class #pragma once class Student { float Nota_mate; float Nota_eng; float Nota_ist; float Medie; char Nume[50]; public: void setname(char nume[]); //methods to setand get the name of the student const char* getname(); void ...
CalvinLeo/CLCircleProgressView
CLCircleProgressView/CLProgressView/CLProgressView.h
<gh_stars>1-10 // // 圆形进度条 // // Created by AEF_oycf on 2018/8/22. // Copyright © 2018年 AEF_oycf. All rights reserved. // #import <UIKit/UIKit.h> @interface CLProgressView : UIView @property (nonatomic, assign) CGFloat progressValue;// 进度 @property (nonatomic, strong) UIColor *trackColor; // 轨道颜色 @property (non...
DreamerZJ/ZJLaunchAdv
ZJLaunchAdvDemo/ZJLaunchAdv/ZJLaunchAdv/ZJProxy.h
<filename>ZJLaunchAdvDemo/ZJLaunchAdv/ZJLaunchAdv/ZJProxy.h<gh_stars>0 // // ZJProxy.h // Push // // Created by 张建 on 2017/12/8. // Copyright © 2017年 zhangjian. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @interface ZJProxy : NSProxy @property (nonatomic,readonly,weak) id targ...
DreamerZJ/ZJLaunchAdv
ZJLaunchAdvDemo/ZJLaunchAdv/ZJLaunchAdv/ZJLaunchAdv.h
<gh_stars>0 // // ZJLaunchImageAdView.h // Push // // Created by zhangjian on 2017/12/29. // Copyright © 2017年 zhangjian. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger,ZJAdType){ ZJAdTypeLogo = 0, //带有logo ZJAdTypeFullScreen, //全屏,不带lodo ...
DreamerZJ/ZJLaunchAdv
ZJLaunchAdvDemo/ZJLaunchAdv/AppDelegate.h
<filename>ZJLaunchAdvDemo/ZJLaunchAdv/AppDelegate.h<gh_stars>0 // // AppDelegate.h // ZJLaunchAdv // // Created by zhangjian on 2018/1/3. // Copyright © 2018年 zhangjian. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWi...
ipuustin/sql-parser
include/sqlparser/TableAccess.h
#pragma once #include <string> #include <set> #include <map> #include <iterator> #include <unordered_map> namespace hsql { typedef std::unordered_map<std::string, std::set<std::string>> TableAccessMap; class TableAccess { public: const std::string OpUnknown{"unknown"}; const std::string O...
ipuustin/sql-parser
include/sqlparser/SQLStatement.h
#pragma once #include <vector> #include "TableAccess.h" #include "Expr.h" namespace hsql { enum StatementType { kStmtError, // unused kStmtSelect, kStmtImport, kStmtInsert, kStmtUpdate, kStmtDelete, kStmtCreate, kStmtDrop, kStmtPrepare, kStmtExecute, kStmtExport, kStm...
ipuustin/sql-parser
include/sqlparser/AlterStatement.h
#pragma once #include "SQLStatement.h" #include "SelectStatement.h" namespace hsql { enum AlterType { kAlterTable, kAlterSchema, kAlterDatabase }; // Represents SQL Alter statements. // Example: "ALTER TABLE students ADD column Id varchar (20)" struct AlterStatement : SQLStatement { AlterSt...
ipuustin/sql-parser
include/sqlparser/DeleteStatement.h
#pragma once #include "SQLStatement.h" // Note: Implementations of constructors and destructors can be found in statements.cpp. namespace hsql { // Represents SQL Delete statements. // Example: "DELETE FROM students WHERE grade > 3.0" // Note: if (expr == nullptr) => delete all rows (truncate) struct DeleteS...
ipuustin/sql-parser
include/sqlparser/UpdateStatement.h
<reponame>ipuustin/sql-parser #pragma once #include "SQLStatement.h" namespace hsql { // Represents "column = value" expressions. struct UpdateClause { char* column; Expr* value; }; // Represents SQL Update statements. struct UpdateStatement : SQLStatement { UpdateStatement(); virtual ~Upd...
ipuustin/sql-parser
include/sqlparser/PrepareStatement.h
<filename>include/sqlparser/PrepareStatement.h #pragma once #include "SQLStatement.h" namespace hsql { // Represents SQL Prepare statements. // Example: PREPARE test FROM 'SELECT * FROM test WHERE a = ?;' struct PrepareStatement : SQLStatement { PrepareStatement(): SQLStatement(kStmtPrepare), ...
ipuustin/sql-parser
include/sqlparser/ShowStatement.h
<gh_stars>1-10 #pragma once #include "SQLStatement.h" // Note: Implementations of constructors and destructors can be found in statements.cpp. namespace hsql { enum ShowType { kShowColumns, kShowTables, kShowDatabases }; // Represents SQL SHOW statements. // Example "SHOW TABLES;" struct ShowS...
ipuustin/sql-parser
include/sqlparser/ExecuteStatement.h
<gh_stars>1-10 #pragma once #include "SQLStatement.h" namespace hsql { // Represents SQL Execute statements. // Example: "EXECUTE ins_prep(100, "test", 2.3);" struct ExecuteStatement : SQLStatement { ExecuteStatement(); virtual ~ExecuteStatement(); void tablesAccessed(TableAccessMap& accessMap) c...
ipuustin/sql-parser
include/sqlparser/InsertStatement.h
#pragma once #include "SQLStatement.h" #include "SelectStatement.h" namespace hsql { enum InsertType { kInsertValues, kInsertSelect }; // Represents SQL Insert statements. // Example: "INSERT INTO students VALUES ('Max', 1112233, 'Musterhausen', 2.3)" struct InsertStatement : SQLStatement { Ins...
ipuustin/sql-parser
include/sqlparser/Database.h
<reponame>ipuustin/sql-parser<gh_stars>1-10 #pragma once #include "Expr.h" #include <stdio.h> #include <vector> namespace hsql { struct DatabaseName { char* name; }; } // namespace hsql
ipuustin/sql-parser
include/sqlparser/statements.h
#pragma once #include "SelectStatement.h" #include "ImportStatement.h" #include "CreateStatement.h" #include "InsertStatement.h" #include "UpdateStatement.h" #include "DeleteStatement.h" #include "DropStatement.h" #include "AlterStatement.h" #include "PrepareStatement.h" #include "ExecuteStatement.h" #include "ShowSta...
shreroa/CSE3320
sigqueue_example.c
// The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, mo...
shreroa/CSE3320
pipe.c
<gh_stars>1-10 // The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // t...
shreroa/CSE3320
block_signal.c
<filename>block_signal.c<gh_stars>1-10 // The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without li...
shreroa/CSE3320
fork.c
<reponame>shreroa/CSE3320 // The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the ...
shreroa/CSE3320
mutex.c
#include <pthread.h> // for pthread_create, pthread_join, pthread_exit #include <stdio.h> // for printf #include <stdlib.h> // for exit #define NITER 1000000 pthread_mutex_t mutex; int count = 0; void * Count(void * a) { int i, tmp; for(i = 0; i < NITER; i++) { pthread_mutex_lock( &mutex ...
shreroa/CSE3320
shared_mem.c
// The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, mo...
shreroa/CSE3320
sigint_signal_block.c
// The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, mo...
shreroa/CSE3320
time.c
<gh_stars>1-10 #include <sys/time.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main () { struct timeval begin; struct timeval end; gettimeofday( &begin, NULL ); sleep(5); gettimeofday( &end, NULL ); int time_duration = ( ( end.tv_sec - begin.tv_sec ) * 1000000 + ( end.tv_usec - be...
shreroa/CSE3320
memmap.c
<reponame>shreroa/CSE3320<gh_stars>1-10 // The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without l...
shreroa/CSE3320
multiple_signals.c
// The MIT License (MIT) // // Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, mo...
vkrotin/ASNotificationCenter
core/ASNotifiation.h
// // ASNotifiation.h // AppSafeNotificationCenter // // Created by <NAME> on 16.03.17. // Copyright © 2017 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> typedef NSString *ASNotificationName NS_EXTENSIBLE_STRING_ENUM; @interface ASNotifiation : NSObject @property (nonatomic, strong) id obser...
vkrotin/ASNotificationCenter
core/ASNotificationCenter.h
<gh_stars>0 // // ASNotificationCenter.h // AppSafeNotificationCenter // // Created by <NAME> on 16.03.17. // Copyright © 2017 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> #import "ASNotifiation.h" #define _protectedCenter [ASNotificationCenter protectedCenter] @interface ASNotificationCente...
vkrotin/ASNotificationCenter
Example/ASNotificationCenter/ASAppDelegate.h
// // ASAppDelegate.h // ASNotificationCenter // // Created by <NAME> on 03/16/2017. // Copyright (c) 2017 <NAME>. All rights reserved. // @import UIKit; @interface ASAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
vkrotin/ASNotificationCenter
Example/ASNotificationCenter/ASModalViewController.h
// // ASModalViewController.h // ASNotificationCenter // // Created by <NAME> on 16.03.17. // Copyright © 2017 <NAME>. All rights reserved. // #import <UIKit/UIKit.h> @interface ASModalViewController : UIViewController @end
vkrotin/ASNotificationCenter
Example/ASNotificationCenter/UIColor+ASRandom.h
<reponame>vkrotin/ASNotificationCenter // // UIColor+ASRandom.h // ASNotificationCenter // // Created by <NAME> on 16.03.17. // Copyright © 2017 <NAME>. All rights reserved. // #import <UIKit/UIKit.h> @interface UIColor (ASRandom) +(UIColor *) randomColor; @end
vkrotin/ASNotificationCenter
Example/Pods/Target Support Files/ASNotificationCenter/ASNotificationCenter-umbrella.h
<filename>Example/Pods/Target Support Files/ASNotificationCenter/ASNotificationCenter-umbrella.h<gh_stars>0 #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 #import "ASNotifi...
vkrotin/ASNotificationCenter
Example/ASNotificationCenter/ASViewController.h
// // ASViewController.h // ASNotificationCenter // // Created by <NAME> on 03/16/2017. // Copyright (c) 2017 <NAME>. All rights reserved. // @import UIKit; @interface ASViewController : UIViewController @end
CodeChalenges/vcd-delay-analyzer
include/utils.h
#ifndef UTILS_H #define UTILS_H unsigned char startsWith(const char* prefix, const char* str); #endif
CodeChalenges/vcd-delay-analyzer
src/signal.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include "signal.h" void createSignal(Signal** signals, unsigned int* nsignals, char* name, char symbol) { Signal* newSignal = (Signal*)malloc(sizeof(newSignal)); newSignal->name = (char*)malloc(strlen(name) * sizeof(char)); strcpy(n...
CodeChalenges/vcd-delay-analyzer
include/signal.h
#ifndef SIGNAL_H #define SIGNAL_H typedef struct { char* name; char symbol; unsigned char currentSignalValue; unsigned char hasPassedInIdle; unsigned int lastSignalChangeTimestamp; unsigned int shortestIdleDelay; unsigned int longestIdleDelay; } Signal; /* Create a new signal */ void createSignal(Signal...
CodeChalenges/vcd-delay-analyzer
src/utils.c
#include <string.h> #include "utils.h" unsigned char startsWith(const char* prefix, const char* str) { size_t lenpre = strlen(prefix), lenstr = strlen(str); return lenstr < lenpre ? 0 : (strncmp(prefix, str, lenpre) == 0); }
CodeChalenges/vcd-delay-analyzer
src/main.c
<filename>src/main.c #include <stdlib.h> #include <stdio.h> #include <string.h> #include "signal.h" #include "utils.h" int main(int argc, char* argv[]) { Signal* signals = NULL; unsigned int nsignals = 0; const char* vcd_file = argv[1]; char* name; char id; // Read VCD file FILE* fp; char* line = NUL...
matthewmascord/esp8266-blink
test/mocks/ets_sys.h
<reponame>matthewmascord/esp8266-blink #include <stdint.h> #ifndef _ETS_SYS_H_ #define _ETS_SYS_H_ #define ICACHE_FLASH_ATTR #define UART_CLK_FREQ 80*1000000 void uart_div_modify(uint8_t uart_no, uint32_t DivLatchValue); #endif
matthewmascord/esp8266-blink
test/mocks/osapi.h
<reponame>matthewmascord/esp8266-blink #include <stdint.h> #include <stdbool.h> #ifndef _OSAPI_H_ #define _OSAPI_H_ typedef void os_timer_func_t(void *timer_arg); typedef struct _os_timer_t_ { struct _os_timer_t_ *timer_next; uint32_t timer_expire; uint32_t timer_period; os_t...
matthewmascord/esp8266-blink
test/mocks/user_interface.h
<gh_stars>0 #include <stdint.h> #include <stdbool.h> #ifndef _USER_INTERFACE_H_ #define _USER_INTERFACE_H_ typedef enum { SYSTEM_PARTITION_BOOTLOADER, SYSTEM_PARTITION_OTA_1, SYSTEM_PARTITION_OTA_2, SYSTEM_PARTITION_RF_CAL, SYSTEM_PARTITION_PHY_DATA, SYSTEM_PARTITION_SYSTEM_PARAMETER, SYST...
matthewmascord/esp8266-blink
src/main.c
#include "main.h" #ifdef GDB_DEBUG #include "gdbstub.h" #endif #include <stddef.h> #include "gpio.h" #include "os_type.h" #include "user_interface.h" #define SPI_FLASH_SIZE_MAP 4 #define SYSTEM_PARTITION_OTA_SIZE 0x6A000 #define SYSTEM_PARTITION_OTA_2_ADDR 0x81000 #define SYSTEM_PARTITION_RF_CAL_ADDR ...
matthewmascord/esp8266-blink
test/TestMain.c
#include "main.h" #include "unity.h" #include "Mockgpio.h" #include "Mockets_sys.h" #include "Mockosapi.h" #include "Mockgdbstub.h" #include <stdint.h> const uint32_t noPinsMask = 0; const uint32_t pinMask = 4; const uint32_t otherPinMask = 8; void setUp(void) { gpio_init_Ignore(); gpio_output_set_Ignore(); ...
matthewmascord/esp8266-blink
src/main.h
#include "ets_sys.h" #include "osapi.h" void DoBlinkyStuff(void); void ICACHE_FLASH_ATTR user_init(void); extern os_timer_t timer;
matthewmascord/esp8266-blink
test/mocks/gpio.h
#include <stdint.h> #ifndef _GPIO_H_ #define _GPIO_H_ #define GPIO_OUT_ADDRESS (uint32_t) 0 void gpio_init(void); void gpio_output_set(uint32_t set_mask, uint32_t clear_mask, uint32_t enable_mask, uint32_t disable_mask); uint32_t GPIO_REG_READ(uint32_t add...
1apple7seeds/ROSPlan
rosplan_knowledge_base/include/rosplan_knowledge_base/VALVisitorPredicate.h
<gh_stars>1-10 /** * This file describes VALVisitorPredicate class. * KMS VALVisitor classes are used to package PDDL things into ROS messages. */ #include <sstream> #include <string> #include <vector> #include "ptree.h" #include "VisitController.h" #include "rosplan_knowledge_msgs/DomainFormula.h" #ifndef KCL_va...
1apple7seeds/ROSPlan
rosplan_knowledge_base/src/VALfiles/ValidatorAPI.h
#ifndef VAL_API #define VAL_API #include <sstream> namespace VAL { bool checkPlan(const std::string& domain_file, const std::string& problem_file, std::stringstream& plan); }; #endif
1apple7seeds/ROSPlan
rosplan_knowledge_base/src/VALfiles/Environment.h
<filename>rosplan_knowledge_base/src/VALfiles/Environment.h /************************************************************************ * Copyright 2008, Strathclyde Planning Group, * Department of Computer and Information Sciences, * University of Strathclyde, Glasgow, UK * http://planning.cis.strath.ac.uk/ * * <N...
1apple7seeds/ROSPlan
rosplan_planning_system/include/rosplan_planning_system/PlanDispatch/EsterelPlanDispatcher.h
#include <stdlib.h> #include <map> #include <iostream> #include <string> #include <boost/regex.hpp> #include <boost/concept_check.hpp> #include "PlanDispatcher.h" #include "rosplan_knowledge_msgs/KnowledgeQueryService.h" #include "rosplan_knowledge_msgs/GetDomainOperatorDetailsService.h" #include "rosplan_knowledge_...
1apple7seeds/ROSPlan
rosplan_knowledge_base/include/rosplan_knowledge_base/DomainParser.h
<reponame>1apple7seeds/ROSPlan #include <ros/ros.h> #include <vector> #include <iostream> #include <fstream> #include "ptree.h" #include "FlexLexer.h" #ifndef KCL_domainparser #define KCL_domainparser extern int yyparse(); extern int yydebug; namespace VAL { extern analysis an_analysis; extern yyFlexLexer* yfl; }...
1apple7seeds/ROSPlan
rosplan_knowledge_base/src/VALfiles/LaTeXSupport.h
/************************************************************************ * Copyright 2008, Strathclyde Planning Group, * Department of Computer and Information Sciences, * University of Strathclyde, Glasgow, UK * http://planning.cis.strath.ac.uk/ * * <NAME>, <NAME> and <NAME> - VAL * <NAME>well - PDDL Parser *...
1apple7seeds/ROSPlan
rosplan_planning_system/include/rosplan_planning_system/PlannerInterface/PlannerInterface.h
#include "ros/ros.h" #include "actionlib/server/simple_action_server.h" #include "std_msgs/String.h" #include "std_srvs/Empty.h" #include "rosplan_dispatch_msgs/PlanningService.h" #include "rosplan_dispatch_msgs/PlanAction.h" #ifndef KCL_planner_interface #define KCL_planner_interface /** * This file contains an i...
1apple7seeds/ROSPlan
rosplan_knowledge_base/include/rosplan_knowledge_base/VALVisitorProblem.h
<reponame>1apple7seeds/ROSPlan<filename>rosplan_knowledge_base/include/rosplan_knowledge_base/VALVisitorProblem.h<gh_stars>1-10 /** * This file describes VALVisitorProblem class. * KMS VALVisitor classes are used to package PDDL things into ROS messages. */ #include <ros/ros.h> #include <sstream> #include <string> #...
1apple7seeds/ROSPlan
rosplan_planning_system/include/rosplan_planning_system/PlanDispatch/PlanDispatcher.h
/** * This file describes a class that dispatches a plan. */ #include "ros/ros.h" #include "rosplan_dispatch_msgs/ActionFeedback.h" #include "rosplan_dispatch_msgs/ActionDispatch.h" #include "std_srvs/Empty.h" #ifndef KCL_dispatcher #define KCL_dispatcher namespace KCL_rosplan { class PlanDispatcher { protected...
1apple7seeds/ROSPlan
rosplan_interface_movebase/include/rosplan_interface_movebase/RPMoveBase.h
#include <ros/ros.h> #include <vector> #include <iostream> #include <fstream> #include <boost/foreach.hpp> #include "rosplan_action_interface/RPActionInterface.h" #include "actionlib/client/simple_action_client.h" #include "move_base_msgs/MoveBaseAction.h" #include "mongodb_store/message_store.h" #include "geometry_m...
1apple7seeds/ROSPlan
rosplan_knowledge_base/include/rosplan_knowledge_base/KnowledgeBase.h
<filename>rosplan_knowledge_base/include/rosplan_knowledge_base/KnowledgeBase.h #include <ros/ros.h> #include <vector> #include <iostream> #include <fstream> #include "std_srvs/Empty.h" #include "rosplan_knowledge_msgs/KnowledgeUpdateService.h" #include "rosplan_knowledge_msgs/KnowledgeUpdateServiceArray.h" #include ...
1apple7seeds/ROSPlan
rosplan_knowledge_base/include/rosplan_knowledge_base/ProblemParser.h
#include <ros/ros.h> #include <vector> #include <iostream> #include <fstream> #include "FlexLexer.h" #include "ptree.h" #include "VisitController.h" #include "VALVisitorProblem.h" #ifndef KCL_problemparser #define KCL_problemparser extern int yyparse(); extern int yydebug; namespace VAL { extern analysis an_an...
1apple7seeds/ROSPlan
rosplan_planning_system/include/rosplan_planning_system/PlanDispatch/SimplePlanDispatcher.h
<gh_stars>1-10 /* * This file describes the class used to dispatch a Simple (sequential) PDDL plan. */ #include "PlanDispatcher.h" #include "rosplan_dispatch_msgs/CompletePlan.h" #include "rosplan_knowledge_msgs/KnowledgeQueryService.h" #include "rosplan_knowledge_msgs/GetDomainOperatorDetailsService.h" #include "ro...
pwiklowski/ng-iot-esp32-rgb-led-driver
main/iot_device.h
/* * iot_device.h * * Created on: Jan 6, 2021 * Author: pwiklowski */ #ifndef MAIN_IOT_DEVICE_H_ #define MAIN_IOT_DEVICE_H_ void iot_device_start(); #endif /* MAIN_IOT_DEVICE_H_ */
pwiklowski/ng-iot-esp32-rgb-led-driver
main/led.h
<gh_stars>0 #ifndef __LED_H__ #define __LED_H__ #include "driver/gpio.h" #include "driver/ledc.h" #include <math.h> #define LED_PWM_RESOLUTION LEDC_TIMER_8_BIT #define LED_MAX_VALUE (pow(2, LED_PWM_RESOLUTION)-1) void led_init(); void led_set_rgb(uint8_t red, uint8_t green, uint8_t blue); void led_set_value(ledc_cha...
pwiklowski/ng-iot-esp32-rgb-led-driver
main/led.c
#include "led.h" #include "iot_device.h" #if defined(VARIANT_6CH) || defined(VARIANT_6CH_RGB) ledc_channel_config_t led_channel_6 = { .channel = LEDC_CHANNEL_0, .duty = 0, .gpio_num = 15, .speed_mode = LEDC_HIGH_SPEED_MODE, .hpoint = 0, .timer_sel = LEDC_TIMER_0 }; ledc_channel_config_t led_channel_5 = ...
pwiklowski/ng-iot-esp32-rgb-led-driver
main/iot_device.c
#include "cJSON.h" #include "iot.h" #include "led.h" #include <stdio.h> #include "esp_heap_caps.h" #include "esp_log.h" #include "esp_system.h" #include "led.h" #include <string.h> #include "iot_device.h" char *TAG = "IOT_DEVICE"; #define SCHEMA_RGB "{\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"type\":\...
pwiklowski/ng-iot-esp32-rgb-led-driver
main/settings.c
/* * settings.h * * Created on: Jan 5, 2021 * Author: pwiklowski */ char* audience = "https%3A%2F%2Fwiklosoft.eu.auth0.com%2Fapi%2Fv2%2F"; char* scope = "name+email+profile+openid+offline_access"; char* AUTH_TOKEN_URL = "https://wiklosoft.eu.auth0.com/oauth/token"; char* AUTH_CODE_URL = "https://wiklosof...
pwiklowski/ng-iot-esp32-rgb-led-driver
main/main.c
<filename>main/main.c #include "esp_log.h" #include "esp_spi_flash.h" #include "esp_system.h" #include "esp_task.h" #include "nvs_flash.h" #include "wifi.h" #include "iot_device.h" #include "settings.c" static const char *TAG = "main"; void app_main(void) { // Initialize NVS esp_err_t ret = nvs_flash_init(); ...
ULL-ESIT-IB-2020-2021/ib-practica12-oop-gtests-exercism-AdrianoMoreira07
complejos/src/complejo.h
/** * Universidad de La Laguna; Escuela Superior de Ingeniería y Tecnología * Grado en Ingeniería Informática (1º) * Asignatura: Informática Básica * * @author <NAME> <<EMAIL>> * @brief Permite manejar números complejos * Funcionalidades: * - Representar complejos (forma binómica) * e imprimirlos en pantal...
ULL-ESIT-IB-2020-2021/ib-practica12-oop-gtests-exercism-AdrianoMoreira07
fechas/src/fecha.h
/** * Universidad de La Laguna; Escuela Superior de Ingeniería y Tecnología * Grado en Ingeniería Informática (1º) * Asignatura: Informática Básica * * @author <NAME> <<EMAIL>> * @brief Clase Fecha */ #ifndef FECHA_H #define FECHA_H #include <string> #include <iostream> class Fecha { public: Fecha() {} ...
ULL-ESIT-IB-2020-2021/ib-practica12-oop-gtests-exercism-AdrianoMoreira07
fechas/src/inicio.h
/** * Universidad de La Laguna; Escuela Superior de Ingeniería y Tecnología * Grado en Ingeniería Informática (1º) * Asignatura: Informática Básica * * @author <NAME> <<EMAIL>> * @brief Header para inicio.cc */ #ifndef INICIO_H #define INICIO_H /** * Muestra mensajes de ayuda o error * en funcion de los pa...
mephory/vselect
vselect.c
<reponame>mephory/vselect // Usage: vselect [OPTION]... FILENAME - select a rectangular area from an image // // Options: // -f FORMAT specify an output format // -t TITLE change window title // -h print this help // // FORMAT is any string that can contain the following vars: // %l / %...
GiulioPN/bnlm
src/gamma_poisson.h
<reponame>GiulioPN/bnlm<filename>src/gamma_poisson.h #ifndef _CPYP_GAMMA_POISSON_H_ #define _CPYP_GAMMA_POISSON_H_ #include "m.h" namespace cpyp { // http://en.wikipedia.org/wiki/Conjugate_prior template <typename F> struct gamma_poisson { gamma_poisson(F shape, F rate) : a(shape), b(rate), n(), marginal(), ll...
GiulioPN/bnlm
src/uniform_vocab.h
<reponame>GiulioPN/bnlm #ifndef _UNIFORM_VOCAB_H_ #define _UNIFORM_VOCAB_H_ #include <cassert> #include <vector> namespace cpyp { // uniform distribution over a fixed vocabulary struct UniformVocabulary { UniformVocabulary(unsigned vs, double, double, double, double) : p0(1.0 / vs), draws() {} template<typename ...
GiulioPN/bnlm
src/logval.h
#ifndef LOGVAL_H_ #define LOGVAL_H_ #define LOGVAL_CHECK_NEG false #include <iostream> #include <cstdlib> #include <cmath> #include <limits> #include <cassert> //TODO: template for supporting negation or not - most uses are for nonnegative "probs" only; probably some 10-20% speedup available template <class T> class...
GiulioPN/bnlm
src/uvector.h
#ifndef UVECTOR_H_ #define UVECTOR_H_ #include <vector> struct uvector_hash { size_t operator()(const std::vector<unsigned>& v) const { size_t h = v.size(); for (auto e : v) h ^= e + 0x9e3779b9 + (h<<6) + (h>>2); return h; } }; #endif
GiulioPN/bnlm
src/slice_sampler.h
//! slice-sampler.h is an MCMC slice sampler //! //! <NAME>, 1st August 2008 //! A few changes by <NAME>, Aug 13, 2012 #ifndef SLICE_SAMPLER_H #define SLICE_SAMPLER_H #include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <limits> #include <random> namespace cpyp { //! slice_sampler_r...