text
stringlengths
8
6.88M
// ASU CSE310 Assignment #4 // Name of Author: Divesh Basina // ASU ID: 1205546806 // Description: this is the main program that reads input from a text file, // it then call hash functions to execute hash commands given in the input. /************************************************************************** //(1)De...
#ifndef _SOCKET_SERVER_H #define _SOCKET_SERVER_H #include "common_defines.h" // #include "game_show.h" using namespace std; #include <thread> #include <string.h> #include <queue> #include <mutex> class SocketServer { public: SocketServer(); ~SocketServer(); static void startup(); sta...
#pragma once namespace sim::custom { class ConstantVMWorkloadModel : public infra::IVMWorkloadModel { public: void Setup( const std::unordered_map<std::string, std::string>& params) override { if (auto it = params.find("required_ram"); it != params.end()) { required_ram_ = ...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFile> #include <QFileDialog> #include <QMessageBox> #include <QVBoxLayout> #include <QHBoxLayout> #include <QTextStream> #include <QDebug> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this)...
#include <stdio.h> int main() { float salario, prestacao; printf("Digite o valor de seu salario: "); scanf("%f", &salario); printf("Digite o valor de sua prestacao: "); scanf("%f", &prestacao); if (prestacao > (salario * 0.3)) { printf("\nEmprestimo negado!!!"); } else { printf("\nEmprestimo aprovado!!...
/* -*- 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(USE_OPDLL) #ifdef MACGOGI #in...
// Copyright 2015 Intelligent Robotics Group, NASA ARC #ifndef ROBUST_FILTER_NODELET_H_ #define ROBUST_FILTER_NODELET_H_ #include <robust_filter/robust_filter.h> #include <nodelet/nodelet.h> namespace robust_filter_node { class RobustFilterNodelet : public nodelet::Nodelet { public: RobustFilterNodelet() {} ~R...
#include <iostream> #include <fstream> #include<cstdio> #include<string.h> #include"defination.h" #include "buffermanager.h" #include "catalogmanager.h" block blocks[BLOCKNUMBER];//预计有10个buffer中的block void block::ClearBlock(){ for (int i=0;i<BLOCKSIZE+1;i++) content[i]=0; filename = ""; dirty = pin = us...
#ifndef NMOS_COMPONENTS_H #define NMOS_COMPONENTS_H #include "cpprest/json.h" #include "nmos/string_enum.h" namespace nmos { // Components (used in raw video flows) // See https://github.com/AMWA-TV/nmos-discovery-registration/blob/v1.2/APIs/schemas/flow_video_raw.json DEFINE_STRING_ENUM(component_name) ...
// 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...
// (C) Copyright Mateusz Loskot 2008, mateusz@loskot.net // Distributed under the BSD License // (See accompanying file LICENSE.txt or copy at // http://www.opensource.org/licenses/bsd-license.php) // #include <liblas/bounds.hpp> #include <tut/tut.hpp> #include <string> #include <vector> #include <stdexcept> #include "...
#include <iostream> #include <cstdio> using namespace std; typedef long long LL; LL nfc(LL n) { if(n == 0 || n == 1) return 1; LL ret = 0; for(int i = 0; i < n; i++) { ret += nfc(i) * nfc(n - 1 - i); } return ret; } int main() { LL n; while(~scanf("%lld", &n)) { LL x; LL ni = 1; for(int i ...
#include <cstdlib> #include <iostream> #include <string> #include <vector> #include <numeric> #include <sstream> // Prototype functions std::vector<std::string> StringToVector(std::string theString, char separator); std::string VectorToString(std::vector<std::string> theVector, char separator); std::string TrimWhiteSp...
#include <QListView> #include "MainWidget.h" #include "ItemsModel.h" #include <ActiveQt/qaxwidget.h> MainWidget::MainWidget(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); }
#ifndef __LSOCKET_H__ #define __LSOCKET_H__ #include "CmnHdr.h" class LSocket { public: LSocket() : m_Socket(INVALID_SOCKET){} LSocket(SOCKET sock) : m_Socket(sock) {} bool IsInvalid() const { return (m_Socket == INVALID_SOCKET); } void Close() { if (m_Socket != ...
// Created on: 1997-05-09 // Created by: Christian CAILLET // Copyright (c) 1997-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 ...
/* -*- Mode: c++; tab-width: 4; 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. * * Espen Sand */ #include "core/pch.h" #include "platforms/quix/commandline/quix_comm...
#include "item.hpp" namespace nora { namespace scene { item::item() : instance_countee(ICT_ITEM), count_(0) { } item::item(uint32_t pttid, int count) : instance_countee(ICT_ITEM), pttid_(pttid), count_(count) { } ...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2002 Opera Software ASA. 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 XSLT_SUPPORT #include "modules/xslt/src/xs...
#include <iostream> #include <deque> #include <stack> using namespace std; // 14分39秒(ヒント見た) void sortStack(stack<int>& input){ stack<int> largeStack; while(!input.empty()){ int num = input.top(); input.pop(); while(!largeStack.empty() && num <= largeStack.top()){ input.push...
// // 5. Longest Palindromic Substring.cpp // leetcode // // Created by Xujian CHEN on 5/25/20. // Copyright © 2020 Xujian CHEN. All rights reserved. // /* 5. Longest Palindromic Substring Medium 6410 513 Add to List Share Given a string s, find the longest palindromic substring in s. You may assume tha...
#include<iostream> #include<cstring> #include<cmath> #include<vector> #define FOR0(i,n) for(i=0;i<n;i++) #define FOR(i,j,n) for(i=j;i<n;i++) #define FORD(i,j,k) for(i=j;i>=k;i--) #define MAX(a,b) (a)>(b)?(a):(b) #define MIN(a,b) (a)<(b)?(a):(b) using namespace std; int n,X[10],Y[10]; float table[10][300]; f...
////////////////////////////////////////////////////////////////////// ///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 <Wire.h> #include "SparkFun_Qwiic_Joystick_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_joystick JOYSTICK joystick2; const int sampleWindow = 150; // Sample window width in milliseconds unsigned int shout2; int ledPin2 = 6; void setup() { Serial.begin(9600); pin...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #include "core/pch.h" #ifdef DATASTREAM...
#include "process.h" #include <unistd.h> #include <cctype> #include <sstream> #include <string> #include <vector> #include "linux_parser.h" using std::string; using std::to_string; using std::vector; template <typename Z> //Template to check stol is not operating on an invalid argument Z convertStr(string x) { Z...
// // Server.h // Tarea4Ejercicio3 // // Created by Daniel on 16/10/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #ifndef __Tarea4Ejercicio3__Server__ #define __Tarea4Ejercicio3__Server__ #include <iostream> #include "ListaEnlazada.h" #include "Mensaje.h" class Server{ public: Server(); ~Serv...
//ROS includes #include "ros/ros.h" #include "std_msgs/String.h" #include <sensor_msgs/image_encodings.h> #include <sensor_msgs/Image.h> #include <ros/callback_queue.h> //Include for messages #include <markerlocator/markerpose.h> #include <feature_detection/coord.h> //Opencv includes #include <opencv2/imgproc/imgproc.h...
/* -*- 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. */ /** \file * This implementation of the PlatformUpdater interface is a cheat to get ...
#include "stdafx.h" #include "Prof-UIS.h" extern "C" __declspec(dllexport) HANDLE WINAPI UISalPopupTipWindowCreate(LPCWSTR text, HICON icon, int style) { // create a new popup window CExtPopupMenuTipWnd* popupMenuTipWindow = new CExtPopupMenuTipWnd(); // if passed, set additional data if (text != NULL) { popup...
/********************************************************************************** User interface Has overall class definition and private and public functions Edited by Ethan Lauer on 4/8/19 *********************************************************************************/ #include<Arduino.h> class Di...
#ifndef _AILIST_H_ #define _AILIST_H_ #include <list> //#include "aisprite.h" class AISprite; class AIlist { public: AIlist(); ~AIlist(); virtual void attach(AISprite *); virtual void detach(AISprite *); virtual void notify(); private: std::list<AISprite*> _observers; }; #endif
#include <iostream> #include <fstream> #include <string> #include <typeinfo> using namespace std; #define INSTRUCTION_LEN 16 #define VERBOSE_OUTPUT true typedef enum OPCODE{ ADD, SUB, ADDI, SLL, SRL, AND, NOR, OR, ORI, XOR, LW, SW, BEQ, BLTZ, J, BLT, NONE_OPCODE //Used instead of 'NULL' because 'NULL...
// // Created by Mirco Altenbernd on 30.10.19. // #ifndef ARGOS3_EXAMPLES_READINGSSERVICE_H #define ARGOS3_EXAMPLES_READINGSSERVICE_H #include <argos3/plugins/robots/loot-bot/control_interface/ci_lootbot_light_sensor.h> #include <argos3/plugins/robots/loot-bot/control_interface/ci_lootbot_proximity_sensor.h> #include ...
#include<bits/stdc++.h> using namespace std; int main() { // only gravity will pull me down // Number of Unique Paths int t, m, n; cin >> t; while (t--) { cin >> m >> n; int dp[m][n]; dp[0][0]=1; for(int i=1; i<m; i++) dp[i][0] = 1; for(int j...
/* -*- 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 "adjunct/quick/controller/BookmarkPrope...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #include "core/pch.h" #ifdef _NATIVE_...
#include <crtdbg.h> #include <assert.h> #include <time.h> #include "../VFS/BlockManager.h" #include "../VFS/IFile.h" #include "../VFS/BlockFS.h" #include "../VFS/UnpackedFile.h" char data[1024*1024]="\0"; char data1[1024]="\0"; int main() { _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); IFile...
#include "G_Global_IO.h" #include "G_Particles_IO.h" #include <ctime> g_global_io::g_global_io() { ptr=0; } g_global_io::~g_global_io() { } void g_global_io::GIO_installParticleHandle( g_particles_io &particles_ios ) { ptr+=1; particles_handle.push_back(particles_ios); handle_ptr.push_back(ptr); g_particles_...
#include "./ProduceToken.hpp" namespace dot_pp { namespace lexer { namespace states { namespace { inline bool isDirectedEdge(const Token& token) { return token.to_string() == "->"; } inline bool isEdge(const Token& token) { ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software ASA. 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/logdoc/logdoc.h" #inclu...
#include <iostream> #include "B_tree_node_imp.hpp" #include "B_Tree.hpp" #include "disk.hpp" using namespace std; using namespace zhf_lib; int main() { try { BTree<int, string> B_tree(2); B_tree.insert(10, "hehe"); } catch (BTreeNode<int, char>::Bad_Allocate) { cout << "too much tree...
#include <iostream> class Vector { private: int * arr; int len; public: int reserve = 5; Vector() { arr = (int * ) malloc(reserve * sizeof(int)); len = 0; } Vector(int size) { arr = (int * ) malloc(size * sizeof(int)); ...
#define CATCH_CONFIG_MAIN #include "../external/catch2/catch.hpp" #include "../src/math/is_odd.hpp" TEST_CASE("Is Odd Test", "[is_odd]") { REQUIRE(Math::isOdd(3) == true); REQUIRE(Math::isOdd(6) == false); }
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2012-2013. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #ifndef _GDCMIO_DICOMREFINSTANCEWRITER_HXX_ #define _GDCMIO_DICOMREFINSTAN...
#include "entities/citizen.hpp" #include "job/joblist.hpp" #include "job/job.hpp" #include "city.hpp" #include "clock.hpp" #include "components/ai/ai.hpp" #include "needs/needssystem.hpp" #include "components/renderable.hpp" #include "components/citizenname.hpp" #include "components/movable.hpp" #include "components/po...
#include<iostream> using namespace std; int main() { int n; cin>>n; int arr[n],sum=0; for(int i=0;i<n;i++) cin>>arr[i];cout<<endl; for(int i=0;i<n;i++) { sum=sum+arr[i]; } cout<<sum; return 0; }
#include <stdlib.h> #include <string> #include <iostream> #include "bitmap_informations.h" #include "file_operations.h" // https://google.github.io/styleguide/cppguide.html int main(int argc, char* argv[]) { if (argc == 1) { std::cout << "There are no arguments" << std::endl; return 0; } std::string input_f...
#include "NauModular.hpp" struct Tension : Module{ enum ParamIds{ VOLT_PARAM, NUM_PARAMS }; enum InputIds{ NUM_INPUTS }; enum OutputIds{ VOLT_OUTPUT, NUM_OUTPUTS }; enum LightIds{ BLINK_LIGHT, NUM_LIGHTS }; Tension() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS)...
//By SCJ #include<iostream> using namespace std; #define endl '\n' struct Node{ int flag,ans; }seg[100005*8]; inline void down(int i) { if(seg[i].flag) seg[i<<1]=seg[i<<1|1]=seg[i],seg[i].flag=0; } inline void up(int i) { seg[i].ans=seg[i<<1].ans|seg[i<<1|1].ans; } inline void build(int l,int r,int i) { if(l==r)...
#ifndef MCR_SCENE_SEGMENTATION_MUlTI_PLANE_SEGMENTATION_ROS_H #define MCR_SCENE_SEGMENTATION_MUlTI_PLANE_SEGMENTATION_ROS_H #include <ros/ros.h> #include <sensor_msgs/PointCloud2.h> #include <pcl/point_types.h> #include <pcl_ros/point_cloud.h> #include <vector> class MultiPlaneSegmentationRos { public:...
#include <ros/ros.h> #include <geometry_msgs/PoseArray.h> #include <geometry_msgs/Polygon.h> // Define callbacks here geometry_msgs::PoseArray boxmsg; geometry_msgs::Point32 p; geometry_msgs::Polygon polygonmsg; void callback(const geometry_msgs::PoseArray& msg) { boxmsg = msg; geometry_msgs::Polygon poly; //R...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- // // Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. // #ifndef SEARCH_PROTECTION_H #define S...
/* 类模板的静态成员Bug */ #include <iostream> using namespace std; template < typename T> class testCase{ public: static int _data; }; //直接初始化 testCase<int>::_data = 1; testCase<char>::_data = 2; int main(int argc, char const *argv[]) { cout << testCase<int>::_data << endl; cout << testCase<char>::_data << endl; testC...
#include <string> #include <cmath> #include <fstream> #include <iostream> #include <sstream> #include <list> #include <algorithm> #include <set> #include <map> #include <stack> #include <queue> #include <numeric> #include <bitset> #include <deque> //#include <random> #include <string.h> #include <stdlib.h> #include <ve...
#ifndef __LIB_COMM_INTERFACE_H #define __LIB_COMM_INTERFACE_H #include <mutex> #include <fstream> #include <iostream> #include <string> #include "mosquitto.h" #include <jsoncpp/json/json.h> #include "ros/ros.h" #include "transfer_msgs/Moveto.h" #include "transfer_msgs/AreaInfo.h" #include "transfer_msgs/AreaState.h" ...
#include "PostMaster.h" #include "Message.h" #include "MessageType.h" #include "Subscriber.h" namespace Platy { namespace Game { std::vector<std::vector<Subscriber*>> PostMaster::mySubscribers; PostMaster::~PostMaster() { for (auto& it : mySubscribers) { it.clear(); } mySubscribers.clear(); ...
#include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_oarchive.hpp> #include <boost/serialization/vector.hpp> #include <boost/serialization/map.hpp> #include <boost/serialization/string.hpp> #include <boost/serialization/base_object.hpp> #include "ProgramBddContext.hpp" #include "glog/logging.h" #in...
#ifndef __ELEMENTO_INEXISTENTE_EXCEPTION_H__ #define __ELEMENTO_INEXISTENTE_EXCEPTION_H__ #include <string> /** * Excepción provocada cuando se intenta acceder a un elemento que no existe * en la lista. * */ class ElementoInexistenteException { private: std::string mensaje; public: Eleme...
#include "trivia.h" #include "ui_trivia.h" Trivia::Trivia(QWidget *parent) : QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowTitleHint ), ui(new Ui::Trivia) { ui->setupUi(this); ui->b_ok->setEnabled(false); configureGame(); } /**************** * Clean all minigame code ****************/ T...
#include <stdexcept> #include <boost/asio.hpp> #include "HttpServer.hpp" #include "Server.hpp" #include "MongoDB.hpp" namespace pt = boost::property_tree; int main(int argc, char const *argv[]) { std::string configFile = "config.json"; if (argc == 2) { configFile = argv[1]; } try { boost::property_t...
// includes system #include <cmath> // includes, project #include "nebula.h" #include "red_type.h" #include "red_macro.h" gas_component::gas_component(var_t r_1, var_t r_2, var_t r_SL, var_t f_neb, var_t Sigma_1, var_t f_gas, var_t p) : r_1(r_1), r_2(r_2), r_SL(r_SL), f_neb(f_neb), Sigma_1(Sigma_...
#include<bits/stdc++.h> using namespace std; int main(){ int n , a; cin>>n; vector<int>v; for (int i = 0; i < n; i++) { cin>>a; v.push_back(a); } int dif = abs(v[0] - v[n-1]); int f = 1 , l = n; for (int i = 0; i < n-1; i++) { if (abs(v...
// Created on: 2000-08-15 // Created by: Andrey BETENEV // Copyright (c) 2000-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.1 a...
#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>...
#ifndef LOGGER_H #define LOGGER_H //shortcuts to log //can be used like LOG_E("something bad happened!") #define LOG_E(message) Logger::instance()->Error(message) #define LOG_I(message) Logger::instance()->Info(message) #define LOG_W(message) Logger::instance()->Warn(message) #define LOG_D(message) Logger::instance()-...
#include <iostream> int exercise01() { int i = 0, n, sum = 0; std::cout << "Suma kolejnych liczb dodatkich od 0 do n" << std::endl; std::cout << "Podaj margines\nn: " << std::endl; std::cin >> n; for (; i <= n; i++) { sum += i; } std::cout << " Suma wynosi: " << sum << std::endl; return 0; }
#include <iostream> #include <cmath> #include "SimplifiedDes.h" using namespace std; unsigned short int encrypt( unsigned short int key , short int message ){ unsigned short int subKey1, subKey2,aux,aux1,subKey[2],r1,r2; char auxMessage; Permutation *ip; ip = memoryAllocation(8); generateSubKeys( ...
// COP3530SortingAnalysis.cpp // Leeson Chen (UFID 7907-2212) #include <iostream> #include <ctime> #include <ratio> #include <chrono> #include <fstream> #include <string> #include <sstream> // We are an all-inclusive script that embraces diversity using namespace std; // void heapSort(int arr[], int n); // void heapify...
//================================================================================================== // Name : DebugUtil.cpp // Author : Ken Cheng // Copyright : This work is licensed under the Creative Commons // Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this /...
/******************************************************************************** ** Form generated from reading UI file 'cnfdialog.ui' ** ** Created: Thu Apr 26 21:38:44 2012 ** by: Qt User Interface Compiler version 4.6.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! *******...
#pragma once #include <iostream> #include <stdio.h> #include <math.h> #include <array> #include"SDL.h" class Draw { private: public: SDL_Window* window; SDL_Renderer* renderer; std::array<SDL_Rect,8> agentes; void DrawWindow() { SDL_Init(SDL_INIT_VIDEO); window = SDL_CreateWindow("hola", SDL_WINDOWPOS_UNDEFIN...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2011-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef __OPURL_H__ #define __OPURL_H__ #include "modules/url/u...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2005-2006 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/svg/src/svgpch.h" #if...
// // OpenGLRenderer.cpp // Wonderland // // Created by Admin on 02.08.2021. // #include <iostream> #include <glm/gtc/matrix_transform.hpp> #include "OpenGLRenderer.hpp" OpenGLRenderer::OpenGLRenderer(std::string rootPath) : base((rootPath + "/Vertex.glsl").c_str(), (rootPath + "/Fragment.glsl").c_str()) ...
#ifndef __IGCONTEXT_H__ #define __IGCONTEXT_H__ #include "igWidget.h" #include "igColor.h" #include "igIdent.h" #include "igRect.h" #include "igSizing.h" #include <string> #define DEFAULT_CHARSET " QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890~!@#$%^&*()_+=-\\|{}[]:;\"'<>,.?/" // draggable >>>>>>>>...
// // konfiture_node.hh // // Author: // Alexander Nusov // // Copyright (C) 2014 Alexander Nusov // // 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 // wi...
#ifndef GRAPHICSCENE_H #define GRAPHICSCENE_H #include <QGraphicsScene> #include <QGraphicsPixmapItem> class GraphicScene : public QGraphicsScene { Q_OBJECT public: GraphicScene(QObject *parent = 0); ~GraphicScene(); QGraphicsPixmapItem* hyperPixmap(); QGraphicsPixmapItem* maskPixmap(); void ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) Opera Software ASA 2009-2011 * * WebGL compiler -- compilation context. * */ #ifndef WGL_CONTEXT_H #define WGL_CONTEXT_H #include "modules/webgl/src/wgl_glsl.h" #include "modules/webgl/src/wgl_ast.h" #include "modules/...
#ifndef SYMBOLIC_NAVIGATION_H #define SYMBOLIC_NAVIGATION_H #include <vector> #include <cmath> //#include <symbolic_navigation/structs.h> class SymbolicNavigation { public: SymbolicNavigation(); ~SymbolicNavigation(); private: }; #endif
#include <assert.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> #include "codegenc.h" #include "codegenmlir.h" using namespac...
/* 快速幂:要考虑base为0和是负数的情况 */ class Solution { public: double Power(double base, int exponent) { if(base == 0) return 0; if(exponent == 0) return 1; if(exponent < 0) { base = 1.0/base; exponent = -exponent; } if(exponent&1){ return base*Power(...
int L[maxN], R[maxN], T[maxN], root[N], idx, a[N], n ; void build(int i, int b, int e){ if(b == e)return ; int mid = (b + e) >> 1 ; L[i] = ++idx ; R[i] = ++idx ; build(L[i], b, mid) ; build(R[i], mid + 1, e) ; } int update(int i, int b, int e, int pos, int v){ if(pos < b or e < pos)return i ; int id = ++idx ...
#ifndef INCLUDE_SEARCH_HXX #define INCLUDE_SEARCH_HXX #include "boardrep.hxx" #include "moves.hxx" const signed int INFINITE = 32767; const signed int NEG_INFINITE = -32768; signed int MiniMax( Position&, bool, signed int, signed int, int ); MoveRep Search( Position&, int ); #endif
#pragma once #include "common.hpp" namespace Cartridge { template <bool wr> uint8_t access(uint16_t addr, uint8_t v = 0); template <bool wr> uint8_t chr_access(uint16_t addr, uint8_t v = 0); void signal_scanline(); int load(const char* fileName); bool loaded(); }
#include<iostream> using namespace std; int main() { cout<<"\n\t\t*** INSERTION SORT ***\n"; int n; cout<<"\n Enter no. of elements in array : "; cin>>n; int arr[n]; cout<<"\n Enter an element in array :\n"; for(int i=0; i<n; i++) { cout<<" "; cin>>arr[i]; } for(int i=1; i<=n-1; i++) ...
#ifndef MATH_IS_DIVISIBLE_HPP #define MATH_IS_DIVISIBLE_HPP namespace Math { static bool isDivisble(int dividend, int divisor) { return dividend % divisor == 0; } } // namespace Math #endif /* end of include guard : MATH_IS_DIVISIBLE_HPP */
#include <iostream> using namespace std; void test(int a) { cout<<&a<<endl; }; void test1(int& a) { cout<<&a<<endl; }; int main() { int x; cout<<&x<<endl; test(x); test1(x); /* Địa chỉ của đối số x là 0x61fe1c. Địa chỉ của tham trị a là 0x61fdf0. Địa chỉ của tham biến a là 0x...
#include <iostream> int main() { int choice = 0; std::cout << "1. Disable Riot Vanguard" << std::endl; std::cout << "2. Enable Riot Vanguard" << std::endl; std::cout << "3. Riot Vanguard Status" << std::endl; std::cout << "Choice (1-3): "; std::cin >> choice; system("cls"); if (choice == 1) {...
# include<iostream> using namespace std; void addMines(int f[30][30],char f2[30][30],int rows,int cols,int x,int y) { for(int row = x-1; row <= x+1 && row < rows; row++) { for(int col = y-1; col <= y+1 && col < cols; col++) { if(row >= 0 && col >= 0 && !(row == x && col == y)) { if(f2[row][col] != '*') { ...
#include <iostream> #include <string> #include "STRING.hpp" #include <vector> #include "INTEGER.hpp" #include "CHAR.hpp" using namespace std; int menu() { int opcion = 0; cout <<endl << "--------Menu---------\n" << "1) Agregar Integer\n" << "2) Agregar CHAR\n" << "3) Agregar STRING\n" << "4...
/*==================================================================== Copyright(c) 2018 Adam Rankin 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 without limitati...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef POSIX_IPC_BINARY_SELECTOR_H #define POSIX_IPC_BINARY_SELEC...
/* * The test file of the Class Queue */ #include <iostream> #include "queue.h" using std::cout; using std::endl; int main(void) { Queue *test = new Queue(); QElemType e; std::cout<<"the length is "<<test->QueueLength()<<std::endl; test->EnQueue(1); std::cout<<"the length is "<<test->QueueLength()<<std::end...
#include <iostream> #include <vector> #include <string> #include <list> #include <stack> #include "dfs.hpp" #include "dfs_applications.hpp" using namespace std; int main() { int n; vector<Node<int>*> nodes; vector<vector<bool>> adj_matrix; nodes.reserve(1000); adj_matrix.reserve(1000); for (aut...
vector<string> numbers = {"abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; class Solution { public: vector<string> letterCombinations(string digits) { vector<string> ret; if(digits.empty()) return ret; string cur = ""; dfs(digits,0,ret,cur); return ret; } void df...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright 2009-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef _MODULES_DATABASE_PREFSCOLLECTIONDATABASE_H_ #define _MOD...
//知识点: Trie 树(字典树),模拟 /* By:Luckyblock 使用Trie树 记录字串 , 并在字串的尾部打标记; 进行检查时, 1. 如果无法匹配,那么说明Trie树中不存在此字串, 输出Wrong 2. 如果匹配后,字串尾部未被打上重复标记, 那么证明合法,输出Ok,并打上 重复标记 3. 如果匹配后,字串尾部被打上重复标记,\ 说明重复出现,输出Repeat; */ #include<cstdio> #include<cstring> #include<ctype.h> const int MARX = 5e4+10; //============...
#include "myobject.h" MyObject::MyObject(QObject* parent) : QObject(parent) { }
#include "Enemy3Fighting.h" #include "Enemy3.h" Enemy3Fighting::Enemy3Fighting() { } Enemy3Fighting::~Enemy3Fighting() { } Enemy3Fighting::Enemy3Fighting(Enemy3Data *data) { this->mData = data; } void Enemy3Fighting::Update() { // mData->enemy->AddPosition(1, 0); } Enemy3State::StateName Enemy3Fighting::Get...