text
stringlengths
8
6.88M
#include "ShapesBlocks.h" void SqrBaseRectBlocks:: SurfaceAreaOfCylinder(){ int a; for(int i=0;i<width.size();i++){ a=2*(22/7)*(width[i]/2)*(height[i])+2*(22/7)*((width[i]/2)*(width[i]/2)); cout << a<<endl; } }
//By SCJ //#include<iostream> #include<bits/stdc++.h> using namespace std; #define endl '\n' #define INF 0x2f2f2f2f int n,m,d[15][15],dp[1<<15][15],nx[1<<15][15]; vector<int> w; int main() { ios::sync_with_stdio(0); cin.tie(0); memset(d,INF,sizeof(d)); memset(dp,INF,sizeof(dp)); cin>>n>>m; for(int i=0;i<n;++i) d[i]...
#include <iostream> #include <string> #include <fstream> #include "Parser.h" #include "CodeWriter.h" int main(int argc, char* argv[]) { if(argc == 0) { std::cout << "Usage: VMTranslator file1.vm file2.vm ..." << std::endl; } else { CodeWriter cw1; for (int i = 1; i < argc; i++) { std::string nameStr ...
/* * 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 <quic/state/StateData.h> #include <algorithm> namespace quic { /** * Adds data to the end of the write ...
#ifndef vector_base_h #define vector_base_h #include <iostream> #include <memory> template <typename T, typename A> struct vector_base { A alloc; T *elem; int sz; int space; vector_base() : elem{0}, sz{0}, space{0} {} vector_base(const A &a, int n) : alloc{a}, elem{alloc...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10035" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif int one,two...
#ifndef BASIC_H_ #define BASIC_H_ #define DELIMITER "|" #include <iostream> #include <fstream> #include <sstream> #include <filesystem> #include <list> #include <string> #include <cstdlib> #include "user.h" #include "menu.h" #include "role.h" #include "permission.h" #include "permission_user.h" #include "admin.h" #i...
/* leetcode 24 * * * */ #include <vector> #include <deque> #include <algorithm> using namespace std; /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* swapPairs(ListNod...
// $Id: util.cpp,v 1.4 2014-04-24 18:14:51-07 - - $ using namespace std; #include "util.h" string trim(const string& str) { size_t first = str.find_first_not_of (" \t"); if (first == string::npos) return ""; size_t last = str.find_last_not_of (" \t"); return str.substr (first, last - first + 1); }
#include <bits/stdc++.h> using namespace std; int main(){ int d, n; cin >> d >> n; int cnt = 0, i = 0; while(cnt < n){ i++; int div_num = 0; int tmp = i; while(tmp%100 == 0){ tmp /= 100; div_num++; } if(d == div_num)...
#pragma once #include "collisiontester.h" #include "../collisionbody.h" #include "../sat_able.h" #include "sattester.h" #include "../quadtree.h" #include "../compoundcollision.h" #include "compoundtester.h" #include "../CollisionResults/satresult.h" #include "../../system.hpp" #include <memory> namespace sbg { tem...
/* * PlayerMessage.h * * Created on: Jun 28, 2017 * Author: root */ #ifndef PLAYERMESSAGE_H_ #define PLAYERMESSAGE_H_ #include "Network/MessageHandler.h" #include "MsgDefineMacro.h" #include "ServerMsgDefine.h" #include "Timer/TimerInterface.h" #include "EventSet/EventSet.h" #include "Player.h" using name...
#include <iostream> #include <string> #include <pqxx/pqxx> void createTable(pqxx::connection &C){ const char * sqlStatement = "CREATE TABLE IF NOT EXISTS utilisateur(" \ "EMPLOYEE_ID INT PRIMARY KEY NOT NULL," \ "NOM TEXT NOT NULL," \ "PRENOM TEXT NOT NULL," \ "MDP TEXT NOT NULL);"; pqxx::wo...
#include "HeadersOnly.hpp" FileDelete::FileDelete(ResponseContext& ctx, BufferChain& writeChain) : HeadersOnly(ctx) { struct stat file; // Try to get stat of route // if it returns anything other than 0, assume it's not found if (stat(_route.c_str(), &file)) { if (errno == ENOENT) throw HttpError(NOT_FOUND...
#ifndef AMVK_SPHERE_H #define AMVK_SPHERE_H #include "vulkan.h" #include <stdint.h> #include <cmath> #include <vector> #include <glm/vec3.hpp> #include "macro.h" #include "state.h" #include "buffer_helper.h" class Sphere { public: struct Vertex { glm::vec3 position; }; Sphere(State& state); void init(uint32_...
#pragma once #ifndef MX_MODULE_BASE_H_ #define MX_MODULE_BASE_H_ #include "../Utils/MxGeneralBase.hpp" #include "../Log/MxLog.h" namespace Mix { class ModuleBase : GeneralBase::NoCopyBase { public: virtual void load() {} virtual void init() {} virtual ~ModuleBase() = default; p...
#pragma once #include <cmath> #include <complex> #include <execution> #include <limits> #include <vector> namespace ugsdr { template <typename MixerImpl> class Mixer { protected: double sampling_rate = 0.0; double mixer_frequency = 0.0; double mixer_phase = 0.0; public: Mixer(double sampling_freq, double...
/* * * DO NOT use this (not finished) * */ #ifndef REACTOR_NET_HTTP_COOKIE_H #define REACTOR_NET_HTTP_COOKIE_H #include <string> namespace reactor { namespace net { namespace http { class Cookie { public: Cookie(const std::string &name, const std::string &value): name_(name), value_(value) { } ~Cookie() ...
#include <assert.h> #include <math.h> #include <algorithm> #include <climits> #include <functional> #include <iostream> #include <numeric> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define ll long long using namespace std; int n, m; vector<vector<int>> adj; struct Solutio...
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved. #include "TestingGroundsGameMode.h" #include "TestingGroundsHUD.h" #include "Player/FirstPersonCharacter.h" #include "UObject/ConstructorHelpers.h" #include "EngineUtils.h" #include "NavMesh/NavMeshBoundsVolume.h" #include "ActorPool.h" ATestingGroundsGame...
/* -*- 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 Arjan van Leeuwen (arjanl) */ #ifndef COMMIT_LISTENER_...
/* ================ Spawner.h ================ */ #ifndef __GAME_SPAWNER_H__ #define __GAME_SPAWNER_H__ const int MAX_SPAWN_TYPES = 32; class rvSpawner; typedef void (*spawnerCallbackProc_t) ( rvSpawner* spawner, idEntity* spawned, int userdata ); typedef struct { idEntityPtr<idEntity> ent; idStr event; } ...
/* leetcode 119 * * * */ class Solution { public: vector<int> getRow(int rowIndex) { if (rowIndex < 0) { vector<int> ans; return ans; } vector<int> ans(rowIndex + 1); if (rowIndex == 0) { ans.at(0) = 1; return ans; } ...
#include "IALogicAndres.h" #include <time.h> int IALogicAndres::m_commonThresholds[4][4]={ {60,30,20,10}, //70% attack, 30 % defense/movement where movement is 20% {70,40,20,10},//60% attack, 40 % defense/movement where movement is 20% {75,50,20,10},//40% attack, 60 % defense/movement where movement is 20% {80,6...
/*************************************************** * Mir Ali Talpur * Vector3.cpp * 4/1/2015 ***************************************************/ #include "Vector3.h" #include <math.h> #include <iostream> #include <cstring> #include "Vector4.h" #include "Matrix4.h" #include "Drawable.h" /*************************...
#include "stdafx.h" #include "up_konstanten.h" int P_Anz = 6; double pi = M_PI; double D = 75.15; //[mm]; KR - Nenndurchmesser double s = 0.210; //[mm]; Spalthöhe double ss = s / D; //[]; Verhältnis von Spalthöhe zu Durchmesser double L = pi*D - s; //[mm]; Umfangslänge double l = 0; //[...
/******************** *-=gamemodule.hpp=-* ******************** Auteur : My?terious Description : Contient le module de jeu. */ #ifndef HEADER_GAMEMODULE #define HEADER_GAMEMODULE //-=Inclusion des headers=-// //-=Fin de la section=-// #endif
/* filename: time_stamp.cpp author: Sherri Harms last modified: 8/8/01 description: Class time_stamp implementation file for serial moitems. Values of this type is a list of events Used in computing serial episodes and closures A single serial moitem is a composite of several timestamps. That is, within a ser...
//Paul Schakel //Two Button LED Blink //Like Button LED Blink only w/2 leds and buttons int buttonPin1 = 2; //gray button int buttonPin2 = 4; //yellow button int ledPin1 = 8; //red led int ledPin2 = 13; //blue led int buttonState1 = 0; int buttonState2 = 0; void setup() { Serial.begin(9600); pinMode(...
// Created on: 2007-11-24 // Created by: Alexander GRIGORIEV // Copyright (c) 2007-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 ...
// files: // /home/pi/.arduino15/packages/stm32duino/hardware/STM32F1/2020.6.20/libraries/SPI/src/SPI.cpp /* a minimal example that works some reverse engineering notes at db5.194 */ typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; #define __IO volatile #define REG(x) *(volatile uint32_t *)(x...
// // Project: A2BlackJack // Created by: Ryan Purse // Date: 02/01/2021 // #ifndef A2BLACKJACK_PLAYINGCARD_H #define A2BLACKJACK_PLAYINGCARD_H #include <iostream> /* Unicode manipulation for iostream */ #include <io.h> #include <fcntl.h> struct playingCard { char suit[9]; char name[6]; int value; ...
/** * @file AddingImages.cpp * @brief Simple linear blender ( dst = alpha*src1 + beta*src2 ) * @author OpenCV team */ #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include <iostream> using namespace cv; using namespace std; /** * @function main * @brief Main function */ int main( void ) { ...
#ifndef _TABLE_H #define _TABLE_H #include <time.h> #include <list> #include <vector> #include "Player.h" #include "GameLogic.h" #include "Configure.h" #include "TableTimer.h" const int GAME_PLAYER = 512; // //历史记录 #define MAX_SCORE_HISTORY 15 //历史个数 #define STATUS_TABLE_CLOSE -1 //桌子关闭 #define STATUS_T...
// Fill out your copyright notice in the Description page of Project Settings. #include "Focchiatti.h" #include "MyFocchiattiProjectile.h" #include "GameFramework/ProjectileMovementComponent.h" AMyFocchiattiProjectile::AMyFocchiattiProjectile(const class FObjectInitializer& PCIP) : Super(PCIP) { PrimaryActorTick.bC...
// // Created by glyphack on 7/11/19. // #ifndef CRAWLLALA_SCOREBOARD_H #define CRAWLLALA_SCOREBOARD_H #include "../server/Match.h" #include "snake.h" #include <vector> class ScoreBoard { public: std::vector<std::pair<game::Snake, int>> scores; game::Snake mvp; Match match; }; #endif //CRAWLLALA_SCORE...
#include<iostream> #include<string> #include<fstream> #include<sstream> using namespace std; int totalcontact = 0; void Ncontact(int serial,string name,string phone); // new contact create function prototype int main() { yy: // this is scope int count = 0; cout<<"\t\t########################################"<<endl;...
#include <iostream> #include <opencv2/opencv.hpp> using namespace cv; using namespace std; int main(int argc, char** argv){ Mat image; image = imread("bolhas.png", CV_LOAD_IMAGE_GRAYSCALE); // lendo a image if(!image.data) cout<<"Imagem não abriu\n"; Mat imaAux = Mat(image.rows , im...
#include <iostream> #include <string> bool judege(const std::string& str); /** str = A(n)PATA(n) str = A(n)PA(b)TA(b * n) 应该是这样的 */ bool judege(const std::string& str) { int prefix = 0; int infix = 0; int postfix = 0; std::string::const_iterator it = str.begin(); while (it != str.en...
#include "WndProc.h" LONG __stdcall Hooks::WndProc::Func(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return CallWindowProc(Original, hWnd, uMsg, wParam, lParam); } void Hooks::WndProc::Init() { hwWindow = FindWindowW(0, L"Team Fortress 2"); Original = (WNDPROC)SetWindowLongPtr(hwWindow, GWL_WNDPROC, (LON...
#ifndef FUNCTIONS_H #define FUNCTIONS_H #include<complex> #include<iostream> #include<string> #include<vector> #include<sstream> #include<cctype> #include"stdio.h" #include"stdlib.h" #include<fstream> #include<cmath> #include<cstring> #include<ctime> using namespace std; int AinverseB(vector<vector<double> > &,vector<v...
#pragma once #include "AvatarModel.h" class AvatarActionCalculator { public: virtual void computeNextAction(AvatarModel* avatarModel)=0; };
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) Opera Software ASA 1999-2006 * * Primitive ECMAScript 'string' datatype. * * Generally the names 'string' and 'String' collide with too much in various * platforms' standard libraries and headers, so we use 'jstring' ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2010 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Alexander Remen (alexr) */ #ifndef INDEXIMAGE_H #define INDEXI...
/* 10*10 이하의 정수형 이차원 배열을 입력받아 그 배열의 각 행의 요소의 합을 출력하는 프로그램을 만들어 보세요 <입력> 3 4 4 2 6 3 7 9 3 4 5 1 2 1 <출력> 15 23 9 */ #include<stdio.h> int main(){ int a, b; int arr[10][10] = {0}; int ans[3] = {0}; printf("Enter two number to generate a 2 by 2 matrix: "); scanf("%d %d", &a, &b); for(int i=0; i < a; i+...
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION #include <array> #include "stb_image_write.h" #include "png_toolkit.h" png_toolkit::png_toolkit() { } png_toolkit::~png_toolkit() { stbi_image_free(imgData.pixels); } bool png_toolkit::load( const std::string &pictureName ) { imgData.pix...
#include "PassSupport.h" #include "Pass.h" #include <msclr/marshal.h> #include "utils.h" using namespace LLVM; PassInfo::PassInfo(llvm::PassInfo *base) : base(base) , constructed(false) { } PassInfo::!PassInfo() { if (constructed) { delete base; } } PassInfo::~PassInfo() { this->!PassInfo(); } llvm::PassInfo ...
#include "precompiled.h" #include "mesh/mesh.h" #include "render/rendergroup.h" #include "math/vertex.h" #include "texture/texturecache.h" namespace mesh { }; using namespace mesh; Mesh::Mesh() { ZeroMemory(this, sizeof(Mesh)); D3DXMatrixIdentity(&mesh_offset); } Mesh::~Mesh() { ASSERT(refcount == 0); delete []...
#include "stdafx.h" #include "TextFile.h" TextFile::TextFile() : m_lines(), m_pFile(NULL) { } TextFile::~TextFile() { } // Read the given file, return true on success bool TextFile::Read(const string& filename) { bool status = Open(filename); if (!status) { m_errorString = string("Unable to open file: ") + ...
/* * Never include this file directly! It is included by quadtree.hpp and * exists only in order to properly split interface and implementation * despite the template. */ #include <array> #include <memory> #include <optional> /* * This can be used to iterate over the nodes of a quadtree. * Dereferencing(i.e. *)...
#include "sensor.h" using namespace web; using namespace http; using namespace utility; using namespace web::http; using namespace web::http::experimental::listener; using namespace std;
#include "stdafx.h" #include "PartTimeEmployee.h" // Functions' declaration double PartTimeEmployee::calculatePay() const { return payRate * hoursWorked; } void PartTimeEmployee::print() const { Employee::print(); cout << "Weekly Wages: $" <<PartTimeEmployee::calculatePay()<< endl; } PartTi...
/* Copyright 2021 University of Manchester 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 writing, s...
/* PROBLEM: http://acm.javeriana.edu.co/maratones/forum/viewtopic.php?f=706&t=844&sid=ca13060eb4f374c0c166801002ae43b8 AUTHORS: Juan Felipe Cañizares Corrales Systems Engineer [Student] Universidad Católica de Oriente pipecaniza@outlook.com Brian Giraldo Echeve...
#ifndef _ROS_statistics_msgs_Stats1D_h #define _ROS_statistics_msgs_Stats1D_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace statistics_msgs { class Stats1D : public ros::Msg { public: double min; double max; double mean; double variance; ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * 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. * * @author Martin Olsson (molsson) */ #include "core/pch.h" #ifdef UTILIX #include "platfo...
#include <iostream> #include <fstream> using namespace std; const int MAXM = 100; ofstream ofs; ifstream ifs; struct MONHOC { string MAMH; string TENMH; int STCLT; int STCTH; MONHOC* left; MONHOC* right; }; struct DSMH { MONHOC* root; int n = 0; }; struct SinhVienDK { string MASV; int DI...
#include "decaf.h" Decaf::Decaf() { this->description = "Decaf Coffee"; } double Decaf::cost(){ return 125.0; }
// 问题的描述:判断数组中是否有重复值 // 给定一个数组和它的长度,判断数组中是否有重复值,要求空间复杂度为O(1) // 解决方案:堆排序(非递归) // 测试用例有3组: // 1、空数组 // 输入:[] // 输出:[] // 2、无重复值数组 // 输入:[1, 2, 3, 4, 5, 6, 7] // 输出:true // 3、有重复值数组 // 输入:[3, 5, 1, 4, 2, 5, 6] // 输出:false #include <iostream> #include <vector> using namespace std; /...
#include <boost/algorithm/string.hpp> #include <iostream> #include <stack> #include <vector> using namespace std; class String { public: String(const string& constString) : zeichenkette{constString} {} String to_lower() const { string str{zeichenkette}; boost::to_lower(str); return {st...
#include "SmartPointer.hpp" #include "Chaine.hpp" #include<cstdio> void f(int *p){ printf("%d\n",*p); } int main(){ using enseirb::SmartPointer; SmartPointer<int> p(new int(10)); SmartPointer<int> q(p); f(p); *p=5; f(q); SmartPointer<float> pc(new float(3.2)); SmartPointer<char> p1(new char(...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <map> #include <vector> #include <algorithm> #include <math.h> #define pb push_back using namespace std; int a, b; void input() { scanf("%d %d", &a, &b); } int usln(int n, int m) { n = abs(n); m = a...
/**************************************************************************** * ThermoX v0.20.0 HVAC Thermostat * * Compares ambient and desired temperatures, and runs HVAC as needed. * Hysteresis levels for both Summer and Winter are independently adjustable. * Sensor can be corrected +/- 5 degrees...
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs // Copyright (c) 2018-2020 Karbo developers // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://...
// 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...
#pragma once #include <cstdint> #include <vector> #include <string> #include <glm/glm.hpp> #include <fea/rendering/color.hpp> #include "walltype.hpp" class CollisionMap { public: CollisionMap() = default; CollisionMap(std::vector<WallType> collisionValues, glm::ivec2 size); const WallType* ...
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once // Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corre...
#include "pch.h" #include "ofApp.h" using namespace ofxCvGui; !! //Pretty sure this doesn't work #include "StreamBufferSequence.h" //-------------------------------------------------------------- void ofApp::setup(){ ofSetWindowTitle("Client"); ofSetWindowShape(512, 1024); ofSetWindowPosition(512, ...
// // nehe01.h // NeheGL // // Created by Andong Li on 8/15/12. // Copyright (c) 2013 Andong Li. All rights reserved. // implement NeHe tutorials lesson 1 // #ifndef NEHE01_H #define NEHE01_H #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <GLUT/glut.h> #include <iostream> #include <stdlib.h> #include <...
// Card.h #ifndef CARD_H_ #define CARD_H_ #include <iostream> using namespace std; #define SUITSIZE 4 #define VALUESIZE 13 class Card { friend ostream& operator<<(ostream& output, const Card& c); friend bool operator>(Card c1, Card c2); friend bool operator<(Card c1, Card c2); friend bool operator>=(Card c1, Ca...
#include <iostream> #include <Windows.h> #include <time.h> using namespace std; void SumMI(int a[], const int size); void SumMR(int a[], const int size,int i,int sum); int NMAXI(int a[], const int size); int NMINI(int a[], const int size); int NMAXR(int a[], const int size, const int i, int max, int num); int NMINR(...
#include "lower_bound.h" #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; /* * You are given N integers in the sorted order. Then you are given Q queries. In each query you will be given an int * and you have to tell whether that integer is present in...
#ifndef DIMMANUEL_H #define DIMMANUEL_H #include <QWidget> #include "ui_commande.h" #include "commande.h" #include "clienttcp.h" namespace Ui { class DimManuel; } class DimManuel : public QWidget { Q_OBJECT public: explicit DimManuel(QWidget *parent = 0); ~DimManuel(); void envoiparametres(); ...
// Copyright (c) 1995-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 Lesser General Public License version 2.1 as published ...
// // main.cpp // BloomFilter // // Created by Prateek Khandelwal on 5/6/15. // Copyright (c) 2015 Prateek Khandelwal. All rights reserved. // #include <iostream> #include <fstream> #include <sstream> #include <cstdlib> #include <map> #include "md5.h" using namespace std; #define BLOOM_FILTER_SIZE 10000000 #defi...
// // talkcases.hpp // AutoCaller // // Created by Micheal Chen on 2017/8/2. // // #ifndef talkcases_hpp #define talkcases_hpp #include <atomic> #include <condition_variable> #include <mutex> #include <thread> #include "IYouMeVoiceEngine.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) extern void SetServerMode(SERV...
#include "Shape.h" #include <fstream> using namespace DirectX::SimpleMath; Shape::Shape() { } Shape::~Shape() { } bool Shape::Initialize(ID3D11Device* device, char * fileName) { if (!LoadModel(fileName)) { return false; } InitializeBuffer(device); return true; } bool Shape::Render(ID3D11DeviceContext * de...
#include <bits/stdc++.h> using namespace std; #define REP(a,n) for(int i=a; i<n ;i++) #define pb(a) push_back(a) typedef long long ll; typedef unsigned long long ull; typedef vector<int> V; typedef pair<ll, ll> pll; typedef vector<ll> vll; typedef vector<pll> vpll; typedef vector<vll> vvll; typedef vector<string>...
/*********************************************************\ * 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...
#include<iostream> using namespace std; int main() { //menukarkan 2 buah bilangan int a, b, c; a=3; b=5; cout<<a<<endl; cout<<b<<endl; c=a; a=b; b=c; cout<<a<<endl; cout<<b<<endl; return 0; }
#include<bits/stdc++.h> #define N_CHAR 256 using namespace std; int main(){ freopen("KYTU.inp", "r", stdin); freopen("KYTU.out", "w", stdout); int prefix[N_CHAR] = {0}; string s; getline(cin, s); for(int i = 0; i < s.size(); i++) prefix[(int)s[i]]++; for(int i = 0; i < N_CHAR; i++){ if(prefix[...
// -*- LSST-C++ -*- /* * LSST Data Management System * Copyright 2014-2015 AURA/LSST. * * This product includes software developed by the * LSST Project (http://www.lsst.org/). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as publ...
#include<iostream> using namespace std; class Position{ public: int x=10; int y=20; Position operator + (Position pos){ Position new_pos; new_pos.x=x+pos.x; new_pos.y=y+pos.y; return new_pos; } bool operator == (Posi...
class DZ_GroupText: RscText { idc = -1; type = 0; style = 0x00; sizeEx = .025; shadow = 2; colorBackground[] = {1,1,1,0}; colorText[] = {1,1,1,1}; }; class DZ_GroupDynamicText: RscStructuredText { //access = 0; type = 13; colorText[] = {1,1,1,1}; class Attributes { font = "Zeppelin32"; color = "#ffffff"...
#ifndef HEADER_H_INCLUDED #define HEADER_H_INCLUDED #include <sys/time.h> #include <ctime> #include <cmath> #include <fstream> #include <iostream> #include </usr/local/include/raspicam/raspicam_cv.h> #include </usr/local/include/raspicam/raspicam.h> #include </usr/local/include/raspicam/raspicam_still_cv.h> #include <...
#define num 10 #define fot_num 5 int light[fot_num]; int plight[fot_num]; int maxlight[fot_num]; int minlight[fot_num]; int midlight[fot_num]; int samlight; int maxsam; int minsam; boolean lightflag[fot_num]; double lpf = 0.1; long tm; void setup() { Serial.begin(9600); pinMode(2, OUTPUT); pinMode(3, OUTPUT); ...
/* ArduCAM.h - Arduino library support for CMOS Image Sensor Copyright (C)2011-2015 ArduCAM.com. All right reserved Basic functionality of this library are based on the demo-code provided by ArduCAM.com. You can find the latest version of the library at http://www.ArduCAM.com Now supported contr...
#include <ConfigManager.h> #include <ConfigManager.h> using namespace breakout; ConfigManager::ConfigManager() { m_config = std::make_unique<Config>(std::string(CONFIG_FILE)); } ConfigManager::~ConfigManager() { } ConfigManager& ConfigManager::Get() { static ConfigManager configManager; return configManager; } ...
#ifndef SOUNDMANAGER_H #define SOUNDMANAGER_H #include <AL/al.h> #include <AL/alc.h> #include "Sound.h" namespace gg { class SoundManager { public: SoundManager(); ~SoundManager(); void init(); void playSound(const Sound& sound); private: ALCdevice* _device; ALCcontext* _context; }; } #endif
#include "ball_init.h" #include "raylib.h" const float radius = 15.0f; Vector2 ballPosition; Vector2 ballSpeed; float ballRadius = radius; void initBall(Rectangle &player) { ballPosition.x = player.x; ballPosition.y = player.y - 30; ballSpeed = { 600.0f, 500.0f}; }
#include <iostream> using namespace std; int number[1000001]; long remainders[1001]; int main(void) { ios::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL); int n, m; long long count = 0; cin >> n >> m >> number[0]; number[0] %= m; remainders[number[0]]++; if (!number[0]) count++; ...
#include "stdafx.h" #include <boost/asio.hpp> #include <boost/bind.hpp> #include <iostream> #include <vector> #include "connection.hpp" // Must come before boost/serialization headers. #include <boost/serialization/vector.hpp> #include "stock.hpp" /// Downloads stock quote information from a server. class ...
#include <conio.h> #include <iostream.h> #include <dos.h> void main () { // DIAMOND 1 clrscr(); int a, b; for(int i=1; i<=19; i++) { for(int j=1; j<=21; j++) cout<<"*"; cout<<"\n"; } // DIAMOND 2 delay(2000); clrscr(); ...
#include <unordered_set> int solution(int X, vector<int> &A) { // write your code in C++14 (g++ 6.2.0) int map_cnt=0; unordered_set<int> set_rec; for(size_t i = 0 ; i<A.size(); i++){ if (A[i]<=X && set_rec.count(A[i])==0) { set_rec.insert(A[i]); map_cnt++; } ...
// Created on: 1992-09-28 // Created by: Remi GILET // 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 GNU Les...
#include "Plane.h" LaiEngine::Plane::Plane(const Transform & transform, bool isNormalFlipped) : ISurface(transform, isNormalFlipped) { } LaiEngine::Plane::Plane(const glm::vec3 & normal, const glm::vec3 & point, const Transform & transform, bool isNormalFlipped) : ISurface(transform, isNormalFlipped), mNormal(normal)...
class Solution { public: int jump(vector<int>& nums) { int maxPos = 0,end=0, res=0; for(int i=0;i<nums.size();i++){ maxPos = max(maxPos, i + nums[i]); if(end==i){ end = maxPos; res++; } } return res; } };
// Copyright 2019 Erik Teichmann <kontakt.teichmann@gmail.com> #ifndef INCLUDE_SAM_OBSERVER_HPP_ #define INCLUDE_SAM_OBSERVER_HPP_ #include <sam/observer/position_observer.hpp> #endif // INCLUDE_SAM_OBSERVER_HPP_
#include "Node.h" Node::Node(int _id) { id=_id; //ctor } Node::~Node() { //dtor }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2004 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 "Win...