text stringlengths 3.08k 10.5k |
|---|
/* b03902086 李鈺昇 */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/wait.h>
#include <sys/select.h>
#define CHILD 0
#define HOST_MAX 12
#define PLAYER_MAX 20
#define COMP_MAX 4845 // C(20, 4)
#define LINE_LEN 20
int Cn4(int n) {
return n * (n-1) * (n-2) * (n-3) / 24;
}
... |
/*
* userid.c
*
* Created on: Oct 30, 2017
* Author: hjshin
*/
#include "iotivity_config.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#include <signal.h>
#ifdef HAVE_PTHREAD_H
#include <pthread.... |
// Copyright (c) 2020, <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... |
/****************************************************************************
** Copyright (C) 2020 MikroElektronika d.o.o.
** Contact: https://www.mikroe.com/contact
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"... |
// This file is part of Deark.
// Copyright (C) 2021 <NAME>
// See the file COPYING for terms of use.
// LZH with adaptive Huffman coding
#define DE_NOT_IN_MODULE
#include "deark-private.h"
#include "deark-fmtutil.h"
#include "../foreign/lzhuf.h"
void fmtutil_get_lzhuf_d_code_and_len(UI n, UI *pd_code, UI *pd_len)
... |
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/reboot.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "flipflop.h"
#include "readconf.h"
/* What to boot if flipf... |
/* $NetBSD: femi.c,v 1.9 2003/07/15 03:35:58 lukem Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
* All rights reserved.
*
* Written by <NAME> for Wasabi Systems, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
... |
/*
* Copyright (C) 2015 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#include <stdio.h>
#include "codes/codes-jobmap.h"
#define ERR(str, ...) \
do { \
fprintf(stderr, "ERROR at %s:%d: " str "\n", __FILE__, __LINE__, ##__VA_ARGS__); \
return 1; \
} while(0)
s... |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//This function takes six values of (both I & Q of early, prompt, and late) tracking correlator outputs and
//provide NCO updates (Carrier freq & phase, three code delays) for the next iteration for the s... |
/*
* Copyright 2017, Data61
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
* ABN 41 687 119 230.
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(DATA... |
/*
* 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:
*
*... |
/* dns_send.c -- send DNS messages
*
* Copyright <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#include <errno.h>
#include <string.h>
#includ... |
#include <stdbool.h>
#include <stdint.h>
#include <math.h>
#include "const.h"
/*****************************************************************************
NAME: calculate_slope_horn
PURPOSE: Performs the Horn's slope algorithm (from GDALDEM) to compute the
terrain slope for the current 3x3 window... |
/*
* Title: Højde-funktion af binært træ
* Description: Write a function in C that calculates the height of a tree. The starting point (parameter) must be a pointer to a node in the tree. Test the function on different trees.
* Assignment: Opgave 12.7
* Link to assignment: http://people.cs.aau.dk/~normark/impr-c/s... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "cvmsi.h"
#include "cvmsi_utils.h"
#include "cvmsi_geo2xy.h"
#define SUCCESS 1
#define FAIL 0
#define ILONGLAT2UTM 0
#define IUTM2LONGLAT 1
void utm_geo_(double *rlon, double *rlat, double *rx, double *ry, int *utmzone, int *iway);... |
/*
* mmap implementation for Windows. Note that in Windows, mmap works as
* MAP_SHARED and msync is not needed or just ignored here.
*/
#include <sys/mman.h>
#include <io.h>
#include <stdint.h>
#include "win_util.h"
//#define MMAN_API_LOG
//#define MMAN_API_ERROR_LOG
#ifdef MMAN_API_LOG
#define MMAN_API_PRINTF(fo... |
/* Programmable Interval Timer (PIT) driver for Intel 8253 */
#include <sys/mimiker.h>
#include <dev/i8253reg.h>
#include <dev/isareg.h>
#include <sys/pci.h>
#include <sys/interrupt.h>
#include <sys/timer.h>
#include <sys/devclass.h>
typedef struct pit_state {
resource_t *regs;
resource_t *irq_res;
timer_t timer... |
/*
* Copyright (c) 2020 <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
*
* 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... |
/*
* ---------------------------------------------------------------------
* Author: <NAME>, <NAME>
* Created: 2019-11-27
* Last update: 2019-11-30
* Platform: ATmega328P, 16 MHz, AVR 8-bit Toolchain 3.6.2
* ---------------------------------------------------------------------
*/
/* Inc... |
/*
* Copyright (c) 2010-2012 Digi International Inc.,
* All rights not expressly granted are reserved.
*
* 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/.
*
* Digi... |
/*
* Copyright 2021 Cisco Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
typedef struct edge {
int v1, v2;
int weight;
} edge;
typedef struct cedge {
int v;
int weight;
} cedge;
void floyd(int nv);
void dijkstra(int nv);
void prim(int nv, int ne);
void kruscal(int nv, int ne);
void sorting(int ... |
#include <stdio.h> // stderr, stdin, stdout - standard I/O streams
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define BUF_SIZE 2
#define STDIN_BUF_SIZE 2
// buffer to hold the characters read from in
char buffer[BUF_SIZE];
// indicate if we're on a new line. If true, the next character should
//... |
/*
* Copyright (C) 2020 <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 applicable law or agreed to ... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define check_leap(year) ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
#define _SIZE_ 35
typedef struct
{
int day;
int year;
char month[15];
}date;
typedef struct
{
int ID;
double average;
char name[20];
char surname... |
// Copyright 2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include <platform.h>
#include <xs1.h>
#include <stdarg.h>
#include <xcore/hwtimer.h>
#include "board_init.h"
#include "app_conf.h"
typedef enum {
PORT_INPUT = 0,
PORT_OUTPUT = 1,
PORT_INOUT =... |
#include "Tinn.h"
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
typedef struct
{
float** in;
float** tg;
int nips;
int nops;
int rows;
}
Data;
typedef struct {
int k;
float tg;
float pd;
} pos;
void output_svg(int j, Data data, int realnum, float pcage, ... |
/* SPDX-License-Identifier: MIT */
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include "../common.h"
#include "../insist.h"
/*----------------------------------------------------------------------------*/
/*! Function to read a ugraph file. */
/*--------------------------------------------... |
/*
WARFRAME death log
Original JavaScript and regex patterns by semlar, C implementation by Wampa842
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#define MAX_LENGTH 1000
FILE * file;
char * url;
time_t starttime = 0;
/* Trim whitespaces from the beginning and ... |
/*
* This file is part of the libpayload project.
*
* Copyright (C) 2008-2010 coresystems GmbH
*
* 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 copyrigh... |
/*
* Broadcom NAS Kernel Partition Table Support
*
* Copyright 2003, Broadcom Corporation
* All Rights Reserved.
*/
#include "broadcom.h"
#include <linux/pagemap.h>
#include "check.h"
extern int disk_repartition_minor_base;
extern int disk_repartition_minor_range;
#define BROADCOM_PARTITON_TABLE_HEADER "Broad... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#define BUF_SIZE 1024
#define HEADER_SIZE 16
#define DATA_SIZE 1008
void error_handling(char *message){
fputs(message, stderr);
fputc('\n',stderr);
exit(1);
}
int main(int argc, char *argv[]){
int serv_sd, clnt_... |
/**
Minimum Spanning Tree problems in a undirected graph
Goal: find the lowest-costied edges that connect the graph, which is the Minimum Spanning Tree consist of
Kruskal's algorithm:
Requirement:
all distance must be greater or equal to 0
Data structure (for enhancement of time complexity): disjoint ... |
#include <fips_rng_tests.h>
#include <stdlib.h>
#include <string.h>
const int FIPS_RNG_MONOBIT_TEST = 0x00000001;
const int FIPS_RNG_POKER_TEST = 0x00000002;
const int FIPS_RNG_RUNS_TEST = 0x00000004;
const int FIPS_RNG_LONG_RUNS_TEST = 0x00000008;
const int FIPS_MONOBIT_LOW_LIMIT = 9725;
const int FIPS_MONOBIT_HIGH... |
/*
* pr_pset14_02.c -- version in one file
* Write a program that prompts the user to enter the day, month, and year.
* The month can be a month number, a month name, or a month abbreviation.
* The program then should return the total number of days in the year up
* through the given day. (Do take leap years ... |
#include "dcf77.h"
#include "Arduino.h"
bool packet[60] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
void packetGen(/*bool* packet, */int minute, int hour, int day, int month, int... |
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "flag_flipper.h"
#include "queries.h"
FlagFlipperState *flag_flipper_new(void)
{
FlagFlipperState *st = malloc(sizeof(*st));
Controller *ctl = malloc(sizeof(*ctl));
controller_init(ctl);
st->ctl = ctl;
st->wq = bqueue_new();
return st;
}
Pa... |
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
#include "freertos/semphr.h"
#include "lwip/err.h"
#include "lwip/sockets.h"
#include "lwip/sys.h"
#include "lwip/netdb.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "wifi.h"
#include "log... |
/******************************************************************************
pampick
*******************************************************************************
Select specified images from a Netpbm image stream and create a new
Netpbm image stream containing them.
By <NAME>... |
#include "whois.h"
#include "../resource.h"
static HGLOBAL xmlres;
static xmlDocPtr xmldoc;
static xmlXPathContextPtr xpath;
static const char* xpath_template[] = {
"/domainList/domain[@name='%s']/whoisServer",
"/domainList/domain[@name='%s']/domain[@name='%s.%s']/whoisServer"
};
bool __cdecl xmldb_load(void) {
... |
#define _GNU_SOURCE
#include <errno.h>
#include <grp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
// Keep in sync with backend/src/users.ts
const int MIN_UID = 2000;
const int MAX_UID = 65000;
int privileged;
void __attribute__ ((noret... |
#include "bash.h"
void bash_mkII(){
size_t size = 16;
char* in_buffer = malloc(sizeof *in_buffer * size), *ptr = in_buffer;
int bytes_read;
uint has_realloc = 1;
bool exit = false;
write(STDOUT_FILENO, "$ ", 2);
while(!exit && (bytes_read = read(STDIN_FILENO, ptr, size / has_realloc)) >... |
/****************************************************************************
* Copyright (c) 2013-now *
* This software is subjected to Apache License Version 2.0, January 2004 *
* http://www.apache.org/licenses/ *
* Permi... |
#include "privparent.h"
#include "sckutil.h"
#include "commsocket.h"
#include "common.h"
#include "privsock.h"
#include "tunable.h"
static void privop_pasv_get_data_sock(session_t *sess);
static void privop_pasv_active(session_t *sess);
static void privop_pasv_listen(session_t *sess);
static void privop_pasv_accept(se... |
/*
* Copyright (C) 2000, 2001 <NAME> (<EMAIL>)
* Licensed under the GPL
*/
#include "linux/kernel.h"
#include "asm/errno.h"
#include "linux/sched.h"
#include "linux/mm.h"
#include "linux/spinlock.h"
#include "linux/config.h"
#include "linux/init.h"
#include "linux/ptrace.h"
#include "asm/semaphore.h"
#include "asm... |
/*
* eventheap.c - 2016 <NAME> <<EMAIL>>
*
* Heap will be a single allocated buffer of pointers to event_t
* objects. Unlike most datastructures in C, this one uses 1-based
* indexing (first pointer to an event_t is at index location 1).
* index location zero will keep track of the heap... |
#include <xcopy.h>
#include <tcpcopy.h>
static uint64_t clt_udp_cnt = 0;
static uint64_t clt_udp_send_cnt = 0;
int
tc_init_sess_table(void)
{
return TC_OK;
}
void
tc_dest_sess_table(void)
{
}
/*
* filter udp packets
*/
bool
tc_check_ingress_pack_needed(tc_iph_t *ip)
{
bool is_needed = f... |
/*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team,
* check out http://www.gromacs.org for more information.
* Copyright (c) 2012,2013, by the GROMACS development team, l... |
/**
******************************************************************************
* File Name : init.c
******************************************************************************
*
* COPYRIGHT(c) 2016 STMicroelectronics
*
* Redistribution and use in source and binary forms, with or without mo... |
#include <stdio.h>
#include <sys/types.h> // required for u_char
#include <stddef.h> // offsetof
#include <stdlib.h> // malloc
#include <netinet/in.h> // sockaddr_in
#include <arpa/inet.h> // inet_pton and friends
#include <string.h> // strlen
#include <ctype.h> // ... |
/*
* list.c
*/
#include "token.h"
#include "parse.h"
#include <stdlib.h>
/* Allocates and initializes a new list. */
List *
alloc_list ()
{
List *new;
new = (List *) malloc (sizeof (List));
new->cdr = new->car = NULL;
new->token.type = TOK_UNKNOWN;
new->token.u.string = "<Uninitialized>";
new... |
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdio.h>
#include "pico.h"
#include "pico/scanvideo.h"
#include "pico/scanvideo/composable_scanline.h"
#include "pico/sync.h"
#include "pico/stdlib.h"
#include "hardware/structs/dma.h"
#include "hardware/st... |
//Day12b.c
//
//Question 2: If register c is initialized to 1, what is the value in register a
//after the program executes?
//
//To solve this puzzle, we need to change one line of code. Woohoo!
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
//The assembly interpreter is untouched
typ... |
/*
* Author: <NAME> <<EMAIL>>
*/
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "cint.h"
#include "config.h"
// 128s42p21d12f8g6h4i3j
#define NCTR_CART 128
// 72s24p14d10f8g6h5i4j
#define NCTR_SPH 72
#define NPRIMAX 64
#define BLKSIZE 96
#define EXPCUTOFF 50 ... |
static const unsigned int borderpx = 4;
static const char *tags[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"};
static const float mfact = 0.55;
static const int nmaster = 1;
static const int resizehints = 0;
static const int lockfullscreen = 1;
static const unsigned int snap = 32;
static const int showbar = 1;
stat... |
/*
* Copyright (c) 2019 Cisco and/or its affiliates.
* 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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "LargeAllocator.h"
#include "utils/MathUtils.h"
#include "Object.h"
#include "Log.h"
#include "headers/ObjectHeader.h"
inline static int LargeAllocator_sizeToLinkedListIndex(size_t size) {
assert(size >= MIN_BLOCK_SIZE);
return log2_floor(size... |
/**
* Copyright (c) 2014 - 2017, Nordic Semiconductor ASA
*
* 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,... |
/*
* Simple test program to demonstrate
* the functionality of the openg/openfh
* system call!
*/
#include <stdio.h>
#include <sys/time.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <linux/... |
/*
* vtj1options.c - Set some terminal options on the VTJ-1 terminal.
* Probably not as portable as I'd like, but compiles and seems to run ok
* under both Linux and NetBSD 7.
*
* Copyright (c) 2017 <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modifica... |
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/wait.h>
#include <unistd.h>
static const char **argv;
static int gotsig;
static struct {
size_t nmemb;
size_t written;
c... |
/******************** (C) COPYRIGHT 2012 **************************************
* File Name : separator_tension.c
* Creater : deh
* Date First Issued : 12/12/2012
* Board : Linux PC
* Description : Separate a big file into small files based on tension
***************************... |
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolar... |
/*
* Copyright 2010 Cloudkick Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
/*
* Copyright (c) 1987 Fujitsu
*
* 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, di... |
/*
* table.c
*
* Created on: July 24th, 2017
* Author: hirschag
*/
#include "ArrayList.h"
#include "bets.h"
#include "commonFunctions.h"
#include "table.h"
#include "players.h"
#include "dice.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
table* setup() {
table* Table;
Table = (table*)ma... |
#include "../common.h"
/**
* ADSR structure.
* @on: The note on flag.
* @min, ax: The minimum and maximum.
* @v, atk, decay, sus, rel, target: The paramaters.
*/
struct amp_adsr_t {
bool on;
double min, max;
double v, atk, decay, sus, rel, target[2];
};
/*
* global variables
*/
const struct amp_modu... |
/*
This file is part of PlibC.
(C) 2011 <NAME> (and other contributing authors)
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,... |
/* $NetBSD: rdate.c,v 1.19 2009/10/21 01:07:47 snj Exp $ */
/*
* Copyright (c) 1994 <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... |
#include <tonc.h>
#include <string.h>
#include <stdlib.h>
#include "model.h"
#include "math.h"
#include "camera.h"
#include "logutils.h"
#include "timer.h"
#include "render/draw.h"
#include "globals.h"
static Vec3 cubeModelVerts[8];
static Face cubeModelFaces[12];
Model cubeModel;
void modelInstancePoolReset(ModelIn... |
/*
Copyright (c) 1993-Present, <NAME>, Acadix Software Systems
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 noti... |
// ----------------------------------------------------------------------------
// This module contains the startup code for a portable embedded
// C with no lib
//
// Control reaches here from the reset handler via jump or call.
//
// The actual steps performed by _start are:
// - copy the initialised data region(s)
... |
/**
* @file introSort.c IntroSort implementation
* @brief
*
* Complete IntroSort implementation optimized to switch to Insertion
* Sort when problem sizes are less than or equal to minSize in length.
* For pure QuickSort, set minSize to 0.
*
* When depth of recursion goes beyond fixed "reasonable... |
/*
* this is stupid and ugly.
*
* i'm not clever and have no idea about how to play the order-4 magic square
* game, so i just brute-force-attack the problem, and am too lazy to check
* the "replicated" ones: burn the CPU, and play no trick.
*
* to use OpenMP to take advantage of all your cores, compile with `... |
/*
C program to implement jacobi's method for solving a system of
linear equations.
Jacobis method works when all of the diagonal elements of the
augmented matrix is not equal to 0.
So we can rearrange the equations to write:
x1 = b1/a11 - a12/a11 x2 - a13/a23 x3 -... (1)
x2 = b2/a2... |
/*
* rgbled.c
*
* Created on: May 16, 2017
* Author: kevin
*/
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "esp_log.h"
#include "driver/ledc.h"
#include "rgbled.h"
#include "GarageDoor.h"
#define RED_LED 25
#define GREEN_LED 26
#define BLUE_LED 27
typedef s... |
/*
* imap/select.c - issues and handles IMAP SELECT commands, as well as common
* responses from SELECT commands
*/
#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "imap/imap.h"
#include "internal/imap.h"
#include "log.h"
#include "util/list.... |
/* $OpenBSD: skeytest.c,v 1.4 2014/03/25 04:29:49 lteo Exp $ */
/* $NetBSD: skeytest.c,v 1.3 2002/02/21 07:38:18 itojun Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided... |
/* =============================================================================
* Copyright (c) Texas Instruments Incorporated 2016
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions o... |
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2018-2019 <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 mu... |
/***************************************************************************
* Copyright (C) 2015 by <NAME> *
* <EMAIL> *
* *
* This program is free softw... |
/**
* VGA Display Library
*/
#include "display.h"
#include "../kernel/system.h"
#include "ports.h"
#define VIDEO_MEM_ADDR 0xb8000
#define SCREEN_ROWS 25
#define SCREEN_COLS 80
#define BLACK 0x00
#define BLUE 0x01
#define GREEN 0x02
#define CYAN 0x03
#define RED 0x04
#define MAGENTA 0x05
#define BROWN 0x06
#define ... |
/*
* NET3 IP device support routines.
*
* 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.
*
* Derived from the... |
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
// Tef Edit: the following may be necessary for 'write()' to work (..)
#include <sys/types.h>
#include <string.h>
// the following is THE one for 'read()' & 'write()'
#include <unistd.h>
// Tef Edit: Fcn qui utilise 'write()' pour afficher du stuff sur stdou... |
/*
* spsc.c
*
* Created on: Nov 22, 2016
* Created by: <NAME> <<EMAIL>>
*/
#include <locale.h>
#include <pthread.h>
#include <sys/time.h>
#include "../src/lib/mmt_lib.h"
#include "../src/lib/lock_free_spsc_ring.h"
#include "../src/lib/system_info.h"
typedef struct _user_data_struct{
lock_free_spsc_ring_t *rin... |
/*
CPSC 223C
Spring 2015
CSU Fullerton
Lab 5: word frequencies
Authors: <NAME> (<EMAIL>) (REPLACE THIS
WITH YOUR NAMES AND CSUF EMAIL ADDRESSES)
*/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NOT_FOUND -1
/* Safe estimate of the length o... |
#include "common.h"
#include "scanner.h"
#include "local.h"
// when this is entered, a (/) has been seen. If the next character is a
// (/) or a (*), then we have a comment, otherwise we have a / operator.
static token_t comment_or_operator() {
int ch = get_char();
if(ch == '/') {
// eat a sinlge li... |
/*
* Copyright (c) 2020-2021, <NAME>
* <EMAIL>
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-02-07 <NAME> the first version
*/
#include <rtthread.h>
#include <board.h>
#include <rtdevice.h>
#include "drv_soft_i2c.h"
#include "BME280/bme280.h... |
#include "mpi.h"
#include <stdlib.h>
#include <stdio.h>
#include "dtypes.h"
#include "gcomm.h"
#if defined(NEEDS_STDLIB_PROTOTYPES)
#include "protofix.h"
#endif
int verbose = 0;
/*
This program is from mpich/tsuite/pt2pt and should be changed there only.
It needs gcomm and dtype from mpich/tsuite, and can be ru... |
/* Copyright 2017, <NAME>, <NAME>, <NAME>
* All rights reserved.
*
* This file is part of Workspace.
*
* 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 co... |
/*
* Copyright 2018-2020 Redis Labs Ltd. and Contributors
*
* This file is available under the Redis Labs Source Available License Agreement
*/
#include "op_node_by_id_seek.h"
#include "shared/print_functions.h"
#include "../../query_ctx.h"
/* Forward declarations. */
static OpResult NodeByIdSeekInit(OpBase *opBase);... |
/* --COPYRIGHT--,BSD
* Copyright (c) 2017, 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 copy... |
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas at Austin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Re... |
/*
* device_name_form.c - ask for sound control device name
* Copyright (c) <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 yo... |
/*
*
* Copyright (c) International Business Machines Corp., 2001
*
* 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 l... |
#include <lib/defs.h>
#include <lib/syscall.h>
#include <lib/errno.h>
#include <lib/launcher.h>
#include <lib/ipc.h>
#include <lib/bug.h>
#include <lib/print.h>
#include <lib/string.h>
#include <lib/fs_defs.h>
#define VMR_READ (1 << 0)
#define VMR_WRITE (1 << 1)
#define VMR_EXEC (1 << 2)
#define PFLAGS2VMRFLAGS(PF)... |
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include <string.h>
#include "common.h"
#include "messages.h"
#include "rule.h"
#include "print.h"
#include "caract.h"
#include "caract_list.h"
#include "ihm... |
/*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warr... |
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.... |
/* Copyright 2019, 2021 Google 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.