text string | size int64 | token_count int64 |
|---|---|---|
#include "mylib.h"
int my_val = 0;
void init_my_lib() { my_val = 10; }
int get_my_lib_val() { return my_val; }
void shutdown_my_lib() { my_val = 0; } | 153 | 75 |
/* mbed Microcontroller Library
* Copyright (c) 2006-2020 ARM Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* 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... | 11,791 | 4,369 |
/*
* Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "flashlight/app/objdet/nn/Transformer.h"
#include "flashlight/fl/nn/nn.h"
using namespace ... | 13,299 | 5,007 |
// @COPYRIGHT@
// Licensed under MIT license (LICENSE.txt)
// clxx/info/platform_layer_info.hpp
/** // doc: clxx/info/platform_layer_info.hpp {{{
* \file clxx/info/platform_layer_info.hpp
* \brief Defines \ref clxx::platform_layer_info "platform_layer_info" class
*/ // }}}
#ifndef CLXX_INFO_PLATFORM_LAYER_INFO_HPP... | 9,143 | 2,864 |
/*
* @Author: Petrichor
* @Date: 2022-03-11 11:40:37
* @LastEditTime: 2022-03-11 17:21:28
* @LastEditors: Petrichor
* @Description:
* @FilePath: \ModernOCR\modules\core\utils.cpp
* 版权声明
*/
#include "utils.h"
namespace ModernOCR {
namespace utils{
};
namespace image{
cv::Mat getRot... | 3,337 | 1,173 |
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Copyright (c) 2019 The Yiya Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "assettablemodel.h"
#include "assetrecord.h"
#include "guiconstants.... | 6,845 | 1,991 |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2015-2018, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version ... | 1,344 | 481 |
/****************************************************************\
** BB_Sudoku Bit Based Sudoku Solver **
\****************************************************************/
/****************************************************************\
** (c) Copyright Brian Turner, 2008-2009. Th... | 30,158 | 10,723 |
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from errors.djinni
#ifndef DJINNI_GENERATED_ERROR_HPP_JNI_
#define DJINNI_GENERATED_ERROR_HPP_JNI_
#include "../../api/Error.hpp"
#include "djinni_support.hpp"
namespace djinni_generated {
class Error final {
public:
using CppType = ::ledge... | 1,138 | 446 |
/*
* ::718604!
*
* Copyright(C) November 20, 2014 U.S. Food and Drug Administration
* Authors: Dr. Vahan Simonyan (1), Dr. Raja Mazumder (2), et al
* Affiliation: Food and Drug Administration (1), George Washington University (2)
*
* All rights Reserved.
*
* The MIT License (MIT)
*
* Permission is hereb... | 21,403 | 8,685 |
/* FDP.cpp
* -------
* -----------------------------
* Finite-Difference in Parallel
* -----------------------------
*
* Adding Linear Solve Functionality in the Solve_Linear_Equation function.
* - It currently needs to be able to wrap MatMult in MyMatMult, using my Finite-Difference
* Stencils to calculate t... | 104,500 | 44,593 |
CartridgeSlot cartridgeSlot{"Cartridge Slot"};
CartridgeSlot expansionSlot{"Expansion Slot"};
CartridgeSlot::CartridgeSlot(string name) : name(name) {
}
auto CartridgeSlot::load(Node::Object parent) -> void {
port = parent->append<Node::Port>(name);
port->setFamily(interface->name());
port->setType("Cartridge")... | 599 | 200 |
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <windows.h>
#include <thread>
#include "FirebaseCommunication.h"
#include <atlbase.h>
#include <atlconv.h>
#include <vector>
FirebaseCommunication::FirebaseCommunication()
{
http = new HTTPclient();
cv = false;
}
EXIT_TYPE FirebaseCommunication::... | 7,627 | 2,833 |
/*
* conjunctive.hpp - Clause and Conjunctive
*
* Copyright (C) 2019-2020 Tobias Boege
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Artistic License 2.0
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; withou... | 2,939 | 1,041 |
/* Copyright (c) 2021 NexFarming
* All rights reserved
*
* Author: Tasnim Zotder
* Git: git@github.com:NexFarming/farm-a1-temp-control.git
*/
#include <stdio.h>
#include "hardware/adc.h"
#include "hardware/gpio.h"
#include "pico/binary_info.h"
#include "pico/stdlib.h"
const uint LED_PIN = 25;
const ... | 2,865 | 1,349 |
/****************************************************************************
Copyright (c) 2014-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
https://adxeproject.github.io/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and a... | 4,221 | 1,577 |
// Copyright David Abrahams 2002.
// Copyright Stefan Seefeld 2016.
// 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 boost_python_to_python_value_hpp_
#define boost_python_to_python_value_hpp_
#include <... | 5,576 | 1,898 |
#include "taichi/ir/type_factory.h"
#include "taichi/ir/type_utils.h"
TLANG_NAMESPACE_BEGIN
TypeFactory &TypeFactory::get_instance() {
static TypeFactory *type_factory = new TypeFactory;
return *type_factory;
}
TypeFactory::TypeFactory() {
}
Type *TypeFactory::get_primitive_type(PrimitiveTypeID id) {
std::lo... | 6,151 | 2,078 |
// Copyright 2020 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
#include "ledger/LedgerTxnImpl.h"
#include "util/GlobalChecks.h"
#include "util/types.h"
names... | 12,024 | 3,764 |
/*
Copyright 2018 Igor Kholopov, 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... | 4,072 | 1,367 |
/* mbed Microcontroller Library
* Copyright (c) 2006-2018 ARM 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
*
* ... | 8,494 | 3,031 |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | 4,630 | 1,452 |
#include "lab4/dfp.h"
#include "iostream"
#include "lab1/brent.h"
#include "lab3/solver.h"
using namespace lab4;
DFP::DFP()
: s(lab2::Vector({1})),
d(lab2::Vector({1})),
G(lab2::Matrix({{1}}, std::nullopt)) {}
lab2::Vector DFP::iteration(lab2::NFunction &f, double) {
lab2::Vector x_k_1 = get_poi... | 1,103 | 468 |
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofSetVerticalSync(true);
ofBackground(0,0,0);
ofSetCircleResolution(100);
radius = 50;
}
//--------------------------------------------------------------
void ofApp::update(){
radius = radius +... | 1,765 | 594 |
/*
* GridTools
*
* Copyright (c) 2014-2019, ETH Zurich
* All rights reserved.
*
* Please, refer to the LICENSE file in the root directory.
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <gridtools/stencil_composition/make_loop_intervals.hpp>
#include <gtest/gtest.h>
#include <gridtools/common/defs.hpp>
... | 2,602 | 884 |
#include "src.h"
#include <string.h>
#include <stdlib.h>
int sum(int const * A_members, size_t n){
auto ret = 0;
for (int i = 0; i < n; i++){
ret += *A_members;
A_members++;
}
return ret;
}
void digits(int n, int** A_output, size_t* size, int base){
auto ret = (int*)malloc(0);
s... | 1,035 | 458 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/apigatewayv2/model/Stage.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace ... | 6,726 | 2,343 |
// Copyright 2017 Google 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 agreed to in... | 16,513 | 5,280 |
/* In this exercise we want to design a Storyboard. Our version of the Storyboard
* contains arbitrary many notes (imagine it like putting sticky notes on a board).
* Every note has a title, a text and a set of tags. E.g.
* - title: "Test Traceplayer"
* - text: "Implement a unit test for the class Traceplayer of ... | 3,052 | 989 |
/*
* This source file is part of the bstring string library. This code was
* written by Paul Hsieh in 2002 - 2006, and is covered by the BSD open source
* license. Refer to the accompanying documentation for details on usage and
* license.
*/
/*
* bstrwrap.c
*
* This file is the C++ wrapper for the bstring fu... | 73,497 | 22,433 |
//
// This source file is part of appleseed.
// Visit https://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2015-2018 Esteban Tovagliari, The appleseedhq Organization
//
// Permission is hereby granted, free of charge, to any perso... | 6,361 | 2,146 |
//////////////////////////////////////////////////////////////////////
// Copyright (c) 2015, Jeff Chadwick and David Bindel
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redis... | 4,037 | 1,296 |
#ifndef FILE_ACCESS_HPP_INCLUDED
#define FILE_ACCESS_HPP_INCLUDED
// Read value of a key, show warning and default value if the key is missing
template <class T>
T readEntry
( boost::property_tree::ptree pt
, std::string section
, std::string name
, T defaultValue );
// Read settings from proper... | 2,122 | 688 |
/******************************************************************************
*
* Copyright (c) 2018-2019, NVIDIA CORPORATION. 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 Lice... | 2,629 | 962 |
#include "Interface/IFat32Directory.hpp"
#include "Fat32Directory.hpp"
#include "Fat32Root.hpp"
#include "Fat32File.hpp"
#include <algorithm>
#include <string>
Fat32Directory::Fat32Directory(std::weak_ptr<Fat32Disk> fat32, std::shared_ptr<DirectoryEntry> entry)
: IFat32Directory(fat32)
{
m_fat32 = fat32;
... | 644 | 269 |
/*
* Copyright (C) 2015 The Android 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 4,641 | 1,409 |
/*
TiMidity -- Experimental MIDI to WAVE converter
Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
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 you... | 15,212 | 7,488 |
// Copyright 2020 The Pigweed 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... | 1,831 | 706 |
#include <bits/stdc++.h>
using namespace std;
int i, n;
struct activity
{
int s,f;
};
bool compare(activity a1, activity a2)
{
return (a1.f < a2.f);
}
void activity_greedy(activity a[], int m)
{
if(m >= n)
return;
if(a[m].s >= a[i].f)
{
if(i == 0)
cout << "{" << a[i].s << "," << a[i].f << "} ";
cou... | 604 | 318 |
/**
* Copyright (C) 2012 10gen Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful... | 8,206 | 2,420 |
#include "Cursor.h"
#include "Util\Math.h"
Cursor::Cursor(const sf::RenderWindow& window) : Tower(window) {}
void Cursor::update(const sf::RenderWindow& window, const Path& path,
const std::vector<std::unique_ptr<Tower>>& towers, bool bTowerBeingPlaced)
{
if (bTowerBeingPlaced)
{
// place dummy tower a... | 6,985 | 2,810 |
/*
** $Id$
**
** loadSplash.cpp:
**
** Copyright (C) 2003 ~ 2010 Beijing Feynman Software Technology Co., Ltd.
**
** All rights reserved by Feynman Software.
**
** Current maintainer: lvlei
**
** Create date: 2010-08-25
*/
#include "mdconfig.h"
#ifdef _MD_ENABLE_WATERMARK
#include "licenseHidden... | 8,823 | 3,669 |
/*
Copyright (C) 1997-2011 by Suntail.com AS, Tim Whelan
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify... | 9,227 | 3,610 |
// Copyright 2014 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 "config.h"
#include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include... | 9,408 | 2,537 |
/********************* */
/*! \file msat-array-models.cpp
** \verbatim
** Top contributors (to current version):
** Makai Mann
** This file is part of the smt-switch project.
** Copyright (c) 2020 by the authors listed in the file AUTHORS
** in the top-level sour... | 1,591 | 588 |
#include "MainScreen.h"
#include "Song.h"
#include "Music.h"
#include <string>
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void main(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
for (int i = 0; i < args->Length; i... | 529 | 197 |
#include "CondFormats/ESObjects/interface/ESADCToGeVConstant.h"
ESADCToGeVConstant::ESADCToGeVConstant()
{
ESvaluelow_=0.;
ESvaluehigh_=0.;
}
ESADCToGeVConstant::ESADCToGeVConstant(const float & ESvaluelow, const float & ESvaluehigh) {
ESvaluelow_ = ESvaluelow;
ESvaluehigh_ = ESvaluehigh;
}
ESADCToGeVConst... | 352 | 157 |
/*
* Copyright (c) 2019, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at w... | 6,155 | 2,290 |
#include "nn/axpby.h"
namespace gnn
{
template<typename mode, typename Dtype>
Axpby<mode, Dtype>::Axpby(std::string _name, Dtype _a, Dtype _b, PropErr _properr)
: Factor(_name, _properr), a(_a), b(_b)
{
}
template<typename mode, typename Dtype>
void Axpby<mode, Dtype>::Forward(std::vector< std::shared_ptr<Variab... | 1,661 | 692 |
#include "ServoMotion.h"
#include "DataStore.h"
#define START_DELAY 200
#define RUNNING_HOLD_PERIOD 1000
enum ServoMotionState_t {
SS_OFF,
SS_JUST_ON,
SS_RUNNING,
};
static void s_powerOff(uint8_t powerPin) {
digitalWrite(powerPin, LOW);
}
static void s_powerOn(uint8_t powerPin) {
digitalWrite(power... | 1,072 | 493 |
// Copyright David Abrahams 2004. 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)
#include <boost/python/detail/destroy.hpp>
#include <boost/detail/lightweight_test.hpp>
int count;
int marks[] = {
-1
, -1,... | 1,171 | 464 |
#pragma once
#include "../../JObject.hpp"
namespace android::media
{
class MediaRecorder;
}
namespace android::media
{
class MediaRecorder_AudioEncoder : public JObject
{
public:
// Fields
static jint AAC();
static jint AAC_ELD();
static jint AMR_NB();
static jint AMR_WB();
static jint DEFAULT();
s... | 700 | 264 |
#include <iostream>
#include <queue>
using namespace std;
using ll = long long;
const int N = 2e5 + 10;
ll ans[N];
struct Node {
int t, d, id;
};
int main() {
int n, b;
scanf("%d%d", &n, &b);
ll ed = 0;
queue<Node> q;
for (int i = 0; i < n; ++i) {
int t, d;
scanf("%d%d", &t,... | 944 | 380 |
/*
* src/qd.cc
*
* This work was supported by the Director, Office of Science, Division
* of Mathematical, Information, and Computational Sciences of the
* U.S. Department of Energy under contract number DE-AC03-76SF00098.
*
* Copyright (c) 2000-2001
*
* Contains implementation of non-inlined functions of quad... | 27,860 | 13,067 |
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
* reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Found... | 40,106 | 12,048 |
/*
CommandSet.cpp
By Jim Davies
Jacobus Systems, Brighton & Hove, UK
http://www.jacobus.co.uk
Provided under the MIT license: https://github.com/jacobussystems/ArdJack/blob/master/LICENSE
Copyright (c) 2019 James Davies, Jacobus Systems, Brighton & Hove, UK
Permission is hereby granted, free of charge, to any... | 17,668 | 7,025 |
#if !defined(ARCADIA_BUILD)
# include "config_core.h"
#endif
#include <Interpreters/InterpreterExternalDDLQuery.h>
#include <Interpreters/Context.h>
#include <Parsers/IAST.h>
#include <Parsers/ASTDropQuery.h>
#include <Parsers/ASTRenameQuery.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTExternalDDLQue... | 2,716 | 854 |
// Copyright 2014 the V8 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.
// TODO(jochen): Remove this after the setting is turned on globally.
#define V8_IMMINENT_DEPRECATION_WARNINGS
#include "test/cctest/compiler/function-... | 15,625 | 7,241 |
///////////////////////////////////////////////////////////////////////////////
// //
// DxcPixLiveVariables.cpp //
// Copyright (C) Microsoft Corporation. All rights reserved. //
... | 7,822 | 2,621 |
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
// Copyright (c) 2012, John Haddon. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted pro... | 8,039 | 2,639 |
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#inc... | 2,471 | 845 |
// freverb.cpp:
// reverb processing example
// depends on libsndfile
//
// (c) V Lazzarini, 2021
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright n... | 5,260 | 2,085 |
/******************************************************************************
* Copyright 2017 The Apollo 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
... | 11,927 | 4,272 |
#include <Kernel/Syscall.h>
#include <errno.h>
#include <mman.h>
#include <stdio.h>
extern "C" {
void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset)
{
Syscall::SC_mmap_params params { (u32)addr, size, prot, flags, fd, offset, nullptr };
int rc = syscall(SC_mmap, ¶ms);
if (rc... | 1,469 | 644 |
/* -------------------------------------------------------------------------- *
* OpenSim: Schutte1993Muscle_Deprecated.cpp *
* -------------------------------------------------------------------------- *
* The OpenSim API is a toolkit for musculoskeletal modeling and simulation. *
... | 27,642 | 9,150 |
// MIT License
// Copyright (c) 2021 Daniel Kowalczyk
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify... | 10,387 | 3,550 |
#include "canvas/Persistency/Provenance/EventAuxiliary.h"
// vim: set sw=2 expandtab :
#include <ostream>
#include <utility>
using namespace std;
namespace art {
EventAuxiliary::~EventAuxiliary() {}
EventAuxiliary::EventAuxiliary()
: id_{}, time_{}, isRealData_{false}, experimentType_{Any}
{}
EventAux... | 3,137 | 1,148 |
// Copyright (C) 2018 ETH Zurich
// Copyright (C) 2018 UT-Battelle, LLC
// All rights reserved.
//
// See LICENSE for terms of usage.
// See CITATION.md for citation guidelines, if DCA++ is used for scientific publications.
//
// Author: Peter Staar (taa@zurich.ibm.com)
//
// HDF5 reader.
#ifndef DCA_IO_HDF5_HDF5_READ... | 8,136 | 3,026 |
/*!
* @copyright
* Copyright (c) 2016-2019 Intel Corporation
*
* @copyright
* 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
*
* @copyright
* http://www.apache.org/licenses/LICENSE-... | 7,305 | 1,939 |
#include <STD/Ostream.hpp>
| 27 | 13 |
#include <iostream>
#include <iomanip>
#include "DenseGraph.h"
#include "SparseGraph.h"
#include "ReadGraph.h"
#include "LazyPrimMST.h"
#include "PrimMST.h"
#include "KruskalMST.h"
using namespace std;
int main() {
string filename = "testG1.txt";
int V = 8;
SparseGraph<double> g = SparseGraph<double>(V,... | 1,321 | 535 |
#include "exploding_villagers.h"
#include <set>
#include "genie/dat/DatFile.h"
#include "ids.h"
void configureExplodingVillagers(genie::DatFile *df, bool nerfSaboteur) {
std::set<int> villagers = {
ID_FISHING_SHIP, ID_TRADE_COG, ID_TRADE_CART_EMPTY, ID_TRADE_CART_FULL,
ID_VILLAG... | 1,726 | 775 |
#define pinTrigger 9
#define pinEcho 10
const int ledsColors[] = { 7, 6, 5 };
const int red = ledsColors[0];
const int blue = ledsColors[1];
const int green = ledsColors[2];
int readDistance()
{
digitalWrite(pinTrigger, LOW);
delayMicroseconds(2);
digitalWrite(pinTrigger, HIGH);
delayMicroseconds(10);
digi... | 864 | 349 |
#include "kalman_filter.h"
#include <string>
using Eigen::MatrixXd;
using Eigen::VectorXd;
// Please note that the Eigen library does not initialize
// VectorXd or MatrixXd objects with zeros upon creation.
KalmanFilter::KalmanFilter() {
/*
* private variable for debug
*/
fn = "Constructor";
}
KalmanFilt... | 2,727 | 1,292 |
/*
* See header file for a description of this class.
*
* \author S. Bolognesi and G. Cerminara - INFN Torino
*/
#include <iostream>
#include <map>
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
#include "DataFormats/MuonDetId/... | 9,612 | 3,286 |
/**
* Implementation of a custom Newton solver which only utilizes
* the linear solvers of PETSc.
*/
#include <iostream>
#include <string>
#include <vector>
#include "DREAM/IO.hpp"
#include "DREAM/OutputGeneratorSFile.hpp"
#include "DREAM/Solver/SolverNonLinear.hpp"
using namespace DREAM;
using namespace std;
/... | 23,298 | 8,030 |
/*
* operations.cpp
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013-2022 Apple Inc. and the FoundationDB project 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 obtai... | 10,976 | 3,483 |
/*
* 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 by... | 5,082 | 1,476 |
#include "gtest/gtest.h"
#include "example.h"
TEST(example, divide)
{
double res;
res = divide_numbers(10.0, 2.0);
ASSERT_NEAR(res, 5.0, 1.0e-11);
}
| 162 | 81 |
#include <cstdlib>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <immintrin.h>
#include "gettime.cpp"
#include "avx512f-strrchr.cpp"
class TestCase {
private:
char* buffer;
size_t size;
volatile size_t count;
public:
TestCase(size_t s)
: size(s) {
... | 1,976 | 754 |
#include "QtMainWindow.h"
QtMainWindow::QtMainWindow(const std::string username, QWidget* parent)
: QMainWindow(parent)
{
setupUi(this);
this->username = username;
this->user = new GuiUser(username);
std::string fileName = username + "_form_gui.txt";
std::string title = "Data Hive | User: " + user... | 10,595 | 3,634 |
/*
* Copyright 2014 The Android 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | 8,374 | 2,943 |
#include <stdlib.h>
#include "common.h"
#include "matlab.h"
static string matlabprog = "matlab -nojvw -nosplash -nodesktop -r ";
int matlabCall(const std::string& cmd)
{
return system((matlabprog+cmd+", exit").c_str());
}
| 228 | 89 |
/*
* UVCCamera
* library and sample to access to UVC web camera on non-rooted Android device
*
* Copyright (c) 2014-2017 saki t_saki@serenegiant.com
*
* File name: serenegiant_usb_UVCCamera.cpp
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance ... | 67,031 | 26,906 |
#include "catch2/catch.hpp"
#include "share/scream_types.hpp"
#include "ekat/ekat_pack.hpp"
#include "ekat/kokkos/ekat_kokkos_utils.hpp"
#include "physics/p3/p3_functions.hpp"
#include "physics/p3/p3_functions_f90.hpp"
#include "p3_unit_tests_common.hpp"
namespace scream {
namespace p3 {
namespace unit_test {
templ... | 3,325 | 1,400 |
// MABE is a product of The Hintze Lab @ MSU
// for general research information:
// hintzelab.msu.edu
// for MABE documentation:
// github.com/Hintzelab/MABE/wiki
//
// Copyright (c) 2015 Michigan State University. All rights reserved.
// to view the full license, visit:
// github... | 1,563 | 578 |
#ifndef _RYSQ_MATRIX_HPP_
#define _RYSQ_MATRIX_HPP_
#include <stdlib.h>
#if !defined(__host__) && !defined(__device__)
#define __host__
#define __device__
#endif
namespace rysq {
struct matrix_layout {
matrix_layout() {}
matrix_layout(size_t size1, size_t size2, size_t ld = 0)
: size1(size1),size2(size2... | 1,921 | 758 |
#include "stdafx.h"
#include "ShaderParamMat3.h"
#include "Memory/MemoryLeaks.h"
namespace bv {
// ****************************
//
ShaderParamMat3::ShaderParamMat3 ( const std::string & name, const glm::mat3 & value )
: GenericShaderParam( ShaderParamTypeTraits< ValueMat3::Va... | 648 | 240 |
#include "constants.hpp"
#include "light.hpp"
#include "motor.hpp"
#include "timer.hpp"
#include "keypad.hpp"
enum OniState {
INIT,
IDLE,
MOVE
};
class Oni {
private:
Light *eye = new Light(DIGITAL_PIN3, 12, 24);
Motor *eyeMotor = new Motor(DIGITAL_PIN9);
Motor *axeMotor = new Motor(DIGITAL_PI... | 1,126 | 425 |
class Solution {
protected:
string yieldRange(int begin, int end) {
if (begin == end) {
return to_string(begin);
}
return to_string(begin) + "->" + to_string(end);
}
public:
vector<string> summaryRanges(vector<int>& nums) {
const int n = nums.size();
vector<string> r... | 826 | 296 |
/*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
// include the required headers
#include "MeshDeformer.h"
#include <EMotionFX/Source/Allocators.h>
... | 1,119 | 386 |
#define CATCH_CONFIG_RUNNER
#include "catch/catch.hpp"
#include <QCoreApplication>
int main(int argc, char* argv[])
{
QCoreApplication a(argc, argv);
QCoreApplication::setOrganizationName("Brady Brenot");
QCoreApplication::setOrganizationDomain("bradybrenot.com");
QCoreApplication::setApplicationName("Huestacea... | 423 | 155 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "ActionParserRegistration.h"
#include "AdaptiveCardParseException.h"
#include "BaseElement.h"
#include "OpenUrlAction.h"
#include "ShowCardAction.h"
#include "SubmitAction.h"
#include "ToggleVisibi... | 4,461 | 1,146 |
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:06 PM
// Created by Sc2ad
// =========================================================================
#pragma once
#pragma pack(push, 8)
// Begin includes
#include "utils/typedefs.h"
// Including type: System.Object
#include "System/Object.hpp"
// Including type... | 2,957 | 1,112 |
/**
* @file
* Declares the Windows Desktop Management Information (DMI) fact resolver.
*/
#pragma once
#include "../resolvers/dmi_resolver.hpp"
#include <facter/util/windows/wmi.hpp>
#include <string>
#include <memory>
namespace facter { namespace facts { namespace windows {
/**
* Responsible for resolvi... | 1,069 | 324 |
// Concord
//
// Copyright (c) 2018-2020 VMware, Inc. All Rights Reserved.
//
// This product is licensed to you under the Apache 2.0 license (the "License").
// You may not use this product except in compliance with the Apache 2.0 License.
//
// This product may include a number of subcomponents with separate copyrigh... | 6,078 | 1,936 |
//===- include/pstore/http/http_date.hpp ------------------*- mode: C++ -*-===//
//* _ _ _ _ _ *
//* | |__ | |_| |_ _ __ __| | __ _| |_ ___ *
//* | '_ \| __| __| '_ \ / _` |/ _` | __/ _ \ *
//* | | | | |_| |_| |_) | | (_| | (_| | || __/ *
//* |_| |_|\__|\__| .__/ \__,_|\__,_|... | 1,251 | 432 |
//===- NpcompModule.cpp - MLIR Python bindings ----------------------------===//
//
// 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
//
//===---------------------------... | 2,379 | 852 |
#include "basis.hpp"
#include <cassert>
#include <memory>
Basis::Basis(Runtime& rt, std::vector<HighsInt> active,
std::vector<BasisStatus> lower, std::vector<HighsInt> inactive)
: runtime(rt),
buffer_column_aq(rt.instance.num_var),
buffer_row_ep(rt.instance.num_var) {
for (HighsInt i = ... | 7,446 | 2,817 |
// Copyright (C) 2002 Ronald Garcia
//
// Permission to copy, use, sell and distribute this software is granted
// provided this copyright notice appears in all copies.
// Permission to modify the code and to distribute modified code is granted
// provided this copyright notice appears in all copies, and a notice
// ... | 14,357 | 4,406 |