text string | size int64 | token_count int64 |
|---|---|---|
#if defined(Hiro_ComboButton)
auto mComboButton::allocate() -> pObject* {
return new pComboButton(*this);
}
auto mComboButton::destruct() -> void {
for(auto& item : state.items) item->destruct();
mWidget::destruct();
}
//
auto mComboButton::append(sComboButtonItem item) -> type& {
if(!state.items) item->sta... | 1,875 | 641 |
/****************************************************************************
** Meta object code from reading C++ file 'enhancededitorwindow.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.0)
**
** WARNING! All changes made in this file will be lost!
***********************************************... | 13,057 | 5,718 |
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
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; version 2 of the License.
This program is distributed i... | 57,365 | 19,496 |
// Smart pointer with unique ownership
#include <memory>
#include <cassert>
int main() {
std::unique_ptr<int> uptr1(new int(1));
int val = *uptr1;
std::unique_ptr<int> uptr2 = uptr1; // Fail
std::unique_ptr<int> uptr3 = std::move(uptr1); // OK
assert(uptr3);
assert(uptr1);
uptr3.reset... | 441 | 170 |
// **********************************************************************
//
// Generated by the IDL3 Translator
//
// Copyright (c) 2001-2004
// StarMiddleware Group
// www.StarMiddleware.net
//
// All Rights Reserved
//
// Author: Huang Jie huangjie@email.com
// Author: Chang Junsheng cjs7908@163.com
// Auth... | 2,147 | 724 |
#include "ConstraintPhysicsSetup.h"
ConstraintPhysicsSetup::ConstraintPhysicsSetup()
{
}
ConstraintPhysicsSetup::~ConstraintPhysicsSetup()
{
}
btScalar val;
btHingeAccumulatedAngleConstraint* spDoorHinge=0;
void ConstraintPhysicsSetup::stepSimulation(float deltaTime)
{
val=spDoorHinge->getAccumulatedHin... | 2,471 | 1,112 |
#include<iostream>
using namespace std;
#define MAX 1024
int main()
{
cout << MAX << endl;
return 0;
} | 106 | 44 |
Leetcode - Two Sum
//Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
//You may assume that each input would have exactly one solution, and you may not use the same element twice.
//You can return the answer in any order.
class Solution {
publ... | 834 | 263 |
/*
* IOSCSITape.cpp
* IOSCSITape
*
* This software is licensed under an MIT license. See LICENSE.txt.
* Created by Jesse Peterson on 12/13/09.
*
*/
#include <AssertMacros.h>
#include <sys/conf.h>
#include <miscfs/devfs/devfs.h>
#include <sys/errno.h>
#include "mtio.h"
#include <sys/ioctl.h>
#include <sys/ui... | 33,012 | 14,900 |
#include <stdio.h>
#define MAX_N 20
void Cubic_Spline(int n, double x[], double f[], int Type, double s0, double sn,
double a[], double b[], double c[], double d[]);
double S(double t, double Fmax,
int n, double x[], double a[], double b[], double c[], double d[]);
int main() {
freopen("in6.txt", "r", stdin);
i... | 3,488 | 2,102 |
/* 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... | 4,188 | 1,288 |
/* -*- c++ -*- */
/*
* Copyright 2006,2007,2009,2013 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio 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, or ... | 33,241 | 11,405 |
#ifndef UDP_CLIENT_BASE_SESSION_IMPL_HPP__
#define UDP_CLIENT_BASE_SESSION_IMPL_HPP__
#include "../client_base.hpp"
using boost::asio::ip::udp;
namespace My_Async{
namespace UDP{
template<typename Derived,
typename InContainer,
typename OutContainer,
std::size_t ReadBufferSize>
Client_Base<Derived, InContaine... | 5,081 | 1,800 |
#ifndef _CELERITE2_UTILS_HPP_DEFINED_
#define _CELERITE2_UTILS_HPP_DEFINED_
#include <Eigen/Core>
#include <cassert>
namespace celerite2 {
namespace utils {
#define ASSERT_SAME_OR_DYNAMIC(VAL, J) assert((VAL == Eigen::Dynamic) || (VAL == J))
// adapted from https://academy.realm.io/posts/how-we-beat-cpp-stl-binary-... | 756 | 316 |
#include <stdio.h>
#include <iostream>
using namespace std;
int xx[] = {0, -1, -1, -1, 0, 1, 1, 1},
yy[] = {1, 1, 0, -1, -1, -1, 0, 1},
M[3][3];
int nextDir(int d) {
for (int i=0; i<8; i++) {
int nd = (d+6+i)%8;
if (M[xx[nd]+1][yy[nd]+1])
return nd;
}
return d;
}
int m... | 563 | 278 |
/**
* UGENE - Integrated Bioinformatics Tools.
* Copyright (C) 2008-2020 UniPro <ugene@unipro.ru>
* http://ugene.net
*
* 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
* ... | 27,599 | 8,668 |
/*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://ww... | 12,903 | 3,773 |
#pragma once
#include "base_object.hpp"
#include "file_element.hpp"
#include "project.hpp"
#include "../libpbxparser/value.hpp"
#include <string>
namespace pbx
{
class BuildFile : public pbx::BaseObject
{
std::string _file_ref;
pbx::Dictionary _settings;
public:
BuildFile(const std::shared_ptr<pbx::Proje... | 454 | 172 |
auto manacher(const string &in) {
int n = in.size();
string s(2 * n - 1, '#');
rep(i, n) s[2 * i] = in[i];
n = 2 * n - 1;
vector<int> r(n);
int i = 0, j = 0, k;
while (i < n) {
while (0 <= i - j && i + j < n && s[i - j] == s[i + j])j++;
r[i] = j, k = 1;
while (0 <= i - k && i + k < n && k + r[i - k] < r[i... | 381 | 213 |
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2.0,
* as published by the Free Software Foundation.
*
* This program is also distributed with certain software (in... | 9,012 | 2,715 |
#include <polyvec/utils/color.hpp>
#include <polyvec/utils/num.hpp>
NAMESPACE_BEGIN(polyfit)
NAMESPACE_BEGIN(Color)
const vec3 COLOR_MIN(22. / 255, 64. / 255, 229. / 255);
const vec3 COLOR_MID(30. / 255, 255. / 255, 97. / 255);
const vec3 COLOR_MAX(255. / 255, 45. / 255, 30. / 255);
// Returns some kind of interpola... | 772 | 377 |
// Copyright © 2017 by Donald King <chronos@chronos-tachyon.net>
// Available under the MIT License. See LICENSE for details.
#include "crypto/cipher/rc4.h"
#include "base/logging.h"
#include "crypto/primitives.h"
#include "crypto/security.h"
namespace crypto {
namespace cipher {
inline namespace implementation {
st... | 3,029 | 1,158 |
#include "KVulkanHeapAllocator.h"
#include "KVulkanGlobal.h"
#include "KVulkanHelper.h"
#include "KBase/Publish/KNumerical.h"
#include "KBase/Interface/IKLog.h"
#include <algorithm>
#include <mutex>
#define KVUALKAN_HEAP_TRUELY_ALLOC
//#define KVUALKAN_HEAP_BRUTE_CHECK
namespace KVulkanHeapAllocator
{
struct BlockI... | 20,045 | 10,309 |
#include "main.h"
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void print_menu();
void add_number(vector<int> &userNumbers);
void display_list(const vector<int> &userNumbers);
double get_avgnum(const vector<int> &userNumbers);
int get_smallnum(const vector<int> &userNumbers);
int get_la... | 2,473 | 943 |
/**
* 507 / 507 test cases passed.
* Runtime: 20 ms
* Memory Usage: 17.6 MB
*/
class Solution {
public:
bool isValidSudoku(vector<vector<char>>& board) {
bool row[10][10] = { false };
bool col[10][10] = { false };
bool blk[10][10] = { false };
for (int i = 0; i < 9; i++) {
... | 726 | 278 |
/* Copyright (c) <2003-2021> <Newton Game Dynamics>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* includi... | 11,998 | 5,851 |
//
// _PORTALUSERPREFWIN_CPP_
//
// Copyright (C) 2017-2020 Tactical Computing Laboratories, LLC
// All Rights Reserved
// contact@tactcomplabs.com
//
// See LICENSE in the top level directory for licensing details
//
#include "PortalUserPrefWin.h"
// Event Table
wxBEGIN_EVENT_TABLE(PortalUserPrefWin, wxDialog)
EVT... | 5,178 | 1,462 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | 4,153 | 1,255 |
/**
* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* Copyright (c) 2016 LIBSCAPI (http://crypto.biu.ac.il/SCAPI)
* This file is part of the SCAPI project.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Permission is hereby granted, free of charge, to any p... | 16,474 | 5,437 |
// @formatter:off
//
// Balau core C++ library
//
// Copyright (C) 2008 Bora Software (contact@borasoftware.com)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apach... | 2,642 | 861 |
//
// LoopbackProvider.hh
//
// Copyright 2017-Present Couchbase, Inc.
//
// Use of this software is governed by the Business Source License included
// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
// in that file, in accordance with the Business Source License, use of this
// software will ... | 11,305 | 2,923 |
#include <iostream>
#include <stdio.h>
#include <string>
#include <dirent.h>
#include <dirent.h>
#include <sstream>
#include <vector>
#include "nlohmann/json.hpp"
#include <time.h>
#include <iterator>
#include <algorithm>
#include <fstream>
#include <filesystem>
#ifdef _WIN32
#include <filesystem>
#include "process.h"
... | 4,232 | 1,541 |
#include "WindowsInclude.h"
#include "CustomWindow.h"
#include "Exception.h"
#include <UnitTest/UnitTest.h>
using UnitTest::Assert;
namespace Wex
{
TEST_CLASS(CustomWindowTest)
{
public:
CustomWindowTest()
{
}
};
}
| 228 | 93 |
#include "velocity_controller/velocity_controller.h"
int main(int argc, char **argv) {
const bool DEBUG_MODE = false; // debug logs are printed to console when true
ros::init(argc, argv, "velocity_controller");
ros::NodeHandle nh;
if (DEBUG_MODE) {
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME,
... | 527 | 168 |
#pragma once
#include <exception>
namespace dansandu::glyph::error
{
class GrammarError : public std::exception
{
public:
explicit GrammarError(std::string message) : message_{std::move(message)}
{
}
const char* what() const noexcept override
{
return message_.c_str();
}
private:
... | 910 | 275 |
/****************************************************************************
Copyright (c) 2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
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 ... | 4,269 | 1,481 |
//===-- flang/unittests/RuntimeGTest/CommandTest.cpp ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | 5,759 | 2,011 |
// nnet2bin/nnet2-modify-learning-rates.cc
// Copyright 2013 Guoguo Chen
// See ../../COPYING for clarification regarding multiple 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 ... | 9,444 | 3,229 |
/*
* Copyright 2009-2017 Alibaba Cloud 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... | 1,823 | 615 |
#include "lab5.h"
#include "logiclayer.h"
#include "QtWidgetsFL.h"
#include "findstop.h"
#include <QDialog>
#include <QDesktopWidget>
#include <QApplication>
#include <QMessageBox>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsRectItem>
#include <QGraphicsEllipseItem>
#include "QtTipsDlgView.h"
#include <QtWi... | 6,806 | 3,217 |
/* * * * * * * * * * * * *\
|* ╔═╗ v0.4 *|
|* ╔═╦═╦═══╦═══╣ ╚═╦═╦═╗ *|
|* ║ ╔═╣ '╔╬═╗╚╣ ║ ║ '║ *|
|* ╚═╝ ╚═══╩═══╩═╩═╣ ╔═╝ *|
|* * * * * * * * * ╚═╝ * *|
|* Manipulation tool for *|
|* ESRI Shapefiles *|
|* * * * * * * * * * * * *|
|* http://www.npolar.no/ *|
\* * * * * * * * * * * * */
#ifndef RES... | 2,368 | 781 |
/*
auther : Abdullah Al Masum
MIST_roll : 201914044
problem Link : https://www.hackerearth.com/practice/algorithms/graphs/breadth-first-search/practice-problems/algorithm/oliver-and-the-battle-1/submissions/
*/
#include<bits/stdc++.h>
#define MAX 1000
using namespace std;
int n,m;
int mat[MAX][MAX];
int vis... | 1,711 | 660 |
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2019 Couchbase, 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
*
* h... | 3,042 | 1,000 |
#include "transit/transit_graph_data.hpp"
#include "transit/transit_serdes.hpp"
#include "base/assert.hpp"
#include "base/checked_cast.hpp"
#include "base/logging.hpp"
#include "base/stl_helpers.hpp"
#include "base/string_utils.hpp"
#include <algorithm>
#include <iterator>
#include <set>
#include "defines.hpp"
usi... | 15,475 | 5,561 |
#ifndef PYTHONIC_BUILTIN_LIST_COUNT_HPP
#define PYTHONIC_BUILTIN_LIST_COUNT_HPP
#include "pythonic/include/__builtin__/list/count.hpp"
#include "pythonic/__dispatch__/count.hpp"
#include "pythonic/utils/proxy.hpp"
namespace pythonic
{
namespace __builtin__
{
namespace list
{
ALIAS(count, pythoni... | 420 | 171 |
#pragma once
#include <boost/container/deque.hpp>
#include <boost/container/options.hpp>
#include <boost/container/small_vector.hpp>
#include <boost/container/static_vector.hpp>
template <typename I, size_t N>
using SmallVector = boost::container::small_vector<I, N>;
template <typename I, size_t N>
using StaticVector ... | 671 | 205 |
/*
* Copyright (c) 2019, The Robot Studio
* 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, this
* list of cond... | 10,663 | 4,482 |
//------------------------------------------------------------------------------
// pnaclURLLoader.cc
//------------------------------------------------------------------------------
#include "Pre.h"
#include "pnaclURLLoader.h"
#include "Core/pnacl/pnaclInstance.h"
#include "IO/Stream/MemoryStream.h"
#include <ppapi/c... | 7,119 | 2,063 |
#include <fstream>
#include <iostream>
#include <algorithm>
#include <queue>
#include "utils.h"
#include "ssTableCache.h"
std::vector<entryForMerge> ssTableCache::genSortedEntry(std::vector<uint64_t> &&keyArray, ssTable *table) {
std::vector<entryForMerge> res;
for (uint32_t i = 0; i < keyArray.size(); ++i) {
... | 11,028 | 3,580 |
#include <iostream>
#include <string>
#include "moses/Timer.h"
#include "moses/InputFileStream.h"
#include "moses/FF/LexicalReordering/LexicalReorderingTable.h"
using namespace Moses;
Timer timer;
void printHelp()
{
std::cerr << "Usage:\n"
"options: \n"
"\t-in string -- input table file n... | 1,423 | 523 |
//
// Created by lbinr on 2020/11/5.
//
#include <iostream>
using namespace std;
int main( int argc, char* argv[] ){
cout << "hello, world!" << endl;
} | 158 | 66 |
#include "Artist.h"
#include <iostream>
using std::vector;
using std::map;
using std::wstring;
Artist::Artist()
{
m_name = L"";
m_albumTitles = vector<wstring>();
m_albumMap = map<wstring, vector<Song>>();
}
Artist::Artist(const wstring name)
:m_name(name)
{
m_albumTitles = vector<wstring>();
m_albumMap = map... | 1,501 | 621 |
// Copyright 2021 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 "components/history_clusters/core/memories_features.h"
#include "base/metrics/field_trial_params.h"
namespace history_clusters {
namespace {
... | 1,572 | 487 |
#include "bitmap.h"
#include <android/native_window.h>
android_native_surface::android_native_surface(ANativeWindow &window)
: _window(window)
{
ANativeWindow_Buffer descriptor = { };
if (ANativeWindow_lock(&_window, &descriptor, 0) < 0)
throw 0;
switch (descriptor.format)
{
case WINDOW_FORMAT_RGBA_8888:
... | 717 | 287 |
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkTwoPointConicalGradient.h"
#include "SkRasterPipeline.h"
#include "../../jumper/SkJumper.h"
sk_sp<SkShader> SkTwoPointConicalGradient::Create(const SkPoint& c0, ... | 9,958 | 3,265 |
#include"iostream"
#include"climits"
using namespace std;
bool is_int(double);
int main() {
double num;
cout<<"Enter an integer value:";
cin>>num;
while(!is_int(num)) {
cout<<"Out of range--please try agagin:";
cin.get();
cin>>num;
}
int val=(int)num;
cout<<"The valu is:"<<val<<endl;
return 0;
}
bool is... | 404 | 171 |
//
// Created by rotem levy on 27/05/2020.
//
#pragma once
#include "Soldier.hpp"
using namespace std;
class Paramedic: public Soldier
{
public:
static const uint MAX_HP = 100;
Paramedic() {};
virtual ~Paramedic() {};
Paramedic(uint num);
void attack(vector<vector<Soldier*>> &... | 387 | 156 |
// http://www.cplusplus.com/reference/iomanip/setw/
// setw example
#include <iostream> // std::cout
#include <iomanip> // std::setw
int main () {
int width = 20;
std::cout << "0 1 2 3\n";
std::cout << "123456789012345678901234567890\n";
std::cout << std::setw(width);
std::c... | 542 | 222 |
/** Basic Info **
Copyright: 2019 Johnny Hendriks
Author : Johnny Hendriks
Year : 2019
Project: VSTestAdapter for Catch2
Licence: MIT
Notes: None
** Basic Info **/
/************
* Includes *
************/
// Catch2
#include <catch2/catch_test_macros.hpp>
/**************
* Start code *
**************/
nam... | 677 | 244 |
#ifndef EVT_EVTAPPROACH_HPP_
#define EVT_EVTAPPROACH_HPP_
#include "measures_pool.hpp"
namespace chronovise {
/**
* The abstract class implementing one of the EVT approach (BM or PoT).
*/
template <typename T_INPUT, typename T_TIME=unsigned long>
class EVTApproach {
public:
/**
* A default virtual costr... | 1,763 | 553 |
#pragma once
#include "math.hpp"
namespace at3 {
/**
* Get the faked cylinder gravity to apply to a mass.
* This attempts to take into account cylinder-tangential velocity of the mass, and provide a complete picure of the
* way an object would move inside the cylinder from the perspective of th... | 2,334 | 700 |
/*-------------------------------------------------------------------------
* drawElements Quality Program OpenGL ES 3.1 Module
* -------------------------------------------------
*
* Copyright 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not ... | 23,364 | 9,851 |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* 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 "MediaStreamGraph.h"
#inc... | 77,288 | 24,407 |
// Copyright (c) 2020 by Robert Bosch GmbH. 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... | 1,420 | 487 |
#include "stdafx.h"
#include "SyncModel.h"
#include "EnNoteTranslator.h"
#include "MockEnService.h"
#include "MockMessagePump.h"
#include "MockLogger.h"
#include "MockUserModel.h"
#include "SignalCheck.h"
#include <boost/ref.hpp>
using namespace boost;
using namespace std;
//-----------------------
... | 1,322 | 492 |
// license:BSD-3-Clause
// copyright-holders:Sergey Svishchev
/*
Elektronika MS 7004 keyboard (DEC LK-201 workalike with extra keys
for Cyrillic characters).
To do:
- connect LEDs and speaker
*/
#include "emu.h"
#include "ms7004.h"
#include "speaker.h"
#define VERBOSE_DBG 1 /* general debug me... | 21,937 | 10,758 |
#include "string.hpp"
#include "vector.hpp"
int main() {
int n(in);
Vector<String> s(n);
Vector<int> p(n);
read(s, p);
int sum = p.accumulate();
for (int i = 0; i < n; ++i) {
if (sum < p[i] * 2) {
cout << s[i] << endl;
return 0;
}
}
cout << "atcoder" << endl;
}
| 299 | 139 |
#include "L1Trigger/L1TMuonEndCap/interface/PtAssignment.h"
#include "L1Trigger/L1TMuonEndCap/interface/PtAssignmentEngine.h"
#include "L1Trigger/L1TMuonEndCap/interface/PtAssignmentEngineDxy.h"
void PtAssignment::configure(PtAssignmentEngine* pt_assign_engine,
PtAssignmentEngineDxy* pt_a... | 8,026 | 3,021 |
#ifndef _ALGEBRA_TEST_LINEAR_POLYNOMIAL_HPP_
#define _ALGEBRA_TEST_LINEAR_POLYNOMIAL_HPP_
#include "gtest/gtest.h"
#include "algebra/misc/linear_polynomial.hpp"
namespace carpio{
TEST(linear_polynomial, lp){
typedef LinearPolynomial_<double, std::string> Poly;
Poly poly;
poly["a"] = 1;
poly["b"] = 2;
poly["b"] ... | 2,857 | 1,444 |
// Copyright András Vukics 2006–2020. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
#include "Evolution_.h"
#include "PumpedTwoLevelAtom.h"
#include "Qbit.h"
#include "StateVector.h"
#include "DensityOperator.h"
#include "Simulated.h"
using namespace std ;
usin... | 1,249 | 542 |
// Fill out your copyright notice in the Description page of Project Settings.
#include "Main/HBGameInstance.h"
UHBGameInstance::UHBGameInstance()
{
//SoundManager = CreateDefaultSubobject<UHBSoundManager>(TEXT("ItemConfig"));
}
void UHBGameInstance::Init()
{
//SoundManager = NewObject<UHBSoundManager>(this,Sound... | 492 | 161 |
#include "llvm/Analysis/IVUsers.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO/PassManagerBuil... | 1,550 | 545 |
#include <ros_msg_io.h>
#include <v_repLib.h>
#include <stubs.h>
#include <cstring>
#py from parse_messages_and_services import get_msgs_info, get_msgs_srvs_info, TypeSpec
#py msgs = get_msgs_srvs_info(pycpp.params['messages_file'], pycpp.params['services_file'])
#py for msg, info in msgs.items():
void write__`info.ty... | 10,714 | 3,020 |
// Generated by Haxe 4.0.0-rc.2+77068e10c
#include <hxcpp.h>
#ifndef INCLUDED_lime_system_Endian
#include <lime/system/Endian.h>
#endif
namespace lime{
namespace _hx_system{
::lime::_hx_system::Endian Endian_obj::_hx_BIG_ENDIAN;
::lime::_hx_system::Endian Endian_obj::_hx_LITTLE_ENDIAN;
bool Endian_obj::__GetStatic(... | 2,247 | 1,095 |
#include "screen.h"
#include <iostream>
using namespace std;
void test1()
{
Screen myscreen;
//char ch = myscreen.get();
//ch = myscreen.get(0, 0);
myscreen.move(4, 0).set('#');
}
void test2()
{
Screen myScreen(5, 5, 'X');
myScreen.move(4, 0).set('#').display(cout);
cout << "\n";
myS... | 411 | 166 |
#include <bits/stdc++.h>
using namespace std;
void backtrack(int start, vector<int> &row, int sum, set<vector<int>> &res, vector<int> &A, int B)
{
if (sum >= B)
{
if (sum == B)
res.insert(row);
return;
}
if (start == A.size())
return;
row.push_back(A[start]);
sum += A[start];
backtra... | 952 | 429 |
#include "transport_catalogue.h"
#include <algorithm>
#include <utility>
#include <iostream>
namespace transport_catalogue{
namespace detail{
size_t StringPairHash::operator() (const std::pair<std::string, std::string>& stops) const {
return hash_s(stops.first) + hash_s(stops.second) * 101;
}
s... | 4,898 | 1,976 |
// Copyright 2016 Google 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 required by applicable... | 5,496 | 1,666 |
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#include <unistd.h>
#include <sys/time.h>
#include "rank_support.hpp"
#include "select_support_scan.hpp"
#include "select_support_mcl.hpp"
#inclu... | 3,503 | 1,738 |
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | 8,522 | 3,003 |
#ifndef _VAE_VOICE
#define _VAE_VOICE
#include "../vae_types.hpp"
#include "../vae_config.hpp"
#include <limits>
namespace vae { namespace core {
/**
* @brief Barebones voice.
* Enough to play back a non spatialized and non filtered sound.
* Other structs extend this and depend on it
* @see VoicePan
* @see... | 1,941 | 688 |
/**
* @file tests/main_tests/kfn_test.cpp
* @author Atharva Khandait
* @author Heet Sankesara
*
* Test mlpackMain() of kfn_main.cpp.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause BSD license. You should have received a copy of the
* 3-clause BSD licens... | 20,097 | 7,069 |
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
int l, r;
l = 0;
r = nums.size() - 1;
k -= 1;
while (true) {
int mid;
mid = sort(nums, l, r);
if (mid == k) {
... | 1,008 | 368 |
/*
* Automatically generated file, do not edit manually!
*
* Copyright 2010-2019 Matus Chochlik. 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)
*/
//[oglplus_object_BoundObjOps_Buffer
template <>
class __B... | 2,992 | 999 |
/*
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <gflags/gflags.h>
DEFINE_uint64(num_threads, 20, "How many threads to use");
DEFINE_string(model, "PF", "Models: PF");
DEFINE_s... | 2,186 | 758 |
// Copyright 2020 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 "weblayer/browser/browsing_data_remover_delegate.h"
#include "base/callback.h"
#include "build/build_config.h"
#include "components/browsing_dat... | 5,221 | 1,661 |
#include "misc/Frustum.h"
Box3D::Box3D(const Box3D& source, const glm::dmat4& transformation)
{
min = transformation * glm::dvec4(source.min, 1.0);
max = transformation * glm::dvec4(source.max, 1.0);
if (min.x > max.x)
{
const double temp = max.x;
max.x = min.x;
min... | 4,623 | 1,983 |
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int N;
bool first = true;
while(scanf("%d", &N)){
if(N == 0)
break;
bool ans = false;
if(! first){
printf("\n");
}
for(int fghij = 1234; fghij <= 98765 / N; fghij++){
int abcde = fghij * N;
int tmp, used = (fghi... | 764 | 411 |
/*
* Original work Copyright (c) 2006-2011 Erin Catto http://www.box2d.org
* Modified work Copyright (c) 2020 Louis Langholtz https://github.com/louis-langholtz/PlayRho
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* a... | 5,691 | 1,833 |
// Copyright 2018 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 "third_party/blink/renderer/core/editing/plain_text_range.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "thir... | 1,047 | 369 |
#include <algorithm>
#include <deque>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <linux/input.h>
#include <arch/bits.hpp>
#include <arch/register.hpp>
#include <arch/io_space.hpp>
#include <async/result.hpp>
#include <boost/intrusive/list.hpp>
#include <helix/ipc.hpp>
#include <libevbackend.... | 22,838 | 9,559 |
// Copyright 2021 The XLS 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 t... | 1,858 | 615 |
//
// Created by sebastian on 03.10.18.
//
#include "A4963RegisterInfo.h" | 73 | 38 |
#include <cstdint>
#include <cstring>
#include "surface.hpp"
#ifdef WIN32
#define __attribute__(A)
#endif
// note:
// for performance reasons none of the blending functions make any attempt
// to validate input, adhere to clipping, or source/destination bounds. it
// is assumed that all validation has been done b... | 8,293 | 3,630 |
#pragma once
#include "sea_dsa/Graph.hh"
namespace sea_dsa {
struct CloningContext {
llvm::Optional<const llvm::Instruction *> m_cs;
enum DirectionKind { Unset, BottomUp, TopDown };
DirectionKind m_dir;
CloningContext(const llvm::Instruction &cs, DirectionKind dir)
: m_cs(&cs), m_dir(dir) {}
static... | 2,428 | 834 |
#include "theme.h"
#include "themedata.h"
#include "themedatabase.h"
namespace ote {
#define CASE(item) case item: return #item;
#define IF(item) if(strcmp(elem, #item)==0) return item;
const char* Theme::elementToString(Theme::HighlightElements elem)
{
switch(elem) {
CASE(TextEditText)
CASE(TextEditAct... | 2,059 | 697 |
// ----------------- BEGIN LICENSE BLOCK ---------------------------------
//
// Copyright (C) 2018-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
//
// ----------------- END LICENSE BLOCK -----------------------------------
#include <string>
#include <ad/map/access/Logging.hpp>
#include "core_python.h"
u... | 3,950 | 1,445 |
#include "House.h"
extern TEXTURE_2D **TextureList;
House::House()
{
texnum = 0;
}
// Create an OpenGL rendering context
BOOL House::CreateViewGLContext(HDC hDC)
{
m_hGLContext = wglCreateContext(hDC);
if (m_hGLContext == NULL)
return FALSE;
if (wglMakeCurrent(hDC, m_hGLContext) == FALSE)
... | 12,364 | 5,024 |
/*
* LEGAL NOTICE
* This computer software was prepared by Battelle Memorial Institute,
* hereinafter the Contractor, under Contract No. DE-AC05-76RL0 1830
* with the Department of Energy (DOE). NEITHER THE GOVERNMENT NOR THE
* CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
* LIABILITY FOR THE ... | 15,686 | 4,376 |
/*
* Author: Renato Utsch Gonçalves
* Computer Science, UFMG
* Computer Graphics
* Practical exercise 2 - Boids
*
* Copyright (c) 2014 Renato Utsch <renatoutsch@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the... | 4,793 | 1,409 |