text stringlengths 3.08k 10.5k |
|---|
/******************************************************************************
*
* Copyright 2017 Xaptum, 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
*
* h... |
/*BEGIN_LEGAL
Copyright (c) 2018 Intel Corporation
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 a... |
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 <NAME> / <NAME>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as ... |
#include <stdio.h>
#include <stdlib.h>
#include "include/dataset.h"
// Makes sure the integers are read acording to the endianness
// of the system
uint32_t map_uint32(uint32_t in) {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return (
((in & 0xFF000000) >> 24) |
((in & 0x00FF0000) >> 8) |
((in & 0... |
/* 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, merge, publish, distri... |
/*
* Copyright 2012 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, publish, d... |
#include "isr.h"
#include "idt.h"
#include "ports.h"
#include "libc/stdio.h"
isr_t interrupt_handlers[256];
/* Can't do this with a loop because we need the address
* of the function names */
void InstallISR()
{
SetIDTGate(0, IDT_TA_InterruptGate, (uint64_t)isr0);
SetIDTGate(1, IDT_TA_InterruptGate, (uint64... |
// SPDX-License-Identifier: BSD-2-Clause
//
// Copyright (c) 2016-2019, NetApp, Inc.
// 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 abo... |
/* dweis003_prodr010_lab2_part1.c - [10/5/17]
* Partner(s) Name & E-mail:<NAME> <EMAIL>
* <NAME> <EMAIL>
* Lab Section: 022
* Assignment: Lab #2 Exercise #1
* Exercise Description:
*
* I acknowledge all content contained herein, excluding template or example
* code, is my own original work.
*/
#include <avr/io... |
/*******************************************************************************
*
* Copyright (C) 2014-2018 Wave Computing, Inc.
*
* 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 c... |
/* edwWebDeprecate - A cgi script to mark files as deprecated.. */
/* Copyright (C) 2014 The Regents of the University of California
* See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
#include "common.h"
#include "obscure.h"
#include "linefile.h"
#include "hash.h"
#include "options.h... |
/*
* Copyright (C) 2012 <NAME> <<EMAIL>>
* Copyright (C) 2008 <NAME> <<EMAIL>>
*
* 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... |
/******************************************************************************
* Copyright (c) 2018 - 2020 Xilinx, Inc. All rights reserved.
* SPDX-License-Identifier: MIT
******************************************************************************/
#include "xil_io.h"
#include "xpm_common.h"
#include "xpm_regs.... |
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/types.h>
#include <signal.h>
#define MAX 10240
#define PORT 8080
#define path "ess_socket4"
... |
/*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
** **
** This file forms part of the Underworld geophysics modelling application. **
** ... |
#include "lanzalloc.h"
struct unit {
unsigned int size; // If size == 0, it is a unused unit.
void* address; // If address == 0, it is a free unit.
};
struct lanzalloc {
unsigned int unitMax;
void* pool;
unsigned int poolSize;
struct unit* units;
};
// Defragment
static int lanzalloc_defragment(struct lanzallo... |
/***************************************************************************//**
* @file main_gg11_tg11.c
* @brief This project shows how to configure the LEUART for using DMA to write
* and read to the LEUART transmit/receive registers while remaining in EM2.
* This example receives input from the serial terminal ... |
/*
WinCtl - control windows under Windows 9x/Windows NT
Copyright (C) 1999 <NAME> (<EMAIL>)
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
... |
#include <mysql.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void exit_mysql_err(MYSQL *mysql) {
const char *err = mysql_error(mysql);
if (err) {
fprintf(stderr, "019_populate_node_tags_and_remove_helper: MySQL error: %s\n", err);
} else {
fprintf(stderr, "019_... |
/**
Copyright (c) 2020 <NAME>. All rights reserved.
Licensed under the MIT License.
See LICENSE file in the project root for full license information.
*/
#include "encdec.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "../vtenc.h"
static size_t type_size8() { return... |
/*
* The software for the x0xb0x is available for use in accordance with the
* following open source license (MIT License). For more information about
* OS licensing, please visit -> http://www.opensource.org/
*
* For more information about the x0xb0x project, please visit
* -> http://www.ladyada.net/make/x... |
#include "Python.h"
#include "datetime.h"
void py_init_python()
{
/* sometimes Python needs to know about argc and argv to be happy */
int _python_argc = 1;
wchar_t* _python_argv[] = {
L"python",
};
Py_SetProgramName(L"python");
Py_Initialize();
PySys_SetArgv(_python_argc, _python... |
#include "sparse_formats.h"
#include "common_rand.h"
int unsigned_int_comparator(const void* v1, const void* v2) {
const unsigned int int1 = *((unsigned int*) v1);
const unsigned int int2 = *((unsigned int*) v2);
if(int1 < int2)
return -1;
else if(int1 > int2)
return +1;
else
... |
/*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* ... |
//
// Created by YthanZhang on 2021/12/27.
//
/*******************************************************************************
* Copyright 2021 <NAME>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistr... |
/*
* Copyright (C) 2006 Nokia Corporation.
* Author: <NAME> <<EMAIL>>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope tha... |
/**
* @file ndnr_main.c
*
* Part of ndnr - NDNx Repository Daemon.
*
*/
/*
* Portions Copyright (C) 2013 Regents of the University of California.
*
* Based on the CCNx C Library by PARC.
* Copyright (C) 2009-2013 Palo Alto Research Center, Inc.
*
* This work is free software; you can redistribute it and/... |
#include <stdio.h>
#include <stdlib.h>
#include "list.h"
#include "graph.h"
graph* initGraph(void) {
graph* g;
g = (graph*) malloc(sizeof(graph));
g->vertices = initList();
g->edges = initList();
return g;
}
void eraseGraph(graph* g) {
eraseList(g->edges, g->edges->head);
eraseLi... |
#include <stdio.h>
#include <string.h>
#include "tree.h"
void ep_tree_alloc(struct ep_tree *t, size_t elemsize, size_t maxnodes) {
size_t link_alloc = sizeof(int) * maxnodes;
size_t elem_alloc = elemsize * maxnodes;
size_t total_alloc = link_alloc + elem_alloc;
char *mem = malloc(total_alloc);
t-... |
/*
* Copyright (c) 2022 micro framework workers, All rights reserved.
*
* Terms for redistribution and use can be found in LICENCE.
*/
/**
* @file shell-addons.c
* @brief Zephyr System Shell extensions
*/
#include <init.h>
#include <shell/shell.h>
#include <stdbool.h>
#include <zephyr.h>
#include <stdarg.h>
#... |
#include <passion.h>
#include <math.h>
enum ps_status ps_matrix_3_set_identity(struct ps_matrix_3 *this)
{
PS_CHECK(this, PS_STATUS_INVALID_ARGUMENT);
memset(&this->data, 0, sizeof(float) * PS_MATRIX_3_SIZE);
this->data[0] = 1.0f;
this->data[4] = 1.0f;
this->data[8] = 1.0f;
... |
#ifndef DDEBUG
#define DDEBUG 0
#endif
#include "ddebug.h"
#include "ngx_http_rds_json_handler.h"
#include "ngx_http_rds_json_util.h"
ngx_int_t
ngx_http_rds_json_ret_handler(ngx_http_request_t *r)
{
ngx_chain_t *cl;
ngx_buf_t *b;
size_t ... |
/*************************************************************************/
/* */
/* Copyright (c) 1994 Stanford University */
/* */
/* ... |
/*
* Copyright (c) 2014-2015,2019 <NAME>. 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 copyright
* notice, this list of cond... |
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <signal.h>
#include <stdlib.h>
#include <gps.h>
#include <wiringPi.h>
#include "compass.h"
#include "motor.h"
#include "mitibiki.h"
#include "ring_buffer.h"
#include "pid.h"
#include "acclgyro.h"
#include "xbee_at.h"
static const int GPS_RING_LEN = 10;//g... |
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2017-2018 <NAME> <<EMAIL>>
*/
#include <common.h>
#include <div64.h>
#include <dm.h>
#include <pwm.h>
#include <regmap.h>
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch/pwm.h>
#include <asm/arch/gpio.h>
#include <power/regulator.h>
DECLARE_GLOBAL_D... |
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
#include "kann.h"
#include "kann_extra/kann_data.h"
static kann_t *model_gen(int n_in, int n_out, int loss_type, int n_h_layers, int n_h_neurons, float h_dropout)
{
int i;
kad_node_t *t;
t = kann_layer_input(n_in);
for (i = 0; i < n_h_l... |
#include "utf_8.h"
#define READ_1_BYTE 1
#define READ_2_BYTE 2
#define READ_3_BYTE 3
#define READ_4_BYTE 4
#define READ_ERROR -1
int utf_8_error_code = 0;
uint utf_8_error_byte = 0;
static const uint byte_1_flag = 128;
static const uint byte_2_flag = 128+64+32;
static const uint byte_3_flag = 128+64+32+16;
static co... |
#include <lua.h>
#include <lauxlib.h>
#include <stdlib.h>
#include <stdio.h>
#if LUA_VERSION_NUM < 502
# ifndef luaL_newlib
# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
# endif
#endif
#define pushfstring(buf, sz, e, fmt, ...) do{if(sz-e > 0) e+=snprintf(buf+e, sz-e, fmt, ##__VA_ARGS__);}while... |
int CHORD_C[] = {0, NOTE_C3, NOTE_E3, NOTE_G3, NOTE_C4, NOTE_E4};
int CHORD_C7[] = {0, NOTE_C3, NOTE_E3, NOTE_Bb3, NOTE_C4, NOTE_E4};
int CHORD_Cm[] = {0, NOTE_C3, NOTE_G3, NOTE_C4, NOTE_Eb4, NOTE_G4};
int CHORD_Cmaj7[] = {0, NOTE_C3, NOTE_E3, NOTE_B3, NOTE_C4, NOTE_E4};
int CHORD_Cm6_Eb[] = {NOTE_Eb2, NOTE_A2, NOTE_Eb... |
/**
* Copyright (C) 2013-2015 Netronome Systems, Inc. All rights reserved.
*
* @file nfp_emem.c
* @brief Set internal memory either from a file or from a static value
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <nfp.h>
#define EMU0_ISLAND 24
#define EMU... |
/*
Copyright (c) 2012, Broadcom Europe Ltd
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 t... |
/*
* Copyright 2014 <NAME>
*
* 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 following disclaimer.
*
*... |
/**
* \file
*
* \brief Common NVM service example
*
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
*
* \asf_license_start
*
* \page License
*
* Subject to your compliance with these terms, you may use Microchip
* software and any derivatives exclusively with Microchip products.
*... |
/*
* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
* disclaimer below) provided that the following conditions are met:
*
* * Redistributions of source ... |
/*
* Trivial malloc() implementation
*
* Inspired by K&R2 malloc() and <NAME> malloc().
*/
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#include <assert.h>
#include <stdint.h>
/*
* the chunk header
*/
typedef uint64_t ALIGN;
typedef union CHUNK_TAG
{
struct
{
uint32_t l; /* ... |
/* readclock - manipulate the hardware real time clock */
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <lib.h>
#include <minix/type.h>
#include <minix/const.h>
#include <minix/callnr.h>
#include <minix/log.h>
#include <minix/syslib.h>
#... |
/*
* Author: <NAME>, Finland 2011-2019
*
* This file is part of Kunquat.
*
* CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
*
* To the extent possible under law, Kunquat Affirmers have waived all
* copyright and related or neighboring rights to Kunquat.
*/
#include <player/events/note... |
/*
* scorefile.c: Rog-O-Matic XIV (CMU) Tue Mar 19 21:46:11 1985 - mlm
* Copyright (C) 1985 by <NAME>, <NAME>, <NAME>, and <NAME>
*
* This file contains the functions which update the rogomatic scorefile,
* which lives in <RGMDIR>/rgmscore<versionstr>. LOCKFILE is used to
* prevent simultaneous accesses to the fi... |
/* setgrp.c - by <NAME>. Set the gid if possible
* Added a bit more error recovery/reporting - poe
* <NAME> added code for asking password */
/* 1999-02-22 <NAME> <<EMAIL>>
* - added Native Language Support
*/
#include <errno.h>
#include <getopt.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <st... |
/*
* This file implements the haircell model described in [Dau et al., 1996]
* as a C function, to be incorporated into MATLAB as a MEX function.
*
* Only the real values are used for calculation, the imaginary parts are
* discarded.
*
* filename : haircell.c
* copyright: Universitaet Oldenburg, c/o Prof. <NAM... |
#include "types.h"
#include "stat.h"
#include "user.h"
char *instructions =
"\ntester [int][number of processes] [int][arrival delay] [int][number of runs]\n\n\
arrival time may have additional delay until the tester gets rescheduled to fork the next process\n\
number of proccess must be in range 1 <= number of pr... |
/*-
* SPDX-License-Identifier: BSD-4-Clause
*
* Copyright (c) 2010
* <NAME> <<EMAIL>>.
* 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 t... |
#include <sys/time.h>
#include <time.h>
#include "libfirm/firm.h"
#include "lib/resolve.h"
#include "lib/types.h"
#include "lib/convert.h"
#include "cmdline/options.h"
#include "cmdline/help.h"
#define LINK_COMMAND "grep -vE '(\\.type|\\.size)' a.s > a.S && cc -m32 a.S"
int nostats = 0;
static void initial... |
#include "proto.h"
#include "libusc_mrcp.h"
#include <pthread.h>
#define CMP(p, s) strncmp(p, s, sizeof(s) - 1)
#define SKIP_FUN(p) (4 + ntohl(*(uint32_t *)(p)))
static HANDLE_MRCPINTF user_asr = -1;
#define ASR_INIT "usc_mrcp_asr_init"
#define ASR_DESTROY "usc_mrcp_asr_destroy"
#define SERVICE_INIT "usc_mrcp_servic... |
/* driver for hybrj example. */
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <cminpack.h>
#define real __cminpack_real__
#ifdef BOX_CONSTRAINTS
typedef struct {
real *xmin;
real *xmax;
} fcndata_t;
#endif
int fcn(void *p, int n, const real *x, real *fvec, real *fjac, int ldfjac,
... |
/***
Methods for fast string operations
@license MIT/X11
@module stringy
*/
#define LUA_LIB
#include <lua.h>
#include <lauxlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <ctype.h>
#include "fastsearch.h"
#if LUA_VERSION_NUM < 502
# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,... |
/************************************************************************************
***
*** Copyright 2020 Dell(<EMAIL>), All Rights Reserved.
***
*** File Author: Dell, 2020-11-22 13:18:11
***
************************************************************************************/
#include <stdio.h>
#include <unistd.h... |
#include <naiveConsole.h>
static uint32_t uintToBase(uint64_t value, char * buffer, uint32_t base);
static char buffer[64] = { '0' };
static uint8_t * const video = (uint8_t*)0xB8000;
static const uint32_t width = 80;
static const uint32_t height = 25;
static uint8_t * currentVideo = (uint8_t*)0xB8000;
// Ca... |
#include <IOKit/hid/IOHIDManager.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gamepad.h"
struct gamepad_device {
char name[1024];
IOHIDDeviceRef device;
struct gamepad_device* next;
};
struct gamepad_context {
IOHIDManagerRef hid_manager;
void (*callback)(int type, int p... |
/*
Copyright (c) 2017-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, distribut... |
#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
#include <ntddser.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <malloc.h>
#include <rasman.h>
#include <dim.h>
#include <routprot.h>
#include <ipxrtdef.h>
// [pmay] this will no longer be neccessar... |
/* BSD Socket API Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <string.h... |
TK_MOUNT *tk_fat_mount(char *devfn, char *mntfn,
char *fsty, char *mode, char **opts);
TK_FILE *tk_fat_fopen(TK_MOUNT *mnt, char *name, char *mode);
int tk_fat_fread(void *buf, int sz1, int sz2, TK_FILE *fd);
int tk_fat_fwrite(void *buf, int sz1, int sz2, TK_FILE *fd);
int tk_fat_fseek(TK_FILE *fd, int ofs, int rel);... |
/*
* repo_zyppdb.c
*
* Parses legacy /var/lib/zypp/db/products/... files.
* They are old (pre Code11) product descriptions. See bnc#429177
*
* Copyright (c) 2008, Novell Inc.
*
* This program is licensed under the BSD license, read LICENSE.BSD
* for further information
*/
#include <sys/types.h>
#include <sys... |
//
// BSD 3-Clause License
//
// Copyright (c) 2020, <NAME>
// 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 abov... |
// lazyNES bubbles demo
#include "lazynes.h"
enum {
F=3, // pseudo floating point shift value
maxDrawObjects=42, // 21 bigBubbles + 21 smallBubbles + spr0
dfAlive=1
};
typedef struct {
ubyte
f, // flags
s; // sprite image offset into bubbles[] table
word
x, y; // coordinates (shifted)
byte
vx, vy, /... |
/** @file
* Copyright (c) 2016-2018,2021 Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
* 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
*
* ... |
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <ctype.h>
#include "tinyber.h"
#define CHECK(x) do { if ((x) == -1) { return -1; } } while (0)
int
decode_structured (const asn1raw_t * src, asn1raw_t * dst, int * n)
{
// create a buffer to iterate through the encoded data
buf_t src0;
init... |
#include <GL/glew.h>
#include <string.h>
#include <stdio.h>
#include "window.h"
void window_resize(Window *window, int width, int height) {
printf("resize: %dx%d\n", width, height);
window->width = width;
window->height = height;
window->aspect_ratio = (double)width / (double)height;
if (window->chart != N... |
/**
F64 TO CSV
*/
#define __STDC_WANT_IEC_60559_BFP_EXT__ // strfromd()
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "util.h"
const int buffer_size = 64;
static void usage(void);
static ... |
#define R_NO_REMAP
#include <R.h>
#include <Rinternals.h>
#include "read-rdi-common.h"
// A wrapper around the file handle and any options passed in
// from R. This is needed for R_ExecWithCleanup() but is also a
// nice abstraction around the file types
typedef struct {
FILE* handle;
long offset;
R_xlen_... |
/*
Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2000-Apr-09 or later
(the contents of which are also included in unzip.h) for terms of use.
If, for some reason, all these files are missing, the Info-ZIP license
also may be found at: ftp://ftp.info-zip.or... |
/******************************
* <NAME> 2006/0395
* Multiprocesorski sistemi
* domaci zadatak 5 - 5. zadatak
*******************************/
/**
* 5. Sastaviti program koji u nizu kompleksnih brojeva pronalazi broj sa najvecom apsolutnom vrednoscu.
* Kompleksni broj je predstavljen sa dva realna broja i jednim... |
static inline int num_120Hz_steps( double elapsed )
{
// Our simulation frequency is 120Hz, an 8⅓ (eight one third) ms period.
double e = 1 / 120.0;
// We will pretend our display sync rate is one of thse:
if ( elapsed > 4.5 * e )
return 5; // 24 Hz ( .. to 26.67 Hz )
else if ( elapsed > 3.5 * e )
re... |
/*
opml.c -- OPML add-on to LaTeX writer
(c) 2013-2015 <NAME> (http://fletcherpenney.net/).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License or the MIT
license. See LICENSE for details.
This program is distributed in the hope that it w... |
// Copyright 2011 The Avalon Project Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0
// that can be found in the LICENSE file.
#include "linebuffer.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int lb_pending(struct LineBuffer* lb) { r... |
/* testFC_M() */
/* Rip_FC_M() */
/* Depack_FC_M() */
#include "globals.h"
#include "extern.h"
int16_t testFC_M ( void )
{
/* test 1 */
PW_Start_Address = PW_i;
if ( in_data[PW_Start_Address + 4] != 0x01 )
{
return BAD;
}
/* test 2 */
if ( in_data[PW_Start_Address + 5] != 0x00 )
{
return BA... |
/**
* Author: <NAME> (<EMAIL>)
* <NAME> (<EMAIL>)
* Date: Jan 2016
* Description: EZR32WG-specific definition of the "radio" bsp module.
*/
#include "board.h"
#include "radio.h"
#include "leds.h"
#include "stdio.h"
#include "string.h"
#include "radiotimer.h"
#include "debugpins.h"
//===================... |
/*
PsychToolbox3/Source/Common/WaitSecs/WaitSecs.c
PLATFORMS:
All.
AUTHORS:
<NAME> awi <EMAIL>
<NAME> mk <EMAIL>
HISTORY:
1/20/02 awi wrote it.
4/6/05 awi Use mach_wait_until() instead of looping. Mario's suggestion.
4/7/05 awi Relocate mach_wait_until() call within PsychWaitInt... |
/*********************************************************************
* Author : <NAME>
* E-mail : <EMAIL>
----------------------------- MIT License ----------------------------
* MIT License
*
* Copyright (c) 2020 <NAME>
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obta... |
#include <fractals.h>
#include <syscalls.h>
//Fuente: http://www.splinter.com.au/converting-hsv-to-rgb-colour-using-c
static void HsvToRgb(unsigned char *r, unsigned char *g, unsigned char *b, unsigned char h, unsigned char s, unsigned char v);
//Fuente: http://warp.povusers.org/Mandelbrot/
void mandelbrot(int iter, ... |
/*
* Copyright (C) 2018-2020 Alibaba Group Holding Limited
*/
#include "avfilter/avfilter_swr.h"
#include "avfilter/avfilter_atempo2.h"
#define TAG "filter_atempo2"
struct avfilter_atempo2 {
struct avfilter f;
sf_t sf;
avfilter_t *avfc; ... |
/***************************************************************************
* Copyright (C) 2009 <NAME> <<EMAIL>> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU... |
#include "hyperll.h"
#include "register_set.h"
extern VALUE rb_mHyperll;
VALUE rb_cRegisterSet;
const int LOG2_BITS_PER_WORD = 6;
const int REGISTER_SIZE = 5;
void register_set_init(register_set *set, int count) {
set->count = count;
int bits = count / LOG2_BITS_PER_WORD;
if (bits == 0) {
set->size = 1;
... |
/*
* 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 "FeOSMusic.h"
#define ICONX (256-16)
#define ICONY (0)
char prev[1024];
static int state = SINGLE;
static int playingEntry;
int markersX[2] = {0, 256-8};
int track, dragging;
u16* playStateFrms[NUM_PLAYLIST_STATES];
static void onEof(void* context)
{
if(getPlayLstState()==REPEAT) {
cur_codec.seek(0);
}
... |
/*
* Copyright 2002-2011, The TenDRA Project.
* Copyright 1997, United Kingdom Secretary of State for Defence.
*
* See doc/copyright/ for the full copyright terms.
*/
#ifdef __TenDRA__
#define _POSIX_SOURCE
#else
#undef _POSIX_SOURCE
#endif
#include <stdio.h>
#if defined(_POSIX_SOURCE)
#include <sys/types.h>
#i... |
/********************************************************************************************************
* File name: stringBuffer.h
* Description: C语言缓冲字符串的实现
* Author: <EMAIL>
* Version: 2.0
* Date: 2019.1.27
* History:
* [v:2.0 d:2019.1.27] -修复了1.0版本的buffer_get_string功能的内存分配错误导致的越界访问
*************************... |
// This file is part of the Orbbec Astra SDK [https://orbbec3d.com]
// Copyright (c) 2015-2017 Orbbec 3D
//
// 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... |
// This C source file provides utility functions to access and control the
// I2C (Inter-Integrated-Circuit) on the BeagleBone.
#include <fcntl.h> // For O_RDWR
#include <linux/i2c.h>
#include <linux/i2c-dev.h> // For I2C_SLAVE
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <time.h>
#include ... |
#include <stdio.h>
#include "esp_system.h"
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_wifi.h"
#include "nvs.h"
#include "esp_event_loop.h"
#include "esp_log.h"
#include "esp_err.h"
#include "interna... |
/*
* Copyright (c) 2008-2012 the MansOS team. 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 con... |
#include "gfx.h"
void gfx_draw_pixel(uint16_t x, uint16_t y, uint8_t ppo)
{
uint16_t offset;
uint8_t bit;
if (x > (gfx_screen_width-1) || y > (gfx_screen_height-1)) {
/* don't do anything if x/y is outside bounds of display size */
return;
}
offset = (x + y * gfx_screen_width) / 8;
bit = 1 ... |
/*
* Copyright(C) 2012 <NAME>. All Rights Reserved.
*
* This file is part of the YARD-ICE.
*
* 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 3.0 of the License,... |
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "utils.h"
#include "http.h"
Request *parse_client_request(char* client_request)
{
Request *request = (Request *) malloc(sizeof(Request));
unsigned short int i = 0;
bool is_first_line = true;
ch... |
/***************************************************
* Ceno Real-time Operating System (CenoRTOS)
* version 0.1
* author neroyang
* email <EMAIL>
* time 2019-01-29
*
* Copyright (C) 2018 CenoCloud. All Rights Reserved
*
* Contract Information:
* https://www.cenocloud.com
********************************************... |
/* $OpenBSD: qscms.c,v 1.2 2008/08/22 21:05:07 miod Exp $ */
/* from OpenBSD: qscms.c,v 1.6 2006/07/31 18:50:13 miod Exp */
/*
* Copyright (c) 2006 <NAME>.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright ... |
/*******************************************************************************
Copyright (C) 2020 released Microchip Technology Inc. All rights reserved.
Microchip licenses to you the right to use, modify, copy and distribute
Software only when embedded on a Microchip microcontroller or digital signal
controller th... |
///////////////////////////////////////////////////////////////////////////////
// \author (c) <NAME> (<EMAIL>)
// 2014-2019, PALANDesign Hannover, Germany
//
// \license The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.