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 |
|---|---|---|---|---|---|---|---|---|
0bea0f4cc0e87b6fbe5e71d6e709f093c9ef6afa | 9ac5fd3d227da1af13cab0a1c9c816551bb38d78 | hugochougt/homework | /C++/B-四-2.cpp | C++ | cpp | 588 | no_license | #include <iostream>
using namespace std;
class Point
{
public:
Point(int i,int j)
{
X=i;
Y=j;
}
Point(Point &rp);
~Point()
{
cout<<"Destructor called.\n";
}
int Xcood()
{
return X;
}
int Ycood()
{
return Y;
}
private:
int X,Y;
};
Point::Point(Point &rp)
{
X=rp.X;
... |
e6573b82222ae57acebce65e8e311f2262a75baf | 95f1138fa01b3b288a58414640240cf8bd27e5ff | StephanXu/SignalR-Client-Cpp | /test/signalrclienttests/test_websocket_client.cpp | C++ | cpp | 6,155 | permissive | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#include "stdafx.h"
#include "test_websocket_client.h"
#include <thread>
#include "test_utils.h"
#include "signalrclient/signalr_exception.h"
std::shar... |
b3846feb95f4ee06e75ce479d53e08435fae8c8e | 0ed4c3997ba13759e5274b435eab389f26ed34d5 | Arnold134777/LeetCode-LintCode | /category/字符串/Reverse String/main.cpp | C++ | cpp | 550 | no_license | //
// main.cpp
// LeetCode-C++
//
// Created by aa on 2018/3/28.
// Copyright © 2018年 aa. All rights reserved.
//
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string reverseString(string s) {
if(s.length() <= 0){
return s;
}
l... |
ef1b8e1475f3277695a80ad480a0f01d049e0dd0 | b045830ea01f130234c267f798033cd7d3faa4ec | SaharaJannat/C-plus-plus-Programs | /Fast_food_shop.cpp | C++ | cpp | 7,204 | no_license |
#include<bits/stdc++.h>
#include<string.h>
#include<ctime>
#include<fstream>
using namespace std;
class Date
{
public:
string date;
Date(){};
Date(string date)
{
this->date=date;
}
};
class Person
{
public:
string name;
Date date1;
Person(){};
P... |
52c23cbd847bef8e27c8f3e38e6bf44508fff5cc | 35f1bac0ae6ee0a7e69d28ef22fac0cef9ab6a2f | sunshuai/sa-sdk-ios-encrypt | /SensorsAnalyticsEncrypt/SACryptopp/sa_darn.cpp | C++ | cpp | 6,797 | permissive | // darn.cpp - written and placed in public domain by Jeffrey Walton
#include "sa_pch.h"
#include "sa_config.h"
#include "sa_cryptlib.h"
#include "sa_secblock.h"
#include "sa_darn.h"
#include "sa_cpu.h"
// At the moment only GCC 7.0 (and above) seems to support __builtin_darn()
// and __builtin_darn_32(). Cl... |
36fb9b4888bc221c35cc9a7dfde1dd829115b314 | be51d848e74053a529bbc3e2add7497331dade55 | Tarasilya/syla-roads | /src/game/road.cpp | C++ | cpp | 7,825 | no_license | #include "road.h"
#include "enum.h"
#include "city.h"
#include "crew.h"
#include "road_view.h"
#include "painter/painter.h"
#include "painter/shapes.h"
#include <cmath>
#include <sstream>
#include <iostream>
RoadState Road::GetState()
{
return state_;
}
Road::Road(std::vector<City*> cities){
cities[0]->Add... |
f3e67fc7df01aec8753f84fd8db6d32eb0c3aee3 | 67606e772e45302bf798a99a2aaa976ead5bf0b1 | ayushmankumar7/tensorflow | /tensorflow/lite/micro/kernels/logical_test.cc | C++ | cc | 4,711 | permissive | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
8d09a840f75e5a9715303fc2bf677f0ee14e0b47 | d57acda995c42883ce2b22e5c8da6e05012f7d5d | Rajputakshay/HacktoberFestContribute | /Swap.cpp | C++ | cpp | 271 | permissive | #include <iostream>
int main(int argc, char *argv[ ]) {
int a, b;
printf("Type two integers:\n");
scanf("%d %d", &a, &b);
printf("Before Swap: A = [%d], B = [%d]\n", a, b);
swap(a,b);
printf("After Swap: A = [%d], B = [%d]\n", a, b);
return 0;
}
|
082d974ad89a39f9792f5f1239c2fe85ba97d737 | 09183a54b2fa568644a832bdfb56c53ef176c6d0 | Balraaj/Windows-Programming | /C C++/Temp/CPPIO.cpp | C++ | cpp | 394 | no_license | //This program shows some basic io formatting in cpp
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int value;
cout<<"Enter value : ";
cin>>value;
cout<<"\nValue : "<<hex<<uppercase<<value;
double value1;
cout<<"\n\nEnter double value : ";
cin>>value1;
... |
72c3a756b5f1e6d7a10ce26f5956ced6212d84d7 | cf93778eadf555817aecf5eea2ffe65e3e554dbb | Tudor67/Competitive-Programming | /LeetCode/Explore/October-LeetCoding-Challenge-2021/#Day#20_ReverseWordsInAString_sol8_istringstream_O(N)_time_O(N)_extra_space_7ms_7.4MB.cpp | C++ | cpp | 451 | permissive | class Solution {
public:
string reverseWords(string s) {
const int N = s.length();
string answer;
string word;
istringstream ss(s);
while(ss >> word){
copy(word.rbegin(), word.rend(), back_inserter(answer));
answer += ' ';
}... |
95a6aafd06e389045a903cda37066dea95768247 | b3c0811012524625ec90a82c5165468d7247c540 | smadala/IIIT-PG11 | /aps/lab/4/2.cpp | C++ | cpp | 592 | no_license | #include<iostream>
#include<stdlib.h>
#include<stack>
using namespace::std;
void process(int *a,int n){
int i;
int *r=(int *)malloc(n*sizeof(int));
stack<int> s;
s.push(0);
for(i=1;i<n;i++){
while(s.size() > 0 && a[i] > a[ s.top() ] ) {
r[s.top()] = a[i];
s.pop();
}
s.push(i);
... |
c3eabee3d070f876640a4521e73a8b80c0bc2329 | 5056e563527f0289510c22c7d5f094b118c62d1c | MOBInodecoin/Mobinode | /src/test/util_tests.cpp | C++ | cpp | 17,431 | permissive | // Copyright (c) 2011-2014 The Bitcoin Core developers
// Copyright (c) 2017-2018 The PIVX developers
// Copyright (c) 2019 The Mobinode 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 ... |
135423c5745ffc45c76d767c38f599180d218ec0 | e5c9752e85f7e0567a3cbcde3817f39b0430ca2e | jyfhbc/jiao_yufeng | /11.10/src/CheckingAccount.cpp | C++ | cpp | 673 | no_license | #include <iostream>
#include "Account.h"
#include "CheckingAccount.h"
CheckingAccount::CheckingAccount( double cinmoney, double fee )
: Account( cinmoney )
{
transactionFee = ( fee < 0.0 ) ? 0.0 : fee;
}
void CheckingAccount::credit( double addmoney )
{
Account::credit( addmoney );
chargeFee();
}
bool C... |
f4beb0e458509e48bd70fc7f7406960d6dc71df9 | 1e503baafefee8cd91aa267dbdaa27181f7e5860 | 201816040301/Assignment_01 | /Ex_06.50.cpp | C++ | cpp | 912 | no_license | #include <iostream>
using namespace std;
int tripleByValue(int);//function prototype
void tripleByReference(int &);//function prototype
int main()
{
int a,b;//定义参数
//对tripleByValue函数
cout <<"Enter a value for count:";
cin >> a;
cin >> b;
cout <<"Value of count before call to tripl... |
5a43f4f2a5278cc6b9f211f5dc28e89e6f1ed747 | 6f5eabbdac347acbdb4b48c367e4d1732b781d06 | lbllol365/CODE | /C++/L_4.5.cpp | C++ | cpp | 914 | no_license | #include <iostream>
using namespace std;
double per_area_price(int a,double per_price);
int main(){
int small_area,large_area;
double small_price,large_price,un_sml_price,un_lar_price;
cout<<"Please enter the small one's area !!"<<endl;
cin>>small_area;
cout<<"Please enter the small one's price!!"<<endl;
cin>>sm... |
e2e5722fb5b6fe6f4f7864c45391e4620aea2d5c | cf3037a2a25d267fdb8ddbaf35b808fe20631d0b | asmazovec/vector3 | /main.cpp | C++ | cpp | 6,544 | no_license | /* Составить описание класса для объектов-векторов,
* задаваемых координатами концов в трёхмерном пространстве,
* считая, что компоненты векторов представлены
* вещественными числами типа double.
*
* Компоненты векторов должны быть скрыты (инкапсулированы)
* в объекте.
*
* Предусмотреть в классе деструктор и... |
20c4a52426afee72e518586b3da459d38bc9f6d7 | ff68d83aa579755e310d1e00b3647d05331ec6d7 | ryanchengguo/C-Plus-Plus-Application-Development-1 | /Exercise 6.31/Exercise 6.31/main.cpp | C++ | cpp | 962 | no_license | //
// main.cpp
// Exercise 6.31
//
// Created by Ryan Guo on 5/26/19.
// Copyright © 2019 Ryan Guo. All rights reserved.
//
#include <iostream>
using namespace std;
int GCD(int a, int b);
int gcdRecursive(int a, int b);
int ans, divider, divisor, m;
int main() {
int num1 = 319;
int num2 = 377;
cout <... |
4a54225d22296d921f3196c13ec7465cdc697f4c | 9abb715a3baf74ecad2a330a28ce7e46c48d706b | choudarykvsp/xtp | /src/libxtp/calculators/kmclifetime.cc | C++ | cc | 13,887 | permissive | /*
* Copyright 2009-2017 The VOTCA Development Team (http://www.votca.org)
*
* 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
*
* Unl... |
640265aee7dc3047426dcc63ae3ef16af617a4aa | 5da21221dbfb0535e837fc47da8f6d702413fa57 | phertfelder/Coding-Examples | /CSC Projects/Graphs/vertex.cpp | C++ | cpp | 6,636 | no_license | #include "vertex.h"
using namespace std;
void addVertex(Vertex*& vHead, char label)
{
Vertex* newVertex = new Vertex;
newVertex->data = label;
newVertex->vNext = nullptr;
newVertex->aHead = nullptr;
if (vHead == nullptr)
{
vHead = newVertex;
return;
}
... |
af57a1d4d673c8f754d70d548378e68a748e24ad | c9f6fa3a15183a6dfe8915b955849f9bb1ae7948 | proteanx/Nav-tobedeleted | /src/qt/coincontroldialog.cpp | C++ | cpp | 36,506 | permissive | // Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "coincontroldialog.h"
#include "ui_coincontroldialog.h"
#include "addresstablemodel.h"
#include "devaultunits.h"
#i... |
565b943cd175414a51a56bd2cd3027831b147715 | 05dc5b632f94b83cd4394e1c0125d5c90c418743 | heragaji/ABC | /100/D.cpp | C++ | cpp | 2,255 | no_license | #include<iostream>
#include<vector>
#include <algorithm>
using namespace std;
int main(){
int N,M;
cin >> N >> M ;
vector<long long > v1 = vector<long long >(N);
vector<long long > v2 = vector<long long >(N);
vector<long long > v3 = vector<long long >(N);
vector<long long > v4 = vector<long lo... |
69a86bbd38f6c03dfdb39e07063d015e497d999e | 57f6a57bf3f3c79a8108ac0f6cd7e215e137a695 | DreamLab/contrail-controller | /src/vnsw/agent/oper/agent_path.cc | C++ | cc | 38,928 | permissive | /*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#include <boost/uuid/uuid_io.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
#include <cmn/agent_cmn.h>
#include <route/route.h>
#include <vnc_cfg_types.h>
#include <agent_types.h>
#include <filter/acl.h>
#include <oper/pe... |
374b5ccf88794c11d9ca423ceb1fe387b3f47496 | 5641d55410c4b898a0fdf152dce15ed7cbe0005c | Deligne/data_structure | /03链栈.cpp | C++ | cpp | 811 | no_license | #include<iostream>
#include<cstdlib>
#include<ctime>
#include<iomanip>
#define MAXSIZE 10
using namespace std;
typedef struct LNode
{
int data;
struct LNode *next;
}LNdde;
int init(LNode *&L)
{
L=(LNode*)malloc(sizeof(LNode));
L->next=NULL;
return 1;
}
int isEmpty(LNode *&L)
{
if(L->next==NULL)
return 1;
e... |
1ebdc3947ca57424f21944ad504a715e65f86301 | 0182b5dc2320e8309977ad1fc9a6246fcf2fd7ec | TerjeTL/snekGame | /map.cpp | C++ | cpp | 680 | no_license | #include "map.h"
Map::Map(int widthWin, int heightWin, int size, int thickness) : w(widthWin), h(heightWin), t(thickness), size(size), winOuter(sf::Vector2f(size+thickness, size+thickness)), winInner(sf::Vector2f(size, size))
{
winOuter.setFillColor(sf::Color::White);
winInner.setFillColor(sf::Color::Black);
winOut... |
b9c77a1fef2486a1bd00f42a4d4e78b88e800357 | 8dbc98f8e04a86e2b39e6ec0b0c681ff14c44e89 | HyunjoonJeon/MIPS_CPU | /utils/assembler/assembler.cpp | C++ | cpp | 10,145 | no_license | #include "mips.hpp"
#include <utility>
#include <map>
#include <iostream>
#include <cassert>
#include <iomanip>
struct instruction{
string s0;
string s1;
string s2;
string s3;
};
int main(){
vector<instruction> instruction_set;
map<string, int> labels;
string tmp;
int error = -1;
//... |
d49afe1e9cf7643ae13125906144eefeb06625b4 | 475f95dda6a6aa793a5108d837fe8ef4199d219a | mxgrey/ifcplusplus | /IfcPlusPlus/src/ifcpp/IFC4/lib/IfcFastener.cpp | C++ | cpp | 6,598 | permissive | /* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#include <sstream>
#include <limits>
#include "ifcpp/model/AttributeObject.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/model/BuildingGuid.h"
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include... |
3cc9b9c16e0ad1a2d2bfc57f9aeffed9e49fdd3a | ca7202afb04b45626bdd6d281bbf776d03c3cbbb | flutter/engine | /impeller/scene/scene.cc | C++ | cc | 1,733 | permissive | // Copyright 2013 The Flutter 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 "impeller/scene/scene.h"
#include <memory>
#include <utility>
#include "flutter/fml/logging.h"
#include "impeller/renderer/render_target.h"
#inc... |
d61276c7b4f54be8e3ad74eaf791e28a278b91f9 | 7be11319638bb11e2d74f0270f320a89f2fec403 | Vaa3D/vaa3d_tools | /released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/ext/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp | C++ | hpp | 2,319 | permissive | /*=============================================================================
Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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)
=... |
e775254e71a0672e4c700f1b9c31fb7bd1f1e107 | a661b6d866bd7146da14ce8ea6655803b0a0e8ea | JSantiagoS/LabCGeIHC | /Practica3/06-ShadersEnObjeto/src/main.cpp | C++ | cpp | 6,087 | no_license | //glew include
#include <GL/glew.h>
//std includes
#include <string>
#include <iostream>
//glfw include
#include <GLFW/glfw3.h>
// program include
#include "Headers/TimeManager.h"
#include "Headers/Shader.h"
Shader shader;
GLuint VBO, VAO, EBO;
typedef struct {
float XYZ[3];
float RGB[3];
} Vertex;
int screenW... |
099b236d664875d7e5abef259d5ddae7a13f8288 | f79a840fe124824fd926e389a9f9b8217f77018b | ahatzikonstantinou/ehome | /esp8266_01_lightswitch/src/Configuration.cpp | C++ | cpp | 4,703 | no_license | #include "Configuration.h"
#include "Settings.h"
Configuration::Configuration()
{
switchDevice.active = "true";
switchDevice.sleep_seconds = String( MAX_SLEEP_SECONDS );
}
void Configuration::setup()
{
read();
}
bool Configuration::read()
{
//read configuration from FS json
Serial.println("mounting FS.... |
75b330ebd5ddc16a22f7b81eed01aacced98c85f | f54a621a3916616ff8e05d1a2a90be0b9ecb6060 | pigranya1218/WinAPI-Dungreed | /Dungreed/ChestNpc.cpp | C++ | cpp | 2,966 | no_license | #include "stdafx.h"
#include "ChestNpc.h"
#include "ObjectManager.h"
#include "GoldObject.h"
#include "ItemObject.h"
#include "Item.h"
void ChestNpc::setInfo()
{
switch (_rank)
{
case 0: // 베이직
{
_imgName = "NPC_CHEST_BASIC";
_type = NPC_TYPE::CHEST_BASIC;
_size = Vector2(40, 60);
}
break;
case 1: // 블루
... |
001188460ebb3759daa579d69aefeedafd18a3c1 | c8584219e566e57155dc294beb923e9feb766cb9 | gitytakahas/SFrameAnalysis | /SFrame/core/src/SFrameCore_Dict.cxx | C++ | cxx | 99,373 | no_license | // Do NOT change. Changes will be lost next time file is generated
#define R__DICTIONARY_FILENAME srcdISFrameCore_Dict
/*******************************************************************/
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#define G__D... |
6228eba173235a9022e62485402e06cc0a376968 | 0fbfa103ca350e5fc9dc19faa47ee56ffd95624c | ARIF-SUHAIMI/PROG_C- | /binary.cpp | C++ | cpp | 1,545 | no_license | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
fstream inp;
inp.open("test.txt",ios::in|ios::binary);
char ch;
inp.read(&ch,sizeof(ch)); //first parameter address where data must go
//second parameter how many bytes to read from th... |
25cb20dd20c3ba57c66921093abd701f9f9b1700 | abb4cd534a4da4a21dad6513643020dd81e370f4 | jungx098/ConEmu | /src/ConEmuHk/ExtConsole.cpp | C++ | cpp | 57,434 | permissive |
/*
Copyright (c) 2012-present Maximus5
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the follo... |
4585278b325b3e415d6c1205763a6fe78cb0b8e3 | bd4cf73be0d1c2f2eb961428b15f4cbf643e2354 | huaweicloud/huaweicloud-sdk-cpp-v3 | /drs/src/v5/model/CompareTaskParams.cpp | C++ | cpp | 5,002 | permissive |
#include "huaweicloud/drs/v5/model/CompareTaskParams.h"
namespace HuaweiCloud {
namespace Sdk {
namespace Drs {
namespace V5 {
namespace Model {
CompareTaskParams::CompareTaskParams()
{
compareTaskId_ = "";
compareTaskIdIsSet_ = false;
type_ = "";
typeIsSet_ = false;
startTime_ = "";
star... |
7da7e02e032b73a9173e863550ffdfb7446fc60e | 75ec7ce385144e309314622cb2a111a1d10765ae | angeltears/demohub | /数据压缩/heap.cc | C++ | cc | 3,587 | no_license | /**
* Copyright: Copyright (c) 2018 angeltears-hyj, All right reserved.
*
* @Functional description:heap
* @Author : angeltears-onter
* @Date : 18-11-5.
* @package : dataCompression
*/
#include "heap.h"
#include <cstdlib>
#include <cstring>
/**
获取父结点位置 (i-1)/2
@param npos 当前结点位置
@return 父结点位置
*/
#define heap_par... |
9212ce11fc4d86cd5b51185f87e00545cdcc9d39 | 38c7cc404fe59ac697ccd2f5ff613534f9e04727 | palashgo/libtorrent | /test/test_pex.cpp | C++ | cpp | 5,416 | permissive | /*
Copyright (c) 2008, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the f... |
54b70382ab03fa32bc70c2dc4ebb7dc715aefb75 | adada7e1368135b3c027aa6493edb45073c89825 | 15831944/TxUIProject | /trunk/TestCode/MBCAutoSwitcher/MBCAutoSwitcher/MBCSockMgr.cpp | C++ | cpp | 1,279 | no_license | #include "StdAfx.h"
#include "MBCSockMgr.h"
#include <algorithm>
CMBCSockMgr::CMBCSockMgr(void)
{
}
CMBCSockMgr::~CMBCSockMgr(void)
{
}
HRESULT CMBCSockMgr::RegisterSock( SOCKET hsock, CMBCBaseObj* pBaseObj )
{
MAPSOCKMBCOBJS::iterator itf = m_mapSockToObj.find(hsock);
if (itf != m_mapSockToObj.end())
{
if(pBas... |
cc5c786c0d8a3ad96aeeaeb53936d726ad39d64d | 5995d1010d8be1dff377b4956b3b430a0dcda91c | zhenglu0/Programming_Practice | /Practices/Concurrency/Atomic_Wait.cpp | C++ | cpp | 1,410 | no_license | //
// Atomic_Wait.cpp
//
// Modified by 罗铮 on 03/26/14.
#include <iostream> // std::cout
#include <atomic> // std::atomic_flag
#include <thread> // std::thread
#include <vector> // std::vector
#include <sstream> // std::stringstream
#include <future> // std::async, std... |
90e354e60e42faeaa1e03d88f68fbb6bdb692dce | 56d8dc09a772c78d78629b5d7135042d010ea5cb | nujgnayuf/force-riscv | /base/src/GenExceptionAgent.cc | C++ | cc | 7,904 | permissive | //
// Copyright (C) [2020] Futurewei Technologies, Inc.
//
// FORCE-RISCV is 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
//
// THIS SOFTW... |
b10461e28eb0871e4c6d434b5e8bf39e8df4c373 | 0f35617887439febd65a5cf587e8a505b7c76f35 | dumheter/jar_light | /light_controller.hpp | C++ | hpp | 3,248 | permissive | /**
* Note, this is an altered version of the light controller that does not rely
* on the c++ stdlib.
*
* light_controller
*
* Contains information about one led unit. Can contain multiple LEDs
* all connected to one data pin.
*/
#pragma once
// ============================================================ //... |
7e88b1ca2356b1c2e5fe24ba9a56b22e5f0fccbb | 18905b9a4e3f7572a5e827fb3b5e4226937e28f0 | chubbymaggie/insight | /src/domains/interval/interval_context.hh | C++ | hh | 2,565 | permissive | /*-
* Copyright (C) 2010-2014, Centre National de la Recherche Scientifique,
* Institut Polytechnique de Bordeaux,
* Universite de Bordeaux.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitte... |
3f867fb735f44b70b433173ff800b4418a887214 | 57d7c19cb574b4bcebc340ceecbf9feeb7eb8219 | payshares-legacy/paysharesd | /src/ripple_rpc/handlers/BookOffers.cpp | C++ | cpp | 7,226 | permissive | //------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012-2014 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby g... |
dd35b3dfe58145ec89d86f7d7963ebc86230dee1 | 53cdd368fb42af072c0f9146eba26d02f5806e87 | smeenai/llvm-project | /libc/test/src/string/strndup_test.cpp | C++ | cpp | 1,526 | permissive | //===-- Unittests for strndup ---------------------------------------------===//
//
// 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
//
//===---------------------------... |
cae85713bd905a4e6120ae755fc76a4d0dba7145 | ec546733d41c0d29269c8ea77c0521c622a9f4e5 | vishalpolley/Competitive-Programming | /Other/prog.cpp | C++ | cpp | 972 | permissive | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int bitmask;
char* characters;
int characters_count;
char* running;
int running_count;
void permutations() {
int i;
if (running_count == characters_count) {
printf("%s\n", running);
} else {
for (i=0; i<characters_count; i++) {
... |
06f1152a65b624771a0da133a16c82b62b0b4762 | cf4862145fa54c627b3a5b6266b45a81ee4f15e0 | rajathans/cp | /CodeChef/March15/q3.cpp | C++ | cpp | 353 | no_license | #include <bits/stdc++.h>
using namespace std;
#ifndef PI
#define PI 3.14159265
#endif
int main()
{
int t;
cin>>t;
while(t--)
{
double s,c,k;
cin>>s>>c>>k;
double result;
for(int i=0;i<s-1;i++)
{
result = asin(pow(2,i)) * 180.0 / PI;
cout<<"The arc sine of "<<pow(2,i)<<" is "<<result<<" degrees... |
38d149765c2c550e783e117c396cbc3535a54945 | 19e7f176fe23c134d808d2165d0a95e6bdae1f90 | NicoG60/OpenOrganigram | /src/Supervision/f_AffichageFenetre.cpp | C++ | cpp | 1,254 | no_license | #include "f_AffichageFenetre.h"
#include "ui_f_AffichageFenetre.h"
f_AffichageFenetre::f_AffichageFenetre(QList<f_SubWindow *> ListeFenetre, QWidget *parent) :
QDialog(parent),
ui(new Ui::f_AffichageFenetre),
Model(new QStandardItemModel),
ListeFenetre(ListeFenetre)
{
ui->setupUi(this);
ui->li... |
b4e8e9b6c39fcf721d9993514fa615d5914651d6 | b991371d9980f6d80624a586f8ff019a9c11d527 | GitEasonXu/CarND-Unscented-Kalman-Filter-Project | /src/ukf.cpp | C++ | cpp | 16,322 | permissive | #include "ukf.h"
#include "Eigen/Dense"
#include <iostream>
#include <math.h>
//#define M_PI 3.1415926
using namespace std;
using Eigen::MatrixXd;
using Eigen::VectorXd;
using std::vector;
//#define DEBUG
/**
* Initializes Unscented Kalman filter
* This is scaffolding, do not modify
*/
UKF::UKF() {
// Open NIS dat... |
a1400823fb46ed0edf9580f5cfc16ced9c07f6a4 | 4bd47c05c886f87257d4eaec222d68b8d70eded5 | fuchsto/array_ref | /reference/test/test_meta_make_filled_dims.cpp | C++ | cpp | 1,608 | no_license | ////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2015 Bryce Adelstein Lelbach aka wash
//
// 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)
/////////////////////////... |
674f2bedf27281d4ecb57692274f0035e7f1b0af | cfb1204b3db95794e3f8ed4c3565fd8607de1476 | ScSofts/EasyXWarpper | /cpptoc.cpp | C++ | cpp | 26,262 | no_license | #define EXP 1
#include <comutil.h>
#include "C.h"
#include "CPP.h"
#include <GdiPlus.h>
#pragma comment(lib, "comsuppw.lib")
#pragma comment(lib, "GdiPlus.lib")
using namespace Gdiplus;
using namespace Gdiplus::DllExports;
EasyX_C_API HWND __stdcall initgraph(int width,int height){
return initgraph_cpp(width, height)... |
b199725e5e852a6944e39f942a6bd135c1acddae | ec047f356eab9ca73916573cf3ed3cb4629cc797 | Lincerpi/CPP08 | /ex01/main.cpp | C++ | cpp | 663 | no_license | #include "span.hpp"
int main()
{
// srand(time(NULL));
Span sp(5);
sp.addNumber(5);
sp.addNumber(3);
sp.addNumber(17);
sp.addNumber(9);
sp.addNumber(11);
// try
// {
// sp.addNumber(65);
// }
// catch (const std::exception& e)
// {
// std::cerr << e.what() << std::endl;
// }
std::cout << sp.shortest... |
e0d6a9903a834d66eff2fe04f8e4ac749a0b877e | 19a4e567e0336f3845774b8f19b1b3db38779195 | mayukuner/AC | /Contest Hunter/CH23/CH23C.cpp | C++ | cpp | 2,402 | no_license | #include<stdio.h>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#include<iostream>
#define For(i,n) for(int i=1; i<=n; i++)
#define Rep(i,n) for(int i=0; i<n; i++)
#define N 3005
#define INF (1<<30)
using namespace std;
struct Edge{
int u,v,cap,flow;
inline void init(int a,int b,int c,int... |
61819998778ed019a6183454b2844f3825c2531c | 85b8c8b94824266e48a0dd14b14431e478ddca14 | Truongkoi/baitaptamgiac | /tamgiac3.cpp | C++ | cpp | 276 | no_license | #include <iostream>
using namespace std;
void main()
{
int d, i, j;
cout << "nhap canh tam giac: "; cin >> d; cin.ignore();
for (i = d; i >= 1; i--)
{
for (j = i; j >= 1; j--)cout << " ";
for (j = 2 * (d - i); j >= 0; j--)cout << "* ";
cout << "\n";
}
cin.get();
} |
b803b48f3d3da1b5b94df3f40800b5f015b4f49a | 7b792a1459e8e839a3dc104895c9545e2e85d56a | daxingyou/sg_server | /trunk/game_server/user_troop/user_troop.cpp | C++ | cpp | 69,297 | no_license | #include "user_troop.hpp"
#include "formation/formation.hpp"
#include "common.pb.h"
#include "user_troop_mgr.hpp"
#include "hero/hero_manager.hpp"
#include "log_enum.hpp"
#include "tblh/errcode_enum.hpp"
#include "tblh/Treasure.tbls.h"
#include "tblh/TreasureMake.tbls.h"
#include "treasure/treasure_manager.hpp"
#includ... |
fa2f538324b2348f45c5963ed3df691dac003b12 | c562e77b6b614c3bb2a9f9e697a1cb260d1661b6 | weimingtom/rpg2kemuSvn | /new_file/define/Music.cpp | C++ | cpp | 248 | no_license | #include "Define.hpp"
const char* rpg2kLib::define::Music = " \
Array1D Music \n \
{ \n \
[1]: string fileName; \n \
[2]: int fadeInTime = 0; \n \
[3]: int volume = 100; \n \
[4]: int tempo = 100; \n \
[5]: int balance = 50; \n \
}; \n \
";
|
8dd5c31e780f910d47ac60f324b1a82c8e588710 | 7fc88027d9bbcac713577a4de27522d69c9967bc | efifogel/sgal | /src/libs/SGAL/include/SGAL/Text_texture.hpp | C++ | hpp | 3,378 | no_license | // Copyright (c) 2004 Israel.
// All rights reserved.
//
// This file is part of SGAL; 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; version 2.1 of the
// License. See the file LICENSE.LGPL distributed with SGAL.
//
... |
160e64e9d3756122729c68a24e065849c48d0b6a | b488192160a7761d121265899005512f073832d9 | RedlineResearch/QTR-tool | /class_list.hpp | C++ | hpp | 272 | permissive | #ifndef CLASS_LIST_HPP
#define CLASS_LIST_HPP
#include <set>
using namespace std;
// Contains the list of classes to instrument for the all of their method call events.
class class_list {
public:
static set<string> white_list;
};
#endif // CLASS_LIST_HPP
|
a4ba8f46ec732efe3e127a724c0c3eee3b54d89a | 08ae55c69edbf339744c19e2ab078d41f3e0d636 | godsangin/AutoSystem | /Autosys/Autosys/ChildDlg.cpp | C++ | cpp | 8,169 | no_license | // ChildDlg.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "Autosys.h"
#include "ChildDlg.h"
#include "afxdialogex.h"
#include <opencv\cv.h>
#include <opencv\highgui.h>
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <Windows.h>
#include <iostream>
#include "filename.h"
#include <iostream>
#inc... |
1839d5ad9fc35094e698b5aeb48b52e72be9da48 | c1a4a5e62a4a6bc544ab94aff7baaaa7ea1126c3 | joansanchez/idi | /idi/bloc-1/ses3/act4/MyGLWidget.cpp | C++ | cpp | 4,279 | no_license | #include "MyGLWidget.h"
#include <iostream>
MyGLWidget::MyGLWidget (QWidget* parent) : QOpenGLWidget(parent)
{
setFocusPolicy(Qt::ClickFocus); // per rebre events de teclat
}
MyGLWidget::~MyGLWidget ()
{
if (program != NULL)
delete program;
}
void MyGLWidget::initializeGL ()
{
// Cal inicialitzar l'ús de... |
92d5084653b3ab2d90d984e40cf168fd46419358 | 684236b62864d28097734805a60b7fe915cdc761 | mintforpeople/robobo-ros2-ios-port | /ros2_mod_ws/build/lifecycle_msgs/rosidl_typesupport_cpp/lifecycle_msgs/srv/get_available_transitions__type_support.cpp | C++ | cpp | 874 | permissive | // generated from rosidl_typesupport_cpp/resource/srv__type_support.cpp.em
// generated code does not contain a copyright notice
#include <cstddef>
#include "rosidl_generator_c/service_type_support_struct.h"
#include "lifecycle_msgs/srv/get_available_transitions__struct.hpp"
#include "rosidl_typesupport_cpp/service... |
1261c71ad0f4666a16fe30ed2fa2bc68cc46cf4a | 2945d73506931b89893cb9c89a50ca171627cacb | celeritas-project/celeritas | /src/corecel/sys/KernelAttributes.hh | C++ | hh | 4,328 | permissive | //----------------------------------*-C++-*----------------------------------//
// Copyright 2022-2023 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//--------------------------------------------------------------------... |
127680e140f6141463dbecae1f9c2e77285fc7e6 | f2f9d27f58019317119fe5a1dc35a40d949d425b | E7mer/GhostTunnel | /agent/gt_wclient/gt_wclient/main.cpp | C++ | cpp | 524 | no_license | #include <windows.h>
#include <stdio.h>
#include "data_handler.h"
int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
_In_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nCmdShow
)
{
data_handler *handler = data_handler::get_instance();
if (handler->initialize())
{
handler->s... |
0af92f6bacace77e9648ce6816cd00470e2fb5a6 | 3f8271ed0e8c1aaff939b8809a4e048d9f3e972d | dishant-mittal/Efficiency-Analysis-of-Kernels-in-Hybrid-C-Means-Algorithms | /4 Clusters/synthetic/RCM with Hypertangent Kernel.cpp | C++ | cpp | 12,767 | no_license | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define ARRAYSIZE(x) (sizeof(x)/sizeof(*(x)))
#include <math.h>
#include<string.h>
#include <iomanip>
#include <cstdlib>
#include <time.h>
double max(double [],int);
double min(double [],int);
int in,index,count1,count2;
double sum1,sum2,sum2a,pi,summation... |
48e6be44cecbafc49b4dd5c2b71afe5f4f039a89 | 9934dd984e727af7c7283c0a616fff9ef6163788 | tsarpaul/LIEF | /examples/cmake/external_project/main.cpp | C++ | cpp | 295 | permissive | #include <iostream>
#include <LIEF/LIEF.hpp>
int main(int argc, char** argv) {
if (argc != 2) {
std::cerr << "Usage: " << argv[0] << " <binary>" << std::endl;
return 1;
}
std::unique_ptr<LIEF::Binary> binary = LIEF::Parser::parse(argv[1]);
std::cout << *binary << std::endl;
}
|
5beb2c6f7f75e450638f424801ce31e676a4f09d | feaa5adc998d720b100ae4abf2399e2f6b991954 | mer-packages/qtconnectivity | /qtconnectivity/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp | C++ | cpp | 10,019 | no_license | /****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtBluetooth module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Lice... |
64a35c9a31ddc10243ebe51968a1f384f6640629 | 7fcbafdb7190785903bd0485dc1c6e67a0dfcdf2 | Laura-lc/leechcraft | /src/plugins/lmp/nativeplaylist.cpp | C++ | cpp | 2,302 | permissive | /**********************************************************************
* LeechCraft - modular cross-platform feature rich internet client.
* Copyright (C) 2006-2014 Georg Rudoy
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organiz... |
bf639b5cd54d52cedb17ecc74b1639d3438b60f0 | 56c6c743a2a33b52b84e22cfd59a06010c1a14c0 | sohamnandi77/Cpp-Basic-Concepts | /6. OOPs/ConstantFunction.cpp | C++ | cpp | 893 | no_license | #include <iostream>
using namespace std;
class Fraction
{
private:
int numerator;
int denominator;
public:
Fraction(int numerator, int denominator)
{
this->numerator = numerator;
this->denominator = denominator;
}
int getNumerator() const { return numerator; }
int getDenom... |
68bfd737ba9dec48d76d6942f86f2fcb348bbdc7 | 46e32a14a8e54dce4f2864af8ea4ffcd3e840aeb | KOTOKORURU/llpc | /llpc/lower/llpcSpirvLowerRayTracingIntrinsics.cpp | C++ | cpp | 8,390 | permissive | /*
***********************************************************************************************************************
*
* Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associ... |
bf0c13927da0d2107c69aafc8e8c6d8a33e7908f | a5510a68e69edadb18e7f3a0688fc78c64c8577b | giovaneaf/CompetitiveProgramming | /Algorithms/Miscellaneous/rectangles.cpp | C++ | cpp | 2,250 | no_license | /*
Compute area union of rectangles in O(n*log(n))
Tested in problem NKMARS on SPOJ
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(a, b, c) for(int a = b; a < c; ++a)
#define ii pair<int, int>
#define fst first
#define snd second
#define MAXN 200010
int n;
struct line
{
int x,... |
f1f214bc6f965a76c53984596177add45305f0f9 | da6283ab7db489ad99e1c3189aafd621bfdf41f8 | phonglong9962/Terraria-Rewrite-in-C-SDL2 | /TomatoEngine/CameraTrackingSystem.cpp | C++ | cpp | 1,002 | no_license | #pragma once
#include "System.h"
#include "WorldHandle.h"
void CameraTrackingSystem::update()
{
for (auto &entity : entities)
{
auto &transform = Distributor::get()->getComponent<Transform>(entity);
WorldHandle::get()->pos = transform.position;
auto &cam_pos = Camera::get()->position;
cam_pos.x = transform... |
c157da8a9bd4688704ebfdead2a2e0c7aabe5448 | b06b4afe3ea88108f5a38eeada316946b2a170e0 | isabella232/traffic | /include/traffic/http.hpp | C++ | hpp | 3,069 | permissive | #ifndef TRAFFIC_HTTP_HPP
#define TRAFFIC_HTTP_HPP
#include <traffic/constants.hpp>
#include <traffic/memory.hpp>
#include <traffic/buffer.hpp>
#include <traffic/offset.hpp>
#include <traffic/url.hpp>
#include <ts/ts.h>
#include <string_view>
namespace traffic {
template <> struct default_delete<TSHttpParser> {
us... |
721a66e0e4fbbdf6753b717800254c7d57ab771f | 2ef8892b738ffeddf08063fbe0c4fed6b8e89f8f | yontyon/concord-bft | /bftengine/src/bftengine/ReplicaForStateTransfer.cpp | C++ | cpp | 7,765 | permissive | // Concord
//
// Copyright (c) 2018, 2019 VMware, Inc. All Rights Reserved.
//
// This product is licensed to you under the Apache 2.0 license (the "License"). You may not use this product except in
// compliance with the Apache 2.0 License.
//
// This product may include a number of subcomponents with separate copyri... |
aef9ea7c9f04290687cf0fa4b286743af72639d0 | 520937e4e28338d42a5455077c37df943899a433 | maddotexe/Competitive-contest-programs | /course code/4th sem/osy1/osy/prio_p.hpp | C++ | hpp | 1,484 | no_license | void priority_pree()
{
int min_arrival_index, x, n, y;
int t_prev, t_now;
vector<bool> c;
vector<vector<int> > v;
vector<int> c_t, b_t;
priority_queue<node3> pq;
struct node3 p;
cout << "enter the number of processes\n";
cin >> n;
v.resize(n+1);
c.resize(n+1);
c_t.resize(n+1);
b_t.resize(n+1);
x = y =... |
34f513c78f1d26d149fb72889c3fb67cbd38b6f6 | 2ab0ac8323b3ea6713ad726ba001f49e06c0f649 | KingricharVD/Nests | /autom4te.cache/src/test/sanity_tests.cpp | C++ | cpp | 699 | permissive | // Copyright (c) 2012-2013 The Bitcoin Core developers
// Copyright (c) 2020-2021 The NestEgg Core Developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "compat/sanity.h"
#include "key.h"
#include "test_pivx.h"
#i... |
9144887bbed1071aab275265e517a5dd6cc56b1d | f4808eecf6a40c31ea6bf111a3f61503ce8d2b62 | jobinrjohnson/red_channel_extract | /include/Auth.hpp | C++ | hpp | 413 | no_license | //
// Created by Jobin Johnson on 08/03/20.
//
#ifndef RED_CHANNEL_EXTRACT_AUTH_HPP
#define RED_CHANNEL_EXTRACT_AUTH_HPP
#define AUTH_PROVIDER_SIMPLE 1
class Auth {
private:
int numberOfAttempts = 3;
int authProvider = AUTH_PROVIDER_SIMPLE;
public:
int setAuthProvider(int authProvider);
void se... |
30acae6a819aab25433751bce98f9886dd36ae5a | b8dd7569906fc41911a881e3f97d2646394b9ad1 | liuxinren456852/fast_gicp | /include/fast_gicp/gicp/impl/fast_gicp_st_impl.hpp | C++ | hpp | 10,251 | permissive | #ifndef FAST_GICP_FAST_GICP_ST_IMPL_HPP
#define FAST_GICP_FAST_GICP_ST_IMPL_HPP
#include <sophus/so3.hpp>
#include <fast_gicp/so3/so3.hpp>
#include <fast_gicp/opt/gauss_newton.hpp>
#include <fast_gicp/gicp/fast_gicp_st.hpp>
namespace fast_gicp {
template<typename PointSource, typename PointTarget>
FastGICPSingleThr... |
24a8e8b8034b9ea46ff6f9780db715d28c0590a6 | db6cce01e4bb0d91d4154d1f619a9c13ab596e35 | kevinskyba/smart_cookie_jar | /hardware/ESP01/src/i2c.cpp | C++ | cpp | 1,004 | no_license | #include "i2c.h"
#include <Wire.h>
#include <Esp.h>
float bytes_to_float(byte* bytes);
void i2c_start(int sdaPin, int sdlPin) {
Wire.begin(sdaPin, sdlPin);
}
float i2c_request_float_from_address(uint8_t address, int &error) {
ESP.wdtFeed();
Wire.setTimeout(5000);
Wire.requestFrom(address, 4);
ESP... |
be04e09e1c1a521c6e0a055db2ceb1512a458200 | b05555f241c2e5c8d7b24c2f0f322a7ff110319e | rpaggi/wxVcashGUI | /HistoryPage.cpp | C++ | cpp | 10,406 | no_license | /******************************************************************************
* wxVcashGUI: a GUI for Vcash, a decentralized currency
* for the internet (https://vcash.info).
*
* Copyright (c) The Vcash Developers
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT AN... |
767e0146145a5a0abd2be96d9745fded99b66d98 | 2a09753b36f2d60c093e4e667b666dbbfee686c5 | Yalir/Awl | /include/Awl/boost/mpl/aux_/preprocessed/no_ctps/less.hpp | C++ | hpp | 2,033 | permissive |
// Copyright Aleksey Gurtovoy 2000-2004
//
// 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)
//
// Preprocessed version of "Awl/boost/mpl/less.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespa... |
96cf253e0b39b6b0d3367d7f565b622eca431d73 | 9ad59c68ca84e2e09d38e9cfa5dbce2e26567e06 | SugarSpinda/MyLib | /test/thread/TestCondition.cpp | C++ | cpp | 1,183 | permissive | #include "common/Log.hpp"
#include "common/Exception.hpp"
#include "thread/Thread.hpp"
#include "thread/Mutex.hpp"
#include "thread/Condition.hpp"
void * changer(void *);
void * watcher(void *);
void testCondition();
Condition condition;
Mutex conditionMutex;
int conditionVariable = 0;
int main()
{
testCondition... |
5b1888010e74dd3e35012140d62a4ca31c721e36 | f3e4503822fb7af11d0ca411acf91cc7a6cdbddd | xifoxy/OnlineJudge | /Boj/3000/3085(사탕게임).cpp | C++ | cpp | 844 | no_license | #include <bits/stdc++.h>
using namespace std;
int n;
string bom[51];
int dx[]{1,0};
int dy[]{0,1};
bool safe(int x, int y) {
return x >= 0 && y >= 0 && x < n && y < n;
}
int getMax() {
int ret = 0, col, row;
for(int i = 0; i < n - 1; i++) {
col = row = 1;
for(int j = 0; j < n - 1; j++) {
row++, col++;
if(b... |
fc8dc9f8318465e96b45c42cee6a948e98575ba5 | 3cf22591563c8d9f1d72101e55db42a3ea295151 | bartlomiej-zdrojewski/computer-graphics | /vector4.cpp | C++ | cpp | 1,329 | permissive | #include <cmath>
#include <iomanip>
#include <sstream>
#include "vector4.h"
Vector4::Vector4(double x, double y, double z, double w) {
data[0] = x;
data[1] = y;
data[2] = z;
data[3] = w;
}
double& Vector4::operator[](size_t const &i) {
return data[i];
}
double Vector4::c(size_t const &i) const {
... |
5458364200645498ab91fa04509c88e2327ce51e | a0db7bd68a9d82f90b45b98b3f19c52aadb8c1bd | ezamyatin/Goldsteal | /src/model/sources/IBrain.cpp | C++ | cpp | 779 | no_license | #include "../IBrain.h"
#include "../BrainPLayerInput.h"
#include "../GameState.h"
IBrain* IBrain::getBrain(std::string name) {
if (name == "BrainPlayerInput")
return brainPlayerInput;
}
void IBrain::initBrains(InputData const* input) {
IBrain::brainPlayerInput = new BrainPlayerInput(input);
}
IBrain* IBrain::bra... |
2c47f3835a8dc9ede488489881d6c7b7ac87ca32 | 983bb78ce75ac545002a2cb390834a9e8464bf29 | Ice1187/tfcis | /toj/170.cpp | C++ | cpp | 1,167 | no_license | #include <iostream>
using namespace std;
void N(int s,int n){
for (int i=0; i<s; i++){
cout << ' ';
}
for (int j=0; j<2*n-1; j++){
cout << '*';
}
cout << endl;
}
void N2(int n,int s=0){
for (int a=1; a<=n; a++){
N(n-a+s,a);
}
}
void A(int n){
N2(n);
}
void B(int n){
N2(n);
N... |
def59c1267abcb0784fe7dbc112a9e2ecdb7a71c | 0f0d8955fdbf045b86b75bd768e9784da34de7bc | leejaeseung/Algorithm | /CodeForce/C++/1352B_Same Parity Summands.cpp | C++ | cpp | 2,384 | no_license | /*
B. Same Parity Summands
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
You are given two positive integers n (1≤n≤109) and k (1≤k≤100). Represent the number n as the sum of k positive integers of the same parity (have the same remainder when divided by 2).
... |
92d73c7016f6fd10d3363b06b6d5766d0165e32f | 7f25eb644b602d5ed51097c92d69fd4470a615da | emrul-chy/Competitive-Programming | /UVa/10226 - Hardwood Species.cpp | C++ | cpp | 945 | no_license | #include <bits/stdc++.h>
using namespace std;
vector <string> v;
int main()
{
string s;
int i, t, c;
cin >> t;
getchar();
getchar();
while(t--)
{
c = 0;
map <string, int> mp;
while(getline(cin, s))
{
if(s.size() == 0)
... |
db7ff37f4a8283f74efa16ba15b51436288302af | e4102fa5223f5d7b70ccc207eed2da32db507160 | johnstill/euler | /cxx/src/problem2.cpp | C++ | cpp | 422 | no_license | /*
* Problem 2: Find the sum of the even valued Fibonacci terms whose value does
* not exceed 4 Million
*/
#include <iostream>
#define LIMIT 4000000
int main()
{
int temp,
first = 1,
second = 2,
total = 0;
while (second < LIMIT) {
if (second % 2 == 0)
total += second;
temp = first + second;
fi... |
7cc7d1c5436a2993ae44d2abcb76f8149ce6b8ed | da48a479ee948188a947c08f8ea510345ff9de97 | TencentCloud/tencentcloud-sdk-cpp | /pts/src/v20210728/model/DescribeJobsResponse.cpp | C++ | cpp | 5,220 | 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
... |
db318e22951d1dc7cffcaf8280d7f149576d59a1 | b16e504e1a5374bfd540aa67557b2a0ad83052c4 | saravanannnnn/Playground | /Employee Structure/Main.cpp | C++ | cpp | 616 | no_license | #include<iostream>
using namespace std;
struct employee{
char name[50],designation[50];
int id,age;
float salary;
}e;
int main()
{
cout<<"Enter name:";
cin>>e.name;
cout<<"\nEnter ID:";
cin>>e.id;
cout<<"\nEnter age:";
cin>>e.age;
cout<<"\nEnter designation:";
cin>>e.designation;
cout<<"\nEnter ... |
98772c360c0776f853f8e9a2d949aa2f7c4d8706 | bc9ba842879285e5a82e0a64bd55c08ebeeb05c1 | kz04px/ECS | /src/ecs/component_manager.hpp | C++ | hpp | 2,822 | no_license | #ifndef COMPONENT_MANAGER_HPP
#define COMPONENT_MANAGER_HPP
#include <iostream>
#include <set>
#include <unordered_map>
#include <memory>
typedef uint32_t Entity;
typedef uint32_t Component;
class Store
{
public:
virtual ~Store() = default;
virtual void remove_entity(const Entity e) = 0;
};
temp... |
8a0be4c4d14b7325eaa27eae0d0a4bff52601da9 | 3778f473381b0e51fa6e03191173d0448733fff0 | xuefrye/PAT-Advanced-Level-Practice | /1132 Cut Integer (20 分)/1132 Cut Integer (20 分).cpp | C++ | cpp | 521 | no_license | /*
1132 Cut Integer Бе20 ио)
*/
#include<iostream>
#include<string>
using namespace std;
int n;
string z;
int main()
{
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> z;
int zint = stoi(z);
string z1 = z.substr(0, z.size() / 2); int z1int = stoi(z1);
string z2 = z.substr(z.size() / 2, z.size() / 2); int z2... |
c00db3f7b88221ed0808976ce8a23a490faa4388 | 22d215e8142ca1cfbde2801aea61f1513c479ad1 | dhnesh12/codechef-solutions | /02-CodeChef-Easy/205--Snake Snaky.cpp | C++ | cpp | 954 | no_license | #include <stdio.h>
#include <string.h>
#define siz 1010
main()
{
int fall, M, N, y, i, tx, ty, L, x, m, hy, hx;
char w, B[siz][siz], z[siz*siz+siz];
for(scanf("%d",&fall); fall--; printf(" %d\n",m))
{
scanf("%d %d %d %d %d %s",&N,&M,&tx,&ty,&L,z);
for(y=0; y<M; mem... |
3659b02f0855139b21a67f7dd72d6ce45bbdf4e6 | c443fa510f7b179d4bf989b015b7334daaba0b17 | mefisto545/RoguelikeGame | /Persistent.cpp | C++ | cpp | 7,215 | no_license | #include "main.hpp"
void LightningBolt::load(TCODZip &zip)
{
range = zip.getFloat();
damage = zip.getFloat();
}
void LightningBolt::save(TCODZip &zip)
{
zip.putInt(LIGHTNING_BOLT);
zip.putFloat(range);
zip.putFloat(damage);
}
void Confuser::load(TCODZip &zip)
{
range = zip.getFloat();
nbTurn... |
deec867fce5f8e0b4872e2ace83e2c1c8fe5f401 | 1650615f45d8423a5da6d1afed995cdf7204021e | jo9182/Sonic3DGamev3 | /SonicGame3Dv3/src/entities/DelfinoPlaza/DP_Leaves.cpp | C++ | cpp | 2,161 | no_license | #include <glad/glad.h>
#include "../entities.h"
#include "../../models/models.h"
#include "../../toolbox/vector.h"
#include "dpleaves.h"
#include "../../renderEngine/renderEngine.h"
#include "../../objLoader/objLoader.h"
#include "../../engineTester/main.h"
#include "../../toolbox/maths.h"
#include "../camer... |
f2f26734188cb0ba63004d67d28a77f7bb07216b | 92c98cad959fdc16391f16628e76be6a914986cb | yonggang985/Leetcode | /204 Count Primes.cpp | C++ | cpp | 838 | no_license | /*Count Primes
Description:
Count the number of prime numbers less than a non-negative number, n.
*/
class Solution {
public:
int countPrimes(int n)
{
if(n<=2)
{
return 0;
}
double c = sqrt(n);
bool *bv = new bool[n]; //new初始化每个元素为false
for(int i=3... |
57edd18fce118d2a19ed1a800fd7f4ae8a6dc013 | e3f344271740c398978ca0c234e17bf0f468ce1d | omega07/Codeforces-misc | /83A-Magical Array.cpp | C++ | cpp | 1,994 | no_license | #include <bits/stdc++.h>
#define int long long
#define itn int
#define mod 1000000007
#define pb push_back
#define sortall(x) sort(x.begin(),x.end());
#define fast ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
using namespace std;
int a[1000007];
vector <int> v;
bool sortinrev(const pair<int,int> &a, con... |
f0eb36aec8fb58876e5a006578d357d8e818e2d7 | 57609d91cfbf3f218c378f1634f11a1620af5e69 | aakardwivedi/Hackerrank-Problems | /Sherlock-and-array.cpp | C++ | cpp | 738 | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int t,n,sumb=0,suma=0,flag=0;
cin>>t;
while(t--)
{
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];... |
3ade7762ac38ebbb0a4d899f12fe6a5908d17504 | c011e5d794c99af333e3f3069b9970f1815fbdf7 | xlong88/contrail-controller | /src/bgp/bgp_ribout.cc | C++ | cc | 13,542 | permissive | /*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#include <algorithm>
#include <boost/bind.hpp>
#include "base/string_util.h"
#include "bgp/bgp_ribout.h"
#include "bgp/bgp_ribout_updates.h"
#include "bgp/bgp_export.h"
#include "bgp/bgp_factory.h"
#include "bgp/bgp_route.h"
#include "bgp/bgp_t... |
78bed408cc010742b47bff19b0868bd18018bfd4 | 93a1939b14faaf18df94674f6a3c3ad1b9fc8e51 | harsha-karumuri/Data-Structures-Programs | /BinarySearchTree.cpp | C++ | cpp | 6,081 | no_license | //
// main.cpp
// BinarySearchTree
//
// Created by MM on 11/10/16.
// Copyright © 2016 MM. All rights reserved.
//
#include <iostream>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <iomanip> // std::setw
// #define N 10
using namespace std;
// Node objects that each contain a key, ass... |
e57fd169a3bfaf9bc69366c11b70bf9b91056651 | 6b7420609711a48deb0a717ccf4564c4cf85679e | rtohid/blaze | /blazetest/src/mathtest/dvecdvecmult/VDaV3a.cpp | C++ | cpp | 3,670 | permissive | //=================================================================================================
/*!
// \file src/mathtest/dvecdvecmult/VDaV3a.cpp
// \brief Source file for the VDaV3a dense vector/dense vector multiplication math test
//
// Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
//
// This... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.