text stringlengths 3.08k 12.5k |
|---|
#include "Dependencies.h"
#include "GPUProgram.h"
#include "GPUKernel.h"
#include "GPUMem.h"
namespace a_two {
std::random_device rnd;
std::mt19937_64 rng(rnd());
std::uniform_int_distribution<cl_int> uniformRand(0, 10);
#define MAXARRLENGTH (1<<15)
std::uniform_int_distribution<size_t> uniformSize(1, MAXARRLENGT... |
#include "EquilibriumGenerator.h"
using namespace std::chrono;
EquilibriumGenerator::EquilibriumGenerator(int coordinateCount)
{
this->coordinateCount = coordinateCount;
//coordinates = new NonPlanarCoordinate[coordinateCount];
coordinates = (NonPlanarCoordinate**) calloc(coordinateCount, sizeof(NonPlanarCoordi... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#include "TestHttpServer.h"
#include <boost/config.hpp>
#include <boost/beast/core/detail/base64.hpp>
#include <cstdlib>
#include <iostream>
#include <memory>
using boost::beast::string_view;
namespace ... |
#include "FilePermissions.hpp"
#include <sstream>
#include <tuple>
#include <vector>
#include <sys/stat.h>
using namespace pistis::filesystem;
namespace {
static const int ALL_BITS = S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO;
static const std::vector< std::tuple<int, std::string> >&
permissionToNa... |
/*
Copyright (c) 2011 TOSHIBA CORPORATION
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distri... |
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* ***************************************************************************
* 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 ... |
/****************************************************************************************************************/
/* */
/* OpenNN: Open Neural Networks Library ... |
#include "tiger.h"
#include "utils.h"
#include <fstream>
using namespace std;
using namespace UTILS;
TIGER::TIGER() :
SIMULATOR(3, 4, 1.0)
{
// -----------------------------------
RewardRange = 40.0; // <----- correct is 110 [from -100 to 10]
// -----------------------------------
}
STATE* TIGER::Cop... |
#include <cstring>
#include <ctime>
#include <iostream>
#include <fstream>
#include <pthread.h>
#include <semaphore.h>
#include <sys/sem.h>
#include <sys/stat.h>
#include <queue>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <algorithm>
using namespace std;
#define MAX_THREAD 20
#define DIRECT... |
#include "screens/game/game.h"
#include <algorithm>
#include <chrono>
#include <functional>
#include <iostream>
#include <random>
#include <sstream>
#include "global/global.h"
#include "screens/game/bot.h"
#include "screens/game/dice.h"
#include "screens/game/human.h"
#include "screens/help.h"
#include "screens/intro.h... |
/* Copyright (c) <2009> <<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 commercia... |
/*
* Copyright 2018 ARP Network
*
* 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... |
// Arquivo cmd_user_info.cpp
// Criado em 18/03/2018 as 13:39 por Acrisio
// Implementação da classe CmdUserInfo
#if defined(_WIN32)
#pragma pack(1)
#endif
#include "cmd_user_info.hpp"
using namespace stdA;
CmdUserInfo::CmdUserInfo(bool _waiter) : pangya_db(_waiter), m_uid(0), m_ui{0} {
};
CmdUserInfo::CmdUserInfo... |
//class header
#include "Image.hpp"
//std lib includes
#include <string>
#include <iostream>
#include <sstream>
#include <assert.h>
//other includes
#include "png.h"
#include "..\BasicLog.hpp"
/*
MIT License
Copyright (c) 2018 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of t... |
#include "ChatClient.h"
#include <algorithm>
#include <iostream>
#include <mutex>
#include <thread>
#include <vector>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ws2tcpip.h>
#include "ChatConnection.h"
#include "ChatConstant.h"
#include "ChatPacket.h"
#include "ChatTableID.h"
#include "GreetingsPack... |
/***********************************************************************/
/** */
/** wsbs_planner.cpp */
/** */
/** Copyright (c) 2016, ... |
#include "judger.h"
struct Submission submission = {0, 0, 0, 0, -1, 0, -1, 0, CL_Other, JR_OTHER};
char sql[BUFFER_SIZE];
char box_dir[BUFFER_SIZE];
int main(int argc, char *argv[]){
if (argc < 3) exit(1);
submission.id = atoi(argv[1]);
submission.box_id = atoi(argv[2]);
sprintf(box_dir, "/home/judge... |
#include <cstdio>
#include <stack>
unsigned int read() {
unsigned int res = 0; char c = getchar();
while( c < '0' || c > '9' )
c = getchar();
while( c >= '0' && c <= '9' ) { res = res * 10 + ( c - '0' ); c = getchar(); }
return res;
}
const unsigned int N = 3e4 + 1e2;
struct node {
unsigned int son[2], fa;
... |
// Copyright (c) 2012 The Chromium 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 "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h"
#include "ash/shelf/shelf_constants.h"
#include "base/bind.h"
#include "base/logg... |
#include "storage.h"
#include "interpreter.h"
#include "processor.h"
#include "commands.h"
#include <algorithm>
#include <iterator>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
TEST(Table_Test, Insert_Records)
{
std::set<Record> data;
auto rc = data.emplace(0, "hello");
EXPECT_TRUE(rc.second);
... |
/*
The MIT License (MIT)
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, publis... |
#include <EigenFaceMaskedArray.h>
#include <EigenFace.h>
#include <EigenFaceData.h>
#include <QByteArray>
#include <QBuffer>
#include <QDomDocument>
#include <QDomElement>
#include <QFile>
#include <QIODevice>
#include <QString>
#include <QStringList>
#include <QVector>
#include <Return.h>
Return... |
#include "ScreenOutputNode.h"
#include <QDebug>
#include <QJsonObject>
#include <QGuiApplication>
ScreenOutputNode::ScreenOutputNode(Context *context, QSize chainSize)
: OutputNode(context, chainSize)
{
}
void ScreenOutputNode::init()
{
auto ow = new OutputWindow(qSharedPointerCast<OutputNode>(sharedFromThis(... |
#include <mbed.h>
#include <pid.hpp>
#include <rotary_inc.hpp>
#include <scrp_slave.hpp>
ScrpSlave slave(PA_9, PA_10, PA_12, SERIAL_TX, SERIAL_RX, 0x0803e000);
using namespace arrc;
constexpr int NUM_PORT = 5;
constexpr int NUM_MOTOR_PORT = 4;
constexpr int MAX_PWM = 250;
constexpr double MAX_PWM_MBED = 0.95;
const... |
// Bring-up test code for the ez-retro, i.e. eZ80 connected to a Wide Pill
//
// hello ram test: a2zwjcb
// hello flash test: a2zfjcba0zwjcb
//
// Connections:
//
// PB0 = eZ80 XIN, pin 86
// PB2 = eZ80 ZDA, pin 69 (w/ 10 kΩ pull-up)
// PB4 = eZ80 ZCL, pin 67 (w/ 10 kΩ pull-up)
// PB8 = eZ80 RESET, pin 55
// PA2 ... |
// Copyright (c) 2012 The Chromium 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 "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
#include "base/logging.h"
#include "chrome/browser/browser_process.h"
#incl... |
#include "Player.h"
#include "BaseLibrary.h"
#include "tinyexpr.h"
#include "CustomShape.h"
#include <set>
#include <list>
#include <algorithm>
void Player::processInput(GLFWwindow *window, std::vector<unsigned int> &char_callbacks, std::vector<KeyStruct> &key_callbacks, bool &drawShadows, std::list<TextStruct> ... |
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)MIT
*
* Flacon - audio File Encoder
* https://github.com/flacon/flacon
*
* Copyright: 2022
* <NAME> <<EMAIL>>
*
* MIT License
*
* Copyright (c) 2022 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associ... |
/////////////////////////////////////////
//
// OpenLieroX
//
// event queue
//
// based on the work of JasonB
// enhanced by <NAME> and <NAME>
//
// code under LGPL
//
/////////////////////////////////////////
#include <list>
#include <cassert>
#include <time.h>
#include <SDL_events.h>
#include "ThreadPool... |
/*
* Copyright 2008, 2009 Google Inc.
* Copyright 2006, 2007 Nintendo Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
... |
// This file is part of the Eccoin project
// Copyright (c) 2009-2010 <NAME>
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Copyright (c) 2014-2018 The Eccoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
... |
/*******************************************************************************
* examples/tutorial/k-means_step6.cpp
*
* Part of Project Thrill - http://project-thrill.org
*
* Copyright (C) 2016 <NAME> <<EMAIL>>
*
* All rights reserved. Published under the BSD-2 license in the LICENSE file.
******************... |
/*
Copyright (c) 2019 - 2020 Advanced Micro Devices, 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 Software without restriction, including without limitation the rights
to use, ... |
/*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
///2
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <CGAL/Triangulation_face_base_2.h>
#include <vector>
#include <iostream>
#include <queue>
#include <boost/graph/adjacency_list.hpp>
#include <b... |
// Copyright (c) 2020 Simons Foundation
//
// 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.txt
//
// Unless required by applicable law or... |
// license:BSD-3-Clause
// copyright-holders:<NAME>
/***************************************************************************
Orion video driver by <NAME>
22/04/2008 Orion Pro added
02/04/2008 Preliminary driver.
****************************************************************************/... |
// Copyright 2020 <NAME>
#include "../../modules/task_1/rezantsev_s_strassen/strassen.h"
#include <algorithm>
double* sumMatrix(double* a, double* b, int n) {
double* res = new double[n * n];
for (int i = 0; i < n * n; i++) res[i] = a[i] + b[i];
return res;
}
int checkSize(int n) {
int m = 2;
while (n > m) ... |
/*
Copyright (c) 2015, Advanced Micro Devices, 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 above copyright notice, this list of conditions and t... |
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... |
#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
#include <algorithm>
#include <fcntl.h>
#include "../Utility/Utility.h"
#include "../Progresscounter/Progresscounter.h"
#include "Path.h"
#ifdef _WIN32
// Used for _kbhit() and _getch().
#include <conio.h>
#else
#endif
using namespace std;
c... |
// --------------------------------------------------------------------------
// OpenMS -- Open-Source Mass Spectrometry
// --------------------------------------------------------------------------
// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
// ETH Zurich, and Freie Universit... |
#include "util.h"
#include "mbr.h"
#include <sys/ioctl.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <QFile>
#include <QFileInfo>
#include <QProcess>
#include <QDebug>
#include <QList>
#include <QtEndian>
/*
* Convenience functions
*
* Initial au... |
//
// APyTools.cpp
// nebulosity3
//
// Created by <NAME> on 2/6/15.
/*
BSD 3-Clause License
Copyright (c) 2021, <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 so... |
#include "MainComponent.h"
MainComponent::ReferenceCountedBuffer::ReferenceCountedBuffer(const juce::String& nameToUse,
int numChannels,
int numSamples) :
name(nameToUse),
buffer(numChannels, numSamples)
{
DBG(juce::String("Buffer named '") + name + "' constructed. numChannels = " + juce::String(nu... |
/***************************************************************************
Video Hardware for Double Dragon (bootleg) & Double Dragon II
***************************************************************************/
#include "driver.h"
#include "vidhrdw/generic.h"
#include <stdio.h>
unsigned char *dd_videoram;
in... |
#include "AppClass.h"
//Application Class
AppClass::AppClass(std::string a_windowName) : m_sWindowName(a_windowName) {}
AppClass::AppClass(AppClass const& input) {}
AppClass& AppClass::operator=(AppClass const& input) { return *this; }
AppClass::~AppClass(void){ Release(); }
void AppClass::Run(void)
{
//Initialize the... |
// Original work Copyright (c) 2017, University of Minnesota
// Modified work Copyright 2020, <NAME>
//
// ADMM-Elastic Uses the BSD 2-Clause License (http://www.opensource.org/licenses/BSD-2-Clause)
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the ... |
// This example shows how to define tombstones for your type.
#include <cassert>
#include <iostream>
#include <foonathan/tiny/check_size.hpp> // for `tiny::check_size`
#include <foonathan/tiny/optional_impl.hpp> // for `tiny::optional_impl`
#include <foonathan/tiny/tombstone.hpp> // for `tiny::tombstone_traits... |
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "save2json.h"
#include "engine/cmd.h"
#include "engine/cmd.gen.h"
#include "engine/cmd_specific.gen.h"
#... |
#include "options.h"
#include "read.h"
#include "gh.h"
#include "utils.h"
#include <ctime>
#include <sstream>
#include <iomanip>
#include "constants.h"
#ifdef WITH_MPI
// only include if the mpi version is being compiled
#include "mpi.h"
#endif
void print_usage()
{
cout << "\nUsage:" << APPNAME << " [options... |
///////////////////////////////////////////////////////////////////////////////
// SOFTWARE COPYRIGHT NOTICE AGREEMENT //
// This software and its documentation are copyright (2010) by the //
// Broad Institute. All rights are reserved. This software is supplied //
... |
#include "cbase.h"
#include "editorcommon.h"
void CHLSL_Solver_Parallax::OnWriteFXC(bool bIsPixelShader, WriteContext_FXC &context) {
const char *pszFuncPOM = "CalcParallaxUV_POM";
const char *pszFuncRelief = "CalcParallaxUV_Relief";
const char *pszFalse = "false";
const char *pszTrue = "true";
... |
/*=========================================================================
Library: TubeTK
Copyright 2010 Kitware Inc. 28 Corporate Drive,
Clifton Park, NY, 12065, USA.
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Lic... |
// -*-c++-*-
/*
* Copyright (C) 2004 <NAME> http://digitalmind.de
*
*
* The Open Scene Graph (OSG) is a cross platform C++/OpenGL library for
* real-time rendering of large 3D photo-realistic models.
* The OSG homepage is http://www.openscenegraph.org/
*
* This software is free software; you can redistribute it and... |
#include "motor_shield.h"
//Global tracking the timer status for timed engine-control
int16_t dirA_buff = -1;
int16_t powA_buff = -1;
int16_t dirB_buff = -1;
int16_t powB_buff = -1;
bool timerRequested = false;
bool timerRunning = false;
int16_t timerVal = -1;
//
//Callback for "engineA" Service
//
void ctrlEngineA(c... |
// -*-Mode: C++;-*-
// * BeginRiceCopyright *****************************************************
//
// $HeadURL$
// $Id$
//
// --------------------------------------------------------------------------
// Part of HPCToolkit (hpctoolkit.org)
//
// Information about sources of support for research and development of
//... |
/* Copyright (c) 2015-2021 The Khronos Group Inc.
* Copyright (c) 2015-2021 Valve Corporation
* Copyright (c) 2015-2021 LunarG, Inc.
* Copyright (C) 2015-2021 Google Inc.
* Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "L... |
/**
* @file bus.cc
*
* @copyright 2019 3081 Staff, All rights reserved.
*/
#include "src/bus.h"
Bus::Bus(std::string name, Route * out, Route * in,
int capacity, double speed, std::string type) {
name_ = name;
outgoing_route_ = out;
incoming_route_ = in;
passenger_max_capacity_ = capacity;
sp... |
#include <iostream>
#include <Eigen/Dense>
#include <rgbd_simulation/rgbd_primitives.hpp>
#define VTK_EXCLUDE_STRSTREAM_HEADERS
#include <lcm/lcm-cpp.hpp>
#include <pronto_utils/pronto_vis.hpp> // visualize pt clds
#include <ConciseArgs>
using namespace std;
using namespace Eigen;
class Pass{
public:
Pas... |
// Copyright (c) 2009 The Chromium 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 <iostream>
#include <signal.h>
#include <X11/Xlib.h>
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/file_path.h"
#... |
/// <J_WINDOW> ////////////////////////////////////////////////////////////////
const std::string J_Window::WINDOW_FILE = RES_DIR_DATA "Window.dat";
std::string J_Window::title = "\0";
int J_Window::startWidth = 0, J_Window::startHeight = 0;
int J_Window::cachedWidth = 0, J_Window::cachedHeight = 0;
int J_Window::scre... |
//*************************************************************************************
/** \file main.cpp
* This file contains the main() code for a program which tests various features of
* the ME405/ME507/FreeRTOS software package. Tests include sending data from tasks
* to other tasks by several means a... |
/**
* @file sample_computationalgeometry_computationalgeometry.cpp
* @brief Sample of computational geometry.
*
* @section LICENSE
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTA... |
#include "Somfy.h"
Somfy::Somfy(byte RFSenderPin, unsigned int startId){
portRF = RFSenderPin;
startRemoteId = startId;
}
void Somfy::AddRemote(char* remoteName)
{
//for debugging purposes
/* String result;
result = "remotes.size() : " + String(remotes.size());
result += "\neepromAddress ... |
/*
This piece of software acts as like a HD44780 LCD on the I2C bus.
The Nano receives the HD44780 instructions as an I2C slave using the default pins A4 (SDA) and A5 (SCL).
It applies the instructions to a local representation of the display content. On each change
of the display content it sends the whole... |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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... |
/**
* @file expression_tree.cc
* @author <NAME> <<EMAIL>>
*
* @section LICENSE
*
* The MIT License
*
* Copyright (c) 2014 <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 t... |
#include "stdafx.h"
#include <Windows.h>
#include "RapidXML\rapidxml.hpp"
#include <vector>
#include <fstream>
#include <regex>
using namespace rapidxml;
class Policy {
public:
std::string policyname;
std::string registrykey;
Policy(std::string tpolicyname, std::string tregistrykey) {
policyname = tpolicyname;
... |
/*
ID: sireric1
LANG: C++11
TASK: camelot
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
template <typename T1, typename T2>
ostream &operator <<(ostream &os, pair<T1, T2> p){os << p.first << " " << p.second; return os;}
template <typename T... |
/**
* @file
* @brief Implementation of module EtaCalculation
*
* @copyright Copyright (c) 2017-2022 CERN and the Corryvreckan authors.
* This software is distributed under the terms of the MIT License, copied verbatim in the file "LICENSE.md".
* In applying this license, CERN does not waive the privileges and imm... |
/*
Atanua Real-Time Logic Simulator
Copyright (c) 2008-2014 <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,
includi... |
#include "StdAfx.h"
#include "WindowData.h"
#include "GameControl.h"
#include "../Fonts/SDLFont.h"
#include "ROptionsGraphics.h"
#include "RGame.h"
#include "Joystick.h"
#include "ROptions.h"
CROptions::CROptions()
{
m_pGameCtrl = CGameControl::GetInstance();
m_pSDLFontTitle = new CSDLFont( CMultiLan... |
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double PI=acos(-1.0);
#define t1(x) cerr<<#x<<"="<<x<<endl
#define t2(x, y) cerr<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl
#define t3(x, y, z) cerr<<#x<<"=" <<x<<" "<<#y<<"=... |
#include <iostream>
unsigned long long s = 0;
unsigned long long p = 1000000001;
unsigned long long f(unsigned long long x){
return (x % p + s % p) % p;
}
struct Node {
unsigned long long key{0};
unsigned long long sum{0};
unsigned long long height{0};
Node* left{nullptr};
Node* right{nullptr... |
#include <iostream>
#include <vector>
#include <cmath>
#include <mpi.h>
#include <omp.h>
#include <assert.h>
#include <cstdio>
using namespace std;
#ifdef INFO
void print_array(float *data, int rows, int cols, int rank) {
printf("\n***%d***\n", rank);
for(int i = 0; i < rows; i++) {
for(int j = 0; j < c... |
//===-- bind.cpp ----------------------------------------------------------===//
//
// LDC – the LLVM D compiler
//
// This file is distributed under the Boost Software License. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===... |
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2005, 2011 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
// File: excxx_example_database_read.cpp
#include <iostream>
#include <fstream>
#include <cstdlib>
#include "MyDb.hpp"
#include "gettingStartedCommon.hpp"
#i... |
#include "core/hepch.h"
#include "ModuleAudio.h"
#include "core/preferences/src/AudioPreferences.h"
#include <AK/SoundEngine/Common/AkMemoryMgr.h> // Memory Manager interface
#include <AK/SoundEngine/Common/AkModule.h> // Default memory manager
#include <AK/SoundEngine/Common/IAkStreamMgr.h> // Streaming Manager
#incl... |
/*
* Accounting.cc
*
* Created on: Apr 29, 2014
* Author: wilfeli
*/
#include <Eigen/Dense>
#include "Accounting.h"
#include "Contract.h"
#include "Tools.h"
void
AccountH::ac_W_end_step(Eigen::MatrixXd* s, double ut){
//stores utility
g_t.back() = ut;
//stores consumption of a good - assume consum... |
#include "RigidBody.h"
#include "Direction.h"
#include "BoundaryVector.h"
#include <iostream>
#include <fstream>
#include <gtest/gtest.h>
using namespace std;
using namespace ibpm;
double tol = 1e-14;
double lowtol = 1e-5;
class RigidBodyTest : public testing::Test {
protected:
RigidBody body;
};
TEST_F( RigidB... |
#include<vector>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
struct CanonicalHaffman {
struct node {
int val;
char code;
node *left, *right;
node(char c, int v) {
val = v; code = c;
left = right = NULL;
}
};
in... |
/*
* DifferentialKinematics.cpp
*
* Created on: Feb 2, 2011
* Author: joshua
*/
#include "Kinematics/DifferentialKinematics.h"
#include <stdio.h>
#include "math.h"
using namespace RSN;
DifferentialKinematics::DifferentialKinematics(float width_of_chassis) {
assert(width_of_chassis>0.0001);
width = width... |
/******************************************************************************
* Project: libspatialindex - A C++ library for spatial indexing
* Author: <NAME>, <EMAIL>
******************************************************************************
* Copyright (c) 2002, <NAME>
*
* All rights reserved.
*
* P... |
#include "Panel.hpp"
#include "Managers/AssetsManager.hpp"
#include "Managers/InputsManager.hpp"
#include "OS/SystemConfiguration.hpp"
Panel::Panel(nlohmann::json json) noexcept : Widget(json) {
auto ogSize = getSize();
if (auto it = json.find("sprite"); it != json.end())
setTexture(*it);
setSize(ogSize);
full... |
//
// tweakseq - provides an editor for and interface to various sequence alignment tools
//
// The MIT License (MIT)
//
/// Copyright (c) 2000-2017 <NAME>, <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software")... |
/**
* @file llattachmentsmgr.cpp
* @brief Manager for initiating attachments changes on the viewer
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it und... |
/**
* Copyright (c) 2021 OceanBase
* OceanBase CE is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BAS... |
#include "Controller.hpp"
#include "../Experiments/Experiment.hpp"
#include "../GlobalLog.hpp"
#include "../Input/Event.hpp"
#include "../OpenGLHeaders.hpp"
#include "Phenotype.hpp"
#include "Substrate.hpp"
#include <NeuralNetwork.h>
#include <btBulletDynamicsCommon.h>
void loadExperiments(Experiment* experiment, co... |
/*
* OXRS_Output.cpp
*
* An ESP32 library for handling binary commands and generating
* control events based on the output configuration. Including
* support for interlocks and timers.
*
*/
#include "Arduino.h"
#include "OXRS_Output.h"
void OXRS_Output::begin(eventCallback callback, uint8_t defa... |
// This file is part of the dune-xt-common project:
// https://github.com/dune-community/dune-xt-common
// Copyright 2009-2018 dune-xt-common developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://o... |
/* (c) <NAME>. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#include <stdlib.h> //rand
#include <base/system.h>
#include <engine/shared/config.h>
#include <engine/shared/network.h>
#include <maste... |
/**************************************************************
*
* 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 y... |
// Copyright 2010-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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
#include <stdio.h>
#include <sys/syscall.h> // syscall(SYS_gettid),
#include <sys/time.h>
#include <sys/types.h> // syscall(SYS_gettid),
#include <unistd.h> // syscall(SYS_gettid),
#include <bitset>
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <thread>
#... |
//////////////////////////
// 1. external includes //
//////////////////////////
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstdarg>
#include <string>
#include <omp.h>
#include "mex.h"
#include "matrix.h"
//////////////////////////
// 2. define statements //
//////////////////////////
#define M... |
#include "ros/ros.h"
#include "turtlesim/Pose.h"
#include "geometry_msgs/Twist.h"
// CONSTANTS
const char* NODE_NAME{"/pidLinController"};
const char* VEL_TOPIC{"/turtle1/cmd_vel"};
const char* POSE_TOPIC{"/turtle1/pose"};
const _Float32 LT {0.01}; // linear threshold
const float blinkFreq {100.0};
const float control... |
// <NAME> - 2126613
// <NAME> - 2126745
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <utility>
#include <iomanip>
#include <limits>
#include <chrono>
#include <cmath>
// #define TESTING
const double INFTY = std::numeric_limits<double>::in... |
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, 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 restrictio... |
// @@@ START COPYRIGHT @@@
//
// 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.