text
stringlengths
8
6.88M
// // SnappaUtil.h // Snappa // // Created by Sam Edson on 7/13/15. // Copyright (c) 2015 Sam Edson. All rights reserved. // #ifndef __Snappa__SnappaUtil__ #define __Snappa__SnappaUtil__ #include <stdio.h> #include <string> #include <vector> class SnappaUtil { public: static std::vector<std::string> &split...
#include "game.h" #include <sdl.h> int main(int argc, char* args[]) { Game game(new Engine()); game.Startup(); while (!game.Quit()) { game.Update(); } game.Shutdown(); return 0; }
#include "naive_dictionary.hpp" #include "tools.hpp" naive_dictionary::naive_dictionary(const std::initializer_list<std::string>& init) : m_set(init.begin(), init.end()) { } void naive_dictionary::init(const std::vector<std::string>& word_list) { m_set = std::set<std::string>(word_list.begin(), word_list.end()...
#include <iostream> #include <glad/glad.h> #include <GLFW/glfw3.h> int main() { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); GLFWwindow* window = glfwCreateWindow(800, 800, "OpenG...
#include "sx/ResFileHelper.h" #include <boost/filesystem.hpp> namespace sx { ResFileType ResFileHelper::Type(const std::string& filepath) { ResFileType type = RES_FILE_UNKNOWN; auto ext = boost::filesystem::extension(filepath); std::transform(ext.begin(), ext.end(), ext.begin(), tolower); if (ext == ".png" || ex...
/* moveniu 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. moveniu is distributed in the hope that it will be useful, but WITHOUT ANY ...
#pragma once #include <cstddef> #include "parameter_is_shared.hpp" #include "sum_template_parameters.hpp" namespace detail { template<typename Function, typename Integers, typename... Args> struct sizeof_shared_parameters_impl; template<typename Function, unsigned int... Integers, typename... Args> struct sizeo...
#include "precompiled.h" #include "component/poscomponent.h" #include "component/jscomponent.h" using namespace component; REGISTER_COMPONENT_TYPE(PosComponent, 1); #pragma warning(disable: 4355) // disable warning for using 'this' as an initializer PosComponent::PosComponent(entity::Entity* entity, const...
#include<bits/stdc++.h> using namespace std; using ll=long long; unordered_map<ll,int> mp; int main(){ int n; scanf("%d",&n); ll a; for(int i=0;i<n;i++){ scanf("%I64d",&a); mp[a]++; } ll ans=0; for(int i=-10;i<0;i++){ if(mp.count(i)&&mp.count(-i)){ ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2007 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" #ifdef SVG_SUPPORT #include "modules/svg/src/sv...
/** Copyright (c) 2016 Mozart Alexander Louis. All rights reserved. */ #ifndef __AUDIO_UTILS_HXX__ #define __AUDIO_UTILS_HXX__ #include "fmod_studio.hpp" #include "globals.hxx" /** * Map of audio instance pointers that use a a string to reference them. */ using AudioMap = unordered_map<string, FMOD::Studio::EventI...
#include "pch.h" GameServer::GameServer() { } GameServer::~GameServer() { } BOOL GameServer::Begin() { m_ServerConnector = new CServerConnector(); return TRUE; } BOOL GameServer::End() { delete m_ServerConnector; return TRUE; }
#include "clickablelabel.h" ClickableLabel::ClickableLabel(QWidget* parent, Qt::WindowFlags f) : QLabel(parent) { } ClickableLabel::~ClickableLabel() { } void ClickableLabel::mousePressEvent(QMouseEvent* e) { emit clicked(true); }
#ifndef _QMC5883_HPP_ #define _QMC5883_HPP_ #include <Wire.h> #define QMC_ADDRESS ((uint8_t)0x0D) #define OSR_512 ((uint8_t)0b00000000) #define OSR_256 ((uint8_t)0b01000000) #define OSR_128 ((uint8_t)0b10000000) #define OSR_64 ((uint8_t)0b11000000) #define RNG_2G ((uint8...
// #include <boost/multiprecision/cpp_int.hpp> // using boost::multiprecision::cpp_int; #include <bits/stdc++.h> using namespace std; // ¯\_(ツ)_/¯ #define f first #define s second #define mp make_pair #define pb push_back #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begi...
#pragma once #define _CRT_SECURE_NO_WARNINGS #ifndef _STDAFX_H #define _STDAFX_H #include <WS2tcpip.h> #include <Windows.h> #pragma comment(lib,"ws2_32.lib") #include <string> #include <iostream> #include <fstream> #include <sstream> #include <vector> #include <stack> #include <list> #include <map> #include <io.h> #...
#pragma once #include "pch.h" #include "VertexBuffer.h" #include "ConstantBuffer.h" #include "Shaders.h" #include "Timer.h" struct PS_FADE_BUFFER { XMFLOAT3 color; float alpha; }; class Transition { private: // Device ID3D11DeviceContext* m_dContext; // Constant Buffers ConstBuffer<PS_FADE_BUFFER> m_fadeCBu...
#include <cstdio> #include <cstdlib> #include <ctime> #include <unistd.h> #include <iostream> #include <vector> #include <ostream> #include <queue> #include <set> #include <algorithm> #include <cmath> using namespace std; #include "common.h" #include "marshal.h" #include "update.h" Mapa mapa; Stav stav; // vzdy so...
/* * 2013+ Copyright (c) Ruslan Nigatullin <euroelessar@yandex.ru> * All rights reserved. * * 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 * (at your ...
// Created on: 2016-04-07 // Copyright (c) 2016 OPEN CASCADE SAS // Created by: Oleg AGASHIN // // 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 publi...
// Fill out your copyright notice in the Description page of Project Settings. #include "Hypoxia.h" #include "Hammer.h" #include "EngineUtils.h" #include "PhysicsEngine/DestructibleActor.h" #include "Components/DestructibleComponent.h" void AHammer::BeginPlay() { Super::BeginPlay(); //for (TActorIterator<ADestruct...
/* Programación Orientada a Objetos PROYECTO 3 Ana Elisa Estrada Lugo A01251091 05/06/2020 */ #include <iostream> #include <string> #include <sstream> #include <fstream> #include "Reserva.h" #include "Disco.h" #include "Libro.h" #include "Software.h" using namespace std; int main() { //Declarac...
class Solution { public: int josephus(int n, int k) { if(n==1) return 1; return (josephus(n-1,k)+k-1)%n+1; } };
#ifndef CORE_SRC_CONFIGURATION_H #define CORE_SRC_CONFIGURATION_H #include "ConfigurationReader.h" namespace edlprovider { namespace core { /*! * \brief The Configuration class provides the read values for the application to use. */ class Configuration { public: /*! * \brief Configuration constructor. ...
#pragma once #include <QString> class ConstantStrings { public: static const QString averageRatio; static const QString brainCount; static const QString neuronPerBrain; static const QString loopPerCompute; static const QString mutationFrequency; static const QString mutationIntensity; sta...
#pragma once #include <windows.h> class Waitable { public: Waitable(HANDLE handle); virtual ~Waitable(); bool beWaited(); bool isSignaled(); HANDLE handle; }; class Semaphore: public Waitable { public: Semaphore(LONG initialCount, LONG maximumCount); bool dissipate(); bool accumulate()...
#pragma once #include "FwdDecl.h" #include "d3d11.h" #include "WinWrappers/ComPtr.h" #include "Keng/GPU/RenderTarget/ISwapChain.h" namespace keng::graphics::gpu { class SwapChain : public core::RefCountImpl<ISwapChain> { public: SwapChain(Device& device, const SwapChainParameters& params, ...
#include <iostream> bool checkNumber(int number) { if(1 == number || 2 == number || 3 == number) { return true; } else { for(int i = 2; i <= number/2; ++i ) { if(0 == number % i) { return false; } } } } int main() { int number; bool truefalse = true; std::cout<<"Mutqagrel tiv@ ->"; std::cin>>nu...
#pragma once #include "../../Toolbox/Toolbox.h" #include "Texture2D.h" namespace ae { class FramebufferAttachement; /// \ingroup graphics /// <summary> /// 2D multisample data that can be link to a shader to be rendered. /// </summary> class AERO_CORE_EXPORT TextureMultisample : public Texture2D { public: ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-1999 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/dom/src/domenvironmen...
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution { public: vector<vector<int>> generateMatrix(int n) { //基本思想:模拟旋转过程,从外往内按层模拟旋转输出,每一层输出四条边。 //对于这种螺旋遍历的方法,重要的是要确定上下左右四条边的位置,上边界和左边界都为layer也是层数,右边界和下边界都为n-layer。 vector<vector<int>> res(n, vector<int>(n, 0)); //cnt为填入的数字从...
#include "table.h" #include "system.h" /* Create a table to hold at most "size" entries. */ Table::Table(int size){ tableSize = size; tableLock = new Lock("tableLock"); table = (void**) new int[size]; for(int i = 0; i < size;i++){ table[i] = NULL; } } Table::~Table(){ for(int i = 0; i < tableSize; i++) { d...
// // Created by Brady Bodily on 4/19/17. // #ifndef ITAK_USERIPLIST_HPP #define ITAK_USERIPLIST_HPP #include "UserIP.hpp" #include <iostream> #include <fstream> #include <string> #include <vector> class UserIPList { private: std::vector<UserIP> AllIPs; public: UserIPList(std::ifstream* fin); void Print...
#include <cassert> #include <cmath> using namespace std; #include "gaussianbasisfunction.h" #include "kmeans.h" GaussianBasisFunction::GaussianBasisFunction(double _mean, double _variance) : mean(_mean), variance(_variance) { } QVector<double> GaussianBasisFunction::sample(QVector<double> xs) const ...
// // Created by OLD MAN on 2020/1/8. // //将一个数组中的值按逆序重新存放。例如,原来的顺序为 8,6,5,4,1。要求改为 1,4,5,6,8。 // //输入格式\ //输入为两行:第一行数组中元素的个数 n(1<n<100),第二行是 n 个整数(整数范围为 [−100,100]),每两个整数之间用空格分隔。 // //输出格式\ //输出为一行:输出逆序后数组的整数,每两个整数之间用空格分隔。 #include <iostream> using namespace std; int main(){ int n; cin>>n; int a[n]; f...
#include<malloc.h> #include<assert.h> #include<stdio.h> template<class T> class Vector { typedef int ptrdiff_t; //Vector的嵌套型别定义(参考vector源码) typedef T value_type;//存储的数据类型 typedef value_type* pointer;//可以指向存储的数据的指针 typedef value_type* iterator;//迭代器(与指针相同) typedef size_t size_type;//数据size的类型 typedef value_type& ...
////////////////////////////////////////////////////////////////////// // Interpolate.cpp // // 插值类 CInterpolate 的实现代码 // // 周长发编制, 2002/8 ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "Interpolate.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FI...
// Copyright Oliver Kowalke 2013. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TASKS_DETAIL_WORKER_OBJECT_H #define BOOST_TASKS_DETAIL_WORKER_OBJECT_H #include <boost/asse...
#include "valid_tracker.h" #include "utils.h" #include <algorithm> void ValidTracker::reset() { valid.clear(); std::vector<int> permutation(validNumbers.begin(), validNumbers.end()); std::random_shuffle(permutation.begin(), permutation.end()); std::copy(permutation.begin(), permutation.end(), std::inse...
#include <iostream.h> /* * Á´±í½á¹¹ * */ struct Node { int data; Node* next; }; class LinkList { public: LinkList() { Construct(); } virtual bool Construct(void); bool AddTo(int); bool Display(void) const; //bool Insert(); bool Delete(int); bool Destroy(void); const Node* GetHead(void) const; virtu...
vector<int> Solution::flip(string A) { //1 based indexing int n = A.size(); int start = 0, end = -1; int sum = 0, maxSum = INT_MIN; int ansStart = 0, ansEnd = INT_MAX; for (int i = 0; i < n; i++) { if (A[i] == '1') sum--; else sum++; if (sum ...
#pragma once #cmakedefine HAS_EXPERIMENTAL_FILESYSTEM #ifdef HAS_EXPERIMENTAL_FILESYSTEM # include <experimental/filesystem> namespace std_fs_impl = std::experimental::filesystem; #else # include <filesystem> namespace std_fs_impl = std::filesystem; #endif #cmakedefine KG_PLATFORM_WIN #cmakedefine KG_PLATFOR...
#pragma once #include <boost/core/demangle.hpp> #include <iomanip> #include <vector> #include "basis.hpp" namespace spacetime { template <class DblTreeIn, class DblTreeOut> auto GenerateSigma(const DblTreeIn &Lambda_in, const DblTreeOut &Lambda_out) { using OutNodeVector = std::vector<typename DblTreeOut::T0 *>; ...
// // tertura.cpp // opengl2 // // Created by Tiago Rezende on 4/2/13. // // #include "genTexture.h" #include <fstream> GenTexture::GenTexture() { fbo.allocate(512, 512, GL_RGBA); //camera.enableOrtho(); camera.setAspectRatio(1); camera.setPosition(0, 0, -1); camera.setFov(45.0); camera.loo...
// // Created by gurumurt on 10/18/18. // #ifndef OPENCLDISPATCHER_KERNELGRAPHS_H #define OPENCLDISPATCHER_KERNELGRAPHS_H #endif //OPENCLDISPATCHER_KERNELGRAPHS_H #include "headers.h" #include "globals.h" #include "../include/Importkernel.h" #include <iostream> // std::cout #include <utility> // std::pair #include...
template < class Executor, bool Symmetric, class BaseLhs, class TypesLhs, class BaseRhs = BaseLhs, class TypesRhs = TypesLhs, typename ResultType = void > class StaticDispatcher { typedef typename TL::DerivedToFront<TypesLhs>::Result TList; typedef typename TL::Head<TList>::Result He...
/* * @Author: shaoDong * @Version: 1.0 * @DateTime: 2018-07-16 10:31:04 * @Description: 反转字符串中的元音字符,使用set 结构 */ #include <iostream> #include <set> #include <string> using namespace std; // 编译使用g++ reverseVowel.cpp -o reverseVowel -std=c++11 set<char> vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * restriction, including wit...
/* * ============================================================================ * Name : DeviceInfoUtility.h * Author : Vinod Kumar K V (mailto:vin2kalks@gmail.com) * Version : 1.0.0b * Date Createed : 23/02/2007 * Date Modified : 23/02/2007 * Copyright : Copyright (c) 1999 - 2007 vin2ktalks. * (h...
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); screen = new Screen(this); connect(ui->pushButton_shot,SIGNAL(clicked()),this,SLOT(on_screenbtn_clicked())); connect(ui->push...
// class Solution { // public: // int lengthOfLongestSubstring(string s) { // int n = s.size(); // if( n == 0) return 0; // vector <int> cnt(400,0); // int i(0), j(0); // // cout << i << j; // cnt[s[0]]++; // int ans=1; // while(j!=n-1) { // ...
#pragma once #include "pch.h" #include "Exceptions.h" using namespace std; struct OrderMsg { OrderMsg(const string& symbol, int quantity) : symbol_(symbol), quantity_ {quantity} {}; // TODO Rename or override with << const string& ToString() const { return symbol_; }; // TODO implement static OrderMsg P...
// KEGIESDoc.h : CKEGIESDoc // #pragma once #include "resource.h" #include "myDocument.h" class CKEGIESDoc : public CDocument { public: myDocumentPtr m_doc; protected: // serialization CKEGIESDoc(); DECLARE_DYNCREATE(CKEGIESDoc) public: virtual BOOL OnNewDocument(); virtual BOOL OnOpenDocument(LPCTSTR lpszP...
/* Linked List Reverse Printing Challenge Using whatever programming techniques you know, write the cleanest possible function you can think of to print a singly linked list in reverse. The format for the node should be a struct containing an integer value, val, and a next pointer to the following node. */ #incl...
#include <iostream> #include <vector> int gcd(int a, int b) { while (b) { a %= b; std::swap(a, b); } return a; } int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); int n; std::cin >> n; int data[100]; while (n--) { int nn; ...
// // 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 Arjan van Leeuwen (arjanl) // #ifndef MAILBOX_COMMAND_H #define MAILBOX_COMMAND_H #include "adjunct/m2/src/backend/imap/commands...
#include<bits/stdc++.h> using namespace std; main() { long long int l, h, i, limit, value, count = 0, g=0, c=0, temp; while(scanf("%lld %lld",&l,&h)==2) { if(l==0 && h==0)break; temp = 0, g=0, c=0; if(l>h) { temp = l; l = h; h =temp; ...
#include<iostream> #include<vector> #include<algorithm> #include<set> #include<map> using namespace std; class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { //基本思想:双指针,与algo里面的set_intersection算法一致 vector<int> res; multiset<int> s1,s2; for(auto num...
#include "grille.hpp" #define WIDTH_BLOCKS 6 #define HEIGHT_BLOCKS 8 #define OFFSET_SCORE 180 #define SIZE_BLOCK 50 #define W_WIDTH ((WIDTH_BLOCKS) * (SIZE_BLOCK)) //20 * 6 #define W_HEIGHT ((HEIGHT_BLOCKS) * (SIZE_BLOCK) + (OFFSET_SCORE)) //20 * 8 struct retCheckGO { enum rettyp...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Простой Калькулятор v 0.6. The Simply Calculator // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include<iostream> using namespace std; int main() { char userSelection = 'y'; do { cout << "Калькулятор. Введите первое число" << endl; float firs...
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Soft...
#include "AABB.h" #include <Gizmos.h> #include "PhysicsMaterial.h" AABB::AABB(const vec2& pos, const vec2& vel, float width, float height, const vec4& colour, float mass, float friction, float elasticity, bool isKinematic) : RigidBody(eShapeType::AABB, pos, vel, 0, isKinematic, new PhysicsMaterial(friction, elasticit...
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ); template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } templat...
#pragma once namespace Hourglass { class PrimitiveRenderer; } class Health : public hg::IComponent { public: virtual int GetTypeID() const { return s_TypeID; } void LoadFromXML(tinyxml2::XMLElement* data); float GetValue() const { return m_Value; } void SetValue(float val) { m_Value = val; } void Init(); voi...
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/TextInputPrice.g.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Fuse.Animations.IResize.h> #include <Fuse.Binding.h> #include <Fuse.Controls.Panel.h> #include <Fuse.Drawing.ISurfaceDrawable.h> #incl...
#pragma once #include <Tanker/Entry.hpp> #include <Tanker/Trustchain/Actions/DeviceRevocation.hpp> #include <Tanker/Trustchain/DeviceId.hpp> #include <Tanker/Trustchain/UserId.hpp> #include <Tanker/User.hpp> #include <gsl-lite.hpp> #include <tconcurrent/coroutine.hpp> #include <cstdint> #include <tuple> #include <ve...
/* -*- Mode: c++; tab-width: 4; 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 Arjan van Leeuwen (arjanl) */ group "desktop_util.mailto"; include "adjunc...
#include "VnaCalStandard.h" using namespace RsaToolbox; #include <QTextStream> /*! * \class RsaToolbox::VnaCalStandard * \ingroup VnaGroup * \brief \c %CalStandard represents an RF calibration standard and its * associated properties * * A \c %CalStandard can be one or two port, of different connector ...
// Siva Sankar Kannan - 267605 - siva.kannan@student.tut.fi #include <iostream> #include <iomanip> #include <vector> #include <map> #include <string> #include "splitter.h" #include "fileread.h" #include "usercommands.h" //#include "global.h" using namespace std; // define function pointers /*-----------------------...
#include "Logger.h" #include "CoinConf.h" #include "hiredis.h" #include "Util.h" #include "GameApp.h" #include <vector> #include "StrFunc.h" using namespace std; static CoinConf* instance = NULL; CoinConf* CoinConf::getInstance() { if(instance==NULL) { instance = new CoinConf(); } return instance; } CoinConf::...
// // Transform.cpp // closedFrameworks // // Created by William Meaton on 12/05/2016. // Copyright © 2016 WillMeaton.uk. All rights reserved. // #include "Transform.hpp" Transform::Transform(){ } Transform::Transform(const Math::Vector2D& pos): position(pos){ } Math::Vector2D& Transform::getPos(){ ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;} #define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;} typedef long l...
#include "Model.h" #include "Window.h" // ベクトル struct vec { float x, y, z; }; bool Model::FileLoad(const char *name, GLuint &nv, GLfloat(*&pos)[3], GLfloat(*&norm)[3], GLuint &nf, GLuint(*&face)[3], bool normalize){ //OBJファイル読み込み std::ifstream file(name, std::ios::binary); // ファイルが開けなかったら戻る if (file.fail()) {...
#ifndef STRING_HPP #define STRING_HPP class String: public Var { public: std::string str; String(std::string str); std::string toString(std::string str); }; #endif
#include "Game.h" #define stripeImageWidth 32 Game::Game() { Init(); } void Game::Init() { ps = ParticleSystem(Point3(0, 0, 0), Point3(0, 0.001, 0), 0.1, 1000); surrounding = Surrounding(); cueBall = CueBall(); cue = Cue(); quaffles.clear(); bludgers.clear(); for (int i = 0; i < 6; i++) ...
#include <iostream> #include "11_SeqList.h" using namespace std; template <typename T> TSeqList<T>::TSeqList(int capacity) { pArray = new T[capacity]; this->capacity = capacity; this->len = 0; } template <typename T> TSeqList<T>::~TSeqList() { delete[] pArray; pArray = NULL; len = 0; capacit...
DoublyLinkedListNode* sortedInsert(DoublyLinkedListNode* head, int data) { DoublyLinkedListNode *temp=head, *temp2, *newNode=(DoublyLinkedListNode *)malloc (sizeof(DoublyLinkedListNode)); newNode->next=NULL; newNode->prev=NULL; newNode->data=data; ...
// Copyright (c) 2018 Mozart Alexander Louis. All rights reserved. // Includes #include "app_delegate.hxx" #include "engines/firebase/firebase_engine.hxx" #include "engines/fmod/fmod_engine.hxx" #include "engines/language/language_engine.hxx" #include "scenes/intro/intro_scene.hxx" #include "utils/data/data_utils.hxx"...
#include "stdafx.h" #include "Transform.h" Transform::Transform() :pParent(NULL), pFirstChild(NULL), pNextSibling(NULL) { bAutoUpdate = true; this->Reset(); if (this->bAutoUpdate) this->UpdateTransform(); } Transform::~Transform() { } void Transform::AddChild(Transform * pNewChild) { // 새로들어간 자식의 부모가 나면 리턴 ...
#include "CTransform.h" using Mat4D::CMatrix4D; using Mat4D::CVector4D; CTransform::CTransform() { Position.Identity(); Scaling.Identity(); RotationX.Identity(); RotationY.Identity(); RotationZ.Identity(); FinalRotation.Identity(); } CTransform::~CTransform() { } void CTransform::SetRotationX(float angle) { ...
#ifndef TREEFACE_TEXTURE_POST_SURFACE_H #define TREEFACE_TEXTURE_POST_SURFACE_H #include "treeface/post/PostSurface.h" #include "treeface/gl/Texture.h" #include <treecore/RefCountHolder.h> namespace treeface { /// /// \brief post process rendering surface on a texture /// /// It holds a 2D texture, or one side of ...
#include<stdio.h> int a,b,c,s=0; main() { scanf("%d",&c); a=c; while(a!=0) { b=a%10; a=a/10; s=s*10+b; } if(c==s) { printf("YES"); } else printf("NO"); }
#include <cstdint> namespace rd { namespace ch1 { /* * converts a binary number (specified as a uint64_t number with * only ones and zeros) to a nonnegative integer * Example: * binary_to_decimal<11010>::value is replaced by 26 */ template <uint64_t input> struct binary_to_d...
#include "CCWebView.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxWebView.h" #include "CCEGLView.h" #include "CCDirector.h" #include "CCFileUtils.h" namespace cocos2d { namespace webview_plugin { CCWebViewDelegate *CCWebView::s_pWebViewDelegate = NULL; CCWebView::CCWebView(void* obj){ mWebView = obj; } CCWebView...
#pragma once #include "jsvalue.h" #include "../spatial/rect_size.h" #include <boost/filesystem.hpp> #include <cef/cef_app.h> #include <cef/cef_client.h> #include <functional> #include <list> namespace Browser { class Browser; class Application : public CefApp, boost::noncopyable { public: class IJSObjecti...
#include "archiveextractor.h" ArchiveExtractor::ArchiveExtractor(QFileInfo& fileDest,QString& dir,QObject* parent) : QObject(parent), fileDest_(fileDest), dir_(dir) { } void ArchiveExtractor::run() { std::ifstream ifs(fileDest_.filePath().toStdString(), std::ios_base::in | std::ios_base::binary); boost::...
class AK_107_kobra { weight = 3.8; }; class AK_107_GL_kobra { weight = 5.3; }; class AK_107_pso { weight = 4; }; class AK_107_GL_pso { weight = 5.5; }; class AK107_Kobra_DZ { weight = 3.8; }; class AK107_GL_Kobra_DZ { weight = 5.3; }; class AK107_PSO_DZ { weight = 4; }; class AK107_GL_PSO_DZ { weight = 5.5; }; ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef _WINDOWSOPAUINSTALLER_H_ #define _WINDOWSOPAUINSTALLER_H_ #ifdef AUTO_UPDATE_...
//Chuong trinh an nut sang LED void setup() { // put your setup code here, to run once: //Cau hinh uart Serial.begin(9600); pinMode(31, INPUT_PULLUP); //Cau hinh chan 31 noi voi nut nhan,tro keo len pinMode(40,OUTPUT); //Cau hinh LED xanh (tren kit) la output } void loop() { // put your main code here, to...
#ifndef __DUSERDITOR_H #define __DUSERDITOR_H #include "BaseOkCancelDialog.h" #include "MUser2.h" #include "TPresenter.h" #include "DUserGroupEditor.h" #include "VUserPanel.h" namespace wh{ namespace view{ //----------------------------------------------------------------------------- /// Редактор для действия clas...
// // Application0.cpp // Odin.MacOSX // // Created by Daniel on 21/09/15. // Copyright (c) 2015 DG. All rights reserved. // #include "Application0.h" #include "Engine.h" #include "Camera.h" #include "Text.h" #include "BoxShape.h" #include "Math.h" #include "Material.h" #include "ResourceManager.h" #include "Re...
#include <vector> #ifndef IMG_H_ #define IMG_H_ class img { private: std::size_t width; std::size_t height; std::vector<unsigned int> massiv; unsigned int *GPU_img; void copy_to_GPU(); public: void filter(); img(const char *filename, std::size_t width, std::size_t height); img(std::size_t width, std::size_t he...
// Created on: 1993-06-23 // Created by: Jean Yves LEBEY // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
// Given 2 arrays of +ve integers, add their elements into new array using recursion // Eg: A = [23,5,2,7,87] B = [4,67,2,8] --> [27,72,4,15,87] #include<iostream> using namespace std; int c[10],k=0; void sum(int a[],int b[],int n1,int n2,int i,int j) { if(i == n1 && j == n2) return; if(i =...
#include <iostream> #include <vector> using namespace std; typedef long long ll; ll t, n, q, x, y, s[100001], diff[100001], ans; vector<int> pos[100001]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> t; for (int i = 1; i <= t; i++) { cout << "Case " << i << ":" << end...
#include "Game.h" #include <iostream> #include "Skills.h" #include "ColorStrings.h" #include <conio.h> #include "Window.h" #include "Texture.h" #include "MapDisplay.h" std::vector<Game::Object*> Game::objects; BioMap::map_t Game::map; void Game::main() { Window::init(); TextureManager::loadparts("b...
#include<bits/stdc++.h> #define fast ios_base::sync_with_stdio(false); cin.tie(0); #define rep(i,a,n) for(int i=a;i<n;i++) #define all(x) x.begin(),x.end() #define watch(x) cout<<#x<<" = "<<x<<endl; #define V(x) vector<x> #define P(x,y) pair<x,y> #define UMP(x,y) unordered_map<x,y> #define MP(x,y) map<x,y> #define pb ...
/* * PowerControllerMCB.cpp * File implementing the MCB power controller * Author: Alex St. Clair * February 2018 */ #include "PowerControllerMCB.h" PowerControllerMCB::PowerControllerMCB() { // pin setup and disable level wind at startup pinMode(MC2_ENABLE_PIN, OUTPUT); pinMode(MTR2_ENABLE_P...
using namespace std; string to_hex(unsigned char s); string sha256(string line);
#include "AIntervalService.hpp" AIntervalService::AIntervalService(boost::asio::io_service &ioService, std::size_t seconds) : _started(false), _timer(ioService), _interval(seconds) {} void AIntervalService::start() { if (this->_started) { return ; } this->_started = true; this->run(); } void AInt...