repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
lzx8589561/X-UI
main/ui/page/dialplate/dialplate_view.h
<gh_stars>1-10 #ifndef __DIALPLATE_VIEW_H #define __DIALPLATE_VIEW_H #ifdef __cplusplus extern "C" { #endif #include "lvgl/lvgl.h" typedef struct dialplate_view_t *dialplate_view_heandler; typedef struct { lv_obj_t* cont; lv_obj_t* lableValue; lv_obj_t* lableUnit; } SubInfo_t; struct dialplate_view_t{ ...
lzx8589561/X-UI
main/ui/page/start_up/start_up.c
#include <stdlib.h> #include "start_up.h" #include "start_up_view.h" #include "../../ui_page_manager.h" #include "../status_bar/status_bar.h" static page_base_handler pb = NULL; startup_view_handler startup_view_ui = NULL; static void start_up_on_timer(lv_timer_t* timer); static void start_up_on_event(lv_event_t* eve...
lzx8589561/X-UI
main/ui/page/dialplate/dialplate.h
<gh_stars>1-10 #ifndef __DIALPLATE_PRESENTER_H #define __DIALPLATE_PRESENTER_H #ifdef __cplusplus extern "C" { #endif #include "lvgl/lvgl.h" /** * 定义页面单独的一些交互实体 */ #ifdef __cplusplus } /*extern "C"*/ #endif #endif
lzx8589561/X-UI
main/ui/app_page_factory.c
<reponame>lzx8589561/X-UI #include "ui_page_manager.h" /** * 页面定义 * @param name 页面名称 * @return 页面处理器 */ page_base_handler pm_create_page(const char* name){ APP_CLASS_MATCH(start_up); APP_CLASS_MATCH(dialplate); return NULL; }
lzx8589561/X-UI
main/controller/dialplate_controller.c
#include <sys/cdefs.h> #include <stdio.h> #include "esp_system.h" #include "esp_event.h" #include "esp_log.h" #include <freertos/task.h> #include "dialplate_controller.h" #include "../ui/ui_page_manager.h" #include "../ui/app_entity_def.h" static int a1 = 1; static int a2 = 1; static int a3 = 1; /*** * 消息回调接收 (由UI线程...
maxux/zdbfs
src/zdbfs.c
<gh_stars>0 #define FUSE_USE_VERSION 34 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <time.h> #include <fuse_lowlevel.h> #include <hiredis/hiredis.h> #include <signal.h> #include <linux/fs.h> #include <sys/epoll.h> #include <sys/ioctl.h> ...
maxux/zdbfs
src/init.h
#ifndef ZDBFS_INIT_H #define ZDBFS_INIT_H int zdbfs_init_args(zdbfs_t *fs, struct fuse_args *args, struct fuse_cmdline_opts *fopts); int zdbfs_init_runtime(zdbfs_t *fs); int zdbfs_init_free(zdbfs_t *fs, struct fuse_cmdline_opts *fopts); #endif
maxux/zdbfs
src/system.c
<gh_stars>1-10 #define FUSE_USE_VERSION 34 #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <fuse_lowlevel.h> #include <hiredis/hiredis.h> #include <signal.h> #include <string.h> #include <ctype.h> #include <stddef.h> #include "zdbfs.h" #define UNW_LOCAL_ONLY #include <libunwind.h> // // error hand...
maxux/zdbfs
src/system.h
<gh_stars>1-10 #ifndef ZDBFS_SYSTEM_H #define ZDBFS_SYSTEM_H void zdbfs_system_fulldump(void *_data, size_t len); void zdbfs_system_backtrace(); void zdbfs_system_sighandler(int signal); int zdbfs_system_signal(int signal, void (*function)(int)); void warns(char *help, char *value); void d...
maxux/zdbfs
src/init.c
#define FUSE_USE_VERSION 34 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fuse_lowlevel.h> #include <stddef.h> #include <hiredis/hiredis.h> #include <errno.h> #include "zdbfs.h" #include "init.h" #include "system.h" // // argument options // #define zdb_opt_field(f) offsetof...
maxux/zdbfs
src/inode.h
#ifndef ZDBFS_INODE_H #define ZDBFS_INODE_H int zdbfs_inode_init(zdbfs_t *fs); size_t zdbfs_inode_dirlist_id(const char *name); void zdbfs_inode_dump(zdb_inode_t *inode); size_t zdbfs_offset_to_block(off_t off); size_t zdbfs_inode_dir_size(zdb_dir_t *dir); size_t zdbfs_inode_file_size(zdb...
maxux/zdbfs
src/cache.h
#ifndef ZDBFS_CACHE_H #define ZDBFS_CACHE_H int zdbfs_cache_enabled(zdbfs_t *fs); double zdbfs_cache_time_now(); inocache_t *zdbfs_cache_get(fuse_req_t req, uint64_t ino); inocache_t *zdbfs_cache_add(fuse_req_t req, uint64_t ino, zdb_inode_t *inode); int zdbfs_cache_release(fuse_req_t req, ino...
AnnikaLau/cq-formation-openacc
cpp/step3.kernels/matrix_functions.h
<reponame>AnnikaLau/cq-formation-openacc<gh_stars>1-10 /* * Copyright 2016 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/license...
followthwhiterabbit/GLCD_slideshow_project
GLCD.c
///////////////////////////////////////////////////////////////////////// //// GLCD.C //// //// //// //// This file contains drivers for using a Hantronix HDM64GS12 with //// //// an LED backligh...
followthwhiterabbit/GLCD_slideshow_project
temp_proje.c
/* Mechatronics Engineering Microprocessors Final Project Slide Show Using GLCD Author : <NAME> ID : 140223014 Date: 29/12/2020 */ #if defined(__PCM__) #include <16F877.h> #fuses HS,NOWDT,NOPROTECT,NOLVP #use delay(clock=20000000) #endif // fast_io ini...
magster28/Preferences
Preference.h
// FOR HISTORICAL PURPOSES ONLY // // Preference.h // Photo Math // // Created by <NAME> on 6/16/13. // Copyright (c) 2013 Magster. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to de...
desertkun/GameCenterAuth
Unity/GameCenterAuth.h
#ifndef GameCenterAuth_h #define GameCenterAuth_h typedef void ( __stdcall *GenerateSucceeded )( const char* publicKeyUrl, uint64_t timestamp, const char* signature, const char* salt, const char* playerID, const char* alias, const char* bundleID ); typedef void ( __stdcall *GenerateFailed...
freedomsb/v4l2_h264_rtsp
H264LiveSourceWithx264.h
<filename>H264LiveSourceWithx264.h /*=============================================================================== Project: H264LiveStreamer Module: H264LiveSourceWithx264.h Copyright (c) 2014-2015, <NAME> <<EMAIL>> Permission to use, copy, modify, and/or distribute this software for any purpose with or ...
freedomsb/v4l2_h264_rtsp
x264Encoder.h
<reponame>freedomsb/v4l2_h264_rtsp<gh_stars>0 /*=============================================================================== Project: H264LiveStreamer Module: x264Encoder.h Copyright (c) 2014-2015, <NAME> <<EMAIL>> Permission to use, copy, modify, and/or distribute this software for any purpose with or ...
freedomsb/v4l2_h264_rtsp
capture.c
<reponame>freedomsb/v4l2_h264_rtsp<filename>capture.c #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include <sys/ioctl.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <time.h> #include <unistd.h> #include <errno.h> #include <malloc.h> #include <dirent.h> #include <stdio.h> ...
freedomsb/v4l2_h264_rtsp
capture.h
#ifndef _VIDEO_CAPTURE_H_ #define _VIDEO_CAPTURE_H_ #include <stdint.h> #include <stdio.h> #include <avcodec.h> #include <linux/videodev2.h> struct buffer { uint8_t *start; size_t length; }; struct camera { char *device_name; int fd; int width; int height; int display_depth; int buff_num; struct buffe...
rr-/shot
src/monitor_mgr_win.c
<filename>src/monitor_mgr_win.c #include <assert.h> #include <windows.h> #include "monitor_mgr.h" #define UNUSED(x) (void)(x) static BOOL CALLBACK callback( HMONITOR hmonitor, HDC hdc, LPRECT rect, LPARAM data) { UNUSED(hmonitor); UNUSED(hdc); MonitorManager *mgr = (MonitorManager*)data; assert(m...
fixstars/ion-bb-genesis-cloud
rt_display.h
<reponame>fixstars/ion-bb-genesis-cloud #ifndef ION_BB_GENESIS_CLOUD_RT_DISPLAY_H #define ION_BB_GENESIS_CLOUD_RT_DISPLAY_H #include <stdexcept> #include <sys/ioctl.h> #include <linux/fb.h> #include <HalideBuffer.h> #include "rt_common.h" namespace { class FBDev { public: FBDev(int32_t width, int32_t heigh...
fixstars/ion-bb-genesis-cloud
rt.h
#ifndef ION_BB_GENESIS_CLOUD_RT_H #define ION_BB_GENESIS_CLOUD_RT_H #include <iostream> #include <cstring> #include <string> #include <tuple> #include <unordered_map> #include <vector> #include <HalideBuffer.h> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc....
fixstars/ion-bb-genesis-cloud
rt_camera.h
#ifndef ION_BB_GENESIS_CLOUD_RT_CAMERA_H #define ION_BB_GENESIS_CLOUD_RT_CAMERA_H #include <stdexcept> #include <vector> #include <unordered_map> #include <errno.h> #include <fcntl.h> #include <linux/videodev2.h> #include <sys/epoll.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/stat.h> #include <sys/...
fixstars/ion-bb-genesis-cloud
rt_common.h
<reponame>fixstars/ion-bb-genesis-cloud<filename>rt_common.h #ifndef ION_BB_GENESIS_CLOUD_RT_COMMON_H #define ION_BB_GENESIS_CLOUD_RT_COMMON_H #ifdef _WIN32 #define ION_EXPORT __declspec(dllexport) #else #define ION_EXPORT #endif #include <cstdio> #include <string> namespace { template<typename... Rest> std::string...
peteshand/kinect-azure
src/structs.h
#ifndef kinect_azure_structs_h #define kinect_azure_structs_h #ifdef KINECT_AZURE_ENABLE_BODY_TRACKING typedef struct _JSJoint { float cameraX = 0; float cameraY = 0; float cameraZ = 0; // float orientationX = 0; float orientationY = 0; float orientationZ = 0; float orientationW = 0; // float colorX = 0; fl...
dennis/bzlauncher
src/search32.h
#ifndef SEARCH32_PNG_H #define SEARCH32_PNG_H static const unsigned char search32_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00, 0x04, 0x7...
dennis/bzlauncher
src/stop22.h
<gh_stars>1-10 #ifndef STOP22_PNG_H #define STOP22_PNG_H static const unsigned char stop22_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, 0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0xb4, 0x6c, 0x3b, 0x00, 0x00, 0x00, ...
dennis/bzlauncher
src/bzflag32.h
#ifndef BZFLAG32_PNG_H #define BZFLAG32_PNG_H static const unsigned char bzflag32_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x08, 0x6f, 0x4...
dennis/bzlauncher
src/refresh32.h
#ifndef REFRESH32_PNG_H #define REFRESH32_PNG_H static const unsigned char refresh32_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00, 0x04, ...
dennis/bzlauncher
src/favorite32.h
#ifndef FAVORITE32_PNG_H #define FAVORITE32_PNG_H static const unsigned char favorite32_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00, 0x0...
dennis/bzlauncher
src/gui.h
<filename>src/gui.h /////////////////////////////////////////////////////////////////////////// // C++ code generated with wxFormBuilder (version Sep 28 2007) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// #ifndef __gui...
dennis/bzlauncher
src/ping32.h
<reponame>dennis/bzlauncher #ifndef PING32_PNG_H #define PING32_PNG_H static const unsigned char ping32_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, ...
dennis/bzlauncher
src/about32.h
#ifndef ABOUT32_PNG_H #define ABOUT32_PNG_H static const unsigned char about32_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00, 0x04, 0x73, ...
microsoft/ai-freezer-monitor
AIFreezerMonitor/database.h
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // // Class that represents Adafruit IO feed #include "AdafruitIO_WiFi.h" class database { public: database(char *name); void write(float data); void init(); private: AdafruitIO_Feed *feed; ...
microsoft/ai-freezer-monitor
FreezerTempAlert/cls.h
<filename>FreezerTempAlert/cls.h<gh_stars>1-10 // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // // all classes used in program #include <Wire.h> #include <Adafruit_I2CDevice.h> #include <Adafruit_I2CRegister.h> #include "Adafruit_MCP9600.h" #include "AdafruitIO_WiFi.h" #ifndef CLS_H_ #...
microsoft/ai-freezer-monitor
AIFreezerMonitor/predictor.h
<reponame>microsoft/ai-freezer-monitor // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // // Utilities used to process data for ML #ifndef PREDICTOR_H_ #define PREDICTOR_H_ float normalize(float value, float min, float max); float meanOf(float *value, int array_size); float mae(float *x, f...
pauljlohman/Pegasus
libraries/Pegasus_CtrlData/Pegasus_Log.h
/* Atmel i2c Serial EEPROM 256-Kbit (32,768 bytes) AT24C256C 8SOIC 64-byte page */ #include "EEPROM_I2C.h" #ifndef PEGASUS_LOG_H #define PEGASUS_LOG_H // log label #define LOG_IMU 0x20 // yaw, pitch, roll #define LOG_PID 0x40 // yaw, pitch, roll #define LOG_RX 0x60 // yaw, pitch, roll, thr...
pauljlohman/Pegasus
libraries/ZETA1/radio_config_rake.h
/*! @file radio_config.h * @brief This file contains the automatically generated * configurations. * * @n WDS GUI Version: 3.2.10.0 * @n Device: Si4455 Rev.: B1 * API Rev B1A Freq. 915 Mhz, 250 kHz spacing FSK 20kbs preamble 8 bytes, std pattern sync...
pauljlohman/Pegasus
libraries/MPU9255/MPU9255.h
// I2Cdev library collection - MPU9255 I2C device class // Based on InvenSense MPU-9255 register map document rev. 2.0, 5/19/2011 (RM-MPU-6000A-00) // 10/3/2011 by <NAME> <<EMAIL>> // Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib // // Changelog: // ... - ongoing debug rele...
pauljlohman/Pegasus
libraries/Stick/StickXY.h
/* Joystick library http://www.third-helix.com/2013/04/12/doing-thumbstick-dead-zones-right.html */ #ifndef STICKXY_H #define STICKXY_H //#include <Dampen.h> #include <RollingAverage.h> class StickXY { byte pinX, pinY; //Dampen dampenX, dampenY; RollingAverage avgX; RollingAverage a...
pauljlohman/Pegasus
libraries/Pegasus_CtrlData/Pegasus_CtrlData.h
/* RX data format, tested with 16 byte packet, 128 bits minimum data requirements yaw, pitch, roll, throttle, a few extra bits 11 bit resolution(2048) for yaw, pitch, roll, and throttle, and 4 bits for control is probably enough If bit packed thats 6 bytes BIT PACKED FORMAT 7 6 5 4 3 2 1...
pauljlohman/Pegasus
libraries/EEPROM/EEPROM_I2C.h
/* written for EEPROM Microchip 24LC256 typical EEPROM pin layout ___ A0| U |Vcc A1| |WP A2| |SCL Vss|___|SDA Pin Function A0 : User Configurable Chip Select A1 : User Configurable Chip Select A2 : User Configurable Chip Select VSS : Ground SDA : Serial Data, 10kOhm pull-up for 100kHz, 2kOh...
pauljlohman/Pegasus
libraries/IMU/GyroAngle.h
<reponame>pauljlohman/Pegasus<filename>libraries/IMU/GyroAngle.h /* MPU9255 GYROSCOPE FS_SEL | Full Scale Range | LSB Sensitivity -------+--------------------+---------------- 0 | +/- 250 degrees/s | 131.072 LSB/deg/s 1 | +/- 500 degrees/s | 65.536 LSB/deg/s 2 | ...
pauljlohman/Pegasus
libraries/XRotor/XRotor.h
<filename>libraries/XRotor/XRotor.h #ifndef XRotor_H #define XRotor_H #include <Arduino.h> #include <math.h> //#include <Servo.h> class XRotor { unsigned int pwmWriteFrequency; byte pwmResolution; unsigned int escMin; unsigned int escMax; long remap(long long value, long long low1, lon...
pauljlohman/Pegasus
libraries/Pegasus_CtrlData/Pegasus_ConfigMem.h
<reponame>pauljlohman/Pegasus #include "EEPROM_I2C.h" // ADDRESS // NAV MODE 4 bytes //+0 yaw, +1 pitch, +2 roll, +3 throttle #define ADDR_NAV_MODE 0 // NAV RANGE 5 bytes //+0 yaw, +1 pitch, +2 roll, +3 throttle #define ADDR_NAV_RANGE_REL 4 #define ADDR_NAV_RANGE_ABS 9 // PID 6 bytes, 3 uint16 //+0 upper P, +1 lower...
pauljlohman/Pegasus
libraries/Stick/CapacitiveSwitch.h
/* Joystick library http://www.third-helix.com/2013/04/12/doing-thumbstick-dead-zones-right.html */ #ifndef CAPACITIVESWITCH_H #define CAPACITIVESWITCH_H class CapacitiveSwitch { byte pin; long threshold = 1700; short offset = 50; short countRange = 200; short count = 0; ...
pauljlohman/Pegasus
libraries/PID/pPID.h
/* https://en.wikipedia.org/wiki/PID_controller PID controller (P) Accounts for present value of the error. i.e. if the error is large, the control output will also be large. (I) Accounts for past values of the error. i.e. if the current output is not sufficiently strong, error will accumu...
pauljlohman/Pegasus
libraries/IMU/AccelAngle.h
<reponame>pauljlohman/Pegasus<gh_stars>1-10 /* MPU9255 - ACCELEROMETER AFS_SEL | Full Scale Range | LSB Sensitivity --------+------------------+---------------- 0 | +/- 2g | 16384 LSB/g 1 | +/- 4g | 8192 LSB/g 2 | +/- 8g | 4096 LSB/g 3...
pauljlohman/Pegasus
libraries/Stick/Stick.h
/* Joystick library http://www.third-helix.com/2013/04/12/doing-thumbstick-dead-zones-right.html */ #ifndef STICK_H #define STICK_H #include <RollingAverage.h> class Stick { byte pin; RollingAverage avg; float center = 512.0; float outerEdge = 0.0; float deadZone = 0.0; flo...
pauljlohman/Pegasus
libraries/Stick/Pot.h
#ifndef POT_H #define POT_H #include <RollingAverage.h> class Pot { byte pin; RollingAverage avg; float range = 512.0; bool flip = false; public: float v; void config(byte _pin, float _outputRange, bool _flip){ pin = _pin; range = _ou...
pauljlohman/Pegasus
libraries/Smooth/RollingAverage.h
<reponame>pauljlohman/Pegasus<filename>libraries/Smooth/RollingAverage.h /* RollingAverage ra1; ra1.bankSize = 32; float a1 = ra1.update( analogRead(9)-512); */ #ifndef ROLLINGAVERAGE_H #define ROLLINGAVERAGE_H #define MAXBANKSIZE 8 class RollingAverage{ float sample[MAXBANKSIZE] = {0.0}; byte bankS...
pauljlohman/Pegasus
libraries/Smooth/Dampen.h
<reponame>pauljlohman/Pegasus /* */ #ifndef DAMPEN_H #define DAMPEN_H class Dampen{ bool isFirstSample = true; float dry = 0.01; float wet = 1.0-dry; float outValue; public: void config(float f){ f = constrain(f,0.0,1.0); dry = 1.0 - f; we...
pauljlohman/Pegasus
libraries/IMU/CompassAngle.h
/* MPU9255 - AK8963C - COMPASS Full scale measurement range is ±4800µT Y axis runs front to back X axis runs left to right z axis runs bottom to top (YAW) positive value moves the nose right */ #ifndef COMPASSANGLE_H #define COMPASSANGLE_H #include "math...
pauljlohman/Pegasus
libraries/CurveRemap/CurveRemap.h
#ifndef CURVEREMAP_H #define CURVEREMAP_H class CurveRemap{ private: // http://codereview.stackexchange.com/a/33043 byte greatestIndexNotExceeding(unsigned short *arr, unsigned short limit, byte lb, byte ub) { byte mid = (lb + ub) / 2; // Need to go lower but can't if (mi...
pauljlohman/Pegasus
libraries/ZETA1/ZETA1.h
/* For Silicon Labs’ Si4455 Transceiver rev B1A Developed on RFSolutions ZETA-915, Teensy LC, Arduino IDE fixed packet length, can be configured using WDS consolidated used functions into single class re-facter to support blocking or non blocking flow */ #ifndef ZETA1_H #define ZETA1_H #inc...
trukanduk/pq_huffman
src/huffman_decode.c
#include "huffman.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> typedef struct _huffman_decoder_node { int symbol; struct _huffman_decoder_node* children[2]; } huffman_decoder_node_t; typedef struct _huffman_decoder { huffman_decoder_node_t* root_node; huffman_deco...
trukanduk/pq_huffman
src/fast_nn_result_data.c
<reponame>trukanduk/pq_huffman #include "fast_nn_result_data.h" #include <stdio.h> #include <stdlib.h> void result_data_init(result_data_t* result_data, long long initial_capacity) { result_data->capacity = 0; result_data->indices = NULL; result_data->dists = NULL; result_data_realloc(result_data, in...
trukanduk/pq_huffman
src/mst.h
<filename>src/mst.h #ifndef _MST_H #define _MST_H #include <stdio.h> #include "misc.h" #include "huffman.h" #include "stats.h" // NOTE: Internal computing structure typedef struct _mst_edge { vector_id_t source; vector_id_t target; float dist; } mst_edge_t; // NOTE: This way is not very optimal but pret...
trukanduk/pq_huffman
src/pq_encoder.c
#include "pq.h" #include <assert.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <yael/kmeans.h> #include "vecs_io.h" #include "misc.h" typedef struct _config { const char* input_filename; const char* output_template; int m; int num_bits_per...
trukanduk/pq_huffman
src/fast_nn_block_loader.h
#ifndef _FAST_NN_BLOCK_LOADER_H_ #define _FAST_NN_BLOCK_LOADER_H_ #include "fast_nn_block.h" #include "fast_nn_blocks_info.h" #include <pthread.h> void get_vectors_in_block(const char* input_filename, blocks_info_t* blocks_info, long long* block_indices, float* block, long long* num_vectors...
trukanduk/pq_huffman
src/read_dists.c
<filename>src/read_dists.c #include <stdio.h> #define NUM_NN 200 #define NUM_VECTORS 10000 typedef struct _temp_file_item { long long index; float dist; } temp_file_item_t; int main(int argc, const char* argv[]) { FILE* f = fopen(argv[1], "rb"); double sum = 0.0; double min = 100500.0; double...
trukanduk/pq_huffman
src/dsu.c
<gh_stars>1-10 #include "dsu.h" #include <stdlib.h> void dsu_init(dsu_t* dsu, long long num_elements) { dsu->num_elements = num_elements; dsu->items = malloc(sizeof(*dsu->items) * dsu->num_elements); dsu_item_t* items_it = dsu->items; for (long long item_id = 0; item_id < dsu->num_elements; ++item_id...
trukanduk/pq_huffman
src/fast_nn_block_loader2.c
#include "fast_nn_block_loader2.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> #include "vecs_io.h" #include "misc.h" enum { BATCH_SIZE = 1000 * 1000 }; static void* block_loader2_thread(void* arg); void block_loader2_init_from_blocks(block_loader2_t* block_loader, const char* input_filename, ...
trukanduk/pq_huffman
src/concurrent_queue.h
#ifndef _CONCURRENT_QUEUE_H #define _CONCURRENT_QUEUE_H #include <pthread.h> #include <semaphore.h> typedef struct _concurrent_queue { pthread_mutex_t mutex; sem_t sem; int size; int first_datum_index; int next_push_index; int capacity; void** data; } concurrent_queue_t; void concurrent_q...
trukanduk/pq_huffman
src/fast_nn_block_loader.c
#include "fast_nn_block_loader.h" #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <string.h> #include <math.h> #include "misc.h" #define NUM_ROWS_IN_BATCH 10000 #define DATASET_ITEM_SIZE 4L #define DATASET_DIMS_ITEM_SIZE 4L #define NUM_ROWS_IN_BATCH 10000 #define NUM_ROWS_IN_BATCH_BATCH 500 stat...
trukanduk/pq_huffman
src/fast_nn_result_data.h
<filename>src/fast_nn_result_data.h #ifndef _FAST_NN_RESUT_DATA_H_ #define _FAST_NN_RESUT_DATA_H_ typedef struct _result_data { long long capacity; int* indices; float* dists; } result_data_t; void result_data_init(result_data_t* result_data, long long initial_capacity); void result_data_realloc(result_da...
trukanduk/pq_huffman
src/bitstream.h
<filename>src/bitstream.h<gh_stars>1-10 #ifndef _BITSTREAM_H #define _BITSTREAM_H #include <stdio.h> #include "misc.h" enum { BYTE_NUM_BITS = sizeof(byte_t) * 8 }; typedef struct _bit_stream bit_stream_t; bit_stream_t* bit_stream_create_from_file(FILE* file); bit_stream_t* bit_stream_create_from_file_buffered(...
trukanduk/pq_huffman
src/stats.h
#ifndef _HUFFMAN_STATS_H #define _HUFFMAN_STATS_H #include <stdio.h> typedef struct _huffman_stats { long long num_vectors; int m; int k_star; double sum_length; double* partial_lengths; int num_roots; } huffman_stats_t; void huffman_stats_init(huffman_stats_t* stats, long long num_vectors, ...
trukanduk/pq_huffman
src/huffman_decoder.c
#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> #include "bitstream.h" #include "huffman.h" #include "misc.h" #include "mst.h" #include "vecs_io.h" enum { ACTION_DECODE = 0, // NOTE: Read input file and decode the data. // Drop data if ...
trukanduk/pq_huffman
src/compute_nn_fast.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <math.h> #include <assert.h> #include <pthread.h> #include <semaphore.h> #include <yael/nn.h> #include "concurrent_queue.h" #include "misc.h" #include "fast_nn_temp_file.h" #include "fast_nn_block.h" #include "fast_nn_blocks_info...
trukanduk/pq_huffman
src/fast_nn_temp_file.c
#include "fast_nn_temp_file.h" #include <stdlib.h> #include <string.h> #include <limits.h> #include <math.h> #include "vecs_io.h" // Max heap int fast_nn_heap_search_indices_collisions(nn_item_t* begin, nn_item_t* end, const nn_item_t* item) { for (nn_item_t* i = begin;...
trukanduk/pq_huffman
src/dsu.h
#ifndef _DSU_H #define _DSU_H #include "misc.h" typedef struct _dsu_item { vector_id_t parent_id; // NOTE: not pointer to save memory (if vector_id_t = int) int rank; } dsu_item_t; typedef struct _dsu { long long num_elements; dsu_item_t* items; } dsu_t; void dsu_init(dsu_t* dsu, long long num_eleme...
trukanduk/pq_huffman
src/fast_nn_block.c
<filename>src/fast_nn_block.c #include "fast_nn_block.h" #include <stdlib.h> #include <string.h> void block_init(block_t* block, long long block_id, int num_dimensions, long long initial_capacity, int init_flags) { block->id = block_id; block->num_dimensions = num_dimensions; block->capaci...
trukanduk/pq_huffman
src/misc.c
#include "misc.h" #include <assert.h> #include <stdlib.h> #include <string.h> #include <stdio.h> int imin(int a, int b) { return (a < b ? a : b); } long long iminll(long long a, long long b) { return (a < b ? a : b); } long long iclampll(long long value, long long min_value, long long max_value) { if (v...
trukanduk/pq_huffman
src/vecs_io.h
#ifndef _VECS_IO_H #define _VECS_IO_H #include <stdio.h> #include "misc.h" byte_t* load_vecs_light_filename(const char* filename, size_t element_size, long long* num_elements_out, int* num_dimensions_out); byte_t* load_vecs_light_file(FILE* file, size_t element_size, ...
trukanduk/pq_huffman
src/huffman_encoder.c
<filename>src/huffman_encoder.c #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> #include "bitstream.h" #include "huffman.h" #include "stats.h" #include "misc.h" #include "vecs_io.h" #include "mst.h" enum { SORT_NOSORT = 0, SORT_SORT = 1, SORT_SHUFFLE = 2 };...
trukanduk/pq_huffman
src/stats.c
#include "stats.h" #include <stdlib.h> void huffman_stats_init(huffman_stats_t* stats, long long num_vectors, int m, int k_star) { stats->num_vectors = num_vectors; stats->m = m; stats->k_star = k_star; stats->sum_length = 0.0; stats->partial_lengths = malloc(sizeof(*stats->partial_lengths) * sta...
trukanduk/pq_huffman
src/concurrent_queue.c
#include "concurrent_queue.h" #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> #include "misc.h" void concurrent_queue_print(concurrent_queue_t* queue, const char* action) { #ifdef _QUEUE_DEBUG int semv = -1; sem_getvalue(&queue->sem, &semv); printf("Queue %s c=%2d, s=%2d, s...
trukanduk/pq_huffman
src/mst.c
#include "mst.h" #include <assert.h> #include <math.h> #include <stdlib.h> #include <string.h> #include "dsu.h" #include "vecs_io.h" enum { NN_LOADER_BATCH_SIZE = 128 * 1024 // NOTE: vectors }; static int mst_dist_comparator(const void* first, const void* second) { float first_dist = ((const mst_edge_t*) fi...
trukanduk/pq_huffman
src/huffman_codebook.c
#include "huffman.h" #include <assert.h> #include <stdlib.h> void huffman_dump_code(const huffman_code_item_t* item, FILE* f) { if (!item->code) { fprintf(f, "-"); return; } for (int bit_index = 0; bit_index < item->bit_length; ++bit_index) { int byte_offset = bit_index / BYTE_NUM...
trukanduk/pq_huffman
src/fast_nn_block_loader2.h
<reponame>trukanduk/pq_huffman #ifndef _FAST_NN_BLOCK_LOADER2_H_ #define _FAST_NN_BLOCK_LOADER2_H_ #include "fast_nn_block.h" #include "fast_nn_blocks_info.h" #include <pthread.h> typedef struct _block_loader2 { pthread_t* thread; const char* input_filename; long long num_vectors; int num_dimensions;...
trukanduk/pq_huffman
src/fast_nn_temp_file.h
#ifndef _FAST_NN_TEMP_FILE_H #define _FAST_NN_TEMP_FILE_H #include <stdio.h> #include <pthread.h> #include "misc.h" // Max heap // TODO: generalize and move to common code typedef struct _nn_item { vector_id_t index; float dist; } nn_item_t; int fast_nn_heap_search_indices_collisions(nn_item_t* begin, nn_it...
trukanduk/pq_huffman
src/fast_nn_blocks_info.c
#include "fast_nn_blocks_info.h" #include <stdlib.h> #include <stdio.h> #include <assert.h> #include <string.h> #include <math.h> #include "misc.h" #include "vecs_io.h" #define DATASET_ITEM_SIZE 4L #define DATASET_DIMS_ITEM_SIZE 4L #define NUM_ROWS_IN_BATCH 10000 #define NUM_ROWS_IN_BATCH_BATCH 500 static int make_...
trukanduk/pq_huffman
src/bitstream.c
#include "bitstream.h" #include <string.h> #include <stdlib.h> #include <assert.h> // #define _BITSTREAM_DEBUG struct _bit_stream { FILE* file; byte_t* buffer; int mode; long long buffer_capacity; long long buffer_filled_bits; long long buffer_read_position; }; enum { DEFAULT_BUFFER_SIZ...
trukanduk/pq_huffman
src/misc.h
#ifndef _HUFFMAN_MISC_H #define _HUFFMAN_MISC_H typedef unsigned int vector_id_t; int imin(int a, int b); long long iminll(long long a, long long b); long long iclampll(long long value, long long min_value, long long max_value); // NOTE: Allocates with malloc char* concat(const char* prefix, const char* suffix); lo...
trukanduk/pq_huffman
src/huffman.h
#ifndef _HUFFMAN_H #define _HUFFMAN_H #include "bitstream.h" enum { HUFFMAN_NO_SYMBOL = -1, HUFFMAN_INVALID_SYMBOL = -2 }; typedef struct _huffman_decoder huffman_decoder_t; typedef struct _huffman_code_item { const byte_t* code; int bit_length; } huffman_code_item_t; typedef struct _huffman_codebo...
trukanduk/pq_huffman
src/prepend_vecsl_meta.c
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "vecs_io.h" enum { XVECSL_SUFFIX_LENGTH = 7 // .xvecsl }; int main(int argc, const char* argv[]) { if (argc < 4) { fprintf(stderr, "Usage: %s <filename> <num_vectors> <num_dimensions>\n", argv[0]); return ...
trukanduk/pq_huffman
src/mst_builder.c
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "mst.h" #include "misc.h" #include "vecs_io.h" typedef struct _config { const char* nn_input_template; const char* pq_input_template; // NOTE: May be null - if no pq penalties expected const char* output_template; ...
trukanduk/pq_huffman
src/fast_nn_blocks_info.h
<reponame>trukanduk/pq_huffman #ifndef _FAST_NN_BLOCKS_INFO_H_ #define _FAST_NN_BLOCKS_INFO_H_ #include "fast_nn_block.h" #include <stdio.h> typedef struct _block_dimension_info { int dimension; int num_blocks; double block_overlap_fraction; long long block_id_mask; float* block_starts; float...
trukanduk/pq_huffman
src/huffman_encode.c
#include "huffman.h" #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct _huffman_encoding_tree_node { double sum_count; int symbol_id; // NOTE: -1 if is not leaf struct _huffman_encoding_tree_node* children[2]; } huffman_encoding_tree_node_t; typedef struct _huf...
trukanduk/pq_huffman
src/fast_nn_block.h
#ifndef _FAST_NN_BLOCK_H_ #define _FAST_NN_BLOCK_H_ typedef struct _block { long long id; int num_dimensions; long long capacity; long long* indices; float* data; long long size; } block_t; enum { BLOCK_INIT_WITH_DATA = 0x01, BLOCK_INIT_WITH_INDICES = 0x02, BLOCK_INIT_ALL = 0xff }...
trukanduk/pq_huffman
src/vecs_io.c
<filename>src/vecs_io.c<gh_stars>1-10 #include "vecs_io.h" #include <assert.h> #include <stdlib.h> typedef unsigned int header_item_t; byte_t* load_vecs_light_filename(const char* filename, size_t element_size, long long* num_elements_out, int* num_dimensions_out) { FILE* f = fop...
trukanduk/pq_huffman
src/nn_huffman_estimator.c
#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> #include "bitstream.h" #include "huffman.h" #include "stats.h" #include "misc.h" #include "vecs_io.h" typedef struct _config { const char* pq_input_template; const char* nn_input_template; const char* output_t...
ticky/gstest
gstest.c
<filename>gstest.c #include <stdio.h> #include <malloc.h> #include <gsKit.h> #include <dmaKit.h> #include <gsToolkit.h> int main(int argc, char *argv[]) { GSGLOBAL *gsGlobal = gsKit_init_global(); // Initialise DMAKit dmaKit_init( D_CTRL_RELE_OFF, D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC, D_CTRL_STD_O...
Setonas/setonas
Python/importlib.h
<reponame>Setonas/setonas /* Auto-generated by Modules/_freeze_importlib.c */ const unsigned char _Py_M__importlib[] = { 99,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0, 0,64,0,0,0,115,231,4,0,0,100,0,0,90,0,0, 100,164,0,90,1,0,100,4,0,100,5,0,132,0,0,90, 2,0,100,6,0,100,7,0,132,0,0,90,3,0,100,8, 0,100,9,0,132,0,0...
Setonas/setonas
Python/getcopyright.c
/* Return the copyright string. This is updated manually. */ #include "Python.h" static const char cprt[] = "\ Copyright (c) 1918-2017 Setonas Software Foundation.\n\ All Rights Reserved."; const char * Py_GetCopyright(void) { return cprt; }
Setonas/setonas
Python/graminit.c
/* Generated by Parser/pgen */ #include "pgenheaders.h" #include "grammar.h" PyAPI_DATA(grammar) _PyParser_Grammar; static arc arcs_0_0[3] = { {2, 1}, {3, 1}, {4, 2}, }; static arc arcs_0_1[1] = { {0, 1}, }; static arc arcs_0_2[1] = { {2, 1}, }; static state states_0[3] = { {3, arcs_0_0}, {...
ericsaba/geoNotes
Notes/Notes/geoNotes-Bridging-Header.h
<filename>Notes/Notes/geoNotes-Bridging-Header.h // // geoNotes-Bridging-Header.h // geoNotes // // Created by <NAME> on 2/29/16. // Copyright © 2016 <NAME>. All rights reserved. // #import <Parse.h> #import <Bolts.h>