text
stringlengths
8
6.88M
// // AcidAudioBuffer.cpp // SRXvert // // Created by Dennis Lapchenko on 04/05/2016. // // #include "AcidAudioBuffer.h" using namespace AcidR; AcidAudioBuffer::AcidAudioBuffer() { } AcidAudioBuffer::~AcidAudioBuffer() { } void AcidAudioBuffer::PeakNormalise(float maxPeak, float threshold) { float peakGain...
#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 maxn = 210; int maze[maxn][maxn]; int gap[maxn],dis[maxn],pre[maxn],cur[...
#include "stdafx.h" #include "Act_Blizzard.h" #include "../Monster.h" #include "ACTEffect.h" #include "../../GameData.h" Act_Blizzard::Act_Blizzard() { m_ActionId = enBlizzard; } Act_Blizzard::~Act_Blizzard() { } bool Act_Blizzard::Action(Monster* me) { if (m_target == nullptr) return true; if (m_first) { if (...
// Example 2_2 : Initialization, move, swap, auto, decltype // Created by Oleksiy Grechnyev 2017 #include <iostream> #include <string> int main(){ using namespace std; { cout << "5 forms of initialization" << endl; // No copy/move/assignment here, only 1 object created by ctor each time ...
#include "pch.h" #include "Mesh.h" #include "RenderDevice.h" #include "Core\FileUtils.h" Hourglass::Mesh::Mesh() : m_AabbScale(1.0f) { } void Hourglass::Mesh::Serialize(FileArchive& archive) { archive.EnsureHeader("HMDL", 4); archive.Serialize(m_Type); archive.Serialize(PositionArray); archive.Serialize(UV0Ar...
#ifndef Q_COMMON_FUNCTIONS #define Q_COMMON_FUNCTIONS 1 /* C includes for time retrival */ #include <stdio.h> #include <sys/timeb.h> #include <time.h> namespace qEngine { char* returnCurrentTime() { //TODO: Figure out why struct __timeb64 timebuffer; char *timeline; char *timeOutput = NULL; _ftime64( &ti...
/** * @file np_arctan2_arcsinh_f4_combi_hw.cc * @author Gerbrand De Laender * @date 19/04/2021 * @version 1.0 * * @brief E091103, Master thesis * * @section DESCRIPTION * * Combined component including: * - Element-wise arc tangent of x1/x2 choosing the quadrant correctly. * - Inverse hype...
#include "Mage.h" const WeaponType Mage::type = WeaponType::dark; Mage::Mage(string name):Character() { setHealth(16); setStrength(0); setMagic(3); setSkill(1); setSpeed(3); setLuck(0); setDefense(2); setResistance(3); setMovement(6); setName(name); setExp(0...
#include <algorithm> #include <iterator> #include <numeric> #include <limits> #include <iostream> #include <utility> #include <cmath> #include "DP_multiprec.hpp" cpp_dec_float_100 DPSolver_multi::compute_score_optimized(int i, int j) { cpp_dec_float_100 score = a_sums_[i][j] / b_sums_[i][j]; return score; } cpp_...
class Solution { private: long long splitArray(int pos, int m, vector<int>& nums, vector< vector<long long> >& DP){ if(DP[m][pos]) return DP[m][pos]; int N = nums.size(); // found a solution if(pos == N && m == 0) return 0; // no solution here if(pos == N ...
/* -*- 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 WEBSERVER_ADVANCE...
#pragma once #include <vector> #define LAYA_MARKER (JPEG_APP0 + 2)//ICC #define LAYA_PROFILE "LAYA_PROFILE" #define LayaMin(x,y) (((x) < (y)) ? (x) : (y)) struct ImageJPEG { int width = 0; int height = 0; char* buffer = nullptr; ~ImageJPEG() { if (buffer) { delete[] ...
#include <stdio.h> #include <math.h> #define A 2 #define B 42 int main(void) { double x, y; printf("Please, type x: "); scanf("%lf", &x); y = (B*A)*sqrt(A*x*log10(A + x)) + pow(M_E, (A*x)); putchar('\n'); printf("x = %.4f\n", x); printf("y = %.4f \n", y); putchar('\n'); return 0;...
// Copyright 2015 Stef Pletinck // License: view LICENSE file #ifndef EPCAMERA_H #define EPCAMERA_H // SFML includes #include <SFML/Graphics.hpp> // C++ includes // My includes class EpCamera { private: // Absolute position of camera // (number of pixels from origin) sf::Vector2f position; // Coordinates ...
#include <iostream> using namespace std; namespace std{ int f(int a, int b){ return a>b?a:b; } } struct testa{ char a; short b; }; int main(void){ cout << "Size of int: " << sizeof(int) << endl; cout << "Size of char: " << sizeof(char) << endl; cout << "Size of bool: " << sizeof(bool) << endl; cout << "Si...
#include <iostream> #include <unordered_map> #include <unordered_set> #include <vector> #include <sstream> #include <algorithm> #include <cctype> using namespace std; class WordFreq{ public: WordFreq(string input) : s(input) { transform(s.begin(), s.end(), s.begin(), [](unsigned char c) -> uns...
/* -*- 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 "ExtensionsModel.h" #include "adj...
int vis[MAXN]; int dfn[MAXN],low[MAXN]; int dfc; bool iscut[MAXN]; //bool brg[MAXN][MAXN]; int maxs=0; vector<pii> edges[MAXN]; void cut_brg(int cur,int fa) //适用于没有重边的图 { vis[cur] = 1; dfn[cur] = low[cur] = ++dfc; int child = 0; int cuts = 0; feach(edges[cur],p) { int to = p->x; ...
////////////////////////////////////////////////////////////////////// ///Copyright (C) 2011-2012 Benjamin Quach // //This file is part of the "Lost Horizons" video game demo // //"Lost Horizons" is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published ...
#include<bits/stdc++.h> using namespace std; int main() { int x,y,rem; cin>>x>>y; if(x == y) { cout<<"O JOGO DUROU 24 HORA(S)\n"; } else if(x>y) { rem = 24-x; rem = rem+y; cout<<"O JOGO DUROU "<<rem<<" HORA(S)\n"; } else if(x<y) { rem = y-x...
#include "topicTree.h" #include "frame.h" #include "util.h" #include <map> #include <vector> TopicNode::TopicNode(std::string part, std::string fPath) : name(part), nodes(), fullPath(fPath), retainMessage(""), retainQoS(0), subscribers() {} TopicNode::~TopicNode() { for (std::map<std::string, TopicNode*>::iterato...
#include <fstream> #include "psef22_8_opt.h" int main() { ofstream in_pix("input_pixels_regression_result_psef22_8_opt.txt"); ofstream fout("regression_result_psef22_8_opt.txt"); HWStream<hw_uint<128> > in_update_0_read; HWStream<hw_uint<128> > psef22_8_update_0_write; // Loading input data // cmap : ...
#ifndef DESIGNPATTERN_OBSERVER_IOBSERVER_H_ #define DESIGNPATTERN_OBSERVER_IOBSERVER_H_ #include "common.h" #include <string> namespace DesignPatter { interface IObserver { virtual bool Update(const std::string& data) = 0; }; } #endif
#include <iostream> #include <string> #include <map> using namespace std; int main(int argc, const char *argv[]) { map< string,int > word_count; string str; while(cin >> str) { ++word_count[str]; } for (map<string,int>::iterator map_iter = word_count.begin(); map_iter != word_count.end(); ++map_iter) { cou...
#ifndef FRAME_H #define FRAME_H #include "slaveslam/camera.h" #include "slaveslam/common_include.h" namespace slaveslam { class Frame { public: typedef std::shared_ptr<Frame> Ptr; unsigned long id_; double time_stamp_; SE3 T_c_w_; Camera::Ptr camera_; Mat col...
#include <iostream> #include <cstdlib> #include <cassert> #include <cstdlib> #include <cstdlib> #include <cassert> #include <cstdlib> #include <cassert> // #template random.h: do not remove this line int rand32() { return (int(rand()) << 20) ^ (int(rand()) << 10) ^ int(rand()); } LL rand64() { return (LL(rand...
// Copyright (c) 2017 Mozart Alexander Louis. All rights reserved. // Includes #include "data_utils.hxx" #include "xxhash/xxhash.h" void DataUtils::initDatabase() { // Get database instance. const auto db = getDatabase(); // Creating the main sqlite statement to create the tables if they haven't been created y...
// // Created by Brady Bodily on 2/3/17. // #ifndef ANALYSTCOMPARER_ANALYST_HPP #define ANALYSTCOMPARER_ANALYST_HPP #include <string> #include <vector> #include "History.hpp" class Analyst { private: std::string m_name; std::string m_initials; History m_history; public: Analyst(std::string name, st...
#include <petunia/ipc_medium_default.h> #include <petunia/petunia.h> #include <petunia/osutils.h> #include <assert.h> #include <sqlite3/CppSQLite3.h> #define CHANNEL_FILE_EXTENSION ".ipc.db" #define MAX_CHANNEL_DELETE_TRIES 1 namespace Petunia { class IPCInternalMedium : public IPCMedium { public: IPCInte...
#ifndef SOBELFILTER_H #define SOBELFILTER_H #include "iimageexpander.h" #include "iimagefilter.h" class SobelFilter : public IImageFilter { public: SobelFilter(); QImage *process(IImageExpander *expander, QImage *img) override; private: IImageExpander *expander; }; #endif // SOBELFILTER_H
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2003 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef _FIND_TEXT_DIALOG_H #define _FIND_TEXT_DIALOG_H #include...
/* -*- 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. ** */ #include "core/pch.h" #if defined(SELFTEST) #include "modu...
#include <iostream> #include <conio.h> #include <cctype> #include "board.h" using namespace std; Board::Board() { // initialize board board = InitBoard(); bEnpassantW = bEnpassantB = true; turn = 0; pawnCountW = pawnCountB = 8; bishopCountW = bishopCountB = 2; knightCountW = knightCountB = 2; rookCountW = ro...
#include "Renderer.h" #include "imgui.h" #include "imgui_impl_dx11.h" using namespace DirectX; Renderer::Renderer( Microsoft::WRL::ComPtr<ID3D11Device> device, Microsoft::WRL::ComPtr<ID3D11DeviceContext> context, Microsoft::WRL::ComPtr<IDXGISwapChain> swapChain, Microsoft::WRL::ComPtr<ID3D11RenderTargetView> back...
#pragma once #include <Eigen/Dense> #include <iostream> #include <vector> namespace tools::linalg { struct SolverData { double relative_residual = 0; double initial_algebraic_error = 0; double algebraic_error = 0; size_t iterations = 0; bool converged = false; }; enum StoppingCriterium { Relative, Algebra...
#ifndef __IVIEW_FAV_H #define __IVIEW_FAV_H #include "IViewWindow.h" #include "ModelBrowserData.h" #include "IViewFilterList.h" namespace wh { //----------------------------------------------------------------------------- class IViewFav: public IViewWindow { public: virtual void SetBeforeUpdate(const std::vector<co...
#include "MacroManager.h" using namespace sc2; MacroManager::MacroManager() { } MacroManager::~MacroManager() { } Orders MacroManager::ThinkAndSendOrders(const sc2::ObservationInterface* observation) { Orders orders = Orders(); Units populationSize = observation->GetUnits(Unit::Alliance::Ally); int pop_size = ...
#pragma once #ifndef WEEK_H #define WEEK_H #include "Day.h" class Week { private: string date; vector<Day> week; //array of days, should probable change to an array public: string getDate() { return date; } void setDate(string date) { this->date = date; } Day getDay(string day); string toString...
#pragma once class Gt2DObject : public GtObject { GnDeclareRTTI; public: const static gint OBJECT_TYPE = 0; private: Gn2DMeshObjectPtr mpsMesh; GnSimpleString mGMFileName; guint m2DObjectType; public: Gt2DObject(void); ~Gt2DObject(void); public: bool SaveData(const gchar* pcBasePath = NULL); bool LoadData...
// // Created by manout on 18-3-25. // #include <numeric> #include <vector> #include <algorithm> using std::vector; using std::accumulate; using std::max; int double_core_process(vector<int>& data) { using Matrix = vector<vector<int>>; std::for_each(data.begin(), data.end(), [](int& a){a = a / 1024;}); i...
/* * File: main.cpp * Author: ovoloshchuk * * Created on March 9, 2011, 12:04 PM */ #include <stdlib.h> #include <cstring> #include <iostream> #include <string> #include <fstream> #include <stdio.h> #include "Reader.h" #include "KMeans.h" #include "Upgma.h" #include "EuclidMetric.h" #inclu...
#include "nv/lines.h" #include <gtest/gtest.h> TEST(nv_lines, init) { nv_lines lines; nv_lines_init(&lines); ASSERT_NE(nullptr, lines.data); ASSERT_LT(0, lines.capacity); ASSERT_EQ(0, lines.size); nv_lines_cleanup(&lines); } TEST(nv_lines, add) { nv_lines lines; nv_lines_init(&line...
#include <iostream> #include "../code/Scope.h"
#define ANNDLL_EXPORTS #include "NeuralRealisation.h" using namespace std; NeuralRealisation::NeuralRealisation(vector<size_t> conf, ANeuralNetwork::ActivationType aType, float scale) { this->configuration = conf; this->activation_type = aType; this->scale = scale; if (conf.empty()) return; } NeuralRealisation...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 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 DESKTOP_OP_DROP_D...
#include <glad/glad.h> #include <GLFW/glfw3.h> #include <iostream> void WindowResize(GLFWwindow* window, int width, int height); int main() { // main window setings GLFWwindow* window = nullptr; unsigned int window_width = 800; unsigned int window_height = 600; const char* window_name = "EdgaEngine2D"; const char*...
#include "core/pch.h" #ifdef IRC_SUPPORT #include "chattersmodel.h" #include "adjunct/m2/src/engine/chatinfo.h" #include "adjunct/m2/src/engine/message.h" #include "adjunct/m2/src/engine/engine.h" #include "adjunct/m2/src/engine/store.h" #include "adjunct/quick/hotlist/HotlistManager.h" #include "adjunct/quick/hotli...
#include "profit.h" #include "ui_profit.h" #include<rone.h> profit::profit(QWidget *parent) : QDialog(parent), ui(new Ui::profit) { ui->setupUi(this); } profit::~profit() { delete ui; } void profit::on_pushButton_clicked() { hide(); rone s; s.setModal(true); ...
#include<iostream> #include<cstdio> #include<cstring> #define fo(i,u,d) for (long i=(u); i<=(d); ++i) #define min(u,d) (u)<(d)?(u):(d) using namespace std; const long maxn=5100; const long maxm=100010; const long inf=1000000000; long head[maxn],next[maxm],node[maxm],tt; long c[maxm],cost[maxm]; //残留网,边费用 ...
#include <stdio.h> #include"mytcp.h" #include <string.h> #include <stdlib.h> #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <algorithm> using std::min; bool strcmp1(const char *,const char *); int main(){ char buff[100]; char ret_msg[100]; tcp_client client; client.init("127...
#ifndef MIANVIEW_H #define MIANVIEW_H #include <QWidget> #include <QStandardItemModel> #include <QSqlTableModel> #include <QMessageBox> #include <adddata.h> #include <databases.h> namespace Ui { class MianView; } class MianView : public QWidget { Q_OBJECT public: explicit MianView(QWidget *...
// Created on: 2002-12-12 // Created by: data exchange team // 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...
//prime number #include<iostream> using namespace std; int main(){ int n; cin>>n; int m=n/2; int flag=0; for(int i=2;i<=m;i++) { if(n%i==0) { cout<<"Not prime"; flag=1; break; } } if(flag==0) { cout<<"Prime"; } return 0; }
#include<bits/stdc++.h> using namespace std; vector<int> merge(int arr1[],int arr2[],int n1,int n2) { int i=0,j=0; vector<int> v; while(i<n1 && j<n2) { if(arr1[i]<=arr2[j]){v.push_back(arr1[i]);i++;} else{v.push_back(arr2[j]);j++;} } while(i<n1){v.push_back(arr1[i]);i++;} ...
#pragma once #include "plbase/PluginBase.h" #include "CTaskComplex.h" #include "CAiTimer.h" #pragma pack(push, 4) class PLUGIN_API CTaskComplexKillPedOnFoot : public CTaskComplex { public: unsigned __int8 m_nFlags; class CPed *m_pTarget; unsigned __int32 m_dwAttackFlags; unsigned __int32 m_dwActionDelay...
#ifndef GNTEXTURE_H #define GNTEXTURE_H #include "GnTextureMap.h" class GnTexture : public GnObject { GnDeclareRTTI; GnDeclareStream; protected: static gchar msTextureWorkPath[GN_MAX_PATH]; GnTextureMap* mpTextureMap; GnSimpleString mFileName; guint mWidth; guint mHeight; public: GnTexture(); virtual ~Gn...
#include<iostream> #include<vector> #include<algorithm> #include<map> #include<set> #include<stack> using namespace std; class Solution { public: vector<double> res; //最后返回的结果 map<string,int> vex; //顶点string转化为int映射,方便用连接矩阵存储有向加权图 vector<vector<double>> arc; //连接矩阵表示有向加权图 vector<double> calcEquation(...
#include<iostream> #include<vector> #include<unordered_map> using namespace std; string addUp2K(vector<int> list, int k){ unordered_map<int, bool> hash; for(int i:list){ if (hash[k-i]){ cout<<"numbers are "<<i<<","<<k-i<<endl; return "true"; } else hash[i] = true; } return "false...
// // Created by fab on 05/12/2020. // #include "../../../headers/components/IComponent.hpp" #include "../../../headers/components/rendering/SkyBox.hpp" void SkyBox::start() { IComponent::start(); } void SkyBox::draw() { IComponent::draw(); } void SkyBox::drawInspector() { IComponent::drawInspector(); }...
/* Copyright 2021 University of Manchester Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http: // www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
/*********************************************************************** ÀࣺNOISE SceneManger ¼òÊö£ºCenter of many manager object£¨MESH,LIGHT,MATERIAL,TEXTURE...£© ************************************************************************/ //!!!!!!!!!IMPORTANT : when a new class n...
/***************************************************************************************************************** * File Name : DetectLoopInLL.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\linkedlist\page04\DetectLoopInLL.h * Created on : Dec 18, 2013 :: 1:17:36 AM...
#pragma once #include "cq.h" #include "kmerutil.h" namespace bns { class CircusEnt { circ::deque<char> q_; uint8_t counts_[4]; uint8_t cqsz_; const uint8_t qsz_; const double qszinv_; public: static constexpr double NOT_FULL = -1.; CircusEnt(unsigned qsz): q_(qsz), counts_{0}, c...
#ifndef SCHEME_VALUES_ATOM_HPP #define SCHEME_VALUES_ATOM_HPP #include "Utils.hpp" #include <memory> #include <string> class Scheme_value; class Environment; class Symbol { public: explicit Symbol(const std::string& atom); std::string as_string() const; private: std::string name; }; #endif // SCHEME_VALUES...
/* * Program: Blending.h * Usage: Blend result images into one stitched image */ #ifndef BLENDING_H #define BLENDING_H #include <iostream> #include <vector> #include "CImg.h" using namespace std; using namespace cimg_library; class Blender{ public: Blender(CImg<unsigned char>& src1, CImg<unsigned char>& src2); CIm...
#pragma once #ifndef CITY_H #define CITY_H #include <string> #include <vector> #include "Flight.h" using namespace std; class City { public: City(string city) : myCity(city) {}; void addflight(City* end, int mile, int price) { Flight toPlace(this, end, mile, price); outflights.push_back(toPlace)...
#include <AssetsManager.h> #include <TexturesManager.h> #include <ShadersManager.h> #include <FontsManager.h> #include <OGLML/Texture2D.h> #include <OGLML/Shader.h> #include <OGLML/Font.h> #include <cassert> using namespace breakout; AssetManager::AssetManager() { } AssetManager::~AssetManager() { UnloadAll(); ...
#include <iostream> // knapsack #include "knapsackP.h" #include "knapsack.h" // TSP #include "route.h" #include "tsp.h" // real function #include "real_function.h" #include "real_vector.h" #include "EA.hpp" template <typename problem_class, typename solution_class> void solve_problem(size_t problem_size){ // Cre...
#include "Timer.h" #include "RobotException.h" Timer::Timer() : nextID(1), timerHandle(NULL), time(0), repeat(false) {} Timer::~Timer() { if(mTimer.lock() != WAIT_OBJECT_0 || mHook.lock() != WAIT_OBJECT_0) throw RobotException("Timer destructor could not get locks!");; stop(); disconnect(); } T...
#ifndef ACCESSMODEL_H #define ACCESSMODEL_H #include "adjunct/m2/src/include/defs.h" #include "adjunct/m2/src/engine/listeners.h" #include "adjunct/desktop_util/treemodel/optreemodel.h" class AccessModel; /*********************************************************************************** ** ** AccessModelItem ** *...
// // LearnedLTFOS.hpp // GA // // Created by Tom den Ottelander on 09/12/2019. // Copyright © 2019 Tom den Ottelander. All rights reserved. // #ifndef LearnedLTFOS_hpp #define LearnedLTFOS_hpp #include <stdio.h> #include <vector> #include <unordered_set> #include <unordered_map> #include <set> #include "FOS.hpp"...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <sys/stat.h> #include <semaphore.h> #include <sys/types.h> #include <sys/mman.h> #include <csignal> #include <unistd.h> #include <errno.h> using namespace std; #define INTVAL 1 #define ERR -1 #define SHMBUFFLEN 256 sem_t *sem; i...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #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>...
// Created on: 1996-04-01 // Created by: Flore Lantheaume // Copyright (c) 1996-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<iostream> using namespace std; main(){ int size=10; int values[size][size],a,o1[100],i,j,max=0,k1,k2,num=0; for(i=0;i<size;i++){ for(j=0;j<size;j++){ values[i][j]=0; } } while(1){ cout<<"1: Irmeg nemeh, 2: Irmeg hasah, 3: Oroi nemeh, 4:Oroi hasah, 5: hewl...
#include "block.h" #include "visitor.h" Block::Block(Variable_list* _v_list, Statement_list* _s_list) : v_list(_v_list), s_list(_s_list) {} void Block::Accept(AbstractDispatcher& dispatcher) { dispatcher.Dispatch(*this); } Block::~Block() { if (v_list != NULL) delete v_list; if (s_list != NULL) ...
#include "Material.h" using namespace std; Material::Material(float aR, float aG, float aB, float dR, float dG, float dB, float sR, float sG, float sB, int P, float rR, float rG, float rB){ ambR = aR; ambG = aG; ambB = aB; difR = dR; difG = dG; difB = dB; speR = sR; speG = sG; speB = sB; s...
#include<iostream> using namespace std; int findMxmRecurrsion(int arr[], int length) { if(length == 1) return arr[0]; return max(findMxmRecurrsion(arr,length-1),arr[length-1]); } int findMimRecurrsion(int arr[], int length) { if(length == 1) return arr[0]; return min(findMimRecurrsion...
// arr == &arr[0] // *arr == arr[0] // ptr + 1 == ptr에 sizeof(*ptr)를 더한 값 #include <iostream> int main(){ int arr[2][3] = {{1,2,3},{4,5,6}}; // 3개짜리 일차원 배열을 가르키는 포인터 int(*ptr)[3] = &arr[0]; // arr == &arr[0] for(int i=0; i<2; i++){ for(int j=0; j<3; j++){ printf("%d ", ptr[i][j]); } } pr...
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Alexander Remen (alexr@opera.com) * */ #include "core...
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. #pragma once #include "EngineMinimal.h" #include "Modules/ModuleManager.h" UENUM(BlueprintType) enum class ECharacterState : uint8 { PREINIT, LOADING, READY, DEAD //NODAMAGE? -> 이건플래그로두는게낫나 }; class FSYCharacterModule : public IModul...
#include "var.hpp" #ifndef VECTOR_HPP #define VECTOR_HPP class Vector{ protected: int size; int countForPush; int countForPop; Var* vector; public: Vector(); Vector(Vector& vec); Vector(Vector&& vec); ~Vector(); Vector(int n, Var fill); int getSize(); Var* getVecto...
class Point; class PointManagement { public: double getDistance(Point& a, Point& b); }; class Point { public: Point(double xx, double yy); friend double PointManagement::getDistance(Point& a, Point& b); private: double x, y; };
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/carakan/src/builtins/es_builtins.h" #ifdef ES_DEBUG_BUILTINS #include "modules/ecmascript/carakan/src/built...
#pragma once #include<string> #include"Action.h" #include"MAction.h" #include<string> class Parser { Game* game; public: Parser(Game*); Game* getGame(); Action* parse(std::string str); };
/* * Creature.cpp * * Created on: Jun 27, 2017 * Author: root */ #include "Creature.h" #include "SvrConfig.h" CreatureObj::CreatureObj(eObjType type):Object(type),m_ID(-1) { } CreatureObj::~CreatureObj() { } void CreatureObj::Release() { Object::Release(); m_ID = -1; CreatureState state; m_Creatur...
class Solution { public: string removeOuterParentheses(string S) { string res; stack<char> st; for (int i=0 ; i<S.length(); i++) { if (S[i]=='(') { if (st.size()>0) res+=S[i]; st.push(S[i]); } else { if (st....
#ifndef AMVK_G_BUFFER_H #define AMVK_G_BUFFER_H #include "macro.h" #include "vulkan.h" #include "buffer_helper.h" #include "image_helper.h" #include "state.h" #include "fullscreen_quad.h" #include "camera.h" #include "timer.h" #include "utils.h" #include <cfloat> #include <array> #include <unordered_set> #include <...
#pragma once #include "StrID.h" #include <unordered_map> namespace Hourglass { class Entity; class EntityAssembler { public: /** * Get a fully assembled entity, given the name of * the pre-assembled entity type */ static Entity* GetAssembledEntity( StrID name ); /** * Get a fully assembled entity,...
#include"sensor.h" void Sensor::int_set(int i) { m_i = i; } int Sensor::int_get() { return m_i; }
#include <fstream> #include <memory> #include <stdexcept> #include <string> #include <SDL2/SDL_opengles2.h> #include "utils/utils.hpp" std::unique_ptr<std::string> get_file_contents(const char *filename) { std::ifstream in(filename, std::ios::in | std::ios::binary); if (in) { std::unique_ptr<std::str...
#include <iostream> #include <vector> #include <algorithm> #include <iterator> #include <sequtils.h> using namespace std; int main(int argc, char *argv[]) { vector<int> v1; populate_rand(v1, 10); print_seq(v1); iter_swap(v1.begin(), ++v1.begin()); print_seq(v1); iter_swap(v1.begin(), --v1.end()); ...
#include <stdio.h> #include<stdlib.h> /******************************** * * function init_matrix() * * arg * n inttype the matrix size n*n * *********************************/ int** init_matrix(int n){ int i,j; // temp rows; int **temp=(int**) malloc(n*sizeof(int*)); //temp columns for(i=...
#include <iostream> #include "custom_date.h" #ifndef __CUSTOM_PERSON_H__ #define __CUSTOM_PERSON_H__ using namespace std; string occupation_list[] = { "Unemployed", "Engineer", "Doctor", "Teacher", }; class Person { public: string get_name() const; // string get_occu...
/* $Id: QKDDisplay.cpp 631 2012-07-02 17:34:33Z lwy $ $URL: http://172.17.8.1/svn/QUESS/tags/QKDBench-2.2.1/QKDDisplay.cpp $ */ #include "stdafx.h" #include <afx.h> #include <math.h> #include "QKDDisplay.h" #include "QKDTimer.h" double QKDDisplay::LuaProcess(lua_State *pLua, unsigned char *pBuf, int startByte, int b...
class ItemWaterBottle : FoodDrink { scope = 2; model = "\dayz_equip\models\waterbottle_gear.p3d"; picture = "\z\addons\dayz_epoch\pictures\equip_waterbottle10oz_ca.paa"; displayName = $STR_EQUIP_NAME_12; descriptionShort = $STR_EQUIP_DESC_12; Nutrition[] = {0,0,1000,0}; infectionChance = 0.3; consumeOutp...
#include "dialog.h" #include <QtGui> #include <Qt> #include "server/KServer.h" #include "common/KWhiteList.h" #include <tchdb.h> #include <pthread.h> #include <time.h> #include <string> KServer newServer; pthread_t pt; Dialog::Dialog(QWidget *parent) : QWidget(parent) { this->userLogFile.InitLogCfg(LEVEL_DE...
#include <iostream> using namespace std; int main() { char ch; cout<<"请输入一个字母:"<<endl; cin>>ch; if(96<ch &&ch<123) switch(ch){ case 'a':cout<<"元音"<<endl;break; case 'e':cout<<"元音"<<endl;break; case 'i':cout<<"元音"<<endl;break; case 'o':cout<<"元音"<<endl;break; ...
#pragma once namespace aeEngineSDK { struct AE_UTILITY_EXPORT aeAABB { /*************************************************************************************************/ /* Constructors declaration /*************************************************************************************************/ public: a...