text
stringlengths
8
6.88M
/* * File: Row.cpp * Author: ovoloshchuk * * Created on March 9, 2011, 12:08 PM */ #include "Object.h" #include <memory.h> #include <stdio.h> Object::Object() { } Object::Object(int attributeCount) { _attributeCount = attributeCount; _attrValues = new float[attributeCount]; _attrValid = new bool...
#include <Adafruit_NeoPixel.h> #include "SpinningAnimation.h" SpinningAnimation::SpinningAnimation(Adafruit_NeoPixel strip) { _time_delay = 1000; _timeout = millis(); _current_pixel = 0; _color = strip.Color(0, 64, 64); _black = strip.Color(0, 0, 0); } void SpinningAnimation::loop(Adafruit_NeoPixel strip) {...
//A random walking snake that leaves a trail // Here two arrays are used to remeber the past locations of the snake // and to fade the brightness out. // pot 1 controls color #include <cloudflare_arduino_workshop.h> #define pot1_pin A0 #define pot2_pin A1 unsigned long current_time; unsigned long prev_time[8]; //arr...
class Solution { public: int countNumbersWithUniqueDigits(int n) { if(n == 0) return 1; if(n == 1) return 10; int val = 9; int res = 10; for(int i=2; i<=n; ++i){ val *= (9-i+2); res += val; } return res; } }; class Solution { public...
#include <iostream> #include <string> #include <cstring> #include <sstream> #include <vector> #include <algorithm> #include <iterator> #include <fstream> //files #include <errno.h> //errors #include <stdio.h> //printf #include <unistd.h> // sys calls #include <sys/types.h> // O_ constants #include <sys/ipc.h> // IPC...
// Name: Palmer Robins #include "Cache.h" #include <cstdlib> #include <fstream> #include <iostream> using namespace std; /* This method is passed the name of a configuration file containing * the capacity (in bytes), block size (in bytes), and set associativity. * It is also passed a pointer to the cache to config...
// This file was generated based on /usr/local/share/uno/Packages/Fuse.iOS/1.3.1/iOSInterop.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.h> namespace g{namespace Fuse{namespace iOS{namespace Bindings{struct iOSDeviceInterop;}}}} namespace g{ namespace Fuse{ namespa...
#include <iostream> namespace popular { inline namespace V3_2 { double f(double); void f(int) { std::cout << "default" << std::endl; } template<typename T> class C {}; } namespace V3_0 { double f(double); void f(int) { std::cout << "v30" << std::endl; } template<typename T> class C {}; } namespace V2_4_2 { ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2006 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * */ #ifndef _BOOKMARK_SEPARATOR_H_ #define _BOOKMARK_SEPARATOR...
// collision.hpp // // Copyright 2010 Kevin Pors <krpors@users.sf.net> // // 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,...
// Copyright (c) 2013-2019 Agustin Berge // // SPDX-License-Identifier: BSL-1.0 // 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) #pragma once #include <pika/config.hpp> #include <pika/functional/detail/invoke.h...
/* * This file is part of Lua API++ library (https://github.com/OldFisher/lua-api-pp) * distributed under MIT License (http://opensource.org/licenses/MIT). * See license.txt for details. * (c) 2014 OldFisher */ #ifndef LUA_CALL_HPP_INCLUDED #define LUA_CALL_HPP_INCLUDED #include "luapp_lazy.hxx" namespace lua { cl...
#include <iostream> #include <string> #include <cstring> #include <sstream> #include <vector> #include <algorithm> #include <iterator> #include <fstream> //files #include <errno.h> //errors #include <stdio.h> //printf #include <unistd.h> // sys calls #include <sys/types.h> // O_ constants #include <sys/ipc.h> // IPC...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef PI_DEVICE_API_OPPOWERSTAT...
#include "CCategoryFactory.h" #include "Markup.h" #include "CMisc.h" #include "CClientLog.h" #include "CDriverCategory.h" #include "CERPCategory.h" #include "CWebCategory.h" #include "COtherCategory.h" #include "CMessageDataMediator.h" #include "NetClass.h" #include "NetClt.h" #include <QApplication> #include <QFile> ...
#include <iostream> #include "opencv2/opencv_modules.hpp" #if defined(HAVE_OPENCV_CUDACODEC) #include <string> #include <vector> #include <algorithm> #include <numeric> #include <opencv2/core.hpp> #include <opencv2/core/opengl.hpp> #include <opencv2/cudacodec.hpp> #include <opencv2/highgui.hpp> int main(int argc, ...
// // Created by Matteo Favaro on 03/08/16. // #ifndef ARDUINO_MCWW_UTILITY_H #define ARDUINO_MCWW_UTILITY_H #include <Arduino.h> #include "RF24Network.h" #include "Message.h" #include "Leds.h" /* * return a adress compatible with the RF24Network * addressing format, a octal number where the maximum is * 04444 --...
class ItemCanvas { weight = 4; }; class ItemBurlap { weight = 8; }; class equip_rag { weight = 0.3; }; class equip_string { weight = 0.05; }; class equip_rope { weight = 0.1; }; class ItemSkinRabbit { weight = 3; }; class ItemSkinCow { weight = 12; }; class ItemSkinGoat { weight = 6; }; class ItemSkinBoa...
// Copyright 2017 The WCT(Wisdom City Times) Authors. All rights reserved. #include "chrome/browser/ui/views/tabs/big_popup_thumbnail.h" /// gmbrowser { /// yfj #include "cc/paint/paint_flags.h" ///} #include "chrome/browser/thumbnails/thumbnail_service.h" #include "chrome/browser/ui/browser.h" #include "chrome/brows...
#include <iostream> using namespace std; const int MAXN=100010; int n,s,l; int num[MAXN]; int maxto[MAXN]; template<class T>struct Segtree { #define ls (o<<1) #define rs (o<<1)|1 T data[2][MAXN<<2]; void pushup(int o) { data[0][o]=max(data[0][ls],data[0][rs]); data[1][o]=min(data...
/* * Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com> * Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com> * Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com> * Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com> * Copyright (c) 2011 Guillaume Pinot <guillaume.pino...
// // Shop.h // GetFish // // Created by zhusu on 15/8/3. // // #ifndef __GetFish__Shop__ #define __GetFish__Shop__ #include "cocos2d.h" #include "ButtonWithSpriteManage.h" USING_NS_CC; class Shop : public CCLayer { public: static const int SHOP_TYPE_GOLD = 0; static const int SHOP_TYPE_VIP = 1; ...
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <unordered_set> #include <unordered_map> #include <queue> #include <chrono> using namespace std; bool compare(const pair<int,int>& a, const pair<int,int>& b){ return a.second < b.second; } int FIFO(int num_quadros, const vector<in...
#include "Point2D.h" #include "cassert" Point2D::Point2D() { init(); } Point2D::Point2D(float x, float y) { init(); coord[0] = x; coord[1] = y; } Point2D::Point2D(float xy[2]) { init(); coord[0] = xy[0]; coord[1] = xy[1]; } Point2D::Point2D(std::vector<float> xy) { init(); asser...
// -*- C++ -*- /*! * @file PSGamepadComp.h * @brief Playstation Gamepad component * @date $Date$ * * $Id$ */ #ifndef PSGAMEPADCOMP_H #define PSGAMEPADCOMP_H #include <rtm/Manager.h> #include <rtm/DataFlowComponentBase.h> #include <rtm/CorbaPort.h> #include <rtm/DataInPort.h> #include <rtm/Data...
/* * Copyright (c) 2016, GNSS Sensor Ltd. * * 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 ...
/* * Copyright (c) 2016-2018 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_REFINED_H_ #define CPPSORT_REFINED_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <type_traits> #include <utility> #include "detail...
#pragma once #include <SFML/Graphics.hpp> #include <iostream> #include <stdlib.h> #include "../include/Pawn.h" #include "../include/Board.h" #include "../include/DrawableArray.h" #include <string> #include <fstream> #include <ostream> #include <iosfwd> #include "../include/TextureException.h" using namespace sf; //! K...
#pragma once #include <QDialog> #include "ui_addtransformdialog.h" #include "TransformModel.hpp" #include <base/TransformWithCovariance.hpp> namespace envire { namespace viz { class AddTransformDialog : public QDialog { Q_OBJECT public: AddTransformDialog(QWidget* parent = nullptr); QString getFrameId() const...
#include "RenderSystem.h" #include <iostream> #include <osg/Image> #include <osg/LightSource> #include <osg/MatrixTransform> #include <osg/PositionAttitudeTransform> #include <osgDB/ReadFile> #include "../Constants.h" #include "../components/Tile.h" using namespace ld; using namespace osg; RenderSystem::RenderSystem...
#include "ObjectPool.h" void main() { ObjectPool<Ball > pool(50); Object<Ball> *pPooledObj = pool.GetPooledObject(); Ball *pObj = pPooledObj->GetObject(); pObj->val; std::cout << pObj->val << std::endl; }
// MainView.cpp : implementation of the CMainView class // #include "stdafx.h" #include "IPCTrace.h" #include "Doc.h" #include "MainView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #include "Cfg.h" #define BKCOLOR RGB(255, 196, 0) ////////////////////////////...
#pragma once #include "../Config.hpp" #include "../SecureWiper.hpp" #include "../Array.hpp" #include "../Intrinsic.hpp" // Detect if AESNI feature is enabled. // For MSVC detect if SSE2 is enabled only. #if defined(__GNUC__) && defined(__AES__) || defined(_MSC_VER) && (_M_IX86_FP >= 2 || _M_AMD64) namespace accel::Cr...
#include "graphicview.h" GraphicView::GraphicView(QWidget *parent) { initialize(); } GraphicView::GraphicView(QGraphicsScene *scene, QWidget *parent) : QGraphicsView(scene, parent) { initialize(); } GraphicView::~GraphicView() { if(m_pLastCropRect) delete m_pLastCropRect; } void GraphicView::initialize(...
// // Created by DELL on 10/23/2020. // #include "Draw.h" Draw::Draw() {} Draw::~Draw() {} Draw::Draw(vector < pair<float,float> > tiles_pos, vector <Texture> t_map_list, vector <Sprite> map_list, Texture t_cursor, Texture t_background, Texture t_soil , Texture t_arrow, Texture t_gras...
/** * @file AudioMachine.h * @brief Header file for Engine::AudioMachine * * @author Gemuele (Gem) Aludino * @date 09 Dec 2019 */ /** * Copyright © 2019 Gemuele Aludino * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associate...
#include <iostream> #include <vector> int n, m, status[201], check[201]; std::vector<int> link[201]; int dfs(int cow) { for(int house : link[cow]) { if(check[house]) { continue; } check[house] = 1; if(status[house] == 0 || dfs(status[house])) { ...
/* -*- 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. ** */ #ifndef _JS11_NAVIGATOR_ #define _JS11_NAVIGATOR_ #include "m...
#ifndef LEVEL_H #define LEVEL_H #include "TileSet.h" #include "SingletonTemplate.h" #include <map> #include <vector> #include <string> using std::map; using std::vector; using std::string; using std::pair; class Level : public Singleton<Level> { public: struct Point { float x; float y; Point(float _x, float ...
#include "stdafx.h" #include "GtaThread.h" #include "CScriptManager.h" static void(*ScriptThreadInit)(GtaThread*); static rage::eThreadState(*ScriptThreadTick)(GtaThread*, uint32_t); static CMemory::Hook scrHook([] { constexpr CMemory::Pattern initScrThreadPat("48 89 5C 24 ? 57 48 83 EC ? 83 89 ? ? ? ? ? 33 FF 83 A...
#pragma warning(disable:4996) #include "Clock.h" #include <iostream> #include <time.h> #include <Windows.h> #include <iomanip> #include <conio.h> using namespace std; Clock::Clock() { time_t now = time(0); tm* ltm = localtime(&now); hour = ltm->tm_hour; min = ltm->tm_min; sec = ltm->tm_sec; } void Clock::show() ...
class Consumer { public: Consumer(int (&pipe_fd)[2]); int watchPipe(); private: int *pipe_fd_; void printStatus(int received_number); };
#include "glut.h" #include <stdio.h> #include <string.h> //文字列関数のインクルード #include "CModelX.h" void CModelX::Load(char *file) { // //ファイルサイズを取得する // FILE *fp; //ファイルポインタ変数の作成 fp = fopen(file, "rb"); //ファイルをオープンする if (fp == NULL) { //エラーチェック printf("fopen error:%s¥n", file); return; } //ファイルの最後...
/* ============================ @Author: shaoDong @Version: 1.0 @DateTime: 2018-04-01 09:01:12 @Description: print demo ============================ */ #include <iostream> #include <vector> #include <string> #include <cmath> #include <map> #include <list> #include <algorithm> using namespace std; typedef pa...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ /** * @file security_info_parser.cpp * * Contains function definitions for the clas...
#include <bits/stdc++.h> using namespace std; #define ll long long ll mod=1000000007; int main(){ std::ios::sync_with_stdio(false); int n; cin>>n; ll num; cin>>num; ll fac[10]; fac[0]=1; for(int i=1;i<10;i++)fac[i]=fac[i-1]*i; ll res=1,num1=num; vector<ll> vec; for(int i=0;i...
#include<iostream> #include<cstring> #include<vector> using namespace std; const int maxn = 1005; struct node { int x, y; node(){} node(int xx,int yy):x(xx),y(yy){} }; int n, cnt; int vis[maxn][maxn];//标记这个点是否被访问过 char mp[maxn][maxn];//存图 int dy[] = { 0,0,1,-1 }; int dx[] = { 1,-1,0,0 }; vector<node> d[100000];//第...
#ifdef __APPLE__ #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <GLUT/glut.h> #elif defined(WIN32) #include <Windows.h> #include <GL/gl.h> #include <GL/glu.h> #include <GL/glut.h> #else #include <GL/gl.h> #include <GL/glu.h> #include <GL/glut.h> #endif #include "MyVehicle.h" #include "Vehicl...
// Copyright 2019 Erik Teichmann <kontakt.teichmann@gmail.com> #include <vector> #include "test/catch.hpp" #include "include/sam/observer/position_observer.hpp" TEST_CASE("PositionObserver saves position") { std::vector<double> pos_1({1.5, 2.6}); std::vector<double> pos_2({2.3, 3.8}); double t_1 = 0.1; doubl...
#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 10e18 // 4倍しても(4回足しても)long longを溢れない #define rep(i,n) f...
#ifndef coupleediteur_h #define coupleediteur_h #include <QWidget> #include <QObject> #include <QPushButton> #include <QHBoxLayout> #include <QVBoxLayout> #include <QListWidget> #include <QScrollArea> #include <QLabel> #include <QLineEdit> /** \file coupleediteur.h */ #include "manager.h" #include "couple.h" class C...
// Created on: 2015-07-07 // Created by: Irina KRYLOVA // Copyright (c) 2015 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as publ...
// // Created by fab on 27/02/2020. // #ifndef DUMBERENGINE_CHUNK_HPP #define DUMBERENGINE_CHUNK_HPP #include <glm/vec3.hpp> #include <glm/vec2.hpp> #include "../IComponent.hpp" #include "Cube.hpp" #include "../../rendering/renderer/opengl/Vbo.hpp" #define CUBE_MASK_TRANSPARENT 0xFF class Chunk { private: glm::...
#include "core.h" template<typename Type> void ArrayOut(int size, Type* array) { cout << "Array: "; for (int i = 0; i < size; i++) cout << array[i] << ' '; cout << endl; }
#include<iostream> int main () { int startHour = 0; int startMin = 0; int endHour = 0; int endMin = 0; char symb; std::cout << "Input start time ( ex 1:07) : "; std::cin >> startHour >> symb >> startMin; std::cout << "Input end time (ex 5:07) : "; std::cin >> endHour >> symb >> endMin; st...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FOR(i,n) for(ll i=0;i<n;i++) #define FOR1(i,n) for(ll i=1;i<n;i++) #define FORn1(i,n) for(ll i=1;i<=n;i++) #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define mod 1000000007; using namespace std; int main() { ...
#include "stdafx.hpp" #include "views.hpp" namespace curses { // view view::view(sp_pen&& p, rectangle&& rect) CURSES_NOEXCEPT: parent_( CURSES_MOVE(sp_pen, p) ), rect_( CURSES_MOVE(rectangle, rect) ), display_(), underground_(NULL) { display_ = parent_->sub_pen(rect_); } view::~view() CURSES_NOEXCEPT { hide()...
#ifndef SOCKS6MSG_IDEMPOTENCEOPTION_HH #define SOCKS6MSG_IDEMPOTENCEOPTION_HH #include "option.hh" #include "restrictedint.hh" namespace S6M { typedef BoundedInt<uint32_t, SOCKS6_TOKEN_WINDOW_MIN, SOCKS6_TOKEN_WINDOW_MAX> WindowSize; class IdempotenceRequestOption: public Option { WindowSize winSize; protected: ...
// LexemesPairsMatchChecker.h #include <map> #include <parser/lexemes/Lexeme.h> namespace parser { class LexemesPairsMatchChecker { public : LexemesPairsMatchChecker() = default; LexemesPairsMatchChecker( const LexemesPairsMatchChecker& checker ); LexemesPairsMatchChecker& operator =( const L...
#define _USE_MATH_DEFINES #include <cmath> #include <iostream> #include <iomanip> #include <string> #include "shapes.h" using namespace std; Shape::Shape() {} Shape::Shape(string sName, string sColor) { name = sName; color = sColor; } string Shape::getName() { return name; } void Shape::setName(string sName) { nam...
#include "User.h" #include <QDate> #include <QString> #include "Entities/Gender/Gender.h" #include "Entities/UserRole/UserRole.h" // :: Constants :: const QString ID_JSON_KEY = "id"; const QString LOGIN_JSON_KEY = "login"; const QString PASSWORD_JSON_KEY = "password"; const QString ROLE_JSON_KEY = "roleName"; cons...
#include "math.h"
/* * Exemple_window_2.h * * * */ #ifndef EXEMPLE_WINDOW_3_H #define EXEMPLE_WINDOW_3_H #include "uLCD_4DLibrary.h" #include "ulcd_button.h" #include "ulcd_slider.h" #include "ulcd_label.h" #include "ulcd_progress_bar.h" #include <string> #include <sstream> /* * public types * */ /* * public class * */ c...
#include <iostream> #include <cmath> #include "Point.h" #include "Vector.h" #include "PointStack.h" using namespace std; bool CCW(Point X1,Point X2,Point X3){ double crossProduct; Vector a(X1,X2); Vector b(X2,X3); crossProduct=a.getXM()*b.getYM()-a.getYM()*b.getXM(); if(crossProduct>0.000001){ ...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <map> using namespace std; typedef long long ll; typedef map<ll, bool> lmap; #define INF 10e10 #defin...
#include "Point3D.h" #include "Point2D.h" #include <cassert> Point3D::Point3D() { init(); } Point3D::Point3D(float x, float y, float z) { init(); coord[0] = x; coord[1] = y; coord[2] = z; } Point3D::Point3D(float xyz[3]) { init(); coord[0] = xyz[0]; coord[1] = xyz[1]; coord[2] =...
// Construct permutation of numbers 1..n with exactly k peaks #include <bits/stdc++.h> using namespace std; int main() { int t; cout<<"Enter t "; cin>>t; while(t--) { int n,k; cout<<"\nEnter n,k "; cin>>n>>k; vector<int>a(n+1); int n1 ...
/************************************************************************************** * File Name : VerticesDescriptionLayout.hpp * Project Name : Keyboard Warriors * Primary Author : JeongHak Kim * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation...
// // Created by gurumurt on 4/11/18. // #ifndef OPENCLDISPATCHER_SELECTION_GENERATOR_H #define OPENCLDISPATCHER_SELECTION_GENERATOR_H #endif //OPENCLDISPATCHER_SELECTION_GENERATOR_H #include "../headers.h" #include "../globals.h" #include "../kernel_class/selection.h" class generate_selection : public selection1{ ...
// // main.cpp // EX05_03 // // Created by Eben Schumann on 11/1/16. // Copyright © 2016 Eben Schumann. All rights reserved. // #include <iostream> #include <vector> #include <string> int main(int argc, const char * argv[]) { }
#pragma once #include <qEngine/qCommonInclude.h> #include <qEngine/qConfigManager.h> #include <qEngine/qViewport.h> namespace qEngine { class qSceneGraph { public: qSceneGraph(void); ~qSceneGraph(void); bool init(boost::shared_ptr<qConfigManager> spCM); void set2D(); void set3D(); private: bool is2D; ...
#include<string> #include <iostream> using namespace std; bool StupidIsPal(string str, int begin, int end){ int i = 0; while (begin + i <= end - i) { if (str[begin + i] != str[end - i]) return false; i++; } return true; }
#ifndef PCBLIST_H #define PCBLIST_H #include "pcb.h" class PCBList { public: PCBList(); void push(PCB*); PCB* pop(); int listLength(); PCB* findPCB(QString); void removePCB(PCB*nodeToRemove); PCB *firstNode,*lastNode; PCB* shortestToCompletion(); //User Commands }; #endif // PCB...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef MODULES_UTIL_B23TREE_H #define MODULES_UTIL_B23TREE_H cl...
#include"Gamecontroller.h" #include <QDebug> StartMenueR *S; Play * play; Endmenu * E; Gamecontroller::Gamecontroller() { //startmenu = new Startmenu(); S = new StartMenueR; qDebug() <<"we resevied the constructor of gamecontroller"; gameover = new QMediaPlayer(); gameover->setMedia...
#pragma once #include <QMainWindow> class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); virtual ~MainWindow(); private: };
// Created on: 1996-12-05 // Created by: Odile Olivier // 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 GNU ...
#include<iostream> using namespace std; class hospital { public: char name[50]; char doa[10]; char dod[10]; char disease[50]; void input() { cout<<"\nEnter the name of the patient: "; cin>>name; cout<<"\nEnter the date of admission: "; cin>>doa; cout...
#pragma once class Uma :public Monster { public: Uma(); private: AnimationClip m_anim[3]; };
#define DEBUG #include <iostream> #include <sstream> #include "utility.h" #include "jni-reflection.h" JNIEXPORT jobject JNICALL Java_com_jnireflection_bindings_JNIReflection_getStaticObject (JNIEnv *env, jclass clazz, jstring jClassName, jstring jFieldName, jstring jSignature) { std::string className =...
#include "msg_0x1d_destroyentity_stc.h" namespace MC { namespace Protocol { namespace Msg { DestroyEntity::DestroyEntity() { _pf_packetId = static_cast<int8_t>(0x1D); _pf_initialized = false; } DestroyEntity::DestroyEntity(int8_t _entityCount, const std::vector<int32_t>& _entityIds) : _pf_entityCount(_entityCount...
#include "SoundManager.h" #include "Debug.h" using namespace gg; SoundManager::SoundManager() { init(); } SoundManager::~SoundManager() { } void SoundManager::init() { _device = alcOpenDevice(0); if(!_device) writeLog("Failed to open audio device!"); writeLog("Audio device opened!!"); _context = alcCrea...
#include "ofxBson.h" #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_io.hpp> #include <boost/lexical_cast.hpp> using namespace _bson; ofBuffer ofxBson::BSONNode::emptyBuffer; void ofxBson::serialize(const ofAbstractParameter & parameter) { if (!parameter.isSerializable()) { return; } strin...
#include <stdio.h> int fan(int n){ if(n==1) return 1; else return 2 * fan(n - 1) + n; } int main(){ int n; while (~scanf("%d", &n)) { printf("%d\n", fan(n)); } }
#include <bits/stdc++.h> using namespace std; int N; long long int maxo = LLONG_MIN,total,act; int main() { ios_base::sync_with_stdio(0); cin.tie(0); for(int i=0; i<7; i++){ cin >> act; total+= act; if(act > maxo) maxo = act; } cout << total/7 << '\n' << maxo; return 0; }
#include <iostream> #define MAX 300 using namespace std; typedef struct { int Data; }node; class STACK { private: int Top; node Stack[MAX]; public: STACK(); void Push(node Item); node Pop(); void Init(); bool IsEmpty(); bool IsFull(); }; STACK::STACK() { } void STACK::Init() { this->Top = -1; } bool S...
/* Petar 'PetarV' Velickovic Algorithm: Heapsort */ #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> #define MAX_N 1000001 using name...
#include<iostream> #include<stdlib.h> using namespace std; int main() { int i,j,k=0,t,n,*c,output[50]; cin>>t; for(i=0;i<t;i++) { cin>>n; c=(int*)calloc(n,sizeof(int)); for(j=0;j<n;j++) cin>>c[j]; output[k]=c[0]; for(j=1;j<n;j++) { if(c[j]>output[k]) output[k]=c...
#pragma once #include <string> namespace hdd::asio { class HostName { public: static std::string Get(); private: HostName(); }; }
#include <iostream> #include <vector> #include <algorithm> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int n, m; std::cin >> n >> m; std::vector<int> data(n); for (int i = 0; i < n; ++i) { std::cin >> data[i]; } int ans = st...
#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 = 2e4 + 100; const int MAXM = 2e5 + 100; struct Edge{ int p,ne...
//算法:DP //对于第i个数要么接到前一个数后面, //要么自己作为起点,再开一个新序列 //则: //f[i]表示结尾为i的序列的最大和 , //转移方程式:f[i]=max(f[i-1]+a[i],a[i]); #include<cstdio> #include<algorithm> using namespace std; int n,ans=-10010; int a[200010]; int f[200010];//结尾为i的序列的最大和 int main() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[...
#include "GetChatMessages.h" boost::property_tree::ptree GetChatMessages::execute(std::shared_ptr<Controller> controller) { return controller->getChatMessages(commandParams); } GetChatMessages::GetChatMessages(boost::property_tree::ptree &params) : BaseCommand("GetMessagesInChat") { commandParams = params; }
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int maxn = 100 + 10; int a[maxn]; int main() { int n; while(scanf("%d", &n) && n) { int x,ans = 0; memset(a, 0, sizeof a); for( int i = 0; i < n; i++) { cin >> x; a[x]++; } for(int i = 1; i <=105; i++...
#pragma once #include "bricks/core/object.h" #include "bricks/core/returnpointer.h" #include "bricks/io/filepath.h" #include "bricks/io/filenode.h" namespace Bricks { namespace IO { class Stream; struct FileInfo; typedef size_t FileHandle; class Filesystem : public Object { public: static Filesystem* GetDef...
#include "NetEventService.h" #include "protocol.h" #include <vector> #include <thread> #include <time.h> #include <windows.h> #include "direct.h" #define random(x) (rand()%x) void Message_handle(void *args); void Send_testPack(void *args); void Send_TransformPack(void *args); void Send_SeatNumber(void *args); void Se...
/* DigitalReadSerial Reads a digital input on pin 2, prints the result to the serial monitor This example code is in the public domain. */ // digital pin 2 has a pushbutton attached to it. Give it a name: int pushButton = 4; // the setup routine runs once when you press reset: void setup() { // initialize ser...
#include "insertion_sort.h" void sloth::InsertionSort::sortHighToLow(std::list<std::shared_ptr<Particle>>& particles) { for (auto it1 = particles.begin(); it1 != particles.end();) { auto it2 = it1; ++it2; if (it2 != particles.end() && (*it1)->getDistance() < (*it2)->getDistance()) { sortUpHighToLow(particle...
// // Created by mikcy on 15. 6. 7. // #ifndef JUDGESERVER_TASK_H #define JUDGESERVER_TASK_H namespace Util { class Task { public: virtual void task() = 0; }; } #endif //JUDGESERVER_TASK_H
#pragma once #include <Dot++/lexer/Token.hpp> #include <Dot++/lexer/TokenInfo.hpp> #include <Dot++/lexer/TokenizerState.hpp> #include <deque> #include <utility> namespace dot_pp { namespace lexer { namespace states { TokenizerState produceToken(const TokenizerState state, std::deque<TokenInfo>& tokens, Token& t...