repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
dodekja/heuristics | primary_insertion_best_benefit_item_limit/solver.h | #pragma once
#include "items.h"
#include "knapsack.h"
class solver
{
items* items_;
knapsack* knapsack_;
std::string prices_filename_;
std::string weights_filename_;
int carrying_capacity_;
int item_capacity_;
bool load();
bool validate_files(const std::string& weights_file, const std::string& pri... |
dodekja/heuristics | primary_insertion_best_benefit_item_limit/items.h | <reponame>dodekja/heuristics
#pragma once
#include <vector>
#include "knapsack_item.h"
class items
{
std::vector<knapsack_item*>* unchecked_items_;
std::vector<knapsack_item*>* not_inserted_items_;
public:
items();
void load(const std::string& weights_file, const std::string& prices_file) const;
kn... |
dodekja/heuristics | primary_insertion_best_benefit_item_limit/knapsack_item.h | #pragma once
#include <string>
class knapsack_item
{
const int price_;
const int weight_;
public:
knapsack_item(unsigned int price,unsigned int weight);
int get_price() const;
int get_weight() const;
double get_benefit() const;
std::string to_string() const;
~knapsack_item();
};
|
dodekja/heuristics | primary_insertion_best_benefit_item_limit/knapsack.h | #pragma once
#include <vector>
#include "knapsack_item.h"
class knapsack
{
int carrying_capacity_;
int item_capacity_;
int knapsack_price_;
std::vector<knapsack_item*>* knapsack_;
public:
knapsack(int carrying_capacity,int item_capacity);
int get_carrying_capacity() const {return carrying_capacity_... |
dongpo666/HBCategory | XHBCategory/NSString+Replace.h | //
// NSString+Replace.h
// BeautifulHome
//
// Created by 臧英振 on 16/8/14.
// Copyright © 2016年 ZYZ. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Replace)
//隐藏文字
+(NSString*)replacestr:(NSString*)BeforeReplacement range:(NSRange)range;
///是否是身份证号
+ (BOOL)validateIDCardNumber:(NSS... |
dongpo666/HBCategory | XHBCategory/UIAlertController+Alert.h |
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, OptionStyle) {
OptionStyleStyleOK_Cancel = 0,
OptionStyleStyleOnlyOK
};
@interface UIAlertController (Alert)
/// 中间弹窗
/// @param title 标题
/// @param message 消息
/// @param optionStyle 弹窗选项样式,两个选择或只有一个
/// @param okTitle 右边选项的文字
/// @param cancelTitle 左边选项的文字... |
dongpo666/HBCategory | XHBCategory/HBKitCategory.h |
#ifndef HBKitCategory
#define HBKitCategory
#import "UILabel+HBExtension.h"
#import "UIButton+HBExtension.h"
#import "UIImageView+HBExtension.h"
#import "UIBarButtonItem+HBExtension.h"
#import "UIView+Extension.h"
#import "UIBarButtonItem+HBExtension.h"
#import "UILabel+StringFrame.h"
#import "NSDictionary+GetValue.h"... |
dongpo666/HBCategory | XHBCategory/UIBarButtonItem+HBExtension.h | <filename>XHBCategory/UIBarButtonItem+HBExtension.h
#import <UIKit/UIKit.h>
@interface UIBarButtonItem (HBExtension)
/**
* 创建一个文字 item
*
* @param frame frame
* @param title 文字
* @param titleColor 文字颜色
* @param tapAction 回调
*/
+ (instancetype)hb_barButtonItemTitleWithFrame:(CGRect )frame
... |
dongpo666/HBCategory | XHBCategory/UIButton+TimerButton.h | <reponame>dongpo666/HBCategory
#import <UIKit/UIKit.h>
/**
* 计时器按钮
*/
@interface UIButton (TimerButton)
-(void)startTime;
@end
|
dongpo666/HBCategory | XHBCategory/UIImageView+HBExtension.h | <filename>XHBCategory/UIImageView+HBExtension.h
#import <UIKit/UIKit.h>
@interface UIImageView (HBExtension)
/**
* 创建 UIImageView
*
* @param frame 尺寸
* @param imageStr 图片名字(图片在项目中)
*/
+ (instancetype)hb_imageViewWithFrame:(CGRect)frame
imageStr:(NSString *)imageStr;
/**
* 创建 ... |
dongpo666/HBCategory | XHBCategory/UINavigationBar+Extension.h | <filename>XHBCategory/UINavigationBar+Extension.h
//
// UINavigationBar+Extension.h
// mixcloud
//
// Created by 东坡 on 2020/10/28.
// Copyright © 2020 Jovision. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UINavigationBar (Extension)
- (void)hh_setBackgroundColor:(UIColor *)... |
dongpo666/HBCategory | XHBCategory/UILabel+StringFrame.h | /*
*计算文本大小
*/
#import <UIKit/UIKit.h>
@interface UILabel (StringFrame)
- (CGSize)boundingRectWithSize:(CGSize)size;
/**
设置行间距和行缩进
@param text 设置文字
@param alignment alignment
@param headIndent 行缩进
@param firstLineHeadIndent 行首缩进
@param lineSpacing 行间距
*/
-(void)setPar... |
dongpo666/HBCategory | XHBCategory/UIScrollView+AllowPanGestureEventPass.h |
#import <UIKit/UIKit.h>
@interface UIScrollView (AllowPanGestureEventPass)<UIGestureRecognizerDelegate>
@end
|
dongpo666/HBCategory | XHBCategory/UIColor+HBCategory.h | <gh_stars>0
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIColor (HBCategory)
+ (UIColor *)tab_normalDynamicBackgroundColor;
+ (UIColor *)tab_getColorWithLightColor:(UIColor *)lightColor
darkColor:(UIColor * _Nullable)darkColor;
/// 主题色颜色
+ (UIColor *)themeTitleColor;
... |
dongpo666/HBCategory | XHBCategory/UIButton+HBExtension.h | <filename>XHBCategory/UIButton+HBExtension.h
#import <UIKit/UIKit.h>
typedef void(^TapButtonActionBlock) (UIButton *button);
@interface UIButton (HBExtension)
/**
* 快速创建文字Button
*
* @param frame frame
* @param title title
* @param font font
* @param backgroundColor 背景颜色
* @p... |
dongpo666/HBCategory | XHBCategory/NSData+Compression.h | <gh_stars>0
//
// NSData+Compression.h
// mixcloud
//
// Created by 东坡 on 2020/10/28.
// Copyright © 2020 Jovision. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/// 压缩和解压缩
@interface NSData (Compression)
/// 解压 gzip 数据
- (NSData *)hb_gzipInflate;
/// 以 gzip 压缩
- (NSData *)hb... |
dongpo666/HBCategory | XHBCategory/UILabel+HBExtension.h | <reponame>dongpo666/HBCategory<gh_stars>0
#import <UIKit/UIKit.h>
//#import <Masonry.h>
@interface UILabel (HBExtension)
/**
* 快速创建Label
*
* @param frame frame
* @param title 文字
* @param titleColor 文字颜色
* @param textAlignment 对齐方式
* @param font 字体
*/
+ (instancetype)hb_labelWit... |
dongpo666/HBCategory | XHBCategory/UIViewController+Dealloc.h | <filename>XHBCategory/UIViewController+Dealloc.h
//
// UIViewController+Dealloc.h
// RuntimeDemo
//
// Created by LeeJay on 16/8/8.
// Copyright © 2016年 LeeJay. All rights reserved.
// 代码下载地址https://github.com/leejayID/Linkage
#import <UIKit/UIKit.h>
@interface UIViewController (Dealloc)
@property(nonatomic, ass... |
dongpo666/HBCategory | XHBCategory/UIImage+ImageSize.h | <filename>XHBCategory/UIImage+ImageSize.h<gh_stars>0
#import <UIKit/UIKit.h>
@interface UIImage (ImageSize)
+ (CGSize)getImageSizeWithURL:(id)URL;
@end
|
dongpo666/HBCategory | XHBCategory/NSString+MD5Addition.h | <filename>XHBCategory/NSString+MD5Addition.h
#import <Foundation/Foundation.h>
@interface NSString(MD5Addition)
- (NSString *) stringFromMD5;
@end
|
dongpo666/HBCategory | XHBCategory/NSDictionary+GetValue.h | <gh_stars>0
#import <Foundation/Foundation.h>
@interface NSDictionary (GetValue)
/**
* 字符串转化
*
* @param newKey NSString
*
* @return NSString
*/
- (NSString *)getStringForKey:(NSString *)newKey;
/**
* Integer转化
*
* @param newKey NSString
*
* @return NSInteger
*/
- (NSInteger)getIntegerForKey:(NSString... |
IntarBV/MHZ16_uart | MHZ16_uart.h | /*
MHZ16_uart.h - MH-Z16 CO2 sensor library for ESP32
by <NAME>
version 0.1
License MIT
*/
#ifndef MHZ16_uart_h_
#define MHZ16_uart_h_
#include "Arduino.h"
#ifdef ARDUINO_ARCH_ESP32
#include "HardwareSerial.h"
#else
#include "SoftwareSerial.h"
#endif
#define PREHEAT_MS 180000
enum MHZ16_DATA {
PPM, TEM... |
ccawley2011/ngage-demo | src/main.c | <gh_stars>0
// Spdx-License-Identifier: MIT
#include "core.h"
int main(int argc, char *argv[])
{
int status = 0;
core_t *core = NULL;
if (CORE_ERROR == init_core("demo", &core))
{
status = -1;
goto quit;
}
load_map("E:\\demo.tmx", core);
while(CORE_OK == update_cor... |
ccawley2011/ngage-demo | src/tiled.c | // SPDX-License-Identifier: MIT
#include "stb_sprintf.h" /* libxml2 */
#include <SDL.h>
#include <tmx.h>
#include "core.h"
static void tmxlib_store_property(tmx_property* property, void* core);
Sint32 get_first_gid(tmx_map* tiled_map)
{
return (Sint32)tiled_map->ts_head->firstgid;
}
tmx_layer* get_head_layer(t... |
ccawley2011/ngage-demo | src/core.h | // Spdx-License-Identifier: MIT
#ifndef CORE_H
#define CORE_H
#include <SDL.h>
#include <tmx.h>
#ifndef FUNCTION_NAME
# if defined(__NGAGE__)
# define FUNCTION_NAME __FUNCTION__
# else
# define FUNCTION_NAME __func__
# endif
#endif
typedef enum
{
MAP_LAYER_BG = 0,
MAP_LAYER_FG,
MAP_LAYER_MAX
}... |
ccawley2011/ngage-demo | src/core.c | // Spdx-License-Identifier: MIT
#include <SDL.h>
#include "core.h"
status_t init_core(const char* title, core_t** core)
{
status_t status = CORE_OK;
*core = (core_t*)calloc(1, sizeof(struct core));
if (NULL == *core)
{
dbgprint("%s: error allocating memory.", __FUNCTION__);
return COR... |
jafrado/magdec | wmm/wmm_globe.c | /***
* Print out declination over the globe.
*
* Based on WMM 2020 GeomagnetismLibrary
*
*
* The WMM source code is in the public domain and not licensed or
* under copyright. The information and software may be used
* freely by the public. As required by 17 U.S.C. 403, third
* parties producing copyrighted... |
jafrado/magdec | magdec.c | <reponame>jafrado/magdec
#include <stdlib.h>
#include <stdio.h>
#include "magdec.h"
/**
* @brief Look up the magnetic compass declination angle at a given
* latitude/longitude for compass correction
*
* @param lat the latitude for the location to lookup (decimal degrees)
* @param lon the longitude for the ... |
jafrado/magdec | test.c | <reponame>jafrado/magdec
#include <stdlib.h>
#include <stdio.h>
#include "magdec.h"
/* Magdec location */
typedef struct location_s{
char* city;
char* state;
char* country;
float lat;
float lon;
} location_t;
location_t locations[] = {
{"Miam<NAME>", "FLA", "USA", 25.7907, -80.1300},
{"New York", "NY", "USA", ... |
jafrado/magdec | magdec.h | #ifndef __MAGDEC__H
#define __MAGDEC__H
/***
*
* @mainpage Magnetic Declination Corrector
*
* The World Magnetic Model is the standard model used by the
* U.S. Department of Defense, the U.K. Ministry of Defence, the North
* Atlantic Treaty Organization (NATO) and the International
* Hydrographic Organization ... |
jafrado/magdec | wmm/wmm_nav.c |
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include "GeomagnetismHeader.h"
#include "EGM9615.h"
char MAG_GeomagIntroduction_WMM(MAGtype_MagneticModel *MagneticModel,
char *VersionDate, char *ModelDate);
int main(int argc, char* argv[])
{
MAGtype_MagneticModel * MagneticModel... |
kunkunGit/KunCatogary | Example/CatogaryDemo/KunAppDelegate.h | //
// KunAppDelegate.h
// CatogaryDemo
//
// Created by kunkunGit on 10/26/2018.
// Copyright (c) 2018 kunkunGit. All rights reserved.
//
@import UIKit;
@interface KunAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
kunkunGit/KunCatogary | Example/CatogaryDemo/KunViewController.h | //
// KunViewController.h
// CatogaryDemo
//
// Created by kunkunGit on 10/26/2018.
// Copyright (c) 2018 kunkunGit. All rights reserved.
//
@import UIKit;
@interface KunViewController : UIViewController
@end
|
kunkunGit/KunCatogary | CatogaryDemo/Classes/UITextView/UITextView+Placeholder.h | //
// UITextView+Placeholder.h
// 自定义带placeholder的UITextView
//
// Created by 樊小聪 on 16/6/3.
// Copyright © 2016年 樊小聪. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UITextView (Placeholder)
/** 👀 placeholder的文字 👀 */
@property (copy, nonatomic) NSString *placeholder;
/** 👀 placeholder文字的颜色 👀 *... |
abanvill/42-Projects | 42-fdf/srcs/planes.c | <reponame>abanvill/42-Projects
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* planes.c ... |
abanvill/42-Projects | 42-fdf/srcs/vectors.c | <gh_stars>1-10
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* vectors.c :+: ... |
abanvill/42-Projects | 42-ping/srcs/addr.c | #include "../includes/ping.h"
/*
** Taking only the first result but can be enhanced to take any addresses
*/
static int register_addr_infos(t_ping *ping)
{
void *addr;
struct addrinfo *infos;
infos = ping->infos;
addr = ((void *)&((struct sockaddr_in *)infos->ai_addr)->sin_addr)... |
abanvill/42-Projects | 42-ping/srcs/icmp.c | #include "../includes/ping.h"
/*
** Must be enhanced to be ip version agnostic
*/
int create_icmp_header(t_ping *ping)
{
struct icmphdr *icmp;
unsigned long *data;
struct timeval start;
gettimeofday(&start, NULL);
data = (unsigned long *)&ping->ip.frame.hdr.data;
*data =... |
abanvill/42-Projects | 42-fdf/srcs/main.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/srcs/signals.c | #include "../includes/ping.h"
int bind_signals(void)
{
signal(SIGABRT, abort_callback);
signal(SIGKILL, kill_callback);
signal(SIGQUIT, quit_callback);
signal(SIGSTOP, term_callback);
signal(SIGALRM, alarm_callback);
signal(SIGINT, interrupt_callback);
return (1);
}
|
abanvill/42-Projects | 42-fdf/srcs/parse.c | <filename>42-fdf/srcs/parse.c<gh_stars>1-10
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parse.c ... |
abanvill/42-Projects | 42-ping/includes/ping.h | <reponame>abanvill/42-Projects<gh_stars>1-10
#ifndef _PING_H_
# define _PING_H_
# include <arpa/inet.h>
# include <netdb.h>
# include <netinet/if_ether.h>
# include <netinet/in.h>
# include <netinet/ip_icmp.h>
# include <signal.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <sys/socket.h>
#... |
abanvill/42-Projects | 42-ping/srcs/misc.c | <filename>42-ping/srcs/misc.c
#include "../includes/ping.h"
unsigned short inet_checksum(unsigned short *ptr, unsigned long checksum, size_t len)
{
size_t size;
size = (len % 2) ? ((len + 1) >> 1) : (len >> 1);
checksum = (checksum) ? checksum + 1 : checksum;
while (size--) {
checksum +=... |
abanvill/42-Projects | 42-ping/libs/libft/srcs/ft_itoa.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa.c :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/srcs/data.c | #include "../includes/ping.h"
static int init_stats_struct(t_stats *stats)
{
if (!stats) {
printf("init_stats_struct(): stats struct is null.\n");
return (0);
}
ft_memset(stats, 0, sizeof(t_stats));
return (1);
}
static int init_ip_struct(t_ip *ip)
{
if (!ip) {
printf("init_i... |
abanvill/42-Projects | 42-fdf/srcs/pixels.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pixels.c :+: :+: :+: ... |
abanvill/42-Projects | 42-fdf/srcs/init.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* init.c :+: :+: :+: ... |
abanvill/42-Projects | 42-fdf/includes/fdf.h | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fdf.h :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/srcs/main.c | <reponame>abanvill/42-Projects
#include "../includes/ping.h"
static int create_dependancies(t_ping *ping)
{
if (!(create_raw_socket(ping))) {
printf("create_dependancies(): ipv4 socket initialization failure.\n");
return (0);
}
if (!(create_icmp_header(ping))) {
printf("create_dependancies... |
abanvill/42-Projects | 42-fdf/srcs/lines.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* lines.c :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/srcs/print.c | <filename>42-ping/srcs/print.c
#include "../includes/ping.h"
static void print_human(void)
{
printf("\n");
printf("%4s, %-64s\n", "-t", "Set provided [ttl] in the IP header time-to-live value.");
printf("%4s, %-64s\n", "-v", "Showing the 'type' and the 'code' ICMP values as required in project subject.... |
abanvill/42-Projects | 42-fdf/srcs/hooks.c | <gh_stars>1-10
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* hooks.c :+: ... |
abanvill/42-Projects | 42-ping/srcs/time.c | #include "../includes/ping.h"
void update_triptime(t_ping *ping)
{
struct timeval res;
unsigned long tt;
res = get_time(&ping->stats.transmitted_at, &ping->stats.acknowledged_at);
tt = get_triptime(&res) & 0xFFFFFFFF;
ping->stats.tottt += tt & 0xFFFFFFFFFFFFFFFF;
ping->stats.s... |
abanvill/42-Projects | 42-ping/libs/libft/srcs/ft_flagparse.work.c | <gh_stars>1-10
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_flagparse.work.c :+: ... |
abanvill/42-Projects | 42-ping/libs/libft/srcs/ft_options.work.c | <reponame>abanvill/42-Projects
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_options.work.c ... |
abanvill/42-Projects | 42-libftasm/main.c | <filename>42-libftasm/main.c
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c ... |
abanvill/42-Projects | 42-ping/libs/libft/srcs/ft_lstmap.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstmap.c :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/libs/libft/srcs/ft_lstnew.c | <reponame>abanvill/42-Projects
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c ... |
abanvill/42-Projects | 42-ping/srcs/callbacks.c | <reponame>abanvill/42-Projects
#include "../includes/ping.h"
void alarm_callback(int signbr) {
t_ping *ping;
(void)signbr;
ping = require_data();
if (ping->opts.flag.deadline) {
ping->opts.deadline--;
if (ping->opts.deadline == 0xFFFFFFFF) {
print_outro(ping);
... |
abanvill/42-Projects | 42-fdf/srcs/map.c | <filename>42-fdf/srcs/map.c<gh_stars>1-10
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* map.c ... |
abanvill/42-Projects | 42-fdf/srcs/program.c | <gh_stars>1-10
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* program.c :+: ... |
abanvill/42-Projects | 42-ping/srcs/options.c | <filename>42-ping/srcs/options.c
#include "../includes/ping.h"
static int option_packet_size(t_ping *ping, char *arg)
{
int res;
if (!arg) {
print_usage(ping->pname);
return (0);
}
if ((res = ft_atoi(arg)) > 0xFFFF - (8 - 1)) {
printf("%s: packet size too large: %d\n", p... |
abanvill/42-Projects | 42-ping/libs/libft/srcs/ft_monitor.work.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_monitor.work.c :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/srcs/ip.c | #include "../includes/ping.h"
int create_ip_header(t_ping *ping)
{
struct iphdr *in;
struct addrinfo *infos;
infos = ping->infos;
in = &ping->ip.frame.hdr.ip;
in->ihl = IPV4_HEADER_LENGTH;
in->version = ping->ip.type;
in->id = ping->pid & 0xFFFF;
in->protocol = IPPROTO_ICMP;
... |
abanvill/42-Projects | 42-ping/srcs/sockets.c | <filename>42-ping/srcs/sockets.c<gh_stars>1-10
#include "../includes/ping.h"
int create_raw_socket(t_ping *ping)
{
int sockfd, sockopt;
t_ip *ip;
ip = &ping->ip;
sockfd = 0x00;
if ((sockfd = socket(ip->domain, SOCK_RAW, IPPROTO_ICMP)) == -1) {
printf("init_raw_soc... |
abanvill/42-Projects | 42-libftasm/includes/libfta.h | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libfta.h :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/libs/libft/srcs/ft_readline.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_readline.c :+: :+: :+: ... |
abanvill/42-Projects | 42-fdf/srcs/process.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* process.c :+: :+: :+: ... |
abanvill/42-Projects | 42-ping/srcs/network.c | <gh_stars>1-10
#include "../includes/ping.h"
void send_packet(t_ping *ping)
{
int fd;
int data_sended;
unsigned int data_length;
char *data;
if (ping->opts.flag.count && !ping->opts.count) {
print_outro(ping);
exit(EXIT_SUCCESS);... |
abanvill/42-Projects | 42-fdf/srcs/commands.c | <filename>42-fdf/srcs/commands.c
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* commands.c ... |
abanvill/42-Projects | 42-ping/srcs/stats.c | #include "../includes/ping.h"
void update_total_time(t_ping *ping)
{
struct timeval current;
gettimeofday(¤t, NULL);
ping->stats.total_time += get_milliseconds(&ping->stats.triggered_at, ¤t);
}
void update_stats(t_ping *ping, u_int8_t type)
{
gettimeofday(&p... |
RaisedBar/SurfaceReader | DispatchQueue.h | // DispatchQueue.h
// Asynchronous despatch queue
// https://embeddedartistry.com/blog/2017/2/1/c11-implementing-a-dispatch-queue-using-stdfunction
#ifndef DISPATCH_QUEUE_H
#define DISPATCH_QUEUE_H
#include <thread>
#include <functional>
#include <queue>
#include <mutex>
#include <condition_variable>
class disp... |
RaisedBar/SurfaceReader | RBInputBox.h | // RBInputBox.h
// Simple prompt/text box dialog
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
#ifndef RBINPUTBOX_H
#define RBINPUTBOX_H
#pragma once
#include "RBEnums.h"
#include "SRConstants.h"
#include <wx/dialog.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#in... |
RaisedBar/SurfaceReader | SurfaceList.h | <reponame>RaisedBar/SurfaceReader
// SurfaceList.h
// Derived from wxListBox
// #define _SCL_SECURE_NO_WARNINGS
#ifndef SURFACE_LIST_H
#define SURFACE_LIST_H
#pragma once
// #include <vector>
#include "DisplayReportDlg.h"
#include "ProtocolCollection.h"
#include "MIDISurface.h"
#include "DisplayDefinition.h"
#inc... |
RaisedBar/SurfaceReader | ActionsPageMac.h | <reponame>RaisedBar/SurfaceReader
// ActionsPageMac.hpp
// Definition for the Apple Mac version of the ActionsPage class, part of the AppConfigWizard
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
#ifndef ACTIONS_PAGE_MAC_H
#define ACTIONS_PAGE_MAC_H
#pragma once
#include <wx/platform.h>
#ifdef ... |
RaisedBar/SurfaceReader | MIDI.h | // MIDI.h
// definition of the MIDI class
// #define _SCL_SECURE_NO_WARNINGS
#ifndef MIDI_H
#define MIDI_H
#pragma once
#include <string>
#include <vector>
#include "SRConstants.h"
#include "RBStringFuncs.h"
#include <wx/string.h>
#include <wx/msw/winundef.h>
#include <boost/lexical_cast.hpp>
using boost::bad_... |
RaisedBar/SurfaceReader | DisplaysPage.h | // DisplaysPage.h
// Definition for the DisplaysPage class, part of the AppConfigWizard
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
// #define _SCL_SECURE_NO_WARNINGS
#ifndef DISPLAYS_PAGE_H
#define DISPLAYS_PAGE_H
#pragma once
#include <map>
#include "RBEnums.h"
#include "RBInputBox.h"
#inc... |
RaisedBar/SurfaceReader | MIDIWidget.h | // MIDIWidget.h
//MidiWidget class.
//note: all functions are inlined where possible.
// #define _SCL_SECURE_NO_WARNINGS
#ifndef MIDIWIDGET_H
#define MIDIWIDGET_H
#pragma once
#include <vector>
#include <string>
#include "SRConstants.h"
#include "RBException.h"
#include "MIDI.h"
#include <RtMidi.h>
#include <bo... |
RaisedBar/SurfaceReader | Serializer.h | <gh_stars>0
//Serializer.h
// Serialization/DeSerialization for the mdr.
//Copyright (©) <NAME>/<NAME>, 2010-2012, All Rights Reserved.
#ifndef MDRSERIALIZER_H
#define MDRSERIALIZER_H
#pragma once
//Includes:
//Standard c++ headers.
#include <stdlib.h>
#include <string>
#include <iostream>
#include <fstream>
#inclu... |
RaisedBar/SurfaceReader | ParseIniFile.h | <reponame>RaisedBar/SurfaceReader<filename>ParseIniFile.h
// ParseIniFile.h
#ifndef PARSEINIFILE_H
#define PARSEINIFILE_H
//parse ini file. allows us to parse both ConfigNames.ini and any hsc file.
//includes:
#pragma once
#include <stdlib.h>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_... |
RaisedBar/SurfaceReader | ActionPickerWin.h | <reponame>RaisedBar/SurfaceReader
// ActionPickerWin.h
// Definition for the ActionPicker class
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
// #define _SCL_SECURE_NO_WARNINGS
#ifndef ACTION_PICKER_WIN_H
#define ACTION_PICKER_WIN_H
#pragma once
#include "AppConfig.h"
#include "DisplayParamsDl... |
RaisedBar/SurfaceReader | RBTextCtrl.h | // RBTextCtrl.h
// Text control that allows itself to show up in the Tab order when using the read-only style
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
#ifndef RBTextCtrl_H
#define RBTextCtrl_H
#pragma once
#include <wx/textctrl.h>
#include <wx/msw/winundef.h>
class RBTextCtrl: public wxTe... |
RaisedBar/SurfaceReader | WIX Include.h | #ifndef WIXINCLUDE_H
#define WIXINCLUDE_H
#pragma once
//wix includes:
#include <dutil.h>
//macros to extend the wix system, to exit on false and exit if values are equal or not equal to a given value.
#define ExitOnFalse(v, x, e, s) if (v ==false) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); ExitTrace(x, s); ... |
RaisedBar/SurfaceReader | DisplayDefinition.h | // DisplayDefinition.h
//DisplayDefinition Class.
// #define _SCL_SECURE_NO_WARNINGS
#ifndef DISPLAYDEF_H
#define DISPLAYDEF_H
#pragma once
#include "MessageDefinition.h"
#include "MIDI.h"
class DisplayDefinition: public MessageDefinition
{
public:
DisplayDefinition();
DisplayDefinition( bool blnIsLED);
~Disp... |
RaisedBar/SurfaceReader | SRConstants.h | <filename>SRConstants.h
// SRConstants.h
#ifndef SR_CONSTANTS_H
#define SR_CONSTANTS_H
#pragma once
#include <string>
#include <wx/string.h>
#include <wx/msw/winundef.h>
// String constants
const std::string strEmpty = "";
const std::wstring wstrEmpty = L"";
const std::string strNoteOn = "144";
const std::strin... |
RaisedBar/SurfaceReader | DisplayParamsDlg.h | <reponame>RaisedBar/SurfaceReader<gh_stars>0
// DisplayParamsDlg.h
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
// #define _SCL_SECURE_NO_WARNINGS
#ifndef DISPLAY_PARAMS_DLG_H
#define DISPLAY_PARAMS_DLG_H
#pragma once
#include "RBEnums.h"
#include "SRConstants.h"
#include "AppConfig.h"
#include... |
RaisedBar/SurfaceReader | SurfaceAction.h | // SurfaceAction.h
//Response to surface events
// #define _SCL_SECURE_NO_WARNINGS
#ifndef SURFACE_ACTION_H
#define SURFACE_ACTION_H
#pragma once
//#include <string>
//#include <vector>
#include "RBEnums.h"
#include "RBSpeech.h"
//Serialization headers.
//#include <boost/serialization/string.hpp>
//#include <boo... |
RaisedBar/SurfaceReader | TextDisplaysPage.h | <reponame>RaisedBar/SurfaceReader<filename>TextDisplaysPage.h
// TextDisplaysPage.h
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
// #define _SCL_SECURE_NO_WARNINGS
#ifndef TEXT_DISPLAYS_MESSAGESPAGE_H
#define TEXT_DISPLAYS_MESSAGESPAGE_H
#pragma once
#include <map>
#include <boost/shared_ptr.h... |
RaisedBar/SurfaceReader | SpeechDialog.h | <filename>SpeechDialog.h<gh_stars>0
// SpeechDialog.h
// Custom dialog class definition for the selection of Mac speech parameters
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
#ifndef SPEECH_DIALOG_H
#define SPEECH_DIALOG_H
#pragma once
#include <wx/platform.h>
#ifdef __WXOSX_COCOA__
#include <... |
RaisedBar/SurfaceReader | SurfaceWizard.h | // SurfaceWizard.h
// #define _SCL_SECURE_NO_WARNINGS
#ifndef SURFACE_WIZARD_H
#define SURFACE_WIZARD_H
#pragma once
#include <boost/shared_ptr.hpp>
#include "SurfacePage.h"
#include "ProtocolCollection.h"
#include "SurfaceReaderHelp.h"
//#include <wx/frame.h>
//#include <wx/menu.h>
#include <wx/wizard.h>
//#incl... |
RaisedBar/SurfaceReader | RBWizardPage.h | // RBWizardPage.h
// Custom dialog class definition for a page of a multi-page wizard
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
#ifndef RBWIZARDPAGE_H
#define RBWIZARDPAGE_H
#pragma once
#include <wx/dialog.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include "RBEnums.h"
#include "SRCon... |
RaisedBar/SurfaceReader | ActionPickerModels.h | <filename>ActionPickerModels.h
// ActionPickerModels.hpp
#ifndef ACTION_PICKER_MODELS_H
#define ACTION_PICKER_MODELS_H
#pragma once
#include <wx/platform.h>
#ifdef __WXOSX_COCOA__
#include "AppConfig.h"
#include "MessageDefinition.h"
#include "RBStringFuncs.h"
#include "SRConstants.h"
#include "RBException.h"
#in... |
RaisedBar/SurfaceReader | ControlStatesDialog.h | // ControlStatesDialog.h
// Custom dialog class definition for defining MIDI message state labels
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
#ifndef CONTROL_STATES_DLG_H
#define CONTROL_STATES_DLG_H
#pragma once
#include <vector>
#include "DefineStateDialog.h"
#include "MessageDefinition.h"
... |
RaisedBar/SurfaceReader | MessageDefinition.h | // MessageDefinition.h
//MessageDefinition Class.
// #define _SCL_SECURE_NO_WARNINGS
#ifndef MSGDEF_H
#define MSGDEF_H
#pragma once
#include "SurfaceActions.h"
class MessageDefinition
{
public:
MessageDefinition();
MessageDefinition( std::wstring wstrNewLabel);
~MessageDefinition();
std::wstring GetLabel();
... |
RaisedBar/SurfaceReader | ProtocolCollection.h | <reponame>RaisedBar/SurfaceReader
// ProtocolCollection.h
// #define _SCL_SECURE_NO_WARNINGS
#ifndef PROTOCOL_COLLECTION_H
#define PROTOCOL_COLLECTION_H
#pragma once
#include "Protocol.h"
//ProtocolCollection class, holding Protocols.
class ProtocolCollection
{
private:
std::map <std::string, SurfaceProtocol> my... |
RaisedBar/SurfaceReader | ScreenReaderFunctionsDlg.h | <reponame>RaisedBar/SurfaceReader<filename>ScreenReaderFunctionsDlg.h
// ScreenReaderFunctionsDlg.h
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
// #define _SCL_SECURE_NO_WARNINGS
#ifndef SCREEN_READER_FUNCTIONS_DLG_H
#define SCREEN_READER_FUNCTIONS_DLG_H
#pragma once
#include "RBSpeech.h"
#inc... |
RaisedBar/SurfaceReader | RBSpeechCocoa.h | //RBSpeechCocoa.h: speech utilities class header file.
//Copyright (�) 2012 Raised Bar Ltd.
#ifndef RB_SPEECH_COCOA_H
#define RB_SPEECH_COCOA_H
#pragma once
#ifdef __WXOSX_COCOA__
typedef long HRESULT;
// typedef bool BOOL;
struct SpeechSynthesizerImpl;
/* Pre-defined success HRESULTS */
#define S_OK ((HRESULT)0... |
RaisedBar/SurfaceReader | AppConfig.h | // AppConfig.h
//AppConfig and related Classes
// #define _SCL_SECURE_NO_WARNINGS
#ifndef APPCONFIG_H
#define APPCONFIG_H
#pragma once
#include "Protocol.h"
class AppConfig
{
public:
AppConfig();
~AppConfig();
// Setters and getters
void SetAppName( std::wstring wstrName);
std::wstring GetAppName() const;
v... |
RaisedBar/SurfaceReader | SysExPage.h | // SysExPage.h
// Custom dialog class definition for the System Exclusive page of the control surface protocol definition wizard
// Author: <NAME>
// Raised Bar Ltd.
// http://www.raisedbar.net
// #define _SCL_SECURE_NO_WARNINGS
#ifndef PROTOCOLSYSEXPAGE_H
#define PROTOCOLSYSEXPAGE_H
#pragma once
#include <vector... |
RaisedBar/SurfaceReader | ParseJsdFile.h | // ParseJSDFile.h
#include <boost/config/warning_disable.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_object.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.