blob_id large_stringlengths 40 40 | language large_stringclasses 1
value | repo_name large_stringlengths 4 124 | path large_stringlengths 2 969 | src_encoding large_stringclasses 35
values | length_bytes int64 6 2.95M | score float64 2.52 5.44 | int_score int64 3 5 | detected_licenses large listlengths 0 58 | license_type large_stringclasses 2
values | text stringlengths 9 2.95M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
8112ee66b0df2aff8f17fbe47eb5956d8b956261 | C | andxet/uni-algoritmi-strutture-dati | /ASD/Compito05/c/sorting.c | UTF-8 | 7,106 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <sys/time.h>
#include "sorting.h"
#define true 1
#define false 0
#define SOGLIA_QSORT 69
#define SOGLIA_MSORT 64
int * vcopy(int v[], int n){
int i = 0;
int * vett = malloc(sizeof(int) * n);
for(i = 0; i < n; i ++){
vett[i] =... | true |
d6561aae85b3989a70863bcd3c62184b49875305 | C | mbartling/photonMapper | /src/imageProcessing/kernels.h | UTF-8 | 696 | 2.65625 | 3 | [
"MIT"
] | permissive | #ifndef __KERNELS_H__
#define __KERNELS_H__
enum
{
KERNEL_MEAN = 0,
KERNEL_WMEAN,
KERNEL_GAUSS,
KERNEL_SOBEL_X,
KERNEL_SOBEL_Y,
KERNEL_SOBEL_B,
KERNEL_LAPLACIAN,
NUM_KERNEL_TYPE // Make sure this stays at the end!
};
double Gauss2d(int x, int y);
void createGaussKernel( int m_conv_x, int m_conv_y, doub... | true |
b91a8fde96c0882163c0dd75b9f447845b537f3e | C | raphaexl/RT | /libs/libft/color.c | UTF-8 | 4,707 | 2.71875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* color.c :+: :+: :+: ... | true |
0d83c856733f598b79ac91818674b350a3d17371 | C | ivoper/SE | /Lab_6/src/Lab_6.c | UTF-8 | 1,606 | 2.609375 | 3 | [] | no_license | /*
===============================================================================
Name : Lab_5.c
Author : $(author)
Version :
Copyright : $(copyright)
Description : main definition
===============================================================================
*/
#ifdef __USE_CMSIS
#include "LP... | true |
cfcdf54006184726be46e69e988e72c45094373e | C | slimlime/sandbox | /C/gsl_cdf.c | UTF-8 | 393 | 2.828125 | 3 | [] | no_license | #include <stdio.h>
#include <gsl_rng.h>
#include <gsl_randist.h>
int main (int argc, char *argv[])
{
/* set up GSL RNG */
gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937);
/* end of GSL setup */
int i,n;
double gauss,gamma;
n=atoi(argv[1]);
for (i=0;i<n;i++) {
gauss=gsl_ran_gaussian(r,2.0);
gamma=gsl_ran_gam... | true |
9270e820900e8f8dcb7748684d0cd073da8556a6 | C | giovannamoeller/algoritmos-I | /Estruturas de Controle/Repetição Contada/Exemplo1Versao2.c | UTF-8 | 140 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
int main(){
int i, x;
scanf("%d", &x);
for (i = 1; i <= x; i++){
printf("Bem - Vindos!\n");
}
} | true |
e7bafdfe450333efa55a09318a5fec3da5c92199 | C | Jozko-Mrkvicka/Common | /Demo_Examples_C/Pokusy_PC_v1/Pokus 1.3 - RS232/Ovladac 1_2 DME.c | UTF-8 | 1,959 | 2.859375 | 3 | [] | no_license | #include <windows.h>
#include <stdio.h>
#include <string.h>
HANDLE port, hPort;
HANDLE OpenPort()
{
DCB dcb;
hPort = CreateFile("COM4", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if(hPort == INVALID_HANDLE_VALUE)
printf("CHYBA: nie je mozne otvorit port");
else
printf("Pristup ... | true |
2b3f8aedabeb9122d15585102aa163749d6bb2fc | C | StuartC52/Parallel-programming | /Assignment/searching_MPI_0.c | UTF-8 | 3,574 | 3.109375 | 3 | [] | no_license | #include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <time.h>
////////////////////////////////////////////////////////////////////////////////
// Program main
////////////////////////////////////////////////////////////////////////////////
char *textData;
int textLen... | true |
3a9c9452c4e39d426ed46c5f989d4004ef33b6b6 | C | yang17/Myshell | /myshell.c | UTF-8 | 5,918 | 2.828125 | 3 | [] | no_license | #include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
//#include "wshell.h"
int Mysh_cd(char **args,char **hist, int current);
int Mysh_help(char **args,char **hist, int current);
int Mysh_exit(char **args,char **hist, int current);
int Mysh_history(ch... | true |
d31cce40c8af68fb577de053b6230f685245b956 | C | chipmunk-project/domino-examples | /domino_in_c_lan/marple_new_flow.c | UTF-8 | 519 | 3.09375 | 3 | [] | no_license | #include <iostream>
void marple_new_flow(int &new1, int &count) {
if (count == 0) {
count = 1;
new1 = 1;
}
}
int main(int argc, char **argv) {
int new1, count;
std::cout << "input the initial value of p.new: " << std::endl;
std::cin >> new1;
std::cout << "input the initial value of count: " << s... | true |
7dd1c96653bf3ddcc7534d5eff08a618d809b324 | C | LeandroEgea/clasesProgramacionLabPrimerCuatrimestre | /CLASE_11_INIT/contrataciones.c | UTF-8 | 5,745 | 2.84375 | 3 | [] | no_license | #include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "utn.h"
#include "contrataciones.h"
static int con_buscarIndiceVacio(Contratacion* pBuffer,int limite,int*indice);
int con_inicializarArray(Contratacion* pBuffer,int limite){
int i;
for(i=0;i<limite;i++){
pBuffer[... | true |
5f8ab2b97efbf8636e09f0d780811758424fe952 | C | 514467952/bitekeji | /学生管理系统/材料2/添加函数.c | GB18030 | 1,452 | 2.8125 | 3 | [] | no_license | int Add(stud *p)//Ӻ
{
if(p==NULL || p->next==NULL)
{
printf("\t\t\tѧϢ\n");
system("pause");
return 4;
}
stud *q=p,*a=p,*head[100];
int i=-1,b,n=0;
char m='y';
while(q->next)
{
n++;
q=q->next;
}
while(m=='y')
{
system("cls");
q=a;
printf("\t\t\tѧϢ...:\n");
i... | true |
f404290040e520a4138fd0c6ddca6df79fe4f5f4 | C | Lixin-SCUT/UULP | /chapter6/sigdemo1.c | UTF-8 | 233 | 2.5625 | 3 | [] | no_license | //sigdemo1.c
//Coded by Lixin on 2020/01/06
#include<stdio.h>
#include<signal.h>
main(){
void f(int);
int i;
signal(SIGINT,f);
for(i=0;i<5;i++){
printf("hallo!\n");
sleep(1);
}
}
void f(int signum){
printf("OUCH!\n");
}
| true |
2852f82f3da3b45add49bb7cade231a5d165b779 | C | WaNhuimin/huimin | /task3.c | GB18030 | 1,127 | 3.90625 | 4 | [] | no_license | //һ
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
void swap(int* x, int* y)
{
int tmp = *x;
*x = *y;
*y = tmp;
}
int main()
{
int a[] = { 1, 2, 3, 4, 5 };
int b[] = { 6, 7, 8, 9, 10 };
int sz = sizeof(a) / sizeof(a[0]);
for (int i = 0; i < sz; i++)
{
swap(&a[i], &b[i]);
}
printf("aֵ")... | true |
7a08eb3d8b63aa516026baa27efed0cf478e0fcd | C | maxjayne98/Socket-Programming-snappQ- | /serverFinal.c | UTF-8 | 17,471 | 3.046875 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include <string.h>
#include<netinet/in.h>
#include<time.h>
#define UDP_PORT 9999
int cal_string_size(char* st){
int i = 0;
while(st[i] != NULL)
i+=1;
return i;
}
char** str_split(char* a_str, const char a_delim... | true |
d814a80962f72adf566091afb0ab2a782d5913bf | C | Gabukuro/Estrutura-de-Dados | /01. Ordenação de dados/main.c | UTF-8 | 1,084 | 3.078125 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <math.h>
#include "sorts.c"
#include "utils.c"
int main()
{
int option, i;
printf("\nDo you want to view the input and output values ?\n[ 1 ] - YES\n[ 0 ] - NO\n\nYour choice: ");
scanf("%d", &option);
... | true |
72f4d27645402449466107735341e4aaec2408a2 | C | penguin-wwy/exploit_tools | /kallsymsprint-master/main.c | UTF-8 | 1,611 | 3.09375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <libkallsyms/kallsyms_in_memory.h>
static size_t
get_file_length(const char *file_name)
{
struct stat st;
if (stat(file_name, &st) < 0) {
return 0;
}
ret... | true |
750236a6fe741608eb9ce64327761ffd7164ca82 | C | nataliamedinat/holbertonschool-low_level_programming | /0x07-pointers_arrays_strings/4-strpbrk.c | UTF-8 | 571 | 3.53125 | 4 | [] | no_license | #include "holberton.h"
/**
* _strpbrk - searches a string for any of a set of bytes
*@s: pointer
*@accept: pointer
* Return: s + era or '\0'
*/
char *_strpbrk(char *s, char *accept)
{
int era; /*recorre s*/
int ase; /* recorre accept*/
int les;
for (era = 0; s[era] != '\0'; era++)
{/**Recorre a s*/
les = 0... | true |
bc616b3009fc945fa59ef8ed901692507b98674e | C | bratekarate/c-datastructures | /src/arraylist.h | UTF-8 | 826 | 2.78125 | 3 | [] | no_license | #include <stddef.h>
typedef struct ArrayList ArrayList;
ArrayList *arraylist_new();
void arraylist_add(ArrayList *list, void *elem);
void arraylist_add_all(ArrayList *list, ArrayList *addable);
void arraylist_insert(ArrayList *list, size_t i, void *elem);
void *arraylist_get(ArrayList *list, size_t i);
void *arraylist... | true |
fe4c2602c485159df90b93e888fbee2c8aa66981 | C | andrewtroyan/troyandz | /C/ClassWork/SinusGenerator/main.c | UTF-8 | 361 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include <unistd.h>
int main()
{
short int buffer[64];
for(int i = 0; i < 44100 * 5 / 64; ++i)
{
for(int j = 0; j < 64; ++j)
{
buffer[j] = 20000 * (sin((i * 64 + j) * 220 * 2 * 3.14159265 / 44100.0));
}
write(1, buffer, 64 * s... | true |
e6d87d2b82eaff206e5904145c4b6b184f3366d8 | C | GuhPires/fei-c | /04 - MATRICES/03-Matrices.c | UTF-8 | 1,039 | 4 | 4 | [] | no_license | /******************************************* OBJETIVO ******************************************************
* Faça um programa para receber uma matriz 3×3 (solicitar ao usuário) e apresentar a soma dos elementos da
* diagonal principal e a matriz na forma como deve ser vista: com linhas e colunas
*
* AUTHOR: GuhP... | true |
1efcbb5072079d35db7c49af6ad41dcaaa38579e | C | wjsaya/SICNU | /C数据结构与算法/7-8_银行业务队列简单模拟.c | UTF-8 | 1,429 | 3.53125 | 4 | [] | no_license | #include<stdio.h>
int size(int *p) {
int i=0, len=0;
while(p[i] != '\0') {
if(p[i] != -233)
len++;
i++;
}
return len;
}
int push(int *p, int X) {
int last;
last = size(p);
p[last++] = X;
}
int isEmpty(int *p) {
if(size(p) == 0)
return 0;
els... | true |
700e50f4db7ba1b22dbb4df840726e5579a8d57d | C | choueric/cnetlib | /src/multicast.c | UTF-8 | 8,734 | 2.53125 | 3 | [] | no_license | #include <netinet/in.h>
#include <stdio.h>
#include <strings.h>
#include <string.h>
#include <sys/ioctl.h>
#include "multicast.h"
#include "address.h"
#include "log.h"
// modified from source code of net-tools_1.60, ipmaddr.c
// NOTE: ONLY support IPv4
#define PATH_PROCNET_IGMP "/proc/net/igmp" /* net/core/igm... | true |
0ad0a279ed9672523bfba5295edefbe836a91fac | C | zzaiyuyu/InterviewOfStack | /stackApp.c | GB18030 | 2,291 | 3.828125 | 4 | [] | no_license | //ջӦ
#include "stack.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
//ƥ䷵1
int match_brackets(const char * string)
{
if (NULL == string) {
return 1;
}
Stack s;
init(&s);
//Ŷ࣬Ŷ࣬˳ͬ
while (*string) {
if (*string == '(' || *string == '[' || *string == '{') {
pushBack(&s, *string);
string++;
... | true |
a427c841b19b6610fa435152644fc34a0febf8e7 | C | fatleader/autowriting | /randChar.c | UTF-8 | 3,192 | 3.46875 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
//#define MIN 32
//#define MAX 127
#define MIN 96
#define MAX 123
// fn prototypes
void write(FILE *fp);
void compare(FILE *shit, FILE *eng, int *end);
unsigned int rand_interval(unsigned int min, unsigned int max);
/*
le main function.
ideally we get it t... | true |
3d2d78f3360168626489d65aa72806978c424547 | C | padsof-uam/redes2 | /G-2301-11-P2/tests/test_sockutils.c | UTF-8 | 1,699 | 2.75 | 3 | [] | no_license | #include "test_sockutils.h"
#include "testmacros.h"
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "errors.h"
#include "sockutils.h"
/* BEGIN TESTS */
int t_Server_close_communication__close_noconnected_socket() {
int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
... | true |
1301ccf765f10226e4028882a83dfdd20e7db968 | C | BlancoSebastianEzequiel/palindrome-MIPS | /tp1.c | UTF-8 | 4,678 | 3.265625 | 3 | [] | no_license | #define _POSIX_C_SOURCE 1
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
//------------------------------------------------------------------------------
// DEFINITIONS
//------------------------------------------------------------------------------
#define ERROR -1
#define SUCCESS 0
#d... | true |
95c792740a86aa603beca6d5e0b85930dd9c43ea | C | akash-tiwari/computer-networking | /client2server_oneway/client.c | UTF-8 | 1,203 | 2.796875 | 3 | [] | no_license | // *** I am client ***
#include<stdio.h>
#include<stdlib.h>
#include<netdb.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<string.h>
#include<unistd.h>
#include<arpa/inet.h>
#include<netinet/in.h>
int main(){
int sock, len = 0;
struct sockaddr_in my, ser;
// struct hostent *h;
char *host, buff[50], s[]... | true |
ec75c116f7d857014ff05b017549ee3b06700db4 | C | giorgospan/CDR-Management-System | /include/heap.h | UTF-8 | 1,363 | 2.90625 | 3 | [] | no_license | #ifndef HEAP_H
#define HEAP_H
struct aux_struct;
#include "auxqueue.h"
struct HeapNode
{
struct HeapNode* parent;
struct HeapNode* right;
struct HeapNode* left;
char* caller;
float bill;
};
struct Heap
{
struct HeapNode* root;
struct HeapNode* last;
int counter;
float revenue;
};
/*Creates Heap*/
void h... | true |
d5671ff32abce9b695c6961fc61595101fe0bcfa | C | unaidelao/kochan-programming-in-c | /exercise9_3.c | UTF-8 | 1,718 | 4.53125 | 5 | [] | no_license | /*
* Exercise 9.3 Kochan - Programming in C
*
* Write a function 'elapsed_time' that takes as its arguments two 'time'
* structures and returns a 'time' structure that represents the elapsed time
* (in hours, minutes and seconds) between the two times. So the call
*
* elapsed_time (time1, time2)
*
* where 'tim... | true |
41833f466531e9327592ba8af2746dc40e743598 | C | penguinjuggler/Jacob_Project_Euler | /PE11.c | UTF-8 | 2,336 | 3.5625 | 4 | [] | no_license | /*
Project Euler
Problem 11 - find largest product 4 nums in a line
Jacob Mintz
*/
#include <stdio.h>
int getGrid(void);
int main(void)
{
int NROWS = 20;
int NCOLS = 20;
int LINE = 4;
int largeProd = 1;
int prod;
//int *nums = getGrid();
int a[2][4];
int i, f, g;
int nums[20][20];
FILE *fptr; //pointer ... | true |
e9535e648f71b04eadf95169afc7d051f6cf38a0 | C | fivol/acos | /inf21-0_posix_dl_simple-dlopen/main.c | UTF-8 | 538 | 2.921875 | 3 | [] | no_license | #define _GNU_SOURCE
#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char** argv) {
if(argc < 3){
fprintf(stderr, "Too few arguments");
return 1;
}
char* filename = argv[1];
char* symname = argv[2];
double (*function)(double);
void* lib = dlopen(filename, 0);
func... | true |
c597dccdf495c813901d26bfcc486f3134af73f7 | C | RickyL-2000/ZJUI-lib | /ECE220/2019/ece实验文件/归档/lab5/gcd.c | UTF-8 | 1,354 | 4.21875 | 4 | [] | no_license | #include <stdio.h>
// Calculate the Greatest Common Denominator/Divisor (GCD) of two
// positive integers extA and extB.
// NOTE: LIKELY TO TERMINATE IF EITHER VALUE IS 0
unsigned int
extOut (unsigned int extA, unsigned int extB)
{
unsigned int A = extA;
unsigned int B = extB;
unsigned int C;
unsig... | true |
ebc90039516357c47d5bb314bd9c2fce18523e2f | C | rupy/programing_exercise | /kadai7/7-2.c | UTF-8 | 199 | 2.9375 | 3 | [] | no_license | #include<stdio.h>
int main(){
char x[100];
char* p;
int result=0;
scanf("%s",x);
for(p=x;*p!='\0';++p){
if(*p=='X')++result;
}
printf("Result = %d\n",result);
return 0;
}
| true |
da626c11276bea8988749b71d9854054990c514e | C | jayarerita/edX_C_programming | /ex3-3_arrays_and_func.c | UTF-8 | 1,109 | 4.78125 | 5 | [] | no_license | /*
Within this program, we will pass an array with 6 integers to a function, have the function swap the first and last integer, the second and the second to last integer, the third and the third to last integer.
The function is called reverseArray and doesn't return anything (void). It should take one parameter, repre... | true |
14b4ebfb98bcf60ecb0fd3650a7a55f76a989a4c | C | doushinide/Meron_Demo | /LED/User/Led7Seg.c | GB18030 | 2,059 | 2.5625 | 3 | [] | no_license | #include <reg52.h>
#include "port.h"
#include "Timer.h"
#include "Led7Seg.h"
uint8 g_u8LedDisplayBuffer[8] ={0};//ʾ
//-----------------------------------------------------------------------
// ܵĶ
//-----------------------------------------------------------------------
code uint8 g_u8LedDisplayCode[] =
{
... | true |
a80892ef1d0ca2ea7b28d82827d30fa4c3ba1883 | C | mankamana/my_test_c_prog | /games_of_throns.c | UTF-8 | 671 | 3.40625 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
void findPalind(char *arr)
{
int flag = 0;
int i = 0;
while (arr[i] != '\0')
{
flag = flag ^ arr [i];
i++;
}
printf ("\nflag = %d", flag);
if (((flag < 'z') && (flag > 'a')) || ((flag < 'Z') ... | true |
a8cfee51974baee1899dd4d1d7d2c94c549a88ec | C | cJeek/Operating-System | /cPolymorphism/head.h | UTF-8 | 568 | 2.90625 | 3 | [] | no_license | #ifndef __HEAD_H__
#define __HEAD_H__
#include <stdio.h>
struct shape {
const char* name;
struct shape_operations* sops;
};
struct shape_operations {
void (*draw)(const struct shape*);
};
struct triangle {
int a, b, c;
struct shape base;
};
struct circle {
int r;
struct shape base;
};
... | true |
4d0997a49b09ae58a219d88fb33ca601ccce6d55 | C | tomjkidd/c-cheatsheet | /src/processes.c | UTF-8 | 4,464 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
void error(char *msg) {
fprintf(stderr, "%s: %s\n", msg, strerror(errno));
exit(1);
}
void redirect_file_descriptor(int file_descriptor_from, int file_descriptor_to) {
if(dup2(file_descriptor_to, file_descriptor_fr... | true |
080b5a037a10021bcc77a0896265bde1b0e6c773 | C | yusiwen/mpa | /tools/qnum.c | UTF-8 | 827 | 2.578125 | 3 | [] | no_license | #include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/types.h>
#include <unistd.h>
#include "rscommon/commonbase.h"
#include "rscommon/msq.h"
void usage(void);
int getSize(int qkey);
void usage() {
printf("Get message numbers in a given queue\n"
... | true |
c14baf7582a9587e5648ab79656fada52c9d17a8 | C | deater/vmw-meter | /lpd8806_led_string/bargraph_manual.c | UTF-8 | 1,179 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include "effects.h"
#include "lpd8806.h"
#include "colors.h"
int bargraph_manual(int spi_fd, char *color1, char *color2) {
int i;
unsigned char data[128];
int bar=0;
unsigned char ch;
int lr,lg,lb,rr,rg,rb;
/* color left */
if ... | true |
077a3723f27be2170410a20f01670a1c18a404b5 | C | h404j/c-test1 | /OJ/OJ1-100/OJ1-10/test1006.c | UTF-8 | 277 | 3.359375 | 3 | [] | no_license | #include<stdio.h>
//给出三个整数,分别表示等差数列的第一项、最后一项和公差,求该数列的和。
int main(){
int a,b,c;
int sum=0;
scanf("%d%d%d",&a,&b,&c);
sum = sum + a;
while (a!=b)
{
a = a + c;
sum=sum+a;
}
printf("%d",sum);
return 0;
} | true |
0dd1aba4028a3d9155002f7ffdbaca3c76c460a9 | C | wuzhiyi/data-structure | /data-structure/d-ary-heap.c | UTF-8 | 1,900 | 3.703125 | 4 | [
"MIT"
] | permissive | /**************************************************************
* Copyright (c) Wuzhiyi
* Introduction to Algorithms
*
* 题目: Problem 6-2
* 名称: D-ARY-HEAP
* 作者: skanev
* 语言: c
* 内容摘要: 对d叉堆的分析
*
* 修改记录:
* 修改日期 版本号 修改人 修改内容
* ------------------------------------------------------------
*... | true |
52cd351f117c551c3a9341ca4c7dd6929a057a8d | C | BullfroG21/shell_project | /bash_bts.c | UTF-8 | 8,273 | 3.03125 | 3 | [] | no_license | /*
============================================================================
Name : shell.c
Author : André Schaiter Florian Gwechenberger
Version :
Copyright : made by André Schaiter Florian Gwechenberger
Description : FHS Lite Shell in C, Ansi-style
=========================================... | true |
f3db1e5437cc43cb35f58f68e7256108e03627dd | C | xjhsxjh/YakOS | /kernel/debug.c | UTF-8 | 2,310 | 2.640625 | 3 | [] | no_license | /*
* Copyright (c) 2013 Yannik Li(Yanqing Li)
*
* 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, merg... | true |
165b851350a8e7e9ccda8fa239fd902fad44fbfb | C | yuyuOWO/source-code | /C/动态内存分配给指针数组赋字符串值并输出.c | GB18030 | 284 | 3.34375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *a[3];
int i;
for(i=0;i<3;i++)
{
a[i]=(char *)malloc(sizeof(char)*30); //Ϊÿַ30ֽڵĿռ
scanf("%s",a[i]);
}
for(i=0;i<3;i++)
{
printf("%s\n",a[i]);
free(a[i]);
}
return 0;
}
| true |
149d873e85b7c7c694d2d8ef6cc683f42ce5e5ca | C | richzw/CodeHome | /Classic/Bit_fields_of_c.c | UTF-8 | 2,250 | 3.859375 | 4 | [] | no_license | While we're on the subject of structures, we might as well look at bitfields. They can only be declared inside a
structure or a union, and allow you to specify some very small objects of a given number of bits in length. Their
usefulness is limited and they aren't seen in many programs, but we'll deal with them anyway.... | true |
e99690aca1ea17c3459badc1b1d96e2cba70a628 | C | indy728/42-fdf | /includes/libft/includes/libft.h | UTF-8 | 6,314 | 2.546875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libft.h :+: :+: :+: ... | true |
a9ad0711909073c3b920264099c093bb093d4d47 | C | tischina/olya | /main.c | UTF-8 | 3,176 | 3.78125 | 4 | [] | no_license | // В одномерном массиве, состоящем из п вещественных элементов, вычислить:
// 1) максимальный по модулю элемент массива;
// 2) сумму элементов массива, расположенных между первым и вторым положительными элементами.
//Преобразовать массив таким образом, чтобы элементы, равные нулю, располага¬лись после всех остальн... | true |
c93601c1a3eccb5aae5fc8c124a858837277ee34 | C | beefstooo/CMU_15-213_caching-web-proxy | /proxy.c | UTF-8 | 16,265 | 2.640625 | 3 | [] | no_license | /*
* proxy.c
*
* Made: July 31, 2015 by jkasbeer
* Version: Part 3
* Known bugs: (1) Aborts in Mozilla Firefox @ www.cmu.edu with an error in
* Getaddrinfo. Stems from call to Open_clientfd & fails
* while executing freeaddrinfo (run-time error).
*
* Proxy Lab
*
* This is a concurre... | true |
16ae40b54bcfe34cb199027754e0c45347f474bd | C | tomb50/CProgramming | /src/319/moment.c | UTF-8 | 3,879 | 3.71875 | 4 | [] | no_license | /****************************************
** 319-1A
** Tom Beadman
** 20 Feb 2012
**
** Statistical Moments:
** This program calculates the statistical moments from a 100 element
** distribution contained in blank.txt.
**
** Currently the program is producing nonsense results half of the time and
** correc... | true |
6bdd678f40cc433773f242a02374782201578a4d | C | boxuhere/DataStructure | /3.3.Queue_of_LinkedStorage.c | UTF-8 | 1,331 | 4.09375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct QNode {
int value;
struct QNode* next;
};
typedef struct QNode* PtrToQNode;
struct QueueStr {
PtrToQNode Front;
PtrToQNode Rear;
};
typedef struct QueueStr* Queue;
//函数:创建一个队列
Queue CreatQueue() {
Queue Q = (Queue)malloc(sizeof(struct QueueStr));
Q->Front = NULL;
... | true |
601f369dc674f2e0132c706f38c4750b0e9ad6ee | C | SlientD/usual_practice_c | /数据结构/堆/堆/Heap.c | GB18030 | 3,165 | 3.296875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
#include "Heap.h"
#define ARRSIZE(a) (sizeof(a)/sizeof(a[0]))
#include "Heap.h"
#include <string.h>
#include <stdio.h>
#if 1
void swap(HPDataType *a, HPDataType *b) //һԼԼԼԼͬʱԼĶӦַĿռ䣬ֵ*aͬʱְ*bĵˣԽsortΪһֻʣһڵʱ
{
*a ^= *b;
*b ^= *a;
*a ^= *b;
}
#else
void swap(HPDataType *a, HPDat... | true |
487f1e00353e6c795fc5ad2663a0491501ad5b0f | C | YIHONG-JIN/Solution-for-C-Primer-Plus-6th | /Chapter 4/Practice/4.7.c | UTF-8 | 582 | 3.140625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <float.h>
int main(void)
{
double d_third = 1.0/3.0;
float f_third = 1.0/3.0;
printf("float of one third(6) = %.6f\n", f_third);
printf("float of one third(12) = %.12f\n", f_third);
printf("float of one third(16) = %.16f\n", f_third);
printf("double of one third(... | true |
2c4be3886e33e72ffcdd13aee0f3d35ceaf97a8e | C | MagicWinnie/SESC_IT_Exam | /11.c | UTF-8 | 869 | 3.5625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define N 1000
void swap(double* a, double* b){
double c = *a;
*a = *b;
*b = c;
}
bool next_perm(int n, double* A){
int i = n-1;
for(; i > 0; i--){
if(A[i-1] < A[i]) break;
else if(i - 1 == 0) return false;
}
int ... | true |
ffb92151ebd4a15992ae4dbc275711c30da0f0f3 | C | CharlotteCoupez/push_swap42 | /sources/manage_list.c | UTF-8 | 2,083 | 2.703125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* manage_list.c :+: :+: :+: ... | true |
4b38029c165e895d3f509c81087cff153a5a7c30 | C | mischief/9problems | /sys/src/ape/lib/bsd/inet_aton.c | UTF-8 | 942 | 2.515625 | 3 | [] | no_license | /* posix */
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
/* bsd extensions */
#include <sys/uio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define CLASS(x) (x[0]>>6)
int
inet_aton(char *from, struct in_addr *in)
{
unsigned char *to;
unsigned long x;
char *p;
int i;
... | true |
475f1b77727a30c7ea22003b6089affb77262563 | C | ksong0xd/acf | /include/an_allocator.h | UTF-8 | 2,082 | 2.84375 | 3 | [
"BSD-3-Clause",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"CC0-1.0"
] | permissive | #ifndef AN_ALLOCATOR_H
#define AN_ALLOCATOR_H
#include "an_cc.h"
AN_EXTERN_C_BEGIN
#include "acf_export.h"
#include <stddef.h>
#include <string.h>
struct an_allocator {
void *(*malloc)(const void *ctx, size_t size, void *return_addr);
void *(*calloc)(const void *ctx, size_t nmemb, size_t size, void *return_addr)... | true |
9e377073144d7c282a94a928ed0b8b5e112fabfd | C | lucianoperez/1c-2016-TpOperativos-Elestac | /utilidades/utilidades/general.h | UTF-8 | 1,898 | 2.515625 | 3 | [] | no_license | #ifndef UTILIDADES_GENERAL_H_
#define UTILIDADES_GENERAL_H_
#include <commons/config.h>
#include <stdint.h>
#include <errno.h> // Incluye perror
#include "sockets.h"
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <commons/log.h>
#include "tiposDeDatos.h"
#define ERROR -1
#define INT (si... | true |
288b4c49069d8d9639c19f1a1a666226d4be4ea6 | C | csteifel/parallelboids | /setup.c | UTF-8 | 1,944 | 3.375 | 3 | [] | no_license | #include "inc.h"
//Position boids on the field based on what is passed in via file (regular text file)
//First line should be maximum sizes (width height)
/*
file encoding: 0 - barrier/unusable spot
1 - free spot open on the board
2 - boid in location
3 - exit location
*/
void setupSimulation(char * fileName, boidCont... | true |
65fe9b672a4658491099658883b691c4dfae42fa | C | bsurmanski/clockwork | /src/util/hash.c | UTF-8 | 3,044 | 2.984375 | 3 | [] | no_license | /**
* hash.c
* @file hash.h
* obj
* @date July 12, 2012
* @author Brandon Surmanski
*/
#include "hash.h"
#define MASK8 0xff
#define MASK16 0xffff
#define MASK24 0xffffff
#define MASK32 0xffffffff
#define MASK64 0xffffffffffffffff
#define FNV32_PRIME 16777619u
#define FNV64_PRIME 1099511628211ull
#defi... | true |
1d2812eaf9a74e7bcace94ea6bcdf12c1c00531d | C | wkoutre/42-piscine | /Notes/Pointers_to_Functions.c | UTF-8 | 898 | 3.59375 | 4 | [] | no_license | POINTERS TO FUNCTIONS
int x;
int *y;
x = 42;
y = &x;
*y = 0; // so now x = 0; keep this shit in MIND
----------
void f(char c); // function returns nothing, it takes a character, c, as a parameters
void (*funptr)(char); // we don't need to specify a name for the function's parameter
// ***** MORE COMPLETE EX... | true |
e2fbbf6b9d3e58d4e6a4809f97de3da37cd208e8 | C | tomtrath/firmware | /rs485eltako.c | UTF-8 | 2,921 | 2.578125 | 3 | [] | no_license | /*
* rs485Eltako.c
*
* Created: 10.11.2012 17:04:51
* Author: thomas
*/
#include <avr/io.h>
#include "uart2.h"
#include "rs485eltako.h"
rs485eltako_t msgrx;
typedef void (*voidFuncPtru08)(const rs485eltako_t *msg);
volatile static voidFuncPtru08 appRxFuncHandler;
#define MODE_WAITING_FOR_PREAMBLE 0
#define M... | true |
222cb77bb0d2a9fedf53c35252bf4cb4998cbc8a | C | NitichaiSawangsai/BUU-Y1 | /30=888142/week04/ex06.c | UTF-8 | 371 | 3 | 3 | [] | no_license |
/*Program name: ex06.c
student: 59160668 Nitichai Sawangsai
section:04
*/
#include<stdio.h>
int main (void)
{
int a,b;
printf("Please enter two integers:");
scanf("%d%d",&a,&b);
if (a <= b )
printf("%d < %d\n",a,b);
else
... | true |
a4e1a7832ca16ce20b208b7a954bde6f9a68d3c7 | C | jamesrafe/soal-shift-sisop-modul-2-C11-2021 | /soal2/soal2.c | UTF-8 | 3,925 | 2.8125 | 3 | [] | no_license | #include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <wait.h>
#include <stdio.h>
#include <glob.h>
#include <dirent.h>
#include <string.h>
int animalCount = 0, nameCount = 0, ageCount = 0;
char animals[55][20];
char names[55][20];
char ages[55][3];
int handleAnimal(char filename[], int j){
int cha... | true |
c1732812941f9159be1745a2e6eac1c84fb85868 | C | raydel95/http-web-server | /src/utils.c | UTF-8 | 2,245 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <setjmp.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <math.h>
#include <semap... | true |
ac2050fae3599034100f13c6f0ff3d4800e108d3 | C | senhaisenhai/sync | /synchronasition.c | UTF-8 | 2,014 | 2.984375 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: synchronasition.c
*
* Description: fork fibonnacci
*
* Version: 1.0
* Created: 2011年09月12日 11时59分59秒
* Revision: none
* Compiler: gcc
*
* Author: XaoQin ... | true |
9ab2a148abd47bc87d90e4d8db63f8373f079f19 | C | theahb/C-tutorial | /hello.c | UTF-8 | 1,172 | 3.5 | 4 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello!\n");
// parse comand line arguments
printf("There are %d command line arguments.\n", argc);
printf("They are:\n");
int i;
for(i = 0; i < argc; i++) {
printf(" %d: %s\n", i, argv[i]);
}
float f = 0;
pri... | true |
220a4b33aec612419c967151a4ce118d80beb47e | C | mkopec/statusline | /i3sl.c | UTF-8 | 2,052 | 3.1875 | 3 | [] | no_license | /* See LICENSE file for copyright and license details. */
/* Global libraries */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
/* Local libraries */
#include "config.h"
#include "blocks.h"
/* Functions */
void signalhandler(int signum);
void pretty_print();
/* Basic signal handling ... | true |
c229df84936180c4d194a51cc1f75553a75cb5c0 | C | Jing-He-1997/C-Practise | /c_programs/s1e31/s1e31_v1.c | UTF-8 | 191 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int i = 520;
printf("before loop, i = %d\n", i );
for(int i = 0; i < 3; i++)
printf("i = %d\n", i);
printf("after loop, i = %d\n", i );
return 0;
}
| true |
1ef3f64eb13363eb11605129f72a3e1b136b4a3b | C | matt-empson/cs50 | /mario.c | UTF-8 | 556 | 3.03125 | 3 | [] | no_license | #include <cs50.h>
#include <stdio.h>
int main(void)
{
int height = 0;
do
{
height = get_int("Height:\n");
}
while (height < 1 || height > 8);
for (int row = 1; row <= height; row++)
{
for (int fs = 0; fs < height - row; fs++)
{
printf(" ");
... | true |
98d6858f32640d08c860ebbe7cca84e6bd3e812c | C | liamkit/hashfs | /ops/unlink.c | UTF-8 | 277 | 2.8125 | 3 | [] | no_license | static int hashfs_unlink(const char *path)
{
char realpath[ PATH_MAX ];
int ret;
debug(1, "calling unlink %s", path);
if (mtor(path, realpath, sizeof(realpath)) < 0) {
ret = ENOMEM;
} else if ((ret = unlink(realpath)) < 0) {
ret = -errno;
}
return ret;
}
| true |
67e2387d6095d3c67eaa9aa2e2a2ae7c92d193fa | C | 1abhi23/c-programming-1 | /17/17.3.3-create-array.c | UTF-8 | 413 | 3.78125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int *create_array(int n, int initial_value)
{
int *a;
a = malloc(n * sizeof(int));
if (!a)
return NULL;
for (int i = 0; i < n; i++)
a[i] = initial_value;
return a;
}
#define SIZE 923
int main(void)
{
int *A = create_array(SIZE, INT_MAX);
... | true |
8b3fbb95f467537fd2087c65db3a276f47d91f7d | C | 333-9/code-dump | /src/31.c | UTF-8 | 1,004 | 2.875 | 3 | [
"BSD-2-Clause-Views"
] | permissive | // 5 kyu
// Write your own printf #2
#include <stdarg.h>
#include <stdlib.h>
char *
mr_asprintf(const char *format, ...)
{
size_t size = 0x400;
char *str = malloc(size), nbuf[16], *nbufp;
size_t i = 0;
char *s;
int n;
va_list ap;
va_start(ap, format);
for (; *format != '\0'; format++) {
if (*format == '{')... | true |
87a2002b5fea1a14af391a6fe698dece4f242463 | C | XiaoJie-Liu/- | /求解三角形面积.c | GB18030 | 575 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#include <stdlib.h>
using namespace std;
int main()
{
cout << "-------֪ߣ-------" << endl;
int a, b, c;
double p, s;
cout <<"ֱε" << endl;
cin >> a >> b >> c;
if (a + b > c&&a - b < c)
{
p = (a + b + c) / 2;
s = sqrt(p*(p - a)*(p - b)*(p - c));
cout << "εs... | true |
aaa4c33c83463f90778f7a5f169571f10133369f | C | aetterer/cs550-pa2 | /Code/src/peer_node.c | UTF-8 | 14,524 | 2.671875 | 3 | [] | no_license | #include "common.h"
#include "network.h"
#include "read_config.h"
#include "constants.h"
#include "thread_queue.h"
#include "cmd_queue.h"
// MACROS ------------------------------------------------------------------ //
#define USAGE "usage: ./peer_node <config_file> <server_ip> <server_port>"
#define CONFIG_FILE "peern... | true |
77001cd6b07f8d7ac713deacd9430e984a6bd253 | C | seacen/Connect4-Socket-Game | /prod-cons.c | UTF-8 | 2,042 | 3.859375 | 4 | [] | no_license | #include <stdio.h>
#include <malloc.h>
#include <unistd.h>
#include <pthread.h>
#include <string.h>
#include <time.h>
typedef int buffer_item;
#define PROD_SLEEP 1
#define CONS_SLEEP 1
#define BUFFER_SIZE 5
#define MAX_PROD 20
#define MAX_CONS 20
buffer_item buffer[BUFFER_SIZE];
unsigned int buff_idx;
int insert_i... | true |
60656727580a5169875f4174ef23da4e42c92183 | C | tenkjm/game | /server/utils.c | UTF-8 | 2,554 | 2.875 | 3 | [] | no_license | //
// utils.c
// server
//
// Created by anton on 03.10.2018.
// Copyright © 2018 anton. All rights reserved.
//
#include "utils.h"
#include <stdio.h>
char* getParamTwoString(char* message, int all)
{
int index1 = 0;
int index2 = 0;
for (int i=0; i < strlen(message); i++)
{
i... | true |
e26e7cfc94c1ca73cc97ec5c3b7ece5c251ad9c7 | C | Slawecky/srod_prog | /Elementarz1/zad2.c | UTF-8 | 194 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
int main() {
int tabela[] = {1, 2, 4, 6, 12};
int n = sizeof(tabela) / sizeof(int);
for (int i = n-1; i >= 1; i--) {
printf("%d ",tabela[i]);
return 0;
}
}
| true |
8d279c5a90b68a3ffb46cebcbb890c60ebc61af1 | C | nicolasherrerac/holbertonschool-low_level_programming | /0x10-variadic_functions/3-print_all.c | UTF-8 | 1,365 | 3.515625 | 4 | [] | no_license | #include "variadic_functions.h"
#include <stdio.h>
#include <stdarg.h>
/**
* print_all - function that prints anything.
* @format: list of arguments.
* Return: Always 0.
*/
void print_all(const char * const format, ...)
{
check array[] = {
{"c", c_char},
{"i", c_int},
{"f", c_float},
{"s", c_string},
{N... | true |
35fa3f17df4d6a5aa523dac48584d4825470e2b3 | C | sanjes09/LifeWork | /C/UCV/Comunicacion_Datos/lab4.3/servidor.c | UTF-8 | 4,663 | 2.625 | 3 | [] | no_license | #include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
//#define PORT 3006
//#define BACKALOG 2
void serverArchivos(int id){
char buffer[100];
DIR *folder;
... | true |
a52a7a03c44a9d22f33338af14c260d369abcb9f | C | marnaa/praktisk_programmering | /homework/interpolation/main.c | UTF-8 | 2,843 | 2.625 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include <gsl/gsl_vector.h>
#include <assert.h>
#include <stdlib.h>
#include <gsl/gsl_spline.h>
#include <gsl/gsl_interp.h>
int binsearch(gsl_vector* x, double z){
/* locates the interval for z by bisection */
int n = (*x).size;
assert(gsl_vector_get(x,0)<=z && z<=gsl_vector_get... | true |
4d881a890f914d62de1578db30ae16167ee5d5ac | C | gonced8/RSA | /main.c | UTF-8 | 1,307 | 3.578125 | 4 | [] | no_license | #include <stdio.h>
int ascii_to_text(int argc, char **argv);
int generate_keys (int argc, char **argv);
int text_to_ascii(int argc, char **argv);
int encrypt(int argc, char **argv);
int decrypt(int argc, char **argv);
int modular_exponentiation(char a[], char b[], char m[], char r[]);
int main (int argc, char **arg... | true |
e3e1071ab45460099ce9e21bcf5b098b8dc633c2 | C | EstherF2/BMC-CS355 | /hw5/sfucci-tests/wf_2.c | UTF-8 | 459 | 2.9375 | 3 | [] | no_license | #include "../mem.h"
#include <stdlib.h>
#define MEM_SIZE 4096
/*
This tests whether worst fit is actually used, but this just has a hole somewhere (a pointer that doesn't get freed)
*/
int main(){
Mem_Init(MEM_SIZE);
void * ptr1 = Mem_Alloc(3000);
void * ptr2 = Mem_Alloc(50);
Mem_Free(ptr1, 0);
void ... | true |
5c887fd401acbe872fa9a5a1f30cb3af7dfecbe4 | C | liviaab/spc-problems | /roteiro5/pedagio.c | UTF-8 | 2,106 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
typedef struct {
int inicio, fim, tamanho;
int itens[10000];
}Fila;
void criaFila( Fila *f){
f->inicio = 0;
f->fim = 0;
f->tamanho = 0;
int i;
for(i = 0 ; i < 5001 ; i++) f->itens[i] = 0;
}
int vazia(Fila *f){
return (f->tamanho == 0)? 1:0;
}
int cheia(Fila *f){
if (f-... | true |
49c018fd0a396f58886a9b6c3f454992b8110ac3 | C | puliuyinyi/learngit | /c/c程序文件/C program for xingru/10/10.c | GB18030 | 273 | 2.765625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
main()
{
int i;
printf("%d ",randnum(1,10));
printf("%d ",randnum(1,10));
}
int randnum(int h,int t)//h~t֮
{
int n;
srand((unsigned)time(NULL));
n=rand()%26;
printf("%d",n);
return n;
}
| true |
72d1f8ec0ac29842d2d0f989eb14d5d20502bf13 | C | tinglengyue/Lora | /Software/Car/delay.c | GB18030 | 1,198 | 3.078125 | 3 | [] | no_license | #include "delay.h"
/*
*
ע⣺мIJu32 iܳ1800붨ʱһӣͨforѭdelay_ms100060Σʹdelay_ms60000Ȼͳˡ
*/
void delay_us(u32 i)
{
u32 temp;
SysTick->LOAD=9*i; //װֵ, 72MHZʱ
SysTick->CTRL=0X01; //ʹܣⲿʱԴ
SysTick->VAL=0; //
do
{
temp=SysTick->CTRL; //ȡǰֵ
}
while(... | true |
96d84de13c83938cfe1813e95a2f13f11db4733c | C | boksajak/OpenCVImageStitching | /source/Camera.h | UTF-8 | 1,437 | 2.96875 | 3 | [] | no_license | #pragma once
#include "glm.h"
struct Camera {
glm::mat4 perspectiveMatrix;
glm::mat4 lookAtMatrix;
glm::mat4 viewMatrix;
glm::mat4 normalMatrix;
glm::vec3 position;
glm::vec3 direction;
glm::vec3 upVector;
glm::vec3 lookAtVector;
glm::vec3 rightVector;
float cameraAngle; //< Horizontal field of view a... | true |
8e6f754120a1e7a1cc4ce3f1bb6ad467098d51f1 | C | dklibc/dklibc | /env.c | UTF-8 | 306 | 2.984375 | 3 | [] | no_license | #include <string.h>
extern char **environ;
char *getenv (const char *name)
{
char **p, *q;
int i;
i = strlen(name);
p = environ;
while (*p) {
q = strchr(*p, '=');
if (!q) /* Is it possible? */
continue;
if ((q - *p == i) && !memcmp(*p, name, i))
return q + 1;
++p;
}
return *p;
}
| true |
4b801d414ab6d568e567c362d871d62061013c0d | C | kulbhushankundalwal/C_Prg | /prg17.c | UTF-8 | 352 | 4.21875 | 4 | [] | no_license | #include <stdio.h>
void swap(int *x, int *y);
int main(){
int x, y;
printf("Enter the Value of X: ");
scanf("%d", &x);
printf("Enter the Value of Y: ");
scanf("%d", &y);
swap(&x, &y);
printf("The Swapped values are X is %d and Y is %d", x,y);
return 0;
}
void swap(int *x, int*y){
... | true |
90c339d519e3eb2fc4026c6682929b8be09ee60f | C | NicholasMacedo/MazeSolver | /src/linkedList.c | UTF-8 | 4,276 | 4.34375 | 4 | [] | no_license | #include "linkedList.h"
/*
This function creates the list using a dummy head. It can be used by calling it and equaling it to the list you made.
*/
listNode * createList()
{
listNode * dummyNode = malloc(sizeof(listNode)*1);
dummyNode->x = 0;
dummyNode->y = 0;
dummyNode->nodeInfo = 0;
dummyNode->ne... | true |
c27556084988f7e52a20f18afb0158aa0b5f4f9a | C | XiyouLinuxGroup-2020/TeamA | /wxz/linuxc/fork_waitpid_while.c | UTF-8 | 1,061 | 3.046875 | 3 | [] | no_license | /*************************************************************************
> File Name: fork_waitpid_while.c
> Author:
> Mail:
> Created Time: 2020年03月29日 星期日 10时35分17秒
************************************************************************/
#include<stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include... | true |
dd348237c7ff6cd4d8ae9be64ef396635d12bd2b | C | FuelFighter/um-car-simulator | /UniversalModuleDrivers/timer.c | UTF-8 | 2,616 | 3.015625 | 3 | [] | no_license | /*
* timer.c
* This C-file helps to either measure time between start and stop or sets a flag after a predetermined timer cycle count.
* Created: 01/04/17 15:46:48
* Author: Sondre
*/
#include "timer.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdint.h>
#include <stdbool.h>
#define F_CPU 8000000... | true |
537a63100e4d6c0253abadebb6d377bcfac06e49 | C | mi-fan/C-Project-Practice | /Snake/display_handle.c | UTF-8 | 5,103 | 2.84375 | 3 | [] | no_license | #include "display_handle.h"
//*********************************************//
// //
// Define the functions used for display //
// pictures, shapes and words //
// //
//**************************************... | true |
d642662e9966bd5dfad2e7e2ea683d53a3d3c9da | C | rajrpatel62499/DataStructures | /C Pro/FILE HANDLING PROGRAMMS/filehandling.c | UTF-8 | 557 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
#include<string.h>
int main()
{
FILE *fsource,*ftarget;
char data[10]="rajrpatel";
int length=strlen(data);
int i;
char ch;
fsource=fopen("Diary.txt","r");//
ftarget=fopen("raj.txt","a"); //I opened in append mode so ftarget pointer will be point after the last character o... | true |
a56f86c9956c967a9135ca5a40cf1220b12bc60b | C | paulotokarskiglinski/C | /maratona/strings/exer1168.c | UTF-8 | 712 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
int main() {
int n, op, cont, i, total = 0;
char num[100];
scanf("%d", &op);
for(cont = 0; cont < op; cont++) {
scanf("%s", num);
for(i = 0; i <= strlen(num); i++) {
switch(num[i]) {
case '0': { total += 6; break; }
case '1': { total += 2; break; }
case... | true |
339f2a741f13b0a8a47e0d466b64eb017ae986a0 | C | tgey/Philosophers | /src/arg.c | UTF-8 | 790 | 3.390625 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2018
** philo
** File description:
** parsing arguments
*/
#include "philosopher.h"
bool is_number(char *str)
{
int i = 0;
while (str[i]) {
if (!isdigit(str[i]))
return (false);
i += 1;
}
return (true);
}
int check_args(char **argv)
{
bool p = (!strcmp(argv[1], "-p") || !strcmp(ar... | true |
ec40215267a12a8a100fdf990691ebfb7a694712 | C | codeaaaa/c-study-primary | /入门学习函数9/入门学习函数9.c | WINDOWS-1252 | 370 | 3.140625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
//ݹ
void print(int n)
{
if (n > 9)
{
print(n / 10);
}
printf("%d ", n % 10);
}
int main()
{
//printf("hehe\n");
//main();
//ջ
unsigned int num = 0;
scanf("%d", &num);//1234
//ݹ
print(num);
//print(1234);
//print(123) 4
//print(12) 3 4
//print(1) 2... | true |
10c188795af0173feeedbdb6df7579849aad6f61 | C | AgustinRow/SeminarioC | /p6_ej6_recursivo.c | UTF-8 | 516 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int imprime_recursivo_inverso(char * string, int longitud){
if (longitud == 0){
printf("%c\n", string[longitud]);
return 0;
}
else {
printf("%c", string[longitud]);
imprime_recursivo_inverso(string, (--longitud));
return 0;
}
}
int main(){
c... | true |
20b5e87d8d5d810e9995c1072a52b7769f47f13d | C | japowell1/EE459_Project | /testLCD/lcd.c | UTF-8 | 7,080 | 2.796875 | 3 | [] | no_license | /*************************************************************
* lcd.c - Demonstrate interface to a parallel LCD display
*
* This program will print a message on an LCD display
* using the 4-bit wide interface method
*
* PORTB, bit 4 (0x10) - output to RS (Register Select) input of display... | true |