text
stringlengths
8
6.88M
#pragma once #include "GameObject.h" class Particle: public GameObject { public: int r; int g; int b; int a; int deathtime; Particle(int width, int height, Physics physics, SDL_Texture* texture, int r, int g, int b, int a, int deathtime); Particle(GameObject go, int r, int g, int b, int a, int dea...
// Lexer for Python. #include <string.h> #include <assert.h> #include <ctype.h> #include <algorithm> #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "Le...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-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 Manuela Hutter (manuelah) */ #include "core/pch.h" #i...
#pragma once #include "entity/entity.h" #include "component/component.h" namespace component { struct PosComponentDesc : public ComponentDesc { D3DXVECTOR3 position; D3DXVECTOR3 rotation; D3DXVECTOR3 scale; string parentName; PosComponentDesc() : position(0.0, 0.0, 0.0), rotation(0.0, 0.0...
#include <iostream> #include <cmath> #include <emscripten.h> #include <emscripten/bind.h> #include <emscripten/val.h> #include "vendor/entt/entt.hpp" #include "main.h" #include "scene/Scene.cpp" EMSCRIPTEN_KEEPALIVE int add(int a, int b) { return a + b; } EMSCRIPTEN_KEEPALIVE int sub(int a, int b) { return a -...
#pragma once #include <string> #include <algorithm> using namespace std; string longestPalindrome_violence(string s) { int maxlen = 0; string maxstr; int len = s.size(); for (int i = 0; i < len; ++i) { for (int j = i; j < len; ++j) { bool is_palindrome = true; int sub_len = j - i + 1; for (int k = 0; k ...
#include <iostream> #include<string> #include<stdio.h> #include<vector> #include<conio.h> using namespace std; class Ngay { private: int ngay,thang,nam; public: void Input_ngay(); void out_ngay(); }; void Ngay::Input_ngay() { do { cout<"\n Nhap Ngay:"; cin>>ngay; if(ngay<0||n...
#ifndef _MSG_0X07_USEENTITY_CTS_H_ #define _MSG_0X07_USEENTITY_CTS_H_ #include "mcprotocol_base.h" namespace MC { namespace Protocol { namespace Msg { class UseEntity : public BaseMessage { public: UseEntity(); UseEntity(int32_t _user, int32_t _target, bool _button); size_t serialize(Buffer& _dst, size_t _offset...
// Created on: 2001-12-20 // Created by: Pavel TELKOV // Copyright (c) 2001-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 as ...
#include<stdio.h> int a,b,max=0; main() { scanf("%d",&a); while(a!=0) { b=a%10; a=a/10; if(b>max) { max=b; } } printf("%d",max); }
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> typed...
 // DBServerDlg.cpp: 구현 파일 // #include "pch.h" #include "framework.h" #include "DBServer.h" #include "DBServerDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // 응용 프로그램 정보에 사용되는 CAboutDlg 대화 상자입니다. class CAboutDlg : public CDialogEx { public: CAboutDlg(); // 대화 상자 데이터입니다. #ifdef AFX_D...
#pragma once class GameCursor; class Fade; class ReturnButton; class DungeonSelect : public GameObject { public: bool Start() override; void Update() override; void OnDestroy() override; private: void CheckDungeonClearState(); void InitDungeonButtons(); void InitSideButtons(); void InitBackButton(); void Pos...
#include "color.h" Color::Color() { } Color::Color(int _r, int _g, int _b, int _a) { r = _r; g = _g; b = _b; a = _a; } Color::Color(glm::vec4 color) { r = color.r; g = color.g; b = color.b; a = color.a; } Color::~Color(){ }
#include<iostream> #include<cstdlib> using namespace std; typedef struct node* ref; struct node{ int key; ref next; }; ref get(int k){ ref p; p=new node; if(p==NULL) exit(0); p->key=k; p->next=NULL; return p; } void addlast(ref &head, ref &tail, int k){ ref p=get(k); if(head==...
/** * @file adaptor.cpp * @brief * @author kevin20x2@gmail.com * @version 1.0 * @date 2018-12-17 */ #include "adaptor.hpp" #include "fs/inode.hpp" namespace kvfs{ using namespace rocksdb; const std::string RocksDBAdaptor ::default_DBpath = "/tmp/rocksdb"; RocksDBAdaptor :: RocksDBAdaptor(): inited_(false...
// Created on: 2002-01-16 // Created by: Michael PONIKAROV // Copyright (c) 2002-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....
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2000 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" #include "modules/logdoc/src/doc_tree.h" ...
#ifndef VID_H #define VID_H #include <vector> using namespace std; vector<unsigned char> EncryptVidg(vector<unsigned char> data,vector<unsigned char> key); vector<unsigned char> DecryptVidg(vector<unsigned char> data,vector<unsigned char> key); #endif // VID_H
#ifndef _config_h #define _config_h #include <string> #include <cstdarg> #include <vector> #include <sstream> #include <limits> #include <cstring> #include <sys/stat.h> #include <opencv2/core/core.hpp> #include <opencv2/objdetect/objdetect.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/im...
#include "model/TokenID.h" using namespace BeeeOn; TokenID::TokenID() { }
#include<bits/stdc++.h> using namespace std; int main() { int n; long long l, p; cin>>l>>n; p=l*n; cout<<p<<"\n"; return 0; }
#include <bits/stdc++.h> using namespace std; void print(int n) { if (n == 0) return; print(n-1); cout << n << " "; } int main() { // only gravity will pull me down // Print 1 to n without using loops int t, n; cin >> t; while(t--) { cin >> n; print(n); cout << endl; } ...
/* The ESP32 has four SPi buses, however as of right now only two of * them are available to use, HSPI and VSPI. Simply using the SPI API * as illustrated in Arduino examples will use VSPI, leaving HSPI unused. * * However if we simply intialise two instance of the SPI class for both * of these buses both can ...
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno. // WARNING: Changes might be lost if you edit this file directly. #include <_root.app18_accessor_List_Items.h> #include <_root.List.h> #include <Uno.Bool.h> #include <Uno.Object.h> #include <Uno.String.h> #include <Uno.Type....
/* ** EPITECH PROJECT, 2021 ** B-CPP-300-STG-3-1-CPPrush3-maxime.owaller ** File description: ** TitleSection */ #include "TitleSection.hpp" TitleSection::TitleSection(std::string const& title, sf::Color color, sf::Vector2f position) noexcept { _title = new Text{title, color, {100, 100}, 14}; _title->setP...
#include <iostream> #include <fstream> #include <string> #include <cstring> #include <sstream> #include <vector> #include <arpa/inet.h> #include <netinet/in.h> #include <unistd.h> #include <dirent.h> #include <map> #include <getopt.h> //#include <bits/regex.h> #include <regex> #include <sys/stat.h> using namespace std...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 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" #include "modules/widgets/OpEdit.h" #includ...
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다. // GnDirectx9Renderer.pch는 미리 컴파일된 헤더가 됩니다. // stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다. #include "GnDirectx9RendererPCH.h" GNDIRECTX9RENDERER_ENTRY void LinkError_GnDirectx9RendererFunc() { return; }
//https://www.spoj.com/problems/DEFKIN/ //Defkin SPOJ #include<iostream> #include<bits/stdc++.h> #include<algorithm> using namespace std; #define ll long long ll x[1000000]; ll y[1000000]; int main() { ll t; cin>>t; while(t--) { ll w,h; cin>>w>>h; ll n; cin>>n; for(ll i=0;i<n;i++) { cin>>x[i]>>y[i];...
#include<iostream> #include<vector> using std::vector; using std::cin; using std::cout; using std::endl; int main() { vector<int> v; int i; while(cin >> i) v.push_back(i); auto size = v.size(); size = size % 2 == 0 ? size/2 : (size / 2 + 1); for(decltype(v.size()) index = 0; index < s...
#include <fstream> #include <iostream> #include "sodium.h" #include "cryptobox/core/HSM.hpp" #include "cryptobox/core/Storage.hpp" namespace cryptobox { HSM::HSM(std::string const& storagePath) : storagePath_{storagePath} { // bring up the key store entries_ = std::move(io::retrieve(storagePath_)); } ...
#include <omtalk/Om/ObjectModel.h>
#include "Enemy.h" #include <string> #include <random> #include <ctime> using namespace std; void Enemy::_regenerateDefence(int defence) { // The defence of the Enemy decreases by 20% after each reset. Otherwise there is no way to kill the Don. _defence = (int)(defence - ((20 / 100)*defence)); } Enemy::Enemy(strin...
#include "SuperMutant.hpp" SuperMutant::SuperMutant(void) : Enemy(170, "Super Mutant"){ std::cout << "Gaaah. Me want smash heads !"<< std::endl; return; } SuperMutant::~SuperMutant(){ std::cout << "Aaargh ..."<< std::endl; return; } SuperMutant::SuperMutant(SuperMutant const & src) : Enemy(src){ // ...
#include <iostream> #include <sstream> #include <cstdlib> #include <cstdio> #include <vector> #include <queue> #include <deque> #include <stack> #include <list> #include <map> #include <iomanip> #include <set> #include <climits> #include <ctime> #include <complex> #include <cmath> #include <string> #in...
#ifndef INCLUDED_MATH_MATH_H #define INCLUDED_MATH_MATH_H namespace Math { class Vector3; } namespace Math{ //円周率 static const float pi = 3.14159265358979323846f; //角度の単位変換に使う static const float to_deg = 180.f / pi; static const float to_rad = pi / 180.f; //ラジアンから度に直す float To_Deg(float rad); //度からラジアンに直す ...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10340" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif string subs...
/**************************************************************************** ** Copyright (c) 2006 - 2011, the LibQxt project. ** See the Qxt AUTHORS file for a list of authors and copyright holders. ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modificatio...
#include <sys/stat.h> #include <signal.h> #include "Version.h" #include "IniFile.h" #include "Configure.h" #include "Logger.h" #ifndef WIN32 #include <sys/time.h> #include <sys/resource.h> #include <unistd.h> #include <getopt.h> #endif void daemonize() { #ifndef WIN32 pid_t pid, sid; /* already a daemon */ if ...
#include <iostream> template<typename T> bool Copy_equality(T x) { T{x} == x; } template<typename T> bool Copy_assing_equality(T x, T &y) { return (y = x, y == x); } template<typename T> bool Move_assign_effect(T x, T &y, T &z) { return (y == z ? (x == std::move(y), x == z): true) and can_destroy(y); } ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 1995 - 2011 * * EcmaScript_Manager -- API for access to the ECMAScript engine * Lars T Hansen */ #include "core/pch.h" #include "modules/ecmascript/ecmascript.h" #include...
/* 46450368 - 48579580 */ // Nicolás Saliba - Gonzalo Nicolari. // Instituto de Computación - Facultad de Ingeniería, Laboratorio de Programación 2. #include "../include/binario.h" #include "../include/cadena.h" #include "../include/uso_cadena.h" #include "../include/info.h" #include <assert.h> #include <...
// // Created by 邦邦 on 2022/4/22. // #ifndef BB_POOL_H #define BB_POOL_H #include <vector> #include <list> #include <mutex> #include <future> #include <thread> #include <functional> #include "pool_wait.h" namespace bb{ class pool{ struct task_list{ task_list():lock(mutex,std::defer_lock){} ...
// config.h #pragma once #include <filesystem> #include <map> #include <string> namespace leap { namespace system { struct Config { void parse(const std::filesystem::path&); const std::string& get_str(const std::string& key, const std::string& default_value) const; float get_float(const std::string& key, floa...
/* * **************************************************************************** * * * * * Copyright 2008, xWorkshop Inc. * * * All rights reserved. * *...
// // Created by heyhey on 20/03/2018. // #ifndef PLDCOMP_EXPRESSIONUNAIRE_H #define PLDCOMP_EXPRESSIONUNAIRE_H #include <ostream> #include "Expression.h" class ExpressionUnaire : public Expression { public: enum Operateur {VAGUE, PARENTHESE, EXCLAMATION}; ExpressionUnaire(); virtual ~ExpressionUnaire...
#include <stdio.h> #include <memory.h> #include <pigpio.h> #include "rfHandlerV2.h" #include "coding/OokDecoder.h" #include "coding/KakuDecoder.h" #include "coding/NewKakuDecoder.h" #include "coding/OregonDecoder.h" #include "coding/AlectoDecoder.h" #include "Logger.h" #define MAX_STACK_ELEM 10 typedef struct { ...
class desert_large_net_kit { weight = 50; }; class forest_large_net_kit { weight = 50; }; class desert_net_kit { weight = 25; }; class forest_net_kit { weight = 25; }; class winter_net_kit { weight = 25; }; class winter_large_net_kit { weight = 50; };
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2011 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" #include "platforms/windows/pi/util/Win...
#ifndef PPJ_AST_H #define PPJ_AST_H #include <cstdlib> #include <iostream> #include <vector> #include <set> #include <map> using namespace std; #include "symtable.h" #include "function.h" struct ASTree { int line; string token; string source; ASTree *dad; vector<ASTree*> adj; int type; Function *fun...
#include "medicalajout.h" #include "ui_medicalajout.h" #include "stock.h" medicalajout::medicalajout(QWidget *parent) : QDialog(parent), ui(new Ui::medicalajout) { ui->setupUi(this); ui->IDML->setVisible(false);ui->IDM->setVisible(false); ui->delaiduDE->setVisible(false);ui->delaiduL->setVisible(fa...
#pragma once #include <glad/glad.h> #include <glm/vec3.hpp> #include <vector> namespace LaiEngine { struct sVertex { glm::vec3 Position; glm::vec3 Color; }; class Mesh { public: virtual ~Mesh() {}; std::vector<sVertex> vertices; std::vector<GLuint> indices; }; class Cube : public Mesh { pub...
#include "directionwidget.h" #include "ui_directionwidget.h" DirectionWidget::DirectionWidget(QWidget *parent) : QWidget(parent), ui(new Ui::DirectionWidget) { ui->setupUi(this); iofile->readFromFile(); nameList = iofile->getNameList(); setSourceList(); setDestinationList(); QPalette *...
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<(n);i++) #define for1(i,n) for(int i=1;i<=n;i++) #define FOR(i,a,b) for(int i=(a);i<=(b);i++) #define FORD(i,a,b) for(int i=(a);i>=(b);i--) const int INF = 1<<29; const int MOD=1073741824; #define pp pair<ll,ll> typedef long long int ll; bool...
#include <iostream> #include "conio.h" using namespace std; /*Se ingresa un entero por teclado. Se desea determinar si el número ingresado es primo o no. Utilice bucles "while". */ int main() { int entero, x=2; bool N= true; cout<<"Introduzca el entero: ";cin>>entero; while (N && x < entero){ ...
/**************************************************************** File Name: phase2.C Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995 Copyright(c) 1995 by Tian Zhang All Rights Reserved Permission to use, copy and modify this software must be granted by the author a...
#include "datacollectionthread.h" #include "some_fun.h" #include <QDateTime> #include <QDebug> #include <QDir> DataCollectionThread::DataCollectionThread(QObject *parent) : m_pSerialPort(nullptr), m_pFileLog(nullptr) { this->moveToThread(this); } DataCollectionThread::~DataCollectionThread() { re...
// Copyright (c) 2012-2017 The Cryptonote developers // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "TransactionValidation.h" #include "TestGenerator.h" #in...
//Ordinary function #include <algorithm> #include <ctime> #include <cstdlib> #include <vector> #include <iostream> using namespace std; /*int randGen_1() { return rand() % 10 + 1; }*/ class myFunctor { // function: public: myFunctor() : num(1) {} void operator() (int i) { cout << "#" << num++ << ": " << i <<...
int motor_one1=9; int motor_one2=10; int motor_two1=5; int motor_two2=3; void setup() { // put your setup code here, to run once: pinMode(6,INPUT); pinMode(9,OUTPUT); pinMode(10,OUTPUT); pinMode(11,INPUT); pinMode(5,OUTPUT); pinMode(3,OUTPUT); } void loop() { // put your main code here, to run repeatedly: int...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef SIMPLEWEBSERVERMANAGERIMPL_H #define SIMPLEWEBSERVERMANAG...
#ifndef BSMAI_CLIENT #define BSMAI_CLIENT #include <iostream> #include <sstream> #include <fstream> #include <curl/curl.h> #include "json.hpp" class PhenoAIClient{ private: std::string _server_ip; int _server_port; CURL* _curl; public: // Constructor PhenoAIClient(std::string ip, int port){ // Store server se...
#include<iostream> #include<algorithm> #include<vector> using namespace std; class NestedInteger { public: // Return true if this NestedInteger holds a single integer, rather than a nested list. bool isInteger() const{ return isInt; } // Return the single integer that this NestedInteger holds, ...
#ifndef WINDOWS_PANEL_H #define WINDOWS_PANEL_H #include "adjunct/quick_toolkit/windows/DesktopWindow.h" #include "modules/inputmanager/inputaction.h" #include "adjunct/quick/panels/HotlistPanel.h" #include "modules/util/adt/opvector.h" #include "modules/widgets/OpWidget.h" class OpToolbar; class OpWindowList; /*...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Adam Minchinton, Michal Zajaczkowski */ #ifndef _AUTOU...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2006 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" #include "mod...
#include "Player.hpp" Player::Player() { m_pos.x = 96; m_pos.y = 96; m_vel.x = 0; m_vel.y = 0; m_dim.width = 32; m_dim.height = 32; m_speed = 4; m_upPressed = false; m_downPressed = false; m_leftPressed = false; m_rightPressed = false; } Player::~Player() { } void Player:...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2006 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" #include <ctype.h> #include <signal.h> #include...
#include "../GraphicsProperties.h" #include <nexus_config.h> #include <nexus_platform.h> #include <nxclient.h> namespace WPEFramework { namespace Device { namespace Implementation { class NexusPlatform : public Plugin::IGraphicsProperties { public: NexusPlatform() : _totalGpuRam(0) { NEXUS_Error rc =...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2002 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef XSLT_HANDLER_H #define XSLT_HANDLER_H #ifdef XSLT_SUPPORT # incl...
#include"stdio.h" #include"conio.h" void main(void) { int a,b,c,y1,y2,y3,y4; clrscr(); printf("\n\nPut the value of a = "); scanf("%d",&a); printf("\nPut the value of b = "); scanf("%d",&b); printf("\nPut the value of c = "); scanf("%d",&c); y1=(a==b)!=c; y2=(a!=b); y3=(a>=b); y4=(c==b==a)==10; printf("\n\n\nT...
/* versionL With AK8LS * Date: 20200220 */ #include "FWCore/ParameterSet/interface/ParameterSet.h" // edm::ParameterSet #include "FWCore/Utilities/interface/Exception.h" // cms::Exception #include "PhysicsTools/FWLite/interface/TFileService.h" // fwlite::TFileService #include "DataFormats/FWLite/interface/Input...
#include "object\Telop.h" #include "Config.h" #include "Resource.h" Telop::Telop() : Telop({ Ref::FLD_W * (1.0F + Config::GetInstance()->GetResolutionNo() / 2.0F) / 2.0F, 128 * (1.0F + Config::GetInstance()->GetResolutionNo() / 2.0F) }) { } Telop::Telop(Vector2 pos) : Object(pos) { } void Telop::Init() { } void ...
#include "PrettyPrinter.h" #include <iostream> #include "GrammaticRules.h" #include <cassert> using namespace std; std::string CPrettyPrinter::marginString = " "; void CPrettyPrinter::PrintTabs( size_t tabs ) const { for ( size_t i = 0; i < tabs; i++ ) { cout << marginString; } } void CPrettyPrinter::PrintMa...
#include<iostream> #include<fstream> #include<string> #include<sstream> #include<stdlib.h> #include"IndexManager.h" #include"defination.h" using namespace std; BPLUSTREE::BPLUSTREE(int block_size) : block_size(block_size) { ifstream file("allindex.idx", ios::app); file.seekg(0, ios::beg); string file_name...
#pragma once #ifndef GLFW_INCLUDE_VULKAN #define GLFW_INCLUDE_VULKAN #endif #include <GLFW/glfw3.h> #include <vector> #include <string> struct InstanceVersion { uint32_t major, minor, patch; }; std::vector<std::string> fromExtPropertiesList(std::vector<VkExtensionProperties> prop_vec); class VulkanInstance { pr...
#include "pch.h" #ifndef SSAOINSTANCE_H #define SSAOINSTANCE_H #include "ViewHelper.h" #include "ConstantBuffer.h" #include "Shaders.h" const int SSAO_SAMPLE_DIRECTIONS = 14; struct PS_SSAO_BUFFER { XMFLOAT4 sampleDirections[SSAO_SAMPLE_DIRECTIONS]; XMFLOAT2 ditherScale; XMFLOAT2 pad; }; struct PS_SSAO_C...
/** \file movingAverage.hpp \author UnBeatables \date LARC2018 \name movingAverage */ #pragma once #include <iostream> #include <vector> class movingAverage { public: /** \brief Class constructor. */ movingAverage(); /** \brief This function determines newAverag...
#ifndef PSEUDOGENOMEBASE_H_INCLUDED #define PSEUDOGENOMEBASE_H_INCLUDED #include "../readsset/ReadsSetBase.h" #include "../readsset/DefaultReadsSet.h" using namespace PgSAReadsSet; namespace PgSAIndex { class PseudoGenomeBase: public ReadsSetBase { protected: const uint_pg_len_max length...
#include <iostream> #include <fstream> void checkForName(std::string str) { std::ifstream file("diary.txt"); // pass file name as argment std::string linebuffer; bool isName = false; while (file && std::getline(file, linebuffer)) { int i = 0; while (' ' != linebuffer[i]) { i++...
#include <CommonHeader.h> #include <iostream> #include <string> #include <thread> #pragma comment(lib, "kernelhelper.lib") void Usage(const char * p) { printf("Usage:\n\t%s from_file [from_db]\n" "\tExamples:[from_db=telephone-in.db]\n" "\t%s 100.txt my.db\n" "\t%s 100.txt\n", p, p, p ); } int...
// Created on: 1992-11-17 // Created by: Christian CAILLET // Copyright (c) 1992-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 ...
#include "movie.h" using namespace std; Movie::Movie(const std::string category, const std::string name, double price, int qty, std::string genre, std::string rating) : Product (category, name, price, qty) { genre_ = convToLower(genre); rating_ = rating; } Movie::~Movie() { } std::set<std::string> Movi...
#include <iostream> int INF=999999; using namespace std; struct edge{ int u; int v; int value; edge *next; }; edge *start=NULL; void add(int u,int v,int value) { edge *e=new edge; e->u=u; e->v=v; e->value=value; e->next=NULL; edge* q=new edge; q->n...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** 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. ** */ #ifndef FONTDB_H #define FONTDB_H #include "modules/util/str...
/* * FirebaseJson, version 3.0.7 * * The Easiest Arduino library to parse, create and edit JSON object using a relative path. * * Created June 14, 2023 * * Features * - Using path to access node element in search style e.g. json.get(result,"a/b/c") * - Serializing to writable objects e.g. String, C/C+...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <folly/Expected.h> #include <quic/QuicException.h> #include <quic/codec/ConnectionIdAlgo.h> #include <quic...
#pragma once #include <math.h> #include <vector> #include "Vector2D.h" class Arrival { public: Vector2D arrival(Vector2D target, Vector2D position, Vector2D velocity, float maxspeed, float maxforce) { Vector2D mol = position.operator-(target); mol.normalize(); Vector2D desired = mol...
/*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. =================...
#include <iostream> #include <cmath> #include <stdexcept> #include <string> using namespace std; class bad_hmean:public logic_error { private: double v1; double v2; string error="hmean invalid arguments: a=" + to_string(v1) + " b=" + to_string(v2) + " a=-b";; public: bad_hmean(double a = 0, double b = 0) :v1(a), v...
#include <unordered_set> int solution(vector<int> &A) { // write your code in C++14 (g++ 6.2.0) unordered_set <int> rec; //int cur_max_n = 1; for (auto a : A) { if (rec.count(a)==0) rec.insert(a); } int i = 1; while (i<A.size()){ if (rec.count(i)==0) return i; i++; ...
// Created on: 1991-02-26 // Created by: Isabelle GRIGNON // Copyright (c) 1991-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 "Keyboard.h" #include "xuartlite_l.h" Keyboard::Keyboard(uint32_t baseaddr) : baseaddr(baseaddr) { } uint8_t Keyboard::IsKeyPressed() { if (!XUartLite_IsReceiveEmpty(baseaddr)) { key = XUartLite_RecvByte(baseaddr); return 1; } return 0; } uint8_t Keyboard::GetKey() const { ...
#include "rendercl.h" #include "renderjob.h" #include "renderjobqueue.h" #include "shared/platform.h" #include <cl/cl.h> #include <iostream> #include <string> #if _DEBUG #define CL_CHECK_ERROR(x) { assert(x == CL_SUCCESS); } #else #define CL_CHECK_ERROR(x) x #endif inline void build(cl_program program, cl_device_id...
/* * Header file for the board.cells, cell and move classes and functions to validate moves and * other useful things used by both the main game and the AI. */ #ifndef DRAUGHTSMODULE_H #define DRAUGHTSMODULE_H #include <vector> //For vector #include <fstream> //For ifstream #include <string> #define BOARD_WIDTH 8 #d...
#pragma once #include <cstring> namespace prv { namespace lex { class token_view { public: explicit constexpr token_view(const char* ptr, std::size_t size) noexcept : ptr_(ptr) , size_(size) { } constexpr char operator[](std::size_t i) const noexcept ...
#include <iostream> #define NUM 1 + 2 using namespace std; int main() { cout << NUM * NUM << endl; return 0; }
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <folly/portability/GMock.h> #include <folly/portability/GTest.h> #include <quic/api/QuicTransportBase.h> ...
// // main.cpp // Homework 1 // // Created by Hender Lin on 4/11/21. // #include <iostream> #include <string> #include "Set.h" using namespace std; Set::Set() { m_length = 0; } bool Set::empty() const { if (m_length == 0) { return true; } return false; } int Set::size() const { re...