text string | size int64 | token_count int64 |
|---|---|---|
//===- LoopUtils.cpp ---- Misc utilities for loop transformation ----------===//
//
// 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
//
//===---------------------------... | 3,073 | 946 |
#include <boost/mpl/erase_key.hpp>
| 35 | 17 |
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free ... | 3,094 | 1,107 |
/* IsotopeData.cc ***********************************************-*-c++-*-
** **
** G A M M A **
** **
** IsotopeData ... | 10,704 | 3,116 |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "extern/beatsaber-hook/shared/utils/typedefs.h"
#include "extern/beatsaber-hook/shared/utils/byref.hpp"
// Including type: System.IntPtr
... | 21,305 | 6,905 |
#include "UIComponent.h"
#include "UIManager.h"
#include "UIScreen.h"
UIScreen::UIScreen(UIComponent* parent) : UIComponent(parent)
{
// Register this screen with the UIManager
}
UIScreen::~UIScreen(void)
{
}
void UIScreen::OnInit()
{
UIComponent::OnInit();
UIManager* manager = UIManager::GetInstance();... | 515 | 170 |
/**
* @file dp_handler.cpp
* @author Marijke Hengstmengel
*
* @copyright Copyright (c) Remedy IT Expertise BV
*/
#include "dp_handler.h"
#include "ccd_handler.h"
#include "add_handler.h"
#include "mdd_handler.h"
#include "idd_handler.h"
#include "id_handler.h"
#include "pl_handler.h"
#include "property_handle... | 4,562 | 1,380 |
#include "sp/sp.h"
#include "Input.h"
namespace sp {
InputManager* Input::s_InputManager = nullptr;
InputManager::InputManager()
{
ClearKeys();
ClearMouseButtons();
m_MouseGrabbed = true;
Input::s_InputManager = this;
}
void InputManager::Update()
{
for (int i = 0; i < MAX_BUTTONS; i++)
m_Mouse... | 1,574 | 696 |
struct FDSDrive {
auto clock() -> void;
auto change() -> void;
auto powerup() -> void;
auto rewind() -> void;
auto advance() -> void;
auto crc(uint8 data) -> void;
auto read() -> void;
auto write() -> void;
auto read(uint16 address, uint8 data) -> uint8;
auto write(uint16 address, uint8 data) -> voi... | 734 | 270 |
#ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#include <iostream>
using std::endl;
#include "BRMeshRefine.H"
#include "Loa... | 12,441 | 4,980 |
#include "schoolMember.h"
SchoolMember::SchoolMember(unsigned short id, std::string name, std::string currentCourse)
: id_(id),
name_(name),
currentCourse_(currentCourse)
{}
SchoolMember::~SchoolMember()
{}
unsigned short SchoolMember::getId() const
{
return this->id_;
}
std::string SchoolMember::getName() co... | 434 | 146 |
#include "nau/render/opengl/glMaterialGroup.h"
#include "nau/render/opengl/glIndexArray.h"
#include "nau/render/opengl/glVertexArray.h"
#include <glbinding/gl/gl.h>
using namespace gl;
//#include <GL/glew.h>
using namespace nau::render::opengl;
GLMaterialGroup::GLMaterialGroup(IRenderable *parent, std::string mate... | 1,354 | 564 |
#include "headers/Game.hpp"
#include <stdlib.h>
#include <algorithm>
#include <list>
#include <iostream>
#include <string>
#include <sstream>
namespace engine {
Game* Game::gGame = NULL;
engine::Level* Game::gLevel = NULL;
engine::GameObjectList Game::gObjects = engine::GameObjectList();
sf::Clock Game::gFram... | 10,580 | 3,596 |
#include "strings.h"
std::vector<std::string> Strings::registry_;
const char* Strings::Add(const char* str) { return Add(str, strlen(str)); }
const char* Strings::Add(const char* str, size_t length) {
for (auto& s : registry_) {
if (s.length() == length) {
if (memcmp(s.c_str(), str, length) == 0) {
... | 466 | 176 |
#include <precompiled.h>
///
/// MIT License
/// Copyright (c) 2018-2019 Jongmin Yun
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL... | 1,939 | 804 |
//
// MainPage.xaml.cpp
// Implementation of the MainPage class.
//
#include "pch.h"
#include "MainPage.xaml.h"
using namespace PrintableTomKitten;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Graphics::Printing... | 8,305 | 2,398 |
/////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003-2017 by The University of Queensland //
// Centre for Geoscience Computing //
// http://earth.uq.edu.au/centre-geoscience-computing //
// ... | 3,886 | 1,517 |
// Copyright (C) 2019 The Regents of the University of California (Regents).
// 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... | 12,124 | 4,220 |
#include <clrefl/Generator.h>
#include <clrefl/Codegen.h>
#include <infra/ToString.h>
#include <stl/vector.hpp>
#include <stl/unordered_map.hpp>
#include <stl/unordered_set.hpp>
#include <json11.hpp>
#include <cctype>
#define RESOLVE_TEMPLATES 1
#define DEBUG_CLANG_ARGS 0
namespace two
{
using Json = json11::Jso... | 30,183 | 12,936 |
#ifndef IBMTIMEPREDICATE_H
#define IBMTIMEPREDICATE_H
#include "AbstractPredicate.hpp"
#include <set>
namespace splitter
{
class IBMtimePredicate : public AbstractPredicate
{
public:
IBMtimePredicate(unsigned long time);
virtual bool ps(const events::AbstractEvent &event) const;
virtual bool pc(const ev... | 530 | 165 |
#pragma once
#include "create_triangle.hpp"
#include "create_vertex.hpp"
#include "geometry.hpp"
#include "inner_triangle_edges.hpp"
#include "insert_vertex.hpp"
#include "lawson_algorithm.hpp"
#include "mesh.hpp"
#include "random_triangle_edge.hpp"
#include "topology.hpp"
#include "triangle.hpp"
#include "triangles.h... | 397 | 145 |
// System.Reflection.Emit.ConstructorBuilder.SetSymCustomAttribute()
/* The following program demonstrates the 'SetSymCustomAttribute' method
of ConstructorBuilder class. It creates an assembly in the current
domain with dynamic module in the assembly. Constructor builder is
used in conjunction with the 'TypeBui... | 4,348 | 1,213 |
#include <s2e/S2E.h>
#include "Kasan.h"
#include "util.h"
using namespace klee;
namespace s2e {
namespace plugins {
// #define DEBUG_KASAN
S2E_DEFINE_PLUGIN(KernelAddressSanitizer, "kernel address sanitizer",
"KernelAddressSanitizer", "KernelFunctionModels",
"AllocManager", "Opt... | 25,382 | 8,372 |
/******************************Module*Header*******************************\
* Module Name: brushobj.cxx
*
* Support for brmemobj.hxx and brushobj.hxx.
*
* Created: 06-Dec-1990 12:02:24
* Author: Walt Moore [waltm]
*
* Copyright (c) 1990-1999 Microsoft Corporation
\*********************************************... | 96,209 | 29,723 |
/*
* @doc INTERNAL
*
* @module OLSOLE.CPP -- OlsOle LineServices object class
*
* Author:
* Murray Sargent (with lots of help from RickSa's ols code)
*
* Copyright (c) 1997-1998 Microsoft Corporation. All rights reserved.
*/
#include "_common.h"
#include "_font.h"
#include "_edit.h"
#include "... | 9,994 | 4,888 |
#include "CtrlCore.h"
NAMESPACE_UPP
#ifdef flagSO
CtrlFrame::CtrlFrame() {}
CtrlFrame::~CtrlFrame() {}
#endif
void CtrlFrame::FramePaint(Draw& draw, const Rect& r) {}
void CtrlFrame::FrameAdd(Ctrl& ctrl) {}
void CtrlFrame::FrameRemove() {}
int CtrlFrame::OverPaint() const { return 0; }
void NullFrameClass::FrameLay... | 5,031 | 1,926 |
/******************************************************************************
*
* Copyright 2018 Xaptum, 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
*
* htt... | 4,483 | 1,326 |
#include "asd.KeyframeAnimation_Imp.h"
#include <cmath>
namespace asd
{
KeyframeAnimation_Imp::KeyframeAnimation_Imp()
: m_targetType(AnimationCurveTargetType::NoneTarget)
, m_targetAxis(AnimationCurveTargetAxis::NoneTarget)
{
}
KeyframeAnimation_Imp::~KeyframeAnimation_Imp()
{
}
const achar* Keyfr... | 1,032 | 397 |
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2022 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except... | 17,635 | 5,524 |
// Copyright 2015 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 "chrome/browser/android/data_usage/data_use_ui_tab_model.h"
#include <stddef.h>
#include <stdint.h>
#include "base/macros.h"
#include "base/run... | 18,471 | 6,576 |
#include <example/lib/c.hpp>
int main() {
c();
}
| 51 | 25 |
// Copyright 2013, James Mitchell, All rights reserved.
#pragma once
#include "typetraits/EnableIf.hpp"
#include "typetraits/CallTraits.hpp"
#include "typetraits/HasOstreamOut.hpp"
#include "typetraits/HasMemberFunction.hpp"
#include "typetraits/IsArithmetic.hpp"
#include "typetraits/IsPointer.hpp"
#include "typetrai... | 356 | 137 |
#include "../../std_lib_facilities.h"
int square(int x)
{
return x * x;
}
int main(void)
{
//constexpr int first {1000};
//constexpr int second {1000000};
constexpr int third {1000000000};
bool is_overflow{false};
for (int i{0}, temp{0}; is_overflow || temp < third; ++i)
{
temp =... | 383 | 155 |
#include <ngp/ngp.hpp>
namespace ares::NeoGeoPocket {
auto enumerate() -> vector<string> {
return {
"[SNK] Neo Geo Pocket",
"[SNK] Neo Geo Pocket Color",
};
}
auto load(Node::System& node, string name) -> bool {
if(!enumerate().find(name)) return false;
return system.load(node, name);
}
Scheduler sc... | 2,372 | 886 |
#include <cstdlib>
#include <string>
// Implementation of the DJB hash
uint64_t djb(const std::string& str)
{
uint64_t hash = 5381;
// mix in each octet
for (auto oct : str)
{
hash += hash << 5;
hash += oct;
}
return hash;
}
| 238 | 107 |
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
int sum = 0;
void *summer(void *); //function to run inside thread
int main(int argc, char *argv[])
{
pthread_t tid;
pthread_attr_t attr;
if (argc != 2) // if 2 arguments are not pas... | 1,058 | 352 |
#include<iostream>
using namespace std;
int main(){
unsigned long a,b,c;
cin>>a>>b>>c;
while(a != 0, b != 0, c != 0){
if(c-b == b-a){
cout<<"AP "<< c + c - b<<endl;
}
else{
cout<<"GP "<< c * (c/b) <<endl;
}
cin>>a>>b>>c;
}
return 0;
}
| 259 | 144 |
// @doc
#include "PyWinTypes.h"
#include "PyWinObjects.h"
#include "malloc.h"
#include "Userenv.h"
#define CHECK_PFN(fname) \
if (pfn##fname == NULL) \
return PyErr_Format(PyExc_NotImplementedError, "%s is not available on this platform", #fname);
typedef BOOL(WINAPI *DeleteProfilefunc)(WCHAR *, WCHAR... | 23,451 | 7,252 |
/* The key of each element is the array index of the element.
* Time: O(log N)
* Memory: O(N)
*/
#include <bits/stdc++.h>
using namespace std;
struct Splay {
struct Node {
int val, sz;
Node *child[2], *par;
Node() {}
Node(int val, int sz = 1) : val(val), sz(sz) {
child[0] = child[1] = par ... | 3,657 | 1,455 |
#include <iostream>
using namespace std;
int main()
{
int k, l, m, n, d;
cin >> k >> l >> m >> n >> d;
// kth got punched in the face with frying pan
// lth got shut in the balcony door
// mmeth got his paws trampled
// nth to call her mom
int count = d;
if (l == 1 || k == 1 || m == ... | 694 | 251 |
// ----------------- BEGIN LICENSE BLOCK ---------------------------------
//
// Copyright (C) 2018-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
//
// ----------------- END LICENSE BLOCK -----------------------------------
#include <ad/map/access/Factory.hpp>
#include <ad/map/access/Operation.hpp>
#includ... | 3,140 | 1,179 |
#include "logger.hpp"
using namespace VictoryConnect;
| 54 | 16 |
#include <QApplication>
#include <QMainWindow>
#include <QGridLayout>
#include <QPushButton>
#include <QMouseEvent>
#include <QPainter>
#include <QTimer>
#include "kgd/external/cxxopts.hpp"
#include "kgd/utils/indentingostream.h"
#include "minicgp.h"
DEFINE_NAMESPACE_PRETTY_ENUMERATION(watchmaker, VideoInputs, X, Y... | 5,653 | 2,193 |
#include <dqcsim>
#include <memory>
#include <vector>
#include <xpu.h>
#include <xpu/runtime>
#include <qx_representation.h>
#include "json.hpp"
#include "bimap.hpp"
// Alias the dqcsim::wrap namespace to something shorter.
namespace dqcs = dqcsim::wrap;
/**
* Function pointer type for constructing/binding QX gates.... | 15,723 | 5,920 |
// $Id: OccupancyOcTreeBase.hxx 440 2012-11-02 10:41:10Z ahornung $
/**
* OctoMap:
* A probabilistic, flexible, and compact 3D mapping library for robotic systems.
* @author K. M. Wurm, A. Hornung, University of Freiburg, Copyright (C) 2009.
* @see http://octomap.sourceforge.net/
* License: New BSD License
*/
/... | 34,351 | 12,030 |
/**
* Copyright (C) 2021 FISCO BCOS.
* 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.apache.org/licenses/LICENSE-2.0
*
* Un... | 7,943 | 2,886 |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
for(int i = 1; i <= T; i++) {
int r1, r2, c1, c2;
cin >> r1 >> c1 >> r2 >> c2;
if((r1 & 1) == (r2 & 1)) {
if((c1 & 1) != (c2 & 1)) {
printf("Case %d: impossible\n", i);
... | 683 | 256 |
// Copyright 2019 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... | 8,583 | 3,137 |
#include <BlackBox/Renderer/Quad.hpp>
#include <BlackBox/Renderer/IGeometry.hpp>
#include <BlackBox/Renderer/OpenGL/Debug.hpp>
Quad::Quad()
{
float verts[] = {
// positions // texCoords
-1.0f, 1.0f, 0.0f, 1.0f,
-1.0f, -1.0f, 0.0f, 0.0f,
1.0f, -1.0f, 1.0f, 0.0f,
-1.0f, 1.... | 1,187 | 571 |
#include "error_code.h"
#include "tapplication.h"
#include <iostream>
using namespace std;
int main()
{
int ret = 0;
TApplication app;
return app.Run();
} | 168 | 61 |
/*!
* Copyright (c) 2015 by Contributors
* \file ctc_loss.cc
* \brief
* \author Sebastian Bodenstein
*/
#include "./ctc_loss-inl.h"
#include "./ctc_include/detail/cpu_ctc.h"
namespace mshadow {
template <typename DType>
ctcStatus_t compute_ctc_cost(const Tensor<cpu, 3, DType> activations,
... | 3,199 | 1,062 |
// 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)
//
// This file provides the particle number doma... | 1,388 | 535 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome_frame/simple_resource_loader.h"
#include <atlbase.h>
#include <algorithm>
#include "base/base_paths.h"
#include "base/file_path.h"... | 8,763 | 2,821 |
/*
Copyright (C) 2016 Quaternion Risk Management Ltd
All rights reserved.
This file is part of ORE, a free-software/open-source library
for transparent pricing and risk analysis - http://opensourcerisk.org
ORE is free software: you can redistribute it and/or modify it
under the terms of the Modified BSD License... | 5,655 | 1,754 |
#pragma once
#include <voxel/structure.hpp>
#include <mutex>
#include <thread>
namespace VOXEL_NAMESPACE
{
template<class T = Sector>
class AsyncStructure : public Structure<T>
{
protected:
bool isRunning;
std::mutex updateMutex;
std::thread updateThread;
inline void update(const Registry& registry)
{
... | 1,863 | 751 |
//
// Created by yangtao on 20-5-29.
//
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
struct Node {
Node *left, *right;
int no;
};
map<int, Node*> s;
int n,m;
Node *h , *p;
int main() {
cin >> n;
h = new Node;
Node *t = new Node;
... | 1,316 | 509 |
/**
* Copyright (c) 2018 Cornell University.
*
* Author: Ted Yin <tederminant@gmail.com>
*
* 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 limita... | 5,453 | 1,806 |
//=========================================================================
// Copyright (C) 2018 The C++ Component Model(CCM) 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 Lic... | 2,902 | 923 |
#include "coefficients.hpp"
#include "bias.hpp"
#include <cstddef>
enum direction
{
DOWN,
UP,
UNKNOWN
};
std::tuple<uint64_t, std::array<uint32_t, 3>, counters>
coefficient_search(const eval_t<uint64_t, const std::array<uint32_t, 3> &> &eval,
const std::array<bool, 3> &negated,
... | 1,595 | 579 |
#include "Aphelion/Renderer/Renderer.h"
#include <glm/gtc/type_ptr.hpp>
#include "Aphelion/Renderer/RenderCommand.h"
#include "Aphelion/Renderer/Renderer2D.h"
namespace ap {
struct RendererData {
// PerspectiveCamera camera;
glm::mat4 view;
glm::mat4 projection;
};
static RendererData data;
void Renderer::In... | 1,197 | 401 |
/******************************************************************************/
/* Mednafen NEC PC-FX Emulation Module */
/******************************************************************************/
/* mouse.cpp:
** Copyright (C) 2007-2016 Mednafen Team
**
** This program is... | 1,937 | 704 |
#include "xbt/xcc_z.h"
#include <cstdio>
#include <string.h>
#include <zlib.h>
#include "stream_int.h"
shared_data xcc_z::gunzip(data_ref s)
{
if (s.size() < 18)
return shared_data();
shared_data d(read_int_le(4, s.end() - 4));
z_stream stream;
stream.zalloc = NULL;
stream.zfree = NULL;
stream.opaque = NULL;
... | 1,646 | 823 |
// Created on: 1994-08-26
// Created by: Frederic MAUPAS
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... | 1,724 | 635 |
//
// This file is part of the aMule Project.
//
// Copyright (c) 2004-2011 Angel Vidal ( kry@amule.org )
// Copyright (c) 2004-2011 aMule Team ( admin@amule.org / http://www.amule.org )
// Copyright (c) 2003-2011 Barry Dunne (http://www.emule-project.net)
//
// Any parts of this program derived from the xMule, lMule o... | 31,390 | 13,988 |
#include <bits/stdc++.h>
#ifdef LOCAL
#include "code/formatting.hpp"
#else
#define debug(...) (void)0
#endif
using namespace std;
template <typename Node>
struct segtree {
vector<Node> node;
vector<array<int, 2>> range;
vector<int> where;
segtree() = default;
segtree(int L, int R, Node init) { as... | 6,197 | 2,327 |
#include<iostream>
#include<cmath>
using namespace std;
//avoids the space complexity of O(n) by directly extracting the digits from the input.
bool IsPalindromeNumber(int x) {
if (x <= 0) {
return x == 0;
}
const int num_digits = static_cast<int>(floor(log10(x))) + 1;
int msd_mask = static_cast<int>(po... | 808 | 320 |
/* Copyright 2001, 2019 IBM Corporation
*
* 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 notice, this list of conditions and the
* following d... | 8,407 | 3,290 |
// 2021.01.22 - Copyright Victor Dods - Licensed under Apache 2.0
#pragma once
#include "lvd/read_bin_type.hpp"
#include "lvd/sst/SV_t.hpp"
namespace lvd {
template <typename S_, typename C_, auto... Params_>
struct ReadInPlace_t<sst::SV_t<S_,C_>,BinEncoding_t<Params_...>> {
template <typename CharT_, typename ... | 2,032 | 726 |
// 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.
// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
#include "config.h"
#include "V8RsaKeyAlgorithm.h"
#include "bindings/v8/Ex... | 7,254 | 2,434 |
#include <gtest/gtest.h>
#include <fastad_bits/util/value.hpp>
namespace ad {
namespace util {
struct value_fixture : ::testing::Test
{
protected:
};
TEST_F(value_fixture, ones_scl)
{
double x = 0.;
ones(x);
EXPECT_DOUBLE_EQ(x, 1.);
}
} // namespace util
} // namespace ad
| 289 | 119 |
/*
* Copyright 2019 pixiv Inc. All Rights Reserved.
*
* Use of this source code is governed by a license that can be
* found in the LICENSE.pixiv file in the root of the source tree.
*/
#include "api/create_peerconnection_factory.h"
#include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs... | 1,562 | 522 |
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX ... | 65,787 | 20,266 |
#include <cmath>
#include "src/core/hpcp.h"
#include "src/core/test/gtest_extras.h"
using namespace musher::core;
/**
* @brief Test Zero inputs
*
*/
TEST(HPCP, TestZeros) {
std::vector<double> actual_hpcp;
std::vector<double> frequencies(10);
std::vector<double> magnitudes(10);
actual_hpcp = HPCP(frequenc... | 6,453 | 2,592 |
#include "Util/FFT.h"
size_t FFT::getGoodSize(size_t size)
{
//check if size is a power of 2
size_t mod = size % 2;
if(mod == 0) return size;
//get the next bigger power of 2
size_t potens = 0;
while(size > 0)
{
size = size/2;
potens++;
}
return pow(2,potens);
}
Tensorcd FFT::reverseOrder(const Tensorc... | 3,829 | 1,807 |
#include <cstring>
#include "html/Extensions.h"
using namespace std;
using namespace htmlcxx;
Extensions::Extensions(const string &exts)
{
const char *begin = exts.c_str();
while (*begin)
{
while (*begin == ' ') ++begin;
if (*begin == 0) break;
const char *end = begin + 1;... | 849 | 290 |
// -*- C++ -*-
//
// Package: HGCalGeometry
// Class: HGCalGeometryESProducer
//
/**\class HGCalGeometryESProducer HGCalGeometryESProducer.h
Description: <one line class summary>
Implementation:
<Notes on implementation>
*/
//
// Original Author: Sunanda Banerjee
//
//
// system include files
#inc... | 2,175 | 785 |
/**
* Copyright (c) 2017-present, 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 "logdevice/common/StatsCollectionThread.h"
#include <folly/Optional.h>
#incl... | 3,682 | 1,129 |
//===- VectorToLLVM.cpp - Conversion from Vector to the LLVM dialect ------===//
//
// Copyright 2019 The MLIR 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.... | 11,892 | 3,666 |
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int length, width, height;
double percent;
cin >> length >> width >> height >> percent;
int volume = length * width * height;
double liters = volume * 0.001;
percent = percent * 0.01;
double realLeaters = liters * (1-p... | 430 | 146 |
#include <catch2/catch.hpp>
#include <nlohmann/json.hpp>
#include <nw/kernel/Kernel.hpp>
#include <nw/objects/Door.hpp>
#include <nw/serialization/Archives.hpp>
#include <filesystem>
#include <fstream>
namespace fs = std::filesystem;
TEST_CASE("door: from_gff", "[objects]")
{
auto door = nw::kernel::objects().l... | 2,594 | 1,061 |
/* $Id$
*
* Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
*
* This file is part of OpenCAMlib.
*
* OpenCAMlib 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... | 3,265 | 1,030 |
/*
* Copyright (c) 2021 Huawei Device 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 ... | 20,479 | 6,652 |
#ifndef LIBCAER_NETWORK_HPP_
#define LIBCAER_NETWORK_HPP_
#include "libcaer.hpp"
#include <libcaer/network.h>
namespace libcaer {
namespace network {
class AEDAT3NetworkHeader : private aedat3_network_header {
public:
AEDAT3NetworkHeader() {
magicNumber = AEDAT3_NETWORK_MAGIC_NUMBER;
sequenceNumber = 0;
ve... | 1,533 | 589 |
#include <libcryptosec/certificate/Certificate.h>
Certificate::Certificate(X509 *cert)
{
this->cert = cert;
}
Certificate::Certificate(std::string pemEncoded)
throw (EncodeException)
{
BIO *buffer;
buffer = BIO_new(BIO_s_mem());
if (buffer == NULL)
{
throw EncodeException(EncodeException::BUFFER_CREATING, "C... | 18,190 | 7,371 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/crt/Api.h>
#include <aws/crt/Optional.h>
#include <aws/testing/aws_test_harness.h>
const char *s_test_str = "This is a string, that should be long enough to avoid small string optimizatio... | 4,749 | 1,710 |
/*
Maximum Sum Circular Subarray
Given a circular array C of integers represented by A, find the maximum possible sum of a non-empty subarray of C.
Here, a circular array means the end of the array connects to the beginning of the array. (Formally, C[i] = A[i] when 0 <= i < A.length, and C[i+A.length] = C[i] when i >... | 2,156 | 795 |
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2015 Intel Corporation. All Rights Reserved.
#include "../include/librealsense2/rs.hpp"
#include "../include/librealsense2/rsutil.h"
#include "core/video.h"
#include "align.h"
#include "archive.h"
#include "context.h"
#include "environment.h"... | 27,488 | 8,243 |
#include "MapControlBaseTpl.hpp"
| 34 | 14 |
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <queue>
using namespace std;
int x,y,fx[10][3],dis[105][105];
struct Point
{
int x,y;
};
void bfs()
{
memset(dis,-1,sizeof(dis));
dis[x][y]=0;
fx[1][1]=fx[2][1]=1,fx[3][1]=fx[4][1]=-1,fx[5][1]=fx[6][1]=2,fx[7][... | 1,158 | 701 |
class Solution {
public:
int XXX(int x) {
long long int ans = x;
long long int square= 0;
while(ans){
long long int temp = ans/2;
square= temp*temp;
ans = temp;
if(square<= x){
break;
}
}
while(square... | 417 | 121 |
/**
** Isaac Genome Alignment Software
** Copyright (c) 2010-2017 Illumina, Inc.
** All rights reserved.
**
** This software is provided under the terms and conditions of the
** GNU GENERAL PUBLIC LICENSE Version 3
**
** You should have received a copy of the GNU GENERAL PUBLIC LICENSE Version 3
** along with ... | 3,138 | 982 |
#include "PaintField.h"
#include <QPainter>
//We need to register this Type in MTQ
MTQ_QML_REGISTER_PLUGIN(PaintField)
//Constructor
PaintField::PaintField(QQuickItem *)
{
setHeight(600);
setWidth(600);
setStrokeHue(0);
setBackgroundBrightness(255);
}
void PaintField::paint(QPainter *painter)
{
painter->setRen... | 1,753 | 763 |
// Copyright (C) 2004 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library 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, or (at your option)
// an... | 2,747 | 1,027 |
#include "Experiment/Experiment.hh"
/*******************************************************************************
* Project: BaBar detector at the SLAC PEP-II B-factory
* Package: EvtGenBase
* File: $Id: EvtPropBreitWigner.cc 427 2010-01-14 13:25:53Z stroili $
* Author: Alexei Dvoretskii, dvoretsk@slac.stanf... | 1,101 | 453 |
class Solution {
public:
bool searchMatrix(vector<vector<int> > &matrix, int target) {
int posx = 0, posy = 0;
int n = matrix.size();
int m = matrix[0].size();
do {
if (matrix[posx][posy] == target) return true;
if (posx + 1 < n && matrix[posx+1][pos... | 439 | 148 |
/*############################################################################
# Copyright Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
#pragma once
#include <algorithm>
#include <iostream>
#include <utility>
#include <tuple... | 32,319 | 10,631 |
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int g[20][20];
// once you feel prob is high, random.
void solve() {
int n,m;
cin >> n >> m;
const int TRY = 100*(n+m);
const int JUMP = 25;
for (int _ = 0; _ < TRY; _++) {
... | 1,827 | 707 |
/**
\file mpi_mesh_grdecl.cpp
\brief This file implement class for decompose main mesh among processes
\author Iskhakov Ruslan
\date 2008-10-14*/
#include "mpi_mesh_grdecl.h"
#ifdef _MPI_MY
namespace blue_sky
{
//! default constructor
mpi_mesh_grdecl::mpi_mesh_grdecl(bs_type_ctor_param)
{
}
mpi_... | 9,678 | 3,992 |
#pragma once
#include "i-game-state.hpp"
class Game; // Forward declaration
class CinematicState : public IGameState {
public:
CinematicState(Game& game);
virtual ~CinematicState();
void enter() override;
void update(float deltatime) override;
void exit() override;
};
| 278 | 91 |
#include "ShadingOperation.h"
extern "C" {
#include <math.h>
}
#include "Graphics.h"
#include "Textures.h"
#include "Light.h"
#include "FrameBuffer.h"
namespace GraphicsEngine
{
void ShadingOperation::Initialize()
{
auto shadowCamera = Engine::Create<Camera>();
auto shadowScene = Engine::Create<Scene>();
sh... | 15,127 | 5,948 |