text stringlengths 3.08k 12.5k |
|---|
/**
* @file main.cpp
* @copyright Copyright (c) 2020 University of Turku, MIT License
* @author <NAME>
* @author <NAME>
*/
#include <memory>
#include <loguru.hpp>
#include <nlohmann/json.hpp>
#include <ftl/configuration.hpp>
#include <ftl/net/universe.hpp>
#include <ftl/net_configurable.hpp>
#include <ftl/rgbd.... |
#include <iostream>
#include <string>
#include <thread>
#include <atomic>
#include <mutex>
#include "../hdcs_networking.h"
using namespace std;
using namespace hdcs::networking;
// record sending request times
atomic<uint64_t> send_index(0);
// receive ack times.
atomic<uint64_t> receive_index(0);
mutex send_lock;
... |
/* SWAPCHAIN FRAME.cpp
* by Lut99
*
* Created:
* 08/09/2021, 15:38:52
* Last edited:
* 08/09/2021, 15:38:52
* Auto updated?
* Yes
*
* Description:
* Contains data needed to draw to a single frame returned by the
* swapchain.
**/
#include "tools/Logger.hpp"
#include "../auxillary/ErrorCodes.hpp"... |
/**
* Copyright © 2019 <NAME>. (<EMAIL>) All rights reserved.
* Authors: <NAME>. (<EMAIL>)
* All rights reserved.
* License: see LICENSE.txt
*
* 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 ... |
/*****************************************************************
* Copyright (c) <NAME>. All rights reserved. *
* This file is part of FMIKit. See LICENSE.txt in the project *
* root for license information. *
**************************************************************... |
#include "detectorconstruction.hh"
// contructor
detectorconstruction::detectorconstruction()
{}
// destructor
detectorconstruction::~detectorconstruction()
{}
// define a function to create NaI detectors
// add properties and volumenes
G4VPhysicalVolume* detectorconstruction::Construct()
{
// Get nist material ma... |
#pragma once
#include "stat.h"
#include <cassert>
StatDiff::operator bool() const {
return Flag != 0
|| HP != 0
|| ATK != 0
|| DEF != 0
|| GR != 0
|| YK != 0
|| GK != 0
|| BK != 0;
}
StatDiff::operator Stat() const {
return {
Flag : Flag,
HP : HP,
ATK : ATK,
DEF : DEF,
GR : GR,
YK : YK,
... |
/*
* Copyright (c) 2010 Yahoo! 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 applicable law or a... |
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** proxy.cpp
**
** WS-Discovery proxy
**
** -------------------... |
#include <Common/Voxels/WorldGenerator.hpp>
#include <Common/Voxels/FastNoise.h>
#include <Common/Voxels/BlockRegistry.hpp>
#include <math.h>
#include <string.h>
#include <Common/Voxels/Voronoi.h>
#define JC_VORONOI_IMPLEMENTATION
using namespace phx;
WorldGenerator::Params WorldGenerator::params;
FastNoise heightN... |
#include "NavigationGrid.h"
#include "../../Common/Assets.h"
#include <fstream>
using namespace NCL;
using namespace CSC8503;
const int LEFT_NODE = 0;
const int RIGHT_NODE = 1;
const int TOP_NODE = 2;
const int BOTTOM_NODE = 3;
const char WALL_NODE = 'x';
const char FLOOR_NODE = '.';
NavigationGrid::NavigationGr... |
/*!
* \file CMultizoneOutput.cpp
* \brief Main subroutines for multizone output
* \author <NAME>, <NAME>
* \version 7.0.6 "Blackbird"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2020, SU2 Contributo... |
#include <stdio.h>
#include <queue>
#include <vector>
#include "knnSearch.h"
#include "vptree.cuh"
#include "knnSearch.h"
#include "QuickSelect.cuh"
double dist(double* X, double* Y, int dim)
{
double dist = 0.0;
for (int i = 0; i < dim; i++)
dist += (X[i] - Y[i]) * (X[i] - Y[i]);
return sqrt(dist)... |
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include <winnls.h>
#include <tchar.h>
#include <stdio.h>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#ifdef _UNICODE
typedef std::wstring tstring;
#else
typedef ... |
#include <iostream>
#include <random>
#include <chrono>
#include <list>
#include <unordered_map>
#include <memory>
#include <vector>
#include <SDL2/SDL.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/quaternion.hpp>
#include <glm/gtx/rotate_vector.hpp... |
#include "ofApp.h"
#include <random>
ofTrueTypeFont font;
ofFbo buffer;
int seed;
std::string seedstring;
const int width = 2000;
const int height = 2000;
int res = 300;
int states[2000][2000];
double time_limit = 1;
double noise_seed;
std::mt19937 engine;
double gaussian(double mean, double deviation) {
std:... |
#include <node.h>
#include <vips/vips8>
#include "nan.h"
#include "common.h"
#include "metadata.h"
using v8::Handle;
using v8::Local;
using v8::Value;
using v8::Object;
using v8::Number;
using v8::String;
using v8::Boolean;
using v8::Function;
using v8::Exception;
using Nan::AsyncQueueWorker;
using Nan::AsyncWorker... |
#pragma once
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <array>
#include <vector>
#include <unordered_map>
#include <memory.h>
#include "../utils.hpp"
#include "../def.hpp"
... |
/*
SELECT (((((STR(all_employees.id)+': ')+all_employees.name)+' (')+STR(all_employees.active))+')') AS employee, ((((STR(all_employees.id)+' ')+employee)+' ')+STR(founded)) AS employee2 FROM Example1.Company WHERE (employee2 LIKE '.*true.*')
with (company = parseFromFile()) {
for each all_employee in company.all_em... |
#include <iostream>
#include <iomanip> //setw() , setfill()
#include <vector>
#include <algorithm> // std::sort
using namespace std;
/*1.1. Write a class Time with three fields hr, min, sec representing hour, minutes, seconds. Store time in 24 hour format.
A constructor is used to initialize time objects, which ta... |
#include "init.h"
Weight weightInitialTree(Graph& G, Vertex root, vector<Vertex> &terminalsMap, vector<Vertex> &terminals){
return incrementalDijks3(G,root,terminalsMap,terminals).pruneLeaves();
}
Tree spanningTree(Graph& G, Vertex root){
if (root < 0 || root > G.numberVertices) throw "spanningTree";
Tree... |
#include "2020/day11/cpp/include/day11.hpp"
#include <algorithm>
#include <map>
#include "utils/cpp/include/utils.hpp"
using day11::input_type;
using day11::output_type;
using neighbor_map =
std::map<std::pair<int, int>, std::vector<std::pair<int, int>>>;
using positions = std::vector<std::pair<int, int>>;
posi... |
/*
* Copyright (C) 2008 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... |
/*
The MIT License (MIT)
Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <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, co... |
#include <iostream>
#include <fstream>
#include <thread>
#if defined (TF_LITE_1_13) || defined (TF_LITE_1_14)
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/version.h"
#include "tensorflow/lite/optional_debug_tools.h"
#else
#include "tensorflow/cont... |
#include "plainx.h"
#include "console.h"
#define ES_CONSOLE_UPDATE 10
CConsole::CConsole()
: CListener()
{
m_iFPS = 0;
m_iFpsId = -1;
m_iInputId = -1;
m_iStatusId = -1;
m_szStatus[0] = 0;
m_bIsDrawCursor = TRUE;
m_iCurrCmd = 0;
for (int i = 0; i < CON_MAX_CMD; i++) {
m_cmd[i].iCmdPos = 0;
m_cmd[i].szCmd... |
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2011, MBARI.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions... |
/*
* Copyright 2019 Carnegie Technologies
*
* 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 l... |
#include "dataload_can.h"
#include <QTextStream>
#include <QFile>
#include <QMessageBox>
#include <QDebug>
#include <QSettings>
#include <QProgressDialog>
#include <QFileDialog>
#include <QRegularExpression>
#include "fstream"
// Regular expression for log files created by candump -L
// Captured groups: time, channel,... |
/* This is a temporary fix since we do not support this mode with pub/sub yet */
#define UWS_ALLOW_SHARED_AND_DEDICATED_COMPRESSOR_MIX
/* Zlib bug should not affect testing */
#define UWS_ALLOW_8_WINDOW_BITS
#include "../src/WebSocketExtensions.h"
#include <iostream>
void testNegotiation(bool wantCompression, int w... |
#include <vector>
#include <climits>
#include <set>
const int kINF = INT_MAX;
struct Vertex {
explicit Vertex(int to = 0, int cost = 0) : to_(to), cost_(cost) {}
int to_, cost_;
int to() const {
return to_;
}
int cost() const {
return cost_;
}
};
struct Edge {
explicit E... |
/*******************************************************************************
* include/util/common.hpp
*
* Copyright (C) 2018 <NAME> <<EMAIL>>
*
* All rights reserved. Published under the BSD-2 license in the LICENSE file.
******************************************************************************/
#pragm... |
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2013, Image Engine Design 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:
//
// * Re... |
/* Copyright (c) 2010, Cedrus Corporation
* 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 condit... |
/*
* 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, di... |
#include <iostream>
#include "IOMC/EventVertexGenerators/test/BoostTester.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
// essentials !!!
#include "FWCore/Framework/interface/Event.h"
//#include "FWCore/Framework/interface/Handle.h"
#include "DataFormats/Common/interface/Handle.h"
#includ... |
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
typedef struct NODE {
int data, left, right, cover, num, sum, delta;
bool en;
NODE *leftchild, *rightchild;
} node;
node *tree, *p;
int cnt = 0;
void construct_seg(node *cur, int l, int r) {//Each... |
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<utility>
#ifdef XS
#include<De>
#endif
using namespace std;
#define MS(m) memset(m,0,sizeof(m))
typedef unsigned U;
typedef pair<int,int > P;
typedef long long ll;
void inp();
int main(){
#ifdef XS
freopen("spoj375.in","r",stdin);
#end... |
#include<iostream>
#include<vector>
#include<fstream>
#include <boost/math/special_functions/gamma.hpp>
const int X=0;
const int O2=1;
const int G=2;
const int Xy=3;
const int A=4;
const int B=5;
void get_rhs(std::vector<double>& rhs,std::vector<double> solnvec,double t,int nvars)
{
// ------- MODEL CONSTANTS -----... |
/**
* @file sensorDS18x20.cpp
* @copyright 2020 <NAME>
* Used for Wio Terminal testing, mostly mashup
* @author <NAME> <<EMAIL>>
*
* @brief UI Help
*/
// Included Dependencies
#include "sensorDS18x20.h"
//sensorDS18x20::sensorDS18x20() {}
//sensorDS18x20::~sensorDS18x20() {}
//sensorDS18x20:: {}
// Inclu... |
#include "Analog.h"
/*=====================================================================*\
| ESP32 measurable input voltage range:
| -----------------+-----------------
| ADC_ATTEN_DB_0 | 100 mV ~ 950 mV
| ADC_ATTEN_DB_2_5 | 100 mV ~ 1250 mV
| ADC_ATTEN_DB_6 | 150 mV ~ 1750 mV
| ADC_ATTEN_DB_11 ... |
/*
* Copyright (c) 2021, the neonavigation authors
* 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, ... |
// Copyright (c) 2019-2021, The Khronos Group Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICEN... |
/*
* bme280.cpp
*
* Created on: 11.12.2017
* Author: thomas
*/
#include "include/GxEPD.h"
static char tag[] = "GxEPD";
void GxEPD::init() {
dispWin = {
.x1 = 0,
.y1 = 0,
.x2 = GxGDEW075T8_WIDTH-1,
.y2 = GxGDEW075T8_HEIGHT-1,
};
_width = GxGDEW075T8_WIDTH;
_height = GxGDEW075T8_HEIGHT;
... |
/***************************************************************************
* Copyright (C) 2008 by <NAME> *
* <EMAIL> *
* *
* This program is free software; yo... |
#include <Python.h>
#include <map>
#include <memory>
#include <vector>
#include <string>
#include <iostream>
#include "PyVersionedObjectsOfType.hpp"
#include "VersionedObjectsOfType.hpp"
#include "VersionedIdSets.hpp"
#include "../typed_python/Type.hpp"
#include "../typed_python/PyInstance.hpp"
class PyVersionedObjec... |
extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "cl_min.h"
#include <pcre.h>
}
#include <Rcpp.h>
/* short quasi-header */
Attribute* make_s_attribute(SEXP corpus, SEXP s_attribute, SEXP registry);
Attribute* make_p_attribute(SEXP corpus, SEXP p_attribut... |
//
// OctreeInboundPacketProcessor.cpp
// assignment-client/src/octree
//
// Created by <NAME> on 8/21/13.
// Copyright 2013 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <PacketHead... |
////////////////////////////////////////////////////////////////
// CursorBasicView.cc
//
// Abstract class for views containing cursor information.
//
///////////////////////////////////////////////////////////////
#include "CursorBasicView.h"
#include "CursorModel.h"
#include "ImageData.h"
#include <Xm/Label.h>
#incl... |
#include <pch.h>
#include "Day1.h"
#include <fstream>
#include <iostream>
#include <vector>
#include <numeric>
#include <string>
#include <assert.h>
#include <array>
Day1::Day1()
= default;
Day1::~Day1()
= default;
//// PART 1 /////
/*
--- Day 1: The Tyranny of the Rocket Equation ---
Santa has become stranded at t... |
// 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/extensions/external_pref_extension_loader.h"
#include "base/bind.h"
#include "base/file_path.h"
#include "base/file_util.h"
... |
#include <stdio.h>
#include <GL/glut.h>
float x = 0, y = 0, referencia = 2;
float rf = referencia / 2;
float ri = -rf;
void Background()
{
glClearColor(1, 1, 1, 0);
glClear(GL_COLOR_BUFFER_BIT);
}
void Points()
{
glPointSize(10);
glBegin(GL_POINTS);
glColor3f(1, 0, 0);
glVertex2f(0.0, 0.0);
glVertex2f(... |
#define _CRT_SECURE_NO_WARNINGS
extern "C"
{
#include "hlslcc.h"
};
#include <string>
#include <stdio.h>
#define GL_VERTEX_SHADER 0x8B31
const int gNumAttriSems = 16;
const char* gAttriSematics[][2] = {
"VPOSITION", "VPOSITION0",
"VCOLOR", "VCOLOR0",
"VNORMAL", "VNORMAL0",
"VTANGENT", "VTANGENT0",
"VBINORMAL", ... |
// $Id: client.cpp 91825 2010-09-17 09:10:22Z johnnyw $
#include "ace/Get_Opt.h"
#include "testC.h"
#include "tao/RTCORBA/RTCORBA.h"
#include "tao/ORB_Core.h"
#include "ace/Task.h"
#include "../check_supported_priorities.cpp"
static const ACE_TCHAR *ior = ACE_TEXT("file://ior_1");
static int iterations = 12;
static C... |
//a34021501 {{{
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define SZ(x) ((int)((x).size()))
#define ALL(x) begin(x),end(x)
#define REP(i,x) for (int i=0; i<(x); i++)
#de... |
/// -*- tab-width: 4; Mode: C++; 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 as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include <windows.h>
#include <winn... |
/*************************************************************************
Gestion entree - tache gerant les barrieres d'entree
----------------------------------------------------
debut : 18/03/2016
binome : B3330
*************************************************************************/
/... |
#include <iostream>
#include <random>
#include <vector>
#include <thread>
#include <byteswap.h>
#include <pthread.h>
#include "config.h"
#include "compiler.hh"
#include "sampling.hh"
#include "masstree.hh"
#include "kvthread.hh"
#include "masstree_tcursor.hh"
#include "masstree_insert.hh"
#include "masstree_print.hh... |
#pragma once
// Libraries
#include <math.h>
#include <assert.h>
class FVector;
class FRotator;
class Vector3;
float DegToRad(float x);
float RadToDeg(float x);
float DistancePointToLine(FVector Point, FVector LineOrigin, FVector Dir);
// Class Vector2
// This class represents a 2D vector.
class Vector2... |
// Nombre del alumno <NAME>
// Usuario del Juez DG24
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include "Grafo.h"
#include "queue_eda.h"
#include "ConjuntosDisjuntos.h"
#include <string>
#include <sstream>
const std::vector<int> incF = {-1,-1,0,1,1,1,0,-1 };
const std::vector<int> ... |
/*
* LEGAL NOTICE
* This computer software was prepared by Battelle Memorial Institute,
* hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830
* with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE
* CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
* LIABILITY FOR THE USE OF... |
/*
* Copyright (c) 2008 <NAME>, <NAME>, <NAME>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR... |
/*
* Copyright (c) 2008-2016, Integrity Project Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list ... |
/*
* Copyright 2009 Rensselaer Polytechnic Institute
* 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.
*
* Thi... |
//
// WhiteNoiseStimulus.cpp
// NeuralNetworkCode
//
// Created by <NAME> on 02/03/2017.
// Copyright © 2017 <NAME>. All rights reserved.
//
#include "WhiteNoiseStimulus.hpp"
WhiteNoiseStimulus::WhiteNoiseStimulus(NeuronPopSample *neur,std::vector<std::string> *input,GlobalSimInfo * info):Stimulus(ne... |
#include <EEPROM.h>
#include <TinyGPS++.h> // library for GPS module
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <Adafruit_Si7021.h>
#include <ArduinoJson.h>
#include <ESP8266HTTPClient.h>
#define analog A0
#define ledPower D4
String dust_str = "0.00", date_str , time_str , lat_str , lng_str, temp_s... |
#include "replace_function.h"
#include "BufferManagerProducer.h"
#include "ignore_ins.h"
#include "speculation.h"
using namespace std;
struct fake_inst_info_t {
fake_inst_info_t(ADDRINT _pc, size_t _len)
: pc(_pc)
, len(_len) {}
bool operator==(const fake_inst_info_t& rhs) { return pc == rhs.... |
///////////////////////////////////////////////////
//
// Dual Counter - VCV Module
//
// Strum 2017
// Thanks to ML for the diaplay code
//
///////////////////////////////////////////////////
#include "mental.hpp"
#include "dsp/digital.hpp"
#include <sstream>
#include <iomanip>
struct MentalCounters : Module... |
////////////////////////////////////////////////////////////////////////////////
//
// Package: RoadNarrows Robotics ROS Chess Engine Package
//
// Link: https://github.com/roadnarrows-robotics/chess_engine
//
// ROS Node: chess_server
//
// File: chess_as_mam.cpp
//
/*! \file
*
* \brief Make a move acti... |
/*
* Copyright (C) 2018 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... |
//
// whois.cpp
// MikrotikManager
//
// Created by <NAME> on 08/07/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
/*
MIT License
Copyright (c) 2017 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentati... |
#include "select_knn_cpu.h"
#include "helpers.h"
#include "utils.h"
#include <torch/extension.h>
#include <string> //size_t, just for helper function
#include <cmath>
float calculateDistance(
size_t i_v,
size_t j_v,
const float_t *d_coord,
size_t n_coords)
{
float distsq = 0;
if (i_v == j_... |
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define FZ(n) memset((n),0,sizeof(n))
#define FMO(n) memset((n),-1,sizeof(n))
#define F first
#define S second
#define PB push_back
#define ALL(x) begin(x),end(x)
#define SZ(x) ((int)(x).size())
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
template... |
/* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** ... |
/*
* 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 source code must retain the above copyright
* notice, this list of ... |
#include <gstreamer-1.0/gst/gst.h>
#include <gstreamer-1.0/gst/gstelement.h>
#include <gstreamer-1.0/gst/gstpipeline.h>
#include <gstreamer-1.0/gst/gstutils.h>
#include <gstreamer-1.0/gst/app/gstappsrc.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <cstdio>
#include <signal.h>
#incl... |
#include <iostream>
#ifdef VCPKG
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#include "client/windows/handler/exception_handler.h"
#elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
#include "client/mac/handler/exception_handler.h"
#endif
#endif
... |
// GetMemoryUsage, GetTotalMemory, GetCPUUsage from https://stackoverflow.com/a/64166/4061051
#include "GarrysMod/Lua/Interface.h"
#include <stdio.h>
using namespace GarrysMod::Lua;
#if defined(_WIN32) && !defined(__linux__)
#include "windows.h"
#include "psapi.h"
#include "TCHAR.h"
#include "pdh.h"
static HA... |
#include <math.h>
#include <uWS/uWS.h>
#include <iostream>
#include <string>
#include "json.hpp"
#include "PID.h"
#include "twiddle.h"
// for convenience
using nlohmann::json;
using std::string;
using std::cout;
using std::endl;
// For converting back and forth between radians and degrees.
constexpr double pi() { ret... |
/* Copyright (c) 2019 ohtorii
* - Bug fix and more modification.
*
* The following is the original copyright notice.
*/
/*
* This code is derivative of guess.c of Gauche-0.8.3.
* The following is the original copyright notice.
*/
/*
* guess.c - guessing character encoding
*
* Copyright (c) 2000-2003 <N... |
#include <cybozu/mmap.hpp>
#define XBYAK_NO_OP_NAMES
#include <xbyak/xbyak_util.h>
#include <stdint.h>
#include <assert.h>
#ifdef _MSC_VER
#include <intrin.h>
#else
#include <x86intrin.h>
#endif
typedef const char * (*FindType)(const char *, size_t, const char *, size_t);
FindType findRange0;
FindType findRange1;
Fin... |
#include "help_functions.hpp"
#include <command_line_args.hpp>
#include <types/splitted_string.hpp>
#include <iostream>
#include <fstream>
#include <memory>
#include <algorithm> // any_of
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#ifdef WIN32
#include <windows.h> // file_size
#include <fileapi... |
/*
* File: pregunta2.hxx
* Author: <NAME>
*
* Created on 3 de Diciembre de 2015, 13:06
*/
/*************************
* Constructor vacío.
*************************/
Pregunta::Pregunta() {
this->Num_preg = 0;
this->Enunciado = "";
}
/****************************
* Constructor de copia.
**********... |
#include <iostream>
#include <Windows.h>
using std::cout;
using std::endl;
using std::wcout;
void test_1()
{
// 获取环境变量
// WINDIR: //系统目录 - C:\WINDOWS
// SYSTEMROOT: //系统目录 - C:\WINDOWS
// SYSTEMDRIVE: //系统根目录 - C:
// HOMEDRIVE: //当前用户根目录 - C:
// USER... |
#include <iostream>
#include <sstream>
#include "subflow.h"
#include "parser_utility.h"
using namespace std;
string get_timestamp_display(double timestamp){
stringstream string_builder;
string_builder << fixed;
if (timestamp == MP_UNINITIALIZED_TS){
string_builder << "- ";
} else{
string_builder << ti... |
/*
* Pathtracer based on <NAME>'s 'Ray Tracing in One Weekend' e-book
* series.
*
* Copyright (C) 2017 by <NAME> - <EMAIL>
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
#include "Triangle.h"
Triangle::Triangle(const Vector3& v0, const Vector2& t0,
const ... |
//====- LowerToLLVM.cpp - Lowering from Pinch+Affine+Std to LLVM ------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===-------------------------... |
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define NDEBUG
#include <ctime>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long i64;
#define NMAX 100000
#define EPS 1e-9
struct Point {
Point() : x(0), y(0) {}
Po... |
#include "Tetris.h"
#include <stdio.h>
#include <stdlib.h>
bool TableMounter2D::insert(UnitMounter2D *unit) {
for (int y = 0; y < altura; y++) {
for (int x = -4; x <= 4; x++) {
if (unit->colide(AABB(vec2(x, y) - vec2(0.4), vec2(x, y) + vec2(0.4)))) {
table[y][x + 4] = true;
... |
// Spatial Index Library
//
// Copyright (C) 2002 Navel Ltd.
//
// 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 vers... |
/*
* ========================= gl_support.cpp ==========================
* -- tpr --
* CREATE -- 2018.11.21
* MODIFY --
* ----------------------------------------------------------
* 支援 main 函数的 子函数。
* -----... |
#include "world.h"
#include <thread>
#include <maya/MSceneMessage.h>
#include <maya/MGlobal.h>
#include "mayaSceneFactory.h"
#include "renderGlobalsFactory.h"
#include "rendering/rendererFactory.h"
#include "threads/renderQueueWorker.h"
#include "utilities/logging.h"
static MCallbackId timerCallbackId = 0;
static MCal... |
#include "hai_detector.h"
hai_detector::hai_detector() {
double threshold_init[11] = { 0.96,0.98,0.96,0.93,0.94,0.92,0.97,0.95,0.97,0.97,0.95 };
// 1 2 3 9 5 6 7 8 4 4 5
cv::String img_path = "../img/";
cv::String hainame = img_path + "bamboo_hai_";
cv::String haimigi = "right_";
cv:... |
#include "Soldier.h"
#include <JimmyGodEngine/Inc/JimmyGodEngine.h>
using namespace Steering;
using namespace JimmyGod;
using namespace JimmyGod::AI;
using namespace JimmyGod::Math;
using namespace JimmyGod::Graphics;
Soldier::Soldier(JimmyGod::AI::AIWorld & world)
:JimmyGod::AI::Agent(world, (uint32_t)1)
... |
/*
* 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, modify, merge, publish, distr... |
/* labx2000 keypad and display project
* this attempt is with lpc1343, using Olimex P1343 dev kit (8 LED's :)
*/
#include "gpio.h"
#include "lpc13xx.h"
#include "nvic.h"
//shared ~millisecond services:
#include "msservice.h"
CyclicTimer ledToggle(750); //todo: clearer timebase
RegisterTimer(ledToggle); //a polle... |
#include "Backtrack.h"
static const float LerpTime()
{
static ConVar* updaterate = g_Interfaces.CVars->FindVar("cl_updaterate");
static ConVar* minupdate = g_Interfaces.CVars->FindVar("sv_minupdaterate");
static ConVar* maxupdate = g_Interfaces.CVars->FindVar("sv_maxupdaterate");
static ConVar* lerp = g_Interfaces... |
#include "util/common.h"
#include "kernel/sparse-table.h"
#include "kernel/global-table.h"
#include "util/static-initializers.h"
#include <gflags/gflags.h>
using std::tr1::unordered_map;
using namespace dsm;
int optimizer_hack;
DEFINE_int32(test_table_size, 100000, "");
#define START_TEST_PERF { Timer ... |
//
// Created by <NAME> on 7/3/20.
//
#include "LeetCodeLib.h"
/*
* @lc app=leetcode id=957 lang=cpp
*
* [957] Prison Cells After N Days
*
* https://leetcode.com/problems/prison-cells-after-n-days/description/
*
* algorithms
* Medium (38.18%)
* Likes: 612
* Dislikes: 885
* Total Accepted: 74.7K
* To... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.