text
stringlengths
8
6.88M
#include <vector> #include "Masque.h" void Masque::maskDetection(Image bg, Image img, Image* mask) { int seuil = 20; for (int x = 0; x < img.getHeight(); x++) { for (int y = 0; y < img.getWidth(); y++) { int r1, g1, b1; int r2, g2, b2; r1 = bg.getColor(x,y).r; g1 = bg.getColor(x,y).g; b1 = bg.getC...
#include "stdafx.h" #include "Prof-UIS.h" // declare method to get a CExtTabWnd object CExtTabWnd* GetCExtTabWndFromHWND(HWND tabBarHandle) { // result CExtTabWnd* tabWnd = NULL; // get the correct object #ifndef TabIsCExtTabPageContainerWnd tabWnd = (CExtTabWnd*)CExtTabWnd::FromHandlePermanent(tabBarHandle); #el...
// // GCastleForces.cpp // Core // // Created by Max Yoon on 11. 7. 19.. // Copyright 2011년 __MyCompanyName__. All rights reserved. // #include "GnGamePCH.h" #include "GCastleForces.h" #include "GIconGage.h" GCastleForces* GCastleForces::CreateCastle(GLayer* pInterfaceLayer, GLayer* pCastleLayer ,...
/************************************************************************ * @project : sloth * @class : MetaFile * @version : v1.0.0 * @description : 存储字体文件加载后的信息 * @author : Oscar Shen * @creat : 2017年2月27日21:43:56 * @revise : ******************************************************************...
#include "pch.h" LobbyUserManager::LobbyUserManager() { } LobbyUserManager::~LobbyUserManager() { } BOOL LobbyUserManager::Begin(DWORD maxUserCount) { CThreadSync Sync; mMaxUserCount = maxUserCount; mConnectedUserMap.clear(); mCurrentUserCount = 0; return TRUE; } BOOL LobbyUserManager::End() { mConnectedUs...
// https://projecteuler.net/problem=13 // Solution: 5537376230 #include <iostream> #include <vector> #include <fstream> #include <algorithm> #include <math.h> using namespace std; long long int largeSum(vector<vector<int>> ln) { // Printing the num // for (int i = 0; i < ln.size(); i++) // { // f...
/* Autor: Faustino Moiśes Amador García Fecha: 8 de Noviembre de 2017 Exámen */ #include <iostream> using namespace std; int main (){ float V, D, T; //Tu programa no entra al while porque no le diste un valor inicial a la T. Sí lo que querías era validar que T fuera diferente de 0, solo necesitabas el if. //wh...
/* offer 56_1 * * * */ #include <string> #include <unordered_set> #include <algorithm> using namespace std; class Solution { public: vector<int> singleNumbers(vector<int>& nums) { int a = 0, b = 0, res = 0; for(int i = 0; i < nums.size(); i++) { res = res ^ nums.at(i); } ...
#include<iostream> #include<string.h> #include<math.h> using namespace std; int main() { string s; cin>>s; int s1 = floor(sqrt(s.size())); int s2 = ceil(sqrt(s.size())); }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2012 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** @author Yngve Pettersen ** @author Alexei Khlebnikov ** */ #...
/* * Copyright (C) 2011 The Android Open Source Project * * 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 requir...
// // Created by Lee on 2019-04-19. // #ifndef UBP_CLIENT_CPP_VER_PHOTOMANAGER_H #define UBP_CLIENT_CPP_VER_PHOTOMANAGER_H #include <vector> #include <QtNetwork> #include <QJsonArray> #include <QJsonObject> #include <src/model/Photo.h> #include <src/model/PhotoGroup.h> class PhotoManager { public: explicit Photo...
// // Node.cpp // unblockme_solver // // Created by Alexander G Anderson on 12/16/13. // Copyright (c) 2013 Alexander G Anderson. All rights reserved. // #include "Node.h" /*Node::Node(CBoard c) { vector<int> parents; vector<int> children; CBoard cb = c; } */ Node::Node() { vector<int> parents; ...
#include "Sphere.hpp" #include <iostream> namespace assignment2 { float Sphere::contains(Vector3 vertex) { float distance = glm::distance(vertex, mPosition); if (distance <= mRadius) { return 0; } return 1; } void Sphere::renderGeome...
#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 <map> typedef long long LL; typedef unsigned long long ULL; #define PI 3.141592653589...
#include "SG_RoomHandler.h" #include "Tools/SG_Logger.h" #include "Networking/General/SG_ClientSession.h" #include "Networking/General/SG_ServerBase.h" void SG_RoomHandler::SendRoomList(const boost::shared_ptr<SG_ClientSession> Session, std::list<boost::shared_ptr<sg_constructor::Room>>* roomlist_ptr) { std::vector<...
#pragma once #include"Builder.h" class ConcreteBuilder:public Builder{ public: ConcreteBuilder(); virtual ~ConcreteBuilder(); virtual void BuildPartA(); virtual void BuildPartB(); virtual void BuildPartC(); };
/* * 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/fizz/handshake/FizzCryptoFactory.h> #include <quic/fizz/handshake/FizzBridge.h> #include <quic/fizz/handshake/Fiz...
/** * Peripheral Definition File * * DMA - Direct memory access controller * * MCUs containing this peripheral: * - STM32F0xx */ #pragma once #include <cstdint> #include <cstddef> #include "io/reg/stm32/_common/dma_v1.hpp" namespace io { namespace base { static const size_t DMA1 = 0x40020000; static const size_t...
/* 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, ...
/* some basic math computation */ #include <math.h> #include "Common.h" #include "math_3d.h" #ifndef H_MATH_BASICS_H #define H_MATH_BASICS_H namespace P_RVD { namespace Math { /* compute the centor of a triangle three vertices */ Vector3d computeCenter(const Vector3d p1, const Vector3d p2, const Vec...
/* * Copyright (c) 2017-2018 Morwenn * SPDX-License-Identifier: MIT */ #include <algorithm> #include <iterator> #include <vector> #include <catch2/catch.hpp> #include <cpp-sort/sorters/poplar_sorter.h> #include <testing-tools/distributions.h> TEST_CASE( "poplar_sorter tests", "[poplar_sorter]" ) { // Distributi...
#include <iostream> #include <stdio.h> #include <set> using namespace std; const int MOD = 1000000007; const int N = 200222; typedef long long ll; int pow2[N]; int w[N]; int fath(int x) { if (w[x] != x) w[x] = fath(w[x]); return w[x]; } void un(int x, int y) { w[fath(x)] = fath(y); } set<int> used; i...
#pragma once #include <gpu/material.h> #include <math/math.h> class Diffuse : public Material { public: __device__ Diffuse(const glm::vec3& color) : albedo(color) {} __device__ ~Diffuse() = default; __device__ bool Diffuse::scatter(const Ray& r, HitDesc& desc, glm::vec3& attenuation, Ray& scattered, curandState*...
/* solve2 is a modified version of solve program. It is optimized for solving matrices with limited number of non-zero near diagonal elements. Modified by by Hamid Soltani. (gmail: hsoltanim) https://csvparser.github.io/ Last modified: Sep. 2016. */ #include "stdafx.h" #include < cstdlib > #include < cstdi...
/* * sphere.cpp * author: Thomas Blackwell * CS Username: tablackw * email: tablackwell@email.wm.edu * * Contains the methods needed for the Sphere class, includes a * setter method and a method for calculating the intersection between * a ray and the sphere. * */ #include "Sphere.hpp" #include <math.h> // Sets th...
//thing const char * usage = " \n" "Server \n" " \n" "Simple server program \n" " ...
#include <gtest/gtest.h> #include <mutiplex/InetAddress.h> using namespace muti; TEST(test_addr, test_addr) { InetAddress addr1("127.0.0.1:443"); ASSERT_TRUE(addr1.to_string() == "127.0.0.1:443"); ASSERT_TRUE(addr1.ip_str() == "127.0.0.1"); ASSERT_TRUE(addr1.host_port() == 443); } TEST(test_resolve, ...
#include <iostream> #include <vector> #include <string> using namespace std; int main() { vector<string> myVector(5); myVector[0] = "Batman"; myVector[1] = "Robin"; myVector[2] = "Batgirl"; myVector[3] = "Nightwing"; myVector[4] = "Red Hood"; myVector.insert(myVector.begin() + 2, "John Baugh"); myVector.pop_...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) Opera Software ASA 2009 - 2010 * * WebGL GLSL compiler -- AST builder routines. * */ #include "core/pch.h" #ifdef CANVAS3D_SUPPORT #include "modules/webgl/src/wgl_base.h" #include "modules/webgl/src/wgl_ast.h" #include...
// // Created by Stephen Clyde on 2/16/17. // #include "Deck.h" Deck::Deck(int cardSize, int cardCount, int numberMax) : m_cardSize(cardSize), m_cardCount(cardCount), m_numberMax(numberMax) { // TODO: Implement for(int i = 0; i < m_cardCount; i++){ Card* pCard = new Card(cardSize, numberMax, i...
// // Created by griha on 01.12.17. // #pragma once #ifndef MIKRONSST_HSM_INPUT_OUTPUT_HPP #define MIKRONSST_HSM_INPUT_OUTPUT_HPP #include <windows.h> //#include <unknwn.h> namespace griha { namespace hsm { static const GUID IID_IInput = {0x9036c524, 0x1e9c, 0x47e2, {0x96, 0x01, 0x89, 0x9f, 0x22, 0x51, 0...
#pragma once class Win32Utils { public: Win32Utils(); ~Win32Utils(); // Return current working directory (with trailing backslash) static string GetCurrentWorkingDirectory(); };
/* -*- 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<string> #include<set> #include<cctype> #include<sstream> using namespace std; set<string> dic; int main() {string s1,s2; while (getline(cin,s1)) {for (int i = 0;i < s1.length(); i++) if (isalpha(s1[i])) tolower(s1[i]); else s1[i]=' '; stringstream ss(s1); while (s...
#include "About.hpp" #include "Resources.hpp" #include "config.h" #include <wx/aboutdlg.h> wxString readLicense(const wxString& filename) { Resources res; wxString short_license = "This code is licensed under MIT License (see LICENSE for details)"; if(!res.Exists(filename)){ wxPuts("File \"" + fil...
#include <bits/stdc++.h> #include "d.h" using namespace std; int conversionBinToInt(string s){ int len = s.length(); int val=0; for(int i=len-1,k=0;i>=0;--i,k++){ val=val+(s[i]-'0')*pow(2,k); } return val; } string conversionIntToBin(int num){ string binStr="0000"; int i=3; while(num){ binStr[i--]=(ch...
//=========================================================================== //! @file UI_Button.cpp //=========================================================================== #if 0 //=========================================================================== //! コンストラクタ //==========================================...
#include <iostream> #include <vector> using namespace std; class Solution { public: int canCompleteCircuit(const vector<int>& gas, const vector<int>& cost) { int total = 0; int tank = 0; int start = 0; for(int i = 0; i < gas.size(); i++){ int tmp = gas[i] - cost[i]; ...
/******************************************************** CS200 Lab 4 Maze Implementation File Writen by : Denise Byrnes Modified by: Khoa Ngyuen, Eifu Tomita, Avi Vajpeyi Purpose : Contains the implementation of the various data structures and functions, like creating the equivalency ...
// -*- C++ -*- // // Package: EgammaHLTAlgos // Class : EgammaHLTHcalIsolationDoubleCone // // Implementation: // use double cone to exclude shower leakage // mostly identical to EgammaHLTHcalIsolation, but // with an inner exclusion cone // Original Author: // Created: Tue Jun 13 12:16:41...
// TcpSocket.cpp : Defines the entry point for the console application. // #include <winsock2.h> #include <errno.h> #include <io.h> #include <stdio.h> #include "TcpSocket.h" SOCKET Tcp_Init(const char * ptServerAddr, int nServerPort, DWORD dwSendTimeOut/* = DEFAULT_SEND_TIMEOUT*/, DWORD dwRecvTimeOut/* = DE...
#include <iostream> #include "UzytkownikMenager.h" #include "AdresatMenager.h" using namespace std; class KsiazkaAdresowa { UzytkownikMenager uzytkownikMenager; AdresatMenager *adresatMenager; const string NAZWA_PLIKU_Z_ADRESATAMI; public: KsiazkaAdresowa(string nazwaPlikuZUzytkownikami, string naz...
#include "views/roomsview.hpp" #include "views/defaultlayout.hpp" #include "views/designview.hpp" #include "views/viewstack.hpp" #include "components/room.hpp" #include "hydroponics/hydroponics.hpp" #include "storage/storageroom.hpp" #include "entities/workroom.hpp" extern bool paused; namespace { enum RoomType...
// // Created by Tanguy on 28/11/2017. // #ifndef MEDIATORPROJECT_MEDIATOR_HPP #define MEDIATORPROJECT_MEDIATOR_HPP #include <string> #include <functional> #include <list> #include <vector> #include "IMediator.hpp" class Mediator : public IMediator { std::vector<FunctionPtr> actions; std::list<MediatorPacke...
#include <iberbar/Renderer/CallbackCommand.h> iberbar::Renderer::CRenderCallbackCommand::CRenderCallbackCommand() : CRenderCommand( URenderCommandType::Callback ) { }
#ifndef BINARY_CLOCK_H #define BINARY_CLOCK_H #include "FastLED.h" #include <stdint.h> class BinaryClock { private: CRGB *leds; }; #endif // BINARY_CLOCK_H
#pragma once namespace sbg { struct Clonable { virtual Clonable* clone() const = 0; }; }
#ifndef TEAMMANAGER #define TEAMMANAGER #pragma warning (disable:4786) //------------------------------------------------------------------------ // // Name: TeamManager.h // // Desc: Singleton class to handle the management of Team. // // Author: Mat Buckland 2002 (fup@ai-junkie.com) // //--------...
#include "OpCode.h" using namespace std; using namespace OpenFlight; std::string OpCodeUtils::toString(opCode iOpcode) { std::string r; switch (iOpcode) { case ocUnsupported: r = "Unsupported record"; break; case ocHeader: r = "Header Record"; break; case ocGroup: r = "Group Recor...
#include "nxtOSEKgenerator.h" #include "funcOrientedGenerator.h" #include "sequentialGenerator.h" using namespace qReal; using namespace robots::generator; NxtOSEKgenerator::GeneratorType NxtOSEKgenerator::mCurGeneratorType = NxtOSEKgenerator::sequentialType; //NxtOSEKgenerator::GeneratorType NxtOSEKgenerator::mCurG...
#ifndef QUICKSORT_HH #define QUICKSORT_HH #include "Jet.hh" #include "JetFinder.hh" void QuickSort(Jet* jets[M_JET],int njets); #endif
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2008 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" /** Use this if the libssl random implement...
/* * potion.hpp * Purpose: * * @author Jeremy Elkayam */ #include <SFML/Graphics.hpp> #include "entity.hpp" #pragma once class Potion : public Entity { private: //The amount of time this potion can exist in seconds. float lifespan; //The amount of time this potion has existed in seconds. float age; ...
#include "basePlayerData.hpp" #include <QDebug> BasePlayerDataGUI::BasePlayerDataGUI() : m_Label(Label()) , m_LineEdit(LineEdit()) , m_ComboBox(ComboBox()) , m_Layout(Layout()) , m_Frame(Frame()) , m_SpinBox_Age(new QSpinBox) , m_DateTimeEdit_Birthday(new QDateTimeEdit) { initGUI(); } BasePlayerDataGUI::Label::Label(...
#define CATCH_CONFIG_MAIN #include "../external/catch2/catch.hpp" #include "../src/string/is_absulte_url.hpp" #include <vector> #include <string> #include <array> struct TestStruct { std::string val; bool actual; TestStruct(std::string val, bool actual) : val(val), actual(actual) { } }; ...
#pragma once class CLdr { public: unsigned int read(); };
#include<iostream> using namespace std; typedef unsigned long long int ll; int main(){ ll n; cin>>n; ll k=n/2; for(ll i=1;i<=k;i++) if(n%i==0) cout<<i<<endl; cout<<n; return 0; }
// Copyright (c) 2005-2017 Hartmut Kaiser // Copyright (c) 2011 Bryce Adelstein-Lelbach // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma once #include <pika/...
#pragma once #include"Model.h" class scene_node { private: Model* m_p_model; vector<scene_node*> m_children; float m_x, m_y, m_z; float m_xangle, m_zangle, m_yangle; float m_scale; public: scene_node(); void SetXPos(float x); void SetYPos(float y); void SetZPos(float z); float GetXPos(); float GetYPos(); ...
#include "stdafx.h" #include "grid.h" #include "assert.h" Grid::Grid () { m_grid = NULL; } Grid::~Grid () { } bool Grid::init ( int rowNum, int colNum ) { m_rowNum = rowNum; m_colNum = colNum; m_grid = new Tile*[m_rowNum]; for ( int r = 0; r < m_rowNum; r++ ) { m_grid[r] = new Tile[m_co...
#include <iostream> #include <cmath> using namespace std; using ll = long long; ll dist(ll sx, ll sy, ll gx, ll gy) { ll dx = abs(sx - gx), dy = abs(sy - gy); return max(dx, dy); } int main() { ll n, x, y; cin >> n >> x >> y; cout << (dist(1, 1, x, y) <= dist(n, n, x, y) ? "White" : "Black") << ...
#include <glm/gtc/matrix_transform.hpp> #include "camera.h" namespace pb { Camera::Camera() : mpProjection( NULL ), mpVP( NULL ) { mStatus = init(); } Camera::~Camera() { PB_DELETE( mpVP ); PB_DELETE( mpProjection ); PB_DELETE( mpTransform ); } PBError Camera::init() { if ( mStatus == PB...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef WIDGET_PREFS_H #define WIDGET_PREFS_H #include "modules...
/*In this program we will be seeing about ARRAY in C++ Program*/ /*Array in a C++ Program is a data type which is an user Defined data type, which is used to store a Collection of data which have same data type.*/ /*ADVANTAGE OF ARRAY : When used need to store many values of same data type, he/she can't ale to declea...
#include "VnaPortSettings.h" // RsaToolbox #include "Vna.h" using namespace RsaToolbox; VnaPortSettings::VnaPortSettings(QObject *parent) : QObject(parent) { _placeholder.reset(new Vna()); _vna = _placeholder.data(); _channel = 0; _port = 0; } VnaPortSettings::VnaPortSettings(const VnaPortSet...
#include <iostream> #include <LGB-methods.h> using namespace std; using namespace LGBm; int main() { LGBrandom<float> qRandom; LGBsplit<float> qSplit; std::vector<float> signal; int status; signal = { 1, 0, 2, 0, 3, 0, 4, 0, 1, 1, 2, 1, 3, 1, 4, 1, 1, 2, 2, 2, 3, 2, 4, 2, 1, 3, 2, 3, ...
#ifndef __CCGREELEADERBOARD_H__ #define __CCGREELEADERBOARD_H__ #include "cocos2d.h" #include "GreeExtensionMacros.h" // leaderbaord selector typedef enum { kLeaderboardSelectorMyScores = 0, kLeaderboardSelectorFriendsScores, kLeaderboardSelectorAllScores, } LeaderboardSelector; // leaderboard period typedef enum...
/*************************************************** This is a library for the MLX90614 Temp Sensor Designed specifically to work with the MLX90614 sensors in the adafruit shop ----> https://www.adafruit.com/products/1748 ----> https://www.adafruit.com/products/1749 These sensors use I2C to communicate, 2...
// Generated from Expr.g4 by ANTLR 4.8 #pragma once #include "antlr4-runtime.h" #include "ExprParser.h" /** * This class defines an abstract visitor for a parse tree * produced by ExprParser. */ class ExprVisitor : public antlr4::tree::AbstractParseTreeVisitor { public: /** * Visit parse trees produced...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2007 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ /** @file stdlib_array.cpp Array functions */ #include "core/pc...
#include <iostream> using namespace std; int main() { int a=0,b=1,c=0,d,e; cin>>e; for(d=1; d<=e; d++) { if(d==1) { cout<<" "<<d; continue; } if(d==2) { cout<<d<<" "; continue; } c=a+b; a=b; b=c; cout<<c<<" "; } return 0; }
#include "scene/player/role.hpp" #include "db_log.hpp" #include "db/message.hpp" #include "db/connector.hpp" #include "utils/assert.hpp" #define LOG_COMMON(role, type) auto msg = make_shared<db::message>("add_log", db::message::req_type::rt_insert); \ msg->push_param(role); \...
#pragma once #include "../MonsterAction.h" #include "cmp/CAct_Beam.h" class Act_Thunder : public MonsterAction { public: Act_Thunder(); bool Action(Monster* me) override; private: CAct_Beam m_cBeam; CVector3 m_efs = CVector3::One() * 3.5; bool m_first = true; float m_cost = 0.1; float m_timer = 0; int m_coolti...
#include "Common.h" #include <QStringList> #include <QTextStream> #include <QDebug> #include <cmath> QString hls::baseUrl(const QString &url) { QString baseUrl(url); const auto i = baseUrl.lastIndexOf('/'); if (i > 0) { baseUrl.remove(i + 1, url.size() - i); } return baseUrl; } QString hls::toString(c...
#include <Arduino.h> /********************************************************************* This is an example for our Monochrome OLEDs based on SSD1306 drivers Pick one up today in the adafruit shop! ------> http://www.adafruit.com/category/63_98 This example is for a 128x64 size display using I2C to communicat...
#include "SPH/rigid.h" #include <glm/gtx/euler_angles.hpp> Rigid::Rigid(std::shared_ptr<RigidProperty> _rigidProperty, Mesh _mesh, std::string _name, std::string _type): BaseSphParticle(_rigidProperty, _name) { m_property = _rigidProperty; m_mesh = _mesh; m_positionMapped = false; m_velocityMapped...
#include "webpageview.h" //#include "ui_passworddlg.h" #include <QMenu> #include <QFileDialog> #include <QTreeView> #include <QMessageBox> #include <QContextMenuEvent> #include <QAuthenticator> #include <QWebEngineProfile> #include <QWebEngineDownloadItem> #include <QWebEngineSettings> #include <QWebEngineHistory> #in...
#include "ImplicitEuler.h" bool ImplicitEuler::stepScene(TwoDScene& scene, scalar h) { VectorXs& qn = scene.getX(); VectorXs& qn1 = scene.getX(); VectorXs& qdotn = scene.getV(); VectorXs& qdotn1 = scene.getV(); const VectorXs& m = scene.getM(); const MatrixXs M = m.asDiagonal(); assert(qn.size() == ...
////////////////////////////////////////////////////////////////////////////////////////////////// #include "gameLog.h" #include "myMethod.h" #include <cstdio> #include <string.h> LOG::LOG( IDirect3DDevice9* device ) { _device = device; _font = new CD3DFont("Times New Roman", 16, 0); _font->InitDevic...
/* ID: stevenh6 TASK: inflate LANG: C++ */ #include <fstream> #include <string> #include <algorithm> using namespace std; ofstream fout("inflate.out"); ifstream fin("inflate.in"); int timeline[10001]; int main() { int sol = 0; int minutes, pclasses; fin >> minutes >> pclasses; for (int i = 0; i ...
/* * File: stepper.cpp * Stepper motor code is stored here. * */ #include "thimble.hpp" #include "stepper.hpp" #include "arduino/wiring_private.h" BipolarStepper::BipolarStepper(byte pin1, byte pin2, byte pin3, byte pin4) { pinA_1 = pin1; pinA_2 = pin2; pinB_1 = pin3; pinB_2 = pin4; pinMod...
/***************************************************************** * Copyright (C) 2017-2018 Robert Valler - All rights reserved. * * This file is part of the project: DevPlatformAppCMake. * * This project can not be copied and/or distributed * without the express permission of the copyright holder ******...
//Space Complexity: O(NM), where n is number of coins and m is amount. //Time Complexity: O(NM), where n is the length of the array. //Executed successfully on leetcode. class Solution { public: int change(int amount, vector<int>& coins) { int dp[coins.size()+1][amount+1]; for(int i=0; i<coins.siz...
#include <iostream> #include <vector> int main(){ std::vector< std::vector<int> > arr(6, std::vector<int>(6)); for(int arr_i = 0;arr_i < 6;arr_i++){ for(int arr_j = 0;arr_j < 6;arr_j++){ std::cin >> arr[arr_i][arr_j]; } } int max; bool control = false; for (int i = 0;...
#include<iostream> using namespace std; int countZeros(int n){ if(n<10){ if(n==0) return 1; else return 0; } if(n%10==0){ return 1+countZeros(n/10); }else{ return countZeros(n/10); } } int main(){ int n; cin>>n; cout<<co...
#include <cstdio> using namespace std; int main(){ int n, r; int sumDigits, numberApplicable; long long inputNumber; scanf("%d%d", &n, &r); numberApplicable = 0; while(n > 0){ scanf("%lld", &inputNumber); sumDigits = 0; while(inputNumber > 0){ sumDigits...
/* -*- Mode: c++; tab-width: 4; 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. * * @author Arjan van Leeuwen (arjanl) */ group "desktop_util.OpSortedVector"; include...
#ifndef AMBIENT_LIGHT_H #define AMBIENT_LIGHT_H #include "PhotonBox/component/LightEmitter.h" class AmbientLight : public LightEmitter { public: void init() override; void destroy() override; Shader* getLightShader() override; }; #endif // AMBIENT_LIGHT_H
/* https://www.codechef.com/problems/FLOW009 */ #include <iostream> #include <iomanip> using namespace std; int main() { int t; cin >> t; long double quantity, price; while(t--){ cin >> quantity >> price; if(quantity>1000) cout << fixed << setprecision(6) << (quantity*price)-((quantity*price)*.10) << end...
// 0913_8.cpp : 定义控制台应用程序的入口点。 // #include <iostream> using namespace std; int main() { int T; cin >> T; int flag = 1; while (flag<=T) { int n, m,i; int x[40]; while (cin>>n>>m) { if (n >= 1 && n <= 40 && m >= 1 && m <= n) { int temp = 0; for (i = 1; i <= n; i++) cin >> x[i]; for ...
#include <iostream> void drowLetter(char**& matrix, int& size, char& sym) { std::cout << "Enter the size (from 6 to 60):\t"; std::cin >> size; std::cout << "Size:\t" << size << std::endl; matrix = new char*[size]; while(6 > size || 60 < size) { std::cout << "Please, enter a number from the ...
#include "../include/drift_diffusion.h" double Drift_diffusion::steady_current(void) { double tmp_change_current; vector<double> Jn_t1 = result_it1_scaled.J_n_scaled; vector<double> Jn_t = result_it_scaled.J_n_scaled;; vector<double> Jp_t1 = result_it1_scaled.J_p_scaled; vector<double> Jp_t = result_it_scaled.J_...
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2009-2011. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #include <sstream> #include <fwTools/Type.hpp> #include <fwComEd/helper/A...
#include <afxwin.h> #include <string> #include <iostream> #include <afxinet.h> #include <Rasdlg.h> #pragma comment(lib,"Rasdlg.lib") // //#include <windows.h> //#include <Wininet.h> //#include <strsafe.h> using namespace std; void test() { CInternetSession session("Mozilla/5.0 (Windows; U; Win...
// system includes #include <iostream> #include <vector> //#include <list> //#include <map> // global namespace declaration using namespace std; // project includes //#include "CPolyLine.h" //#include "CRect.h" #include "Test.h" #include "CImage.h" //#include "NotPolymorphic.h" //#include "Polymorp...
// // C++ Interface: AnalogFS // // Description: // 虚拟文件系统,接口函数使用方法尽量与库函数相同 // 意义在于使用此类操作文件可保证多线程安全 // // Author: Jally <jallyx@163.com>, (C) 2008 // // Copyright: See COPYING file that comes with this distribution // // #ifndef ANALOGFS_H #define ANALOGFS_H #include "mess.h" class AnalogFS { public: AnalogFS...
#include <iostream> using namespace std; int gcdR(int a,int b){ if (b == 0) return a; else return gcdR(b,a%b); } int main(){ int gcd; for(int i=0;i<45;i++){ gcd=gcdR(i,45); if(gcd==1){ cout << i << " es posible llave a" << endl; ...
#include "Volume.h" const char* FILTER[] = { "type:", "size:" }; Volume::Volume(const char & diskName) { this->diskName = diskName; QMutexLocker locker(&lock); } Volume::~Volume(void) { deleteUSN(); } bool Volume::isNTFS(void) { bool diskIsNTFS = false; char sysNameBuf[MAX_PATH] = { 0 }; char* s = new char[4]...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* SuperMutant.hpp :+: :+: :+: ...