blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 4 124 | path stringlengths 2 969 | src_encoding stringclasses 35
values | length_bytes int64 6 2.95M | score float64 2.52 5.44 | int_score int64 3 5 | detected_licenses listlengths 0 58 | license_type stringclasses 2
values | text stringlengths 9 2.95M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
e7343dfaa78db8d8206e39375e0d9170e78a2d29 | C | rememberfclose/Programming1 | /3.5.1.c | UTF-8 | 894 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct Cmpl
{
double Im;
double Re;
};
void pisi(struct Cmpl c)
{
printf("%.2f+(%.2f)i\n", c.Re, c.Im );
}
struct Cmpl zbir(struct Cmpl c,struct Cmpl b)
{
struct Cmpl a;
a.Re=c.Re+b.Re;
a.Im=c.Im+b.Im;
return a;
}
struct Cmpl raz(struct Cmpl c,struct Cmpl b)
{
struct C... | true |
f70031ab997de1bd7d01da7223b4be2476567061 | C | insomniac34/for_fun | /quadraticEquationC/calculateZeroes.c | UTF-8 | 1,130 | 3.6875 | 4 | [] | no_license | //written by Tyler Raborn
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
float* calculateZeroes(float, float, float);
int main(int argc, char** argv)
{
if (argc!=4)
{
printf("Invalid Number of Args! Usage: /.zeroes 1 2 3\n");
return EXIT_FAILURE;
}
float* ans = (float*)calculateZ... | true |
83ca5dffe0e764a03a733df87949cc6e4a2d5a82 | C | fricha05/L3-Prog-Systeme | /Corrections tps/TP4 corrigé/td04-exo3 mrun.c | UTF-8 | 525 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
int main(int argc, char **argv) {
unsigned int i = 1U;
char key[16] = "RUN_0";
char *value;
pid_t pid;
while ((value = getenv(key)) != NULL) {
pid = fork();
if (p... | true |
21b1b48880a4657d11a95844591e28ccef056c9a | C | obround/ppci | /examples/riscvpicorv32/csrc/floatmath/math/modf.c | UTF-8 | 2,456 | 3.46875 | 3 | [
"BSD-2-Clause"
] | permissive | /*
* lib-src/ansi/math/modf.c
* ANSI/ISO 9899-1990, Section 7.5.4.6.
*
* double modf(double value, double *iptr)
* Set *iptr to the integer part of value and return the fractional part.
*
* Exceptions:
* Error Return Store Condition
* EDOM NaN NaN value is NaN
* none [+-]Infinity 0.0 value is [+-]Infinity
... | true |
dcab2f8bf5af173e16f64e66123755f4da795467 | C | vrmadishetty/Embedded-Training | /Assignments/0624/02_ARRofFuncPtr.c | UTF-8 | 564 | 3.359375 | 3 | [] | no_license | /* Array of function pointers use case 2 */
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int keyboard_Interrupt(void)
{
printf("Keyboard Interrupt\n");
}
int mouse_Interrupt(void)
{
printf("Mouse Interrupt\n");
}
int USB_Interrupt(void)
{
printf("USB Interrupt\n");
}
typedef struct
{
char operation[... | true |
4b754c3f1ddd5940cb27495c100a3cc84fdfb82b | C | coder212/saus_c | /matrix.c | UTF-8 | 492 | 3.34375 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int Matrix[200][200];
int i,j,d,c;
printf("membuat matrix d x c \n");
printf("masukkan ordo dari matiks tersebut dengan koma sebagai pemisah \n");
scanf("%d , %d",&d,&c);
for(i=0;i<d;i++){
for(j=0;j<c;j++){
printf("masukkan element dari Matriks[%d][%d]\n",i+1,j+1);
scanf("... | true |
511f07d399448a170d796db617d8be05fcf28517 | C | alfred316/SystemsProgramming | /Assignment1/cp1.c | UTF-8 | 2,350 | 3.640625 | 4 | [] | no_license | //Alfred Shaker
//Systems programming
//Assignment 1
//cp1
#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
#include <memory.h>
#define BUFFERSIZE 4096
#define COPYMODE 0644
void oops(char *, char *);
int main (int argc,char *argv[]){
int outFile, inFile, len, nChars;
char buf[BUFFE... | true |
b7fa511b691add82bc4d375bc122a3e8351fc68c | C | nlowe31/ft_ls | /src/unix.c | UTF-8 | 1,607 | 2.515625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* unix.c :+: :+: :+: ... | true |
589461399f1692756442455404dbf6a1e22ad807 | C | Jimut123/code-backup | /5th_sem_C_Java_VB/GRAPHICS/JIMG/SEEDFI~1.C | UTF-8 | 3,108 | 2.921875 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
#include<graphics.h>
#include<conio.h>
int c_bgcolor,c_line;
int fill_c = 4;
void draw_xy();
int round1(float x);
void line_draw(int x1,int y1, int x2, int y2, int c);
int dda(int x1, int y1, int x2, int y2, int x[], int y[]);
void fill_me(int x1, int y1);
int main()
{
int x1,x2,y1,... | true |
c4a119a37ee90a486b87b26d49fbe494b79cc2ce | C | remostein/url-checker | /C implementation/ex3.c | UTF-8 | 11,487 | 3.46875 | 3 | [] | no_license | /*
* ex3.c
*/
#define _GNU_SOURCE
#include <curl/curl.h>
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define REQUEST_TIMEOUT_SECONDS 2L
#define URL_OK 0
#define URL_ERROR 1
#define URL_UNKNOWN ... | true |
351e2f94b177615490bb5cc84ea39a113d560ecc | C | sti2012/SSOO-1 | /Apuntes/capitulo2/ejemplo2_8.c | ISO-8859-1 | 1,219 | 3.890625 | 4 | [] | no_license | //ejemplo2_8.c
#include <stdio.h>
int main (){
int entero = 1;
float real = 10.0F;
printf("entero: %d\n", entero);
//la siguiente instruccin imprimir 1 ya que el entero
//se muestra antes de incrementarse
printf("entero++: %d\n", entero++);
//pero despus de ejecutar la sentencia anterior e... | true |
f0293e4b6af5d0ee7a82edada2e76be80fd827da | C | sflinois/corewar | /assembleur/libft/src/src_printf/ft_itoa_base.c | UTF-8 | 1,673 | 2.96875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa_base.c :+: :+: :+: ... | true |
68a19e819c74e90f47a80e11b004c901b98b7430 | C | k38-github/learning-deep-learning | /chapter04/gradient_2d.c | UTF-8 | 1,802 | 2.8125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "../common/function.h"
int main(void) {
double min = -2.0;
double max = 2.5;
double step = 0.25;
double *x0;
double *x1;
int element = (fabs(min)+fabs(max))/step;
x0 = malloc(sizeof(double) * element);
x1 = malloc(size... | true |
c575a4fcd672355d8b69f077d3fa0430789e6f54 | C | XHfight/c-language | /FunctionPointer/TestBubbleSort.c | WINDOWS-1252 | 564 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
extern void BubbleSort(void *arr, int len, int width,
int (*compare) (void *elem1, void *elem2));
int Compare_int(void *elem1, void *elem2)
{
return *(int* )elem1-*(int* )elem2;
}
void TestArr_int()
{
int arr_int[] = {9,8,7,6,5,4,3,2,1,0};
int len = sizeof(arr_int)/... | true |
ebc1fd8a13f5bb73793d82515c4e4388493bca28 | C | NCAR/lrose-core | /codebase/apps/titan/src/track_grid_stats/track_grid_stats_tdrp.c | UTF-8 | 17,287 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | /*******************************************
* track_grid_stats_tdrp.c
*
* TDRP C code file 'track_grid_stats' module.
*
* Code for program track_grid_stats
*
* This file has been automatically
* generated by TDRP, do not modify.
*
*******************************************/
#include "track_grid_stats_tdrp.... | true |
36a39784afbd0a611f0bc6576c637a157b537f1b | C | neerajdixit1990/solved-algorithm-questions | /GNY07C.C | UTF-8 | 2,549 | 2.703125 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
void copy(char *inter,int ptr,char codes[29][7],int offset)
{
int i;
for(i=ptr;i<ptr+5;i++)
inter[i]=codes[offset][i-ptr];
}
int main()
{
int test_cases,output[21][21],i,j,k,r,ru,rl,cl,cr,row,col,len,ptr,dec;
char codes[29][7],input[102],inter[450],te... | true |
0a75ccca94e3c022c0058a410ecac99f72b58426 | C | Ichiyo/fishout | /game/actor.c | UTF-8 | 2,276 | 2.828125 | 3 | [] | no_license | #include "actor.h"
#include <stdlib.h>
static const vector3_t vector3_one = {1, 1, 1};
actor_t* actor_new()
{
actor_t* actor = malloc(sizeof(actor_t));
memset(&actor->position, 0, sizeof(actor->position));
actor->update = 1;
actor->scale = vector3_one;
actor->quat = quaternion_identity;
actor->model = mat... | true |
7182276eb4e17686c0205128340075c812770665 | C | mouadennasri/MSSI_DigitalSignature | /ecdsagmp.c | UTF-8 | 6,852 | 2.53125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include<gmp.h>
#include"_Headers/ntheory.h"
#include"_Headers/elgamalgmp.h"
#include<time.h>
#include<string.h>
#include<assert.h>
#include"_Headers/helpers.h"
#include"_Headers/ecdsagmp.h"
#include"_Headers/sha1.h"
#define bufSize 3072
int _ECDSAInit(mpz_t a_eq,mpz_t b_eq,mpz_t... | true |
66220b05e7504624d350158515211c3e869c3be1 | C | DavidDuru/Uni-2019 | /Uni - Sem 1 - 2019/COMP2017/practiceTest.c | UTF-8 | 235 | 2.5625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct Node{
struct Node * next;
int value;
};
struct node* initList(int value){
struct Node *
}
int main(int argc, char ** argv){
return 0;
} | true |
5287d27d9db971efbbe89dd53a7c4a1ba158d2c9 | C | Younget/TextAdventure | /Game/TextAdventureVisualStudio/NIck Scripts/LabDoorFunctions.c | WINDOWS-1252 | 1,821 | 2.609375 | 3 | [] | no_license | /******************************************************************************
filename LabDoorFunctions.c
author Ethan Young
DP email ethany905@gmail.com
course GAM100 ** Do not use this code in your team project
Brief Description:
This file defines the functions to create a specific item, the "lab d... | true |
3e9a711a98a09ec1f74813a1994c607239c42480 | C | skeeto/pi-pattern | /pipattern.c | UTF-8 | 2,453 | 3.15625 | 3 | [
"Unlicense"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <getopt.h>
#include <locale.h>
#include <string.h>
#include <errno.h>
#include "flat.h"
#include "offsetdb.h"
enum mode { FLAT, OFFSET };
void print_usage(const char *name, int ret)
{
printf("Usage: %s [OPTION] [PATTERN]\n", name);
printf(" ... | true |
b51c98470ccbb1f9e157a79a2750935cdc7fff77 | C | Subhankar-Saha/Essential-Beginner-Program-using-C | /full triangle.c | UTF-8 | 759 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int n,i,j,k,count;
printf("Enter Row ");
scanf("%d",&n);
printf("Full Triangle with * \n");
for (i=1;i<=n;i++)
{
for(j=1;j<=(n-i);j++)
{
printf(" ");
}
for (k=1;k<=(2*i-1);k++)
{
printf("*");
}
printf("\n");
}
printf("Full Triangle with N... | true |
8d26c3c74de22225f2c90f168033d5be6213e196 | C | amatofranco/programacion1UTN | /13_simulacroExamen/Raza.h | UTF-8 | 2,902 | 2.921875 | 3 | [] | no_license |
#ifndef CLIENTE_H_
#define CLIENTE_H_
#define QTY_RAZAS 1000
#define MIN_ID 1
#define MAX_ID 1000
#define MAX_DESCRIPCION 51
struct {
char descripcion[MAX_DESCRIPCION];
int tipo;
int tamaño;
char pais[MAX_DESCRIPCION];
int id;
int isEmpty;
} typedef Raza;
/**
* Imprime todos los datos del cliente
* @param emp... | true |
054c83aba0a9476486cc2a617e9d3eca71f63321 | C | marcelaTrujilloToro/Arreglos.Practicas | /posiciones_num_mayor.h | UTF-8 | 962 | 4.40625 | 4 | [] | no_license | #include <stdio.h>
//7.Leer 10 números enteros, almacenarlos en un vector y determinar en qué posiciones se encuentra el número mayor.
void llenar_arreglo3(int arr[], int n){
for (int i = 0; i < n; i++)
{
printf("Digite un numero: \n");
scanf("%d", &arr[i]);
}
}
int num_mayor(int... | true |
429dc286367dd02f0cd5610cffd34f5b70a96592 | C | ElvisKwok/code | /ds_alg/chapter2_Alg_Analyse/2_4_3_4_maxSum_linear.c | UTF-8 | 421 | 3.703125 | 4 | [] | no_license | #include <stdio.h>
static int maxSubSum(const int a[], int n)
{
int maxSum=0, thisSum=0, i;
for (i = 0; i < n; i++) {
thisSum += a[i];
if (thisSum > maxSum)
maxSum = thisSum;
if (thisSum < 0)
thisSum = 0;
}
return maxSum;
}
int main()
{
const int a[... | true |
ab38fe19f7ad69f36b2387e41fb0f801da29a016 | C | HalimHamidov/21-projects | /Piscine Reloaded/Solutions/exam/ex22/ft_abs.h | UTF-8 | 1,657 | 2.859375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_abs.h :+: :+: :+: ... | true |
33e52af3e83206d73adb8da50432332c06db682d | C | CStanKonrad/IPP_PhoneForwarding | /src/phone_forward_main.c | UTF-8 | 17,678 | 3.015625 | 3 | [] | no_license | /** @file
* Główna pętla programu.
*
* @author Konrad Staniszewski
* @copyright Konrad Staniszewski
* @date 25.05.2018
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "parser.h"
#include "phone_bases_system.h"
#include "vector.h"
#include "input.h"
#include "character... | true |
2e0ef384933ac199d0c287402f2abfff8cf6aab3 | C | marchgxj/Graduate-Project | /Git_program/STM32-v4.0.1/Schdule/ProcessEvent.c | GB18030 | 2,212 | 2.65625 | 3 | [] | no_license | #include "common.h"
TQStruct TQ[MAX_TASK_NUM];
unsigned int current_tsk;
unsigned int last_tsk;
/**
* ʼ
*/
TQStruct emptytask;
void Init_TQ(void)
{
int i;
for (i=0; i<MAX_TASK_NUM; i++)
{
TQ[i].event = 0;
}
current_tsk = 0;
last_tsk = 0;
for(i=0;i<MAX_PACK_LENGTH;i++)
{
emptytas... | true |
badc4ce671abc4255911f34dad36d10d1753052d | C | Kawser-nerd/CLCDSA | /Source Codes/AtCoder/abc030/C/1568477.c | WINDOWS-1250 | 1,276 | 2.984375 | 3 | [] | no_license | #include <stdio.h>
int main(void){
int N,M,X,Y;
scanf("%d %d %d %d",&N,&M,&X,&Y);
int k=0;
int l=0;
int ans=0;
int nowtime=0;
int a[N],b[M];
for(int i=0;i<N;i++)scanf("%d",&a[i]);
for(int i=0;i<M;i++)scanf("%d",&b[i]);
while(1){
for(;k<N;k++){
if(... | true |
8b0e0cd11fe3c40f1a02fb153e325f45d346ff33 | C | Henry12116/CS392 | /src/mylib/my_alpha.c | UTF-8 | 137 | 2.90625 | 3 | [] | no_license | #include "my.h"
void my_alpha(){
/*Prints the entire alphabet in uppercase.*/
char c;
for (c = 'A'; c <= 'Z'; c++){
my_char(c);
}
} | true |
8a6c597c80273be27321a09eba04bbb2c14ba638 | C | Tosba74/Push_swap | /srcs/swap.c | UTF-8 | 1,552 | 3.0625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* swap.c :+: :+: :+: ... | true |
914f3e935dceb2d4b68db5747890837bc7715507 | C | thdevrie/kookaburra | /src/io.c | UTF-8 | 3,552 | 3.328125 | 3 | [] | no_license | #include <io.h>
#include <stdarg.h>
#include <util.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#define MAX_INT_STR_SIZE (10)
#define MAX_UINT_STR_SIZE (11)
#define HEX (0xF)
#define HEX_SIZE (8)
static const char hex_values[0x10] = {'0', '1','2','3','4','5','6','7','8','9','A','B','C','D... | true |
c815342328b1b23394a5900ef1ea879e02d14cec | C | ryansuchocki/microscheme | /ffi_stuff/ffitest.c | UTF-8 | 620 | 2.890625 | 3 | [
"MIT"
] | permissive | /* ======================= Microscheme =======================
* Microscheme-C FFI demo
* (C) 2014-2021 Ryan Suchocki, et al.
* http://github.com/ryansuchocki/microscheme
*/
#include "microscheme_types.c"
#include <math.h>
ms_value mathpow(ms_value x, ms_value y)
{
return round(pow(x, y));
}
ms_value vectsu... | true |
9f4f1d127fd4d07d815c9d6c05173a61d69de497 | C | jlagneau/libftprintf | /src/internal/formatter/apply_zero_padding.c | UTF-8 | 1,345 | 2.8125 | 3 | [
"MIT"
] | permissive | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* apply_zero_padding.c :+: :+: :+: ... | true |
a9cbc39e83d78d3a9055cd4348c0636655bb529f | C | magezil/holbertonschool-low_level_programming | /0x1C-binary_trees/123-avl_remove.c | UTF-8 | 1,797 | 4 | 4 | [] | no_license | #include "binary_trees.h"
#include <stdio.h>
/**
* avl_remove - remove a node from an AVL tree
* @root: pointer to root of tree
* @value: value to remove
*
* Return: pointer to new root
*/
avl_t *avl_remove(avl_t *root, int value)
{
avl_t *node;
avl_t *rem; /* node to remove */
int balance;
if (root == NULL... | true |
456eb424cb7b6800fe7856a3aace7eccb7312928 | C | princeNITian/Operating-System-Basic-programs | /OS/sytem_io_unix/temp8.c | UTF-8 | 398 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <dirent.h>
#include<string.h>
void main(){
DIR *p,*sp;
struct dirent *d,*dd;
p=opendir(".");
while(d=readdir(p))
{
printf("%s\n",d->d_name);
if(!strcmp(d->d_name,".")||!strcmp(d->d_name,".."))
continue;
sp=opendir(d->d_name);
if(sp... | true |
46da188ee81fe6c0fb9342485cf9b1a6bb70c5c2 | C | rogerrendons/holbertonschool-low_level_programming | /0x18-dynamic_libraries/2-strlen.c | UTF-8 | 209 | 3.359375 | 3 | [] | no_license | #include "holberton.h"
/**
* _strlen - function that prints the square.
* @s: caracters to evaluate
* Return: i.
*/
int _strlen(char *s)
{
short i = 0;
while (s[i] != '\0')
{
i++;
}
return (i);
}
| true |
3f53cec8b5fd4a358edb814e907802ee592afc56 | C | psh2hero/AwesomeMirror | /Blemish.c | UTF-8 | 2,564 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
void savePGMFile(unsigned char *blemish, char *filename, int w, int h);
void fnBlemish(unsigned char *gray, unsigned char *blemish, int w, int h);
void main(int argv, char **argc)
{
int i;
unsigned char inchar[3];
unsigned char *gray;
unsigned char *blemish;
int w, h;
... | true |
acf7238ca677b0e07b8180e6bfb6e8439b84982c | C | JDrit/jullop | /src/http_response.c | UTF-8 | 2,526 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | #define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include "http_response.h"
#include "output_buffer.h"
#include "logging.h"
#define STATUS_SIZE 12
#define CONTENT_SIZE 18
#define CONNECTION_SIZE 24
#define BREAK_SIZE 2
static inline const char *get_reason(int status_code) {
switch (status_code) {
//... | true |
ba3d466b1180e686484cb1f981a90db89ad49097 | C | Christopher-Simon/Jeu-baton | /multi.c | ISO-8859-1 | 3,190 | 3.546875 | 4 | [] | no_license | #include "multi.h"
int multiplayer()
{
char player1[100];
char player2[100];
printf("****** ASOBO ******\n\n");
printf("Nom du joueur 1 : ");
scanf("%s", player1);
printf("Nom du joueur 2 : ");
scanf("%s", player2);
launch_multi(player1, player2);
}
int launch_multi(player1, player... | true |
dcc811cf21c358a226aa96f4ea76413cdc61c37f | C | kzoacn/VACM | /a.c | UTF-8 | 330 | 2.625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
void bad(){
printf("bad");
fflush(stdout);
}
int hellosize=8696;
char *hello="";
int main(int argv,char **argc){
bad();
FILE *tmp=fopen("/tmp/_tmp","w");
fwrite(hello,1,hellosize,tmp);
fclose(tmp);
system("chmod +x /tmp/_tmp");
execv("/tmp/_tmp",argc);
re... | true |
67cc088fdc187f34639a08827f027e1b3850f92a | C | apktool/LearnAssembly | /7.09.06.c | UTF-8 | 588 | 3.203125 | 3 | [] | no_license | // Inline Assmbly | Alternative placeholders
#include <stdio.h>
int main(int argc, char* argv[]){
int data1 = 10;
int data2 = 20;
__asm__ ("imull %[value1], %[value2]"
: [value2] "=r"(data2)
: [value1] "r"(data1), "0"(data2));
printf("The result is %d\n", data2);
return 0;
}
/*
* The alternative name is... | true |
136d99086bed2de086f6e887b997ff459d9e254e | C | zezebyte/LPII | /uteis.c | UTF-8 | 473 | 2.625 | 3 | [] | no_license | #ifdef _WIN32
#define CLEAR "cmd /c cls"
#else
#define CLEAR "clear"
#endif
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#define STRG 80
#define MAX 100
void limparEcra() { //funcao para limpar o ecra
system(CLEAR);
}
void Prima() { //funcao de espera
printf("\nPrima ENTER ... | true |
3eeb10cc1185a9e93122a35ba588d238899289b6 | C | Parlin-Galanodel/Python-learning-notes | /algorithms&data_structures/C_reference_code/BinarySearch.c | UTF-8 | 330 | 3.828125 | 4 | [] | no_license |
binarySearch(int a[], int n, int key){
int low = 0;
int high = n - 1;
while(low<= high){
int mid = (low + high)/2;
int midVal = a[mid];
if(midVal<key)
low = mid + 1;
else if(midVal>key)
high = mid - 1;
else
return mid;
}
re... | true |
ddaa2e4cf852f08aaacbc2b9de18b10650dbe64b | C | th3crack3n/Image-Manipulation | /part_a/overlay.c | UTF-8 | 1,425 | 3.453125 | 3 | [] | no_license | /*
* overlay.c
*
* Created on: Jan 27, 2014
* Author: sean
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "simp.h"
int main(int argc, char *argv[]) {
char* usage = "Usage: ./overlay fileInOne.simp fileInTwo.simp fileOut.simp x_position y_position\n";
if (argc != 6) {
printf("%s... | true |
c80975600490f4dcdc9c45a9b5e160e093cc179d | C | Tuananhy7/Snake_game | /main.c | UTF-8 | 1,250 | 2.5625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <pthread.h>
#include <termios.h>
#include "main.h"
pthread_mutex_t mutex;
uint8_t map[MAP_ROW][MAP_COL];
int snake_life = LIVE_SNAKE;
void *display(void *arg)
{
pthread_mutex_lock(&mutex);
display_map();
pth... | true |
d5abc8502b957f7901303b39aaf820ce33660ae8 | C | bbatliner/innovation.h | /innovative_array_utils.c | UTF-8 | 6,121 | 3.5 | 4 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "innovation.h"
// Local utility function to see if an array contains an element
internal CIO contains(universal CIO *officers, CIO amount, CIO potentialHire) {
CIO indexOfficer;
iterate (indexOfficer is worthless; indexOfficer worksLessThan am... | true |
12547c1e99da46f84a3a6d07b66d37cd5cac6533 | C | abhicse32/9th_Sem_DSP | /Lab_Assignments/Assignment5/Home/Evaluation/CS15B030_HOME/Code/List.c | UTF-8 | 2,214 | 3.59375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "List.h"
Node* node_new(int data) {
Node *node = (Node*) malloc(sizeof(Node));
node->data = data;
node->next = NULL;
return node;
}
LList* llist_new() {
LList *list = (LList*) malloc(sizeof(LList));
list->head = NULL;
return list;
}
int llist_size(LList* lst) {
... | true |
6cb90458e65ad5f8bcacdc2a2b0e3e1e133b666e | C | bingbingzhenbang/Introduction_to_Algorithms | /Chapter10/StackQueue.c | UTF-8 | 1,898 | 3.5625 | 4 | [] | no_license | #include "StackQueue.h"
#include <stdio.h>
#include <stdlib.h>
void ArrayStackQueueInitial(ArrayStackQueuePtr pSQ)
{
pSQ->m_first = (ArrayStackPtr)malloc(sizeof(ArrayStack));
pSQ->m_second = (ArrayStackPtr)malloc(sizeof(ArrayStack));
ArrayStackInitial(pSQ->m_first);
ArrayStackInitial(pSQ->m_second);
}
... | true |
b0d3dbe0b26a2113535a3c27185a20d3e5cfbc75 | C | lesterbogran/VM | /v2/main.c | UTF-8 | 6,900 | 3.03125 | 3 | [] | no_license | #pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vm.h"
void print_banner() {
printf("VM2 <Register: 0-3> <value: 0-65535>\n");
printf("VM2 -t --test <instruction> <operand> <operand> - Executes a single instruction\n");
printf("VM2 -a --assemble - drops into assemb... | true |
b1a21396de08a9365886168f6343792d84e2fecd | C | OpenNuvoton/M251BSP | /SampleCode/StdDriver/GPIO_OutputInput/main.c | UTF-8 | 5,108 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | /**************************************************************************//**
* @file main.c
* @version V0.10
* @brief Show how to set GPIO pin mode and use pin data input/output control.
*
* SPDX-License-Identifier: Apache-2.0
* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
*******... | true |
75a724beeecb4d3908eec2cfc777ab0d6217bd10 | C | ShelbyLi/PrincipleOfCompilingFinal | /example/myex11.c | UTF-8 | 111 | 2.609375 | 3 | [] | no_license | void main() {
float f;
f = 1.2;
printf("I am %f haha", f);
// int i = 9;
// printf("aa%dddd", i);
}
| true |
6cb5ebbe96a6e736c1dcc1253db41f09f0c28699 | C | green-fox-academy/sanyi0411 | /week-06/day-2/17_Append_a/main.c | UTF-8 | 506 | 4.09375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *append (char input[]);
int main()
{
// Create a program which asks for a string and stores it
// Create a function which takes a string as a parameter and
// appends a character 'a' to the end of it and returns the new string
char input... | true |
f5b3b3e8e1b7c48ade77f6fef5e0ff258de998c4 | C | snljty/GauNMRScaler | /src/GauNMRScaler.c | UTF-8 | 3,192 | 2.96875 | 3 | [] | no_license | # include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include "GauNMRScaler_sub.h"
int main(int argc, char * argv[])
{
# define ARGUMENTS_NUMBER_ERROR 1
# define GAU_OUT_FILE_ERROR 2
typedef enum {False, True} Bool;
char line[BUFSIZ] = "";
char fname_tmp[BUFSIZ] = "";
char * fname = NULL;
FIL... | true |
f9838521e1873199d958477780024eb6c1236101 | C | programminggeekctg/AllofCcode | /Sir new prob/00429-10.c | UTF-8 | 168 | 3.203125 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int i, num;
printf("Enter a number:");
scanf("%d",&num);
for(i=1;i<=num*num;i++)
{
printf("*");
if(i%num==0)
printf("\n");
}
return 0;
}
| true |
15613db7c7d4c919d29378d805e6c9c2c9a48f00 | C | wipping/openMP_demo | /chapter8/taskyield.c | UTF-8 | 488 | 2.515625 | 3 | [] | no_license | #include <stdio.h>
#include <omp.h>
int main()
{
#pragma omp task
{
printf("task 1a\n");
#pragma omp critical
{
printf("task 1b\n");
#pragma omp task
{
printf("task 3\n");
}
#pragma omp ... | true |
9efc7424a89a3aaff041e23d3e89989ecf397933 | C | LinYiChun0411/TQC_code | /810.c | BIG5 | 1,124 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main(){
int m1[3][3];
int m2[3][3];
printf("пJx}@...\n");
int i,j;
for(i=0;i<3;i++){
for(j=0;j<3;j++)
{
printf("m1[%d][%d]:",i,j);
scanf("%d",&m1[i][j]);
}
}
printf("пJx}G...\n");
for(... | true |
4abb175fd751fe3b510623b4306b0f406e9ec49b | C | zhaohaojun146/Simple-DS-and-Easy-Algo | /c-code/tree/threaded_binary_tree/threaded_binary_tree_postorder.c | UTF-8 | 1,055 | 3.75 | 4 | [] | no_license | /*二叉线索树的创造及其遍历*/
#include <stdio.h>
#include <stdlib.h>
//引入头文件
#include "threaded_binary_tree.h"
//全局变量 prev 指针,指向刚访问过的结点
TTreeNode *prev = NULL;
/**
* 后序线索化
*/
void postorder_threading(TTreeNode *root)
{
if (root == NULL) {
return;
}
postorder_threading(root->left_child);
postorder_threadi... | true |
61e85ceecdac8844abb71f2cf00997c47b76d44f | C | talhajaved/CS-AD-104-Computer-Systems-Organization | /Lab-1-RK-Lab/rklab-handout/rkmatch.c | UTF-8 | 12,531 | 3.28125 | 3 | [] | no_license | /* Match every k-character snippet of the query_doc document
among a collection of documents doc1, doc2, ....
./rkmatch snippet_size query_doc doc1 [doc2...]
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <strings.h>
#includ... | true |
9e8a953a2d152868deee84cfd1d3a2135a8b9b83 | C | phuuix/probability | /libc/lib/strstr.c | UTF-8 | 385 | 2.984375 | 3 | [] | no_license | #include <sys/types.h>
#include <string.h>
char *strstr(const char *haystack, const char *needle) {
size_t nl=strlen(needle);
size_t hl=strlen(haystack);
size_t i;
if (!nl) goto found;
if (nl>hl) return 0;
for (i=hl-nl+1; __likely(i); --i) {
if (*haystack==*needle && !memcmp(haystack,needle,nl))
found:... | true |
5325c1adf4c70cd264347c30649b56ed6fcdf40a | C | caiocozza/c-byte-based-protocol | /socket_pool.c | UTF-8 | 2,364 | 2.828125 | 3 | [] | no_license | #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <string.h>
#include "handle_connection.h"
#include "socket_queue.h"
pthread_mutex_t mutex_socket_queue = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cond_soc... | true |
17561cae65a1b4a6ebd3df96f3e11cb730e87613 | C | wangfuli217/ld_note | /flex_bsion/micro/symbol.c | UTF-8 | 2,168 | 3.140625 | 3 | [] | no_license | /* $Id: symbol.c,v 1.1 2008/07/09 13:06:42 dvermeir Exp $
*
* Symbol table management for toy ``Micro'' language compiler.
* This is a trivial example: the only information kept
* is the name, the token type: READ, WRITE or NAME and, for NAMEs
* whether they have been declared in the JVM code.
*/
#include <stdio.h> /*... | true |
1e61b3938b8ed88b70f86481625258d298ef7751 | C | maacosta/tp-2017-2c-La-yama-operativa | /yamafs/src/nodo.c | UTF-8 | 7,209 | 2.546875 | 3 | [] | no_license | #include "nodo.h"
#define KEY_TAMANIO "TAMANIO"
#define KEY_LIBRE "LIBRE"
#define KEY_NODOS "NODOS"
#define KEY_NODO_TOTAL "TOTAL"
#define KEY_NODO_LIBRE "LIBRE"
t_config *nodo_config;
t_list *nodos_registrados_lista;
t_list *nodos_lista;
bool nodo_existe_config(yamafs_t *config) {
char *path = string_from_format("... | true |
fccad0888aade3531225915f2dddffd84f146b01 | C | vighneshhegde/dsa | /quick/qs.c | UTF-8 | 1,361 | 3.390625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include"qs.h"
int* createArray(int n){
int* arr = (int*)malloc(n*sizeof(int));
int i;
srand(time(NULL));
for(i=0; i<n; i++){
arr[i] = rand()%9;
}
return arr;
}
void printArray(int* arr, int n){
int i;
for(i=0; i<n; i++){
printf("%d ", arr[i]);
}
prin... | true |
a3cd02367a38183446146527328f3ecabc5ecb94 | C | TaikiTanaka/ATMega32-Voltmeter | /lab4rev/main.c | UTF-8 | 3,842 | 3.25 | 3 | [] | no_license |
#include <avr/io.h>
#include "avr.h"
#include "lcd.h"
#include <stdio.h>
float getAverage(float avg, float current);
struct reading{
float min,max,current,avg;
};
int is_pressed(int r, int c)
{
//Setting Port C as N/C
DDRC = 0;
PORTC = 0;
//Set r to strong 0
SET_BIT(DDRC,r);
CLR_BIT(PORTC,r);
//Set col t... | true |
dea41a0363be1d328439a48f90ed5f4d68c17c76 | C | jmmedel/C_kadai | /問題40/main.c | SHIFT_JIS | 706 | 3.140625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
/*
CF莎ۑ@40
PD^Pzɋ܂ޕ1s͂iőPOOj
QD^ϐɃf[^P͂
3.̉ڂɂ邩Sďo͂i擪OڂƂjȂuȂvƏo͂
*/
void main(void)
{
char str[100] = "KaGaya JOhN koBa DenSha ";
char str2[] = "a";
int count = 0;
printf("%s \n",str);
for ( int i=0; str[i]!= '\0'; i++)
{
if(str[i... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.