text string | size int64 | token_count int64 |
|---|---|---|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/public/browser/service_worker_context.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "base/message_loop/... | 9,375 | 2,933 |
#include "DeadRecMonteCarlo.h"
#include <iostream>
#include <limits.h>
#include <cmath>
using namespace std;
DeadRecMonteCarlo::DeadRecMonteCarlo(int num, ifstream *ifs)
{
Pose p{0.0,0.0,0.0};
m_poses.insert(m_poses.begin(),num,p);
m_rand_ifs = ifs;
m_step = 0;
m_distance_max_noise_ratio = 0.05; // 5% noise
m_... | 2,135 | 1,050 |
#ifndef LINKEDLIST_HPP
#define LINKEDLIST_HPP
#include <iostream>
#include <iomanip>
template <class T>
class LinkedList
{
public:
LinkedList() { head_ = 0; }
~LinkedList() { destroy_(head_); }
void Add(const T& k) { head_ = add_(k); }
void Reverse() { head_ = reverse_(head_, 0); }
in... | 2,098 | 750 |
// Copyright Daniel Orchard 2020
#include "SLoaderWindow.h"
#include "Vault.h"
#include "VaultSettings.h"
#include "MetadataOps.h"
#include "SAssetPackTile.h"
#include "VaultStyle.h"
#include "AssetPublisher.h"
#include "VaultTypes.h"
#include "ImageUtils.h"
#include "EditorStyleSet.h"
#include "PakFileUtilities.h"
... | 26,301 | 10,611 |
/*
* Time.hpp
*
* Created on: Nov 20, 2014
* Author: matheus
*/
#ifndef TIME_HPP_
#define TIME_HPP_
#include <sys/time.h>
class Stopwatch {
private:
timeval i;
public:
Stopwatch();
void start();
float time() const;
};
#endif /* TIME_HPP_ */
| 276 | 120 |
using namespace std;
#include<stdio.h>
#include<iostream>
int main()
{
int num_lines;
int count[50];
char text[50][100];
std::cout<<"This is the program to count number of holes in text";
std::cout<<endl<<"Please enter the number of lines follwed by each of the lines: ";
cin>>num_lines;
for(int i = 0;i<num_lines;i... | 681 | 323 |
#include <boost/metaparse/limit_sequence_size.hpp>
| 51 | 19 |
/* Generated by Edge Impulse
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute,... | 18,212 | 9,647 |
/*
* Copyright 2019 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | 2,210 | 735 |
/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* OpenAPI spec version: 1.1.1
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#i... | 2,458 | 839 |
#include <iostream>
using namespace std;
int main() {
int a[3], i, j, t;
for (i = 0; i < 3; i++) {
cin >> a[i];
}
for (i = 0; i < 3; i++) {
for (j = i + 1; j < 3; j++) {
if (a[i] > a[j]) {
t = a[i];
a[i] = a[j];
a[j] = t;
... | 412 | 181 |
#include "chrono.h"
using namespace std::chrono;
Chrono::Chrono()
: _paused(false)
{
}
Chrono::~Chrono()
{
}
void Chrono::start()
{
// reset chrono if already running
_startTime = ClockT::now();
_current_duration = DurationT::zero();
}
void Chrono::pause()
{
if(!_paused)
{
_current_duration = ClockT::now... | 1,044 | 445 |
#include <ros/ros.h>
#include <tf2/LinearMath/Vector3.h>
#include <tf2/LinearMath/Quaternion.h>
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2_ros/transform_listener.h>
#include <geometry_msgs/TransformStamped.h>
#include <tf2_ros/transform_broadcaster.h>
int main(int argc, char** argv)
{
ros::init(argc, argv, ... | 1,372 | 547 |
#include "QMaterial.h"
#include <qgl.h>
#include <cmath>
namespace GCL
{
QMaterial::QMaterial(QObject *parent) : QOpenGLShaderProgram(parent)
{
this->initializeOpenGLFunctions();
}
QMaterial::~QMaterial()
{
this->clearTextures();
}
void QMaterial::clearTextures()
{
foreach (auto texture, local_textures_)... | 5,355 | 2,158 |
/*
PROG: COW
LANG: C++
ID: nibnalin
*/
//USACO February Contest
#include <fstream>
#include <vector>
#include <climits>
using namespace std;
vector<vector<int> > grid;
vector< vector<long> > memtable;
int ans(long x, long y) {
if(memtable[x][y] == INT_MIN)
{
long paths = 0;
for(long i = (x-1);i >= 0;i--)
{... | 981 | 517 |
/* generator.cpp - generates a list of random numbers
* Julian Heisz
* Algorithms and Data Structures Final Project
* Winter 2015
*/
#pragma comment(lib, "advapi32.lib")
#include <iostream>
#include <windows.h>
#include <Wincrypt.h>
using namespace std;
int main(int argc, char** argv)
{
if(argc != 4)
{
... | 1,570 | 580 |
// ------------------------------------------------------------
// 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... | 21,980 | 5,828 |
#ifndef AMC_READSKELETON_HPP
#define AMC_READSKELETON_HPP
#include <string>
#include <vector>
#include "Skeleton.hpp"
using std::string;
using std::vector;
bool ReadSkeleton(string filename, Library::Skeleton& into);
bool ReadSkeletonV(string filename, Library::Skeleton& into);
// read 'amc' file format (automati... | 1,045 | 340 |
/* Copyright (c) 2019 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "storage/http/StorageHttpDownloadHandler.h"
#include "webservice/Common.h"
#include "process/ProcessUtils.h"
#i... | 9,193 | 2,665 |
#pragma once
# include <git2.h>
# include "../mimosa/mimosa/non-copyable.hh"
namespace mimosa
{
namespace git
{
class Commit : public NonCopyable
{
public:
inline Commit() : commit_(nullptr) {}
inline Commit(git_repository *repo, const git_oid *id) {
git_commit_lookup(&commit_, re... | 562 | 189 |
// Copyright (c) 2016 Adrien Guinet <adrien@guinet.me>
// 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,... | 5,069 | 2,064 |
// http://algospot.com/judge/problem/read/STARFORCE
#include <cstdio>
#include <iostream>
using namespace std;
int n, m, s, best;
int in[200];
int pre[200][200]; // pre processed : or
void input() {
scanf("%d %d", &n, &m);
int i, j;
for (i = 0; i < n; i++) {
scanf("%d", &in[i]);
}
for (i... | 1,152 | 494 |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
using namespace std;
//const double eps=1e-8;
//struct P
//{
// double x,y;
// void in(){scanf("%lf%lf",&x,&y);}
//};
//double dis(P a,P b)
//{
// return sqrt((a.x-b.x)*(a.x-b.x)+(a.... | 2,241 | 1,055 |
/*
erase && remove
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int args, char **argv)
{
vector<int> v;
for (size_t i = 0; i < 10; i++)
{
v.push_back(i);
if (i == 5 || i == 8)
v.push_back(i);
}
for (auto &&i : v)
... | 1,105 | 470 |
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2011-2012 Heiko Strathmann
* Copyright (C) 201... | 2,453 | 966 |
#include <cstdio>
#include "NetSock.h"
void usage() {
printf("usage: xoxoxo <host> <port>\n");
}
int main(int argc, char **argv) {
if (argc != 3) {
usage();
return 1;
}
unsigned short port;
if (sscanf(argv[2], "%hu", &port) != 1) {
usage();
return 2;
}
const char *ho... | 532 | 227 |
/*
libvitaboy - Open source OpenGL TSO character animation library
vbparse.cpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
Author(s): Fatbag <X-Fi6@phppoll.org>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provi... | 4,930 | 1,786 |
#include "body.h"
#include <algorithm>
namespace apollonia {
using std::abs;
void Body::set_mass(Float mass) {
mass_ = mass;
inv_mass_ = 1 / mass;
}
void Body::set_inertia(Float inertia) {
inertia_ = inertia;
inv_inertia_ = 1 / inertia;
}
bool Body::ShouldCollide(const Body& other) const {
return !(mass_... | 2,453 | 953 |
#include "pch.h"
#include "Rendering/Text/Internal/Font.h"
#include "Core/Application.h"
#include "Rendering/ShaderManager.h"
#include "Rendering/Shader.h"
#include "Rendering/Window.h"
#include <glm/gtc/type_ptr.hpp>
using namespace TE;
#ifdef TRICKSTER_OPENGL
void Font::Initialize()
{
// configure VAO/VBO ... | 6,100 | 2,422 |
#ifdef USE_GPU
#include "DeslantImgGPU.hpp"
#else
#include "DeslantImgCPU.hpp"
#endif
#include <opencv2/imgcodecs.hpp>
#include <iostream>
int main(int argc, const char *argv[])
{
const cv::String opts =
"{help h usage ? | | print this message }"
"{@imagein |- | path name to read the input image... | 2,105 | 840 |
#include "statement.hpp"
#include <sstream>
#include <stack>
#include <memory>
#include <utility>
#include <typeinfo>
namespace statement
{
std::ostream &operator<< (std::ostream &os, const statement &x)
{
x.print(os);
return os;
}
std::ostream &operator<< (std::ostream &os, const assignment &x)
{
x.print(os);
retu... | 3,348 | 1,383 |
/*
* aggcountervector.{cc,hh} -- count packets/bytes with given aggregate
*
* 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, subject to the conditions
* listed in th... | 5,715 | 2,099 |
// C:\diabpsx\SOURCE\INV.CPP
#include "types.h"
// address: 0x801558DC
// line start: 434
// line end: 435
void FreeInvGFX__Fv() {
}
// address: 0x801558E4
// line start: 440
// line end: 447
void InvDrawSlot__Fiii(int X, int Y, int Frame) {
// register: 2
// size: 0x28
register struct POLY_FT4 *Ft4;
}
// ... | 12,043 | 5,892 |
//
// Worker.cc
//
// Copyright (c) 2017 Couchbase, Inc All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless ... | 7,859 | 2,373 |
#include "../precompiled/stdafx.h"
#include "../engine/base.h"
#include "../../common/utility/ext_xml.h"
#include "../../common/utility/ext_util.h"
//////////////////////////////////////////////////////////////////////////
// CMap default constructor & destructor
////////////////////////////////////////////////... | 9,610 | 3,902 |
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <gflags/gflags.h>
#include "../Header/parse.hpp"
#include "../Header/coloring_algorithm.hpp"
#include "../Header/dsatur.hpp"
#include "../Header/mcs.hpp"
#include "../Header/lmxrlf.hpp"
#include "../Header/hybrid_dsatur.hpp"
#include ... | 2,690 | 934 |
/* Copyright 2020 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... | 9,750 | 2,907 |
/*=========================================================================
*
* Copyright David Doria 2011 daviddoria@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
*
*... | 1,844 | 553 |
#pragma once
#include "engine/surface.hpp"
namespace devilution {
void InitSpellBook();
void FreeSpellBook();
void CheckSBook();
void DrawSpellBook(const Surface &out);
} // namespace devilution
| 211 | 70 |
#include "jnc.h"
/* GetStringChars is not guaranteed to be null terminated */
#define DO_WITH_STRING_16(env, jstring, name, length, stat, ret) \
do { \
jsize length = CALLJNI(env, GetStringLength, jstring); \
if (unlikely(CALLJNI(... | 7,189 | 2,496 |
class Solution {
public:
void XXX(vector<vector<int>>& matrix) {
int m=matrix.size(),n=matrix[0].size();
for(int i=0;i<m/2;++i)
for(int j=0;j<n;++j)
{
swap(matrix[i][j],matrix[m-i-1][j]);
}
for(int i=0;i<m;++i)
for(int j=i+1;j<n... | 413 | 162 |
#include <gtest/gtest.h>
#include <compact_time/compact_time.h>
// #define KSLog_LocalMinLevel KSLOG_LEVEL_TRACE
#include <kslog/kslog.h>
TEST(Library, version)
{
const char* expected = "1.0.0";
const char* actual = ct_version();
ASSERT_STREQ(expected, actual);
}
static void fill_date(ct_date* date, int ... | 10,703 | 5,582 |
/* dtkWidgetsTagCloudView.cpp ---
*
* Author: Julien Wintz
* Created: Mon Apr 15 14:39:34 2013 (+0200)
* Version:
* Last-Updated: Mon Apr 15 14:44:56 2013 (+0200)
* By: Julien Wintz
* Update #: 7
*/
/* Change Log:
*
*/
#include "dtkWidgetsTagCloudDesc.h"
#include "dtkWidgetsTagCloudList.h"
... | 5,215 | 1,900 |
// Copyright (c) 2019-2020 Xenios SEZC
// https://www.veriblock.org
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef ALT_INTEGRATION_INCLUDE_VERIBLOCK_ENTITIES_ALT_POP_TRANSACTION_HPP_
#define ALT_INTEGRATION_INCLUDE_VERI... | 1,777 | 634 |
/*
g++ --std=c++20 -pthread -o ../_build/cpp/utility_declval.exe ./cpp/utility_declval.cpp && (cd ../_build/cpp/;./utility_declval.exe)
https://en.cppreference.com/w/cpp/utility/declval
*/
#include <utility>
#include <iostream>
struct Default { int foo() const { return 1; } };
struct NonDefault
{
NonDefault() = del... | 700 | 256 |
#include <Instance.hpp>
#include <PhysicalDevice.hpp>
#include <Device.hpp>
#include <Queue/Queue.hpp>
#include <Queue/Fence.hpp>
#include <Queue/Semaphore.hpp>
#include <Command/Pool.hpp>
#include <Command/Buffer.hpp>
#include <Memory.hpp>
#include <Buffer.hpp>
#include <Common.hpp>
#include <future>
#include <iostr... | 7,631 | 2,417 |
/*
The MIT License (MIT)
Copyright (c) 2019 Cdec
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,... | 2,813 | 979 |
#include"cfiddle.hpp"
#include<sstream>
#include<string>
#include<fstream>
#include"DataSet.hpp"
#include"PerfCounter.hpp"
#include"walltime.h"
double start_time = 0.0;
DataSet * get_dataset();
extern "C"
void write_stats(char * filename) {
//std::cerr << "Writing to " << filename << "\n";
std::ofstream out(filen... | 1,559 | 612 |
/**********************************************************************
* CC0 License
**********************************************************************
* MergeBathy - Tool to combine one or more bathymetric data files onto a single input grid.
* Written in 2015 by Samantha J.Zambo(samantha.zambo@gmail.com) while e... | 15,716 | 6,798 |
#include "ck/core/customstream.h"
namespace Cki
{
CustomStream::CustomStream(CkCustomFile* file) :
m_file(file)
{}
CustomStream::~CustomStream()
{
delete m_file;
}
bool CustomStream::isValid() const
{
return m_file->isValid();
}
int CustomStream::read(void* buf, int bytes)
{
return m_file->read(buf... | 713 | 268 |
// Copyright 2020, Intel Corporation
#include "pmlc/dialect/pxa/analysis/strides.h"
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/Support/DebugStringHelper... | 23,760 | 7,905 |
#include <dll_main.h>
#include <Il2CppModLoader/il2cpp_helpers.h>
#include <Il2CppModLoader/interception_macros.h>
using namespace modloader;
INJECT_C_DLLEXPORT bool in_menu();
namespace
{
constexpr float NO_AIR_DECELERATION_DURATION = 0.2f;
constexpr float NO_AIR_DECELERATION_RESET_DURATION = 0.2f;
flo... | 3,055 | 1,075 |
#pragma once
#include "controller.hpp"
#include "settings.hpp"
namespace msrv {
class Router;
class ContentTypeMap;
class WorkQueue;
class StaticController : public ControllerBase
{
public:
StaticController(
Request* request,
const Path& targetDir,
const ContentTypeMap& contentTypes);
... | 903 | 245 |
#include <iostream>
using namespace std;
int main()
{
int a = 3;
if (int b = 2; a > b) // javlja warning - init-statement in selection statements only available with -std=c++1z or -std=gnu++1z
{
cout << a << endl;
cout << b << endl;
}
cout << a << endl;
} | 291 | 101 |
#include "Matrix.hpp"
Matrix Matrix::operator+ () const {
return *this;
}
Matrix Matrix::operator- () const {
return operator*(-1.);
}
Matrix Matrix::operator+ (const real_t &scalar) const {
Matrix A = *this;
for(size_t y = 0; y < A.Height(); ++y)
A[y] = A[y] + scalar;
return A;
}
Matrix Matrix::operator- ... | 948 | 382 |
#pragma once
#include <crab/support/debug.hpp>
#include <crab/support/os.hpp>
namespace crab {
namespace cfg {
// To group together statements over integers or real
typedef enum {
BINOP_ADD,
BINOP_SUB,
BINOP_MUL,
BINOP_SDIV,
BINOP_UDIV,
BINOP_SREM,
BINOP_UREM,
BINOP_AND,
BINOP_OR,
BINOP_XOR,
BI... | 1,949 | 873 |
/// \copyright The Unlicense
#include "stdafx.h"
#include "PropertyPage1.h"
#include "PropertySheet.rc.h"
#include "rrwindows/rrwindows.h"
namespace rrMFC {
namespace Test {
const UINT PropertyPage1::IDD {IDD_PROPERTY_PAGE_1};
#// Constructors
PropertyPage1::
PropertyPage1()
: CPropertyPage(IDD)
{
DcMeth(... | 1,735 | 706 |
#ifndef GEOMETRY_MESHBUILDERBASE_HPP
#define GEOMETRY_MESHBUILDERBASE_HPP
#include <Core/Types/TVector.hpp>
#include <Geometry/HalfedgeMesh/HalfedgeMesh.hpp>
#include <Geometry/HalfedgeMeshBuilder/MeshTriangleAdder.hpp>
#include <LinAl/LinearAlgebra.hpp>
namespace Geometry
{
template <typename T, typename Derived>
c... | 1,825 | 638 |
#include <iostream>
#include "phaser.h"
#include "results.h"
#include "type.h"
bool HYBRID = false;
bool NEW_FORMAT = false;
bool KEEP_PS = false;
int WINDOW_SIZE = 200;
int WINDOW_OVERLAP = 60;
int BASE_OFFSET = 33;
int MAX_BARCODE_SPANNING = 60000;
int MAX_HIC_INSERTION= 40000000;
int RECURSIVE_LIMIT = 15;
int OPE... | 6,856 | 2,436 |
//
// Student name: Xinyi Zou
// Student number: 20765197
//
// SYDE 121 Lab: Lab Assignment #1 Exercise #3
// Filename: lab02_03c
//
// I hereby declare that this code, submitted for credit for the course
// SYDE121, is a product of my own efforts. This coded solution has
// not been plagiarized from other so... | 6,326 | 2,300 |
#include "herramientas.h"
#include "ui_herramientas.h"
herramientas::herramientas(QWidget *parent) :
QWidget(parent),
ui(new Ui::herramientas)
{
const int max=450;
ui->setupUi(this);
ui->txt_centrox->setValidator( new QIntValidator(0, max, this) );
ui->txt_centroy->setValidator( new QIntValid... | 2,997 | 1,199 |
#ifndef BIT_OPERATION_HEADER_HPP
#define BIT_OPERATION_HEADER_HPP
/**
* @brief bit operations
*
*/
#include <cassert>
#include <cstdint>
#include "deBruijn_sequence.hpp"
namespace lib {
/**
* @brief 在二进制最高的 1 后面填充满 1
* @param x
* @return std::uint32_t
*/
std::uint32_t fill_one_after_msb(... | 1,802 | 974 |
#include "Sphere.h"
#include "math.h"
#include <map>
#include <array>
struct Triangle
{
unsigned int vertex[3];
};
using TriangleList = std::vector<Triangle>;
using VertexList = std::vector<glm::vec3>;
using NormalList = std::vector<glm::vec3>;
#define Index unsigned int
namespace icosahedron
{
co... | 2,845 | 1,302 |
/*This file is part of the FEBio Studio source code and is licensed under the MIT license
listed below.
See Copyright-FEBio-Studio.txt for details.
Copyright (c) 2020 University of Utah, The Trustees of Columbia University in
the City of New York, and others.
Permission is hereby granted, free of charge, to any per... | 5,691 | 2,743 |
// PUBG FULL SDK - Generated By Respecter (5.3.4.11 [06/03/2019]) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "PUBG_SoundOptionWidget_parameters.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Functions
//------------------------------------------... | 4,219 | 1,321 |
/******************************************************************
* muensterTPCsim
*
* Simulations of the Muenster TPC
*
* @author Lutz Althüser
* @date 2015-04-14
*
* @update 2015-11-02 - added comments
*
* @comment
******************************************************************/
#ifndef __muenster... | 808 | 291 |
/***********************************************************************************************************************
* Copyright (c) Hands Free Team. All rights reserved.
* Contact: QQ Exchange Group -- 521037187
*
* LICENSING TERMS:
* The Hands Free is licensed generally under a permissive 3-clause BSD licen... | 5,403 | 2,275 |
#include "../../include/core/CConfigFileEngineCoreBuilder.h"
#include "../../include/core/IFileSystem.h"
#include "../../include/platform/CConfigFileReader.h"
#include <memory>
#include <thread>
#include <functional>
namespace TDEngine2
{
CConfigFileEngineCoreBuilder::CConfigFileEngineCoreBuilder() :
CBaseEngineCo... | 2,977 | 981 |
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10010;
int n, P, Pi;
vector<int> E[MAXN];
bool vis[MAXN];
void dfs(int u, int p){
if(vis[u]) return;
vis[u] = true;
if(p > P){
P = p;
Pi = u;
}
for(int i = 0; i < E[u].size(); i++){
dfs(E[u][i], p + 1);
}
}
int main(){
ios_base::sync_with_... | 710 | 406 |
#pragma once
#include <algorithm>
#include <cassert>
#include <set>
#include <vector>
#include "simple_graph/graph.hpp"
namespace simple_graph {
template<typename W>
bool check_distance(const W &d, const W &w)
{
return !((d > 0) && (w > 0) && (std::numeric_limits<W>::max() - d < w));
}
template<bool Dir, typena... | 3,521 | 1,229 |
/* Copyright 2020 The TensorFlow Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, s... | 5,338 | 1,735 |
#include <shg/gsgts.h>
#include <shg/mzt.h>
#include <shg/utils.h>
#include "testing.h"
namespace SHG::Testing {
BOOST_AUTO_TEST_SUITE(gsgts_test)
BOOST_AUTO_TEST_CASE(basic_test) {
const std::vector<double> result1{
-0.1853455, -0.1532896, -0.1108232, -0.2036469, -0.1754326,
-0.1098344, -0.... | 4,200 | 2,948 |
#include <string>
#include "gact.h"
inline int64_t max(int64_t a, int64_t b) {
return a > b ? a : b;
}
inline void setDefaultParams(AlignTask *task) {
task->params["TILE_SIZE"] = 128;
task->params["OVERLAP_SIZE"] = 32;
}
AlignTileRet alignTile(std::string ref, std::string qry, bool first, int maxTBLen) ... | 3,925 | 1,523 |
/*
* GeometryTest.cpp
*
* Created on: Mar 19, 2020
* Author: jelavice
*/
#include <gtest/gtest.h>
// Math
#include <cmath>
#include "test_helpers.hpp"
#include "pure_pursuit_core/math.hpp"
namespace ppt = pure_pursuit_test;
namespace pp = pure_pursuit;
using SolutionCase = pp::Intersection::SolutionCase;
... | 9,465 | 3,690 |
// Distributed under the BSD 2-Clause License - Copyright 2012-2021 Robin Degen
#include <aeon/web/http/url_encoding.h>
#include <aeon/web/http/validators.h>
#include <gtest/gtest.h>
#include <random>
using namespace aeon;
TEST(test_url_encoding, encode_regular_string)
{
const std::u8string test_str = u8"ThisIsA... | 1,712 | 634 |
#pragma once
namespace DoremiEngine
{
namespace AI
{
/**
TODOKO docs
*/
class MapGrid;
class AStarSubModule
{
public:
virtual void GetPath(int p_startPos, const MapGrid& p_map) = 0;
virtual MapGrid* BuildMapGrid() = 0;
};
... | 326 | 100 |
#include "imgui.h"
#include "IconsFontAwesome5.h"
void SetStyle()
{
ImGuiStyle& st = ImGui::GetStyle();
st.FrameBorderSize = 1.0f;
st.FramePadding = ImVec2(4.0f, 2.0f);
st.ItemSpacing = ImVec2(8.0f, 2.0f);
st.WindowBorderSize = 1.0f;
st.TabBorderSize = 1.0f;
st.WindowRounding = 1.0f;
st... | 5,515 | 3,041 |
#include <iostream>
#include <vector>
#include "dragon/algos/subset-xor-maximization.hpp"
int main() {
std::vector<int> v{48, 32, 31};
std::cout<<dragon::maximum_subset_xor_value(v)<<"\n";
std::cout<<dragon::maximum_subset_xor_value(v.begin(), v.end())<<"\n";
}
| 269 | 118 |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,r,sum=0,temp;
cout<<"Enter a three digit positive integer: ";
cin>>n;
temp=n;
while(n>0)
{
r=n%10;
sum=sum+(r*r*r);
n=n/10;
}
if(temp==sum)
... | 465 | 178 |
#include "qstd.h"
QTextStream qstd::cin(stdin,QIODevice::ReadOnly);
QTextStream qstd::cout(stdout,QIODevice::WriteOnly);
QTextStream qstd::cerr(stderr, QIODevice::WriteOnly);
| 176 | 68 |
#include "./curl.h"
void NodeCurl::Init(Handle<Object> target) {
target->Set(String::NewSymbol("request"),
FunctionTemplate::New(request)->GetFunction());
target->Set(String::NewSymbol("get"),
FunctionTemplate::New(get)->GetFunction());
}
// curl.request (options);
Handle<Value> NodeCurl::request(const Ar... | 1,070 | 365 |
#include <thread>
#include <functional>
#include <stdio.h>
#include <memory>
#include "asyncclient.h"
#include "asyncserver.h"
int main(int argc, char** argv)
{
asyncclient async1;
asyncclient async2;
asyncclient async3;
asyncserver server;
std::thread t1(std::bind(&asyncclient::start, &async1));... | 604 | 236 |
#include "../catch.h"
#include "../mylist.h"
#include "solution.h"
TEST_CASE("Delete Node In a Linked List", "deleteNodeInALinkedList") {
Solution sln;
const int len = 4;
int nums[len] = {1,2,3,4};
ListNode* root = createList(nums, len);
ListNode* p = root->next->next;
sln.deleteNode(p);
C... | 442 | 180 |
#include <iostream>
using namespace std;
class Solution {
public:
int dfs(TreeNode *node) {
if (node == NULL)
return 0;
return max(dfs(node->left, dep+1), dfs(node->right, dep+1))+1;
}
bool isBalanced(TreeNode *root) {
if (root == NULL)
return true;
if... | 499 | 163 |
#include "circle_mask_tests.h"
#include "../../main/collisions/circle_mask.h"
#include "../../main/utils/point.h"
#include "../tests_setup.h"
int static creation_test();
int static center_test();
int static interior_test();
int static border_test();
int static exterior_test();
void circle_mask_tests() {
begin_test... | 2,237 | 885 |
#pragma once
#include "Common/Defines.h"
#include "Common/RandomAccessFile.h"
class BufferData
{
public:
BufferData()
: m_iBufferSize(-1)
, m_pBuffer(nullptr)
{ }
BufferData(size_t iBufferSize)
{
setSize(iBufferSize);
}
void operator=(BufferData& pBufferData)
{
cleanup();
setSize(pBuffer... | 1,179 | 563 |
//---------------------------------------------------------------------------
// HEADER FILES:
//---------------------------------------------------------------------------
#include "UnitTest.h"
#include "MathEngine.h"
#define eq Util::isEqual
#define MATH_TOLERANCE 0.0001f
//----------------------------------------... | 7,069 | 4,485 |
#include <eros/DataLogger/DataLoggerProcess.h>
using namespace eros;
using namespace eros_nodes;
DataLoggerProcess::DataLoggerProcess()
: log_directory(""),
log_directory_available(false),
logfile_duration(-1.0),
logging_enabled(false),
snapshot_mode(true) {
}
DataLoggerProcess::~DataLogger... | 1,170 | 350 |
#include "compression/confluo_encoder.h"
namespace confluo {
namespace compression {
unique_byte_array confluo_encoder::encode(void *ptr, size_t size, uint8_t encoding) {
switch (encoding) {
case encoding_type::D_UNENCODED: {
return unique_byte_array(reinterpret_cast<uint8_t *>(ptr), size, no_op_delete);
... | 841 | 317 |
inline void hk_VecFPU::fpu_add_multiple_row(hk_real *target_adress,hk_real *source_adress,hk_real factor,int size,hk_bool adress_aligned) {
if(adress_aligned==HK_FALSE) {
//we have to calculate the block size and shift adresses to lower aligned adresses
long result_adress = long(source_adress) & hk_VecFPU_ME... | 19,721 | 9,291 |
/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
this file is part of rcssserver3D
Fri May 9 2003
Copyright (C) 2002,2003 Koblenz University
Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
$Id$
This program is free software; you can redistribute it and/or modify
it und... | 4,793 | 1,485 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public... | 2,838 | 936 |
#include "mainwindow.h"
#include "qstd.h"
using namespace qstd;
#include <QApplication>
#include "evolutionnary_process.h"
int main(int argc, char *argv[])
{
Evolutionnary_process evo;
evo.init();
cout<<evo.toString()<<endl;
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec(... | 325 | 123 |
#include "vehicle.hpp"
#include "controller.hpp"
int main(int argc, char *argv[]) {
// Create vehicle object
Vehicle vehicle;
vehicle.SetVelocity(20);
vehicle.SetAcceleration(30);
std::cout << "### Vehicle Object ###" << std::endl;
std::cout << "velocity:" << vehicle.GetVelocity() << std::endl... | 616 | 214 |
#include <App.h>
#include <Defines.Public.h>
#include <GameOptions.h>
#include <Ini.h>
#include "PGUI.Core.h"
#include "PGUI.Screen.h"
PGUI::Screen::Screen( PGUI::Core* gui, uint width /* = 0 */, uint height /* = 0 */, int left /* = 0 */, int top /* = 0 */ ) : PGUI::Element( gui, width, height, left, top ),
// public... | 2,898 | 1,023 |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#define MAXN 105
using namespace std;
int t, n, ans, lo, hi, maxim, how;
int w[MAXN];
int main( ) {
scanf( "%d", &t );
for ( int T = 0; T < t; ++T ) {
scanf( "%d", &n );
for ( int i = 1; i <= n; ++i ) {
scanf( "%d", &w[i] )... | 668 | 382 |
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <tack@gecode.org>
*
* Copyright:
* Guido Tack, 2006
*
* Last modified:
* $Date$ by $Author$
* $Revision$
*
* This file is part of Gecode, the generic constraint
* development environment:
... | 9,745 | 2,833 |
//
// Created by caedus on 30.01.2021.
//
#pragma once
#include "Modules/Module.hpp"
#include "Runtime/Interface/IEvaluatorFactory.hpp"
#include "Modules/Interface/IModuleBuilder.hpp"
#include <algorithm>
namespace nastya::modules {
template<typename EvaluatorFactory, typename... OtherFactories>
class ModuleBuilde... | 2,316 | 710 |
/*
Copyright (C) 2016 Thomas Hauth. All Rights Reserved.
* Written by Thomas Hauth (Thomas.Hauth@web.de)
This file is part of Kung Foo Barracuda.
Kung Foo Barracuda 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... | 2,150 | 744 |
#include "standard.h"
#include "directx.h"
#include "global.h"
#include "hwrender.h"
#include "output.h"
#include <main.h>
#include <game/inventry.h>
#include <3dsystem/hwinsert.h>
#define HealthBarX 8
#define HealthBarY 6
#define HealthBarW 100
#define AirBarX (game_setup.dump_width-110)
#define AirBarY 6
#define A... | 5,810 | 2,970 |