text stringlengths 3.08k 10.5k |
|---|
// Copyright (c) 2016, Sandia Corporation. Under the terms of Contract
// DE-AC04-94AL85000, there is a non-exclusive license for use of this
// work by or on behalf of the U.S. Government. Export of this program
// may require a license from the United States Government
// This file is part of the Compressed Continuo... |
/**
* @file stm32_rtc_cal.c
* @author <NAME> (<EMAIL>)
* @brief Implementation of calendar api for stm32 rtc
* @date 2020-10-07
*
* @copyright Copyright (C) 2020 <NAME>
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT st_stm32_rtc
#include <zephyr.h>
#include <device.h>
#include <stm32f4xx_... |
/*
* Copyright (C) 2015 <NAME>
*/
/*
* The daemonize module
*/
#ifndef daemonize_c
#define daemonize_c
#else
#error Preprocesor macro daemonize_c conflict!
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#inclu... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* o... |
#include "run_module_lbm.h"
#ifdef V_T
#include <VT.h>
int class_id;
int advance_step_id;// get_buffer_id;
#endif
#define SIZE_ONE (2)
extern double u[nx][ny][nz],v[nx][ny][nz];
extern double u_r;
status_t insert_zipper(GV gv){
int i, j, k;
/*create_prb_element*/
char* buffer;
// FILE *fp;
// char file_nam... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolar... |
#include "main.h"
#include "sensor.h"
#include "imu.h"
extern struct timespec time_tag;
extern struct timespec time_tag_raw;
extern struct timespec time_tag_after_read_mcs;
extern volatile bool keepRunning;
/**
* Handles initialisation of mcs
**/
int start_imu(sensor* imu){
#ifdef DEBUG
printf("Calling mcst .... |
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "sdcpclient.h"
#include "testkeys.h"
#include "helpers.h"
#define ASSERT_EQUAL(a, b) assert((a) == (b))
int main()
{
// Dump the model keys
puts("Model and device keys:\n----------------------\n");
print_bytes("pk_m", g_mod... |
/*-------------------------------------------------------------------------
* drawElements Image Library
* --------------------------
*
* Copyright 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Li... |
// Copyright (C) 2007 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* o... |
/*
* Copyright (c) 2021 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, dis... |
/*
* This is a RANDOMLY GENERATED PROGRAM.
*
* Generator: csmith 2.2.0
* Git version: dcef523
* Options: (none)
* Seed: 2874691728
*/
#include "csmith.h"
static long __undefined;
/* --- Struct/Union Declarations --- */
/* --- GLOBAL VARIABLES --- */
static int32_t g_3 = 0L;
static int32_t g_4[9][7][2]... |
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2005 - 3D Realms Entertainment
This file is NOT part of Shadow Warrior version 1.2
However, it is either an older version of a file that is, or is
some test code written during the development of Shadow Warrior.
This fil... |
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
#include "c_timer.h"
int main(int argc, const char* argv[]) {
srand((unsigned int)time(NULL));
int LDA=0, LDB=0, LDC=0, N=0, M=0, P=0, NTROW=0, NTCOL=0, dimension=0;
double inizio, fine;
void matmatthread(int LDA, int LDB, int LDC, flo... |
/* $Id$ */
/*
* %ISC_START_LICENSE%
* ---------------------------------------------------------------------
* Copyright 2015-2016, Google, Inc.
* Copyright 2011-2016, Pittsburgh Supercomputing Center
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with ... |
#include <stdio.h>
#include <stdlib.h>
#include "ehlo-shared.h"
static void print_prompt(void)
{
printf_locked("> ");
fflush(stdout);
}
static void *command_thread(void *arg)
{
socket_t sock = *((socket_t *)arg);
for (;;) {
int recv_size;
int8_t cmd;
recv_size = recv(sock, &cmd, 1, 0);
if (r... |
#include<Python.h>
#include<numpy/arrayobject.h>
#include<stdio.h>
#include"PacWar.h"
typedef signed char PacBits;
static const int PACBIT_TYPE = NPY_BYTE;
typedef unsigned int Score;
static const int SCORE_TYPE = NPY_UINT;
static const int GENE_LEN = 50;
/*
* Pacwar core
* ===========
*/
/**
* Run a single ... |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <libgen.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "main.h"
#include "function.c"
// temp TODO
#include "net/... |
#include "args.h"
#include "ra.h"
#include "rand.h"
#include "timer.h"
#include <math.h>
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int n = 28, N_U_log2 = 19;
u64 N_U, m, idxMask;
const double errorTolerance = 1e-2;
int rank, nprocs;
int doneCount = 0;
MPI_Request recvReq;
u64 recvBuf[2];
static int id... |
#define STMT_TYPE_IMPORT 1
#define STMT_TYPE_FUNC_DEF 2
#define STMT_TYPE_VAR_DECL 3
#define STMT_TYPE_STRUCT_DECL 4
#define STMT_TYPE_ASSIGN 5
#define STMT_TYPE_CONST 6
#define STMT_TYPE_RETURN 7
#define STMT_TYPE_IF 8
#define STMT_TYPE_FOR_CLASSIC 9
#define STMT_TYPE_FOR_RANGE 10
#define STMT_TYPE_FOR_SWITC... |
#include <catam.h>
double epsilon;
double pi=3.1415926535897932;
double r,t,x[1000],xl[1000],xu[1000];
int a[1000],p[1000],q[1000],i,j,M,option;
int floint(double X) {
int I;
I=0;
while(X>0) {X=X-1;I=I+1;}
return I-1;}
int main(void) {
epsilon=pow(2,-52);
do {
printf("\nSelect which real to a... |
#include <stddef.h>
#include <stdint.h>
#include "osc.h"
#include "atm_cmd_constants.h"
/* Adjust the following to reduce memory usage */
#define ATM_SCORE_CHANNEL_COUNT (4)
#define ATM_SFX_SLOT_COUNT (2)
#define ATM_PATTERN_STACK_DEPTH (3)
ct_assert(ATM_SCORE_CHANNEL_COUNT <= OSC_CH_COUNT, channel_count);
ct_asser... |
/******************************************************************************
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2017-2018 Yeonji <<EMAIL>>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document... |
/************************************************************************************
*
* Copyright 2016 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the Li... |
/* reversi.c */
#include <stdio.h>
#include <stdlib.h>
#define B_SIZE 10 //BOARDSIZE
#define WIDTH (B_SIZE+2) //BOARDSIZE+WALL
#define ALLBOARD (WIDTH * WIDTH) //盤外を含めたBOARDSIZE
#define EMPTY 0 //空点
#define BLACK 1 //黒石
#define WHITE 2 //白石
#define WALL 3 //盤外
#define MARK 1 //マーク
//----... |
#include "game.h"
#include "world.h"
#include <string.h>
//#include "player.h"
extern game_state_t* gs;
// sets new beginning state for current level
void W_StartLevel() {
P_Spawn();
// reset monster bullet
gs->mbullet_px = 0;
gs->mbullet_py = 0;
memset( gs->ms, 0, sizeof(gs->ms) );
// set hardcoded monster t... |
/* rgwin_graph.c: The graphics window type
for RemGlk, remote-procedure-call implementation of the Glk API.
Designed by <NAME> <<EMAIL>>
http://eblong.com/zarf/glk/
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "glk.h"
#include "remglk.h"
#include "rgdata.h"
#include "rgwin_gra... |
/*
* @XMHF_LICENSE_HEADER_START@
*
* eXtensible, Modular Hypervisor Framework (XMHF)
* Copyright (c) 2009-2012 Carnegie Mellon University
* Copyright (c) 2010-2012 VDG Inc.
* All Rights Reserved.
*
* Developed by: XMHF Team
* Carnegie Mellon University / CyLab
* VDG Inc.
* ... |
/*
nsswitch.c - functions for parsing /etc/nsswitch.conf
Copyright (C) 2011-2015 <NAME>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or... |
/* -*- coding: utf-8 -*-
* ----------------------------------------------------------------------
* Copyright © 2010-2012, RedJack, LLC.
* All rights reserved.
*
* Please see the LICENSE.txt file in this distribution for license
* details.
* ----------------------------------------------------------------------
... |
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#include<string.h>
#define MAX_RANDOM 100000
#define FALSE 0
#define TRUE 1
#define BOOL int
typedef unsigned long long int ulli;
ulli power(ulli x, ulli y, ulli p){
ulli res = 1;
x = x % p;
while (y > 0){
if (y & 1) res = (res*x) % p;
y =... |
/*
The MIT License (MIT)
Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, co... |
//
// Created by <NAME> on 01-11-2017.
//
#include "data.h"
bool map[LIST_ROWS][LIST_COLUMNS];
int iteratorB = 0;
struct ListPosition current = {0, 0};
void mapPositions() {
int counter = 0;
// printf("\n%d\t%d", x, y);
while (1) {
int x = rand() % LIST_COLUMNS;
int y = rand() ... |
#include "includes/slistcore.h"
#include "../src/includes/sparser.h"
#include "includes/sapi.h"
#include "../src/includes/smemory.h"
#include "../src/includes/scompiler.h"
#include "../src/includes/sgcobject_utils.h"
static Constant listNew(VM* vm, int arity, Constant* args) {
expect(1, arity, "List constructor");
... |
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected un... |
/*
Copyright (c) 2013 <NAME> <<EMAIL>>
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,
mod... |
/******************************************************************************
A basic implementation of the concepts that will be utilized in the
roguelike I intend to construct from the resources located in the
"resources" directory. This is a very rough testing environment, and will
certainly need many ... |
#include <getopt.h>
#include <sys/epoll.h>
#include "common.h"
#define TOR_MAX_EVENT 256
int do_loop(void);
int read_config(char *fname);
static void usage(char *argv0) {
fprintf(stderr, "Usage : %s \r\n"
"\t-c config\r\n", argv0);
}
int main(int argc, char **argv) {
const char *opstring = "c:";
... |
// Copyright (c) 2021 Cesanta
// All rights reserved
#include "uart.h"
#include "gpio.h"
#include "soc.h"
#include "sys.h"
#include "timer.h"
// Software UART send
void uart_tx_pin(int pin, int baud, uint8_t c) {
unsigned long s = time_us(), t = (unsigned long) (100000000 / baud);
gpio_write(pin, 0);
for (s += ... |
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "hashmap.h"
#ifndef M_PI
#define M_PI 3.141592653589793
#endif
#define VERSION_MAJOR 0
#define VERSION_MINOR 1
#define VERSION_PATCH 0
#define CHANNEL_COUNT 8
#define IS_ROTATION_CHANNEL(ch) ((ch) == CHANNEL_RX || (ch) == CHANNEL_... |
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "datastructs.h"
#include "utils.h"
#include "consts_match.h"
// Global variables -- prevents excessive passing
// of commonly used variables
int field_rank = -1, playerKicked;
playerpacket* prevpositions = NULL;
pla... |
#include "ext/debug.h"
#include "ext/kheap.h"
#include "page.h"
#include "types.h"
#include "string.h"
// A bitset of frames - used or free.
u32int *frames;
u32int nframes;
page_directory_t* kernel_directory;
page_directory_t* current_directory;
// Defined in kheap.c
extern u32int placement_address;
// Macros used ... |
/*
* Mips specific backtracing code for oprofile
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* Copyright (c) 2008 Wind River Systems, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 a... |
#include "graph_gen.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
void create_RMAT_graph(node_t* node_ptr, edge_t* edge_ptr,
double a, double b, double c, uint32_t N, uint32_t M)
{
//srand(1204);
srand(104);
double d;
assert(a + b + c < 1);
d = 1 - (... |
/*
* strtod implementation.
* original author: <NAME>
* tidied up and modified to use soft float macros: <NAME>
* license: public domain
*/
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "milieu.h"
#include "macros.h"
#include "softfloat.h"
extern double fltMinusOne;
extern... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h> // for memset()
#include <stdint.h>
#include <limits.h>
#include "socket.h" // for socket_xxx()'s
extern char* stristr(const char* haystack, const char* needle, size_t len);
#ifdef _MSC_VER // >=1600 (2010), >=1800 (2013)
#define strdup _strdup
//#define st... |
/*
* This file is part of the µOS++ distribution.
* (https://github.com/micro-os-plus)
* Copyright (c) 2016 <NAME>.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restr... |
/* (c) 2018 <NAME> <<EMAIL>>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WAR... |
/*
* Copyright (C) 2019 <NAME>
*
* Author: <NAME> <<EMAIL>>
*/
#include <string.h>
#include <stdio.h>
#include <lexbor/encoding/encoding.h>
#define FAILED(with_usage, ...) \
do { \
fp... |
//
// Created by cagriakpak on 05.04.2019.
//
#include "writeOutput.h"
pthread_mutex_t mutexWrite = PTHREAD_MUTEX_INITIALIZER;
struct timeval startTime;
void InitWriteOutput()
{
gettimeofday(&startTime, NULL);
}
unsigned long long GetTimestamp()
{
struct timeval currentTime;
gettimeofday(¤tTime, N... |
/*****************************************************************************/
/* This code is part of the JAviator project: javiator.cs.uni-salzburg.at */
/* */
/* pwm.c Interface for controlling four brushless motors. */
... |
//
// swi_demo.c
//
// Demonstrates software interrupt
// Note that swi.c uses inline assembly, which is
// compiler dependent. The THUMB/ARM thing is nicely
// circumvented by defining the swi_call macro.
//
// (20031228 - 20070809, Cearn)
#include <stdio.h>
#include <tonc.h>
// === swi calls =========... |
/*
* Copyright (c) 2013-2015, Xerox Corporation (Xerox) and Palo Alto Research Center, Inc (PARC)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must r... |
/*
** ------------------------------------------------------------------------
** Copyright (C) 2017-2021 Carnegie Mellon University. All Rights Reserved.
** ------------------------------------------------------------------------
** Authors: <NAME>
** -------------------------------------------------------------------... |
#include "main.h"
#include "Task_IO.h"
//#include "Task_LED.h"
#include "DrUart.h"
static u16 LED_Blink_time;
static u8 LED_Blink_End;
struct DIPType
{
union
{
u8 bytetype;
struct {
u8 pre_level :1;
u8 cur_status :1;
u8 timer_en :1;
u8 reserve ... |
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/signal.h>
#include <asm/io.h>
#include <linux/timekeeping.h>
#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/jiffies.h>
#include <linux/timer.h>
// https://hackmd.io/WUQIe9uySQKZNWRAz... |
#include <System/Log.h>
#include <System/System.h>
#include <Runtime/Runtime.h>
#include <Engine/ECSystem.h>
#include <Engine/Entity.h>
#include <Engine/Component.h>
#include "ECS.h"
#define ECSYS_MOD "ECSystem"
bool E_RegisterSystems(void);
static Array _systems;
static Array _filteredEntities;
static void _ecsy... |
// Copyright (C) 2004-2011 <NAME> & <NAME>
// This file is part of the "Luxinia Engine".
// For conditions of distribution and use, see luxinia.h
#include "ma.h"
#include "../fileio/parser.h"
#include "../fileio/filesystem.h"
void fileLoadMATrack();
void AnimBuildFromBuffer(Anim_t *anim);
void freeTracks(void);
... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolar... |
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
#include <limits.h>
/* local objects */
#include "loadconfig.h"
#include "config.h"
#include "acquire.h"
#include "error.h"
#include "aldl-io.h"
#include "useful.h"
#include "serio.h"
#include "modules... |
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32f0xx_hal_msp.c
* @brief This file provides code for the MSP Initialization
* and de-Initialization codes.
********************************************... |
/*
* Copyright (c) 2019 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribut... |
//
// Created by maxim on 3/14/20.
//
#ifdef __GNUC__
#pragma implementation "obj_controllable_car.h"
#endif
#include "obj_controllable_car.h"
#include "../../rendering/renderer.h"
#include "car.h"
#include "../obj_dummy.h"
#define MAX_WHEEL_ANGLE M_PI / 7
static camera_t* car_camera;
static vec4 car_start = NULL;
s... |
/*---------------------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <<EMAIL>>, <<EMAIL>> written this file.
* As long as you retain this notice you can do whatever you want with this
* stuff. If we meet some day, and you think this stuff is worth it, ... |
/*
Copyright (c) 2016, Dust Networks. All rights reserved.
*/
// SDK includes
#include "dn_common.h"
#include "cli_task.h"
#include "loc_task.h"
#include "dn_gpio.h"
#include "dn_system.h"
#include "dn_exe_hdr.h"
#include "Ver.h"
// app includes
#include "app_task_cfg.h"
// C includes
#include <stdio.h>
//========... |
#ifdef _WIN32
#define LIMPAR "cls"
#include <windows.h>
#define dormir(x)(Sleep(x*1000))
#else
#define LIMPAR "clear"
#include <unistd.h>
#define dormir(x)(sleep(x))
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define L 6
#define C 6
#define BATERIA_FULL 16
int bateria = BATERIA... |
#include <stdio.h>
#include <stdlib.h>
#define LEVEL 2
#define Y 2
#define DEST 3
#define ENTER 13
#define MAPSIZE 20
int wrong=0;
int size[LEVEL][2]={{7,7},{15,17}};
int beginning[LEVEL][2]={{1,1},{1,0}};
int wall[LEVEL][MAPSIZE][MAPSIZE]={ // 3 is destination
{
{0,0,0,0,0... |
/* Tethys, upgrade.c -- self-exec
Copyright (C) 2013 <NAME>
This file is protected under the terms contained
in the COPYING file in the project root */
#include "ircd.h"
const char *opt_upgrade;
mowgli_json_t *upgrade_json;
static int
_form_phoenix_args(const char *upgrade_fn, const char ***argv)
{
static... |
#include <stm32f4xx.h>
#include <stm32f4xx_i2c.h>
// this slave address belongs to the STM32F4-Discovery board's
// CS43L22 Audio DAC
// connect PD4 to VDD in order to get the DAC out of reset and test the I2C
// interface
#define SLAVE_ADDRESS 0x4A // the slave address (example)
void I2C1_init(void){
... |
/* t-secmem.c - Test the secmem memory allocator
* Copyright (C) 2016 g10 Code GmbH
*
* This file is part of Libgcrypt.
*
* Libgcrypt is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either versio... |
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <lightning.h>
#define minFloatReg 2
#define maxArgs 2
typedef struct jitput jitput;
typedef struct node node;
typedef struct timespec timespec;
typedef union {
float f;
uint8_t b[4];
} value;
#define putasmParams node* self, value *contextual
ty... |
/*
Copyright (C) 2009-2019 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in t... |
/* Test the Reed-Solomon codecs
* for various block sizes and with random data and random error patterns
*
* Copyright 2002 <NAME>, KA9Q
* May be used under the terms of the GNU Lesser General Public License (LGPL)
*
* Modified in 2019 by <NAME> to support more thorough testing.
*/
#include <stdio.h>
#include <... |
/*
** $PROJECT: Write
**
** $VER: Write.c 1.4 (20.2.97)
**
** (C) Copyright 1996-1997 <NAME>
** All Rights Reserved.
**
** This example open and writes a new CF file.
*/
#include <exec/types.h>
#include <exec/libraries.h>
#include <dos/rdargs.h>
#include <dos/dos.h>
#include <proto/exec.h>
#include <proto/do... |
/* Written by: Michael
* Debugged by: Nikita */
#include "rtc.h"
#include "i8259.h"
#include "lib.h"
/*
* rtc_init
* DESCRIPTION: Initialize Real Time Clock(RTC)
* INPUTS: none
* OUTPUTS: none
* RETURN VALUE: none
* SIDE EFFECTS: rtc is initialized
*/
void rtc_init(void)
{
/* interrupt flag set ... |
//
// Created with <3 by marcluque, August 2020
//
#include "map_loader.h"
//// Private variables
//////////////////////
static const int MAX_LINE_LENGTH = 512;
//// Public variables
/////////////////////
int NUM_PLAYERS = 0;
int NUM_OVERRIDE = 0;
int NUM_BOMBS = 0;
int BOMB_RADIUS = 0;
int MAP_HEIGHT = 0;
int MAP_W... |
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "aos/kernel.h"
#include "aos/hal/uart.h"
#include "yunit.h"
extern void hal_uart_test(void);
extern void hal_gpio_test(void);
extern void hal_i2c_test(void);
extern void hal_spi_test(vo... |
#include <stdio.h>
#include "absint_interval.h"
void test_add()
{
aint(x,32);
aint(y,32);
aint(z,32);
set_interval(x,3,100,32);
set_interval(y,10,200,32);
add(z,x,y,32);
test_interval("add: positive values (32-bit)",z,13,300);
set_interval(x,3,20,32);
set_interval(y,-10,40,32);
add(z,x,y,... |
/*
* Copyright (c) 1996-2000 <NAME>.
* See README file for details.
*/
#include "local.h"
#define PI_HALF 1.5707963267948966192313216916397514420986 /*pi/2*/
#define PI_QUARTER 0.7853981633974483096156608458198757210493 /*pi/4*/
#define EXP78 1.0129030479320018583185514777512982888868 /*... |
#include "codegen.h"
#include "common.h"
#include "compiler.h"
#include "display.h"
// Get a register number in 8085 convention
static u8 codegen_get_reg_number(Token t) {
switch(t.start[0]) {
case 'a': return 7;
case 'b': return 0;
case 'c': return 1;
case 'd': return 2;
case 'e': return 3;
case 'h': ret... |
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<unistd.h>
#include<omp.h>
#define NODE_SAYISI 5
#define HEDEF_DUGUM 4
#define BASLANGIC_DURUMU 0
#define FEROMON_ESIGI 1
#define FEROMON_SALGI_MIKTARI 0.2
#define KARINCA_SAYISI 100
#define MAX_YOL_UZUNLUGU 30
#define TRUE 1
#define FALSE ... |
/*
* statusbar.c
*
* Written by
* <NAME> <<EMAIL>>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free... |
// apprentice.c
// Written by <EMAIL>
int is_apprentice_of(object ob)
{
mapping family;
string *fams;
if( !mapp(family = query("family")) ) return 0;
if( family["master_id"] == (string)query("id", ob) &&
family["master_name"] == (string)query("name", ob) )
... |
/*
* A "social" module for Aetos
* $Id: emote.c,v 1.4 2004/09/21 15:29:50 semprini Exp $
*/
#include <stdlib.h>
#include <string.h>
#include "libpq-fe.h"
#define MOD_NAME hello
#include "../mod.h"
static efun_tbl efuns;
static int fd;
PGconn *db_conn;
gs_table gst;
void emote_send (char *dest, char *msg_templ... |
#pragma once
const int cDfltJoinOverlap = 0; // join cores which overlap and have starts which at most differ by cMaxJoinOverlap
const int cMaxJoinOverlap = 100; // max allowed join overlap
const int cMaxLengthRange = 1000000; // maximal element length
// processing modes
typedef enum TAG_eMLFPM... |
/*
* command_processor.c
*
* Created on: 17 abr. 2021
* Author: <NAME>
* email: <EMAIL>
*/
#include "command_processor.h"
#include "ksi_serial.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "ksi_memory_store.h"
extern QueueHandle_t user_interface_queue;
static State_t stat... |
#include <arch/uart.h>
#include <utils/kprintf.h>
#include <sys/io.h>
#include <sys/param.h>
#include <utils/string.h>
char * uart_models[] = {"unknown", "8250", "16450", "16550", "16550A", "16750", "unsupported"};
void uart_init() {
}
void uart_enable(enum uart_port port) {
uart_lcr_t lcr = 0;
uart_write_r... |
/**********************************************************************/
/* ____ ____ */
/* / /\/ / */
/* /___/ \ / */
/* \ \ \/ ... |
/**
* varlpenis - Generate ASCII-art penis of arbitrary length
* <NAME> <https://www.gitlab.com/ssterling/varlpenis>
*
* See `LICENSE' file for copyright information.
*/
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <time.h>
#ifdef VP_USE_POSIXTIME
#include <sys/time.h>
#endif /* VP_USE_POS... |
/**
* @brief Calculates the pagerank vector of a web graph saved in an
* NTWPR_WGFile form.
*
* Documentation for the whole API behind this program can be found at:
* https://nicktheway.github.io/Pagerank/html/index.html
*
* @file NTWpagerank_serial.c
* @author <NAME>, 8551, <EMAIL>
* @date 26-09-2... |
// Test code for priority scheduling Q 3.5.2
#include "types.h"
#include "user.h"
struct timeVariables {
int creationTime;
int terminationTime;
int sleepingTime;
int readyTime;
int runningTime;
};
int main(void)
{
changePolicy(2);
int i = 0;
int j = 0;
int k = 0;
struct time... |
/*
zip.c -- is a part of the ziphack
Copyright (c) 2017 <NAME>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, m... |
#include "main.h"
/*
* Store all reader and writer processes in the following arrays.
*/
static pid_t *readers = NULL;
static pid_t *writers = NULL;
static void clearMemory()
{
if (readers != NULL)
{
free(readers);
}
if (writers != NULL)
{
free(writers);
}
}
/*
* Creates a... |
/* -*- linux-c -*-
*
* Copyright (C) Copyright Nokia Siemens Networks 2010
* (C) Copyright <NAME> 2011
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This
* file and... |
/* box2.c
* This program draws a red box and then draws a green sphere within
* the box. The top face of the box is drawn by pressing 'c' to close the box, and
* not drawn by pressing 'o' to open the box. 'e' = exit.
* NOTE:
* (1) There is ONE LIGHT SOURCE to give a better 3D effect than box1.c
* (search... |
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <numpy/arrayobject.h>
#include <numpy/npy_math.h>
#include <math.h>
static PyObject* downsample(PyObject *self, PyObject *args) {
int threshold;
PyObject *x_obj = NULL, *y_obj = NULL;
PyArrayObject *x_array = NULL, *y_array = N... |
/*
* Copyright 2020 Codethink Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... |
/******************************************************************************
* @file stm8S003_tim2_delay_example.c
* @author <NAME> - github.com/aardwolfDigital
* @brief Timer 2 DelayMs and DelayUs example for the STM8S003F3.
* Using the SDCC, or the IAR compiler. Self contained within one
* ... |
//Written by <NAME>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
// Use O_DIRECT.
#define __USE_GNU
// 1MB.
#define BUFFER_SIZE (1 << 20)
//#defi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.