text
stringlengths
8
6.88M
#pragma once #include "Definitions.h" #include "IJKSize.h" #include <memory> #include <vector> #include "SimpleStorage.h" #include "SimpleSwappableStorage.h" class Repository { DISALLOW_COPY_AND_ASSIGN(Repository); public: Repository(const IJKSize& domain); ~Repository(); const IJKSize domain; ...
class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { // 二分法,核心思想是把矩阵拉成一条数组。 // 可行的原因是每一行开头的数值比上一行末尾的大。可以把下一行拼接到上一行,最后将矩阵变成一行。 int m = matrix.size(), n = matrix[0].size(); // 得到矩阵行和列 int left = 0, right = m * n - 1; // 左边位置和右边位置 while (left <= ri...
#include<bits/stdc++.h> using namespace std; #define ll long long #define fr1(i,n) for(ll i=1;i<=n;i++) #define fr(i,n) for (ll i=0;i<n;i++) ll k, ans, a,b,n,m,c; ll find_k(ll n) { ll tmp=n-a%n; ll lcm=((a+tmp)*(b+tmp) / __gcd((a+tmp),(b+tmp) )); if(lcm<ans) ans=lcm, k=tmp; } int ma...
#include<stdio.h> int main() { int a,s=0; for(a=1; a<=100; a++) { if(a%3==0||a%5==0) s+=a; } printf("%d ",s); return 0; }
#include "main.h" // For iterating through directories. #include <dirent.h> #include <GL/glew.h> #include <GLFW/glfw3.h> // For reading and writing to files. #include <sstream> #include <fstream> #include "UI.h" #include "Chat.h" #include "Sound.h" #include "Chunk.h" #include "Blocks.h" #include "Camera.h" #include...
#pragma once #include "data/node.h" #include "data/datafactory.h" #include "data/minmax_map.h" namespace nodes { struct inspector_result : nodes::result { data::minmax_map minmax_map; data::minmax_map tdd_minmax_map; }; class inspector : public node { public: inspector(); ~inspector(); virtua...
// // my_su.cpp // CRsim // // Created by Ji on 14-10-7. // Copyright (c) 2014年 lj. All rights reserved. // #include "my_su.h" MySU::MySU() : SU() { getMyHopSeq(); getTransSeq(); return; } void MySU::getTransSeq() { transSeq = ""; int m = global::TOTAL_CHAN_NUM; for (int i = 0; i < m + 2;...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
/********************************************************************** ** Mie Calculations are listed in this file. This far field solution is ** based on Bohren and Huffman's (John Wiley 1983) BHMIE code **********************************************************************/ #include "miesimulation.h" #include <cmat...
/* BAEKJOON 17406. 배열 돌리기 4 */ #include <iostream> #include <vector> #include <algorithm> #define MAX 51 using namespace std; struct rotation { int r, c, s; }; int N, M, K, R, C, S, Answer = 987654321; vector<rotation> V; int map[MAX][MAX]; int c_map[MAX][MAX]; int operation[6]; bool selected[6] = { false }; ...
#include "CodeGen/SourceFileWriter.h" #include <cassert> #include <sstream> #include <iostream> namespace vazgen { SourceFileWriter::SourceFileWriter(const SourceFile& sourceFile) : m_writer(sourceFile.getName()) , m_sourceFile(sourceFile) , m_indent(0) { } void SourceFileWriter::write() { beginFile...
#ifndef POLYGON_H_ #define POLYGON_H_ #include "../Include/Graph.h" class Polygon : public Graph { public: Polygon(); void setRefPoint(int x, int y, int num); Point getRefPoint(int num); void draw(); void move(int x, int y); bool isGrabbed(int x, int y); void setMaxRefNum(int x); int getMaxRefNum(); pri...
/*************************************************************************** Copyright (c) 2015 Philip Fortier This program 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 2 of the License, or (at ...
#include "sdltest2.h" #include "CValuteEntry.h" bool SDLTest2::OnInit() { if (SDL_Init(SDL_INIT_VIDEO) < 0) { return false; } // SDL_image init int imgFlags = IMG_INIT_PNG; if (!(IMG_Init(imgFlags) && imgFlags)) { return false; } // SDL_ttf init if (TTF_Init() == -1) { return false; } if ((Window = ...
#ifndef _COMPONENTMANAGER_H #define _COMPONENTMANAGER_H #include "ComponetInterface.h" #include <atlstr.h> #include <map> ////////////////////////////////////////////////////////////////////////// // 组件管理器 class CComponentManager: public IComponentManagerVSDK { public: BOOL RegisterComponent(IComponent *pComponent...
#include <iostream> using namespace std; int main() { int x, r1, r2; cin >> r1 >> r2; x = ((r1*12)-(r2*3))/3; cout << "Lightning Little Marcos:\n\n\n"; cout << r1+r2 << ".0 -> " << x << endl; return 0; }
/* * Copyright (c) 2009-2012 André Tupinambá (andrelrt@gmail.com) * * 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 limitation the rights * to use...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2010 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of ...
#include <iostream> #include "test.h" using namespace std; int main() { swapTest<int> oswapTest; int a = 8; int b = 4; oswapTest.swap(a, b); cout << "a=" << a << ",b=" << b<< endl; cout << "the end" << endl; }
#ifndef _HTTP_A_H #define _HTTP_A_H #include <vector> #include <mysql++.h> mysqlpp::Connection con; int CrearEstadisticas(std::string &, std::string &); int ParsearEstadisticas(std::string &, std::string &); int RecuperarDominios(std::vector<std::string> &, std::vector<std::string> &, mysqlpp::Connection &); #end...
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Steam.h" #include "SteamEnums.h" #include "SteamStructs.h" #include "UObject/NoExportTypes.h" #include "SteamUGC.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnAddAppDepe...
#ifndef MX_FLUIDEMITTER_H #define MX_FLUIDEMITTER_H #if 0 //#include <NxPhysics.h> #include "MxUtils.h" #include "MxObjects.h" class MxFluid; class MxFluidEmitter : public MxObject { public: virtual MxFluidEmitter* isFluidEmitter() { return this; } virtual void* isType(MxObjectType type) { if (type == M...
#include "../generated/MessageAdapters.hpp" #include "Game.hpp" #include <eznet/Utils.hpp> int main(void) { eznet::init(); Game game; game.run(); return 0; }
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) cin>...
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int t,n,a,b,i; cin>>t; while(t--) { cin>>n>>a>>b; if(b<a){ int temp=...
#include<bits/stdc++.h> #define ll long long using namespace std; const ll N=1e6+5,mod=998244353; ll gcd(ll a,ll b) { return a%b==0?b:gcd(a%b,b); } ll pow(ll a,ll b) { ll ret=1; while(b) { if(b&1) ret=ret*a%mod; a=a*a%mod; b>>=1; } return ret; } ll a[N],b[N],f[N],dp[N]; ll n,c; int main() { scanf("%lld %...
class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int>& nums2) { sort(nums1.begin(), nums1.end()); sort(nums2.begin(), nums2.end()); int pointer1 = 0, pointer2 = 0; vector<int> res; while(pointer1 < nums1.size() && pointer2 < nums2.size()) { ...
#ifndef _TNA_ENGINE_FPSCAMERA_H_ #define _TNA_ENGINE_FPSCAMERA_H_ #include "../math/matrix.h" #include "../math/vector.h" #include "../math/math_tools.h" #include "../resources/resources.h" #include <furious/components.h> #include <math.h> namespace tna { struct fps_camera_t { FURIOUS_COMPONENT(fps_camera_t);...
/******************************************************************************* * Split * * Authors: * Chantel Frizzell, Jeremy DeHaan * * Date Last Modified: * 2017-03-13 * * This class is used to help process command strings, by splitting into * usable parts, and placing the parts into a vector. ****...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#include <iostream> using namespace std; class Move { private: double x; double y; public: Move(double a = 0, double b = 0); // sets x, y to a, b showMove() const; // shows current x, y values Move add(const Move & m) const; // this function adds x of m to x of invoking object to get new x, // adds y o...
#include <iostream> #include <iomanip> #include <string> #include "Calculator.h" #include "CalcSum0to10.h" #include "CalcSum3to7.h" #include "Batch.h" using namespace std; /** * Story: * Create one calculator(receiver), and several sets of operations(ConcreteCommand) * main function(Client) contains these operat...
// // Copyright Jason Rice 2019 // 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) // #ifndef NBDL_FWD_CONSUMER_INIT_HPP #define NBDL_FWD_CONSUMER_INIT_HPP #include <nbdl/concept/Consumer.hpp> namespace nbdl { t...
#pragma once #include "string" using namespace std; class Person { private: string name; string telNo; public: Person(); Person(string name, string telNo); string getName(); void setName(string name); string getTelNo(); void setTelNo(string telNo); ~Person(); };
// Fill out your copyright notice in the Description page of Project Settings. #include "XTwoHandWeapon.h" #include "XBaseCharacter.h" AXTwoHandWeapon::AXTwoHandWeapon() { } void AXTwoHandWeapon::OnUse(AXBaseCharacter * Character) { } void AXTwoHandWeapon::Tick(float DeltaTime) { Super::Tick(Del...
#include <syslog.h> #include "Math.h" #include "Game.h" void Game::Menu() { if(m_playing) { Tick(0); } else { if(m_hasWon) { m_splash->Load(VICTORY); } if(!m_hasWon) { m_splash->Load(DEFEAT); } if(m_racers[0].CurrLap() == 0 && m_racers[0].NextCheckPoint() == 0) { m_splash->Load(SPLA...
/* json.h -*- C++ -*- Rémi Attab (remi.attab@gmail.com), 19 Apr 2015 FreeBSD-style copyright and disclaimer apply */ #pragma once #include "json/json.h"
#pragma once #ifndef _DATAINPUT_HPP_ #define _DATAINPUT_HPP_ #include <iostream> using std::cout; //------------------------------------------------------------------------ // DATA INPUT STRUCTURES //------------------------------------------------------------------------ struct DataInput { void display() cons...
#include<bits/stdc++.h> using namespace std; int count_bits(int n) { int count = 0; while(n!=0) { int rmsb = n&-n; n = n - (rmsb); count+=1; } return count; } int main() { int x,y; cin >> x >> y; int output = x^y; cout << count_bits(output) << endl; return 0; }
#pragma once #include "Platform.h" #include <vector> namespace vkw { class VulkanDevice; class Subpass; class RenderPass { public: RenderPass(VulkanDevice* pDevice, const std::vector<VkAttachmentDescription>& attachments, std::vector<VkSubpassDescription> subpassDescriptions, std::vector<VkSubpassDependency> dep...
#include <bits/stdc++.h> using namespace std; const int MAX_INT = std::numeric_limits<int>::max(); const int MIN_INT = std::numeric_limits<int>::min(); const int INF = 1000000000; const int NEG_INF = -1000000000; #define max(a,b)(a>b?a:b) #define min(a,b)(a<b?a:b) #define MEM(arr,val)memset(arr,val, sizeof arr) #defi...
// $Id: B4cDetectorConstruction.cc 101905 2016-12-07 11:34:39Z gunter $ // /// \file B4cDetectorConstruction.cc /// \brief Implementation of the B4cDetectorConstruction class #include "B4cDetectorConstruction.hh" #include "B4cCalorimeterSD.hh" #include "G4Material.hh" #include "G4NistManager.hh" #include "G4Box.hh" ...
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); int t; cin>>t; for(int tc=1;tc<=t;tc++) { int n,a,b,c; cin>>n; int left[n+1]={},right[n+1]={}; int w_left=0,w_right=0; for(int i=0;i...
#include <iostream> #include <cstdio> #include <cstring> #include <map> #include <vector> #include <ctime> #include "hw2.h" using namespace std; void get(int u, int a, int q, int p, int d) { Data key; key.a = a; key.q = q; key.p = p; key.d = d; pair <SubData::iterator, SubData::iterator> range; range = users...
#include <cybermed/cybCore.h> #include <cybermed/cybViewMono.h> #include <cybermed/cybViewAnaglyph.h> #include <cybermed/cybViewColorAnaglyph.h> #include "InteractionHandle.h" int main(int argc, char** argv) { char *fileName = "monkey.wrl"; //Model name int numLayer = 1; //Number of layers used in this application...
// // Copyright Jason Rice 2016 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include <nbdl/bind_map.hpp> #include <nbdl/bind_sequence.hpp> #include <nbdl/entity.hpp> #include <nbdl/match_path.hpp> #inclu...
#include<bits/stdc++.h> using namespace std; int m = 1e7+7; int pow1(int n, int k){ if(k==0) return 1; else if(k%2 == 0) return pow1((n*1ll*n)%m, k/2)%m; else return (pow1((n*1ll*n)%m, k/2)*1ll*n)%m; } int main(){ while(1){ int n,k; cin >> n >>k; if(n==0 && k==0) break; l...
#ifndef SPOOFMAC_H #define SPOOFMAC_H #define MALLOC(x) HeapAlloc(GetProcessHeap(), 0, (x)) #define FREE(x) HeapFree(GetProcessHeap(), 0, (x)) #define WORKING_BUFFER_SIZE 15000 #define MAX_TRIES 3 #define MAX_KEY_LENGTH 255 #define MAX_VALUE_NAME 16383 #define _WIN32_WINNT 0x0500 #define TOTALBYTES 8192 #define BYTEIN...
#include "Stack.h" void PrintInfo(Stack &s) { cout << "Size : " << s.getSize() << " / " << "Length : " << s.getLength() << " / " << "Front : " << s.Front() << " / " << "Top : " << s.Top() << endl; } int main() { Stack q(5); cout << "<init>" << endl; PrintInfo(q); cout << q << endl; cout << "<push>" ...
#include<bits/stdc++.h> #define maxn 5005 #define int long long #define mod 1000000007 using namespace std; typedef long long ll; int dp[5005][5005], dp1[5005][5005]; char s[maxn], t[maxn]; ll fac[maxn*2]; ll inv[maxn*2]; ll qpow(long long a,long long b) { ll ans=1; ll k=a; while(b) { if(b&1)ans=ans*k%mod; k=k...
#include "networking\Singularity.Networking.h" #define PACKER_TYPE_GAME 0x30 #define PACKER_COMMAND_REGISTER 0x10 #define PACKER_COMMAND_UNREGISTER 0x20 #define PACKER_COMMAND_UPDATE 0x40 #define PACKER_COMMAND_LIST 0x80 #define PACKER_COMMAND_PLAYER 0x01 #define PACKER_COMMAND_DATA 0x04 using namespace...
#include <iostream> #include "Hastable.h" #include "HashString.h" #include "Hashable.h" void main() { Table<int> hashT(20); hashT.Add(500, HashString ("test1") ); hashT.Add(600, HashString("test5")); hashT.Add(700, HashString("test2")); hashT.Add(800, HashString("test1")); hashT.Add(900, HashString("test10")); ...
#include "stdafx.h" #include <stdlib.h> #include "locale.h" #include < string.h > #include "Book.h" #define MAX_LEN 20 // Конструктор по умолчанию Book::Book() { } // Конструктор с параметрами(ну не совсем) Book::Book(int num, char InfoString[100])//здесь происходит парс строки из Source по сиволам '/' ...
/* BAEKJOON 17143. 낚시왕 1시간 10분 소요 처음에 테스트케이스는 맞지만 시간초과가 났다. 상어의 속력의 범위는 0 ≤ s ≤ 1000이다. 상어 수가 많아질 수록, 속력 수 만큼 한 칸씩 while문으로 이동한다면 1초 안에 해결할 수 없다. 따라서, 현재 위치(제자리)로 돌아오는 때를 무시하고 그 이후의 거리만 while문으로 이동해야 한다. 이동 방향이 위, 아래일 때는 (R-1)*2만큼 이동할 때마다 제자리로 돌아온다. 이동 방향이 왼, 오른쪽일 때는 (C-1)*2만큼 이동할 때마다 제자리로 돌아온다. 따라서...
// // ConfigFile.cpp // // Copyright (c) 2013 - The Foreseeable Future, zhiayang@gmail.com // // Licensed under the Apache License Version 2.0. // #include <Kernel.hpp> // #include <String.hpp> // #include <StandardIO.hpp> // #include <SimpleStringMap.hpp> // #define RAPIDXML_NO_STDLIB // #define RAPIDXML_NO_EXCEPTIO...
#include <bits/stdc++.h> using namespace std; struct Student{//学生结构体,把成绩均初始化为-1,以便输出 string id; int Gp=-1,Gmid=-1,Gfinal=-1,G=0; }; int main(){ unordered_map<string,Student>m;//学生id到学生结构体的映射 int P,M,N,score; scanf("%d%d%d",&P,&M,&N); string temp; for(int i=0; i<P; ++i){ cin>>temp>>sc...
// // CardTypeHelper.cpp // demo_ddz // // Created by 谢小凡 on 2018/2/8. // #include "CardTypeHelper.hpp" #include <algorithm> NumMap CardTypeHelper::splitByDepth(const NumVec& src) { if (src.empty()) return {}; NumMap ret; int count = 0; int num = -1; for (size_t i = 0; i != src.size(); ...
/*========================================================================= Program: Visualization Toolkit Module: vtkLineSource.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is d...
#ifndef SHADERS_HPP #define SHADERS_HPP namespace shaders { static const char *vertexShaderSource = "attribute highp vec4 posAttr;\n" "attribute lowp vec4 colAttr;\n" "varying lowp vec4 col;\n" "uniform highp mat4 matrix;\n" "void main() {\n" " col = colA...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define fr(i,n) for(int i=0;i<n;i++) ...
// Copyright 2017-2018 Apex.AI, Inc. // // 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...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * 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 ...
/** 树状数组模板: MAX_N 范围 lowbit(x) 返回低位 add(n,val) 位置n加上val query(int n) 返回从1到n的和 切记从 1 开始使用 Author:赵宏宇 **/ const int MAX_N = 10000; int a[MAX_N]; int c[MAX_N]; int lowbit(int x){ //返回低位1 return x&(-x); } void add(int n,int val){ //增加值! while(n<...
#include <bits/stdc++.h> using namespace std; int main(){ cout << 1000 << " LRLRLRLRLRLLRLRRLRLRLLRLR"; for (int i=0; i<1000; i++){ for (int j=0; j<1000; j++) cout << '.'; cout << endl; } }
class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { if(matrix.empty()) return false; int rows = matrix.size(), cols = matrix[0].size(); int a = rows - 1, b = 0; while(a >= 0 && b < cols) { if(matrix[a][b] < target) ...
#pragma once #include "./ReaderWriter.h" #include <string> class BufferedReaderWriter { /// la taille du buffer static const int TAILLE_BUFF=500; /// l'outil de lecture interne ReaderWriter rw; /// debut de ce qu'il reste à lire (si une lecture a déjà eu lieu sans vider le buffer et /// qu'on vaut éviter d...
#include "CRPGServer.h" #include "CData.h" #include "CRPGServerLogicThread.h" bool CRPGServer::Init(const char * _path) { char ip[15]; UINT16 port; UINT16 sessionLength; UINT16 workerThreadLength; GetPrivateProfileString("Server", "IP", NULL, ip, 15, _path); port = GetPrivateProfileInt("Server", "Port", 0, _pat...
#include <windows.h> #include <GL/glut.h> void display() { glClearColor(1.0,1.0,1.0,1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);//"czyszczenie" tła okan i bufora głębokosci glEnable(GL_DEPTH_TEST);//włącznie algorytmu zasłaniania glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspectiv...
//Seth Stoltenow Delivery 2 CSCI 465 UND Fall 2018. Completed in Linux Mint on GCC 5.4.0 //ID: 1119117 //Email: seth.stoltenow@und.edu //TODO writeln #include "compiler.h" #include <stack> #include <queue> #include <iostream> #include <fstream> #include <string> #include <sstream> #include <iomanip> #include <vecto...
#include <whiskey/AST/Predicates.hpp> #include <whiskey/Core/Assert.hpp> namespace whiskey { bool isAtomicType(NodeType type) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wswitch-enum" switch (type) { case NodeType::TypeAtomicBool: return true; case NodeType::TypeAtomicInt8: return tr...
// // SMMeshView.hpp // SMFrameWork // // Created by SteveMac on 2018. 9. 14.. // #ifndef SMMeshView_h #define SMMeshView_h #include "SMView.h" #include <cocos2d.h> #include <renderer/CCTrianglesCommand.h> #include <renderer/CCCustomCommand.h> #include <2d/CCAutoPolygon.h> class SMMeshView : public SMView { publi...
#include <gcc-plugin.h> int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version) { (void)plugin_info; (void)version; fprintf(stderr, "HELLO from %s\n", plugin_info->full_name); return 0; } int plugin_is_GPL_compatible;
#include<string> #include<vector> #ifndef ESCENARIO_H #define ESCENARIO_H #include"Item.h" #include"Bombas.h" using namespace std; class Escenario{ private: Item*** tablero; vector<Bombas*> bombas; string nombre; vector<Bombas*> enemigas; public: Item***& getTablero(); vector<Bombas*> getBombas(); void...
#ifndef LIGHTS_ANIMATOR_H #define LIGHTS_ANIMATOR_H #include <FastCG/World/Behaviour.h> #include <FastCG/Rendering/PointLight.h> #include <glm/glm.hpp> #include <vector> class LightsAnimator : public FastCG::Behaviour { FASTCG_DECLARE_COMPONENT(LightsAnimator, FastCG::Behaviour); public: void ChangeColors(); pr...
#pragma once #include <map> #include <atlcomcli.h> #include <Wbemidl.h> #include <string> #include <cassert> using std::wstring; //! Provides classes for manipulating WMI objects /*! WMI (Windows Management Instrumentation) is designed to be used from scripting languages (such as VBScript). That way, it uses approac...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include <iostream> #include <fstream> #include <string> #include <algorithm> #include <iterator> #include <cassert> #include <vector> #include <cstdio> #include <ctime> using namespace std; const int binLen=8; const int happycount=100; //struct for node of binary tree struct node { string value; //to place valu...
#include <iostream> int main(){ auto var_int = 5; auto var_doub = 6.4 ; auto var_doub2 = 10.4 ; printf("var_int %d var_doub %f\n",var_int,var_doub); printf("swapped wrong output by swapping keep in mind var_int %f var_doub %d\n",var_int,var_doub2); //Most easy methd is using cout st...
/* * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef CUTELYSTVALIDATORRULE_P_H #define CUTELYSTVALIDATORRULE_P_H #include "validatorrule.h" #include <Cutelyst/Context> #include <limits> #include <QDate> #include <QDateTime> #include...
/*************************************************************************** Copyright (c) 2020 Philip Fortier This program 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 2 of the License, or...
// // Created by gadi on 07/01/2020. // #ifndef SEARCHALGORITHMS__SERVER_H_ #define SEARCHALGORITHMS__SERVER_H_ #include "ClientHandler.h" #include <string> #include <iostream> #include "Solver.h" #include "StringReverser.h" #include "CacheManager.h" #include "FileCacheManager.h" namespace server_side { class Server ...
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> si; typedef map<string, int> msi; typede...
#include<iostream> #include<conio.h> using namespace std; class TreeNode { private: int *obj; TreeNode *left; TreeNode *right; public: int *get() { return this->obj; } void set(int *obj) { this->obj=obj; } TreeNode *getleft() { return left; } void...
#include <bits/stdc++.h> using namespace std; int removeCoveredIntervals(vector<vector<int>> &arr) { sort(arr.begin(), arr.end(), [](auto a, auto b) { return a[0] == b[0] ? a[1] > b[1] : a[0] < b[0]; }); for (auto a : arr) cout << a[0] << " " << a[1] << endl; int len = arr.size(); for (int i = ...
#include <iostream> #include "SimpleSpaceShip.h" using namespace std; SimpleSpaceShip::SimpleSpaceShip() { name += "_default"; cout << "Default Constructor Called, " << name << endl; } SimpleSpaceShip::SimpleSpaceShip(Vector2D position, int fuel) : position{ position }, fuel{ fuel } { name += "_conversion"; cout...
#include <iostream> #include <string> using namespace std; #include "solution.h" int main() { Solution sol; cout << sol.toGoatLatin(string("I speak Goat Latin")) << endl; cout << sol.toGoatLatin( string("The quick brown fox jumped over the lazy dog")) << endl; return 0; }
//Jason Strange //CS222-01-13W //This datatype inherits from a name key, it is used //to store a string and compare it against other titlekeys. #include <string> #include "TitleKey.h" using namespace std; TitleKey::TitleKey(string t){title = t;} string TitleKey::getTitle(){return title;} void TitleKey::setTi...
/*********************************************************************** created: 17th August 2015 author: Lukas Meindl (based on code by Paul D Turner) purpose: Implementation of PropertyHelper methods *************************************************************************/ /******************...
#include "CCheckBox.h" #include "CLabel.h" CCheckBox::CCheckBox(const vec2d& pos, const vec2d& size, const String& text, bool selected): CAbstractToggle(pos,size,selected) { addChild(new CLabel(vec2d(getH()+5., 0), vec2d(getH(), getH()), text)); } void CCheckBox::draw(){ double u=getH()/8.; set...
/************************************************************************* > File Name: HelloOpenCV.cpp > Author: Henry Ma > Mail: iloveicRazavi@gmail.com > Created Time: 2020年07月31日 星期五 16时26分44秒 ************************************************************************/ #include <iostream> #include <...
#include <iostream> #include <time.h> #include <windows.h> using namespace std; int i = -1 ; int zero[1] = { 0 }; int stroka, stolb,returned; int &maxelement(int(**)); int main() { srand(time(0)); SetConsoleCP(1251); SetConsoleOutputCP(1251); while (i <=1) { printf("Введите количество элементов массива (больш...
#ifndef CLISTENERMEMBERFN_H #define CLISTENERMEMBERFN_H #include "CListener.h" template<class idType, class objectType> class CListenerMemberFn: public CListener{ typedef void (objectType::*fn0)(idType); typedef void (objectType::*fn1)(idType, CGuiPanel*); public: CListenerMember...
#include <iostream> #include "lista.h" using namespace std; template <typename T> lista<T>::lista() { primero = NULL; cursor = NULL; longitud = 0; } template <typename T> lista<T>::~lista() { vaciar(); } template <typename T> int lista<T>::cantidadElementos() { return longitud; } ...
#include <Arduino.h> #include "./hardware.h" Intensity def = intensity_none; short pwm = 0; Toy lnip = {"lnip", "L Nipple", 0, def, pwm, 1, .75, .5, 2 }; Toy rnip = {"rnip", "R Nipple", 0, def, pwm, 1, .75, .5, 16}; Toy button = {"btn", "button", 0, def, pwm, 1, .89, .75, 26}; Toy t4 = {"t4", "Toy 4", 0, def, pwm, 1...
#include<bits/stdc++.h> using namespace std; unordered_map<string,pair<int,int>> ha; pair<int,int> solve(string input) { if(input.size()==1) { if(input[0]=='T') { return {1,0}; } else { return {0,1}; } } if(ha.find(input)!=ha.end()) { return ha[input]; } int t = 0; int f=0; for(int i=...
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. #include "CyLandEditorDetailCustomization_NewCyLand.h" #include "Framework/Commands/UIAction.h" #include "Widgets/Text/STextBlock.h" #include "Framework/MultiBox/MultiBoxBuilder.h" #include "Misc/MessageDialog.h" #include "Modules/ModuleManager.h" #include "...
#include "MultipinRoute.h" double MultipinRoute::getRoutedWirelength() const { double routedWL = 0.0; for (const auto &gp : this->mGridPaths) { routedWL += gp.getRoutedWirelength(); } return routedWL; } int MultipinRoute::getRoutedNumVias() const { int numRoutedVias = 0; for (const aut...
#pragma once #include <usp10.h> #include <dimm.h> #include <d3d9types.h> #include <d3dx9math.h> #include <vector> #include "common_ui.h" //-------------------------------------------------------------------------------------- // Defines and macros //-------------------------------------------------------------------...
#include "InputHandler.h" InputHandler::InputHandler() { this->m_mouseX = 0; this->m_mouseY = 0; int m_mouseDX = 0; int m_mouseDY = 0; int m_mouseWheelX = 0; int m_mouseWheelY = 0; this->m_screenWidth = 0; this->m_screenHeight = 0; this->m_mouseButtonState.left = 0; this->m_mouseButtonState.right = 0; this-...
/* File: SavingsAccount.cpp * Name: Paulo Lemus * Date: 2/8/2017 */ #include <iostream> #include <string> #include "BasicAccount.h" #include "SavingsAccount.h" /* Constructors */ SavingsAccount::SavingsAccount() : ba(){ withdrawals = 0; } SavingsAccount::SavingsAccount(long int accountNum, std::string name, f...