repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
TwoFlyLiu/ecanspy3 | ecanspy3/can/UsbCanUtil.h | <gh_stars>1-10
#pragma once
#include "ECanVci.H"
#include <QObject>
/*!
* \brief 设备类型,对于测试软件就是使用USBCAN了
*/
#define USB_CAN_DEVICE_TYPE (USBCAN1)
#define USB_CAN_DEVICE_INDEX (0)
/*!
* \brief 默认的VCI_CAN初始化设置
*/
#define DEFAULT_VCI_INIT_CONFIG {0x00000000, 0xffffffff, 0, 0x00, 0, 0x1c, 0x00}
/*!
* \b... |
TwoFlyLiu/ecanspy3 | ecanspy3/send/signalwidget.h | #ifndef SIGNALWIDGET_H
#define SIGNALWIDGET_H
#include "base/titletableviewwidget.h"
#include "send/signaltablemodel.h"
#include "can/UsbCanUtil.h"
class SignalWidget : public TitleTableViewWidget
{
Q_OBJECT
public:
explicit SignalWidget(QWidget *parent = nullptr);
void initModel();
voi... |
TwoFlyLiu/ecanspy3 | ecanspy3/send/signaltableviewphysicalvaluedelegate.h | <reponame>TwoFlyLiu/ecanspy3
#ifndef COMBOBOXDELEGATE_H
#define COMBOBOXDELEGATE_H
#include <QItemDelegate>
#include <dbc4cpp/parser.h>
class SignalTableViewPhysicalValueDelegate : public QItemDelegate
{
public:
SignalTableViewPhysicalValueDelegate(QObject *parent=nullptr);
// QAbstractItemDelegat... |
TwoFlyLiu/ecanspy3 | ecanspy3/diag/diagwidget.h | <reponame>TwoFlyLiu/ecanspy3
#ifndef DIAGWIDGET_H
#define DIAGWIDGET_H
#include <QWidget>
class DiagWidget : public QWidget
{
public:
DiagWidget(QWidget *parent);
};
#endif // DIAGWIDGET_H
|
TwoFlyLiu/ecanspy3 | ecanspy3/can/Core - 副本.h | <filename>ecanspy3/can/Core - 副本.h
#pragma once
#include <vector>
#include <map>
#include "ECanVci.H"
#include <QObject>
#include <QTimer>
/////////////////////////////////////////////////////////////////////////////////////////
// 周期性发送报文
//////////////////////////////////////////////////////////////////... |
TwoFlyLiu/ecanspy3 | dbc4cpp/entities.h | #ifndef ENTITIES_H
#define ENTITIES_H
#include "dbc4cpp_global.h"
#include <QSet>
#include <QMap>
#include <QStringList>
BEGIN_DBC4CPP_NAMESPACE
static QString EMPTY_STRING;
/*!
* \brief Version类,代表DBC文件中的版本号
*/
class Version
{
public:
Version(const QString &version="");
/*!
*... |
TwoFlyLiu/ecanspy3 | ecanspy3/receive/receivemessagefilterproxymodel.h | #ifndef RECEIVEMESSAGEFILTERPROXYMODEL_H
#define RECEIVEMESSAGEFILTERPROXYMODEL_H
#include <QSortFilterProxyModel>
#include <QList>
#include "filtertablemodel.h"
class ReceiveMessageFilterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
ReceiveMessageFilterProxyModel(QObject *parent=nul... |
TwoFlyLiu/ecanspy3 | ecanspy3/utils/scrollingfile.h | #ifndef SCROLLINGFILE_H
#define SCROLLINGFILE_H
#include <QFile>
class ScrollingFile
{
public:
enum {
DEFAULT_SINGILE_FILE_COUNT = 40 * 1024 * 1024 //!< 单位字节
};
enum FileNameRule {
FILE_NAME_RULE_ID_INC = 0, //!< 以ID递增方式
};
ScrollingFile(QString filePath, in... |
algisb/vkRend | src/DbgPrint.h | <reponame>algisb/vkRend
#pragma once
#include <stdarg.h>
#define ENABLE_DBG_PRINT
#ifdef ENABLE_DBG_PRINT
#define dbgPrint(_str, ...)\
{\
printf(_str, ##__VA_ARGS__);\
}
#else
#define dbgPrint(_str, ...)
#endif
|
algisb/vkRend | src/VkWrapper.h | #pragma once
#include <vector>
#include <vulkan/vulkan.h>
struct SDL_Window;
class VkWrapper
{
public:
const std::vector<const char*> validationLayers =
{
"VK_LAYER_KHRONOS_validation"
};
#ifdef NDEBUG
const bool enableValidationLayers = false;
#else
const bool enableValidationLaye... |
devium/redis-devium | protocol/redis.h | #pragma once
#include <string>
#include <vector>
#include <cstdint>
#include <boost/variant.hpp>
#include "reader.h"
#include "writer.h"
#include "configs.h"
struct RedisError {
explicit RedisError(const std::string& msg) : msg(msg) {}
std::string msg;
};
struct RedisNull {};
struct RedisBulkString {
... |
devium/redis-devium | server/HashTable.h | <reponame>devium/redis-devium<gh_stars>0
#pragma once
#include <unordered_map>
#include <protocol/redis.h>
typedef std::unordered_map<std::string, RedisValue> RedisHashTable;
class HashTable {
private:
RedisHashTable table_;
public:
HashTable();
HashTable(RedisHashTable hashTable);
RedisHashTabl... |
devium/redis-devium | server/Cmd.h | #pragma once
#include <protocol/redis.h>
#include "HashTable.h"
#include "configs.h"
class Cmd {
protected:
cmd name_;
HashTable* redisHashTable_;
public:
Cmd(cmd name, HashTable * hashTable);
cmd getName();
};
class Setter : public Cmd {
public:
Setter(HashTable * hashTable);
using ... |
devium/redis-devium | configs.h | #pragma once
constexpr size_t MAX_STRING_SIZE_ = 1024 * 1024;
constexpr size_t MAX_STRING_LEN_ = 1 << 15;
enum cmd {SET, GET};
enum RedisType {
REDIS_NULL,
REDIS_INT,
REDIS_STRING,
REDIS_BULK_STRING,
REDIS_ERROR,
REDIS_ARRAY
};
|
devium/redis-devium | server/Listener.h | <gh_stars>0
#pragma once
#include <memory>
#include <stdlib.h>
#include <netinet/in.h>
#include <tclDecls.h>
#include <sys/errno.h>
#include "Socket.h"
class Listener {
private:
int socketDescriptor_;
int port_;
const int max_port_ = 1 << 16 - 1;
const int min_port_ = 0;
void bindSocket();
... |
devium/redis-devium | protocol/reader.h | <reponame>devium/redis-devium
#pragma once
#include <vector>
#include <string>
#include <stdexcept>
#include "configs.h"
class Reader {
public:
explicit Reader(size_t bufferSize) : buffer_(bufferSize) {}
char readChar();
std::string readLine();
std::string readRaw(size_t len);
int64_t readInt... |
devium/redis-devium | server/Server.h | <gh_stars>0
#pragma once
#include <gtest/gtest.h>
class Server {
public:
Server();
void listen();
void serve(int maxAccept = -1);
virtual void handle(int conn) = 0;
};
|
devium/redis-devium | server/Socket.h | <filename>server/Socket.h
#pragma once
#include <unistd.h>
#include <string>
class Socket {
private:
int socketDescriptor_;
public:
Socket(int socketDescriptor);
~Socket();
int getSocketDescriptor();
std::string readData(size_t size);
void writeData(std::string data);
};
|
devium/redis-devium | protocol/writer.h | <filename>protocol/writer.h
#pragma once
#include <vector>
#include <string>
class Writer {
public:
explicit Writer(size_t bufferSize) : buffer_(bufferSize) {}
void writeString(const std::string &s);
void writeRaw(const char *s, size_t len);
void writeInt(int64_t i);
void writeChar(char c);
... |
yksz/cpp-logger | src/loggerconf.h | #pragma once
namespace logger {
/**
* Configure a logger with a configuration file.
* If the filename is nullptr, return without doing anything.
*
* The following is the configurable key/value list.
* |key |value |
* |:--------------------------|:---... |
yksz/cpp-logger | src/logger.h | <filename>src/logger.h
#pragma once
#include <cstdint>
#include <cstdio>
#include <cstring>
#if defined(_WIN32) || defined(_WIN64)
#define __FILENAME__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#else
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#endi... |
bolero-MURAKAMI/KTL | projects/msvc11/functor/ktl_rc_version.h | <reponame>bolero-MURAKAMI/KTL
/*=============================================================================
Copyright (c) 2010-3015 <NAME>
https://github.com/bolero-MURAKAMI/KTL
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/L... |
bolero-MURAKAMI/KTL | ktl/rc/version.h | /*=============================================================================
Copyright (c) 2010-2015 <NAME>
https://github.com/bolero-MURAKAMI/KTL
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============... |
Jmin17/Random-Class-C- | Random.h | <gh_stars>0
#pragma once
#ifndef RANDOM_CLASS
#define RANDOM_CLASS
#include <random>
#include <memory>
class Random
{
public:
Random();
Random(int minIntVal, int maxIntVal);
int nextInt();
int nextInt(int minVal, int maxVal);
void setIntRange(int minVal, int maxVal);
double nextDouble();
... |
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/1+N/TangramOnePlusLayoutComponent.h | <reponame>iYeso/TextureTangram<gh_stars>1-10
// Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by... |
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/Inline Layout/Base/TangramInlineLayoutComponent.h | //
// TangramInlineLayoutComponent.h
// TextureTangram
//
// Created by 廖超龙 on 2018/8/23.
// Copyright © 2018年 ZZinKin. All rights reserved.
//
#import "TangramLayoutComponent.h"
#import "TangramInlineCellInfo.h"
@interface TangramInlineLayoutComponent : TangramLayoutComponent
@property (nonatomic) CGRect inline... |
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/Grid Layout/TangramGridLayoutComponet.h | // Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, soft... |
iYeso/TextureTangram | TextureTangram/Core/Data Source Helper/TangramDefaultDataSourceHelper.h | //
// TangramDefaultDataSourceHelper.h
// TextureTangram
//
// Created by 廖超龙 on 2018/10/19.
// Copyright © 2018年 ZZinKin. All rights reserved.
//
#import "TangramLayoutComponent.h"
@interface TangramDefaultDataSourceHelper : NSObject
/**
根据json数据创建TangramLayoutComponent数组
@param contents json转化的数组,需要去null处理
... |
iYeso/TextureTangram | TextureTangram/Utils/NSTimer+Compatible.h | // Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, soft... |
iYeso/TextureTangram | TextureTangram/Demo/Hardcoded Demo/DemoViewController.h | //
// DemoViewController.h
// TextureTangram
//
// Created by cello on 2018/8/23.
// Copyright © 2018年 ZZinKin. All rights reserved.
//
#import <AsyncDisplayKit/AsyncDisplayKit.h>
@interface DemoViewController : ASViewController
@end
|
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/Inline Layout/Carousel(Banner)/TangramPageControl.h | /// Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, sof... |
iYeso/TextureTangram | TextureTangram/Core/Base/TangramLayoutComponent.h | // Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, soft... |
iYeso/TextureTangram | TextureTangram/Utils/NSArray+TangramParse.h | //
// NSArray+TangramParse.h
// TextureTangram
//
// Created by 廖超龙 on 2018/10/19.
// Copyright © 2018年 ZZinKin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NSArray (TangramParse)
- (UIEdgeInsets)parseInsets;
/**
递归地移除所有的属性
@return 一个新的NSArray对象
*/
- (NSArray *)tan_removeNullValues;
@end
|
iYeso/TextureTangram | TextureTangram/Utils/TANWeakProxy.h | <gh_stars>1-10
// Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
iYeso/TextureTangram | TextureTangram/Utils/NSDictionary+TangramParse.h | <reponame>iYeso/TextureTangram<filename>TextureTangram/Utils/NSDictionary+TangramParse.h<gh_stars>1-10
//
// NSDictionary+TangramParse.h
// TextureTangram
//
// Created by 廖超龙 on 2018/10/19.
// Copyright © 2018年 ZZinKin. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDictionary (TangramPar... |
iYeso/TextureTangram | TextureTangram/Utils/NSObject+SafeKVO.h | <reponame>iYeso/TextureTangram
//
// NSObject+SafeKVO.h
// TextureTangram
//
// Created by 廖超龙 on 2018/10/18.
// Copyright © 2018年 ZZinKin. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (SafeKVO)
/**
Registers a block to receive KVO notifications for the specified key-path
rela... |
iYeso/TextureTangram | TextureTangram/Core/Base/TangramComponentDescriptor.h | <gh_stars>1-10
// Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
iYeso/TextureTangram | TextureTangram/Core/Base/TangramCollectionViewLayout.h | <filename>TextureTangram/Core/Base/TangramCollectionViewLayout.h<gh_stars>1-10
// Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LI... |
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/Inline Layout/Carousel(Banner)/TangramCarouselInlineLayoutComponent.h | /// Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, sof... |
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/Waterflow Layout/TangramWaterFlowLayoutComponent.h | <filename>TextureTangram/Core/Build-in Layouts/Waterflow Layout/TangramWaterFlowLayoutComponent.h
// Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apa... |
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/TangramBuildInLayout.h | <gh_stars>1-10
//
// TangramBuildInLayout.h
// TextureTangram
//
// Created by 廖超龙 on 2018/10/19.
// Copyright © 2018年 ZZinKin. All rights reserved.
//
#import "TangramGridLayoutComponet.h"
#import "TangramWaterFlowLayoutComponent.h"
#import "TangramOnePlusLayoutComponent.h"
#import "TangramCarouselInlineLayoutCo... |
iYeso/TextureTangram | TextureTangram/Core/Build-in Layouts/Inline Layout/Horizontal Scrollable/TangramHorizontalInlineLayoutComponent.h | // Copyright ZZinKin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, soft... |
ModernBinary/ModernBinary | src/comp/core/convert.h | <gh_stars>10-100
#include <string>
using namespace std;
#ifndef FUNCTIONS_H_INCLUDED
#define FUNCTIONS_H_INCLUDED
string texttomb(string text);
string mbtotext(string text);
#endif |
aapris/esp32-ble2mqtt | config.c | <gh_stars>1-10
#include "config.h"
#include <mbedtls/md5.h>
#include <esp_err.h>
#include <esp_log.h>
#include <esp_spiffs.h>
#include <cJSON.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
/* Constants */
static const char *TAG = "Config";
static const char *config_file_name = "/spiff... |
bennyyip/kaleidoscope-oxidized | example/fib.c | <reponame>bennyyip/kaleidoscope-oxidized<filename>example/fib.c<gh_stars>0
#include<stdio.h>
double fib(double);
double fibi(double);
int main(int argc, const char **argv) {
printf("%lf %lf", fib(10), fibi(20));
return 0;
}
|
colinw7/CConcat | src/CConcatFind.h | <gh_stars>0
#ifndef CCONCAT_FIND_H
#define CCONCAT_FIND_H
#include <CConcatBase.h>
#include <CGlob.h>
#include <CRegExp.h>
#include <vector>
class CommentParser;
class CConcatFind : public CConcatBase {
public:
typedef std::vector<std::string> Strings;
public:
CConcatFind();
~CConcatFind();
//---
const... |
colinw7/CConcat | src/CConcatBase.h | <filename>src/CConcatBase.h
#ifndef CCONCAT_BASE_H
#define CCONCAT_BASE_H
#include <string>
#include <sys/types.h>
class CConcatBase {
public:
CConcatBase();
const std::string &id() const { return id_; }
void setId(const std::string &s) { id_ = s; }
const std::string &filename() const { return filename_; }... |
colinw7/CConcat | src/CConcat.h | <gh_stars>0
#ifndef CCONCAT_H
#define CCONCAT_H
#include <CConcatBase.h>
#include <vector>
class CConcat : public CConcatBase {
public:
CConcat();
bool isSymlink() const { return symlink_; }
void setSymlink(bool b) { symlink_ = b; }
void addFile(const std::string &s) {
files_.push_back(s);
}
uint ... |
colinw7/CConcat | src/CConcatReplace.h | <filename>src/CConcatReplace.h
#ifndef CCONCAT_REPLACE_H
#define CCONCAT_REPLACE_H
#include <CConcatBase.h>
#include <vector>
class CConcatReplace : public CConcatBase {
public:
typedef std::vector<std::string> Strings;
public:
CConcatReplace();
~CConcatReplace();
const Strings &fromPatterns() const { retu... |
colinw7/CConcat | src/CUnconcat.h | #ifndef CUNCONCAT_H
#define CUNCONCAT_H
#include <CConcatBase.h>
class CUnconcat : public CConcatBase {
public:
CUnconcat();
bool isTabulate() const { return tabulate_; }
void setTabulate(bool b) { tabulate_ = b; }
bool isCount() const { return count_; }
void setCount(bool b) { count_ = b; }
int fileN... |
sayinala/Capstone | main/algorithms/NemhauserUllmannSolver.h | <filename>main/algorithms/NemhauserUllmannSolver.h
#ifndef MAIN_ALGORITHMS_NEMHAUSERULLMANNSOLVER_H_
#define MAIN_ALGORITHMS_NEMHAUSERULLMANNSOLVER_H_
#include <string>
#include <vector>
#include "main/KnapSackSolver.h"
/**
* A PlotPoint represents a point in the worth vs. weight plot.
* Therefore we need the wort... |
sayinala/Capstone | main/algorithms/DynamicProgrammingParallelSolver.h | <reponame>sayinala/Capstone
#ifndef MAIN_ALGORITHMS_DYNAMICPROGRAMMINGPARALLELSOLVER_H_
#define MAIN_ALGORITHMS_DYNAMICPROGRAMMINGPARALLELSOLVER_H_
#include <string>
#include <vector>
#include "util/MyMath.h"
#include "main/KnapSackSolver.h"
#include "main/algorithms/DynamicProgrammingSolver.h" // for IntegerItem str... |
sayinala/Capstone | util/io/KnapSackWriter.h | #ifndef IO_KNAPSACKWRITER_H_
#define IO_KNAPSACKWRITER_H_
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <assert.h>
#include "main/KnapSack.h"
/**
* Helper class used to create an output file representing the solution of a solved
* knapsack problem in a specific format.
*
* Example output fil... |
sayinala/Capstone | main/algorithms/BruteForceSolver.h | <filename>main/algorithms/BruteForceSolver.h<gh_stars>1-10
#ifndef MAIN_ALGORITHMS_BRUTEFORCESOLVER_H_
#define MAIN_ALGORITHMS_BRUTEFORCESOLVER_H_
#include <string>
#include <vector>
#include "main/KnapSackSolver.h"
/**
* The BruteForceSolver extends the KnapSackSolver class and
* implements the abstract method so... |
sayinala/Capstone | main/algorithms/DynamicProgrammingSolver.h | #ifndef MAIN_ALGORITHMS_DYNAMICPROGRAMMINGSOLVER_H_
#define MAIN_ALGORITHMS_DYNAMICPROGRAMMINGSOLVER_H_
#include <string>
#include <vector>
#include "util/MyMath.h"
#include "main/KnapSackSolver.h"
/**
* The same struct as KnapSackItem but instead of having
* double values for weight and worth we use int values.
... |
sayinala/Capstone | main/algorithms/NemhauserUllmannParallelSolver.h | #ifndef MAIN_ALGORITHMS_NEMHAUSERULLMANNPARALLELSOLVER_H_
#define MAIN_ALGORITHMS_NEMHAUSERULLMANNPARALLELSOLVER_H_
#include <omp.h>
#include <string>
#include <vector>
#include "main/KnapSackSolver.h"
#include "main/algorithms/NemhauserUllmannSolver.h"
/**
* Based on NemhauserUllmannSolver but the method betterPoi... |
sayinala/Capstone | util/StringUtils.h | #ifndef UTIL_STRINGUTILS_H_
#define UTIL_STRINGUTILS_H_
#include <string>
#include <algorithm>
#include <functional>
#include <cctype>
#include <locale>
#include <vector>
#include <sstream>
/**
* Helper class which provides string helper functions
*/
class StringUtils {
public:
/**
* Trims white spaces from the ... |
sayinala/Capstone | main/algorithms/DynamicProgrammingLowMemorySolver.h | #ifndef MAIN_ALGORITHMS_DYNAMICPROGRAMMINGLOWMEMORYSOLVER_H_
#define MAIN_ALGORITHMS_DYNAMICPROGRAMMINGLOWMEMORYSOLVER_H_
#include <string>
#include <vector>
#include <assert.h>
#include "util/MyMath.h"
#include "main/KnapSackSolver.h"
#include "main/algorithms/DynamicProgrammingSolver.h" // for IntegerItem struct
/... |
sayinala/Capstone | util/io/KnapSackReader.h | #ifndef IO_KNAPSACKREADER_H_
#define IO_KNAPSACKREADER_H_
#include "main/KnapSack.h"
#include "util/StringUtils.h"
#include <cstdlib>
#include <fstream>
#include <string>
/**
* Helper class used to interpret knapsack problems from input files.
*
* Example File:
*
* ------------------------
* 10.0 4 2
* XXL bl... |
sayinala/Capstone | util/io/StatisticsWriter.h | #ifndef IO_STATISTICSWRITER_H_
#define IO_STATISTICSWRITER_H_
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
/**
* Helper class used to create an output file representing the statistics collected
* while solving a knapsack problem in a KnapSackSolver
*
* Example outpu... |
sayinala/Capstone | test/TestData.h | <filename>test/TestData.h
#ifndef TEST_DATA_H_
#define TEST_DATA_H_
/* Content of text file
15.0 4 5
XXL blue 0x 02.0 2.00
gray mouse 01.0 2.00
big green box 12.0 4.00
yellow daisy 04.0 10.00
salmon mousse 01.0 1.00
*/
static const char* KNAPSACK_INPUT_FILE = "res/KnapSackItemsForUnittest.txt";
/* Content of t... |
sayinala/Capstone | main/KnapSack.h | #ifndef MAIN_KNAPSACK_H_
#define MAIN_KNAPSACK_H_
#include <utility>
#include <iostream>
#include "util/MyMath.h"
/**
* Represents an item from the item pool of the knapsack
*/
struct KnapSackItem{
// using string pointer because of performance reasons.
std::string* name;
double weight;
double worth;
bool op... |
sayinala/Capstone | util/TestUtils.h | <gh_stars>1-10
#ifndef UTIL_TESTUTILS_H_
#define UTIL_TESTUTILS_H_
/**
* Helper class that provides methods for performing tests.
*/
class TestUtils {
public:
/**
* Checks whether the file found at the given TEST_OUTPUT_FILE path matches the given ASSUMED_CONTENT.
* Reads the file found at the given path and ... |
sayinala/Capstone | main/algorithms/NemhauserUllmannRLPParallelSolver.h | #ifndef MAIN_ALGORITHMS_NEMHAUSERULLMANNRLPPARALLELSOLVER_H_
#define MAIN_ALGORITHMS_NEMHAUSERULLMANNRLPPARALLELSOLVER_H_
#include <string>
#include <vector>
#include <cmath>
#include <omp.h>
#include "main/KnapSackSolver.h"
// For PlotPoints
#include "main/algorithms/NemhauserUllmannSolver.h"
/**
* This is paral... |
sayinala/Capstone | util/MyMath.h | <gh_stars>1-10
#ifndef UTIL_MYMATH_H_
#define UTIL_MYMATH_H_
#include <cmath>
/**
* Helper class which provides mathematical helper functions
*/
class MyMath {
public:
/**
* Range that two floating point numbers may differ to still be considered as equal
*/
static const double EPSILON;
/**
* Compares two... |
sayinala/Capstone | main/algorithms/NemhauserUllmannSolverRLP.h | #ifndef MAIN_ALGORITHMS_NEMHAUSERULLMANNSOLVER_RLP_H_
#define MAIN_ALGORITHMS_NEMHAUSERULLMANNSOLVER_RLP_H_
#include <string>
#include <vector>
#include "main/KnapSackSolver.h"
// For PlotPoints
#include "main/algorithms/NemhauserUllmannSolver.h"
/**
* This is an improvement of NemhauserUllmannSolver.
* The suff... |
jiayuehua/Cpp20 | src/splitview.h | #pragma once
// https://godbolt.org/z/7GjPzEGo1
#include <ranges>
#include <algorithm>
#include <string>
#include <iostream>
#include <span>
using namespace std::ranges;
template <contiguous_range V, forward_range Pattern>
requires view<V> && view<Pattern> &&
std::indirectly_comparable<iterator_t<V>,
... |
jiayuehua/Cpp20 | src/boolean.h | #pragma once
#include <concepts>
struct boolean
{
private:
bool _val;
public:
constexpr boolean() noexcept = default;
template<std::convertible_to<bool> T>
explicit(!std::same_as<T, bool>) constexpr boolean(T b) noexcept
: _val(b) {}
template<std::constructible_from<bool> T>
explicit(!std::same_as<boo... |
jiayuehua/Cpp20 | src/detect_expr.h | #pragma once
//#include "https://raw.githubusercontent.com/PeterSommerlad/PSsimplesafeint/main/include/psssafeint.h"""
#include <iostream>
namespace compile_checks {
//using namespace psssint;
template<auto value>
using consume_value = void;
#define concat_line_impl(A, B) A##_##B
#define concat_line(A, B) concat_lin... |
haikieu/Swift-Tool-Kit | ToolKit/ToolKit/ToolKit.h | <reponame>haikieu/Swift-Tool-Kit
//
// ToolKit.h
// ToolKit
//
// Created by <NAME> on 1/28/18.
// Copyright © 2018 <EMAIL>. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for ToolKit.
FOUNDATION_EXPORT double ToolKitVersionNumber;
//! Project version string for ToolKit.
FOUNDATION_EX... |
haikieu/Swift-Tool-Kit | ToolKitUI/DevKitUI/DevKitUI.h | <reponame>haikieu/Swift-Tool-Kit
//
// ToolKitUI.h
// ToolKitUI
//
// Created by <NAME> on 1/28/18.
// Copyright © 2018 <EMAIL>. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for ToolKitUI.
FOUNDATION_EXPORT double ToolKitUIVersionNumber;
//! Project version string for ToolKitUI.
FOU... |
ybabs/dji-drone-planner | include/uav_agent/controllers/pid_alt.h | // Alternative implementation of PID controller from : https://github.com/pms67/PID
#ifndef PID_CONTROLLER_H
#define PID_CONTROLLER_H
struct PIDControl {
// Gains
float Kp;
float Ki;
float Kd;
/* LPF time constant derivative */
float tau;
// Output limits
float max_limit;
float... |
ybabs/dji-drone-planner | include/uav_agent/base/control.h | <filename>include/uav_agent/base/control.h
#ifndef CONTROL_H
#define CONTROL_H
#include "uav_agent/base/base.h"
class HLControl : public Base
{
public:
HLControl();
bool takeoff();
bool M100Takeoff();
bool M100Land();
bool land();
void rth();
float computeTi... |
ybabs/dji-drone-planner | include/uav_agent/base/base.h | <filename>include/uav_agent/base/base.h
#ifndef FLIGHT_BASE
#define FLIGHT_BASE
#include <ros/ros.h>
#include <geometry_msgs/QuaternionStamped.h>
#include <geometry_msgs/Vector3Stamped.h>
#include <sensor_msgs/NavSatFix.h>
#include <std_msgs/UInt8.h>
#include <tf/tf.h>
#include <sensor_msgs/Joy.h>
#include <std_msgs/F... |
ybabs/dji-drone-planner | include/uav_agent/controllers/pid.h | <reponame>ybabs/dji-drone-planner
#ifndef _PID_H_
#define _PID_H_
#include <ros/ros.h>
struct pid {
float current_effort;
float target_effort;
float prev_position; // to get rid of derivative kick
float error;
float prev_error;
float Kp;
float Ki;
float Kd;
float output... |
ybabs/dji-drone-planner | include/uav_agent/utils/utils.h | #include <cmath>
#include <geometry_msgs/QuaternionStamped.h>
#include <geometry_msgs/Vector3Stamped.h>
#define PI (double) 3.141592653589793
#define C_EARTH (double)6378137.0
static double DegToRad(double degree)
{
return degree * (PI/180.0);
}
static double RadToDeg(double rad)
{
return rad * (180.0/PI);... |
ybabs/dji-drone-planner | include/uav_agent/base/planner.h | <filename>include/uav_agent/base/planner.h
#ifndef PLANNER_H
#define PLANNER_H
#include <tuple>
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <queue>
#include "uav_agent/controllers/pid.h"
#include "uav_agent/base/base.h"
#include "uav_agent/base/control.h"
#include "gcs/Action.h"
#include "gcs/Waypoint.h... |
Nero-Hu/speech | HMM/hmm.h | //
// hmm.h
// HMM
//
// Created by NeroHu on 3/5/15.
// Copyright (c) 2015 hthu. All rights reserved.
//
#ifndef HMM_hmm_h
#define HMM_hmm_h
#include <vector>
#include <iostream>
#include <deque>
typedef std::vector<int> ObsVector;
typedef std::vector<float> RowVector;
typedef std::deque<RowVector> Beta;
type... |
Nero-Hu/speech | recognizer/fenonic.h | <gh_stars>0
//
// fenonic.h
// recognizer
//
// Created by NeroHu on 3/6/15.
// Copyright (c) 2015 hthu. All rights reserved.
//
#ifndef recognizer_fenonic_h
#define recognizer_fenonic_h
#include <iostream>
#include <fstream>
#include <unordered_map>
#include <deque>
#include <cmath>
#include <set>
#include "hmm.... |
Nero-Hu/speech | recognizer/hmm.h | //
// hmm.h
// HMM
//
// Created by NeroHu on 3/5/15.
// Copyright (c) 2015 hthu. All rights reserved.
//
#ifndef HMM_hmm_h
#define HMM_hmm_h
#include <vector>
#include <map>
#include <ctime>
static const int FENO_SIZE = 257;
static const std::string SIL = "<sil>";
static std::map<std::string, int> HIdxMap;
//R... |
pablomiralles22/deiso-xv6 | kernel/exec.c | #include "types.h"
#include "param.h"
#include "memlayout.h"
#include "riscv.h"
#include "spinlock.h"
#include "proc.h"
#include "defs.h"
#include "elf.h"
#include "vma.h"
int
exec(char *path, char **argv)
{
char *s, *last;
int i, off;
uint64 argc, sz = 0, sp, ustack[MAXARG], stackbase;
struct elfhdr elf;
st... |
pablomiralles22/deiso-xv6 | kernel/vma.c | #include "file.h"
#include "defs.h"
#include "vma.h"
#include "proc.h"
struct vma vma_list[NVMA];
struct vma *vma_alloc() {
struct vma* vma;
for(vma = vma_list; vma < &vma_list[NVMA]; vma++) {
acquire(&vma->lock);
if(vma->used == 0) return vma;
release(&vma->lock);
}
return 0;
panic("Out of VMAs... |
pablomiralles22/deiso-xv6 | kernel/vma_flags.h | <reponame>pablomiralles22/deiso-xv6
#ifndef VMA_FLAGS_H
#define VMA_FLAGS_H
#define PROT_READ (0x1 << 0)
#define PROT_WRITE (0x1 << 1)
#define PROT_EXEC (0x1 << 2)
#define MAP_SHARED (0x1 << 0)
#define MAP_PRIVATE (0x1 << 1)
#endif
|
pablomiralles22/deiso-xv6 | user/lotterytest.c | <filename>user/lotterytest.c
#include "../kernel/types.h"
#include "../kernel/stat.h"
#include "../kernel/pstat.h"
#include "user.h"
#define N_THREADS 5
#define X_SPIN 1e5
#define Y_SPIN 1e5
#define ITER_TOL 5
struct pstat ps;
int pid[N_THREADS], ind[N_THREADS];
long long aux;
long long spin() {
unsigned x = 0;
... |
pablomiralles22/deiso-xv6 | kernel/pstat.h | #ifndef _PSTAT_H_
#define _PSTAT_H_
#include "param.h"
struct pstat {
int inuse[NPROC]; // whether this slot of the process table is in use (1 or 0)
int tickets[NPROC]; // the number of tickets this process has
int pid[NPROC]; // the PID of each process
int ticks[NPROC]; // the number of ticks each p... |
pablomiralles22/deiso-xv6 | kernel/sysproc.c | <reponame>pablomiralles22/deiso-xv6
#include "types.h"
#include "riscv.h"
#include "defs.h"
#include "date.h"
#include "param.h"
#include "memlayout.h"
#include "spinlock.h"
#include "proc.h"
#include "pstat.h"
#include "vma.h"
uint64
sys_exit(void)
{
int n;
if(argint(0, &n) < 0)
return -1;
exit(n);
return... |
pablomiralles22/deiso-xv6 | kernel/types.h | <reponame>pablomiralles22/deiso-xv6
#ifndef TYPES_H
#define TYPES_H
typedef unsigned int uint;
typedef unsigned short ushort;
typedef unsigned char uchar;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long uint64;
typedef uint64 pde_t;
# ifndef __size_t... |
pablomiralles22/deiso-xv6 | kernel/vma.h | <reponame>pablomiralles22/deiso-xv6<gh_stars>0
#ifndef VMA_H
#define VMA_H
#include "defs.h"
#include "types.h"
#include "file.h"
#include "spinlock.h"
#include "param.h"
#include "vma_flags.h"
struct vma {
int used;
uint64 start;
uint64 length;
uint64 file_length;
struct file *file;
uint64 offset;
int ... |
ChristopherBilg/crb_shell | tests.c | <filename>tests.c<gh_stars>0
#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
#include "standard.h"
int main() {
printf("Enter some input: ");
char *test_input = read_input();
printf("Test Input: %s", test_input);
char **parsed_input = parse_input(test_input);
int parsed_input_size = count_argumen... |
ChristopherBilg/crb_shell | standard.h | <gh_stars>0
#ifndef STANDARD_H
#define STANDARD_H
#define SHELLNAME "crb_shell$ "
#define INPUT "<"
#define DOUBLE_INPUT "<<"
#define OUTPUT ">"
#define DOUBLE_OUTPUT ">>"
#define PIPE "|"
#define BACKGROUND "&"
void print_error();
int has_io_redirect(char **parsed_input);
int find_io_redirect_position(char **parsed_... |
ChristopherBilg/crb_shell | parser.c | #include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "parser.h"
#include "standard.h"
// This function will read the input from the user and return it as a char* (array)
char *read_input() {
char *input = NULL;
size_t input_buffer_size = 0;
getline(&input, &... |
ChristopherBilg/crb_shell | parser.h | <gh_stars>0
#ifndef PARSER_H
#define PARSER_H
#define BUFFER_SIZE 128
#define DELIMITER " \t\r\n\a"
char *read_input();
char **parse_input(char *input);
int count_arguments(char **parsed_input);
int run_cd(char **parsed_input);
int run_clr();
int run_dir(char **parsed_input);
int run_environ();
int run_echo(char **p... |
ChristopherBilg/crb_shell | main.c | #include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#include "main.h"
#include "parser.h"
#include "standard.h"
#define LINE_SIZE 1024
// The main function that is called when the program is started
int main(int argc, char **argv) {
// Check for ar... |
ChristopherBilg/crb_shell | standard.c | #include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "standard.h"
// Standard error message to print whenever an error occurs
// This is required by the project requirements.
void print_error() {
char error_message[30] = "An error has occurred\n";
write(STDERR_FILENO, error_message, strlen(error_mes... |
ChristopherBilg/crb_shell | main.h | <reponame>ChristopherBilg/crb_shell
#ifndef MAIN_H
#define MAIN_H
#include <stdbool.h>
int main();
int start_process(char **process_input, int input, int filedesc);
int run_execution(char **process_input);
int run_io_redirect(char **left_side_arguments,
char **right_side_arguments,
... |
andrewparlane/fiuba6633_lab_de_sistemas_digitales | micro/assembler/lsd_asm.c | <reponame>andrewparlane/fiuba6633_lab_de_sistemas_digitales
/**************************************************************************
Copyright (c) 2013
<NAME> (<EMAIL>)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... |
gniezen/PicoPicoSynth | picopicosynth.c | <reponame>gniezen/PicoPicoSynth<filename>picopicosynth.c
/**
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdio.h>
#include <math.h>
#include "bongo.h"
#if PICO_ON_DEVICE
#include "hardware/clocks.h"
#include "hardware/structs/clocks.h"
#endif
#include... |
kouxichao/ncnn | examples/print_data.h | #include <stdio.h>
int print_data(ncnn::Mat &indata, int startrow, int num_print, char* name = NULL)
{
printf("%s(dim:%d,c:%d,h:%d,w:%d):\n", name, indata.dims, indata.c,indata.h,indata.w);
int rows = num_print/indata.w;
int len;
for(size_t i = 0; i < rows + 1; i++)
{
printf("row_%d:\n", i)... |
kouxichao/ncnn | examples/crnn/text_recognization.h | <gh_stars>1-10
#ifndef TEXT_RECOGNIZATION_H
#define TEXT_RECOGNIZATION_H
typedef struct
{
//左上角开始顺时针点坐标
int x1;
int y1;
int x2;
int y2;
int x3;
int y3;
int x4;
int y4;
}DKSBox;
typedef struct
{
//等待添加
bool lexicon;
}DKSBoxTextRecognizationParam;
char* minDistan... |
kouxichao/ncnn | src/layer/lstmcell.h | <filename>src/layer/lstmcell.h
#ifndef LAYER_LSTMCell_H
#define LAYER_LSTMCell_H
#include "layer.h"
namespace ncnn {
class LSTMCell : public Layer
{
public:
LSTMCell();
virtual int load_param(const ParamDict& pd);
virtual int load_model(const ModelBin& mb);
virtual int forward(const std::vector<Ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.