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 |
|---|---|---|---|---|---|---|---|---|
b6fa35a0e510414749a20f6ec65f358372dd0da1 | 0409984f0612a5eb7a2be08129bc9ab30fa0fe56 | dumpinfo/GameMatrixTest | /CCode/PluginCode/C4SpaceManipulators.cpp | C++ | cpp | 18,482 | no_license | //=============================================================
//
// C4 Engine version 4.5
// Copyright 1999-2015, by Terathon Software LLC
//
// This file is part of the C4 Engine and is provided under the
// terms of the license agreement entered by the registed user.
//
// Unauthorized redistribution of sou... |
ad740f3883d57bac546788c97b9d71116e3cd508 | fd4ad0efd0b2d63c798ece553528d124e7a6e068 | ComputationalBiomechanicsLab/opensim-creator | /src/oscar/Maths/Sphere.hpp | C++ | hpp | 218 | permissive | #pragma once
#include <glm/vec3.hpp>
#include <iosfwd>
namespace osc
{
struct Sphere final {
glm::vec3 origin;
float radius;
};
std::ostream& operator<<(std::ostream&, Sphere const&);
}
|
451a8485a6d8d38be03c256810a021491484026c | 482bd07cea323ccd2840f6cf1ae7a3c09a83f956 | aFleetingTime/MySmallTarget | /Day07/Test/vptrTest.cpp | C++ | cpp | 1,151 | no_license | #include <iostream>
using namespace std;
class Test1
{
public:
Test1(int a)
{
this->a = a;
}
virtual void print()
{
cout << "Test1::a = " << a << endl;
}
private:
int a;
};
class Test2 : public Test1
{
public:
Test2(int a, int b) : Test1(a)
{
this->b = b;
}
void print() //一旦基类有一个函数修饰为virtual,那么无论派生类是... |
55d8e8eb736b1abf76e6984e3f2e1a8c708761fe | 042a48fe29ed4769eea9df407bb7baa7143c3c38 | jie786389209/leetcode-problem | /tree/Binary Tree Level Order Traversal II.cpp | C++ | cpp | 1,743 | no_license | Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
return its bottom-up level order traversal as:
[
[15,7],
[9,20],
[3]
]
... |
5ce969fbb1ccf4eef95e1c6678919f6a0da54ce3 | 4ae583dcd8190d7ecc49c2d0e11d53d2c4832c8c | openharmony-sig-ci/ace_ace_engine | /frameworks/base/utils/date_util.cpp | C++ | cpp | 2,100 | permissive | /*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... |
caa9a9a5bb0b8be03a4f6536ead9358c4ba27a9e | e73fab11274276dad2817a67f8c5169c25847cf3 | jigneshjain25/algo-class-1 | /DFS.cpp | C++ | cpp | 1,471 | no_license | #include<iostream>
#include<vector>
#include<queue>
#include<fstream>
#define rep(i,a,b) for(i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
int TIME=0;
using namespace std;
class node{
public:
int name;
vector<int> adj;
bool explored;
int d;
int s;
int f;
int p... |
cf44d71396dbf3c0a664be841bd0625286f9d156 | 24429fa5a124ebc653efa016bee61e37c377fca8 | Infin8Gamer1/DigipenWanicProjectsYear2 | /CS230/CS230 Lab10/HighLevelAPI/src/Collider.cpp | C++ | cpp | 3,442 | no_license | //------------------------------------------------------------------------------
//
// File Name: Collider.cpp
// Author(s): Jeremy Kings (j.kings)
// Project: BetaFramework
// Course: WANIC VGP2 2018-2019
//
// Copyright © 2018 DigiPen (USA) Corporation.
//
//---------------------------------------------------------... |
18f94997cd9bcd76c30c4090602bdd169eaf0f58 | ad4e24dcf5cc44ef746e8739ae5bbd9f155c5b13 | victor-anisimov/Umpire | /src/umpire/op/CudaAdviseAccessedByOperation.hpp | C++ | hpp | 981 | permissive | //////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2016-20, Lawrence Livermore National Security, LLC and Umpire
// project contributors. See the COPYRIGHT file for details.
//
// SPDX-License-Identifier: (MIT)
////////////////////////////////////////////////////////////////... |
af057267b9c65d0675162161fdb997ad586c99f6 | b370a0cbdc54a08d38d021771279ccd896c30f7f | yuyuwu5/Algorithm-design-and-analyst | /joe.cpp | C++ | cpp | 1,122 | no_license | #include<stdio.h>
#include<stdlib.h>
#include<memory.h>
void karatsuba_multiply(long long *res,const long long *p,const long long *q, int size){
long long t0[size], t1[size], r[size<<1]={0};
if(size<=4){
for(int i=0;i<size;i++)for(int j=0;j<size;j++)r[i+j]+=p[i]*q[j];
}else{
int nSize=(size>>1);
for(int i=0;i<... |
b98ac21d67d6601b1f28260198336eb1afae8cbd | b8069801db2d8ef96dde3e6b79d61abd2ac7bd2f | MJJBennett/CPPlugins | /test/testing.hpp | C++ | hpp | 973 | permissive | #ifndef CPPLUGINS_TESTING_HPP
#define CPPLUGINS_TESTING_HPP
#include <iostream>
#include <string>
#include <optional>
// Very simple 'test' helpers.
template<typename T>
bool test_eq(T lhs, T rhs, std::optional<std::string> test_name = {}) {
if (lhs == rhs) {
std::cout << "[PASSED] ";
if (test_na... |
72f63208c868af6803065425bcb45b475265eaa7 | 7c17e021d135c22268b30b8eed35fe18d2107814 | FatmaElbadry2/Formula101 | /Car Racing Project/src/1_directional_light/directional_light_scene.hpp | C++ | hpp | 1,354 | no_license | #ifndef DIRECTIONAL_LIGHT_SCENE_HPP
#define DIRECTIONAL_LIGHT_SCENE_HPP
#define GLM_FORCE_CXX11
#include <glm/glm.hpp>
#include <scene.hpp>
#include <shader.hpp>
#include <mesh/mesh.hpp>
#include <textures/texture2d.hpp>
#include <camera/camera.hpp>
#include <camera/controllers/fly_camera_controller.hpp>
#include<time... |
49f56024fe18166ad816ec2bdbbc2b92fb6f7f04 | 21bd2af953681ed796e0730742410be2aa5de4ef | sumopandian/Marmalade | /thirdparty/assimp/code/Common/PostStepRegistry.cpp | C++ | cpp | 10,164 | permissive | /*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,... |
5275ce138aa485b7aef273e6170ace65e39e5a79 | 6f1209a19656e66f757e9f716fe7039de6b0eb40 | nerdooit/chromium | /content/browser/indexed_db/indexed_db_database.cc | C++ | cc | 66,114 | permissive | // Copyright (c) 2013 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 "content/browser/indexed_db/indexed_db_database.h"
#include <math.h>
#include <algorithm>
#include <limits>
#include <set>
#include <utility... |
f9494c18ff0342aa6954e8a4838637160c647530 | 70cd3ced1a89e899e267e73d7ec45b951f27b367 | yohan-choi-dev/chromium | /chrome/browser/ui/views/tabs/tab_strip.cc | C++ | cc | 144,658 | permissive | // Copyright 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 "chrome/browser/ui/views/tabs/tab_strip.h"
#include <stddef.h>
#include <algorithm>
#include <iterator>
#include <limits>
#include <string>
#in... |
450c8c1fb6bcc3936c706a211a9357399ae9674f | df6719178d3ad14e29a21c7ca53577b7b60dcf74 | elcrypto/Pulse | /src/qt/bitcoinstrings.cpp | C++ | cpp | 8,340 | permissive | #include <QtGlobal>
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif
static const char UNUSED *bitcoin_strings[] = {QT_TRANSLATE_NOOP("bitcoin-core", ""
"Unable to bind to port %d on this computer. Pulse is probably already "
"running."... |
9c6a6fcbf3dfdb7d07941b656d183dccaffefcaa | 8a3c7a9e33b6dcc94e1ce7460c46622fe8828674 | CP-lands/Codeforces | /Diluc_and_Kaeya_C_div2.cpp | C++ | cpp | 917 | no_license | #include<bits/stdc++.h>
using namespace std;
//https://codeforces.com/contest/1536/problem/C
#define nl '\n'
#define pb push_back
#define fi first
#define se second
#define bug cout<<"bug here!\n"
typedef long long ll;
void Solve(){
int n;
string s;
cin>>n>>s;
vector<pair<int, int>> prefix(n);... |
8ce70db1bb09b446f6156c57ba1c0a25171316ef | 3482a92767b397872f94c51fcfa419429c8a7543 | yular/CC--InterviewProblem | /LeetCode/leetcode_employee-importance.cpp | C++ | cpp | 1,056 | no_license | /*
*
* Tag: DFS
* Time: O(n)
* Space: O(n)
*/
/*
// Employee info
class Employee {
public:
// It's the unique ID of each node.
// unique id of this employee
int id;
// the importance value of this employee
int importance;
// the id of direct subordinates
vector<int> subordinates;
};
*/
class... |
fb0cdb57eab2b6218ec888b325c4f9573c125d4a | 0b10162be0bfaf14133cd93f534f313ea9c1cfe7 | rovinbhandari/Programming_Scripting | /ACM-ICPC/ACM-ICPC_12/Amritapuri/online contest/ACM-ICPC Amritapuri 2012 Online Competition Accepted Solutions/B/cpp/00003478_B_STICKS_amicpc120186.cpp | C++ | cpp | 450 | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int T;
cin>>T;
int len[50000];
while(T--){
int N,M;
cin>>N>>M;
int l;
for(int i=0;i<N;i++){
cin>>l;
len[i] = l;
}
double x,y,z;
double max = -1;
for(int i=0;i<M;i++){
cin>>x>>y>>z;
double diag = sqrt(x*x + y*y + z*z);
... |
b6ffb28f4532aa634d11fb0482b69d592eb38c98 | 7ad946a6655a186cbd0508bedbe98ba032a61612 | Mukesh01Coder/Geeksforgeeks | /Array/RotateArray.cpp | C++ | cpp | 389 | no_license | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long ll;
int main() {
//code
int t; cin>>t;
while(t--){
int n,k; cin>>n>>k;
int a[n];
for(int i=0; i<n; i++) cin>>a[i];
reverse(a,a+k);
reverse(a+k,a+n);
reverse(a,a+n);
for(int i=... |
51b7feab1ad054d115b0b1a05632571146fa5854 | 550d1e144024baf7c6d4d27cb16a84a665ec7456 | SlavickKuzmin/gl3.0_simpleProject | /ShadersTool.cpp | C++ | cpp | 3,805 | no_license | //
// Created by slavickkuzmin on 8/1/16.
//
#include <stdio.h>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <GL/glew.h>
#include "ShadersTool.h"
Shaders::Shaders(const char *vertex_file_path, const char *fragment_f... |
2a84af6b6150da77bd3086773c285ddb217f7cb0 | c48c152c7da6635ad4fa1f92c0e97cf5bc1cfdab | masbog/rethinkdb | /src/clustering/administration/main/cache_size.cc | C++ | cc | 13,416 | permissive | #include "clustering/administration/main/cache_size.hpp"
#include <limits>
#include <string>
#if defined(__MACH__)
#include <cstdio>
#endif
#include <inttypes.h>
#include <stddef.h>
#include <unistd.h>
#if defined(__MACH__)
#include <availability.h>
#include <errno.h>
#include <mach/mach.h>
#include <sys/sysctl.h>
... |
7c17417d5bf1fbd9849099e43a2dbfc3c382f9f2 | c3295382a06f1684c873752b7312726ea8cf8b4f | h4hany/yeet-the-leet | /algorithms/Medium/208.implement-trie-prefix-tree.cpp | C++ | cpp | 1,542 | no_license | /*
* @lc app=leetcode id=208 lang=cpp
*
* [208] Implement Trie (Prefix Tree)
*
* https://leetcode.com/problems/implement-trie-prefix-tree/description/
*
* algorithms
* Medium (49.77%)
* Total Accepted: 343.2K
* Total Submissions: 689.6K
* Testcase Example: '["Trie","insert","search","search","startsWith"... |
005b9e32941506a1ed3522f52ac0968daaa33f32 | c94d016ed7f9721cda0e4585a544d19559de3040 | ondrej-vesely/GEO1004-hw3 | /cpp/tree-RANSAC/external/magnum/src/Magnum/Math/Test/StrictWeakOrderingTest.cpp | C++ | cpp | 4,165 | permissive | /*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
2020 Vladimír Vondruš <mosra@centrum.cz>
Copyright © 2018 Borislav Stanimirov <b.stanimirov@abv.bg>
Permission is hereby granted, free of charge, to any person obtaining a
copy ... |
9fc2943d31a7f6661517350b991cfcff68fb94d0 | 0e91ced3d7b9e16a00b277587c1bf7bea29d70bc | blueboxd/chromium-legacy | /chrome/browser/search_engines/template_url_service_unittest.cc | C++ | cc | 109,665 | permissive | // Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stddef.h>
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"... |
6e7d5efe54b99f6fff84d1446259448f37259b68 | b911fad2caed10c27f009f609988cea4a09aec30 | bondarevts/amse-qt | /2010/zabrodina/task7/test/Test1.cpp | C++ | cpp | 978 | no_license | #include<QTest>
#include <QtTest>
#include<QSignalSpy>
#include"Test1.h"
Test1::Test1():QObject(){
m_dial = new MyDialog();
}
void Test1::setValueToTimer() {
QTest::keyPress(m_dial->setLineEdit,Qt::Key_1);
QTest::keyPress(m_dial->setLineEdit,Qt::Key_0);
QTest::mouseClick(m_dial->setButton,Qt::LeftBu... |
d7c58209559219deea17a7fa345d4db80255410f | f31de8927e6dd5c72ae73023b55615c193d98b29 | dkargin/miniroscpp | /include/generated/std_msgs/UInt64.hxx | C++ | hxx | 4,501 | permissive | // Generated by gencxx from file std_msgs/UInt64.msg
// DO NOT EDIT!
#pragma once
#include <string>
#include <vector>
#include <map>
#include <array>
#include <miniros/types.h>
#include <miniros/serialization.h>
#include <miniros/traits/builtin_message_traits.h>
#include <miniros/message_operations.h>
namespace ... |
7e1904375b36bd2eb9a8189fef4f07ffa867d9ed | 6eb5403c55b6126ae2f27972caa568dc588eb582 | lmarent/nsis-ka-0.98 | /ntlp/test/responder_cookie.cpp | C++ | cpp | 8,264 | no_license | // ----------------------------------------*- mode: C++; -*--
// responder_cookie.cpp Unit test for the responder cookie
// ----------------------------------------------------------
// $Id:$
// $HeadURL:$
// ==========================================================
//
// Copyright (C) 2009, all ... |
30af7a4dd561f51be6d12f0b9d8163e4aedeccdb | eaac3f90a2d5a0c933807ee34318e19ade800e6d | nthallen/citcims | /triple/DSDaq/Hercules.cc | C++ | cc | 7,618 | no_license | #include <errno.h>
#include <strings.h>
#include <sys/neutrino.h>
#include <hw/inout.h>
#include "Hercules.h"
#include "oui.h"
#include "nortlib.h"
Hercules::Hercules(int ad_se) : dsdaqdrv("Hercules") {
int i;
n_ad = ad_se ? 16 : 8;
n_dio = 5;
n_bio = 40; // hard coded, but really configurable.
dabu = 4; // ... |
f64524b1ee115662fe908e0315cc3e29924b4da8 | e31606158acf2f7d50c47b62ff1dcf04a549b075 | AlexMorson/DustScripts | /lib/drawing/Sprite.cpp | C++ | cpp | 2,553 | no_license | #include '../math/math.cpp';
class Sprite
{
string sprite_set;
string sprite_name;
sprites@ sprite;
float sprite_offset_x;
float sprite_offset_y;
float sprite_width;
float sprite_height;
float origin_x;
float origin_y;
Sprite(string sprite_set='', string sprite_name='', float origin_x=0.5, float origin_... |
cc207d84220afe0a843b8e3785ccb72495c6721c | 9f20b5a322827bee138ee5d9e29588ccccded4ce | cai-pi-rinha/DHBW | /source/HTTP_Header.cpp | C++ | cpp | 1,381 | no_license | #include "HTTP_Header.hpp"
HTTP_Header::HTTP_Header()
{
//iterator of the List
it_entry = Header_entrys.MakeIterator();
}
HTTP_Header::~HTTP_Header()
{
}
String HTTP_Header::Creat_request_Line(String request_method_name, String request_URI, String HTTP_version)
{
this->request_line += request_method_name;
thi... |
9ce6b1e4c65c91d80bc10c2d5cf121ab88d5bdcf | 7586c21cf65598ed91de4de3bc2c36c87df70970 | fxrc2018/Demos | /CPP/tinyrenderer_sdl/test.cpp | C++ | cpp | 227 | no_license | #include <iostream>
#include "model.h"
using namespace std;
int main(int argc, char const *argv[])
{
Model *model = new Model("obj/african_head.obj");
cout<<model->nfaces()<<endl;
system("pause");
return 0;
}
|
e5cd50eeeb05c10114b19faa16c21993bae00e29 | e80e1fe7db564284b8987f212a81fa7807bc1fcb | changhuaqiu/old-linux | /Http/net/InetAddress.cpp | C++ | cpp | 810 | no_license | //
// InetAddress.cpp
// qiuServer
//
// Created by 邱昌华 on 2021/2/15.
//
#include "InetAddress.hpp"
#include "SocketOps.hpp"
InetAddress::InetAddress(uint16_t port, bool loopbackOnly,bool ipv6)
{
memset(&addr_,0,sizeof addr_);
addr_.sin_family = AF_INET;
addr_.sin_port = sockets::Htons(port);
}
I... |
981a3060de608bfced604979e73dc2fa05439b0b | d1b054188f64a38d28cfde855f7dcf72015b89d7 | Bl00per/AIE-Programming | /Day Code/Day 14 - Constructors/Player.cpp | C++ | cpp | 1,777 | no_license | #include "Player.h"
#include <iostream>
#include <cstring>
Player::Player()
{
std::cout << "Default constructor" << std::endl;
// created a character array on the heap (free-storage)
// m_name holds the memory address of the new character array on the heap
m_name = new char[10];
strcpy(m_name, "");
m_health = 0.... |
f40df997048312c1db20934b37b8ef39ae25e49e | 43fbf66cc1ff606f6776cedca7d7bcbdd049f707 | ahoque1999/SpectraST | /SpectraST/SpectraSTLibEntry.hpp | C++ | hpp | 8,015 | no_license | #ifndef SPECTRASTLIBENTRY_HPP_
#define SPECTRASTLIBENTRY_HPP_
#include "SpectraSTPeakList.hpp"
#include "Peptide.hpp"
#include <iostream>
#include <string>
#ifdef __MINGW__
#define MSVC
#endif
#ifdef MSVC
#include <winsock2.h>
#include <windows.h>
#else
#include <pthread.h>
#endif
/*
Program : Spectrast
Auth... |
6d910a41e0d6afd71f5775adafdcfbca4b929b67 | e7d345fd2b0ac6ad1b3be3c9f22299214512fffc | HH-LFY/HH | /CPP/汉诺塔问题.cpp | C++ | cpp | 447 | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int i = 1;
void move(int n,char s,char e){
printf("第%d步:将第%d号盘子从 %c 移到 %c 。\n",i++,n,s,e);
}
void hanoi(int n,char a,char b,char c){
if(n == 1){
move(n,a,b);
}else{
hanoi(n-1,a,c,b);
move(n... |
0c3c186968fdd70b2767055008e23255f9f211e6 | 9857cbe6a9d16ba4cade15aa879d3641d7646fdb | tabghu/LeetCode | /2020-11-05/面试16.01交换数字.cpp | C++ | cpp | 644 | no_license | //编写一个函数,不用临时变量,直接交换numbers = [a, b]中a与b的值。
//
//示例:
//
//输入 : numbers = [1, 2]
//输出 : [2, 1]
//提示:
//
//numbers.length == 2
//
//
//来源:力扣(LeetCode)
//链接:https ://leetcode-cn.com/problems/swap-numbers-lcci
//著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
class Solution {
public:
vector<int> swapNumbers(vector<int>& numbers) {
... |
58601cd3651dc8afb222fadc6107983737933025 | 36d95bece641b24fa0075459f355eece5d95cef4 | LJCLWS/Compiler | /FreeC++/src/parser.cpp | C++ | cpp | 15,346 | no_license | #include "lexer.h"
#include "parser_.h"
#include <stack>
#include <queue>
#include <vector>
#include <iostream>
#include "object.h"
#include "error.h"
using namespace std;
int parser:: pop_terminal()
{
//token序号出队列
//temp_terminal = TokenListQueue.front();
static int j = 0;
if (j < TokenListQueue.size())
{
temp... |
b907ede822e15f16b163fda946fcc4f3a9216eed | 5dd5eaf144a0a8cb565aa616174d7ecb407dc041 | sunxfancy/LR_Parser | /sources/BNF_parser.cpp | C++ | cpp | 9,045 | permissive | #include "BNF_parser.h"
#include "afx.h"
#include <VMap.h>
#include <stdio.h>
#include <ctype.h>
BNF_parser::BNF_parser()
{
}
BNF_parser::BNF_parser(const BNF_parser& other)
{
}
BNF_parser::~BNF_parser()
{
}
BNF_parser& BNF_parser::operator=(const BNF_parser& other)
{
}
bool BNF_parser::operator==(const BNF_pa... |
0e61e97e2c1f863d06097d1b801ec9560d28fa2d | af0fdcd41100b91b1d7c0152fcda75c39c0191c0 | guanwwjian/MyCode | /作业/人工智能/102342 关键 ID3算法/关键 102342 ID3算法/关键 102342 ID3算法/关键 102342 ID3算法.cpp | C++ | cpp | 433 | no_license | // 关键 102342 ID3算法.cpp: 主项目文件。
#include "stdafx.h"
#include "Form1.h"
using namespace 关键102342ID3算法;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// 在创建任何控件之前启用 Windows XP 可视化效果
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// 创建主窗口并运行它
Application... |
0a89d5016ba74b5cf8c5a6bd61a89d47628ed6a4 | d6ee41c239d21873eb96e4ec5914e140a2b2f071 | wushengkai/2020C-homework | /基础班作业/201920420221 吴晟楷(3)/第一题.cpp | C++ | cpp | 227 | no_license |
#include<iostream>
using namespace std;
const int build(12);
int main(){
int height;
cout<<"Enter your height:__\b\b";
cin>>height;
cout<<"You are "<<height/build<<" feet and "<<height%build<<" inches high.";
return 0;
} |
be14b61dc65bcd6596e8b712c701c8a6b5703099 | ce5ea1a76c4606d86ddc56082d59aef0c575edeb | rgbitx/MAVRIC_Library | /control/manual_control.hpp | C++ | hpp | 10,048 | permissive | /*******************************************************************************
* Copyright (c) 2009-2016, MAV'RIC Development Team
* 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. R... |
3a9e1d49fff036efe725a6cb4f03f9ed9a4bb6c1 | d08544a3a3e0806e118ddf2287d73e2b901410c4 | cvernier/DeepNTuples | /DeepNtuplizer/plugins/DeepNtuplizer.cc | C++ | cc | 9,185 | no_license | // user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "../interface/ntuple_cont... |
374335788fa77dd5bfe6aaf2d5af4059a3b667f4 | c09be8371941f65128259cd8352be8a3860f6794 | Mooksc/RTS-Engine | /include/loadGame.hpp | C++ | hpp | 480 | no_license | #include <sstream>
void loadGame() {
int var, n;
int s[4];
std::string line, line2;
std::ifstream loadFile("Sample.sav");
for(int i = 0; i < 4; ++i){
loadFile >> line >> var;
s[i] = var;
}
std::cout
<< s[0]
<< std::endl
<< s[1]
<< std::endl
<< s[2]
<< std::endl
... |
b2bb2b88e512f68f9bf372dd857b3aecccd0ccf3 | 82a6917530267ddf446dad841a486d70ede49fee | Br4ggs/i2cSnake | /gamecontroller_src/snakeGame.cpp | C++ | cpp | 4,260 | no_license | #include "snakeGame.h"
#include "stdlib.h"
#include <Arduino.h>
#ifdef __cplusplus
extern "C" {
#endif
static uint8_t fieldWidth_ = 0;
static uint8_t fieldHeight_ = 0;
static uint8_t wrapField_ = 0;
static uint16_t snakeLenght_ = 0;
static GameObject snakeFood_;
static GameObject* snakeBody_;
static Snake... |
bd40bbed662d269568a24bbbad185af88973e40a | 0490658b420d5cc6350a2dd0b55518eb98ee40d1 | PDi-Communication-Systems-Inc/lollipop_external_chromium_org | /third_party/webrtc/modules/video_coding/main/source/jitter_buffer_unittest.cc | C++ | cc | 72,553 | permissive | /*
* Copyright (c) 2011 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 contribut... |
b7f5e3b7715f71b822de8a3cbf3a823b70c784d5 | 865fa5018df60fb5cc9f7da82522329b0846cd6f | wangben85/CplusplusBasic | /Qt_Test/In_VS_2015_test/vs2015_qt_list/list/list/GeneratedFiles/qrc_list.cpp | C++ | cpp | 1,333 | no_license | /****************************************************************************
** Resource object code
**
** Created by: The Resource Compiler for Qt version 5.11.1
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#ifdef QT_NAMESPA... |
bb306f399d3880190a15a70f19bb5ca6cf636096 | 1b1808d506d8bfb46c58f43e6e0c75eb0b7acc72 | bogus/findik | /playground/barfan/0.0.1-DEV-01/request.hpp | C++ | hpp | 1,059 | no_license | #ifndef FINDIK_IO_REQUEST_HPP
#define FINDIK_IO_REQUEST_HPP
#include <string>
#include <vector>
#include <boost/asio.hpp>
#include "header.hpp"
namespace findik {
namespace io {
/// A request received from a client.
class request
{
public:
request();
enum method_type {
get,
post,
... |
85fc228394086b5ba693251193cbe5ee65415f5b | d54b113b61851a4f8f2ad10ca5af83c6ed228a54 | sdk-team/aliyun-openapi-cpp-sdk | /ecsops/src/model/OpsReleaseIpAddressRequest.cc | C++ | cc | 1,940 | permissive | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... |
bdabf449395bf5f65fc515d5f5332d6e13456b7a | 4b1d875f11d54bbc6c76414b22e6f0b7a089efdf | lvcargnini/zircon | /system/ulib/cobalt-client/histogram.cpp | C++ | cpp | 7,431 | permissive | // Copyright 2018 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 <float.h>
#include <math.h>
#include <string.h>
#include <cobalt-client/cpp/histogram.h>
#include <cobalt-client/cpp/histogram-internal.h>
#incl... |
3a266a8d61881f23bb7e97a37f217a90a9f357f3 | 86595233d4b35d5967555b30f3c75c8752cb6e64 | primenumber/LSmethod | /level2.hpp | C++ | hpp | 301 | permissive | #pragma once
#include <tuple>
#include <vector>
#include "matrix.hpp"
#include "level0.hpp"
#include "level1.hpp"
namespace std {
using namespace math;
Vector operator*(const SpMat &lhs, const Vector &rhs);
// y = A^T * x
Vector trans_mv(const SpMat &lhs, const Vector &rhs);
} // namespace math
|
94f18fac82710accb72192108b37bdd9a1a94869 | 36cfd6058839234e835e0da853f20fd2d104584d | Wiladams/graphicc | /examples/Milliseconds/milliseconds.cpp | C++ | cpp | 297 | permissive | #include "drawproc.h"
float scale;
void setup() {
size(640, 360);
noStroke();
scale = width / 20.0f;
}
void draw() {
for (int i = 0; i < scale; i++) {
colorMode(COLOR_MODE_RGB, (i + 1) * scale * 10);
fill(millis() % (int)((i + 1) * scale * 10));
rect(i*scale, 0, scale, height);
}
}
|
3c89d8945720995210fbb2bb7769d41322a64ae8 | 4857da667e5684a36664a58277085a0f83412544 | novaquark/aws-sdk-cpp | /aws-cpp-sdk-appconfig/source/model/ListTagsForResourceRequest.cpp | C++ | cpp | 993 | permissive | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
e97dba40a5d9ef2b69e8609e240d2bca3787ad2f | ffbb193848ef42acff89e93774420de5f136bbde | jimsdog/GGRTMonitor | /Thirdparty/ECFramework/ECNavigationBar.cpp | C++ | cpp | 2,776 | no_license | /****************************************************************************
**
** Copyright (C) 2017 JIMSDOG
**
** ECFramework is a frameworke based on Qt5.3, you will be more efficient with it.
**
** Version : 0.0.1.0
** Author : Jimsdog
** Website : https://github.com/jimsdog
** Project : https://github.com/jimsdo... |
e86ba2de6ba365040f70dd5217a708fa99739b3a | d67543e2e694769587b63ea79b93c8e1978d7822 | c-dilks/sims_mposka | /geant/fmsu/simgen/src/Analysis.cxx | C++ | cxx | 20,327 | no_license | # include "Analysis.h"
using namespace std;
ClassImp(Analysis)
const Float_t PI=3.14159265;
Analysis::Analysis(TTree * events,Float_t sqrts_)
{
printf("HELLO EVERYBODY FROM ANALYSIS\n");
evtr = events;
sqrts = sqrts_;
printf("TMC PARTICLE INSTANCE\n");
parttmp = new TMCParticle();
//TString datfile="";... |
fe95c7bcba7c41287416e64d118009b14d5a17fc | d2dc0dd460e5daa1884d059408ad47aa301d0bb5 | graphcore/popart | /willow/src/patterns/log1pgradoppattern.cpp | C++ | cpp | 2,083 | permissive | // Copyright (c) 2020 Graphcore Ltd. All rights reserved.
#include <string>
#include <vector>
#include <popart/graph.hpp>
#include <popart/ir.hpp>
#include <popart/op/div.hpp>
#include <popart/op/log1p.hpp>
#include <popart/patterns/log1pgradoppattern.hpp>
#include <popart/tensor.hpp>
#include <popart/tensorinfo.hpp>
... |
8442606fc97eda6599c4391fa016c2ff4c21c78e | 25abce3b6182fa06ddfc4d355ab2b57d466f8810 | zouguangxian/omim | /3party/boost/boost/coroutine2/detail/wrap.hpp | C++ | hpp | 2,845 | permissive |
// Copyright Oliver Kowalke 2014.
// 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_COROUTINE2_DETAIL_WRAP_H
#define BOOST_COROUTINE2_DETAIL_WRAP_H
#include <type_traits>
#inc... |
e0cfeeb75e7b3ce8790b9b323108919e4f32e752 | 3146f28616c513929b44787824cdd5306d9c50cc | KDE/okteta | /libs/kasten/controllers/document/versionview/versionview.cpp | C++ | cpp | 1,743 | no_license | /*
This file is part of the Kasten Framework, made within the KDE community.
SPDX-FileCopyrightText: 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "versionview.hpp"
// tool
#include "versiontablemodel.... |
839958ba5e0a5ef703cb6a85e7fb3e54140b2ec0 | e59da4e98004a6cf644350def6886b2fa556813d | Muderru/planescape_code | /libdreamland/xml/xmlnode.cpp | C++ | cpp | 5,208 | no_license | /* $Id: xmlnode.cpp,v 1.8.34.3 2009/10/11 18:35:38 rufina Exp $
*
* ruffina, Dream Land, 2003
*/
/***************************************************************************
xmlnode.cpp - description
-------------------
begin : Fri May 4 200... |
30da047b1677eca24714a54c57a22dd0d69e4c8d | 4d64f62c8a23f8bf5810029a8b339aea0d1282d9 | nmhung1210/chromium | /ui/gfx/font_fallback_win.cc | C++ | cc | 13,850 | permissive | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gfx/font_fallback_win.h"
#include <dwrite_2.h>
#include <usp10.h>
#include <wrl.h>
#include <wrl/client.h>
#include <algorithm>
#includ... |
1d91199f765224e4b75f13851c117628a975e269 | f031a09e9be6fa0c0be9c84df6db71378cac8362 | sebbekarlsson/websitecompiler | /src/Website.cpp | C++ | cpp | 8,620 | no_license | #include "Website.h"
Website::Website(std::string directory) {
this->dir = directory;
ResourceManager::load(this->dir + "/site.json");
this->site = nlohmann::json::parse(
ResourceManager::get(this->dir + "/site.json")
);
std::cout <<
"[Initializing]: Creating director... |
f66371d8a8f548d4ac0872cbd719684fde3634f5 | 70fe8700011150e591a5f96405e0e4c9d886a6be | newmttbrb/workspace | /c++/bi/Selecter.cpp | C++ | cpp | 1,154 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <errno.h>
#include <algorithm>
#include "Selecter.h"
Selecter::Selecter() : max_sd(0), next(0), ready(0) { FD_ZERO(&ma... |
2e654f4e3c8cff917af439d0739510668fab0d5b | b1d3b0f7f92ddb8d650dfc7d36511113ce1d5834 | esimionato/lanarts | /src/interface/GameHud.cpp | C++ | cpp | 3,055 | no_license | /*
* GameHud.cpp
* Various components of the overlay display & side bar
* Includes inventory manipulation
*/
#include <ldraw/display.h>
#include <ldraw/draw.h>
#include "draw/draw_sprite.h"
#include "draw/SpriteEntry.h"
#include "draw/TileEntry.h"
#include "gamestate/GameInstSet.h"
#include "gamestate/GameStat... |
65273396588f3d4a0927bc9a2ca88160ca6ac30a | 266a65cb0f2316aedd558a626ee85e3a421c5da7 | WhiZTiM/duplichase | /dupscan/useful_qt_functions.cpp | C++ | cpp | 1,818 | no_license | /*******************************************************************************************
** (C) Copyright September 2013 - October 2013 by
** @author: Ibrahim Timothy Onogu {WhiZTiM}
** @email: <ionogu@acm.org>
**
** Provided this copyright notice appears on all derived works;
** Use, modification and distribut... |
eb7bb23bfed16be3be70890c999233d14576fd6b | 532c1501f50da7908c3d258a85dcafa9dd2763ca | killvxk/GDI-PlusPlus | /DLL/hook.cpp | C++ | cpp | 3,202 | no_license |
#include "override.h"
typedef struct {
void* addr;
BYTE hook [1 + sizeof(void*)];
BYTE orig [1 + sizeof(void*)];
CRITICAL_SECTION lock;
} HookData;
#pragma warning(push)
#pragma warning(disable:4312)
static FARPROC xatoi(LPCSTR s)
{
DWORD p = 0;
while (*s) {
p <<= 4;
if ('0' <= *s && *s <= '9') {
p |... |
d7a06f9594a1ca045f1c9d85b9dd997b4fb657c0 | 33e4f9011cd7b71e8d8b51d8cfa72e7cf38d6a23 | yuukidach/OnlineJudge | /LeetCode/sliding_window/Offer59-1.cpp | C++ | cpp | 587 | no_license | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
vector<int> res;
int l = 0, r = 0;
deque<int> q;
while (r < nums.size()) {
while (!q.empty() && nums[r] > q.back()) q.pop_back();
q.push_back(nums[r]);
r++;
... |
f9c280321ec06539aae64facc37153ef05968949 | 693fc1ec38497d7bd32076f1aab2a38344a096c0 | Wasrek/POSN15 | /Dynamic Programming Algorithm2/FC_Golden Age.cpp | C++ | cpp | 649 | no_license | /*
TASK:FC_Golden Age
LANG: CPP
AUTHOR: KersaWC
SCHOOL: REPS
*/
#include<bits/stdc++.h>
using namespace std;
int n,a[5100],dp[5100][110];
int play(int u,int k){
if(u>n || k==0) return 0;
if(k==0) return 0;
if(dp[u][k]!=-1) return dp[u][k];
int i,ans=0;
for(i=0;k-i-1>=0;... |
0d3250e5f16adb077df1a70167930905aa45a96b | fb88c376c588e348657e8fc591ce31e58f7fc47f | tuliolages/impt | /tests/tests.cpp | C++ | cpp | 1,729 | no_license | /* TODO: tirar um monte aqui*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <sys/timeb.h>
#include <fstream>
#include <vector>
#include <time.h>
#include <sys/time.h>
#include <string>
#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <dire... |
903923ac50e2b6364e0564921726b9168c787f2e | 55db43f8210660dfe6a4d85fcf6037dd4670570c | Ashleywutq/PIC_10C_HW1 | /HW1/HW1/cards.cpp | C++ | cpp | 5,639 | no_license | //
// Ashley Wu
// PIC_10C_HW1
// cards.cpp
// implementation of classes.
//
#include "cards.h"
#include <cstdlib>
#include <iostream>
/*
You might or might not need these two extra libraries
#include <iomanip>
#include <algorithm>
*/
/////////////////////////////////////////////////////////////////////////... |
66d3c73966a99e0f2beca76763d31a7382a43a64 | 11fa53aec89b7cd3c3dea766e337ef4c58df4f1e | iColabora/pixie | /src/carnot/planner/distributed/splitter/presplit_analyzer/split_pem_and_kelvin_only_udf_operator_rule_test.cc | C++ | cc | 11,490 | permissive | /*
* Copyright 2018- The Pixie 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 ag... |
419751153f330fe4e8f27580b11de4dd8e1902de | e01f8ec9c4a016f06b2ae0d0af890533e0a42a29 | Stephen1993/ACM-code | /hdu1787.cpp | C++ | cpp | 515 | no_license | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
#include<iomanip>
#define INF 999999
using namespace std;
const int MAX=100;
int Euler(int n){
int sum=n;
for(int i=2;i*i<=n;++i){
if(n%i==0){
sum-=sum/i;
... |
da29e30a661371713dd320eb001297631354bd52 | 1ae820f19c4e961080e870ef6f3f045785993b71 | mlpack/mlpack | /src/mlpack/methods/ann/init_rules/oivs_init.hpp | C++ | hpp | 4,641 | permissive | /**
* @file methods/ann/init_rules/oivs_init.hpp
* @author Marcus Edel
*
* Definition and implementation of the Optimal Initial Value Setting method
* (OIVS). This initialization rule is based on geometrical considerations as
* described by H. Shimodaira.
*
* For more information, see the following paper.
*
*... |
37f27e02166d4740eee2e68393b2f18341626b5d | 1362f94361425f6a6db517609595083516b408bd | sungkukpark/Above-The-Cloud | /ATC/Engine/StaticUI.cpp | C++ | cpp | 1,615 | permissive | #include "DXUT.h"
#include "Transform.h"
#include "GraphicsManager.h"
#include "Texture.h"
#include "StaticUI.h"
USING(Engine)
StaticUI::StaticUI(void)
{
}
StaticUI::StaticUI(std::wstring _texturetag)
{
UIBase::SetInformation(_texturetag);
}
StaticUI::StaticUI(std::wstring _texturetag, Transform* _parent)
{
UIBase... |
f46988136507906e6f64020b784604e66b9b8d71 | 423873d4ea806a6993465bc1c35bc6cc4ad0b236 | dingmingxin/cocos2d-x-2.2.2-liquidfun | /cocos2dx/shaders/CCShaderCache.cpp | C++ | cpp | 10,287 | permissive | /****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2011 Ricardo Quesada
Copyright (c) 2011 Zynga Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and asso... |
bf82d8cff403d6520ea1808487d564dfe86749e0 | 0d8d91c1ec5bf569c3aefafae24424b488904a66 | 15831944/mcadp | /MCad01/Mt/MtWaitLoop.cpp | C++ | cpp | 8,551 | no_license | //==========================================================================================
// Copyright (C) 2006-2008. K.Matsu. All rights reserved.
//
// MODULE: M_CadApi.cpp
//
// 機能 コマンド処理用バックグラウンドのタスクの起動
//
// K.Matsu 08/01/04 Created.
//==========================================================... |
0d17aec7ab53cf45d32e57dfde58b5a681aa1ee8 | b12dec0f7049ff092e5821666ec0b3780042c80f | Krul002/42-projects | /CPP/day05/ex03/PresidentialPardonForm.cpp | C++ | cpp | 1,836 | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PresidentialPardonForm.cpp :+: :+: :+: ... |
362982f4c2fbcdd86c8941a74cc5c4814a33226c | 327bf4b45fd8d07e2ef5f7c589428e0c9f0bd503 | jisantuc/gdal-warp-bindings | /src/unit_tests/dataset_tests.cpp | C++ | cpp | 13,380 | permissive | /*
* Copyright 2019 Azavea
*
* 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 wr... |
0ba0576df3719c4cd56e58fdac06d2546dc38670 | f12bdc2d573bcf8c29562bab40a61aca44f48884 | riyaz-ahmad/DSA-Practice | /lenght_even_odd.cpp | C++ | cpp | 1,959 | no_license | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
/* Link list node */
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
}*head;
Node *findNode(Node* head, int search_for)
{
Node* current = head;
while (current != NULL)
{... |
6489cea6f0a786e29f6214a77d6f04a8e574aadf | 58cd3aaa22fbf66a63d217f0197867e7d8346bd1 | sebastianpecak/avrosp | /SourceCode/AVRProgrammer.hpp | C++ | hpp | 2,599 | no_license | /*****************************************************************************
*
* Atmel Corporation
*
* File : ErrorMsg.cpp
* Compiler : Microsoft Visual Studio 2005
* Revision : $Revision: 8.0.50727.42 $
* Date : $Date: 2009-06-12 $
* Updated by : $Au... |
78751e56013f0fa03537ec93d44046ec3026f85e | 2046359df56f0297f603c3bebff5312bd2fe19ce | AsifWatson/LightOJ | /1010.cpp | C++ | cpp | 824 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
///freopen("in.txt", "rt", stdin);
///freopen("out.txt", "wt", stdout);
int t,caseno=0;
scanf("%d",&t);
while(t--)
{
int a,b;
scanf("%d %d",&a,&b);
if((a==1 || b==1) || (a==2 && b==2))
{
... |
b2886e932665782e217cce37430f55e561b8e8a3 | b6d9c83797fc823da4cdda26db9d303173716cad | mcheese/cheesebase | /test/storage.cc | C++ | cc | 1,213 | permissive | #include "catch.hpp"
#include "storage.h"
#include "common.h"
#include <array>
#include <algorithm>
using namespace cheesebase;
using namespace std;
SCENARIO("stored data can be read") {
GIVEN("A Storage and data") {
Storage store{ "test.db", OpenMode::create_always };
const size_t size{ 500 };
const s... |
5775d007a4fb605c10806c48a9d3bf8ed564f7ed | 3d706f1b855ecc7f94eccc887c51109684d887e0 | jianmingwu/leetcode | /removeElement/removeElement.cpp | C++ | cpp | 454 | no_license | class Solution {
public:
int removeElement(int A[], int n, int elem) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int i, j;
i = j = 0;
while (j < n) {
if (A[j] != elem)
A[i++] = A[j++];
... |
d439cf476b3ad77489b484f261afbd1a1dc0ae2e | 4538e4fa55906d2ec516ec8cc6d996c3244154b4 | Tudor67/Competitive-Programming | /LeetCode/Problems/Algorithms/#2493_DivideNodesIntoTheMaximumNumberOfGroups_sol1_bfs_O(N(N+E))_time_O(N+E)_extra_space_586ms_50MB.cpp | C++ | cpp | 2,461 | permissive | class Solution {
private:
using Graph = vector<vector<int>>;
const int INF = 1e9;
void storeConnectedComponentNodes(int srcNode, const Graph& G, vector<int>& connectedComponentNodes){
vector<bool> vis(G.size(), false);
queue<int> q;
q.push(srcNode);
vis[srcNode] = t... |
6ba3c7c88f0be269a36c5d646d35aa14b88c3061 | 95a4e0733bf1855622a39c30a41021876cc81a95 | faserg1/traps_sweeper | /src/engine/render/opengl/gl_enabled_attributes.cpp | C++ | cpp | 587 | no_license | #include "gl_enabled_attributes.h"
#include <unordered_set>
#define GLEW_STATIC
#include <GL/glew.h>
namespace
{
// enabled attributes are global anyway. So why not to store ig globally?
std::unordered_set<GLuint> vertexAttribs;
}
namespace engine::render::opengl
{
void enableVertexAttribArray(u32 loc)
... |
1e894d1fe66f71d3a3c7e2a134db764b13da2de3 | 374b5c85cded666211f62d7b2c4d97b74c83ac0a | zshwuhan/MMLE-GaP | /src/sample_hmc.cpp | C++ | cpp | 2,943 | no_license | #include <RcppArmadillo.h>
#include <RcppEigen.h>
#include <numeric>
#include "commons.h"
using namespace Rcpp;
using namespace arma;
double U_cpp(arma::vec& eta_n, const arma::ivec& v_n, const arma::mat& W,
float alpha, float beta){
return -posterior_eta_cpp(eta_n, v_n, W, alpha, beta);
}
arma::vec ... |
3936b88514f551fcd33dc1c1499e97ea2cbf84c4 | 59941ea06ac76ed2a7e5154bee40fb419de61ab9 | manuelmann/tsduck-test | /src/libtsduck/dtv/descriptors/tsAudioStreamDescriptor.cpp | C++ | cpp | 5,877 | permissive | //----------------------------------------------------------------------------
//
// TSDuck - The MPEG Transport Stream Toolkit
// Copyright (c) 2005-2020, Thierry Lelegard
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the f... |
ed1eee48547ec19f4417f182d3a9cd47650c71bc | f7065f51ed4bfa426ad9917d8ec47febf81001f7 | Ariel1986/LeetCode | /100.SameTree.cpp | C++ | cpp | 1,062 | no_license | /* Question:
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
*/
/* 思路:
1)两棵树都为空,说明前面的节点全部相同,两棵树相等,返回true
2)p或q任何一个为空,另一个不为空,返回false
3)p和q所指向的节点的值不同,返回false
4)分别递归判断p和q所指向的左右子树是否相等
*/
... |
5a170b2eb356ca4a9151c8867be4f65ebc8839d1 | 44d723a96835bb012145905e8580e9b028ac2796 | LakshmipriyaPurushan/Thunder | /Source/WPEProcess/Process.cpp | C++ | cpp | 18,275 | permissive | /*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 RDK Management
*
* 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 co... |
99ff0526360b47674d30a230115bd45193ed918a | e682e713f46c97748feaec86b20291c8996ff5a1 | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE124_Buffer_Underwrite/s02/CWE124_Buffer_Underwrite__CWE839_rand_82_goodB2G.cpp | C++ | cpp | 1,401 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE124_Buffer_Underwrite__CWE839_rand_82_goodB2G.cpp
Label Definition File: CWE124_Buffer_Underwrite__CWE839.label.xml
Template File: sources-sinks-82_goodB2G.tmpl.cpp
*/
/*
* @description
* CWE: 124 Buffer Underwrite
* BadSource: rand Set data to result of rand(... |
af00bc670fbd190aafd1f7a2be301e9357052c6b | 0d2335dca96e6ad112a01d1e40dd87f1beab2a6b | subnr01/subs-practice | /leet_code/bitwise/ugly_num.cpp | C++ | cpp | 505 | no_license | /*
Write a program to check whether a given number is an ugly number.
Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7.
Note that 1 is typically treated as an ugly number.
*/
class Solution {
public:... |
4f9b6eadcdbfddbe857da6218203eda3c44caac6 | 9df04ce7c2f806151bdd3792eb173f3758105c79 | AdvaitKoparkar/DSA | /Course2/Week1/test/test_bfs.cpp | C++ | cpp | 1,015 | no_license | #include "../src/bfs.cpp"
#include<bits/stdc++.h>
void test_datatype()
{
Graph *graph = read_graph("../test/graphs/graph0.txt");
assert(graph->n_nodes == 1 && graph->n_edges == 0 && graph->nodes.size() == 1 && "test_datatype");
}
void test_simplebinarytree()
{
Graph *graph = read_graph("../test/graph... |
3ada9e9e4ab66497c48e00a88d0f4afb6d73b7ba | 44d0b370dfe710d721b055c325d370729ebff4f8 | guisongchen/leetcode_try | /201-250/222_Count Complete Tree Nodes.cpp | C++ | cpp | 1,429 | no_license | /*
Given a complete binary tree, count the number of nodes.
Note:
Definition of a complete binary tree from Wikipedia:
In a complete binary tree every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at th... |
f002b791f05d9c004a450f8975e23bd2e5d88b39 | 31121326a588e1252951c646510804d6a328074d | zjin-lcf/HeCBench | /hbc-cuda/main.cpp | C++ | cpp | 1,797 | permissive | #include <iostream>
#include <iomanip>
#include <cstdlib>
#include <chrono>
#include "parse.h"
#include "sequential.h"
#include "util.h"
int main(int argc, char *argv[])
{
program_options op = parse_arguments(argc,argv);
int max_threads_per_block, number_of_SMs;
query_device(max_threads_per_block,number_of_SMs,... |
4522202bb6ae1e40493e48641088f8729b47aa06 | bd59958f7302e07dcdfd593e73957f1d5802c2dc | gitter-badger/RadJav | /library/src/RadJav/v8/RadJavV8BlockchainV1.cpp | C++ | cpp | 56,916 | permissive | /*
MIT-LICENSE
Copyright (c) 2017 Higher Edge Software, LLC
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... |
bb1c9b91992edb1b1efc7a18722c91b97bc191f7 | a8a0c75d27d01606a12930b75f8ad0c8366bb4e2 | andres-arana/degree-7506-tp | /source/tests/integration/decompressor_tree_tests.cpp | C++ | cpp | 5,857 | no_license | #include "../../dependencies/tut/tut.hpp"
#include "../../ppmc/decompressor.h"
#include "../../ppmc/compressor.h"
#include "../../bplus/bplus_container.h"
#include "../../commons/io/stream_binary_source.h"
#include "../../commons/io/stream_binary_destination.h"
#include "../../commons/io/stream_char_destination.h"
#inc... |
e2672ab081981a28add806dd3812cd14998955b2 | 458038c82b692084d650b81dd9645a3947ad44dd | HrishikeshKarale/Homework6-CMPN603 | /Time.cpp | C++ | cpp | 1,025 | no_license | #include <stdlib.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include "Time.h"
using namespace std;
Time::Time( void )
{
seconds = 0;
}
Time::Time( int _seconds )
{
seconds = _seconds;
}
Time::Time( string t )
{
setTime( t );
}
void operator>>(Time t)
{
int start=0;
std::string _seconds... |
15423a9b92e1a88b05ff8fe0fb09283e1bc28845 | fc9d6d94451db9e89732e7a46eac8c4ed57de819 | CarlosIvanCardenas/vindinium-cpp-client | /client.cpp | C++ | cpp | 5,654 | no_license | #include "game.h"
#include BOTINCLUDE
#include "state.h"
#include "utils.h"
#include "network.h"
#include "options.h"
#include "tiles.h"
#include <signal.h>
#include <boost/regex.hpp>
#include <cassert>
#include <fstream>
#if defined(OPENMP_FOUND)
#include <omp.h>
#endif
#define TURN_DURATION .8
Game
play_game(cons... |
367ce2f75294dc20d52abd821902a54edb46f409 | f0abe2f2d10085848aa74d1e18e676f14e4e4e89 | DanielLivingston32/Data-Structures_and_Algorithms | /Codeforces/RGB Protaganist.cpp | C++ | cpp | 724 | no_license | #include <iostream>
#include <climits>
using namespace std;
int knapSack(long v[], long w[], int n, long W)
{
if (W < 0)
return INT_MIN;
if (n < 0 || W == 0)
return 0;
int in = v[n] + knapSack(v, w, n - 1, W - w[n]);
int ex = knapSack(v, w, n - 1, W);
return max(in, ex);
}
int mai... |
c91b3b981808ca4675874d8dd0ecb9c7a44914cf | c700054718a121d71fe27ce94284ff5c6fdb4c98 | BlenderCN-Org/spacegameengine | /plugins/d3d9/src/surface/color_holder.cpp | C++ | cpp | 1,844 | no_license | /*
spacegameengine is a portable easy to use game engine written in C++.
Copyright (C) 2006-2016 Carl Philipp Reh (carlphilippreh <at> gmail.com)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation... |
dfea9aefe63c49cb246f21c141209df85dc62736 | 6e7d91d789db1b55e8aaaa684d14ef6d6d6d537e | AkiLotus/AkikazeCP | /Vault/Codeforces Problems/828A.cpp | C++ | cpp | 12,786 | no_license | /**
Template by Akikaze
Applied for C++11/C++14 (Add -std=c++14 to your IDE.)
To make it compatible to C++98, remove all tuple typedefs,
unordered sets/maps/multisets/multimaps, and add a space
between two '<'/'>'s when declaring multi-dimensional vectors.
**/
/**
Code written by a random fan of momocashew and C... |
c5067d873ccde69324b2252c0abf40a5b61048ee | fe7a2d766fd81be9901f40b4e9a4af2c1f9b600c | joseramosp/Learning-Cpp | /Projects/Project_3/Continent.cpp | C++ | cpp | 352 | permissive | //
// Created by Jose Ramos on 5/8/20.
//
#include "Continent.h"
const string &Continent::getName() const {
return name;
}
void Continent::setName(const string &name) {
Continent::name = name;
}
const Player &Continent::getOwner() const {
return owner;
}
void Continent::setOwner(const Player &owner) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.