repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
nanshuii/TurnTable
TurnTable/TurnTable/Main/LENSettingViewController.h
<reponame>nanshuii/TurnTable // // LENSettingViewController.h // TurnTable // // Created by 林南水 on 2019/7/22. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LENSettingViewController : UIViewController @property (weak, nonatomic) IBOutlet UISwitch *r...
nanshuii/TurnTable
TurnTable/TurnTable/Main/LENTurnTableViewController.h
// // LENTurnTableViewController.h // TurnTable // // Created by 林南水 on 2019/7/10. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LENTurnTableViewController : UIViewController @property (weak, nonatomic) IBOutlet UIView *contentView; @end NS_ASSU...
nanshuii/TurnTable
TurnTable/TurnTable/Main/LENTurnTablePreviewViewController.h
// // LENTurnTablePreviewViewController.h // TurnTable // // Created by 林南水 on 2019/7/18. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LENTurnTablePreviewViewController : UIViewController @property (nonatomic, strong) LENTurnTableModel *model; @p...
nanshuii/TurnTable
TurnTable/TurnTable/Main/view/LENTurnTableTableViewCell.h
// // LENTurnTableTableViewCell.h // TurnTable // // Created by 林南水 on 2019/7/10. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LENTurnTableTableViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (weak, ...
nanshuii/TurnTable
TurnTable/TurnTable/Main/LENTurnTableHistoryViewController.h
// // LENTurnTableHistoryViewController.h // TurnTable // // Created by 林南水 on 2019/7/19. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LENTurnTableHistoryViewController : UIViewController @property (nonatomic, strong) LENTurnTableModel *model; @p...
nanshuii/TurnTable
TurnTable/TurnTable/Main/model/LENAddTrunTableModel.h
<gh_stars>0 // // LENAddTrunTableModel.h // TurnTable // // Created by 林南水 on 2019/7/10. // Copyright © 2019 ledon. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @interface LENAddTrunTableModel : NSObject @property (nonatomic, copy) NSMutableArray *colors; // F F F F F F @pr...
nanshuii/TurnTable
TurnTable/TurnTable/Main/view/LENTurnHistoryTableViewCell.h
// // LENTurnHistoryTableViewCell.h // TurnTable // // Created by 林南水 on 2019/7/19. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LENTurnHistoryTableViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (we...
nanshuii/TurnTable
TurnTable/TurnTable/view/LENTurnTableView.h
// // LENTurnTableView.h // LedonDemo // // Created by 林南水 on 2019/7/5. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN typedef void(^FoodBlock)(NSString *title, int index); @interface LENTurnTableView : UIView @property (nonatomic, copy) FoodBlock foodBlock; ...
nanshuii/TurnTable
TurnTable/TurnTable/Main/LENTurnTableShowViewController.h
// // LENTurnTableShowViewController.h // TurnTable // // Created by 林南水 on 2019/7/16. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface LENTurnTableShowViewController : UIViewController @property (nonatomic, strong) LENTurnTableModel *model; @propert...
nanshuii/TurnTable
TurnTable/TurnTable/LENTurnTableDefine.h
<filename>TurnTable/TurnTable/LENTurnTableDefine.h // // LENTurnTableDefine.h // TurnTable // // Created by 林南水 on 2019/7/10. // Copyright © 2019 ledon. All rights reserved. // #ifndef LENTurnTableDefine_h #define LENTurnTableDefine_h #define PATHS [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUser...
nanshuii/TurnTable
TurnTable/TurnTable/Main/view/LENAddTrunTableViewCell.h
// // LENAddTrunTableViewCell.h // TurnTable // // Created by 林南水 on 2019/7/10. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> typedef void(^MessageChangeBlock)(NSString * _Nonnull message); typedef void(^RateChangeBlock)(NSString * _Nonnull rate); typedef void(^ColorButtonBlock)(); ...
nanshuii/TurnTable
TurnTable/TurnTable/view/LENColorSelectImageView.h
<gh_stars>0 // // LENColorSelectImageView.h // TurnTable // // Created by 林南水 on 2019/7/12. // Copyright © 2019 ledon. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN typedef void(^CurrentColorHex)(int colorHex); @interface LENColorSelectImageView : UIImageView @property (nonatomic, cop...
ss-sucha/MiniFirewall
mfw_module.c
#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/fs.h> #include <linux/slab.h> #include <asm/uaccess.h> #include <linux/list.h> #include <linux/types.h> #include <linux/netfilter_ipv4.h> #include <linux/in.h> #include <linux/ip.h> #include <linux/tcp.h> #include <linux/udp.h> ...
WhitNearSpace/DS1820
DS18B20.h
<reponame>WhitNearSpace/DS1820<gh_stars>0 #ifndef DS18B20_H #define DS18B20_H #include <mbed.h> #include "OneWire.h" #define DS18B20_FAMILY_CODE 0x28 class DS18B20{ public: /** * Constructor * **/ DS18B20(OneWire *onewire, char ROM[8] = 0x00); /** * Overwrite ...
Elethom/contacts-phonetic
inc/config.h
<gh_stars>10-100 #define VERSION_STRING "contacts-phonetic version 0.3 Copyright (c) 2016 <NAME>\n" #define HELP_STRING VERSION_STRING "\ \n\ Usage: contacts-phonetic [arguments]\n\ \n\ Arguments:\n\ -v, --version\n\ Display current version.\n\ \n\ -h, --help\n\ Display this help text.\n\ ...
hosuzuki/ft_printf
.dev/ft_printf.c
<gh_stars>0 #include "ft_printf.h" void ft_init_format(t_analyze *analyze) { analyze->len = 0; analyze->flag_left_align = OFF; analyze->flag_zero_padding = OFF; analyze->flag_notation = OFF; analyze->flag_sign = OFF; analyze->flag_space = OFF; analyze->width = 0; analyze->precision = -1; //? } int ft_analyze...
hosuzuki/ft_printf
mains/main_only_ft.c
<reponame>hosuzuki/ft_printf<gh_stars>0 #include "../includes/ft_printf.h" #include <limits.h> void end(void)__attribute__((destructor)); void end(void) { system("leaks a.out"); } int main(void) { int i; int a; // i = ft_printf("%x\n", ULLONG_MAX - 1); //fffffffe // printf("return value: %d\n", i); //9 pri...
hosuzuki/ft_printf
.dev/ft_double.h
#ifndef FT_DOUBLE_H # define FT_DOUBLE_H # include <math.h> # include <float.h> # include <stdint.h> # include <strings.h> # include "ft_printf.h" # define DECIMAL_DIGIT 1074 # define INTEGER_DIGIT 308 # define EXP_BIAS 1023 # define EXP_MAX 2047 # define FRAC_BIT 52 # define EXP_BIT 11 typedef struct { uint8_t ...
hosuzuki/ft_printf
.dev/ft_write.c
#include "ft_printf.h" #include <stdio.h> void ft_write_char(char c, t_analyze *analyze) { analyze->buffer[analyze->done % BUFSIZ] = c; analyze->done++; printf("out is : %lu\n", analyze->done % BUFSIZ); if (analyze->done % BUFSIZ == 0) write(1, analyze->buffer, BUFSIZ); }
hosuzuki/ft_printf
src/ft_print_unsigned.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_print_unsigned.c :+: :+: :+: ...
hosuzuki/ft_printf
.dev2/ft_printf.c
#include "ft_printf.h" int ft_printf(const char *fmt, ...) { t_stock *lst; size_t total_length; if(!fmt) return (0); lst = (t_stock *)malloc(sizeof(t_stock)); if (!lst) return (-1); lst->total_len = 0; va_start(lst->args, fmt); total_length = ft_analyze_fmt(fmt, lst); va_end(lst->args); free(lst); retu...
hosuzuki/ft_printf
src/ft_printf.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_printf.c :+: :+: :+: ...
hosuzuki/ft_printf
.dev/ft_printf.h
#ifndef FT_PRINTF_H # define FT_PRINTF_H # include <stdio.h> # include <unistd.h> # include <stdarg.h> //for such as va_start # include <stdlib.h> //for free(), malloc # include <limits.h> // for INT_MAX //# include <stdint.h> # include "libft.h" # define ON 1 # define OFF 0 typedef struct list { char *buffer; s...
hosuzuki/ft_printf
includes/ft_printf.h
<filename>includes/ft_printf.h /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_printf.h ...
hosuzuki/ft_printf
src/ft_print_address.c
<gh_stars>0 /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_print_address.c :+: ...
hosuzuki/ft_printf
.stock/ft_utils.c
<reponame>hosuzuki/ft_printf<gh_stars>0 /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_utils.c ...
hosuzuki/ft_printf
src/ft_turnon_flags.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_turnon_flags.c :+: :+: :+: ...
hosuzuki/ft_printf
.dev2/ft_print_decimal.c
#include "ft_printf.h" #include "libft.h" void ft_print_space(t_stock *lst, int len) { if (lst->sign != OFF) lst->width--; if (lst->space == ON) { lst->total_len++; lst->width--; write(1, " ", 1); } else if (lst->width > 0 && lst->zero_pad == OFF) { while (lst->width - len > 0) { write(1, " ", 1);...
hosuzuki/ft_printf
mains/main_printTester.c
<gh_stars>0 #include "../includes/ft_printf.h" #include "../libft/libft.h" #include <limits.h> #include <stdio.h> void end(void)__attribute__((destructor)); void end(void) { system("leaks a.out"); } int main(void) { // ft_printf("%02x\n", -100); // ft_printf("%03d\n", 1); // ft_printf("%01d\n", 10); // print...
hosuzuki/ft_printf
src/ft_analyze_fmt.c
<reponame>hosuzuki/ft_printf<filename>src/ft_analyze_fmt.c /* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_analyze_fm...
hosuzuki/ft_printf
.dev2/ft_analyze_fmt.c
#include "ft_printf.h" #include "libft.h" int ft_isflag(char c) { if (c == '-' || c == '+' || c == ' ' || c == '#' || c == '0') return (1); else return (0); } void ft_write_fmt(const char *fmt, size_t i) { write(1, &fmt[i], 1); } void ft_analyze_speci(const char *fmt, t_stock *lst, size_t i) { if (fmt[i] ==...
hosuzuki/ft_printf
.dev2/ft_flags.c
<reponame>hosuzuki/ft_printf<gh_stars>0 #include "ft_printf.h" #include "libft.h" void ft_precision(const char *fmt, t_stock *lst, size_t *i) { size_t len; if (fmt[*i] != '.') return ; (*i)++; len = 0; if (fmt[*i] == '*') { lst->precision = va_arg(lst->args, int); (*i)++; return ; } while (ft_isdigit...
hosuzuki/ft_printf
.dev/ft_print_char.c
<gh_stars>0 #include "ft_printf.h" void ft_print_char(int c, t_analyze *analyze) { char output[2]; // analyze->zero_padding = 0; do i need this even in it is initialized with 0 in ft_init_format? analyze->len = 1; output[0] = c; output[1] = '\0'; analyze->status = ft_push(analyze, "", output); }
hosuzuki/ft_printf
src/ft_write_utils.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_write_utils.c :+: :+: :+: ...
hosuzuki/ft_printf
.dev2/ft_print_address.c
<gh_stars>0 #include "ft_printf.h" #include "libft.h" void ft_print_space_ad(t_stock *lst, int len) { if (lst->width > 0) { while (lst->width - len > 0) { write(1, " ", 1); lst->width--; lst->total_len++; } } } static ssize_t ft_putnbr_base_r(size_t nbr, char *base, size_t len) { static ssize_t tot...
hosuzuki/ft_printf
.dev2/printing.c
#include "ft_printf.h" #include "libft.h" void ft_print_str(t_stock *lst) { char *str; size_t len; str = va_arg(lst->args, char *); len = ft_strlen(str); write(1, str, len); lst->total_len = lst->total_len + len; } void ft_print_char(t_stock *lst) { int c; c = va_arg(lst->args, int); write(1, &c, 1); lst...
hosuzuki/ft_printf
src/ft_print_decimal.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_print_decimal.c :+: :+: :+: ...
hosuzuki/ft_printf
.stock/main.c
<gh_stars>0 #include <stdio.h> int ft_printf(const char *input, ...); int main(void) { // printf("a"); // ft_printf("%s", "a"); ft_printf("a"); return (0); }
hosuzuki/ft_printf
mains/main_decimal.c
#include <stdio.h> int main(void) { //flag combo //2: '-'flag + '+'flag printf("[%-+d]\n", 1); printf("[%-+d]\n", -1); printf("[%-+10d]\n", 1); printf("[%-+10d]\n", -1); printf("[%-+f]\n", 1.0); printf("[%-+f]\n", -1.0); printf("[%-+10f]\n", 1.0); printf("[%-+10f]\n", -1.0); //3: '-'flag + '(space)'flag pr...
hosuzuki/ft_printf
.dev2/ft_print_hex.c
<gh_stars>0 #include "ft_printf.h" #include "libft.h" void ft_print_space_hex(t_stock *lst, int len) { int space_len; space_len = lst->width; if (lst->hash == ON) space_len -= 2; if (0 < lst->precision) space_len -= lst->precision; else space_len -= len; while (0 < space_len) { write(1, " ", 1); sp...
hosuzuki/ft_printf
.dev2/ft_printf.h
<filename>.dev2/ft_printf.h<gh_stars>0 #ifndef FT_PRINTF_H # define FT_PRINTF_H # include <stdio.h> # include <stdarg.h> # include <unistd.h> # include <stdlib.h> # define ERROR -1 # define OFF 0 # define ON 1 # define PLUS 2 # define MINUS -2 typedef struct { va_list args; size_t total_len; //char type; int st...
hosuzuki/ft_printf
mains/main_char.c
<gh_stars>0 #include <stdio.h> #include "./includes/ft_printf.h" int main(void) { printf("\x1b[32mgeneral\n\x1b[39m"); printf(" => %d\n", printf("[%c]", 'a')); printf(" => %d\n", ft_printf("[%c]", 'a')); printf("\n"); /* printf("\x1b[32m'-'flag\n\x1b[39m"); printf(" => %d\n", printf("[%-c]", 'a')); printf(" => ...
hosuzuki/ft_printf
.dev/main.c
#include <stdio.h> #include "ft_printf.h" int main(void) { // printf("a"); // ft_printf("%s", "a"); ft_printf("a"); return (0); }
hosuzuki/ft_printf
.dev/ft_push.c
#include "ft_printf.h" #include "ft_double.h" static int ft_isint(char type) { return (type == 'd' || type == 'i' || type == 'o' || \ type == 'u' || type == 'x' || type == 'X'); } static int ft_isdouble(char type) { return (type == 'a' || type == 'A' || \ type == 'e' || type == 'E' || \ type == 'f' || type...
hosuzuki/ft_printf
.dev2/main.c
#include "ft_printf.h" int main(void) { ft_printf("s is : %s\n", "abcde"); ft_printf("a\n"); ft_printf("[%-10d]\n", 1); printf("[%-10d]\n", 1); ft_printf("[%010d]\n", 1); printf("[%010d]\n", 1); ft_printf("%+d\n", 1); printf("%+d\n", 1); ft_printf("%+d\n", 0); printf("%+d\n", 0); ft_printf("[% d]\n", 1...
hosuzuki/ft_printf
mains/main_hex.c
<reponame>hosuzuki/ft_printf #include <stdio.h> #include "../includes/ft_printf.h" void end(void)__attribute__((destructor)); void end(void) { system("leaks a.out"); } int main(void) { ft_printf("%x, %x, %x\n", 107, 107, 107); ft_printf("%x\n", 107); ft_printf("%x\n", 107); ft_printf("%X\n", 107); ft_print...
hosuzuki/ft_printf
mains/main_42tester.c
#include "../includes/ft_printf.h" #include "../libft/libft.h" #include <limits.h> #include <stdio.h> void end(void)__attribute__((destructor)); void end(void) { system("leaks a.out"); } int main(void) { int a = -4; int b = 0; char c = 'a'; int d = 2147483647; int e = -2147483648; int f = 42; int g...
hosuzuki/ft_printf
.dev/ft_analyze.c
<reponame>hosuzuki/ft_printf #include "ft_printf.h" static int ft_istype(const char fmt, va_list *args, t_analyze *analyze) { analyze->type = fmt; if (fmt == 'c') ft_print_char(va_arg(*args, int), analyze); /* else if (fmt == 's') print_string(va_arg(*args, char *), analyze); else if (fmt == 'p') print_addres...
hosuzuki/ft_printf
mains/main_ft_printf_tester.c
<filename>mains/main_ft_printf_tester.c #include "../includes/ft_printf.h" #include "../libft/libft.h" #include <limits.h> #include <stdio.h> /* * void end(void)__attribute__((destructor)); void end(void) { system("leaks ft.out"); } */ int main(void) { PRINT(" --- Return : %d\n", PRINT("%#010X", 123)); //T2...
hosuzuki/ft_printf
.dev2/ft_print_unsigned.c
#include "ft_printf.h" #include "libft.h" static int count_digits(unsigned n) { int i; i = 1; /* if (n == INT_MIN) return (11); if (n < 0) { n = n * -1; i++; } */ while (n > 9) { n = n / 10; i++; } return (i); } static void to_alpha(char *res, int n, int *i) { if (n == INT_MIN) { to_alpha(res,...
JFF-Bohdan/qcodec2
src/qcodec2/qcodec2wrappers.h
#ifndef QCODEC2WRAPPERS_H #define QCODEC2WRAPPERS_H #include "qcodec2decoder.h" #include "qcodec2encoder.h" #endif //QCODEC2WRAPPERS_H
JFF-Bohdan/qcodec2
src/qcodec2/qcodec2shared.h
#ifndef QCODEC2SHARED_H #define QCODEC2SHARED_H #include <QtCore/QtCore> //! Holds information about last error class QLastErrorHolder { public: //! Empty constructor QLastErrorHolder() : m_ErrorDetected(false) { // } //! Construct by error text QLastErrorHolder(const QString ...
JFF-Bohdan/qcodec2
src/qcodec2/qcodec2wrappersbase.h
#ifndef QCODEC2WRAPPERSBASE_H #define QCODEC2WRAPPERSBASE_H #include <climits> #include <QtCore/QSharedPointer> #include <QtCore/QIODevice> #include <QtMultimedia/QAudioFormat> #include "qcodec2shared.h" #include "codec2.h" class QCodec2BaseClass : public QIODevice, public QLastErrorHolder { Q_OBJECT public: ...
JFF-Bohdan/qcodec2
src/qcodec2/qcodec2encoder.h
#ifndef QCODEC2ENCODER_H #define QCODEC2ENCODER_H #include <QtCore/QIODevice> #include "qcodec2wrappersbase.h" class QCodec2Encoder : public QCodec2BaseClass { Q_OBJECT public: /*! * \brief QCodec2Encoder constructor for encoder * \param outputDevice pointer to output device * \param parent ...
JFF-Bohdan/qcodec2
src/qcodec2/qcodec2decoder.h
#ifndef QCODEC2DECODER_H #define QCODEC2DECODER_H #include <QtCore/QIODevice> #include "qcodec2wrappersbase.h" class QCodec2Decoder : public QCodec2BaseClass { Q_OBJECT public: /*! * \brief QCodec2Decoder constructor for decoder * \param inputDevice pointer for device contains encoded data * \...
JFF-Bohdan/qcodec2
src/gui/mainwindow.h
<gh_stars>1-10 #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QtMultimedia/QAudio> namespace Ui { class MainWindow; } class QComboBox; class QAudioDeviceInfo; class QAudioFormat; class QProgressBar; class QFile; class QLabel; class QAudioInput; class QAudioOutput; class QCodec2Encoder...
Fallen-Zen/UpdateableComboBox
UpdateableComboBox.h
#pragma once #include <QComboBox> #include <QSortFilterProxyModel> #include <QCompleter> class UpdateableComboBox : public QComboBox { Q_OBJECT public: explicit UpdateableComboBox(QWidget *parent = Q_NULLPTR); void setItemModel(QAbstractItemModel *model); private slots: void setTextIfCompleterIsClicked(const QSt...
chunlin-pan/DYSTA
examples/ForTest.c
void n(int n){ for(int i = 0; i<k; i++){ // k=k; } } void n_logn(int n) { int k = n; for(int i=1;i<=n;i++) for(int j=1;j<=n;j*=2) k++; } // void n_2_n(int n) { // int k = n; // for(int i=1;i<=n;i++) // for(int j=1;j<=1<<n;j++) // o++; // } void l...
chunlin-pan/DYSTA
examples/lengthOfLongestSubstring.c
<gh_stars>0 static int lengthOfLongestSubstring(char s) { int offset[128]; int max_len = 0; int len = 0; int index = 0; memset(offset, 0xff, sizeof(offset)); // int s_len = len(s); //還沒做出assign function call for (int i = 0; i < s_len; i++) { offset_Si = offset[s[i]]; if (off...
chunlin-pan/DYSTA
examples/twoSum.c
int* twoSum(int nums, int numsSize, int target) { int min=INT_MAX; int max=INT_MIN; for (int i=0;i<numsSize;i++) { if (nums[i]<min) min=nums[i]; if (nums[i]>max) max=nums[i]; } // int* map=calloc(max-min+1,sizeof(int)); if (map==NULL) return NULL; // int*...
chunlin-pan/DYSTA
challenge/Fliptile.c
// 邻接的格子的坐标 const int dx[5] = {-1, 0, 0, 0, 1}; const int dy[5] = {0, -1, 0, 1, 0}; // 输入 int M = a; int N = b; int tile[MAX_M][MAX_N]; int opt[MAX_M][MAX_N]; // 保存最优解 int flip[MAX_M][MAX_N]; // 保存中间结果 // 查询(x,y)的颜色 int get(int x, int y) { int c = tile[x][y]; for (int d = 0; d < 5; d++) { int x2 = x + dx[d], y2 = y...
chunlin-pan/DYSTA
tests/c/binarySearch.c
#include <stdlib.h> #include <stdio.h> int binarysearch(int *data, int key, int n){ int low = 0; int high = n - 1; while (low <= high){ int mid = (low + high) / 2; if (data[mid] == key){ return printf("Found index is %d\n", mid); } else if (data[mid] < key){ ...
chunlin-pan/DYSTA
examples/binarySearch.c
int binarysearch(int data, int key, int n){ int low = 0; int high = n - 1; while (low <= high){ int mid = (low + n) / 2; if (data[mid] == key){ return mid; } else if (data[mid] < key){ low = (low + high)/2 + 1; } else if (data[mid] > ke...
chunlin-pan/DYSTA
examples/partition.c
int partition(int arr, int low, int high){ int i = low -1; int tmp; for(int j = low; j < high; j++){ if(arr[j] < arr[high]){ i++; tmp = arr[j]; arr[j] = arr[i]; arr[i] = tmp; } } tmp = arr[i+1]; arr[i+1] = arr[high]; arr[high] =...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/UIViewController+YJAddition.h
<filename>WYNews/WYNews/Tools/Additions/UIViewController+YJAddition.h // // UIViewController+YJAddition.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface UIViewController (YJAddition) /** * 在当前视图控制器中添加子控制器,将子控制器的视图添加到 view 中 * * ...
Annabelle1024/WYNewws
WYNews/WYNews/Classes/Home/WYHomeViewController.h
// // WYHomeViewController.h // WYNews // // Created by Annabelle on 16/6/14. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface WYHomeViewController : UIViewController @end
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/NSArray+YJAddition.h
<reponame>Annabelle1024/WYNewws<filename>WYNews/WYNews/Tools/Additions/NSArray+YJAddition.h // // NSArray+YJAddition.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface NSArray (YJAddition) /// 从 plist 文件创建指定 clsName 对象数组 //...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/YJNetworkManager/YJNetworkManager.h
// // YJNetworkManager.h // WYNews // // Created by Annabelle on 16/6/15. // Copyright © 2016年 annabelle. All rights reserved. // #import <AFNetworking.h> /// 网络管理器 - 统一管理所有网络请求 @interface YJNetworkManager : AFHTTPSessionManager // 建立全局访问点 + (instancetype)sharedManager; // 接口方法 - (void)newsListWithCategory:(NS...
Annabelle1024/WYNewws
WYNews/WYNews/Classes/Home/NewsDetail/WYNewsList.h
// // WYNewsList.h // WYNews // // Created by Annabelle on 16/6/15. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface WYNewsList : NSObject /// 标题 @property (nonatomic, copy) NSString *title; /// 配图地址 @property (nonatomic, copy) NSString *imgsrc; /// 来源 @propert...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/NSObject+YJAddition.h
<gh_stars>1-10 // // NSObject+YJAddition.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface NSObject (YJAddition) /// 使用字典创建模型对象 /// /// @param dict 字典 /// /// @return 模型对象 + (instancetype)yj_objectWithDict:(NSDictionary *)d...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/NSString+YJPath.h
<reponame>Annabelle1024/WYNewws<filename>WYNews/WYNews/Tools/Additions/NSString+YJPath.h<gh_stars>1-10 // // NSString+YJPath.h // // Created by Annabelle on 16/6/10. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (YJPath) /// 给当前文件追加文档路径 - (NSString *...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/NSArray+Log.h
// // NSArray+Log.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface NSArray (Log) @end
Annabelle1024/WYNewws
WYNews/WYNews/Classes/Home/NewsList/WYNewsListViewController.h
<filename>WYNews/WYNews/Classes/Home/NewsList/WYNewsListViewController.h // // WYNewsListViewController.h // WYNews // // Created by Annabelle on 16/6/15. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> // 不同的 新闻页面 使用 不同的 url 来加载数据 @interface WYNewsListViewController : UIViewContr...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/UIButton+YJAddition.h
// // UIButton+YJAddition.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface UIButton (YJAddition) /// 创建文本按钮 /// /// @param title 文本 /// @param fontSize 字体大小 /// @param normalColor 默认颜色 /// @param selectedColor 选中颜色 /...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/NSString+YJBase64.h
// // NSString+YJBase64.h // // Created by Annabelle on 16/6/10. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (YJBase64) /// 对当前字符串进行 BASE 64 编码,并且返回结果 - (NSString *)yj_base64Encode; /// 对当前字符串进行 BASE 64 解码,并且返回结果 - (NSString *)yj_base64Decode; @e...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/UIView+YJAddition.h
<reponame>Annabelle1024/WYNewws // // UIView+YJAddition.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface UIView (YJAddition) /// 返回屏幕截图 - (UIImage *)yj_snapshotImage; @end
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/YJAdditions.h
<gh_stars>1-10 // // YJAdditions.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import "UILabel+YJAddition.h" #import "UIButton+YJAddition.h" #import "UIColor+YJAddition.h" #import "UIView+YJAddition.h" #import "UIScreen+YJAddition.h" #import "UIViewController+YJA...
Annabelle1024/WYNewws
WYNews/WYNews/Classes/Home/NewsDetail/WYNewsCell.h
<gh_stars>1-10 // // WYNewsCell.h // WYNews // // Created by Annabelle on 16/6/15. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface WYNewsCell : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *iconView; @property (weak, nonatomic) IBOutlet UILabel *tit...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/UIScreen+YJAddition.h
<filename>WYNews/WYNews/Tools/Additions/UIScreen+YJAddition.h // // UIScreen+YJAddition.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface UIScreen (YJAddition) /// 屏幕宽度 + (CGFloat)yj_screenWidth; /// 屏幕高度 + (CGFloat)yj_screenHeight;...
Annabelle1024/WYNewws
WYNews/WYNews/Classes/Main/WYMainViewController.h
<filename>WYNews/WYNews/Classes/Main/WYMainViewController.h // // WYMainViewController.h // WYNews // // Created by Annabelle on 16/6/14. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface WYMainViewController : UITabBarController @end
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/UILabel+YJAddition.h
<reponame>Annabelle1024/WYNewws // // UILabel+YJAddition.h // // Created by Annabelle on 16/5/28. // Copyright © 2016年 annabelle. All rights reserved. // #import <UIKit/UIKit.h> @interface UILabel (YJAddition) /// 创建文本标签 /// /// @param text 文本 /// @param fontSize 字体大小 /// @param color 颜色 /// /// @return UI...
Annabelle1024/WYNewws
WYNews/WYNews/Tools/Additions/NSString+YJHash.h
// // NSString+Hash.h // // Created by Annabelle on 16/6/10. // Copyright © 2016年 annabelle. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (Hash) #pragma mark - 散列函数 /** * 计算MD5散列结果 * * 终端测试命令: * @code * md5 -s "string" * @endcode * * <p>提示:随着 MD5 碰撞生成器的出现,MD5 算法不应被用于...
hyphaproject/hyphahandlers
source/alarm/include/hyphahandlers/alarm/alarm.h
<filename>source/alarm/include/hyphahandlers/alarm/alarm.h // Copyright (c) 2015-2016 Hypha #pragma once #include <map> #include <string> #include <hypha/handler/hyphahandler.h> namespace hypha { namespace handler { namespace alarm { class Alarm : public HyphaHandler { public: explicit Alarm(); ~Alarm(); sta...
hyphaproject/hyphahandlers
source/testhandler/include/hyphahandlers/testhandler/testhandler.h
// Copyright (c) 2015-2016 Hypha #pragma once #include <map> #include <string> #include <hypha/handler/hyphahandler.h> namespace hypha { namespace handler { namespace testhandler { class TestHandler : public HyphaHandler { public: explicit TestHandler(); ~TestHandler(); static TestHandler *instance(); void...
ProVir/WebServiceSwift
Source/WebService.h
// // WebService.h // WebServiceSwift 3.0.0 // // Created by <NAME> (ViR) on 24.08.17. // Updated to 3.0.0 by <NAME> (ViR) on 04.09.18. // Copyright © 2017 - 2018 ProVir. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for WebServiceSwift. FOUNDATION_EXPORT double WebServiceS...
Yemonade/evalcsu
code/soa/automation/datastructure/graph_traval/interaction.h
<filename>code/soa/automation/datastructure/graph_traval/interaction.h<gh_stars>10-100 #ifndef INTERACTION_H #define INTERACTION_H int Get_int(); void Initialize(); int Intercommand(); void Is_refresh(); #endif // ! INTERACTION_H
J0B10/ScreenAutoRotate
cli/display.h
#ifndef DISPLAY_H #define DISPLAY_H #include <string> #include <Windows.h> enum class DisplayRotation : int { cw_0, cw_90, cw_180, cw_270 }; int displayCount(); class Display { private: DEVMODE devmode{}; DISPLAY_DEVICE display{}; public: Display(const int device); const std::string getName() const...
msotozuniga/Eyecatch
source/grafica/Eyecatch.h
#pragma once #ifndef ENGINE #define ENGINE #include "CoreLayer/Scene.h" #include <memory> #include "App.h" namespace Graficas { class Engine { public: Engine(App& app) : m_scene(app) {} ~Engine() = default; Engine(const Engine&) = delete; Engine& operator=(const Engine&) = delete; /* * Funcion que comie...
msotozuniga/Eyecatch
source/grafica/CoreLayer/Scene.h
#pragma once #ifndef SCENE #define SCENE #include "Input.h" #include "../App.h" #include "Window.h" #include <memory> #include <array> #include <filesystem> #include <string> namespace Graficas { class Material; class Scene { public: friend class Engine; Scene(const Scene& scene) = delete; Scene& operator=(...
msotozuniga/Eyecatch
source/grafica/App.h
#pragma once #ifndef APP #define APP #include <memory> namespace Graficas { class Input; class Scene; class App { public: friend class Scene; /* * Funcion virtual que el usuario del motor DEBE implementar al heredar de esta clase. Este metodo es llamado durante el proceso de * inicio del motor. */ virt...
msotozuniga/Eyecatch
source/grafica/CoreLayer/Window.h
<gh_stars>0 #pragma once #ifndef WINDOW #define WINDOW #include <memory> #include <glm/glm.hpp> namespace Graficas { class Scene; class EventManager; /* * La clase Window provee una interfaz que permite al usario configurar y/o consultar informaci�n de la ventana de la aplicaci�n. */ class Window { public: fr...
msotozuniga/Eyecatch
source/grafica/CoreLayer/Input.h
#pragma once #ifndef INPUT #define INPUT #include <glm/glm.hpp> #include <memory> namespace Graficas { /* * La clase Input provee una interfaz que permite al usuario hacer consultas sobre distintos dispositivos(teclado y mouse). * El motor internamente usa los metodos privados para actualizar cuando corresponda el...
msotozuniga/Eyecatch
source/grafica/simple_timer.h
/** * @file simple_timer.h * @brief Some functionality to implement a basic profiler * * @author <NAME> * @license MIT */ #include <chrono> #include <iostream> #include <string> #include <iomanip> namespace Grafica { template <typename LogProfileFunction> class Timer { public: Timer(const char* name, LogPr...
liweihao-cn/serprog-lpc54114-lite
app/serprog.c
<filename>app/serprog.c #include "fsl_device_registers.h" #include "fsl_power.h" #include "fsl_reset.h" #include "fsl_spi.h" #include "LPC54114_cm4.h" #include "board.h" #include "pin_mux.h" #include "tusb.h" #include "serprog.h" #include "FreeRTOS.h" #include "task.h" #define PGMNAME "lpc-serprog" #define CMD_MAP (...
liweihao-cn/serprog-lpc54114-lite
app/retarget.c
<gh_stars>0 #include <stdint.h> #include "fsl_usart.h" int _write (int fd, const void *buf, size_t count) { uint8_t *p = (uint8_t *)buf; (void) fd; USART_WriteBlocking(USART0, p, count); if (*(p+count-1) == '\n') USART_WriteByte(USART0, '\r'); return count; }
liweihao-cn/serprog-lpc54114-lite
board/pin_mux.c
#include "fsl_common.h" #include "fsl_iocon.h" #include "pin_mux.h" void BOARD_InitPins(void) { CLOCK_EnableClock(kCLOCK_Iocon); /* USB0_VBUS */ const uint32_t port1_pin6_config = (7 << 0) | (1 << 7) | (1 << 8); IOCON_PinMuxSet(IOCON, 1U, 6U, port1_pin6_config); /* fc2 ssel3 */ const uint32_t...
liweihao-cn/serprog-lpc54114-lite
board/pin_mux.h
<filename>board/pin_mux.h #ifndef _PIN_MUX_H_ #define _PIN_MUX_H_ #if defined(__cplusplus) extern "C" { #endif void BOARD_InitPins(void); #if defined(__cplusplus) } #endif #endif /* _PIN_MUX_H_ */
liweihao-cn/serprog-lpc54114-lite
board/board.c
#include <stdint.h> #include "fsl_common.h" #include "fsl_usart.h" #include "clock_config.h" #include "board.h" void board_uart_init() { usart_config_t config; CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0); RESET_PeripheralReset(kFC0_RST_SHIFT_RSTn); USART_GetDefaultConfig(&config); config.baudRate_Bps = 1...
liweihao-cn/serprog-lpc54114-lite
board/board.h
<filename>board/board.h #ifndef _BOARD_H_ #define _BOARD_H_ #include "clock_config.h" #include "fsl_common.h" #include "fsl_gpio.h" #define BOARD_NAME "LPC54114-LITE" #if defined(__cplusplus) extern "C" { #endif /* __cplusplus */ void board_uart_init(); #if defined(__cplusplus) } #endif /* __cplusplus */ #endif /...
liweihao-cn/serprog-lpc54114-lite
app/serprog.h
/* According to Serial Flasher Protocol Specification - version 1 */ #define S_ACK 0x06 #define S_NAK 0x15 #define S_CMD_NOP 0x00 /* No operation */ #define S_CMD_Q_IFACE 0x01 /* Query interface version */ #define S_CMD_Q_CMDMAP 0x02 /* Query supported commands bitmap */ #define S_CMD_Q_PGMNAME 0x03 /* Query...