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 |
|---|---|---|---|---|---|---|---|---|
f9b3ee528d58e72932f264aa75249e6431eba775 | 2a11e6838dbabc0a8a0cc0965e3babea06ab01d8 | dincerunal/design_patterns | /027-State/project/Project/OffState.cpp | C++ | cpp | 384 | no_license |
#include "OffState.h"
#include "OnState.h"
#include "Device.h"
#include <iostream>
using namespace std;
void OffState::On(Device *dev)
{
cout << "off state gets on state" << endl;
dev->SetState(new OnState);
}
void OffState::Off(Device *dev)
{
cout << "off state gets off state" << endl;
}
void OffState::Pause(... |
a219b4a099d51e0d1bd947d0890cc4a5651d5274 | c9a82c7f2aa4d7e1cc4ffa044489819c5ca89e7a | lontoken/ApiDocumenter | /VS2010/HomsApiTool/EditBrowseCtrlXml.cpp | C++ | cpp | 793 | no_license | #include "stdafx.h"
#include "EditBrowseCtrlXml.h"
// CMyEditBrowseCtrl
//IMPLEMENT_DYNAMIC(CMyEditBrowseCtrl, CMFCEditBrowseCtrl)
CEditBrowseCtrlXml::CEditBrowseCtrlXml()
{
m_strFileType = _T("All Files (*.*)|*.*||");
}
CEditBrowseCtrlXml::~CEditBrowseCtrlXml()
{
}
BEGIN_MESSAGE_MAP(CEditBrowseCtrlXml, CMFCEdi... |
0936c0138379a7e6afcc04c3235a6601151ea00f | 0b115d876e9d1398752a72ff9f2987d3157fed4b | MORTAL2000/GameFramework | /GameFramework/StruffyLite/Base/LBtTime.cpp | C++ | cpp | 2,664 | no_license | ////////////////////////////////////////////////////////////////////////////////
// BtTime.cpp
#include "BtTime.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#ifdef WIN32
#include "BtTimeDX11.h"
#else
#include "BtTimeGLES.h"
#endif
///////////////////////////////////////////////////////////////////////... |
503bc7dddfd364cedb45ea18e8ddd65d5d415b7a | 7d7f53016baa9a05bfcc559ed969741b8756cf39 | yananliusdu/scamp5d_interface | /scamp_python_module/scampmodule.cpp | C++ | cpp | 5,988 | permissive |
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <scamp5d_tcp.h>
#include <scamp5d_usb.h>
#include <vs_packet_decoder.hpp>
#include "scampmodule_packet_switch.hpp"
scamp5d_interface *box = NULL;
std::list<std::pair<uint8_t*,size_t>> packet_list;
st... |
e2dc06602275c9c3909df3ecf308de9b691ffeaa | 06f41c9dfcec209865bb5c934dde46dca42333cb | deardeng/learning | /vstest/C++/56cpp/Calculator/Calculator/main.cpp | C++ | cpp | 1,104 | no_license | #include <iostream>
using namespace std;
#include "Parser.h"
#include "Scanner.h"
#include <string>
#include "Exception.h"
#include "Calc.h"
int main(void){
Calc calc;
STATUS status = STATUS_OK;
do{
cout << "> ";
string buf;
getline(cin,buf);
//cout << buf << endl;
Scanner scanner(buf);
i... |
ca67eae933b47f10e69e3fd88aa2d7a5efd4b8c4 | dd4c7e49040f608c2b84032ffb9d3ea87b9429da | yr-wang-hit/irods | /lib/core/include/data_object_proxy.hpp | C++ | hpp | 15,090 | permissive | #ifndef IRODS_DATA_OBJECT_PROXY_HPP
#define IRODS_DATA_OBJECT_PROXY_HPP
#include "dataObjInpOut.h"
#include "rcConnect.h"
#include "replica_proxy.hpp"
#include <algorithm>
#include <optional>
#include <string_view>
#include <vector>
namespace irods::experimental::data_object
{
/// \brief Presents a data object-l... |
726fc362e049a429de62350989fc53d0e7534421 | 987a503d42115bf54a3713fb4966fd0c2e83f562 | timondy/PhaseFieldBenchmarking | /Uintah/src/testprograms/Malloc/test14.cc | C++ | cc | 1,914 | permissive | /*
* The MIT License
*
* Copyright (c) 1997-2018 The University of Utah
*
* 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
* right... |
cd93070c4320d6c417e8cdbc0d0790811836c1e4 | 2588fe01ca7551da51a5edfc0a57a908f825fdc1 | RolphWoggom/shr.tar | /Simpsons Hit&Run/game/libs/sim/apps/simviewer/testviewer/menu.hpp | C++ | hpp | 280 | no_license | #ifndef _MENU_HPP
#define _MENU_HPP
class MenuHandler
{
public:
enum MenuType { TOP, ITEM, SUB, SUBITEM };
virtual void AddItem(char* name, MenuType type, int meGroup, bool checkable, bool checked, char* command) = 0;
virtual void Create() = 0;
};
#endif
|
58401967e9ffcd96d21c72b0c4b98f2532d61752 | 89746d2f4563812d4104ffb49a0c84ca89f2ca97 | mohammadVatandoost/MyPlayer | /backend.cpp | C++ | cpp | 2,974 | no_license | #include "backend.h"
BackEnd::BackEnd(QObject *parent) : QObject(parent)
{
readSubtitleFile("./en.srt");
}
void BackEnd::readSubtitleFile(QString directory)
{
cout<< "readSubtitleFile:"<< directory.toStdString()<<endl;
if(!isFileExist(directory.toStdString())) {
cout<< "file does not exist"... |
84b1eb7fd64651152eb4d8dd8a4afc1738bdb66c | a583df3824d127e64e435ebdabfa0c9f20a053dc | blockchaingate/fabcoin | /src/cpp-ethereum/libethereum/TransactionReceipt.cpp | C++ | cpp | 2,158 | permissive | /*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the... |
62f0288b79f58ec0c63e1837aad010456bd90823 | 2f6d2b522cab76be822f159ca0a3400641111d77 | donjohnnie/CPP_Primer | /chap16/Exer16_40.cpp | C++ | cpp | 898 | no_license | // Warning: this is for verification. It cannot compile.
// The problem lies in line 29 to 32.
#include <iostream>
#include <string>
#include <vector>
using std::cout;
using std::endl;
using std::vector;
using std::string;
template <typename It>
auto fcn3(It beg, It end) -> decltype(*beg + 0)
{
return *beg;
}
int main... |
1934505c8c33183367c65d796bc08142a614e842 | 1be380eaea723f5641c4361067bc3da360dee03a | nealwu/UVa | /volume116/11638 - Temperature Monitoring.cpp | C++ | cpp | 1,245 | no_license | #include <stdio.h>
int main() {
int testcase, cases = 0;
int M; /* the device takes a reading every M seconds. */
int S; /* The device will instantly take a reading when the °•Startup delay°¶ ends. */
int threshold[4]; /* */
int C; /* */
int enable[4], trigger[4]; /* trigger 0 <, 1 > */
int K, time, temp;
sca... |
c8e227d686d089243e833d2c40bca48e059a6416 | f35a57ef706ef603001976f72cbd6f014bb298a7 | Djuelich/cpp | /musterloesungen/uebung07/jumper/src/Level.cpp | C++ | cpp | 3,734 | no_license | /*
* Level.cpp
*
* Created on: Nov 13, 2015
* Author: twiemann
*/
#include "Level.hpp"
#include <iostream>
#include <fstream>
#include <SDL_image.h>
namespace jumper
{
Level::Level(SDL_Renderer* renderer, std::string filename)
{
// Set all default values
m_texture = 0;
m_tileWidth = 0;
m_tileHeig... |
0c74622012869e1ecbad91f724415d450797eaae | 6829dc7be08c6ba923012de0b61c1cb1b76f2ff0 | SeanNesdoly/UniSpend | /unispend/US_User.cpp | C++ | cpp | 9,716 | no_license | #include "US_User.h"
// Set exception class methods
UserException::UserException(const string& outputMsg): outputMsg(outputMsg)
{
// No additional setup needed
}
string& UserException::what()
{
return outputMsg;
}
// Sign up constructor
User::User(const string& username, const string& pass, const string& firstName... |
ccde9b539eae51505bf5960e8b21031163f48561 | 7bdc3a97cd0352cbed464a50d1c91fbe09edc69c | UCSD-Quadcopter-Class/quad-firmware-yolo | /firmware/libraries/Adafruit_LSM9DS1-master/Adafruit_LSM9DS1.cpp | C++ | cpp | 18,640 | permissive | /***************************************************************************
This is a library for the LSM9DS1 Accelerometer and magnentometer/compass
Designed specifically to work with the Adafruit LSM9DS1 Breakouts
These sensors use I2C to communicate, 2 pins are required to interface.
Adafruit invests tim... |
d473b78cf2a8724e02422e71f2e58311f9f3b2bd | 39ffbb2bb5dd50db01ebc8731615dd5ec2ee0ed5 | bitsapien/anuvaad | /public/phase-2-20160620022203/C_PLUS_PLUS/anniversary.cpp | C++ | cpp | 556 | no_license | // Name : Anniversary
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char const *argv[]) {
// input:
// k : customer received a free bottle of milk
// l : a kilogram of bacon
// m : one 10 dollar coupon
// n : 99 percent discount for everything they bought
// d : number of cust... |
fe7c84ae4e63c3d6abcf0088aa05c4cfac7ec5ee | 12e5842e75786db293eae852963adef59076f0ab | kshhhv/CS141 | /LAB8_Q2.cpp | C++ | cpp | 2,973 | no_license | /*
2. Write a program to find the largest, smallest, mean, median, elements with highest frequency of the elements of all elements of an array. (Use functions for each of the task in the question)
*/
#include<iostream>
using namespace std;
void largest (int n,int arr[]){ //fun for largest
int max=0;
for(int ... |
c070d22d8523f20cd30ceb6538a9650428aaedc7 | a65fe3c8debe514e6900a4727cd5be44f30e6fc9 | amenoyoya/old-project | /c/shooting/C++lua/old/龍神録/15章/mydat/source/shot.cpp | C++ | cpp | 2,919 | permissive | #include "../include/GV.h"
extern void shot_bullet_H000(int);extern void shot_bullet_H001(int);extern void shot_bullet_H002(int);
extern void shot_bullet_H003(int);extern void shot_bullet_H004(int);extern void shot_bullet_H005(int);
extern void shot_bullet_H006(int);extern void shot_bullet_H007(int);extern void sh... |
9a58a19e3240f25ea9bb2d9e5303b7e8335bb519 | 400092644fb883512d5033c51962ab9f83fa8769 | nado6miri/cpp_idioms | /Day4/1_empty6.cpp | C++ | cpp | 2,330 | no_license | #include <iostream>
#include <vector>
#include <list>
#include <forward_list>
#include <algorithm>
/*
// STL에서는 반복자를 5가지로 구분함
// 입력 : 컨테이너에서 꺼내 오는것
// 출력 : 컨테이너에 넣는 것
// 1. 입력 반복자 : 입력, ++
// 2. 출력 반복자 : 출력, ++
// 3. 전진형 반복자 : 입력, ++, 멀티패스 --------> 싱글리스트 반복자
// 4. 양방향 반복자 : 입력, ++, --, 멀티패스 --------> 더블... |
82b5a9b5a6df87626d8c71d4a9fb4549e4d9be60 | e6aadedcf353f7384b5a5677eb2c11596b04543a | Buffer429/HW1 | /Source.cpp | C++ | cpp | 9,434 | no_license | #include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <Windows.h>
#include <strsafe.h>
#include <Shlwapi.h>
#include <stdint.h>
#include <errno.h>
#include <crtdbg.h>
#include <locale.h>
void print(_In_ const char* fmt, _In_ ...)
{
char log_buffer[2048];
va_list args;
va_start(args, fmt);
HRESULT ... |
fc658b344eb6bb94d9da3c3fbc5490310481ae06 | 227cfb57d5f13b8a4c992a1b7125637f274667e4 | epfl-lasa/Task_Allocation | /intercept_finder/src/finder.cpp | C++ | cpp | 10,715 | no_license | /*
Copyright (c) 2016 Sina Mirrazavi,
LASA Lab, EPFL, CH-1015 Lausanne, Switzerland,
http://lasa.epfl.ch
The program is free for non-commercial academic use.
Please acknowledge the authors in any academic publications that have
made use of this code or part of it.
}
*/
#include "finder.h"
void chatte... |
bf4cf23f03dfc723b2b23431ed69783cab15cdfa | 67607a7c2bd13bfcc458a2a70c6a6a13ca6192df | b-mq/Openframeworks_ROS | /mymapEdit_ROS/src/main.cpp | C++ | cpp | 468 | no_license | #include "ofMain.h"
#include "ofApp.h"
#include <ros/ros.h>
//========================================================================
int main(int argc, char* argv[]){
ros::init(argc, argv, "ros_tutorial_msg_publisher"); // ノード名の初期化
ofSetupOpenGL(768,768, OF_WINDOW); // <-------- setup the GL context
// this ... |
f0747c980f1120c28284af96c319614125d5bfe7 | c97aa231b0175617c337ddc0f8ec88f6b88a50d1 | yun-lai-yun-qu/dlex-cnn | /core/src/common.cpp | C++ | cpp | 558 | permissive | ////////////////////////////////////////////////////////////////
// > Copyright (c) 2017 by Contributors.
// > https://github.com/cjmcv
// > brief Common.
// > author Jianming Chen
////////////////////////////////////////////////////////////////
#include "common.h"
namespace dlex_cnn {
std::string FetchSubStr(std::... |
bbf702a61defde517fda3f71e2bb547eaa1e3219 | 9552fe73ff1448b224ff56f3f9630703b13c6194 | bravesoftdz/realwork | /garant6x/implementation/Garant/GblAdapterLib/impl/DynamicTree_i/TextOpFilter_i_factory.cpp | C++ | cpp | 1,499 | no_license | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Модуль: "w:/garant6x/implementation/Garant/GblAdapterLib/impl/DynamicTree_i/TextOpFilter_i_factory.cpp"
// C++ Interface Factories implementation files (.cpp)
// Generated from UML model, root ... |
d732ad7740e4c04ea2e57cf6e1f22a2f989030d1 | 53360616c790b5c188fd6ab5aeb01d363eebc167 | messalina14/poo_c | /mainem.cpp | C++ | cpp | 497 | no_license | #include "empleado.cpp"
# include <iostream>
using namespace std;
main(){
string puesto,nombres,apellidos,direccion,codigo_empleado;
int telefono,sueldo;
cout<<"Ingresar Nombres: ";
cin>>nombres;
cout<<"Ingresar Apellidos: ";
cin>>apellidos;
cout<<"Ingresar Direccion: ";
cin>>direccion;
cout<<"Ingresar Tel... |
0b4269630cc8e656eea21f50a4302f70b6c09f9d | 49c034d7ed61b721bcca025f868b1210dcc28f6f | Ahmedazeem98/CompetitiveProgramming | /Codeforces/CF670-D2-D.cpp | C++ | cpp | 2,137 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#includ... |
a50cadb9cfd4a6a178c1cc8a61c5ce8ebc277d92 | 0a57d52702aa0e5617d441c9e4751c905f56daaa | schraderSimon/FYS3150_collab | /Project4/cpp/justOne.cpp | C++ | cpp | 6,873 | no_license | /**
compiles and runs as
mpic++ -c e.cpp
mpic++ -c vecop.cpp
mpic++ -o e_not_parallel.exe vecop.o b.o
mpirun -n 4 e_not_parallel.exe amont_of_simulations L start_temp end_temp steplength
*/
#include "vecop.hpp"
#include <iostream>
#include <random>
#include <cmath>
#include <fstream>
#include <mpi.h>
using namespace st... |
2e199eabcf0f93506565cb72c065bd3033cd5a72 | cd1b7a5e840ddc594bdbed7dba613dbbb55a68c2 | xknxkn/zrobot_v1 | /sw/app/music_demo_arm/music_demo/play.cpp | C++ | cpp | 847 | no_license | #include "play.h"
#include "ui_play.h"
#include <QMessageBox>
#include <unistd.h>
play::play(QWidget *parent) :
QDialog(parent),
ui(new Ui::play)
{
ui->setupUi(this);
}
play::~play()
{
delete ui;
}
void play::on_pushButton_start_clicked()
{
if((path_music.isEmpty()==true))
{
QMessageB... |
dba751923a8555d8e0b131867f69e0653ff685cd | fe8b33fb4b7d610e4d4702a7261b5095c80d8855 | 8l/HrwCC | /vm/InstructionsFetcher.cpp | C++ | cpp | 3,753 | no_license | #include "InstructionsFetcher.h"
InstructionsFetcher* InstructionsFetcher::instance = 0;
InstructionsFetcher::InstructionsFetcher()
{
instructions.clear();
}
InstructionsFetcher::~InstructionsFetcher()
{
//clear the instructions:
for ( Instructions::iterator it=instructions.begin(); it!=instructions.end(); it++ )... |
8a859c2b230741b34b85689dfcee11376a689a5a | 4cc2d9392a1073844e4c8fba1cbd8ede8daec78f | JoseSalamancaCoy/RACIMO_AIRE | /Documents/RacimoAire/Libreria/Nextion/NexSlider.cpp | C++ | cpp | 4,898 | permissive | /**
* @file NexSlider.cpp
*
* The implementation of class NexSlider.
*
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
* @date 2015/8/13
* @copyright
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
* This program is free software; you can redistribute it and/or
* modify it under the ... |
926a8bcfcd33179bb8a84d8a917b6d16bf560e66 | 0a0867f4749da3b7e30e96fdeb9546ab8d907cd3 | vlreek1969/3dcoin | /src/rpc/misc.cpp | C++ | cpp | 39,675 | permissive | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
#include "clie... |
2c94e99b3c7cae4800ab4e11bd39fac9ae608263 | 744c9e3f145e3abb4aa7cd9b8e91282d199bfa8e | google/omaha | /omaha/google_update/google_update_unittest.cc | C++ | cc | 1,439 | permissive | // Copyright 2009 Google Inc.
//
// 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... |
f9b63f5bfa1e2ba5eeb1a9d0fac39b04cb3ed983 | 2ebf0e67d52e73757cc89f7d591aae6909fd04ca | vedraiyani/LibLapin | /src/graphics/clear.cpp | C++ | cpp | 2,302 | no_license | // Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2018
//
// Lapin library
#include "lapin_private.h"
#define PATTERN "%p picture, %p color"
void bunny_clear(t_bunny_buffer *picture,
unsigned int _color)
{
size_t *type = (size_t*)picture;
sf::Color color
((_color >> (RED_CMP * 8)) &... |
a7e1dfc37e7ddf27eae675f9cbc1b7fb2e2c66c2 | d73cb8f9ce5620f060b38958030dbdd07c53b6a5 | anklean/QiuTou | /src/Gui/ViewProviderAnnotation.cpp | C++ | cpp | 17,023 | no_license | /***************************************************************************
* Copyright (c) 2008 Werner Mayer <wmayer[at]users.sourceforge.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* ... |
ff67401b44e8852a62ab7cf8e139864e3261198e | 2e0ed4bfc6f8cb966058207715eaa078d3e3c815 | sirojja/timus | /HW2/1494.cpp | C++ | cpp | 499 | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, x;
stack <int> st;
cin >> n;
vector <int> v;
for(int i = 0; i < n; i++) {
cin >> x;
v.push_back(x);
}
int j = 0;
for(int i = 0; i < n; i++) {
st.push(i + 1);
while(!st.empty() && st.top() ... |
6a31c0c1f60e31e8bc78833b6b33806ef6c254a3 | 2736d5d82a26c310e11a4ae6f633038d497b4a17 | gpertea/stringtie | /SuperReads_RNA/global-1/SuperReadsR/src2/findMatchesBetweenKUnitigsAndReads.cc | C++ | cc | 19,484 | permissive | /* SuperRead pipeline
* Copyright (C) 2012 Genome group at University of Maryland.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option... |
567d115598dff6193c3eddac8415ed17201f7644 | 6b930b07bb085a29b391bd4057708bede1964646 | Bjohh/SuperPlay | /SuperPlayLib/Libraries/stb_image/stb_image.cpp | C++ | cpp | 151,850 | permissive | /* stbi-1.33 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c
when you control the images you're loading
no warranty implied; use at your own risk
QUICK NOTES:
Primarily of interest to game developers and other people who can
avoid probl... |
a9ecd878651b2602bb4ffedcfbe66b46b1a59741 | 4aa9c243bf06107011ac65ed3ed9e82a72def8cc | colsipple/TrivialCipher | /sub-code/trivialCipher.cpp | C++ | cpp | 2,606 | no_license | #include<iostream>
#include<string>
#include<fstream>
#include<cstdio>
/**
Author: Collin Sipple
Date Created: February 28, 2021
Purpose: Using a trivial substitution to decrypt a given ciphertext.
**/
using namespace std;
string alphabetTable = "abcdefghijklmnopqrstuvwxyz";
int getPosInStr(char);
bool swapUsed(ch... |
8c673f97cdaa68d02fe827717f2b45ab5e4bd42c | e4f6002949eae3f6115a360e8edfc3a0df0d3a0d | onatbas/robocubes | /tests/GameOverMakerTests.cxx | C++ | cxx | 1,138 | no_license | //
// Created by Onat Bas on 08/01/17.
//
#include "gtest/gtest.h"
#include <view/WindowOpener.hxx>
#include <view/WindowRenamer.hxx>
#include <decorators/GameLooper.hxx>
#include <decorators/LoopTerminator.hxx>
#include <EntityFactory.hxx>
#include <systems/AnimationSubSystem.hxx>
#include <view/WindowDimensionGette... |
f473d6f87244076f68ce1ca275ca47f258587255 | a23ca8df1c459424d6d90bb2361614000c959578 | etiennerobinet/plc4x | /sandbox/plc4cpp/api/src/main/cpp/org/apache/plc4x/cpp/api/exceptions/PlcProtocolPayloadTooBigException.cpp | C++ | cpp | 1,944 | permissive | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
cc528104d737eeaced84c26123e59357601b3af6 | 7717c3015063cfe4d286162ad84167d84d5852f5 | sjb8100/FishEngine-Experiment | /Source/FishEngine/Asset.cpp | C++ | cpp | 681 | permissive | #include <FishEngine/Asset.hpp>
#include <cassert>
namespace FishEngine
{
void AssetManager::AddAsset(Object* asset)
{
assert(!m_Cleaning);
bool flag = IsAsset(asset);
// assert(flag);
if (flag)
{
m_Assets.insert(asset);
}
}
void AssetManager::RemoveAsset(Object* asset)
{
if (m_Cleaning)
retur... |
0e61160cc92fcda82e70a3bd7319f7f3b3559549 | 0d74faca959a1d0bec59c425fbd8bb9c68bb01e0 | xczhang07/leetcode | /f/longest_increasing_subsequence.cpp | C++ | cpp | 998 | no_license | Given an unsorted array of integers, find the length of longest increasing subsequence.
Example:
Input: [10,9,2,5,3,7,101,18]
Output: 4
Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.
Note:
There may be more than one LIS combination, it is only necessary for you to return... |
eac32f215cf5c265f62f7e21368e61d9a9b7bba8 | 992ddb70af2c7b8694bd447ab1b78a27a5ba9e5c | AntoineJT/chip8-emulator | /Chip8Disassembler.Core/WriteTextFileFunc.cpp | C++ | cpp | 437 | no_license | #include "WriteTextFileFunc.hpp"
#include <fstream>
// Write file, removes all its previous content
void Chip8::Disasm::WriteTextFile(const std::string& filename, const std::string& textContent)
{
std::fstream file;
file.open(filename, std::ios::out | std::ios::trunc);
if (!file.is_open())
{
t... |
cbd5a0ec4e085b67f0bcb42a11fc48c610222884 | 30bf0b5f1d8cb406660e3ca79d0a855978267dee | prabodhw96/ProjectEuler | /Problem 5.cpp | C++ | cpp | 256 | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int lcm = 20;
for(int i=1; i<=20; i++)
{
int sum = lcm;
while(sum%i != 0)
sum += lcm;
lcm = sum;
}
cout<<lcm;
return 0;
} |
af44f365186ee3c427c1f223bd571d9b31717d2b | cd7a291cf2ca6a989ac8097517cc098e95d098e6 | guoanjie/Cpp-Primer | /ch03/3.04.cc | C++ | cc | 597 | no_license | #include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
string s, t;
cin >> s >> t;
if (s < t)
cout << t << " is larger" << endl;
else if (s > t)
cout << s << " is larger" << endl;
else
cout << s << " and " << t ... |
8f69d8ac2022b06d50ed3ad0edc93748001d1732 | 4e182a6486e598833c2a4268cd99b71dea2a8cea | thegamer1907/Code_Analysis | /Graphs/1970.cpp | C++ | cpp | 2,218 | no_license | #include <bits/stdc++.h>
using namespace std;
#define fastIO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define asc(s) sort(s.begin(),s.end())
#define des(s) sort(s.rbegin(),s.rend())
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define rev(v) reverse(v.begin(), v.end(... |
0b0af800fff4aee295ac9ab987cead82e6911105 | 6ed6f216f791e31c9e9e95874ca116357ef33dd7 | devang191/algorithms_competitions | /google_code_jam/practice (Case Conflict)/AlienNumbers.cpp | C++ | cpp | 4,108 | no_license | #include <fstream>
#include <iostream>
#include <string>
#include <iterator>
#include <vector>
#include <sstream>
#include <algorithm>
#include <boost/lexical_cast.hpp>
#include <math.h>
#include <map>
using namespace std;
int COUNT = 1;
int get_decimal(map<char,int> source_language, string alien_number) {
int ... |
57c7e0e7b4bcb289c45b08be5237e2d38aff97ce | 80618a801333134c0579068083dbdb4f1790778b | graphcore/popart | /willow/src/op/reducelogsum.cpp | C++ | cpp | 2,987 | permissive | // Copyright (c) 2019 Graphcore Ltd. All rights reserved.
#include <algorithm>
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
#include <popart/op/reducelogsum.hpp>
#include <popart/opmanager.hpp>
#include "popart/attributes.hpp"
#include "popart/datatype.hpp"
#include "popart/names.hpp"
#incl... |
3319ee4a7cea699147c82bf2c417a828f4f25eb7 | bca7739e729f7363323da28157bd3c8759ece607 | sfegan/EGS5_ACT | /BField.cpp | C++ | cpp | 257 | no_license | #include "BField.hpp"
BField::~BField()
{
// nothing to see here
}
ConstantBField::~ConstantBField()
{
// nothing to see here
}
void ConstantBField::getFieldCGS(double h, double& bx, double& by, double& bz)
{
bx = m_bx;
by = m_by;
bz = m_bz;
}
|
3464d722dc5bce668829afc72920f8ac462e3d87 | 3620b687fa8786c04886ead2c53fc40eb5986b21 | shujaatak/scraps | /C/Перевод из двоичной в десятичную.cpp | C++ | cpp | 554 | permissive | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int crc2digit(int *codecrc)
{
char bin[] = "0000";
int a, b, c[4] = {0,0,0,0}, *code = codecrc;
for(a=0; a<4; a++) bin[a] = code[a]+48;
b = atoi(bin);
for(a=3; a>=0; a--) {
c[a] = b%10;
... |
2ef42756bb7492c8bc272b1c1bdc085110ff2087 | 62d0a8c6814d823b74c8ee0c5020929fe269383b | yumendy/Data-Structures-and-Algorithms | /第二章作业/栈、队列和串部分/5.4/MyStack.cpp | C++ | cpp | 1,255 | no_license | #include <iostream>
#include "MyStack.h"
using namespace std;
template <typename T>
MyStack <T>::MyStack(int n)
{
size = n;
top = -1;
data = new T[n];
}
template <typename T>
MyStack <T>::~MyStack()
{
delete data;
}
template <typename T>
bool MyStack <T>::push(const T &item)
{
if (top < size - 1)
{
data[++t... |
25d862d08e679acde3e24e26e9cab594b4642a88 | a3e7f41b5b221c088966dd7668c401f78248326c | TurtleShip/ProgrammingContests | /Solutions/UVa/584/584.cpp | C++ | cpp | 910 | no_license | #include <cstdio>
#include <cstring>
using namespace std;
int score[15];
char in[100];
/*
Calculates the base score at index idx.
Note that this function doesn't calculate the bonus point
from either strike or spare.
*/
int getScore(int idx) {
if('0' <= in[idx] && in[idx] <= '9') return in[idx] - '0';
if(in[idx]... |
ff5df244fa7140eeee149b070b80decb806193af | fa469a250c15ee5de210a61f1e7cba04dc06f8ae | jamil97/Examen2Laboratorio_JamilVilleda_31641572 | /mainListasEnlazadas.cpp | C++ | cpp | 2,784 | no_license | #include "Nodo.h"
#include "Seleccion.h"
#include "ListasEnlazadas.h"
#include <iostream>
#include <fstream>
using namespace std;
int main(){
Seleccion* sele;
Nodo* nodo;
ListasEnlazadas* listas;
bool seguir = true;
string nombreSeleccion;
int partidosGanados = 0;
int partidosEmpatados = 0;
int partido... |
6d8c39a3e46f12421eaef81d6f3ade7fc9e3578b | 2b13d96bd329e8da3241108f789bac4bcd4decc6 | ajorians/nBinaryPuzzle | /src/BinaryLevels.cpp | C++ | cpp | 29,636 | no_license | #include "BinaryLevels.h"
int g_nRelocatedGlobals = 0;
const char* g_Levels[] =
{
//6x6
LEVEL_1,
LEVEL_2,
LEVEL_3,
LEVEL_4,
LEVEL_5,
LEVEL_6,
LEVEL_7,
LEVEL_8,
LEVEL_9,
LEVEL_10,
#ifdef ALLOW_ALL_LEVELS
LEVEL_11,
LEVEL_12,
LEVEL_13,
LEVEL_14,
LEVEL_15,
LEVEL_16,
LEVE... |
f9997435fd633cea3a2c2b824fed31b8866050c0 | c352916c37015e61fc332280eff774f0667e720d | thanhvo/EPI | /C++/BinaryTreeTest.cpp | C++ | cpp | 17,722 | no_license | #include <memory>
#include <cassert>
#include <list>
#include "BTNode.h"
#include "BinaryTreeTest.h"
#include "Trie.h"
#include "LockableBTNode.h"
using namespace std;
void test_balanced_binary_tree() {
shared_ptr<BTNode<int>> zero(make_shared<BTNode<int>>(0));
shared_ptr<BTNode<int>> one(make_shared<BTNode<i... |
c3917c2a5684a14939348c90e3226727a4017de7 | 9e19c97f7e92f28704181aea3fa5dba68064a6f2 | BRousserie/CCC | /CCC/src/Platform/OpenGL/OpenGLContext.cpp | C++ | cpp | 545 | permissive | #include "CCCpch.h"
#include "OpenGLContext.h"
#include <GLFW/glfw3.h>
#include <glad/glad.h>
namespace CCC
{
OpenGLContext::OpenGLContext(GLFWwindow* windowHandle)
: m_WindowHandle(windowHandle)
{
CCC_CORE_ASSERT(windowHandle, "Window handle is null")
}
void OpenGLContext::Init()
{
glfwMakeContextCurren... |
4fe20bbc04098597c611233fdb8dd63537ea91bd | 0d692760ac305c842eb26f3dd3c137859370b288 | wenkaizheng/Websocket-chat | /db.cpp | C++ | cpp | 4,726 | no_license | //
// Created by wenkai on 12/29/20.
//
#include "db.hpp"
namespace db{
std::vector<char*> answers;
std::map<char*,std::vector<char*>> cache;
std::list<char*> track;
unsigned int cache_cap;
// for tmp customer cmp function
char cache_cmp_key[65];
static bool cmp_track(char* i){
if ... |
9e312fe141c834d565fccf109056533ec2ea578f | 98e5a00ea35f7a71232ac0859b8e6aef24052e26 | joaopedrofump/vende22 | /Vende++20/main.cpp | C++ | cpp | 756 | no_license | /*
T7G02
Jo„o Pinheiro
Leonardo Teixeira
*/
#include <iostream>
#include <string>
#include <vector>
#include "Cliente.h"
#include "Vende++.h"
#include "Menus.h"
#include "utils.h"
#include "data.h"
int main() {
string loja, fichClients, fichProdutos, fichTransacoes;
//
// pede a informacoo sobre o nome da loj... |
be1310e0f6533eaf1062a40ee94cf47bd6365e7f | 157b6b8a0b5018b591c3140313f566f0fd130c1e | asheesh1202/practice_codes | /duplicates_in_dist_d.cpp | C++ | cpp | 737 | no_license | //Check if a given array contains duplicate elements within k distance from each other
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int maximumDistance(int arr[], int k, int n)
{
unordered_map<int, int> positionCount;
for(int i =0; i<n; i++)
{
if(positionCount.find(arr[i])!=p... |
0ec260fb6fe493d871d2b767d1d31aefac1fbc54 | e2920bb13b19b9ffa614cccc590032e169cff187 | HarshitCd/Codeforces-Solutions | /Prefixes.cpp | C++ | cpp | 298 | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, i=0, c=0;
string s;
cin>>n>>s;
while(i<n){
if(s[i]==s[i+1]){
if(s[i]=='a') s[i]='b';
else s[i]='a';
c++;
}
i+=2;
}
cout<<c<<"\n"<<s;
return 0;
}
|
982716794a514878186ebb585cd223d9d3bd6373 | b045c37160e4f35dd321bd2b6eca396ed94a9a85 | lam2003/rtmp-server | /src/protocol/rtmp/server.cpp | C++ | cpp | 22,011 | no_license | #include <common/error.hpp>
#include <common/utils.hpp>
#include <protocol/amf/amf0.hpp>
#include <protocol/rtmp/defines.hpp>
#include <protocol/rtmp/server.hpp>
#include <protocol/rtmp/stack.hpp>
namespace rtmp {
Server::Server(IProtocolReaderWriter* rw) : rw_(rw)
{
handshake_bytes_ = new HandshakeByt... |
2ae01a93638e8a088d12c9688819796949b7f6f1 | 0a6b2ee37434a211db70661755b83a4d902da666 | kawayiboy/CPP | /ChangeCoin.cpp | C++ | cpp | 517 | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int coins[4] = {10,8,5,2};
int Change(int sum, int coin[],int numcoins)
{
int min = sum;
for (int i = 0;i<numcoins;i++)
{
if (sum>coin[i]&&(min>1+Change(sum-coin[i],coin,numcoins)))//µü´ú¶¯Ì¬¹æ»®
{
min = 1+Change(sum-coin[i],coin,numco... |
4ef0d9c0f0050dabfe9bd75d164bd8311b2c2d5d | c86c59bdfcbdc0aad373ab85e5d57f215bf4a4b1 | crosswalk-project/chromium-crosswalk-efl | /chrome/browser/ui/browser_browsertest.cc | C++ | cc | 112,257 | 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 <string>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#includ... |
7bed9ea0d960724c986b48375c673423139f15cd | 151bdf8297c424105dc7e10a164be860551c054d | liangjisheng/C-Cpp | /Algorithm/Matrix and array/第n项丑数的计算.cpp | C++ | cpp | 1,008 | permissive | 一个能被2或3或5或7整除的数称为Humble Number(简称丑数)
数列{1,2,3,4,5,6,7,8,9,10,12,14,15,16,18,......}是前15个丑数(把1也算作丑数)。
编程输入n(1<=n<=5842),输出这个数列的第n项。
#include"iostream"
using namespace std;
int main()
{
int cnt=0,n,h=0,t;
cout<<"Please input the n:";cin>>n;
while(cnt<n)
{
h++;t=h;
while(t%2==0)t=t/2;
while(t%3==0)t=t/3;
whil... |
49006b2d552ffcff46a3b21475a3f0ffa23d8449 | 5cc3e0b1ebec42b329a2378718eb3c4dd6370402 | mandalsudipti/competitive_programming | /codeforces/Gas Pipeline.cpp | C++ | cpp | 1,360 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
long long int len , pipe_cost , pillar_cost ;
cin>>len>>pipe_cost>>pillar_cost;
string S;
cin>>S;
long long int arr[len+1];
arr[0]=0;
for(int i=0;i<S.length();i+... |
99b217a08b4b3c5a0132283980036e5c1810ed09 | de684ffeb3347269ebcbb404839c169c6df5abc0 | TencentCloud/tencentcloud-sdk-cpp | /cdb/src/v20170320/model/DescribeDBImportRecordsResponse.cpp | C++ | cpp | 5,396 | 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
... |
ef43ff137f3aebea3216ba0f9c350dc80f1de706 | 89c2ca24e0b341fd1eddaf5a42817715eced8f91 | heanglightman/chromium | /net/http/http_proxy_connect_job.cc | C++ | cc | 30,298 | permissive | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/http/http_proxy_connect_job.h"
#include <utility>
#include "base/bind.h"
#include "base/callback.h"
#include "base/metrics/field_trial.h"
... |
59905edd65003f7797f732f96a88f8acbba204ec | a5832032124e01a8e22abb1236cad2e153be942e | munnecoin/Munnewallet | /src/qt/editaddressdialog.cpp | C++ | cpp | 3,728 | permissive | #include "editaddressdialog.h"
#include "ui_editaddressdialog.h"
#include "addresstablemodel.h"
#include "guiutil.h"
#include <QDataWidgetMapper>
#include <QMessageBox>
EditAddressDialog::EditAddressDialog(Mode mode, QWidget *parent) :
QDialog(parent),
ui(new Ui::EditAddressDialog), mapper(0), mode(mode), mod... |
e837c024e9eca75953cb44a61931610a4790f200 | 1fd4c80219464d907392c8807c435e3481fd4967 | aronhelser/VTKExamples | /src/Cxx/Rendering/Shadows.cxx | C++ | cxx | 6,621 | permissive | // test baking shadow maps
#include <vtkSmartPointer.h>
#include <vtkActor.h>
#include <vtkCamera.h>
#include <vtkCameraPass.h>
#include <vtkCellArray.h>
#include <vtkLight.h>
#include <vtkOpenGLRenderer.h>
#include <vtkOpenGLTexture.h>
#include <vtkPlaneSource.h>
#include <vtkCubeSource.h>
#include <vtkPolyDataMappe... |
f99142d058f806d3913264380adb6bb0e9b89b65 | 17bbc005a26c48b787a1a1dba348c5f6691c1aff | devmil/qmlnet-native | /QmlNet/qml/QCoreApplication.cpp | C++ | cpp | 6,724 | no_license | #include <QmlNet/qml/QCoreApplication.h>
#include <QmlNet/qml/NetVariantList.h>
#include <QmlNet/qml/NetQObject.h>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QmlNetUtilities.h>
#include <QDebug>
#include <QIcon>
#if __has_include(<QApplication>)
#define QMLNET_HAS_WIDGETS
#include <QApplicat... |
e1f67030361a487eb18b8b55348e932722525a23 | a1459bdf19414e9f6944236f04112590c48ca1e0 | InternetofAwesome/mynewt-nimble | /porting/npl/linux/src/os_eventq.cc | C++ | cc | 2,756 | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
e5a9ae2cbf02fe7edc4b35d8dde0c18593d96ca1 | 6d2e5946b9198b705fc08e00ea0a33078deb90b3 | ayushgupta1997/I-Kit | /Hashing/Print Number in words till 9999.cpp | C++ | cpp | 3,182 | no_license | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define rep(i, a, b) for(int i = a; i < b; i++)
#define REP(i, a, b) for(int i = a; i <= b; i++)
#define sc(n) scanf("%d",&n)
#define sc2(a,b) scanf("%d%d", &a, &b)
#define pb ... |
4f6ac44360c7d6811f666914d9f7b0b249ea769a | 20d372f2791828bbe19cffddf0dafbeec216ee7b | LINDBURG/baekjoon | /cppsrc/2438.cpp | C++ | cpp | 200 | no_license | #include <stdio.h>
#include <stdlib.h>
int main() {
int i, j, num;
scanf("%d", &num);
for (i = 1; i <= num; i++) {
for (j = 0; j < i; j++) {
printf("*");
}
printf("\n");
}
return 0;
}
|
a7d55cc9be25674a8db5773ef14e98ac756e530b | f26c673c67cd2ff87c5addd59b7940d6b3977434 | AlexGavrilova/TCHMK3 | /tchmk.cpp | C++ | cpp | 13,122 | no_license | #include "tchmk.h"
LongNumber ReadNumber(unsigned long long int value)
{
struct LongNumber num;
num.pointer = (unsigned int*)malloc(sizeof(unsigned int)*(3));
num.size = 0;
unsigned long long int carry = value;
do
{
num.size++;
num.pointer[num.size - 1] = carry % BASE;
carry = carry / BASE;
} while (car... |
1c6d1c832e2cdfe90d8364ad8322572b181a5fe6 | 3a5cf276c4ee10912bb2c9b9507d12105adfad23 | shravanrn/nacl-llvm | /lib/Transforms/NaCl/PromoteI1Ops.cpp | C++ | cpp | 6,388 | permissive | //===- PromoteI1Ops.cpp - Promote various operations on the i1 type--------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
d48744fdf8bd734841b05c04b8ab185dbac091e4 | 749a3f201c1c855b61a862983a81d24c71cd7289 | kiike/xplugins | /Xsaitekpanels/multipanel.cpp | C++ | cpp | 35,340 | no_license | // ****** multipanel.cpp **********
// **** William R. Good ********
#include "XPLMUtilities.h"
#include "XPLMDataAccess.h"
#include "saitekpanels.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#define testbit(x, y) ( ( ((const char*... |
8bdf7f0378692f0bf3dfa066335c2cfb31cc5f22 | 2c2b80ba8f28577d71bd7f9a75b908a39cdb1a7b | altseed/Altseed | /Dev/asd_cpp/core/Shape/asd.CoreArcShape_Imp.cpp | C++ | cpp | 5,722 | permissive | #include "asd.CoreTriangleShape_Imp.h"
#include "asd.CoreArcShape_Imp.h"
#include <Box2D/Box2D.h>
namespace asd
{
CoreArcShape_Imp::CoreArcShape_Imp()
:
position(Vector2DF())
, startingCorner(0)
, endingCorner(0)
, innerDiameter(0)
, outerDiameter(0)
, numberOfCorners(0)
, angle(0)
{
}
int CoreA... |
ad108c9c6093e29e06e2e5303a9893f0afa338a8 | 9e6c9f62f6b3bc93eac755c4d80e193a849e1ca3 | 4ian/GDevelop | /Core/GDCore/IDE/WholeProjectRefactorer.cpp | C++ | cpp | 75,816 | permissive | /*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "WholeProjectRefactorer.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include ... |
1fa4a1f1ef7002a85801f2cfaa18463151502c45 | c50e35c789c6453226d0a171b8cdab558ddf1bfc | EnEff-BIM/EnEffBIM-Framework | /SimModel_Python_API/simmodel_swig/SimModel_Dll_lib/framework/SimFlowTerminal_PlumbingTerminal_DishWasher.cxx | C++ | cxx | 4,124 | permissive | // Copyright (c) 2005-2014 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Fre... |
075ab31d3148cf993ef3cbf64bd75bb0e26dbc15 | 5996a2df174a861658674f32c89d2960af0234ec | rishabkr/Competitive-Programming | /Leetcode(209-1239)/307_range_sum_query_with_updates.cpp | C++ | cpp | 1,256 | no_license | class NumArray {
vector<int>fenwick;
vector<int>arr;
int n;
public:
void put_val(int index,int value)
{
index+=1;
while(index < fenwick.size())
{
fenwick[index]+=value;
index=index+(index&(-index));
}
... |
0844d811b88108e8325eef08e7f81a64b7c77ded | 089f8c0b21f629caade316d458da935e7121f0c3 | Mem2019/MyCTFChallenges | /TrieTreeCM/kxctf2017OctMine/TrieTreeString.cpp | C++ | cpp | 1,156 | permissive | #include "stdafx.h"
#include "TrieTreeString.h"
#include <cstring>
#include <iostream>
using namespace std;
TrieTreeString::TrieTreeString()
{
length = 0;
str[0] = '\0';
}
TrieTreeString::TrieTreeString(char* str)
{
if (!isStrContainable(str))
{
cerr << "No no no, the string length exceeds the maximum string len... |
dfffa7206e75978decb07cadb93fa3af8712a51e | 14ebb912f1f41d3bf7f8997371b1a5c92a8d7dd4 | jgespino/openvino | /inference-engine/src/plugin_api/cpp_interfaces/impl/ie_plugin_internal.hpp | C++ | hpp | 8,840 | permissive | // Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief Inference Engine plugin API wrapper, to be used by particular implementors
* @file ie_plugin_internal.hpp
*/
#pragma once
#include <ie_plugin_config.hpp>
#include <map>
#include <memory>
#include <string>
#include... |
96a3b102da700e8378044d302b40f3666051c16c | cf3d049350b9148b9505cc287cfc7097ace5fa5a | sukesuke0718/CSampleProject02 | /Address2.cpp | C++ | cpp | 235 | no_license | #include<iostream>
using namespace std;
int main() {
int n[5];
cout << "&n[2] = " << (size_t)&n[2] << endl
<< "&n[2] +1 = " << (size_t)(&n[2] + 1) << endl
<< "&n[3] = " << (size_t)&n[3] << endl;
} |
24429e2a4a1daa9556623a60bb399ac1b5efa428 | e61c8f2852f6b64ca9ed12966991d668ea992cff | mehagupta22/ECE244 | /Lab1/convert.cpp | C++ | cpp | 2,767 | no_license | #include <iostream>
using namespace std;
// Conversion constants
#define CtoFRatio 1.80
#define CtoFOffset 32.00
#define CtoKOffset 273.0
// Scale indentifiers
#define DegC 'C'
#define Degc 'c'
#define DegF 'F'
#define Degf 'f'
#define DegK 'K'
#define Degk 'k'
// Conversion function prototypes
// Should be in a ".h... |
0b52c9ec30fe65f56511b110b2665223290774d4 | 08d6bcd8aa69f2e2038d0eac940076672f7dc14c | c0de4un/bt-core | /utils/metrics/BaseLog.cpp | C++ | cpp | 4,042 | permissive | /**
* Copyright © 2020 Denis Z. (code4un@yandex.ru) All rights reserved.
* Authors: Denis Z. (code4un@yandex.ru)
* All rights reserved.
* Language: C++
* License: see LICENSE.txt
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions a... |
85a5b989d6cded01c8caa0a317fbd8261f58669b | 55c71e5de9b576ba57bab75afb6a69f02a609bdd | enriquegr84/GameEngineTutorial | /Source/GameEngine/Graphic/Renderer/DirectX11/HLSL/HLSLTextureBuffer.cpp | C++ | cpp | 788 | no_license | // David Eberly, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2017
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// File Version: 3.0.1 (2016/09/12)
#include "HLSLTextureBuffer.h"
HLSLText... |
bd2241f2d82c48838c11f4ff8d6520f0810ebd65 | 52f4311bfa0a6ffa582a2cc8d6ad90357bc68c30 | px41833/wangjin | /10-app/nvr/source/nvs_core.cpp | C++ | cpp | 5,182 | no_license |
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <sys/socket.h>
#include <sys/un.h>
#include "common.h"
#include "mc.h"
#include "dev.h"
#include "nvs_core.h"
#define mn_log(fmt, ...) printf("[MN]%s %d:" fmt, __FUNCTION__, __LINE__, ##__V... |
5832072bc346a177c9805fc771bc2a2b829af090 | 2a93e85020ca8da4682a3f2329bb2033c12734e5 | zhou78yang/homeworks | /pat/B/1043.cc | C++ | cc | 591 | no_license | #include <iostream>
using namespace std;
int main()
{
char str[10005];
int book[256] = {0};
cin >> str;
for(int i = 0; str[i] != '\0'; i++) book[str[i]]++;
char ascii[7] = "PATest";
int order[6];
for(int i = 0; i < 6; i++) order[i] = book[ascii[i]];
bool flag = true;
while(flag)
... |
c966ffe92e5345942adb20346e1bf0c3859f65c2 | e5e6fdd6fb4823472e353a678c5b91890f5f610b | Sanyam96/HackerRank-Solutions | /Domains/Core CS Tracks/Basic Programming/Divisible Sum Pairs.cpp | C++ | cpp | 928 | no_license | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... |
89bbfa9bf7c021ddc6b0cf0ddd16d5115b21c850 | 59c697758a1022ba6653c2dd75e1bd3b7d4854f9 | Steveb-p/brick | /libcef_dll/ctocpp/domdocument_ctocpp.cc | C++ | cc | 7,185 | permissive | // Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translato... |
213b3e02c87212cade673ed4fbb133e566db107f | 016b34ea168dd3ed96ae96f3e170abe961ce3c8d | ASMlover/study | /cplusplus/MemoryEvolve/InfantGC/VM.cc | C++ | cc | 2,931 | no_license | // Copyright (c) 2020 ASMlover. 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 ofconditions and... |
08795c945adac655bcbf23c30aca334b32ec9840 | ef2b350610f95e8fdaa0d2d56eae1d76ea77d00a | hugetiny/DTXManiaXG-verK | /SlimDXc_Jun2010(VC++2008)/source/direct3d9/Sprite9.cpp | C++ | cpp | 5,597 | permissive | #include "stdafx.h"
/*
* Copyright (c) 2007-2010 SlimDX Group
*
* 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, m... |
0aeca32a1327816f9c29fb0d4e0f9d77b2996e3f | a55e096eef0fe4cc1ad88ea707d24a801f946f71 | qixianlong/pi | /libraries/plugins/pi_witness/pi_witness.cpp | C++ | cpp | 12,039 | permissive | /*
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
*
* The MIT License
*
* 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... |
b5329fbb6e7f1f53bc275c10f8ff308304836727 | f101e90284e38872d219d0c6c8858a855c2537c6 | zhoufangyuanTV/zzzz | /2021-1-6/2021-1-5HardT1/count.cpp | C++ | cpp | 1,996 | no_license | #include<cstdio>
#include<cstring>
using namespace std;
int x[11000],y[11000],w[11000];
long long M[110][110],MM[110][110];
inline long long ksm(long long x,long long k)
{
long long s=1;
while(k>0)
{
if(k&1)s=s*x%998244353;
x=x*x%998244353;
k>>=1;
}
return s;
}
int main()
{
freopen("count.in","r",stdin);
f... |
d0a77ce3c57dd65a84f8817151eaf9fc6aa018c3 | 86c9fc074d619e04e8882404150beef8e8f11199 | vivlund65/cmake_testapp | /test/tests.cpp | C++ | cpp | 671 | no_license | //
// Created by Vivian Lund on 4/22/20.
//
#define BOOST_TEST_MAIN // in only one cpp file
#define BOOST_TEST_MODULE my_unit_tests
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp> //BOOST_TEST_DYN_LINK
#include "../calc.h"
BOOST_AUTO_TEST_SUITE(my_testsuite)
BOOST_AUTO_TEST_CASE(addvalues_zero)... |
9303583acc483a1dad7c09c9163ee15f5bc4e393 | 1621b13728ef85ef9e96f2b17fca6d0eb1509889 | pbyri/SuperMarket | /tests/ProductTest.cpp | C++ | cpp | 1,760 | no_license | /** @file ProductTest.cpp
* @brief This file contains unit tests for Product.cpp
* @author Pavan Kumar Byri
* @date 06-13-2018
*
*/
#include "Product.h"
#include "catch.hpp"
#include <memory>
#include <sstream>
using namespace SuperStore;
SCENARIO("validate Product object", "[Product]")
{
Product p(10,"soap"... |
cdbee0fc0c28a3da5f9249690c84a37e824cd289 | fa99777be9f95c2ad73c0bb9c49e44c898a4e6e9 | sadrulhc/chromium | /third_party/blink/renderer/core/svg/svg_animate_element.cc | C++ | cc | 21,434 | permissive | /*
* Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
* Copyright (C) 2008 Apple Inc. All rights reserved.
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
*
* This library is free software; you can redistribute it and/o... |
7062a79a02acc76d604ddb5223fca64f71ab64ed | a3e0691fabeddd732a1bc2568718c71a3f34a6b2 | June-UwU/Handmade | /Handmade/Handmade.cpp | C++ | cpp | 1,241 | no_license | #include "Handmade.h"
#include <stdint.h>
internal void RenderWeirdGradient(GameScreenBuffer* Buffer, int XOffset, int YOffset)
{
// may need to clear this to black
uint8_t* Row = static_cast<uint8_t*>(Buffer->Memory);
for (int Y = 0; Y < Buffer->Height; Y++)
{
uint32_t* Pixel = (uint32_t*)Row;
for (int X = 0;... |
3a363756148bfdf49eb6d314f5868c44bff23321 | e58d36e318e705d9fbf251f8c301e9adca52a56d | graphcore/tensorflow | /tensorflow/core/kernels/maxpooling_op.cc | C++ | cc | 74,373 | permissive | /* Copyright 2015 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... |
71e042eb1afacbdd0c3ca07279a372b44d7f3e7a | 05a6643441849888451cd8718f4c7eee99a31025 | boostorg/safe_numerics | /test/test_right_shift_automatic_constexpr.cpp | C++ | cpp | 1,341 | permissive | // Copyright (c) 2019 Robert Ramey
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/safe_numerics/safe_integer.hpp>
#include <boost/safe_numerics/automatic.hpp>
#include "test_right_shift_auto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.