repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
pacolang/paco | core/console/console.c | #include <stdio.h>
#include <stdlib.h>
#include "console.h"
// println prints the given message with a line break after
void println(const char *message) {
puts(message);
}
// print prints the given message without a line break after
void print(const char *message) {
printf("%s", message);
}
// getStringEntry re... |
pacolang/paco | core/strings/strings.h | <gh_stars>10-100
#ifndef PACO_STRINGS_H
#define PACO_STRINGS_H
int contains(const char *str, const char *substr);
int startsWith(const char *str, const char *substr);
int endsWith(const char *str, const char *substr);
char* toLower(const char *str);
char* toUpper(const char *str);
#endif //PACO_STRINGS_H
|
pacolang/paco | core/random/random.h | #ifndef PACO_RANDOM_H
#define PACO_RANDOM_H
int randInt(int upper);
char* randString(int length);
#endif //PACO_RANDOM_H
|
pacolang/paco | core/console/console.h | <filename>core/console/console.h
#ifndef PACO_CONSOLE_H
#define PACO_CONSOLE_H
void println(const char *message);
void print(const char *message);
char* getStringEntry();
int getIntEntry();
#endif //PACO_CONSOLE_H
|
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/backup/UUIDGenerator.h | #include "random.h"
class UUIDGenerator
{
struct UUID
{
unsigned Node;//16 bits
unsigned long long TimeEpoch; //52 bits
unsigned long long RandomNumber; //60 bits
};
public:
UUIDGenerator();
~UUIDGenerator();
char* GenerateUUID(bool bPrettyPrint=true);
protected:
void SetTimeEpoch();
void SetRandomN... |
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/void_callback.h | <gh_stars>1-10
#ifndef VOIDCALLBACK_H_
#define VOIDCALLBACK_H_
#include "function.h"
typedef Function<void(void)> VoidCallback;
#endif
|
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/backup/subscription.h |
#include "unique_ptr.h"
#include "vector.h"
struct find_if_fn {
template< std::input_iterator I, std::sentinel_for<I> S,
class Proj = std::identity,
std::indirect_unary_predicate<std::projected<I, Proj>> Pred >
constexpr I operator()( I first, S last, Pred pred, Proj proj = {} ) const
{... |
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/project_interface.h |
#include "arduino_interface.h"
class ProjectInterface {
private:
ArduinoInterface* arduino;
char* project_guid;
int project_type_id;
int response_version;
ProjectInterface** remote_projects;
SemaphoreHandle_t remote_projects_semaphore;
int remote_projects_total;
HostInterface* host;
... |
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/arduino_interface.h | <reponame>AustinHellerRepo/ArduinoBluetoothInterface
#include "host_interface.h"
#include <Arduino_FreeRTOS.h>
#include <semphr.h>
#include "void_callback.h"
struct HostConnectionResult {
bool is_successful;
HostInterface host;
};
struct process_command_output {
int command_id;
bool is_successful;
int value... |
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/unique_ptr.h | #ifndef UNIQUEPTR_H_
#define UNIQUEPTR_H_
template<typename T> class UniquePtr {
public:
UniquePtr(T* t) : _ptr(t) {}
UniquePtr() : UniquePtr(nullptr) {}
template <class OtherType>
UniquePtr(UniquePtr<OtherType>& other) : _ptr(other._unsafe_get()) {
other._unsafe_set(nullptr);
}
template <class Oth... |
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/helper.h | <gh_stars>1-10
int split(const char *str, char c, char ***arr);
char* generate_guid();
char get_random_hex_value();
|
AustinHellerRepo/ArduinoBluetoothInterface | frameworks/arduino/v1/test_api_interface/api_interface.h | <filename>frameworks/arduino/v1/test_api_interface/api_interface.h
#include <ArduinoJson.h>
enum MethodTypeEnum {
Get,
Post
}
class ApiInterface {
private:
JsonObject get_json_result_from_url(MethodTypeEnum methodType, char* url, JsonObject arguments_json_object);
char* get_formatted_url(char* url_part... |
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/vector.h | <reponame>AustinHellerRepo/ArduinoBluetoothInterface
#ifndef VECTOR_H_
#define VECTOR_H_
template <class Ty>
class Vector {
public:
typedef unsigned Size;
#define ScaleFactor 1.75;
Vector(Size initialCpacity = 5) {
firstElement = afterLastElement = new Ty[initialCpacity];
capacity = initialCpacity;
}
... |
AustinHellerRepo/ArduinoBluetoothInterface | bluetooth_interface/host_interface.h |
class HostInterface {
public:
void send_message_to_project(char* message, char* project_guid);
void send_message_to_server(char* message);
};
|
yeyutinglou/DYWCategory | Example/DYWCategory/DYWAppDelegate.h | <filename>Example/DYWCategory/DYWAppDelegate.h
//
// DYWAppDelegate.h
// DYWCategory
//
// Created by yeyutinglou on 11/19/2021.
// Copyright (c) 2021 yeyutinglou. All rights reserved.
//
@import UIKit;
@interface DYWAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window... |
yeyutinglou/DYWCategory | DYWCategory/Classes/UISegmentedControl+DYWExtension.h |
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UISegmentedControl (DYWExtension)
- (void)ensureiOS12Style:(UIColor *)color;
@end
NS_ASSUME_NONNULL_END
|
yeyutinglou/DYWCategory | DYWCategory/Classes/DYWCategory.h | <reponame>yeyutinglou/DYWCategory<gh_stars>0
#ifndef Category_h
#define Category_h
#import "UIColor+DYWExtension.h"
#import "NSDate+DYWExtension.h"
#import "NSDictionary+DYWCategory.h"
#import "NSObject+DYWIntrospection.h"
#import "NSObject+DYWPropertyLog.h"
#import "NSObject+DYWModel.h"
#import "NSObject+DYWSwizzling... |
yeyutinglou/DYWCategory | DYWCategory/Classes/UIImage+DYWExtension.h | <filename>DYWCategory/Classes/UIImage+DYWExtension.h
#import <UIKit/UIKit.h>
@interface UIImage (DYWExtension)
+ (UIImage *)imageWithColor:(UIColor *)color;
/**
* 图片由颜色值生成
*
* @param color 颜色
* @param size 图片大小
*
* @return image 一张新的图片
*/
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size... |
yeyutinglou/DYWCategory | DYWCategory/Classes/UIView+DYWBorder.h |
#import <Foundation/Foundation.h>
typedef NS_OPTIONS(NSUInteger, UIViewBorder) {
UIViewBorderNone = 0,
UIViewBorderLeft = 1 << 0,
UIViewBorderRight = 1 << 1,
UIViewBorderTop = 1 << 2,
UIViewBorderBottom = 1 << 3
};
@interface UIView(DYWBorder)
- (void)addBoard:(UIViewBorder)boarderType ... |
yeyutinglou/DYWCategory | DYWCategory/Classes/UIButton+DYWSwizzling.h |
#import <UIKit/UIKit.h>
@interface UIButton (DYWSwizzling)
@end
|
yeyutinglou/DYWCategory | Example/DYWCategory/DYWViewController.h | <gh_stars>0
//
// DYWViewController.h
// DYWCategory
//
// Created by yeyutinglou on 11/19/2021.
// Copyright (c) 2021 yeyutinglou. All rights reserved.
//
@import UIKit;
@interface DYWViewController : UIViewController
@end
|
yeyutinglou/DYWCategory | DYWCategory/Classes/NSObject+DYWModel.h |
#import <Foundation/Foundation.h>
@interface NSObject (DYWModel)
///数组转模型
+ (NSArray *_Nullable)modelWithJson:(id _Nullable )json;
///字典转模型
+ (instancetype _Nullable )modelWithDic:(NSDictionary *_Nullable)dic;
@end
|
yeyutinglou/DYWCategory | DYWCategory/Classes/NSObject+DYWSwizzling.h | <reponame>yeyutinglou/DYWCategory<gh_stars>0
#import <Foundation/Foundation.h>
@interface NSObject (DYWSwizzling)
+ (void)DYW_methodSwizlingWithOriginalSelector:(SEL)originalSelector
swizzledSelector:(SEL)swizzledSelector;
@end
|
yeyutinglou/DYWCategory | DYWCategory/Classes/UILabel+DYWExtension.h | <filename>DYWCategory/Classes/UILabel+DYWExtension.h
#import <UIKit/UIKit.h>
@interface UILabel (DYWExtension)
-(CGFloat)adaptLabelHeight;
-(CGFloat)adaptLabelWidth;
/** 富文本 */
- (void)richTextWithFont:(UIFont *)font range:(NSRange)range color:(UIColor *)color;
@end
|
yeyutinglou/DYWCategory | DYWCategory/Classes/UIViewController+DYWExtension.h |
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIViewController (DYWExtension)
@end
NS_ASSUME_NONNULL_END
|
yeyutinglou/DYWCategory | DYWCategory/Classes/UIViewController+DYWChild.h | <filename>DYWCategory/Classes/UIViewController+DYWChild.h
#import <UIKit/UIKit.h>
@interface UIViewController (DYWChild)
-(void)displayViewController:(UIViewController *)viewController view:(UIView *)view;
-(void)showBackBtn;
-(void)back;
@end
|
yeyutinglou/DYWCategory | DYWCategory/Classes/NSString+DYWExtension.h | <reponame>yeyutinglou/DYWCategory<filename>DYWCategory/Classes/NSString+DYWExtension.h<gh_stars>0
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface NSString (DYWExtension)
/// 字符串是否合法
- (BOOL) isValid;
/**
* 计算文字宽度
*/
-(CGSize)sizeWidth;
-(CGSize)sizeWidthFont:(UIFont *)font size:(CGSize )si... |
yeyutinglou/DYWCategory | DYWCategory/Classes/UIView+DYWExtension.h | <filename>DYWCategory/Classes/UIView+DYWExtension.h
#import <UIKit/UIKit.h>
@interface UIView (DYWExtension)
@property(nonatomic, assign) CGFloat left;
@property(nonatomic, assign) CGFloat top;
@property(nonatomic, assign) CGFloat right;
@property(nonatomic, assign) CGFloat bottom;
@property(nonatomic, assign) CGFl... |
yeyutinglou/DYWCategory | DYWCategory/Classes/UIColor+DYWExtension.h | <reponame>yeyutinglou/DYWCategory
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIColor (DYWExtension)
+ (UIColor *)colorWithHex:(long)hex;
+ (UIColor *)colorWithHex:(long)hex alpha:(float)alpha;
@end
NS_ASSUME_NONNULL_END
|
yeyutinglou/DYWCategory | DYWCategory/Classes/NSObject+DYWPropertyLog.h |
#import <Foundation/Foundation.h>
@interface NSObject (DYWPropertyLog)
///打印属性字符串
+ (void)resolveDic:(NSDictionary *)dic;
@end
|
yeyutinglou/DYWCategory | DYWCategory/Classes/NSDictionary+DYWCategory.h |
#import <Foundation/Foundation.h>
@interface NSDictionary (DYWCategory)
+ (NSDictionary *)removeTheSymbolWith:(NSData *)data;
/**
字典转模型
@param object 模型
@return 字典
*/
+ (NSDictionary *)dicFromModel:(NSObject *)object;
@end
|
yeyutinglou/DYWCategory | DYWCategory/Classes/UINavigationController+DYWExtension.h | <gh_stars>0
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UINavigationController (DYWExtension) <UIGestureRecognizerDelegate>
@end
NS_ASSUME_NONNULL_END
|
natew/electron | shell/common/gin_helper/object_template_builder.h | <gh_stars>1-10
// Copyright (c) 2019 GitHub, Inc. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_COMMON_GIN_HELPER_OBJECT_TEMPLATE_BUILDER_H_
#define SHELL_COMMON_GIN_HELPER_OBJECT_TEMPLATE_BUILDER_H_
#include "shell/common/gin_he... |
fanlilinSaber/MSTRnMMA | Sources/Manager/MMAEmitEventManager.h | //
// MMAEmitEventManager.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/3.
// Copyright © 2019 puwang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <React/RCTEventEmitter.h>
NS_ASSUME_NONNULL_BEGIN
@interface MMAEmitEventManager : RCTEventEmitter
- (void)send:(NSDictionary *)data;
@end
... |
fanlilinSaber/MSTRnMMA | MSTRnMMA IOS Example/MSTRNView.h | <reponame>fanlilinSaber/MSTRnMMA
//
// MSTRNView.h
// MSTRnMMA IOS Example
//
// Created by <NAME> on 2019/7/5.
// Copyright © 2019 puwang. All rights reserved.
//
#import <MSTRnMMA/MSTRnMMA.h>
NS_ASSUME_NONNULL_BEGIN
@interface MSTRNView : MMAView
@end
NS_ASSUME_NONNULL_END
|
fanlilinSaber/MSTRnMMA | Sources/UI/MMAViewController.h | //
// MMAViewController.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/3.
// Copyright © 2019 puwang. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol MMACommandSendable, MMAResponseManagerDelegate;
@class PWCommand;
@interface MMAViewController : UIViewController
@property (weak, nonatomic) id<MMARes... |
fanlilinSaber/MSTRnMMA | Sources/Commmand/MMACommand.h | //
// MMACommand.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/4.
// Copyright © 2019 puwang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Pineapple/PWCommand.h>
// 发送协议 自定义 command 必须实现
@protocol MMACommandSendable <PWCommandSendable>
@end
// 接收协议 自定义 command 必须实现
@protocol MMACommandRe... |
fanlilinSaber/MSTRnMMA | MMACommand/MMAPhotoCommand.h | <reponame>fanlilinSaber/MSTRnMMA
//
// MMAPhotoCommand.h
// RNTest
//
// Created by <NAME> on 2019/7/8.
// Copyright © 2019 puwang. All rights reserved.
//
#import "MMACommand.h"
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MMAPhotoCommand : MMACommand <MMACommandSendable, MMACommandReceivable>
/*... |
fanlilinSaber/MSTRnMMA | Sources/MSTRnMMA.h | //
// MSTRnMMA.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/3.
// Copyright © 2019 puwang. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for MSTRnMMA.
FOUNDATION_EXPORT double MSTRnMMAVersionNumber;
//! Project version string for MSTRnMMA.
FOUNDATION_EXPORT const unsigned char MST... |
fanlilinSaber/MSTRnMMA | Sources/Manager/MMAResponseManager.h | //
// MMAResponseManager.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/3.
// Copyright © 2019 puwang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTBridge.h>
@class PWCommand;
// MMA 和 IOS 消息 delegate
@protocol MMAResponseManagerDelegate <NSObject... |
fanlilinSaber/MSTRnMMA | MSTRnMMA IOS Example/ViewController.h | <reponame>fanlilinSaber/MSTRnMMA
//
// ViewController.h
// MSTRnMMA IOS Example
//
// Created by <NAME> on 2019/7/3.
// Copyright © 2019 puwang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
fanlilinSaber/MSTRnMMA | Sources/Manager/MMAManager.h | //
// MMAManager.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/5.
// Copyright © 2019 puwang. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol MMACommandSendable;
@class MMAAbility, RCTBridge, PWCommand;
@interface MMAManager : NSObject
/*&* 解析和转换对应实体对象的关键 ability */
@property (nonatomic, st... |
fanlilinSaber/MSTRnMMA | MSTRnMMA IOS Example/MSTScanViewController.h | //
// MSTScanViewController.h
// MSTRnMMA IOS Example
//
// Created by <NAME> on 2019/7/9.
// Copyright © 2019 puwang. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MSTScanViewController : UIViewController
/*&* <##> */
@property (nonatomic, copy) void(^blockForScanResult)(NSS... |
fanlilinSaber/MSTRnMMA | MMACommand/MMAARCommand.h | //
// MSTARCommand.h
// MARS
//
// Created by <NAME> on 2019/7/16.
// Copyright © 2019 puwang. All rights reserved.
//
#import "MMACommand.h"
NS_ASSUME_NONNULL_BEGIN
@interface MMAARCommand : MMACommand <MMACommandSendable, MMACommandReceivable>
@end
NS_ASSUME_NONNULL_END
|
fanlilinSaber/MSTRnMMA | Sources/Commmand/MMACloseRequestCommand.h | <reponame>fanlilinSaber/MSTRnMMA
//
// MMACloseRequestCommand.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/11.
// Copyright © 2019 puwang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "MMACommand.h"
NS_ASSUME_NONNULL_BEGIN
// MMA 主动关闭页面协议
@interface MMACloseRequestCommand : MMACommand <MM... |
fanlilinSaber/MSTRnMMA | Sources/Manager/MMABridgeManager.h | //
// MMABridgeManager.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/3.
// Copyright © 2019 puwang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <React/RCTBridge.h>
@protocol MMACommandSendable;
@class PWCommand, MMAViewController;
@interface MMABridgeManager : RCTBridge
- (instancetype)i... |
fanlilinSaber/MSTRnMMA | MMACommand/MMAQRCommand.h | //
// MMAQRCommand.h
// RNTest
//
// Created by <NAME> on 2019/7/8.
// Copyright © 2019 puwang. All rights reserved.
//
#import "MMACommand.h"
NS_ASSUME_NONNULL_BEGIN
@interface MMAQRCommand : MMACommand <MMACommandSendable, MMACommandReceivable>
/**
回复给RN的二维码识别协议
@param content 识别的内容
@return MMAQRCommand
... |
fanlilinSaber/MSTRnMMA | Sources/Manager/MMAAbility.h | //
// MMAAbility.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/4.
// Copyright © 2019 puwang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Pineapple/PWAbility.h>
@interface MMAAbility : PWAbility
/*&* 自定义协议的command class 类 */
@property (copy, nonatomic, readonly) NSDictionary *commands;
@e... |
fanlilinSaber/MSTRnMMA | MMACommand/MMAUserListCommand.h | //
// MMAUserListCommand.h
// MARS
//
// Created by <NAME> on 2019/7/16.
// Copyright © 2019 puwang. All rights reserved.
//
#import "MMACommand.h"
NS_ASSUME_NONNULL_BEGIN
@interface MMAUserListCommand : MMACommand <MMACommandSendable, MMACommandReceivable>
@end
NS_ASSUME_NONNULL_END
|
fanlilinSaber/MSTRnMMA | Sources/UI/MMAView.h | //
// MMAView.h
// MSTRnMMA
//
// Created by <NAME> on 2019/7/3.
// Copyright © 2019 puwang. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <React/RCTRootView.h>
@protocol MMACommandSendable, MMAResponseManagerDelegate;
@class PWCommand;
@interface MMAView : RCTRootView... |
fanlilinSaber/MSTRnMMA | MMACommand/MMAMRCoopCommand.h | <filename>MMACommand/MMAMRCoopCommand.h
//
// MMAMRCoopCommand.h
// MARS
//
// Created by <NAME> on 2019/7/16.
// Copyright © 2019 puwang. All rights reserved.
//
#import "MMACommand.h"
NS_ASSUME_NONNULL_BEGIN
@interface MMAMRCoopCommand : MMACommand <MMACommandReceivable, MMACommandSendable>
@end
NS_ASSUME_NO... |
fanlilinSaber/MSTRnMMA | MSTRnMMA IOS Example/MSTRNViewController.h | <reponame>fanlilinSaber/MSTRnMMA<gh_stars>1-10
//
// MSTRNViewController.h
// MSTRnMMA IOS Example
//
// Created by <NAME> on 2019/7/8.
// Copyright © 2019 puwang. All rights reserved.
//
#import <MSTRnMMA/MSTRnMMA.h>
NS_ASSUME_NONNULL_BEGIN
@interface MSTRNViewController : MMAViewController
@end
NS_ASSUME_NON... |
ChanganVR/my_shell-1 | prompt.h | /* functions for printing the friendly prompt */
#ifndef PROMPT_H
#define PROMPT_H
#include "common.h"
/* abs_dir is the absolute path, this function adjusts it and get more
readable result */
void adjust_dir_name (char *abs_dir, char *last_dir);
/* print the prompt which contains basic info, like username,
hos... |
ChanganVR/my_shell-1 | command_exec.h | <reponame>ChanganVR/my_shell-1<gh_stars>0
/* The functions for execute commands, both internal and external. */
#ifndef COMMAND_EXEC_H
#define COMMAND_EXEC_H
#include "common.h"
#include "basic.h"
#include "job_control.h"
/* This is the high-level function which decides what to do according to the type of commands. *... |
ChanganVR/my_shell-1 | command_parser.h | /* This file declares the functions for parsing the input */
#ifndef PARSER_H
#define PARSER_H
#include "basic.h"
#include "common.h"
void parse_command (Job *job);
/* locate the position of pipe for separating commands */
bool find_pipe (char *s, int start_index, int end_index);
/* check the existence of the sy... |
ChanganVR/my_shell-1 | job_control.h | <filename>job_control.h
/* Functions for handling job control. Some details references the GNU shell tutorial. And
the mainly referencing part is in the function update_status(the option of waitpid which is
WNOHANG | WUNTRACED for updating the info of children without blocking the parent) */
#ifndef JOB_CONTROL_H
#de... |
ChanganVR/my_shell-1 | basic.h | /* The basic functions and data structure for the shell */
#ifndef STRUCTURE_H
#define STRUCTURE_H
#include "common.h"
#include <list>
#include <string.h>
void init_shell();
enum CommandType{
CD,
EXIT,
JOBS,
FG,
BG,
NON_BUILT_IN,
EMPTY
};
class Command{
public:
std::string name;
... |
ChanganVR/my_shell-1 | common.h | <reponame>ChanganVR/my_shell-1
/* The common header files for the whole project, this header should
be included in other headers in this project. */
#ifndef COMMON_H
#define COMMON_H
#include <cstring>
#include <cstdio>
#include <iostream>
#include <stdbool.h>
#include <string>
#include <vector>
#include <stdl... |
ChimengSoso/recover | recover.c | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <cs50.h>
typedef uint8_t BYTE;
int main(int argc, char *argv[])
{
if (argc != 2)
{
printf("Usage: ./recover image");
return 1;
}
FILE *file = fopen(argv[1], "r");
int cnt = 0; // count number of image
... |
Kukanani/status_panel | include/status_panel/status_panel.h | ///////////////////////////////////////////////////////////////////////////////
// Title : Status panel
// Project : ROSSTEP
// Created : 7/15/2015
// Author : <NAME>
// Platforms : Ubuntu 64-bit
// Copyright : Copyright© The University of Texas at Austin, 2014-2017. All rights ... |
Kukanani/status_panel | include/status_panel/status_logger.h | ///////////////////////////////////////////////////////////////////////////////
// Title : Status logger
// Project : ROSSTEP
// Created : 7/15/2015
// Author : <NAME>
// Platforms : Ubuntu 64-bit
// Copyright : Copyright© The University of Texas at Austin, 2014-2017. All rights... |
Balnian/ChannelsCPP | ChannelsCPP/Channel.h | <reponame>Balnian/ChannelsCPP<gh_stars>10-100
#pragma once
#include <queue>
#include <deque>
#include <memory>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <limits>
#include "ChannelBuffer.h"
#include "IChannel.h"
#include "OChannel.h"
#include "ChannelUtility.h"
#include "Circular_buffer.... |
Balnian/ChannelsCPP | ChannelsCPP/Circular_buffer.h | #pragma once
#include<iostream>
#include<memory>
#include <stdexcept>
namespace go
{
namespace internal
{
template<typename T, std::size_t Buffer_Size>
class Circular_buffer
{
typedef T& reference;
typedef const T& const_reference;
typedef T* pointer;
typedef const T* const_pointer;
typedef declt... |
Balnian/ChannelsCPP | ChannelsCPP/IChannel.h | #pragma once
#include <iterator>
#include <memory>
#include "ChannelBuffer.h"
namespace go
{
class Case;
template<typename T, std::size_t Buffer_Size> class OChan;
// Inspired by http://h-deb.clg.qc.ca/Sujets/Divers--cplusplus/Iterateurs-generateurs.html From <NAME>
// References: https://golang.org/ref/spec... |
Balnian/ChannelsCPP | ChannelsCPP/OChannel.h | #pragma once
#include "ChannelBuffer.h"
namespace go
{
template<typename T, std::size_t Buffer_Size> class IChan;
template<typename T, std::size_t Buffer_Size = 0>
class OChan //: private Chan<T>
{
protected:
std::shared_ptr<internal::ChannelBuffer<T, Buffer_Size>> m_buffer;
OChan(std::shared_ptr<internal::... |
Balnian/ChannelsCPP | ChannelsCPP/ChannelUtility.h | #pragma once
//#include "Channel.h"
#include <utility>
#include <functional>
#include<iostream>
#include <random>
#include <algorithm>
/*#include "IChannel.h"
#include "OChannel.h"*/
namespace go
{
namespace internal
{
template<typename...> constexpr bool dependent_false = false;
}
template<typename T, std::s... |
Balnian/ChannelsCPP | ChannelsCPP/ChannelBuffer.h | #pragma once
#include <queue>
#include <memory>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include "Circular_buffer.h"
namespace go
{
namespace internal
{
template<typename T, std::size_t Buffer_Size=0>
class ChannelBuffer
{
private:
Circular_buffer<T, Buffer_Size> buffer;
std:... |
Martiniele/DSTrain | SortAlgorithm/SortAlgorithm.h | //
// Created by root on 18-3-11.
//
#ifndef SORTALGORITHM_SORTALGORITHM_H
#define SORTALGORITHM_SORTALGORITHM_H
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <iostream>
#include <unistd.h>
using namespace std;
/*****************************************************************... |
evilC/ViGEmBus | sys/ByteArray.c | <reponame>evilC/ViGEmBus
#include "ByteArray.h"
#include "trace.h"
#include "bytearray.tmh"
//
// Helpers
//
ULONG_PTR align_to_page_size(ULONG_PTR val)
{
return (val + (PAGE_SIZE - 1)) & -PAGE_SIZE;
}
//
// Forward decalarations
//
NTSTATUS IncreaseCapacityByteArray(IN PBYTE_ARRAY Array, IN ULONG NumElements)... |
timoteus/rock | src/print.c | <reponame>timoteus/rock<gh_stars>0
/**
* @file print.c
* @author timoteus <<EMAIL>>
*/
#include "print.h"
void
rock_byte_print(int s, void *p)
{
for (int i = s - 1; i >= 0; i--) {
for (int k = 7; k >= 0; k--) {
printf("%u", (*((unsigned char *)p+i) & (1 << k)) >> k);
}
}
}
void... |
timoteus/rock | src/disk.c | <reponame>timoteus/rock
/**
* @file disk.c
* @author timoteus <<EMAIL>>
*/
#include "disk.h"
#include "hdf5.h"
#include "hdf5_hl.h"
int
rock_indx_save(rock_indx_t *indx, char *fname)
{
hid_t file_id;
herr_t status;
hsize_t dims[] = {indx->len};
file_id = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAUL... |
timoteus/rock | tests/test_sort.c | <gh_stars>0
/**
* @file test_sort.c
* @author timoteus <<EMAIL>>
*/
#include "core.h"
#include "disk.h"
#include "sort.h"
#include "random.h"
#include "print.h"
extern int rock_radix_bits;
extern int rock_num_threads;
void
test(rock_desc_t *desc,
rock_uint_t num_dims,
rock_uint_t *dims,
rock_indx_t... |
timoteus/rock | src/print.h | <filename>src/print.h
/**
* @file print.h
* @author timoteus <<EMAIL>>
*/
#ifndef _PRINT_H
#define _PRINT_H
#include "core.h"
/**
* Print a whole tensor descriptor object.
*
* @param [in] name
* @param [in] desc
*/
void
rock_desc_print(char *name, rock_desc_t *desc);
/**
* Print the binary representation o... |
timoteus/rock | tests/test_random.c | <gh_stars>0
/**
* @file test_random.c
* @author timoteus <<EMAIL>>
*/
#include "core.h"
#include "random.h"
/**
* Unit test of rock_indx_sample().
*
* This is a very simple test, we _could_ spend all year verifying
* the results of this function if we wanted to.
*
* We're mostly going to make sure gene... |
timoteus/rock | src/sort.c | /**
* @file sort.c
* @author timoteus <<EMAIL>>
*/
#include "sort.h"
#include "print.h"
/* Use default values if not manually overridden. */
int rock_radix_bits = ROCK_USE_DEFAULT;
int rock_num_threads = ROCK_USE_DEFAULT;
static inline void
indx_sort_thread(rock_desc_t *desc,
rock_uint_t num_dims... |
timoteus/rock | src/tensor.h | <reponame>timoteus/rock<gh_stars>0
/**
* @file tensor.h
* @author timoteus <<EMAIL>>
*/
#ifndef _TENSOR_H
#define _TENSOR_H
#include "core.h"
/**
* A tensor object using the coordinate format to repesent a sparse
* or incomplete tensor (multidimensional array).
*
* The index (@c indx) array represents the coo... |
timoteus/rock | examples/example_distribute.c | <reponame>timoteus/rock<filename>examples/example_distribute.c
/**
* @file example_distribute.c
*/
#include "rock.h"
int main(int argc, char **argv)
{
srand(time(NULL));
MPI_Init(&argc, &argv);
rock_indx_t *indx = NULL;
rock_elem_t *elem = NULL;
rock_desc_t *desc = NULL;
rock_mpart_t *mpar... |
timoteus/rock | src/distribute.c | /**
* @file distribute.c
* @author timoteus <<EMAIL>>
*/
#include "distribute.h"
#include "sort.h"
rock_mesh_t *
rock_mesh_init(MPI_Comm comm,
rock_uint_t order,
rock_uint_t *dim_size)
{
rock_mesh_t *mesh = calloc(1, sizeof(rock_mesh_t));
MPI_Comm_size(comm, &mesh->np);
M... |
timoteus/rock | examples/example_core.c | <gh_stars>0
/**
* @file example_core.c
*/
#include "rock.h"
int main(int argc, char **argv)
{
srand(time(NULL));
/* Create a descriptor for the tensor described in core.h. */
rock_uint_t order = 3;
rock_uint_t dim_size[] = {12, 5, 2};
rock_desc_t *desc = rock_desc_init(order, dim_size);
/*... |
timoteus/rock | src/version.h | #define ROCK_VERSION "0.6.0"
|
timoteus/rock | tests/test_disk.c | <reponame>timoteus/rock<filename>tests/test_disk.c
/**
* @file test_disk.c
* @author timoteus <<EMAIL>>
*/
#include "core.h"
#include "sort.h"
#include "random.h"
#include "disk.h"
/**
* Unit test of rock_indx_save() and rock_indx_load().
*/
void
test_rock_indx_save_load()
{
char *fname = "test_rock_indx_sav... |
timoteus/rock | src/sort.h | /**
* @file sort.h
* @author timoteus <<EMAIL>>
*/
#ifndef _SORT_H
#define _SORT_H
#include "core.h"
/** The number of threads to use for parallel sort. */
extern int rock_num_threads;
/** The number of bits to maximally process each pass of radix sort. */
extern int rock_radix_bits;
/**
* Sorts an index array... |
timoteus/rock | src/core.c | /**
* @file core.c
* @author timoteus <<EMAIL>>
*/
#include "core.h"
#include "sort.h"
rock_desc_t *
rock_desc_init(rock_uint_t order,
rock_uint_t *dim_size)
{
rock_desc_t *desc = calloc(1, sizeof(rock_desc_t));
rock_uint_t total_size = 1;
for (rock_uint_t i = 0; i < order; i++) {
... |
timoteus/rock | src/core.h | /**
* @file core.h
* @author timoteus <<EMAIL>>
*
* Sparse and incomplete tensors are represented using a coordinate format
* where each non-zero element is stored with its index and value in
* separate arrays (@c rock_indx_t and @c rock_elem_t):
*
* "indx" elem
* +---+---+---+ +------+
* ... |
timoteus/rock | src/rock.h | /**
* @file rock.h
* @author timoteus <<EMAIL>>
*/
#ifndef _ROCK_H
#define _ROCK_H
#include "version.h"
#include "common.h"
#include "core.h"
#include "random.h"
#include "print.h"
#include "sort.h"
#include "disk.h"
#include "distribute.h"
#include "tensor.h"
#endif
|
timoteus/rock | src/common.h | /**
* @file common.h
* @author timoteus <<EMAIL>>
*/
#ifndef _COMMON_H
#define _COMMON_H
#include "config.h"
#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <sys/time.h>
#include <time.h>
#include <assert.h>
#incl... |
timoteus/rock | src/random.c | <reponame>timoteus/rock<filename>src/random.c
/**
* @file random.c
* @author timoteus <<EMAIL>>
*/
#include "random.h"
#include "sort.h"
rock_uint_t
rock_uint_random(rock_uint_t range)
{
#ifdef ROCK_WORD_SIZE_64
return ROCK_ERR;
#else
if (range > RAND_MAX) {
return ROCK_BAD_INPUT;
}
uint32_... |
timoteus/rock | src/distribute.h | <gh_stars>0
/**
* @file distribute.h
* @author timoteus <<EMAIL>>
*/
#ifndef _DISTRIBUTE_H
#define _DISTRIBUTE_H
#include "core.h"
#include <mpi.h>
/**
* Processor mesh object.
*
* Represents a logical mesh of processors.
*
* Can be used in combination with @c rock_mpart_t to distribute
* tensors on a distr... |
timoteus/rock | src/tensor.c | <filename>src/tensor.c
/**
* @file tensor.c
* @author timoteus <<EMAIL>>
*/
#include "tensor.h"
#include "core.h"
#include "sort.h"
#include "disk.h"
#include "random.h"
#include "print.h"
rock_tensor_t *
rock_tensor_init(rock_uint_t order,
rock_uint_t *dim_size,
rock_uint_t num_e... |
timoteus/rock | tests/test_core.c | <filename>tests/test_core.c
/**
* @file test_core.c
* @author timoteus <<EMAIL>>
*/
#include "core.h"
#include "print.h"
/**
* Unit test of rock_desc_init(), rock_desc_free().
*/
void
test_rock_desc(rock_uint_t order, rock_uint_t *dim_size)
{
rock_desc_t *desc = rock_desc_init(order, dim_size);
assert(d... |
timoteus/rock | src/error_codes.h | /**
* @file error_codes.h
* @author timoteus <<EMAIL>>
*/
#define ROCK_OK 0
#define ROCK_ERR -1
#define ROCK_BAD_INPUT 100
|
timoteus/rock | src/disk.h | <filename>src/disk.h
/**
* @file disk.h
* @author timoteus <<EMAIL>>
*/
#ifndef _DISK_H
#define _DISK_H
#include "core.h"
/**
* Save an array of packed multi-indices to disk.
*
* @param [in] indx
* @param [in] fname
* @return ROCK_OK or ROCK_ERR.
*/
int
rock_indx_save(rock_indx_t *indx, cha... |
timoteus/rock | examples/example_tensor.c | <reponame>timoteus/rock<gh_stars>0
/**
* @file example_tensor.c
*/
#include "rock.h"
int main(int argc, char **argv)
{
srand(time(NULL));
/* Initialize a tensor of arbitrary size. */
rock_uint_t order = 3;
rock_uint_t dim_size[] = {10, 300000, 500};
rock_uint_t nnz = 20; /* Number of non-zero e... |
timoteus/rock | src/random.h | <gh_stars>0
/**
* @file random.h
* @author timoteus <<EMAIL>>
*/
#ifndef _RANDOM_H
#define _RANDOM_H
#include "core.h"
/**
* Generate a pseudo-random number within a certain range.
*
* @param range Upper limit (exclusive).
* @return A number between 0 and @c range.
*/
rock_uint_t... |
vfreex/packaging_wide-dhcpv6 | missing/sys/queue.h | <gh_stars>100-1000
/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must ret... |
vfreex/packaging_wide-dhcpv6 | missing/getifaddrs.c | <reponame>vfreex/packaging_wide-dhcpv6<gh_stars>100-1000
/*
* Copyright (c) 2006 WIDE Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain... |
vfreex/packaging_wide-dhcpv6 | dhcp6relay_script.c | /*from $KAME: dhcp6c_script.c,v 1.11 2004/11/28 10:48:38 jinmei Exp $ */
/*
* Copyright (C) 2003 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of sou... |
vfreex/packaging_wide-dhcpv6 | base64.c | /* $KAME: base64.c,v 1.1 2004/06/08 07:26:56 jinmei Exp $ */
/*
* Copyright (C) 2004 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code mus... |
vfreex/packaging_wide-dhcpv6 | missing/daemon.c | <gh_stars>100-1000
/*
* Copyright (c) 2006 WIDE Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, thi... |
hudakmariann/UdacityCppND_systemMonitor | include/processor.h | #ifndef PROCESSOR_H
#define PROCESSOR_H
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
using std::string;
class Processor {
public:
float Utilization(); // : See src/processor.cpp
// Declare any necessary private members
private:
string line, key ;
float user ; //: normal process... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.