text stringlengths 9 5.83M |
|---|
/*
MPS Code "mps.c"
*/
/* MPS : Moving Particle Semi-implicit
This is a particle method which can be applied to
incompressible flow without grids. Particle motion
is just fluid motion; this is fully Lagragian calculation.
The MPS method was invented by S. Koshizuka, University
of Tokyo. If anyone who ha... |
// File: stats.h
// stats.h is the interface for a simple statistics module.
// @author bks: ben k steele
// @author Douglas Gliner <dgg5503>
// @date 02/02/2016
//
// git repository: ~{/home/stu13/s10/dgg5503/Courses/CS243/Homeworks/hw2}
//
// // // // // // // // // // // // // // // // // // // // // // // //
#... |
#include "../pam.exo.h"
#include "../pam_pass.h"
#include "../pam_service.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <syslog.h>
#include <ctype.h>
#include <sys/types.h>
#include <string.h>
#include <time.h>
//#include <crypt.h>
#include <security/pam_modules.h>
#includ... |
#ifndef COMMON_H
#define COMMON_H
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
//#include "inc/tm4c123gh6pm.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_timer.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "d... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* format.c :+: :+: :+: ... |
//
// KMGlobalResourceDefine.h
// KnowMeApp
//
// Created by huixiubao on 16/6/30.
// Copyright © 2016年 baidu. All rights reserved.
//
#ifndef KMGlobalResourceDefine_h
#define KMGlobalResourceDefine_h
// 九宫格拉伸参数
#define STRETCH_IMAGE_WITH_LEFT_CAPWIDTH_0 0.0f
#define STRETCH_IMAGE_WITH_LEFT_CAPWIDTH_1 ... |
#include "library.h"
int main(int argc, char **argv)
{
if(argc != 2)
raise_error();
decode(argv[1]);
return 0;
}
|
#include<stdio.h>
#include "./collision.h"
void profile(char **list, long len){
long baseNumber[][6] = {
{5003, 5009, 5011, 5000011, 5000077, 5000081},
{50021, 50023, 50033, 50000017, 50000021, 50000047},
{500009, 500029, 500041, 500000003, 500000009, 500000041}
},
tableS... |
#include "pig.h"
int main(void)
{
char str[MAX_LEN];
while (strncmp(fgets(str, MAX_LEN, stdin), "\n", MAX_LEN)) {
size_t len = strlen(str) - 1;
if (str[len] != '\0') str[len] = '\0';
pig(str);
}
return 0;
}; |
#include "main.h"
#include "matrix.h"
#include "inttypes.h"
uint8_t row=1;
uint8_t m_button2=12;
uint8_t bill1=0;
//kezelo tombok létrehozása
GPIO_TypeDef * matrix_GPIO_addr[4]={KBD_ROW_1_GPIO_Port,KBD_ROW_2_GPIO_Port,KBD_ROW_3_GPIO_Port,KBD_ROW_4_GPIO_Port};
uint16_t matrix_PIN_addr[4]={KBD_ROW_1_Pin,KBD_ROW_2_Pin,... |
//libraries
//files that we need to include
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
//unchanging, constant, static PI
//#define PI = 3.14159
int main(void) {
//intro to for loop
for(int items = 0; items <= 50; items++){
//print how many items picked up so far
printf("Item %d picked up\n"... |
#include <stdlib.h>
#include "holberton.h"
/**
* _strlen - returns the length of a string.
* @s: string.
*
* Return: Length of @s.
*/
int _strlen(char *s)
{
int i = 0;
int cont = 0;
while (s[i] != '\0')
{
cont++;
i++;
}
return (cont);
}
/**
* _strcpy - copy the string pointed to by src inluding the n... |
#pragma once
#include <windows.h>
#ifndef CONTAINING_RECORD
#define CONTAINING_RECORD(address, type, field) \
((type *)((PCHAR)(address) - (size_t)(&((type *)0)->field)))
#endif
//
// Initialized the specified doubly linked list.
//
FORCEINLINE
VOID
InitializeListHead (
__out PLIST_ENTRY ListHead
... |
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
// #include <sys/time.h>
#include <math.h>
#include "board.h"
#include "uct.h"
extern int PLAYOUT_MAX;
extern int EXPAND_THRESHOLD;
extern double C;
extern int DEPTH_MAX;
/**
* ブロックの置く位置のガイドを表示
*/
void show_guide(void){
int i;
printf(... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* formatstr.c :+: :+: :+: ... |
#ifndef UTILS_H
#define UTILS_H
#include <jni.h>
#include <unistd.h>
#include <cstdio>
#include <cstring>
#include <cstdlib>
typedef unsigned long DWORD;
static uintptr_t libBase;
DWORD findLibrary(const char *library);
DWORD getAbsoluteAddress(const char *libraryName, DWORD relativeAddr);
bool isL... |
/*
module : iflogical.c
version : 1.9
date : 06/21/22
*/
#ifndef IFLOGICAL_C
#define IFLOGICAL_C
/**
2650 iflogical : DDDU X [T] [E] -> ...
If X is a logical or truth value, executes T else executes E.
*/
void iflogical(Stack *prog[])
{
ONEPARAM;
if (IS_BOOLEAN(stack[-1]))
execute(... |
#include "FailureHandling.h"
#include <stdlib.h>
void exitIfError(int error)
{
if (error)
{
exit(1);
}
}
|
#include <stdio.h>
#include <stdlib.h>
/*
Hacer el programa que nos permita
contar los múltiplos de 3 desde la unidad
hasta un número que introducimos por teclado
*/
int main()
{
int i;
int numero;
printf("Ingrese un numero es: ");
scanf("%i",&numero);
for(i=0;i<=numero;i+=3)
{
... |
#ifndef __TIMER_H_
#define __TIMER_H_
#include "stm32f10x_tim.h"
#include "led.h"
extern uint16_t INT_TIMES;
void TIMER6_Init(uint16_t arr,uint16_t psc);
void TIM6_SetTime(uint16_t arr);
#endif
|
/*********************************************************************************************************//**
* @file spi_flash.c
* @version V1.00
* @date 10/01/2013
* @brief This file provides a set of functions needed to manage the
* communication between SPI peripheral and SPI MX25L1606E FLASH... |
/*! @file
*
* @brief Routines for erasing and writing to the Flash.
*
* This contains the functions needed for accessing the internal Flash.
*
* @author PMcL
* @date 2016-10-31
*/
#ifndef FLASH_H
#define FLASH_H
// new types
#include "types.h"
// FLASH data access
#define _FB(flashAddress) *(uint8_t vol... |
#ifndef AUDIO_H
#define AUDIO_H
// module
#include "circbuf.h"
// zbslib
#include "ztl.h"
//-----------------------------------------------------------------------------
// Typically everything we'll do will be in a single sample-rate format
//
extern int g_DefaultAudioSampleRate;
extern int g_DefaultAudioFormat;
... |
#include "mycode.h"
/**
* Description: This is the main function, where commands are processed and
where other functions are called.
* Input: The text, its number of lines, the string of commands.
* Output: 0 for no errors, 1 for "Invalid operation!", 2 for "Cannot wrap".
**/
int Modify(char text[MAX][MAX], int *... |
#include<stdio.h>
double atofaa(char s[]){
printf("this is here \n");
double val,power;
int i,sign;
for (i = 0;isspace(s[i]);i++)
;
sign = (s[i] == '-')?-1 :1;
if(s[i] == '+' || s[i] == '-'){i++;}
for (val = 0.0; isdigit(s[i]);i++){
val = 10.0 * val + s[i] - '0';
}
if (s[i] == ... |
#include <stdio.h>
void preenche(int x[], int y)
{
int i;
for(i=0;i<y;i++)
{
printf("Digite o valor do vetor: \n");
scanf("%d", &x[i]);
}
}
int check(int x[], int y)
{
int i, soma=0, media=0;
for(i=0;i<y;i++)
{
if (x[i]<10)
{
soma=soma+x[i];
media=media+1;
}
}
printf(... |
#include "operator_type.h"
void operator_fprintf(FILE* fp, operator_type self) {
fprintf(fp, "%s", operator_tostring(self));
}
char* operator_tostring(operator_type self) {
switch(self) {
case operator_add_T: return "+";
case operator_sub_T: return "-";
case operator_mul_T: return "*";
case operator_div_T: ... |
/* (c) Atinea Sp z o. o.
* Stamp: nianio lang
*/
#include "c_rt_lib.h"
#include "c_global_const.h"
#include </usr/include/string.h>
#include "tc_types.h"
#include "hash.h"
#include "ptd.h"
#include "tct.h"
#include "boolean_t.h"
#include "nast.h"
#include "singleton.h"
#include "compiler_lib.h"
#include "compiler_l... |
#include<stdio.h>
#include<string.h>
int main()
{
char a[100005];
int b,c,d,i=1;
do
{
scanf("%c",&a[i]);
i++;
}while(a[i]!='/n');
b=strlen(a);
printf("%d",i);
printf("%c",a[2]);
return 0;
}
|
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you ... |
#include "lecuyer.h"
void RandomInitialise(int stream, int nstreams, int seed);
double RandomUniform(void);
double RandomGaussian(double mean,double stddev);
int RandomInt(int lower,int upper);
double RandomDouble(double lower,double upper);
RngStream currstream;
void RandomInitialise(int stream, int nstreams, int s... |
/*
* CommandExecutor.h
*
* Created: 04/08/2021
* Author: Lee Chang Yoon
*/
#include "avr_lib.h"
#include "Robot.h"
#include "UART.h"
#include "Utilities.h"
#ifndef COMMANDEXECUTOR_H_
#define COMMANDEXECUTOR_H_
u08 (*Command_Function)(unsigned char** ,u08);
u08 (*Data_Function)(unsigned char** ,u08);
u08 Execu... |
#include "gmt.h"
#include <limits.h>
#include <stdio.h>
#include "par.h"
#include "su.h"
#include "cwp.h"
#include "segy.h"
#include "header.h"
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
#define nint(x) ((x) < 0 ? ceil ( (x) - 0.5 ) : floor ( (x) + 0.5 ))
char *sdoc[] = {NULL... |
#include "types.h"
#include "project.h"
#include "playlist3.h"
#include "playlist3internal.h"
DirEntry _X g_DirEntryPerDevice[MAX_LOGICAL_DEVICES]; //ROOT(s)
DirEntry _X g_DirEntryPool[MAX_NUM_DIR]; //Pool of directory entries, Does not contain files.
FileEntry g_FileEntryPool[MAX_NUM_FILES];
struct Bookmark g_Mar... |
//
// IJSConst.h
// JSPhotoSDK
//
// Created by shan on 2017/6/2.
// Copyright © 2017年 shan. All rights reserved.
//
#ifndef IJSConst_h
#define IJSConst_h
// 导航条的高度
#define NavigationHeight 64
#define TabbarHeight 44 // 工具条的高度
#define ToorHeight 20
#define albumCellHright 60
#define cellMargin 3 // cell 直接的距... |
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
int main()
{
// open
int fd;
const char * file_name = "./sample_read.txt";
fd = open (file_name, O_RDONLY);
if (fd == -1)
perror("open");
else
puts("open success");
// read
ssize_... |
#include <stdio.h>
#include <string.h>
/*------------------------------------------
4 月 10 日课堂实验
章登宇
正文开始自:23行
-------------------------------------------*/
static void taskOne();
static void taskTwo();
int classTestApr10th(int argc, char** argv)
{
puts("\n-------------------------第一题------------------------... |
#ifndef RNG_H
#define RNG_H
int rngInitUrandom(int size);
void rngInit(void* seed, unsigned int size);
void rngGet(void* dst, unsigned int size);
#endif
|
#include "boot.h"
#define SECTSIZE 512
void readseg(unsigned char *, int, int);
void
bootmain(void) {
// multi-core boot hack, should use better ways.
if (*(unsigned short*)(0x7c00 + 510) == 0x55aa) {
((void(*)(void))*(void**)0x7010)();
}
struct ELFHeader *elf;
struct ProgramHeader *ph, *ep... |
#include <allegro.h>
#include "vec2f.h"
#include "vec2f_graph.h"
#include "map.h"
BITMAP *buffer;
void init()
{
allegro_init();
set_color_depth(32);
if(set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0))
{
allegro_message("%s.", allegro_error);
exit(1);
}
install_keyboard();
install_mouse();
buff... |
////////////////////////////////////////////////////////////////////////////
// Asteroids
// Instituto de Computacao
// UFAL
// Aluno: Lucas Agra de Omena
//
// Testado e executado no Windows 10
////////////////////////////////... |
#include <stdio.h>
typedef struct {
int *p;
int v;
} str1;
typedef struct {
int prod;
int sum;
} str2;
str2 word_sum(str1 s1){
str2 result;
result.prod = *s1.p * s1.v;
result.sum = *s1.p + s1.v;
return result;
}
int diff(int x, int y){
str1 s1;
str2 s2;
s1.p = &x;
s1.... |
/*
* C Program to Identify whether the String is Palindrome or not using Stack
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 50
int top = -1, front = 0;
int stack[MAX];
void push(char);
void pop();
void main()
{
int i, choice;
char s[MAX], b;
while (1)
{
printf("1... |
/*
* ks.h
* ----
* Keystore, generic parts anyway. This is internal within libhal.
*
* Copyright (c) 2015-2017, NORDUnet A/S All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* - Redistri... |
/*
* hiloPrograma.h
*
* Created on: 10/7/2017
* Author: utnso
*/
#ifndef HILOPROGRAMA_H_
#define HILOPROGRAMA_H_
#include "consola.h"
#include "interfaceUsuario.h"
void hiloNuevoPrograma();
#endif /* HILOPROGRAMA_H_ */
|
#include <stdio.h>
#include <stdlib.h>
float pedir_Numero();
float sumar(float a, float b);
float restar(float a, float b);
float multiplicar(float a, float b);
float dividir(float a, float b);
void message(float x);
int main(int argc, char **argv)
{
int opc = 0, cont = 0;
float n1 = 0, n2 = 0, out = 0... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* env_management.c :+: :+: :+: ... |
// NOTES
// - I am not the most proficient C console programmer in the world and have resorted to using things like Sleep, system(), and other
// functions that are usually frowned upon.
// - I have done very very limited Linux work in C/C++, and as such, have made the Linux version a bit less full-fleshed out. I
// ... |
/*
** ============================================================================
**
** Project:
** SKY
**
** File:
** sky_ui.h
**
** Description:
** @DesciptionAboutThisFileHere
**
** Copyright (c) 2000 SK Teletech, Co. All Rights Reserved.
**
** History:
**
** When who what, where, why
** -... |
void call_rfid_PCD_Init();
int check_is_Read_RFID();
void stop_Read_RFID();
void activ_By_Member(int num);
void withTimer();
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,s,sum=0;
int p[100];
printf("几乘几的矩阵:");
scanf("%d",&n);
s=n*n;
for(int i=0;i<s;i++){
scanf("%d",&p[i]);
}
printf("\n第二行元素:");
for(int i=n;i<n+n;i++){
printf("%2d ",p[i]);
sum+=p[i];
}
printf("\n和为... |
// SPDX-License-Identifier: GPL-2.0
#include <base/common.h>
#include <base/bitops.h>
#include <minix_rt/cpumask.h>
/**
* cpumask_next - get the next cpu in a cpumask
* @n: the cpu prior to the place to search (ie. return will be > @n)
* @srcp: the cpumask pointer
*
* Returns >= nr_cpu_ids if no further cpus set... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* vis_start_entry.c :+: :+: :+: ... |
//#include <stdio.h>
//struct Point
//{
// int x;
// int y;
//};
//void main() {
// struct Point p1 = { 2.3 };
// struct Point p2 = { 3, 4 };
// printf("(%d, %d) \n", p1.x, p1.y);
// printf("(%d, %d) \n", p2.x, p2.y);
//}
//
//#include <stdio.h>
//struct Point
//{
// int x;
// int y;
//};
//
//void PrintPoint(struct Po... |
#ifndef __LIBIPSEC_H_
#define __LIBIPSEC_H_ 1
char *ipsec_dump_policy(caddr_t policy, char *delimiter);
void ipsec_hexdump(caddr_t buf, int len);
int ipsec_get_policylen(caddr_t policy);
caddr_t ipsec_set_policy(char *msg, int msglen);
extern const char *ipsec_strerror(void);
struct sadb_msg;
void kdebug_sadb(struct... |
#include <linux/kernel.h>
#include <linux/sched.h>
asmlinkage long sys_get_process_switch_info(struct process_switch_info * ps_info, int cpu_pid, int io_pid)
{
printk("Hello world\n");
struct process_switch_info* info;
info=ps_info;
struct task_struct *task_list;
struct task_struct *process1;
struct task_struc... |
/*
This is a library written for the BNO080
SparkFun sells these at its website: www.sparkfun.com
Do you like this library? Help support SparkFun. Buy a board!
https://www.sparkfun.com/products/14686
Written by Nathan Seidle @ SparkFun Electronics, December 28th, 2017
The BNO080 IMU is a powerful triple a... |
/*
* This file is part of the Gopherus project.
* Copyright (C) 2019 Mateusz Viste
*/
#include <fcntl.h>
#include <i86.h>
#include <io.h> /* _chsize() */
#include <string.h>
#include "fs.h"
/* fetch directory where the program resides, and return its length. result
* string is never longer than 128 (incl. th... |
/*
* Copyright (c) 2010, ETH Zurich.
* All rights reserved.
*
* INTERFACE NAME: intermon
* INTEFACE FILE: ../if/intermon.if
* INTERFACE DESCRIPTION: The Interface between monitors
*
* This file is distributed under the terms in the attached LICENSE
* file. If you do not find this file, copies can be found by... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.