text stringlengths 3.08k 10.5k |
|---|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <err.h>
#include <pthread.h>
#include <stdbool.h>
#include <math.h>
#include <arpa/inet.h>
static uint64_t recvCount, sendCount;
void TimePrinter()
{
time_t t ... |
/*
** LuaSystemLog
** Copyright 1994-2021 <NAME> (DarkGod)
**
*/
#include <syslog.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
static int lsyslog_open(lua_State *L)
{
const char *ident = luaL_checkstring(L, 1);
int facility = luaL_checkinteger(L, 2);
lua_pushvalue(L,1);
lua_setfield(L, LUA_REGIS... |
/*
* Utilities library for libgit2 examples
*
* Written by the libgit2 contributors
*
* To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain
* worldwide. This software is distributed without any warranty.
*
* You... |
/*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2005 International Business
* Machines Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under th... |
/*
* ciaaRTC.c
*
* Created on: 13/9/2018
* Author: fran
*/
#include "chip.h"
#include "api_RTC.h"
// Despues debo sacar estas funciones de aca lo dejo por ahora por comodidad.
//================================================[RTC Management]========================================================
static vo... |
/*
Copyright (C) 2006-2007 <NAME>
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
* @file work_lda.c
* @brief This file is to be included in LDA functionals. As... |
#include "lcb_luv_internal.h"
uv_buf_t
alloc_cb(uv_handle_t *handle, size_t suggested_size)
{
lcb_luv_socket_t sock = (lcb_luv_socket_t)handle;
(void)suggested_size;
return sock->read.buf;
}
void
read_cb(uv_stream_t *stream, ssize_t nread, uv_buf_t buf)
{
/* This is the same buffer structure we had be... |
#include "main.h"
#define PID_LOOP_COUNT 1
// functions to get the current values
typedef double (*getCurrentValFunction)();
getCurrentValFunction *valueGetters[PID_LOOP_COUNT];
// functions to send current values to do whatever with them
typedef void (*setCurrentValFunction)(double);
setCurrentValFunction *valueSet... |
/*
*Wireless Driver API
*
*The Common API for Wireless
*
*Writed by dengkexi
*Under the GPL licence
*/
#include <asm/types.h>
#include <netinet/ether.h>
#include <netinet/in.h>
#include <net/if.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <linux/netlink.h>
#include ... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/ptrace.h>
#include <sys/reg.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/user.h>
#include <fcntl.h>
#include <linux/limits.h>
#include <linux/unistd.h>
static void proce... |
#include <pthread.h>
#include "energymgr.h"
//#include <stdint.h>
#include "../mNodes.h"
#include <math.h>
#ifndef NUMTIMEFRAMES
#define NUMTIMEFRAMES 12
#endif
#ifdef STATIC_POLICY
int static_state = STATIC_STATE;
double static_grade = STATIC_GRADE;
#endif
int ENERGY_TIMESCALES[NUMTIMEFRAMES];
extern unsigned i... |
#include <arpa/inet.h>
/* 11-format word */
#define WORD32(c) ((c[1]) + ((c)[0]<<8) + ((c)[3]<<16) + ((c)[2]<<24))
#define WORD16(c) (*(c+1) + (*(c)<<8))
// Max forwarding count (4 bits)
#define CH_FORWARD_MAX 0xF
enum { CHOP_RFC=1, CHOP_OPN, CHOP_CLS, CHOP_FWD, CHOP_ANS, CHOP_SNS, CHOP_STS,
CHOP_RUT, CHOP_LOS... |
/* Editor Settings: expandtabs and use 4 spaces for indentation
* ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: *
* -*- mode: c, c-basic-offset: 4 -*- */
/*
* Copyright © BeyondTrust Software 2004 - 2019
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you m... |
/* invert.c
ACMI convergent inversion algorithm implementation. */
#include <time.h>
#include "acmi.h"
enum { MAX_RESTART_ITER = 2 };
/* Quickly computes ||I - AR0|| for R0 = alpha*I. */
static double traceErr(double alpha, Mat mA) {
return sqrt(MatN(mA) + 1 - 2*alpha*trace(mA));
}
/* Returns the number of mi... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <netinet/in.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include <time.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include <event2/event.h>
#include <... |
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pcap.h>
#include <err.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "pcap_layers.h"
#define XCMP(X,Y) (X<Y?-1:(... |
/* This is the UI for the calculator.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <termios.h>
#include "common.h"
#include "calculator.h"
#include "raw_stdin.h"
#include "ui.h"
/* This is the width of the calculator display window. */
#define CALC_DISPLAY_WINDOW_WIDTH... |
#include <stdlib.h>
#include <assert.h>
#include "universe.h"
#include "readwrite.h"
static uint32_t n_set, n_best;
static universe *best;
#define PRUNE(x) //printf x
static void recurse(universe *u, universe *init) {
// first of all, are there any cells we can determine immediately?
tile *t;
... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <myst/args.h>
#include <myst/eraise.h>
#include <myst/file.h>
#include <myst/fsgs.h>
#include <myst/json.h>
#include <myst/kernel.h>
#include <myst/printf.h>
#define APPENV_F... |
#include <sys/time.h>
#include <assert.h>
#include <string.h>
#include "ite/itu.h"
#include "itu_cfg.h"
#include "itu_private.h"
static const char aclkName[] = "ITUAnalogClock";
bool ituAnalogClockUpdate(ITUWidget* widget, ITUEvent ev, int arg1, int arg2, int arg3)
{
bool result;
ITUAnalogClock* aclk = (ITUA... |
/*
* Memory/banking implementation for ticks
*/
#include "ticks.h"
#include <stdio.h>
typedef uint8_t *(*memory_func)(int pc);
static void standard_init(void);
static uint8_t *standard_get_memory_addr(int pc);
static void zxn_init(void);
static uint8_t *zxn_get_memory_addr(int pc);
static void zxn_h... |
/*****************************************************************************/
/* */
/* fileinfo.c */
/* */
... |
#include <stdio.h>
#include <unistd.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/types.h>
#define _GNU_SOURCE
#include <getopt.h>
#include <iot/common/macros.h>
#include <iot/common/log.h>
#include <iot/utils/manifest.h>
#include <iot/utils/identity.h>
#include <iot/utils/appid.h>
typedef struct {
con... |
/********************************************************************
** Copyright (c) 2018-2020 <NAME>
** This file is part of the Berry default interpreter.
** <EMAIL>, https://github.com/Skiars/berry
** See Copyright Notice in the LICENSE file or at
** https://github.com/Skiars/berry/blob/master/LICENSE
************... |
/*
* Calculate and display Pascal's triangle.
*
* Copyright (C) 2005 <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 (at your option) any late... |
/*
* Copyright (C) 2016 Atmel Corporation
* Wenyou.Yang <<EMAIL>>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <clk-uclass.h>
#include <dm/device.h>
#include <linux/io.h>
#include <mach/at91_pmc.h>
#include "pmc.h"
DECLARE_GLOBAL_DATA_PTR;
#define GENERATED_SOURCE_MAX 6
#d... |
/* Copyright (c) 2009 <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, modify, merge, publi... |
/* IP85HI_Area - description
*
* Purpose: Read or write an area to the DeAnza display device.
*
* Written by: <NAME>
* Date: June 17, 1988
*
* Calling Sequence:
* STATUS = IP85HI_Area(Unit, lun, function,
* imp, size, area, buffer, mask)
*
* Parameter List:
* Unit: Display device unit number
... |
/**
* Copyright (c) Analog Devices Inc, 2020
* All Rights Reserved.
*
* @file usb.c
* @date 6/26/2020
* @author <NAME> (<EMAIL>)
* @brief Implementation file for iSensor-SPI-Buffer USB command line register interface
**/
#include "usb.h"
#include "reg.h"
#include "main.h"
#include "usbd_cdc_if.h"
#i... |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2020 <NAME> <<EMAIL>>
*
* Based on rpi_touchscreen.c by <NAME> <<EMAIL>>
*/
#include <linux/backlight.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#inclu... |
// A Squeak VM for RiscOS machines
// Suited to RISC OS > 4, preferably > 5
// See www.squeak.org for much more information
//
// <NAME> <EMAIL>
//
// License: MIT License -
// Copyright (C) <2013> <<NAME>>
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and asso... |
/***************************************************************************//**
* @file main.c
* @brief This project demonstrates use of the USART with interrupts.
*
* After initialization, the MCU goes into EM1 where the receive interrupt
* handler buffers incoming data until the reception of 80 characters or a
... |
// Graph ADT interface for Ass2 (COMP2521)
//Written By Jasdeep, Atharv & Pramith
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "Graph.h"
static int validVertex(Graph g, Vertex v);
//Graph Representation using Adjacency list representation
struct GraphRep{
int nVertices;
int nEdges;
AdjList... |
#include <string.h>
#include <assert.h>
#include <mpg123.h>
#include "replay.h"
#include "plugin.h"
#include "util.h"
#include "playlist.h"
int
in_mp3_init(plugin_obj *obj)
{
int r;
NEW_PLUGIN_OBJ(obj);
assert(obj != NULL);
if (mpg123_init() != MPG123_OK)
return REPLAY_ERR;
obj->data = mpg123_new(NULL, &r... |
/*
* Copyright (c) 2012-2016, Texas Instruments Incorporated
* 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 retain the above copyright
* n... |
/* Example of a code-generator for an Intel 386 or higher. */
#include "dt.h"
/* We have extended types! What we have to do to support them: */
/* - #define HAVE_EXT_TYPES
- #undef all standard types
- #define all standard types plus new types
- write eval_const and insert_const
- write type... |
/*
* OLED.c
*
* Created: 2017-02-11 22:09:20
* Author: Atomic
*/
#include <stdlib.h>
#include "u8g/u8g.h"
#include "main.h"
#include "OLED.h"
u8g_t oled_display;
#define U8G_WITH_PINLIST
uint8_t OLED_Init(void){
// Setting transfer speed
// CLKPR = 0x80;
// CLKPR = 0x00;
// Initialize I2C an... |
#include <string.h>
#include <stdlib.h>
#include "numbers.h"
#include "expressions.h"
#include "operations.h"
#include "environment.h"
lval* builtin_op(lenv* e, lval* v, char* sym);
lval* lval_sym(char* s) {
lval* v = (lval *) malloc(sizeof(lval));
v->type = LVAL_SYM;
v->data.sym = (char *) malloc(strlen(s) + 1);
... |
/* --
*
* MIT License
*
* Copyright (c) 2018 <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, m... |
///
/// @file
///
/// @brief
///
/// @author <NAME> (<EMAIL>), Umeå University
///
/// @internal LICENSE
///
/// Copyright (c) 2019-2020, Umeå Universitet
///
/// Redistribution and use in source and binary forms, with or without
/// modification, are permitted provided that the following conditions are met:
///
/// 1.... |
/*s: libc/fmt/fmt.c */
#include <u.h>
#include <libc.h>
#include "fmtdef.h"
/*s: enum [[_anon_ (fmt/fmt.c)]] */
enum
{
Maxfmt = 64
};
/*e: enum [[_anon_ (fmt/fmt.c)]] */
typedef struct Convfmt Convfmt;
/*s: struct [[Convfmt]] */
struct Convfmt
{
int c;
volatile Fmts fmt; /* for spin lock in fmtfm... |
/**********************************************************************************
Avatar Tools
Copyright (c) 2019, National Technology and Engineering Solutions of Sandia, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the foll... |
#include "mailbox_utilities.h"
#include <stdlib.h>
#include <applibs/application.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <applibs/log.h>
#include <string.h>
#include "eventloop_timer_utilities.h"
#include <pthread.h>
#include "common.h"
#define COMMAND_BYTE 0
#define MQTT_CONFIG_LO... |
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "mat3.h"
mat3* new_mat3() {
mat3* m = calloc(1, sizeof(mat3));
if (m == NULL) {
return NULL;
}
m->m[0][0] = 1.0;
m->m[1][1] = 1.0;
m->m[2][2] = 1.0;
return m;
}
void free_m... |
/***********************************************************
Copyright (c) 1987 X Consortium
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... |
/*
* Copyright (c) 2000-2017 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file exc... |
// Multiprocessor support
// Search memory for MP description structures.
// http://developer.intel.com/design/pentium/datashts/24201606.pdf
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "mp.h"
#include "x86.h"
#include "mmu.h"
#include "proc.h"
struct cpu cpus[NCPU];
static ... |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include <stdio.h>
#include <stdlib.h>
#include "iothub_client.h"
#include "iothub_message.h"
#include "azure_c_shared_utility/threadapi.h"
#include "azure_c_shared_uti... |
/*
* GStreamer
* Copyright (C) 2010 <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, modi... |
#include <stdio.h>
#include <stdlib.h>
#include "http_parser.h"
#include "http_writer.h"
#include "http_server.h"
#include "game.h"
// Our Model
static GM_GamePool *game;
void generateGameSession(char *session, size_t len) {
const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP... |
/****************************************************************************
* apps/examples/bridge/host_main.c
*
* 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 ... |
/*
* estimbreakout.c
*
* Created: 6/4/2019 1:07:39 PM
* Author : raster
*/
#include <avr/io.h>
#include "addr_table.h"
#define F_CPU 20000000L // CPUclock speed 20MHz
#define F_CLKPER 6 // MCLKCTRLB.PDIV Prescaler Division
#define T_RISE 300 // T_rise electrical characteristic max ns
#define F_BAUD 400000L ... |
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> ... |
#include "common.h"
#include <stdio.h>
#include <math.h>
#include "beep.h"
#include "battery.h"
#include "motor.h"
#include "watchdog.h"
#include "led.h"
#include "sonar.h"
#include "mpu6050.h"
#include "inv_mpu.h"
#include "filters.h"
#include "protocol.h"
#define PI 3.14159265358979f
#define fastAbs(n... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
unsigned char *convert_to_hex(const unsigned char *tags, size_t *len)
{
//char *p = &tags[0];
size_t c = 0;
size_t emvlen = *len;
static unsigned char p[255+1];
unsigned char fb;
unsigned char sb;
for(int... |
/*
This file is a part of PIC16F1454 firmware used on the SpiderSoM and
MX10 System-on-Modules. Please, refer to http://www.spiderboard.org/
and http://www.aries-embedded.de/?q=MX10
Copyright (C) 2018 ARIES Embedded GmbH
Based on:
example minimal CDC serial port adapter using PIC16F1454 microcontroller
this... |
#include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#define clear() printf("\033[H\033[J")
pthread_t ptidTracker;
void clearStdin(){
int c;
while ((c = getchar()) != '\n' && c != EOF);
}//end clearStdin
void* trackAndKill() {
FILE *fp;
int pids[50... |
/*
* Commands to the keyboard processor
*/
#define LK_PARAM 0x80 /* start/end parameter list */
#define LK_CMD_RESUME 0x8b /* resume transmission to the host */
#define LK_CMD_INHIBIT 0x89 /* stop transmission to the host */
#define LK_CMD_LEDS_ON 0x13 /* light LEDs */
/* 1st param: led bitmask */
#define ... |
/*
* Driver for DS1307 RTC
*
* Part of esp-open-rtos
* Copyright (C) 2016 <NAME> <<EMAIL>>
* BSD Licensed as described in the file LICENSE
*/
#include "ds1307.h"
#include <i2c/i2c.h>
#include <stdio.h>
#define ADDR 0x68
#define RAM_SIZE 56
#define TIME_REG 0
#define CONTROL_REG 7
#define RAM_REG 8
#defi... |
#include <stdbool.h> /* for bool */
#include <stdio.h>
#include <stdlib.h> /* for malloc */
#include <string.h> /* for strrchr */
#include <sys/stat.h>
#include "common.h"
#include "conf.h"
#include "input-args.h"
#include "keylog.h"
static const char usage_str[] =
"usage: keyloggerd [-h | --help] [--debug... |
/* magscrolls.c Treaty of Babel module for Z-code files
* 2006 By <NAME>
*
* This file depends on treaty_builder.h
*
* This file is public domain, but note that any changes to this file
* may render it noncompliant with the Treaty of Babel
*/
#define FORMAT magscrolls
#define HOME_PAGE "http://www.if-legends.o... |
/*
* tbstack -- fast stack trace utility
*
* Copyright (c) 2014, Tbricks AB
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above ... |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus - si_controller.c *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Copyright (C) 2014 <NAME> *
* ... |
/* Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>
#include <sys/types.h>
#include "main.h"
#include "ion_error.h"
#include "ion_alloc.h"
#include "ion_util.h"
#include "wells_header.h"
#include "well... |
#include <stdio.h>
#include <math.h>
double logistic_regression_response (double linear_combination) {
return 1.0 / (1.0 + exp(-linear_combination));
}
double calculate_linear_combination (double first_part[], double second_part[], int combination_length) {
double result = 0.0;
for (int i = 0; i < combina... |
#include <pcap.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define SIZE_ETHERNET 14
#define ETHER_ADDR_LEN 6
void got_packet(u_char *args, const struct pcap_pkthdr *hea... |
/*******************************************************************************
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to d... |
#include "OPF.h"
void opf_OPFClassifyingScore(Subgraph *sgtrain, Subgraph *sg, float **minLabel)
{
int i, j, k, l, p, label = -1;
float tmp, weight, minCost, sumCost;
int nlabels = sgtrain->nlabels;
//matrix to store scores for each object and class
//float **minLabel = (float **) calloc(sg->nnodes, ... |
/*$
Copyright (c) 2014-2017, Azel
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 retain the above copyright
notice, this list of conditions and the follow... |
/*
Write a program to check a C program for rudimentary syntax errors like
unbalanced parenthesis, brackets and braces. Don't forget about quotes,
both single and double, escape sequences and comments. (This program is
hard if you do it in full generality.)
*/
/*
I hope this:
1. Only uses features from Chapter 1... |
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
// Structures for functions
struct struct_fibonacci {
float param1;
};
struct struct_pow {
float param1;
};
struct struct_operation {
float param1;
float param2;
float param3;
float param4;
};
//Global Variable... |
//
// Created by 17616 on 2020/3/23.
//
#include "sc_i2c.h"
/****************************************************
* @note: 常用的通用API为:
* I2C_Init : 初始化函数
* I2C_Read : 读函数
* I2C_Write : 写函数
*
* 其他的不是通用函数
* *************************************************... |
/*
Copyright (C) <2010> <<NAME> and <NAME>>
This file is part of IFT-demo.
IFT-demo 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 3 of the License, or
(at your option) an... |
/*
------------------------------------------------------------------------------
isaac64.c: My random number generator for 64-bit machines.
By <NAME>, 1996. Public Domain.
------------------------------------------------------------------------------
*/
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#incl... |
/** WAVE input/output, RAW input.
Copyright (c) 2015 <NAME> */
#include <fmedia.h>
#include <avpack/wav-read.h>
#include <FF/audio/pcm.h>
#include <FF/mtags/mmtag.h>
extern const fmed_core *core;
#define errlog1(trk, ...) fmed_errlog(core, trk, NULL, __VA_ARGS__)
#define warnlog1(trk, ...) fmed_warnlog(core, trk,... |
/*
* Copyright (c) 2004 <NAME> <<EMAIL>>
* 2004 Open Source Development Lab
*
* Copyright (c) 2004 <NAME> <<EMAIL>>
*
* Copyright (c) 2011 <NAME> <<EMAIL>>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License ... |
/***********************************************************************
*************************mag3110_test**********************************
***********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#in... |
/* Name:
* Date:
* Section:
* Submission Code: Game of Thrones
* */
#include<stdio.h>
#include<float.h>
#include<limits.h>
#include<string.h>
#define PROGRAM_NAME_IDX 0
#define INPUT_FILENAME_IDX 1
#define PROJECTION_FILENAME_IDX 2
#define OUTPUT_FILENAME_IDX 3
#define MAX_PLAYER_COUNT 8
#define MAX_PLAYER_LEN 2... |
#include "common.h"
extern u32 __pagetables[];
extern char __kmem_start[];
extern char __load_addr[];
extern char __devmem_addr[];
extern char __devmem_size[];
extern char __lma_code[];
extern char __lma_code_size[];
extern char __lma_rodata_size[];
extern char __lma_data_size[];
#define MEGABYTE 0x100000
#define... |
/**************************************************************************
*
* Copyright 2003 <NAME>, Inc., <NAME>, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal i... |
/**
* This is the demo code for our lab-01.
* @author <NAME>
* @email: <EMAIL>
*
* Instructions:
* (1) Implement the bubble sort and the quicksort algorithm.
* (2) Do the following 10 times:
* (a) Generate a random list of 100 items.
* (b) Have each algorithm (bubble sort and quicksort) sort the list... |
#pragma strict_types
#include "../def.h"
inherit MASTER_ROOM;
void create_object(void);
void reset(int arg);
void init(void);
int do_break(string str);
string long_fun(void);
void construction_desc(void);
void rack_desc(void);
void damage_desc(void);
int rack_destroyed,rack_hp;
void create_object(void... |
#include <pebble.h>
static Window *s_main_window;
static Layer *layer;
static GPoint *ellipsePoints;
static GPathInfo *ellipse;
static GPath *my_path = NULL;
static char *line1[] = {
"sgeorgia", "london",
"cairo"
};
static char *line2[] = {
"rio", "azores",
"paris", "moscow"
... |
#include "Number.h"
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <time.h>
#include <signal.h>
#define FAIL(...) { fprintf(stderr, __VA_ARGS__); exit(EXIT_FAILURE); }
// If the system has requested that the program be stopped
static volatile bool StopRequested = false;
// Handles a signal re... |
/*
* Copyright (C) 1997 Massachusetts Institute of Technology
*
* This software is being provided by the copyright holders under the
* following license. By obtaining, using and/or copying this software,
* you agree that you have read, understood, and will comply with the
* following terms and conditions:
*
*... |
/**
* Copyright © 2009 Red Hat, Inc.
*
* 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, pu... |
#include <stdbool.h>
#include "shared_context.h"
#include "apdu_constants.h"
#include "utils.h"
#include "ui_flow.h"
static const char SIGN_MAGIC[] =
"\x19"
"Ethereum Signed Message:\n";
/**
* Check if a given character is a "special" displayable ASCII character
*
* @param[in] c character we're checking
*... |
/*
* Copyright 2004, 2005, 2006 PathScale, Inc. All Rights Reserved.
*/
/* Code to implement F2003 intrinsics related to command line */
#include <string.h>
#include <alloca.h>
#include <stdlib.h>
#include "pathf90_libU_intrin.h"
#include "externals.h"
#define C_IFY(name, name_len, notrim) \
c_ify(alloca((name_... |
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "zdtmtst.h"
const char *test_doc = "Check dumpable flag handling (non-dumpable case)";
const char *test_author = "<NAM... |
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <moss.h>
mt_function* mf_new_function(unsigned char* address);
mt_tuple* mf_raw_tuple(long size);
#define mv_rand_state 100
static uint32_t kx = 123456789;
static uint32_t ky = 234567891;
static uint32_t kz = 345678912;
static uint32_t kw = 456789123... |
/* This is a managed file. Do not delete this comment. */
#include <corto.x>
static
char* x_pattern_parseElement(
x_pattern this,
char *str,
ut_strbuf *regex,
corto_object scope)
{
char *ptr = str, ch;
corto_bool implicitName = FALSE;
corto_id id1, id2;
char *idPtr = id1;
char *ele... |
/*************************************************************************//**
* @file main.c
* @version V1.00
* @brief Demonstrate the usage of Ethernet time stamp function.
* It sets current time to 1000 second and prints out
* current time every second. It also sets an alarm at
* ... |
/* Do not change! */
#define FUSE_USE_VERSION 29
#define _FILE_OFFSET_BITS 64
/******************/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <fuse.h>
#include <errno.h>
#include <stdlib.h>
#include <assert.h>
#include "myfilesystem.h"
char * file... |
#include "epm_bin_access.h"
#include <stdlib.h>
#include <errno.h>
#include <math.h>
#include <string.h>
#define MAX_NCOEF 20
#ifdef _WIN32
#define snprintf _snprintf
#define strcasecmp _stricmp
#endif
EpmFile * epm_file_open (const char *filename)
{
EpmFile *epmf = (EpmFile *)malloc(sizeof(EpmFile));
if (epmf... |
/*
* $Id: Udp.c 879 2008-11-04 08:07:44Z takaya $
* Copyright (C) 2008 AIST, National Institute of Advanced Industrial Science and Technology
*/
#include "Udp.h"
#include "Emac.h"
#include "Arp.h"
#include "CheckSum.h"
#include "Orbe.h"
#include <string.h>
#include <stdio.h>
static All_header send_hea... |
/*
* © Copyright 2018 <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, distr... |
#include "MPLn23d.h"
void MP_Neigh3dInit(MP_Neigh3dData *data)
{
data->link_max = 0;
data->link_top_max = 0;
}
void MP_Neigh3dFree(MP_Neigh3dData *data)
{
free(data->link);
free(data->link_top);
}
int MP_Neigh3dDivide(MP_Neigh3dData *data, double rcut,
int num, double size[], double x[], double y[], double z[])... |
/*
* Copyright 2014-2021 Jetperch LLC
*
* 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 agre... |
/*
* baby_steps.c
* $Id: baby_steps.c 14056 2006-01-09 15:06:32Z dts12 $
*/
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include <net-snmp/agent/baby_steps.h>
#if HAVE_DMALLOC_H
#include <dmalloc.h>
#endif
#define BABY_STEPS_PER... |
// 马青公式
/*一个计算π的c程序
======================================
由于大多数计算机内置算法有一定精度限制,你想计算那么多位就会产生问题。
这里有一个c程序,允许计算要多少有多少。但马青公式在试图计算亿位时不理想。
下面就是这个程序。超过万位时此程序就不能胜任了。而J<NAME>的程序可算到10万位!
目前最快的方法是Chudnovsky、Ramanujan和金田康正的高斯-勒让德算法。
*/
///////////////////////////////////////////////////////////////////////////
/******... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.