text
stringlengths
8
6.88M
// Created on: 1996-02-13 // Created by: Jacques GOUSSARD // Copyright (c) 1996-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the G...
#ifndef BOSS_H #define BOSS_H #include "EnemyBase.h" class Mesh; class Boss : public EnemyBase { public: Boss(); Boss(Mesh* _mesh); virtual ~Boss(); void Init(float _hp = 100.0f, double _speed = 2.0, int _enemyType = 1, bool _invul = false); void SetTypeOfEnemy(int _enemyType); void Update(double dt); void...
// Created on: 1993-02-02 // Created by: Christian CAILLET // 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 ...
#include <stdio.h> #include <iostream> #include <math.h> #include <vector> #include <iostream> #include <sstream> #include <fstream> #include <string> #include <iomanip> #include <stdexcept> #include <cstdlib> #include <stdlib.h> #include <list> using namespace std; class request { public: int index; int arrivalTi...
#include<bits/stdc++.h> using namespace std; int main(){ string S; cin >> S; int x = S.size(); int count_p = 0; int count_m = 0; for(int i=0; i <x; i++){ if(S.at(i) == '+'){ count_p++; } else if(S.at(i) == '-'){ count_m++; } } cout << count_p - count_m + 1<< endl; } //...
/* -*- 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. */ #ifndef DIALOG_CONTEXT_LISTENER_H #define DIALOG_CONTEXT_LISTENER...
#include "..\h\ellipse.h" CEllipse::CEllipse() { } CEllipse::CEllipse(EBRUSHSTYLE _iBrushStyle, int _iHatchStyle, COLORREF _FillColor, int _iPenStyle, int _iPenWidth, COLORREF _iPenColor) { m_iBrushStyle = _iBrushStyle; m_iHatchStyle = _iHatchStyle; m_iFillColor = _FillColor; m_iPenStyle = _iPenStyle; m_iPen...
/* * 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. */ #pragma once #include <folly/Optional.h> #include <quic/QuicConstants.h> #include <quic/state/QuicPriorityQueue.h> #include <chr...
#include "moving_objects_tracker.h" #include <geometry_msgs/TransformStamped.h> #include <kkl/alg/nearest_neighbor_association.hpp> #include <moving_object_tracker/TrackerCovarianceArray.h> #include <tf2_geometry_msgs/tf2_geometry_msgs.h> namespace kkl { namespace alg { /** * @brief definition of the distance bet...
/*** * Project TowerDefense * * Main file * ***/ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include "class.h" #include "methods.cpp" #include "mapas.cpp" int main(){ //Creacion de objetos map mapa1(10,50,' ', '-', '|', A); enemy pepe(1, 'X', 2, 0, 3); //G...
#include <sys/ipc.h> #include <semaphore.h> #include <sys/sem.h> #include <sys/shm.h> #include <fcntl.h> #include <iostream> #define RWRR (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) using namespace std; sem_t call_sem_init( ); sem_t call_sem_open( ); // generate a key key_t getIpcKey() { return ftok( "/home/tomabot/l...
//---------------------------------------------------------------- // GameState.cpp // // Copyright 2002-2005 Raven Software //---------------------------------------------------------------- #include "../../idlib/precompiled.h" #pragma hdrstop #include "GameState.h" /* ==============================================...
// // FastMarchingMethod.h // FastMarchingMethod // // Created by fimi on 30/09/14. // Copyright (c) 2014 Filip Michlik. All rights reserved. // #ifndef __FastMarchingMethod__FastMarchingMethod__ #define __FastMarchingMethod__FastMarchingMethod__ #include <iostream> #include "VelocityModel.h" struct GridPositi...
//================================================================================================== // Name : UnknownsSolver.h // Author : Ken Cheng // Copyright : This work is licensed under the Creative Commons // Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of thi...
void bonk_fsm(float reading){ /* * Main Bonk State Machine. * Controls what actions are * completed. */ switch(state){ case IDLE: if (reading > threshold) { Serial.println("TRIGGERED"); Serial.println(reading); state =...
#include "clientDummy.h" int main(int argc, char* argv[]){ if(argc != 7){ cout << "Usage is ./clientSNFS -serverport port# -serveraddress address# -mount directory" << endl; exit(EXIT_FAILURE); } check_values(argv[1], "-serverport"); check_port(argv[2], "port#"); int serverPort = stoi(argv[2]); check_values...
#include "mathutil.h" using namespace pb; float pb::Clamp(float x, float min, float max) { return x < min ? min : (x < max ? x : max); }
/******************************************************************************* * filename: C_EqualSpreadComplexityPatternInitialiser.cpp * description: Implementation of 'EqualSpreadComplexityPatternInitialiser' class * author: Moritz Beber * created: 2011-02-11 * copyright: Jacobs University Breme...
#pragma once #include <Arduino.h> #include "gfx.h" #include "RtcClock.h" enum ClockStyle { DISPLAY_SECONDS, DISPLAY_ONLY_MINUTES }; #define MAX_TIME_TEXT_LENGTH 10 #define TEXT_SECONDS_OFFSET 7 #define GEVENT_CLOCK GEVENT_USER_FIRST #define GCLOCK_SOURCE ((GSourceHa...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <stdio.h> #include <string.h> using namespace std; class AnagramFree { public:...
#include<iostream> using namespace std; int main() { int ftemp,ctemp; //for temperature in fahrenheit cout << "Enter temperature in fahrenheit: "; cin >> ftemp; ctemp = (ftemp-32) * 5 / 9; cout << "Equivalent in Celsius is: " << ctemp << '\n'; return 0; }
#include <iostream> #include "MonteCarloPiSim.h" using namespace std; int main() { MonteCarloPiSim piSim; cout << "After 100 darts the approximation of PI is " << piSim.estimatePi(100) << endl; cout << "After 1000 darts the approximation of PI is " << piSim.estimatePi(1000) << endl; cout << "After 100...
#include <bits/stdc++.h> using namespace std; class code { int id; public: //Default Constructor code() {} //Parameterized Constructor code(int a) { id = a; } //Copy Constructor code(code &x) { x.id = id; } void display() { cout << id; ...
#include <iostream> #include <vector> using namespace std; class Menu; class Draw { public: void DrawTable(Menu& menu, Account& newAccount, int page); void DrawPages(Account& newAccount, int minEntry, int maxEntry); void DrawMonthPages(Account& newAccount, int minEntry, int maxEntry); void DrawMenu(Account& n...
#pragma once #include <unordered_map> #include <string> #include <vector> #include "StrID.h" namespace Hourglass { class IBehavior; class BaseBehaviorPool; class BehaviorTree; class BehaviorFactory { public: ~BehaviorFactory() {} static IBehavior* GetFreeBehavior( StrID name ); /** * Get a fully ass...
// Copyright (C) 2004 Id Software, Inc. // #ifndef __DECLSKIN_H__ #define __DECLSKIN_H__ /* =============================================================================== idDeclSkin =============================================================================== */ typedef struct { const idMaterial * from; //...
#include "base_includes.hpp" #include "generators.hpp" #include "perf.hpp" #include "module.hpp" #include "simple.hpp" template <typename key_t, typename val_t > static void bubble_sort(std::vector<pair_t<key_t, val_t>>& arr) { const size_t n = arr.size(); if ((ssize_t)n < 1) return; bool swapped...
#include <iostream> using namespace std; int main() { int a,b,c; for (a=1; a<=500; a++) { for (b=1; b<=500; b++) { c=1000-b-a; if ((a*a+b*b)==c*c && a<b ) { cout << a*b*c << endl; } } } return 0; }
#ifndef AMVK_PIPELINE_MANAGER_H #define AMVK_PIPELINE_MANAGER_H #include <cstddef> #include <vector> #include "macro.h" #include "state.h" #include "pipeline_builder.h" #include "pipeline_cache.h" #include "tquad.h" #include "model.h" #include "skinned.h" #include "point_light.h" #include "g_buffer.h" namespace Pipel...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { ll t; cin>>t; while(t--) { ll n; cin>>n; string str; map<string,vector<char>> map1;//map of str and vector confusion lol for(ll i=0;i<n;i++) { //use cin instead of the fu****g getline cin>>str; if(str.size()>0)...
#ifndef SIET_H #define SIET_H extern float *** at; extern float X,Y,Xn,Yn,Zn; extern void nastav_polohu_primaca_a_dlzku(); extern void save_interface(float ***at,int id),init_interface(float ***at,int id); class Bod { public: Bod(const short &smer,const short &ii,const short &jj,const short &kk): s(smer),i(ii),j(jj)...
#include <iostream> #include <stdio.h> using namespace std; int main() { int A, B, C, D, DIFERENCA; scanf("%d", &A); scanf("%d", &B); scanf("%d", &C); scanf("%d", &D); DIFERENCA = (A*B - C*D); printf("DIFERENCA = %d\n", DIFERENCA); return 0; }
#include "src/graphics/window.h" #include "src/graphics/buffers/buffer.h" #include "src/graphics/buffers/vertex_array.h" #include "src/graphics/buffers/index_buffer.h" #include "src/utils/error_check.h" #include "src/utils/timer.h" #include "src/graphics/texture/texture_2d.h" #include "src/graphics/texture/texture_mana...
#ifndef OPENCV_XTION_IOP_H #define OPENCV_XTION_IOP_H #include <cstdint> #include <vector> //OPENCV2 #include "core/core.hpp" #include "Edvs/Event.hpp" #include "xtion_io.h" #include "config.h" namespace dedvs { DEdvsStatus getDepthFrameCVMat(openni::VideoStream* video_stream, cv::Mat* cv_mat); void getDepthF...
#include <iostream> #include "CmdMessenger.h" using namespace std; enum { ksetled }; int main(int argc, char *argv[]) { if(argc == 2){ char op; cmd::CmdMessenger arduino(argv[1], 9600); cmd::Cmd led(ksetled); cmd::Timeout timeout = cmd::Timeout::simpleTimeout(1000); arduino.setTimeout(time...
#pragma once #include <windows.h> namespace sn { struct Color { float r, g, b; Color() : r{0}, g{0}, b{0} {} Color(float r, float g, float b) : r{r}, g{g}, b{b}{} float& operator [] (size_t index) { return (&r)[index]; } //const float& operator [] (size_t index) { return (&r)[index]; } void Set(float r...
// // Created by frenchcommando on 11/09/2019. // #include <iostream> #include <euler_project/EulerProject.h> int main() { freopen("/mnt/c/Users/marti/CLionProjects/EulerProject/output.txt", "w", stdout); return 0; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. ** */ #include "core/pch.h" #ifdef LCMS_3P_SUPPORT #include "modul...
/****************************************************************************** * * * Copyright 2018 Jan Henrik Weinstock * * * ...
/* -*- c++ -*- */ /* * Copyright 2015 <+YOU OR YOUR COMPANY+>. * * This 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, or (at your option) * any later version. * * This software is d...
/** Kabuki SDK @file /.../Source/Kabuki_SDK/include/_2D/Vect_f.h @author Cale McCollough @copyright Copyright © 2016 Cale McCollough @license Free and open-source. You can find a copy of the license that YOU MUST READ in the accompanying ./ReadMe.md, file incorporated herein by this refere...
// This file was created to group tools into different categories // Melee weapons hatchet, machete, crowbar, and baseball bat added directly to building loot. // This list contains small tools that can spawn anywhere ToolsSurvival[] = { {Loot_TOOL, 1, ItemKnife}, {Loot_TOOL, 1, ItemMap}, {Loot_TOOL, 1...
/*********************************************************\ * 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...
#pragma once #include <cstdint> void init_xor(); void trevi_xor( uint8_t* buffer_a, uint8_t* buffer_b, unsigned int bufferSize );
// 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 Lesser General Public License version 2.1 as published // by the Free Software Foundation, with spe...
#include <cstdio> #include <fstream> #include <deque> #include <iostream> #include <vector> #include <string> #include <exception> #include <queue> #include <functional> #include <ctime> #include <boost\graph\adjacency_list.hpp> #include <boost\graph\dijkstra_shortest_paths.hpp> #include <boost/graph/graph_traits.hpp> ...
#ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" #include "Tower.h" #include "Waypoint.h" #include "libs/pugixml/pugixml.hpp" #include "Enemy.h" struct Circle { cocos2d::Vec2 center; float radius; }; class HelloWorld : public cocos2d::Layer { public: // there's no 'id' i...
#include "integration.hpp" namespace { #include "integration_rules.ipp" } namespace Time { double Integrate(const std::function<double(double)>& f, const Element1D& elem, size_t degree) { assert(degree < integration_rules.size()); double integral = 0.0; for (const auto [p, w] : integration_rules...
type attributePayload = | BoolPayload(bool) | FloatPayload(string) | IdentPayload(Longident.t) | IntPayload(string) | StringPayload(string) | TuplePayload(list(attributePayload)) | UnrecognizedPayload; let tagIsGenType = s => s == "genType" || s == "gentype"; let tagIsGenTypeImport = s => s == "genType....
/* * 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...
#include "job.h" #include "dispatcher.h" #define LED (LED_BUILTIN) #define delay2(value) vTaskDelay(value / portTICK_PERIOD_MS) //////////////////////////////////////////////////////////////////////// // led task //////////////////////////////////////////////////////////////////////// class processingWorker : dispatc...
#include "Consumer.h" #include "Utils.h" #include <iostream> #include <sstream> #include <string> #include <unistd.h> using namespace std; // Consumer class, which encapsulates the functionalities // for a consumer, such as watching the pipe and printing // the read values. // The constructor receives an array of ref...
//$$---- EXE CPP ---- //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop //--------------------------------------------------------------------------- USEFORM("MainForm.cpp", Experiment); USEFORM("PredStart.cpp", PStart); USEFORM("BuildProtocol.cpp", ProtoBui...
/* * 数组排序后相邻元素的最大差值 */ #include <bits/stdc++.h> using namespace std; class Solution{ public: int max_minus(vector<int> &nums){ //1.求出数组最大最小值 int n = nums.size(); int _max = nums[0]; int _min = nums[0]; for(int i=1; i<n; ++i){ _max = max(_max,nums[i]); ...
#include <opencv2/features2d.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/opencv.hpp> #include <vector> #include <iostream> #include <string> using namespace std; using namespace cv; const float nn_match_ratio = 0.8f; // Nearest neighbor matching ratio int main(int argc, char** argv) { string imageN...
/* * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping * Framework Based on Octrees * http://octomap.github.io * * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg * All rights reserved. License for the viewer octovis: GNU GPL v2 * http://www.gnu.org/licenses/old-licen...
#ifndef VIEWER_H #define VIEWER_H #include <fstream> #include <vector> #ifndef WIN64 #define EIGEN_DONT_ALIGN_STATICALLY #endif #include <Eigen/Dense> #include <opencv2/core/core.hpp> #include <boost/thread/thread.hpp> #include <pcl/common/common_headers.h> #include <pcl/visualization/pcl_visualizer.h> void run...
/* -*- 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. */ #ifndef ACCESSIBILITY_TREE_URL_NODE_H #define ACCESSIBILITY_TREE_...
// Author: Kirill Gavrilov // Copyright (c) 2019 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 published // by the Free Softwar...
// Created on: 1998-03-27 // Created by: Robert COUBLANC // Copyright (c) 1998-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...
/* * ===================================================================================== * * Filename: replace.cpp * * Description: Replacement tool * * Version: 1.0 * Created: 28.02.2014 15:56:34 * Revision: none * Compiler: gcc * * Author: Marcel Neidin...
// Copyright (c) 2022 ETH Zurich // // 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) // This test verifies that threads that are suspended get rescheduled on the // same threa...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 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 OpenSSLCertificate.cpp * * SSL certificate implementati...
#include <Node.hpp> /* class Node { public: Node(); Node(double x, double y, double flow, int id); ~Node(); double x() const; double y() const; double flow() const; int id() const; private: double x_; double y_; double flow_; int id_; };*/ cie::pipenetwor...
#pragma once #include "RocketMQProducer.h" #include "DefaultMQProducer.h" #include <queue> using namespace rocketmq; class RocketMQSyncProducer final : public RocketMQProducer { public: RocketMQSyncProducer(const std::string& sGroupName); ~RocketMQSyncProducer(); public: virtual bool Awake( const st...
#include <iostream> #include <vector> #include "StrongDataTypes.h" #include "Utils.h" using namespace std; using namespace utils; int main() { // simple integer container std::vector<int> nativeTypeCollection {1, 4, 5, 3, 6, 8, 9, 0, 2, 7}; // custom class type container std::vector<Integer> userDefi...
#pragma once #include "GlutHeader.h" #include "Point3.h" #include "Point2.h" #include "Cylinder.h" #include "KeyBoardGame.h" #include "Ball.h" #include "CueBall.h" #include "Terrain.h" class Cue { public: Cue(); ~Cue(); void Draw(CueBall); }; #define CUE_STEPTH 0.04 #define CUE_WIDTH_HALF 0.015...
#include <iostream> #include <list> #include <memory> #include <vector> #include <math.h> #include <stdint.h> #include <SDL2/SDL.h> #include <SDL2/SDL_opengles2.h> #include "engine/shader.hpp" #include "engine/shader_program.hpp" #include "engine/vertex_buffer.hpp" #include "engine/window.hpp" #include "modules/pers...
#pragma once struct Player { std::string name; int rating; }; struct Tree { int place; Player player; int depth; struct Tree *LLink = nullptr; struct Tree *RLink = nullptr; }; void ProcessTree(Tree *&node, std::vector<Player> &players, int place, int depth, const int depthOfTree); void PrintTree(Tree *node, i...
#include<iostream> #include<vector> #include<algorithm> #include<map> using namespace std; class Solution { public: vector<vector<string>> res; vector<vector<string>> solveNQueens(int n) { //基本思想:递归回溯法,每次在每行加入一个Q,循环n次检查因为一行n个位置哪个位置加入Q,然后调用check函数是否满足N皇后条件,满足的话cnt+1继续递归加入下一个Q直到cnt=n结束;如果不满足回溯剔除刚加入的Q //HashMap记录加入的...
/* -*- 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 DOM_XMLSERIALIZER_H #define DOM_XMLSERIALIZER_H #ifde...
#include "JsonResponse.h" #include <sstream> JsonResponse::JsonResponse(std::string id, std::string payload) : id(id), payload(payload) {} std::string JsonResponse::toJSON() { std::stringstream stream; stream << "{"; stream << "\"id\":\"" << id << "\","; stream << "\"payload\":" << payload; ...
#include <iostream> using namespace std; class box { double l, b, h; double vol() const; public: box(const double, const double, const double); friend double volDiff(const box &, const box &); }; #define abs(x) ((x) > 0 ? (x) : -(x)) box::box(const double len, const double bre, const double hgt)...
#ifndef SECRET_PASSAGE_SERVICE_HPP #define SECRET_PASSAGE_SERVICE_HPP #include <boost/asio/io_service.hpp> #include <boost/shared_ptr.hpp> #include "settings.hpp" #include "pid_file.hpp" #include "scoped_descriptor.hpp" #include "listen_mode.hpp" #include "connect_mode.hpp" namespace sp { class secret_passage_servic...
#include <iostream> #include <set> #include <string> using namespace std; set<char> vowel = {'a', 'i', 'u', 'e', 'o'}; int main() { string s[2]; for (int i = 0; i < 2; ++i) { cin >> s[i]; for (char& c : s[i]) { if (vowel.count(c)) { c = 'a'; } else { ...
//https://www.patest.cn/contests/gplt/L2-005 #include<iostream> #include<cstdio> #include<string> #include<cstring> #include<vector> #include<set> #include<map> #include<unordered_map> #include<unordered_set> #include<algorithm> using namespace std; int main(){ //input int n; cin>>n; vector<unordered...
/* * HoughTransform.h -- Perform hough transform */ #ifndef HOUGH_TRANSFORM_H #define HOUGH_TRANSFORM_H #include "utils.h" #define DIVIDER 180 #define MAX 0x7FFFFFFF class HoughTransformer { public: HoughTransformer(double threshold, double peakDis, CImg<unsigned char>& input, double fitDis, bool flag); CImg<int>...
// http://oj.leetcode.com/problems/regular-expression-matching/ class Solution { public: bool isMatch(const char *s, const char *p) { if (s == nullptr || p == nullptr || *p == '*') { return false; } if (*p == '\0') { return *s == '\0'; } if ...
#include <iostream> #include <string> #include <sstream> #include <fstream> // ::wali::cprover #include "BplToPds.hpp" using namespace std; using namespace wali::cprover; int main(int argc, char ** argv) { char * mainProc = NULL, * errLbl = NULL; string fname; if(argc >=2){ stringstream s; s << argv[1]...
#include "Shader.h" #include <fstream> #include <vector> std::string read_file_as_string(const std::string& filepath) { std::string result; std::ifstream in(filepath, std::ios::in | std::ios::binary); if (in) { in.seekg(0, std::ios::end); result.resize((size_t)in.tellg()); in.seekg(0, std::ios::beg); in.r...
#include <iostream> using namespace std; int w = 0, h = 0; int c[51][51]; int dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}; int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1}; void dfs(int x, int y) { c[x][y] = 2; // 探索済みにする for (int i = 0; i < 8; i++) { if (x + dx[i] >= 0 && x + dx[i] < w && y + dy[i] >= 0 && y...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2003-2007 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 "modules/inputman...
#include <iostream> #include <iomanip> using namespace std; //method declarations long long int factorial(int N); int main(){ int N; long long int F; //ask the user for a number cout << "Enter a number to use to compute a factorial... or enter a negative number to quit: " << endl; cin >> N; //will con...
#include <cairo.h> #include <gtk/gtk.h> static void do_drawing(cairo_t *); static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr, gpointer user_data) { do_drawing(cr); return FALSE; } static void do_drawing(cairo_t *cr) { cairo_set_source_rgb(cr, 0, 0, 0); cairo_select_font_face(cr, "Sans"...
/* * parent.cpp * * You start this program from a command line. When it starts up, * the first thing it does is call fork. * * The child process immediately calls fork with a command that * creates a new terminal window and runs the process ulc. The * program ulc reads standard-in one character at a time. ...
#include "productType.h" productType::productType() { productLevel = "None"; subscriptionDaysLeft = 0; } QString productType::getLevel() { return productLevel; } int productType::getDaysLeft() { return subscriptionDaysLeft; } void productType::changeLevel(QString lev) { /...
/* @Author: Francisco Adrian Llaryora Artificial Neural Network represent a set of layers, and their connections. The topology is the basic: the axon of the layer i connect with each neurone on the layer i+1. */ #ifndef _CONNECTOR_H_ #define _CONNECTOR_H_ #include "layer.h" #include <stdio.h> class ArtificialNeura...
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; int main(){ int N,M,T; cin >> N >> M >> T; vector<pair<int,int>>A(M); rep(i,M)cin >> A[i].first >> A[i].second; int nowtime = 0; int firstN = N; //firs...
# include <iostream> using namespace std; int main3() { // short(2) int(4) long(4) long long(4) // 可以利用sizeof关键字求出数据类型占用内存大小 // 语法 sizeof(数据类型/变量) short num1 = 10; cout << "num1占用的内存空间为:" << sizeof(num1) << endl; cout << "short占用的内存空间为:" << sizeof(short) << endl; cout << "long long占用的内存空间为:" << sizeof(long long...
#include <iostream> #include <string> #include <vector> #include <memory> void test0(); void test1(); int main() { test0(); test1(); } struct Printer { Printer() = default; Printer(Printer const&) { std::cout << "calling Printer(Printer const&)" << std::endl;} Printer(Printer &&) { std::cout << "...
#include <cstdio> #include <iostream> using namespace std; int main() { return 0; } /*#include <iostream> #include <cmath> using namespace std; const int mod = 1000000009; typedef long long ll; ll poww(ll a, ll n) { ll res = 1; while (n) { if (n & 1) res = (res * a) % mod; ...
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #pragma once #include "Math/Rectangle.hpp" #include "Core/Noncopyable.hpp" #include <cstdint> namespace Push { class VertexBuf...
#include <algorithm> #include <cmath> #include <cstudio> #include <cstring> using namespace std; int N, target; double dist[20][20], memo[1<<16]; // 1<<16, note that max N=8 double matching(int bitmask){ if(memo[bitmask]>-0.5) return memo[bitmask]; if(bitmask == target) return memo[bitmask] = 0; double ans = ...
#pragma once class BasicController : public Controller { public : static const unsigned int MAX_HTML_TAB = 10; BasicController() : m_lastInputPannelStatus(FALSE), m_isSearching(FALSE), m_isHandlingHotspot(FALSE), m_inputChangedTimer(0) { this->m_searchingLock = PR_NewLock(); this->m_hotspotLo...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Date...
#ifndef QT_APP_BASE_GALLERY_H #define QT_APP_BASE_GALLERY_H #include <QObject> #include <QVariant> #include <QFutureWatcher> #include <QFuture> #ifdef Q_OS_ANDROID #include <QAndroidActivityResultReceiver> #endif namespace wpp { namespace qt { //struct AddressBookImpl; class Gallery : public QObject #ifdef Q_OS_AN...
// // Created by heyhey on 20/03/2018. // #include "Simple.h" const string &Simple::getValeur() { setIsUsed(true); return valeur; } ostream &operator<<(ostream &os, const Simple &simple) { os << static_cast<const Variable &>(simple) << " valeur: " << simple.valeur; os << endl; return os; } Si...
#ifndef MITAMA_MAYBE_FACTORY_JUST_HPP #define MITAMA_MAYBE_FACTORY_JUST_HPP #include <mitama/mitamagic/is_interface_of.hpp> #include <mitama/maybe/fwd/maybe_fwd.hpp> #include <mitama/result/detail/meta.hpp> #include <mitama/result/traits/impl_traits.hpp> #include <boost/hana/functional/fix.hpp> #include <boost/hana/fun...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2012 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 <WinGdi.h> #include "platfor...
#pragma once #include <string> #include <ionshared/misc/util.h> #include <ionir/tracking/scope_anchor.h> #include <ionir/tracking/context.h> #include <ionir/misc/identifiable.h> #include "type.h" #include "construct.h" namespace ionir { class Pass; class Function; struct Module : public Construct, publi...