text stringlengths 3.08k 10.5k |
|---|
/********************************************************************************************************
* @file soc_impl.c
*
* @brief for TLSR chips
*
* @author telink
* @date Sep. 30, 2010
*
* @par Copyright (c) 2018, Telink Semiconductor (Shanghai) Co., Ltd.
* All rights reserve... |
/*
* ps4-kexec - a kexec() implementation for Orbis OS / FreeBSD
*
* Copyright (C) 2015-2016 shuffle2 <<EMAIL>>
* Copyright (C) 2015-2016 <NAME> "marcan" <<EMAIL>>
*
* This code is licensed to you under the 2-clause BSD license. See the LICENSE
* file for more information.
*/
#include "kernel.h"
#include "linu... |
#include "main.h"
static int iFinishCount;
static xSemaphoreHandle xControlMutex;
static xSemaphoreHandle xControlBarr;
static TaskHandle_t timeoutTask;
static int iProbGet() {
static int initialized = 0;
if(!initialized) {
srand(time(0));
initialized = 1;
}
return rand() & 1;
}
static void vTasksInit() ... |
/*-
* Copyright (c) 2012, 2013 The FreeBSD Foundation
* All rights reserved.
*
* This software was developed by <NAME> under sponsorship
* from the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* a... |
#include "dogos.h"
struct KEYBOARDCTL KEYBOARD;
static char keytable0[0x80] = {
0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 0, 0,
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 0, 0, 'a', 's',
'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0, '\\', 'z', '... |
#include "mdb_kernel_common.h"
#include <klog.h>
static uint32_t bailout_get_mod(uint32_t bailout)
{
if(bailout == 1)
return 0;
if (bailout < 256)
return 1;
if (bailout < 512)
return 2;
if (bailout < 1024)
return 4;
... |
// # channels #################################################################
// - rlyeh, public domain
//
// [src] based on cchan library by <NAME> (Public Domain)
//
// Go-style construct for inter-thread communication: each channel is a FIFO of
// fixed-length messages, which grows to make space for unread message... |
/**
* The MIT License (MIT)
*
* 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... |
#include "./include/Main.h"
cache_t *iniCache() {
g_Config.sets = g_Config.words/g_Config.bloco;
g_Config.log2bl = crapLog2foo(g_Config.bloco);
cache_t *Cache = malloc(g_Config.sets*sizeof(cache_t));
assert(Cache);
for (int i=0; i<g_Config.sets; i++) {
Cache[i].vBit = false;
Cache[i].tag = -1;
Cache[i].l... |
#include "../include/all.h"
#define ADDR_COLS(b) ((b)+1)
#define HEX_COLS(b, seg) ((b*2)+(b/seg))
#define ASCII_COLS(b) (b)
#define EDITOR_LINES (LINES - 1)
#define LINES_IN_BUFFER (buf.size / view.bpline)
#define INDEX_COL (buf.index % view.bpline)
#define CURSOR_LINE ((... |
// RUN: %check_clang_tidy %s cert-err34-c %t -- -- -std=c11
typedef __SIZE_TYPE__ size_t;
typedef signed ptrdiff_t;
typedef long long intmax_t;
typedef unsigned long long uintmax_t;
typedef void * FILE;
extern FILE *stdin;
extern int fscanf(FILE * restrict stream, const char * r... |
/*
--------------------------------
MarkdownLatex
tableProcessor.c
--------------------------------
Copyright 2014 <NAME>
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 Licen... |
/*
* This file is part of the Nice GLib ICE library.
*
* (C) 2012 Collabora Ltd.
* Contact: <NAME>
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*... |
/*
* iLBC - a library for the iLBC codec
*
* filter.c - The iLBC low bit rate speech codec.
*
* Adapted by <NAME> <<EMAIL>> from the reference
* iLBC code supplied in RFC3951.
*
* Original code Copyright (C) The Internet Society (2004).
* All changes to produce this version Copyright (C) 2008 by <NAME>
* All ... |
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* The MIT License
*
* Copyright (c) 2008-2010 <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 ... |
/*
* CV_Gate.c
*
* Created on: May 28, 2017
* Author: mayo
*
* This file is part of the Gecho Loopsynth Firmware Development Framework.
* It can be used within the terms of CC-BY-NC-SA license.
* It must not be distributed separately.
*
* Find more information at: http://gechologic.com/gechologists/
... |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright 2019 NXP
*/
#include <linux/clk.h>
#include <linux/devfreq.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/pm_opp.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
struct imx_bus {
struct devfreq_dev_... |
#include <unistd.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sched.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <limits.h>
#include "zdtmtst.h"
const char *test_doc = "Ch... |
/*
# _____ ___ ____ ___ ____
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# (c) 2009 Lion
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LIC... |
/* File: linked_list.c
*
* Purpose: Implement an unsorted linked list with ops insert (at head),
* print, member, delete, free_list.
*
* Input: Single character lower case letters to indicate operators,
* followed by arguments needed by operators.
* Output: Results of operations.
*... |
#include "unp.h"
#include "log.h"
#include "conf.h"
#include "http.h"
#include "map.h"
#define koko fprintf(stderr, "ライン %d: %s() ここまで\n", __LINE__, __func__)
configuration *conf;
void http_data_to_html_table(http_data *hp, char *table, size_t len)
{
snprintf(table, len,
"<tr><th>%s</th><td>%s</td></... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <lib/fidl/internal.h>
#ifdef __Fuchsia__
#include <zircon/syscalls.h>
#include <zircon/syscalls/object.h>
#endif
// Coding tables for primitives... |
/* USER CODE BEGIN Header */
/**
******************************************************************************
* file : main.c
* brief : Main program body
******************************************************************************
* Created by <NAME>
* Program Objective : Read a GPIO p... |
#include <e9print.h>
#include <stdint.h>
#include <multiboot2.h>
struct multiboot_info {
uint32_t size;
uint32_t reserved;
struct multiboot_tag *first;
};
void multiboot2_main(uint32_t magic, struct multiboot_info* mb_info_addr) {
if (magic != MULTIBOOT2_BOOTLOADER_MAGIC) {
e9_printf("multiboo... |
#include <bal/abi.h>
#include <bal/task/task.h>
#include <brutal/debug.h>
#include <elf/elf.h>
static void bal_exec_load(BrHandle space, Elf64Header const *elf_header, BrHandle elf_memory)
{
Elf64ProgramHeader *prog_header = (Elf64ProgramHeader *)((uint8_t *)elf_header + elf_header->programs_offset);
for (siz... |
/**
*Licensed to the Apache Software Foundation (ASF) under one
*or more contributor license agreements. See the NOTICE file
*distributed with this work for additional information
*regarding copyright ownership. The ASF licenses this file
*to you under the Apache License, Version 2.0 (the
*"License"); you may n... |
/**
* @file e2e_tc.c
* @note Copyright (C) 2018 <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 later version... |
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/flash_ctrl.h"
#include "sw/device/lib/base/log.h"
#include "sw/device/lib/base/memory.h"
#include "sw/device/lib/base/mmio.h"
#include "sw/devic... |
/*
// Functions for computing probability distribution
// functions commonly used in extreme value analysis
*/
/* Function prototypes */
#include "spei.h"
/*
// gammaFit() function:
// Gives the parameters of a Gamma distribution function
// fitted to a data series through its L-moments.
*/
void gammaFit(double *L, do... |
/* Copyright (c) 2018-2021, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
* \file voting_schedule.c
* \brief Compute information about our voting schedule as a directory
* authority.
**/
#include "feature/dirauth/voting_schedule.h"
#include "core/or/or.h"
#include "app/config/config... |
/*
Serval Low-bandwidth asychronous Rhizome Demonstrator.
Copyright (C) 2015-2018 Serval Project Inc., Flinders University.
This program monitors a local Rhizome database and attempts
to synchronise it over low-bandwidth declarative transports,
such as bluetooth name or wifi-direct service information
messages. It i... |
#include "Main.h"
int my_rank, query_ndx;
int SHOULD_GET_NETWORK_SPEED;
int SHOULD_LOAD_STATS;
int DESIRED_PLAN_NDX = 1;
int debug_level = 0;
char TIME_FILE[100];
char VOLUME_FILE[100];
char QUERY_FILE[100];
char RESULT_FILE[100];
char MACHINE_FILE[100];
char STAT_FILE_1[100];
char STAT_FILE_2[100];
char S... |
/* k_simd.c -- SIMD support */
/* XXX should move to HAL/Ig */
/*
* Copyright 2021 <NAME> <<EMAIL>>.
* 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
* in the Software without re... |
/*
* Date : Aug 2011
* File : prod_consumer_mutex_multi_access.c
* Desc : Producer-Consumer problem with large no. of threads and large no. of resources
* (as many as user specifies) using condition variable
* Input : num_threads, queue_size & ThreadAffMask (all 3, first 2 or first 1 only are
... |
#include <pebble.h>
#include "cl_util.h"
#define KEY_START 0
#define NUM_SAMPLES 15
static Window *window;
static TextLayer *x_layer, *y_layer, *z_layer;
static int latest_data[3 * NUM_SAMPLES];
static void window_load(Window *window)
{
x_layer = cl_init_text_layer(GRect(0, 0, 144, 24), GColorBlack, GColorClear, ... |
/* $NetBSD: hf.c,v 1.2 2007/11/09 20:08:40 plunky Exp $ */
/* $DragonFly: src/usr.sbin/sdpd/hf.c,v 1.1 2008/01/06 21:51:30 hasso Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
* All rights reserved.
*
* Written by <NAME> for Itronix Inc.
*
* Redistribution and use in source and binary forms, with or without
* m... |
/*
Copyright (C) 1995-2001 Activision, Inc.
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 later version.
This library is distribu... |
// Copyright(c) 2014-2018, Intel Corporation
//
// 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... |
/*
Pam module to change user names arbitrarily in the pam stack.
Compile as
gcc pam_user_map.c -shared -lpam -fPIC -o pam_user_map.so
Install as appropriate (for example, in /lib/security/).
Add to your /etc/pam.d/mysql (preferably, at the end) this line:
==============================================... |
/**
* Copyright 2017 Comcast Cable Communications Management, 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 requir... |
/* $Id$ */
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* I N T E R N A L D A T A S T R U C T U R E S O F
*
* I N L I N E S U B S T I T U T I O N
*
*/
typedef struct actual *... |
#include "sha3.h"
#include <string.h>
#define ROUNDS 24 // Number of KECCAK rounds to perform for SHA3-256.
#define WIDTH 200 // 1600-bit width in bytes.
#define LANES 25 // The state is an unrolled 5x5 array of 64-bit lanes.
#define RATE 136 // 1600-bit width - 512-bit capacity in bytes.
#define RO... |
/* The MIT License (MIT)
*
* Copyright (c) 2017 Monetra Technologies, LLC.
*
* 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 righ... |
/**
* @copyright (c) 2019 mrab
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the MIT license. See LICENSE for details.
*
* @author <NAME> (<EMAIL>)
* @brief
* @date 2019-09-16
*
* @file
*/
#include "clog.h"
#include <stdarg.h>
#include <stdio.h>
static con... |
/**
* \file supervisor/supervisor_create_canonizationservice.c
*
* \brief Create the canonization service.
*
* \copyright 2019-2020 Velo Payments, Inc. All rights reserved.
*/
#include <agentd/control.h>
#include <agentd/canonizationservice.h>
#include <agentd/canonizationservice/api.h>
#include <agentd/supervi... |
#include <stdio.h>
#include <string.h>
#include "unistd.h"
#include "sysctl.h"
#include "global_config.h"
#include "dvp.h"
#include "fpioa.h"
#include "iomem.h"
#include "plic.h"
#include "camera.h"
#include "rtc.h"
#include "syslog.h"
#if CONFIG_ENABLE_LCD
#include "nt35310.h"
#include "lcd.h"
#endif
static const... |
#include "interpolate.h"
#define LIKELY_IN_CACHE_SIZE 8
/** @brief find index of a sorted array such that arr[i] <= key < arr[i + 1].
*
* If an starting index guess is in-range, the array values around this
* index are first checked. This allows for repeated calls for well-ordered
* keys (a very common case) to ... |
/*
* SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "common.h"
#include "sign.h"
#include <err.h>
#include <fcntl.h>
#include <libgen.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <twz/_sctx.h>
#include <unistd.h>
#... |
/*
* Copied from https://www.softprayog.in/programming/interprocess-communication-using-posix-shared-memory-in-linux
* Copyright © 2007-2017 SoftPrayog.in. All Rights Reserved.
*
* Suggestion to use malloc_stats() from www.linuxjournal.com/article/6390
*/
//input output commands
#include <stdio.h>
//conta... |
/* idt.c (MP3.1) - All IDT related functions
* vim:ts=4 noexpandtab
*/
#include "idt.h"
#include "asm_linkage.h"
#include "keyboard.h"
#include "rtc.h"
#include "i8259.h"
#include "lib.h"
#include "system_calls.h"
/*
* enter all relevant exceptions into IDT table
*/
// Refer to OSDEV for paging: flush, map... |
/*
Copyright (c) 2020 <NAME>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alte... |
/*
*
* Copyright 2016, Google 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:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of condi... |
#include <stdint.h>
#include <stddef.h>
#include <stivale2.h>
#include <kernel.h>
#include <gdt.h>
#include <idt.h>
#include <printf.h>
#include <mm.h>
#include <serial.h>
/*
typedef struct syscall_t {
uint64_t rax;
uint64_t rbx;
uint64_t rcx;
uint64_t rdx;
uint64_t rsi;
uint64_t rdi;
uint6... |
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdio.h>
#include <curl/curl.h>
#include "../../utils/curl.h"
#include "../../utils/strutils.h"
/* required */
#include "../modtape.h"
#include "../../core/irc.h"
#include "../../core/log.h"
#include "../../core/modules.h"
static void
json_item(char ... |
#include "sprite_loading.h"
#include <stdint.h>
#include "vdp.h"
#include "assert.h"
#include "math_util.h"
#include "debug_print.h"
#include "camera.h"
#include "hero.h"
#include "sprite_actor.h"
#include "gcc_lib.h"
const int8_t SPRITE_INDEX_UNDEFINED = -1;
static void init_sprite(SpriteLoadingContext *context, ... |
/*
* 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 the hope that it will be use... |
#include "QapFp2_weierstrass.h"
typedef struct {
QapFp2_t b;
} curve_wp2_t;
typedef curve_wp2_t Curve_wp2_t[1];
typedef struct {
QapFp2_t t0;
QapFp2_t t1;
QapFp2_t t2;
QapFp2_t t3;
QapFp2_t t4;
QapFp2_t t5;
QapFp2_t t6;
QapFp2_t t7;
QapFp2_t t8;
} aux_wp2_t;
typedef aux_wp2... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* corewar_vis_init.c :+: :+: :+: ... |
#include <libk/stdarg.h>
#include <libk/stdio.h>
#include <libk/string.h>
#include <psp2/types.h>
#include <psp2/display.h>
#include "draw.h"
#define ALPHA_BLEND 1
extern unsigned char msx[];
static int pwidth, pheight, bufferwidth, pixelformat;
static unsigned int* vram32;
static uint32_t fcolor = 0x00ffffff;
st... |
#include "attitude.h"
#include <math.h>
#include "adc.h"
#include "main.h"
#include "nav_comms.h"
#include "quaternion.h"
#include "vector.h"
// =============================================================================
// Private data:
#define ACCELEROMETER_CORRECTION_GAIN (0.001)
static float quat_[4] = { 1.... |
/*-
* Copyright (C) 2011, 2017 <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 the above copyright
* notice, this list... |
/*
DESCRIPTION:
Remove noise from a spectral-matrix (time x freq)
- noise= single-timepoint decrease/increase that span many adjacent frequencies
- timeseries for each freq. converted to Z-scores for thresholding
- outputs a modified matrix with noise-timepoints set to NAN
- percentages for positive and negati... |
/*
This and the shell builder was originally written by
https://github.com/tpoechtrager but I had to modify both so that
they played nicely and were reproducible with nixpkgs. Much thanks
to MixRank for letting me work on this.
<NAME> <<EMAIL>>
*/
#ifndef TARGET_CPU
#define TARGET_CPU "armv7"
#endif
#ifnde... |
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
#include <netinet/in.h>
#include <inttypes.h>
#include "postgres.h"
#include "catalog/pg_type.h"
#include "fmgr.h"
#include "utils/builtins.h"
#include "openssl/hmac.h"
#include "ap_pgutils.h"
#inc... |
/*******************************************************************
Base64 Encoding/Decoding Library
Author: freecode http://freecode-freecode.blogspot.com/
*******************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**
* characters used for Base6... |
#define _GNU_SOURCE
#include <dlfcn.h>
#include <errno.h>
#include <error.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <bits/types/clockid_t.h>
#include <bits/types/struct_timespec.h>
#in... |
#include <kernel/mem.h>
#include <kernel/gpio.h>
#include <kernel/kerio.h>
#include <kernel/uart.h>
#include <kernel/interrupts.h>
#include <kernel/process.h>
#include <kernel/timer.h>
#include <kernel/mutex.h>
#include <kernel/rand.h>
#include <common/stdlib.h>
uint8_t numGPIOInterrupts = 0;
uint32_t interruptsReceiv... |
/*
* Find the number n, 1 < n < N, such that n / Totient (n) is minimal and Totient (n) is a permutation of n
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "math_utils.h"
#include "linked_list.h"
#include "utils.h"
#define FULL_SEARCH_CUTOFF 500
#define STEP_SIZE 0.8
static bool search_for_... |
#include <termbox.h>
#include <errno.h>
#include <fcntl.h> /* open */
#include "ui.h"
#include "nav.h"
#include "util.h"
static void ui_resize(struct ui *);
static void win_resize(struct window *, int, int, int, int);
static void win_draw(struct window *, struct dir *, struct colorscheme *);
static void win_printline... |
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <clh2.h>
static const char *provider_ref = "clh2-ref";
static const double abserr = 1e-6;
static int no_ref;
static size_t calc_total(unsigned char n_max, signed char ml_max) {
return (size_t) (pow(n_max, 4.) ... |
/*
* libwebsockets - small server side websockets and web server implementation
*
* Copyright (C) 2010 - 2019 <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... |
/******************************************************************************
*
* Copyright (C) 2009 - 2014 Xilinx, 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 deal
* in the Softw... |
#include "unity.h"
#include "libqiniu_ng.h"
#include <string.h>
#include "test.h"
void test_qiniu_ng_str(void) {
qiniu_ng_char_t *str = QINIU_NG_CHARS("你好,世界");
size_t len = QINIU_NG_CHARS_LEN(str);
qiniu_ng_str_t qiniu_str = qiniu_ng_str_new(str);
TEST_ASSERT_EQUAL_STRING_MESSAGE(
qiniu_ng_str... |
/*
Glowey Core - Copyright (C) 2017..2018 <NAME>
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 applicabl... |
#include "epic_game.h"
/**log vars**/
char error_log[1024] = {0};
uint64_t write_to_log = 0;
uint64_t curr = 0;
/************/
void init_player(player* p_player, uint32_t character_type)
{
uint64_t luck = rand;
switch (character_type)
{
case 1: //Mighty warrior
{
... |
void swap(int *a,int *b); //* hoán vị 2 số
void interchangeSort(List *L); //* Sắp xếp trực tiếp
void selectionSort(List *L); //* Sắp xếp chọn
void bubbleSort(List *L); //* Sắp xếp nổi bọt
void insertionSort(List *L);... |
/*****************************************************************************
* | File : DEV_Config.c
* | Author :
* | Function : Hardware underlying interface
* | Info :
*----------------
* | This version: V1.0
* | Date : 2021-03-16
* | Info :
#
# Permission is hereby ... |
#include "map.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "orb.h"
#define reset_str "\n\33[0;0f"
map_config_t map_config = {.food_rate = 30, .food_scores = {1000, 4000}};
map_t *create_map(void) {
// create new map
map_t *map = (map_t *)malloc(sizeof(map_t));
m... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* getenv_func.c :+: :+: :+: ... |
//
// LFCondition.c
// Lite Foundation
//
// Copyright (c) 2011 by <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 righ... |
/*
* Copyright (c) 2015 <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 DISCL... |
/*
*
* Screen NULL driver by <NAME> 2018
*
* For testing the Makefile for a new platform before writing a special screen driver
*
* will output to stdout when pixels for the screen are received, no graphics screen
*
*/
#include <stdio.h>
#include "device.h"
#include "fb.h"
#include "genmem.h"
... |
/* System definitions for code taken from the GNU C Library
Copyright 2017-2021 Free Software Foundation, Inc.
This program 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.... |
/* Exercise low-level query functions with different QTYPEs.
Copyright (C) 2016-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published b... |
/*
* Copyright (c) 2002-2013 Balabit
* Copyright (c) 1998-2013 <NAME>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation, or (at your option) any later version.
*
* This program ... |
/*
*
* Copyright 2017 gRPC authors.
*
* 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... |
/**
* @file
* Hier ist die Datenhaltung und Programmlogik
*
* @author <NAME>, <NAME>
*/
/* ---- System Header einbinden ---- */
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <math.h>
#include <stringOutput.h>
#include <assert.h>
#ifdef MACOSX
#include <GLUT/glut.h>
#else
#include <GL/glut.... |
/* Example usage of SQN optimizer in package stochQN with Rosenbrock's (a.k.a. banana) function.
Implementation of the functions taken from here:
https://gist.github.com/Bismarrck/772d4ae4a8c5ddcd37b8
*/
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include "stochqn.h"
double rose... |
/* $NetBSD: upc_iobus.c,v 1.2 2002/03/24 23:37:44 bjh21 Exp $ */
/*-
* Copyright (c) 2000 <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 r... |
#include "os.h"
#include "cx.h"
#include "ux.h"
#include "cx_hash.h"
#include "lcx_sha256.h"
#include "lcx_ripemd160.h"
void os_longjmp(unsigned int exception) {
longjmp(try_context_get()->jmp_buf, exception);
}
try_context_t *current_context = NULL;
try_context_t *try_context_get(void) {
return current_conte... |
// Copyright (C) 2020 Intel Corporation
//
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <openssl/engine.h>
#include <openssl/err.h>
#include <openssl/pem.h>
#include <openssl/evp.h>
#include <openssl/ui.h>
void* decrypt(ENGINE* eng, EVP_PKEY* pkey, int fd, size_t* size) {
const EVP_CIPHE... |
#define MICROPY_HW_BOARD_NAME "STM32F103ZET6"
#define MICROPY_HW_MCU_NAME "STM32F103xE"
// HSE is 8MHz not use
// Preset system clk = 72M , AHB clk = 72M , APB1 = 36M ,APB2 = 72M
// Can be modified by function pyb.freq()
#define MICROPY_HW_FLASH_FS_LABEL "pybflash"
#define MICROPY_HW_HAS_MMA7660 ... |
/*
* display.c
*
* Contains headers and definitions of display update functionality.
*
*/
#include <stdbool.h>
/*
* Serves as an input to the display task engine.
*/
struct display_params_t
{
float Boost; // The boost amount in deci-psi
float Afr; // The AFR in deci-% where 147... |
/**
* \file
*
* \brief HTTP component task for the HTTP Netconn Example.
*
* Copyright (c) 2013-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... |
/*
setup.h
This defines the setup variables */
#ifndef WSTYPES_H
#include "wstypes.h"
#endif
extern int setup_loaded_setup ; /* Has setup file been read? */
extern int setup_loaded_stats ; /* Has stats file been read? */
extern int setup_loaded_devices ; /* Has devices file been read? */
//extern int setu... |
/******************************************************************************
* *
* UTIL.C *
* *
... |
/*
* Hoike.c
*
* Created: 3/1/2018 3:40:20 PM
* Author: <NAME>
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include "io.c"
#include "Timer.c"
#include "adc.c"
#include "GetSetBit.c"
#include "usart_ATmega1284.h"
enum States { Init, UserInput, Visualize, Learn } Sta... |
/**
* Copyright (c) 2021 Sirvoid
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include "worldgenerator.h"
#include "world.h"
#include "raylib.h"
#define FNL_IMPL
#include "FastNoiseLite.h"
... |
void calc_err_2norm_dtype(
const int len, const DTYPE *x0, const DTYPE *x1,
DTYPE *x0_2norm_, DTYPE *err_2norm_
)
{
DTYPE x0_2norm = 0.0, err_2norm = 0.0, diff;
for (int i = 0; i < len; i++)
{
diff = x0[i] - x1[i];
x0_2norm += x0[i] * x0[i];
err_2norm += diff *... |
/****************************************************************************/
/* Author: <EMAIL> */
/* https://github.com/morethanuser/ddc_kvm_switch */
/* http://morethanuser.blogspot.com */
/********************... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.