blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
9b4bc415c536b84c6cdffac928339d2c91e98cb7 | ec9b48de083719d072c682c82000be6fa2908c7c | CadQuery/pywrap | /opencascade/AIS_InteractiveObject.hxx | C++ | hxx | 6,833 | permissive | // Created on: 1996-12-11
// Created by: Robert COUBLANC
// Copyright (c) 1996-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... |
71d265b07d801df059dfbaf4e9136d2cebe1356f | 3dd40c0f6a92b023dc32e4806f99525dcf363378 | cacao518/Raccoon | /DrawBmp.cpp | C++ | cpp | 4,833 | no_license | #include <string.h>
#include "stdafx.h"
#include "DrawBmp.h"
CDrawBmp::CDrawBmp()
{
}
CDrawBmp::~CDrawBmp()
{
}
CDrawBmp::CDrawBmp(CWnd* parent)
:m_parent(parent)
{
}
void CDrawBmp::DrawBitmap(CDC* pDC, int x, int y, CBitmap& cbmp, bool bTrans,
COLORREF crTransColor)
{
CDC memdc;
CBitmap* oldCbmp;
int bx, by... |
e5f8a8199a5807aee4672fafe9d9812138ce1da6 | 9a25eeadfe3ccd8c3851a12857944a59a0714e17 | BlackTShirtDev/VitaPad | /DataParser.hpp | C++ | hpp | 13,918 | permissive | //Author : Sygmei
//Key : 976938ef7d46c286a2027d73f3a99467bcfa8ff0c1e10bd0016139744ef5404f4eb4d069709f9831f6de74a094944bf0f1c5bf89109e9855290336a66420376f
#pragma once
#include <string>
#include <map>
#include <vector>
#include <fstream>
#include <iostream>
#include <algorithm>
#include "Functions.hpp"
... |
b89e7f4f3278715b99f65100c2bf441fd8dd995e | 508e8223a95b807efecdca849467daaad9fb4f52 | MaoZeDongXiJinping/xray-2212 | /xr_3da/xrGame/game_sv_deathmatch_process_event.cpp | C++ | cpp | 1,239 | no_license | #include "stdafx.h"
#include "game_sv_deathmatch.h"
#include "xrServer.h"
#include "xrMessages.h"
void game_sv_Deathmatch::OnEvent (NET_Packet &P, u16 type, u32 time, ClientID sender )
{
switch (type)
{
case GAME_EVENT_PLAYER_CHANGE_SKIN: //dm only
{
xrClientData *l_pC = m_server->ID_to_client(sender);
u... |
085ac023a6d250062a8e4ab6505b67f412053c88 | dab341d9ac82bce30584b65f86426833d0cb2348 | BGCX067/faint-graphics-editor-svn-to-git | /tags/release-0.7/tasks/rotate-object.hh | C++ | hh | 1,483 | permissive | // Copyright 2012 Lukas Kemmer
//
// Licensed under the Apache License, Version 2.0 (the "License"); you
// may not use this file except in compliance with the License. You
// may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
e8e1916d489cef1f0711f836708498161b11a993 | bcdcb099cdb7589cdf83985a9a47d9bd1a9f5987 | wincash/Wincashcoin | /src/lightzwccthread.cpp | C++ | cpp | 5,183 | permissive | // Copyright (c) 2015-2019 The WINCASHCOIN developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
#include "lightzwccthread.h"
#include "main.h"
/****** Thread ********/
void CLightWorker::ThreadLightZWCCSimplified() {
... |
71def830de2100d87e23605e3b55b2eeea6fa3a4 | 88f2a8f43067ab5961f45994828db10e7f62bccf | f-koehler/cpp-perf | /test/test_format_duration.cpp | C++ | cpp | 1,562 | permissive | #define BOOST_TEST_MODULE TestFormatDuration
#include <boost/test/unit_test.hpp>
#include <cpp-perf.hpp>
BOOST_AUTO_TEST_CASE(hours)
{
BOOST_CHECK_EQUAL(perf::format_duration(perf::hours(1)), "1 h");
BOOST_CHECK_EQUAL(perf::format_duration(perf::minutes(60)), "1 h");
BOOST_CHECK_EQUAL(perf::format_duratio... |
c0767096b9bdbf5d71b27410735d194462cc6ed3 | 95673ba19e776b3c52eb492d0b14d761b584f807 | typhoonzero/Paddle | /paddle/operators/lrn_op.cc | C++ | cc | 8,420 | permissive | /* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
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 ... |
de988049d4aff34129abde00de7283634a5df686 | 9aad703854b6b7651dcc6502910a409fba15d90d | xtblock/chromium | /device/gamepad/gamepad_id_list.cc | C++ | cc | 26,628 | permissive | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "device/gamepad/gamepad_id_list.h"
#include <algorithm>
#include <iterator>
#include "base/stl_util.h"
namespace device {
namespace {
static... |
9ef8a785491f3446f277b434616d49eb490bb245 | 4542c850474a1a31ce45b5640ec00ad4502d6a8e | Hronom/PhysicsSystem | /PhysicsSystem/PhysicsUtils.cpp | C++ | cpp | 598 | no_license | #include "PhysicsUtils.h"
#include <QDebug>
void PhysicsUtils::updateSpeed(b2Body *par_body, const float &par_speedDirX, const float &par_speedDirY)
{
float speedX;
speedX = par_body->GetLinearVelocity().x;
float speedY;
speedY = par_body->GetLinearVelocity().y;
if(speedX != par_speedDirX || spe... |
0c7a70fd1fd5da876a422e663f2cbc4af87d707d | 3ce158692c91e0bc9fc7e1070c483892193626c8 | Teanan/ethanon | /toolkit/Source/src/engine/Resource/ETHSpriteDensityManager.cpp | C++ | cpp | 4,273 | permissive | /*--------------------------------------------------------------------------------------
Ethanon Engine (C) Copyright 2008-2013 Andre Santee
http://ethanonengine.com/
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), t... |
dc6fe1f0960f5e8505f3805955ee947289f7957b | 9ce937bd61eef0d02b2f04f6eaeda396ffcf881c | harpine/projetsv2020 | /code_rendu/src/Lab/Nutriment.hpp | C++ | hpp | 1,429 | no_license | #ifndef NUTRIMENT_HPP
#define NUTRIMENT_HPP
#include "CircularBody.hpp"
#include <Utility/Types.hpp>
#include <SFML/Graphics.hpp>
#include <Interface/Drawable.hpp>
#include <Interface/Updatable.hpp>
class Nutriment : public CircularBody, public Drawable, public Updatable
{
public:
//Constructeur:
Nutriment(co... |
b6a0059d28be12ec2f04f9f2faa03aee7e33cee3 | d1af071b288af8f41afa91674e393ac48b3233b2 | nlbao/competitive-programming | /solution/Codeforces/593B.cpp | C++ | cpp | 1,926 | no_license | // #pragma comment(linker, "/STACK:1024000000")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define fori(i,a,b) for (ll i=(a); i<=(b); ++i)
#define ford(i,a,b) for (ll i=(a); i>=(b); --i)
#define foreach(it, x) for(... |
1ea47ab5b861f465b5421d77d5e7ce92230350cb | a35e9dbe321248ecf62964050d0b97f2665d7b6b | apurv94188/ChallengingAlgorithms | /maxprdt.cpp | C++ | cpp | 1,239 | no_license | class Solution {
public:
int maxProduct(vector<int>& nums) {
int p=nums[0], n=nums[0];
int max_p = p;
int n_first = max_p;
int negcnt = nums[0] < 0 ? 1 : 0;
for (int i=1; i<nums.size(); ++i) {
if (nums[i] <= 0) {
max_p = max(m... |
5f69cfa5aa34726e8d7a76336e071250957be47c | b2e358dca1b91bd5498d75d5ffc19853d583e115 | wjdminjoo/TheElf-FakeNick- | /Source/TheElf/DragonService_Detect.cpp | C++ | cpp | 1,979 | permissive | // Fill out your copyright notice in the Description page of Project Settings.
#include "DragonService_Detect.h"
#include "MyAIController.h"
#include "MyCharacter.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "DrawDebugHelpers.h"
UDragonService_Detect::UDragonService_Detect() {
NodeName = TEXT("... |
815ec775172189a559c07faf1635df487b9d1e16 | 9f069b9fc7e7dd86ce9872ebba407973b40da409 | bigmtn1113/Baekjoon | /BOJ_1167/1167.cpp | C++ | cpp | 1,817 | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
vector<pair<int, int>> tree[100001];
bool visit[100001];
int far_node, far_node_dist;
void Dfs(int node, int dist) {
visit[node] = true;
if (far_node_dist < dist) {
far_node_dist = dist;
far_node = node;
}
for (int i = 0; i < tree[... |
713be9e54e038aa58df693143023e8828009eeb2 | 2cb1e0989ff8b0a2fc055788a060406422acb61c | AaronNGray/GenomeWorkbench | /include/gui/objutils/seq_fasta_reader.hpp | C++ | hpp | 3,333 | permissive | #ifndef GUI_UTILS___SEQ_FASTA_READER__HPP
#define GUI_UTILS___SEQ_FASTA_READER__HPP
/* $Id: seq_fasta_reader.hpp 38900 2017-06-30 20:50:04Z evgeniev $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for B... |
909a308a316cd922c640ad05ceed02873102d10c | fbbd58d8e76ea0b3a98076874cabe603bf3ffdb0 | teacup4000/cgue20-Mama | /Mama/src/Render/Display/AnimModel.cpp | C++ | cpp | 13,761 | no_license | #include "stdafx.h"
#include "AnimModel.h"
#include <GLFW/glfw3.h>
#include "stb_image.h"
////////////////////////////////////////////////////////////////
// THE ANIMATION CLASS //
// This class loads an animation file via the assimp library //
// and renders it onto the s... |
c5a853622d52e7c6f1c055180d329d29d69befc6 | 1c00ecf48899ab1fc93e4bb4d901796e68cf4795 | if1997/practise_c- | /demo/demo0717/PaintPad/widget.cpp | C++ | cpp | 1,689 | no_license | #include "widget.h"
#include "ui_widget.h"
#include <QTime>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
qsrand(QTime::currentTime().msec());
QPalette plat = this->palette();
plat.setColor(QPalette::Background,Qt::white);
this->setPalette(plat);
... |
15ab4f3052046f5b0aa0c8923ffbce195ecacd12 | 3eed60d50ce9e8f7af629cc3f5a2dc2b1afa1f3a | codahq/SoT-SDK | /SDK/SoT_AD_FirstPerson_PlayerPirate_Male_Default_structs.hpp | C++ | hpp | 802 | no_license | #pragma once
// Sea of Thieves (2.0) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SoT_Basic.hpp"
#include "SoT_ADS_IdlesNative_classes.hpp"
#include "SoT_ADS_JumpingNative_classes.hpp"
#include "SoT_ADS_CameraAdditiveNative_classes.hpp"
#include "SoT_Athena_classes.hpp"
#include "SoT_ADS_WheelNative... |
7f76e2408e1e80df680dd264d6d038fa10f2221b | 135d0f07290e444c333ad78070cceba01ca25f65 | bluesquanium/Algorithm | /Samsung/q01265.cpp | C++ | cpp | 491 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int T, N, P;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
cin >> T;
for (int t = 1; t <= T; t++) {
cin >> N >> P;
int base = N / P;
int res = N % P;
long long ans = 1;
for (int... |
0c8428f0ea8b3c2f5465bed8d882cbc6c9daa14a | ad3ba770cb0537de0e616a5f5dba6066c14d0218 | C-RJohnston/Platformer-Engine | /Player.cpp | C++ | cpp | 4,531 | no_license | #include "Player.h"
#include "Maths.h"
Player::Player()
{
this->texture.loadFromFile("Graphics/Player.png");
this->sprite.setTexture(texture);
this->boundBox = this->sprite.getGlobalBounds();
this->top = FloatRect(boundBox.left+4, boundBox.top, boundBox.width-4, boundBox.height / 4);
this->bottom = FloatRect(bou... |
9c4a1f1d32c6a392bf9970243de92bc5ef836294 | 0d97042284b8489c06675729b070a3cade295cef | chuxuantinh/C-CPP-CT | /Code/Basic/Basic/1/Demo18.cpp | C++ | cpp | 3,127 | no_license | /* Code by KingNNT */
#include <bits/stdc++.h>
using namespace std;
#define pathio "E:/Code/C-Extend/GNU-Compiler/Test/"
#define fi pathio"input.txt","r",stdin
#define fo pathio"output.txt","w",stdout
class cauthu
{
private:
string hoten, vitri;
int tuoi;
float can, chieucao;
public:
cauthu()
{
hoten = vitri ... |
11d02bc9b16f353afeb76b230adb874bca698c53 | 51c05b7a2115ddff4f70bff83ba86bc6f2a50758 | lenon461/Algorithm | /scpc/01map.cpp | C++ | cpp | 1,039 | no_license | /*
You should use the standard input/output
in order to receive a score properly.
Do not use file input and output
Please be very careful.
*/
#include <iostream>
#include <map>
using namespace std;
long Answer;
map<int, int> list;
map<int, int> sum;
void goo(){
for(int i =3 ; i <= 1000000 ; i++) {
... |
2e218aed959a4ffa66bed644cfab8db4803fdf0f | 25e7f25d0cc64da51b1a54681ae85fedfb323eff | WatkingStudio/Tournament-Creator | /src/matchupspage.cpp | C++ | cpp | 22,283 | no_license | #include "include/mainwindow.h"
#include "ui_mainwindow.h"
#include "time.h"
#include <set>
// This .cpp file is used to handle the Matchups Page
void MainWindow::AddResult(const std::string &result, int const playerIndex)
{
UtilLog("Add Result: " + result);
if(result == "Win")
{
m_MainPlayerList-... |
79a11abef7a7fab92c096cc5cd45b29f57f7dc73 | 63955b7bc20b9acbb62a34eb35a80b448a3376ab | rabbit0v0/Course-works | /PPCA/floyd.cpp | C++ | cpp | 1,731 | no_license | //
// floyd.cpp
// PPCA
//
// Created by 施晓钰 on 31/07/2017.
// Copyright © 2017 幺幺. All rights reserved.
//
#include <stdio.h>
#include <cstring>
#include <iostream>
using namespace std;
int hour[1001][1001];
int main(){
int n;
cin >> n;
while (n){
memset(hour, 10000000, sizeof(hour));
... |
89196ce599e5f5a26ef6f32d2068fc28f492e1bb | 8cba66c553cba5a627647eb5ea55b75bd2c62751 | fermi-lat/geometry | /src/Intersection.cxx | C++ | cxx | 2,497 | permissive | // $Id: Intersection.cxx,v 1.1.1.1 1999/12/18 22:50:55 burnett Exp $
//
#include "geometry/Intersection.h"
#include <cmath>
#include <cfloat>
#include <cassert>
static double step_parameter = 0.5; // amount of curvature to step, in radians
static double tolerance = 2e-8; // how close is close enough (should be s... |
c19c257861b663e3c62724e5a3f9b1e927c0c41c | 78aa079ad1771a1e135c7f355db57b84e0d6b67a | mehadi-trackrep/ACM_Programming_related | /(((... All online judge practice and contest ...)))/@Toph/Intra NSU Programming Contest Fall 2016 for SUST/Stack Overflow Happens.cpp | C++ | cpp | 6,480 | no_license | /*
BISMILLAH HIR RAHMANIR RAHIM .. "ALLAH IS ALMIGHTY" .
###########################################################################
# #
# // // ////// // // /\ //////\\ ///////// #
# // / / ... |
a536d7eb8840ee6f948d8694a072484a825a13a0 | cda2cffd713f9638721c8574ae0398fc498874a7 | ordinary-developer/education | /cpp/std-14/s_meyers-effective_modern_cpp/code/ch_06-lambdas/item_34-prefer_lambdas_to_std_bind/06_overloaded_func_with_lambdas/main.cpp | C++ | cpp | 628 | permissive | #include <chrono>
#include <functional>
using Time = std::chrono::steady_clock::time_point;
enum class Sound { Beep, Siren, Whistle };
using Duration = std::chrono::steady_clock::duration;
// a dump function
void setAlarm(Time t, Sound s, Duration d) { }
enum class Volume { Normal, Loud, LoudPlusPlus };
// an ove... |
e0027ae7b4770aa7e1c7a7082f7a6b65ba27c5b0 | 8d20a0b09fe73868ecbcfad93b0deccfbbcb70b5 | iMikeLiu/The_road_of_exploding_zero | /EZOJ/309/309.cpp | C++ | cpp | 1,823 | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<stack>
#include<map>
#include<ctime>
#define debuglog(x) cerr<<"\tdebug:"<<#x<<endl
#define debug(x) cerr<<"\tdebug:"<<#x<<"="<<(x)<<endl
#define debugg(x,y) cerr<<"... |
678ac9423a75348f0c7bded9fb61375bc0b3513c | 02e0baf1384f3f9850f6ecd69765e83dbab49115 | Jigsik/Our-very-first-game | /The_Game/The_Game/main_old.cpp | C++ | cpp | 10,480 | no_license | #include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
//#include "player.h"
//#include "enemy.h"
//#include "rocket_missiles.h"
#include "WorldObject\Game.h"
void pause(sf::RenderWindow* Window)
{
// Asi netreba, ale jeste to tu pro jistotu ... |
74c715f0fd0114b75fbb770d6303900f6c0a1185 | f0375e626434d4e441c5a20729eab703ff2b58c5 | jardous/Toaster | /Toaster/Rig.cpp | C++ | cpp | 2,370 | no_license | /* This file is part of Toaster, the editor and remote control for Kemper profiling amplifier.
*
* Copyright (C) 2016 Thomas Langer
*
* Toaster 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 vers... |
0fa69a2f0691cb6be000736c5c5481d2650c8077 | ca2c90204be69c126acefb959df3e577491129f5 | leejunguk/UBAL | /Source/Kart_SIDE/Kart_SIDEGameMode.cpp | C++ | cpp | 275 | no_license | // Copyright Epic Games, Inc. All Rights Reserved.
#include "Kart_SIDEGameMode.h"
#include "Kart_SIDEPawn.h"
#include "Kart_SIDEHud.h"
AKart_SIDEGameMode::AKart_SIDEGameMode()
{
DefaultPawnClass = AKart_SIDEPawn::StaticClass();
HUDClass = AKart_SIDEHud::StaticClass();
}
|
16c0437259164ef1ff8b111baffd0016f2117ad5 | 1ae94a7ded88fcbc7aa0cf2649464563cc20355e | IlyaZh/Maiman-Workbench | /src/command.cpp | C++ | cpp | 2,287 | no_license | #include "command.h"
#include "appsettings.h"
extern AppSettings settings;
Command::Command(QString code, QString unit, double divider, quint8 interval, bool isTemperatureFlag, QObject *parent) : QObject(parent)
{
this->Code = code;
this->interval = (interval < MAX_COM_INTERVAL_COUNTER) ? interval : MAX_COM_I... |
c944c11488d647da6584e2d58dccdf6424411a6f | 74a276f3028ba7b25807897d96c9f789db114fb7 | RafaelSantosBraz/Codigos-Gerais | /codigosInicioAno/exerciosApostila/12.cpp | C++ | cpp | 388 | no_license | #include <iostream>
#include <clocale>
#include <cstdio>
using namespace std;
int main(){
double x, y, area, perimetro;
setlocale(LC_ALL, "");
cout << "Informe o primeiro lado: ";
cin >> x;
cout << "Informe o segundo lado: ";
cin >> y;
area = x * y;
perimetro = (2 * x) + (2 * y);
printf("A ... |
1b60b4e4e3f3784e5ef9af0a3ef0c42a8e3e7bfd | 614af95b971e77f612d073401176c8b603190a96 | j10sanders/v8 | /src/regexp/regexp-parser.cc | C++ | cc | 66,432 | permissive | // Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/regexp/regexp-parser.h"
#include <vector>
#include "src/char-predicates-inl.h"
#include "src/heap/factory.h"
#include "src/isolate.h"
#i... |
976eec50a33bcc69019c2ed76ce0d93d737c550c | a584244a4f7c3cf06925690687fd1083e4f02aec | willbryk720/Falcon9_Simulation | /RocketSimulation/main.cpp | C++ | cpp | 61,418 | no_license | /* Author: William Bryk
Simulation of a Falcon v1.1 launch and landing
This program represents an attempt to model a Falcon v1.1 launch, payload delivery, and landing. It includes realistic air resistance, realistic estimates of the changing mass distribution and changing moment of inertia of the falcon, appropriat... |
09d0c8707c324144909a0cf49826d42c2177e06e | fbf0ece00962627dd27a1ab4e05338c75f60efa6 | hfarazi/humanoid_op_ros_kinetic | /src/nimbro/tools/trajectory_editor/src/rvizwidget.cpp | C++ | cpp | 5,938 | no_license | // Incorporates a RViz display
// Author: Max Schwarz <max.schwarz@uni-bonn.de>
#include <trajectory_editor/rvizwidget.h>
#include <trajectory_editor/robotdisplay.h>
#include <rviz/view_controller.h>
#include <rviz/visualization_manager.h>
#include <rviz/robot/robot.h>
#include <sensor_msgs/JointState.h>
#include <O... |
2e1f905824355892fa915bab9b7b925b5d328b0e | dbe422c03904c6b21bff5c323e6bbfa2be6dad22 | goodspeed24e/2014iOT | /import/include/boost_1.54/asio/ip/address_v6.hpp | C++ | hpp | 7,340 | permissive | //
// ip/address_v6.hpp
// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_IP_ADDRESS_V6_... |
366740c859cdd768152c3f62a9bdbfaf5b4c4218 | 86e6b5f334821126fc7cbcd6509a59873ed643da | tarunluthra123/Competitive-Programming | /Algo++/Binary Search/Kth root.cpp | C++ | cpp | 895 | no_license | /*
KTH ROOT
You are given two integers n and k. Find the greatest integer x, such that, x^k <= n.
Input Format:
First line contains number of test cases, T. Next T lines contains integers, n and k.
Constraints:
1<=T<=10 1<=N<=10^15 1<=K<=10^4
Output Format
Output the integer x
Sample Input
2
10000 1
100000000000000... |
39fd7c033346e6019753bba193aac3ea905fe08f | f30ef64363404c73da5b22560efb637aa3a9f915 | FRENSIE/FRENSIE | /packages/utility/distribution/test/tstDeltaDistribution.cpp | C++ | cpp | 29,085 | permissive | //---------------------------------------------------------------------------//
//!
//! \file tstDeltaDistribution.cpp
//! \author Alex Robinson
//! \brief Delta distribution unit tests.
//!
//---------------------------------------------------------------------------//
// Std Lib Includes
#include <iostream>
#incl... |
3bcc50c86d050e97e7197b2a193fc2676318a3e2 | 38b0a35c0cbc3b079faa9661e79eb33c31d34c6d | walkccc/LeetCode | /solutions/0500. Keyboard Row/0500.cpp | C++ | cpp | 681 | permissive | class Solution {
public:
vector<string> findWords(vector<string>& words) {
vector<string> ans;
const vector<int> rows{2, 3, 3, 2, 1, 2, 2, 2, 1, 2, 2, 2, 3,
3, 1, 1, 1, 1, 2, 1, 1, 3, 1, 3, 1, 3};
for (const string& word : words) {
string lowerWord = word;
transfor... |
4d964ffd5768f936d804d3f781c18e5c5db25773 | da2bea30babb2659f3f09804767803bc2a3e8b2d | leeleelee394/Moonlighter | /TeamProject/TeamProject/DXRenderer.cpp | C++ | cpp | 4,105 | no_license | #include "stdafx.h"
#include "DXRenderer.h"
SingletonCpp(DXRenderer)
/********************************************************************************
## DXRenderer ##
D3D디바이스 생성 -> DSV,RTV 생성 -> D2D렌더타겟,팩토리 등등 생성 -> 기본 브러쉬 생성
-> 기본 폰트등록
***************************************************************************... |
5e0e570bd03942d7a3126c33606fc8718b87cbc1 | a2f649ff08b92e66781d90e7995cfd9d0f353009 | increedBull7/C-and-DS-by-Bari | /04-Object-orientation/inheritance.cpp | C++ | cpp | 460 | permissive | #include<iostream>
using namespace std;
class Base{
public:
int x;
void show(){
cout<<"This is from base class : "<<x<<endl;
}
};
class Derived:public Base{
public:
int y;
void display(){
cout<<"This is from derived class : "<<x<<" "<< y<<endl;
}
};
int main(){
... |
ef726b76384b92f87b8d10c55e81f286c3523542 | 85158991d13bb89646ed404a86d1728855faecb7 | TencentCloud/tencentcloud-sdk-cpp | /iss/src/v20230517/model/ControlDevicePresetRequest.cpp | C++ | cpp | 3,101 | permissive | /*
* 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
... |
40b5d1b56e76d910d6577fd4cc526f63af7d0453 | 6d8e4003c2398dc1335e7ff2bd9bb8403d924d49 | lubo3751/CppPrimerPlus | /Chapter05/ex.05.05.cpp | C++ | cpp | 1,162 | no_license | /* ex.05.05.cpp
You sell the book C++ for Fools.Write a program that has you
enter a year’s worth of monthly sales (in terms of number of
books, not of money).The program should use a loop to prompt
you by month, using an array of char * (or an array of string
objects, if you prefer) initialized to the month string... |
b6776456ecd8931bd1fa56fda62a59770dd9143e | 2e5197a8ff11a19230db6564d903d7ab6d3bc3f5 | Hatelix/NyuziToolchain | /lib/Analysis/MemoryBuiltins.cpp | C++ | cpp | 36,542 | permissive | //===- MemoryBuiltins.cpp - Identify calls to memory builtins -------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
360713c119fb9b124fba2d80aaf4af53e2dbff87 | c4e2a70d93b24cea0a1a3f33a3bbd25334a9c973 | lineCode/game_server-1 | /src_my/scene/condition.hpp | C++ | hpp | 713 | no_license | #pragma once
#include "proto/data_base.pb.h"
#include "proto/data_condition.pb.h"
#include "proto/data_player.pb.h"
#include <set>
using namespace std;
namespace pd = proto::data;
namespace nora {
namespace scene {
class role;
void condition_merge(pd::condition_array& a, con... |
09fd69dc35472d1b7d6924c68befe98fd0cfea39 | ab21fb9f5700df78842e9b0dc723f3bc2369d0c5 | korleinster/gamebusdriver | /client/MapTool/MapTool/Terrain.cpp | C++ | cpp | 5,001 | permissive | #include "stdafx.h"
#include "Terrain.h"
#include "Info.h"
#include "VIBuffer.h"
#include "RcTerrain.h"
#include "Shader.h"
#include "ShaderMgr.h"
#include "Texture.h"
#include "Camera.h"
#include "Device.h"
#include "Shader.h"
#include "ResourcesMgr.h"
#include "NaviMgr.h"
#include "MyForm.h"
#include "MainFrm.h"
#inc... |
b68efe20210c519d3bbcd6156a06318d72c13572 | aac1ff0405e3afdcefd61e6921a5d8125962dd19 | deekshithanand/SPOJ | /ONP.cpp | C++ | cpp | 1,143 | permissive | #include<iostream>
using namespace std;
#include<stack>
int prec(char i)
{
if (i == '^')return 3;
else if(i == '*' || i == '/') return 2;
else if(i == '+' || i == '-') return 1;
else return 0;
}
void solve(string &st)
{
string op;
stack<char> stk;
stk.push('N');
for(auto i:st)
{
... |
ef4eee7586c1966f057a2410dc6b981f8179c6ed | 0d3dcf381eabaaa7734c29c0f91fb2934507d78c | smeenai/llvm-project | /clang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-begin-at-eof.cpp | C++ | cpp | 557 | permissive | // RUN: not clang-tidy %s --checks='-*,google-explicit-constructor' 2>&1 | FileCheck %s
// CHECK: :[[@LINE+8]]:11: warning: single-argument constructors must be marked explicit
// Note: the expected output has been split over several lines so that clang-tidy
// does not see the "no lint" suppression comment and ... |
a19f36d059db348eab82298b5ce742985c4c85d6 | 4f16195266598636b25a43d5b6e350846d2478e1 | AbnerLimaa/computer-graphics | /trabalhos/snowman/Snowman/ponto.cpp | C++ | cpp | 578 | no_license | #include "ponto.h"
Ponto::Ponto()
{
this->x = 0;
this->y = 0;
this->z = 0;
}
Ponto::Ponto(float a, float b, float c)
{
this->x = a;
this->y = b;
this->z = c;
}
float Ponto::getX()
{
return this->x;
}
float Ponto::getY()
{
return this->y;
}
float Ponto::getZ()
{
return this->z;
}... |
ee142d42492c12c426bd2b3e717e99d1a5c4fc47 | f47a7ea15ec308ee6012fdef694a656a4ae712af | KhusainovAydar/codeforces | /383div1/A.cpp | C++ | cpp | 1,828 | no_license | #include <bits/stdc++.h>
#define fi first
#define se second
#define endl '\n'
#define pb push_back
#define times clock() * 1.0 / CLOCKS_PER_SEC
//#define pi 3.1415926535897932384626433832795
#define eps 0.000000001
#define cntbit(x) __builtin_popcount(x)
//#define double long double
//#define int ll
#define MIN -214748... |
ac5baf0b1deedf3692f9c75a690775d088865043 | 9a087d30788575670a7800876b9c53cfa994f041 | bizcointeam/bizcoin | /src/util.cpp | C++ | cpp | 37,837 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "util.h"
#include "sync.h"
#include "strlcpy.h"
#include "version.h"
#inc... |
5bd06ec772a9cd019b59dc3f71596e09b1b0975c | ab2276baf02437d52cc0b232413b59f61aa80061 | athomas355/4760_Project_2 | /master.cpp | C++ | cpp | 1,610 | no_license | #include "bin_addr.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
#define DEBUG 1
using namespace std;
struct cli_struct{
bool s, t;
int x, time;
char* datafile;
};
cli_struct parse_args(int argc,char* argv[]);
int main(int argc, char* argv[]) {
... |
937865044c1bcc37e9107ae963426b86a71c827a | b54fce778daea75415158e8ac33717711b41e456 | cpe102/lab14-2562-2-Ponyapat | /lab14_3.cpp | C++ | cpp | 523 | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a[] = {1,2,4,6,9};
double b[] = {5.5,2.1,13,-7,6.9,0,25,11.1,-4};
int *pa = a;
double *pb = b;
pa = max_element(&a[0],&a[5]);
cout << "Address of the highest value in array A is " << pa << "\n";
cout << "The highest value in arra... |
d459b1c7951062ace25c5a15c8b230bddb2ac1b4 | c0610cf014d16446c6ec81696d88481e2aca70a1 | Lgeu/ahc002 | /ahc3/40_answer.cpp | C++ | cpp | 13,279 | no_license | // メモ: 未整理の utils は https://atcoder.jp/contests/ahc001/submissions/20928259
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array... |
fdccdbe2ccbca88ca003a41adc41737480a4a579 | 80c00eabffc0eb7221d6b2eb9e786b21504713f2 | inviwo/inviwo | /modules/basegl/src/datastructures/stipplingsettingsinterface.cpp | C++ | cpp | 2,118 | permissive | /*********************************************************************************
*
* Inviwo - Interactive Visualization Workshop
*
* Copyright (c) 2020-2023 Inviwo Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided th... |
7a39c9a3c3e851d486a697483c39de7fb36d4f6d | a4ea797f62e5883bdfeddce795157c90f1f55cde | drbaird2/Restart | /Objects/AABB.cpp | C++ | cpp | 4,775 | no_license | #include "AABB.h"
#include "../Utilities/Constants.h"
#
AABB::AABB()
: p0(Point3(0.0,0.0,0.0))
, p1(Point3(0.0,0.0,0.0))
{
// = (p0 + p1) / 2;
}
AABB::AABB(Point3 p0, Point3 p1)
: p0(p0)
, p1(p1)
{
//centroid = (p0 + p1) / 2;
}
AABB::AABB(const AABB& aab)
: p0(aab.p0)
, p1(aab.p1)
{
//centroid = (p0 + p1) /... |
1af6b8ee2446da12ab1df19771691f540230dd24 | 4cad150c75ab71517425e69523edb0f36b4be44c | flxf/codeforces | /315/b.cpp | C++ | cpp | 485 | no_license | #include <iostream>
using namespace std;
long long a[100000];
long long y = 0;
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < m; i++) {
int t;
cin >> t;
if (t == 1) {
int v, x;
cin >> v >> x;
a[v - 1] = x - y;
... |
8f311792c2727d03cb01d83d75176492887f654f | a647fb21cfbdb85a0bb3fe335e9feb847ab81c7e | abe-mused/CSC4110-assignment1 | /HelloWorld.cpp | C++ | cpp | 341 | no_license | // Simple C++ program to display "Hello World"
// Author: Abe Mused <hf2358@wayne.edu>
// Header file for input output functions
#include<iostream>
using namespace std;
// main function -
// where the execution of program begins
int main()
{
// prints hello world
cout<<"Testing git merge!";
... |
de7c6b7d7b3e9625b917f309d19cf49588710bc0 | 207276afbd634779774548091f4b03aa8978e79a | aliahsan07/mutual-exclusion | /bakery.cpp | C++ | cpp | 1,690 | no_license | #include <iostream>
#include <thread>
#include "bakery.h"
bool bakery :: instance = false;
bakery* bakery :: m = NULL;
bakery :: bakery(int i) {
n = i;
choosing = new bool[n];
token = new int[n];
for(int i = 0; i < n + 1; i++)
choosing[i] = false;
for(int i = 0; i ... |
ed6a3e9647c63eeb82280eca61f50866febbf29e | 83fac3b7c9c9c5cd52205165fd52523e90fbce4b | PauloRolim/LP1_IMD_2020 | /atividade_aula03_correcao/main.cpp | C++ | cpp | 936 | no_license | #include <iostream>
#include <string>
#include <fstream>
void show_usage(const std::string &prog_name);
int main(int argc, char *argv[]) {
if (argc == 1) {
show_usage(argv[0]);
return 1;
}
std::string action = argv[1];
if (action != "add"){
show_usage(argv[0]);
retur... |
acbc1896129ea70c07d91a42344d2d304d7c1080 | cf7078d323db1b86e0b6beaa9b93336976ec3289 | bitoncoin/biton | /src/net.cpp | C++ | cpp | 56,884 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Biton developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "db.h"
#include "net.h"
#include "init.h"
#include "addrman.h"
#include "ui... |
c6a403d28fdaf03d57b8e515338a827a7938a322 | 48d85041de8ab8747938db76b9988f974b37ea8c | Watch-Later/ncbi-cxx-toolkit-public | /include/objtools/readers/reader_listener.hpp | C++ | hpp | 2,032 | no_license |
/* $Id$
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyri... |
ef06e8085c796db13905c57eb844fe2f46f2ec6d | 9c1849009a37951ab050933f62dc945d5f6e2768 | karunmatharu/Android-4.4-Pay-by-Data | /external/chromium/net/server/http_server.cc | C++ | cc | 13,493 | permissive | // Copyright (c) 2011 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 "net/server/http_server.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/md5.h"
#include "base/string_number_... |
604f5ddd7a99e1a49340dabdbce849135773f286 | bc43b1b64e61570a1b717ee86e742366b09eef76 | lidianxiang/sinsy0.91 | /lib/label/LabelMaker.cpp | C++ | cpp | 64,407 | permissive | /* ----------------------------------------------------------------- */
/* The HMM-Based Singing Voice Synthesis System "Sinsy" */
/* developed by Sinsy Working Group */
/* http://sinsy.sourceforge.net/ */
/* -----------------------------... |
6b8eb5f275100a7a65909e2ee1655a854fc29677 | 84dbf44514e8be79b3b32bcd9158579c79ac4340 | oyvindskog/lunarLander | /entity/key_handler.cpp | C++ | cpp | 544 | no_license | #include "key_handler.h"
#include <SDL.h>
key_handler::key_handler(entity *ent) : component(ent) {
if (_ent->has_component<physics>()) {
_physics = &_ent->get_component<physics>();
}
}
void key_handler::handle_events(SDL_Event *) {
const Uint8 *currentKeyStates = SDL_GetKeyboardState(NULL);
if (currentKe... |
455e6782850bc534f25a93ecb7038f05eb385fbd | 715c0cab1cc53283afdfb17de46929f55d99b15f | kitounliu/ledger | /libs/ml/include/ml/optimisation/rmsprop_optimiser.hpp | C++ | hpp | 2,715 | permissive | #pragma once
//------------------------------------------------------------------------------
//
// Copyright 2018-2020 Fetch.AI Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the Licen... |
389d32cc1a0e835511d646f18201fdcee52edfd8 | 4fd1ff962e293231a2721aff96ee66537455a5f7 | vusec/safeinit | /llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | C++ | cpp | 14,140 | permissive | //===-- AMDGPUTargetMachine.cpp - TargetMachine for hw codegen targets-----===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
50ff853b37a0f7ab4628af0d967d66a11792cfa5 | 5d4db015ed963018516486ac490bdb7cc08b870e | WillowOfTheBorder/boost.simd | /include/boost/simd/function/definition/shl.hpp | C++ | hpp | 824 | permissive | //==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
@copyright 2016 J.T.Lapreste
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*... |
dbc463a637e77e08bb66b959d8630abd401d5a7b | 740047392efa7827b452ffa60f55840d10c7441a | edgarVazquez43/TAKESHI | /catkin_ws/src/tools/justina_tools/src/JustinaHRI.cpp | C++ | cpp | 19,139 | no_license | #include "justina_tools/JustinaHRI.h"
bool JustinaHRI::is_node_set = false;
std::string JustinaHRI::pathDeviceScript;
//Members for operating speech synthesis and recognition. (Assuming that blackboard modules are used)
ros::Publisher JustinaHRI::pubFakeSprRecognized;
ros::Publisher JustinaHRI::pubFakeSprHypothesis;
... |
2ff6112228dc85acd14e717f243871ddb1cfaddc | ea01b2fe09425430f0288e94dd67916066711a87 | Helical-Games/HG-DNAGameplay-UE4P | /Source/DNAAbilities/Private/DNAEffectExtension.cpp | C++ | cpp | 231 | no_license | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "Core.h"
#include "DNAEffectExtension.h"
UDNAEffectExtension::UDNAEffectExtension(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
|
b999888cbfe4044e2107751849b930881a6aa4ac | 007fc21ddf442bae84fa09c6361516f41b64a3eb | JayKarhade/OS-Assignment | /sjf.cpp | C++ | cpp | 2,211 | no_license | #include<iostream>
using namespace std;
int mat[10][6];
void swap(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}
void arrangeArrival(int num, int mat[][6])
{
for(int i=0; i<num; i++)
{
for(int j=0; j<num-i-1; j++)
{
if(mat[j][1] > mat[j+1][1])
{
... |
936b9d59853e5862214195d0600136462704ec82 | dde156ff0733218891f2cd999e4aa3f23e706f20 | baaahs/sparklemotion | /brain/sw/components/iso/iso-palette.cpp | C++ | cpp | 1,168 | permissive | //
// Created by Tom Seago on 12/30/19.
//
#include "iso-palette.h"
#include <math.h>
IsoPalette::IsoPalette(uint8_t len, const RgbColor *values) :
m_len(len), m_values(values)
{
}
RgbColor
IsoPalette::colorInPalette(float progress) {
if (progress > 1.0f) {
float iPart;
progress = modf(progr... |
7be5fb8dc7cc038fb9d320e3278b496b01da6b28 | 329eacb34c3b63a25c2567cf677a1df4b31a4611 | walking-appa/connectedhomeip | /src/app/server/Mdns.cpp | C++ | cpp | 11,073 | permissive | /*
*
* Copyright (c) 2021 Project CHIP 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 requir... |
bb9ec3d08d413acdbd109cb3d62ef7ca50a2ebf0 | 150050942dfdd9c9ffe823a1f18fa50c6377558f | Dolphiniac/Vulkan | /Engine/Code/Engine/Input/TheKeyboard.cpp | C++ | cpp | 2,431 | no_license | #include "Engine/Input/TheKeyboard.hpp"
//-----------------------------------------------------------------------------------------------
TheKeyboard *g_theKeyboard = nullptr;
//-----------------------------------------------------------------------------------------------
TheKeyboard::TheKeyboard()
{
InitializeAr... |
923bbc9e5402746369a93cab05d433ba397bab59 | 616ba9d2f64ce80e7d7db33b6007fbbd92747f2b | robocopnixon/cudf | /cpp/tests/replace/replace_nulls_tests.cpp | C++ | cpp | 32,656 | permissive | /*
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
*
* Copyright 2018 BlazingDB, Inc.
* Copyright 2018 Alexander Ocsa <cristhian@blazingdb.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the... |
79da520fa7a623b33c57effb1bf02b476fb0ac51 | 9afae0aaee57d66a317bb0592c2b6c722eb19177 | AsteriskChan/PhotoEditor | /geometrydialog.cpp | C++ | cpp | 3,158 | no_license | #include "geometrydialog.h"
#include "ui_geometrydialog.h"
#include <QSpinBox>
#include <QSlider>
GeometryDialog::GeometryDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::GeometryDialog)
{
ui->setupUi(this);
imageLabel = new QLabel;
img=new QImage;
imageProcess = NULL;
imageLabel->setA... |
e471897c111c6b5e78d105ccace1935a425b57e5 | 87a85a7b8083d26349cba305352f653e158fa0eb | cpmech/vismatrix | /src/boost/spirit/home/lex/tokenize_and_parse.hpp | C++ | hpp | 14,618 | permissive | /*=============================================================================
Copyright (c) 2001-2008 Hartmut Kaiser
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)
=========================================... |
e772c8540081637421f3a3558d408d38d4273d35 | 96a831e4d0412d1e785a057075d664f0bc397b56 | mehrabha/04_BattleTank | /BattleTank/Source/BattleTank/Private/TankAimingComponent.cpp | C++ | cpp | 1,551 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "TankAimingComponent.h"
// Sets default values for this component's properties
UTankAimingComponent::UTankAimingComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can t... |
6087b658578f2a409abecd141135aedb4fcfa5c9 | 16248ae2676190ae1f82c35ad55a0fdc25b3c366 | kpdev/llvm-project | /libc/test/utils/FPUtil/x86_long_double_test.cpp | C++ | cpp | 2,899 | permissive | //===-- Unittests for x86 long double -------------------------------------===//
//
// 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
//
//===---------------------------... |
7603a34a50dd3dc18b254ba47ce1c4f7eb1a4a5e | fbe3d08e49195b3bede0032e369a9a3b0f56eb28 | HannahJHan/BlueNoiseSampling | /wei-noise-master/11-DiffSamp/src/code/Main/Math.cpp | C++ | cpp | 2,602 | permissive | /*
Math.cpp
Li-Yi Wei
09/04/2013
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#include <stdlib.h>
#include <math.h>
#include "Math.hpp"
#include "Exception.hpp"
#include "Random.hpp"
#include "Sample.hpp"
// assumes unit box domain
int RValue(int argc, char **argv)
{
... |
e381fdbcbbd98f7c394747064aa34357a2f3c767 | 6052b88751850b2ba5146ac3c86423c75158d287 | seancassell/parallelstl | /Test/swap_ranges.cpp | C++ | cpp | 3,330 | no_license | #include "stdafx.h"
namespace ParallelSTL_Tests
{
struct SwapableType {
SwapableType() : _Val(rand()), _Swap(false)
{
}
int _Val;
bool _Swap;
};
void swap(SwapableType& _A, SwapableType& _B) {
std::swap(_A._Val, _B._Val);
_A._Swap = true;
_B._Swap = true;
}
TEST_CLASS(SwapRangesTest)
{
templ... |
10b869d406359740fd123cc2a4e5c45da5308df5 | 8b2c1b68e4e3c962b61cc7d18419ada3ba203fe0 | ilerJemos/AlgorithmFromEntryToGiveUp | /C++/CppAlgorithm/chapter5/5_teamQueue.cpp | C++ | cpp | 1,059 | no_license | #include<cstdio>
#include<queue>
#include<map>
using namespace std;
const int maxt = 1000+10;
int main(){
int t,kase = 0;
while(scanf("%d",&t)==1&&t){
printf("Scenario #%d\n",++kase);
map<int,int> team;
for(int i = 0;i<t;i++) {
int n,x;
scanf("%d",&n);
... |
91545795cb627240c169cecbbe6be8840b8b67ac | fe4526dbfce204a81a4b5d752ef9374cf092ee57 | chehr/txt_demo_c_download | /FtTxtWorkspace/TxtDemo05_DbcCallbackInput1M1/src/main.cpp | C++ | cpp | 2,818 | no_license | /**********************************************************
* Compiler: gcc / g++
*
* Demonstration of working with the Transfer Area: using CallBack-Function when Transfer-Area is updated
* Connections
* I1: Switch
* M1: Motor
*
* Demo_05 - using Callback-Function
* - Start Transfer with StartTxtDo... |
64fe42f8e42bab9f2a7bd5c87f0b6bb43f4c063c | cf2ae7b1af107714b792d06f85d46ccd6995dac6 | azusalee/MyCustomMars | /marsksim/boost/numeric/conversion/detail/meta.hpp | C++ | hpp | 3,851 | no_license | // (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
// Use, modification, and distribution is 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)
// See library home page at http://www.boost.org/libs/numeric... |
78a02883b90963a72aceafce241be2aa73357cc3 | d8fc00828195c161a235e656674bd803f6759f61 | Vizionnation/chromenohistory | /gpu/command_buffer/service/service_transfer_cache.cc | C++ | cc | 12,408 | permissive | // Copyright (c) 2017 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 "gpu/command_buffer/service/service_transfer_cache.h"
#include <inttypes.h>
#include <utility>
#include "base/bind.h"
#include "base/strin... |
033a4387f473164f474980ca2ed367db2a99ad36 | 768c334dc8b6d47e465e48a8a5fd8f127bbba10d | longstl/mus12 | /_Library/_Include/boost/lambda/detail/operator_return_type_traits.hpp | C++ | hpp | 28,735 | no_license | // operator_return_type_traits.hpp -- Boost Lambda Library ------------------
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
//
// 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)
//
// For more ... |
25cb93dee8effa512649eaa77b496bf2352ba0a8 | a9ca91f66a2ff850cc3414d6561096676fc61fa2 | pavelburan/cardiac_sim | /observers/obs_stimulus.cpp | C++ | cpp | 1,185 | no_license | #include "obs_stimulus.h"
#include "../system.h"
#include "../grids/grid.h"
Obs_stimulus::Obs_stimulus(System& system, const std::string& configFileName, const std::string& keyPrefix):Observer(system,configFileName,keyPrefix),t0(0.0),dt(0.0),te(0.0),xi0(0.0),dxi(0.0),eta0(0.0),deta(0.0),zeta0(0.0),dzeta(0.0),tLast(0.0... |
f6ccfd35083909e1421c5c8c5c371d6ec0a74ca9 | 4ac1d9be5c06debce266e5431ab0e39d5309ed4c | alexandraback/datacollection | /solutions_5695413893988352_0/C++/Siyao/B_test.cpp | C++ | cpp | 1,267 | no_license | #include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
using namespace std;
char tmp1[100],tmp2[100];
int ans1[100],ans2[100];
int tans1[100],tans2[100];
int len;
long long minv=-1;
void dfs(long long value, int i)
{
if(i==len)
{
if(value<0) value = -value;
if(minv==-1||value<minv... |
a2d81d69707ee58c1966331508c757364c4c3d9b | fb768ed54fb1b1c84d61d356cef2d61b49c574ec | ufukhurriyetoglu/AaltoASR | /tools/morph_lattice/MorphSet.cc | C++ | cc | 2,480 | permissive | #include <stdlib.h>
#include <vector>
#include "MorphSet.hh"
#include "str.hh"
MorphSet::MorphSet() : max_morph_length(0) { }
MorphSet::Node*
MorphSet::insert(char letter, const std::string &morph, Node *node)
{
// Find a possible existing arc with the letter
Arc *arc = node->first_arc;
while (arc != NULL) {
... |
5acef7be56b95ff055d9bf0d450ed9e6bb33df69 | acaf474349e1cb7f4cd01d395579d1794dacc63e | tstr/CTVisualizer | /src/gui/LabelledSlider.cpp | C++ | cpp | 1,103 | no_license | /*
Labelled slider class
*/
#include <QStylePainter>
#include <QStyleOptionSlider>
#include "LabelledSlider.h"
void LabelledSlider::paintEvent(QPaintEvent* event)
{
//Draw actual slider
QSlider::paintEvent(event);
QStylePainter painter(this);
QStyleOptionSlider options;
options.init(this);
options.orientati... |
91bc564eff66ab111b6a1f3f107084cd7a93720a | 222b92cb284b40740eded412a24a34031264ed40 | muschellij2/FSL6.0.0 | /extras/include/boost/boost/test/utils/basic_cstring/bcs_char_traits.hpp | C++ | hpp | 4,338 | permissive | // (C) Copyright Gennadiy Rozental 2004-2008.
// 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)
// See http://www.boost.org/libs/test for the library home page.
//
// File : $RCSfile: bcs_char_traits... |
3e6ee249cab0b78f1511ab0b5fc8d7fba8fab5f7 | be3eceec0c18ef547c9a499cfa948081c6845007 | OpenWinch/test-workflow | /src/state.cpp | C++ | cpp | 956 | permissive | /**
* @file state.cpp
* @author Mickael GAILLARD (mick.gaillard@gmail.com)
* @brief OpenWinch Project
*
* @copyright Copyright © 2020
*/
#include "openwinch.hpp"
#include "state.hpp"
bool State::checkRun(State current) {
return (State::RUNNING == current|| State::START == current);
}
bool State::checkStop... |
c0a4769c4218734a39b4649e0f2cb23f117da57b | 1ac8bf9669f8796e94490bb2b0c449a9f8236457 | isabella232/harmony-drlvm | /vm/jitrino/src/dynopt/ValueProfiler.cpp | C++ | cpp | 5,794 | permissive | /*
* 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 ... |
afa0c2fcc1432697e1d64fd1b2960e545e80e6cd | 75a5c9f1723b1a5fadb124d93816290d6780750d | Tryweirder/gvisor | /test/syscalls/linux/fcntl.cc | C++ | cc | 66,306 | permissive | // Copyright 2018 The gVisor 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... |
8fdf4e42cde178897a536919b70a9c092681cdb2 | 4df54be05983a53bf8c4c65ac75d482142f4a59f | Alexander25470/Juego-de-naves-en-cpp- | /coso que esquiva cositos.cpp | C++ | cpp | 9,838 | no_license | #include <stdio.h>
#include <windows.h>
#include <conio.h>
#include <stdlib.h>
#include <list>
#include <iostream>
using namespace std;
#define arriba 72
#define izquierda 75
#define derecha 77
#define abajo 80
#define ENTER 13
void gotoxy(int x, int y){
HANDLE hCon;
hCon = GetStdHandle(ST... |
bcd81072ea1dad9c32ae3d1c56a35a782f65ad76 | 2e941264c7ef578b76196d43d3231565580e33c6 | sjRifat/others_OJ | /LeetCode/1480. Running Sum of 1d Array.cpp | C++ | cpp | 239 | no_license | class Solution {
public:
vector<int> runningSum(vector<int>& v) {
vector<int>vv;
int n=v.size(),i,j,s=0;
for(i=0;i<n;i++){
s+=v[i];
vv.push_back(s);
}
return vv;
}
};
|
a66f41fe1867fed031b3b7a3bb8d58fb46cbdf76 | 45f0468072732ae0608c66e12e5574e10377d984 | rmchakra/CPlusPlus-OOPS-DataStructures-Projects | /hw3/llisttest.cpp | C++ | cpp | 4,833 | no_license | /*
if other = null
+operator
*/
#include "lliststring.h"
#include "gtest/gtest.h"
#include <iostream>
//all tests should have same name eg FIbtest or whatever
//i.e. first parameter
//parameter 2 is name of test, can be whatever you want
//expect_eq is expect equal
class lliststringtest : public testing::Test {
pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.