text stringlengths 3.08k 12.5k |
|---|
#include "UselessFenixUtils.h"
#include "CombatBehaviorTrees.h"
#include "CombatBehaviorConditions.h"
#include "Hooks.h"
template <int ID, int offset = 0x0>
void writebytes(const std::string_view& data)
{
REL::safe_write(REL::ID(ID).address() + offset, data.data(), data.size());
}
void MainUpdateHook::Update(RE::Mai... |
/////////////////////////////////////////////////////////////////////////
/// ///
/// ///
/// This Academic Free License applies to any software and associated ///
/// documentation (the "... |
/*
* created by xehoth on 04-03-2017
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/priority_queue.hpp>
inline char read() {
static const int IN_LEN = 1000000;
static char buf[IN_LEN], *s, *t;
if (s == t) {
t = (s = buf) + fread(buf, 1, IN_LEN, stdin);
if (s == t) return -1;
}
re... |
#include "application.h"
using namespace Protocol;
std::map<size_t, std::queue<Message>> broadcast;
std::map<size_t, std::queue<Message>> msgqueue;
void ServerApplication::StaticInit() { // init once per server
std::vector<asio::ip::address> iplist;
if(getIpv4Address(iplist)){
std::cout << "Server li... |
#include <string>
#include <vector>
#include <limits>
#include "common/util/FileUtil.h"
#include "common/util/Trie.h"
#include "common/util/BitUtils.h"
#include "gtest/gtest.h"
#include "test/all_jak1_symbols.h"
#include "common/util/json_util.h"
#include "common/util/Range.h"
#include "third-party/fmt/core... |
/*
* Copyright (C) 2015 Intel Corporation
*
* 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... |
// Author: <NAME>
// Copyright (c) 2022
#include "dtx/dtx.h"
#include "util/timer.h"
bool DTX::CheckReadRO(std::vector<DirectRead>& pending_direct_ro,
std::vector<HashRead>& pending_hash_ro,
std::list<InvisibleRead>& pending_invisible_ro,
std::list<Has... |
// SPDX-License-Identifier: MIT
#include <dectris/neggia/user/H5File.h>
#include <dlfcn.h>
#include <array>
#include <iostream>
#include "DatasetsFixture.h"
typedef void (*plugin_open_file)(const char*,
int info_array[1024],
int* error_flag);
typedef ... |
/* Copyright 2017 Columbia University, SLD Group */
//
// tb.cpp - <NAME>
// Implementation of tb.hpp.
// In a normal run the source thread does nothing, while the sink waits for the
// program_end signal to be asserted and stops simulation
// (sc_stop).
//
#include "tb.hpp"
// Source thread
void tb::source()
{
// ... |
#include <library/cpp/float16/float16.h>
#include <xmmintrin.h>
#include <emmintrin.h>
#include <immintrin.h>
#include <util/system/cpu_id.h>
#include <util/system/yassert.h>
#include <cstring>
bool NFloat16Impl::AreConversionIntrinsicsAvailableOnHost() {
#ifdef _MSC_VER
return false;
#else
return NFloat16O... |
/*
* Author: Crownstone Team
* Copyright: Crownstone (https://crownstone.rocks)
* Date: Apr 7, 2021
* License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)
*/
#include <ble/cs_Nordic.h>
#include <ble/cs_UUID.h>
#include <protocol/cs_ErrorCodes.h>
#include <cstring>
#include <util/cs_UuidParser.h>
#in... |
// quick and dirty hack to patch a ttf file and to fix the checksums
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#define FONTDIR "" //"/DOS/windows/system/"
typedef unsigned char U8;
void usage()
{
printf( "Usage: patchttf fontfile -p 0xaddr 0xdata");
// typical: CLEAR PUSHB00 0 IF ... EIF
// =>... |
/*
* Copyright (C) 2014 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 "stripe.h"
#define DIGICERT_CERT \
"-----BEGIN CERTIFICATE-----\r\n" \
"MIIEtjCCA56gAwIBAgIQDHmpRLCMEZUgkmFf4msdgzANBgkqhkiG9w0BAQsFADBs\r\n" \
"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\r\n" \... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#include "matmul.h"
#include "common.h"
#include "utils/broadcast_utils.h"
#include "utils/shape_utils.h"
#include <math.h>
// Wasm interop method
void matmul_f32(void *data) {
uint32_t *dataIndex = static_cast<uint32_t ... |
/**
* Digital signature module based on Ed25519
*
* @file Ed25519.cpp
* @author <NAME> <<EMAIL>>
* @version 1.0
* @date Mar 29, 2021
*
* Copyright 2021 University Corporation for Atmospheric Research
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this ... |
#include <Arduino.h>
#include "BTS7960.h"
#include <NintendoExtensionCtrl.h>
const uint8_t L_EN = 37;
const uint8_t L_L_PWM = 35;
const uint8_t L_R_PWM = 36;
const uint8_t R_EN = 23;
const uint8_t R_L_PWM = 21;
const uint8_t R_R_PWM = 22;
String Data_In = "";
String Type = "";
String Data_A = "";
String Data_B = "";... |
/****************************************************************************
* Copyright (c) 2020, CEA
* 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 retai... |
#include "nSoundSystem.h"
#include "nSoundSource.h"
#include "nSoundBuffer.h"
#include "nSoundListener.h"
#include "nSoundStreamer.h"
#include "nSoundStreamerPlaylist.h"
#include <AL/al.h>
#include <AL/alc.h>
#include "util/nEfxHelper.h"
#include <QSettings>
#include <QUuid>
nSoundSystem::nSoundSystem(QObject *parent... |
#include "C_Transform.h"
#include "C_Camera.h"
#include "GameObject.h"
C_Transform::C_Transform(GameObject* gameobject, Component_Type type) : Component(type, gameobject)
{
name = "Transform";
ID = App->RandomNumberGenerator.GetIntRNInRange();
}
C_Transform::~C_Transform()
{
}
bool C_Transform::Enable()
{
activ... |
/* SuperRead pipeline
* Copyright (C) 2012 Genome group at University of Maryland.
*
* 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... |
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
using namespace std;
int sol;
bool done[5], have[5];
vector<int> at, s, d;
class SmartElevator {
public:
void go(int t, int f, int n) {
/*for (vector<int>::size_type i=0; i<at.size(); ... |
#include "TriMesh.h"
#include "Levelset.h"
#include "opgl.h"
using namespace PRINTX_LIB;
TriMesh mesh, mesh_in;
SphericalCamera *camera = 0;
float focus[3], up[3] = { 0, 1, 0 };
float cameraRadius = 100;
int g_iLeftMouseButton = 0, g_iMiddleMouseButton = 0, g_iRightMouseButton = 0;
int g_vMousePos[2] = { 0, 0 };
in... |
#include "SimpleRender.h"
/**
* Sets the Pixel to a color at the position given
* Draws pixel for the Main Draw Pixels
*
* @param x - The X-axis position
* @param y - The Y-axis position
* @param color - The Color to set the pixel to
* @param pixels - Pointer to the pixels array
*/
void SimpleRender::drawPix... |
//Dictionary consisting of morse code of alphabates;numbers and some symbols
#include <map>
#include <string>
#include <iostream>
#include <iostream>
#include <string>
#include <cstdlib>
#include <conio.h>
#include <cctype>
#include <map>
#include <algorithm>
#include "MACROS.h"
#include <exception>
using std::cout;
... |
/*
* Author: <NAME> <<EMAIL>>
* Copyright (c) 2015 - 2016 Intel Corporation.
*
* 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 r... |
#include "dla_interface.h"
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include "gtest/gtest.h"
#include "communicator_grid.h"
#include "communicator_manager.h"
#include "types.h"
#include "util_complex.h"
#include "util_distributed_matrix.h"
#include "test_ftn_dlai_... |
/*
MIT License
Copyright (c) 2019 <NAME>(<EMAIL>), <NAME>(<EMAIL>) and <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... |
/** @file
* tstShflSize - Testcase for shared folder structure sizes.
* Run this on Linux and Windows, then compare.
*/
/*
* Copyright (C) 2006-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you... |
/**
* @copyright Copyright 2018 The J-PET Framework Authors. 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 find a copy of the License in the LICENCE file.
*
* Unless required by applicable la... |
#include "PID.h"
#define MAX_TUNE_STEPS 1000
using namespace std;
#define DEFAULT_AMOUNT_P 0.1
#define DEFAULT_AMOUNT_I 0.1
#define DEFAULT_AMOUNT_D 0.1
#define MAX_CTE 2.0
/*
* TODO: Complete the PID class.
*/
PID::PID() {
// is_initialized = false;
}
PID::~PID() {}
void PID::Init(double p, double i, double... |
#include "src/meta/zp_meta_election.h"
#include <glog/logging.h>
#include "slash/include/env.h"
#include "slash/include/slash_string.h"
#include "include/zp_const.h"
#include "include/zp_conf.h"
extern ZpConf* g_zp_conf;
const std::string kElectLockKey = "##elect_lock";
const std::string kLeaderKey = "##meta_leader1... |
#include "STLWriter.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <Core/Exception.h>
using namespace PyMesh;
void STLWriter::with_attribute(const std::string& attr_name) {
std::cerr << "Error: .stl format does not support attributes." << std::endl;
}
void STLWriter::write_mesh(Mesh& mes... |
/* -------------------------------------------------------------------------- *
* Simbody(tm): SimTKmath *
* -------------------------------------------------------------------------- *
* This is part of the SimTK biosimulation toolkit originating from *
... |
// MainFrm.cpp : implmentation of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include "aboutdlg.h"
#include "View.h"
#include "MainFrm.h"
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
if(CFrameWindowImpl<CMainFr... |
#include "Win32HNDL.hpp"
#include "../EventHandler.hpp"
#include "../InternalEvents.hpp"
#include <GameEngine/Core/Events.hpp>
#include <map>
using namespace GameEngine;
namespace GameEngine {
extern std::vector<Runnable *> runOnUiThread;
Window* activeWindow;
Window* _GetActiveWindow(){ return activeWin... |
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
#define NMAX 100000
#define SIGMA 256
class SuffixTree;
void show(SuffixTree &tree);
class SuffixTree {
public:
SuffixTree() : size(0) {
... |
/*
# Copyright 2018 <NAME>. 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 ag... |
// BEGIN CUT HERE
#pragma warning(disable:4018) // signed/unsigned mistatch
#pragma warning(disable:4244) // w64 to int cast
#pragma warning(disable:4267) // big to small -- possible loss of data
#pragma warning(disable:4786) // long identifiers
#pragma warning(disable:4800) // forcing int to bool
#pragma wa... |
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
void update(map<string, string> &M, const string &rem, const string &cand) {
if (M.count(rem) == 0) {
M[... |
/* Copyright 2019 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... |
// Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
#include <unistd.h>
#include <iostream>
#include <vector>
#include "lunasa/Lunasa.hh"
#include "faodelConfig.h"... |
//==-------------------------------------------------------------*- C++ -*--==//
//
// Copyright 2020 Contributors to the Gazer 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
//
... |
/*
Matrix.cpp - Max7219 LED Matrix library for Arduino & Wiring
Copyright (c) 2006 <NAME>. All right reserved.
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 o... |
/******************************************************************************
* Copyright (c) 2017 <NAME>.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of LICENSE.txt.
*
* Contributors:
* <NAME> and others
******************************************... |
//=============================================================================================================
/**
* @file edf_ch_info.cpp
* @author <NAME> <<EMAIL>>;
* <NAME> <<EMAIL>>
* @version 1.0
* @date May, 2019
*
* @section LICENSE
*
* Copyright (C) 2019, <NAME> and <NAME>. All rights res... |
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <memory>
#include <iomanip>
#include <numeric>
#include <functional>
#include <new>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdl... |
/************************************************************************************************
* Program: ar_pillar_drive_ino_car.cpp *
* Author: <NAME>
* Date: 2015/12/30
* Contact: <EMAIL>
* Licese: BSD (see below)
* Note:
* This ROS program is mainly act as a templete for the final projec... |
#include <cstdio>
using namespace std;
inline int gint() {
int c;
while ((c = getchar()) < '-');
int f = 0;
bool t = false;
if (c == '-')
t = true;
else
f = c & 0x0f;
while ((c = getchar()) >= '0')
f = f * 10 + (c & 0x0f);
return t ? -f : f;
}
inline unsigned g... |
#include <argp.h>
#include <unistd.h>
#include <csignal>
#include <cstdlib>
#include <cstring>
#include <memory>
#include "megasampler.h"
#include "pythonfuncs.h"
#include "sampler.h"
#include "smtsampler.h"
const char *argp_program_version = "megasampler 0.1";
const char *argp_program_bug_address = "<<EMAIL>>";
st... |
// license:BSD-3-Clause
// copyright-holders:smf
/*
* Beatmania DJ Main Board (GX753)
* emulate video hardware
*/
#include "emu.h"
#include "includes/djmain.h"
#define NUM_SPRITES (0x800 / 16)
#define NUM_LAYERS 2
void djmain_state::draw_sprites( bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int offs, ... |
#ifndef INCLUDED_STDDEFX
#include "stddefx.h"
#define INCLUDED_STDDEFX
#endif
#ifndef INCLUDED_CALC_FINDSYMBOL
#include "calc_findsymbol.h"
#define INCLUDED_CALC_FINDSYMBOL
#endif
// Library headers.
#ifndef INCLUDED_SSTREAM
#include <sstream>
#define INCLUDED_SSTREAM
#endif
#ifndef INCLUDED_VECTOR
#include <vector>
... |
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); y... |
/************************************************************************************
Copyright (C) 2005
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>
This file is part of the XFEM C++ Library (OpenXFEM++) written
and maintained by above authors.
This program is free software; you can redistribute it and/o... |
// Copyright 2021 <NAME>
#include <mpi.h>
#include <random>
#include <ctime>
#include <algorithm>
#include <vector>
#include "../../../modules/task_2/chornyi_y_smoothing_filter/smoothing_filter.h"
using std::vector;
vector<vector<float>> fillMatrixOfColor(const int matrixWidth, const int matrixHeight) {
std::vect... |
// This file contains the translation of an excellent scalar procedure
// by <NAME> (@lpereira)
// https://github.com/lpereira/lwan/blob/master/src/lib/lwan-time.c
//
// His code is under GPL, so I had to rewrite it.
#include <cstdint>
#define CONST(b0, b1, b2, b3) ( \
(uint32_t(uint8_t(b0)) << 0*8) ... |
/**
* @file cubeMain.cpp
*
* @brief Implements the cube main class.
*
* @author Alvin
* @date 2015-09-28
*/
#include <GL/freeglut.h>
#include <math.h>
#include <iostream>
//#include "octahedronNode.h"
#include "../../utilclass/GroupNode.h"
using namespace std;
GLint screenSizeX = 800, screenSizeY = 600;
//OctahedronNo... |
/*
* Copyright (c) 2016, 2017 <NAME>
* This file is part of Onyx, and is released under the terms of the MIT License
* check LICENSE at the root directory for more information
*/
#include <stdlib.h>
#include <string.h>
#include <errno.h>
/* Don't change the include order! Maybe TOFIX? */
#include <onyx/net/ethernet.h>... |
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include <string>
#include <fstream>
#include <sstream>
#include "Element.h"
#include "Interpreter.h"
#include "Player.h"
class InterpreterTest : public ::testing::Test {
protected:
virtual void SetUp() override {
string filePath = "rockPaperScissors.json";
... |
#include <data/meshes/obj.hpp>
#include <data/meshes/mbsm.hpp>
#include <data/meshes/mmdl.hpp>
using namespace Manta::Data::Meshes;
#include <iostream>
#include <fstream>
#include <math.h>
#include <mikktspace.h>
#define GET_IDX() ((iFace * 3) + iVert)
static std::vector<WavefrontOBJ::OBJVector3> tangents;
static... |
#include "CVK_Geometry.h"
CVK::Geometry::Geometry()
{
m_vertexbuffer = INVALID_OGL_VALUE;
m_normalbuffer = INVALID_OGL_VALUE;
m_uvbuffer = INVALID_OGL_VALUE;
m_indexlist = INVALID_OGL_VALUE;
m_tangentbuffer = INVALID_OGL_VALUE;
m_vao = INVALID_OGL_VALUE;
m_geotype = CVK_GEOMETRY;
}
CVK::Geometry::~Geomet... |
// UOJ - 3
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
const int maxn = 200010,inf = 1<<29;
int N,M,A[maxn],B[maxn],fa[maxn],ch[maxn][2];
int stk[maxn],father[maxn],ans = inf; bool rev[maxn];
inline int find(int a) { if (father[a] != a) return fathe... |
// ================================================================
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
// ================================================================
// ================================================================
// Step 3 of TMK 3-stage hashing pipeline:
... |
#include "game.h"
#include <time.h>
#include <chrono>
#include <thread>
void DestroyMoney(Game* game)
{
game->field[game->m_money_y][game->m_money_x] = CellType::None;
game->DrawPixel(game->m_money_x, game->m_money_y);
}
void Game::InitNcursed()
{
initscr();
keypad(stdscr, true);
noecho();
cur... |
#include "stdafx.h"
#include "World.h"
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <chrono>
#include <thread>
#include <fstream>
#include "stdafx.h"
#include <stdio.h>
#include <istream>
#include "../OpenGLRenderer/renderer.h"
#include "../OpenGLRenderer/collada-model.h"
#include "../OpenGLRe... |
#include <GL/glut.h>
GLfloat xRotated, yRotated, zRotated;
void init(void)
{
glClearColor(1.0,1.0,1.0,0);
}
void DrawCube(void)
{
glMatrixMode(GL_MODELVIEW);
// clear the drawing buffer.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
// Enable depth test
glEnable(GL_DEPTH_TEST);
// A... |
#include<bits/stdc++.h>
using namespace std;
#define Inv(x) QPow(x,Mod-2)
#define pb push_back
const int maxN=5050;
const int maxM=310;
const int Mod=998244353;
int m,n,Sz[maxN],Ts[maxN];
vector<int> T[maxN];
int dp[maxN][maxN][3],dpg[maxN][3];
int F[maxN][maxN];
int Fc[maxN],Ifc[maxN],Mic[maxN];
int Poly[maxN],iPol... |
#include "ControlDependencies.h"
using namespace llvm;
int pdg::ControlDependencyGraph::getDependenceType(const BasicBlock *A,
const BasicBlock *B) const {
assert(A && B);
if (const llvm::BranchInst *b = dyn_cast<BranchInst>(A->getTerminator())) {
if (b->isConditi... |
#include <PushRelabel.h>
#include <cassert>
#include <iostream>
#include <utils.h>
#include <boost/graph/push_relabel_max_flow.hpp>
// some stuff needed for boost
struct IntIterator {
size_t val = 0;
IntIterator() = default;
IntIterator(size_t start) : val(start) {}
auto operator!=(const IntIterat... |
#include <common.hpp>
#include <print.hpp>
#include <context.hpp>
#include <frameTimer.hpp>
#include <shapes.hpp>
#include <meshDesc.hpp>
#include <camera.hpp>
#include <shader.hpp>
#include <mapGen.hpp>
bb::mesh_t Plane(const bb::ext::heightMap_t& hmap)
{
bb::meshDesc_t desc;
desc.SetDrawMode(GL_TRIANGLES);
... |
#include <ros/ros.h>
#include <std_msgs/Float32.h>
#include <sensor_msgs/LaserScan.h>
#include <sensor_msgs/PointCloud2.h>
#include <mb_1r2t_ros/mb_1r2t.h>
#include <vector>
#define BAUDRATE 153600
ros::Publisher g_cloud_pub;
ros::Publisher g_hz_pub;
ros::Publisher g_scan_pub;
sensor_msgs::PointCloud2 g_init_cloud_m... |
#include "program.h"
#include "statement.h"
using namespace std;
//函数名:washQStr
//作用:接收QString类型字符串,去掉前后空白元素后以string类型返回
string washQStr(QString qStr){
string str = qStr.toStdString();
int beginPos = 0;
int endPos = 0;
bool isEmpty = true;
for (int i = 0; i < str.length(); ++i) {
//寻找第一个不... |
#include "console_handler.hpp"
using namespace std;
string HELP_OPTIONS[] = {"-h", "--help"};
string TOTURIAL_OPTIONS[] = {"-t", "--toturial"};
struct stat info;
/* Returns: a random number between 0 and 1 */
float _random() {
int r = rand();
return float(float(r) / float(RAND_MAX));
}
void _sleep(float t... |
/**
* @file bch_code.cpp
*
* @brief Implementation of the BCH code
*
* This implementation relies heavily on the helper functions in bch_helpers.*
* to do the heavy lifting.
*
* Note: these functions must be threadsafe since they'll be called from different threads.
*
* @author <NAME>
* Contact: <EMA... |
/*
Copyright (c) 1999 - 2010, Vodafone Group Services 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... |
#include "stdafx.h"
using namespace luabridge;
LuaCS *luacs = nullptr;
std::vector<LuaEventBind*> LuaEvent::binds;
LuaCS::LuaCS()
{
Initialize();
}
LuaCS::~LuaCS()
{
lua_close(L);
L = nullptr;
}
void LuaCS::Initialize()
{
L = luaL_newstate();
luaL_openlibs(L);
SetupClosures();
SetupClasses();
}
void LuaC... |
/**
* @file CliniParser.hpp
* @author <NAME> <<EMAIL>>
* @brief Basic parsing functions
* @version 0.1
* @date 2019-01-29
*
* @copyright Copyright (c) 2019
*
*/
#include <regex>
#include <sstream>
#include <iterator>
#include <type_traits>
#include <string_view>
#include <functional>
#include <ios>
#include... |
#include "mesh_fil.h"
#include "quadtree.h"
#include <stdio.h>
struct SFilVertX
{
Vec3 vert; // position
float s, t; // texcoord
Vec3 vOs; float fMagS; // first order derivative with respect to, s
Vec3 vOt; float fMagT; // first order derivative with respect to, t
Vec3 norm; // normal
};
bool CMeshFil::Rea... |
/*
Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
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; version 2 of the License.
This program is distributed i... |
/***************************************************************************
*
* Copyright (C) Codeplay Software 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... |
#include "common.h"
void MPIBCAST_forward(double *out, const double *a, int m, int root){
MPI_Comm comm = MPI_COMM_WORLD;
int rank;
MPI_Comm_rank( comm , &rank);
if (rank==root){
memcpy(out, a, sizeof(double)*m);
}
MPI_Request request;
MPI_Status status;
MPI_Ibcast(out, m, MPI_DOUBLE, root, comm, ... |
#include "terminal.h"
#include "io.h"
#include "uart.h"
#include "terminal_data.h"
template <typename T>
static inline T *only_L2_cached(T *ptr) { return (T*)((size_t)ptr | 0x80000000); }
Terminal Terminal::init(const Framebuffer &framebuffer)
{
Terminal result;
uint8_t *bin_addr = (uint8_t*)0x400000;
... |
/*******************************************************************************
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
******************************************************************************/
#include <array>
#include "algorithm"
#include "gtest/gtest.h"
#include "qpl_test_... |
/** @defgroup MleDPPType Magic Lantern Digital Playprint Library API - Type */
/**
* @file DppVector3Array.cpp
* @ingroup MleDPPType
*
* This file implements the int array data type used by the Magic Lantern Digital
* Playprint Library API.
*
* @author <NAME>
* @created September 13, 2004
*/
// COPYRIGHT_BEG... |
#include "SimplePolygon.h"
SimplePolygon::SimplePolygon()
{
vertices = new vector<AGVector>();
triVerts = new vector<AGVector *>();
_triangulate = false;
_color = false;
}
SimplePolygon::~SimplePolygon()
{
delete vertices;
delete triVerts;
}
void SimplePolygon::DrawPolygon()
{
// render vertices... |
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
void print_array(int* arr, int n)
// 打印数组
{
if (n == 0) {
printf("ERROR: Array length is ZERO\n");
return;
}
printf("%d", arr[0]);
for (int i = 1; i < n; i++) {
printf(" %d", arr[i]);
}
prin... |
/***************************** LICENSE START ***********************************
Copyright 2012 ECMWF and INPE. This software is distributed under the terms
of the Apache License version 2.0. In applying this license, ECMWF does not
waive the privileges and immunities granted to it by virtue of its status as
an In... |
#include "mrc.h"
#include "File.h"
#include "ImageIO.h"
#include "Maths.h"
#include <string.h>
#include <set>
using namespace std;
void FixName(char *name)
{
if (name[0] == '/') return; // do nothing if rooted.
char *copy = strdup(name);
copy[8] = '\0';
char temp[2048];
sprintf(temp,"/groups/em/leginon/Data... |
// STL
#include <random>
#include <string>
#include <vector>
#include <cstdlib>
#include <iostream>
// fmt
#include <fmt/format.h>
// SDL2
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
// Internal
#include "../lib/library.hpp"
#include "watchFile.hpp"
namespace SDL {
constexpr int SUCCESS... |
/*
* Copyright (c) CERN 2013
*
* Copyright (c) Members of the EMI Collaboration. 2011-2013
* See http://www.eu-emi.eu/partners for details on the copyright
* holders.
*
* Licensed under the Apache License, Version 2.0
* See the LICENSE file for further information
*
*/
#include "UgrLogger.hh"
#i... |
/* Copyright (c) The Grit Game Engine authors 2016
*
* 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, ... |
// $Id$
/*
Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University
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... |
#include "Chip8.h"
#include <iostream>
#include <SDL2/SDL.h>
const int SCALE = 10;
const int SCREEN_WIDTH = 64;
const int SCREEN_HEIGHT = 32;
SDL_Window* window = nullptr;
SDL_Surface* surface = nullptr;
Chip8 chip8;
bool init()
{
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
std::cout << "SDL could not initialize. SDL_E... |
#include <queue>
#include <iostream>
#include <pthread.h>
#include <thread>
#include <atomic>
#include <chrono>
#include <mutex>
#include <hwloc.h>
#include <condition_variable>
#include "tbb/concurrent_queue.h"
#include <helper.h>
#include <Workitem.h>
#include <cmath>
typedef tbb::concurrent_queue<std::shared_ptr<Wo... |
/* Copyright (c) Stanford University, The Regents of the University of
* California, and others.
*
* All Rights Reserved.
*
* See Copyright-SimVascular.txt for additional details.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated doc... |
#include "Editor.h"
#include <glad/glad.h>
#include <glfw/glfw3.h>
#include <iostream>
#include <glm/glm.hpp>
#include <glm/ext.hpp>
using namespace Caramel;
Editor::Editor()
{
}
Editor::~Editor()
{
}
bool Editor::OnCreate()
{
m_frameBuffer = std::make_shared<Caramel::Framebuffer>();
const GLfloat vertices[] =... |
#include "ViewObj.h"
#include <iostream>
ViewObj::ViewObj()
{
initVBO();
}
ViewObj::~ViewObj()
{
releaseVBO();
}
void ViewObj::releaseVBObuffer(unsigned int& buffer)
{
if (buffer == 0) return;
glDeleteBuffers(1, &buffer);
buffer = 0;
}
void ViewObj::initVBO()
{
vbo_buffer_colors_ = 0;
... |
#include "TheEngine.h"
#ifndef _iostream_
#include <iostream>
#define _iostream_
#endif
#ifndef _fstream_
#include <fstream>
#define _fstream_
#endif
#ifndef _string_
#include <string>
#define _string_
#endif
#ifndef _vector_
#include <vector>
#define _vector_
#endif
#ifndef _glm_
#include <glm\glm.hpp>
#define _g... |
/*
* cylinder.c
*
* Copyright (C) 1989, 1991, <NAME>
* All rights reserved.
*
* This software may be freely copied, modified, and redistributed
* provided that this copyright notice is preserved on all copies.
*
* You may not distribute this software, in whole or in part, as part of
* any commercial product w... |
/**************************************************************
*
* 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.