text
stringlengths
8
6.88M
#pragma once namespace Constantes { const float PI = 3.1415927f; const glm::mat4 biasMatrix( 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0 ); }
#include <iostream> class CCSprite { public: CCSprite(int d); static void traverseCCSprite(); private: int data; CCSprite* next; static CCSprite* head; };
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef _SSL_UPDATERS_H_ #define _SSL_UPDATERS_H_ #if defined(_N...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- * * Copyright (C) 1995-2012 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 "adjun...
#ifndef _FMT_FLAG_HPP_ #define _FMT_FLAG_HPP_ namespace fmt { enum Flag : uint32_t { AlignLeft = 1, AlignRight = 1 << 1, SignPlus = 1 << 2, SignSpace = 1 << 3, Char = 1 << 4, Hex = 1 << 5, UpperHex = 1 << 6, Exponent = 1 << 7, UpperExponent = 1 << 8, Fi...
#include <systemc.h> #include <fstream> #include <iostream> SC_MODULE ( tester ){ sc_in <bool> clk ; sc_in <sc_uint <8> > out1, out2, out3, out4; sc_out <sc_uint <8> > in ; sc_out <sc_bv <4> > we ; sc_out <bool> reset ; ifstream infile; void tester_func (); SC_CTOR( tester ){ SC_TH...
// SPI full-duplex slave example // STM32 acts as a SPI slave and reads 8 bit data frames over SPI. // Master also gets a reply from the slave, which is a a simple count (0, 1, 2, 3) // that is incremented each time a data frame is received. // Serial output is here for debug #include <SPI.h> void setup() { // Th...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Генератор 32-х битных случайных чисел. // V 1.0 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include <iostream> #include <random> int main() { using namespace std; random_device rd; mt1993...
#pragma once #include <string> #include <sstream> namespace StringHelper { const char FORMAT_SYMBOL = '$'; inline std::string ToString(int x) { return std::to_string(x); }; inline std::string ToString(unsigned int x) { return std::to_string(x); }; inline std::string ToString(long x) { return std::to...
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. // Copyright (C) 2016, Intel Corporation, all rights reserved. // Third party copyrights are property of their respective own...
#include <bits/stdc++.h> using namespace std; void subString(string str, string initial=" ", int index=0) { if(index==str.size()) { cout << initial << " " << endl; return; } subString(str, initial, index+1); subString(str, initial + str[index], index+1); } int main() { string ...
#pragma once #include <iberbar/Renderer/Effect.h> #include <DirectXMath.h> namespace iberbar { namespace Renderer { class __iberbarRendererApi__ CEffectMatrices : public CEffectBase { protected: struct _Data { DirectX::XMFLOAT4X4 ViewMatrix; DirectX::XMFLOAT4X4 ProjectionMatrix; DirectX::...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> /// The XBee data type(s) #include "xbee.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private: // The coordinator XBee ...
#include "EquidistantModel.h" Cvl::EquidistantModel::EquidistantModel(double focalLengthX, double focalLengthY, double principalPointX, double principalPointY) : ProjectionModel(focalLengthX, focalLengthY, principalPointX, principalPointY) { } Cvl::ProjectionModel::Uptr Cvl::EquidistantModel::clone() const { return ...
#include<iostream> #include<vector> #include<algorithm> #include<unordered_map> #include<unordered_set> using namespace std; class Solution { public: bool containsNearbyDuplicate(vector<int>& nums, int k) { //基本思想:HashMap,map保存nums中元素对应下标位置的映射 //遍历nums所有元素,对于当前元素nums[i],如果存在于HashMap,计算当前下标i与HashMap[nums[i]]的距离 /...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef WINGOGI_SHARED_MEMORY_MUTEX_H #define WINGOGI_SHARED_MEMORY_M...
/* Copyright 2023 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...
#include "pch.h" #include "OrderWriter.h" using namespace std; using namespace concurrency; OrderWriter::OrderWriter(ISource<OrderMsg>& order_channel, const string& filepath) : order_channel_(order_channel), filepath_(filepath) { double cash = 10000; Asset asset(cash); // TODO Load asset from a file or s...
#pragma once #ifndef Software_Student_H #define Software_Student_H #include "student.h" class SoftwareStudent : public Student { public: SoftwareStudent(string, string, string, string, int, int, int, int, Degree); Degree GetDegreeProgram(); void Print(); private: Degree degreeType; }; #endif
#ifndef LABPROG_BUTTON_H #define LABPROG_BUTTON_H #include <SFML/Graphics.hpp> #include <SFML/Window.hpp> #include <SFML/System.hpp> #include <ctime> #include <cstdlib> #include <iostream> #include <sstream> enum button_states { BTN_IDLE = 0, BTN_HOVER, BTN_ACTIVE }; class Button { public: Button(float ...
// // generators.cpp // Total Control // // Created by Parker Lawrence on 1/16/16. // Copyright (c) 2016 Parker Lawrence. All rights reserved. // #include "generators.h" void Generator::firstdump() { Structure mainland; mainland.bounded = false; mainland.structureid = "mainland"; mainland.transfo...
#pragma once #include "Person.h" #include <iostream> using namespace std; class Employee : public Person { public: Employee(); Employee(string, double); ~Employee(); virtual void printName() const; protected: double salary; };
/** * @author Umaralikhon Kayumov * @version 3.5 */ #include "Header.h" void menu(); void innerMenu(); int main() { srand(time(NULL)); setlocale(0, ""); int choice; int elem; int nextStep; ProgresssionSet user; cout << "Выберите действие: " << endl; menu(); cin >> choice; while (choice != 0) { cout <...
#include<iostream> #include<stdio.h> using namespace std; int main(){ int npinit, rodadas; int npart, ordem, depois, acao; int cont, cont2, cont3, cont1 = 0; int gamers[100] = {}; cin >> npinit >> rodadas; while ( npinit != 0 && rodadas != 0 ){ for ( cont = 0; cont <= npinit; cont++ ){ cin >> gamers[cont...
#pragma once #include "Enums.h" #include "Animation.h" /* GameObjectData is responsible for defining the interface with which any class is going to communicate with when trying to access that GameObjects Data */ class GameObjectData { public: typedef Vector2i SpriteSheedIndex; GameObjectData() = default; virtu...
class T72_INS; class T72_RUST: T72_INS { displayName = "$STR_VEH_NAME_T72_RUST"; hiddenSelectionsTextures[] = {"\dayz_epoch_c\skins\t72\T72_1_wrecked_co.paa","\dayz_epoch_c\skins\t72\T72_2_wrecked_co.paa","\dayz_epoch_c\skins\t72\T72_3_wrecked_co.paa"}; }; class T72_WINTER: T72_INS { displayName = "$STR_VEH_NAME_T7...
#include <iostream> #include<fstream> #include<stdlib.h> #include <iomanip> #include<time.h> #include<math.h> #define MAXLARGO 21 #define TOTALNUM 100 //Total de numeros que genera using namespace std; int main() { int i, x; float prom, sum = 0; double sum2 = 0, des; char nombrearchivo[MAXLARG...
// // Created by kamlesh on 30/10/15. // #ifndef UV_MULTI_WORKER_THREADS_H #define UV_MULTI_WORKER_THREADS_H #include <uv.h> class worker { private: public: worker(); void on_write(uv_write_t *req, int status); void on_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf); void on_conne...
#pragma once #ifndef Game_hpp #define Game_hpp #include <SDL2/SDL.h> #include <stdio.h> #include <SDL2/SDL_image.h> #include "Texture.hpp" #include <fstream> #include <string> #include <stdio.h> #include <iostream> using namespace std; #include "Audio.hpp" class Game { public: Game(); ~Game(); bool initial...
#include<bits/stdc++.h> using namespace std; int main() { // only gravity will pull me down // Find first set bit int t, n; cin >> t; while (t--) { cin >> n; int pos=1; if(!n) { cout << 0 << endl; continue; } while(!(n&1)) { ...
#include <iberbar/RHI/D3D11/Device.h> extern "C" __iberbarD3DApi__ iberbar::RHI::IDevice * iberbarRhiDeviceCreate() { return new iberbar::RHI::D3D11::CDevice(); }
#include<bits/stdc++.h> #define rep(i,n) for (int i =0; i <(n); i++) using namespace std; using ll = long long; const double PI = 3.14159265358979323846; int main(){ string S; cin >> S; int N = (int)S.size(); bool I = false; bool C = false; bool T = false; rep(i,N){ ...
#include "BoardPiece.h" #include <string> using namespace std; BoardPiece::BoardPiece() { } string BoardPiece::print() const { return "XX"; }
#include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <queue> #include <unordered_set> #include <unordered_map> #include <stack> #include <cstdio> #define INT_MIN (1<<31) #define INT_MAX (~INT_MIN) #define UNREACHABLE (INT_MAX>>2) #define INF (1e300) #define eps (1e-9) using namespace s...
#include <stdio.h> #include <math.h> int main() { int numero = 2; float raiz; printf("Quadrados perfeitos entre 1 e 40: "); while (numero <= 40) { raiz = (sqrt(numero)); if (raiz == int(raiz)) { printf("\n%d", numero); } numero++; } }
#include <iostream> #include <cassert> #include <string> #include <locale> #include <stdio.h> using namespace std; struct Say { Say operator()(string word) { return {new_word + (new_word==""?"":" ") + word}; } string operator()() { return new_word; } string new_word; } say; int main() { assert(say(...
#include "Terrain.h" void Terrain::ConfigureGlobals() { Terrain::m_terrainGlobals = new Ogre::TerrainGlobalOptions(); } void Terrain::ConfigureGroup() { m_terrainGroup = new Ogre::TerrainGroup(OgreFramework::getSingletonPtr()->m_pSceneMgr, Ogre::Terrain::ALIGN_X_Z, 513, 12000.0f); m_terrainGroup->setFilenameCon...
// Created on: 1993-11-17 // Created by: Isabelle GRIGNON // Copyright (c) 1993-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 G...
// O(N^2) two pointers skip duplicates class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { vector<vector<int>> triplets; int n = nums.size(); if (n < 3) return triplets; sort(nums.begin(), nums.end()); for (int i = 0; i < n - 2;) { int num =...
#include<bits/stdc++.h> using namespace std; #define maxn 10005 typedef struct node{ int index; int cnt; }node; bool cmp(node a,node b){ if(a.cnt>b.cnt) return true; else if(a.cnt==b.cnt){ if(a.index<b.index) return true; } return false; } int n,m; vector<int> g[ma...
#pragma once #include <vector> #include "bsp_layout.hpp" #include "grid.hpp" #include "math.hpp" #include "random.hpp" #include "generate.hpp" #include "direction.hpp" namespace yama { namespace detail { class bsp_layout_impl { public: using params_t = bsp_layout::params_t; struct node { using ind...
#include <math.h> #include "Eigen/Dense" #include <random> #include <stdio.h> #include <iostream> #include <stdlib.h> using namespace Eigen; class lin_reg{ private: void linsolv(MatrixXd a, int n, VectorXd y); public: MatrixXd THETA; bool bias = 1; lin_reg(){ } void learn(MatrixXd x, MatrixXd y, bool nor...
/** * 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 ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @author Patricia Aas (psmaas) */ #ifndef __FILEHANDLER_MANAGER_H__ #define __FILEHA...
/* * Copyright (c) 2018-2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_DETAIL_NTH_ELEMENT_H_ #define CPPSORT_DETAIL_NTH_ELEMENT_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <iterator> #include <utilit...
#include <iostream> #include <vector> #include <cmath> using namespace std; bool isprime(int n) { if(n <= 1) return false; int sqr = int(sqrt(n * 1.0)); for(int i = 2; i <= sqr; i++) { if(n % i == 0) return false; } return true; } int rev(int n, int d){ vector<int> x; int out =...
// OpenVDB_Softimage // VDB_Node_Write.h // ICE node to write grids to disk #ifndef VDB_NODE_WRITE_H #define VDB_NODE_WRITE_H #include <xsi_pluginregistrar.h> #include <xsi_status.h> #include <xsi_icenodecontext.h> #include <openvdb/openvdb.h> class VDB_Node_Write { public: VDB_Node_Write(); ...
//Declaración de constantes const int boton = 2; //Da el nombre “boton” al pin 2 const int led = 12; bool estadoDeLed = 0; void setup() { //Inicializa la comunicación serial a 9600 bits por segundo Serial.begin(9600); pinMode(boton, INPUT_PULLUP); //Configura el pin "boton" como entrada digital } void loop() { ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; const int pow2[18] = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,6...
#include <Tanker/Opener.hpp> #include <Tanker/BlockGenerator.hpp> #include <Tanker/Client.hpp> #include <Tanker/Crypto/Crypto.hpp> #include <Tanker/Crypto/Format/Format.hpp> #include <Tanker/Errors/AssertionError.hpp> #include <Tanker/Errors/Errc.hpp> #include <Tanker/Errors/Exception.hpp> #include <Tanker/Errors/Serv...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}} #define show(x) {for(auto i: x){cout << i << " ";} cout...
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. #include "SoundBoarding.h" IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, SoundBoarding, "SoundBoarding" );
#pragma once #include "Grid.hpp" #include <BWAPI.h> #include <map> #include <vector> #include "BaseManager.h" class InformationManager { InformationManager(); void parseUnitsInfo(); std::map<BWAPI::UnitType, int> m_unitCountMap; std::map<BWAPI::UnitType, std::vector<int>> ...
#include <nan.h> #include "display_device_manager.h" using v8::Object; using v8::String; using Nan::GetFunction; using Nan::New; using Nan::Set; NAN_METHOD(DisplayWakeupRequest) { int ret = DisplayDeviceManager::getDisplayManager()->SetDisplayState(true); info.GetReturnValue().Set(ret); } NAN_METHOD(DisplaySleepReq...
#ifndef QUEEN_H_INCLUDED #define QUEEN_H_INCLUDED #include "BasePiece.h" #include "Rook.h" #include "Bishop.h" class Queen: public virtual BasePiece , public Bishop, public Rook { public: Queen(Color color, Position pos); ~Queen(); bool validateMove(Position moveToPosition, BasePiece* &piece...
int Solution::isPalindrome(int A) { if (A < 0) return 0; long long int orignalA = A; long long int res = 0; while (A) { res *= 10; res += A % 10; A /= 10; } if (res == orignalA) return 1; return 0; }
#include <maya/MGlobal.h> #include <maya/MPxCommand.h> #include <maya/MArgList.h> #include <maya/MSyntax.h> #include <maya/MFn.h> #include <maya/MFnPlugin.h> #include <maya/MPoint.h> #include <maya/MSelectionList.h> #include <maya/MDagPath.h> #include <maya/MItSelectionList.h> #include <maya/MObject.h> #include <maya/M...
#pragma once #include <list> #include <mutex> #include <algorithm> #include <iostream> class Protected_List { public: void add_to_list(); bool list_contains(int value_to_find); void print(); private: std::list<int> some_list; std::mutex some_mutex; }; void Protected_List::add_to_list() { std::lock_guard<std::...
#ifndef VARIANT3_H #define VARIANT3_H #include <demonstrationclass.h> class variant3 { public: variant3(Ui::MainWindow* _ui,DemonstrationClass *_parent); void on_task_button_clicked(); private: }; #endif // VARIANT3_H
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2012 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Kajetan Switalski ** */ #ifndef _SPDY_DATACONSUMER_H_ #define ...
/* tplane.cpp Colin Fitt -- cfitt -- C6312039 Course CpSci 1020, Prof. Catherine Hochrine Major Programming Assignment #3: Due 11:59pm Sunday, April 20th To be honest I got this completely on accident. I was getting crazy ppms and it was not working at all, and then one day I returned to it and it started to work. I'...
// Created on: 1995-02-01 // Created by: Marie Jose MARTZ // Copyright (c) 1995-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 G...
#include "threadfactory.h" ThreadFactory::ThreadFactory() { } void ThreadFactory::startThreads() { QMap<QObject*, QThread*> *map = IThread::getMap(); } void ThreadFactory::stopAndDeleteThreads() { }
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #ifndef ES_BOOLEAN_BUILTINS_H #define ES_BOOLEAN_BUILTINS_H class ES_BooleanBuiltins { public: static BOOL ES_CALLING_CONVENTION constructor_call(ES_Execution_Context *context, unsigned argc, ES_Value_Inter...
#include "GameObject.h" #include "UIElement.h" GameObject::GameObject(int UnitTypeID, GameEngine* Engine, Player* PlayerID) { engine = Engine; } GameObject::GameObject() { } void GameObject::setPosition(double x, double y) { posX = x; posY = y; icon.setPosition(x,y); if (healthBars.size()...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @file * @author Owner: Karianne Ekern (karie) * ...
/* * @lc app=leetcode.cn id=234 lang=cpp * * [234] 回文链表 */ // @lc code=start /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* left; bool isPalindrome(ListNode* he...
#ifndef TreeSetting_h #define TreeSetting_h #include <iostream> #include "TTree.h" #include "TFile.h" #include "TBranch.h" #include "TROOT.h" #include "TClonesArray.h" #include "TChain.h" using namespace std; const int maxBranchSize = 1000; // import the tree to the RooDataSet UInt_t runNb; UInt_t ...
class Solution { private: int dir[4][2]{{-1, 0}, {1, 0}, {0, 1}, {0, -1}}; bool exist(int pos, int i, int j, vector<vector<char>>& board, string& word) { if(pos == word.length()) return true; char c = board[i][j]; // mark as visited. board[i][j] = ' '; bool re...
#include <iostream> int main(){ freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int a, k; std::cin >> a; k = 2; for(int i = 2; i < a+1; ++i) k += i; std::cout << k; }
// // Created by 송지원 on 2020/06/27. // //바킹독님 6강 큐 boj10845 직접 구현한 큐를 이용하는 버젼 #include <iostream> using namespace std; const int MAX = 10005; //여기서 그냥 "int MAX = ~" 이렇게 하면 아래 "int dat[MAX];" 구문에서 에러남 int dat[MAX]; int head = 0, tail = 0; int N; string s; int t; int main() { ios::sync_with_stdio(0); cin.tie...
std::ostream& operator << (std::ostream& out, VkLayerProperties& layer) { out << layer.layerName << " " << layer.specVersion << " " << layer.implementationVersion << " " << layer.description << std::endl; return out; } std::ostream& operator << (std::ostream& out, VkPhysicalDevice& dev...
#include<vector> using std::vector; #include<iostream> #include<algorithm> #include<memory> using std::shared_ptr; #include<string> using std::string; #include<stack> using std::stack; #include<queue> using std::priority_queue; /* Given an array of integers sorted in ascending order, find the starting and ending positi...
#include "stdafx.h" #include "Win32App.h" HWND Win32App::_hWnd = nullptr; RECT Win32App::_rect = {0}; int Win32App::Width = 1270; int Win32App::Height = 720; int Win32App::_screenWidth = GetSystemMetrics(SM_CXSCREEN); int Win32App::_screenHeight = GetSystemMetrics(SM_CYSCREEN); shared_ptr<Renderer> Win32App::_renderer...
#pragma once #include "ray.h" #include "color.h" #include <float.h> #include <string> class Object; //------------------------------------------------------------------------------ /** */ struct HitResult { // hit point vec3 p; // normal vec3 normal; // hit object, or nullptr Object* object = ...
#ifndef PLAYER_HPP #define PLAYER_HPP class Player { public: Player(); }; #endif // PLAYER_HPP
#include "Matching.h" #include "Blending.h" int main(int argc, char* argv[]){ // Get input images addresses if(argc < 3){ cout << "Not enough parameters!" << endl; return -1; } // SIFT steps CImg<float> src1, src2; src1.load_bmp(argv[1]); src2.load_bmp(argv[2]); cout << "Begin SIFT" << endl; SIFT sifter1(...
#include <QHostAddress> #include "ShoeManagerTcpServer.hpp" #include "ShoeManagerTcpServerPrivate.hpp" ShoeManagerTcpServer::ShoeManagerTcpServer(QObject *parent) : QObject(parent) { d_ptr = new ShoeManagerTcpServerPrivate(this); } ShoeManagerTcpServer::~ShoeManagerTcpServer() { delete d_ptr;...
#ifndef DATABASE_H #define DATABASE_H #pragma once #include "coin.h" #include <QSqlDatabase> #include <QSqlQuery> #include <QtDebug> #include <QSqlError> #include <QSqlRecord> class DbManager { public: // Constructor DbManager(const QString& path); // Deconstructor ~DbManager(...
/** ****************************************************************************** * Copyright (c) 2019 - ~, SCUT-RobotLab Development Team * @file mpu6050_config.cpp * @author YDX 2244907035@qq.com * @brief Code for MPU6050 config. * @date 2020-04-02 * @version 1.1 * @par Change Log: ...
#ifndef __CUBEENVTEAPOT_H__ #define __CUBEENVTEAPOT_H__ class CubeEnvTeapot { D3DXVECTOR3 m_vPos; D3DXVECTOR3 m_vRot; D3DXVECTOR3 m_vScale; D3DXMATRIX m_mTM; D3DXMATRIX m_mScale, m_mRot, m_mTrans; D3DMATERIAL9 m_Mtrl; LPD3DXMESH m_pTeapot; LPDIRECT3DCUBETEXTURE9 m_pCubeTexture; public: ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Manuela Hutter (manuelah) */ #ifndef FAKE_FEATURE_SETT...
/* * Copyright 2016 Robert Bond * * 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 ...
#include <iostream> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ struct node { int value; node *next; }; node *head = NULL; node *insert(int n) { if(head == NULL) { node *temp = new node; temp -> value = n; temp->next = NULL; ...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // Copyright (C) Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. #ifndef WEBFEED_LOADING_FEED_H_ #define WEBFEED_LOADING_FEED_H_ #include "m...
#include "approx_functions.h" // Xsection scalar approx_X22(std::vector<double> params){ double sqrts = params[0]; double T = params[1]; return scalar{1.0/T/T}; } scalar approx_X22QQbar(std::vector<double> params){ double lnsqrts = params[0]; double s = std::exp(2*lnsqrts); return scalar{std::log(1+s/6.7...
#include <Rcpp.h> #include <RcppParallel.h> using namespace RcppParallel; // [[Rcpp::depends(RcppParallel)]] /** * ### Background * * * */ /** * ### The function object * * We'll use a [function object](https://www.cprogramming.com/tutorial/functors-function-objects-in-c++.html) (sometimes called a fu...
#pragma once #include <string> #include <map> #include <memory> #include <experimental/filesystem> #include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> #include "ApplicationException.h" #include "Output.h" #include "Tools.h" namespace FW { class ResourceManager { public: ResourceManager( ...
#ifndef TENSOR_H #define TENSOR_H #include <map> #include <functional> #include "Array/Array.h" typedef std::function<Array(const Array&)> grad_fn; typedef std::map<const Array*, grad_fn> dependency; class Tensor { private: int m_row; int m_col; Array m_data; bool m_required_grad; Array m_...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * 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 wit...
#pragma once #include "stdafx.h" #include "TestBase.h" class Station; class Ai4wwTests : public TestBase { public: Ai4wwTests(); virtual ~Ai4wwTests(); virtual bool Setup(); virtual void Teardown(); virtual bool RunAllTests(); bool TestLocation(); bool TestInState(); bool TestCallsign()...
#include<bits/stdc++.h> using namespace std; #define PI 3.1415926535897932 int main(){ char fox[]="The quick brown fox jumps over the lazy dog."; int n = strlen(fox); for (int i=0;i<n;++i) { if ('o' == fox[i]) { printf("find 'o'!!! fox[%d]\n",i); } } return 0; }
/* The integer 36 has a peculiar property: it is a perfect square, and is also the sum of the integers from 1 through 8. The next such number is 1225 which is 352, and the sum of the integers from 1 through 49. Find the next number (or numbers) that is a perfect square and also the sum of a series 1...n. This next numb...
/**************************************************************************** ** Copyright (C) 2017 Olaf Japp ** ** This file is part of FlatSiteBuilder. ** ** FlatSiteBuilder 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 S...
#include "sort.h" void sort::insertion_sort(vector<int> &data) { for (int j = 1; j < data.size(); ++j) { int temp = data[j], i = j-1; while( i>=0 && data[i]> temp ) { data[i + 1] = data[i]; --i; } data[i + 1] = temp; } } void sort::merge(vector<int> &data, int beg, int mid, int end)...
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #pragma once #include "Core/Path.hpp" #include "Core/Settings.hpp" #include "Serialization/Serializer.hpp" #include <ostream> name...
#pragma once #include "GDISetup.h" #include <Interfaces.h> #include <wil\win32_helpers.h> class VSwapChain : public wrl::RuntimeClass<wrl::RuntimeClassFlags<wrl::ClassicCom>, IVSwapChain> { class VFrame { using unique_gdi = wil::unique_any<Gdiplus::GpGraphics*, decltype(&Gdiplus::DllExports::GdipDeleteGraphics), ...
//Database.cpp #include<iostream> #include<stdexcept> #include"Database.h" using namespace std; Database::Database() { mNextSlot=0; mNextEmployeeNumber=kFirstEmployeeNumber; } Database::~Database() { //Noting need to do. } Employee& Database::addEmployee(string inFirstName,string inLastName) { if(mNextSlot>=k...
// // Game.hpp // GAME2 // // Created by ruby on 2017. 11. 11.. // Copyright © 2017년 ruby. All rights reserved. // #ifndef Game_hpp #define Game_hpp #include <iostream> using namespace std; class Boat; class Torpedo; class BoatAList; class BoatBList; class BoatCList; class Game { private: enum SCORE { TURN=50...
// Build and return the stencil (look in the stencil directory) for a U(1) operator. // Depends on the lattice class and the staggered_u1_op struct. #include <complex> using std::complex; #include "operators.h" #include "lattice.h" #include "coarse_stencil.h" #include "operators_stencil.h" // Given an allocated but...