text string | size int64 | token_count int64 |
|---|---|---|
#include "oems/oems_sorter.h"
#include <cassert>
namespace {
using namespace oems;
void copy_data_from_gpu(ID3D11Device* p_device, ID3D11DeviceContext* p_ctx,
ID3D11Buffer* p_buffer_src, float* p_dest, size_t byte_count)
{
assert(p_device);
assert(p_ctx);
assert(p_buffer_src);
assert(p_dest);
... | 3,063 | 1,374 |
#include <bits/stdc++.h>
using namespace std;
const int M = 1002;
int n, m, a, b, vis[M], pre[M];
string A, B;
vector<int> adj[M];
void dfs(int st) {
vis[st] = true;
for (int i : adj[st]) {
if (!vis[i]) {
pre[i] = st;
dfs(i);
}
}
}
string find(int st, int ed) {
... | 993 | 415 |
#ifndef MALANG_IR_NODES_HPP
#define MALANG_IR_NODES_HPP
#include "ir.hpp"
#include "ir_noop.hpp"
#include "ir_block.hpp"
#include "ir_assignment.hpp"
#include "ir_binary_ops.hpp"
#include "ir_branch.hpp"
#include "ir_call.hpp"
#include "ir_label.hpp"
#include "ir_memory.hpp"
#include "ir_primitives.hpp"
#include "ir_r... | 508 | 224 |
// REVIEW clang-format is your friend, use it, though I don't remeber if macos comes with it by default
#include <math.h>
#include <string.h>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <utility> // REVIEW: for std::move
#include <vector>
//#in... | 10,940 | 3,058 |
/**
* Copyright (c) 2019 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... | 5,391 | 2,056 |
#include <glm\mat4x4.hpp>
#include <glm\gtc\random.hpp>
#include <SFML\System.hpp>
#include <algorithm>
#include "Generators\ColorGenerator.h"
#include "logging\Logger.h"
#include "RoadEffect.h"
RoadStats RoadEffect::stats = RoadStats();
RoadEffect::RoadEffect()
{
}
bool RoadEffect::LoadBasics(ShaderFactory* shaderM... | 8,572 | 2,777 |
/*
* Proland: a procedural landscape rendering library.
* Copyright (c) 2008-2011 INRIA
*
* 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 op... | 14,526 | 5,120 |
class Solution {
public:
void reverse(vector<int> &nums, int startIndex, int endIndex) {
while (startIndex < endIndex) {
int temp = nums[startIndex];
nums[startIndex] = nums[endIndex];
nums[endIndex] = temp;
startIndex++;
endIndex--;
}
... | 702 | 222 |
#include "image.h"
#include "main.h"
#include <map>
map<uint8_t, bool(*)(image*)> gfLoad = {{0, loadDefault}, {1, loadBmp}, {2, loadTga}, {3, loadPng}};
map<uint8_t, bool(*)(image*)> gfSave = {{0, saveDefault}, {1, saveBmp}, {2, saveTga}, {3, savePng}};
bool loadDefault(image* img)
{
printf("%s unknown format.\n"... | 1,505 | 592 |
#include "GoToLineWindow.h"
using namespace InterfaceConstants;
GoToLineWindow::GoToLineWindow(BRect r,BMessenger* messenger) : BWindow(r,"Go To Line...",B_FLOATING_WINDOW,B_NOT_ZOOMABLE|B_NOT_RESIZABLE)
{
SetFeel(B_NORMAL_WINDOW_FEEL);
parent = new BView(Bounds(),"parent",B_FOLLOW_ALL_SIDES,B_WILL_DRAW);
parent... | 1,366 | 655 |
/**
* \file TestReadFromFile7.cpp
* \brief Reads test-data/l2v3-all.xml into memory and tests it.
* \author Sarah Keating
*
* $Id: TestReadFromFile7.cpp 10129 2009-08-28 12:23:22Z sarahkeating $
* $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/sbml/test/TestReadFromFile7.cpp... | 17,235 | 6,783 |
# include <libraw/libraw.h>
# include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
NumericMatrix readraw(CharacterVector fname, NumericVector channels) {
LibRaw rawimage;
int ret=0;
int i, j;
std::string fn = as<std::string>(fname);
ret=rawimage.open_file(fn.c_str());
if (ret != 0) stop("LibRaw ... | 1,017 | 419 |
/* This file is licensed under the terms of the Apache License, Version 2.0
* Please see the file COPYING for the full text of this license
*
* Copyright 2010-2011 Tagged */
/* <base/error.cc>
Implements <base/error.h>. */
#include <base/error.h>
#include <cstdlib>
#include <iostream>
#include <sstream>
#inc... | 1,519 | 523 |
// https://practice.geeksforgeeks.org/problems/array-pair-sum-divisibility-problem/0
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(0)
#define pb push_back
#define digit(x) floor(log10(x))+1
#define mod 1000000007
#define endl "\n"
#define int long long
#define matrix vec... | 1,501 | 614 |
// online2bin/online2-web-nnet3-decode-testmode.cc
// this is for testing kaldi decoder for lots of voice
// Copyright 2014 Johns Hopkins University (author: Daniel Povey)
// 2016 Api.ai (Author: Ilya Platonov)
// 2018 Polish-Japanese Academy of Information Technology (Author: Danijel Korzinek)
... | 4,974 | 1,794 |
#include <iostream>
#include <vector>
using namespace std;
vector<vector<int> > fk;
int n, m;
int query(int x, int y) {
int sum = 0;
for (int i = x; i > 0; i-=(i&(-i))) {
for (int j = y; j > 0; j-=(j&(-j))) {
sum+=fk[i][j];
}
}
return sum;
}
int query(int x1, int y1, int ... | 1,536 | 659 |
// 2009-12-30
//Dynamic max prefix sum query with segment tree. O((n+m) lg n)
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
static int sum[1000000];
static int max_psum[1000000];
void recalc(int root)
{
sum[root]=sum[root<<1]+sum[1+(root<<1)];
max_psum[root]=max(max_psum[root<<1]... | 1,703 | 946 |
#include "pch.h"
#include "tdd_instance.h"
#include "tdd_shape_box.h"
#include "tdd_shape_connection.h"
#include "tdd_shape_text.h"
#include "tdd_shape_free.h"
#include "tdd_shape_table.h"
#include "tdd_shape_qrcode.h"
#include "tdd_instance_action.h"
using namespace std;
namespace TDD
{
void to_json(json& j, const I... | 4,299 | 1,313 |
#pragma once
#include "acmacs-base/guile.hh"
// ----------------------------------------------------------------------
namespace acmacs::data_fix::inline v1
{
// pass pointer to this function to guile::init()
void guile_defines();
} // namespace acmacs::data_fix::inline v1
// ------------------------------... | 453 | 130 |
// Copyright 2019 IBM 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 agreed... | 2,280 | 599 |
#include <random>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <math.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include <float.h>
#include "particle_filter.h"
using namespace std;
void ParticleFilter::init(double x, double y, double theta, double std[]) {
... | 11,744 | 3,448 |
// Copyright (c) 2013 The Chromium Embedded Framework 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 "cefclient/browser/window_test.h"
namespace client {
namespace window_test {
namespace {
HWND GetRootHwnd(CefRefPtr<Cef... | 2,668 | 926 |
#include "pch.h"
#include "HeapTreeNode.h"
#include "SortHelper.h"
#include "resource.h"
#include "ObjectsTreeNode.h"
static const struct {
PCWSTR header;
int width;
int format = LVCFMT_LEFT;
} columns[] = {
{ L"Type Name", 420 },
{ L"Method Table", 120, LVCFMT_RIGHT },
{ L"Object Count", 100, LVCFMT_RIGHT },
{... | 3,296 | 1,362 |
#include "stdafx.h"
#include "Card.h"
Card::Card(int value, int suit)
{
Num = value;
Suit = suit;
}
Card::~Card()
{
}
int Num;
int Suit; | 143 | 70 |
#include <iostream>
using namespace std;
int main() {
int k, m, n;
bool alexs_turn = true;
cin >> k >> m >> n;
while(k) {
if(k >= m + n) k -= m;
else if(k > n) k -= n;
else k = 0;
alexs_turn = !alexs_turn;
}
if(!alexs_turn) cout << "Barb";
else cout << "Ale... | 331 | 136 |
#ifndef TOUCHPAD_HH
#define TOUCHPAD_HH
#include "JoystickDevice.hh"
#include "MSXEventListener.hh"
#include "StateChangeListener.hh"
#include <memory>
namespace openmsx {
class MSXEventDistributor;
class StateChangeDistributor;
class CommandController;
class StringSetting;
class TclObject;
class Touchpad : public ... | 2,094 | 640 |
// -*- C++ -*-
#if !defined(__numerical_random_DiscreteGeneratorBinned_ipp__)
#error This file is an implementation detail of DiscreteGeneratorBinned.
#endif
namespace numerical {
template<class Generator>
inline
typename DiscreteGeneratorBinned<Generator>::result_type
DiscreteGeneratorBinned<Generator>::... | 11,760 | 3,936 |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int> postorderTraversal(TreeNode* root) {
// return recursiveTraversal(root);
... | 1,375 | 457 |
//------------------------------------------------------------------------------
// FunctionOutputData
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
// Copyright (c) 2002 - 2020 United States Government as represen... | 5,951 | 1,547 |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
using nam... | 4,648 | 1,343 |
#include<bits/stdc++.h>
using namespace std;
struct node
{
string xm;
int qm, bj;
char bgb, xb;
int lw;
int ans;
int sum;
}a[101];
int n, tot = 0;
bool cmp(node x, node y)
{
if(x.ans == y.ans) return x.sum < y.sum;
else return x.ans > y.ans;
}
int main()
{
scanf("%d",&n);
for... | 799 | 448 |
#pragma once
#include "core_reflection/metadata/meta_impl.hpp"
#include "core_reflection/reflection_macros.hpp"
#include "core_reflection/metadata/meta_types.hpp"
#include "core_reflection/utilities/reflection_function_utilities.hpp"
namespace wgt
{
BEGIN_EXPOSE(MetaBase, MetaNone())
END_EXPOSE()
BEGIN_EXPOSE(MetaNo... | 3,989 | 1,518 |
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <filesystem>
#include <sstream>
// Hello. This is a simple command line utility for packaging assets into a si-
// ngle file. It works recursively.
namespace stdfs = std::filesystem;
// Unused argument suppressor
#define UNUSED_ARG(x... | 4,595 | 1,338 |
#include "Fuzzer_Caller.h"
#include <unistd.h>
#include <iostream>
#include <fcntl.h>
#include <vector>
#include <stdio.h>
using namespace std;
void Fuzzer_Caller::call_Fuzzer()
{
remove("formula"); //TODO: dont remove the file, just clear it
int fd = open("formula", O_RDWR | O_C... | 641 | 261 |
#include "board_analyzer.h"
#include "board.h"
#include "figures.h"
#include <iostream>
#include <cstdlib>
BoardAnalyzer::BoardAnalyzer() {
isGameInSession = false;
command = "";
BeginOperation();
}
BoardAnalyzer::~BoardAnalyzer() {
}
void BoardAnalyzer::BeginOperation() {
while (command != "e... | 4,708 | 2,149 |
/**
* @file swats_test.cpp
* @author Marcus Edel
*
* Test file for the SWATS optimizer.
*
* ensmallen is free software; you may redistribute it and/or modify it under
* the terms of the 3-clause BSD license. You should have received a copy of
* the 3-clause BSD license along with ensmallen. If not, see
* htt... | 2,053 | 913 |
/*
* 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"); you ... | 6,375 | 2,283 |
#include <Arduino.h>
#include <SPI.h>
#include <NRFLite.h>
#define BUTTON_PIN 3
#define LED_PIN 10
#define CE_PIN 5
#define CSN_PIN 6
#define RADIO_ID 0 // 0 = Transmitter, 1 = Receiver
bool buttonStateZero = 0;
bool buttonStateOne = 0;
struct RadioPacket {
uint8_t FromRadioId;
uint32_t OnTimeMillis;
u... | 1,980 | 728 |
#include "Bounce.h"
#include <iostream>
//#include <intrin.h> - Not needed on linux
World *world;
void ClearScreen()
{
std::cout << std::string(100, '\n');
}
void handleUp(int action)
{
//if (action == 1){
ClearScreen();
World::setGravity(World::getGravity() + 0.5f);
std::cout << Worl... | 1,233 | 453 |
/*************************************************************
* > File Name : P1311.cpp
* > Author : Tony
* > Created Time : 2019/10/20 19:31:08
* > Algorithm :
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
inline in... | 991 | 376 |
#pragma once
#include <opencv2/core.hpp>
struct Detection
{
float x1, y1, x2, y2;
float score;
int cls;
};
void DrawRectangle(cv::Mat& img, const Detection& d, const cv::Scalar& color);
void DrawDetection(cv::Mat& img, const Detection& d, const cv::Scalar& color);
void DrawPerson(cv::Mat& img, const Detection& ... | 677 | 258 |
#include <cmath>
#include <cstdio>
#include <cstring>
#define HMOD 1000007LL
using namespace std;
struct hash_link
{
long long ori;
long long val;
int nxt;
};
hash_link e[HMOD << 2];
int edge_num[HMOD], cnt;
long long a, b, MOD;
inline void add(long long x, long long y)
{
long long ori = x;
x %= HMOD;
for (int... | 1,454 | 737 |
#include "torch/csrc/jit/api/module.h"
#include "core/compiler.h"
#include "core/util/prelude.h"
#include "torch_tensorrt/torch_tensorrt.h"
namespace torch_tensorrt {
// Defined in types.cpp
trtorch::core::runtime::CudaDevice to_internal_cuda_device(Device device);
namespace torchscript {
// Defined in compile_spec.... | 1,877 | 632 |
#ifndef RECEIVE_MSG_HPP
#define RECEIVE_MSG_HPP
#include "common.hpp"
void *receive_msg(void *ptr);
#endif | 109 | 52 |
/* Copyright 2019 Husky Data Lab, CUHK
Authors: Created by Hongzhi Chen (hzchen@cse.cuhk.edu.hk)
*/
template <class T>
ibinstream& operator<<(ibinstream& m, const T* p) {
return m << *p;
}
template <class T>
ibinstream& operator<<(ibinstream& m, const vector<T>& v) {
m << v.size();
for (typename vector<T... | 4,137 | 1,627 |
/////////////////////////////////////////////////////////////////////////////
// Name: samples/archive/archive.cpp
// Purpose: A sample application to manipulate archives
// Author: Tobias Taschner
// Created: 2018-02-07
// Copyright: (c) 2018 wxWidgets development team
// Licence: wxWindows l... | 10,914 | 3,232 |
// 2014-2019, ETH Zurich, Integrated Systems Laboratory
// Authors: Christian Stieger
#include "testTools.h"
#include "test_cr_tVecItr_all.h"
#include "test_cr_tVecItr_all.cc"
template<>
void test_cr_tVecItr_all<CPX__,RE__,CPX__,lm_tCol<CPX__,RE__,CPX__>>::test_dereference() {
const size_t M = genRndST();
const ... | 841 | 439 |
//Lab 3 lab3_GradeBook.cpp
#include <iostream>
using namespace std;
#include "lab3_GradeBook.h"
//set the gradebook with a course and a instructor tag
GradeBook::GradeBook(string course, string Instructor)
{
setCourseName(course);
setInstructorName(Instructor);
}
//set the course name
void GradeBook::setCourseName(... | 1,088 | 372 |
#include "app.h"
App::App()
{
this->window = nullptr;
this->renderer = nullptr;
this->e = {};
this->running = true;
}
App::~App()
{
SDL_RemoveTimer(repeatOnceFunctionTimer);
SDL_RemoveTimer(customEventFunctionTimer);
SDL_Log("Старт разрушения окна");
SDL_DestroyWindow(window);
SDL_Log("разрушение окна успе... | 7,678 | 3,549 |
#include "SourceHolder.h"
| 27 | 10 |
// Copyright 2021 Lawrence Livermore National Security, LLC and other ExaCA Project Developers.
// See the top-level LICENSE file for details.
//
// SPDX-License-Identifier: MIT
#ifndef EXACA_GHOST_HPP
#define EXACA_GHOST_HPP
#include "CAtypes.hpp"
#include <Kokkos_Core.hpp>
void GhostNodesInit(int, int, int Decomp... | 2,779 | 928 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @project Library/Astrodynamics
/// @file Library/Astrodynamics/Trajectory/Orbit/Models/Kepler.hpp
/// @author Lucas Brémond <luca... | 10,745 | 1,931 |
#include <dmzLuaKernel.h>
#include "dmzLuaKernelPrivate.h"
#include <dmzLuaKernelValidate.h>
#include <dmzRuntimeDefinitions.h>
#include <dmzSystem.h>
#include <dmzTypesHashTableHandleTemplate.h>
#include <dmzTypesString.h>
#include <luacpp.h>
using namespace dmz;
namespace {
static const char HandleName[] = "dmz.ty... | 6,793 | 2,592 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2016 NITK Surathkal
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is di... | 8,902 | 3,417 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
string s;
cin >> n;
int sum = n + 2;
for (int i = 0; i < n; i++) {
cin >> s;
if (s[s.size() - 4] == '+') sum++;
}
if (sum == 13) sum++;
cout << 100 * sum << endl;
return 0;
}
| 268 | 131 |
// This file is part of Notepad++ project
// Copyright (C)2003 Don HO <don.h@free.fr>
//
// 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... | 1,657 | 479 |
/*************************************************************************
> File Name: test_10.cpp
> Author: @Yoghourt->ilvcr, Cn,Sx,Ty
> Mail: ilvcr@outlook.com || liyaoliu@foxmail.com
> Created Time: 2018年06月21日 星期四 23时30分40秒
> Description: 将泛型算法应用到vector类对象上
***********************************************... | 911 | 373 |
// ---
// id : 1075
// title : PAT Judge
// difficulty : Medium
// score : 25
// tag : Primary Algorithm
// keyword : sort
// status : AC
// from : PAT (Advanced Level) Practice
// ---
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct User {
... | 2,036 | 902 |
#include "lz4mt.h"
extern "C" const char*
lz4mtResultToString(Lz4MtResult result)
{
const char* s = "???";
switch(result) {
case LZ4MT_RESULT_OK:
s = "OK";
break;
case LZ4MT_RESULT_ERROR:
s = "ERROR";
break;
case LZ4MT_RESULT_INVALID_MAGIC_NUMBER:
s = "INVALID_MAGIC_NUMBER";
break;
case LZ4MT_RESULT... | 7,233 | 3,557 |
#include "actions.h"
G4Run* RunAction::GenerateRun() { return nullptr; }
void RunAction::BeginOfRunAction(const G4Run*) { }
void RunAction::EndOfRunAction(const G4Run*) { }
void EventAction::BeginOfEventAction(const G4Event*) { }
void EventAction::EndOfEventAction(const G4Event*) { }
void TrackingAction::PreUserTrac... | 475 | 155 |
#include <cppnet/poll.hpp>
#include <algorithm>
bool net::poll::add(socket::native_handle_type fd, int eventmask)
{
if (fd < 0)
return false;
auto it = std::find_if(fds.begin(), fds.end(), [fd](const pollfd& p) {
return p.fd == fd;
});
if (it != fds.end())
return false;
fds... | 3,332 | 1,264 |
#ifndef _LOGIC_HPP
#define _LOGIC_HPP
#include "../binary_op.hpp"
#ifdef LIB_FTFP
class BitwiseAndOp: public BinaryOp {
void call(fixed scalar1, fixed scalar2, fixed *result);
};
class BitwiseOrOp: public BinaryOp {
void call(fixed scalar1, fixed scalar2, fixed *result);
};
#else
class BitwiseAndOp: public Binary... | 537 | 188 |
#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
using namespace std;
int main()
{
int k;
vector <pair <int, int>> ans;
while (cin >> k)
{
ans.clear();
for (int y = k + 1; y <= 2 * k; y++)
{
int x = ((k * y) / (y - k));
if ((k * y) % ... | 557 | 280 |
//
// Created by phoenixflower on 10/12/19.
//
#ifndef LANDESSDEVDATASTRUCTURES_ISMEMBERPOINTER_H
#define LANDESSDEVDATASTRUCTURES_ISMEMBERPOINTER_H
//#include "Definitions/Common.hpp"
namespace LD
{
namespace Detail
{
template< class T >
struct is_member_pointer_helper : LD::FalseType... | 742 | 271 |
// Copyright 2010, Florent Lamiraux, Thomas Moulard, LAAS-CNRS.
//
// This file is part of dynamic-graph-python.
// dynamic-graph-python 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
// versi... | 1,798 | 570 |
#include "AmbushState.h"
#include "Level.h"
#include "MovementModule.h"
#include "Player.h"
#include "PathFinderModule.h"
#include "Config.h"
namespace pacman {
Vect2 AmbushState::GetNextTarget()
{
Vect2 next = *m_playerwPtr->GetPos();
m_datawPtr->m_levelwPtr->NextIntersection(next, m_playerwPtr->GetDirection());... | 1,513 | 625 |
#ifndef _PSP_VER
#include "Vector3.h"
Vector3& Vector3::operator =(const Vector3 &rhs)
{
_vec = rhs._vec;
return *this;
}
Vector3 Vector3::operator +(const Vector3& rhs) const
{
Vector3 ret;
D3DXVec3Add( &ret._vec, &_vec, &rhs._vec );
return ret;
}
Vector3 Vector3::operator- (const Vector3& rhs) const
{
Vecto... | 3,405 | 1,519 |
//
// Created by Spud on 7/16/21.
//
#include "npf/layout/rows.hpp"
void Rows::populateBlocks(const JSON_ARRAY &array) { // TODO Comments
display = std::vector<std::vector<int>>(array.Size());
for (JSON_ARRAY_ENTRY &entry : array) {
if (entry.IsObject()) {
JSON_OBJECT object = entry.GetObj();
POPULATE_AR... | 884 | 366 |
// https://www.urionlinejudge.com.br/judge/en/problems/view/1715
#include <iostream>
using namespace std;
int main() {
int players, matches, p;
while (cin >> players >> matches) {
int counter = 0;
for (int i = 0; i < players; i++) {
bool scored = true;
for (int j = 0; j < matches; j++) {
cin >> p;... | 433 | 195 |
#include "CustomSpriteA.h"
//==============================================================
// Constructor / Destructor
//==============================================================
//--------------------------------------------------------------
CustomSpriteA::CustomSpriteA() {
ofLog() << "[CustomSpriteA]Cust... | 1,903 | 465 |
/**
* Testbed on checking whether std::vector<scalar-type> is trivially copyable or not via
* type traits.
*
* Read more about trivially copyable at Notes section in https://en.cppreference.com/w/cpp/types/is_trivially_copyable
*/
#include <type_traits>
#include <iostream>
#include <vector>
std::vector<unsigned i... | 702 | 229 |
//===- AArch64PrettyPrinter.cpp ---------------------------------*- C++ -*-===//
//
// Copyright (c) 2020, The Binrat Developers.
//
// This code is licensed under the GNU Affero General Public License
// as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later... | 14,489 | 4,973 |
void dfs(int node,set<int>s[],vector<int>&visit,string &ans){
visit[node]=1;
for(auto a:s[node]){
if(visit[a]==-1)
dfs(a,s,visit,ans);
}
ans=(char)('a'+node)+ans;
}
string findOrder(string dict[], int N, int K) {
set<int>v[26];
for(... | 864 | 336 |
/**
******************************************************************************
* @file uArmController.cpp
* @author David.Long
* @email xiaokun.long@ufactory.cc
* @date 2016-09-28
* @license GNU
* copyright(c) 2016 UFactory Team. All right reserved
* @modified Samuel Duclos
**********************... | 11,401 | 4,875 |
//
// Created by Erez on 15/05/20.
//
#include "TestCube.h"
#include "../graphics/GLUtils.h"
#include <glm/glm.hpp>
#include <glm/vec3.hpp>
#include <glm/mat4x4.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <android/log.h>
#include <GLES3/gl3.h>
#define LOG_TAG "TesterCubs"
#... | 10,417 | 4,169 |
/*------------------------------------------------------------------------------------------------------------
file Task.cpp
class mtbmpi::Task
brief Class to control a single concurrent task.
details
Tasks are created by the TaskFactory and owns
a work task object as a TaskAdapter.
The work tasks are derived... | 9,551 | 3,401 |
#include "VolumeOptions.hpp"
ntfs::VolOps::VolOps(std::shared_ptr<void> volHandle) : vhandle(volHandle)
{
}
void ntfs::VolOps::setVolHandle(std::shared_ptr<void> vh)
{
if(vhandle)
vhandle.reset();
vhandle = vh;
}
std::shared_ptr<void> ntfs::VolOps::getVolHandle()
{
return vhandle;
}
std::tuple<std::string, s... | 4,158 | 1,690 |
// Copyright 2020 Oleksandr Bacherikov.
//
// Distributed under the Boost Software License, Version 1.0
// (see accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
#pragma once
#include <actl/operation/scalar/scalar_operation.hpp>
namespace ac {
namespace scalar {
struct less_f : s... | 949 | 329 |
/*
* Copyright (c) airfox 2012.
*
* \brief Overload operators
*/
#include "integer.h"
Integer::Integer(int val) : m_val(val)
{
}
const Integer &operator+(const Integer &i)
{
return i;
}
const Integer operator-(const Integer &i)
{
return Integer(-i.m_val);
}
const Integer operator~(const Integer &i)
{
... | 751 | 295 |
/*!
* \author Nicolas Van der Noot
* \file Roll_Shoulder_Art.hh
* \brief Roll_Shoulder_Art class
*/
#ifndef _ROLL_SHOULDER_ART_HH_
#define _ROLL_SHOULDER_ART_HH_
#include "Articulation.hh"
/*! \brief Roll foot articulation
*/
class Roll_Shoulder_Art : public Articulation
{
public:
Roll_Shoulder_Art(CtrlInpu... | 457 | 186 |
/**************************************************************************
* Copyright(c) 2004-2006, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors ... | 4,443 | 1,300 |
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* ***************************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by ... | 7,892 | 2,729 |
//
// Created by james on 01/11/2019.
//
#include "CaesarCipher.hpp"
#include <iostream>
#include <string>
#include <vector>
CaesarCipher::CaesarCipher(const size_t key): key_{key} {}
CaesarCipher::CaesarCipher(const std::string& key): key_{0} {
// check to see whether string can be parsed as a number
... | 2,072 | 581 |
#include "mrvizifymain.h"
#include "ui_mrvizifymain.h"
#include "citk.h"
#include "cvtkwidget.h"
#include "cmrvizthreshold.h"
#include "MrVizifyConfig.h"
//#include "compareimageui.h"
#ifdef USE_CIMGPROC
#include "CImgProcWidget.h"
#endif
#ifdef USE_CIMGCONV
#include "ConverterWidget.h"
#endif
#ifdef... | 5,272 | 2,037 |
/*
* prjsv 2015, 2016
* 2014, 2016
* Marco Antognini
*/
#ifndef INFOSV_JSONSERIALISER_HPP
#define INFOSV_JSONSERIALISER_HPP
#include <JSON/JSON.hpp>
#include <stdexcept>
#include <string>
namespace j
{
class BadPayload : public std::runtime_error
{
public:
BadPayload(std::string const& msg);
};
class NoSu... | 1,065 | 360 |
// Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2018
//
// Bibliotheque Lapin
#include <string.h>
#include "lapin_private.h"
#define PATTERN "%s -> %p"
t_bunny_music *bunny_read_music(t_bunny_configuration *cnf)
{
t_bunny_sound *pc = NULL;
if (bunny_set_sound_attribute(NULL, &pc, &cnf, true) ==... | 1,538 | 663 |
// Fill out your copyright notice in the Description page of Project Settings.
#include "ExplorerMovementComponent.h"
#include "GameFramework/PhysicsVolume.h"
UExplorerMovementComponent::UExplorerMovementComponent(const FObjectInitializer &ObjInitializer)
{
FallingGravityScale = 2.0F;
FallingThreshold = 100.0F;
}
... | 1,500 | 543 |
#include <iostream>
#include <set>
#define lli long long int
using namespace std;
int main()
{
lli n, x;
cin >> n;
set<int, greater<int>> s;
for (lli i = 0; i < n; i++)
{
cin >> x;
s.insert(x);
}
cout << s.size() << "\n";
return 0;
} | 281 | 114 |
#ifndef __STM32L073XX_DMA
#define __STM32L073XX_DMA
#include "common_types.hpp"
namespace DMA {
namespace ADDRESSES {
const inline t_uint32 BASE_ADDRESS = ((t_uint32)0x40020000U);
} // namespace ADDRESSES
namespace TYPEDEFS {
typedef union {
struct __attribute__((packed)) {
__R t_uint32 GIF1 : 0x01U;
... | 4,976 | 2,697 |
#include <geode/value/Compute.h>
#include <geode/python/from_python.h>
#include <geode/python/Ptr.h>
#include <geode/python/Class.h>
#include <geode/utility/format.h>
namespace geode {
#ifdef GEODE_PYTHON
static PyObject* empty_tuple = 0;
namespace {
class CachePython : public Value<Ptr<>>,public Action {
public:
G... | 2,125 | 780 |
#include "Individual.h"
#include "utils.cpp"
Individual::Individual(int t_dimension) {
m_dimension = t_dimension;
m_fitness = -1;
}
Individual::Individual(Individual* other)
{
m_genotype = other->m_genotype;
m_fitness = other->m_fitness;
m_dimension = other->m_dimension;
m_genotype_text = other->m_genotyp... | 10,229 | 4,191 |
#include "msg_sys/msg_feed_id.h"
#include <iostream>
void TryEquals() {
MessageFeedID lhs;
MessageFeedID rhs;
rhs.NewID();
if( lhs == rhs ) {
std::cout << "MessageFeedID TryEquals Bad Test: FAILED!\n";
}
else {
std::cout << "MessageFeedID TryEquals Bad Test: Passed.\n";
}
... | 2,081 | 764 |
#include <rqt_%{Plugin}/rqt_%{Plugin}.h>
#include <pluginlib/class_list_macros.h>
#include <ros/master.h>
namespace rqt_%{Plugin} {
%{CN}::%{CN}() :
rqt_gui_cpp::Plugin()
{
// Constructor is called first before initPlugin function, needless to say.
setObjectName("%{CN}");
}
void rqt_%{Plugin}::%{CN}::i... | 1,092 | 404 |
/**
Copyright 2019 Boris Vinogradov <no111u3@gmail.com>
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 ... | 1,207 | 356 |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<GL/glut.h>
#include <bits/stdc++.h>
#include "GL/freeglut.h"
#define SORT_NO 2 // Number of sorting algorithms
#define MAX 50 // Number of values in the array
#define SPEED 700 // Speed of sorting, must be greater than MAX always
int a[MAX]; // Array
i... | 7,058 | 3,760 |
/*
* Copyright 2022 Sjofn LLC. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | 1,196 | 416 |
#include "vm.hpp"
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <utility>
#include <gsl/gsl_util>
#include "compiler.hpp"
#include "debug.hpp"
using std::chrono::duration_cast;
using std::chrono::seconds;
using std::chrono::system_clock;
using std::cout;
using std::move;
using... | 14,412 | 3,774 |
#pragma once
#include "position.hpp"
#include "state.hpp"
#include "hash_table.hpp"
#include "time.hpp"
constexpr int max_ply = 128;
using PV = sheena::Array<Move, max_ply>;
enum {
RPSDepth = 4 * depth_scale,
};
class KillerMove : public sheena::Array<Move, 2>{
public:
void update(Move m){
if((*this)[0] != m){... | 2,147 | 851 |
#ifndef EXAMPLES_EXAMPLE_UTILS_HPP
#define EXAMPLES_EXAMPLE_UTILS_HPP
#include "mersenne.h"
#include <vector>
#include <sstream>
#include <iostream>
#include <hipcub/util_type.hpp>
#include <hipcub/util_allocator.hpp>
#include <hipcub/iterator/discard_output_iterator.hpp>
#define AssertEquals(a, b) if ((a) != (b)) { ... | 15,964 | 5,001 |
// WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.4
#include "pybase.h"
#include "py.Windows.Networking.Proximity.h"
PyTypeObject* py::winrt_type<winrt::Windows::Networking::Proximity::ConnectionRequestedEventArgs>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Networki... | 56,875 | 17,567 |