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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6a744d7372979166b12c5feca90e751c3af3d49f | C | SaraitHernandez/Proyecto_SO | /client.c | UTF-8 | 1,583 | 3.21875 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<arpa/inet.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<netdb.h>
int main(int argc, char **argv)
{
if(argc<2)
{
printf("[host] [puerto]\n");
return 1;
}
int puerto, conexion;
char buffer[200];
/* ... | true |
868d2c3c7187dda5b7cfa9c109f3171298e21667 | C | ojhaChandu/Practice-Codes | /TalentSprint/datastructure/stack_t.c | UTF-8 | 880 | 4.125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
typedef
struct{
int top;
int size;
int a[1000];
}stack_t;
int isFull(stack_t *s){
if(s->size == s->top)
return 1;
else
return 0;
}
int isEmpty(stack_t *s){
if(s->top == 0)
return 1;
else
return 0;
}
void push(stack_t *s, int ele){
if(isFull(s)){
printf("sta... | true |
decbdeddbf138ea2ac2b7d3102048680a54f4de6 | C | FabioWanDall/GeniusPIC | /SOFTWARE/projeto_genius.X/leds.h | ISO-8859-1 | 2,586 | 2.90625 | 3 | [] | no_license | //#include <stdlib.h>
/*
* File: leds.h
* Author: Fabio WD/Felipe Cabral
*
* Created on 12 de Junho de 2017, 08:48
*/
//
#define LED_ONOFF PIN_D0
#define LED_W_P2 PIN_D1
#define LED_W_P1 PIN_D2
#define LED_YELLOW PIN_D3
#define LED_RED PIN_D4
#define LED_GREEN PIN_D5
#define LED_BLUE PIN_D6
... | true |
16e74a38bdf82531f73f028cc93b280868fba5c6 | C | sampurdue/Debugging_workshop_spring_2015 | /seg_flt_examples/binary_tree.c | UTF-8 | 738 | 3.6875 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
struct tree{
int data;
struct tree *left;
struct tree *right;
};
struct tree* insert(struct tree* node, int data)
{
if(!node){
node=malloc(sizeof(struct tree));
node->data=data;
node->left=node->right=NULL;
return node;
}
else {
if(data>node->data){
... | true |
58c370b6491a9f77ae00d9c0d5b5819b25e024d5 | C | LilyMakhnov/Piscine42_mars2021 | /C04_bkup/ex05/ft_atoi_base.c | UTF-8 | 2,466 | 3.328125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi_base.c :+: :+: :+: ... | true |
29eb7f770f13558814c27704c58dadf2675a974e | C | famorted/cs362f15 | /projects/kuos/dominion/cardtest4.c | UTF-8 | 3,911 | 3.25 | 3 | [] | no_license | /******************************************************************************
cardtest4.c
Sharon Kuo (kuos@oregonstate.edu)
CS362-400: Assignment 3
Description: Unit testing for the council room card, as implemented in
councilRoomCard(). Draws 4 cards to the player's hand, adds 1 buy, and each
other player draws ... | true |
d10d23591ebd197d0a7f61697645564295c242cb | C | Xequals0/Everything-Else | /Architecture/pa2/calc.h | UTF-8 | 1,052 | 2.515625 | 3 | [] | no_license | /*
* calc.h
* Anirudh Tunoori netid: at813
*/
#ifndef calc_h_included
#define calc_h_included
typedef enum id { binary, hexadecimal, octal, decimal,undefined } identity; //enum identity
struct number_ { //number struct
char* numStr;
int sign;
int value;
char initialForm;
enum id identity;
};
ty... | true |
ad2adc2b4f644d93dbee75f4b9b32a6476a0b788 | C | XiyouLinuxGroup-2019-Summer/TeamC | /Code/wuxinyue/进程.c | UTF-8 | 853 | 3.265625 | 3 | [
"MIT"
] | permissive | /*#include <stdio.h>
#include<sys/types.h>
#include<unistd.h>
#include<stdlib.h>
int main()
{
pid_t pid;
pid = fork();
switch(pid){
case 0:
while(1) {
printf ("a background process,childpid:%d,parentpid:%d\n",getpid(),getppid());
sleep(3);
}
case -1:
... | true |
734d910ee00deadee590ed10d43ef6817ef0d264 | C | jinwulee/coby2 | /0716/chario.c | UTF-8 | 469 | 3.484375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
void main()
{
int c, number=0;
char op;
FILE *fp;
if((fp=fopen("test.txt","r"))==NULL)
{
perror("FILE open error");
exit(-1);
}
while(!feof(fp))
{
while((c=fgetc(fp))!=EOF && isdigit(c))
number=10*number+c-'0';
if(c=='\n')
continue;
fprintf(stdout,"ope... | true |
b669b418ac17131dbc0178fe6dcdeb54a679b634 | C | houwentaoff/esd_learn | /driver/semaphore.c | UTF-8 | 2,129 | 2.703125 | 3 | [] | no_license | #include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/fs.h>
struct class *hello_class;
struct semaphore sem_open;
struct semaphore sem_read;
struct semaphore sem_write;
int hello_open(struct inode *inode, struct file *filp){
//try to get semaphore sem_open
if(down_trylock(&sem_... | true |
51d6c7469f8c226634d12f3f79cbc4abbda60793 | C | ilpam/mini_os_dev | /chapter8/kernel/memory.c | UTF-8 | 6,234 | 2.515625 | 3 | [] | no_license | #include "memory.h"
#include "stdint.h"
#include "print.h"
#include "global.h"
#include "debug.h"
#include "string.h"
#define PG_SIZE 4096
#define K_HEAP_START 0xc0100000
#define MEM_BITMAP_BASE 0xc009a000
#define PDE_IDX(addr) ((addr & 0xffc00000) >> 22)
#define PTE_IDX(addr) ((addr & 0x003ff000) >> 12)
struct pool... | true |
237ec326293f9dcc8d908002d68fea66bf339604 | C | ABHISHEKKMRPATHAK/YashvantKanetkar | /2.cInstructions/d.c | UTF-8 | 465 | 3.5 | 4 | [] | no_license | /*conversion of Cartesian coordinates to Polar Coordinates */
#include<stdio.h>
#include<math.h>
int main(){
double x_abscissa , y_ordinates;
double r,$;
printf("Enter the X (ABSCISSA) : ");
scanf("%lf",&x_abscissa);
printf("Enter the Y (ORDINATES) : ");
scanf("%lf",&y_ordinates);
r=sqrt(x_ab... | true |
0c6e73f0cd99d2d52d3b61f46fb7a76decf80d06 | C | akbarmadaminov/Operating-Systems | /week6/ex1.c | UTF-8 | 1,395 | 3.75 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/types.h>
typedef struct process {
int at, bt, tat, ct, wt;
} process;
int n; /// number of processes
void FCFS(process p[]) {
int cur = 0; /// Current time
/// We execute in the given order
... | true |
417cf1d01e844a35e084622aea1b73d12e7e8211 | C | SatishNayak18/Satish_Nayak | /FastTrack-Programming/excerises/Excercise-2/5.c | UTF-8 | 685 | 3.671875 | 4 | [] | no_license | /*Car is traveling at a speed of 80 km/hr and a truck is stationed at a distance of 30 mts.
Truck will start moving exactly after 3 second.
If the car driver applies brake now find out whether car will hit the truck or not.
(distance = ((initial velocity + final velocity )/2 ) * time ).*/
#include<stdio.h>
#d... | true |
27b114cd4e731cddfa8fb0637246fc6565a05256 | C | StefanNa/31388-Advanced-2021 | /smr/files/sim388_project/maketrack.c | UTF-8 | 3,163 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
char *lines[]={ "3.25 -0.1 3.55 -0.1 0 start",
"3.4 -0.1 3.4 0.5 0 l01",
"3.4 0.5 3.7 0.8",
"3.5 0.6 5.4 0.6 0 l03",
"3.7 0.8 4.1 1.2",
"4.0 1.1 5.6 1.1 0 l04",
"5.6 0.80 5.6 2.2 0 l09",
"4.1 1.2 4.1 1.6 0 l05" ,
"4.1 1.6 4.... | true |
e2feecf36d96148add151bc66577ceb6bbd0ce6e | C | CyborgVova/Project21 | /GUS_12_I_AM_RETARDED_EDITION/CPC12/ex10.c | UTF-8 | 1,324 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "ft_list.h"
void ft_list_foreach_if(t_list *begin_list, void (*f)(void *),
void *data_ref, int (*cmp)());
void my_f(void *data)
{
printf("%s\n", (char*)data);
}
int ft_strcmp(char *s1, char *s2)
{
int c;
c = 0;
while ((*(s1... | true |
c607659a5c60de806316efa20f05f9cb90c6fe3d | C | ccarral/c-sudoku | /src/types.c | UTF-8 | 2,914 | 3.359375 | 3 | [] | no_license | #include "types.h"
#include <stdio.h>
#include <stdlib.h>
s_int pop(stack *S);
void push(stack *S, s_int value);
node_t *new_node(s_int val);
void debug_node(node_t *node);
void debug_msg(const char* msg);
int stack_empty(stack *S);
void append(list *L,s_int value);
int remove_val(list *L,s_int value);
s_int p... | true |
eaaf4d8c5fd0a0ea101efa5e4df1f0d08d876050 | C | pg42819/kmeans_mpi | /src/kmeans_config.c | UTF-8 | 9,097 | 2.75 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <getopt.h>
#include <unistd.h>
#include <string.h>
#include "kmeans.h"
#include "log.h"
extern struct kmeans_config *kmeans_config;
/**
* Initialize a new config to hold the run configuration set from the command line
*/
struct kmeans_config *new... | true |
4a018f95f9765de2f1d7dfdfe4ec11f68d9120fd | C | Amaury137/StructuredProgramming2A | /unit2/Project unit 2/Conditionals.c | UTF-8 | 434 | 3.515625 | 4 | [] | no_license | #include <stdio.h>
int main(){
//char* name
char name[255];
int age;
printf("Hello there, what's your name?:\n");
scanf( "%s" , name);
printf("How old are you %s?\n", name);
scanf("%d", &age);
if (age<18){
printf("I'm sorry %s, you need to be 18+ to enter this website\n", na... | true |
42a9f94844f555a97ac0590cf4bfafe4bd6036af | C | Barleth/aion | /src/aion.c | UTF-8 | 10,016 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <ifaddrs.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#define AC ... | true |
3f4860a0cf8ef43be61a83a1624cfee9bf195abe | C | EvOr/systemesrepartis | /examples/genere_UDP.c | ISO-8859-1 | 1,376 | 3.25 | 3 | [] | no_license | /*
Ce programme produit une PDU-UDP destination du processus
li au port UDP 6545
intervalle de temps calcul alatoirement
*/
#include <netinet/in.h>
#include <netdb.h>
#include <sys/socket.h>
#define PORT 6545
int main( int argc, char **argv)
{
int socketfd;
struct sockaddr_in SADDR;
struct hoste... | true |
daee0b1069c1062422b0233be4a60c8efe6bc776 | C | iliasafrass/ASE_M1INFO | /TP_ASE_LILLE1/TP_ASE_FINAL/TP1/try.c | UTF-8 | 564 | 2.953125 | 3 | [] | no_license | #include "try.h"
static int val;
/*
* Fonction try qui permet de simuler un setjump
*/
int try(struct ctx_s *p_ctx, func_t *f, int arg)
{
p_ctx->ctx_magic_number = MAGIC_NUMBER;
asm("movl %%esp, %0\n\t" "movl %%ebp, %1"
:"=r"(p_ctx->ctx_esp), "=r"(p_ctx->ctx_ebp));
return f(arg);
}
/*
* Fonction throw qui... | true |
e21e62cf996a3342205c3d0aca3f3a82948d01fd | C | cebrf/students | /console/unicode.c | UTF-8 | 976 | 2.90625 | 3 | [] | no_license | #include <stdint.h>
typedef union unichr
{
uint8_t c[2];
uint16_t u;
struct
{
uint16_t uni_l : 5;
uint16_t multibyte_mark : 3;
uint16_t uni_r : 6;
uint16_t multibyte_continue : 2;
};
} unichr;
void utf8_to_cp1251(char *str)
{
for (char *ptr = str;... | true |
41a52952a71f87e029de06101d8a82f60f9f27f2 | C | monopatis/CEID | /4nd Semester/Data Structures/partD.c | UTF-8 | 15,829 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define RESET "\033[0m"
#define RED "\033[31m" /* Red */
typedef struct {
int *array;
size_t used;
size_t size;
} Array;
typedef struct redblack redblack_t;
typedef struct tree_node {
int key; /* κλειδί αναζήτησης */
struct tree_node *l;... | true |
bfdbe0cc93aac8719555b04f7a2932ba5eb6181f | C | oscarmrt/holbertonschool-low_level_programming | /0x02-functions_nested_loops/11-print_to_98.c | UTF-8 | 510 | 4 | 4 | [] | no_license | #include <stdio.h>
#include "holberton.h"
/**
* print_to_98 - prints all natural numbers from n to 98
* @n: Integer
* Description: prints all natural numbers from n to 98
*
* Return: 0
*/
void print_to_98(int n)
{
int g = n;
if (n > 98)
{
for ( ; g >= 98; g--)
{
printf("%d", g);
if (g != 98)
... | true |
0b5e36b9bc50c0d110aca1c4313a5b996a48ae3b | C | NamSangKyu/2104C | /0415/operator_1.c | UHC | 727 | 4.15625 | 4 | [] | no_license | #include <stdio.h>
/*
Ģ : + - * / %
*/
int main(){
// 2 Է
int n1, n2;
int result = 0;
printf(" ΰ Է : ");
scanf_s("%d %d",&n1,&n2);
result = n1 + n2;// result
printf(" : %d\n",result);
//
result = n1 - n2;
printf(" : %d\n",result);
//
result = ... | true |
6e6c57e70ca03d8911915e54c78a42e4095e5cb1 | C | LucaDiba/polito-computer-engineering | /Algorithms and Programming/LAB/L04/E01/main.c | UTF-8 | 488 | 2.5625 | 3 | [] | no_license | #include <stdio.h>
#include "header.h"
int main(){
int nr=-1, nc, i,j,n=1,tmp_b,tmp_h,tmp_area, A[MAX_R][MAX_C];
leggiMatrice(A,MAX_R,&nr,&nc);
if(nr==-1)return -1;
for(i=0;i<nr;i++)
for(j=0;j<nc;j++)
if (riconosciRegione(A, nr, nc, i, j, &tmp_b, &tmp_h)){
tmp_area... | true |
612142a35dff2d2619f242cf3197daf25f1cca71 | C | weizhou-geek/vmaf | /libvmaf/src/third_party/ptools/opencontainers_1_8_4/include/ocnumpytools.h | UTF-8 | 2,986 | 2.890625 | 3 | [
"BSD-3-Clause",
"Apache-2.0",
"LGPL-3.0-or-later"
] | permissive | #ifndef OCNUMPYTOOLS_H_
// A few helper functions/defines for help for dealing with Numeric
// (Python Numeric)
#include "ocport.h"
OC_BEGIN_NAMESPACE
// Convert from a Val tag to a Python Numeric Tab
inline const char* OCTagToNumPy (char tag, bool supports_cx_int=false)
{
switch (tag) {
case 's': return "int8"... | true |
89f99721faa513bec5a559caf282d8f4c959ade9 | C | f6m/RnK-Libro | /C3/p3-6.c | UTF-8 | 954 | 3.875 | 4 | [] | no_license | /* El lenguaje de programacion C, R&K, (Prentice Hall, 2da. edicion, 1991) */
/* # 3.6 */
/* El siguiente programa muestra el ejemplo de la funcion itoa la cual comvierte un numero entero a una cadena de caracteres */
/* Esta funcion usa tres argumentos: el entero, la cadena para almacenar la conversion, y un ancho mi... | true |
ab28b572c1f66b87c20120aa4962c170029e73b5 | C | Kartikvk1996/c-php-intercommunication | /c-php.c | UTF-8 | 2,252 | 3.3125 | 3 | [
"Apache-2.0"
] | permissive | // C program to connect to the socket opened by php module
// written by -- kartik
#include<stdio.h>
#include<sys/socket.h>
#include<arpa/inet.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
#include<sys/types.h>
#include<malloc.h>
#include"myfunc.h"
//#include<conio.h>
//max buffer size
#define buffer_s... | true |
16330361703dce9c8a05dbbf24c3e1e29a6d18d3 | C | haxworx/libsea | /tests/strings.c | UTF-8 | 696 | 3.640625 | 4 | [
"MIT"
] | permissive | #include "strings.h"
#include <stdio.h>
int main(void)
{
char string[] = {'h', 'e', 'l', 'l', 'o', 0x00};
int number = 0xf00d;
printf("%d as string is %s\n", number, int_to_ascii(10, number));
printf("%d as string is %s\n", -number, int_to_ascii(10, -number));
printf("%d as string is %s\n", number, int... | true |
caa61f6dc3f63e4833ce83540274ab3018f59a04 | C | cxmmeg/flir | /SYSTEM/usart/usart.c | GB18030 | 3,699 | 2.515625 | 3 | [] | no_license | #include "usart.h"
u8 USART_RX_BUF=0;
u16 USART_RX_STA=0;
void uart_init(u32 bound){
//GPIO˿
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE); //ʹUSART1GPIOAʱ
... | true |
705b4abad11f0c0550d0fbb3e0babe3c8e757681 | C | Shanmukh101/Sorting | /merge.c | UTF-8 | 661 | 3.375 | 3 | [] | no_license | void merge(int arr[], int beg, int mid, int end)
{
int i=beg, j=mid+1, k=beg, temp[end+1],l;
while((i<=mid) && (j<=end))
{
if(arr[i] <= arr[j])
{
temp[k] = arr[i];
i++;
}
else
{
temp[k] = arr[j];
j++;
}
k++;
}
while(j<=end)
{
temp[k] = arr[j];
j++;
... | true |
1569441457b3cc88b8f48ac34d6ed825bb66083d | C | rhaamo/perl2 | /array.c | UTF-8 | 4,004 | 2.734375 | 3 | [] | no_license | /* $Header: array.c,v 2.0 88/06/05 00:08:17 root Exp $
*
* $Log: array.c,v $
* Revision 2.0 88/06/05 00:08:17 root
* Baseline version 2.0.
*
*/
#include "EXTERN.h"
#include "perl.h"
STR *
afetch(ar,key)
register ARRAY *ar;
int key;
{
if (key < 0 || key > ar->ary_fill)
return Nullstr;
return ar->ary... | true |
687513e95c233ad0b83901f95f75dc4b4d375ff0 | C | TJRobson/c-programming-a-modern-approach | /chapter12/exercises/chap12ex9.c | UTF-8 | 788 | 4.1875 | 4 | [] | no_license | /* Chapter 12 Exercise 9 */
#include <stdio.h>
#define NUM 5
double inner_product(const double *a, const double *b, int n);
int main(void)
{
double *a, *b, arr_a[NUM], arr_b[NUM];
printf("\nEnter %d numbers: ", NUM);
for (a = arr_a; a < arr_a + NUM; a++) {
scanf(" %lf", a);
}
printf("\nEnter %d number... | true |
852315c7a98af6268340d977d591846b2c44f017 | C | ruchir001/Operating-Systems | /XV6 IPC implementations/sharedmem1.c | UTF-8 | 1,327 | 2.875 | 3 | [
"MIT"
] | permissive | #include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<sys/shm.h>
#define TEXT_SZ 2048
struct shared_use_st
{
int written_by_you;
char some_text[TEXT_SZ];
};
int main()
{
int running = 1;
void *shared_memory = (void *)0;
struct shared_use_st *shared_stuff;
in... | true |
c2e6bef352148306f986c2dd5ac8df0c00a14d46 | C | sahanal-2603/Hacktoberfest-2021 | /C/hacktoberfest.c | UTF-8 | 585 | 3.265625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
void main () {
char name[100], link[100];
printf("Welcome to hacktoberfest 2021!\n");
printf("Visit this link for join: https://hacktoberfest.digitalocean.com\n");
// Input your name
printf("\nEnter your name: ");
scanf(" %s", &name);
// Input your g... | true |
2345815d1a3f9695023ae7e229d67c40ca7a8f88 | C | xianacarrera/Programacion_II | /Práctica 0/P0_E6/imprimirMatriz.c | UTF-8 | 421 | 2.953125 | 3 | [] | no_license | #include "matriz.h"
void imprimirMatriz(matriz *M) {
int i, k;
if (M != 0) {
for (i = 0; i < M->filas; i++) {
for (k = 0; k < M->columnas; k++)
printf("%f ", *((M->datos) + i * M->columnas + k));
//printf("%f ", *((M->datos) + i * M->filas + k));
... | true |
9aecf2a67c6a5905b000743cf49c6ee7f8fc7267 | C | mcritchlow/farbfeld | /ff2ppm.c | UTF-8 | 1,526 | 2.859375 | 3 | [
"ISC"
] | permissive | /* See LICENSE file for copyright and license details. */
#include <arpa/inet.h>
#include <errno.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "arg.h"
#include "util.h"
static void
usage(void)
{
die("usage: %s [-b colour]", argv0);
}
int
main(int a... | true |
d1cf90a3e15c48272a965d20d4af540409dfa840 | C | dils12001/C_Practice | /C/backspaceCompare.c | BIG5 | 807 | 3.921875 | 4 | [] | no_license | #include<stdio.h>
#include<string.h>
//#include<stdbool.h>
_Bool backspaceCompare(char* s,char* t);
void processStr(char* str);
int main()
{
char s[10];
char t[10];
printf("Enter string S:");
scanf("%s",s);
printf("Enter string T:");
scanf("%s",t);
if(backspaceCompare(s,t))
printf("S and T are equal.");
}... | true |
472f7c147a45d779830ad437bc376f26a500fca0 | C | pj1031999/sshell | /command.c | UTF-8 | 2,531 | 2.875 | 3 | [] | no_license | #include "shell.h"
typedef int (*func_t)(char **argv);
typedef struct {
const char *name;
func_t func;
} command_t;
static int do_quit(__unused char **argv) {
shutdownjobs();
exit(EXIT_SUCCESS);
}
static char pathbuf[4096];
static int do_chdir(char **argv) {
char *path = argv[0];
if (path == NULL)
p... | true |
aad31167be5fb9ecb10d83f7f8ec0c5e26da47ea | C | thx1766/thx1766.github.io | /cs/2015/pa5threads/bookorder.c | UTF-8 | 1,756 | 3.0625 | 3 | [] | no_license | #include "bookorder.h"
void
bookorder(char * clientdbfilename, char * orderinputfilename, char * categoriesfilename)
{
FILE * clients = NULL;
FILE * orders = NULL;
FILE * categories = NULL;
//calculate lengths of files for buffers
int client_bufferlen = filelengthwrapper(clientdbfilename);
int order_bufferlen =... | true |
436fd4cc29f448fbcd56854e66d9862a85ddc2f3 | C | minheenista/FundamentosDeProgramacion | /If 4 Numeros.c | UTF-8 | 681 | 3.3125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
// definicion y prototipos funciones
//variables y constantes
// implementacion de funciones
int main(int argc, char** argv) {
float a, b, c, d;
scanf("%f",&a);
scanf("%f",&b);
scanf("%f",&c);
scanf("%f",&d);
if(a>b && a>c... | true |
3f38f97e9d4c4163fba19b845af4241f44aac4cd | C | connor4312/csc209 | /lab9/time_reads.c | UTF-8 | 744 | 2.875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
int reads = 0;
void close_signal_handler(int sig)
{
printf("Completed %d reads in 5 seconds\n", reads);
exit(0);
}
int main(int argc, char const *argv[])
{
FILE *fp = fopen(argv[1], "rb");
int last_int = sizeof(int) * (1... | true |
5495b7852105589f7cebae51664451255dec3b41 | C | Tudi/TempStorage | /FileServerShardable/daos/daos.c | UTF-8 | 17,896 | 2.5625 | 3 | [] | no_license | #include <daos.h>
#include <file_table.h>
#include <files.h>
#include <logger.h>
#include <definitions.h>
#include <macro_utils.h>
#include <app_errors.h>
#include <request_response_definitions.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#inc... | true |
f295e634d5e5694d33516a44fb258e264576fe26 | C | salehe-e/Simple-Image-Processing-Toolbox | /roi.h | UTF-8 | 5,377 | 2.515625 | 3 | [] | no_license | //ROI Image Convolution by 3x3 Mask ---> To be modified!
void MyFrame::OnROIConvolve3x3Image(wxCommandEvent & event){
printf("ROI Convolving3x3...");
free(loadedImage);
loadedImage = new wxImage(bitmap.ConvertToImage());
loadedImage2 = new wxImage(bitmap.ConvertToImage());
//mask3 matrix forma... | true |
b614176b38760a9c255a20d246e91046ce9c4df0 | C | arifBurakDemiray/operating-systems | /synchronization/product.h | UTF-8 | 1,162 | 3.484375 | 3 | [
"MIT"
] | permissive | //Arif Burak Demiray
//This code is compiled with C99
#ifndef PRODUCT_H //include guard
#define PRODUCT_H
typedef struct product
{
char product_name[30]; // (phone, tshirt, coke etc.)
char product_type[30]; //(electronicDevice, clothing, market etc.)
int price; // (can be integer between 1-100... | true |
53ef82ba6dbff363f608a689b7f5aaef79456762 | C | gardncl/projecteuler | /euler002.c | UTF-8 | 902 | 3.71875 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
/*
Project Euler: Problem 2
December 19th, 2015
Clay Gardner
https://projecteuler.net/problem=2
Solved the above problem.
Input: 1 4000000
Output: 4613732
Time: sys 0m0.003s
https://www.hackerrank.com/contests/projecteuler/challenges/eule... | true |
7c5a46b6a2e0eb030b99b71922714ff7417e6245 | C | schkillten/summerC | /kyle/main.c | UTF-8 | 710 | 3.40625 | 3 | [] | no_license | #include "oo_stack.h"
#include "stdio.h"
#include <sys/time.h>
int main()
{
/*
int i;
Stack* stack = stack_new();
for (i = 0; i < 100000; i++)
{
struct Point p = {i, i+1};
stack->push(stack, i);
}
while (!stack->empty(stack))
{
struct Point p = stack->top(stack);
printf("%i %i\n", p.... | true |
c6824b512a3c751b164b0968cfd6cc657a92b4d2 | C | Rod99/Practica_cola | /main.c | UTF-8 | 1,234 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "gotoxy.h"
#include "colores.h"
#include <conio.h>
void menu();
void dibujar_marco();
int main(int argc, char *argv[]) {
system("portada.exe");
system("cls");
system("color 7");
color(1,7);
dibujar_marco();
color(0,15);
menu();
getch()... | true |
d1386e5b9a82468e239f9b2dd740342ce4de6108 | C | cbdevnet/kbserver | /kbactiond/argparse.c | UTF-8 | 527 | 2.609375 | 3 | [
"WTFPL"
] | permissive | bool args_parse(ARGUMENTS* args, int argc, char** argv){
int i,c;
for(i=0;i<argc;i++){
if(argv[i][0]=='-'){
switch(argv[i][1]){
case 'v':
for(c=1;argv[i][c]=='v';c++){
args->verbosity=c;
}
break;
case 'f':
if(i>=argc-1){
fprintf(stderr, "Missing config file name\n");
... | true |
6bd2f8ff2e32b79976b689e761bf59ac5d36f5cc | C | LeoFC97/ProgramacaoParalela | /trabalho2.c | UTF-8 | 2,401 | 3.59375 | 4 | [
"MIT"
] | permissive | // Leonardo Costa
// Vilmar Rangel
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <time.h>
void* ThreadSoma(int* args) {
int soma = args[0] + args[1];
int tempoSleep = args[2];
printf("Eu sou a thread SOMA (%d) e irei dormir por %d segundos\n", soma, tempoSleep);
... | true |
1aae9366e48e1e09e9bab84f350625bd855928ed | C | krocki/another | /vm.c | UTF-8 | 13,774 | 2.515625 | 3 | [] | no_license | #include "defs.h"
#include "bitmaps.h"
#include "polygon.h"
#include "strings.h"
#define VAR_SCROLL_Y 0xf9
u8 buffer8[4*320*200];
u32 pal32[16];
int done=0;
extern float palette_rgb[48];
void set_palette(u8 *p, u8 v) {
printf("set palette %d", v);
int offset = 32 * v;
for (int i=0; i<16; i++) {
int color =... | true |
db537c103b76d25f37e44da7ea71856edc57897f | C | xianyuchao/linuxC | /sock/listen/server.c | UTF-8 | 1,752 | 2.953125 | 3 | [] | no_license | /* server.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define MAXLINE 80
#define SERV_PORT 8100
int main(void)
{
struct sockaddr_in servaddr, cliaddr;
socklen_t cliaddr_len;
int listenfd,... | true |
3bddafbd9c91f6c1a89792cd98b56d40e85e196c | C | choubari/Coding-Questions | /HackerRank Problems/Array Reversal/solution.c | UTF-8 | 461 | 3.578125 | 4 | [
"MIT"
] | permissive | #include<stdio.h> // header file
main(){
int n,arr[1000],i,temp; //datatypes assigned
scanf("%d",&n); //reading value
for(i=0;i<n;i++){
scanf("%d ",&arr[i]); // reading values and sorring in the array "arr[]"
}
for(i=0;i<n/2;i++){
temp=arr[i]; //swaping array elements
ar... | true |
229c507d2ac5398a4d0862b3f6a6e5c7e4c35c2f | C | mattrw89/dspsys_lib_txrxspi | /APICommand.c | UTF-8 | 10,625 | 2.53125 | 3 | [] | no_license | /*
* APICommand.c
*
* Created on: Dec 19, 2011
* Author: ParallelsWin7
*/
#include <stdio.h> //not needed in CCS
#include "APICommand.h"
//////////////////////////////////////////////////////////////////////////
//////////// API CONSTRUCTORS //////////////
////... | true |
b2853ec87b1a4c803bcc9fbf72c19579ade8dbf8 | C | CobraCyborg/Deitel-C-6e | /fig0717.c | UTF-8 | 1,011 | 3.859375 | 4 | [] | no_license | // Using operator sizeof to determine standard data type size
#include <stdio.h>
int main(int argc, char const *argv[])
{
char c;
short s;
int i;
long l;
long long ll;
float f;
double d;
long double ld;
int array[20];
int *ptr = array;
printf(" sizeof c = %u\tsizeof(char) = %u\n", sizeof... | true |
71270f0a1a44f2ef3ccba8b6003caec6883a4924 | C | caiohmat/42-Basecamp | /C04/ex02/ft_putnbr.c | UTF-8 | 413 | 3.4375 | 3 | [] | no_license | #include<unistd.h>
void ft_print(char printnumbr)
{
write(1, &printnumbr, 1);
}
void ft_putnbr(int nb)
{
int number;
if (nb == -2147483648)
{
ft_print('-');
ft_print('2');
ft_putnbr(147483648);
return ;
}
if (nb >= 0)
number = nb;
else
{
ft_print('-');
number = nb * -1;
}
if (number >= 10)
{... | true |
48db0b08a11ddf4bd1fe011fe9161844a8512789 | C | AKdeBerg/Basic-Console-App | /C Programming A Modern Approach Exercises/CH-07 PROG PROJ/c7p10.c | UTF-8 | 332 | 3.84375 | 4 | [] | no_license | #include<stdio.h>
#include<ctype.h>
int main() {
int count = 0;
char ch;
printf("Enter a sentence: ");
while( (ch = getchar()) != '\n')
{
ch = toupper(ch);
if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
{
/* code */
count += 1;
}
}
printf("Your sentence contains %d vowels\n... | true |
8bc9dacf5450cca511add512c190759e15550d8b | C | jbulow/tort | /ext/t/fiber_core_test.c | UTF-8 | 1,760 | 2.984375 | 3 | [] | no_license | #include "tort/fiber.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
static tort_fiber_t *fiber_a, *fiber_b;
static tort_fiber_func_DECL(a);
static tort_fiber_func_DECL(b);
static
tort_fiber_func_DECL(a)
{
static int n = 10;
assert(_tort_fiber_ptr->status == RUNNING);
fiber_a = _tort_fiber_ptr;
... | true |
71d39ffa7e29e3fb06798441290822efb1a0d32f | C | aman-ku/Cryptography-Algorithms | /Affine.c | UTF-8 | 1,422 | 3.625 | 4 | [] | no_license | // Name-Aman Kumar Kanojia
// Roll no.-201851014
#include <stdio.h>
#include <stdlib.h>
int inverse(int a)
{
for(int i = 1; i < 27; ++i)
{
if((a*i)%26 == 1)
return i;
}
return 0;
}
void Encryption(char arr[], int n, int a, int b)
{
printf("The cipher text is- ");
for(int i = 0; i < n; ++i)
{
if(islowe... | true |
e3b0b51b704cdf838c1e48db3ac6e5d6c71741c1 | C | DevashishPrasad/BE-IT-assignments | /TE/Sem 1/SL-2/assignment 8/consumer.c | UTF-8 | 1,923 | 3.25 | 3 | [] | no_license | // gcc consumer.c -o con.out
// Include header files
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "shm_com.h" // header file containing the structure of shared memory
// Main function
int main()
{
// User de... | true |
1f6c4fe3cb7faa026891a9a7a5f75c5d80e91e9f | C | Aaron-labo/STM32CubeF407 | /00.Sensor Library/ULN2003/APP/Drivers/KEY/key.c | UTF-8 | 848 | 2.875 | 3 | [] | no_license | /*
* key.c
*
* Created on: Apr 3, 2021
* Author: Francis
*/
#include "key.h"
//按键扫描函数
//mode==1时,按键按下亮,松开灭
//mode==0时,按键按下亮,再次按下灭
uint8_t KeyScan(uint8_t mode)
{
static uint8_t key_up = 1;
if(mode == 1){
key_up = 1;
}
if(key_up && (KEY0 == GPIO_PIN_RESET || KEY1 == GPIO_PIN_RESET || KEY2 == GPIO_PIN... | true |
4879a08060a7f0870d991165c688866fbc8e5ee5 | C | gabriel-freitas-Souza/_Faculdade | /exercio_00.c | UTF-8 | 5,888 | 4 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int positivoNegativo();
int maiorNumero();
int calculadora();
int ordemCrescente();
int main() {
int opcao = 1;
while(opcao>0){
printf("\t\t=========== MENU ===========\n");
printf("\t\t1 - Numero Positivo/Negativo\n");
printf("\t\t2 - Maior de 3 nu... | true |
385243de8555d58323ca7e8b997f45b93e594630 | C | srivalli-project/BI_Team_Status | /Santhoshi/InterviewQs/union_size.c | UTF-8 | 728 | 3.25 | 3 | [] | no_license | /******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
***********************************************... | true |
ae510a7976dc4e9209d75210d6520010cfc8c3d6 | C | MartinKaburu/simple-algorithms | /ones_complement.c | UTF-8 | 591 | 3.65625 | 4 | [] | no_license | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
void encrypt(char* input, char* output);
int main(int argc, char* argv[]){
if(argc != 3){
printf("USAGE: complement [input file] [output file]\n");
return 1;
}
encrypt(argv[1], argv[2]);
return 0;
}
void encrypt(char* input, char* output)... | true |
da454f025644b0017ab00d227850b2c91168de2b | C | josephding23/Codes | /《常用算法和程序设计案例》/第三章 递推/3.5.1 杨辉三角(变量迭代).c | GB18030 | 676 | 3.4375 | 3 | [] | no_license | /* עʵǶʽչʽϵn+1еn+1ֱC(n,0),C(n,1),C(n,2)....C(n,n)
ִϹʽ
C(n,0)=1
C(n,k)=(n-k+1)/k*c(n,k-1)*/
#include<stdio.h>
void main()
{
int m,n,cnm,k;
printf("The number of lines:");scanf("%d",&n);
for(k=1;k<=40;k++) printf(" ");
printf("%6d\n",1); //һ
for(m=1;m<=n-1;m++)
... | true |
2c849f593cabf0703cc986671c0427854e0099a5 | C | agrealish/CS362-004-F2017 | /projects/grealisa/saldanajDominion/saldanaj_tests/cardtest1.c | UTF-8 | 3,019 | 3.234375 | 3 | [] | no_license | /*
Student: Joaquin Saldana
Assignment 3
Testing the adventure card
function code:
int adventurerCard(struct gameState *state)
{
int drawntreasure = 0;
int currentPlayer = whoseTurn(state);
int cardDrawn;
int temphand[MAX_HAND];
int z = 0;
while(drawntreasure<2)
{
if (state->deckCount[curr... | true |
fcb19661554d7d272634c086b6fe6c4560c2319b | C | JarLob/gbhv | /gbhv/util.c | UTF-8 | 2,471 | 3.109375 | 3 | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
#include "util.h"
#include <stdarg.h>
/**
* Check if a bit is set in the bit field.
*/
BOOL HvUtilBitIsSet(SIZE_T BitField, SIZE_T BitPosition)
{
return (BitField >> BitPosition) & 1UL;
}
/**
* Set a bit in a bit field.
*/
SIZE_T HvUtilBitSetBit(SIZE_T BitField, SIZE_T BitPosition)
{
return BitField | (1ULL <<... | true |
ac24ca82a400eedc33995b143e39859d6a0cdcea | C | YouHojoon/Socket-Programing | /Linux/select_srv.c | UTF-8 | 2,329 | 2.859375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<arpa/inet.h>
#include<sys/time.h>
#include<sys/select.h>
#include<sys/socket.h>
#include<string.h>
#include<unistd.h>
void ErrorHandling(char *message){
fputs(message,stderr);
fputs("\n",stderr);
exit(1);
}
int main(int argc, char* argv[]){
int srvSock, cln... | true |
abb166a1561d5bb0c381f9d25ff32f1747124d9d | C | nialin/PTA_MOOC | /7_8 树的遍历 (25).c | UTF-8 | 1,574 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define TREE_MAX_SIZE 30
struct node {
int data;
struct node *lchild, *rchild;
};
struct node *tree_creat(int *in, int *post, int len);
void tree_destroy(struct node **root);
void tree_level_walk(struct node *root);
struct node *tre... | true |
84a38055ca9d5c23ef2bca48e699b6480c41187e | C | yashjha123/CBMC-tests | /xor-array-index.c | UTF-8 | 573 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main(){
int arr[] = {1,2,3,4,5};
// int N = 0b11100;
int nonDets[5];
for (int i=0;i<5;i++){
nonDets[i] = nondet_int();
__CPROVER_assume(nonDets[i]>=0&&nonDets[i]<5);
}
// __CPROVER_assume(N>0);
int xorEd = 0;
for(int x=0;x<3;x++){
// printf("%d %d\n",(N&(1<... | true |
9a0caa24c2550215b60f70934240b486282567a5 | C | ebouther/21sh | /libft/ft_printf/padding_5.c | UTF-8 | 2,476 | 2.515625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* padding_5.c :+: :+: :+: ... | true |
3318a0e1874dc406db888f73b2ab91edbbedb8e6 | C | 4k1m0t0/beta | /main.c | UTF-8 | 7,499 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef enum{
OUT, EMPTY,
SECRET,CHARA,
ENEMY, WEAPON,
DEATHENEMY, GDEATHENEMY,
PRISON,EXIT,
GUNS
} squareKind;
typedef enum{
NOWEAPON, HAVEWEAPON,
GUN, FULL,
QUIT
} modeKind;
typedef struct{
int enemy[3][2];
... | true |
b4608c344b2627329251a457a502a5559ca16d80 | C | mykex/OSPCF-Source | /system/kernel/fs/read.c | UTF-8 | 672 | 3.015625 | 3 | [] | no_license | /* -- PCF Operating System --
* See [docs\COPYRIGHT.txt] for more info
*/
/** @file system\kernel\fs\read.c
@brief Virtual File System
*/
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <kernel\console.h>
int VfsRead(int fd, char *buffer, unsigned int len)
{
if(fd == STDIN_FD) {
un... | true |
6b637af8418ee08b964cd3a2be25d1b16200bf5a | C | akimikimikimikimikimikimika/LangComparison | /C/Files.c | UTF-8 | 3,187 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include "Header.h"
void Files() {
FILE *fh;
FILE *fh2;
printLn2(1,"これからファイル操作を試します",1);
// printf : <stdio.h>
printLn("> カレントディレクトリをホームに変更",1);
chdir(getenv("HOME"));
// chdir : <unistd.h>
// getenv : <stdlib.h>
// ファイル/フ... | true |
97d7f8f8b0b8d9b82f390a8448270658f3fec3db | C | rnhl/Semestre_1 | /Methodo/TP's/exos vus en cours-20181112/celsius_for.c | UTF-8 | 258 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
#define MIN 0
#define MAX 40
#define INTER 2
main()
{
int celsius;
printf("Celsius, Fahr\n");
for (celsius = MIN; celsius <= MAX; celsius = celsius + INTER)
printf("%5d %7.1f\n", celsius, ((9.0 * celsius) / 5.0 +32.0));
}
| true |
6ce2042439e9d272a8338d649ba9f471f2879810 | C | ldf92/robot | /libraries/compass_driver/compass_driver.h | UTF-8 | 793 | 2.5625 | 3 | [] | no_license | /**
Header for HMC5883L ditigal compass driver
Requirements:
1. the main file should include wire.h
Pin layout:
I2C:
ANL 4 -> SDL
ANL 5 -> SCL
*/
#ifndef compass_driver_h
#define compass_driver_h
#include "Arduino.h"
#include <wire.h>
//Define pins you're using for I2C communication
#defin... | true |
6d6aa249a47fb1275555a6425401d72c59f02a5d | C | GustavoSchwantz/trabalhos | /a02-GustavoSchwantz-master/teste.c | UTF-8 | 1,846 | 3.0625 | 3 | [] | no_license | #include "memvirt.h"
#include "simpletest.h"
#define WS(a, b, c) \
if (a){ \
isEqual(a->avg_ws, b, c); \
} \
else isNotNull(a, c);
#define PFRATE(a, b, c) \
if (a){ \
isNear(a->total_pf_rate, b, c); \
} \
else isNotNull(a, c);
void tzero1 ()
{
WHEN("eu tenho apenas um processo, 4 frames e um intervalo igual a 20"... | true |
8878c9fcac6cda4bc85d459e8c9b5cc4f3ecbc9a | C | arikhamdi/cs50_introduction | /week4/recover/recover.c | UTF-8 | 1,876 | 3.34375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
int CPT = 0;
bool FLAG = false;
int main(int argc, char *argv[])
{
// Open memory card (File *f = fopen(filename, "r");)
// Repeat until end of card:
// Read 512 bytes into a buffer (fread(data, size, number, inptr))
// If start of a new JPEG... | true |
b9b191813b49db96dcee1a5ca140dc28fd0f2ee8 | C | 1024Adam/Roman | /src/roman.c | UTF-8 | 357 | 3.125 | 3 | [] | no_license | /* roman.c */
/* Author: Adam Reid */
/* Number - Roman Numeral Converter */
/*
The program takes in a user entered number, and converts the number to roman numerals.
*NOTE: The program will not convert any decimals, and will convert words to ""
*/
#include "romanTools.h"
int main(int argc, char * argv[])
{
conve... | true |
746046b9f7580b9e50b78da613f31ec9b9219bf4 | C | suifengls/ee-pdgemm | /myheader/map.c | UTF-8 | 3,369 | 2.640625 | 3 | [] | no_license | #include "map.h"
#include <stdio.h>
#include <stdlib.h>
// in binding=rr mode
void mapping(int mycol, int type)
{
char H_Freq[7]={"2500000"};
// char M_Freq[7]={"1800000"};
char L_Freq[6]={"800000"};
FILE *fp;
char *DVFS=L_Freq;
if(type==1) DVFS=H_Freq;
else if(type==0) DVFS=L_Freq;
if(mycol==... | true |
0a36db62240760c2afd65e5a119c255bd6a65a5c | C | ayns01/c-practice | /Assignment3/main.c | UTF-8 | 441 | 3.671875 | 4 | [] | no_license | /**
* File : main.c
* Author : Ayana, Masa
* Date : Fri 8 Feb 2019
*/
#include <stdio.h>
int vc_find_next_prime(int n)
{
if (n < 2)
{
return 0;
}
for (int i = 2; i < n; i++)
{
if (n % i == 0)
{
return vc_find_next_prime(... | true |
8e4674918e9916a979fe5dec8117901fd26213eb | C | anton-petkov/Code-Academy | /C/20210217/20210217_15.c | UTF-8 | 1,454 | 4.0625 | 4 | [] | no_license | /*Напишете програма аналог на спортния тотализатор.
Използвайте функции.
Насоки:
1. Давате право на избор на играча да избере тотализатор, в който
ще си пробва късмета: (5 от 35), (6 от 42) или (6 от 49)
2. При всяко завъртане програмата изписва 1 произволно число,
което не е извадено до момента.
3. Програмата вади чис... | true |
673bae0a69b791f075c2361c6705e492a25a5ea4 | C | Israel314342177/CompiladoresProgramas | /Programa4/DATOS.h | UTF-8 | 1,506 | 3.09375 | 3 | [] | no_license | #ifndef DATOS_H
#define DATOS_H
typedef struct args ARG;
typedef struct type TYP;
typedef struct type_tab TYPTAB;
struct args{
int arg;
ARG *next;
};
typedef struct argum{
ARG *head;
ARG *tail;
int num; // numero de elementos en la lista
}ARGUMS;
typedef struct sym SYM;
... | true |
6449f8452c0682396cc72e42282a611c93cb5e50 | C | HyeonJ315/C-Data-Structures | /DataStructures/RedBlackTree/TD/TD_RedBlackTree.c | UTF-8 | 2,308 | 3.1875 | 3 | [] | no_license | #ifndef TD_REDBLACKTREE_C
#define TD_REDBLACKTREE_C
#include "../RedBlackTree.h"
#include "../../DynamicArray/DynamicArray.h"
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
char TD_RedBlackTreeComparator( RedBlackTreePayload leftNode, RedBlackTreePayload rightNode )
{
// Return anything but (true or 1)... | true |
ee5c7d135104596256fae5f563df2e765b607a02 | C | ProgrammazioneI-UniPG/esonero-programmazione-procedurale-2020-2021-CharminDoge | /csor.c | UTF-8 | 3,891 | 3.59375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
int getLine(char *inpt);
int printSpeciali(char *s, int len);
int xorFun(char *msg, char *key, char *xorred, int len);
int printHex(char *mssgio, int len);
int main(){
// messaggio da cifrare
char msg[128];
printf("Inserisci il messag... | true |
ef76e06fe15d395bfd903b33d5db740739bf6a08 | C | GustavoOM/SCC0502 | /Aula 01/caminho.c | UTF-8 | 1,553 | 3.421875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "ponto.h"
#include "caminho.h"
struct caminho_{
ponto_ST *pontos;
float distanciaCaminho;
float distanciaPontoInicialParaPontoFinal;
};
//Funções locais que não são exportadas para main
float calcularDistanciaDeTodosPontos(ponto_ST * pontos, int quantidadeDe... | true |
70d8fc9f5f3a123c471baf9ecb137766ab5c63cd | C | mguesner/test_trolololol | /do_child.c | UTF-8 | 460 | 2.59375 | 3 | [] | no_license | #include <signal.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "ft_strace.h"
void do_child(int argc, char **argv)
{
char *args [argc+1];
for (int i=0;i<argc;i++)
args[i] = argv[i];
args[argc] = NULL;
kill(getpid(), SIGSTOP);
execvp(args... | true |
10829faa75ae6e0137fe43259ac5fe97749b4dd0 | C | Passions-yang/leetcode_Algorithm | /insertionSortList.c | UTF-8 | 2,191 | 3.546875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct ListNode {
int val;
struct ListNode *next;
};
struct ListNode *
insert(struct ListNode **head,struct ListNode * tail,struct ListNode *value);
/* return tail node*/
struct ListNode *
insert(struct ListNode **head,struct ListNode * tail,struct L... | true |
57bdcd057e507e3adbd9f990f56203f37ab72763 | C | mhaukness-ucsc/MarginPolish | /impl/referencePriorProbs.c | UTF-8 | 10,800 | 2.6875 | 3 | [
"MIT"
] | permissive | /*
* Copyright (C) 2017 by Benedict Paten (benedictpaten@gmail.com)
*
* Released under the MIT license, see LICENSE.txt
*/
#include <htslib/vcf.h>
#include "htsIntegration.h"
/*
* Functions for reference prior probabilities
*/
stReferencePriorProbs *stReferencePriorProbs_constructEmptyProfile(char *referenceNa... | true |
74c37ec097533309de85374c311a4687bfd942cd | C | AndyKorg/solderstation | /avr/solderstatin/setting_save.c | WINDOWS-1251 | 2,386 | 2.75 | 3 | [
"MIT"
] | permissive | #include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include "eeprom.h"
#include "setting_save.h"
#include "console.h"
#include "stdio.h"
bool eepromInited = false;
set_dev_t setting;
uint8_t *settingBuf = NULL;
//callback function
void saveResult(epState_t result)
{
if(result =... | true |
5374c175b0c8ba597b1afe580ec0310deb9415f2 | C | vollmerr/OSU | /courses/344/block_3/child.c | UTF-8 | 4,426 | 3.171875 | 3 | [] | no_license | /////////////////////////////////////////////
//
// FILE: child.c
// AUTHOR: Ryan Vollmer
// PURPOSE: Child process functons for small shell.
//
/////////////////////////////////////////////
#include "smallsh.h"
/**
* Checks if command is for a background process
* @param {char*} cmd - command to check... | true |
bc08dc0a0e0e19fe37cb4ac5890a6fdcec1e5727 | C | zbxzc35/BPNet | /sin/main.c | UTF-8 | 1,795 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define N 200
#define LEARN_RATE 0.01
#define EPS 1e-11
double input[N], output[N];
void data(){
srand(time(0));
int i;
double atom=M_PI_4/N;
double x=-M_PI_4;
for (i=0; i<N;++i){
x+=atom;
... | true |
0909d32398b369e8364e0f73d74976f3922e2697 | C | xoptov/learning_c_and_cpp | /c_how_to_program/homeworks/3_36/main.c | UTF-8 | 537 | 3.625 | 4 | [] | no_license | #include <stdio.h>
int main()
{
unsigned int binary, divisor = 1, position_divisor = 10, decimal_weight = 1, decimal = 0, position_value;
printf("Введите двоичное число вида 1001011: ");
scanf("%d", &binary);
while (divisor <= binary) {
position_value = binary % position_divisor / divisor;
decimal +... | true |
c6b016ca95ba787f3ab71b9247d77a21a75bb759 | C | KasperZutterman/BesturingsSystemen_II | /Syscalls/Deel VI - Processen en POSIX-threads/Thread Synchronisatie/lseek.c | UTF-8 | 702 | 3.5625 | 4 | [
"MIT"
] | permissive | #include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
// open /etc/passwd + error handling
int fd = open("/etc/passwd", O_RDONLY);
if(fd < 0) {
perror(argv[0]);
exit(1);
}
// lseek to the last ten bytes of the file + error handli... | true |
f7f61ffb3c6810ed2eaee01bb9beff688cbb4c1d | C | anitaNeutrino/anitaFlightSoft | /common/linkWatchLib/linkWatchLib.h | UTF-8 | 1,516 | 2.625 | 3 | [] | no_license | /*! \file linkWatchLib.h
\brief Utility library to help ease the watching of link directories
April 2008, rjn@hep.ucl.ac.uk
*/
#ifndef LINKWATCHLIB_H
#define LINKWATCHLIB_H
// System Includes
#include <time.h>
#include <zlib.h>
#include <stdio.h>
#ifndef __CINT__
#include <dirent.h>
#endif
int setupLinkW... | true |
7c16a7039bd3236b4d4ad93192495ab799ffe02a | C | SyaoKyo/leetcode | /c/easy/938. Range Sum of BST.c | UTF-8 | 1,373 | 4.03125 | 4 | [] | no_license | /*
* 938. Range Sum of BST
* Given the root node of a binary search tree and two integers low and high,
* return the sum of values of all nodes with a value in the inclusive range [low, high].
*
* Example 1:
* Input: root = [10,5,15,3,7,null,18], low = 7, high = 15
* Output: 32
* Explanation: Nodes 7, 10, and 15 are ... | true |
4090ca0a42a1ea91d3733c92536cfda6127da23f | C | ThiagoInocencio/Competitive-Programming-Solutions | /Uri-Online-Judge/c/1457 - Oracle of Alexandria.c | UTF-8 | 423 | 3 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include <math.h>
int main(){
int T, i, tam, num;
long long unsigned int N = 0, P = 0;
char NK[30];
scanf(" %d" , &T);
while(T>0){
scanf("%d%s", &num , NK);
tam = strlen(NK);
N=num;
i = 1;
while(((num-(tam*i))>0) ){
P = (num... | true |
32da8db74a362006210c0f1a34f455a8f0ec4265 | C | nothing4free/refuerzoProg | /modulo1-fundamentos/ejercicio2.c | UTF-8 | 1,001 | 3.953125 | 4 | [] | no_license | /*
Calcular el algoritmo que determine el número de puntos que lleva un
equipo de fútbol en competición de liga en función del número de partidos ganados, perdidos y empatados.
NOTA: un partido ganado son 3 puntos, uno empatado es 1 y uno perdido son 0.
*/
#include <stdio.h>
void main() {
// varia... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.