repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
thomasdenney/microjit
source/Device/OptionalInstructions.h
<reponame>thomasdenney/microjit #pragma once #include "Config.h" #include "Environment/VM.h" namespace Device { #define NEOPIXEL_PIN 2 inline void neoPixelSendOne() { NRF_GPIO->OUTSET = (1UL << NEOPIXEL_PIN); // 9 NOPs asm("nop"); asm("nop"); asm("nop"); asm("nop"); asm("nop"); asm(...
thomasdenney/microjit
source/Tests/JIT/Tests.h
#pragma once #include "Config.h" namespace JIT { bool testCodeExecution(); bool testCompiler(); bool testStaticAnalysis(); }
thomasdenney/microjit
source/Support/Memory.h
<filename>source/Support/Memory.h #pragma once #include "Config.h" #include <memory> namespace Support { /** * C++11 support for make_unique, which wasn't introduced until C++14. * Based on http://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique#Example */ template <typename T, typename... Args> std::uniq...
thomasdenney/microjit
source/ARM/Functor.h
<gh_stars>1-10 #pragma once #include "Config.h" #include "Encoder.h" #include <cstdlib> #include <vector> namespace ARM { typedef void (*f_void)(void); template <typename ReturnType, typename... ArgumentTypes> constexpr inline ReturnType typedCall(f_void fp, ArgumentTypes... args) { typedef ReturnType (*auto_f...
thomasdenney/microjit
source/JIT/RegisterFileStateCOWAllocator.h
<filename>source/JIT/RegisterFileStateCOWAllocator.h #pragma once #include "Config.h" #include "RegisterFileState.h" namespace JIT { // The total number of registers available on the platform #define REGISTER_COUNT 16 /** * Avoids most register move oeprations by maintaining three internal maps to avoid * * a) ...
thomasdenney/microjit
source/Transfer/Deserialiser.h
<gh_stars>1-10 #pragma once #include <cstdint> #include <cstdlib> namespace Transfer { class Deserialiser { public: Deserialiser(const char* filename); ~Deserialiser(); bool exists() const { return m_fileHandle >= 0; } size_t length() const { return m_length; }; void readData(uint8_t* data, siz...
thomasdenney/microjit
source/Code/Instruction.h
#pragma once #include "Config.h" #include "Bit/Bit.h" #include <cstdint> #include <cstdlib> namespace Code { enum class Instruction : uint8_t { Add = 0x00, Sub = 0x01, Mul = 0x02, Div = 0x03, Mod = 0x04, Inc = 0x05, Dec = 0x06, Max = 0x07, Min = 0x08, Lt = 0x09, Le = 0x0a...
thomasdenney/microjit
source/JIT/InstructionMetadata.h
#pragma once #include "Config.h" #include <cstdint> namespace JIT { /** * Illegal => everything else is false * Data => !Code * Code => !Data */ enum class InstructionMetadata : uint8_t { /// Code properties /** * Denotes that we haven't examined this instruction during static analysis */ ...
thomasdenney/microjit
source/JIT/Linker.h
#pragma once #include "Config.h" #include "ARM/Functor.h" #include "Code/Array.h" #include "Code/Region.h" #include "LinkOperation.h" #include "SpecialLinkerLocations.h" #include "StaticAnalysis.h" #include <map> #include <memory> #include <vector> namespace JIT { class Linker { private: std::vector<std::unique...
thomasdenney/microjit
source/JIT/SpecialLinkerOperation.h
#pragma once #include "Config.h" #include "LinkOperation.h" namespace JIT { class SpecialLinkerOperation : public LinkOperation { public: enum class Kind : int { Halt = 0, StackUnderflowError = 1, StackOverflowError = 2 }; private: Kind m_kind; int destinationOffset(const S...
thomasdenney/microjit
source/Code/InstructionStackEffect.h
<filename>source/Code/InstructionStackEffect.h<gh_stars>1-10 #pragma once #include "Config.h" #include "Instruction.h" #include <climits> namespace Code { class InstructionStackEffect { private: int m_popCount, m_pushCount; static const int UnknownEffect = INT_MAX; void resolveFromInstruction(Instructi...
thomasdenney/microjit
source/JIT/LinkOperation.h
<filename>source/JIT/LinkOperation.h #pragma once #include "Config.h" #include "ARM/Functor.h" #include "SpecialLinkerLocations.h" #include "StaticAnalysis.h" #include <cstddef> #include <map> namespace JIT { /** * Subclasses should work based on the offset */ class LinkOperation { private: size_t m_location;...
thomasdenney/microjit
source/Tests/Utilities.h
#pragma once #include "Config.h" #define PRINT_FUNCTION_NAME() printf("%s:%s:%d\n", __FILE__ + strlen("/Users/thomas/Oxford/Year 3/Project/jit/source/"), __FUNCTION__, __LINE__) void printConfiguration(); typedef bool (*TestFunction)(); void printLine(); void printTestHeader(const char* name); void incFailure(); ...
thomasdenney/microjit
source/ARM/Decoder.h
<filename>source/ARM/Decoder.h #pragma once #include "Config.h" #include "Encoder.h" #include <cstdlib> namespace ARM { /** * Dumps the address, hex, binary, and ARM (where possible) for a function */ void printFunction(void (*func)(void), size_t length); /** GENERAL INSTRUCTION DECODING */ /** * |buffer| shou...
thomasdenney/microjit
source/JIT/RegisterFileStateDefaultAllocator.h
<filename>source/JIT/RegisterFileStateDefaultAllocator.h #pragma once #include "Config.h" #include "RegisterFileState.h" namespace JIT { class RegisterFileStateDefaultAllocator : public RegisterFileState { private: /** * If this is true then we fill up the registers like * r2 = stack.peek(0), r4 = sta...
thomasdenney/microjit
source/JIT/Call.h
<reponame>thomasdenney/microjit<gh_stars>1-10 #pragma once #include "Config.h" #include "StackLinkOperation.h" namespace JIT { class Call : public StackLinkOperation { private: public: Call(size_t startOffset, size_t to) : StackLinkOperation(startOffset, to, 0) { } bool isCall() final; ...
thomasdenney/microjit
source/Code/Array.h
<gh_stars>1-10 #pragma once #include "Config.h" #include "Instruction.h" #include "Region.h" #include <cstdlib> namespace Code { /** * This class does not manage the memory associated with it! */ class Array { public: Array(const Instruction* code, size_t length) : m_code((Instruction*)code) ,...
thomasdenney/microjit
source/JIT/Interpreter.h
<reponame>thomasdenney/microjit<filename>source/JIT/Interpreter.h #pragma once #include "Config.h" #include "Code/Instruction.h" #include "Environment/Device.h" #include "Environment/VM.h" namespace JIT { /** * Sets the device that is used by the interpreter only; the compiler is self-contained */ void setGlobalI...
thomasdenney/microjit
source/Transfer/Serialiser.h
#pragma once #include <cstdint> #include <cstdlib> namespace Transfer { class Serialiser { public: Serialiser(const char* filename); ~Serialiser(); void appendData(const uint8_t* data, size_t length); void appendInt(const int i); void appendUnsignedInt(const unsigned int u); private: int m_...
thomasdenney/microjit
source/Tests/TestRunner.h
<filename>source/Tests/TestRunner.h #pragma once #include "Config.h" void unitTests(); void optionalInstructionTests();
thomasdenney/microjit
source/Enums.h
<filename>source/Enums.h #pragma once #define STR_NAME(x) #x
thomasdenney/microjit
source/Bit/Bit.h
#pragma once #include "Config.h" #include <cstdint> namespace Bit { /** * Takes a twos-complemenet integer stored in the lower |bits| bits of |value| * and returns the 32-bit representation */ int unTwosComplement(uint32_t value, uint8_t bits); /** Like itoa, but decodes binary in 16 bits only */ char* itob(int...
thomasdenney/microjit
source/JIT/StaticAnalysis.h
<filename>source/JIT/StaticAnalysis.h #pragma once #include "Config.h" #include "Code/Array.h" #include "Code/BlockStackEffect.h" #include "Code/Region.h" #include "InstructionMetadata.h" #include <cstdint> #include <cstdio> #include <vector> namespace JIT { /** * Performs core static analysis of Stack code to cat...
thomasdenney/microjit
source/Transfer/Flash.h
<gh_stars>1-10 #include "Config.h" #include "Code/Instruction.h" #include "MicroBitFileSystem.h" namespace Transfer { MicroBitFileSystem* microBitFileSystem(); bool writeStackCodeToFlash(Code::Instruction* code, size_t length); /** * The buffer provided *might* be used for the program code --- another buffer * ...
thomasdenney/microjit
source/Transfer/Serial.h
#pragma once #include "Config.h" #include <cstddef> #include <cstdint> namespace Transfer { #define MAX_SERIAL_BUFFER_SIZE 128 class Serial { private: static size_t readProgramLength(); static void readProgramSafe(); /// Returns -1 in case of failure static int readUnsignedNumber(); public: s...
thomasdenney/microjit
source/JIT/UnconditionalBranch.h
#pragma once #include "Config.h" #include "StackLinkOperation.h" namespace JIT { class UnconditionalBranch : public StackLinkOperation { public: UnconditionalBranch(size_t startOffset, size_t destination, int skipCount) : StackLinkOperation(startOffset, destination, skipCount) { } size_t ins...
joltwallet/nano_rest
include/nano_rest.h
<reponame>joltwallet/nano_rest /* nanolws - libwebsocket wrapper Copyright (C) 2018 <NAME>, <NAME>, <NAME> https://www.joltwallet.com/ */ #ifndef __INCLUDE_REST_H__ #define __INCLUDE_REST_H__ #define RX_BUFFER_BYTES (1536) #define RECEIVE_POLLING_PERIOD_MS pdMS_TO_TICKS(10000) int network_get_data(char *post_data, ...
joltwallet/nano_rest
src/nano_rest.c
/* nano_rest - restful wrapper Copyright (C) 2018 <NAME>, <NAME>, <NAME> https://www.joltwallet.com/ */ #include <stdio.h> #include <stdbool.h> #include <string.h> #include "esp_event_loop.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/event_groups.h" #include "esp_log.h" #include...
HelloWorldTestM/Nginx
myModule/ngx_http_hello_world_module.c
// // Created by gaoguili on 2017/10/10. // #include<ngx_config.h> #include<ngx_core.h> #include<ngx_http.h> #include <ngx_http_request.h> #include <ngx_string.h> static ngx_int_t ngx_http_hello_world_init(ngx_conf_t *cf); static ngx_int_t ngx_http_hello_world_handler(ngx_http_request_t *r) { ngx_int_t rx; n...
Fendouzhe/KLine
JHChart-master/JHChartDemo/JHChart/JHPieForeBGView.h
// // JHPieForeBGView.h // JHCALayer // // Created by leilurong on 16/4/28. // Copyright © 2016年 leilurong. All rights reserved. // #import <UIKit/UIKit.h> /** * Each click of the pie chart callback block */ typedef void(^selectBlock)(CGFloat angle,CGPoint p); @interface JHPieForeBGView : UIView /** * Cu...
Fendouzhe/KLine
JHChart-master/JHChartDemo/JHShowController.h
// // JHShowController.h // JHChartDemo // // Created by leilurong on 16/4/12. // Copyright © 2016年 leilurong. All rights reserved. // #import <UIKit/UIKit.h> @interface JHShowController : UIViewController @property (assign , nonatomic) NSInteger index ; @end
Fendouzhe/KLine
JHChart-master/JHChartDemo/JHChart/JHPieChart.h
// // JHPieChart.h // JHCALayer // // Created by leilurong on 16/5/3. // Copyright © 2016年 leilurong. All rights reserved. // #import <UIKit/UIKit.h> #import "JHChart.h" @interface JHPieChart : JHChart /** * Need to draw the specific values。Elements can be either NSString or NSNumber type */ @property (nonatom...
Fendouzhe/KLine
JHChart-master/JHChartDemo/JHChart/JHRadarChart.h
<gh_stars>1-10 // // JHRadarChart.h // JHChartDemo // // Created by leilurong on 16/9/9. // Copyright © 2016年 leilurong. All rights reserved. // #import "JHChart.h" @interface JHRadarChart : JHChart /** * Data Source Arrays */ @property (nonatomic, strong) NSArray<NSArray*> * valueDataArray; /** * Each...
Fendouzhe/KLine
JHChart-master/JHChartDemo/JHChart/JHChartHeader.h
// // JHChartHeader.h // JHChartDemo // // Created by leilurong on 16/4/11. // Copyright © 2016年 leilurong. All rights reserved. // #import "JHChart.h" #import "JHLineChart.h" #import "JHWaveChart.h" #import "JHPieChart.h" #import "JHRingChart.h" #import "JHColumnChart.h" #import "JHTableChart.h" #import "JHRadar...
Fendouzhe/KLine
JHChart-master/JHChartDemo/JHChart/JHWaveChart.h
// // JHWaveChart.h // JHChartDemo // // Created by leilurong on 16/4/13. // Copyright © 2016年 leilurong. All rights reserved. // #import "JHChart.h" typedef NS_ENUM(NSInteger,JHWaveChartType){ JHWaveChartUpType = 0, JHWaveChartUpAndDownType }; @interface JHWaveChart : JHChart /* X轴...
skystar-p/pam_bacchus
src/utils.c
#include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> char *escape_json_string(const char *original) { int current_index; int len = strlen(original); int new_len = len; for (current_index = 0; current_index < len; current_index++) { char c = original[current_index]; ...
skystar-p/pam_bacchus
src/pam_bacchus.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <syslog.h> #define PAM_SM_AUTH #include <security/pam_modules.h> #include <curl/curl.h> #include "tweetnacl.h" #include "utils.h" #define PAM_ITEM_SE...
skystar-p/pam_bacchus
src/randombytes.c
<filename>src/randombytes.c #include <sys/random.h> #include <errno.h> void randombytes(unsigned char *buf, unsigned long long n) { size_t count = 0; while (count < n) { size_t read = getrandom(&buf[count], n - count, 0); if (read == -1) { if (errno == EINTR) continue; b...
skystar-p/pam_bacchus
src/pam_bacchus_genkey.c
<reponame>skystar-p/pam_bacchus<filename>src/pam_bacchus_genkey.c #include <stdio.h> #include <errno.h> #include <sys/random.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include "tweetnacl.h" static ssize_t write_exact(int fd, const void *buf, size_t len) { size_t count = 0; while (count <...
skystar-p/pam_bacchus
test/check_signature.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <unistd.h> #include "../src/utils.h" #include "../src/tweetnacl.h" void randombytes(unsigned char *buf, unsigned long long n) { memset(buf, 0, n); } static ssize_t read_to_end(int fd, void **pbuf) { size_t cap = 64; s...
skystar-p/pam_bacchus
test/id_test.c
<reponame>skystar-p/pam_bacchus #include <security/pam_appl.h> #include <security/pam_misc.h> #include <stdio.h> #include <string.h> static struct pam_conv conv = { misc_conv, NULL }; int main(int argc, char **argv) { pam_handle_t *pamh = NULL; int pam_ret; if (argc != 3) { fprintf(stderr...
skystar-p/pam_bacchus
src/utils.h
#ifndef __UTILS_H #define __UTILS_H #include <sys/types.h> char *escape_json_string(const char *original); ssize_t read_exact(int fd, void *buf, size_t len); int base64_enc(char *out, size_t outsize, const unsigned char *in, const size_t insize); typedef struct { const char *login_endpoint; const char *secre...
PAULINUP/BIT
compat.h
#ifndef __COMPAT_H__ #define __COMPAT_H__ #ifdef WIN32 #include <windows.h> extern int opt_priority; static __inline void sleep(int secs) { Sleep(secs * 1000); } enum { PRIO_PROCESS = 0, }; static __inline int setpriority(int which, int who, int prio) { switch (opt_priority) { case 5: prio = THREAD_PRIORI...
PAULINUP/BIT
stl_heap.h
<filename>stl_heap.h <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" > <meta name="ROBOTS" content="NOARCHIVE"> <link rel="icon" type="image/vnd.microsoft.icon" href="https://ssl.gstatic.com/code...
PAULINUP/BIT
cuda_fugue256.h
#ifndef _CUDA_FUGUE512_H #define _CUDA_FUGUE512_H void fugue256_cpu_hash(int thr_id, uint32_t threads, int startNounce, void *outputHashes, uint32_t *nounce); void fugue256_cpu_setBlock(int thr_id, void *data, void *pTargetIn); void fugue256_cpu_init(int thr_id, uint32_t threads); #endif
tapz/reanimatederror-example
ios/Example-Bridging-Header.h
<reponame>tapz/reanimatederror-example #ifndef Example_Bridging_Header_h #define Example_Bridging_Header_h #import <React/RCTBridgeModule.h> #import <React/RCTEventEmitter.h> #import <React/RCTViewManager.h> #import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> #endif
lamjack/brave-game
Classes/MainScene.h
<gh_stars>1-10 // // MainScene.h // Brave // // Created by jack on 9/11/14. // // #ifndef __Brave__MainScene__ #define __Brave__MainScene__ #include "cocos2d.h" #include "Player.h" #include "VisibleRect.h" USING_NS_CC; class MainScene : public cocos2d::Layer{ public: static cocos2d::Scene* createScene()...
lamjack/brave-game
Classes/FSM.h
<filename>Classes/FSM.h // // FSM.h // Brave // // Created by jack on 9/12/14. // // #ifndef __Brave__FSM__ #define __Brave__FSM__ #include "cocos2d.h" // Finite-state machine 狀態機 class FSM : public cocos2d::Ref{ public: bool init(); static FSM* create(std::string state, std::function<void()> onEnter...
lamjack/brave-game
Classes/Progress.h
<reponame>lamjack/brave-game<gh_stars>1-10 // // Progress.h // Brave // // Created by jack on 9/12/14. // // #ifndef __Brave__Progress__ #define __Brave__Progress__ #include "cocos2d.h" USING_NS_CC; class Progress : public Sprite{ public: bool init(const char* background, const char* fillname); stat...
lamjack/brave-game
Classes/VisibleRect.h
// // VisibleRect.h // Brave // // Created by jack on 9/12/14. // // #ifndef __Brave__VisibleRect__ #define __Brave__VisibleRect__ #include "cocos2d.h" class VisibleRect{ public: static cocos2d::Rect getVisibleRect(); static cocos2d::Vec2 left(); static cocos2d::Vec2 right(); static cocos2d::Vec2 ...
lamjack/brave-game
Classes/CustomTool.h
// // CustomTool.h // Brave // // Created by jack on 9/12/14. // // #ifndef __Brave__CustomTool__ #define __Brave__CustomTool__ #endif /* defined(__Brave__CustomTool__) */
lamjack/brave-game
Classes/Player.h
// // Player.h // Brave // // Created by jack on 9/10/14. // // #ifndef __Brave__Player__ #define __Brave__Player__ #include <cocos2d.h> #include "FSM.h" #include "Progress.h" USING_NS_CC; class Player : public Sprite{ public: enum PlayerType{ PLAYER, ENEMY1, ENEMY2 }; enum ActionTag{ WA...
PokemonWei/Cache-Consistency-Check
id-increment/id.pb.h
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: id.proto #ifndef GOOGLE_PROTOBUF_INCLUDED_id_2eproto #define GOOGLE_PROTOBUF_INCLUDED_id_2eproto #include <limits> #include <string> #include <google/protobuf/port_def.inc> #if PROTOBUF_VERSION < 3012000 #error This file was generated by a newer ...
JackShi1234/SCICPaySDK-master
Example/Pods/Headers/Public/ICPaySDK/ICMessageModel.h
<reponame>JackShi1234/SCICPaySDK-master // // ICMessageModel.h // ICPayPlusDesign // // Created by mac on 2017/12/19. // Copyright © 2017年 iCorki. All rights reserved. // #import <Foundation/Foundation.h> @interface ICMessageModel : NSObject /** @brief success message 支付成功*/ @property (nonatomic, strong, nullabl...
JackShi1234/SCICPaySDK-master
Example/Pods/Headers/Public/ICPaySDK/ICBasePayFactory.h
<reponame>JackShi1234/SCICPaySDK-master // // ICBasePayFactory.h // ICPayPlusDesign // // Created by mac on 2017/12/19. // Copyright © 2017年 iCorki. All rights reserved. // #import <Foundation/Foundation.h> #import "ICIPay.h" NS_ASSUME_NONNULL_BEGIN @class ICMessageModel; @interface ICBasePayFactory : NSObject ...
JackShi1234/SCICPaySDK-master
Example/Pods/Headers/Public/ICPaySDK/ICDebugLog.h
<filename>Example/Pods/Headers/Public/ICPaySDK/ICDebugLog.h // // ICDebugLog.h // Pods // // Created by iCorki on 2017/12/28. // #ifndef ICDebugLog_h #define ICDebugLog_h #ifdef DEBUG #define ICLog(...) NSLog(__VA_ARGS__) #else #define ICLog(...) #endif #endif /* ICDebugLog_h */
JackShi1234/SCICPaySDK-master
Example/Pods/Headers/Public/ICPaySDK/ICWxPayModel.h
<reponame>JackShi1234/SCICPaySDK-master // // ICWxPayModel.h // AFNetworking // // Created by iCorki. on 2018/1/20. // #import <Foundation/Foundation.h> #import "ICIWxModel.h" @interface ICWxPayModel : NSObject<ICIWxModel> @property (nonatomic) NSString *partnerId; @property (nonatomic) NSString *prepayId; @prope...
JackShi1234/SCICPaySDK-master
ICPaySDK/ICUnionpay/ICUnionpayModel.h
<reponame>JackShi1234/SCICPaySDK-master // // ICUnionpayModel.h // AFNetworking // // Created by iCorki. on 2018/1/20. // #import <Foundation/Foundation.h> #import "ICIUnionpayModel.h" @interface ICUnionpayModel : NSObject<ICIUnionpayModel> @property (nonatomic, strong) NSString *scheme; @property (nonatomic, st...
JackShi1234/SCICPaySDK-master
Example/Pods/Headers/Public/ICPaySDK/ICAliPayModel.h
<reponame>JackShi1234/SCICPaySDK-master // // ICAliPayModel.h // AFNetworking // // Created by iCorki. on 2018/1/20. // #import <Foundation/Foundation.h> #import "ICIAliModel.h" NS_ASSUME_NONNULL_BEGIN @interface ICAliPayModel : NSObject<ICIAliModel> @property (nonatomic, strong) NSString *scheme; @property (non...
Algomorph/mLib
include/core-math/mathVector.h
#ifndef CORE_MATH_MATHVECTOR_H_ #define CORE_MATH_MATHVECTOR_H_ #include <type_traits> namespace ml { /************************************************************************/ /* math vector class (used for instance with sparse matrices) */ /*****************************************************...
Algomorph/mLib
include/core-math/blockedPCA.h
<reponame>Algomorph/mLib<gh_stars>1-10 #include <string> #include <vector> #include <core-math/PCA.h> namespace ml { template <class T> class BlockedPCA { public: struct Subset { Subset() { startDim = std::numeric_limits<int>::min(); dimCount = 0; } PCA<T> pca; int startDim; int dimCount; }; Bloc...
Algomorph/mLib
include/application-d3d11/D3D11Buffer.h
#ifndef APPLICATION_D3D11_D3D11BUFFER_H_ #define APPLICATION_D3D11_D3D11BUFFER_H_ #include <vector> #include <application-base/graphicsDevice.h> #include <d3d11.h> namespace ml { template<class T> class D3D11Buffer : public GraphicsAsset { public: D3D11Buffer(bool _withSRV = true, bool _withUAV = false) { ...
Algomorph/mLib
include/application-d3d11/D3D11Texture2D.h
#ifndef APPLICATION_D3D11_D3D11TEXTURE2D_H_ #define APPLICATION_D3D11_D3D11TEXTURE2D_H_ #include <d3d11.h> #include <application-base/graphicsDevice.h> #include <core-base/baseImage.h> namespace ml { template<class T> class D3D11Texture2D : public GraphicsAsset { public: D3D11Texture2D() { ...
Algomorph/mLib
include/application-base/graphicsDevice.h
#ifndef APPLICATION_BASE_GRAPHICSDEVICE_H_ #define APPLICATION_BASE_GRAPHICSDEVICE_H_ #include <application-base/windowWin32.h> #include <core-base/baseImage.h> namespace ml { enum GraphicsDeviceType { GraphicsDeviceTypeD3D11, }; class D3D11GraphicsDevice; class GraphicsDevice { public: virtual...
Algomorph/mLib
include/application-d3d11/D3D11Utility.h
<reponame>Algomorph/mLib #ifndef APPLICATION_D3D11_D3D11UTILITY_H_ #define APPLICATION_D3D11_D3D11UTILITY_H_ #include <string> #include <vector> #include <utility> #include <d3d11.h> namespace ml { class D3D11Utility { public: static ID3DBlob* CompileShader( const std::string &filename, ...
Algomorph/mLib
include/application-d3d11/D3D11GraphicsDevice.h
#ifndef APPLICATION_D3D11_D3D11GRAPHICSDEVICE_H_ #define APPLICATION_D3D11_D3D11GRAPHICSDEVICE_H_ #include <d3d11.h> #include <application-base/graphicsDevice.h> #include <application-base/graphicsAsset.h> #include <application-d3d11/D3D11ShaderManager.h> namespace ml { class D3D11GraphicsDevice : public...
Algomorph/mLib
include/core-base/common.h
#ifndef CORE_BASE_COMMON_H_ #define CORE_BASE_COMMON_H_ #ifdef _WIN32 #ifndef NOMINMAX #define NOMINMAX #endif #ifndef _SCL_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS #endif #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #define MLIB_OPENMP #define DEBUG_BREAK ...
Algomorph/mLib
include/core-graphics/boundingBox2.h
#ifndef CORE_GRAPHICS_BOUNDINGBOX2_H_ #define CORE_GRAPHICS_BOUNDINGBOX2_H_ #include <cfloat> #include <vector> #include <cmath> #include <iostream> #include <core-math/vec2.h> #include <core-math/matrix2x2.h> #include "lineSegment2.h" #include "lineSegment3.h" #include "ray.h" #include "intersection.h" ...
Algomorph/mLib
include/core-math/PCA.h
#include <functional> #include <core-math/denseMatrix.h> #include <core-math/eigenSolver.h> namespace ml { template <class T> class PCA { public: //auto eigenSolver = [](const DenseMatrixf &m) { return m.eigenSystem(); }; typedef std::function<EigenSystem<T>(const DenseMatrix<T> &m)> EigenSolverFunc; P...
Algomorph/mLib
include/core-base/baseImageHelper.h
#ifndef _BASEIMAGE_HELPER_H_ #define _BASEIMAGE_HELPER_H_ #include <core-math/vec3.h> #include <core-math/vec4.h> namespace ml { namespace BaseImageHelper { inline vec3f convertHSVtoRGB(const vec3f& hsv) { float H = hsv[0]; float S = hsv[1]; float V = hsv[2]; floa...
Algomorph/mLib
include/core-graphics/RGBColor.h
<filename>include/core-graphics/RGBColor.h<gh_stars>1-10 #ifndef CORE_GRAPHICS_RGBCOLOR_H_ #define CORE_GRAPHICS_RGBCOLOR_H_ #include <core-base/common.h> #include <core-math/vec4.h> namespace ml { struct RGBColor : public vec4uc { RGBColor() {} RGBColor(BYTE _r, BYTE _g, BYTE _b) { r = _r; ...
Algomorph/mLib
include/core-base/grid3.h
<reponame>Algomorph/mLib #ifndef CORE_BASE_GRID3D_H_ #define CORE_BASE_GRID3D_H_ #include <core-math/vec3.h> namespace ml { template <class T> class Grid3 { public: Grid3(); Grid3(size_t dimX, size_t dimY, size_t dimZ); Grid3(size_t dimX, size_t dimY, size_t dimZ, const T &value); Grid3(co...
Algomorph/mLib
include/mLibD3D11.h
#pragma once // // application-base headers // #include "application-base/windowWin32.h" #include "application-base/graphicsAsset.h" #include "application-base/graphicsDevice.h" #include "application-base/applicationWin32.h" // // D3D11 headers // #pragma warning ( disable : 4005) #include <d3d11.h> ...
Algomorph/mLib
include/core-util/binaryDataCompressor.h
#ifndef CORE_UTIL_BINARYDATACOMPRESSOR_H_ #define CORE_UTIL_BINARYDATACOMPRESSOR_H_ #include <core-base/common.h> namespace ml { //! interface to compress data class BinaryDataCompressorInterface { public: virtual void compressStreamToMemory(const BYTE *decompressedStream, UINT64 decompressedStreamLe...
Algomorph/mLib
include/application-base/windowWin32.h
<filename>include/application-base/windowWin32.h #ifndef APPLICATION_BASE_WINDOWWIN32_H_ #define APPLICATION_BASE_WINDOWWIN32_H_ #include <windows.h> #include <string> namespace ml { class ApplicationWin32; class WindowWin32 { public: WindowWin32(ApplicationWin32 &parent) : m_parent(parent) { ...
Algomorph/mLib
include/core-graphics/ray.h
<gh_stars>1-10 #ifndef CORE_GRAPHICS_RAY_H_ #define CORE_GRAPHICS_RAY_H_ #include <core-math/matrix4x4.h> #include <core-math/matrix3x3.h> namespace ml { template<class FloatType> class Ray { public: Ray() { } inline Ray(const vec3<FloatType> &o, const vec3<FloatType> &d) { m...
Algomorph/mLib
include/core-graphics/camera.h
<gh_stars>1-10 #ifndef CORE_GRAPHICS_CAMERA_H_ #define CORE_GRAPHICS_CAMERA_H_ #include <core-util/binaryDataSerialize.h> #include <core-math/vec3.h> #include <core-math/matrix4x4.h> #include <core-graphics/ray.h> namespace ml { template <class FloatType> class Camera : public BinaryDataSerialize < Ca...
Algomorph/mLib
include/core-math/matrix3x3.h
<filename>include/core-math/matrix3x3.h #ifndef CORE_MATH_MATRIX3X3_H_ #define CORE_MATH_MATRIX3X3_H_ #include <core-util/binaryDataSerialize.h> #include <core-math/vec3.h> #include "eigenSolver.h" namespace ml { template <class FloatType> class DenseMatrix; template <class FloatType> struct EigenSyste...
Algomorph/mLib
include/core-math/matrix4x4.h
#ifndef CORE_MATH_MATRIX4X4_H_ #define CORE_MATH_MATRIX4X4_H_ #include "matrix3x3.h" #include "vec6.h" #include "eigenSolver.h" namespace ml { template <class FloatType> class DenseMatrix; template <class FloatType> struct EigenSystem; //! This class provides functions to handle 4-dimensional matric...
Algomorph/mLib
include/core-graphics/line2.h
<reponame>Algomorph/mLib<filename>include/core-graphics/line2.h<gh_stars>1-10 #ifndef CORE_GRAPHICS_LINE2D_H_ #define CORE_GRAPHICS_LINE2D_H_ #include "lineSegment2.h" namespace ml { template<class T> class Line2 { public: Line2(const LineSegment2<T> &segment) { m_p0 = segment.p0(); ...
Algomorph/mLib
include/application-d3d11/D3D11GeometryShader.h
<filename>include/application-d3d11/D3D11GeometryShader.h #ifndef APPLICATION_D3D11_D3D11GEOMETRYSHADER_H_ #define APPLICATION_D3D11_D3D11GEOMETRYSHADER_H_ #include <string> #include <vector> #include <utility> #include <d3d11.h> #include <application-base/graphicsAsset.h> #include <application-base/graphicsDevice.h>...
Algomorph/mLib
include/core-util/stringUtil.h
<filename>include/core-util/stringUtil.h #ifndef CORE_UTIL_STRINGUTIL_H_ #define CORE_UTIL_STRINGUTIL_H_ #include <string> #include <vector> #include <core-base/common.h> namespace ml { namespace util { //TODO TEST inline bool startsWith(const std::string& str, const std::string& startCandidate) { ...
Algomorph/mLib
include/core-util/eventMap.h
#ifndef _EVENT_MAP_H_ #define _EVENT_MAP_H_ #include <map> #include <core-util/UIConnection.h> namespace ml { class EventMap { public: void registerEvent(const std::string &event, const std::function<void(std::vector<std::string> &params)> &handler); void dispatchEvents(const std::vector<std::string> &messag...
picardb/QtGameOfLife
ControlWindow.h
<reponame>picardb/QtGameOfLife #ifndef _CONTROLWINDOW_H #define _CONTROLWINDOW_H #include <QWidget> #include <QVBoxLayout> #include <QLabel> #include <QLineEdit> #include <QPushButton> #include <QTimer> #include "GameMap.h" #include "DisplayCfgBox.h" #include "DisplayWindow.h" class DisplayCfgBox; class ControlWind...
picardb/QtGameOfLife
DisplayCfgBox.h
#ifndef _DISPLAYCFGBOX_H #define _DISPLAYCFGBOX_H #include <QGroupBox> #include <QGridLayout> #include <QCheckBox> #include <QLineEdit> #include <QPushButton> #include "ControlWindow.h" class ControlWindow; class DisplayCfgBox : public QGroupBox { private: QWidget *m_parent; QGridLayout *m_layout; QCheckBox *m_...
picardb/QtGameOfLife
DisplayWindow.h
<reponame>picardb/QtGameOfLife #ifndef _DISPLAYWINDOW_H #define _DISPLAYWINDOW_H #include <QWidget> #include <QCloseEvent> #include "GameMap.h" class DisplayWindow : public QWidget { private: static const int c_beginXPos = 320; static const int c_beginYPos = 200; GameMap *m_map; unsigned int m_squareSize; v...
picardb/QtGameOfLife
GameMap.h
<filename>GameMap.h #ifndef _GAMEMAP_H #define _GAMEMAP_H class GameMap { private: unsigned int m_rowsNb; unsigned int m_colsNb; bool m_connectedBorder; bool *m_mapArray; void AdjustCoord(int& x, int& y); int GetAliveNeighbours(int x, int y); public: GameMap(const unsigned int& rowsNb, const unsigned int...
shawntoffel/atto
atto.h
<reponame>shawntoffel/atto #ifndef _ATTO_H_ #define _ATTO_H_ typedef struct atto_server { const char *port; const int file_descriptor; } atto_server_t; atto_server_t atto_init_server(char *port); int atto_handle_next_connection(atto_server_t *server, char *response); int atto_close_server(atto_server_t *serve...
shawntoffel/atto
env.c
<gh_stars>0 #include <stdlib.h> void atto_set_from_env(char *env_var_name, char **dest) { char *value = getenv(env_var_name); if (value != NULL) { *dest = value; } }
shawntoffel/atto
response.h
<reponame>shawntoffel/atto #ifndef _RESPONSE_H_ #define _RESPONSE_H_ typedef struct atto_response { char *status_code; char *content_type; char *body; } atto_response_t; atto_response_t atto_default_response(); char* atto_build_response(atto_response_t resp); #endif
shawntoffel/atto
atto.c
#include <stdio.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/socket.h> #include <netdb.h> #include "atto.h" #define LISTEN_QUEUE_SIZE 10 static struct addrinfo* find_available_addresses(char *port) { struct addrinfo hints, *result; memset(&hints, 0, sizeof(hints)); hints.ai...
shawntoffel/atto
response.c
#include <stdio.h> #include <stdlib.h> #include "response.h" #define SERVER_NAME "atto" static const char * response_template = "HTTP/1.1 %s\r\nServer: %s\r\nContent-type: %s\r\n\r\n%s"; atto_response_t atto_default_response() { atto_response_t response; response.status_code = "200 OK"; response.content_...
shawntoffel/atto
env.h
#ifndef _ENV_H_ #define _ENV_H_ void atto_set_from_env(char *env_var_name, char **dest); #endif
shawntoffel/atto
main.c
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include "response.h" #include "atto.h" #include "env.h" static const char *default_port = "8080"; static int running = 1; static void interupt_handler(int signum) { printf("Stopping server\n"); running = 0; } int main(int argc, char** argv) { s...
joeleee/ZLMappingStorageKit
ZLMappingStorageKitTests/ZLTextMapping/RHCTestObjectMappingRule.h
// // RHCTestMapping.h // ZLMappingStorageKit // // Created by Lee on 13-11-25. // Copyright (c) 2013年 ZhuochengLee. All rights reserved. // #import <Foundation/Foundation.h> #import "ZLMappingProtocol.h" @interface RHCTestObjectMappingRule : NSObject <ZLMappingRuleProtocol> @property (nonatomic, assign) ZLMapp...
joeleee/ZLMappingStorageKit
ZLMappingStorageKit/ZLStorages/ZLStoragesManager.h
<gh_stars>1-10 // // ZLStoragesManager.h // // Created by Lee on 13-11-15. // Copyright (c) 2013年 Lee. All rights reserved. // #import <Foundation/Foundation.h> @interface ZLStoragesManager : NSObject + (ZLStoragesManager *)sharedManager; - (NSManagedObjectContext *)managedObjectContextForFullPath:(NSString *)pa...
joeleee/ZLMappingStorageKit
ZLMappingStorageKit/ZLMappings/ZLMappingProtocol.h
<reponame>joeleee/ZLMappingStorageKit // // ZLMappingProtocol.h // ZLMappingStorageKit // // Created by Lee on 13-11-21. // Copyright (c) 2013年 ZhuochengLee. All rights reserved. // #import <Foundation/Foundation.h> @protocol ZLMappingRuleProtocol; typedef enum { ZLMappingTypeEnumObject = 1, ZLMappingTyp...
joeleee/ZLMappingStorageKit
ZLMappingStorageKit/ZLMappings/ZLMappingOperations/ZLEntityMappingOperation.h
<gh_stars>1-10 // // ZLEntityMappingOperation.h // ZLMappingStorageKit // // Created by Lee on 13-11-21. // Copyright (c) 2013年 ZhuochengLee. All rights reserved. // #import "ZLMappingProtocol.h" @interface ZLEntityMappingOperation : NSObject <ZLMappingOperationProtocol> @property (readonly, nonatomic, strong) i...
joeleee/ZLMappingStorageKit
ZLMappingStorageKit/ZLUtilities/ZLRunTimeUtility.h
// // ZLRunTimeUtility.h // ZLMappingStorageKit // // Created by Lee on 13-12-13. // Copyright (c) 2013年 ZhuochengLee. All rights reserved. // #import <Foundation/Foundation.h> @interface ZLRunTimeUtility : NSObject + (id)defaultValueForObject:(id)object withPropertyName:(NSString *)propertyName; @end
joeleee/ZLMappingStorageKit
ZLMappingStorageKitTests/ZLTextMapping/RHCTestMapping.h
// // RHCTestMapping.h // ZLMappingStorageKit // // Created by Lee on 13-11-25. // Copyright (c) 2013年 ZhuochengLee. All rights reserved. // #import <Foundation/Foundation.h> @interface RHCTestMapping : NSObject + (void)testObjectMapping; + (void)testEntityMapping; @end