repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
seanc316/ofxNDI
example-videocaster/src/ofApp.cpp
<filename>example-videocaster/src/ofApp.cpp<gh_stars>10-100 #include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ grabber_.setup(640,480); caster_.setup("ofxNDIVideoCaster Test"); caster_.setSource(grabber_.getGrabber()); } //--------------------------------------...
seanc316/ofxNDI
src/ofxNDISendStream.cpp
<filename>src/ofxNDISendStream.cpp #include "ofxNDISendStream.h" #pragma mark video void ofxNDISendVideo::sendFrame(const ofxNDI::VideoFrame &frame) const { if(is_async_) { NDIlib_send_send_video_async_v2(instance_, &frame); } else { NDIlib_send_send_video_v2(instance_, &frame); } } template<> void ofxNDISen...
seanc316/ofxNDI
src/ofxNDIFrame.cpp
#include "ofxNDIFrame.h" #include "ofImage.h" #include "Processing.NDI.utilities.h" using namespace ofxNDI; #pragma mark video uint64_t VideoFrame::allocate(int width, int height, NDIlib_FourCC_video_type_e type) { uint64_t needed_data_size = getDataSizeInBytes(width, height, type); if(needed_data_size != getDataS...
pumpkin-code/dsba-ads-lect12
src/ex4_stlalgo/main.cpp
/*! \file main.cpp * \author <NAME> * \version 0.2 * \date 25.02.2020 * * STL ALGORITHMS, FUNCTORS, LAMBDAS. */ #include <iostream> #include <string> #include <vector> #include <deque> #include <set> #include <cassert> #include <algorithm> //using namespace std; // WARN: don't use i...
pumpkin-code/dsba-ads-lect12
src/ex3_auto/main.cpp
<gh_stars>0 /*! \file main.cpp * \author <NAME> * \version 0.2 * \date 25.02.2020 * * Automatic Type Deduction with auto. */ #include <iostream> #include <string> #include <vector> #include <cassert> #include <memory> // make_shared #include <type_traits> // is_same //usin...
pumpkin-code/dsba-ads-lect12
src/ex1_smartptrs/main.cpp
<filename>src/ex1_smartptrs/main.cpp<gh_stars>0 /*! \file main.cpp * \author <NAME> * \version 0.2 * \date 25.02.2020 * * Smart pointers. */ #include <iostream> #include <string> #include <memory> #include <cassert> using namespace std; // bad example void demo1_1() { string* p = n...
pumpkin-code/dsba-ads-lect12
src/ex2_typeinfo/main.cpp
/*! \file main.cpp * \author <NAME> * \version 0.2 * \date 25.02.2020 * * Type Identification. */ #include <iostream> #include <string> #include <cassert> #include <cmath> #include <functional> //using namespace std; // WARN: don't use it, otherwise multiple cos's! using std::cout; ...
Singcaster/WCL
include/Console.hpp
#pragma once #include <string> #include <iostream> #include <Windows.h> using namespace std; class Console { private: static bool handling; static CONSOLE_CURSOR_INFO cursorInformations; static HANDLE standardInputHandle, standardOutputHandle; static CONSOLE_SCREEN_BUFFER_INFO consoleScreenBufferInformations; p...
ashanaakh/multisolver
src/solver.cpp
<reponame>ashanaakh/multisolver<filename>src/solver.cpp<gh_stars>0 #include "solver.hpp" const char* Solver::Exception::what() const throw() { return msg.c_str(); } Solver::Exception::Exception(const char* msg) : msg(msg) {} Solver::Solver() : fRes(true), gRes(true), stopped(false), notified(false), showPrompt(tr...
ashanaakh/multisolver
include/solver.hpp
<reponame>ashanaakh/multisolver #ifndef solver_h #define solver_h #include <string> #include <mutex> #include <condition_variable> #include <thread> #include <chrono> #include <iostream> using namespace std; class Solver { bool fRes, gRes; bool stopped; bool notified; bool showPrompt; thread* checker; ...
ashanaakh/multisolver
tests/test2.cpp
<filename>tests/test2.cpp #include <chrono> #include <cassert> #include <iostream> #include "solver.hpp" using namespace std::chrono; using std::cout; void test1() { try { time_point<system_clock> start, end; Solver solver; start = system_clock::now(); bool result = solver.manager(2); end = sy...
ashanaakh/multisolver
src/main.cpp
<filename>src/main.cpp<gh_stars>0 #include <cstdlib> #include <utility> #include <string> #include <exception> #include "solver.hpp" int main() { try { Solver solver; solver.manager(10); } catch(exception &e) { cout << e.what() << endl; } return 0; }
pidapica/conceal-desktop
src/gui/Notification.cpp
#include <QFontDatabase> #include <QGraphicsOpacityEffect> #include <QPropertyAnimation> #include "Notification.h" #include "Settings.h" #include "ui_notification.h" namespace WalletGui { Notification::Notification(QWidget* parent) : QDialog(parent), m_ui(new Ui::Notification) { this->parent = parent; m_ui-...
Uniqu3Ch1/hvpp
src/hvpp/hvpp/vcpu.inl
<reponame>Uniqu3Ch1/hvpp<filename>src/hvpp/hvpp/vcpu.inl // #define HVPP_ENABLE_INTERRUPT_TRACE #if defined(HVPP_ENABLE_INTERRUPT_TRACE) # define __trace_interrupt_inject_vectoring() \ hvpp_trace("interrupt_inject (vectoring) - vector: %s, type: %s, nmi_unblocking: %u, valid: %u",\ ...
Sandokaaan/Earthcoin2
src/earthcoin.cpp
// Copyright (c) 2015 The Earthcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/random/uniform_int.hpp> #include <boost/random/mersenne_twister.hpp> #include "policy/policy.h" #include "arith...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/11.cpp
<reponame>TommyGong08/Leetcode class Solution { public: void rotate(vector<vector<int>>& matrix) { //先求转置,再求行翻转 int temp; int len = matrix[0].size(); //先求转置 for(int i=0;i<len;i++){ for(int j=i;j<len;j++){ temp = matrix[i][j]; matrix...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/5.cpp
<filename>Algorithm/algorithm-easy/String/5.cpp class Solution { public: //验证回文串 bool isPalindrome(string s) { string str; for(char i:s){ if(isalnum(i))//是数字 { str += tolower(i); } } string str_rev(str.rbegin(),str.rend()); ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/List/3.cpp
<filename>Algorithm/algorithm-easy/List/3.cpp<gh_stars>0 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* reverseList(ListNode* head) { if(head == NULL) return hea...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/4.cpp
class Solution { public: //有效的字母异位词 bool isAnagram(string s, string t) { int apl[26]={0}; int flag=0; int len1 = s.length(),len2 = t.length(); if(len1!= len2) return false; for(char i:s){ apl[i-'a']++; } for(char i:t){ apl[i-'a']--; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/List/5.cpp
<reponame>TommyGong08/Leetcode /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool isPalindrome(ListNode* head) { //将每个值压入堆栈 vector<int> v; ListNode* p = h...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/4.cpp
class Solution { public: bool containsDuplicate(vector<int>& nums) { sort(nums.begin(),nums.end()); int i=0; int flag = 0; for(int j=1;j<nums.size();j++){ if(nums[i]!=nums[j] && i!=j){ i=j; } else if(nums[i]==nums[j] && i!=j){ ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/3.cpp
<gh_stars>0 class Solution { public: //字符串中的第一个唯一字符 int firstUniqChar(string s) { int apl[26]={0}; int len = s.length(); if(len ==0 ) return -1; for(int i=0;i<len;i++){ apl[s[i]-'a']++; } int i,flag=0; for(i=0;i<len;i++){ if(apl[s[i]-'a...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/2.cpp
class Solution { public: int maxProfit(vector<int>& prices) { int maxprofit=0; int valley=prices[0]; int peak=prices[0]; int len = prices.size(); int i=0; while(i<len-1){ while(i<len-1 && prices[i]>=prices[i+1]) i++; valley = prices[i]; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/2.cpp
<reponame>TommyGong08/Leetcode<gh_stars>0 class Solution { //整数反转 public: int reverse(int x) { int ans=0; while(x != 0){ if( ans > INT_MAX/10 ) return 0; if( ans < INT_MIN/10 ) return 0; ans = ans*10 + x%10 ; x /= 10; } return ans;...
TommyGong08/Leetcode
Algorithm/algorithm-easy/DP/2.cpp
//rob class Solution { public: int rob(vector<int>& nums) { if(!nums.size()) return 0; if(nums.size()==1) return nums[0]; if(nums.size()==2) return max(nums[0],nums[1]); int ans=0; int f[101]; f[0]=nums[0]; f[1]=nums[1]; f[2] = nums[0]+nums[2]; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/7.cpp
class Solution { public: vector<int> plusOne(vector<int>& digits) { int len = digits.size(); int flag=0; //对最后一位数 if(len>2){ if(digits[len-1]+1==10) { digits[len-1]=0; flag=1; }else{ digits[len-1]++; flag=0; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/8.cpp
class Solution { public: void moveZeroes(vector<int>& nums) { vector<int>::iterator Iter; int count=0; for(Iter = nums.begin();Iter != nums.end(); Iter++){ if(*Iter == 0){ count++;//指向下一元素的迭代器 Iter = nums.erase(Iter); Iter--; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/List/2.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { //采用距离n的双指针 ListNode* dummy = new ListNode(0);//哑节点 if(h...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/7.cpp
class Solution { public: //实现strStr() int strStr(string haystack, string needle) { if(needle.empty()) return 0; int pos=haystack.find(needle); return pos; } };
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/6.cpp
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { if(nums2.size() < nums1.size()){ return intersect(nums2,nums1); } unordered_map<int,int> hash_map; for(int num:nums1){ hash_map[num]++; } vector<int> ans; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Math/3.cpp
<reponame>TommyGong08/Leetcode class Solution { public: bool isPowerOfThree(int n) { bool ans = false; if(n<1) return ans; while(n%3==0){ n /= 3; } return n==1; } };
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/5.cpp
class Solution { public: int singleNumber(vector<int>& nums) { int ans=0; int flag=0; sort(nums.begin(),nums.end()); int i=0; for(int j=1;j<nums.size();j++){ if(nums[i]==nums[j]){ //出现两次 i=j+1; j++; } ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/10.cpp
<reponame>TommyGong08/Leetcode<filename>Algorithm/algorithm-easy/Array/10.cpp<gh_stars>0 class Solution { public: bool isValidSudoku(vector<vector<char>>& board) { int row[9][9]={0}; int col[9][9]={0}; int box[9][9]={0}; int num; //遍历board每一个元素 for(int i=0;i<9;i++){ ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/8.cpp
class Solution { public: //外观数列 string countAndSay(int n) { //外观数列,递归法 if(n == 1) return "1"; string pre = countAndSay(n-1), result = ""; int count = 1; for(int i=0;i<pre.length();i++){ if(pre[i] == pre[i+1]){ count ++; } el...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Tree/3.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: void LDR(TreeNode* root,vector<int>& v){ if(root == NULL ) { v.push_back(-1...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Math/4.cpp
<reponame>TommyGong08/Leetcode class Solution { public: int change(char a) { switch(a) { case 'I':return 1;break; case 'V':return 5;break; case 'X':return 10;break; case 'L':return 50;break; case 'C':return 100;break; case '...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Tree/2.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int BSTUtil(TreeNode* root,long long min,long long max){ if(root == nullptr) return 1; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/9.cpp
<reponame>TommyGong08/Leetcode<gh_stars>0 class Solution { public: //最长公共前缀 string longestCommonPrefix(vector<string>& strs) { string ans; if (strs.size() ==0) return ans; char s ; int len = strs.size(); int min_string_len = strs[0].length(); for(int i=0; i<len ;i++){...
TommyGong08/Leetcode
Algorithm/algorithm-easy/String/1.cpp
class Solution { public: //反转字符串 void reverseString(vector<char>& s) { int len = s.size(); char temp; if( len == 1) return ; for(int i=0;i < len/2 ; i++){ temp = s[i]; s[i] = s[len-1-i]; s[len-1-i] = temp; } return ; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/3.cpp
<gh_stars>0 class Solution { public: void rotate(vector<int>& nums, int k) { //反转法 k %=nums.size(); reverse(nums,0,nums.size()-1); reverse(nums,0,k-1); reverse(nums,k,nums.size()-1); } void reverse(vector<int>& nums,int start,int end){ while(start<end){ ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/9.cpp
<reponame>TommyGong08/Leetcode<gh_stars>0 class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map <int,int> hash_map; vector<int> ans; int len = nums.size(); int left =0; for(int i=0;i<len;i++){ left = target - nums[i]; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/DP/1.cpp
//max sub array class Solution { public: int maxSubArray(vector<int>& nums) { int ans=nums[0]; int pre=0; for(int i=0;i<nums.size();i++) { pre = max(pre+nums[i],nums[i]); ans = max(pre,ans); } return ans; } };
TommyGong08/Leetcode
Algorithm/algorithm-easy/Array/1.cpp
<reponame>TommyGong08/Leetcode class Solution { public: int removeDuplicates(vector<int>& nums) { if(nums.size()==0) return 0; int i=0; int len=nums.size(); for(int j=1;j<len;j++){ if(nums[i]!=nums[j]){ i++; nums[i]=nums[j]; } ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Math/2.cpp
//countPrimes class Solution { public: int countPrimes(int n) { int ans = 0 ; vector<bool> sign(n,true); for(int i=2;i<n;i++){ if(sign[i])ans++; for(int j=2*i;j<n;j+=i){ sign[j] = false; } } return ans; } };
TommyGong08/Leetcode
Algorithm/algorithm-easy/Sort&Search/2.cpp
// The API isBadVersion is defined for you. // bool isBadVersion(int version); class Solution { public: int firstBadVersion(int n) { int first =1;int last = n; while(first < last){ int mid = first + (last-first)/2; if(isBadVersion(mid)){ //中间是错的 last = mid; ...
TommyGong08/Leetcode
Algorithm/algorithm-easy/Tree/5.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* BSTbuild(vector<int>& nums,int left,int right){ if(left > right) return nullp...
TakeScoop/cpp-eventemitter
eventemitter.hpp
/* * Copyright 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, modify, merge, publish, distribute...
TakeScoop/cpp-eventemitter
shared_lock.hpp
<reponame>TakeScoop/cpp-eventemitter /* * Copyright 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, cop...
TakeScoop/cpp-eventemitter
uv_rwlock_adaptor.hpp
/* * Copyright 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, modify, merge, publish, distribute...
TakeScoop/cpp-eventemitter
shared_ringbuffer.hpp
/* * Copyright 2017 Scoop Technologies * * 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, modify, merge, publish...
TakeScoop/cpp-eventemitter
async_event_emitting_reentrant_c_worker.hpp
<reponame>TakeScoop/cpp-eventemitter /* * Copyright 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, cop...
TakeScoop/cpp-eventemitter
eventemitter_impl.hpp
<reponame>TakeScoop/cpp-eventemitter<filename>eventemitter_impl.hpp /* * Copyright 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 limit...
TakeScoop/cpp-eventemitter
test/cpp/eventemitter.cpp
<gh_stars>1-10 #include <node.h> #include <iostream> #include <sstream> #include <thread> #include "../../eventemitter.hpp" using namespace std; using namespace NodeEvent; using namespace Nan; using namespace v8; class TestWorker : public AsyncEventEmittingCWorker<16> { public: TestWorker(Nan::Callback* callbac...
TakeScoop/cpp-eventemitter
test/test_ringbuffer.cpp
#include <atomic> #include <chrono> #include <mutex> #include <string> #include <thread> #define CATCH_CONFIG_MAIN #include <catch.hpp> #include "../shared_ringbuffer.hpp" using namespace std; // std::atomic<bool> write_done; // std::atomic<bool> read_done; TEST_CASE("Verify enqueue and dequeue non-blocking") { ...
TakeScoop/cpp-eventemitter
async_event_emitting_c_worker.hpp
<reponame>TakeScoop/cpp-eventemitter /* * Copyright 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, cop...
TakeScoop/cpp-eventemitter
async_queued_progress_worker.hpp
<reponame>TakeScoop/cpp-eventemitter /* * Copyright 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, cop...
xieguotian/fb-caffe-exts
layer/batch_norm_torch_layer.cpp
<reponame>xieguotian/fb-caffe-exts<gh_stars>0 #include <algorithm> #include <vector> #include "caffe/filler.hpp" #include "caffe/layers/batch_norm_torch_layer.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { template <typename Dtype> void BatchNormTorchLayer<Dtype>::LayerSetUp(const vector<B...
keikei14/MLAC
DivaHook/src/FileSystem/TextFile.cpp
#include "TextFile.h" #include <filesystem> namespace fs = std::filesystem; namespace DivaHook::FileSystem { TextFile::TextFile(const std::string &path) { FileName = path; } TextFile::TextFile(const std::string &directory, const std::string &file) { auto fullPath = directory + "/" + file; F...
keikei14/MLAC
DivaHook/src/Input/DirectInput/Controller.cpp
#include "Controller.h" namespace DivaHook::Input { Controller::Controller() { } Controller::~Controller() { } }
keikei14/MLAC
DivaHook/src/Components/SysTimer.cpp
<gh_stars>1-10 #include "SysTimer.h" #include "../MainModule.h" #include "../Constants.h" namespace DivaHook::Components { SysTimer::SysTimer() { } SysTimer::~SysTimer() { } const char *SysTimer::GetDisplayName() { return "sys_timer"; } void SysTimer::Initialize() { DWORD oldProt...
keikei14/MLAC
DivaHook/src/Input/Bindings/Binding.cpp
#include "Binding.h" namespace DivaHook::Input { Binding::Binding() { } Binding::~Binding() { for (auto& binding : InputBindings) delete binding; } void Binding::AddBinding(IInputBinding* inputBinding) { InputBindings.push_back(inputBinding); } bool Binding::AnyDown() { for ...
keikei14/MLAC
DivaHook/src/Components/Input/TouchPanelState.cpp
#include "TouchPanelState.h" namespace DivaHook::Components { }
keikei14/MLAC
DivaHook/src/FileSystem/ConfigFile.cpp
#include <stdio.h> #include "ConfigFile.h" #include "../Utilities/Operations.h" namespace DivaHook::FileSystem { ConfigFile::ConfigFile(const std::string &path) : TextFile(path) { return; } ConfigFile::ConfigFile(const std::string &directory, const std::string &file) : TextFile(directory, file) { ...
keikei14/MLAC
DivaHook/src/Utilities/Math.cpp
<gh_stars>1-10 #define _USE_MATH_DEFINES #include "Math.h" namespace DivaHook::Utilities { float ToDegrees(float radians) { return radians * (180.0f / M_PI); } float ToRadians(float degrees) { return (degrees * M_PI) / 180.0f; } Vec2 GetDirection(float degrees) { float radians = ToRadi...
keikei14/MLAC
Prepatch/src/Patch/PatchData.cpp
<reponame>keikei14/MLAC<filename>Prepatch/src/Patch/PatchData.cpp #include "PatchData.h" namespace Patch { Patch::PatchData::PatchData() { } Patch::PatchData::~PatchData() { if (OriginalBytes != nullptr) delete[] OriginalBytes; if (PatchedBytes != nullptr) delete[] PatchedBytes; } }
keikei14/MLAC
DivaHook/src/Components/Input/TouchPanelEmulator.cpp
#include "TouchPanelEmulator.h" #include "../../Constants.h" #include "../../Input/Mouse/Mouse.h" #define TOUCH_PANEL_CONNECTED 1 using namespace DivaHook::Input; namespace DivaHook::Components { TouchPanelEmulator::TouchPanelEmulator() { } TouchPanelEmulator::~TouchPanelEmulator() { } con...
keikei14/MLAC
DivaHook/src/Input/Xinput/XinputState.cpp
#include "XinputState.h" namespace DivaHook::Input { bool XinputState::IsDown(BYTE keycode) { return KeyStates[keycode]; } }
orthopteroid/psychic-sniffle
src/hydro/math.cpp
<gh_stars>1-10 // copyright 2016 <NAME> (<EMAIL>) // MIT license #include <cmath> namespace hydro { using namespace std; // https://www.e-education.psu.edu/natureofgeoinfo/c7_p9.html float CalcInterpolate( const float *chart, float Qp, float Qh) { struct { float p, h, e; } I[3]; float Dist[3] = ...
orthopteroid/psychic-sniffle
src/schwefel/main.cpp
<reponame>orthopteroid/psychic-sniffle<gh_stars>1-10 // copyright 2016 <NAME> (<EMAIL>) // MIT license #include <iostream> #include <cstring> #include <cstring> #include "sniffle.h" #include "cpuinfo.h" using namespace sniffle; ////////////////////////////// template<typename Rep, uint Dimension, uint Population>...
orthopteroid/psychic-sniffle
src/hydro/main.cpp
// copyright 2016 <NAME> (<EMAIL>) // MIT license #include <iostream> #include <cstring> #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <signal.h> #include <time.h> #include <bits/siginfo.h> #include "hydro/hydro.h" #include "sniffle.h" #include "cpuinfo.h" #define ENABLE_PAGINATED_OUTPUT //...
orthopteroid/psychic-sniffle
src/quadratic/main.cpp
// copyright 2018 <NAME> (<EMAIL>) // MIT license #include <iostream> #include <cstring> #include <time.h> #include <cstring> #include <limits> #include "sniffle.h" #include "cpuinfo.h" using namespace sniffle; ////////////////////////////// timespec diff(timespec start, timespec end) { timespec temp; if ...
microsoft/wifi-telemetry
src/lib/wpa/wifi_telemetry_input_station_connection_attempt.cxx
#include <limits> #include "wifi-telemetry/wifi/wifi_80211_format_mac.hpp" #include "wifi-telemetry/wpa/wifi_telemetry_input_station_connection_attempt.hpp" WifiTelemetryInputStationConnectionAttempt::WifiTelemetryInputStationConnectionAttempt( const WifiConnectionAttemptResult result, const std::optional<wi...
microsoft/wifi-telemetry
src/lib/wpa/wpa_event_dpp_frame_transmit_status.cxx
#include "wifi-telemetry/wpa/wpa_event_dpp_frame_transmit_status.hpp" WpaEventDppFrameTransmitStatus::WpaEventDppFrameTransmitStatus(const wifi_80211_mac& destination_bssid_, unsigned int frequency_, const std::string& status_) : WpaEvent(WpaEventType::DppFrameTransmitStatus), destination_bssid(destination_bs...
microsoft/wifi-telemetry
include/wifi-telemetry/wifi_telemetry_source_wpa.hpp
<gh_stars>1-10 #ifndef __WIFI_TELEMETRY_SOURCE_WPA_HPP__ #define __WIFI_TELEMETRY_SOURCE_WPA_HPP__ #include <memory> #include <optional> #include <string> #include "wifi-telemetry/wifi/wifi_common.hpp" #include "wifi-telemetry/wifi/wifi_dpp_exchange.hpp" #include "wifi-telemetry/wifi_telemetry_source.hpp" #include "...
microsoft/wifi-telemetry
src/lib/lttng-providers/wifi_telemetry_lttng_provider_wifi.hpp
#undef TRACEPOINT_PROVIDER #define TRACEPOINT_PROVIDER wifi #undef TRACEPOINT_INCLUDE #define TRACEPOINT_INCLUDE "./wifi_telemetry_lttng_provider_wifi.hpp" #if !defined(__WIFI_TELEMETRY_LTTNG_PROVIDER_WIFI_HPP__) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _TRACEPOINT_LTTNG_UST_TRACEF_PROVIDER_H #define __WIFI...
microsoft/wifi-telemetry
src/lib/wpa/wpa_event.cxx
#include <chrono> #include <iostream> #include "wifi-telemetry/wpa/wpa_event.hpp" WpaEvent::WpaEvent(WpaEventType type_) : type(type_) {}
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_event_dpp_auth_success.hpp
#ifndef __WPA_EVENT_DPP_AUTH_SUCCESS_HPP__ #define __WPA_EVENT_DPP_AUTH_SUCCESS_HPP__ #include "wifi-telemetry/wpa/wpa_event.hpp" struct WpaEventDppAuthenticationSucceeded : public WpaEvent { WpaEventDppAuthenticationSucceeded(int initiator); int initiator; }; #endif // __WPA_EVENT_DPP_AUTH_SUCCESS_HPP__
microsoft/wifi-telemetry
src/lib/lttng-providers/wifi_telemetry_lttng_provider_station.hpp
#undef TRACEPOINT_PROVIDER #define TRACEPOINT_PROVIDER wifi_station #undef TRACEPOINT_INCLUDE #define TRACEPOINT_INCLUDE "./wifi_telemetry_lttng_provider_station.hpp" #if !defined(__WIFI_TELEMETRY_LTTNG_PROVIDER_STATION_HPP__) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _TRACEPOINT_LTTNG_UST_TRACEF_PROVIDER_H ...
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_command_key_value_pair.hpp
<reponame>microsoft/wifi-telemetry #ifndef __WPA_COMMAND_KEY_VALUE_PAIR_HPP__ #define __WPA_COMMAND_KEY_VALUE_PAIR_HPP__ #include <cstddef> #include <optional> #include <string_view> struct WpaCommandKeyValuePair { WpaCommandKeyValuePair(const char* key_, bool is_required); const char* operator()(void) ...
microsoft/wifi-telemetry
src/lib/wpa/wpa_command.cxx
#include <iostream> #include "wifi-telemetry/wpa/wpa_command.hpp" WpaCommand::WpaCommand(const std::string& name_) : name(name_) {} std::shared_ptr<WpaCommandResponse> WpaCommand::parse_response(const std::string_view payload) const { std::unique_ptr<WpaCommandResponseParser> parser = create_response_parser...
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_event_authentication_rejected.hpp
<reponame>microsoft/wifi-telemetry #ifndef __WPA_EVENT_AUTHENTICATION_REJECTED_HPP__ #define __WPA_EVENT_AUTHENTICATION_REJECTED_HPP__ #include "wifi-telemetry/wifi/wifi_80211.hpp" #include "wifi-telemetry/wpa/wpa_event.hpp" struct WpaEventAuthenticationRejected : public WpaEvent { WpaEventAuthenticationRejected...
microsoft/wifi-telemetry
src/lib/lttng-providers/wifi_telemetry_trace_station.cxx
#include "wifi_telemetry_trace_station.hpp" #include "wifi_telemetry_lttng_provider_station.hpp" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wc99-extensions" #pragma clang diagnostic ignored "-Wgnu-statement-expression" #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-...
microsoft/wifi-telemetry
include/wifi-telemetry/wifi_telemetry_source.hpp
<reponame>microsoft/wifi-telemetry #ifndef __WIFI_TELEMETRY_SOURCE_HPP__ #define __WIFI_TELEMETRY_SOURCE_HPP__ #include <memory> #include <optional> #include <string> #include <string_view> #include "wifi-telemetry/wifi/wifi_common.hpp" #include "wifi-telemetry/wifi_interface_configuration.hpp" struct WifiTelemetry...
microsoft/wifi-telemetry
src/lib/wpa/wpa_command_response.cxx
<filename>src/lib/wpa/wpa_command_response.cxx #include "wifi-telemetry/wpa/wpa_command_response.hpp" WpaCommandResponseGeneric::WpaCommandResponseGeneric(const std::string payload_) : payload(payload_) {}
microsoft/wifi-telemetry
src/lib/wpa/wpa_event_dpp_auth_success.cxx
<gh_stars>1-10 #include "wifi-telemetry/wpa/wpa_event_dpp_auth_success.hpp" WpaEventDppAuthenticationSucceeded::WpaEventDppAuthenticationSucceeded(int initiator_) : WpaEvent(WpaEventType::DppAuthenticationSucceeded), initiator(initiator_) {}
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_event_dpp_conf_sent.hpp
<gh_stars>1-10 #ifndef __WPA_EVENT_DPP_CONF_SENT_HPP__ #define __WPA_EVENT_DPP_CONF_SENT_HPP__ #include "wifi-telemetry/wpa/wpa_event.hpp" struct WpaEventDppConfigurationSent : public WpaEvent { WpaEventDppConfigurationSent(void); }; #endif // __WPA_EVENT_DPP_CONF_SENT_HPP__
microsoft/wifi-telemetry
src/lib/wpa/wpa_event_dpp_conf_received.cxx
<gh_stars>1-10 #include "wifi-telemetry/wpa/wpa_event_dpp_conf_received.hpp" WpaEventDppConfigurationReceived::WpaEventDppConfigurationReceived(void) : WpaEvent(WpaEventType::DppConfigurationReceived) {}
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_event_disconnected.hpp
<gh_stars>1-10 #ifndef __WPA_EVENT_DISCONNECTED_HPP__ #define __WPA_EVENT_DISCONNECTED_HPP__ #include <array> #include <cinttypes> #include "wifi-telemetry/wifi/wifi_80211.hpp" #include "wifi-telemetry/wpa/wpa_event.hpp" struct WpaEventDisconnected : public WpaEvent { WpaEventDisconnected(const wifi_80211_mac& ...
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_command_status.hpp
#ifndef __WPA_COMMAND_STATUS_HPP__ #define __WPA_COMMAND_STATUS_HPP__ #include <cinttypes> #include <string> #include "wifi-telemetry/wifi/wifi_80211.hpp" #include "wifi-telemetry/wpa/wpa_command.hpp" #include "wifi-telemetry/wpa/wpa_state.hpp" struct WpaCommandStatusResponseParser : public WpaCommandResponseParser...
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_event_dpp_auth_init_failure.hpp
<reponame>microsoft/wifi-telemetry #ifndef __WPA_EVENT_DPP_AUTH_INIT_FAILURE_HPP__ #define __WPA_EVENT_DPP_AUTH_INIT_FAILURE_HPP__ #include <string> #include "wifi-telemetry/wpa/wpa_event_dpp_failure.hpp" struct WpaEventDppAuthenticationInitFailure : public WpaEventDppFailure { WpaEventDppAuthenticationInitFail...
microsoft/wifi-telemetry
include/wifi-telemetry/wifi/wifi_dpp.hpp
<gh_stars>1-10 #ifndef __WIFI_DPP_HPP__ #define __WIFI_DPP_HPP__ enum class WifiDppRole { Initiator, Responder }; inline const char* WifiDppRoleToString(const WifiDppRole role) { static const char* strs[] = { "initiator", "responder" }; return strs[unsigned(role)]; } enum class ...
microsoft/wifi-telemetry
src/lib/wifi_telemetry_instance_impl.cxx
#include "wifi_telemetry_instance_impl.hpp" WifiTelemetrySourceInstanceImpl::WifiTelemetrySourceInstanceImpl(std::shared_ptr<WifiTelemetrySource> source_, const std::shared_ptr<WifiTelemetrySourceActivationArgs> args_) : WifiTelemetrySourceInstance(source_, args_) {} int WifiTelemetrySourceInstanceImpl::activate...
microsoft/wifi-telemetry
include/wifi-telemetry/wifi_telemetry_source_ztpd.hpp
#ifndef __WIFI_TELEMETRY_SOURCE_ZTPD_HPP__ #define __WIFI_TELEMETRY_SOURCE_ZTPD_HPP__ #include <memory> #include <optional> #include <sdbus-c++/sdbus-c++.h> #include "wifi-telemetry/wifi_telemetry_source.hpp" class __attribute__((visibility("default"))) WifiTelemetrySourceZtpd : public WifiTelemetrySource, ...
microsoft/wifi-telemetry
src/lib/wpa/wpa_command_key_value_pair.cxx
#include <string.h> #include "wifi-telemetry/wpa/wpa_command_key_value_pair.hpp" WpaCommandKeyValuePair::WpaCommandKeyValuePair(const char* key_, bool is_required_ = WpaValueOptional) : key(key_), key_length(strlen(key)), value(std::nullopt), is_required(is_required_) {} const char* WpaCommandKeyVal...
microsoft/wifi-telemetry
src/lib/lttng-providers/wifi_telemetry_tracelogging.hpp
<gh_stars>1-10 /** * This file should be used in place of #include'ing TraceLoggingProvider.h * directly because it re-defines as macros what LTTNG has defined as an enum * :-( */ #include <tracelogging/TraceLoggingProvider.h> #undef TRACE_EMERG #undef TRACE_ALERT #undef TRACE_CRIT #undef TRACE_ERR #undef TRACE_WA...
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_event_association_rejected.hpp
#ifndef __WPA_EVENT_ASSOCIATION_REJECTED_HPP__ #define __WPA_EVENT_ASSOCIATION_REJECTED_HPP__ #include <optional> #include "wifi-telemetry/wifi/wifi_80211.hpp" #include "wifi-telemetry/wpa/wpa_event.hpp" struct WpaEventAssociationRejected : public WpaEvent { WpaEventAssociationRejected(WifiStatusCode status_cod...
microsoft/wifi-telemetry
include/wifi-telemetry/wpa/wpa_command_response_parser.hpp
#ifndef __WPA_COMMAND_RESPONSE_PARSER_HPP__ #define __WPA_COMMAND_RESPONSE_PARSER_HPP__ #include <memory> #include <optional> #include <string_view> #include <vector> #include "wifi-telemetry/wpa/wpa_command_key_value_pair.hpp" #include "wifi-telemetry/wpa/wpa_command_response.hpp" struct WpaCommandResponseParser {...
microsoft/wifi-telemetry
src/lib/wifi_device_info.cxx
<gh_stars>1-10 #include <cstdlib> #include <filesystem> #include <libudev.h> #include <stdexcept> #include <string.h> extern "C" { #include <pci/pci.h> } #include "wifi_device_info.hpp" WifiDeviceInfo::WifiDeviceInfo( const std::string& interface_, const std::string& bssid_, const std::string& subsyst...
microsoft/wifi-telemetry
src/lib/lttng-providers/wifi_telemetry_lttng_provider_station.cxx
#define TRACEPOINT_DEFINE #define TRACEPOINT_CREATE_PROBES #include "wifi_telemetry_lttng_provider_station.hpp"
microsoft/wifi-telemetry
src/daemon/main.cxx
<filename>src/daemon/main.cxx #include <getopt.h> #include <iostream> #include <signal.h> #include <stdexcept> #include <string.h> #include <string> #include "wifi-telemetry/wifi_telemetry_monitor.hpp" #include "wifi-telemetry/wifi_telemetry_source_wpa.hpp" #include "wifi-telemetry/wifi_telemetry_source_ztpd.hpp" st...