text
stringlengths
8
6.88M
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : va...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <map> using namespace std; typedef long long ll; #define INF 10e17 // 4倍しても(4回足しても)long longを溢れない #de...
#include "pch.h" #include "AudioSource.h" #include "Core/ComponentFactory.h" #include "System/AudioSystemWwise.h" IMPLEMENT_COMPONENT_TYPEID(Hourglass::AudioSource) void Hourglass::AudioSource::Start() { hg::g_AudioSystem.RegisterEntity(GetEntity(), "AudioSourceEntity"); } void Hourglass::AudioSource::Shutdown() {...
#ifndef LINEARKALMANFILTER_H #define LINEARKALMANFILTER_H // http://arma.sourceforge.net/docs.html #include "armadillo" class LinearKalmanFilter { public: LinearKalmanFilter( const arma::mat& stateTransitionMatrix, const arma::mat& controlMatrix, const arma::mat& observationMatrix, const arma::mat& ini...
//知识点: 模拟,树状结构 /* By:Luckyblock 题目要求: 给定 一棵树, 点有点权 给定两种操作: 1.修改某节点的点权 2.查询 距某节点 最近的 一个祖先, 满足 此节点 与 其祖先节点 点权值 最大公约数>1 分析题意: 由于此题数据 较弱 可以直接 暴力模拟 对于被查询节点, 暴力上跳 对于其每一个祖先 , 都与被查询节点进行比较 如果 最大公约数 >1 则直接输出 数据加强: 在初期状态和更改节点时,所有定点进行一次更新。之后所有1询问,用O(1)的方法得出。 A[i]的范围约20亿,而将其平方根后,质数约5000个。 先把A[i]全部质因数分解掉,...
/*In this program we will be seeing about ARRAY in C++ Program*/ /*Array in a C++ Program is a kind of data type which is an user Defined data type, which is used to store a Collection of data which have same data type.*/ /*ADVANTAGE OF ARRAY : When used need to store many values of same data type, he/she can't ale t...
#ifndef MSORT_H #define MSORT_H #include <cmath> #include "comparison.h" using namespace std; template <class T, class Comparator> void mergeSort (vector<T>& myArray, Comparator comp) { mergeSortHelper(myArray, comp, 0, myArray.size()-1); } template <class T, class Comparator> void mergeSortHelper (vector<T>& ...
#ifndef DB_H #define DB_H #include "log.h" #include <vector> #include <QtSql/QSqlQuery> #include <QObject> using namespace std; class Db : protected Log { public: Db(); void connectSQL(); void selectNames(); void selectParts(QString name); void selectConstruct(QString name); static vector<...
// // Team_Pokemon.cpp for piscine in /home/selari_j/rendu/rush03_pool/s_team // // Made by Julien Selaries // Login <selari_j@epitech.net> // // Started on Sat Jan 24 17:15:29 2015 Julien Selaries // Last update Sun Jan 25 23:24:49 2015 Tristan Roby // #include <iostream> #include <fstream> #include "Pokeplus.h...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2010 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Tomasz Jamroszczak tjamroszczak@opera.com * */ #ifndef D...
/* ======================================================================== DEVise Data Visualization Software (c) Copyright 1992-1996 By the DEVise Development Group Madison, Wisconsin All Rights Reserved. ======================================================================== Under no circumstances ...
// // Created by fab on 20/12/2020. // #ifndef DUMBERENGINE_IPOSTRENDERING_HPP #define DUMBERENGINE_IPOSTRENDERING_HPP class IPostRendering { public: virtual void postDraw() = 0; }; #endif //DUMBERENGINE_IPOSTRENDERING_HPP
#pragma once #include "SquareGrid.h" SquareGrid::SquareGrid() { std::srand(std::time(NULL)); } SquareGrid::~SquareGrid() { delete[] mTiles; delete[] mNeighbors; } bool SquareGrid::init(/*std::string file*/ std::vector<SpawnerStruct>& enemySpawners) { startPos = 0; mWidth = 10; mHeight = 10; mTileWidth = 125...
#ifndef LocalizationSimulator_h #define LocalizationSimulator_h // standard includes #include <cmath> #include <memory> // system includes #include <Eigen/Dense> #include <actionlib/server/simple_action_server.h> #include <eigen_conversions/eigen_msg.h> #include <nav_msgs/OccupancyGrid.h> #include <ros/ros.h> #includ...
/* * struct.h * * Created on: 2021. 9. 25. * Author: dhjeong */ #ifndef RAIIANDMEM_STRUCT_H_ #define RAIIANDMEM_STRUCT_H_ #include <boost/shared_ptr.hpp> #include <iostream> class DataInfo { public: DataInfo() { size = 0; permission = 0; } DataInfo(const std::string &sName, size_t sSize, int sPerm...
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { std::vector<int> vs1; int n = 5; for (int i = 0;i < n;i++) { vs1.push_back(i); } vs1.pop_back(); vs1.insert(vs1.begin(), 100); vs1.insert(vs1.begin()+3, 200); vs1.insert(vs1.end() ,300); for (size...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Простой пример использования логических значений // При каких условиях можно поплавать? // V 1.0 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include<iostream> using namespace std; int main() { cout...
#include "Graph.h" #include <map> #include <iomanip> #include <vector> #include <algorithm> Graph::Graph(ofstream * flog) { this->mList = NULL; // mList[from vetex] = map<to vertex, weigth> this->vertex = NULL; // vetex[index] = CityData * this->mstMatrix = NULL; // MST this->flog = flog; } ...
// Created on: 1994-09-02 // Created by: Bruno DUMORTIER // Copyright (c) 1994-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef PRINT_PROGRESS_DIALOG_H #define PRINT_PROGRESS_DIALOG_H #include "adjunct/qui...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #include "core/pch.h" #include "m...
// // Created by DELL on 10/24/2020. // #include "GamePlay.h" GamePlay::GamePlay() {} GamePlay::~GamePlay() {} GamePlay::GamePlay(Logic logic, Draw draw, Menu menu, vector <int> tiles_amt, vector <int> player_point) { this->logic = logic; this->draw = draw; this->menu = menu; this->til...
int Solution::isSameTree(TreeNode* A, TreeNode* B) { if(A==NULL&&B==NULL) return 1; else if(A==NULL||B==NULL) return 0; //if(A!=B) return false; if(A->val==B->val){ if(isSameTree(A->left,B->left)&&isSameTree(A->right,B->right)) return true; return false; } return false; }
#include <cstdlib> #include <thread> #include <future> #include <functional> #include <unistd.h> #include <gtest/gtest.h> #include "threading.h" void* GetTid(void* arg) { int64_t* id = reinterpret_cast<int64_t*>(arg); *id = Threading::GetTid(); return nullptr; } TEST(ThreadingTest, GetTidTest) { int64_t id =...
#include <ros/ros.h> #include <std_msgs/Int8.h> #include <sensor_msgs/JointState.h> std::vector<double> getVelocities(int num_joints) { static int count = 0; std::vector<double> vals; if (count == 0) vals.resize(num_joints, 1.0); else if (count == 1) vals.resize(num_joints, 0.0); else if (count == 2) vals.re...
// INCLUDE FILES #include "SmsReceiver.h" // CSmsReceiver #include "SmsReceiverObserver.h" // MSmsReceiverObserver #include <smsuaddr.h> // TSmsAddr #include <gsmubuf.h> // CSmsBuffer #include <smsustrm.h> // RSmsSocketReadStream #inclu...
#ifndef TEAM_H #define TEAM_H #include <iostream> #include <string> #include <sstream> #include <vector> #include "Character.h" using std::string; using std::stringstream; using std::cout; using std::endl; using std::vector; class Team { private: vector<Character*> team; publ...
#include "word_frequency.h" /** * This is a small proof-of-concept sample. * Its purpose is to try out the cmake tool, * and to recap OOP in C++. * The scenario used is a word frequency detector. * This path to the input file is the only parameter to this program. */ int main (int argc, char* argv[]) { const c...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- ** ** Copyright (C) 2009-2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** @author sof */ #ifndef DOM_EXTENSIO...
#include "Factory.h" #include "Unit.h" #include <vector> #include <string> #include <fstream> #include <algorithm> #include <iostream> Factory::Factory(const Cell& cell,Player& player):cell(cell), player(player) { std::cout << "Factory::Factory(Cell)" << std::endl; } Player& Factory::getPlayer() const { ...
#ifndef SHOC_MODE_CTR_H #define SHOC_MODE_CTR_H #include "shoc/util.h" namespace shoc { /** * @brief Basic counter mode function, used as a component in CTR and GCM modes. * Counter size is configurable. All pointers MUST be valid. * * @tparam E Block cipher * @tparam L Counter size, default is 4 * @param iv...
#include <iostream> #include "BinarySearchTree.h" #include "AvlTree.h" #include <cstdlib> #include <fstream> #include <time.h> using namespace std; int init_size = 3; // intial size of the trees --can be changed later int n = 100; // number of operations --can be changed later ofstream fout1, fout2; // fout1 for...
#include "StdAfx.h" #include "skeleton.h" #include "Utility_wrap.h" #include "MeshCutting.h" #include "neighbor.h" #include "rapidxml_utils.hpp" #include "myXML.h" // XML key #define BONE_KEY "bone" #define PROPERTIES_KEY "bone_properties" #define CHILD_KEY "children" #define NAME_KEY "bone_name" #define BONE_SIZE_KEY...
#include "BananaWorker.hpp" #include <cmath> #include <string> #include <stdexcept> #include <iostream> #include <cstdio> #include <climits> using namespace bn; BananaWorker::BananaWorker() : topLeft{0, 0}, botRight{0, 0}, firstPoint{0, 0}, secondPoint{0, 0}, thirdPoint{0, 0}, fourthPoint{0, 0}, fifthPoint{0,...
// **************************************************************** // * // File name: testVideoStore.cpp * // * // Programmer: Nicole Hurst ...
#include "DQM/SiStripCommissioningClients/interface/SummaryPlotXmlParser.h" #include "DataFormats/SiStripCommon/interface/SiStripEnumsAndStrings.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include <stdexcept> using namespace xercesc; using namespace sistrip; // --------------------------------------...
#ifndef __GLENGINE__ #define __GLENGINE__ #include "..\EngineLib\GLEngineDevice.h" #include "..\EngineLib\PhysEngineDevice.h" #include "..\EngineLib\EngineCommon.h" #include <gl\GL.h> #include <gl\GLU.h> #include <map> #include <mutex> typedef struct { uint8_t* datBuff[2]; BITMAPFILEHEADER* bmpHeader; BITMAPINFOHEA...
class Pereche{ double x; Polinom pol; public: friend istream& operator >>(istream &in, Pereche &per); friend ostream& operator <<(ostream &out, Pereche &per); bool verificaRadacina(Pereche &per); }; istream& operator>>(istream &in, Pereche &per){ in>>per.x; in>>per.pol; ...
// Copyright (c) 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. #ifndef NAVCOIN_QT_PLATFORMSTYLE_H #define NAVCOIN_QT_PLATFORMSTYLE_H #include <QIcon> #include <QPixmap> #include <QString> /* ...
#pragma once #include <QAbstractListModel> class QTimer; class ProfessionsService; class ProfessionsListModel : public QAbstractListModel { Q_OBJECT public: explicit ProfessionsListModel(QObject *parent = nullptr); // Basic functionality: int rowCount(const QModelIndex &parent = QModelIndex()) cons...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Classes/Engine/DataTable.h" #include "MultiplayerSandboxTypes.generated.h" class UTexture2D; class UStaticMesh; USTRUCT(BlueprintType) struct FInventorySlotInfo { GENERATED_USTRUCT_BODY(...
#include "ISolidShape.h"
#include <pangolin/log/playback_session.h> #include <pangolin/utils/params.h> namespace pangolin { std::shared_ptr<PlaybackSession> PlaybackSession::Default() { static std::shared_ptr<PlaybackSession> instance = std::make_shared<PlaybackSession>(); return instance; } std::shared_ptr<PlaybackSessio...
/** * @file * @author Aapo Kyrola <akyrola@cs.cmu.edu> * @version 1.0 * * @section LICENSE * * Copyright [2012] [Aapo Kyrola, Guy Blelloch, Carlos Guestrin / Carnegie Mellon University] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with ...
#pragma once namespace HotaSim { class Ability; struct AbilityTemplate; class Artifact; struct ArtifactTemplate; class Biom; struct BiomTemplate; class Encounter; struct EncounterTemplate; class Hero; struct HeroTemplate; class Spell; struct SpellTemplate; class Town; struct TownTemplate; class Unit; struct Un...
#include <ros/ros.h> #include <stdio.h> #include <stdlib.h> #include <image_transport/image_transport.h> #include <cv_bridge/cv_bridge.h> #include <sensor_msgs/image_encodings.h> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/video/tracking.hpp> #include <PerFoRoControl/...
#ifndef examples_h #define examples_h #include <stdio.h> #include <vector> #include "tiny_dnn/tiny_dnn.h" #include "pso/psoHeaders.h" #include "additional_functions.h" #include "fitnessFunctions.h" using namespace tiny_dnn; using namespace tiny_dnn::activation; using std :: cout; using std :: endl; using std :: vect...
#ifndef GORGETO_H #define GORGETO_H #include "Widget.h" class Gorgeto: public Widget { public: Gorgeto(int, int); virtual ~Gorgeto(); virtual void rajzol() override; virtual void esemeny(genv::event ev); virtual void elmozdul(int,int); virtual void meret(int); ...
class Solution { public: vector<int> findMinHeightTrees(int n, vector<pair<int, int>>& edges) { if(n == 1) return {0}; vector<int> res; vector<unordered_set<int> > Graph(n); for(int i=0; i<edges.size(); ++i){ int first = edges[i].first; int second = edges[i].s...
// // SuperBullet.cpp // ClientGame // // Created by liuxun on 15/3/3. // // #include "stdafx.h" #include "Player.h" #include "Bullet.h" #ifndef __ClientGame__SuperBullet__ #define __ClientGame__SuperBullet__ class SuperBullet : public Bullet { public: SuperBullet(Player* player); }; #endif /* defined(_...
#include "Vector3D.h" void Vector3D::Read() { int a, b, c; do { cout << "Ââåä³òü x: "; cin >> a; cout << "Ââåä³òü y: "; cin >> b; cout << "Ââåä³òü z: "; cin >> c; } while (!(Init(a, b, c))); } bool Vector3D::Init(int first, int second, int third) { if (abs(first) <= 100 && abs(second) <= 100 && abs(third) <= ...
#include <math.h> #include <memory.h> #include <stdlib.h> #include <time.h> #include <vector> #include "mkl_spblas.h" #include "util.h" using namespace std; const double MAX_VAL = 100.0; // Флаг - был ли инициализирован генератор случайных чисел bool isSrandCalled = false; // Создает квадратную матрицу в формате CC...
#pragma once // Forwarded references class PdbTranslationMaps; class PdbModuleDetails; class PdbFile; class PdbModule : public IPdbModule { public: // Interface const std::wstring& GetName() const; IPdbModuleDetails* GetModuleDetails(); std::vector<IPdbSourceFile*>& GetSourceFiles(); // Internal PdbMod...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2003 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #include "core/pch.h" #ifdef WBMP_SUPPORT #include "modules/...
#include <Rcpp.h> using namespace Rcpp; #ifndef __REVERT__ #define __REVERT__ /** * A revert detector, using a simplified version of Halfak's standard * methodology - namely, checking whether each SHA1 hash from a page * exists between two /matching/ SHA1 hashes. If it does, the edit * was reverted: if it doesn't...
/** Copyright (c) 2015 Eric Bruneton 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...
#include "widget.h" Widget::Widget(QWidget *parent) : QWidget(parent), page1(new Coding()), page2(new Decoding()), tab(new QTabWidget()), main_layout(new QVBoxLayout()) { main_layout->addWidget(tab); this->setLayout(main_layout); tab->addTab(page1, "Coding"); tab->addTab(page2, "Decoding"); } Widg...
/* Chris Jakins */ /* CSE1325 */ /* HW2 9/7 */ #include <iostream> #include <string> #include <vector> #include "student.cpp" int main() { std::vector<Student> students; std::string name; double grade; getline(std::cin, name); while (name != "exit") { students.push_back(name); ...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #ifndef ES_DEBUG_BUILTINS_H #define ES_DEBUG_BUILTINS_H #ifdef ES_DEBUG_BUILTINS class ES_DebugBuiltins { public: #ifdef ES_HEAP_DEBUGGER static BOOL ES_CALLING_CONVENTION getHeapInformation(ES_Execution_Co...
#pragma once #ifndef GAME_H #define GAME_H #include <SDL.h> #include <SDL_image.h> #include "Screen.h" class Game { public: bool init(); void start(); void close(); bool closeGame{ false }; private: SDL_Window* window = nullptr; SDL_Renderer* renderer = nullptr; Screen* screen = nullptr; int numberOfMines...
#ifndef EASYLEVEL_ONE_H #define EASYLEVEL_ONE_H #include <QDialog> namespace Ui { class easylevel_one; } class easylevel_one : public QDialog { Q_OBJECT public: explicit easylevel_one(QWidget *parent = nullptr); ~easylevel_one(); private: Ui::easylevel_one *ui; }; #endif // EASYLEVEL_ONE_H
#include "CImg.h" #include "Info.h" #include <stdexcept> #include <bitset> #include <map> #include <sstream> using namespace cimg_library; using std::string; std::map<string, string> parseCMD(int argc, char *argv[]); template<typename T> void encrypt(CImg<T>& apparent, CImg<T>& secret, std::map<string, string>& co...
class Solution { public: int removeDuplicates(vector<int>& nums) { size_t size = nums.size(); if(size == 0) return 0; size_t copyTo = 1; for(size_t i = 1;i < size;++i) { if(nums[i-1] != nums[i]) { nums[copyTo] = nums[i]; ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 2003 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Morten Stenshorne */ #ifndef X11_POPUPWI...
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #ifndef STFY_APP_I2C_HPP_ #define STFY_APP_I2C_HPP_ #include <iface/dev/i2c.h> #include "Periph.hpp" namespace hal { /*! \brief I2C Peripheral Class * \details This class implements I2C device peripherals. */ class I2C : public Periph { publi...
#include <SR04.h> #include <WebServer.h> #include <AutoConnect.h> #include "SPIFFS.h" #include "esp_camera.h" #include "fd_forward.h" enum State {READY, SCANNING, LOOKING, SEARCHING , TRACKING, BACK, WAIT, INGAME, SAD, MOVEMENT, EXPLAINING }; State c_state; // define all the messages #define ARD_READY "1" #define ES...
#include<iostream> using namespace std; long long gcd(long long a,long long b) {long long t; while (b) {t = a%b; a = b; b = t; } return a; } long long mul(long long a,long long b,long long c,long long m) {long long k,t = 6; k = gcd(t,a);a/=k;t/=k; k = gcd(t,b);b/=k;t/=k; k = gcd(t,c);c/=k;t/...
// Created on: 2013-12-20 // Created by: Denis BOGOLEPOV // Copyright (c) 2013-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 ...
#include <iostream> void function_(int a);
#include "TestGTE.h" #include <iostream> #include <iomanip> int main(int argc, char **argv) { using namespace test; gte device; GTEtestbench tester(&device); tester.constructInstruction(0, 0, 0, 3, 1, MVMVA); tester.storeControl(gte::R11R12, 0x40003000); // rotation matrix tester...
#include <dmp_lib/math/quaternions.h> #include <cmath> namespace as64_ { namespace dmp_ { Eigen::Matrix3d vec2ssMat(const Eigen::Vector3d &v) { Eigen::Matrix3d ssMat; ssMat(0, 1) = -v(2); ssMat(0, 2) = v(1); ssMat(1, 0) = v(2); ssMat(1, 2) = -v(0); ssMat(2, 0) = -v(1); ssMat(2, 1) = v(0); return ...
#include <iostream> #include <vector> #include <map> #include <cmath> #include <queue> #include <algorithm> #include <iomanip> #include <set> using namespace std; /*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/ #define int long long int #define ld long double #define F first #define S second #define P p...
#include "tracker.h" #include "matching.h" int BaseTrack::_count = 0; STrack::STrack(cv::Rect_<float>& tlwh, float score_, cv::Mat temp_feat, int buffer_size) :_tlwh(tlwh) { score = score_; update_features(temp_feat); } STrack::~STrack() { } void STrack::update_features(cv::Mat &feat) { cv::Mat norm_feat; cv::...
// Using floodfill. Time-0.000s #include <bits/stdc++.h> using namespace std; #define ll long long #define vll vector<ll> int dr[] = {1,0,0,-1}; int dc[] = {0,1,-1,0}; char a[21][21],land; ll visit[21][21]; ll m,n; ll dfs(ll i, ll j) { ll sx; if(j==n) j=0; else if(j==-1) j=n-1; if(i >= m || j >=...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2002-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Morten Stenshorne */ #ifdef TEXTSHAPER_SUPPORT #ifndef TEXT_...
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/MerchantProfilePage.g.uno. // WARNING: Changes might be lost if you edit this file directly. #include <_root.MerchantProfilePage.h> #include <_root.MerchantProfilePage.Template2.h> #include <Fuse.Node.h> #include <icon.Map.h> #include <Uno.Bool....
/** * Unidad 3: LED RGB Random * * Esta vez el color cambiará cada cierto tiempo aleatorio * a un valor aleatorio */ byte pinRGB[] = {9, 10, 11}; void setup() { for (byte i = 0; i < 3; i++) { pinMode(pinRGB[i], OUTPUT); } } /** * Función que activa los pines correspondientes para mostrar * e...
#include "prefix.h" #include "ControllerConnect.h" #include "MessageManager.h" char *IP_SERVER = "192.168.4.97"; //char *IP_SERVER = "127.0.0.1"; int portID = 7747; #define handleNum 1 #define transcoderNum 2 int main() { HANDLE receiversHandle[handleNum]; HANDLE sendersHandle[handleNum]; SOCKET sockets[h...
#include "meltCmd.h" #include "meltNode.h" #include <maya/MFnPlugin.h> MStatus initializePlugin(MObject obj) { MStatus stat; MString errStr; MFnPlugin pluginFn(obj, "jason.li", "1.0", "any"); stat = pluginFn.registerCommand("melt", MeltCmd::creator); if (!stat) { errStr = "registerCommand failed"; goto erro...
 #include "myMQ.h"
///////////////////////////////////////////////////////////////////////////// // Name: text.cpp // Purpose: TextCtrl wxWidgets sample // Author: Robert Roebling // Modified by: // RCS-ID: $Id: text.cpp,v 1.81.2.1 2005/11/30 20:48:19 MW Exp $ // Copyright: (c) Robert Roebling, Julian Smart, Vadim ...
/* ID: stevenh6 TASK: subset LANG: C++ */ #include <fstream> using namespace std; ifstream fin("subset.in"); ofstream fout("subset.out"); int n; long long int dyn[1024]; int main() { fin >> n; int s = n * (n + 1); if (s % 4) { fout << 0 << endl; return 0; } s /= 4; ...
/** * Copyright (c) 2007-2012, Timothy Stack * * 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 ...
#include "WelcomeLayer.h" bool WelcomeLayer::init() { if (!Layer::init()) { return false; } return true; } void WelcomeLayer::onEnter() { Layer::onEnter(); auto director = Director::getInstance(); Size visibleSize = director->getVisibleSize(); Point origin = director->getVisibleOrigin(); /...
#define __GXX_EXPERIMENTAL_CXX0X__ #define _GLIBCXX_USE_NANOSLEEP #include <iostream> #include <thread> #include <vector> #include <algorithm> #include <iterator> #include <chrono> using namespace std; int main() { std::vector<std::thread> threads; for(int i =0; i < 10; ++i) { threads.push_back(std::thread(...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Triad National Security, LLC. This file is part of the // Tusas code (LA-CC-17-001) and is subject to the revised BSD license terms // in the LICENSE file found in the top-level directory of this distribution. // ////...
/* RVD_Vertex record the intersection Vertex and normal Vertex */ #ifndef H_RVD_VERTEX_H #define H_RVD_VERTEX_H #include "Common.h" #include "math_3d.h" namespace P_RVD { /* defien the vertex type symbolic */ enum VertexType { VertexType1, VertexType2, VertexType3 }; /* define the Edge type ...
// // Created by 송지원 on 2019-11-02. // #include "iostream" using namespace std; int get_len(int input) { int i, temp, cnt=0; temp = input; for (i=0; i<7; i++) { temp /=10; if (temp>0) cnt++; else return cnt+1; } } int main () { int i1, i2, i3, i4, len; long long val1,...
/* Copyright 2021 University of Manchester 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 writing, s...
/* Question: Create a class Date containing member as: - dd - mm - yyyy Write a C++ program for overloading operators >> and << to accept and display a Date. */ #include<iostream> #include<stdlib.h> using namespace std; class Date{ private: int dd,mm,yy; public: friend istream &operator >>(is...
#include <catch2/catch.hpp> #include <replay/table.hpp> using namespace replay; TEST_CASE("default constructed table is empty") { table<float> t; REQUIRE(t.empty()); } TEST_CASE("move-constructed table has stable address") { table<float> source(4, 4, 42.f); auto old_address = source.ptr(); table<...
#include "stdafx.h" #include "StubDataManager.h" #include "Situation.h" #include "Transition.h" #include <memory> #include "CppUnitTest.h" #include "SituationGraph.h" using std::make_shared; using namespace Microsoft::VisualStudio::CppUnitTestFramework; StubDataManager::StubDataManager() : inputs() { } StubDataMan...
#include "msg_0xcd_clientstatuses_cts.h" namespace MC { namespace Protocol { namespace Msg { ClientStatuses::ClientStatuses() { _pf_packetId = static_cast<int8_t>(0xCD); _pf_initialized = false; } ClientStatuses::ClientStatuses(int8_t _payload) : _pf_payload(_payload) { _pf_packetId = static_cast<int8_t>(0xCD); ...
/*Tests for cc_tic_tac_toe::game_node.*/ #include "cc/tic_tac_toe/game_node.h" #include "gtest/gtest.h" namespace cc_tic_tac_toe { // TODO: Move this test to board_test module. TEST(BoardTest, test_result_text) { EXPECT_TRUE(kPlayerWon == Board::get_text_result(kCross, true)); EXPECT_TRUE(kPlayerWon == Board::get...
// kumaran_14 // #include <boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> using namespace std; // ¯\_(ツ)_/¯ #define f first #define s second #define p push #define mp make_pair #define pb push_back #define eb emplace_back #define rep(i, begin, end) for (__typeof...
#ifndef __EMPLOYEE_H__ #define __EMPLOYEE_H__ #include <iostream> using namespace std; class Employee { public: string Name; string Position; int Age; Employee(string n = "", string p = "", int a = 0) { Name = n; Position = p, Age = a; } Employee(const Employee& e) { Name = e.Name; Position = e.Position,...
// // Created by griha on 08.01.18. // #pragma once #ifndef MIKRONSST_HSM_IO_CRYPTO_HPP #define MIKRONSST_HSM_IO_CRYPTO_HPP #include <cassert> #include <deque> #include <algorithm> #include <crypto/input_output.hpp> #include <misc/unknown_based.hpp> namespace griha { namespace hsm { struct input_typ...
void setup() { // initialize the digital pins as output. pinMode(8, OUTPUT); pinMode(9, OUTPUT); } void loop() { digitalWrite(8, HIGH); // set the LED1 on digitalWrite(9, LOW); // set the LED2 off delay(1000); // wait for a second digitalWrite(8, LOW); // set the LED1 off digitalWrite(9, HIGH); // set ...
#include<iostream> #include "area_utils.h" using namespace std; int main(){ Rectangle rectangle; rectangle.length=10; rectangle.width=20; Circle circle; circle.radious=30; cout<<"Atrea of len 10 width 20 = "<<area(rectangle.length,rectangle.width)<<endl; cout<<"Atrea of Rec len 10 width 20 =...
#include "drop.hpp" #include "scene/player/role.hpp" #include "scene/event.hpp" namespace nora { namespace scene { pd::event_array drop_process(const pc::drop& ptt) { ASSERT(ptt.has__use_odds()); if (!ptt._use_odds()) { ...