text
stringlengths
8
6.88M
/** \file testThread.hpp \author UnBeatables \date LARC2018 \name testThead */ #ifndef TESTTHREAD_HPP #define TESTTHREAD_HPP #include <basemodule.hpp> #include <time.h> #include <cstdio> #include <vector> #include <cmath> /** \brief Thread to test code and time to execute in the robot for t...
#pragma once #include <utility> template<typename T> class shared { private: shared(const shared &); shared(); template<typename> friend class launch_core_access; // allows friends to construct dummy shared<T> objects struct construct_dummy_tag {}; shared(construct_dummy_tag) {} sha...
// Font block 'arial13_basic_latin_1bpp_0x21_0x7E' definition // // Bitmap data static const esU8 sc_arial13_basic_latin_1bpp_0x21_0x7E_data[] = { ________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________,________...
#ifndef GNPATH_H #define GNPATH_H #include "GnSystemDefine.h" #if defined(_MAX_PATH) #define GN_MAX_PATH _MAX_PATH #else //#if defined(_MAX_PATH) #define GN_MAX_PATH 260 #endif //#if defined(_MAX_PATH) class GNSYSTEM_ENTRY GnPath { protected: gtchar* mFullFilePath; gtchar* mFileName; gtchar* mFile...
#if !defined(MIDPOINT_CIRCLE) #define MIDPOINT_CIRCLE #include <vector> #include "../custom-headers/Point.h" void setOctetPoints(Point<int> p,std::vector<Point<int>> &points) { int x=p.x,y=p.y; points.push_back(Point<int>(x , y )); points.push_back(Point<int>(-x , y )); points.push_back(Point<int>(x , -y )); ...
#include "Objets.h" #define TRIANGLE 0 #define QUADRILAT 1 #define POLYGONE 2 using namespace std; Objet::Objet(QVector3D position, QVector3D orientation, QString nomObjet, QString fichierMesh, QString fichierTexture, bool textureUV, int repeatx, int repeaty) { _position = position; _orientation = orientatio...
/* * ===================================================================================== * * Filename: processor.cpp * * Description: Super Scalar Processor with centralised pipeline system * * Version: 1.0 * Created: Monday 12 November 2012 06:28:30 IST * Revision: none *...
#ifndef MySqlConnect_H #define MySqlConnect_H #include "CDL_TCP_Handler.h" #include "CDL_Timer_Handler.h" #include "Packet.h" #include "DLDecoder.h" #define CMD_BACKSVR_HEART 0x0001 //MysqlServerÐÄÌø°ü class MySqlConnect ; class HeartBeatTimer:public CCTimer { public: HeartBeatTimer(){} ; virtu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. ** ** George Refseth and Patricia Aas */ #include "core/pch.h" #incl...
#pragma once #include "ComputationNode.hpp" template<class Type> struct VariableNode : ComputationNode<Type> { void backPropagationPass() override { } };
// PollingCtl.cpp : Implementation of the CPollingCtrl ActiveX Control class. #include "stdafx.h" #include "NetFind.h" #include "PollingCtl.h" #include "PollingPpg.h" #include "ZyFunc.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif IMPLEMENT_DYNCREATE(CPollingCtrl,...
/* g++ -Wall opencv_exempleCPP.cpp -lopencv_core -lopencv_highgui -lopencv_imgproc -std=c++11 */ #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> #include <math.h> #include <complex> #include <time.h> #include <fstream> using namespace std; using nam...
#include<bits/stdc++.h> using namespace std; struct Contest{ public: int sc, ns, originalIndex; }; bool accordingtoScore(Contest a, Contest b){ return (a.sc < b.sc); } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int p, s, currentN; vector < pair <int,int> > result; ...
#pragma once #include <vector> #include <algorithm> using namespace std; class Listener { public: virtual void update(int msg) = 0; }; class DataSource { protected: vector<Listener*> listeners; public: void registerListener(Listener* listener); void removeListener(Listener* listener); void notif...
// NOTE: this doesn't really test anything except that things compile #include "gtest/gtest.h" #include "opennwa/Nwa.hpp" #include "opennwa/nwa_pds/conversions.hpp" #include "Tests/unit-tests/Source/opennwa/fixtures.hpp" using namespace wali::wpds; namespace opennwa { namespace nwa_pds { TEST...
#include "DynamicObjectLogicCalculator.h" DynamicObjectLogicCalculator::DynamicObjectLogicCalculator() { } DynamicObjectLogicCalculator::~DynamicObjectLogicCalculator() { } void DynamicObjectLogicCalculator::correctStepsDueToWallCollisions() { //in case of collision we stop the movement in that direction float st...
/* Phil Culverhouse Oct 2016 (c) Plymouth University James Rogers Jan 2020 (c) Plymouth University This demo code will move eye and neck servos with kepresses. Use this code as a base for your assignment. */ #include <iostream> #include <fstream> #include <string> #include <sys/types.h> #ifndef _WIN...
#ifndef MacOpView_H #define MacOpView_H #include "modules/pi/OpView.h" #include "adjunct/desktop_util/actions/delayed_action.h" #include "modules/libgogi/pi_impl/mde_opview.h" #include "platforms/mac/pi/MacOpSystemInfo.h" class MacOpWindow; class MacOpView : public MDE_OpView { public: virtual ~MacOpView(){} virtu...
// Created on: 1991-03-18 // 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 <cstring> using namespace std; const int maxn = 3000005; int a[maxn]; int n; //人数 int t; //卡片数字 int main() { memset(a, 0, sizeof a); //数组a置0, 做标记 cin >> n; for(int i = 0; i < n; i++) { cin >> t; //sort(); if(a[t] != 0) a[t]--; else a[t]++; } for...
#ifndef INC_SHADY_ENGINE_APPLICATION_MANAGER_H #define INC_SHADY_ENGINE_APPLICATION_MANAGER_H //C++ headers #include<memory> //engine headers #include"application.h" namespace shady_engine { class app_manager { static application* mApp; static void key_callback( GLFWwindow* window, int key, ...
// // nehe12.cpp // NeheGL // // Created by Andong Li on 9/11/13. // Copyright (c) 2013 Andong Li. All rights reserved. // #include "nehe12.h" const char* NEHE12::TITLE = "NEHE12"; GLfloat NEHE12::sleepTime = 0.0f; int NEHE12::frameCounter = 0; int NEHE12::currentTime = 0; int NEHE12::lastTime = 0; char NEHE12::...
// // Created by chris on 11/08/2017. // #include <iostream> #include "Shader.h" Shader::Shader(const char **sources, GLuint *types, int count) { create(sources, types, count); } void Shader::create(const char **sources, GLuint *types, int count) { auto shaders = new GLuint[count]; this->program = glCrea...
#include "dock_perforo.h" /** * Dock PerFoRo */ DockPerFoRo::DockPerFoRo() : it_(nh_) { image_sub_ = it_.subscribe("/ps3_eye/image_raw", 1, &DockPerFoRo::ImageCallback, this); mode_sub_ = nh_.subscribe("/ModePerFoRo", 1, &DockPerFoRo::ModeCallback, this); target_dock_sub_ = nh_.subscribe("/SelectTargetDockPerFo...
#include <iostream> using namespace std; int main() { int t, n, a[150], b, maxi; cin >> t; while(t--) { cin >> n; maxi = 0; for(int i = 0; i < n; i++) cin >> a[i]; for(int i = 0; i < n; i++) { cin >> b; maxi = max(20 * a[i] - ...
struct RandomListNode { int label; struct RandomListNode *next, *random; RandomListNode(int x) : label(x), next(NULL), random(NULL) { } }; typedef RandomListNode rnode; class CloneRandomList { public: // 思路: 首先拷贝首节点,用哈希表记录其地址,遍历原链表, // 若存在节点则取出其地址, // 若不存在则new出来一个, 再用哈希表记录之。 // 复杂度: 时间 O(n), 空间O(n) Random...
#include<iostream> #include<set> using namespace std; int main() { int t,e,x,y; cin >> t; while(t--) { set<int> citySet; set<int>:: iterator it; cin >> e; while(e--) { cin >> x >> y; it = citySet.find(x); if(it == citySet.end()...
// Created on: 1993-03-31 // Created by: Bruno DUMORTIER // 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...
/********************************************************************* ** Author: Chris Matian ** Date: 07/24/2017 ** Description: Class specification header file for the Entree Sampler Functions *********************************************************************/ #ifndef ENTREESAMPLER_HPP #define ENTREESAMPLER_HPP...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1999-2002 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** CREATED DG-170399 ** DESCRIPTION Allow Dynamic linking of RA...
#include "resourceManager.h" #include <filesystem> #include <iostream> ResourceManager::ResourceManager(std::string _execPath) : execPath(_execPath) { generateResourcesPath(); } ResourceManager::~ResourceManager() { } void ResourceManager::loadResources(Point<int> expectedTexturesSize) { loadFont(); textures...
#include<bits/stdc++.h> #define rep(i,n) for (int i =0; i <(n); i++) using namespace std; using ll = long long; using Graph = vector<vector<int>>; const double PI = 3.14159265358979323846; const ll MOD = 1000000007; const int INF = 1e9; const int dx[4] = {1,0,-1,0}; const int dy[4] = {0,1,0,-1}; int main(...
#include <iostream> #include <thread> #include <atomic> //#include <fstream> #include <boost/filesystem/fstream.hpp> #include <boost/filesystem.hpp> #include <boost/program_options.hpp> #include <boost/progress.hpp> #include <boost/regex.hpp> #include <boost/algorithm/string/replace.hpp> // #include "boost/timer/time...
// Problem: Battleships (http://codeforces.com/problemset/problem/965/B) // Author: babang #include <algorithm> #include <iostream> #include <map> #include <set> #include <vector> #include <math.h> #define forn(i, n) for(int i = 0; i < n; i++) #define rofn(i, n) for(int i = n-1; i >= 0; i--) #define foran(i, a, n) fo...
/* * selsort.cpp * * Created on: Feb 7, 2014 * Author: Pooja */ /*#include <iostream> using namespace std; class selection //complexity 0(n2) { public: void selsort(int a[]) { int i,j,min,temp; min=i; for(i=0;i<6;i++) { for(j=i+1;j<6;j++){ if(a[j]>a[j+1]) { temp=a[j]; a[j]=a[j+1]; ...
#include "deck.h" #include <cstdlib> #include <iostream> using namespace std; deck::deck(){ //card cards [52]; cout << "Deck created." << endl; int card_num = 0; for (int i = 1; i < 14; i++){ for (int j = 1; j < 5; j++){ cards[card_num].set_card_rank(i); if(j == 1){ ...
// // Created by giofn on 08/01/2020. // #include "FormulaMin.h" #include "Cell.h" void FormulaMin::update() { min=0; if(cells.size()>0){ min=dynamic_cast<Cell*>((*(cells.begin())))->getValue(); for(auto itr=cells.begin();itr!=cells.end();itr++){ if(dynamic_cast<Cell*>((*itr))->getV...
/* * subtile.h * deflektor-ds * * Created by Hugh Cole-Baker on 1/19/09. * A smaller tile (8x8) that is used for walls, etc */ #ifndef deflektor_subtile_h #define deflektor_subtile_h #include "beam.h" enum Corner { TOPLEFT = 16, TOPRIGHT = 32, BOTTOMLEFT = 64, BOTTOMRIGHT = 128, }; class Subtile {...
#include "d.h" #include "c.h" using namespace std; void c(){ d(); }
#pragma once #include <vector> #include "Print_publication.h" class Publisher { private: struct Node { Print_publication* value; Node* next; Node(Print_publication* a_value); ~Node(); }; Node* publications; char* name; public: Publisher(char* a_name); ~Publisher(); void set_name(char* a_name); char...
#include "transform.h" bool transform::Load(const rapidjson::Value& value) { bool success; success = json::get(value, "position", translation); success = json::get(value, "rotation", rotation); success = json::get(value, "scale", scale); return success; } bool transform::Update() { matrix33 mxs; mxs.scale(sc...
// Playstation Move on the PC, shared header file // this file contains function prototypes // by Carl Kenner 4 October 2010 - 16 November 2010 /* This file (and anything derived from it, based on it, or using it) is released under a non-military license, it may not be used for any military purpose, includi...
#include <cmath> #include <cstdio> #include "Circle.h" #include "Polygon.h" #include "Reuleaux.h" #include "Geom.h" #include "Containable.h" // ======================================= // Constructor ========== Getter Functions ========== // ======================================= ReuleauxTriangle::Reuleau...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <quic/common/FunctionLooper.h> #include <gtest/gtest.h> using namespace std; using namespace folly; using namespace te...
#ifndef PROPERTYWIDGET_HPP #define PROPERTYWIDGET_HPP #include <QDialog> #include <mjson.hpp> #include <vector> #include <string> namespace Ui { class PropertyWidget; } namespace Maint { class PropertyItemWidget; class PropertyWidget : public QDialog { Q_OBJECT Ui::PropertyWidget ...
#include "CustomPillar.h" #include "CustomPhysics/CustomPhysics.h" #include "Definitions.h" USING_NS_CC; // Initialize instance bool CustomPillar::init() { // Super init first return Pillar::init(); } // Initialize physics void CustomPillar::initPhysics(CPWorld* world) { // Top body creation topBody_ = new CPRect...
// Question 6 => Write a Program to check whether a string is a valid shuffle of two strings or not /* 1. Suppose we have two string st1 = "onetwofour" and str2 = "hellofourtwooneworld" */ #include<bits/stdc++.h> using namespace std; bool shuffleString(string A, string B) { int n = A.length(); int m = B.leng...
/* * Copyright 2019 LogMeIn * * 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 w...
/* -*- 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. ** psmaas - Patricia Aas */ #include "core/pch.h" #ifdef HISTORY_SU...
#pragma once template <typename Type, typename Traits> class unique_handle { unique_handle(unique_handle const &) = delete; unique_handle &operator=(unique_handle const &) = delete; void close() throw() { if (*this) { Traits::close(m_value); } } Type m_value;...
#include "ColorCorrection2bit.h" ColorCorrection2bit::ColorCorrection2bit(uint32_t color1, uint32_t color2, uint32_t color3, uint32_t color4) { colorsRGBA[0] = color1; colorsRGBA[1] = color2; colorsRGBA[2] = color3; colorsRGBA[3] = color4; } ColorCorrection2bit::~ColorCorrection2bit() { }
#include<iostream> #include<math.h> using namespace std; int main(){ int k, q; for(int i = 7; i < 10; i++){ k = (i -6)*pow(10,2) + (i - 3)*pow(10,1) + i; q = (i -6)*pow(10,3) + (i - 3)*pow(10,2) + i; if(q - k == 2250){ cout << k; return 0; } } }
#include <csignal> #include <SDL2/SDL_image.h> #include <SDL2/SDL_ttf.h> #include <SDL2/SDL.h> #include "Sound_Queue.h" #include "apu.hpp" #include "cartridge.hpp" #include "cpu.hpp" #include "menu.hpp" #include "gui.hpp" #include "config.hpp" #include <dirent.h> #include <switch.h> namespace GUI { c...
//User function Template for C++ // Get min at pop /* inserts elements of the array into stack and return the stack */ stack<int> _push(int arr[],int n) { // your code here stack<int> s; s.push(arr[0]); for(int i=1; i<n; i++) { if(s.top() >= arr[i]) s.push(arr[i]); else ...
#include <iostream> #include <vector> #include <queue> #include <iterator> using namespace std; int n, l, a[5000001]; vector<int> d; struct MinimumNumber { int number; int index; MinimumNumber(int num, int idx) : number(num), index(idx) {} bool operator<(const MinimumNumber s) const { return th...
#include <stdio.h> #include <stdlib.h> #include <cstring> #include "DynamicArray.h" typedef struct PERSON { LinkNode node; char name[64]; int age; }Person; void printLinkNode(LinkNode* data){ Person* p = (Person*)data; printf("name: %s\t age: %d\n", p->name, p->age); } int main(int argc, char co...
#include "Square.h" double Square::area() { return a * a; }
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; using ll = long long; const ll MOD = 1000000007; int main() { int N; cin >> N; ll dp[N + 1]; fill(dp + 1, dp + N + 1, 0); dp[0] = 1; for (int i = 0; i < N; ++i) { // dp[n] = a[1]~a[i]で...
#ifndef _camera_setup_h #define _camera_setup_h #include "vector.hpp" #include <stdint.h> #include <math.h> #define DEBUG #define PI 3.14159 class Camera_Setup { private: Vector camera_center; Vector UP_VEC; Vector W; /* Towards Image plane */ Vector U; /* 3rd vector perpendicular to W & U */ Vector V; /* ...
#include <tr1/array> #include <tr1/memory> #include <iostream> #include "PortalSpace.h" #include "PortalSpace2d.h" #include <Eigen/Core> #define _USE_MATH_DEFINES #include <cmath> #include "Assert.h" using Eigen::Matrix3d; using Eigen::Vector3d; double PortalSpace::getK() { return log(2*M_PI)/(2*M_PI); } PortalSpac...
#ifndef CONTROLLER_H #define CONTROLLER_H #include "SoccerBot.h" #include "InfoBoard.h" #include <string> class Robot; class Vision; class Command; class Controller : public InfoBoardListener { public: Controller(SoccerBot* bot) : bot(bot), robot(bot->getRobot()), vision(bot->getVision()) {} virtual v...
#include "CirQueue.h" template<typename T> CirQueue<T>::CirQueue() { front_ = 0; rear_ = 0; } template<typename T> CirQueue<T>::~CirQueue() { } template<typename T> void CirQueue<T>::EnQueue(T element) { if (full()) { std::cout << "Queue is full\n"; } else { data[rear_] = element; rear_...
#include "duiElement.h" duiElement::duiElement(void) { isFocused = false; startsWithFocus = false; topLink = NULL; bottomLink = NULL; leftLink = NULL; rightLink = NULL; } duiElement::~duiElement(void) { } void duiElement::Init() { } void duiElement::Update() { } void duiElement::SetFocus(bool val) { ...
#include "EgaliseHisto.hpp" using namespace ns_wtni; EgaliseHisto::EgaliseHisto( pluglink *p ) : plugin(p) { // Ajout des donnees en entree add_input( input ); // Ajout des donnees en sortie add_output( output ); // Ajout des parametres tailleFenetre = 5; add_param( tailleFenetre, "" ); BooleanHisto = false; a...
#ifndef WIDGET_H #define WIDGET_H #include <QtGui> #include "common/constants.h" class QLabel; class QLineEdit; class QPushButton; class QTextEdit; class QVBoxLayout; class QTextBrowser; enum logFlag { SUCCESS, FAIL, HASLOGIN, REFUSED, OTHER, LOGOUT }; enum wlIssuePolicy { BROADCAST, REQUEST }; enum encryp...
#include <iostream> using namespace std; int main() { int n = 0; cin >> n; string str; int len = 0; bool alphabet[26]; char pre = '\0'; bool check = true; int sum = 0; while (n--) { cin >> str; for (int i = 0; i < 26; i++) { alphabet[i] = false; } pre = '\0'; check = true; ...
#include <iostream> #include <cmath> using namespace std; inline double DistanceFormular(int x1, int y1, int x2, int y2) { return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); } /* * r1 = r2, d = 0, -> infinity * |r1 - r2| < d < r1 + r2 -> two point approach * r1 + r2 = d, |r1 - r2| = d -> one p...
#include <ESP8266WiFi.h> const char* ssid = "stargate"; const char* password = "4110656003373428"; int pinLed = D5; // pin on ESP that controls LED int pinHall = A0; // pin on ESP that is input of hall sensor int statRunning = 0; // status: is hamster currently running? (0-no 1-yes) int statDistDay = 0; // statis...
#pragma once #include <iostream> #include <SFML/Graphics.hpp> #include "menu.h" class StartMenu : public sf::Drawable{ double width; double height; public: StartMenu(double w, double h): width(w), height(h){} private: virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const { sf::Ci...
#ifndef PUNTO_H #define PUNTO_H #include "math.h" #include "razionale.h" #include "eccezioni.h" #include "inputitem.h" using std::ostream; using std::cout; using std::string; class punto; ostream& operator<<(ostream&, const punto&); class punto : public inputitem { friend ostream& operator<<(ostream&, const p...
/* leetcode 306 * * * */ #include <string> #include <unordered_set> #include <algorithm> #include <map> using namespace std; class Solution { public: string addStrings(string num1, string num2) { int num1Size = num1.size(); int num2Size = num2.size(); int i = num1Size - 1, j = num2Size -...
/* -*- 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_SERVICE...
#pragma once #include "bibliotecas.h" class Funcionario{ public: string nome; bool masculino; int numeroDePecas; Funcionario(){ } Funcionario(string nome, bool masculino, int numeroDePecas){ this->nome=nome; this->masculino=masculino; this->numeroDePecas=numeroDePecas;...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 2012 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef VEGA_SWEEP_LINE_H #define VEGA_SWEE...
#ifndef SNIFF80211_H #define SNIFF80211_H #include <QWidget> #include "radiotap_iter.h" #include "wifilist.h" #include "maclist.h" class sniff80211 : public QWidget { Q_OBJECT public: explicit sniff80211(QWidget *parent = 0); struct wlan_frame { uint16_t fc; uint16_t duration; u...
#ifndef PortalSpace_h #define PortalSpace_h #include <vector> #include <tr1/array> #include <tr1/memory> #include "Manifold.h" #include <Eigen/Core> using Eigen::Matrix4d; using Eigen::Vector4d; class PortalSpace : public Manifold { public: double getK(); class PointOfReference; class Point : public Manifold::...
#include "Player.h" Player Player::player; sf::Text Player::text; sf::Font Player::font; bool Player::renderHitbox = false; bool Player::blockShoots = false; Player::Player() { shooted = false; deathDelay = false; renderDeath = false; checkDeathFx = false; canMove = true; canShoot = true; light = false; rese...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QPushButton> #include <QLineEdit> #include <QCheckBox> #include <QHBoxLayout> #include <QStackedLayout> #include <QString> #include <QVector> #include <QMessageBox> #include <QGraphicsView> #include <QGraphicsScene> #include <QGraphicsPixmapIte...
#include <cmath> #include "../vector3.h" #include "../border.h" #include "../piece.h" class Retract: public Border { public: double h; double &r; Retract(): h(0.4), r(piece::r) {} vector3 border_function(double t) { int n; n=int(t); return piece::border[n]->point(t-(double)n); } vertex* ...
// Animal.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> #include<string> using namespace std; class Animal{ public: virtual string name(){ return 0; } virtual string does(){ return 0; } }; class Bird : public Animal{ public: string name() { re...
#include<bits/stdc++.h> using namespace std; int n; int a[10001*2]; int f[10001*2]; void input(){ cin >> n; for(int i = 1; i <= n; i++){ cin >> a[i]; a[i+n] = a[i]; } } int main(){ freopen("VONGSO.inp", "r", stdin); freopen("VONGSO.out", "w", stdout); input(); int jMax; int MAX = -99999999...
// Created on: 1996-09-04 // Created by: Christian CAILLET // 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 ...
#include <stdio.h> #include <string.h> #include <unistd.h> #include <iostream> #include <sstream> #include <string> #include "../parser/ErrorResponse.h" #define ALLOC(pointer, size) (pointer) = (char *)calloc((size), sizeof(*pointer)) #define MAX_MESSAGE_SIZE 4096 #define BREW "BREW" #define POST "POST" #define PRO...
//lang CwC #pragma once #include <stdio.h> #include "object.h" /* Base Bool wrapper class. Represents the basis for all Bools. Only contains two basic features, equals and hash. */ class Bool : public Object { public: /** * Bool constructor * @param bool value ...
#include "cqsdk/cqsdk.h" #include<string> #include<cstring> #include<ctime> #include<fstream> #include<time.h> // My Classes #include "NumberGuess.cpp" #include "ConstPara.cpp" #include "Command.cpp" #include "QuestionAnswer.cpp" #include "MyTimer.cpp" #include "roulette.cpp" using namespace std; void debug_print(str...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QtCore> #include <QtGui> #include <QGraphicsScene> #include <vector> #include<Qcolor> const int Rectangle_Width=30; const int Rectangle_Height=100; struct Process { int pid; float arrival_time; float burst_time; int priority; ...
#include<iostream> #include<iomanip> using namespace std; int main (){ char nome [30]; double salario, venda_total , total_final; cin>>nome; cin>>salario; cin>>venda_total; total_final = salario + venda_total * 0.15; cout << "TOTAL = R$ " << fixed << setprecision(2) << to...
#include "Phonebook.hpp" Phonebook::Phonebook() { this->amount = 0; } Phonebook::~Phonebook() { } void Phonebook::add_new_contact(void) { if (this->amount == 8) std::cout << "Contact list is full!\n"; else if (this->contact_list[this->amount].create_contact() == true) this->amount++; } void Phonebook::sho...
#include <iostream> using namespace std; int main() { int sum(2),count; for (int num=3;num<=100;num+=2){ count=0; for (int k=1;k<=num;k+=2) if(num%k==0) count+=1; if(count==2) sum+=num; } cout<<sum; }
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014 Shuangyang Yang // // 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) //////////////////////////////////////////...
#include <Tanker/Share.hpp> #include <Tanker/Crypto/Format/Format.hpp> #include <Tanker/Errors/Errc.hpp> #include <Tanker/Groups/GroupAccessor.hpp> #include <Tanker/Serialization/Serialization.hpp> #include <Tanker/Trustchain/GroupId.hpp> #include <Tanker/Trustchain/ServerEntry.hpp> #include <Tanker/Trustchain/UserId....
#include "visabustest.h" #include "VisaBus.h" using namespace RsaToolbox; VisaBusTest::VisaBusTest(QObject *parent) : TestClass(parent) { } void VisaBusTest::isVisa() { QStringList paths = QString(qgetenv("PATH")).split(";"); foreach (const QString &path, paths) { qDebug() << path; } if (Vi...
/* -*- Mode: c++; -*- * * 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. * */ group "DOM.Misc.XSLTProcessor"; language ecmascript; require XSLT_SUPPORT; require DOM3_LOAD; require DOM3_SAVE; ...
// Created on: 1992-12-02 // Created by: Isabelle GRIGNON // Copyright (c) 1992-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; template <class T> class array{ T *v; int n; public: array(); array(int nelts); int size(); T & operator()(int i); ~array(); void print(string header=""); void read(string instruction=""); T sum(); T norm(float normval=2); }; typedef array<float> FA; #if...
// // NoGold.h // GetFish // // Created by zhusu on 15/8/17. // // #ifndef __GetFish__NoGold__ #define __GetFish__NoGold__ #include "cocos2d.h" #include "ButtonWithSpriteManage.h" USING_NS_CC; class NoGold : public CCLayer { public: static const int TYPE_GOLD = 0; static const int TYPE_GET = 1; ...
#include <iostream> #include "BasicSocket.h" #include "logger.h" std::string Network::BasicSocket::getIpAddress() { std::string s; s = inet_ntoa(_addr_info.sin_addr); return s; } void Network::BasicSocket::setAddress(struct sockaddr_in &addr) { _addr_info = addr; } bool Network::BasicSocket::connect(...
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; void PreOrderTraverse(TreeNode* T) { if (T == NULL) return; cout << T->val << " "; PreOrderTraverse(T->left); PreOrd...
/* * Copyright 2016 Freeman Zhang <zhanggyb@gmail.com> * * 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 applic...
#pragma once #include "Channel.h" namespace Hourglass { class FileArchive; class Clip { public: void Serialize( FileArchive* archive ); unsigned int GetChannelCount() const { return m_ChannelCount; } Channel* GetChannels() { return m_Channels; } const char* GetName() const { return m_Name.c_str(); } ...