text stringlengths 3.08k 12.5k |
|---|
#include "./utility/rt.h"
#include<math.h>
int M;
int N;
#define FLOAT_N 3214212.01
#define EPS 0.005
#define DATA_OFFSET 0
#define MEAN_OFFSET M * N
#define STDDEV_OFFSET M * N + M
#define SYMMAT_OFFSET M * N + M + M
void correlation_trace(double* data, double* mean, double* stddev, double* symmat) {
int i, j, j... |
/* (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 <base/math.h>
#include <base/vmath.h>
#include <game/generated/protocol.h>
#include <game/server/gamecontext.h>
#include <game/... |
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By <NAME>
// VC: 6.0
// basic Hierarchical Scene Node Class
//********************************************************************
#include "dVector.h"
#include "dMatrix.h"
#include "dQuaternion.h"... |
#include <algorithm>
#include <array>
#include <iostream>
#include <limits>
#include <map>
#include <vector>
#include <boost/range/irange.hpp>
/* ====================
* SHOP INVENTORY BEGIN
* ====================
*/
// the dmg and ac values can be represented by the index, since they are sequential
constexpr auto ... |
#include <iostream>
#include <thread>
#include <vector>
#include <xmmintrin.h>
#include <pmmintrin.h>
#include "camera.h"
#include "embree.h"
#include "hit.h"
#include "image.h"
#include "material.h"
#include "onb.h"
#include "ray.h"
#include "sphere.h"
#include "util.h"
#include "vec3.h"
const int w = 1920*4;
const... |
/*********************************************************************************************/
/* Problem: Prime Dates (HR) ********/
/*********************************************************************************************/
/*
--Problem statement:
In this challenge, the task is to debug the existing code to su... |
// Copyright 2014 BVLC and contributors.
#include <stdio.h> // for snprintf
#include <cuda_runtime.h>
#include <google/protobuf/text_format.h>
#include <leveldb/db.h>
#include <leveldb/write_batch.h>
#include <string>
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/net.hpp"
#i... |
// written by <NAME> 2008 - 2015
// this work is public domain. the code is undocumented, scruffy, untested, and should generally not be used for anything important.
// i do not offer support, so don't ask. to be used for inspiration :)
#include "gamedefines.hpp"
#include "base/log.hpp"
#include "base/utils.hp... |
#include "Debug/DebugConsole.hpp"
#include <cstring>
#include "Core/EncodingUtf8.hpp"
#include "Debug/DebugTextRenderer.hpp"
#include "Debug/DebugVectorRenderer.hpp"
#include "Engine/Engine.hpp"
#include "Resources/BitmapFont.hpp"
#include "System/InputManager.hpp"
#include "System/InputView.hpp"
#... |
/*
*****************************************************************************
* esp8266-S88n.h - library for using S88n on ESP8266
*
*****************************************************************************
*/
#include "esp8266-S88n.h"
void S88ISRProxy(void *pArg) {
S88nClass::S88ISRTrigger();
}
S88nCl... |
//
// Created by v4kst1z.
//
#include "TinyGC.h"
#include <cassert>
#include "Visitor.h"
TinyGC::TinyGC()
: visitor_(new Visitor()),
gc_phase_(GCPhase::kNone),
bytes_allocated_(0),
size_of_objects_(0),
gc_count_threshold_(120),
gc_bytes_threshold_(0x1000) {}
voi... |
/*
* Copyright (c) 2019 <NAME>
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <vector>
#include <algorithm>
#if defined(_WIN32) // windows
# define NOMINMAX // to remove min,max macro
# include <windows.h> // should be... |
#include "cbase.h"
#include "SkillAnimPanel.h"
#include "vgui/isurface.h"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
ConVar asw_skill_particle_size("asw_skill_particle_size", "40.0", 0, "Size of particles for the skill spending effect");
ConVar asw_skill_particle_gravity("... |
#include "legitbot.h"
// used: cheat variables
#include "../core/variables.h"
// used: main window open state
#include "../core/menu.h"
// used: key state
#include "../utilities/inputsystem.h"
// used: globals, cliententitylist interfaces
#include "../core/interfaces.h"
// used: backtracking
#include "lagcompensation.... |
template<typename T>
void solver_grid<T>::set(const shared_ptr<Problem>& P){
Solver::set(P);
numberV = ceil(width / label_width) +1;
numberH = ceil(height / label_height) +1;
gridP = vector<vector<T>>(numberH, vector<T>(numberV, T{}));
counter = vector<vector<int>>(numberH, vector<int>(param_k + 1, 0));
mark = v... |
#include <algorithm>
#include <array>
#include "Bot.h"
using namespace std;
//constructor
Bot::Bot()
{
};
//plays a single game of Ants.
void Bot::playGame()
{
//reads the game parameters and sets up
cin >> state;
state.setup();
endTurn();
// All the locations are unseen at the beginning
fo... |
#include "resource.h"
#include <windows.h>
#include <tchar.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "ugldialog.h"
#include "udlgapp.h"
#include "uglut.h"
#include "umsg.h"
using huys::UGLDialog;
float rotqube = 0.0f;
class MyGLDialog : public UGLDialog
{
public:
MyGLDialog(HINSTANCE hInst, UINT nID)... |
/*
** Copyright (C) 2000 <NAME> <<EMAIL>>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is d... |
#include "DarkSDK.h"
#include "physics.h"
// global variables - used for the camera
float g_fSpeed = 0.1f; // speed at which camera moves
float g_fTurn = 0.03f; // turn speed for mouse look
float g_fOldCamAngleX = 0.0f; // to store original x angle
float g_fOldCamAngleY = 0.0f; // to store original... |
#include "VelvetGraph.hh"
VelvetGraph::VelvetGraph( const string& seqFileName, const string& roadmapFileName, const string& pregraphFileName, bool flagReadTracking, int accelerationBits ){
sequences = importReadSet( VUtils::getCharFileName(seqFileName) );
convertSequences( sequences );
graph = importPreGraph( VU... |
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding... |
#include <stdio.h>
#include <fcntl.h> // File Control Definitions
#include <termios.h> // POSIX Terminal Control Definitions
#include <unistd.h> // UNIX Standard Definitions
#include <errno.h> // ERROR Number Definitions
#include <iostream>
#include <string>
#include "SerialPort.h"
using namespace std;... |
/*
* InputClass.cpp
*
* Created on: 10/apr/2015
* Author: <NAME>
*/
#include "Input.h"
void PairFiles::reset() {
this->pair_type = UnknownPair;
this->identify = "";
}
PairFiles::PairFiles() {
this->reset();
}
void PairFiles::init(const string& path_end1, const string& path_end2) {
this->reset();
th... |
//
// This file is part of the libWetCloth open source project
//
// The code is licensed solely for academic and non-commercial use under the
// terms of the Clear BSD License. The terms of the Clear BSD License are
// provided below. Other licenses may be obtained by contacting the faculty
// of the Columbia Computer... |
/*
* VGMTrans (c) 2002-2019
* Licensed under the zlib license,
* refer to the included LICENSE.txt file
*/
#include "CapcomSnesInstr.h"
#include "SNESDSP.h"
#include "CapcomSnesFormat.h"
#include <fmt/format.h>
// ****************
// CapcomSnesInstrSet
// ****************
CapcomSnesInstrSet::CapcomSnesInstrSet(R... |
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
struct tri {
int y, x1, x2;
};
bool operator<(const tri &a, const tri &b) {
if (a.y != b.y) return a.y > b.y;
else if (a.x1 != b.x1) return a.x1 <... |
/*
* Gamedev Framework (gf)
* Copyright (C) 2016-2022 <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 pu... |
#include <iostream>
#include <fstream>
#include "FunctionsProgram.h"
#include "Files.h"
#include "Definitions.h"
#include "DomainTree.h"
#include "MyString.h"
#include "Debug.h"
#include "RunControl.h"
#include "Domain.h"
#include "StandardFEM.h"
using namespace std;
extern Files files;
exte... |
//
// Created by <NAME> on 5/20/20.
//
#include "LeetCodeLib.h"
/*
* @lc app=leetcode id=975 lang=cpp
*
* [975] Odd Even Jump
*
* https://leetcode.com/problems/odd-even-jump/description/
*
* algorithms
* Hard (46.82%)
* Likes: 358
* Dislikes: 103
* Total Accepted: 14.4K
* Total Submissions: 31K
* T... |
// license:GPL-2.0+
// copyright-holders:<NAME>
#include "emu.h"
#include "cpu/sc61860/sc61860.h"
#include "includes/pocketc.h"
#include "includes/pc1403.h"
#include "machine/ram.h"
/* C-CE while reset, program will not be destroyed! */
/*
port 2:
bits 0,1: external rom a14,a15 lines
port 3:
bits ... |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkImageSinusoidSource.cxx
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distribut... |
/*
* MIT License
* Copyright (c) 2019 <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, merg... |
#include"Insieme_int.h"
#include<iostream>
using namespace std;
//CLASS SMARTP
Insieme_int::smartp::smartp(nodo* _point): point(_point) {
if(point) point->reference++; }
Insieme_int::smartp::smartp(const smartp& _sp): point(_sp.point) {
if(point) point->reference++; }
Insieme_int::smartp::~smartp() {
if(point) ... |
#include <ServoControler.h>
int pulseWidth(char angle)
{
int pulse_wide, analog_value;
pulse_wide = map(angle, 0, 180, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH);
analog_value = int(float(pulse_wide) / 1000000 * FREQUENCY * 4096);
Serial.println(analog_value);
return analog_value;
}
Serv::Serv() {
}
Serv::Serv(cons... |
#include "Animal.h"
#include "GenericPlayer.h"
#include "AI_Player.h"
#include "j1Map.h"
#include "j1Audio.h"
#include "SDL_mixer/include/SDL_mixer.h"
#include "ParticleSystem.h"
#include "Emiter.h"
Animal::Animal(EntityType g_type, iPoint g_current_tile) : DynamicEntity() {
type = g_type;
current_tile = g_current_... |
#include "AudioEngine/LineInput.h"
using namespace ci;
using namespace ci::app;
using namespace std;
#define RECORDRATE 44100
#define LOWLATENCY /* Only really suited to Windows Vista/7. XP/Directsound should avoid this. */
#ifdef LOWLATENCY
#define LATENCY ((RECORDRATE * 20) / 1000) /* 20 =... |
/*
* $Id: sample.cpp,v 1.23 2006/11/01 23:33:56 nathanst Exp $
*
* sample.cpp
* hog
*
* Created by <NAME> on 5/31/05.
* Copyright 2005 <NAME>, University of Alberta. All rights reserved.
*
* This file is part of HOG.
*
* HOG is free software; you can redistribute it and/or modify
* it under the terms of... |
#include "stdafx.h"
#include "dx103DFluidVolume.h"
#include "dx103DFluidManager.h"
dx103DFluidVolume::dx103DFluidVolume()
{
}
dx103DFluidVolume::~dx103DFluidVolume()
{
}
void dx103DFluidVolume::Load( LPCSTR N, IReader *data, u32 dwFlags )
{
// Uncomment this if choose to read from OGF
// dxRender_Visual::Load (N... |
/* <NAME> 2020
*
* See LICENSE file
*/
#include "malbolge/loader.hpp"
#include "malbolge/version.hpp"
#include "malbolge/utility/argument_parser.hpp"
#include "malbolge/debugger/script_parser.hpp"
#include <boost/asio/io_context.hpp>
#include <boost/asio/executor_work_guard.hpp>
#include <boost/asio/post.hpp>
#inc... |
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of condi... |
#include <cage-core/entitiesVisitor.h>
#include <cage-engine/scene.h>
#include <cage-simple/engine.h>
#include "../game.h"
#include "../grid.h"
#include <bitset>
bool MonsterComponent::affected(DamageTypeEnum dmg) const
{
return dots[(uint32)dmg].damage > 0;
}
uint32 bitCount(uint32 v)
{
return std::bitset<32>(v)... |
// Bucket Sort Program in C++
// Takes both whole numbers and floating point numbers as input
// Underlying sorting algorithm is Insertion Sory
#include <iomanip>
#include <iostream>
using namespace std;
#define NARRAY 10 // Array size
#define NBUCKET 6 // Number of buckets
#define INTERVAL 10 // Each bucket capa... |
#include <iostream>
#include <cmath>
#include <fstream>
#include <bitset>
#include <cstdio>
using namespace std;
const int MaxPrime = 60380000;
bitset<MaxPrime> PrimeSieve;
int Primes[10000000];
int Divisors[60000002]; //Divisors of numbers upto 60000001
inline int GetFactorCount(unsigned int num)
... |
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2015 Google Inc. http://bulletphysics.org
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 an... |
#include "NumeralFormat.h"
#include "CalcError.h"
#include <sstream>
#include <iomanip>
#include <stack>
#include <cmath>
// For integer and float conversion of integer only operators
long long NumeralConverter::toInteger(double value) {
double roundValue = value < 0 ? std::ceil(value) : std::floor(value);
i... |
#include <iostream>
#include <cmath>
#include <random>
#include <glm/gtc/matrix_transform.hpp>
#include "map.h"
#include "mathutils.h"
#include "randutils.h"
#include "tileset.h"
#include "water.h"
const float RADIUS = 0.5f;
const float TREE_SIZE_X = 0.025;
const float TREE_SIZE_Y = 0.025;
const float TREE_SIZE_Z = 0... |
/// Event log class methods.
#include "search.hpp"
/**
Event log constructor writes headers of event log files and clears if necessary.
Requires a boolean argument to specify whether to continue or restart the log files. If true, the existing files are
appended to. If false, the existing files are overwritten.
Also... |
/*++
Copyright (C) Microsoft Corporation, 2000
Module Name:
Test1
Abstract:
Test1 implementation.
Interactive Test verifying bug
Author:
<NAME> (ericperl) 06/22/2000
Environment:
Win32
Notes:
?Notes?
--*/
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_M... |
//
// Copyright (c) 2008-2019 the Urho3D project.
//
// 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, mod... |
#include "BotControl.hpp"
#include <ros/ros.h>
using namespace botcontrol;
BotControl::BotControl(ros::NodeHandle& nh) : nodehandle_(nh){
//load the param
if(!loadParam()){
ROS_ERROR("Error in loading the parameters.");
// ros::requestShutdown();
}
// declare all the subscriber and publisher
scan_sub_ = no... |
#include <cstdio>
#include <cstring>
#include <climits>
#include <algorithm>
#define MAXN 30100
using namespace std;
struct link
{
int to;
int nxt;
};
struct SegmentTree
{
int p, r, m;
int left, right;
int sum, maxx;
};
link e[2 * MAXN];
SegmentTree tree[MAXN * 2];
int pos[MAXN], val[MAXN], top[MAXN], father[MA... |
//#include "network.h"
#include "segment.h"
using namespace std;
// void segmentChannels(VORONOI_NETWORK *vornet, float probeRad, vector<bool>
// *accessInfo, char *name) {
// accessInfo tells if a node i is accesible or not (after channel detection)
// calling nodes: vornet->nodes.at(i).x radii:
// vornet->nodes.... |
#include "../include/Camera.h"
#include "../include/ScaramuzzaCamera.h"
#include <opencv2/calib3d/calib3d.hpp>
Camera::Parameters::Parameters(ModelType modelType)
: m_modelType(modelType), m_imageWidth(0), m_imageHeight(0)
{
switch (modelType)
{
case KANNALA_BRANDT:
m_nIntrinsics = 8;
break;
case ... |
#include "paging.h"
extern "C" void setup_paging(uint32_t* page_directory_address); //External ASM function: paging.asm
//Turns out I should be doing this from boot.asm, before calling kernel_main
void initializePaging()
{
initializePageDirectory();
//first_page_table = allocateNext();
//initializePageTabl... |
/*
** Module :LAUNCH.CPP
** Abstract :
**
** Copyright (C) <NAME>
**
** Log: Sun 02/05/2004 Created
**
*/
#define INCL_DOS
#include <os2.h>
#include <string.h>
#include <buffer.h>
#include <_search.h>
#include <version.h>
#include <fio.h>
#include <stdio.h>
#define STDIN 0
#define STDOUT 1
#define STDERR ... |
/* --------------------------------------------------------------------------------
#
# 4DPlugin-pHash.cpp
# source generated by 4D Plugin Wizard
# Project : pHash
# author : miyako
# 2019/09/09
#
# --------------------------------------------------------------------------------*/
#include "4DPlug... |
#ifndef __APPLE__
#include <GL/glew.h>
#include "GLFW/glfw3.h"
#else
#define GLFW_INCLUDE_GLCOREARB
#define GLFW_NO_GLU
#include "GLFW/glfw3.h"
#endif
#include "error.h"
#include "MeshObject.h"
#include "CellObject.h"
#include "Framework.h"
#include "CellCam.h"
#include "AxisObject.h"
#include "Ti... |
#include "plane_generator.h"
#include "maratis_math.h"
#include "standard_libs.h"
#include "gplib.h"
float sample_plane_height(float x, float z, float max) {
return -115 * cos(1100 * x/max) - 115 * sin(1100 * z/max);
}
void influence_plane_points(
float domain,
float3* a,
float3* b,
float3* c,
float3* d,
floa... |
#include "CharProfile.h"
#include "Directories.h"
#include "Font.h"
#include "IMP_Portraits.h"
#include "IMP_MainPage.h"
#include "IMPVideoObjects.h"
#include "Text.h"
#include "VObject.h"
#include "Input.h"
#include "Render_Dirty.h"
#include "Cursors.h"
#include "Laptop.h"
#include "IMP_Text_System.h"
#include "Button... |
#include "views/gamelist/BasicGameListView.h"
#include "views/ViewController.h"
#include "Renderer.h"
#include "Window.h"
#include "ThemeData.h"
#include "SystemData.h"
#include "Settings.h"
#include "Locale.h"
BasicGameListView::BasicGameListView(Window* window, FileData* root)
: ISimpleGameListView(window, root), m... |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <pkeybrd.h>
#include <pvideo.h>
#include <duiwin.h>
#include <cfgtable.h>
#include <common.h>
#define MAXUPDATESKIP 10 /* maximum times to skip updating the screen
because a command was available. */
Bu... |
//----------------------------------------------------------------------------
//
// TSDuck - The MPEG Transport Stream Toolkit
// Copyright (c) 2005-2021, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following c... |
#pragma once
#include "NeuralNetwork.h"
using namespace std;
NeuralNetwork::NeuralNetwork(NeuralNetConfig& config)
: inputSize(config.inputSize), outputSize(config.outputSize), batchSize(config.batchSize),
inputData(config.inputSize*config.batchSize),
outputData(config.outputSize*config.batchSize),
numIterati... |
/*
* Copyright (c) 2009,2010 Jice
* 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 conditi... |
/**
* @file solversample.cpp
*/
//
// HiveCore Solver sample
//
#ifdef HIVE_ENABLE_MPI
#include <mpi.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#include <cassert>
#include <sstream>
#include "SceneScript/SceneScript.h"
#include "Core/Path.h"
#include ... |
/*
Copyright (c) 2020
GRAPES is provided under the terms of The MIT License (MIT):
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 ... |
#include <unistd.h>
#include <cerrno>
#include <csignal>
#include <cstring>
#include <map>
#include <Poco/Exception.h>
#include <Poco/Mutex.h>
#include <Poco/Thread.h>
#include "util/Backtrace.h"
#include "util/PosixSignal.h"
using namespace std;
using namespace Poco;
using namespace BeeeOn;
PosixSignal::PosixSign... |
#include <system/drivers/integrated/ps2-mouse.h>
#include <core/port.h>
#include <system/system.h>
using namespace CactusOS;
using namespace CactusOS::common;
using namespace CactusOS::system;
using namespace CactusOS::system::drivers;
using namespace CactusOS::core;
PS2MouseDriver::PS2MouseDriver()
: InterruptHandle... |
// Copyright (c) 2018, The TurtleCoin Developers
//
// Please see the included LICENSE file for more information.
////////////////////////////
#include <Tools.h>
////////////////////////////
#include <cmath>
#include <Common/Base58.h>
#include <Common/StringTools.h>
#include <CryptoNoteCore/CryptoNoteBasicImpl.h>
... |
#include "Globals.h"
#include "Application.h"
#include "ModuleRenderer3D.h"
#include "ModuleWindow.h"
#include "ModuleCamera3D.h"
#include "Primitive.h"
#include "OpenGL.h"
#include "Imgui/imgui.h"
#include "Imgui/imgui_impl_sdl_gl3.h"
#pragma comment (lib, "opengl32.lib") /* link Microsoft OpenGL lib */
#pragma ... |
#include <iostream>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <chrono>
#include "OGUI.h"
#include "OGUICVWindow.h"
#include "OGUILayout.h"
#include "OGUIFormArea.h"
#include "OGUIImageArea.h"
#include "OGUIWidget.h"
#include "OGUIButton.h"
#include "OGUISlider.h... |
#include <qtfinance.h>
N::Finance::Order:: Order (void)
{
login = -1 ;
order = -1 ;
symbol = "" ;
digits = 0 ;
cmd = -1 ;
volume = -1 ;
OpenTime = nTimeNow ;
state = -1 ... |
/*
* Copyright 2015 Twitter, 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 ... |
#include "image_proc.h"
void ComputeCropPadImageLocation(const BoundingBox& bbox_tight, const cv::Mat& image, BoundingBox* pad_image_location) {
// Get the bounding box center.
const double bbox_center_x = bbox_tight.get_center_x();
const double bbox_center_y = bbox_tight.get_center_y();
// Get the image size... |
//
// Created by <NAME> on 9/29/21.
//
#include "nn/layers/gnn/gat_layer.h"
#include "nn/layers/gnn/layer_helpers.h"
GATLayer::GATLayer(shared_ptr<LayerConfig> layer_config, torch::Device device) {
config_ = layer_config;
options_ = std::dynamic_pointer_cast<GATLayerOptions>(layer_config->options);
inpu... |
#include "screencasts.h"
#define PI 3.1415926535898
#define Length(x) (sizeof (x)/sizeof *(x))
/* Globals */
double dim = 2; /* dimension of orthogonal box */
char *windowName = "Hello OpenGL";
int windowWidth = 500;
int windowHeight = 450;
// global state
char *mouseBtnPressed = "";
char *mouseState = "";
int keyP... |
#include <shaders/texture_vert_glsl.h>
#include <shaders/texture_frag_glsl.h>
#include <shaders/phongo_vert_glsl.h>
#include <shaders/phongo_frag_glsl.h>
#include "src/scene.h"
#include "skybox.h"
SkyBox::SkyBox() {
// Initialize static resources if needed
if (!shader) shader = std::make_unique<ppgso::Shader>... |
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
double make_time_remaining(int step,
bool is_lower,
bool is_final_age) {
if (!is_lower && is_final_age)
return 1.0 * step;
return R::runif(0, step);
}
// [[Rcpp::export]]
Rcpp::List microsim_inne... |
#include "Utils/StrUtils.h"
#include "RenderUtils.h"
using namespace std;
namespace {
char errorLog[256];
//fbo and screen vertex shaders must have different axis convention, why??
string VS_PT = R"glsl(
#version 300 es
const vec2 verts[4] = vec2[4](vec2(-1, -1), vec2(-1, 1), vec2(1, 1), ... |
//
// Created by tobias on 27.03.18.
//
#include <parser/CQLParser.h>
#include "data_types/Long.h"
#include "data_types/Double.h"
#include "data_types/String.h"
#include "data_types/Null.h"
#include "data_types/Blob.h"
#include "data_types/Geometry.h"
#include "sqlite_adapter/sqlite_adapter_stream_module.h"
#include "... |
// MAT201B
// Fall 2015
// Modified for 240C and AlloLib in 2018
// Author(s): <NAME>
//
// Shows how to:
// - Use Gamma's SamplePlayer class to load and play a sound
// - How to render a Waveform with a playback cursor
//
#include "Gamma/Filter.h"
#include "Gamma/Oscillator.h"
#include "Gamma/SamplePlayer.h"
#include... |
/* USB EHCI Host for Teensy 3.6
* Copyright 2017 <NAME> (<EMAIL>)
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use... |
#include <CQNascom.h>
#include <CNascom.h>
#include <CQZ80Dbg.h>
#include <CArgs.h>
#include <CQApp.h>
#include <CQImageUtil.h>
#include <CQUtil.h>
#include <QWidget>
#include <QPainter>
#include <QTimer>
int
main(int argc, char **argv)
{
CQApp app(argc, argv);
CArgs cargs("-v:f (verbose) "
... |
#include <cmath>
#include <filesystem>
#include <iostream>
#include <cxxopts.hpp>
#include <OpenImageIO/imageio.h>
namespace sf = std::filesystem;
bool read_input(const std::string& filename, std::vector<float>& data, int& width, int& height, std::vector<std::string>& channel_names);
enum CropMode {
CM_None = 0,
... |
//===- JsonValueTest.cpp --------------------------------------------------===//
//
// The ONNC Project
//
// See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include <skypat/skypat.h>
#include <onnc/ADT/Rope.h>
#include <onnc/... |
#include <cassert>
#include <iostream>
#include <memory>
#include "scanner.hpp"
#include "parser.hpp"
#include "variable.hpp"
#include "evaluator.hpp"
#include "opcode.hpp"
#include "encoder.hpp"
#include "serializer.hpp"
#include "vm.hpp"
using namespace CS;
const char* GetSourceCode() {
const char* code = "in... |
#include <kernel.h>
#include <uint256.h>
#include <chainparams.h>
#include <util.h>
#include <init.h>
#include <timedata.h>
#include <txdb.h>
#include <validation.h>
#include <index/txindex.h>
#include <chain.h>
#include <script/interpreter.h>
#include <unordered_map>
using namespace std;
struct Hasher
{
size_t o... |
#include <Dataset.hpp>
#include <utils.hpp>
#include <thrust/system/cuda/experimental/pinned_allocator.h>
#include <algorithm>
#include <chrono>
#include <fstream>
#include <random>
DataSet::DataSet(std::string data_path, bool shuffle)
: shuffle(shuffle), train_data_index(0), test_data_index(0) {
// train da... |
#include "md5.hpp"
#include <sstream>
#include <iomanip>
#include <cstring>
bool determine_endianness() {
int32_t val = 1;
return *reinterpret_cast<char*>(&val);
}
const bool LITTLE_ENDIAN = determine_endianness();
uint32_t F(uint32_t X, uint32_t Y, uint32_t Z) {
return (X & Y) | ((~X) & Z);
}
ui... |
// (C) 2013-2014 Cybozu.
#include "memcache.hpp"
#include "replication.hpp"
#include "stats.hpp"
#include <cybozu/logger.hpp>
#include <cybozu/util.hpp>
#include <cstdint>
#include <cstring>
#include <stdexcept>
#include <string>
namespace {
using namespace yrmcds::memcache;
const int BINARY_HEADER_SIZE = 24;
in... |
#include "input.h"
const Uint8* Input::keystate = NULL;
Uint8 Input::prev_keystate[SDL_NUM_SCANCODES]; //previous before
//mouse state
int Input::mouse_state; //tells which buttons are pressed
Vector2 Input::mouse_position; //last mouse position
Vector2 Input::mouse_delta; //mouse movement in the last frame
float Inp... |
/*
* OxDataReader.cpp
*
* Created on: Jan 5, 2014
* Author: andresf
*/
#include <fstream>
#include <stdexcept>
#include <stdlib.h>
#include <string>
#include <FileUtils.hpp>
#define NUMBER_OF_DESCRIPTORS 16334970
#define TRAILING_BYTES 12
/**
* Load number of features.
*
* @param keypointsFolder
* @... |
/*
Copyright (c) 2021, <NAME>
Copyright (c) 2018, <NAME> (UC Berkeley)
All rights reserved.
BSD 3-Clause License
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 t... |
#include "Misc\CFrameHeader.h"
/* ----------------------------------------------------------
CFrameHeader class is used to retrieve a MP3's FrameHeader
and load that into a usable structure.
This code will be well commented, so that everyone can
understand, as it's made for the public and not for
... |
#include "config-json.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wexpansion-to-defined"
#include "rapidjson/prettywriter.h"
#include "rapidjson/stringbuffer.h"
#pragma clang diagnostic pop
#include "errlist.h"
#define DEF_BUFFER_SIZE 4096
void ServerConfig::clear() {
listenAddressIPv4.clea... |
/*
* Copyright (C) 2011 True Blood <http://www.trueblood-servers.com/>
* By Asardial
*
* Copyright (C) 2011 - 2013 ArkCORE <http://www.arkania.net/>
*
* 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... |
#include "huffman-converter.h"
// read raw file and build the fTab of pairs of character and its frequency
Bytes HuffmanConverter::build_freq_table(std::ifstream &inFile) {
unsigned char ch;
Bytes bytes = 0;
while(inFile >> std::noskipws >> ch) {
++fTab[ch];
++bytes;
}
return bytes;... |
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include "TileMap.h"
std::vector<std::string> splitString(const std::string& s, char delimiter)
{
std::vector<std::string> tokens;
std::string token;
std::istringstream tokenStream(s);
while (std::getline(tokenStream, token, del... |
#include "backend.h"
#include "dropgenerator.h"
#include "gradientdescent.h"
#include <QXYSeries>
#include <QChart>
#include <QFile>
#include <QTextStream>
#include <QThread>
#include <QTimer>
#include <QImage>
using namespace QtCharts;
Backend::Backend(QObject *parent)
: QObject(parent)
, m_cutoffMoment(0)
... |
// Copyright (C) 2010-2014 <NAME>.
// See the file COPYING for copying permission.
#include <hadesmem/read.hpp>
#include <hadesmem/read.hpp>
#include <array>
#include <cstring>
#include <string>
#include <vector>
#include <hadesmem/detail/warning_disable_prefix.hpp>
#include <boost/detail/lightweight_tes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.