text string | size int64 | token_count int64 |
|---|---|---|
/*=========================================================================
medInria
Copyright (c) INRIA 2013. All rights reserved.
See LICENSE.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
====... | 3,591 | 1,068 |
#ifndef _LEXTRIANGULATOR_HPP
#define _LEXTRIANGULATOR_HPP
#if USE_CUDA == 1
#include <cuda_runtime.h>
#include <cublas_v2.h>
#include <cublasLt.h>
#endif
#include "triangulator.hpp"
class LexTriangulator : public Triangulator {
public:
LexTriangulator(double* x, const int n, const int d) : Tr... | 2,174 | 729 |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "textedit.h"
#include "newconnectionwizard.h"
#include "connectionmanager.h"
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <QSqlRecord>
#include <QSqlField>
#include <QToolBar>
#include <QAction>
#includ... | 22,393 | 6,449 |
#include <maya/MPxLocatorNode.h>
#include <maya/MString.h>
#include <maya/MTypeId.h>
#include <maya/MPlug.h>
#include <maya/MVector.h>
#include <maya/MDataBlock.h>
#include <maya/MDataHandle.h>
#include <maya/MColor.h>
#include <maya/M3dView.h>
#include <maya/MFnEnumAttribute.h>
#include <maya/MFnNumericAtt... | 8,665 | 4,206 |
//
// Created by Maarten on 23/06/2020.
//
#include <esl/economics/markets/ticker.hpp>
| 88 | 45 |
#pragma once
#ifndef SNAKE_DEFAULT_COLORS_HXX
#define SNAKE_DEFAULT_COLORS_HXX
#include "sdl.hxx"
namespace snake::client::colors {
static SDL_Color const BLACK{0, 0, 0, 0xFF};
static SDL_Color const WHITE{0xFF, 0xFF, 0xFF, 0xFF};
enum class Channel : std::uint8_t
{
Red = 0,
Green = 8,
Blue = 16... | 1,320 | 489 |
#include "Person.h"
#include <iostream>
#include <sstream>
#include <vector>
#include "utility.h"
#include "PersonVector.h"
#include "FEM.h"
#include "FEM_MPIMaster.h"
#include "FEM_MPISlave.h"
#include "TimeSeries.h"
#include "Table.h"
#include "EquationParser.h"
#include "EquationNode.h"
#include "Logger.h"
#include... | 13,486 | 5,657 |
// Copyright mogemimi. Distributed under the MIT license.
#include "pomdog/experimental/gui/stack_panel.hpp"
#include "pomdog/experimental/gui/drawing_context.hpp"
#include "pomdog/experimental/gui/pointer_point.hpp"
#include "pomdog/experimental/gui/ui_event_dispatcher.hpp"
#include "pomdog/experimental/gui/ui_helper... | 6,742 | 2,045 |
#include "Interface/Core/OpcodeDispatcher.h"
#include <FEXCore/Core/CoreState.h>
#include <climits>
#include <cstddef>
#include <cstdint>
#include <FEXCore/Core/X86Enums.h>
namespace FEXCore::IR {
auto OpToIndex = [](uint8_t Op) constexpr -> uint8_t {
switch (Op) {
// Group 1
case 0x80: return 0;
case 0x81: ... | 177,837 | 75,446 |
//===----------------------------------------------------------------------===//
//
// BusTub
//
// lru_replacer.cpp
//
// Identification: src/buffer/lru_replacer.cpp
//
// Copyright (c) 2015-2019, Carnegie Mellon University Database Group
//
//===------------------------------------------------... | 2,298 | 860 |
#include "array.h"
int main() {
ArrayList<int> list1(10);
list1.append(5);
list1.insert(7);
list1.goToStart();
list1.insert(8);
list1.next();
int a = list1.remove();
cout << a;
return 0;
} | 225 | 93 |
#include <memory>
#include <openclx/array_view>
#include <openclx/binary>
#include <openclx/bits/macros>
#include <openclx/build_status>
#include <openclx/context>
#include <openclx/device>
#include <openclx/downcast>
#include <openclx/kernel>
#include <openclx/program>
void
clx::program::build(const std::string& opt... | 6,443 | 2,277 |
#pragma once
/// @file
#include "nlohmann/json.hpp"
namespace neon
{
using json = nlohmann::json;
}
| 104 | 46 |
// This file is part of the QuantumGate project. For copyright and
// licensing information refer to the license file(s) in the project root.
#include "pch.h"
#include "Ping.h"
#include "..\Common\Random.h"
#include "..\Common\ScopeGuard.h"
#include <Iphlpapi.h>
#include <Ipexport.h>
#include <icmpapi.h>
#include <wi... | 16,091 | 7,276 |
#include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
std::cout << "Tools::CalculateRMSE"... | 2,358 | 1,028 |
//----------------------------------------------------------------------------
/** @file SgBoardConst.cpp
See SgBoardConst.h */
//----------------------------------------------------------------------------
#include "SgSystem.h"
#include "SgBoardConst.h"
#include <algorithm>
#include "SgInit.h"
#include "SgStack.... | 7,384 | 2,938 |
/* Copyright 2017 The TensorFlow 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 obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | 5,551 | 1,946 |
#ifndef PEMDAS_MUSICPAGE_HPP
#define PEMDAS_MUSICPAGE_HPP
#include <QObject>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QMenu>
#include <QAction>
#include <vector>
#include "utils.hpp"
#include "player.hpp"
#include "ui_pemdas.h"
class musicpage : public QObject {
Q_OBJECT
public:
musicpage... | 624 | 255 |
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
bool is_palindrome(string s) {
string temp = s;
reverse(s.begin(), s.end());
if (temp == s) return true;
else return false;
}
int main() {
int t;
cin >> t;
while(t--) {
string s;
cin >> s;
... | 891 | 287 |
/**
* @file system.cpp
* @author Susanna Maria, David Silver
* @brief system handling impletionments
* @version 1.0
* @date 2020-06-21
*
* @copyright MIT License
*
*/
#include "system.h"
#include <unistd.h>
#include <cstddef>
#include <iostream>
#include <set>
#include <string>
#include <vector>
#include "l... | 1,764 | 538 |
#ifndef S2SFUNC
#define S2SFUNC
#include "rose.h"
#include "s2sDefines.hpp"
#include "api.hpp"
#include <sstream>
#include <string>
#include <iostream>
#include <vector>
//int MAQAO_DEBUG_LEVEL=0;
static int identifierFunctions=0;
class ASTFunction;
class Function;
struct variable_spe;
/**
* ASTFunction class :
... | 6,579 | 1,861 |
#include <Neosegment.h>
/*
This code can be used to display a value from a potentiometer, dynamically changing color depending on the value
2 Neosegment modules are used to display a number from 0 to 1023
Connect potentiometer to NodeMCU or similar as follows:
5V A0 GND
| | |
---[ * ]--
This co... | 3,425 | 1,193 |
#include "example.h"
#include <stdio.h>
int x = 42;
char *s = (char *)"Test";
void Sync::printer(void) {
printf("The value of global s is %s\n", s);
printf("The value of global x is %d\n", x);
printf("The value of class s is %s\n", s);
printf("The value of class x is %d\n", x);
}
| 288 | 120 |
#include "CannotFindLutException.h"
#include <iostream>
using namespace std;
CannotFindLutException::CannotFindLutException(const string path)
{
_message.append("LUT file error : cannot find ");
_message.append(path);
}
CannotFindLutException::~CannotFindLutException() throw ()
{
}
const string ... | 392 | 126 |
#include <cstdio>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <string>
#include <array>
#include <fstream>
#include <cstring>
#include <vector>
#include <cctype>
#include <locale>
#include <algorithm>
using namespace std;
//fun todo list!
// maybe make an output argument!?!
// make a better ... | 12,962 | 4,350 |
// Copyright Golden Hammer Software
#include "GHParticleTransition.h"
#include "GHParticleSystem.h"
GHParticleTransition::GHParticleTransition(GHParticleSystem& particle)
: mParticle(particle)
{
mParticle.getSpawner().setSpawningAllowed(false);
}
void GHParticleTransition::activate(void)
{
if (mParticle.isDead()) {... | 498 | 189 |
/***************************************************************************
*
* Copyright (c) 2013 Baidu, 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
*
... | 10,869 | 3,667 |
#include <iostream>
#include "complejo.h"
complejo::complejo(double real, double imaginario){ //Constructor por defecto
parte_real = real;
parte_imaginaria = imaginario;
}
void complejo::print(){ //Función print complejo
std::cout<<"Su número complejo es: "<<parte_real<<"+"<<parte_imaginaria<<"i"<<... | 1,159 | 426 |
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04... | 28,786 | 10,730 |
#pragma once
#ifndef BE_GFX_TEX_DDS_READER_HPP_
#define BE_GFX_TEX_DDS_READER_HPP_
#include "default_texture_reader.hpp"
#include "betx_payload_compression_mode.hpp"
#include <be/core/logging.hpp>
namespace be::gfx::tex {
///////////////////////////////////////////////////////////////////////////////
bool is_dds(con... | 890 | 286 |
#include "lab3.h"
#include "config.h"
#include "cube.h"
#include "graphics_node.h"
#include "mesh.h"
#include "monochrome_material.h"
#include "types.h"
#include <glm/glm.hpp>
#include <glm/vec3.hpp>
#include <iostream>
using namespace Display;
Lab3::Lab3() {}
Lab3::~Lab3() {}
const float32 movingDistance = 0.05f;
... | 2,834 | 1,136 |
#include <MainWindow.h>
#include <FDCore/FileUtils.h>
#include <FDQUI/GUI/OpenGLApplication.h>
#include <FDQUI/GUI/View/TransformDelegate.h>
#include <FDQUI/GUI/Widget/VectorWidget.h>
#include <FDQUI/Model/TransformModel.h>
#include <QOpenGLTexture>
#include <QDockWidget>
#include <QTimer>
#include <QTreeView>
#inc... | 13,564 | 4,671 |
#ifndef DEEPSORT_HPP
#define DEEPSORT_HPP
#include <memory>
#include <vector>
#include <opencv2/opencv.hpp>
namespace DeepSORT {
struct Box{
float left, top, right, bottom;
cv::Mat feature;
Box() = default;
Box(float left, float top, float right, float bottom):left(left), top(top), right(right), bo... | 2,198 | 851 |
#pragma once
#include "exmath.h"
#include "exfrac.h"
int RoundToINT(double e) { return (int)(e + 0.5); }
double Math::Multiply(std::initializer_list<double> e)
{
double a = 1;
std::initializer_list<double>::iterator it;
for (it = e.begin(); it != e.end(); ++it) {
a *= *it;
}
return a;
}
double Math:... | 3,619 | 1,556 |
/*
* cpu.cpp
* CPU Management Unit implementation
*/
// includes
#include <cstring>
#include <cstdlib>
#include <ctime>
#include "constants.h"
#include "except.h"
#include "cpu.h"
// constants
constexpr int NUM_REGISTERS = 16;
enum Register {
V0 = 0x00,
VF = 0x0F
};
// class structure
struct CPU::OpaqueDa... | 12,688 | 4,770 |
///////////////////////////////////////////////////////////////////////////////
// Dem Bones - Skinning Decomposition Library //
// Copyright (c) 2019, Electronic Arts. All rights reserved. //
///////////////////////////////////////////////////////////////////////////////
... | 8,106 | 3,535 |
/*
* Copyright (c) The Shogun Machine Learning Toolbox
* Written (w) 2015 Wu Lin
* 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... | 24,345 | 13,627 |
// Copyright 2004-2009 Google 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 ... | 3,895 | 1,290 |
#include <iostream>
#include <unordered_map>
#include <stdio.h>
int main() {
int letters_count, code_length;
std::cin >> letters_count >> code_length;
std::unordered_map<std::string,char> letters_map;
std::string character;
std::string code;
for (int i = 0; i < letters_count; i++){
std:... | 843 | 269 |
//===-- Qt Widgets ----------------------------------------------*- C++ -*-===//
//!
//! \version 2021-10-18
//! \since 2021-09-15
//! \authors zhengrr
//! \copyright Unlicense
//!
//===----------------------------------------------------------------------===//
#include <QtWidgets/QApplication>
#include "MainWindow.h... | 456 | 163 |
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
using namespace std;
int main() {
ofstream arquivo;
arquivo.open("Fabiano.txt", std::ios_base::app);
arquivo << "Olá, mundo!\n\nAqui quem fala é o fabiano.";
arquivo.close();
return 0;
} | 278 | 113 |
#ifndef LATTE_CORE_HOOK_H
#define LATTE_CORE_HOOK_H
#include "latte_core_state.hpp"
#include "latte_type.hpp"
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
namespace latte {
namespace core {
// Base class for before(), after(), before_each(), and after_each()
struct latte_test_hook ... | 4,456 | 1,467 |
////////////////////////////////////////////////////////////////
// Header
#include "Gugu/Common.h"
#include "Gugu/Editor/Modal/OpenProjectDialog.h"
////////////////////////////////////////////////////////////////
// Includes
#include "Gugu/Editor/Editor.h"
#include <imgui.h>
#include <imgui_stdlib.h>
... | 1,097 | 338 |
#include <bits/stdc++.h>
#define fi first
#define se second
#define LIMIT 1000000007
#define dbg(x) cout << "variable '" << #x << << "' -> " << x << '\n';
#define oi() cout << "oi" << endl;
#define fr(a, b, c) for(int a = b, _ = c; a < _; ++a)
typedef unsigned long long ull;
using namespace std;
map<int, bool> ... | 1,278 | 614 |
/*****************************************************************************************
* *
* OpenSpace *
* ... | 59,480 | 17,728 |
#include <iostream>
#include <tuple>
#include <vector>
#include <sstream>
#include "fmt/format.h"
#include "graph/graph.hpp"
#include "Data.hpp"
#include "celero/Celero.h"
constexpr int NumberOfSamples = 200000;
constexpr int NumberOfIterations = 10;
const auto graph_int = simpleDirectedGraph<int>();
const auto gra... | 2,245 | 794 |
// Copyright (c) 2020 The Orbit 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 "OrbitAccessibility/AccessibleInterface.h"
#include "OrbitAccessibility/AccessibleInterfaceRegistry.h"
orbit_accessibility::AccessibleInterfac... | 527 | 153 |
//===- lib/Util/Printing.cpp ----------------------------------------------===//
//
// SeeC
//
// This file is distributed under The MIT License (MIT). See LICENSE.TXT for
// details.
//
//===----------------------------------------------------------------------===//
///
/// \file
///... | 1,224 | 402 |
// Copyright (c) 2009-2016 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
// this include is necessary to get MPI included before anything else to support intel MPI
#include "hoomd/ExecutionConfiguration.h"
#include <iostream>
#incl... | 20,441 | 8,801 |
//
// list_multi_map.cpp
// OpenPGP
//
// Created by Yanfeng Zhang on 1/19/17.
//
// The MIT License
//
// Copyright (c) 2019 Proton Technologies AG
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to dea... | 23,567 | 6,554 |
//
// Created by Eben on 05/06/2019.
//
#include <utility>
#include "IrrEntity.hpp"
#include <sys/stat.h>
#include <string>
#include <fstream>
inline bool check_file_exists (const std::string& name) {
struct stat buffer;
return (stat (name.c_str(), &buffer) == 0);
}
Irrlicht::IrrEntity::IrrEntity(
co... | 4,593 | 1,651 |
#pragma once
#include <protozero/pbf_writer.hpp>
#include <protozero/pbf_reader.hpp>
#define RAPIDJSON_HAS_STDSTRING 1
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
#include "rapidjson/document.h"
#include <osmium/osm/types.hpp>
namespace osmwayback {
/*
PBF Object Encoding
============... | 8,816 | 2,526 |
// LzfseDecoder.cpp
/*
This code implements LZFSE data decompressing.
The code from "LZFSE compression library" was used.
2018 : Igor Pavlov : BSD 3-clause License : the code in this file
2015-2017 : Apple Inc : BSD 3-clause License : original "LZFSE compression library" code
The code in the "LZFSE compressi... | 23,104 | 9,986 |
//
// Upcaste Performance Libraries
// Copyright (C) 2012-2013 Jesse W. Towner
//
// 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 lim... | 13,685 | 5,774 |
#include <iostream>
#include <turbo/Engine.hpp>
int main() {
turbo::EventHandler<unsigned int, float> event_handler([](unsigned int i, float j) {
std::cout << "i: " << i << ", j: " << j << std::endl;
});
turbo::Event<unsigned int, float> testEvent;
testEvent += event_handler;
testEvent(4, -... | 390 | 148 |
#pragma once
#include <iostream>
#include <vector>
#define MECH_INF 0
#define ARMOR 1
#define ARTILLARY 2
#define SF 3
#define INF 4
class Regiment{
public:
int type;
int battalions;
double BBV;
double BDV;
double BS;
double BBD;
double BSP;
void addBattalion();
int getStrength();
double getBV(... | 406 | 177 |
#include <iostream>
#include <fstream>
using namespace std;
typedef struct node{
int n;
struct node * left;
struct node * right;
}node;
node * make_tree(){
node * n5 = new node; n5->n = 5; n5->left = nullptr; n5->right = nullptr;
node * n4 = new node; n4->n = 4; n4->left = nullptr; n4->right = nul... | 889 | 359 |
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#include "fiddle/examples.h"
// HASH=0d2cbf82f490ffb180e0b4531afa232c
REG_FIDDLE(Picture_MakePlaceholder, 256, 256, false, 0) {
class MyCanvas : public SkCanvas {
public:
MyCanvas(SkCan... | 1,075 | 375 |
///////////////////////////////////////////////////////////////////////////////
//
// @@@ START COPYRIGHT @@@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright o... | 20,802 | 5,902 |
//
// CPUModelResults.hpp
// SNR_opencl_multi
//
// Created by tihmstar on 27.11.19.
// Copyright © 2019 tihmstar. All rights reserved.
//
#ifndef CPUModelResults_hpp
#define CPUModelResults_hpp
#include <vector>
#include "numerics.hpp"
class CPUModelResults {
std::string _modelName;
cl_uint _modelSize;
... | 844 | 301 |
/*---------------------------------------------------------------------------*\
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of CAELUS.
CAELUS is free software: you can redistribute it and/or modify it
under... | 8,884 | 2,902 |
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04... | 7,612 | 2,664 |
//-*-mode:c++; mode:font-lock;-*-
/*! \file VSSimCoordTransform.hpp
Perform coordinate transforms on simulation events.
\author Matthew Wood \n
UCLA \n
mdwood@astro.ucla.edu \n
\version 1.0
\date 09/11/2008
$Id: VSSimCoo... | 1,584 | 597 |
/*!
\file microfacet-inl.hpp
\author Sho Ikeda
Copyright (c) 2015-2018 Sho Ikeda
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
*/
#ifndef NANAIRO_MICROFACET_INL_HPP
#define NANAIRO_MICROFACET_INL_HPP
#include "microfacet.hpp"
// Standard C++ library
#incl... | 5,526 | 2,024 |
#include <OpenGP/SurfaceMesh/SurfaceMesh.h>
#include <OpenGP/SurfaceMesh/bounding_box.h>
#include <OpenGP/GL/glfw_helpers.h>
#include <OpenGP/GL/glfw_trackball.h>
#include <OpenGP/GL/Eigen.h>
#include <OpenGP/MLogger.h>
using namespace OpenGP;
using namespace std;
/// Viewer global status
SurfaceMesh mesh;
std::vecto... | 6,104 | 2,019 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/chime-sdk-identity/model/EndpointStatusReason.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using name... | 2,224 | 654 |
// Copyright 2017 Rainer Gemulla
//
// 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 applica... | 4,016 | 1,385 |
//! \file PdbCompilandStream.cpp
//! \brief PDB compiland stream.
//! \author Oleg Krivtsov
//! \date 2011
#include "stdafx.h"
#include "PdbCompilandStream.h"
#include "PdbDebugInfoStream.h"
#include "Buffer.h"
#include "strconv.h"
#include "PdbStreamStruct.h"
#include "PdbReader.h"
CPdbCompilandStream::CPdbCompiland... | 11,233 | 3,921 |
// Copyright (c) 2007-2009 Google Inc.
// Copyright (c) 2006-2007 Jaiku Ltd.
// Copyright (c) 2002-2006 Mika Raento and Renaud Petit
//
// This software is licensed at your choice under either 1 or 2 below.
//
// 1. MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of thi... | 10,277 | 4,174 |
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd. 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... | 2,055 | 783 |
#include "I.hpp"
#include "T.hpp"
using namespace std;
int main()
{
}
| 71 | 31 |
#include "File.h" | 17 | 8 |
/*
* ResetableObject.cpp
*
* Created on: Oct 29, 2014
* Author: ricardo
*/
#include "ResetableObject.h"
ResetableObject::ResetableObject() :
DynamicObject() {
this->setAlive(false);
this->_resetTime = rand() % 10;
}
ResetableObject::~ResetableObject() {
}
void ResetableObject::resetPositi... | 656 | 232 |
#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include "shape.hpp"
#include <glm/vec3.hpp>
#include "box.hpp"
#include "sphere.hpp"
#include "color.hpp"
#include "scene.hpp"
#include "scene.cpp"
#include <string>
#include <sstream>
TEST_CASE ("rec", "[rec]"){
glm::vec3 origin {0.f, 0.f, 0.f};
glm::vec3 corner1 {... | 2,767 | 1,316 |
#include <stdlib.h>
#include <unistd.h>
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
string cmd = "python \"C:\\path\\to\\xml-associator.py\" ";
if(argc != 2) {
return 1;
}
string file = string("\"")+argv[1]+"\"";
cmd += file;
cout << cmd << std::endl;
system(... | 336 | 141 |
//
// Copyright (c) 2019 Maxime Pinard
//
// Distributed under the MIT license
// See accompanying file LICENSE or copy at
// https://opensource.org/licenses/MIT
//
#include "config.hpp"
#include "utils.hpp"
#include "RandomDynamicBitsetGenerator.hpp"
#include <catch2/catch.hpp>
#include <sul/dynamic_bitset.hpp>
#inc... | 1,655 | 736 |
#include <iostream>
#include <vector>
#include <list>
using namespace std;
typedef vector<vector<int>> graph;
void visit(int v, const graph &g, vector<int> &visited, list<int> &order) {
visited[v] = true;
for(int w : g[v]) {
if(!visited[w]) visit(w, g, visited, order);
}
order.push_front(... | 942 | 345 |
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
*
* Gearmand client and server library.
*
* Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/
* Copyright (C) 2008 Brian Aker, Eric Day
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* ... | 30,898 | 11,186 |
#include "state_machine.h"
#include "digital_io.h"
#include "globals.h"
// take care to have all enum values of StateType present
void (*state_machine[])(void) = {
sm_state_BEGIN,
sm_state_WAIT_VIN_ON,
sm_state_ENT_CHARGING,
sm_state_CHARGING,
sm_state_ENT_ON,
sm_state_ON,
sm_state_ENT_DEP... | 4,577 | 1,986 |
#include <iostream>
#include <sys/stat.h>
#define MAX_ARR_BOX 100
using namespace std;
struct MyException : public std::exception
{
std::string s;
MyException(std::string ss) : s(ss) {}
~MyException() throw () {} // Updated
const char* what() const throw() { return s.c_str(); }
};
typedef struct Box{
... | 2,347 | 846 |
#include <Precomp.h>
#include <Renderer/UniformBuffer.h>
#include <Renderer/Renderer.h>
#include <Platform/OpenGL/OpenGLUniformBuffer.h>
namespace OP
{
Ref<UniformBuffer> UniformBuffer::Create(uint32_t size, uint32_t binding)
{
switch (Renderer::GetAPI())
{
case RendererAPI::API::None: OP_ENGINE_ASSERT(false... | 554 | 203 |
#include <stan/math/mix.hpp>
#include <test/unit/math/rev/fun/util.hpp>
#include <gtest/gtest.h>
#include <vector>
TEST(ProbDistributionsOrdLog, fv_fv) {
using stan::math::fvar;
using stan::math::ordered_logistic_lpmf;
using stan::math::var;
using stan::math::vector_d;
using stan::math::vector_ffv;
using s... | 16,783 | 10,861 |
/**
* TitaniumKit Titanium.Media.AudioPlayer
*
* Copyright (c) 2015 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License.
* Please see the LICENSE included with this distribution for details.
*/
#include "Titanium/Media/AudioPlayer.hpp"
#include "Titanium/detail/TiIm... | 10,923 | 4,637 |
#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 2000002
using namespace std;
long long bz[N][3];
int d[100];
int n;
void work(int x){
for (int i=2;(long long)i*i<=x;i++)
if (x%i==0){
d[++d[0]]=i;
while (!(x%i))x/=i;
}
if (x!=1)d[++d[0]]=x;
}
int main(){
scanf("%d",&n);
bz[n][2]=1,bz[n-1]... | 853 | 577 |
#ifndef DG_MARCHAND_HPP
#define DG_MARCHAND_HPP
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include "Taille_fenetre.hpp"
#include "Global_taille_fenetre.hpp"
#include "Hero.hpp"
class Marchand
{
public:
////////////... | 7,228 | 1,604 |
/*!
* \file ItemObserver.cpp
* \brief A persistent observer of items in the world for the spatial world database.
*
* The world item observer will store item observations in a remote spatial world database by listening to a
* rail_manipulation_msgs/SegmentedObjectList message.
*
* \author Russell Toris, WPI - rc... | 5,449 | 1,672 |
/**********************************************************************
* CC0 License
**********************************************************************
* MergeBathy - Tool to combine one or more bathymetric data files onto a single input grid.
* Modified in 2015 by Samantha J.Zambo(samantha.zambo@gmail.com) while ... | 49,066 | 19,384 |
#include "mgr.hpp"
#include "if.hpp"
namespace rev {
ObjMgr::~ObjMgr() {
constexpr int N_RETRY = 8;
for(int i=0 ; i<N_RETRY ; i++) {
// オブジェクトが無くなるまで繰り返しdestroy
auto tmp = base_t::getResourceSet();
if(tmp->set.empty())
break;
for(auto& obj : tmp->set) {
try {
if(auto sp = obj.weak.lock())... | 1,224 | 574 |
#pragma once
#include <string>
#include <unordered_map>
#include <glpp/core/object/texture_atlas.hpp>
#include <glpp/core/object/shader.hpp>
namespace glpp::core::render {
namespace detail {
struct none_t {};
template <class T, class Y>
constexpr ptrdiff_t get_offset(Y T::* ptr) {
return reinterpret_cast<char*... | 4,874 | 1,686 |
#include "BookList.h"
BookList::BookList(const BookList & anotherList)
{
capacity_ = anotherList.capacity_;
booksCount_ = anotherList.booksCount_;
books_ = new Book[capacity_];
for (int i = 0; i < booksCount_; i++)
{
anotherList.books_[i].setId(i+1);
books_[i] = anotherList.books_[i... | 2,660 | 958 |
#include "StdAfx.h"
#include "DecompressClayfighter.h"
#include "SharedFunctions.h"
CDecompressClayfighter::CDecompressClayfighter(void)
{
}
CDecompressClayfighter::~CDecompressClayfighter(void)
{
}
int CDecompressClayfighter::Decompress(byte *output, byte *input)
{
bool bVar1;
byte bVar2;
byte bVar3;
byte *... | 966 | 452 |
#ifndef __LISTAADJACENCIA_H__
#define __LISTAADJACENCIA_H__
#include <iostream>
#include <vector>
#include "Estrutura_de_dados.hpp"
using namespace std;
class NodeList
{
public:
/* data */
//NodeList* prior;
NodeList* next;
int data;
double weight;
NodeList(int da... | 1,579 | 500 |
#ifndef PEOPLEEXTRACTORINTERFACESMA_SCENEFRAMEQUEUE_H
#define PEOPLEEXTRACTORINTERFACESMA_SCENEFRAMEQUEUE_H
#include <boost/interprocess/offset_ptr.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/containers/deque.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#inc... | 1,057 | 351 |
#include "StableHeaders.h"
#include "HoveringButtonsController.h"
#include <QPushButton>
#include <QMouseEvent>
#include <QDebug>
#include "RexLogicModule.h"
namespace RexLogic
{
HoveringButtonsController::HoveringButtonsController()
:text_padding_(10.0f)
{
Ui::HoveringButtonsWidget::setupUi(this)... | 2,377 | 727 |
#include <string.h>
#include "FrozenWasteland.hpp"
#include "dsp/digital.hpp"
#define NUM_RULERS 10
#define MAX_DIVISIONS 6
#define TRACK_COUNT 4
#define MAX_STEPS 18
#define sMIN(a,b) (((a)>(b))?(b):(a))
#define sMAX(a,b) (((a)>(b))?(a):(b))
namespace rack_plugin_FrozenWasteland {
struct QuadEuclideanRhythm : Modul... | 23,745 | 10,811 |
/*
Desh, Salman Rahman: 13-23239-1
Amin, H.M. Ruhul: 13-23624-1
Hassan, Jahidul: 13-25373-1
Mahdi, Dewan Osman: 13-25368-3
*/
#include <sstream>
#include <stdio.h>
#include <iostream>
#include <windows.h>
#include <GL/glut.h>
#include <GL/freeglut.h>
using namespace std;
int viewY, viewX;
int move_u... | 11,296 | 5,691 |
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
const int PRE_PROCESS_SIZE=40000;
bool prime[PRE_PROCESS_SIZE];
fill(prime,prime+PRE_PROCESS_SIZE,true);
prime[0]=prime[1]=false;
for(int i=2;i<PRE_PROCESS_SIZE;i++)
if(prime[i])
for(int j=2;i*j<PRE_PROCESS_SIZE;j++)
prim... | 637 | 355 |
// Paste me into the FileEdit configuration dialog
#include <string>
#include <vector>
using namespace std;
class $CLASSNAME$ {
public:
$RC$ $METHODNAME$( $METHODPARMS$ ) {
}
};
$BEGINCUT$
$TESTCODE$
$DEFAULTMAIN$
$ENDCUT$
| 252 | 106 |
// Time: O(n)
// Space: O(n)
class Solution {
public:
int maxProfit(int k, vector<int> &prices) {
vector<int> profits;
vector<pair<int, int>> v_p_stk; // mono stack, where v is increasing and p is strictly decreasing
for (int v = -1, p = -1; p + 1 < size(prices);) { // at most O(n) peaks,... | 2,265 | 802 |
#include "mkl.h"
#include "../headers/calculations.h"
int main(int _argc, char const *argv[])
{
std::string filePath = argv[1];
//calculateRef(filePath);
calculateImpl(filePath);
return 0;
}
| 209 | 79 |