repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
lukangli/weather-clock
Firmware/weather-clock/include/img/pangzi/i7.h
#include <pgmspace.h> const uint8_t i7[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x0A, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0A, 0x08, 0x08, 0x08, 0x0B, 0x0A, 0x0A, 0x0B, 0x0E, 0x18, 0x10, 0x0E, 0x0D, ...
lukangli/weather-clock
Firmware/weather-clock/include/img/tianqi/t11.h
<filename>Firmware/weather-clock/include/img/tianqi/t11.h #include <pgmspace.h> const uint8_t t11[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x0A, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0A, 0x08, 0x08, 0x...
lukangli/weather-clock
Firmware/weather-clock/include/img/tianqi/t9.h
<reponame>lukangli/weather-clock #include <pgmspace.h> const uint8_t t9[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x0A, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0A, 0x08, 0x08, 0x08, 0x0B, 0x0A, 0x0A, 0x0B...
lukangli/weather-clock
Firmware/weather-clock/include/img/tianqi/t15.h
#include <pgmspace.h> const uint8_t t15[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x0A, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0A, 0x08, 0x08, 0x08, 0x0B, 0x0A, 0x0A, 0x0B, 0x0E, 0x18, 0x10, 0x0E, 0x0D, ...
lukangli/weather-clock
Firmware/weather-clock/include/img/tianqi/t26.h
<filename>Firmware/weather-clock/include/img/tianqi/t26.h #include <pgmspace.h> const uint8_t t26[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x0A, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0A, 0x08, 0x08, 0x...
lukangli/weather-clock
Firmware/weather-clock/include/font/W_3660_i7.h
<reponame>lukangli/weather-clock #include <pgmspace.h> const uint8_t W_3660_i7[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xFF, 0xE1, 0x00, 0x5A, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4D, 0x4D, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x0...
lukangli/weather-clock
Firmware/weather-clock/include/img/tianqi/t7.h
#include <pgmspace.h> const uint8_t t7[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x0A, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0A, 0x08, 0x08, 0x08, 0x0B, 0x0A, 0x0A, 0x0B, 0x0E, 0x18, 0x10, 0x0E, 0x0D, 0...
lukangli/weather-clock
Firmware/weather-clock/include/img/tianqi/t31.h
#include <pgmspace.h> const uint8_t t31[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x0A, 0x07, 0x07, 0x08, 0x07, 0x06, 0x0A, 0x08, 0x08, 0x08, 0x0B, 0x0A, 0x0A, 0x0B, 0x0E, 0x18, 0x10, 0x0E, 0x0D, ...
lukangli/weather-clock
Firmware/weather-clock/include/font/W_1830_i7.h
<filename>Firmware/weather-clock/include/font/W_1830_i7.h<gh_stars>0 #include <pgmspace.h> const uint8_t W_1830_i7[] PROGMEM = { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, 0x00, 0x03, 0x02, 0x02, 0x03, 0x02, 0x02, 0x03...
NCDCCC/MatrixMultiplyHLS
MatrixMultiply.c
#include "MatrixMultiply.h" void MatrixMultiply(data_type A[DEPTH*ROWA*COLA], data_type B[DEPTH*COLA*COLB], data_type C[DEPTH*ROWA*COLB]) { int i, j, k, depth; depth: for (depth=0;depth<DEPTH;depth++) { rowa: for (i=0;i<ROWA;i++) { colb: for (k=0;k<COLB;k++) { data_type sum = 0; cola: for (j=0;j<C...
NCDCCC/MatrixMultiplyHLS
MatrixMultiply.h
#ifndef _MATRIX_MULTIPLY_H_ #define _MATRIX_MULTIPLY_H_ #include <stdio.h> #include "ap_cint.h" #define ROWA 8 #define COLA 8 #define COLB 8 #define DEPTH 2 typedef int data_type; void MatrixMultiply(data_type A[DEPTH*ROWA*COLA], data_type B[DEPTH*COLA*COLB], data_type C[DEPTH*ROWA*COLB]); #endif
NCDCCC/MatrixMultiplyHLS
MatrixMultiply_test.c
<gh_stars>0 #include "MatrixMultiply.h" int main() { data_type A[DEPTH*ROWA*COLA]; data_type B[DEPTH*COLA*COLB]; data_type C[DEPTH*ROWA*COLB]; int i = 0, j = 0, k = 0, depth = 0; for (depth=0;depth<DEPTH;depth++) { for (i=0;i<ROWA;i++) { for (k=0;k<COLB;k++) { C[depth*ROWA*COLB+i*COLB+k] = 0; ...
CoderMoe/ModuleA
CMoeListModule/Classes/Actions/Target_List.h
// // Target_List.h // CMoeListModule_Example // // Created by drore on 2018/7/1. // Copyright © 2018年 <EMAIL>. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface Target_List : NSObject - (UIViewController *)Action_nativeFetchDetailViewController:(NSDictionary *)params; ...
CoderMoe/ModuleA
Example/Pods/Target Support Files/CMoeListModule/CMoeListModule-umbrella.h
<reponame>CoderMoe/ModuleA #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 "Target_List.h" #import "CTMediator+CMoeMediatorModuleListActions.h" #import "ListViewCont...
CoderMoe/ModuleA
CMoeListModule/Classes/ListViewController.h
<reponame>CoderMoe/ModuleA // // ListViewController.h // ModuleA // // Created by drore on 2018/6/29. // Copyright © 2018年 Drore. All rights reserved. // #import <UIKit/UIKit.h> @interface ListViewController : UIViewController @end
CoderMoe/ModuleA
CMoeListModule/Classes/CTMediator+CMoeMediatorModuleListActions.h
// // CTMediator+CMoeMediatorModuleListActions.h // CMoeListModule_Example // // Created by drore on 2018/7/1. // Copyright © 2018年 <EMAIL>. All rights reserved. // #import <CTMediator/CTMediator.h> @interface CTMediator (CMoeMediatorModuleListActions) - (UIViewController *)CTMediator_viewControllerForList; @en...
wujb/libc_test
socket/main.c
<filename>socket/main.c /***************************************************************************** # <EMAIL> # # Filename: main.c # Author: Biaoun # Create: 2017-08-18 23:35:43 # Last Modified: 2017-08-19 10:49:51 # Description: --- **************************************************************...
phenol94/Han-Seokbong
klt/kma/header/get-tok.h
typedef struct { unsigned char *token; int length; } TOKEN_STR;
phenol94/Han-Seokbong
galileo/hsb_analyze.c
#include <stdlib.h> #include <stdio.h> #include <string.h> /************************* Constant *************************/ #define MORPHEME_PATH "./outputs/result.txt" #define SCRIPT_PATH "./outputs/script.txt" #define KEYWORD_PATH "./outputs/keyword.xml" #define DIC_PATH "./resource/dic.txt" #define INFO_PATH "./inpu...
phenol94/Han-Seokbong
galileo/hsb.c
<filename>galileo/hsb.c #include <stdlib.h> #include <string.h> #include <stdio.h> #include <dirent.h> #include <unistd.h> #include <fcntl.h> /*********************** Constant ***********************/ #define INPUT_FILE_PATH "./inputs/input.xml" #define OUTPUT_FILE_PATH "./outputs" #define INFO_FILE_PATH "./history...
atanzu/conveyorpp
include/conveyorpp.h
/* * MIT License * * Copyright (c) 2020 <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, modify, m...
atanzu/conveyorpp
include/conveyorpp_internal.h
/* * MIT License * * Copyright (c) 2020 <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, modify, m...
iddev5/intp
src/log.c
#include "intp.h" FILE *logfile; void intp_warn(intp_src_buf *buf, char *str) { fprintf(logfile, "Warning: Line %u, Column %u: %s\n", buf->line, buf->col, str); } int intp_error(intp_src_buf *buf, char *str) { printf("%s[%u, %u] Error: %s\n", buf->filename, buf->line, buf->col, str); exit(-1); } int int...
iddev5/intp
src/intp.h
<filename>src/intp.h #ifndef INTP_H #define INTP_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <stdbool.h> #include <stdarg.h> #define STBDS_NO_SHORT_NAMES #include "../depends/stb_ds.h" #define INTP_DEBUG /* * Types */ #ifdef INTP_SHORT_TYPES ...
iddev5/intp
src/interp/interp.c
#include "../intp.h" #include "expr.h" void check_semi(intp_src_buf *buf, intp_info *info) { if(buf->type != SEMI) { #ifdef INTP_DEBUG printf("Token Found: %d\n", buf->type); #endif intp_error(buf, "Expected ; at the end of statement-expression"); } else { intp_lex(buf); } } /* Forward d...
iddev5/intp
src/lexer.c
<filename>src/lexer.c #include "intp.h" const char *keywords[] = { "and", "break", "continue", "do", "else", "False", "for", "if", "in", "import", "or", "return", "True", "while", "puts" }; static inline char this_ch(intp_src_buf *buf) { if(buf->input == INPUT_FILE) { return buf->th; } ...
iddev5/intp
src/interp/expr.h
<gh_stars>1-10 #ifndef INTP_EXPR_H #define INTP_EXPR_H #include "../intp.h" intp_data *expr(intp_src_buf *buf, intp_info *info); intp_data *paren_expr(intp_src_buf *buf, intp_info *info); /* * Private Functions * It is not recomended to use these functions * for general purpose. */ static inline int64_t FLOORf(...
iddev5/intp
src/data.c
#include "intp.h" intp_data *intp_get_data(intp_info *info, char* name) { for(int i = 0; i < stbds_arrlen(info->objs); i++) { intp_data *data = info->objs[i]; if(data->scope <= info->scope && !(strcmp(data->name, name))) { intp_data *req = ALLOC(intp_data*, 1); req->name = N...
iddev5/intp
src/core.c
#define STB_DS_IMPLEMENTATION #include "intp.h" FILE *logfile; int intp_init(intp_info *info) { /* Open the log file when the interpreter is initialzed. */ logfile = fopen("report.log", "w"); if(logfile == NULL) { intp_error_std("Cannot create/open log file: report.log"); } /*...
iddev5/intp
src/interp/expr.c
<filename>src/interp/expr.c #include "../intp.h" #include "expr.h" int get_binop_prec(intp_src_buf *buf) { int prec = -1; switch(buf->type) { /* Subject to change */ case WAL: prec = 3; break; case KWD_OR: prec = 4; break; case KWD_AND: prec = 5; break; case BOR: pre...
iddev5/intp
intpcli.c
#include <stdio.h> #include <stdlib.h> #include "src/intp.h" intp_info info; void intp_at_exit() { intp_free(&info); } int main(int argc, char **argv) { if(argc < 2) { printf("Usage: INTP filename.intp\n"); exit(-1); } atexit(intp_at_exit); if(intp_init(&info)) { intp_fi...
mjawwad2/set_type
SetType.h
<filename>SetType.h #ifndef SET_TYPE #define SET_TYPE #include<string> #include<iostream> #include<forward_list> #include<unordered_map> using namespace std; class IteratorOutOfBounds { public: string Msg() { return "Iterator is out of bounds. Nothing left to iterate over."; } }; const int DEFAULT_B...
mjawwad2/set_type
unit_tests/unit_util.h
<gh_stars>0 /** * Created by <NAME> on 3/31/2021. * * You should not remove or change any of the tests in this file. * These are the same tests that will be used to grade your assignment. * * Provides utility functions for the tests. DO NOT MODIFY! */ #ifndef UNIT_UTIL_H #define UNIT_UTIL_H #include <iostream>...
wangzhezhe/5MCST
cmake_example/basic/util/sqrt.h
<gh_stars>1-10 double caculateSqrt(double input);
cmacro/simple
growingpains/halmos-master/src/symstring.c
#include "dbg.h" #include "symstring.h" /* we want to write 'struct symstring' and 'struct symstringArray'. We */ /* #defined symstring as size_tArray in the header, so undo this temporarily. */ #ifdef symstring #undef symstring DEFINE_ARRAY(symstring) #define symstring size_tArray #endif // void // symstringInit(str...
cmacro/simple
growingpains/RadixTreeTest/ARTful-master/ARTfulkv.c
// ARTful key-value store // Author: <NAME>, <EMAIL> // Date: 23 DEC 14 /* This work, including the source code, documentation and related data, is placed into the public domain. The orginal author is <NAME>. THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF MERCHANTAB...
cmacro/simple
growingpains/halmos-master/tests/symstring_tests.c
#include "unittest.h" #include "symstring.h" static int test_symstringInsert(void) { const size_t a[4] = {0, 1, 2, 3}; const size_t b[3] = {4, 5, 6}; const size_t c[7] = {0, 1, 4, 5, 6, 2, 3}; struct symstring sa; struct symstring sb; symstringInit(&sa); symstringInit(&sb); size_tArrayAppend(&sa, a, 4)...
cmacro/simple
pythoninc/extencmodule/hello.c
// // A simple C extension module for python, called "hello" // // www.moguf.com 2016-05-28 // #include <Python.h> #include <string.h> // // module functions // static PyObject * // returns object message(PyObject *self, PyObject *args) { ...
cmacro/simple
growingpains/halmos-master/src/error.c
<gh_stars>10-100 #include "error.h" /* check this matches with enum error in error.h by looking at line number */ static const char* errorStrings[error_size] = { "none", /* internal errors */ "endOfString", "endOfFile", "failedFileOpen", "failedFileClose", "invalidReaderMode", /* preprocessor errors */ "...
cmacro/simple
growingpains/ime/akeleditimetest/AkelEdit/AkelEdit.h
#ifndef __AKELEDIT_H__ #define __AKELEDIT_H__ //// Includes #include <richedit.h> #include <shellapi.h> //// Defines #define AES_AKELEDITCLASSA "AkelEditA" #define AES_AKELEDITCLASSW L"AkelEditW" #define AES_RICHEDITCLASSA "RichEdit20A" #define AES_RICHEDITCLASSW L"RichEdit20W" #define AES_WORDDELI...
cmacro/simple
growingpains/halmos-master/tests/hash_tests.c
#include "unittest.h" #include "hash.h" static int test_hash_djb2(void) { const char* s = "hello"; hash_djb2(s, strlen(s), 0); return 0; } static int test_hash_murmur3(void) { const char* s[4] = { "hello", "hello ", "hello w", "hello wo" }; size_t i; for (i = 0; i < 4; i++) { hash_mu...
cmacro/simple
growingpains/halmos-master/src/verifier.c
#include "verifier.h" #include "hash.h" #include "logger.h" DEFINE_ARRAY(symbol) const char* symTypeStrings[symType_size] = { "none", "constant", "variable", "disjoint", "floating", "essential", "assertion", "provable" }; const char* symTypeString(enum symType type) { return symTypeStrings[type]; }...
cmacro/simple
growingpains/ime/akeleditimetest/AkelEdit/AkelBuild.h
<reponame>cmacro/simple<gh_stars>10-100 #ifndef __AKELBUILD_H__ #define __AKELBUILD_H__ //// Includes #include <shlobj.h> #include "AkelEdit.h" //// Defines #define AETIMERID_MOUSEMOVE 1 #define AETIME_PROGRESS 0 //WM_SETCURSOR #define AECC_IBEAM 0 #define AECC_MARGIN 1 #define AECC_SELECTION...
cmacro/simple
growingpains/halmos-master/tests/array_tests.c
#include "unittest.h" #include "array.h" static int Test_arrayAdd(void) { struct intArray a; intArrayInit(&a, 1); intArrayAdd(&a, 3); ut_assert(a.vals[0] == 3, "vals == %d, expected 3", a.vals[0]); ut_assert(a.size == 1, "size == %lu, expected 1", a.size); ut_assert(a.max == 1, "max == %lu, expected 1", a....
cmacro/simple
growingpains/halmos-master/src/unittest.h
<reponame>cmacro/simple #ifndef _HALMOSUNITTEST_H_ #define _HALMOSUNITTEST_H_ #include "dbg.h" #include <stdio.h> #include <string.h> enum { ut_message_size = 1024 }; int ut_tests_run; char ut_message[ut_message_size]; #define ut_assert(test, ...) \ do { \ if (!(test)) { \ LOG_ERR(__VA_ARGS__); \ snprin...
cmacro/simple
growingpains/halmos-master/tests/verifier_tests.c
<gh_stars>10-100 /* verifier_tests.c */ /* 15 Oct 2015 */ #include "unittest.h" #include "reader.h" #include "verifier.h" #include "frame.h" #define check_err(actual, expected) \ do { \ ut_assert(actual == expected, "err = %s, expected %s", errorString(actual), \ errorString(expected)); \ } while (0) static int ...
cmacro/simple
growingpains/RadixTreeTest/ARTful-master/ARTfulkv4.c
// ARTful3: Adaptive Radix Trie key-value store // Author: <NAME>, <EMAIL> // Date: 06 JAN 15 /* This work, including the source code, documentation and related data, is placed into the public domain. The orginal author is <NAME>. THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE IMPLIED ...
cmacro/simple
growingpains/halmos-master/src/main.c
<gh_stars>10-100 #include "halmos.h" int main(int argc, char* argv[]) { halmosMain(argc, argv); return 0; }
cmacro/simple
growingpains/halmos-master/src/compiler.h
<gh_stars>10-100 #ifndef _HALMOSCOMPILER_H_ #define _HALMOSCOMPILER_H_ #include "frame.h" #include "symtab.h" struct reader; struct compiler { struct symtree tab; struct symbolArray symbols; struct frameArray frames; struct reader* r; }; void compilerInit(struct compiler* cmp); void compilerClean(struct compil...
cmacro/simple
simplemake/bar.h
#ifndef __BAR_H__ #define __BAR_H__ class Bar { public: void SetBar(int bar); void PutBar(); private: int m_bar; }; #endif
cmacro/simple
growingpains/halmos-master/tests/preproc_tests.c
<filename>growingpains/halmos-master/tests/preproc_tests.c #include "unittest.h" #include "preproc.h" static int test_preprocInit(void) { struct preproc p; preprocInit(&p); preprocClean(&p); return 0; } static int all(void) { ut_run(test_preprocInit); return 0; } RUN(all)
cmacro/simple
growingpains/halmos-master/src/hash.c
#include "hash.h" uint32_t hash_djb2(const char* str, size_t len, uint32_t seed) { (void) len; (void) seed; uint32_t h = 5381; int c; while ((c = *str++)) { h = ((h << 5) + h) + c; } return h; } uint32_t hash_murmur3(const char* str, size_t len, uint32_t seed) { uint32_t c1 = 0xcc9e2d51; uint32_...
cmacro/simple
growingpains/halmos-master/tests/halmos_tests.c
#include "unittest.h" #include "halmos.h" #define test_file(filename, count) \ static int test_ ## filename(void) \ { struct halmos h; \ halmosInit(&h); \ halmosCompile(&h, "tests/mm/" #filename ".mm"); \ halmosClean(&h); \ return 0; \ } test_file(test1, 0) // test_file(big_unifier, 0) // test_file(big_unifie...
cmacro/simple
growingpains/halmos-master/src/compiler.c
#include "compiler.h" #include "reader.h" void compilerInit(struct compiler* cmp) { symtreeInit(&cmp->tab); symbolArrayInit(&cmp->symbols, 1); frameArrayInit(&cmp->frames, 1); } void compilerClean(struct compiler* cmp) { size_t i; for (i = 0; i < cmp->frames.size; i++) { frameClean(&cmp->frames.vals[i]);...
cmacro/simple
growingpains/halmos-master/src/reader.c
#include "dbg.h" #include "reader.h" #include <string.h> static const int mode_none = 0; static const int mode_string = 1; static const int mode_file = 2; //int //readerGetString(struct reader* r) //{ // if (*r->stream.s == '\0') { // r->err = error_endOfString; // return '\0'; // } // return *(r->stream.s++...
cmacro/simple
growingpains/halmos-master/src/preproc.c
<reponame>cmacro/simple<gh_stars>10-100 #include "array.h" #include "dbg.h" #include "logger.h" #include "preproc.h" #include "reader.h" static const char* whitespace = " \f\n\r\t"; void preprocInit(struct preproc* p) { p->rs = xmalloc(sizeof(struct readerArray)); readerArrayInit(p->rs, 1); /* add an empty read...
cmacro/simple
growingpains/halmos-master/src/frame.c
#include "array.h" #include "frame.h" DEFINE_ARRAY(frame) void frameInit(struct frame* frm) { size_tArrayInit(&frm->stmts, 1); size_tArrayInit(&frm->disjoint1, 1); size_tArrayInit(&frm->disjoint2, 1); } void frameClean(struct frame* frm) { size_tArrayClean(&frm->disjoint2); size_tArrayClean(&frm->disjoint1);...
cmacro/simple
growingpains/halmos-master/src/error.h
#ifndef _HALMOSERROR_H_ #define _HALMOSERROR_H_ enum error { error_none = 0, /* internal errors */ error_endOfString, error_endOfFile, error_failedFileOpen, error_failedFileClose, error_invalidReaderMode, /* preprocessor errors */ error_nestedComment, error_unterminatedComment, error_expectedClosingB...
cmacro/simple
growingpains/halmos-master/src/logger.h
<gh_stars>10-100 #ifndef _HALMOSLOGGER_H_ #define _HALMOSLOGGER_H_ /* logging with the verifier */ #define H_LOG(vrf, err, verbosity, lab, ...) \ do { \ if (vrf->verb < (verbosity)) { break; } \ fprintf(stderr, "%s:%lu:%lu " lab " [%s] ", \ vrf->files.vals[vrf->rId].vals, \ vrf->r->line, \ vrf->r->offs...
cmacro/simple
pythoninc/duplex/duplex.c
// // c API module, test c embedding and extending // // www.moguf.com 2016-05-29 // #include <Python.h> #include <string.h> void helloWorld(char *param) { if (param) printf("It's c, hello %s", param); else printf("It's c, hello "); } static PyObject * message(PyObject *self, PyObject *arg...
cmacro/simple
growingpains/halmos-master/src/symtab.h
<gh_stars>10-100 #ifndef _HALMOSSYMTAB_H_ #define _HALMOSSYMTAB_H_ #include "array.h" #include <stdint.h> struct symbol; typedef struct symbol symbol; DECLARE_ARRAY(symbol) enum symType { symType_none, symType_constant, symType_variable, symType_disjoint, symType_floating, symType_essential, symType_ass...
cmacro/simple
growingpains/RadixTreeTest/ARTful-master/ARTfulkv6.c
// ARTful6: Adaptive Radix Trie key-value store // Author: <NAME>, <EMAIL> // Date: 13 JAN 15 /* This work, including the source code, documentation and related data, is placed into the public domain. The orginal author is <NAME>. THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE IMPLIED ...
cmacro/simple
growingpains/halmos-master/tests/reader_tests.c
<reponame>cmacro/simple #include "unittest.h" #include "reader.h" #include <string.h> static int Test_readerGet(void) { int c; const char s[60] = "In Xanadu did Kubla Khan\n" "A stately pleasure-dome decree :"; struct reader r; readerInitString(&r, s); ut_assert(r.err == error_none, "err == %s, expected ...
cmacro/simple
growingpains/halmos-master/src/memory.c
#include "dbg.h" #include "memory.h" #include <stdlib.h> void* xmalloc(size_t size) { void* p = malloc(size); if (!p) { LOG_FAT("malloc failed"); abort(); } return p; } void* xrealloc(void* p, size_t size) { void* q = realloc(p, size); if (!q) { LOG_FAT("realloc failed"); abort(); } ret...
cmacro/simple
growingpains/halmos-master/src/symstring.h
<gh_stars>10-100 #ifndef _HALMOSSYMSTRING_H_ #define _HALMOSSYMSTRING_H_ #include "array.h" typedef struct size_tArray symstring; DECLARE_ARRAY(symstring) /* we do this to be able to write 'struct symstring' */ #define symstring size_tArray static const size_t default_size = 64; #define symstringInit(symstr) size_...
cmacro/simple
growingpains/halmos-master/trace/trace.c
/* */ /* use gcc features for profiling function calls */ /* usage */ /* compile the code to instrument with -c and -finstrument-functions */ /* compile this file with gcc -c FILENAME -o FILENAME.o, without the */ /* -finstrument-functions (otherwise it will crash) */ /* link them together */ #include <stdio.h> #inclu...
cmacro/simple
growingpains/halmos-master/tests/symtab_tests.c
#include "unittest.h" #include "symtab.h" static int test_symnodeInit(void) { struct symnode n; symnodeInit(&n); ut_assert(n.symId == 0, "n.symId not NULL"); ut_assert(n.next == NULL, "n.next not NULL"); symnodeClean(&n); return 0; } static int test_symnodeInsert(void) { struct symnode n; symnodeInit(...
cmacro/simple
growingpains/halmos-master/src/halmos.c
#include "dbg.h" #include "halmos.h" #include "preproc.h" #include "verifier.h" #include <errno.h> #include <stdio.h> #include <time.h> static const char* flags[halmosflag_size] = { "", "--verbose", "--summary", "--preproc", "--no-preproc", "--no-verify", "--report-count", "--report-hash", "--report-...
cmacro/simple
growingpains/halmos-master/src/charstring.c
<gh_stars>10-100 #include "charstring.h" /* we want to write 'struct charstring' and 'struct charstringArray'. We */ /* #defined charstring as charArray in the header, so undo this temporarily. */ #ifdef charstring #undef charstring DEFINE_ARRAY(charstring) #define charstring charArray #endif void charstringInit(stru...
cmacro/simple
growingpains/halmos-master/src/symtab.c
<filename>growingpains/halmos-master/src/symtab.c #include "dbg.h" #include "hash.h" #include "symtab.h" #include "memory.h" void symbolInit(struct symbol* sym) { charArrayInit(&sym->sym, 1); sym->type = symType_none; sym->isActive = 0; sym->isTyped = 0; sym->scope = 0; sym->stmt = 0; sym->frame = 0; } ...
cmacro/simple
growingpains/halmos-master/src/array.h
<filename>growingpains/halmos-master/src/array.h #ifndef _HALMOSARRAY_H_ #define _HALMOSARRAY_H_ #include "dbg.h" #include "memory.h" #define DECLARE_ARRAY(type) \ struct type ## Array { \ type * vals; \ size_t size; \ size_t max; \ }; \ void type ## ArrayInit(struct type ## Array*, size_t); \ void type ## Arra...
cmacro/simple
growingpains/halmos-master/src/verifier.h
<gh_stars>10-100 #ifndef _HALMOSVERIFIER_H_ #define _HALMOSVERIFIER_H_ #include "array.h" #include "charstring.h" #include "error.h" #include "frame.h" #include "reader.h" #include "symstring.h" #include "symtab.h" /* data for processing compressed proofs */ struct proof { /* labels used in the proof which are not in ...
cmacro/simple
growingpains/halmos-master/src/frame.h
#ifndef _HALMOSFRAME_H_ #define _HALMOSFRAME_H_ #include "array.h" struct frame; typedef struct frame frame; DECLARE_ARRAY(frame) /* frame, for assertions and provables. This is not an extended frame */ struct frame { /* indices to verifier->stmts. These are mandatory hypotheses */ struct size_tArray stmts; /* indic...
cmacro/simple
growingpains/halmos-master/src/preproc.h
#ifndef _HALMOSPREPROC_H_ #define _HALMOSPREPROC_H_ #include "error.h" struct reader; struct readerArray; struct preproc { struct readerArray* rs; struct reader* r; enum error err; size_t errCount; }; void preprocInit(struct preproc* p); void preprocClean(struct preproc* p); void preprocParseComment(struct p...
cmacro/simple
growingpains/halmos-master/src/dbg.h
<filename>growingpains/halmos-master/src/dbg.h<gh_stars>10-100 #ifndef _HALMOSDBG_H_ #define _HALMOSDBG_H_ #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <string.h> #if defined (__GNUC__) #define __FUNC__ __PRETTY_FUNCTION__ #else #define __FUNC__ "unknown" #endif #define _CLEARERRNO() (errno == ...
cmacro/simple
pythoninc/embedsimple/hello.c
// // C code runs Python code in this module in embedded mode. // print hello string // // www.moguf.com 2016-05-28 // #include <Python.h> int main() { printf("embed simple\n"); Py_Initialize(); PyRun_SimpleString("print('run python ...')"); PyRun_SimpleString("import script"); PyRun_SimpleStri...
cmacro/simple
growingpains/halmos-master/src/array.c
<reponame>cmacro/simple<filename>growingpains/halmos-master/src/array.c #include "array.h" DEFINE_ARRAY(char) DEFINE_ARRAY(int) DEFINE_ARRAY(size_t)
cmacro/simple
growingpains/halmos-master/src/charstring.h
#ifndef _HALMOSCHARSTRING_H_ #define _HALMOSCHARSTRING_H_ #include "array.h" typedef struct charArray charstring; DECLARE_ARRAY(charstring) /* we do this to be able to write 'struct charstring' */ #define charstring charArray void charstringInit(struct charstring* s); void charstringClean(struct charstring* s); #...
cmacro/simple
growingpains/halmos-master/src/halmos.h
#ifndef _HALMOSHALMOS_H_ #define _HALMOSHALMOS_H_ enum halmosflag { halmosflag_none = 0, halmosflag_verbose, /* set the verbosity */ halmosflag_summary, /* print summary at the end */ halmosflag_preproc, /* preprocessing only */ halmosflag_no_preproc, /* disable preprocessing */ halmosflag_no_verify, /* di...
cmacro/simple
growingpains/halmos-master/src/memory.h
<filename>growingpains/halmos-master/src/memory.h #ifndef _HALMOSMEMORY_H_ #define _HALMOSMEMORY_H_ #include <stddef.h> void* xmalloc(size_t size); void* xrealloc(void* p, size_t size); #endif
cmacro/simple
growingpains/halmos-master/src/hash.h
<filename>growingpains/halmos-master/src/hash.h<gh_stars>10-100 #ifndef _HALMOSHASH_H_ #define _HALMOSHASH_H_ #include <stddef.h> #include <stdint.h> typedef uint32_t (*hashfunction)(const char*, size_t, uint32_t); uint32_t hash_djb2(const char*, size_t, uint32_t); uint32_t hash_murmur3(const char*, size_t, uint32_...
cmacro/simple
growingpains/halmos-master/src/reader.h
#ifndef _HALMOSREADER_H_ #define _HALMOSREADER_H_ #include "array.h" #include "error.h" #include <stddef.h> #include <stdio.h> struct reader; typedef int (*charGetter)(struct reader*); enum { reader_bufferSize = 1024 * 16 }; struct reader { //union { FILE* f; // const char* s; //} stream; /* buffer for f...
wkias/Young-AI
car/car.c
#include <stdlib.h> #include <at89x51.h> #include <intrins.h> #define TRIG P1_7 #define ECHO P1_6 #define FORWARD 0 #define LEFT 1 #define RIGHT 2 sbit L298N_EN1 = P1^0; sbit L298N_EN2 = P1^1; sbit L298N_IN1 = P1^2; sbit L298N_IN2 = P1^3; sbit L298N_IN3 = P1^4; sbit L298N_IN4 = P1^5; sbit infraredF = P2^5; sbit infr...
brunoga/blinks-hexxagon-ai
game_state_no_map_render.h
#ifndef GAME_STATE_NO_MAP_RENDER_H_ #define GAME_STATE_NO_MAP_RENDER_H_ namespace game { namespace state { namespace no_map { void Render(); } // namespace no_map } // namespace state } // namespace game #endif
brunoga/blinks-hexxagon-ai
game_state_play.h
<reponame>brunoga/blinks-hexxagon-ai<filename>game_state_play.h #ifndef GAME_STATE_PLAY_H_ #define GAME_STATE_PLAY_H_ namespace game { namespace state { namespace play { void Handler(); void Reset(); } // namespace play } // namespace state } // namespace game #endif
brunoga/blinks-hexxagon-ai
render_animation.h
<filename>render_animation.h #ifndef RENDER_ANIMATION_H_ #define RENDER_ANIMATION_H_ #include <blinklib.h> namespace render { namespace animation { void Spinner(Color background, byte slowdown, byte pause); } // namespace animation } // namespace render #endif
brunoga/blinks-hexxagon-ai
game_player_ai.h
<gh_stars>1-10 #ifndef GAME_PLAYER_AI_H_ #define GAME_PLAYER_AI_H_ #include "src/blinks-position/coordinates.h" namespace game { namespace player { namespace ai { bool GetAndScoreNextPossibleMove(byte player, bool use_scratch, position::Coordinates* origin, ...
brunoga/blinks-hexxagon-ai
blink_state.h
<reponame>brunoga/blinks-hexxagon-ai #ifndef BLINK_STATE_H_ #define BLINK_STATE_H_ #include <blinklib.h> namespace blink { namespace state { void SetPlayer(byte player); byte GetPlayer(); void StartColorOverride(); bool GetColorOverride(); void NextAILevel(); byte GetAILevel(); void StartLevelSelection(); bool G...
brunoga/blinks-hexxagon-ai
config/broadcast_config.h
#ifndef BROADCAST_CONFIG_H_ #define BROADCAST_CONFIG_H_ // This is the maximum payload we will need. #define BROADCAST_MESSAGE_PAYLOAD_BYTES 4 // Disable message replies. Saves considerable space. #define BROADCAST_DISABLE_REPLIES // Enable message handler support. Required by the mapping code. #define BROADCAST_ENA...
brunoga/blinks-hexxagon-ai
game_player_ai_conditional_random.h
#ifndef GAME_PLAYER_AI_CONDITIONAL_RANDOM_H_ #define GAME_PLAYER_AI_CONDITIONAL_RANDOM_H_ #include "src/blinks-position/coordinates.h" namespace game { namespace player { namespace ai { namespace conditional_random { bool GetMove(position::Coordinates* origin, position::Coordinates* target); } // namespace cond...
brunoga/blinks-hexxagon-ai
game_message.h
#ifndef GAME_MESSAGE_H_ #define GAME_MESSAGE_H_ #include <blinklib.h> namespace game { namespace message { void Process(); bool SendSelectOrigin(int8_t x, int8_t y); bool SendSelectTarget(int8_t x, int8_t y); } // namespace message } // namespace game #endif
brunoga/blinks-hexxagon-ai
game_map.h
<gh_stars>1-10 #ifndef GAME_MAP_H_ #define GAME_MAP_H_ #include <blinklib.h> #include "game_player.h" #include "src/blinks-position/position.h" #define GAME_MAP_MAX_BLINKS 128 namespace game { namespace map { struct Data { int16_t x : 6; int16_t y : 6; uint16_t player : 4; }; Data* Get(); byte GetSize(); v...
brunoga/blinks-hexxagon-ai
game_map_download.h
#ifndef GAME_MAP_DOWNLOAD_H_ #define GAME_MAP_DOWNLOAD_H_ namespace game { namespace map { namespace download { void Process(); bool Downloaded(); void Reset(); } // namespace download } // namespace map } // namespace game #endif
brunoga/blinks-hexxagon-ai
game_player_ai_score_counter.h
<filename>game_player_ai_score_counter.h #ifndef GAME_PLAYER_AI_SCORE_COUNTER_H_ #define GAME_PLAYER_AI_SCORE_COUNTER_H_ #include "src/blinks-position/coordinates.h" namespace game { namespace player { namespace ai { namespace score { namespace counter { bool GetMove(position::Coordinates* origin, position::Coor...
brunoga/blinks-hexxagon-ai
util.h
#ifndef UTIL_H_ #define UTIL_H_ namespace util { bool NoSleepButtonSingleClicked(); } // namespace util #endif
brunoga/blinks-hexxagon-ai
game_state_generic_render.h
<reponame>brunoga/blinks-hexxagon-ai #ifndef GAME_STATE_GENERIC_RENDER_H_ #define GAME_STATE_GENERIC_RENDER_H_ namespace game { namespace state { namespace generic { void Render(); } // namespace generic } // namespace state } // namespace game #endif
brunoga/blinks-hexxagon-ai
blink_state_face.h
<filename>blink_state_face.h #ifndef BLINK_STATE_FACE_H_ #define BLINK_STATE_FACE_H_ #include <blinklib.h> namespace blink { namespace state { namespace face { union Value { struct { bool map_requested : 1; // Map was requested in this face. bool hexxagon : 1; // Hexxagon connected to this face....
unguest/ballade-en-t
game.h
<gh_stars>0 #ifndef __GAME__H #define __GAME__H #include <stdlib.h> #include <stdio.h> #include <string.h> typedef struct Map { int pX; int pY; int xMax; int yMax; } Map; void create_map(Map *map); void display_map(Map *map); void move(short movement, Map *map); short ask_movemen...
unguest/ballade-en-t
game.c
#include "game.h" #define XMAX 4 #define YMAX 4 void create_map(Map *map) { map->xMax = XMAX; map->yMax = YMAX; map->pX = rand() % XMAX + 1; map->pY = rand() % YMAX + 1; } void move(short movement, Map *map) { switch (movement) { case 0: printf("This isn't a vali...
unguest/ballade-en-t
main.c
<filename>main.c #include <stdio.h> #include <stdlib.h> #include <time.h> #include "game.h" int main(void) { srand(time(NULL)); Map map; create_map(&map); short movement; while(1) { display_map(&map); movement = ask_movement(); move(movement, &map); ...