repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
kiding/DSCapture.framework | ScreenCaptureTest/ScreenCaptureTest/AppDelegate.h | #import <Cocoa/Cocoa.h>
#import <DSCapture/DSCapture.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet NSImageView *imageView;
@property (assign) IBOutlet NSButton *cgCheckBox;
- (IBAction)captureFullAction:(id)sender;
- (IBAction)... |
huangxianhui001/GradientView | GradientViewDemo/GradientViewDemo/ViewController.h | //
// ViewController.h
// GradientViewDemo
//
// Created by Alan on 2018/10/26.
// Copyright © 2018 Alan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
huangxianhui001/GradientView | GradientView/MJAGradientView.h | <gh_stars>0
//
// MJAGradientView.h
// nvwang
//
// Created by Alan on 2018/8/8.
// Copyright © 2018年 mengjitv. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
默认渐变颜色类型
- MJAGradientTypePurple: 紫色到粉红色过渡
- MJAGradientTypeYellow: 浅橘色到橘色过渡
*/
typedef NS_ENUM(NSUInteger, MJAGradientType) {
MJAGradientTy... |
binhdinh296/IdentifySub | Example/Pods/Target Support Files/IdentifySub/IdentifySub-umbrella.h | <gh_stars>0
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "MySDKCrypto.h"
FOUNDATION_EXPORT double IdentifySubVersionNumber;
FOUNDATION_EXPORT const unsigned char... |
lindianfeng/kaika_clock_firmware_new | User/Inc/at24cxx.h | <filename>User/Inc/at24cxx.h
/*
* at24cxx.h
*
* Created on: 2021年1月19日
* Author: linhao
*/
#ifndef INC_AT24CXX_H_
#define INC_AT24CXX_H_
#include <stdint.h>
#define AT24CXX_DEV_ADDRESS 0xA0
#define AT24CXX_DELAY_MS osDelay
void AT24CXX_Write(uint16_t reg_address, uint8_t data);
uint8_t AT24CXX... |
lindianfeng/kaika_clock_firmware_new | User/Inc/sht30.h | <reponame>lindianfeng/kaika_clock_firmware_new
/*
* sht30.h
*
* Created on: 2021年2月1日
* Author: linhao
*/
#ifndef INC_SHT30_H_
#define INC_SHT30_H_
#include <stdbool.h>
#include <stdint.h>
#define SHT_ADDR (0x44<<1)
uint8_t sht30_init();
uint8_t sht30_sample(float *t, float *h);
#endif /* INC_SHT30_H_ ... |
lindianfeng/kaika_clock_firmware_new | User/Src/max72xx.c | <reponame>lindianfeng/kaika_clock_firmware_new<gh_stars>0
/*
* max7219.c
*
* Created on: 2020年12月14日
* Author: lindi
*/
#include "max72xx.h"
#include <stdlib.h>
#include <string.h>
#include "main.h"
#include "utils.h"
#define CS_SET() HAL_GPIO_WritePin(MAX7219_CS_GPIO_Port, MAX7219_CS_Pin, GPIO_PIN_RESET... |
lindianfeng/kaika_clock_firmware_new | User/Src/clock.c | /*
* clock.c
*
* Created on: Dec 10, 2020
* Author: linhao
*/
#include "gpio.h"
#include "i2c.h"
#include "spi.h"
#include "adc.h"
#include "ds3231.h"
#include "max72xx.h"
#include "main.h"
#include "dht11.h"
#include "cmsis_os.h"
#include "key.h"
#include "delay.h"
#include "utils.h"
#include "sht30.h"
#in... |
lindianfeng/kaika_clock_firmware_new | User/Inc/key.h | <reponame>lindianfeng/kaika_clock_firmware_new
/*
* key.h
*
* Created on: Dec 10, 2020
* Author: linhao
*/
#ifndef KEY_H_
#define KEY_H_
#include <stdint.h>
#include "stm32f1xx.h"
#define KEY_ON 0
#define KEY_OFF 1
uint8_t Key_Scan(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
#endif /* KEY_H_ */
|
lindianfeng/kaika_clock_firmware_new | User/Inc/delay.h | /*
* delay.h
*
* Created on: Dec 10, 2020
* Author: linhao
*/
#ifndef DELAY_H_
#define DELAY_H_
#include "stm32f1xx.h"
#include <stdint.h>
uint32_t DWT_Init(void);
void DWT_DelayUs(uint32_t us);
void DWT_DelayMs(uint32_t ms);
static inline uint32_t DWT_MaxSec(void)
{
return (UINT32_MAX / SystemCoreCloc... |
lindianfeng/kaika_clock_firmware_new | User/Src/dht11.c | /*
* dht11.c
*
* Created on: Jan 9, 2021
* Author: lindianfeng
*/
#include "dht11.h"
#include "delay.h"
/**
* @brief DHT11 输出模式
*/
static inline void DHT11_Mode_OUT_PP(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Pin = DHT11_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_Init... |
lindianfeng/kaika_clock_firmware_new | User/Src/at24cxx.c | /*
* at24cxx.c
*
* Created on: 2021年1月19日
* Author: linhao
*/
#include "at24cxx.h"
#include "cmsis_os.h"
#include "stm32f1xx_hal.h"
extern I2C_HandleTypeDef hi2c2;
void AT24CXX_Write(uint16_t reg_address, uint8_t data)
{
HAL_I2C_Mem_Write(&hi2c2, AT24CXX_DEV_ADDRESS, reg_address, I2C_MEMADD_SIZE_16BIT, ... |
lindianfeng/kaika_clock_firmware_new | User/Inc/utils.h | <filename>User/Inc/utils.h
/*
* utils.h
*
* Created on: Dec 11, 2020
* Author: linhao
*/
#ifndef UTILS_H_
#define UTILS_H_
#define MAX_DEBUG 0 ///< Enable or disable (default) debugging output from the MD_MAX72xx library
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ... |
lindianfeng/kaika_clock_firmware_new | User/Src/sht30.c | <gh_stars>0
/*
* sht30.c
*
* Created on: 2021年2月1日
* Author: linhao
*/
#include "sht30.h"
#include "cmsis_os.h"
#include "stm32f1xx_hal.h"
extern I2C_HandleTypeDef hi2c2;
//I2C写2字节命令
uint8_t i2c_write_cmd(uint16_t cmd)
{
uint8_t cmd_buff[2] = { 0, 0 };
cmd_buff[0] = cmd >> 8;
cmd_buff[1] = cmd;
r... |
lindianfeng/kaika_clock_firmware_new | User/Src/key.c | /*
* key.c
*
* Created on: Jan 18, 2021
* Author: linhao
*/
#include "key.h"
uint8_t Key_Scan(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
{
if (HAL_GPIO_ReadPin(GPIOx, GPIO_Pin) == KEY_ON)
{
/*等待按键释放 */
while (HAL_GPIO_ReadPin(GPIOx, GPIO_Pin) == KEY_ON)
;
return KEY_ON;
}
else
{
... |
lindianfeng/kaika_clock_firmware_new | User/Inc/dht11.h | <reponame>lindianfeng/kaika_clock_firmware_new<filename>User/Inc/dht11.h
/*
* dht11.h
*
* Created on: Jan 9, 2021
* Author: lindianfeng
*/
#ifndef INC_DHT11_H_
#define INC_DHT11_H_
#include "main.h"
#define DHT11_OUT_1 HAL_GPIO_WritePin(DHT11_GPIO_Port, DHT11_Pin, GPIO_PIN_SET)
#define DHT11_OUT_0 ... |
lindianfeng/kaika_clock_firmware_new | User/Src/delay.c | /*
* delay.c
*
* Created on: Jan 11, 2021
* Author: linhao
*/
#include "delay.h"
#include "stm32f1xx_hal.h"
//void delay_us(uint32_t us) {
// uint32_t delay = (HAL_RCC_GetHCLKFreq() / 4000000 * us);
// while (delay--) {
// ;
// }
//}
uint32_t DWT_Init(void)
{
if (!(CoreDebug->DEMCR & CoreDebug_DEMCR_TR... |
rwaithera/larabook | node_modules/gulp-sass/node_modules/node-sass/src/custom_importer_bridge.h | <filename>node_modules/gulp-sass/node_modules/node-sass/src/custom_importer_bridge.h
#ifndef CUSTOM_IMPORTER_BRIDGE_H
#define CUSTOM_IMPORTER_BRIDGE_H
#include <nan.h>
#include <sass_context.h>
#include "callback_bridge.h"
using namespace v8;
typedef Sass_Import_List SassImportList;
class CustomImporterBridge : pub... |
rwaithera/larabook | node_modules/gulp-sass/node_modules/node-sass/src/sass_types/boolean.h | #ifndef SASS_TYPES_BOOLEAN_H
#define SASS_TYPES_BOOLEAN_H
#include <nan.h>
#include "value.h"
#include "sass_value_wrapper.h"
namespace SassTypes
{
using namespace v8;
class Boolean : public Value {
public:
static Boolean& get_singleton(bool);
static Handle<Function> get_constructor();
Sas... |
rwaithera/larabook | node_modules/gulp-sass/node_modules/node-sass/src/callback_bridge.h | #ifndef CALLBACK_BRIDGE_H
#define CALLBACK_BRIDGE_H
#include <vector>
#include <nan.h>
#include <condition_variable>
#include <algorithm>
#define COMMA ,
using namespace v8;
template <typename T, typename L = void*>
class CallbackBridge {
public:
CallbackBridge(NanCallback*, bool);
virtual ~CallbackBridge... |
rwaithera/larabook | node_modules/gulp-sass/node_modules/node-sass/src/sass_types/number.h | #ifndef SASS_TYPES_NUMBER_H
#define SASS_TYPES_NUMBER_H
#include <nan.h>
#include "sass_value_wrapper.h"
namespace SassTypes
{
using namespace v8;
class Number : public SassValueWrapper<Number> {
public:
Number(Sass_Value*);
static char const* get_constructor_name() { return "SassNumber"; }
... |
rwaithera/larabook | node_modules/gulp-sass/node_modules/node-sass/src/sass_types/factory.h | <gh_stars>100-1000
#ifndef SASS_TYPES_FACTORY_H
#define SASS_TYPES_FACTORY_H
#include <nan.h>
#include <sass_values.h>
#include "value.h"
namespace SassTypes
{
using namespace v8;
// This is the guru that knows everything about instantiating the right subclass of SassTypes::Value
// to wrap a given Sass_Value ... |
invincible1900/C-examples | misc/log/main.c | /****************************************************************
* Desc: 打印有颜色的日志
*
* Author: X++D
*
****************************************************************/
#include <stdio.h>
#define NONE "\033[m"
#define RED "\033[0;32;31m"
#define LIGHT_RED "\033[1;31m"
#define GREEN "\033[0;32;32m"
#define LIGHT_GR... |
invincible1900/C-examples | misc/lib-test/dynamic-lib/create-lib/libwow.c | #include <stdio.h>
#define NONE "\033[m"
#define YELLOW "\033[1;33m"
void wow(){
printf(YELLOW"Wow ~\n"NONE);
return;
}
|
invincible1900/C-examples | memory/read_mem.c | #include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#define PAGE_SIZE 4096
void hexdump(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0... |
invincible1900/C-examples | exec/main.c | #include <unistd.h>
#include <stdio.h>
#include <wait.h>
int main(){
int ret;
ret = fork();
if(ret == 0){
char * argv[] = {"ls", "-l", NULL};
execve("/bin/ls", argv, NULL);
perror("err");
}
ret = fork();
if(ret == 0){
execl("/bin/ls", "ls", "-l", NULL);
perror("err");
}
wait(NULL);
wait(NULL);
}... |
invincible1900/C-examples | signal/main.c | <gh_stars>1-10
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
void sig_handler(int sig){
printf("sig: %d\n", sig);
return;
}
int main(){
printf("pid: %d\n", getpid());
for(int i = SIGHUP; i<= SIGRTMAX; i++){
signal(i, sig_handler);
}
while(1){
... |
invincible1900/C-examples | kvm/1/main.c | /*
* Creating a KVM-based VM basically needs 7 steps:
*
* 1. Open the KVM device, `kvmfd=open("/dev/kvm", O_RDWR|O_CLOEXEC)`
* 2. Do create a VM, `vmfd=ioctl(kvmfd, KVM_CREATE_VM, 0)`
* 3. Set up memory for VM guest, `ioctl(vmfd, KVM_SET_USER_MEMORY_REGION, ®ion)`
* 4. Create a virtual CPU for the VM, `vcpufd... |
invincible1900/C-examples | time/sleep.c | <gh_stars>1-10
/*
SLEEP(3) Linux Programmer's Manual SLEEP(3)
NAME top
sleep - sleep for a specified number of seconds
SYNOPSIS top
#include <unistd.h>
unsigned int sleep(unsigned int seconds);
*/
#include <unistd.h>
#include <stdio.h>
int main(... |
invincible1900/C-examples | time/nanosleep.c | /*
NANOSLEEP(2) Linux Programmer's Manual NANOSLEEP(2)
NAME top
nanosleep - high-resolution sleep
SYNOPSIS top
#include <time.h>
int nanosleep(const struct timespec *req, struct timespec *rem);
...
DESCRIPTION top
nanosleep() suspends ... |
invincible1900/C-examples | elf/1/main.c | <reponame>invincible1900/C-examples
/************************************************************
* Desc: Open an elf file and read elf header ( no error check )
*
* Author: X++D
*
***********************************************************/
#include <elf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.... |
invincible1900/C-examples | elf/2/main.c | /************************************************************
* Desc: mmap an elf file and read elf header ( no error check )
*
* Author: X++D
*
***********************************************************/
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#in... |
invincible1900/C-examples | shift/main.c | <filename>shift/main.c
#include <stdio.h>
int main(){
int x = 0xe;
int y = x << (32 - 4) >> (32 -4);
int z = x << (32 - 5) >> (32 - 5);
printf("0x%x, %d\n", x, x);
printf("0x%x, %d\n", y, y);
printf("0x%x, %d\n", z, z);
// overflow
printf("0x%lx\n", 1<<32);
// fix 1
printf("0x%lx\n", 1UL<<32);
// fix 2
... |
invincible1900/C-examples | misc/lib-test/static-lib/use-lib/main.c | #include "libwow.h"
int main(){
wow();
return 0;
}
|
invincible1900/C-examples | elf/4/elf.c | <gh_stars>1-10
/*****************************************************
*
* Desc: 插入一个 section 到 ELF 文件 (草稿代码, 方便自己抄)
*
* Author: X++D
*
*****************************************************/
#include <elf.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#inc... |
invincible1900/C-examples | time/gettimeofday.c | <reponame>invincible1900/C-examples
/*
clock_gettime
http://man7.org/linux/man-pages/man2/clock_getres.2.html
gettimeofday
http://man7.org/linux/man-pages/man2/gettimeofday.2.html
struct timeval {
time_t tv_sec; // seconds
suseconds_t tv_usec; // microseconds
};
*/
#include <sys/types.h>
#includ... |
invincible1900/C-examples | memory/mmu.c | <reponame>invincible1900/C-examples<filename>memory/mmu.c
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <fcntl.h>
#include <assert.h>
#include <inttypes.h>
#include <sys/types.h>
#include <unistd.h>
#define PAGE_SHIFT 12
#define PAGE_SIZE (1 << PAGE_SHIFT)
#define PFN_PRESE... |
invincible1900/C-examples | memory/read_phy_mm.c | <gh_stars>1-10
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("Usage: %s <phys_addr> <offset>\n", argv[0]);
return 0;
}
off_t offset = strtoul(argv[1], NULL, 0);
size_t len = ... |
invincible1900/C-examples | hexdump/2/main.c | /****************************************************************
*
* Desc: hexdump ,附带 ascii 码
*
* Author: not me
*
**************************************************************/
#include <stdio.h>
#include <string.h>
void hexdump(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\... |
invincible1900/C-examples | misc/err-handler/main.c | // https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
#include <stdio.h>
#include <errno.h>
#include <string.h>
/*********************************
$ ./a.out
[-] main:43
[-] main:44, Invalid argument
$ man errno
$ man strerror
*********************************/
#define SAFE_1(expr) \
while(1) { \... |
invincible1900/C-examples | portio/main.c | <reponame>invincible1900/C-examples<filename>portio/main.c
// man lspci
// man iopl
#include <sys/io.h>
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#define CONFIG_ADDR 0xCF8
#define CONFIG_DATA 0xCFC
#define VENDOR_ID 0x8086
#define EHCI_PRODUCT_ID 0x293A
#define PCI_BASE_ADDR ... |
invincible1900/C-examples | file/access.c | #include <unistd.h>
#include <stdio.h>
/***************************
access
0-检查文件是否存在
1-检查文件是否可运行
2-检查文件是否可写访问
4-检查文件是否可读访问
6-检查文件是否可读/写访问
*****************************/
int file_exists(char *filename)
{
return (access(filename, 0) == 0);
}
int main(){
if(file_exists("Makefile")){
printf("... |
invincible1900/C-examples | thread/1/main.c | <filename>thread/1/main.c
// https://www.educative.io/edpresso/how-to-create-a-simple-thread-in-c
/*
man pthread_create
#include <pthread.h>
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg);
The new thread te... |
invincible1900/C-examples | misc/mkstemp/main.c | <reponame>invincible1900/C-examples
/*****************************************************************************************
* Desc: mkstemp 创建临时文件示例
*
* Author: X++D
*
*****************************************************************************************/
#include <stdlib.h>
#include <unistd.h>
#include <str... |
invincible1900/C-examples | setjmp/main.c | <reponame>invincible1900/C-examples
#include <setjmp.h>
#include <stdio.h>
jmp_buf env;
void A(){
printf("Now A\n");
longjmp(env,1); //这里跳回到if中继续执行
}
void B(){
printf("Now B\n");
}
int main()
{
if (!setjmp(env)) //setjmp初次返回0,第二次回来返回的就是1
A();
else
B();
return 1;
}
/**********... |
invincible1900/C-examples | elf/3/main.c | /************************************************************
* Desc: mmap an elf file and read elf section headers ( no error check )
*
* Author: X++D
*
***********************************************************/
#include <elf.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/mman.h>
#... |
invincible1900/C-examples | sign/main.c | #include <stdio.h>
#include <assert.h>
#include <stdlib.h>
long sign_extend(long data, int width){
int shift = sizeof(long) * 8 - width;
return data << shift >> shift;
}
long sign_extend_safe(long data, int width){
if(width > 64 || width < 0){
exit(-1);
}
if(width == 64){
return data;
}
if((data >> (wid... |
invincible1900/C-examples | bugs/main.c | // 移位运算潜在溢出的bug
#include <stdio.h>
#define MASK_64 1<<63
#define MASK_64_OK 1lu<<63
//#define MASK_32 1<<32
//#define MASK_32_OK 1<<32
int func1(){
long ff = 0x8000000000000000;
if(ff & MASK_64){
printf("True\n");
}else{
printf("False\n");
}
}
int func2(){
long ff = 0x8000000000000000;
if(ff & MASK_... |
invincible1900/C-examples | misc/lib-test/dynamic-lib/create-lib/libwow.h | <filename>misc/lib-test/dynamic-lib/create-lib/libwow.h
#ifndef _LIB_WOW_H
#define _LIB_WOW_H
void wow();
#endif
|
invincible1900/C-examples | hexdump/1/main.c | #include <stdio.h>
#include <stdint.h>
#include <string.h>
void hexdump(char *buf, int len){
int i;
for(i = 0; i < len; i++){
printf("%02x ", buf[i]);
if( (i+1) % 8 == 0){
printf("\t");
}
if( (i+1) % 16 == 0){
... |
invincible1900/C-examples | thread/2/main.c | <filename>thread/2/main.c
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
//线程函数
void *test(void *ptr)
{
int i;
for(i=0;i<8;i++)
{
printf("the pthread running ,count: %d\n",i);
sleep(1);
}
}
int main(void)
{
pthread_t pId;
int i,ret;
//创建子... |
invincible1900/C-examples | misc/lib-test/dynamic-lib/use-lib/2/main.c | #include <dlfcn.h>
#include <stdio.h>
void (*wow)(void);
int main(){
void *h;
h = dlopen("./libwow.so", RTLD_NOW | RTLD_GLOBAL);
if(!h){
printf("error dlopen\n");
return -1;
}
wow = dlsym(h, "wow");
if(dlerror() != NULL){
printf("error dlsym\n");
return -1;
}
wow();
dlclose(h);
dlerror();
retur... |
miho/VMF-Text-Tests | test-code/transpose-blocking.c | //
// Each transpose function must have a prototype of the form:
// void trans(int M, int N, int A[N][M], int B[M][N]);
//
// A transpose function is evaluated by counting the number of misses
// on a 1KB direct mapped cache with a block size of 32 bytes.
// Author: <NAME>
// (note on style: in trans.c and csim.c, I co... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/drv8323/DRV8323_SPI.c | <reponame>ben5en/MSP430_sensorlessBLDC
// ----------------------------------------------------------------------
// Info
// ----------------------------------------------------------------------
/*
*
* Filename: DRV8323_SPI.c
*
* Author: (c) 2019, <NAME>
*
* Target: XXX
*
* Notes:
*
*/
// --... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/bldc/bldc_1xPwm.h | <filename>F5529_sensorlessBLDC/bldc/bldc_1xPwm.h
#ifndef BLDC_BLDC_1XPWM_H_
#define BLDC_BLDC_1XPWM_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/fifo.h | #ifndef FIFO_H_
#define FIFO_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: fifo.h
//
// MIT License
//
// Copyright (c) 201... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/drv8323/DRV8323.c | // ----------------------------------------------------------------------
// Info
// ----------------------------------------------------------------------
/*
*
* Filename: DRV8323.c
*
* Author: (c) 2019, <NAME>
*
* Target: XXX
*
* Notes:
*
*/
// ---------------------------------------------... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/bldc/step_resp.h | #ifndef BLDC_STEP_RESP_H_
#define BLDC_STEP_RESP_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: step_resp.h
//
// MIT License
... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/bldc/status.h | <gh_stars>1-10
#ifndef BLDC_STATUS_H_
#define BLDC_STATUS_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: status.h
//
// MIT Lic... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/unused_interrupts.c | #include <driverlib.h>
// *****************************************************************************
// MSP430F5529 Unused Vectors
// *****************************************************************************
// UNUSED_HWI_ISR()
//
// The default linker command file created by CCS links all interrupt vectors to
... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/main.c | <reponame>ben5en/MSP430_sensorlessBLDC
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: main.c
//
// MIT License
//
// Copyright (c) 2019 <NAME>
//
// Permission is hereby g... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/F5529_BLDC_Settings.h | <gh_stars>1-10
#ifndef F5529_BLDC_SETTINGS_H_
#define F5529_BLDC_SETTINGS_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: F5529_BL... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/ramfunc.h | <filename>F5529_sensorlessBLDC/ramfunc.h
#ifndef RAMFUNC_H_
#define RAMFUNC_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: ramfun... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/bldc/bldc.c | // ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: bldc.c
//
// MIT License
//
// Copyright (c) 2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person o... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/drv8323/DRV8323_defs.h | #ifndef DRV8323_DEFS_H_
#define DRV8323_DEFS_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// Info
// ----------------------------------------------------------------------
/*
*
* Filename: DRV8323_defs.h
*
* Author: (c) 2019, <NA... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/Serial_Cmd_Monitor.h | <reponame>ben5en/MSP430_sensorlessBLDC
#ifndef SERIAL_CMD_MONITOR_H_
#define SERIAL_CMD_MONITOR_H_
void ClearBufferRelatedParam();
void receivedDataCommand(unsigned char d);
#endif
|
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/config.h | <filename>F5529_sensorlessBLDC/config.h<gh_stars>1-10
#ifndef CONFIG_H_
#define CONFIG_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filen... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/bldc/pi.h | <reponame>ben5en/MSP430_sensorlessBLDC
#ifndef BLDC_PI_H_
#define BLDC_PI_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: pi.h
//... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/bldc/ramp.h | <gh_stars>1-10
#ifndef BLDC_RAMP_H_
#define BLDC_RAMP_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: ramp.h
//
// MIT License
... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/Serial_Cmd_Monitor.c | <reponame>ben5en/MSP430_sensorlessBLDC
#include <msp430.h>
#include "Serial_Cmd_Monitor.h"
#define TEMP_THRESHOLD 4
#define RW_CMD 0x80
#define EXTENSION_BYTE 0x07
//PERIPHERAL
//
//RW CMD TYPE
#define READ 1
#define WRITE 0
//ENDIANNESS
#define BIG_ENDIAN 1
#define LITTLE_ENDIAN... |
ben5en/MSP430_sensorlessBLDC | F5529_sensorlessBLDC/bldc/openLoop.h | #ifndef BLDC_OPENLOOP_H_
#define BLDC_OPENLOOP_H_
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------
// info and license
// ----------------------------------------------------------------------
//
// filename: openLoop.h
//
// MIT License
//
... |
JavalParel/AEM | Newton-Raphson.c | #include<stdio.h>
float expression(float x)
{
//enter your expression here
//For power - pow(base, power)
//for base 10 use- log10(x)
return (pow(x,4)-12*x+7);
}
float intigration(float x)
{
//enter your intigrated expression here
//For power - pow(base, power)
//for base 10 use- log10(x)
return ... |
JavalParel/AEM | Bi-Section.c | #include<stdio.h>
#include<math.h>
float expression(float x)
{
//enter your expression here
//For power use like that - pow(base, exp)
return (pow(x,5)-3*x*x+6*x-15);
}
int main(){
int x,itr,start,a,b,j;
float xn[100],f[100],a_new,b_new,eq;
printf("Enter starting point :- ");
scanf("%d",&start);
pr... |
JavalParel/AEM | Elulers.c | #include<stdio.h>
#include<math.h>
float equation(float x,float y)
{
return ((y-x)/(y+x));
}
int main(){
float x[100],y[100],dydx[100],y_new[100],h;
printf("Enter value of y :-");
scanf("%f",&y[0]);
printf("Enter value of x :-");
scanf("%f",&x[0]);
printf("Enter value of h :-");
scanf("%f",&h);
y_new[0]... |
JavalParel/AEM | Gauss-Seidal.c | <reponame>JavalParel/AEM<filename>Gauss-Seidal.c
#include<stdio.h>
int main(){
int a[5],b[5],c[5],d[5];
float x[100],y[100],z[100],xn,yn,zn;
xn=yn=zn=0;
printf("Eg\na1*x+b1*y+c1*z=d1\na2*x+b2*y+c2*z=d2\na3*x+b3*y+c3*z=d3\n");
for (int i = 0; i < 3; i++)
{
printf("Enter a%d :- ",i+1 );
scanf("%d",&a[i]);
... |
ServError/Revive | ReviveXR/Common.h | #pragma once
#include "OVR_CAPI.h"
#include "microprofile.h"
#include <openxr/openxr.h>
#include <openxr/openxr_reflection.h>
#include <assert.h>
#include <string>
#if 0
#include <Windows.h>
#define REV_TRACE(x) OutputDebugStringA("Revive: " #x "\n");
#else
#define REV_TRACE(x) MICROPROFILE_SCOPEI("Revive", #x, 0xff... |
ServError/Revive | ReviveXR/Session.h | <reponame>ServError/Revive<gh_stars>1000+
#pragma once
#include "OVR_CAPI.h"
#include "Extras/OVR_Math.h"
#include <openxr/openxr.h>
#include <atomic>
#include <condition_variable>
#include <map>
#include <memory>
#include <mutex>
#include <shared_mutex>
#include <list>
#include <vector>
#include <utility>
class Run... |
ServError/Revive | ReviveXR/Runtime.h | <reponame>ServError/Revive<filename>ReviveXR/Runtime.h<gh_stars>1000+
#pragma once
#include "Common.h"
#include "OVR_CAPI.h"
#include <openxr/openxr.h>
#include <map>
#include <vector>
class Runtime
{
public:
static Runtime& Get();
enum Hack
{
// Hack: SteamVR runtime doesn't support the Oculus Touch interacti... |
ServError/Revive | ReviveXR/SwapChain.h | #pragma once
#include "OVR_CAPI.h"
#include <openxr/openxr.h>
#define REV_DEFAULT_SWAPCHAIN_DEPTH 3
struct ovrTextureSwapChainData
{
ovrTextureSwapChainDesc Desc;
XrSwapchain Swapchain;
XrSwapchainImageBaseHeader* Images;
uint32_t Length;
uint32_t CurrentIndex;
};
struct ovrMirrorTextureData
{
ovrMirrorTextur... |
nsscreencast/102-refactoring-view-controllers | CleanTableViews/CleanTableViews/FollowersViewController.h | <reponame>nsscreencast/102-refactoring-view-controllers<gh_stars>0
//
// FollowersViewController.h
// CleanTableViews
//
// Created by ben on 1/5/14.
// Copyright (c) 2014 NSScreencast. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FollowersViewController : UIViewController
@property (nonatomic, str... |
nsscreencast/102-refactoring-view-controllers | CleanTableViews/CleanTableViews/TwitterAccountStore.h | //
// TwitterAccountStore.h
// CleanTableViews
//
// Created by ben on 1/6/14.
// Copyright (c) 2014 NSScreencast. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Accounts/Accounts.h>
extern NSString * const TwitterAccountStoreErrorDomain;
NS_ENUM(NSInteger, TwitterAccountStoreErrorCodes) {
... |
nsscreencast/102-refactoring-view-controllers | CleanTableViews/CleanTableViews/TwitterAPIClient.h | //
// TwitterAPIClient.h
// CleanTableViews
//
// Created by ben on 1/6/14.
// Copyright (c) 2014 NSScreencast. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Accounts/Accounts.h>
#import <Social/Social.h>
@interface TwitterAPIClient : NSObject
- (void)fetchFollowersForAccount:(ACAccount *)ac... |
nsscreencast/102-refactoring-view-controllers | CleanTableViews/CleanTableViews/TwitterUserCell.h | <filename>CleanTableViews/CleanTableViews/TwitterUserCell.h<gh_stars>0
//
// TwitterUserCell.h
// CleanTableViews
//
// Created by ben on 1/5/14.
// Copyright (c) 2014 NSScreencast. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TwitterUserCell : UITableViewCell
@property (nonatomic, strong) IBOutlet... |
corleonechensiyu/ncnn-8-12 | src/layer/lstmnew.h | <reponame>corleonechensiyu/ncnn-8-12
#ifndef LAYER_LSTMNEW_H
#define LAYER_LSTMNEW_H
#include "layer.h"
namespace ncnn {
class LstmNew : public Layer
{
public:
LstmNew();
virtual int load_param(const ParamDict& pd);
virtual int load_model(const ModelBin& mb);
virtual int forward(const Mat& bottom_... |
corleonechensiyu/ncnn-8-12 | src/layer/x86/convolution_3x3.h | <reponame>corleonechensiyu/ncnn-8-12<gh_stars>1-10
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
// Copyright (C) 2019 BUG1989. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the... |
corleonechensiyu/ncnn-8-12 | src/layer/reverse.h | #ifndef LAYER_REVERSE_H
#define LAYER_REVERSE_H
#include "layer.h"
namespace ncnn {
class Reverse : public Layer
{
public:
Reverse();
// virtual int forward_inplace(Mat& bottom_top_blob, const Option& opt) const;
virtual int forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const;
};
... |
corleonechensiyu/ncnn-8-12 | examples/ocr.h | #include <stdio.h>
#include <vector>
#include "platform.h"
#include "net.h"
#include <iostream>
#include <string>
#include "benchmark.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <cpu.h>
#include <unistd.h>
using namespace std;
static int detect(const cv::Mat& bgr , vector<float>... |
corleonechensiyu/ncnn-8-12 | src/layer/x86/convolution_sgemm.h | <filename>src/layer/x86/convolution_sgemm.h
// BUG1989 is pleased to support the open source community by supporting ncnn available.
//
// Copyright (C) 2019 BUG1989. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. Y... |
corleonechensiyu/ncnn-8-12 | src/layer/ctcgreedydecoder.h | #ifndef LAYER_CTCDECODER_H
#define LAYER_CTCDECODER_H
#include "layer.h"
namespace ncnn{
class CTCGreedyDecoder : public Layer
{
public:
CTCGreedyDecoder();
virtual int load_param(const ParamDict& pd);
//virtual int forward_inplace(Mat& bottom_top_blob,const Option& opt) const;
virtual int forward(const Mat... |
SreejitS/dataStructures | codes/recursion/6combination.c | /*
nCr = n! /[ r!*(n-r)! ]
1. either compute each factorial recursively and then divide
2. use pascals triangle : nCr = n-1Cr-1 + n-1Cr
*/
#include <stdio.h>
int fact(int n)
{
if (n == 0)
return 1;
return fact(n - 1) * n;
}
int nCr(int n, int r)
{
int num, den;
num = fact(n);
den = fact(r... |
SreejitS/dataStructures | codes/recursion/2factorial.c | <gh_stars>0
#include <stdio.h>
/*
fact(n) = fact(n-1)*n if n>0 or 1 if n == 0
This is tail recursion
*/
//large number problematic
//takes O(n) time and O(n) space
unsigned long factorial_recursive(unsigned int n)
{
if (n == 0)
{
return 1;
}
return factorial_recursive(n - 1) * (unsigned long)n... |
SreejitS/dataStructures | codes/recursion/3power.c | #include <stdio.h>
/*
m^n = m^(n-1)*m if n>0 or 1 if n==0
This is nested recursion
the number of calling can be halved by checking if the n is odd or even.
if even: power(m*m,n/2)
if odd: m*power(m*m,(n-1)/2)
*/
//here the number of multiplications are n
unsigned long power(unsigned int m, unsigned int n)
{
if (n... |
SreejitS/dataStructures | codes/arrays/array.c | <reponame>SreejitS/dataStructures
#include <stdio.h>
#include <stdlib.h>
struct Array
{
int array[10];
int length;
int size;
};
void display(struct Array arr)
{
for (int i = 0; i < arr.length; i++)
{
printf("%d ", arr.array[i]);
}
}
void append(struct Array *arr, int value)
{
if (... |
SreejitS/dataStructures | codes/recursion/1sumN.c | <reponame>SreejitS/dataStructures<gh_stars>0
#include <stdio.h>
/*
recursive definition
sum(n) = 0 if n=0 or sum(n-1)+n if n>0
better use n*(n+1)/2 as it takes O(1) constant time.
this is tail recursion
*/
//limited by stack depth, will give seg fault for large numbers
//This takes O(n) time and O(n) space
unsig... |
SreejitS/dataStructures | codes/recursion/4taylorSeries.c | <filename>codes/recursion/4taylorSeries.c
#include <stdio.h>
/*
e^x = 1 + (x/1) + (x^2/2!) + (x^3/3!) + .... n times
e(x,n) = 1, n=0 or r=e(x,n-1); p = p*x; f = f*n
*/
double e(unsigned int x, unsigned int n)
{
static double power = 1;
static double fact = 1;
if (n == 0)
{
return 1;
}
... |
mickey9801/MultiButtons | src/MultiButtons.h | /**
* MultiButtons Library
* Copyright (c) 2019 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, mo... |
KalilDev/sway-borders | sway/commands/border_images.c | #include <wlr/render/wlr_renderer.h>
#include "cairo.h"
#include "log.h"
#include "sway/commands.h"
#include "sway/config.h"
#include "sway/output.h"
static void apply_border_textures_for_class(struct border_textures *class) {
struct sway_output *output = root->outputs->items[0];
struct wlr_renderer *renderer = wlr_... |
justi-a-joao/minimap2 | hit.c | <filename>hit.c
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "mmpriv.h"
#include "kalloc.h"
#include "khash.h"
static inline void mm_cal_fuzzy_len(mm_reg1_t *r, const mm128_t *a)
{
int i;
r->mlen = r->blen = 0;
if (r->cnt <= 0) return;
r->mlen = r->blen = a[r->as].y>>32&0xff;
for (i = r->as ... |
KhunLam/OC-weibo | OC_weibo/OC_weibo/Classes/Module/Main/View/LKVistorView.h | <gh_stars>0
//
// LKVistorView.h
// OC_weibo
//
// Created by lamkhun on 15/10/27.
// Copyright © 2015年 lamKhun. All rights reserved.
//
#import <UIKit/UIKit.h>
//设置代理
@protocol LKVistorViewDalegate <NSObject>
@optional
-(void)vistorViewRegistClick;
-(void)vistorViewLoginClick;
@end
@interface LKVistorView ... |
KhunLam/OC-weibo | OC_weibo/OC_weibo/Classes/Module/Home/Controller/LKHomeViewController.h | //
// LKHomeViewController.h
// OC_weibo
//
// Created by lamkhun on 15/10/27.
// Copyright © 2015年 lamKhun. All rights reserved.
//
#import "LKBaseTableViewController.h"
@interface LKHomeViewController : LKBaseTableViewController
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.