text
stringlengths
8
6.88M
#pragma once #include <new> #include "Keng/Memory/Common.h" namespace keng::memory { class KENG_MEMORY_API Api { public: static void* Allocate(std::size_t size); static void Deallocate(void* pointer); }; } #define USE_KENG_MEMORY_MANAGER \ void* operator new(std::s...
#ifndef SEGMENT_H #define SEGMENT_H #include "point.hpp" namespace geometry { class Segment : public Object { public: Segment(); Segment(Point* p1, Point* p2); Segment(Float* a, Float* b, Float* c); Segment(Float* k, Float* l); Segment(std::string string); Segment(Object* obj); ~Segment();...
// // Created by faris on 4/26/2020. // #ifndef FINALPROJECT_LSHAPE_H #define FINALPROJECT_LSHAPE_H #include <Box2D/Box2D.h> #include <vector> #include <cinder/gl/gl.h> #include <mylibrary/Shape.h> using namespace ci; class LShape : public Shape{ public: LShape(b2World* world, const vec2 &pos); int lid = -89;...
#include <vector> #include <GL/glew.h> #ifdef __linux__ #include <GLFW/glfw3.h> #elif __MINGW32__ #include <GLFW/glfw3.h> #elif __WIN32 #include <GL/glfw3.h> #endif #include <glm/gtc/constants.hpp> #include <data.hpp> #include <operations.hpp> float QUADVERTICES[24] = { // vertex attributes for a quad that fills t...
class Solution { public: bool isPowerOfThree(int n) { return (n > 0 && (int)(log10(n)/log10(3)) - log10(n)/log10(3) == 0 ); } };
#ifndef binaryTree_ #define binaryTree_ #include <functional> // for what using namespace std; template <class T> // 此处的T是一个节点 class binaryTree{ public: virtual ~binaryTree() {} //析构函数要是虚函数,要不然自动生成的析构函数不是虚函数 virtual bool empty() = 0; virtual int size() = 0; vi...
/** * Given a binary tree, find the maximum path sum. * * The path may start and end at any node in the tree. * * For example: * Given the below binary tree, * * 1 * / \ * 2 3 * Return 6. */ // Simplified version /** * Definition for binary tree * struct TreeNode { * int val; * T...
#include "inifile.hh" #include "parser.hh" #include <fstream> inifile_driver::inifile_driver () : trace_scanning (false), trace_parsing (false) { // } inifile_driver::~inifile_driver () { } void inifile_driver::parse (std::istream &in) { result = false; file = "stream input"; lexer = new inifileLexer(&in); ...
// // main.cpp // median_filter // // Created by weiren Lan on 2018/4/2. // Copyright © 2018年 weiren Lan. All rights reserved. // #include <iostream> #include <vector> #include <algorithm> using namespace std; void medianFilter(short InputImageData[100][100] ,short OutputImageData[100][100] ,int kernelSize) { ...
#include "openglwidget.h" #include <QApplication> #include <assimp/scene.h> #include <assimp/Importer.hpp> #include <assimp/postprocess.h> #include <bullet/LinearMath/btTransform.h> #include <iostream> #include "bullet/LinearMath/btVector3.h" QVector<Mesh *> loadModel(const QString &modelPath, QString texturePath = ...
// // Created by 송지원 on 2020/05/21. // #include <cstdio> using namespace std; int main() { int N; scanf("%d", &N); for (int i=0; i<N; i++) { printf("%d ", N-i); } }
#include <iberbar/Renderer/Shader.h> #include <iberbar/RHI/Shader.h> iberbar::Renderer::CShaderProgram::CShaderProgram( RHI::IShader* pVS, RHI::IShader* pPS, RHI::IShader* pHS, RHI::IShader* pGS, RHI::IShader* pDS ) : CRenderResource() , m_pShaders() { memset( m_pShaders, 0, sizeof( m_pShaders ) ); } iberb...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2008 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef URL_COMMELM_H #define URL_COMMELM_H #include "module...
#include<bits/stdc++.h> using namespace std; char s1[200000],s2[200000]; int s[700000],sa[700000],rank[300000],ra[300000],num[300000],p1[300000],p2[300000],hei[300000],n,m,ans=0; void readit(){ scanf("%s",s1); scanf("%s",s2); n=strlen(s1); m=strlen(s2); for (int i=0;i<n;i++) s[i]=s1[i]-96; s[n]=27; ...
#include <vector> #include <iostream> #include "MyTree.h" void CreateTree(NODE * &head, const std::vector<DATA> &dataVec){ head = new(NODE); if(!head){ exit(-1); } head->m_data = dataVec[0]; head->m_PLeftChild = NULL; head->m_RightChild = NULL; for(uint i = 1; i < dataVec.size(); ++i){ bool isLeft; NODE...
#ifndef OPENCVSHARKITEM_H #define OPENCVSHARKITEM_H #include <QQuickItem> #include <QImage> #include "camerathread.h" #include <QSGSimpleTextureNode> #include <QSGTexture> #include <QQuickWindow> //tes class OpencvSharkItem : public QQuickItem { Q_OBJECT Q_DISABLE_COPY(OpencvSharkItem) Q_PROPERTY(bool running READ ...
#include "LastDitch.h" #include <chrono> #include "src/Constants.h" using namespace ld; using namespace osg; using namespace std; LastDitch::LastDitch() : root(new Group), input(), rng(SEED > 0 ? SEED : chrono::high_resolution_clock::now().time_since_epoch().count()), time_system(), map_system(rng)...
/* https://www.acmicpc.net/problem/1065 */ #include <iostream> #include <cstring> #include <cmath> using namespace std; int numLength(const int _num) { int length = 0; int num = _num; while (true) { num /= 10; length++; if (num < 1) break; } return length; } int isHansue(const int _num) { int num = _...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e17 // 4倍しても(4回足しても)long longを溢れない #define rep(i,n) f...
/*** * Copyright (C) 2016 Luca Weihs * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distr...
/* -*- 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 spoon / Arjan van Leeuwen (arjanl) */ #ifndef DESKTOP...
#include <limits> #include <util/Logger.h> #include <util/point.hpp> #include <imageprocessing/ConnectedComponent.h> #include <sopnet/segments/EndSegment.h> #include <sopnet/segments/ContinuationSegment.h> #include <sopnet/segments/BranchSegment.h> #include "RandomForestCostFunction.h" static logger::LogChannel rando...
#include <iostream> int main() { std::cin.sync_with_stdio(false); std::cin.tie(NULL); int k, a = 1, b = 0; std::cin >> k; for(int i = 1; i <= k; i++) { int na = b; int nb = a + b; a = na; b = nb; } std::cout << a << ' ' << b << '\n'; return 0; }
#include "pch.h" #include <iostream> #include <windows.h> #include <time.h> #include <stdlib.h> using namespace std; enum YON { YON_asagi = 1, YON_yukari = 2, YON_saga = 3, YON_sola = 4, }; struct ucakhucresi { int x; int y; YON yon; char karakter; }; struct mermi { int x; int y; YON yon; bool ateslendi...
#pragma GCC optimize("Ofast") #include <algorithm> #include <iostream> #include <cstring> #include <bitset> #include <deque> #include <iostream> #include <iterator> #include <string> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <unordered_map> #include <unordered_set> us...
/* * div.h * * Created on: 2 mars 2014 * Author: droper */ #ifndef DIVI_H_ #define DIVI_H_ #include "op.h" class op_divide: public op { public: op_divide(); ~op_divide(); void display(std::ostream&, int); double getValue(); int whoiam(); }; #endif /* DIVI_H_ */
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #ifndef _URL_SCHEME2_H_ #define _URL_SCH...
/******************************************************************************* Copyright (c) 2010, Steve Lesser 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 c...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) 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 WEBVTT_PARSER_H #define WEBVTT_PA...
//concise way class Solution { public: bool validUtf8(vector<int>& data) { int count = 0; for(int c: data){ if(!count){ if((c >> 5) == 0b110) count = 1; else if ((c >> 4) == 0b1110) count = 2; else if((c >> 3) == 0b11110) count = 3; ...
#include "stdafx.h" #include "RandomNumberGenerator.h" #include <ctime> RandomNumberGenerator::RandomNumberGenerator() { SeedRandomState(); } RandomNumberGenerator::~RandomNumberGenerator() { gmp_randclear(m_rstate); } void RandomNumberGenerator::SeedRandomState() { gmp_randinit_mt(m_rstate); gmp_randseed_ui(m...
/* Cousins in Binary Tree In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a binary tree are cousins if they have the same depth, but have different parents. We are given the root of a binary tree with unique values, and the values x and y of two diffe...
#include<bits/stdc++.h> using namespace std; struct tree{ int l,r,tag,sum; }; struct ope{ int p,x,y; }; vector<int> e[200000]; tree tr[500000]; ope q[200000]; int dep[200000],siz[200000],son[200000],fa[200000],top[200000],id[200000],ans[200000],n,m,num=0,k=0; inline void ins(int u,int v){ e[u].push_back...
/* ============================= * | Name: Abhishek Mantha | * | Email: amantha@usc.edu | * | GitHub: abmantha | * | Date Submitted: 1/23/15 | * | HW 1 | * ============================= * * 1. Given two linked-lists of integers, recursively make a new linked-list * (i.e. copy...leaving the original two ...
/* 题目描述 输入n, 求y1=1!+3!+...m!(m是小于等于n的最大奇数) y2=2!+4!+...p!(p是小于等于n的最大偶数)。 输入描述: 每组输入包括1个整数:n 输出描述: 可能有多组测试数据,对于每组数据, 输出题目要求的y1和y2 输入例子: 4 输出例子: 7 26 */ #include "iostream" #include "vector" #include "algorithm" using namespace std; int demo(int n){ if(n == 1){ return n; }else{ return n ...
#include "stdafx.h" #include "CUtil.h" CUtil::CUtil() { } CUtil::~CUtil() { }
/* Petar 'PetarV' Velickovic Algorithm: Strassen's Algorithm */ #include <stdio.h> #include <math.h> #include <string.h> #include <iostream> #include <vector> #include <list> #include <string> #include <algorithm> #include <queue> #include <stack> #include <set> #include <map> #include <complex> using namespace std;...
/** Kabuki SDK @file /.../Source/Kabuki SDK/_2D/PolarPoint.cpp @author Cale McCollough @copyright Copyright © 2016 Cale McCollough @license Free and open-source. You can find a copy of the license that YOU MUST READ in the accompanying ./ReadMe.md, file incorporated herein by this referenc...
#include "AudioTrack.h" #include "JNI_load.h" #define AudioManager_STREAM_MUSIC 3 #define AudioFormat_CHANNEL_OUT_MONO 0x4 #define AudioFormat_CHANNEL_OUT_STEREO 0x4|0x8 #define AudioFormat_ENCODING_PCM_16BIT 2 #define AudioFormat_ENCODING_PCM_8BIT 3 #define AudioTrack_MODE_STATIC 0 #define AudioTrack_MODE_STREAM ...
#include "katakana.h" Katakana::Katakana( const string & inHiraKata, const string & inRoumaji ): Mot( inHiraKata, inRoumaji ) { isHiraKata_ = true; } Katakana::~Katakana() { }
/* -*- 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 Blazej Kazmierczak (bkazmierczak) */ #ifndef GADGET_UP...
#include<bits/stdc++.h> using namespace std; struct node{ int key; struct node *left, *right; }; struct node* newnode(int key) { struct node* temp=(struct node*)malloc(sizeof(struct node)); temp->key=key; temp->left=temp->right=NULL; } void inorder(struct node* root) { if(root!=NULL) { inorder(root->left);...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2004-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 { Anders Oredsson <anderso@opera.com> } */ #include "c...
// // VoiceRAM.cpp // DrumConsole // // Created by Paolo Simonazzi on 20/03/2016. // // #include "../JuceLibraryCode/JuceHeader.h" #include "VoiceRAM.hpp" #include "AudioSettings.hpp" #include "DrumKit.hpp" #include "SoundFromRAM.hpp" VoiceRAM::VoiceRAM(DrumKit* dk):state(Stopped) { drumKit = dk; ...
#include "Light.h" using namespace DirectX; Light::Light() { } Light::~Light() { } void Light::SetAmbientColor(float red, float green, float blue, float alpha) { m_ambientColor.x = red; m_ambientColor.y = green; m_ambientColor.z = blue; m_ambientColor.w = alpha; } void Light::SetDiffuseColor(float red, float g...
#include "Poco/Util/XMLConfiguration.h" #include "Poco/RegularExpression.h" #include "Poco/DirectoryIterator.h" #include "Poco/StreamCopier.h" #include "Poco/Thread.h" #include "Poco/File.h" #include "Poco/Exception.h" #include <iostream> #include <vector> #include <fstream> void deal_path(const std::st...
#include<cstdio> #include<iostream> using namespace std; int main(){ //input int n; //cin>>n; fscanf(stdin,"%d",&n); for(int i=0;i<n;++i){ char sex; double height; cin>>sex>>height; //fscanf(stdin,"%c %f",&sex,&height); if(sex=='M'){ fprintf(stdo...
#ifndef UTIL_H #define UTIL_H #include <string> namespace Platy { namespace Core { class Util { public: Util() = delete; ~Util() = default; /// <summary> /// Gets current time in a d-m-y h-m-s format /// </summary> static std::string GetTime(); /// <summary> /// Safely deletes a poin...
extern "C"{ double mass; void set_mass(double x){ mass = x;} double rotational_inertia; void set_rotational_inertia(double x){ rotational_inertia = x;} double center_to_front; void set_center_to_front(double x){ center_to_front = x;} double center_to_rear; void set_center_to_rear(double x){ center_to_rear = x;...
/*! * \file variable.cpp * \author Simon Coakley * \date 2012 * \copyright Copyright (c) 2012 University of Sheffield * \brief Implementation of model memory variable */ #include "./variable.h" Variable::Variable() { description = ""; constant = false; } Variable::Variable(QString n, QString t) { th...
// // main.cpp // Tarea2Ejercicio3 // // Created by Daniel on 03/09/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #include <iostream> #include <fstream> #include <algorithm> int buscarOcurrencias(std::string texto, std::string buscar); int main(int argc, const char * argv[]) { std::string linea; ...
#include<iostream> using namespace std; void towerOfHanoi(int n, char source, char destination, char auxiliary) { if(n == 1) { cout << "Move disk 1 from ROD " << source << " to ROD " << destination << endl; return; } towerOfHanoi(n-1, source, auxiliary, destination); cout << "Move disk ...
#include"AbstractFactory.h" #include"AbstractProductA.h" #include"AbstractProductB.h" class ConcreteFactory1:public AbstractFactory{ public: ConcreteFactory1(); virtual ~ConcreteFactory1(); virtual AbstractProductA* CreateProductA(); virtual AbstractProductB* CreateProductB(); };
// Created on: 1991-10-04 // Created by: Remi GILET // 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 GNU Les...
#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...
// // Created by fab on 31/08/2020. // #include "../../headers/debug/DebugDraw.hpp" DebugDraw* DebugDraw::instance = nullptr; void DebugDraw::DrawLine(glm::vec3 from, glm::vec3 to, glm::vec3 color) { if(shaderDebug == nullptr) { shaderDebug = new Shader("shaders/debug/"); } if(vbo == nullptr...
#ifndef GSHARE_PREDICTOR_H #define GSHARE_PREDICTOR_H #include <vector> #include <stdint.h> #include "simulator.h" #include "branch_predictor.h" #include "branch_predictor_return_value.h" #include "saturating_predictor.h" class GShareBranchPredictor : public BranchPredictor { public: GShareBranchPredictor(Strin...
#include "../lib/folium_of_Descartes.hpp" using namespace fancyCurve; int main() { foliumOfDescartes f; int a = 0; std::cout << "Hello, your folium of Descartes now is: "; f.print(); std::cout << "And you can:" << std::endl; do { std::cout << "0. Quit;" << std::endl; std::cout <...
// Ceres Solver - A fast non-linear least squares minimizer // Copyright 2015 Google Inc. All rights reserved. // http://ceres-solver.org/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistribution...
#include "Node.hpp" #include <tgmath.h> using namespace std; using namespace arma; Lattice::Lattice(int L,string initState,double temp){ srand(2); //seed dim = L; energyProb = vec(pow(dim,2)+1); if (initState == "alligned"){ energy = pow(dim,2)*2; magnetization = pow(dim,2...
#pragma once #include <Dot++/parser/ParserStatesPack.hpp> #include <Dot++/parser/TokenInfoHandle.hpp> #include <Dot++/parser/TokenStack.hpp> namespace dot_pp { namespace parser { template<class ConstructionPolicy> class Parser { public: Parser(ConstructionPolicy& constructor); ...
// Wed Aug 24 15:46:50 EDT 2016 // Evan S Weinberg // Include file for Variably Precondition GCR #ifndef ESW_INVERTER_VPGCR #define ESW_INVERTER_VPGCR #include <string> #include <complex> using std::complex; #include "inverter_struct.h" #include "verbosity.h" // Variably Preconditioned GCR: inversion_info minv_vect...
/* TouchKeys: multi-touch musical keyboard control software Copyright (c) 2013 Andrew McPherson This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
// // Created by Bowen Yang on 2021/1/30. // #include <iostream> #include "Cards.h" #include "CardsMain.h" using namespace std; int cards::main(){ Deck* deck = new Deck(4); Hand* hand = new Hand(deck); cout << *hand << endl; int n; cout << "please chose the card you want to pick (Enter 1 - 6): ";...
#include <sstream> #include "utility.h" jvmtiEnv *jvmti; void initialize(JNIEnv *env) { JavaVM *vm; env->GetJavaVM(&vm); vm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_0); jvmtiCapabilities capabilities = {0}; capabilities.can_tag_objects = 1; jvmti->AddCapabilities(&capabilities); } void ...
#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; char a[100100]; int next[100100]; int main() { int t,ca = 1; scanf("%d",...
#ifndef AVASERVICE_H #define AVASERVICE_H #include <QObject> #include <QMap> #include "udpfinderclient.h" #include "espdeviceinformation.h" class AvaService : public QObject { Q_OBJECT Q_PROPERTY(QList<QObject *> abonents READ abonents NOTIFY abonentsChanged) QList<UdpFinderClient*> m_finderClients; ...
// GameServer.cpp : Defines the entry point for the console application. // #define _WIN32_WINNT 0x0500 #include "Comms.h" BOOL CreateMyDACL(SECURITY_ATTRIBUTES * pSA) { // Define the SDDL for the DACL. This example sets // the following access: // Built-in guests are denied all access. // Anonymous logo...
// Traver_DLG.cpp : 实现文件 // #include "stdafx.h" #include "MFC综合实验.h" #include "Traver_DLG.h" #include "afxdialogex.h" // Traver_DLG 对话框 IMPLEMENT_DYNAMIC(Traver_DLG, CDialogEx) Traver_DLG::Traver_DLG(CWnd* pParent /*=NULL*/) : CDialogEx(IDD_DIALOG6, pParent) , str(_T("")) { } Traver_DLG::~Traver_DLG() { } voi...
#include<iostream> #include<string> using namespace std; string a,b; int main() {int t; while (cin >> a >> b) {t=a.find("_")+1; a.assign(a,t,a.length()-t); t=b.find("_")+1; b.assign(b,t,b.length()-t); cout << a << "_small_" << b << endl; } return 0; }
#include "solver.h" double Solver::integrate(func function, double from, double to) { return function( (from + to) / 2. ) * (to - from); } vecvec Solver::calc_coefs() { double x_curr = step; vecvec res = { {}, {}, {0} }; // initial condition 1 for (size_t i = 0; i < n; i++) { if (x_curr < break_point) { ...
/********* * * Sujit Maharjan * * lab4 * problem 3 * * Write a class that can store Department ID and Department Name with constructors to initialize its members. Write destructor member in the same class and display the message "Object n goes out of the scope". Your program should be made such that it should s...
#include "LeagueItemSVM.h" #include "LeagueItemDatabase.h" #include "LeagueConstants.h" LeagueItemSVM::LeagueItemSVM(bool performTraining) : ImageSVM("LeagueItem", performTraining) { } LeagueItemSVM::~LeagueItemSVM() { } void LeagueItemSVM::LoadTrainingData() { LoadTraining(); } void LeagueItemSVM::CreateTrain...
#pragma once #ifndef __MODEL_H_ #define __MODEL_H_ //- Defines #define GL_ERROR() checkForOpenGLError(__FILE__, __LINE__) //-- Global Includes #include <string> #include <sstream> #include <vector> //-- Class Includes #include <CGLSLProgram.h> #include <Camera.h> #include <Projection.h> #include <Transformation.h> #...
#ifndef SJTU_HASH_TABLE #define SJTU_HASH_TABLE #include "exceptions.h" template<class V> class hash_table_t{ using point = long; V list[512]; public: hash_table_t(V ini = V()){ for (long i = 0;i < 512;i++) list[i] = ini; } ~hash_table_t(){} int get_value(const point code) const{ ...
/*********************************************************************** h:NoiseCamera ************************************************************************/ #pragma once namespace Noise3D { class /*_declspec(dllexport)*/ ICamera { public: void Destroy(); void SetLookA...
#include <iostream> #include "Logger.h" void log(const Error &error) { std::cout << "Error ::: " << error.getError() << std::endl; } void log(const Warning &warning){ std::cout << "Warning ::: " << warning.getWarning() << std::endl; }
#include "node.h" #include "linked_list.h" #include <iostream> using namespace std; //TODO// Error handle the value inputs //TODO// Check over the rubric /****************************************************** ** Program: LL_Test ** Author: Jacob Reger ** Date: 03/15/2020 ** Description: This program test the implem...
#ifndef DNA_ANALYZER_PROJECT_LIST_H #define DNA_ANALYZER_PROJECT_LIST_H //#include "../Paramcommand.h" #include "Icommand.h" class List:public IcontrolCommands { public: /*virtual*/~List(){} /*virtual*/std::string run(Iwriter &writer, Ireader& reader, dataDNA& containerDna, const Paramcommand& par...
#ifndef BINOMIALHEAP_BINOMIALHEAP_CPP #define BINOMIALHEAP_BINOMIALHEAP_CPP #include <memory> class BinomialHeap{ private: class Buffer; class Node; public: class ManipulationPointer{ public: friend class BinomialHeap; ManipulationPointer(): buffer(nullptr) {} ~Manipulati...
/************************************************************************************** * File Name : Texture.cpp * Project Name : Keyboard Warriors * Primary Author : JeongHak Kim * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights reserved." ...
#ifndef COMMON_SRC_SINGLETONHELPER_H #define COMMON_SRC_SINGLETONHELPER_H #include "Uncopyable.h" namespace common { namespace util { /*! * \brief Helper class to provide singletons without adding boiler plate code to a class. */ template<typename T> class SingletonHelper : private Uncopyable { public: /*! ...
#pragma once #include "..\Common\Pch.h" #include "..\Graphic\Direct3D.h" #include "..\RenderResource\InputLayout.h" #include "Terrain.h" class Trunk : public InputLayout { public: Trunk(); ~Trunk(); void Initialize(Terrain* terrain, FLOAT scale); void Update(Frustum* frustum); void SetBuffer(); D3DXV...
/*Implmentation of string_common module.*/ #include "cc/algo/strings/string_common.h" #include "cc/shared/common.h" namespace cc_algo_strings { const char* get_next_null(const char* start) { RT_ASSERT(start); const char* result = start; while (result[0]) { ++result; } return result; } const char* get_...
#include "Erosion.hpp" using namespace ns_wtni; Erosion::Erosion( pluglink *p ) : plugin(p) { // Ajout des donnees en entree add_input( input, "image d'entrée" ); // Ajout des donnees en sortie add_output( output, "image de sortie" ); // Ajout des parametres taille_de_fenetre = 0; add_param( taille_de_fenetre, "...
#include <cmath> #include <cstdint> #include <cstdio> #include <cstdlib> #include <list> #include <string> #include <sys/time.h> #include <SDL/SDL.h> #include <macs/macs.hpp> #include <betelgeuse/betelgeuse.hpp> #ifndef M_PI #define M_PI 3.141592f #endif #define DOUBLE_BUF true #define RESOLUTION_X 1680 #define ...
#ifndef __GAME_SCENE_H__ #define __GAME_SCENE_H__ #include "cocos2d.h" #include "AppValues.h" #include "Stone.h" #include "StartLayer.h" class Stone; class GameScene : public cocos2d::Layer { public: // there's no 'id' in cpp, so we recommend returning the class instance pointer static cocos2d::Scene* create...
#include <cstdio> #include <iostream> #include <algorithm> using namespace std; int n, m; int main() { freopen("test.in", "r", stdin); freopen("test.out", "w", stdout); scanf("%d%d", &n, &m); for (int i = 1; i < n; ++i) { cout << i << " " << i + 1 << " " << 1 << endl; --m; } int inf = 1000002; for (int...
#pragma once #include <vector> #include "basicValues.h" #include "container.h" namespace json { class Array; class ArrayValue : public AbstractArrayValue, public Container<PValue> { public: typedef Container<PValue>::AllocInfo AllocInfo; ArrayValue(AllocInfo &info); virtual std::size_t size() const ov...
#ifndef _JVG_H #define _JVG_H class JvGame; class JvState; class JvCamera; class JvSave; class JvJoystick; /** *在这里放一些全局函数,全局对象 */ class JvG { public: /** *设置全局数据 *@param JvGame* jvGame,JvGame的指针 *@param unsigned int Width,屏幕宽 *@param unsigned int Height,屏幕高 *@return void */ static void setGameData(JvG...
/* * nullptr.cpp * * Created on: May 10, 2016 * Author: bakhvalo */ #include "gtest/gtest.h" #include <type_traits> int foo(int) {return 1;} int foo(bool) {return 2;} int foo(void*) {return 3;} TEST(NullptrUnitTest, NULL_calls_int_overload) { ASSERT_EQ(1, foo(0)); //ASSERT_EQ(1, foo(NULL)); not compi...
#include <bits/stdc++.h> using namespace std; #define MAX_ITERS 10000000 double Rand(double l, double r) { return l + (r - l) * rand() * 1.0 / RAND_MAX; } double GetCal() { srand(time(NULL)); int num = 0; for(int i = 0; i < MAX_ITERS; i++) { double x = Rand(1.0, 2.0); double y = Rand(0, 1.0); if(1/x...
#pragma once #include <Tanker/Crypto/BasicHash.hpp> #include <Tanker/Crypto/EncryptedSymmetricKey.hpp> #include <Tanker/Crypto/EncryptionKeyPair.hpp> #include <Tanker/Crypto/Hash.hpp> #include <Tanker/Crypto/PublicEncryptionKey.hpp> #include <Tanker/Crypto/PublicSignatureKey.hpp> #include <Tanker/Crypto/SealedPrivateE...
/* TouchKeys: multi-touch musical keyboard control software Copyright (c) 2013 Andrew McPherson This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
#ifndef __DECLLIPSYNC_H__ #define __DECLLIPSYNC_H__ // A way of cross referencing strings and sound shaders // RAVEN BEGIN // jsinger: added to support serialization/deserialization of binary decls #ifdef RV_BINARYDECLS class rvDeclLipSync : public idDecl, public Serializable<'RDLS'> { public: virtual void Write( S...
#pragma once #include "cdisccontroller.h" #include "CParams.h" #include "CDiscCollisionObject.h" #include <cmath> #include <vector> typedef unsigned int uint; class CQLearningController : public CDiscController { private: uint _grid_size_x; uint _grid_size_y; std::vector<std::vector<std::vector<double> > > Qmatrix...
#include "plot-panel.h" #include "cmath-ex.h" #include <vector> #include <algorithm> enum { wxID_DRAW = 1 }; BEGIN_EVENT_TABLE(PlotPanel, wxPanel) // some useful events /* EVT_MOTION(PlotPanel::mouseMoved) EVT_LEFT_UP(PlotPanel::mouseReleased) EVT_LEAVE_WINDOW(PlotPanel::mouseLeftWindow) EVT_KEY_DOWN(PlotPa...
#include "Load.h" #include "AddSmplAssign.h" #include "AddVarAssign.h" #include "AddSOAssign.h" #include "AddStart.h" #include "AddEnd.h" #include "AddRead.h" #include "AddWrite.h" #include "AddCondition.h" #include "AddConnector.h" #include "EditConnector.h" #include "EditStatement.h" #include "AddComment.h" #include...
// you can use includes, for example: #include <algorithm> // you can write to stdout for debugging purposes, e.g. // cout << "this is a debug message" << endl; int calc_block_need(int target_minmax_sum, vector<int> &A){ int block_no = 1; int pre_block_sum = A[0]; for (int i=1; i<A.size(); ++i){ if...
#ifndef NODE_H #define NODE_H #include <QGraphicsItem> #include <QGraphicsTextItem> #include <QList> #include <QPen> #include "../../framework/ProcessingStep.hpp" #include "../framework/GUIEventDispatcher.hpp" namespace uipf{ namespace gui{ class Edge; class GraphWidget; /*QT_BEGIN_NAMESPACE class QGraphicsSceneMou...