text string | size int64 | token_count int64 |
|---|---|---|
#include "App.h"
#include "IAppConfiguration.h"
#include "ConfigurationFile.h"
#include "SingleRunHandler.h"
#include "TextGui.h"
#include <cassert>
#include <variant>
namespace balcony_watering_system {
namespace app {
using ::balcony_watering_system::configuration::IAppConfiguration;
using ::balcony_watering_syst... | 2,000 | 624 |
/**
* Copyright Leonardo Banderali 2017 - 2017.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef PUT_HPP
#define PUT_HPP
#include "format.hpp"
#include "put_utils.hpp"
#include ... | 1,710 | 588 |
#ifndef GEAROENIX_RENDER_ENGINE_CONFIGURATION_HPP
#define GEAROENIX_RENDER_ENGINE_CONFIGURATION_HPP
#include "../../core/gx-cr-build-configuration.hpp"
#include "../../core/gx-cr-static.hpp"
#include "../../math/gx-math-numeric.hpp"
#include "../../system/gx-sys-log.hpp"
#include <cstdint>
namespace gearoenix::render:... | 2,143 | 876 |
#include "types.h"
namespace {
/* Compile time test to verify that integers are at least 32-bits wide. */
using namespace gb;
constexpr uint BitCount() {
auto i{static_cast<uint>(-1)};
uint count{0};
while (i != 0) {
i >>= 1;
++count;
}
return count;
}
static_assert(BitCount() >... | 360 | 133 |
// Copyright (c) 2020 Graphcore Ltd. All rights reserved.
#ifndef _ConvolutionInternal_hpp_
#define _ConvolutionInternal_hpp_
#include "CanonicalConvParams.hpp"
#include "ConvOptions.hpp"
#include "ConvPlan.hpp"
#include <poplin/Convolution.hpp>
namespace poplin {
struct ConvProgramTree;
struct ConvIndices {
unsi... | 5,172 | 1,380 |
#include "SymbolTable.h"
using namespace std;
void SymbolTable::addFixedEntry(const string &symbol, int16_t address)
{
m_map.insert(make_pair(symbol, address));
}
int16_t SymbolTable::addVariableEntry(const std::string &symbol)
{
m_map.insert(make_pair(symbol, m_nextVariable));
return m_nextVariable++;
}
bool Sy... | 568 | 207 |
//
// Created by selya on 01.09.2019.
//
#ifndef SANDWICH_V8B_CLASS_HPP
#define SANDWICH_V8B_CLASS_HPP
#include <v8bind/type_info.hpp>
#include <v8.h>
#include <unordered_map>
#include <type_traits>
#include <memory>
#include <vector>
#include <cstddef>
#include <tuple>
#define V8B_IMPL inline
namespace v8b {
cl... | 7,484 | 2,454 |
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
int app_main();
#ifdef __cplusplus
}
#endif | 97 | 43 |
/****************************************************************************
** Meta object code from reading C++ file 'QGeoMapReplyQGC.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.3)
**
** WARNING! All changes made in this file will be lost!
*****************************************************... | 7,204 | 2,978 |
#include "precheader.h"
#include "Camera.h"
#include "events/Input.h"
#include "events/MouseEvents.h"
#include "events/WindowEvents.h"
namespace vengine
{
Camera::Camera(const float fov, const float near_z, const float far_z) :
m_fov(fov), m_near_z(near_z), m_far_z(far_z)
{
m_view = glm::lookAt(m_eye, m_target,... | 2,938 | 1,309 |
// Copyright (c) 2015 fjz13. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
#include "MedusaCorePreCompiled.h"
#include "SirenCustomClass.h"
#include "Core/Log/Log.h"
#include "Core/Siren/Schema/SirenTextParser.h"
#include "Core/Siren/Schema/... | 9,406 | 3,861 |
/**
*
* ▄▄▄▄▀ ▄ █ █▀▄▀█ ▄█▄ █ █▄▄▄▄ ▄ ,ae,
* ▀▀▀ █ █ █ █ █ █ █▀ ▀▄ █ █ ▄▀ ▀▄ █ ,88888e
* █ ██▀▀█ █ ▄ █ █ ▀ █ █▀▀▌ █ ▀ ,a888b.9888888i
* █ █ █ █ █ █▄ ▄▀ ███▄ █ █ ▄ █ 888888888888888
* ▀ █ █ ▀███▀ ▀ █ █ ▀▄ 888... | 5,353 | 2,064 |
/*
Copyright (c) 2007 Cyrus Daboo. 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
... | 10,215 | 3,922 |
#pragma once
#include <glad/glad.h>
#include <glfw/glfw3.h> | 59 | 29 |
/*==========================================================================
* Copyright (c) 2004 University of Massachusetts. All Rights Reserved.
*
* Use of the Lemur Toolkit for Language Modeling and Information Retrieval
* is subject to the terms of the software license set forth in the LICENSE
* file include... | 10,836 | 3,164 |
#include "calotypes/CameraCalibration.h"
#include "calotypes/KernelDensityEstimation.hpp"
#include "calotypes/ImportanceResampling.hpp"
#include <opencv2/calib3d.hpp>
#include <Eigen/Dense>
namespace calotypes
{
bool CompareDataName( const CameraTrainingData& a, const CameraTrainingData& b )
{
if( a.name.size() == ... | 9,731 | 3,741 |
//
// Created by 25granty on 10/14/19.
//
#include "mason/al/al_buffer.h"
#include "stb/stb_vorbis.c" // Has to be included in the c++ source file or else we die from linker errors.
namespace mason::al {
// TODO: Add proper error checking here (Hopefully I'll get unlazy later)
al_buffer::al_buffer(const std... | 1,390 | 472 |
#pragma once
#include <iostream>
#include <type_traits>
namespace abc
{
template <typename T, typename TTag, int64_t DefaultValue>
class tagged_type
{
static_assert(std::is_trivial<T>::value, "Only trivial types are supported");
T m_value;
public:
using value_t = T;
using this_t = tagged_type<T... | 3,143 | 1,022 |
// DejaLu
// Copyright (c) 2015 Hoa V. DINH. All rights reserved.
#include "HMMailDBAddToSavedRecipientsOperation.h"
#include "HMMailDB.h"
using namespace hermes;
using namespace mailcore;
MailDBAddToSavedRecipientsOperation::MailDBAddToSavedRecipientsOperation()
{
mAddresses = NULL;
mRowID = -1;
mAllSa... | 1,251 | 468 |
#pragma once
#ifndef _USE_MATH_DEFINES
# define _USE_MATH_DEFINES
#endif
#include <algorithm>
#include <cmath>
#pragma warning(push, 0)
#include <DSP/MLDSPOps.h>
#pragma warning(pop)
#include "convert.hpp"
namespace snd {
constexpr auto PI = 3.14159265358979f;
constexpr float DENORMAL_DC = 1e-25f;
inline void f... | 3,451 | 1,637 |
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main(int argc, char const *argv[])
{
string s1 = "Happy day", s2 = "Bad cat";
const char ch1[] = "Know yourself", ch2[] = "Know thyself";
if (s1 > s2) {
cout << "String s1 is larger.";
} else if (s2 < s1) {
... | 666 | 252 |
// 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 "services/data_decoder/public/cpp/safe_json_parser_impl.h"
#include "base/callback.h"
#include "base/sequenced_task_runner.h"
#include "base/str... | 3,241 | 1,010 |
#include <iostream>
#include <cstdlib>
int main(int argc, char** argv) {
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " <number>\n";
return 1;
}
int nmax = atoi(argv[1]);
int sum_num = 0;
for (int i = 3; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0) {
sum_num += i;
}
}
... | 385 | 184 |
#include "clock.hpp"
#include <functional>
Clock::Clock() {
reset();
}
void Clock::reset() {
step = -1.0;
}
bool Clock::isReset() {
return step == -1.0;
}
double Clock::getStep() {
return step;
}
void Clock::setSampleRate(double inSampleRate) {
sampleRate = inSampleRate; // TODO: Cascade to sub ... | 2,119 | 719 |
#include "app.h"
int CALLBACK WinMain(HINSTANCE i, HINSTANCE p, LPSTR c, int n) {
auto foobar = combine(L"C:\\foo\\bar", L"..\\bar");
MessageBoxW(NULL, foobar.c_str(), L"test", MB_OK);
return foobar != L"C:\\foo\\bar";
}
std::wstring combine(std::wstring l, std::wstring r) {
WCHAR* b;
PathAllocCombine(l.c_st... | 418 | 185 |
/*===================================================================
Copyright 2019 Matthias Komm, Vilius Cepaitis, Robert Bainbridge,
Alex Tapper, Oliver Buchmueller. 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.... | 5,714 | 1,636 |
#include <iostream>
using namespace std;
int main() {
cout << "Content-type:text/html\r\n\r\n";
cout << "<html>\n";
cout << "<head>\n";
cout << "<title>Hello World - First CGI Program</title>\n";
cout << "</head>\n";
cout << "<body>\n";
cout << "<h2>Hello World! This is my first CGI program</h2>\n";
c... | 378 | 146 |
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
// FENCE = 5 EDGE = 4
const int N = 10010;
const double ES = 1.1;
struct point{
int x,y;
point(){}
point(int X,int Y){
x = X,y = Y;
}
};
struct step{
int x... | 2,746 | 1,418 |
//------------------------------------------------------------------------------
// Desc: This is the main implementation of BasicTest component of our unit
// test suite. It handles basic operations such as: creating a db,
// deleting a db, backup and restore and add and remove nodes.
// Tabs: 3
//
// Copyright (... | 21,664 | 9,861 |
/*
* Author: NoMachine <developers@nomachine.com>
*
* Copyright (c) 2009, 2013 NoMachine
* All rights reserved
*
* Support functions and system calls' replacements needed to let the
* software run on Win32 based operating systems.
*
* Redistribution and use in source and binary forms, with or without
* modifi... | 4,323 | 1,708 |
#include <iostream>
#include <vector>
using namespace std;
void moveZeroes(vector<int> &nums);
int main() {
int a[] = {0, 0, 1};
vector<int> vv(a, a + 3);
moveZeroes(vv);
for (int i = 0; i < vv.size(); ++i) {
printf("values is %d\n", vv[i]);
}
return 0;
}
/**
* 思路:先把所有的非0数据保持原有顺序,之后... | 607 | 286 |
//
// ad_stack.cpp
// DLVM
//
// Copyright 2016-2018 The DLVM Team.
//
// 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 r... | 1,122 | 396 |
#include "../include/log.h"
void Log(const char * szLog)
{
#if defined(DEBUG_OUTPUT_LOG)
OutputDebugStringA(szLog);
OutputDebugStringA("\n");
#else
return;
#endif
/*
SYSTEMTIME st;
GetLocalTime(&st);
FILE *fp;
fp = fopen("mlog.txt", "at");
fprintf(fp, "MyLogInfo: %d:%... | 788 | 310 |
#pragma once
#include <citro3d.h>
void CitroInit(size_t commandBufferSize);
void CitroDestroy();
void CitroBindUniforms(shaderProgram_s* program);
void CitroUpdateMatrixStacks();
C3D_MtxStack* CitroGetProjectionMatrix();
C3D_MtxStack* CitroGetModelviewMatrix();
C3D_MtxStack* CitroGetTextureMatrix();
| 302 | 110 |
#include <iomanip>
#include "Serialization.h"
#include "io/primitives.h"
#include "MessageID.h"
using namespace Gadgetron::Core;
namespace Gadgetron::Server::Connection::Nodes {
Serialization::Serialization(
Readers readers,
Writers writers
) : readers(std::move(readers)), writers(... | 2,366 | 678 |
/* Copyright 2020, RespiraWorks
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, software
d... | 3,041 | 1,124 |
// Add File İnclude
#ifdef ENABLE_FATIH_SAHIN_REDCOIN_SYSTEM
#include "RedCoinManager.h"
#endif
// Find
CPrivManager priv_manager;
//Add below
#ifdef ENABLE_FATIH_SAHIN_REDCOIN_SYSTEM
CRedCoinManager RedCoinManager;
#endif | 226 | 103 |
/****************************************************************************************
* @author: kzvd4729 created: 21-10-2018 22:40:38
* solution_verdict: Accepted language: C++14
* run... | 1,139 | 407 |
/*
Valid Sudoku
URL: https://leetcode.com/problems/valid-sudoku
Tags: ['hash-table']
___
Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be
validated according to the following rules :
1. Each row must contain the digits `1-9` without repetition.
2. Each column must contain the digits `... | 3,835 | 1,479 |
#ifndef INPUT_H
#define INPUT_H
namespace proto {
class Config;
class Input {
public:
Input(Config& config);
~Input();
};
} // !namespace proto
#endif // !INPUT_H
| 191 | 72 |
// ------------------------------------------------------------
// 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... | 888 | 247 |
#ifndef _CH_FRB_IO_HPP
#define _CH_FRB_IO_HPP
#if (__cplusplus < 201103) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
#error "This source file needs to be compiled with C++11 support (g++ -std=c++11)"
#endif
#include <queue>
#include <string>
#include <vector>
#include <map>
#include <unordered_set>
#include <unordered_ma... | 54,548 | 17,166 |
#include <eval.h>
#include <parserCore.h>
#include <parserTypes.h>
#include <stmtProcessor.h>
#include <syntaxError.h>
#include <util.h>
using namespace parserTypes;
void eval::Term(parserCore *that, term obj, int dest) {
int offs = that->Asm->stack_offset;
struct offset {
enum Type { MUL, DIV, MOD };
Ty... | 1,886 | 620 |
#include "Basic_info.h"
#include <cstring>
#include <cstdio>
using namespace std;
Basic_info::Basic_info()
{
strcpy(this->name, "unknown");
strcpy(this->id, "unkonwn");
strcpy(this->category, "unkonwn");
}
Basic_info::Basic_info(char* name, char* id, char* cat)
{
strcpy(this->name, name);
strcpy(t... | 651 | 274 |
#include <stdio.h>
#include "RasqalQueryResults.hh"
void RasqalQueryResults::loadBindingResults()
{
if(m_results == NULL)
{
return;
}
while(!rasqal_query_results_finished(m_results))
{
int i;
std::map<std::string, rasqal_literal *> bindingResults;
for(i = 0; i < r... | 1,148 | 378 |
#include "Precompiled.hpp"
#include "RigidBody2d.hpp"
#include "Engine/Cog.hpp"
#include "Engine/Space.hpp"
#include "PhysicsSpace2d.hpp"
#include "Utilities/ZeroUtilities.hpp"
namespace Physics2d
{
//-------------------------------------------------------------------RigidBody2d
ZilchDefineType(RigidBody2d, builde... | 3,344 | 1,265 |
/*
PASO DE PARAMETROS TIPO VECTOR
Parametros de la funcion:
void nombreDeFuncion(tipo nombreArreglo[], int tamañoArreglo);
Llamada a la funcion:
nombreDeFuncion(nombreArreglo, tamañoArreglo);
*/
#include <iostream>
using namespace std;
void sqrtVector(int vect[], int N);
void showVector(int vect[], int N);
int ... | 743 | 332 |
#include "parser.hpp"
#include <cctype>
#include <iostream>
#include <sstream>
#include <stdexcept>
namespace ofxPlanet {
namespace csvr {
Parser::Parser() : tables() {}
void Parser::parse(const std::string& source) {
int start = 0;
while (true) {
Table table;
int read ... | 2,453 | 638 |
// Time Complexity: O(n)
// Space Complexity: O(1)
class Solution {
public:
bool isPalindrome(int x) {
if(x < 0)
return false;
int d = 1;
for(; x / d >= 10 ; d *= 10);
for(; x > 0; x = (x % d) / 10, d /= 100) {
int q = x / d;... | 467 | 165 |
#ifndef RA_UI_WIN32_NUMERICUPDOWNBINDING_H
#define RA_UI_WIN32_NUMERICUPDOWNBINDING_H
#pragma once
#include "NumericTextBoxBinding.hh"
namespace ra {
namespace ui {
namespace win32 {
namespace bindings {
class NumericUpDownBinding : public NumericTextBoxBinding
{
public:
explicit NumericUpDownBinding(ViewModelBa... | 2,052 | 741 |
// 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 "ash/wm/cursor_manager.h"
#include "ash/shell.h"
#include "ash/wm/image_cursors.h"
#include "base/logging.h"
#include "ui/aura/root_window.h... | 3,220 | 1,088 |
#ifndef _LINEARACTIVATION_HPP_
#define _LINEARACTIVATION_HPP_
#include "Activation.hpp"
namespace nn {
class LinearActivation : public Activation
{
public:
virtual ~LinearActivation() = default;
virtual void forward(MatrixType &) override {}
virtual void backward(MatrixType &x) override
{
x = MatrixType::One... | 362 | 133 |
/*
* Purpose: Converts Steinheimer format to MUSIC format.
* Compiling: g++ -Wall -Wextra -std=c++11 -O3 -o converter steinheimer_to_music_converter.cc
* Running: ./converter input_file output_file
*/
#include <cmath>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
int main(int arg... | 3,461 | 1,330 |
/*******************************************************************************
* Filename: acceleration_scheduler_sg_xdma.cpp
* Author: Dimitrios Bakoyiannis <d.bakoyiannis@gmail.com>
* License:
*
* MIT License
*
* Copyright (c) [2018] [Dimitrios Bakoyiannis]
*
* Permission is hereby granted, free of charge, to... | 26,537 | 9,198 |
#include "logging/serial_logger.h"
void SerialLogger::setup()
{
Serial.begin();
last_update_ms = millis() - update_interval_ms;
}
void SerialLogger::loop()
{
if (millis() - last_update_ms >= update_interval_ms)
{
last_update_ms = millis();
persist_values();
}
}
void SerialLogger:... | 1,027 | 338 |
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <tchar.h>
#include <strsafe.h>
#include "logger.h"
#define BUFSIZE 512
DWORD WINAPI InstanceThread(LPVOID);
int _tmain(int argc, _TCHAR* argv[]) {
//Init log
initlog(argv[0]);
_tprintf(_T("Server is started.\n\n"));
BOOL fCo... | 5,936 | 2,399 |
#include "visualmsi.h"
#include "bamutil.h"
#include "jsonreporter.h"
#include "htmlreporter.h"
#include "reference.h"
VisualMSI::VisualMSI(Options *opt){
mOptions = opt;
}
VisualMSI::~VisualMSI(){
for(int m=0; m<mMsiTargetsTumor.size(); m++)
delete mMsiTargetsTumor[m];
for(int m=0; m<mMsiTargetsN... | 7,410 | 2,571 |
#include "core/profiler.h"
#include "ecs/ecs.h"
#include "graphics/renderer/terrain.h"
#include "graphics/assets/assets.h"
#include "graphics/assets/model.h"
#include "components/transform.h"
#include "components/terrain.h"
#include "components/camera.h"
#include "graphics/assets/material.h"
#include "graphics/renderer... | 13,157 | 5,072 |
#include "./common.h"
#include <cstdarg>
#include <dmlc/logging.h>
namespace minerva {
namespace common {
void FatalError(char const* format, ...) {
char buffer[4096];
va_list va;
va_start(va, format);
vsprintf(buffer, format, va);
va_end(va);
LOG(FATAL) << buffer;
abort();
}
} // namespace common
} ... | 342 | 132 |
#include "minc_api.hpp"
InheritanceCast::InheritanceCast(MincObject* fromType, MincObject* toType, MincKernel* kernel)
: MincCast(fromType, toType, kernel)
{
}
int InheritanceCast::getCost() const
{
return 0;
}
MincCast* InheritanceCast::derive() const
{
return nullptr;
}
TypeCast::TypeCast(MincObject* fromType,... | 5,248 | 1,946 |
#include "elem.hpp"
QComboBox *file_list() {
QStringList string = QStringList() << "BINARY" << "MOTOROLA"
<< "AIFF" << "WAVE" << "MP3";
QComboBox* combo = new QComboBox();
combo->addItems(string);
return combo;
}
QComboBox *track_list() {
QStringList string... | 6,146 | 2,083 |
#include "ghcpch.h"
#include "ResourceManager.h"
#include "core/Timer.h"
#include "core/logging/Formatter.h"
#include "core/reflection/TypeBuilder.h"
namespace Ghurund::Core {
Status ResourceManager::loadInternal(Loader& loader, Resource& resource, const FilePath& path, const ResourceFormat* format, LoadOption op... | 7,134 | 1,919 |
/*
Copyright SOFT-ERG (Przemek Kuczmierczyk) 2016
All Rights Reserved.
THIS WORK CONTAINS TRADE SECRET
AND PROPRIETARY INFORMATION WHICH IS THE
PROPERTY OF SOFT-ERG (Przemek Kuczmierczyk)
AND IS SUBJECT TO LICENSE TERMS.
*/
// ---------------------------------------------------------... | 1,944 | 674 |
#include <iostream>
#include <string>
#include "sudoku.hpp"
int main(int argc, char** argv)
{
if(argc < 2)
{
std::cout << "Please, rerun the program with a filename...\n";
return 0;
}
std::string filename = argv[1];
filename = "../sudoku_files/" + filename;
size_t table_size = ... | 445 | 166 |
// -*- C++ -*-
//
// ----------------------------------------------------------------------
//
// Brad T. Aagaard, U.S. Geological Survey
// Charles A. Williams, GNS Science
// Matthew G. Knepley, University of Chicago
//
// This code was developed as part of the Computational Infrastructure
// for Geodynamics (http://... | 4,405 | 1,300 |
/*
* Copyright (c) 2021, kleines Filmröllchen <malu.bertsch@gmail.com>.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "Keyboard.h"
#include "Music.h"
#include "TrackManager.h"
#include <AK/Error.h>
#include <AK/NumericLimits.h>
namespace LibDSP {
void Keyboard::set_keyboard_note(u8 pitch, Keyboard::Switc... | 1,517 | 567 |
/*---------------------------------------------------------------------------*\
Copyright: ICE Stroemungsfoschungs GmbH
Copyright held by original author
-------------------------------------------------------------------------------
License
This file is based on CAELUS.
CAELUS is free software: you can redis... | 2,825 | 840 |
#include "stdafx.h"
#include "PIDocManager.h"
IMPLEMENT_DYNAMIC(CPIDocManager, CDocManager)
CPIDocManager::CPIDocManager(void)
{
}
CPIDocManager::~CPIDocManager(void)
{
}
#ifdef _DEBUG
void CPIDocManager::AssertValid() const
{
CDocManager::AssertValid();
}
void CPIDocManager::Dump(CDumpContext& dc) const
{
CDo... | 1,301 | 506 |
// 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 "remoting/host/vlog_net_log.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "ba... | 1,379 | 500 |
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
int main()
{
int N, K;
scanf("%d %d", &N, &K);
vector<vector<int> > g(K);
for (int i = 0; i < N; i++) {
int a, b;
scanf("%d %d", &a, &b);
--a; --b;
g[a].push_back(b);
}
queue<int> q;
vector<int> prev(K, -1);
prev... | 943 | 412 |
#include "transition_fixer.h"
#include <iostream>
#include <system_error>
#include <string>
#include <sstream>
#include <Windows.h>
#include "event_log.h"
#include "utils.h"
namespace {
constexpr LPCWSTR PROGMAN_NAME = L"Progman";
constexpr UINT DEFAULT_TIMEOUT = 500;
constexpr UINT WM_ENABLE_ACTIVEDESKTOP = WM_... | 1,191 | 470 |
// ****************************************************************************
// NOTICE
//
// This is the copyright work of The MITRE Corporation, and was produced
// for the U. S. Government under Contract Number DTFAWA-10-C-00080, and
// is subject to Federal Aviation Administration Acquisition Management
// System... | 12,624 | 4,709 |
/// Source : https://leetcode.com/problems/reorder-log-files/
/// Author : liuyubobobo
/// Time : 2018-11-11
#include <iostream>
#include <vector>
using namespace std;
/// Using Custom Class and overloading < operator to sort
/// Time Complexity: O(nlogn)
/// Space Complexity: O(n)
class Solution {
private:
... | 1,440 | 462 |
#include "RHIInstance.h"
#ifdef RHI_IMPL_DIRECT3D11
#include "Direct3D11/DeviceD3D11.h"
#elif defined(RHI_IMPL_VULKAN)
#include "Vulkan/DeviceVk.h"
#endif
namespace RHI
{
extern void InitRHIInstance();
extern void ShutdownRHIInstance();
static thread_local CDevice::Ref CurrDevice;
CInstance& CInstance::Get()
{
... | 793 | 289 |
#include "pch.h"
#include <string>
#include "AviSynthEnvironment.h"
#include <system_error>
namespace VideoScriptEditor::PreviewRenderer::Unmanaged
{
using namespace VideoScriptEditor::Unmanaged;
AviSynthEnvironment::AviSynthEnvironment() : AviSynthEnvironmentBase()
{
if (!CreateScriptEnvironment(... | 1,436 | 396 |
#include <assert.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include <orbwebai/structure.h>
#include <orbwebai/structure_operator.h>
#include <common/common.h>
namespace orbwebai
{
namespace face
{
float CalculateSimilarity(
const std::vector<float>& feature1,
const std::... | 3,876 | 1,621 |
/*
* Copyright (C) 2017-2019, Yuriy Levchenko <irov13@mail.ru>
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
#include "GOAP/Alias.h"
#include "GOAP/SourceInterface.h"
#include "GOAP/Cook.h"
#include "GOAP/Exception.h"
namespace GOAP
{
... | 1,615 | 438 |
// ImGui GLFW binding with OpenGL3 + shaders
// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture
// identifier. Read the FAQ about ImTextureID in imgui.cpp.
// You can copy and use unmodified imgui_impl_* files in your project. See
// main.cpp for an example of using this. If you use this bindi... | 17,589 | 6,621 |
/* Copyright 2021 Enjin Pte. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | 5,924 | 1,812 |
#include "DX9Line.h"
#include "d3dx9math.h"
DX9Line::DX9Line(LPD3DXLINE pLine ):
m_pLine( pLine )
{
}
DX9Line::~DX9Line()
{
m_pLine->Release();
}
HRESULT DX9Line::Draw( POINTF* pVertexList, DWORD verCount, DWORD Colour )
{
D3DXVECTOR2* vecs = new D3DXVECTOR2[verCount];
for( DWORD i = 0; i < verCount; i++ )
{
ve... | 459 | 239 |
#include <bits/stdc++.h>
int main(void)
{
int input;
scanf("%d", &input);
if((input + 1) % 2 == 0 || input > 2 == 0)
printf("NO\n");
else
printf("YES\n");
return 0;
}
| 207 | 91 |
// 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.
// This code is adapted from Chromium. For the original, see:
// https://code.google.com/p/chromium/codesearch#chromium/src/
// The code has been modi... | 5,915 | 2,019 |
/************************************************************************
Copyright 2021 Phone Thiha Kyaw
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/license... | 3,491 | 1,080 |
#include "stdafx.h"
#include "BsonValue.h"
#include <functional>
#include <random>
#include <sstream>
#include "ObjectId.h"
#include <gsl\gsl>
namespace LiteCppDB
{
#pragma region Properties
// Get timestamp
int32_t ObjectId::getTimestamp() noexcept
{
return this->mTimestamp;
}
void ObjectId::setTimestamp(in... | 6,021 | 2,506 |
#pragma once
#include <cstdint>
#include <cereal/macros.hpp>
namespace cereal {
// -------------------------------------------------------------------------------------------------
using size_type = CEREAL_SIZE_TYPE;
// ---------------------------------------------------------------------------------------------... | 348 | 79 |
//------------------------------------------------------------
// snakeoil (c) Alexis Constantin Link
// Distributed under the MIT license
//------------------------------------------------------------
#ifndef _SNAKEOIL_MATH_UTILITY_FUNCTION_HPP_
#define _SNAKEOIL_MATH_UTILITY_FUNCTION_HPP_
#include "../typedefs.h"
n... | 4,343 | 1,665 |
/* Copyright 2017 NVIDIA Corporation
*
* The U.S. Department of Energy funded the development of this software
* under subcontract B609478 with Lawrence Livermore National Security, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the L... | 8,786 | 2,774 |
/*! \file */ // Copyright 2011-2020 Tyler Gilbert and Stratify Labs, Inc; see LICENSE.md for rights.
#include <cstdio>
#include "calc/Checksum.hpp"
using namespace calc;
u8 Checksum::calc_zero_sum(const u8 * data, int size){
int i;
u8 sum = 0;
int count = size/sizeof(u8) - 1;
for(i=0; i < count; i++){
sum += da... | 1,347 | 598 |
/*
* BaseLibsvmReader.cpp
*
* Created on: 6 May 2016
* Author: Zeyi Wen
* @brief: definition of some basic functions for reading data in libsvm format
*/
#include <iostream>
#include <assert.h>
#include <sstream>
#include <stdio.h>
#include "BaseLibsvmReader.h"
using std::istringstream;
/**
* @brief: g... | 1,597 | 637 |
/* Copyright (c) 2012-2013 Cheese and Bacon Games, LLC */
/* See the file docs/COPYING.txt for copying permission. */
#include "player_mp.h"
#include "enumerations.h"
#include "shot_data.h"
#include "world.h"
#include "counters.h"
#include "collision.h"
#include "score.h"
#include "mirror.h"
#include "render.h"
#inclu... | 94,520 | 29,792 |
/*
* CollectionInterface.cpp
*
* Created on: 13.01.2015
* Author: chris
*/
#include "CollectionInterface.h"
#include <exception>
CollectionInterface::CollectionInterface(int collectionId) : collectionId(collectionId)
{
}
CollectionInterface::~CollectionInterface()
{
}
std::vector<shared_ptr<MediaItem> ... | 445 | 139 |
/*
* Copyright 2003,2004 The Apache Software Foundation.
*
* 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... | 4,719 | 1,722 |
/*
* (C) Crown copyright 2021, Met Office
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*/
#include "ioda/distribution/PairOfDistributions.h"
#include <boost/make_unique.hpp>
#include "oops/util/DateTime.h"
... | 8,298 | 2,673 |
// include definition
#define _CRT_SECURE_NO_DEPRECATE
#include "cnetwork.h"
// Defines for this code
#define SAFE_RELEASE( p ) { if ( p ) { ( p )->Release ( ); ( p ) = NULL; } }
#define SAFE_DELETE_ARRAY( p ) { if ( p ) { delete [ ] ( p ); ( p ) = NULL; } }
// GUID Value
GUID DPCREATE_GUID = { 0x7d2f0893, 0xb... | 25,648 | 10,257 |
#include <stdio.h>
int main() {
long long n, k;
while(scanf("%lld %lld", &n, &k) == 2) {
long long l = 1, r, div;
long long ret = 0;
while(l <= k) {
div = k/l;
r = k/div;
// d = div
if(r > n) r = n;
long long a0 = k%l, d = -d... | 675 | 312 |
/**
Objectives:
- Complete rigid transform interpolation in the function evaluate_local function in file skeleton.cpp
- Complete the Linear Blend Skinning computation in the function skinning.cpp
*/
#include "vcl/vcl.hpp"
#include <iostream>
#include "forest.hpp"
using namespace vcl;
//for patronus and spell
... | 18,321 | 7,890 |
#include "plotty.h"
#include <QCoreApplication>
int main(int argc, char* argv[]) {
auto app = QCoreApplication(argc, argv);
Plotty plotty(50000);
return app.exec();
}
| 184 | 74 |
// Eggs.SD-6
//
// Copyright Agustin K-ballo Berge, Fusion Fenix 2015
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
int x;
int arr[10];
void fun() {}
struct s { static int sm; } so;
template <typename T, T*> ... | 959 | 398 |
// -*- C++ -*- */
//
// Copyright 2016 WebAssembly Community Group participants
//
// 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
//
// ... | 14,615 | 4,711 |
#include <iostream>
#include <vector>
#include <bits/stl_stack.h>
using namespace std;
/**
* Given an absolute path for a file (Unix-style), simplify it.
* For example,
* path = "/home/", => "/home"
* path = "/a/./b/../../c/", => "/c"
* Corner Cases:
* • Did you consider the case where path = "/../"? In this... | 1,473 | 421 |