text string | size int64 | token_count int64 |
|---|---|---|
#include "RenderAPI.h"
namespace ArcanaTools {
RenderAPI::API RenderAPI::s_API = RenderAPI::API::OPENGL;
} | 109 | 41 |
//here take a cat
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <string>
#include <utility>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <vector>
#include <random>
#include <chrono>
#include <queue>
#include <set>
#define ll long long
#define lb long double
#... | 2,740 | 1,332 |
//Author= Aryan Rathee
//Subtract Complex Number Using Operator Overloading
#include <iostream>
using namespace std;
class Complex
{
private:
float real;
float imag;
public:
Complex(): real(0), imag(0){ }
void input()
{
cout << "Enter real and imaginary parts respect... | 604 | 172 |
/*
* Copyright © 2012, United States Government, as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All rights reserved.
*
* The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
* under the Apache License, Version 2.0 (the "License");
* you may not use t... | 4,634 | 1,702 |
// Copyright (c) MisCar 1574
#include "miscar/Fix.h"
#include <cmath>
double miscar::Fix(double value, double range) {
return (std::abs(value) < range) ? 0 : (value - range) / (1 - range);
}
| 196 | 82 |
/*
* Copyright (C) 2010-2019 Hendrik Leppkes
* http://www.1f0.de
*
* 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) any... | 5,038 | 1,930 |
#include "StepParser.hpp"
#include "SnapshotParser.hpp"
#include "ResultCollectorParser.hpp"
#include "application/factories/parsers/StepParserProvider.hpp"
#include "application/jobs/AnalysisStep.hpp"
#include "application/jobs/StructuralAnalysis.hpp"
#include "application/locators/ClockworkFactoryLocator.hpp"
#includ... | 14,504 | 4,044 |
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: CLUBDETAILSDLG.CPP
** COMPONENT: The Application.
** DESCRIPTION: CClubDetailsDlg class definition.
**
*******************************************************************************
*/
#include "Common.... | 2,088 | 694 |
/**********************************************************************
* Copyright (c) 2008-2016, Alliance for Sustainable Energy.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Fre... | 7,501 | 2,541 |
#include <inttypes.h>
#include "WProgram.h"
#include "helpers.h"
#include "MDRecorder.h"
MDRecorderClass::MDRecorderClass() {
recording = false;
playing = false;
recordLength = 0;
playPtr = NULL;
looping = true;
md_playback_phase = MD_PLAYBACK_NONE;
muted = false;
}
void MDRecorderClass::setup() {
Mid... | 4,393 | 1,793 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/opsworks/model/AppAttributesKeys.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Ut... | 2,709 | 721 |
#include "DestroyGraphicEntityMessage.h"
#include "message/GraphicMessageHandler.h"
DestroyGraphicEntityMessage::DestroyGraphicEntityMessage(GraphicEntity * entity_p, bool delete_p)
: GraphicMessage("")
, _entity(entity_p)
, _delete(delete_p)
{}
void DestroyGraphicEntityMessage::visit(GraphicMessageHandler &handl... | 375 | 129 |
/**********************************************************************/
/* */
/* This file is part of the RFSM package */
/* */
/* Copyright (c) 2018-p... | 1,253 | 320 |
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll c[1010][1010], mod = 1e9 + 7;
void comb(){
c[0][0] = 1;
for(ll i = 1; i < 1010; ++i){
c[i][0] = 1;
for(ll j = 1; j < 1010; ++j) c[i][j] = (c[i-1][j-1] + c[i-1][j])%mod;
}
}
void solve(){
comb();
string s;
... | 952 | 484 |
#include <iostream>
using namespace std;
int main()
{
int vetor[10];
int pares = 0;
//Para cada posição eu irei pedir um valor para o usuário
for (int i = 0; i < 10; i++)
{
cout << "Digite um valor para posição " << i << endl;
cin >> vetor[i];
};
//Para ca... | 736 | 281 |
#include "AST.h"
extern ErrorHandler error_log;
extern TypeManager type_manager;
AST::AST() {
PROFILE();
}
AST::~AST() {
PROFILE();
}
//FIXME fix all of this absolute trash
// at the moment we are making copies of the vectors and moving some and none of it is good
// FIXME use allocator
[[nodiscard]] Projec... | 5,476 | 2,024 |
//10. Given an n lines, m columns matrix, write an algorithm which will
// first display the matrix with each line sorted in ascending order,
//then display the matrix with each column sorted in ascending order.
#include <iostream>
using namespace std;
int main(){
int m, n;
int matrice[50][50], c... | 2,588 | 960 |
#include "pch.h"
#include "Box.h"
#include <algorithm>
Box::Box(const std::wstring& name) : m_name{ name } {
CharacterMap charMap;
for (wchar_t ch : name) {
if (charMap.end() == charMap.find(ch)) {
charMap[ch] = 1u;
} else {
++charMap[ch];
}
}
auto two_count_comparator{ [](const Charac... | 1,323 | 503 |
/*
*/
#include "crate_ptr.hpp"
#include "hir.hpp"
::HIR::CratePtr::CratePtr():
m_ptr(nullptr)
{
}
::HIR::CratePtr::CratePtr(HIR::Crate c):
m_ptr( new ::HIR::Crate(mv$(c)) )
{
}
::HIR::CratePtr::~CratePtr()
{
if( m_ptr ) {
delete m_ptr, m_ptr = nullptr;
}
}
| 284 | 140 |
#include "token.hpp"
TOKEN::TOKEN(DOMAIN_TAG tag, POSITION starting, POSITION following) : tag(tag), frag(FRAGMENT(starting, following)) {}
DOMAIN_TAG TOKEN::get_tag() const
{
return tag;
}
FRAGMENT TOKEN::get_frag() const
{
return frag;
}
std::ostream& operator<<(std::ostream &strm, const TOKEN &tok)
{
... | 348 | 141 |
// 函数指针
#include <iostream>
using namespace std;
int foo();
double goo();
int hoo(int x);
int main()
{
// 给函数指针赋值
int (*funcPtr1)() = foo; // 可以
//int (*funcPtr2)() = goo; // 错误!返回值不匹配!
double (*funcPtr4)() = goo; // 可以
//funcPtr1 = hoo; // 错误,因为参数不匹配,funcPtr1只能指向不含参数的函数,而hoo含有int型的参数
int (*... | 475 | 271 |
#include <catch2/catch.hpp>
#include "support/test_compiler.hpp"
namespace tiro::test {
TEST_CASE("Using the same record structure multiple times should only generate one record template",
"[bytecode_gen]") {
std::string_view source = R"(
export func a() {
return (foo: "1", bar: 2, baz: #... | 721 | 240 |
// Final project for CS 294-73 at Berkeley
// Amirreza Hashemi and Júlio Caineta
// 2017
#include "RectMDArray.H"
#include "FFT1DW.H"
#include "FieldData.H"
#include "RK4.H"
#include "WriteRectMDArray.H"
#include "RHSNavierStokes.H"
void computeVorticity(RectMDArray< double >& vorticity, const DBox box,
... | 3,190 | 1,322 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 Sylko Olzscher
*
*/
#include <smf/https/srv/session.h>
#include <smf/https/srv/connections.h>
#include <cyng/vm/controller.h>
#include <cyng/vm/generator.h>
#include <boost/uuid/uuid_io.hpp>
namespace node
{
namespace https
{
plain_session::plain_session(cy... | 7,266 | 2,956 |
// Copyright (c) 2010-2011 Zipline Games, Inc. All Rights Reserved.
// http://getmoai.com
#include "pch.h"
#include <moaicore/MOAIGfxDevice.h>
#include <moaicore/MOAILogMessages.h>
#include <moaicore/MOAIFrameBufferTexture.h>
//================================================================//
// local
//============... | 7,391 | 2,609 |
#include <iostream>
using namespace std;
int main(){
int age;
cout<<"enter your age"<<endl;
cin>>age;
/*
if (age>=150){
cout<<"invalid age";
}
else if (age >=18){
cout<<"you can vote";
}
else
{
cout<<"sorry,you can not vote";
}
*/
switch (age){
case 12:
... | 498 | 256 |
#include <netinet/tcp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <pthread.h>
#define BUF_SIZE 100
#define NAME_SIZE 20
void* send_msg(void *arg);
void* recv_msg(void *arg);
void error_handling(char* msg);
char name[NAME_SI... | 2,132 | 884 |
// Copyright (c) 2012 Christopher Lux <christopherlux@gmail.com>
// Distributed under the Modified BSD License, see license.txt.
#include "volume_generator_checkerboard.h"
#include <scm/core/math/math.h>
#include <exception>
#include <new>
namespace scm {
namespace gl_classic {
bool volume_generator_checkerboard::... | 1,561 | 463 |
#include "Distance.h"
#include <DebugUtils.h>
#if USE_IR
#include "IR_Distance.h"
#endif
//Init
int avr_front , avr_right , avr_left, avr_TOTAL = 0;
//int angle, delta_angle;
NewPing sonar_front (PING_PIN_FRONT, PING_PIN_FRONT, MAX_DISTANCE);
NewPing sonar_right (PING_PIN_RIGHT, PING_PIN_RIGHT, ... | 4,390 | 1,958 |
#include "NeuralInterface.h"
int main()
{
//Define how much dimension we want and how large it is0
int dimensionSize[] = {2,50,70};
int size = 3;
//Create a manager. This is the core component.
NeuralInterface::InterfaceManager interfaceManager;
//Add a Interface named "Test1" with the parameter we defined.
i... | 596 | 199 |
#include "nau/material/materialGroup.h"
#include "nau.h"
#include "nau/geometry/vertexData.h"
#include "nau/render/opengl/glMaterialGroup.h"
#include "nau/math/vec3.h"
#include "nau/clogger.h"
using namespace nau::material;
using namespace nau::render;
using namespace nau::render::opengl;
using namespace nau::math;
... | 2,110 | 775 |
#ifndef Books_ElementsOfProgrammingInterviews_ch8_hpp
#define Books_ElementsOfProgrammingInterviews_ch8_hpp
#include "reference/ch8.hpp"
#include <cstdlib>
#include <memory>
#include <string>
#include <vector>
namespace study {
extern std::shared_ptr<reference::ListNode<int>> MergeTwoSortedLists(std::shared_ptr<... | 1,866 | 579 |
#include "sim/init.hh"
namespace {
const uint8_t data_m5_internal_param_X86ACPIRSDP[] = {
120,156,197,88,109,115,220,72,17,238,209,190,121,109,175,189,
142,223,242,226,196,162,136,47,11,199,217,192,85,224,224,66,
138,92,46,64,170,14,39,37,135,74,98,168,82,201,171,177,
45,103,87,218,90,141,237,236,149,... | 10,012 | 9,336 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/shield/model/ProtectionGroupArbitraryPatternLimits.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
... | 1,228 | 451 |
// UVa 116
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int MAXR = 10+10;
const int MAXC = 100+10;
const int INF = 1 << 30;
int F[MAXR][MAXC];
int dp[MAXR][MAXC];
int nxt[MAXR][MAXC];
int R, C;
void print... | 2,010 | 944 |
#include "pch.h"
#include "ItemBankWindow.h"
#include "ItemBankPage.h"
#include "../[Lib]__EngineUI/Sources/BasicButton.h"
#include "GLGaeaClient.h"
#include "../[Lib]__EngineUI/Sources/BasicTextBox.h"
#include "InnerInterface.h"
#include "ModalCallerID.h"
#include "../[Lib]__Engine/Sources/DxTools/DxFontMan.h"
#inclu... | 2,807 | 1,193 |
#include "Player.h"
Player::Player(std::string username, sf::Uint64 id, sf::IpAddress address, unsigned short port)
: username(username),
id(id),
address(address),
port(port)
{
//ctor
}
Player::~Player()
{
//dtor
}
| 225 | 84 |
#pragma once
#include <algorithm.hpp>
namespace ktl {
namespace str::details {
template <class Traits, class CharT, class SizeType>
constexpr SizeType find_ch(const CharT* str,
CharT ch,
SizeType length,
SizeType start_pos,
... | 1,805 | 536 |
#ifndef STRING_TOOLS_HPP
#define STRING_TOOLS_HPP
#include <string>
namespace APAL {
/**
* @brief Replaces all occurences of an itemToReplace in the given strToChange
* @param strToChange string to replaces stuff in.
* @param itemToReplace String value, which should be replaces
* @param substitute Text to replace... | 983 | 277 |
#pragma once
#include <cassert>
#include <iostream>
#include <iterator>
#include <limits>
#include <set>
#include <tuple>
#include <utility>
template <typename T>
struct SetManagedByInterval {
using IntervalType = std::set<std::pair<T, T>>;
IntervalType interval{
{std::numeric_limits<T>::lowest(),... | 4,217 | 1,489 |
/*
ISC License
Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
... | 18,897 | 8,301 |
/*
* =================================================
* Copyright © 2021
* Aleksandr Dremov
*
* This code has been written by Aleksandr Dremov
* Check license agreement of this project to evade
* possible illegal use.
* =================================================
*/
#include "Lexer/LexerGenerator.h"
#... | 4,262 | 1,252 |
// Solution 01
using namespace std;
class BinaryTree
{
public:
int value;
BinaryTree *left;
BinaryTree *right;
BinaryTree(int value)
{
this->value = value;
left = NULL;
right = NULL;
}
};
int nodeDepths(BinaryTree *node, int depth = 0);
// Av... | 1,122 | 383 |
/*
* @Author: py.wang
* @Date: 2019-05-04 09:08:42
* @Last Modified by: py.wang
* @Last Modified time: 2019-06-06 18:26:02
*/
#include "src/base/Exception.h"
#include "src/base/CurrentThread.h"
#include <iostream>
#include <cxxabi.h>
#include <execinfo.h>
#include <stdlib.h>
#include <stdio.h>
namespace slack... | 462 | 201 |
/*
* Copyright (c) 2015 Samsung Electronics Co., 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... | 2,078 | 642 |
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define all(v) v.begin(),v.end()
#pragma gcc optimize("O3")
#pragma gcc optimize("Ofast")
#pragma gcc optimize("unroll-loops")
using namespace std;
const int INF = 1e9;
const int TMX = 1 << 18;
const long long llINF = 2e18;
const long long ... | 1,406 | 767 |
#ifndef COMPILE_TIME_SHA1_H
#define COMPILE_TIME_SHA1_H
#include "crypto_hash.hpp"
#define MASK 0xffffffff
#define SHA1_HASH_SIZE 5
template<typename H=const char *>
class SHA1 : public CryptoHash<SHA1_HASH_SIZE> {
private:
constexpr static uint32_t scheduled(CircularQueue<uint32_t,16> queue) {
return ... | 3,177 | 1,278 |
#include <stdio.h>
extern int bar();
int main() {
printf("%d\n", bar());
}
| 80 | 33 |
#include <iostream>
#include "Car.h"
#include "Engine.h"
#include "Driver.h"
using namespace std;
Car::Car(string name, float chassisMass, Engine* engine, float* min_mass):
name(name), chassisMass(chassisMass), engine(engine),
min_mass(min_mass) {}
float Car::getRacingMass() {
if (!driver) {
... | 685 | 235 |
/*****************************************************************************\
ljzjs.cpp : Implementation for the LJZjs class
Copyright (c) 1996 - 2007, HP Co.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following con... | 21,929 | 10,568 |
#include "imgui_utils/imgui_runner/runner_glfw.h"
#include "example_gui.h"
int main()
{
ImGui::ImGuiRunner::RunnerGlfw runner;
runner.ShowGui = ExampleGui;
runner.Run();
} | 178 | 71 |
#include "afx.h"
using namespace std;
class Solution
{
public:
bool validUtf8(vector<int> &data)
{
/*
state:
0: end of byte sequence;
>0: in byte sequence, state = bytes remaining
*/
int state = 0;
int result = true;
for (auto &i : data)
{... | 1,352 | 407 |
#include <iostream>
#include "PhoneCall.h"
int main()
{
PhoneCall p;
p.setLength(50);
p.getPrice();
p.setNumber(9002121004);
std::cout << p.getPrice() << "\n";
std::cout << p.getNumber() << "\n";
return 0;
} | 216 | 102 |
/** @addtogroup fir
* @{
*/
/**
* KFR (http://kfrlib.com)
* Copyright (C) 2016 D Levin
* See LICENSE.txt for details
*/
#pragma once
#include "../cident.h"
namespace kfr
{
inline namespace CMT_ARCH_NAME
{
namespace internal
{
template <typename T, bool stateless>
struct state_holder
{
state_holder() ... | 886 | 309 |
//=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ... | 17,080 | 6,323 |
// Copyright 2016 The Fuchsia 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 <lib/fit/thread_checker.h>
#include <thread>
#include <zxtest/zxtest.h>
namespace {
TEST(ThreadCheckerTest, SameThread) {
fit::thread_checke... | 876 | 325 |
/* ============================================================
* QupZilla - Qt web browser
* Copyright (C) 2016-2017 David Rosca <nowrep@gmail.com>
*
* 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 Foundat... | 2,880 | 908 |
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=8 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "... | 77,150 | 25,388 |
#include <system.hh>
#include <process.hh>
#include <server.hh>
#include <agent.hh>
#include <wall.hh>
namespace makemore {
using namespace makemore;
using namespace std;
extern "C" void mainmore(Process *);
void mainmore(
Process *process
) {
Session *session = process->session;
Server *server = process->sys... | 1,755 | 714 |
#include <ros/ros.h>
#include <ros/callback_queue.h>
#include "geometry_msgs/TransformStamped.h"
#include "geometry_msgs/Pose.h"
#include <visualization_msgs/MarkerArray.h>
#include "tf/transform_listener.h"
#include <tf2/LinearMath/Quaternion.h>
#include <hip_msgs/walls.h>
#include <hip_msgs/wall.h>
#include <hip_msg... | 5,104 | 1,696 |
#ifndef STAN_MATH_REV_MAT_FUN_STAN_PRINT_HPP
#define STAN_MATH_REV_MAT_FUN_STAN_PRINT_HPP
#include <stan/math/rev/meta.hpp>
#include <stan/math/rev/core.hpp>
#include <ostream>
namespace stan {
namespace math {
inline void stan_print(std::ostream* o, const var& x) { *o << x.val(); }
} // namespace math... | 352 | 152 |
#include "common/platform/string.h"
#include <string.h>
namespace lightstep {
int StrCaseCmp(const char* s1, const char* s2) noexcept {
return ::_stricmp(s1, s2);
}
} // namespace lightstep
| 195 | 74 |
#ifndef UtGunnsBasicNode_EXISTS
#define UtGunnsBasicNode_EXISTS
////////////////////////////////////////////////////////////////////////////////////////////////////
/// @defgroup UT_GUNNS_BASIC_NODE Gunns Basic Node Unit Test
/// @ingroup UT_GUNNS
///
/// @copyright Copyright 2019 United States Government as repre... | 3,579 | 796 |
// Copyright (c) 2020 Shivam Rathore. All rights reserved.
// Use of this source code is governed by MIT License that
// can be found in the LICENSE file.
// This file contains Solution to Challenge #027, run using
// g++ 001-050/027/c++/code.cpp -o bin/out
// ./bin/out < 001-050/027/c++/in.txt > 001-050/027/c++/out.t... | 1,016 | 417 |
#include "gtime.h"
#include "gutility.h"
#include "gdatetime.h"
#include "gbytes.h"
#include "gstring.h"
#ifdef G_SYSTEM_WINDOWS
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
#include <windows.h>
#include <time.h>
#else // !G_SYSTEM_WINDOWS
#endif // G_SYSTEM_WINDOWS
#define G_TIME_OFFSET_HOUR ... | 6,436 | 2,948 |
/*************************************************************************
> File Name: PA.cpp
> Author: Gavin Lee
> Mail: sz110010@gmail.com
> Created Time: 西元2016年01月30日 (週六) 00時45分08秒
************************************************************************/
#include <bits/stdc++.h>
using namespace std;
int sv... | 588 | 238 |
// This source file is part of the Argon project.
//
// Licensed under the Apache License v2.0
#include <memory/memory.h>
#include <vm/runtime.h>
#include "bool.h"
#include "bounds.h"
#include "error.h"
#include "integer.h"
#include "iterator.h"
#include "hash_magic.h"
#include "bytes.h"
#define BUFFER_GET(bs) ... | 26,120 | 8,426 |
// MIT LICENSE
//
// Copyright (c) 2020 FOSSA Systems
//
// 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, modif... | 7,976 | 2,802 |
#include "command.h"
#include <iostream>
int main(int argc, char* argv[]) {
// This variables can be set via the command line.
std::string oString = "Default Value";
int32_t oInteger = -1;
uint32_t oUnsigned = 0;
double oDouble = 0.0;
float oFloat = 0.f;
bool... | 2,001 | 665 |
// Question Link ---> https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/
class Solution {
public:
vector<int> kWeakestRows(vector<vector<int>>& mat, int k) {
vector<int> res;
multimap<int, int> soldierRow; // {soldier, row}
int M = mat.size();
int N = mat[0].size()... | 808 | 281 |
/*
* Copyright 2019 Xilinx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | 3,167 | 1,020 |
#ifndef SPROUT_DARKROOM_RENDERERS_WHITTED_STYLE_HPP
#define SPROUT_DARKROOM_RENDERERS_WHITTED_STYLE_HPP
#include <cstddef>
#include <limits>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/functions.hpp>
#include <sprout/darkroom/access/access.hpp>
#include <sprout/darkroom/colors/r... | 6,210 | 2,978 |
//
// Created by makstar on 01.12.2020.
//
#include "BlackAndWhiteNode.h"
void BlackAndWhiteNode::process() {
this->outputPtr = applyTransform(this->inputs[0]->getOutputPtr());
}
std::shared_ptr<Image> BlackAndWhiteNode::applyTransform(const std::shared_ptr<Image>& img) {
int width = img->getWidth();
i... | 856 | 298 |
/* Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved */
#include <string>
#include <vector>
#include "OptArgs.h"
#include "Mask.h"
#include "NumericalComparison.h"
#include "Utils.h"
#include "IonH5File.h"
#include "IonH5Arma.h"
using namespace std;
using namespace arma;
/**
* Options about the two be... | 11,962 | 4,530 |
#include "ServerListResponse.h"
#ifdef _MSC_VER
#include <ciso646>
#endif
void ServerListResponse::serializeto( GrowingBuffer &buf ) const
{
assert(not m_serv_list.empty());
buf.uPut((uint8_t)4);
buf.uPut((uint8_t)m_serv_list.size());
buf.uPut((uint8_t)1); //preferred server number
for(const GameSe... | 1,317 | 519 |
/*
Levenshtein distance
# Examples
$ ./levenshtein ABCDEFG ACEG
Levenshtein Distance: 3
$ ./levenshtein ABCDEFG AZCPEGM
Levenshtein Distance: 4
*/
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
size_t levenshtein(const string& x, const string... | 1,118 | 477 |
//////////////////////////////////////////////////////////////////////////////
// use of tmp:
//
// Tmp(0) : nax seg
// Tmp(1) : nst seg
//
// use of debug bits: bits 0-2 are reserved
// 0 : all events
// 1 : passed events
// 2 : rejected events
//
// 3 : events with N(track seeds) = 0
///////////////////////... | 17,987 | 6,549 |
/** Copyright 2020 Alibaba Group Holding Limited.
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 w... | 2,671 | 938 |
#include<sstream>
#include<cassert>
#include "operations.h"
void runAllTests();
int main() {
runAllTests();
return 0;
}
void testSingleMult() {
Operator times{ type::mult, new Constant{3}, new Constant{5} }; // 3*5
ElementTree tree{ × };
std::ostringstream os;
tree.parse(os);
std::... | 1,330 | 484 |
/*! \brief This file have the implementation for SQLiteWrapper class.
\file sqlitewrapper.cc
\author Alvaro Denis <denisacostaq@gmail.com>
\date 6/19/2019
\copyright
\attention <h1><center><strong>COPYRIGHT © 2019 </strong>
[<strong>denisacostaq</strong>][denisacostaq-URL].
All rights ... | 15,546 | 4,984 |
// VTK_Operation.cpp : implmentation of VTK operations to visualize a 3D model
//
// Author: Jungho Park (jhpark16@gmail.com)
// Date: May 2015
// Description:
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
VTK_Operation::VTK_Operation(HWND ... | 17,529 | 7,278 |
#include "hayai-test.hpp"
#ifndef __HAYAI_FIXTURE
#define __HAYAI_FIXTURE
namespace Hayai
{
typedef Test Fixture;
}
#endif
| 128 | 57 |
#include <iostream>
using namespace std;
void printArray(int* array, int n, const char* message);
//a function that inits an array
void initArray(int* array, int n, int value) {
for (int i = 0; i < n; i++) {
array[i] = value;
}
}
//IT'S WRONG
//DON'T USE IT
int resizeArray(int* array, int n) {
int newSize;
cou... | 1,361 | 591 |
#include "Map.h"
Map::Map()
{
_size = 0;
}
Map::~Map()
{
for (int i = 0; i < _size; i++)
{
delete[] _map_matrix[i];
}
delete[] _map_matrix;
}
void Map::resize(int size)
{
_size = size;
_map_matrix = new char*[size];
for (int i = 0; i < size; i++)
{
_map_matrix[i] = new char[size];
for (int j = 0; ... | 1,070 | 520 |
#pragma once
#include <chrono>
/**
* @brief Timer (実行時間計測)
*/
class Timer {
std::chrono::system_clock::time_point m_start;
public:
Timer() = default;
inline void start() {
m_start = std::chrono::system_clock::now();
}
inline uint64_t elapsedMilli() const {
using namespace std::... | 450 | 154 |
#include <iostream>
#include <string>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
int t;
cin >> t;
for (int i = 0; i < t; i++) {
string a, b, c;
cin >> a >> b >> c;
int n = a.size();
bool pass = true;
for (int j = 0; j < n; j++) {
if (c[j] != a[j] && c[j] != b[j]) {
pass =... | 446 | 232 |
#ifndef CaloMC_CaloWFExtractor_hh
#define CaloMC_CaloWFExtractor_hh
//
// Utility to simulate waveform hit extraction in FPGA
//
#include <vector>
namespace mu2e {
class CaloWFExtractor
{
public:
CaloWFExtractor(unsigned bufferDigi, int minPeakADC,unsi... | 737 | 228 |
#include "include/sunspec/common.hpp"
using namespace sunspec;
Common::Common(/* args */)
{
}
Common::~Common()
{
} | 118 | 45 |
#include "Widget.h"
#include "ui_Widget.h"
#include "Escena.h"
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
mEscena = new Escena(this);
ui->graphicsView->setScene(mEscena);
mEscena->iniciaEscena();
}
Widget::~Widget()
{
delete ui;
}
| 310 | 130 |
/**
* Parrot Drones Awesome Video Viewer Library
* Media interface
*
* Copyright (c) 2016 Aurelien Barre
*
* 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... | 2,456 | 918 |
/**
* @file simulator_handler.hpp
* @brief Defines SimulatorHandlerImpl.
*
* @copyright Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*/
#ifndef ADUC_SIMULATOR_HANDLER_HPP
#define ADUC_SIMULATOR_HANDLER_HPP
#include "aduc/content_handler.hpp"
#include "aduc/logging.h"
EXTERN_C_BEGIN
/*... | 1,862 | 564 |
#ifndef LOCKER_FS_HPP_INCLUDED
#define LOCKER_FS_HPP_INCLUDED
#include <string>
#include <tuple>
namespace locker
{
auto get_locker_home() noexcept -> std::pair<bool, std::string>;
}
#endif //LOCKER_FS_HPP_INCLUDED
| 220 | 101 |
#include "dlgtimedate.h"
#include "ui_dlgtimedate.h"
dlgTimeDate::dlgTimeDate(QWidget *parent) :
QDialog(parent),
ui(new Ui::dlgTimeDate)
{
pParent = parent;
ui->setupUi(this);
}
dlgTimeDate::~dlgTimeDate()
{
delete ui;
}
| 245 | 109 |
#include "subsystems/Arm.h"
#include <frc/smartdashboard/SmartDashboard.h>
Arm::Arm(){
m_arm.RestoreFactoryDefaults();
SetName("Arm");
}
void Arm::Rotate(double speed){
m_arm.Set(speed);
}
void Arm::Stop(){
m_arm.Set(0);
}
| 243 | 102 |
#include "tile.hpp"
Tile::Tile(int x, int y, int w, int h):
sprite(),
x(x),
y(y),
marked(false),
color(Textures::EmptyBlock)
{
this->sprite.setTexture(*texturemanager.get(Textures::EmptyBlock));
this->sprite.scale(w / this->sprite.getGlobalBounds().width, h / this->sprite.getGlobalBounds().height);
... | 1,414 | 503 |
//
// Created by kirlos on 2020-07-19.
//
#include "MainMenu.h"
MainMenu::MainMenu(float width, float height, sf::Font &font) : MenuScroller(width, height, font, MAX_NUMBER_OF_ITEMS){
menu[0].setFont(font);
menu[0].setFillColor(sf::Color::Blue);
menu[0].setString("Play");
menu[0].setPosition(sf::Vecto... | 1,386 | 564 |
#include <QCheckBox>
#include <QTableWidget>
#include <QGraphicsWidget>
#include <QGraphicsLayout>
#include <QGraphicsScene>
#include <QVBoxLayout>
#include <QGraphicsSceneMouseEvent>
#include "spaghetti/element.h"
#include "CRPTR.h"
#include "CRPTRNode.h"
namespace CRPTR {
class CRPTR;
class CRPTRNode;
enum clas... | 8,042 | 3,097 |
#ifdef PEGASUS_OS_LINUX
#ifndef __UNIX_CONFIGURATIONCOMPONENT_PRIVATE_H
#define __UNIX_CONFIGURATIONCOMPONENT_PRIVATE_H
#endif
#endif
| 140 | 67 |
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <dsound.h>
#include "synther.h"
#include "synthtable.h"
#include "notetable_touhou.h"
#pragma comment(lib, "dsound.lib")
#pragma comment(lib, "dxguid.lib")
#define MAX_AUDIO_BUF 4
#define BUFFERNOTIFYSIZE 192000
int sample_rate = 44100; //PCM samp... | 31,841 | 26,907 |
/**
*Codeforces Round #353 DIV2 B
*18/05/16 07:44:53
*xuchen
* */
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <cstring>
#include <map>
#include <set>
#include <stdlib.h>
#include <algorithm>
#include <queue>
using namespace std;
const int N = 100005;
set<int> valset;
map<int, int> L, R;
int ... | 951 | 355 |