text string | size int64 | token_count int64 |
|---|---|---|
#include "section.h"
Section::Section(QTreeWidget* parent, quint32 id, quint32 size, quint32 offset)
: QTreeWidgetItem(parent, Section::Type)
, id(id)
, size(size)
, offset(offset)
{
this->setText(0, QString::number(id));
}
Section::~Section()
{
}
quint32 Section::getId() const
{
return id;
}... | 1,764 | 617 |
#include <iostream>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <cstdlib>
#include "init.h"
//#include "scena_meniu.h"
//#include "scena_joc.h"
//#include "player.h"
using namespace std;
/////////////////////////////////////////////////////////////
int latime_pereti_exterior=30;
int hight=510+lat... | 4,424 | 1,901 |
/* Copyright 2022 Jiří Vyskočil, Jan Stephan, Bernhard Manfred Gruber
*
* This file is part of alpaka.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#prag... | 6,823 | 2,230 |
// (C) Copyright John Maddock 2000.
// Use, modification and distribution are subject to 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 "test.hpp"
#include "check_integral_constant.hpp"
#ifdef TEST_STD
# include <typ... | 2,173 | 921 |
/*
* Copyright 2021 The Chromium OS 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 "features/hdrnet/hdrnet_stream_manipulator.h"
#include <algorithm>
#include <optional>
#include <string>
#include <utility>
#include ... | 47,495 | 15,434 |
#pragma once
// Fortnite (1.8) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "../SDK.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
// Function GameplayTasks... | 6,778 | 1,604 |
#include "Slider.h"
#include "MsgPayloads.h"
#include "ofxCogEngine.h"
#include "Scene.h"
#include "Node.h"
namespace Cog {
Slider::Slider(Node* body, Node* text) :body(body), text(text) {
}
void Slider::Load(Setting& setting) {
this->bodyNodeTag = setting.GetItemVal("body");
this->textNodeTag = setting.Get... | 2,622 | 1,092 |
#include<cstdio>
int GetRoot(int ID,int *father){
if(father[ID]==ID)
return ID;
return father[ID]=GetRoot(father[ID],father);
}
int main(){
const int STUDENT_MAX=50000;
int studentNum,pairNum,caseID=1;
int father[STUDENT_MAX];
bool religionRoot[STUDENT_MAX];
while(true){
scanf("%d%d",&student... | 1,065 | 488 |
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
NotPowerPolicyOwnerStateMachine.cpp
Abstract:
This module implements the Not Power Policy Owner state machine for the driver
framework. This code was split out from PowerPolicyStateMachine.cpp
Author:
Environment:
Both kernel an... | 16,503 | 5,905 |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
#include "beatsaber-hook/shared/utils/byref.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils-met... | 4,599 | 1,417 |
// font.chr
//
#include "font.h"
const unsigned char fontTable[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00,
0x03, 0x00, 0x03, 0x00, 0x1f, 0x0a, 0x1f, 0x00,
0x16, 0x1f, 0x0d, 0x00, 0x0b, 0x04, 0x1a, 0x00,
0x0a, 0x15, 0x1a, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x0e, 0x11, 0x00, 0x... | 1,778 | 1,633 |
/** An entity that participates in collision resolution **********************
* *
* Copyright (c) 2016 Florian Oetke *
* This file is distributed under the MIT License *
* ... | 3,743 | 1,350 |
#include "tensorflow/cc/ops/const_op.h"
#include "image.h"
AdjustContrast::AdjustContrast(tensorflow::Scope& scope,
tensorflow::Input images,
tensorflow::Input contrast_factor,
tensorflow::Input min_value,
tensorflow::Input max_value) {
if (!scope.ok())
r... | 41,251 | 11,401 |
// license:BSD-3-Clause
// copyright-holders:AJR
/*******************************************************************************
Skeleton driver for Yamaha DX100 & DX27 FM synthesizers.
The main differences between DX100 and DX27 are that DX27 has 61 keys
rather than 49, but DX100 is portable and can run... | 4,767 | 2,388 |
//
// TrustedBsdHandler.cpp
//
// Copyright © 2018 Microsoft. All rights reserved.
//
#include "TrustedBsdHandler.hpp"
#include "OpNames.hpp"
int TrustedBsdHandler::HandleLookup(const char *path)
{
PolicyResult policyResult = PolicyForPath(path);
AccessCheckResult checkResult = policyResult.CheckReadAccess... | 2,717 | 809 |
#include "scriptmgr.h"
#include "gamemgr.h"
#include "gameobj.h"
#include <iostream> // cout
#include <stdio.h> // fopen, fclose
#include <string.h> // strcmp
#include <assert.h>
#include <add_on/scriptstdstring/scriptstdstring.h>
#include <add_on/scriptbuilder/scriptbuilder.h>
#include <add_on/weakref/weakref.h>
us... | 10,643 | 3,652 |
// Generated from /POI/java/org/apache/poi/ss/formula/SheetNameFormatter.java
#pragma once
#include <fwd-POI.hpp>
#include <java/lang/fwd-POI.hpp>
#include <java/util/regex/fwd-POI.hpp>
#include <org/apache/poi/ss/formula/fwd-POI.hpp>
#include <java/lang/Object.hpp>
struct default_init_tag;
class poi::ss::formula::... | 1,745 | 575 |
/*========================================================================*
* *
* Distributed by Whiteley Research Inc., Sunnyvale, California, USA *
* http://wrcad.com *
* Copyright (... | 8,135 | 2,491 |
//
// Created by researcher on 9/28/20.
//
//
// Created by researcher on 9/8/20.
//
#include <boost/test/unit_test.hpp>
#include "processor.h"
#include <chrono>
using namespace std::chrono_literals;
using namespace queue_processor;
BOOST_AUTO_TEST_CASE(test_run){
QueueProcessor<int, int, unique, sequential> p... | 2,354 | 838 |
// 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 may... | 69,802 | 22,383 |
////////////////////////////////////////////////////////////////////////////////
// This file is distributed under the University of Illinois/NCSA Open Source
// License. See LICENSE file in top directory for details.
//
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
//
// File developed by:
// Miguel Mora... | 3,533 | 1,233 |
/*This file is part of the FEBio Studio source code and is licensed under the MIT license
listed below.
See Copyright-FEBio-Studio.txt for details.
Copyright (c) 2021 University of Utah, The Trustees of Columbia University in
the City of New York, and others.
Permission is hereby granted, free of charge, to any pers... | 14,829 | 7,837 |
/*! \file error.hpp */
#ifndef REPROC_ERROR_HPP
#define REPROC_ERROR_HPP
#include "export.hpp"
#include <system_error>
/*! \namespace reproc */
namespace reproc
{
/*! \see REPROC_ERROR */
// When editing make sure to change the corresponding enum in error.h as well.
enum class errc {
// reproc errors
/*! #REP... | 1,284 | 530 |
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double stockShares = 200; //Total stock shares
double sharePrice = 21.77; //Share Price
double brokerPercentage = 2; //Brokerage percentage
double totalStockPrice = stockShares * sharePrice; //Total Stock price calculation
double brokerCommi... | 2,500 | 777 |
/**
* Intersection Model API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
... | 6,199 | 2,202 |
/*
* Copyright (C) 2011 Benjamin Poulain <benjamin@webkit.org>
*
* 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 condi... | 3,606 | 1,103 |
// Copyright 2021 The Google Research 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... | 1,172 | 378 |
#include <iostream>
#include <vector>
#include "vapor/VAssert.h"
#include <cmath>
#include <vapor/utils.h>
#include <vapor/KDTreeRG.h>
#include "kdtree.h"
using namespace std;
using namespace VAPoR;
KDTreeRG::KDTreeRG( const Grid &xg,
const Grid &yg )
: _points( xg, yg ),
... | 2,503 | 974 |
//
// CSaB - Counter-Strike Bot based on YaPB by jeefo.
// Copyright © 2021-2022 CSaB Project <bariscodefx@protonmail.com>.
//
// SPDX-License-Identifier: MIT
//
#include <csab.h>
// on other tran win32/linux platforms i.e. arm we're using xash3d engine to run which exposes
// nice interface to handle with linkents. ... | 6,753 | 2,981 |
// $Id: MessengerHandler.cpp 85583 2009-06-09 13:47:38Z calabrese_p $
#include "MessengerHandler.h"
#include "ace/OS_NS_time.h"
#include <iostream>
// Implementation skeleton constructor
MessengerHandler::MessengerHandler (CORBA::ORB_ptr orb)
: time_(0)
, orb_(CORBA::ORB::_duplicate(orb))
{
}
// Implementation skele... | 1,337 | 509 |
#include "KeyboardMeleeAttackComponent.h"
#include "gtest/gtest.h"
#include "AnimatorMock.h"
#include "FriendlyFireValidatorMock.h"
#include "InputMock.h"
#include "RayCastMock.h"
#include "RendererPoolMock.h"
#include "exceptions/DependentComponentNotFound.h"
using namespace ::testing;
using namespace components::... | 5,064 | 1,485 |
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int X;
cin>>X;
cout<< (X^1);
cout<<" ";
cout<< (X^2);
cout<<" "<<X<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int testCases;
cin >> testCases;
while (testCases--)
{
... | 362 | 152 |
// (C) Copyright John Maddock 2000.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.tt.org/LICENSE_1_0.txt)
#include "test.hpp"
#include "check_type.hpp"
#ifdef TEST_STD
# include <type_traits>
#el... | 2,095 | 908 |
/*
* Copyright Andrey Semashev 2007 - 2013.
* 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 <string>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <boost... | 5,487 | 1,755 |
#include "VarianceFilter.h"
#include "IntegralImage.h"
#include "DetectorCascade.h"
using namespace cv;
namespace tld
{
VarianceFilter::VarianceFilter()
{
enabled = true;
minVar = 0;
integralImg = NULL;
integralImg_squared = NULL;
}
VarianceFilter::~VarianceFilter()
{
release();
}
void Varianc... | 1,483 | 548 |
#pragma once
#include <algorithm>
#include <chrono>
namespace SDK {
namespace ue::sys::math {
template <class T>
T Lerp(const T &from, const T &to, float fAlpha) {
return (T)((to - from) * fAlpha + from);
}
// Find the relative position of Pos between From and To
... | 1,440 | 431 |
class Solution {
public:
int maximumProduct(vector<int>& nums) {
int max1 = INT_MIN, max2 = INT_MIN, max3 = INT_MIN;
int min1 = INT_MAX, min2 = INT_MAX;
for (int num : nums) {
if (num > max1) {
max3 = max2;
max2 = max1;
max1 = num;
... | 808 | 245 |
/*********************************************************\
* File: XmlNode.inl *
*
* Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/)
*
* This file is part of PixelLight.
*
* Permission is hereby granted, free of charge, to any person obtaining a co... | 6,924 | 2,254 |
/* This file is part of libDAI - http://www.libdai.org/
*
* Copyright (c) 2006-2011, The libDAI 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 <dai/weightedgraph.h>
#include <dai/exceptions.h>
#include <strstream>... | 5,588 | 2,614 |
/*
* Copyright (c) 2021, 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requi... | 20,100 | 7,101 |
/*
* ====================== leet_989.cpp ==========================
* -- tpr --
* CREATE -- 2020.05.27
* MODIFY --
* ----------------------------------------------------------
* 989. 数组形式的整数加法
*/
#include "inn... | 1,149 | 438 |
//
// Created by qiu on 2021/12/20.
//
#include "Config.h"
| 60 | 34 |
#include<iostream>
#include<vector>
int main() {
for ( int i : { 1, 2, 3, 4, 5, 6 } ) {
std::cout<< i <<std::endl;
}
std::vector<int> v { 1, 2, 3, 4, 5, 6 };
for (auto& elem : v ) { //非只读方式 可以修改原来值
//for ( auto elem : v ) { //拷贝成临时变量 即只读的方式即做任何操作都不会改变原来的值
elem *= 3;
}
//for (auto elem : v) { //效率低
... | 423 | 271 |
/*
* Copyright (c) 2016, 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.
*
*/
#include <al... | 7,683 | 3,076 |
#include "stringer.h"
using namespace std;
// Simply prints the string that was passed to the console
void Stringer::PrintString(const std::string& s) {
cout << s << endl;
}
// Checks to see if every character in the passed string is unique
// Returns true if so, false otherwise
//
// Assumes ASCII character set... | 3,164 | 1,016 |
#include <iostream>
#include <iomanip>
#include <optional>
#include <sstream>
#include <fstream>
#include "hpocommand.h"
#include "../lib/jsonobo.h"
#include "../lib/property.h"
#define EMPTY_STRING ""
using namespace phenotools;
using std::string;
using std::cout;
using std::cerr;
using std::stringstream;
using st... | 11,104 | 3,575 |
#include "Type.h"
#include "Function.h"
#include "Module.h"
#include "Utils.h"
#include "FloatType.h"
#include "Exception.h"
using namespace std;
using namespace WorkScript;
std::unordered_map<std::wstring, FloatType*> FloatType::types;
Finalizer FloatType::staticFinalizer(&FloatType::releaseTypes);
FloatType::Float... | 2,915 | 1,057 |
/*
* Copyright (c) 1999, 2021, 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 ... | 26,353 | 8,499 |
#include "QrDefinitions.hpp"
using namespace GtkQR;
QRDataContainer::QRDataContainer()
{
correction_level = QRErrorCorrectionLevel ::QR_ERROR_CORRECTION_LEVEL_MEDIUM;
isMicro=false;
enable_UTF8=true;
qrversion_number = QR_NO_VERSION;
qrversion = QRVersion::QR_VERSION_NULL;
mask = QR_NO_MASK;... | 2,820 | 1,032 |
/*
Reverse a string using Stack
----------------------------
Easy Accuracy: 54.33% Submissions: 27645 Points: 2
You are given a string S, the task is to reverse the string using stack.
Example 1:
Input: S="GeeksforGeeks"
Output: skeeGrofskeeG
Your Task:
You don't need to read input or print anything. Y... | 891 | 326 |
#include <nds.h>
#include "tonccpy.h"
#define __itcm __attribute__((section(".itcm")))
void __itcm
lzssDecompress(u8* source, u8* destination) {
u32 leng = (source[1] | (source[2] << 8) | (source[3] << 16));
int Offs = 4;
int dstoffs = 0;
while (true)
{
u8 header = source[Offs++];
for (int i = 0; i < 8; i++)... | 726 | 382 |
/*
* Copyright (c) 2015-2021, The OSKAR Developers.
* See the LICENSE file at the top-level directory of this distribution.
*/
#include <gtest/gtest.h>
#include "settings/oskar_settings_types.h"
using namespace oskar;
TEST(settings_types, Int)
{
Int i;
ASSERT_TRUE(i.set_default("1"));
ASSERT_STREQ("1"... | 922 | 395 |
#include "doctest.h"
#include "Board.hpp"
using namespace ariel;
#include <string>
#include <algorithm>
using namespace std;
TEST_CASE("Complete Strings") {
Board board;
board.post(0, 0, Direction::Horizontal, "Hello");
board.post(0, 6, Direction::Vertical, "World!");
board.post(1, 8, Direction::Horizontal, "Ver... | 2,807 | 1,169 |
/*
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
noti... | 4,377 | 1,401 |
// simple test program:
// se-simple-vo -L ~/drc-testing-data/state_est/run1_field_camera_snippet.lcmlog -P drc_robot.cfg -p
// Just do VO, not do any imu integration, dont correct for any urdf/cfg offsets
// Output motion in x forward, z up frame
#include <zlib.h>
#include <lcm/lcm-cpp.hpp>
#include <bot_param/param... | 18,816 | 7,175 |
/*=========================================================================
Program: Visualization Toolkit
Module: TestCutter.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This softw... | 6,597 | 2,509 |
//
// Created by jgoppert on 3/23/21.
//
#include "util.h"
#ifdef __GNUG__
#include <cxxabi.h>
#include <cstdlib>
#include <memory>
std::string demangle(const char* name) {
int status = -4; // some arbitrary value to eliminate the compiler warning
// enable c++11 by passing the flag -std=c++11 to g++
std::uniq... | 565 | 216 |
#include "vulkan/VulkanContext.hpp"
#include "vku.hpp"
#define NANOVG_VULKAN_IMPLEMENTATION
#include "nanovg_vk.h"
#include "core/Log.hpp"
#include "core/MathDef.hpp"
#include "core/Status.hpp"
namespace fui {
struct VulkanContext::Private {
std::shared_ptr<vk::UniqueInstance> instance;
vk::SurfaceKHR surface;
... | 9,832 | 3,430 |
// This code is public domain.
// Author: Paul Kienzle
#ifdef HAVE_CONFIG_H
# include <config.h>
#else
# include <octave/config.h>
#endif
#include "defun-dld.h"
#include "error.h"
#include "parse.h"
#include "quit.h"
#include "Cell.h"
DEFUN_DLD(regexprep,args,nargout,"\
-*- texinfo -*-\n\
@deftypefn {Function File} ... | 8,463 | 3,412 |
// SSPI objects for the win32security module, by Roger Upole
// $Id$
// Currently this file contains only object definitions - the SSPI methods
// themselves are defined in win32security.i. In the future this may change.
// @doc - This file contains autoduck documentation
#include "PyWinTypes.h"
#include "structmembe... | 53,764 | 16,652 |
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or t... | 20,149 | 4,824 |
/*
* @author Nickel_Angel (1239004072@qq.com)
* @copyright Copyright (c) 2022
*/
#include <algorithm>
#include <cstdio>
#include <cstring>
const int maxn = 1e6 + 10;
int n, a[maxn];
class BIT
{
private:
int v[maxn], bound;
inline int lowbit(int x)
{
return x & -x;
}
public:
inline v... | 1,129 | 480 |
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file e... | 4,365 | 1,552 |
/*
* Copyright (C) 2011-2020 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this li... | 8,458 | 2,839 |
/* Copyright 2015 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | 1,527 | 498 |
/*
* errfloat.cpp
*
* Created on: 2016年11月15日
* Author: zhuqian
*/
#include "errfloat.h"
#include "mmath.h"
EFloat::EFloat(float v, float err) :
_value(v) {
Assert(!std::isnan(v));
Assert(!std::isnan(err));
if (err == 0.0f) {
_low = _high = v;
} else {
//这里调用NextFloatUp和NextFloatDown是为了做保守的边界
_... | 3,128 | 1,289 |
#pragma once
#include "glm.hpp"
namespace Math{
/* Vector with template specified dimension.
* For operations on vectors use glm::vec
*/
template<typename _ValT, int _D>
struct Component
{
_ValT data[_D];
};
// specializations for named access of the first 3 dimensions
template<typename _ValT>
struc... | 2,048 | 922 |
/*
Given an absolute path for a file (Unix-style), simplify it.
Example
"/home/", => "/home"
"/a/./b/../../c/", => "/c"
Challenge
Did you consider the case where path = "/../"?
In this case, you should return "/".
Another corner case is the path might contain multiple slashes '/' together, such as "/home//foo... | 1,299 | 388 |
#include <iostream>
/*
typedef int Weapon;
Weapons weapon_id[1000];
*/
class Player{
private:
float x, y, z = 0.0;
float speed;
int max_health;
int health;
bool is_alive = true;
// Weapon weapon = 5;
public:
float GetHealth(){return health;}
float GetX(){return x;}
float GetY(){return y;}
float GetZ(){retur... | 1,025 | 460 |
//
// Copyright 2015 The ANGLE 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.
//
// angle_deqp_gtest_main:
// Entry point for standalone dEQP tests.
#include <gtest/gtest.h>
// Defined in angle_deqp_gtest.cpp. Declared he... | 639 | 229 |
//=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ... | 8,394 | 2,517 |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int term;
while (cin >> term) {
int a = (1 + sqrt(1 + 8*(term-1))) / 2.0;
int b = term - (1+a*(a-1)/2);
if (a % 2 == 0) {
cout << "TERM " << term << " IS " << b+1 << '/' << a-b << endl;
} else {
cout << "TERM " << te... | 386 | 171 |
//main.cpp
#include <iostream>
#include <malloc.h>
#include "timer.h"
#include "search_best.h"
#define ALGIN (32) // 使用SIMD需要内存对齐,128bit的指令需要16位对齐,256bit的指令需要32位对齐
#define FACENUM (1000*1000) // 底库中存有100万张人脸特征向量
//#define FEATSIZE (512) // 每个人脸特征向量的维度是512维,每一维是一个DType类型的浮点数
//Step 11,用PCA做... | 2,400 | 1,291 |
// Problem formulations
//
// Naming Convention:
// 1.solver classes are named by all capital letter denote type and a
// "Solver" prefix separated by underscore.
// 2.some math notation like w^t by x will be denoted as wTx,
// which big T means transpose. For the same style, other name
// convention can be deduc... | 5,431 | 1,862 |
#include <cctbx/boost_python/flex_fwd.h>
#include <boost/python/def.hpp>
#include <boost/python/class.hpp>
#include <boost/python/args.hpp>
#include <boost/python/return_value_policy.hpp>
#include <boost/python/copy_const_reference.hpp>
#include <boost/python/return_by_value.hpp>
#include <scitbx/array_family/boost_py... | 5,650 | 2,053 |
/*
* Copyright (c) 2004-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... | 3,062 | 1,153 |
/*
* VectorProtocol.cpp
*
*/
#ifndef GC_VECTORPROTOCOL_HPP_
#define GC_VECTORPROTOCOL_HPP_
#include "VectorProtocol.h"
namespace GC
{
template<class T>
VectorProtocol<T>::VectorProtocol(Player& P) :
part_protocol(P), P(P)
{
}
template<class T>
void VectorProtocol<T>::init(Preprocessing<T>& prep,
... | 1,215 | 478 |
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define rep(i,p,n) for( i = p; i<n;i++)
#define ll long long int
#define pb push_back
#define VI vector<int>
#define VL vector<long long int>
#define VD vector<double>
#define pi pair<int,int>
#define mp(a,b) make_pair(a,b)
#define eps 1e-9
#define PI ... | 6,017 | 2,677 |
#pragma once
template <class H, class G>
void copy(H& a, const G& x) {
for (int u : x.vertices())
a.addVertex(u, x.vertexData(u));
for (int u : x.vertices()) {
for (int v : x.edges(u))
a.addEdge(u, v, x.edgeData(u, v));
}
}
template <class G>
auto copy(const G& x) {
G a; copy(a, x);
return ... | 325 | 148 |
#include "subsystems/Turret.h"
#include "Constants.h"
#include "frc/smartdashboard/Smartdashboard.h"
#include "networktables/NetworkTable.h"
#include "networktables/NetworkTableInstance.h"
#include "networktables/NetworkTableEntry.h"
#include "networktables/NetworkTableValue.h"
#include "wpi/span.h"
using namespace f... | 1,625 | 636 |
#include <iostream>
#include <gtkmm.h>
int
main( int argc, char* argv[] )
{
try
{
Gtk::Main m( argc, argv ) ;
Gtk::Window win ;
m.run( win ) ;
}
catch( std::exception const & exc )
{
std::cout << exc.what() << std::endl ;
exit( -1 ) ;
}
exit( 0 ) ;
}
| 271 | 121 |
#include "Application.h"
#include "Engine/Renderer/Renderer.h"
#include <GLFW/glfw3.h>
#include <glad/glad.h>
namespace EE {
Application* Application::s_app = nullptr;
Application::Application()
{
m_Window = std::unique_ptr<Window>(Window::Create(1600, 900));
m_Window->SetEventCallbackFun(std::bind(&Applicat... | 2,189 | 887 |
/*
BSD 3-Clause License
Copyright (c) 2022, SudoCpp
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. Redistributions of source code must retain the above copyright notice,... | 3,290 | 1,034 |
#include "pch.h"
#include "ParticleForceRegistry.h"
ParticleForceRegistry::ParticleForceRegistry()
{
}
ParticleForceRegistry::~ParticleForceRegistry()
{
}
void ParticleForceRegistry::Add(Particle* particle, ParticleForceGenerator* forceGenerator)
{
ParticleForceRegistration registration;
registration.Particle = ... | 1,324 | 463 |
//leetcode.com/problems/reverse-words-in-a-string/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
string reverseWords(string s) {
string reverse_order_words = "";
int i = 0;
int n = s.length();
while (i < n) {
while (i < n && s[i] == ' '... | 847 | 260 |
#include "Engine.h"
#include "SpriteElement2D.h"
#include "FileSystem.h"
#include "FontManager.h"
#include "TextElement2D.h"
#include <iostream>
// PERFORMANCE IMPROVEMENTS TO MAKE:
// 1. Broadphase on vs. AABB Tests
// 2. Keep a list of active AABBs to avoid needless testing against AABB::alive
Engine::Engine() :
... | 1,997 | 794 |
//
// Created by Kotarou on 2020/8/7.
//
#include <fstream>
#include <fmt/format.h>
#include <yaml-cpp/yaml.h>
#include <spdlog/spdlog.h>
#include "config_loader.h"
#include "uri.h"
#include "hash.h"
#include "httpclient.h"
#include "filesystem.h"
#include "exception/invalid_uri_exception.h"
std::shared_ptr<ConfigLoa... | 3,103 | 967 |
#include <posix.h>
#include <posix/string.h>
size_t strlen(char *s) {
int count = 0;
while (*s++) {
count++;
}
return count;
}
void strcpy(char *dst, const char *src) {
while ((*dst++ = *src++));
}
void reverse(char *src) {
int l = strlen(src);
char work[l+1];
char *dst = work,
*end_ptr = ... | 813 | 395 |
#include <iostream>
#include <algorithm>
#include <stack>
#include <cstring>
#include <cmath>
using namespace std;
struct Edge
{
int To, Next;
double Pow;
Edge(int to, double pow, int next) :
To(to), Pow(pow), Next(next) { }
Edge() { }
} E[1000001];
int G[1001], cnt, Cnt[1001];
double dis[... | 1,519 | 825 |
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | 4,814 | 1,466 |
/*
g++ --std=c++20 -pthread -o ../_build/cpp/thread_thread_thread_2.exe ./cpp/thread_thread_thread_2.cpp && (cd ../_build/cpp/;./thread_thread_thread_2.exe)
https://en.cppreference.com/w/cpp/thread/thread/thread
*/
#include <iostream>
#include <utility>
#include <thread>
#include <chrono>
void f1(int n)
{
for (int ... | 1,847 | 720 |
// Copyright © 2022 Brad Howes. All rights reserved.
#pragma once
#include <cassert>
#include <iostream>
#include "SF2Lib/DSP/DSP.hpp"
#include "DSPHeaders/Biquad.hpp"
namespace SF2::Render {
class LowPassFilter
{
public:
using Coefficients = DSPHeaders::Biquad::Coefficients<Float>;
inline static Float defaul... | 2,140 | 682 |
/**
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
*/
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring... | 2,189 | 977 |
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commerci... | 13,564 | 5,455 |
/*************************************************************************
> File Name: DemoConstCast.cpp
> Author: shenzhuo
> Mail: im.shenzhuo@gmail.com
> Created Time: 2019年08月29日 星期四 10时39分19秒
************************************************************************/
#include<iostream>
using names... | 490 | 189 |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2008 J. Erik Radmall
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 and... | 8,129 | 2,142 |
namespace N {
template <typename T0>
void foo();
template <typename T1>
struct A {};
}
template<typename T2>
void bar() {
N::foo<typename N::A<T2>::X::Y>();
}
| 171 | 67 |
// Fill out your copyright notice in the Description page of Project Settings.
#include "SS_GameMode.h"
#include "SS_Asteroid.h"
#include "Kismet/GameplayStatics.h"
#include "Components/AudioComponent.h"
ASS_GameMode::ASS_GameMode()
{
PrimaryActorTick.bCanEverTick = true;
}
void ASS_GameMode::BeginPlay()
{
Super:... | 1,966 | 850 |
#include <vector>
#include <iostream>
#include <assert.h>
#include <stdio.h>
#include <algorithm>
#include <fstream>
#include <cstring>
#include <string>
#include <iomanip>
#include <sstream>
#include <map>
#include <set>
#include <list>
// Binary Search Tree
using namespace std;
class TreeNode
{
public:
v... | 4,026 | 1,620 |
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include <azure/storage/files/datalake.hpp>
#include "datalake_service_client_test.hpp"
#include "test/ut/test_base.hpp"
namespace Azure { namespace Storage { namespace Test {
class DataLakeFileSystemClientTest : public D... | 984 | 306 |