text string | size int64 | token_count int64 |
|---|---|---|
#include "UIManager.h"
namespace Trixs
{
UIManager::UIManager(Window* window)
{
}
UIManager::~UIManager()
{
}
} | 123 | 57 |
// Copyright (c) 2019 PaddlePaddle 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... | 6,995 | 2,843 |
#include <iostream>
#include <string>
#include <cctype>
#include <cmath>
using namespace std;
int x = 1,y=1;
int h[31]= {
1,1,1,1,1,1,
2,2,2,2,2,2,
3,3,3,3,3,3,
4,4,4,4,4,4,
5,5,5,5,5,5};
int v[31]= {
1,2,3,4,5,6,
1,2,3,4,5,6,
1,2,3,4,5,6,
1,2,3,4,5,6,
1,2,3,4,5,6};
int getPos(char c)
{
... | 799 | 468 |
#include <assert.h>
#include <vector>
using namespace std;
class Solution
{
public:
// 先排序,再依次遍历数组元素,若当前元素小于等于它前一个元素,则将其变为前一个数+1。
int minIncrementForUnique(vector<int> &A)
{
int ans = 0;
int len = A.size();
sort(A.begin(), A.end());
for (int i = 1; i < len; ++i)
{
... | 789 | 358 |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2006 Ferdinando Ametrano
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it... | 3,292 | 946 |
/**************************************************************************************[IntTypes.h]
Copyright (c) 2009-2010, Niklas Sorensson
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 withou... | 183,030 | 60,666 |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
void solve() {
string s;
cin >> s;
int n = s.length();
int rep = 0;
int cnt = 1;
for (int i = 1; i < n ; i++) {
if (s[i] == s[i - 1]) {
cnt++;
}
else {
rep = max(rep, cnt);
cnt = 1;
}
}
cout << max... | 383 | 173 |
#ifndef FALCON_LITERAL_UTILITY_HPP
#define FALCON_LITERAL_UTILITY_HPP
#include <falcon/literal/detail/literal_support.hpp>
#include <type_traits>
#include <limits>
#include <falcon/type_traits/eval_if.hpp>
#include <falcon/type_traits/use.hpp>
namespace falcon {
namespace literal {
template<typename _CharT, _CharT ... | 5,069 | 1,939 |
/******************************************************************************/
/* Mednafen - Multi-system Emulator */
/******************************************************************************/
/* Joystick_XInput.cpp:
** Copyright (C) 2012-2018 Mednafen Team
**
** This ... | 7,783 | 3,120 |
// SPDX-FileCopyrightText: 2014 Erik Garrison
//
// SPDX-License-Identifier: MIT
#include "aligner.hpp"
#include "hash_map.hpp"
//#define debug_print_score_matrices
using namespace vg;
using namespace std;
using namespace vg::io;
static const double quality_scale_factor = 10.0 / log(10.0);
static const double exp_... | 107,053 | 31,252 |
#include <memory>
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interfac... | 8,573 | 3,383 |
/*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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
... | 5,703 | 1,974 |
#include "GenericPagingTable.h"
#include "MemoryManager.h"
namespace kernel {
#ifdef ULTRA_64
Address GenericPagingTable::accessible_address_of(size_t index)
{
return MemoryManager::physical_memory_base + entry_at(index).physical_address();
}
#endif
}
| 258 | 90 |
// Copyright 2021 The Abseil 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 agree... | 9,280 | 3,463 |
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// 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://... | 4,020 | 1,654 |
// Copyright 2016 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 is auto-generated from
// ui/gl/generate_bindings.py
// It's formatted by clang-format using chromium coding style:
// clang-format -i -... | 52,948 | 17,060 |
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
// GraphControl.cpp : implementation file
//
#include "stdafx.h"
#include "vmpi_browser_job_watch.h"
#include "GraphCont... | 5,868 | 2,472 |
#include "testing/testing.hpp"
#include "coding/string_utf8_multilang.hpp"
#include "coding/transliteration.hpp"
#include "platform/platform.hpp"
namespace
{
void TestTransliteration(Transliteration const & translit, std::string const & locale,
std::string const & original, std::string const... | 2,125 | 815 |
// Copyright (c) 2020 PaddlePaddle 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... | 2,851 | 927 |
// PX2Event.cpp
#include "PX2Event.hpp"
#include "PX2Assert.hpp"
using namespace PX2;
Event::Event ()
:
mEventType(0),
mSender(0),
mReceiver(0),
mDelayTime(0.0f),
mDelayTiming(0.0f),
mIsDoDelay(false)
{
mEventChannel.FillUserChannel();
}
//----------------------------------------------------------------------------
... | 3,248 | 828 |
/* lorina: C++ parsing library
* Copyright (C) 2018-2021 EPFL
*
* 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,
... | 8,506 | 2,931 |
#include <cstdio>
class FindUnion
{
private:
int rank;
FindUnion *parent;
public:
static void MakeSet(FindUnion &x)
{
x.parent = &x;
x.rank = 0;
}
static void Union(FindUnion &x, FindUnion &y)
{
FindUnion *xRoot = FindU... | 1,635 | 548 |
#include"CountingSorts.h"
#include<string>
#include<vector>
#include<iostream>
#include<fstream>
#include<ctime>
#include<cstdlib>
using namespace std;
void ResizeIntVector(vector<int>& S, const int size) {
//while the vector is not the correct size
while (S.size() != size)
//pop elements if it is too big, or push... | 1,100 | 477 |
//
// LogLights.hpp
// FilamentViewer
//
// Created by James Walker on 5/27/21.
//
#ifndef LogLights_hpp
#define LogLights_hpp
namespace filament
{
class Engine;
class Scene;
};
/*!
@function LogLights
@abstract Log various information about lights in a Scene to std::cout.
@param inEngine An engine.
@p... | 447 | 175 |
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <afxres.h>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
#include <map>
#include <vector>
#include <string>
//#include <Crispen.h>
// #include <sqlite3.h/sqlite3>
#include <utility>
#define TRUE "true"
#def... | 1,204 | 475 |
#include <iostream>
#include <vector>
using namespace std;
int calc_sum(vector<int> numbers) {
int ans = 0;
for(int i = 1; i <= numbers.size(); i++) ans += i * numbers.at(i-1);
return ans;
}
int main() {
int n, number, pos;
cin >> n;
vector<pair<int, int>> numbers;
for(int i = 0; i < n; ... | 599 | 237 |
#pragma once
#include <cstdlib>
namespace Legolas{
class VirtualVector {
public:
// virtual int getSize( void ) const = 0 ;
typedef std::size_t SizeType;
virtual SizeType size( void ) const = 0 ;
virtual const VirtualVector & getElement( SizeType i ) const = 0 ;
virtual VirtualVector & g... | 1,451 | 431 |
/*
The MIT License (MIT)
Copyright (c) 2014 CantTouchDis <bauschp@informatik.uni-freiburg.de>
Copyright (c) 2014 brio1009 <christoph1009@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... | 3,363 | 1,236 |
#include <sstream>
#include <stdint.h>
#include <iostream>
#include <iomanip>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
#include "rapidxml-1.13/rapidxml.hpp"
#include "rapidxml-1.13/rapidxml_print.hpp"
#include "xml_format.h"
#define XML_TRUE_STRING "true"
#define XML_FALSE_... | 8,311 | 2,740 |
#include<iostream>
using namespace std;
int main()
{
int n , x;
cout <<"Enter the number : \n";
cin>>n;
if(n<2)
cout<<"Number is lesser than 2 and not applicable";
else
{
for(x=2;x<n;x++)
{
if(n%x==0)
{
cout<<"Not Prime Number";
exit(0);
}
else
{
cout<<"Prime... | 364 | 186 |
// Generated from /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/rt.jar
#include <java/lang/reflect/Array_.hpp>
extern void unimplemented_(const char16_t* name);
java::lang::Object* java::lang::reflect::Array_::get(::java::lang::Object* array, int32_t index)
{ /* native */
clinit();
... | 5,207 | 1,920 |
#include "Aspen/Python/Concat.hpp"
#include "Aspen/Python/Box.hpp"
using namespace Aspen;
using namespace pybind11;
void Aspen::export_concat(pybind11::module& module) {
export_box<SharedBox<object>>(module, "Box");
export_concat<SharedBox<SharedBox<object>>>(module, "");
module.def("concat",
[] (SharedBox<... | 415 | 145 |
<?hh // strict
namespace Zynga\Framework\Lockable\Cache\V1\Config\Mock\PgData;
use Zynga\Framework\Testing\TestCase\V2\Base as TestCase;
use
Zynga\Framework\Lockable\Cache\V1\Config\Mock\PgData\Dev as ConfigUnderTest
;
use
Zynga\Framework\Cache\V2\Interfaces\DriverInterface as CacheDriverInterface
;
class DevT... | 628 | 220 |
// ILikeBanas
#include "FactorySkyline/UI/FSKeyMappingWidget.h"
#include "Components/Image.h"
#include "Components/HorizontalBox.h"
#include "Components/TextBlock.h"
#include "Components/CanvasPanel.h"
#include "Components/CanvasPanelSlot.h"
#include "Components/HorizontalBoxSlot.h"
UFSKeyMappingWidget:... | 1,055 | 363 |
// Copyright 2022 Burdukov Mikhail
#include <gtest/gtest.h>
#include "include/horse_min_range.h"
TEST(minHorseRange, Create) {
ASSERT_NO_THROW(minHorseRange hourse);
}
TEST(minHorseRange, Range_without_barriers) {
chess_position_t st('a', 1);
chess_position_t fin('b', 3);
minHorseRange a(st, fin);
... | 1,781 | 785 |
//
// BGLAffine.cc
// Part of the Belfry Geometry Library
//
// Created by GM on 10/13/10.
// Copyright 2010 Belfry Software. All rights reserved.
//
#include "config.h"
#include "BGLAffine.hh"
namespace BGL {
Affine Affine::translationAffine(double dx, double dy)
{
return Affine(1.0, 0.0, 0.0, 1.0, dx, dy)... | 1,860 | 797 |
#include <stdio.h>
int main(){
int n, t ;
int cont = 0;
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%d", &t);
if(t != 1){
cont++;
}
}
printf("%d\n", cont);
return 0;
}
| 244 | 105 |
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:39 PM
// Created by Sc2ad
// =========================================================================
#pragma once
#pragma pack(push, 8)
// Begin includes
// Including type: System.Enum
#include "System/Enum.hpp"
// Including type: UnityEngine.RemoteConfigSettin... | 6,426 | 1,668 |
/**********************************************************************
opconfab.cpp - Confab, the conformer generator described in
Journal of Cheminformatics, 3, 1, 8
http://www.jcheminf.com/content/3/1/8
Copyright (C) 2013 by Noel O'Boyle
This file is part of the Open Babel project.
Fo... | 5,585 | 1,893 |
#include "gtest/gtest.h"
#include "commonfixture.h"
extern "C" {
#include <launchdarkly/api.h>
#include "lru.h"
#include "utility.h"
}
// Inherit from the CommonFixture to give a reasonable name for the test output.
// Any custom setup and teardown would happen in this derived class.
class LRUFixture : public Common... | 1,763 | 821 |
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cassert>
using namespace std;
const int kNmax = 50005;
const int inf = 999999;
class Task {
public:
void solve() {
read_input();
print_output(get_result());
}
private:
int n;
int m;
int source;
vector<pair<int, int> > ad... | 2,016 | 940 |
/*++
Copyright (c) 2013 Microsoft Corporation
Module Name:
dl_mk_quantifier_abstraction.cpp
Abstract:
Create quantified Horn clauses from benchmarks with arrays.
Author:
Ken McMillan
Andrey Rybalchenko
Nikolaj Bjorner (nbjorner) 2013-04-02
Revision History:
--*/
#include "muz/transforms/dl_... | 13,092 | 4,262 |
#pragma once
#include <ATen/ATen.h>
#include <c10/util/accumulate.h>
#include <c10d/Types.hpp>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
typedef SSIZE_T ssize_t;
#pragma comment(lib, "Ws2_32.lib")
#else
#include <fcntl.h>
#include <netdb.h>
#include <sys/poll.h>
#include <sys/socket.h>
#include <unist... | 21,382 | 7,197 |
/*
// Copyright (c) 2016 Intel Corporation
//
// 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... | 28,301 | 12,265 |
#pragma once
/**
@file
@brief check msg
@author MITSUNARI Shigeo(@herumi)
@license modified new BSD license
http://opensource.org/licenses/BSD-3-Clause
*/
#include <stdint.h>
#include <set>
#include <memory.h>
namespace bls_util {
const size_t MSG_SIZE = 32;
struct Msg {
uint8_t v[MSG_SIZE];
bool operator<(co... | 964 | 432 |
/*
* Copyright (C) 2015 Christopher Gilbert.
*
* 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, merge... | 3,318 | 1,338 |
/***************************************************************************
* 2005 by Axel Gonzalez *
* loox@e-shell.net *
* *
* This so... | 3,012 | 1,040 |
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/pdfwindow/PDFWindow.h"
#include "../../include... | 5,759 | 2,629 |
/*
* 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... | 28,179 | 8,877 |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "garnet/lib/ui/gfx/engine/duration_predictor.h"
#include <src/lib/fxl/logging.h>
namespace scenic_impl {
namespace gfx {
DurationPredictor::Dur... | 1,381 | 477 |
#include "vta/runtime.h"
#include "vta/vtalib/include/Bundle/VTABundle.h"
#include "vtaFCTestBundle.h"
SymbolTableEntry symbolTableEntry[2]={{"inputP",0,2048,'1'},{"outP",2048,1000,'1'}};
BundleConfig vtaFCTestBundle_config = {2052000, 3048, 0, 64, 2, symbolTableEntry};
int vtaFCTestMainEntry(int8_t *constantWeight,... | 711 | 379 |
#include "matrix_support.h"
#include "../doctest.h"
#include "Support/Helpers.h" // random_float()
using namespace V3DLib;
void compare_arrays(Float::Array2D &a, float const *b, float precision) {
// Values empirically determined - the bigger the matrices, the less precise
if (precision == -1.0f) {
if (Pla... | 5,710 | 2,364 |
// Copyright (C) 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "cpu_blocked_memory_desc.h"
#include "mkldnn_memory.h"
#include "utils/cpu_utils.hpp"
using namespace MKLDNNPlugin;
BlockedMemoryDesc::BlockedMemoryDesc(InferenceEngine::Precision prc, const std::vector<size_t>& dims) : Memory... | 8,928 | 3,112 |
// A sample program
#include <stdio.h>
int main(){
printf("Hello World\n");
}
| 81 | 31 |
/*
gpe_scene_tilemap_class.cpp
This file is part of:
GAME PENCIL ENGINE
https://www.pawbyte.com/gamepencilengine
Copyright (c) 2014-2020 Nathan Hurde, Chase Lee.
Copyright (c) 2014-2020 PawByte LLC.
Copyright (c) 2014-2020 Game Pencil Engine contributors ( Contributors Page )
Permission is hereby granted, f... | 27,650 | 9,255 |
#include <limits>
#include "common/common/basic_resource_impl.h"
#include "test/mocks/runtime/mocks.h"
#include "gtest/gtest.h"
using testing::NiceMock;
using testing::Return;
namespace Envoy {
class BasicResourceLimitImplTest : public testing::Test {
protected:
NiceMock<Runtime::MockLoader> runtime_;
};
TEST_... | 1,625 | 672 |
/*
==============================================================================
KratosR1StructuralApplication
A library based on:
Kratos
A General Purpose Software for Multi-Physics Finite Element Analysis
Version 1.0 (Released on march 05, 2007).
Copyright 2007
Pooyan Dadvand, Riccardo Rossi, Janosch Stascheit, Fel... | 11,580 | 3,580 |
#include "glog/logging.h"
#include "gtest/gtest.h"
#include "comm/sender.hpp"
#include <iostream>
#include <vector>
namespace minips {
namespace {
class TestSender : public testing::Test {
public:
TestSender() {}
~TestSender() {}
protected:
void SetU... | 1,940 | 566 |
/****************************************************************************
* Copyright (c) 2019-2020 by the Cajita authors *
* All rights reserved. *
* *
* This ... | 1,602 | 514 |
// Generated by zsLibEventingTool
#include "impl_org_webRtc_RTCRemoteOutboundRtpStreamStats.h"
using ::zsLib::String;
using ::zsLib::Optional;
using ::zsLib::Any;
using ::zsLib::AnyPtr;
using ::zsLib::AnyHolder;
using ::zsLib::Promise;
using ::zsLib::PromisePtr;
using ::zsLib::PromiseWithHolder;
using ::zsLib::Promis... | 6,177 | 1,623 |
#pragma once
#include "nwn_api.hpp"
#include "CExoString.hpp"
#include "CExoLocString.hpp"
#include "CExoArrayList.hpp"
#include "Vector.hpp"
#include "CResRef.hpp"
#include "CNWSObject.hpp"
#ifdef NWN_API_PROLOGUE
NWN_API_PROLOGUE(CNWSPlaceable)
#endif
struct CNWSObjectActionNode;
struct CResStruct;
struct CNWSAre... | 4,433 | 1,820 |
#include <<%= libraryName %>/export.h>
#include <iostream>
<%= LIBRARYNAME %>_API int <%= libraryName %>_api()
{
std::cout << "hello from <%= libraryName %>" << std::endl;
return 12345;
}
| 197 | 72 |
/* Copyright © 2017 Apple Inc. All rights reserved.
*
* Use of this source code is governed by a BSD-3-clause license that can
* be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
*/
#include <toolkits/feature_engineering/dict_transform_utils.hpp>
#include <core/data/flexible_type/f... | 14,457 | 4,535 |
//=======================================================================
// Copyright (c) 2014-2020 Baptiste Wicht
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//==================================================================... | 12,208 | 3,577 |
#include "student.h"
#include <iostream>
using namespace std;
void Student::input (void) {
cout << "\n\nRoll No: ";
cin >> rollno;
cout << "Name: ";
cin.ignore();
cin.getline(name, 20);
cout << "MARKS" << endl;
cout << "Phy: "; cin >> marks[phy];
cout << "Chem: "; cin >> marks[chem];
... | 715 | 264 |
//
// Umbrela for the the Mu2e G4 world classes
//
// $Id: Mu2eUniverse.cc,v 1.2 2012/11/19 23:03:49 genser Exp $
// $Author: genser $
// $Date: 2012/11/19 23:03:49 $
//
// Original author Rob Kutschke
//
//
// C++ includes
#include <iostream>
#include <vector>
#include <iomanip>
// Framework includes
#include "art/F... | 1,573 | 591 |
#include "stdafx.h"
#include "KMath.h"
#include "Global.h"
#include "KNpcOrderList.h"
using namespace std;
BOOL KNpcOrderManager::Init()
{
BOOL bResult = false;
int nRetCode = false;
ITabFile* piTabFile = NULL;
char szFileName[MAX_PATH];
int ... | 3,570 | 1,378 |
#include "bimage.hh"
#include <math.h>
#include <fstream>
#include <stdlib.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[]){
BImage image(257,256) ;
image.clear(255,255,255) ;
image.text(10,10,"abc ABC 123 @$%& ][{}.,:") ; // fghijklmnopquvwxyz") ;
for(int i = 0 ; i < 16 ; i+... | 507 | 246 |
/********************************************************************
* COPYRIGHT:
* Copyright (C) 2001-2011 IBM, Inc. All Rights Reserved.
*
********************************************************************/
/********************************************************************************
*
* File dumpce.cpp
... | 53,420 | 17,425 |
// FolderWeapons.cpp: implementation of the CFolderWeapons class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FolderWeapons.h"
#include "FolderCommands.h"
#include "MissionData.h"
#include "MissionMgr.h"
#include "ClientRes.h"
#include "InterfaceMgr.h"
#inclu... | 12,800 | 5,482 |
/* Copyright (c) 2010-2019, Delft University of Technology
* All rigths reserved
*
* This file is part of the Tudat. Redistribution and use in source and
* binary forms, with or without modification, are permitted exclusively
* under the terms of the Modified BSD license. You should have received
*... | 30,481 | 8,709 |
#include <bits/stdc++.h>
using namespace std;
template <typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template <typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os <... | 1,845 | 738 |
//#define CATCH_CONFIG_MAIN // This tells Catch to provide a main()
#define CATCH_CONFIG_RUNNER // We will provide a custom main
#include "catch.hpp"
// TODO: this import may ultimately be a bad idea, but it lets you paste an input deck in...
#include "deck/wrapper.h"
#include "src/species_advance/species_advance.h... | 14,597 | 5,311 |
//----------------------------------------------------------------------------//
// Part of the Fox project, licensed under the MIT license.
// See LICENSE.txt in the project root for license information.
// File : Token.hpp
// Author : Pierre van Houtryve
//------------------... | 2,205 | 612 |
#include "player.h"
#include "bmp_man.h"
extern Arduboy mArduboy;
void Player::move(int dx)
{
if (dx < 0) {
x += dx;
if (x <= -16) x = 127;
} else {
x += dx;
if (x >= 128) x = -15;
}
}
void Player::do_state()
{
switch (state) {
case MAN_ST_ATTACK:
count ++;
if (count >= 20) state = ... | 2,539 | 1,307 |
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD 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.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without... | 47,941 | 19,081 |
#include "rack.hpp"
using namespace rack;
extern Plugin *pluginInstance;
extern Model *modelBPMLFO;
extern Model *modelBPMLFO2;
extern Model *modelBPMLFOPhaseExpander;
extern Model *modelDamianLillard;
extern Model *modelEverlastingGlottalStopper;
extern Model *modelHairPick;
extern Model *modelLissajousLFO;
exter... | 1,320 | 470 |
// File implement/oglplus/enums/precision_type_def.ipp
//
// Automatically generated file, DO NOT modify manually.
// Edit the source 'source/enums/oglplus/precision_type.txt'
// or the 'source/enums/make_enum.py' script instead.
//
// Copyright 2010-2017 Matus Chochlik.
// Distributed under the Boost Software Li... | 3,025 | 1,388 |
// Copyright (c) 2018, The TurtleCoin Developers
// Copyright (c) 2020, The Ionize Developers
//
// Please see the included LICENSE file for more information.
////////////////////////
#include <Nigel/Nigel.h>
////////////////////////
#include <config/CryptoNoteConfig.h>
#include <CryptoNoteCore/CryptoNoteTools.h>
... | 10,072 | 3,254 |
/*
* Copyright 2018-2019 Redis Labs Ltd. and Contributors
*
* This file is available under the Redis Labs Source Available License Agreement
*/
#include "gtest.h"
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "../../src/execution_plan/record.h"
#include "../../src/util/rmalloc.h"
#include "../..... | 1,278 | 543 |
#ifndef MTV_HH
#define MTV_HH
#include <string>
#include "trick/IPPythonEvent.hh"
namespace Trick {
class MTV {
public:
MTV() ;
Trick::IPPythonEvent dummy_event ; /**< trick_io(*io) trick_units(--) */
Trick::IPPythonEvent ** mtv_list ; /**< trick_io(*io) trick_un... | 1,121 | 380 |
//
// MallocCollectorHelper.hpp
// cfunction
//
// Created by hzduanjiashun on 2018/3/28.
// Copyright © 2018年 Daniel. All rights reserved.
//
#ifndef MallocCollectorHelper_hpp
#define MallocCollectorHelper_hpp
#include <stdio.h>
#include <memory>
#include <malloc/malloc.h>
#include "MallocMemory.hpp"
namespace ... | 1,822 | 577 |
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors ... | 6,504 | 2,465 |
#include <iostream>
struct BitFieldStruct {
unsigned int a : 4;
unsigned int b : 3;
};
int main() {
BitFieldStruct x;
x.a = 06;
x.b = x.a | 3; // | bitwise OR, || logical OR ; & bitwise AND, && logicalwise AND
std::cout << x.a << '\n' << std::endl;// converted to unsigned and then displayed
std::cout << x.b <<... | 671 | 245 |
// Libraries
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
// Project headers
#include <client/application/applications/HelloTriangleApplication.hpp>
// C/C++ standard
#include <stdexcept>
int main() {
glfwInit();
HelloTriangleApplication app;
app.init();
while(!glfwWindowShouldClose(app.window))
app.l... | 417 | 163 |
// User data functions. Modify these functions for your data items.
#include "UserTypes.h"
#include "Wire.h"
#include "I2Cdev.h"
#include "MPU6050.h"
//------------------------------------------------------------------------------
MPU6050 mpu;
static uint32_t startMicros;
// Acquire a data record.
void acquireData(dat... | 1,240 | 510 |
#ifndef TP_TALLER_DE_PROGRAMACION_FIUBA_CONSTANTES_HPP
#define TP_TALLER_DE_PROGRAMACION_FIUBA_CONSTANTES_HPP
#include <stdint.h>
const int ANCHO_FONDO = 8177;
#define VALOR_POR_DEFECTO_ANCHO 800
#define VALOR_POR_DEFECTO_ALTO 600
#define TIEMPO_ESPERA_GAME_LOOP 5
#define IZQUIERDA 1
#define DERECHA 2
#define ARRIBA 3... | 5,886 | 2,798 |
#include "mediapipe/framework/calculator_framework.h"
#include "mediapipe/calculators/signn/timed_queue.h"
#include "mediapipe/framework/formats/landmark.pb.h"
#include "mediapipe/calculators/signn/static_dynamic_gate_options.pb.h"
#include <fstream>
namespace mediapipe{
namespace{
constexpr char Landma... | 3,800 | 1,105 |
#include "normal3.h"
#include <cmath>
#include <ostream>
namespace eyebeam
{
Normal3 operator+(const Normal3& lhs, const Normal3& rhs)
{
auto result(lhs);
result += rhs;
return result;
}
Normal3 operator-(const Normal3& lhs, const Normal3& rhs)
{
auto result(lhs);
result -= rhs;
return resul... | 1,074 | 388 |
#include "Matrix.h"
#include "../Vector3/Vector3n.h"
#include <iostream>
int MATRIX_MAX_SIZE = 9;
namespace ME
{
// idendity matrix
Matrix::Matrix()
{
for (int i = 0; i < MATRIX_MAX_SIZE; i++)
{
matrixData[i] = 0.0f;
}
matrixData[0] = matrixData[4] = matrixData[8] = 1.0f;
}
Matrix::Matrix(float m0... | 8,161 | 3,775 |
#include <stdio.h>
#include <zlib.h>
#include <string.h>
#include <stdlib.h>
#include "gzip_mem.h"
#define OF(args) args
#define OS_CODE 3 // unix
#if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8
#else
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
/* default memLevel */
#define Z_BUFSIZE 16384
#def... | 15,068 | 6,079 |
#include "RecoParticleFlow/PFClusterTools/interface/Utils.h"
#include <stdio.h>
#include <math.h>
#include <regex.h>
#include <glob.h>
#include "TCanvas.h"
#include "TVector3.h"
using namespace std;
using namespace pftools;
bool Utils::StringMatch(const char* str, const char* pattern) {
int status;
regex_t ... | 1,683 | 748 |
/** \class EcalMaxSampleUncalibRecHitProducer
* produce ECAL uncalibrated rechits from dataframes
*
* \author G. Franzoni, E. Di Marco
*
*/
#include "RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitWorkerMaxSample.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/EcalDigi/int... | 2,473 | 838 |
#include "athena/MemoryWriter.hpp"
#include <cstdio>
#include <cstring>
#ifdef HW_RVL
#include <malloc.h>
#endif // HW_RVL
namespace athena::io {
MemoryWriter::MemoryWriter(atUint8* data, atUint64 length, bool takeOwnership)
: m_data(data), m_length(length), m_bufferOwned(takeOwnership) {
if (!data) {
atError... | 5,936 | 2,183 |
/*
* Copyright (c) 2012 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 con... | 16,550 | 5,095 |
// 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 "base/values.h"
#include "chrome/browser/external_protocol/auto_launch_protocols_policy_handler.h"
#include "chrome/browser/external_protocol/ext... | 21,702 | 6,434 |
/*
*
* File obtained from pgenlibr R library:
* https://github.com/chrchang/plink-ng/tree/master/2.0/pgenlibr
*
* License info obtained from DESCRIPTION file:
* https://github.com/chrchang/plink-ng/blob/master/2.0/pgenlibr/DESCRIPTION
* -----------------------------------------------------
Package: pgenlibr
... | 17,436 | 7,131 |
#ifndef __GECODE_STRING_FIND_HH__
#define __GECODE_STRING_FIND_HH__
namespace Gecode { namespace String {
/**
* \brief %Propagator for string find.
*
*/
class Find :
public MixTernaryPropagator<StringView, PC_STRING_DOM,
StringView, PC_STRING_DOM, Gecode::Int::IntView, Gecode::Int::PC_INT_BND> {... | 1,335 | 470 |
/*
*
* Copyright 2015 gRPC 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 agree... | 4,152 | 1,332 |
/*
* Copyright (c) 2014-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.
*
*/
#in... | 9,397 | 3,129 |