text
stringlengths
8
6.88M
#include<iostream> #include<vector> #include<unordered_map> using namespace std; // https://leetcode-cn.com/problems/two-sum/ vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> hash; vector<int> ret; for (int i=0; i<nums.size(); ++i) { int findNum = target - nums[i]; ...
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: QTSSFile.cpp Description: Class QTSSFile definition . Comment: copy from ...
//############################################################################################### // Project :: ACTeaM Classic 0.97d // GameServer:: 0.96.40 // Company :: Advanced CoderZ MU DevelopmenT © 2013 // Revised :: 17/01/2014 // Coded :: Mr.Haziel Developer //##############################...
class Solution { public: int characterReplacement(string s, int k) { // 双指针 int n = s.length(); //int num[26]; vector<int> num(26); // 用这样的一个数组计算各个单词的频次 int left = 0, right = 0, maxlen = 0; // 初始化 while (right < n) { num[s[right] - 'A']++; // 右指针遇到一个单词,就记录...
#ifndef TREELEAFTEST_H #define TREELEAFTEST_H #include "test.h" #include "../treelist.h" class TreeLeafTest: public Test { public: bool test(); char * getName(); }; #endif // TREELEAFTEST_H
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); #define chmax(x,y) x = max(x,y) #define chmin(x,y) x = min(x,y) using namespace std; using ll = long long; using vi = vector<int>; using ii = pair<int, int>; using vvi = vector<vi>; using vii = vector<ii>; using gt...
/** * 搜狗笔试题 */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <assert.h> #include <string.h> int encode(const void* raw_in, void* raw_out, uint32_t password, size_t len) { const uint8_t* in = (const uint8_t*)raw_in; uint8_t* out = (uint8_t*)raw_out; uint32_t seed = pas...
// Filename: dnaStorage.cxx // Created by: shochet (29Mar00) // //////////////////////////////////////////////////////////////////// #include "dnaStorage.h" #include <deque> DNAStorage::WorkingSuitPath *DNAStorage::WorkingSuitPath::_deleted_chain = (DNAStorage::WorkingSuitPath *)NULL; //////////////////////////////...
#ifndef GRABDRAGSCROLL_H #define GRABDRAGSCROLL_H #include <QtGui> #include <QtCore> #include <QtWebKit> #include <QtGlobal> class QObject; class QTimerEvent; class QEvent; class QBasicTimer; class QTimer; class QWebView; class QWebFrame; class QString; class QMouseEvent; class QCursor; struct Scr...
#pragma once /* boost */ #include <boost/log/common.hpp> #include <boost/log/attributes.hpp> #include <boost/log/utility/setup/common_attributes.hpp> #include <boost/log/utility/setup/from_settings.hpp> #include <boost/log/utility/setup/from_stream.hpp> #include <boost/log/utility/setup/formatter_parser.hpp> #include ...
#pragma once #include "Matrix.hh" #include <cmath> class Matrix3D : public Matrix<double,3> { public: /** * @brief Construct a new Matrix3D object * Calculates the matrix of rotation. * (Didn't really want to make new .cpp file * for this one constructor.) * * @param angle rotation angle */ Matrix3D(doub...
/** * LAB WEEK 4: SHAPES * CS3210 * @author Dennis Droese * @date March 28, 2018 * @file line.cpp */ #include "shape.h" line::line(double x0, double y0, double z0, double x1, double y1, double z1){ p2 = new matrix(4,1); (*p1)[0][0] = x0; (*p1)[1][0] = y0; (*p1)[2][0] = z0; (*p1)[3][0] = 1.0; (*p2)[0...
#ifndef __FILE_OUTPUT__ #define __FILE_OUTPUT__ #include "pfade_default.h" #include COMMON_SPEZ(logging_spez.h) #include "typen.h" #define pclear() {ps_impl("\033[2J\033[H");} #define pl() {pbegin(); pl_impl();} #define ps(x) {pbegin(); ps_impl(x); pend();} #define vps(...) {pbegin(); vps_impl(__VA_ARGS__); pend();}...
// Using sizeof operator for different variables. #include <iostream> using namespace std; int main(){ int array[ 20 ]; int *ptr; //= array; cout << " integer = " << sizeof( int ) << endl; cout << " double = " << sizeof( double ) << endl; cout << " float = " << sizeof( float ) << endl; ...
#ifndef FASTCG_VULKAN_DESCRIPTOR_SET_H #define FASTCG_VULKAN_DESCRIPTOR_SET_H #ifdef FASTCG_VULKAN #include <FastCG/Graphics/Vulkan/Vulkan.h> #include <FastCG/Graphics/Vulkan/VulkanTexture.h> #include <FastCG/Graphics/Vulkan/VulkanBuffer.h> #include <vector> #include <cstdint> namespace FastCG { struct VulkanDe...
// SenderSocket.h // CSCE 463-500 // Luke Grammer // 11/12/19 #pragma once class SenderSocket { HANDLE statsHandle, workerHandle; struct Properties* properties; BOOLEAN connected = false; DWORD nextSequenceNum = 0; /* GetServerInfo does a forward lookup on the destination host string if necessary * and popul...
#include <iostream> #include <vector> #include <deque> #include <stack> #include <limits> #include "priority_queue.h" using namespace std; namespace Matrix { struct Node { int Id; Node *Prev; int Value; int Sum; Node(int id, int value):Id(id),Value(value) { ...
#include<iostream> using namespace std; template<typename T> T maximum(T a, T b){ return (a > b) ? a : b; } //the above tempalte can't handle strings -- so we have a specialization for it template<> //shows its specialization char* maximum<char*>(char * a, char * b){ return strcmp(a,b)>0 ? a : b; } int main(){ ...
#include "classes.hpp" player::player(string n) { name = n; deck = new DeckBuilder(); //whole deck property = new DeckBuilder(); //hand for green cards, provinces for black deck->createDynastyDeck(); deck->createFateDeck(); Stronghold_card = new Stronghold("Ashina Castle"); army = new list<Personality*>(); ...
#ifndef __DECORATOR_H__ #define __DECORATOR_H__ #include "Component.h" #include <memory> class Decorator : public Component { public: Decorator(std::shared_ptr<Component> component); virtual const std::string product() override; virtual const int price() override; private: std::shared_ptr<Componen...
#include <cstdlib> #include <cstdio> #include <string> #include <unistd.h> #include <sys/wait.h> int main(int argc, char *argv[]) { FILE *log; FILE *out; FILE *err; FILE *exc; log = fopen("sys.log", "w"); out = fopen("out.log", "w"); err = fopen("err.log", "w"); exc = fopen("exc.log", "...
/*Author: Mehmed Esad AKÇAM 150190725 */ #pragma once #include "Faction.h" class Dwarves : public Faction{ //Public derivation public: Dwarves():Faction(){}; //Default constructor Dwarves(string name , int numberOfUnits, int attackPoint, int healthPoint, int regen);//Constroctur with parameters ...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define print(v) for(auto x:v){cout<<x<<" ";}cout<<endl; void solve(string ip,string op,vector<string> &v){ if(ip.length()==0){ v.push_back(op); return; } for(int i=0;i<ip.length();i++){ string op1 = op; sw...
#include "tlsf.h" #include <string> using namespace std; namespace dosk { class allocator { private: string hash; tlsf_t heap; size_t size; public: allocator(string& hash, void* pool, size_t size); void* get_heap(); size_t get_heap_size(); void* malloc(size_t size);...
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> handleExtremeCase(int size) { vector<int> ans(size + 1, 0); ans[0] = 1; return ans; } vector<int> plusOne(vector<int> &digits) { int i = digits.size() - 1; while (i >= 0) ...
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> #include <stdint.h> #include "il2cpp-class-internals.h" #include "codegen/il2cpp-codegen.h" #include "il...
#include <Arduino.h> #include <Wire.h> #include <Adafruit_NeoPixel.h> class VRCLED : public Adafruit_NeoPixel { public: VRCLED(uint8_t pin, uint8_t num_pixels, neoPixelType t = NEO_GRBW); void show_temp_color(uint32_t seconds); void set_temp_color_target(uint8_t white, uint8_t red, uint8_t ...
#include "aulibdefs.h" #include "auudp.h" AuUdp::AuUdp(QHash<quint16 , QVector<qint16> > &plcData,QObject *parent) : QObject(parent), plcRawData(plcData) { }
#ifndef SMART_TEMPERATURE_TEMPERATURESENSORMOCK_H #define SMART_TEMPERATURE_TEMPERATURESENSORMOCK_H #include "gmock/gmock.h" #include "TemperatureSensor.h" class TemperatureSensorMock: public TemperatureSensor { public: TemperatureSensorMock() : TemperatureSensor(210){} MOCK_METHOD(double, readTemperature, ()); }...
// MartixManipulation.cpp : 定义控制台应用程序的入口点。 // //#include <iostream> //#include "Matrix.hpp" //#include <windows.h> //#include <string> //#include <fstream> //using namespace GPSDCurriculumDesign; //int main() //{ // std::string dataPath = "..\\data\\"; // std::string filename = "Matrix.txt"; // std::ifstream fin(da...
// github.com/andy489 #include <iostream> #include <cmath> using namespace std; int res = 0; int checkRecursive(int N, int X, int start, int K) { if (X == 0) ++res; int r = (int) floor(pow(N, 1.0 / K)); for (int i = start + 1; i <= r; i++) { int a = X - (int) pow(i, K); if (a >...
/*LocalNodeStore.h LocalNodeStore copyright Vixac Ltd. All Rights Reserved */ #ifndef INCLUDED_LOCALNODESTORE #define INCLUDED_LOCALNODESTORE #include "Node.h" #include "AsyncFunctor.h" #include "NodeStoreAsync.h" namespace vixac { namespace ina { class LocalNodeStore; } } /** A local node ...
#include <stdio.h> #include <math.h> int main() { double pi=0.0,n=1.0,term=1.0; while(term>=1e-6) { pi=pi+term; n=n+2; term=1/(n*n); } pi=sqrt(pi*8); printf("pi=%10.8f\n",pi); return 0; }
You have selected GOA as your Travel Destination Name Of The Customer :pranjal Total Members :3 Residintial Address :mumbai Area Pin Code :456009 Customer's Contact No.:2147483647
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: vector<int> postorderTraversal(TreeNode* root) { stack<TreeNode*> nodes; st...
#include <gtest/gtest.h> #include "CppLinq.h" #include "TestUtils.h" TEST(Any, ThreeInts) { std::vector<int> src = { 1, 2, 3 }; auto rng = CppLinq::From(src); EXPECT_TRUE(rng.Any()); EXPECT_TRUE(rng.Any([](int a) { return a == 1; })); EXPECT_TRUE(rng.Any([](int a) { return a == 2; })); EXPECT_TRUE(rng.Any([]...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QListWidgetItem> #include <QTime> #include "UscxmlCLib.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); public slots: v...
#ifndef __CLineMatchList #define __CLineMatchList // 注意:可存储的线段对数量大于实际参与匹配运算的数量 #define MAX_LINE_MATCH_COUNT 10 // 最多可参与最小二乘匹配的直线段数量 #include <vector> #include "LineMatchPair.h" #include "CoorTransEquations.h" using namespace std; ///////////////////////////////////////////////////////////////////////////...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#include <iostream> //using namespace std; class Vector { private: double i; double j; double k; public: Vector(); Vector(double _i, double _j, double _k) { i = _i; j = _j; k = _k; } void echo(const Vector& v) { std::cout<<v.i<<","<<v.j<<","<<...
#ifndef _TRIPLEBIT_H_ #define _TRIPLEBIT_H_ #include <string> #include <iostream> #include <sstream> #include <fstream> #include <map> #include <vector> #include <set> #include <stdlib.h> #include <stdio.h> #include <malloc.h> #include <math.h> #include <sys/time.h> #include <stack> #include <tr1/memory> //#include <h...
#include <iostream> #include <fstream> #include "JSONReader.h" JSONReader::JSONReader() { } JSONReader::~JSONReader() { } /* Name: LoadJSONFileLevel Params: A String representing the name of the JSON file A referenced rapidjson::Document to load the json information into. Returns: A bool representing whether or n...
//sort()的第三个参数不填,则默认按照从小到大的顺序排列 #include<stdio.h> #include<algorithm> using namespace std; int main(){ int a[]={2,5,89,55,67}; for(int i=0;i<5;i++) printf("%d ",a[i]); printf("\n"); sort(a,a+5);//不加compare参数的话就是默认从小到大排列 for(int i=0;i<5;i++) printf("%d ",a[i]); printf("\n"); return 0; }
#include <iostream> #include <vector> using namespace std; int k,n; void gen(vector<int> s, int prev) { if (s.size() == k) { for (int i = 0; i < k; i++) { cout << s[i] << " "; } cout << "\n"; return; } for (int i = k - s.size(); i < prev; i++) { vector<i...
#include "Pony.hpp" Pony::Pony(std::string nam, int wei, std::string col) : name(nam), weight(wei), colour(col) { std::cout << "Pony created" << std::endl; return; } Pony::~Pony(void) { std::cout << "Pony destroyed" << std::endl; } void Pony::sayHello() { std::cout << "Hi, my name is " << this->na...
// CkCharset.h: interface for the CkCharset class. // ////////////////////////////////////////////////////////////////////// // This header is generated. #ifndef _CkCharset_H #define _CkCharset_H #include "chilkatDefs.h" #include "CkString.h" #include "CkMultiByteBase.h" class CkByteData; #ifn...
#include "HighScore.h" HighScore::HS::HS() { _HS = new list<score>(); } HighScore::HS::~HS() { delete _HS; } void HighScore::HS::addHS(const int point, const string name) { score add; add.point = point; add.name = name; _HS->push_back(add); _HS->sort(); } void HighScore::HS::getMin(int &...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scan...
#include<iostream> #include<algorithm> using namespace std; int main() { long long int t,arr[100000],arra[100000],i,n,c = 0,d = 0; cin>>t; while(t--) { cin>>n; for(i = 0;i < n;++i) { cin>>arr[i]; arra[i] = arr[i]; } sort(arr,arr+n); ...
#pragma once #include <unordered_map> #include <array> #include <tudocomp/compressors/lz_common/factorid_t.hpp> namespace tdc {namespace lz_pointer_jumping { static constexpr bool PRINT_DEBUG_TRANSITIONS = false; template<typename pj_trie_t> class PointerJumping: public pj_trie_t { using jump_buffer_handle = t...
#include "logger.h" static const char* LoggerLevelStrings[kLogLevels] = { [kLogDebug] = "D", [kLogInfo] = "I", [kLogError] = "E", [kLogFatal] = "F", }; void Logger::Printf(LoggerLevel level, const char* format, ...) { va_list args; va_start(args, format); FormatMessage(level, format, args); Write(ms...
#include <bits/stdc++.h> using namespace std; const int MAX_INT = std::numeric_limits<int>::max(); const int MIN_INT = std::numeric_limits<int>::min(); const int INF = 1000000000; const int NEG_INF = -1000000000; #define max(a,b)(a>b?a:b) #define min(a,b)(a<b?a:b) #define MEM(arr,val)memset(arr,val, sizeof arr) #defi...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Character.h" #include "BasicBot.generated.h" class UUI_DamageDisplay; UCLASS() class THIRDPERSONSHOOTER_API ABasicBot : public ACharacter { GENERATED_BODY() private: UPROPE...
// OpenIGTLinkRemote MRML includes #include "vtkMRMLOpenIGTLinkRemoteNode.h" // VTK includes #include <vtkObjectFactory.h> vtkMRMLNodeNewMacro(vtkMRMLOpenIGTLinkRemoteNode); // ---------------------------------------------------------------------------- vtkMRMLOpenIGTLinkRemoteNode::vtkMRMLOpenIGTLinkRemoteNode() { ...
template <class T> void swapp(T &a,T &b); // template prototype template <class T> void swapp(T &a,T &b){ // function template definition T temp; temp = a; a = b; b = temp; } // 对于给定的函数名,可以有非末班函数,模板函数和显示具体化末班函数以及它们的重载版本 // 显示具体化的原型和定义应以 template<>打头,并通过名称类指出类型 // 具体化优先于常规末班,非模板函数优先于具体化和常规模板 struct ...
#include "cinder/app/App.h" #include "cinder/app/RendererGl.h" #include "cinder/gl/gl.h" #include "cinder/CameraUi.h" #include "sp/BVH.h" using namespace ci; using namespace ci::app; using namespace std; // Basic Triangle Class // The BVH class needs to have access to 3 functions; getBounds, getCentroid and intersec...
#ifndef _MAT4_H_ #define _MAT4_H_ #pragma once #include "math\mathfunctions.h" #include "math\matrix\vec\vec2.h" #include "math\matrix\vec\vec3.h" #include "math\matrix\vec\vec4.h" namespace bne { namespace math { struct mat4 { union { float elements[4 * 4]; vec4f columns[4]; ...
/********************************************************** * License: The MIT License * https://www.github.com/doc97/TxtAdv/blob/master/LICENSE **********************************************************/ #pragma once #include <string> namespace txt { /* Interface: ResponseHandler * Used to implement response hand...
#include "graph.h" #include <utility> #include <iostream> using namespace std; Graph::Graph(int point_number){ this->n=point_number; this->line=0; memset(dat,0,MAX*MAX); } bool Graph::isEmpty(){ return n?false:true; } bool Graph::addline(pair<int,int>lines){ this->dat[lines.first][lines.second]=1; return true; } ...
#include <iostream> #include <math.h> #include <conio.h> using namespace std; class Perhitungan { friend ostream& operator<<(ostream&, Perhitungan&); friend istream& operator>>(istream&, Perhitungan&); public: float rata(); float STD(); private: long sqrt(int n) { return(n*n); } int n; int A[20]; }; ...
/* SH_User.cpp */ #include "qdebug.h" #include "include\SH_User.h" /* Constructor */ SH_User::SH_User() : QObject() { } SH_User::SH_User(QString username, QString password, QString access) : QObject() { } /* Destructor */ SH_User::~SH_User() { } /* isLoggedIn() returns state of loggedIn */ bool SH_User::is...
#ifndef CIRCLE_H #define CIRCLE_H #include <iostream> #include <QMainWindow> #include <QColor> #include <QPainter> #include <QPixmap> #include <QPen> #include "figure.h" using namespace std; class circle:public figure { private: int r; public: circle(int x_=0,int y_=0,int r_=0); ~circle(...
/* Copyright (c) 2013-2014 Sam Hardeman 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, modify, merge, publish, dist...
#ifndef BINARYTREE_H #define BINARYTREE_H #include <QCoreApplication> #include <iostream> #include <queue> ///BinaryTree ///шаблон класса бинарного дерева, помимо стандартных методов работы с бинарными деревьями ///предоставляет функции обхода дерева template <class T> class BinaryTree { protected: BinaryTree *Li...
#include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; void printn(char ch, int n) { while (n--) cout << ch; } void hrule(const vector<int> &col_width) { for (int w: col_width) { cout << "$"; printn('-', w); } cout...
#include <iostream> #include <map> class Flyweight { public: virtual ~Flyweight() {} virtual void operation() = 0; // ... }; class UnsharedConcreteFlyweight : public Flyweight { public: UnsharedConcreteFlyweight(const int intrinsic_state) : state(intrinsic_state) {} ~UnsharedConcreteFlyweig...
#include "jugador.h" namespace Juego { void actualizarJugador() { } void dibujarJugador() { } }
class Solution { public: bool canPlaceFlowers(vector<int>& flowerbed, int n) { // 贪心算法 贪心在于放尽可能多的花,比较花的数量和n的大小。 int flowers = 0; if (flowerbed.size() == 0) return 0; for (int i = 0; i < flowerbed.size(); i += 2) { // 两个格子进行跳跃 这是因为一个格子确定有花之后,下一个一定是0。这样一来,下一朵花需要在离 // 当前花儿2个单位的距离...
#include <bits/stdc++.h> using namespace std; int main() { stack <int> arr; char st[100100],nd[100100]; cin>>st>>nd; int n1=strlen(st),n2=strlen(nd),n; if(st[0]=='0')cout<<nd; //ไม่จำเป็น else{ if(n1>=n2) {n=n2; int j=n1-1,s=0; for(int i=n-1;i>=0;i--) { ...
#include <ResetDetector.h> //prefer this works more reliable than doubleResetDetector //#include <DoubleResetDetector.h> #include <wifi.h> //refactored out WiFiManager #include <utils.h> //utilities functions // Dependency Graph // |-- <ResetDetector> 1.0.3 // | |-- <EEPROM> 1.0 // |-- <DNSServer> 1.1.1 // | |-...
/* ID: hjl11841 TASK: palsquare LANG: C++ */ #include<bits/stdc++.h> using namespace std; int b; int a[1000]; char g[12]={'A','B','C','D','E','F','G','H','I','J','K','L'}; bool check(int x){ int st=1,tail=1; while(x!=0){ a[tail]=x%b; x=x/b; tail++; } tail--; for(int i=1;i<=(t...
/************************************************************************* > File Name : ItsDatabase.h > Author : YangShuai > Created Time: 2016年08月19日 星期五 12时35分53秒 > Description : ************************************************************************/ #ifndef ITSDATABASE_H #define ITSDATABASE_H ...
// EagleControllerTest.cpp : Defines the entry point for the console application. // #define _CRT_SECURE_NO_WARNINGS #include "stdafx.h" #include <iostream> using namespace std; #include "String.h" //#define AssertEqual(a, b) {if (!(a == b)) cout << "Failed " << __FUNCTION__ << ". Expected, received: >" << a << "< ...
#include "euler_cmp.hpp" double **calculate(compendulum cmp) { double T = 2 * PI*sqrt(cmp.L / cmp.g); double dt = (double)T / N * 8; double **calculations = new double*[N]; for (int i = 0; i < N; i++) { calculations[i] = new double[3]; } calculations[0][0] = 0; // time column calculations[0][1] = cmp.angle0;...
#ifndef SYSTEM_H #define SYSTEM_H #include <opencv2/opencv.hpp> #include "Engine.h" #include <stdio.h> #include <stdint.h> #include <string.h> class System { public: cv::Mat image; Engine eng; uint32_t portno; char* host; System(); void setImage(cv::Mat& obj); cv::Mat getImage(); void setEngine(Engine& obj); ...
#include "Linklist.h" #include<iostream> using namespace std; int main(){ Linklist<int> ll; int ch = 0; char loop = 1; int data; int pos; while(loop){ cout<<"Menu:\n1.AddBegin\n2.AddEnd\n3.DeleteBegin\n4.DeleteEnd\n5.Display\n6.Size\n7.Reverse\n8.AddAtPos\n9.DeleteAtPos\n10.ReverseList\n11.Exit\n"; cin>>ch; ...
#pragma once #include "fp_camera.h" class FloatingCamera : public FPCamera { public: FloatingCamera(float32 fov, float32 width, float32 height) : FPCamera(fov, width, height) {} void MoveUp(float32 amount) { Translate(up * amount); } };
#include "Texture.h" bool Texture::load( string file ) { bool result = false; SDL_Surface* img = IMG_Load( file.c_str() ); if( img ) { glGenTextures( 1, &mID ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEX...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include "test_util.h" void TEST_RM_7(const string &tableName) { // Functions Tested // 1. Reorganize Page ** // Insert tuples into one page, reorganize that page, // and use the same tids to read data. The results should // be the same as before. Will check code as well. cout << "****In Test...
#ifndef MYGRAPHICSSCENE_H #define MYGRAPHICSSCENE_H #include <QGraphicsScene> #include "scenestates.h" class MyGraphicsScene: public QGraphicsScene { Q_OBJECT public: MyGraphicsScene(QObject *parent); void setSceneRect(qreal x, qreal y, qreal w, qreal h); void setSceneState(SceneState iscenestate); ...
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
#include <iostream> #include <cmath> using namespace std; //this function test if number is prime. It returns 1 if it's prime int isprime (int num) { if (num == 1) return 0; if (num == 2) return 1; for (int i = 2; i <= sqrt(num); i++) { if (num % i == 0) return 0; } } //this f...
#include<bits/stdc++.h> using namespace std; int main() { string s,s1; cin>>s>>s1; int sz=s.size(), sz1=s1.size(); if(s==s1)cout<<s<<endl; else cout<<1<<endl; }
#include <iostream> #include "List.h" enum Color { Black, Red, DoubleBlack }; template<typename TKey, typename TValue> class Map { private: class Node { public: TKey key; TValue value; Color color; Node *parent, *left, *right; Node() = default; // Default...
/* * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef CUTELYSTVALIDATORDIGITS_H #define CUTELYSTVALIDATORDIGITS_H #include "validatorrule.h" #include <Cutelyst/cutelyst_global.h> namespace Cutelyst { class ValidatorDigitsPrivate; /...
#include "player.h" #include <cmath> #include "gameobjects/level/level.h" inline double dist_sq(double x1, double y1, double x2, double y2) { return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); } //calculates the angle opposite c in a triangle with sides a, b, and c inline double calculate_angle_SSS(double a...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.UI.Core.Preview.2.h" WINRT_EXPORT namespace winrt { namespace Windows::UI::Core::Preview { struct WINRT_EBO SystemNavigationCloseRequestedPreviewEventArgs : Windows::UI...
/** * @file CellFunctor.h * * @date 22 Jan 2018 * @author tchipevn */ #pragma once #include "autopas/cells/SortedCellView.h" #include "autopas/iterators/SingleCellIterator.h" #include "autopas/options/DataLayoutOption.h" #include "autopas/utils/ExceptionHandler.h" namespace autopas { namespace internal { /** *...
#include <bits/stdc++.h> #include <cassert> #define rep(i, N) for (int i = 0; i < (N); ++i) #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rep3(i, a, b) for (ll i = a; i >= b; --i) #define pb push_back #define eb emplace_back #define fi first #define se second #define all(c) begin(c), end(c) #define ok() put...
#include <fstream> #include <string> class VisPromelaAST { public: VisPromelaAST(SgProject *proj); void generate(std::string filename); protected: SgProject * proj; };
/* * UAE - The Un*x Amiga Emulator * * Pro-Wizard glue code * * Copyright 2004 Toni Wilen */ #include "sysconfig.h" #include "sysdeps.h" #ifdef PROWIZARD #include "options.h" #include "uae/io.h" #include "memory.h" #include "uae/seh.h" #include "moduleripper.h" #include "gui.h" #include "uae.h" static int got, canc...
#include <stdio.h> #include <stdlib.h> #include <GL/glut.h> #include <math.h> #define janela_altura 600 #define janela_largura 800 #define PI 3.14159 float transX[] = { 0, 0 }; float l[] = { -150, 150 }; void display(void); void tela(GLsizei w, GLsizei h); void MouseClick(int button, int state, int x, ...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * 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 ...
#include "model.h" const unsigned char intonly_quant_tflite_model[] = { 0x20, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,...
/* // Created by: Jacob Cassady // Date Created: 10/9/2016 // Last Updated: 10/12/2016 */ /* Problem Statement Write a program to evaluate a postfix expression */ #include <string> #include <iostream> #include <stack> #include <sstream> using namespace std; int charToInt(char input){ int output; output = inp...
#include <iostream> using namespace std; int main() { char a; cout << "소문자 입력 : "; cin >> a; cout << a << "는 " << (int)(a - 'a') << "번째 영어 소문자"; }
#include "StdAfx.h" #include "_FaceRecognizer.h" std::vector<IplImage *> _FaceRecognizer::_faces; std::vector<int> _FaceRecognizer::id; CvSize _FaceRecognizer::imgsize; int _FaceRecognizer::nEigens; IplImage ** _FaceRecognizer::eigenVectArr; CvMat * _FaceRecognizer::eigenValMat; IplImage * _FaceRec...
/*************************************************************************** Copyright (c) 2020 Philip Fortier 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 2 of the License, or...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...