text
stringlengths
8
6.88M
// Filename: cPetFlee.h // Created by: dcranall (15Jul04) // //////////////////////////////////////////////////////////////////// #ifndef CPETFLEE_H #define CPETFLEE_H #include "toontownbase.h" #include "cImpulse.h" class EXPCL_TOONTOWN CPetFlee : public CImpulse { PUBLISHED: CPetFlee(NodePath *chaser = 0, float ...
#include <iostream> #include <cstring> using namespace std; int main() { char a[]="aaaaa"; char b[]="bbbbbbbb"; char c[strlen(a)+strlen(b)-1]; strcpy(c,a); strcat(c,b); cout << a <<endl; cout << b <<endl; cout << c <<endl; return 0; }
// // Created by 王润基 on 2017/4/8. // #include "IRayCastable.h" #include "Geometry.h" #include "../Shapes/3D/AxisBox.h" bool IRayCastable::tryGetIntersectionPoint(const Ray &ray, float &t, Vector3f &param) const { bool exist = tryGetIntersectionPoint(ray, t); param = ray.getEndPoint(t); return exist; } bo...
//694 - The Collatz Sequence //Dept. ICE, NSTU-11 Batch #include<bits/stdc++.h> using namespace std; //#define INF 99999999 #define INF 1<<28 #define ll long long #define SZ 100009 #define MX 100000000 #define sfint(a) scanf("%d",&a) #define sfllint(a) scanf("%lld",&a) #define sfch(a) scanf("%c",&a) #define sfchsq(a) s...
/* XBOX SnowFlake Class */ #ifndef __SNOWFLAKE_H__ #define __SNOWFLAKE_H__ #include <xtl.h> #include "..\\XbMesh.h" #include "..\\XbUtil.h" #define MAX_SF 1000 class CXBSnowFlake { protected: CXBMesh m_meshFlake[MAX_SF]; // Snowflakes Models D3DXVECTOR3 m_vecPosition[MAX_SF]; // Snowflakes Position D3...
/*========================================================================= Program: Visualization Toolkit Module: vtkQWidgetRepresentation.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 so...
// Fill out your copyright notice in the Description page of Project Settings. #include "PauseMenu.h" #include "Components/Button.h" #include "Kismet/GameplayStatics.h" #include "../UniverseGameInstance.h" bool UPauseMenu::Initialize() { bool Success = Super::Initialize(); if (!Success) return false; if (!ensur...
/* * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef CUTELYST_P_H #define CUTELYST_P_H #include "context.h" #include "enginerequest.h" #include "plugin.h" #include "request_p.h" #include "response.h" #include <QStack> #include <QVariant...
#include <iostream> using namespace std; void main() { int a, b, c; double avg = 0; cin >> a >> b >> c; avg = (double)(a + b + c) / 3; cout << fixed; cout.precision(2); cout << avg<<endl; if (avg >= 75) cout << "A"; else if (avg < 75 && avg >= 50) cout << "B"; else cout << "F"; }
/* 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...
#pragma once #include "gameNode.h" #define PI 3.141592654f #define BULLETMAX 50 struct tagBullet { float x, y; float speed; float angle; float radius; bool isFire; float gravity; int count; float xPrev, yPrev; }; struct tagCannon { POINT center; //캐논의 중점 POINT cannonEnd; //캐논 포의 끝점 int radius; //붼지름 ...
// // FileManager.cpp // SMFrameWork // // Created by KimSteve on 2016. 11. 17.. // // #include "FileManager.h" #include <stdio.h> #include <dirent.h> static FileManager* _instance = nullptr; const int FileManager::SUCCESS = 0; const int FileManager::FAILED = -1; // app main data root path static const char* DA...
// // SWEA_5644_RE.cpp // Algorithm // // Created by 박세은 on 2020/06/07. // Copyright © 2020 박세은. All rights reserved. // // 5644. [모의 SW 역량테스트] 무선 충전 다시풀기2 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> #include <queue> #include <algorithm> #include <cstring> using namespace std; struct Ba...
class Solution { public: unordered_set<string> resultset; unordered_set<string>::iterator iter; string addstring; char *src; bool *mem; int len; int leftcnt; int rightcnt; int removeleft; int removeright; void fromright2left(int pos, int stacksize, int removed...
/* Started by Gonzalo Pintos Cuesta on June of 2019 Author: Gonzalo Pintos Cuesta Copyright © 2020 Gonzalo Pintos Cuesta Last Update: June/2020 email: gonigox@gmail.com */ #pragma once #include <Entity.hpp> #include <Kernel.hpp> #include <string> #include <memory> #include <map> #include <Window.hp...
#ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif #include "Aria.h" #include "ArNetworking.h" #include "opencv2/highgui/highgui.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <opencv2/opencv.hpp> #include <opencv2/nonfree/nonfree.hpp> #include <ope...
/* * UserModel.h * * Created on: Feb 21, 2013 * Author: cem */ /** * The file structure that we want to write/read as follows: * * UserId=cem, * UDPAverage=0, * TCPAverage=0, * lastDepartureTime=, * dailyAuthenticationNumber=0, * visitFrequencyNumber=0, * authenticationNumber=0, * bandwidthAverage=...
#include<iostream> using namespace std; class Searching { int a[10],n,i; public: void Input(); void Binary(); }; void Searching::Input() { cout<<"Enter Total number of elements:"; cin>>n; cout<<"\nEnter them one by one:"; for(i=0;i<n;i++) { cin>>a[i]; } } //Binary Search void...
//#include <stdio.h> //#include <stdlib.h> // //int main(void) //{ // int n, m; // scanf("%d%d", &n, &m); // if (n < 0 || m < 0) { // exit(1); // } // int *num = (int *)malloc(sizeof(int) * n*m); // for (int i = 0; i < n*m; i++) { // scanf("%d", &num[i]); // } // // /* // 数据处理 // */ // // /*释放申请内存*/ // free(num); //...
#include <RobDuino.h> DOutDir Motor0(pD6, pD7); DOutDir Motor1(pD4, pD5); DOutDir Motor2(pD2, pD3); DOutDir Motor3(pD0, pD1); int pin[4] = {9,10,11,12}; byte max_in = 3; int duration[4]; byte pwm_val[4]; byte direction[4]; void setup() { pinMode(pin, INPUT); pinMode(pin + 1, INPUT); pinMode(pin + 2, INPUT); p...
#include "utils.h" namespace physics { const ffloat Utils::SMALL_NUM = ffloat(0.00001); ffloat Utils::distPointToPlane(const Vector3 &pt, const Vector3 &ptOnPlane, const Vector3 &planeNormal) { Vector3 v = (pt - ptOnPlane); ffloat dist = v.dot(planeNormal); return dist; } ffloat Utils::distPoi...
#ifndef _ROBOT_ANIMATION_COMPONENT_H_ #define _ROBOT_ANIMATION_COMPONENT_H_ #include "Components.h" class RobotAnimationComponent : public Component { private: // constants for arm and leg movement states const char BACKWARD_STATE = 0; const char FORWARD_STATE = 1; // index constants for accessing arm and leg ...
// ~/NmpntLibrary/NtripClient/NtripClient.cpp #ifdef _WIN32 #include "stdafx.h" #else #include <stdio.h> #include <string.h> #endif #include "MultiClient.h" // Callback Function ////////////////////////////////////////////////////////////////////////////// static void table(char *mount) { //... printf("%s\n", mou...
#include <iostream> #include <unistd.h> #include <thread> #include <string> #include <vector> #include "portaudio_wrapper.h" #include <osp_params.hpp> #include <osp_net.hpp> #ifdef __linux__ #include <sched.h> #endif static std::atomic<int> cb_counter(0); static int audio_cb(const void *inputBuffer, void *outputBuf...
#include <bits/stdc++.h> using namespace std; const int N = 606; vector < int > g[N]; int memo[N][N], n; double dp[N][N]; double solve(int blocked, int u){ double resp = .0; if(u == n) return .0; double mx = -1; int mx_vtx; if(g[u].size() == 0) return 1e9; if(memo[blocked][u] != -1) return dp[blocked][u];...
/* * Peceptron.h * * Created on: Feb 25, 2016 * Author: alexander */ #ifndef PERCEPTRON_H_ #define PERCEPTRON_H_ #include <iostream> //General purpose---------------------------- #define PERCEPTRON_L1 0 #define PERCEPTRON_L2 1 //Perceptron geometry------------------------ #define PERCEPTRON_LAYE...
#include "qquickfolderlistmodel.h" QQuickFolderListModel::QQuickFolderListModel() { }
#include <cstdio> #include <QtDBus> #include "subscriber.h" using namespace std; Subscriber::Subscriber(QObject *parent) : QObject(parent) { } void Subscriber::start(const QString &name) { if (name != "org.example.QtDBus.PingExample") { return; } qstdin.open(stdin, QIODevice::ReadOnly); iface ...
#pragma once #include "Common.h" #include "GameWindow.h" // Classes used in game. For a new class, declare it here and provide a pointer to an object of this class below. Then, in Game.cpp, // include the header. In the Game constructor, set the pointer to NULL and in Game::Initialise, create a new object. Don't...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include <functional> #include "CoreMinimal.h" #include "Blueprint/UserWidget.h" #include "Runtime/UMG/Public/Components/Button.h" #include "Runtime/UMG/Public/Components/TextBlock.h" #include "MenuButton.generated.h"...
#include <iostream> using namespace std; /* * Pre:---- * Post: Pide al operador una duración real en segundos y la devuelve separada en días, horas, minutos y segundos (redondeada al segundo) */ int main() { cout << "Duracion en segundos: " << flush; double seg; cin >> seg; int segundosTotales = int(seg + 0.5)...
#include<vector> using namespace std; #include"FindArray.h" class Solution { public: bool Find(vector<vector<int> > array,int target) { int size=array.size(); if(array[0][0]>target) return false; //int head=0,tail=size-1; int head_board=0,tail_board=siz...
// // Created by 邓岩 on 2018/4/26. // /* istreamstring的用法 输入形式: dengyan 1388 321321 huwangfei 312431 8908 rongti dsas fasd 以两下会车结束 总的来说: istringstream类似sscanf ostringstream类似sprintf */ struct Person{ string name; vector<string> phones; }; int valid(const string &c) { for (auto i : c) if(...
// // Created by ivan on 5/10/18. // #ifndef MATHGL_MODULE_MGLGRAPHICS_H #define MATHGL_MODULE_MGLGRAPHICS_H #include <mgl2/qt.h> #include "mathGL_graphics_object.h" #include "mathGL_graphics_frame_properties.h" #include <list> #include <string> /** * Visualisation module based on MathGl library. * This class is a ...
//-----UDP----- /* * Reception de message, lecture et accusé de réception */ void udpIn(){ int packetSize = Udp.parsePacket(); if(packetSize){ Udp.read(message, UDP_TX_PACKET_MAX_SIZE); Serial.print("Message recu: "); Serial.println(message); if(strcmp(message, "happyHour0") == 0) { ...
#include <windows.h> #include "freeglut.h" //wspolrzedne obserwatora GLdouble eyex=0.0; GLdouble eyey=0.0; GLdouble eyez=30.0; void prostopadloscian(GLfloat x, GLfloat y, GLfloat z, GLfloat dx, GLfloat dy, GLfloat dz) { glBegin(GL_QUADS); //gora,………………………………………. niebieski glColor3f(0.0, 0.0, 1.0);...
/*----------------------------------------------------------------------------* * 파일명 : HoPhysics.h * 하는일 : 이동 경로 관리.. * 작성일 : 최종업데이트 2000.1 * 적성자 : 홍호동. *-----------------------------------------------------------------------------*/ #ifndef _HO_PHYSICS_H_ #define _HO_PHYSICS_H_ struct hoPOINT3D { float x; f...
#ifndef PONY_H # define PONY_H # include <iostream> # include <string.h> class Pony { public: Pony(std::string nam, int wei, std::string col); ~Pony(void); void sayHello(); private: std::string name; int weight; std::string colour; };...
/* * MorphingText.h * CFText * * Created by Artem Titoulenko on 1/6/10. * Copyright 2010 Artem Titoulenko. All rights reserved. * */ class ofxMorphingText { private: vector<string> stages; float stageCylceTime; float timeBegan; bool timeSet; int stageSize; bool once; public: void init() { s...
// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. #pragma once #include <string> #include <frc/TimedRobot.h> #include <frc/smartdashboard/SendableChooser.h> #include <f...
#pragma once #pragma execution_character_set("utf-8") #include<set> #include<string> #include<iostream> using namespace std; //int main() //{ // set<char>char_set; // for (int i = 0; i < 10; i++) // char_set.insert(char_set.end(), char(i + 65)); // copy(char_set.begin(),char_set.end(),ostream_iterator<char>(cout,"")...
#ifndef __REGLER__ #define __REGLER__ #include COMMON(logging.h) #include "stateestimator.h" #include COMMON(structs.h) #include COMMON(robotdata.h) #include "globaldata.h" using namespace Common; class Regler { public: static constexpr F MOTORS_R = RobotData::MOTORS_R; // Abstand Rad zu Achsmitte ( = halber ...
/** \file * \brief Implementation of hexdump() * * This file contains an implementation of hexdump() which can be used * to write a hex dump of arbitrary memory locations to ostreams and * log4cpp targets. * * \author Peter Hille (png!das-system) <peter@das-system-networks.de> * * \version 1.1 Moved all hexdum...
#include <stdafx.h> #include "sensor/RangeScanner.h" //#include "LineFeatureSet.h" //#include "blackboxhelper.hpp" //#include "Project.h" //#define SAFE_KUICK_SUING 1 bool bLaserEvent = false; #ifdef USE_BLACK_BOX extern CBlackBox LocBox; #endif //////////////////////////////////////////////////////////////////////...
#include<stdio.h> #include<stdlib.h> typedef char TElemType; typedef struct BiTNode { TElemType data; struct BiTNode *Lchild, *Rchild; } BiTNode, *BiTree; bool CreateBiTree(BiTree &T) { char ch; scanf("%c",&ch); if(ch == '#') T = NULL; else { if(!(T = (BiTNode *)malloc(sizeof(BiTNode)))) return false...
// Copyright [2015] <lgb (LiuGuangBao)> //===================================================================================== // // Filename: main.cpp // // Description: 测试主程序 // // Version: 1.0 // Created: 2015年07月29日 17时34分46秒 // Revision: none // Compiler: gcc // // Auth...
#pragma once // // artCategory.h // PianoPlayer // // Created by Ben Smith on 10/10/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #include <Math.h> #include <string.h> #include <vector.h> struct ResonanceGroup { // a rough way to set relative modifiers for different sub-groups of features in...
#ifndef ASSIGN_I_H #define ASSIGN_I_H #include "varregister.h" #include "instruction.h" #include "../syntaxtree/identifier.h" #include <string> using namespace std; /** * An abstract instruction, representing any instruction in which a result is * assigned to a variable */ class AssignmentI: public Instruction {...
/* Copyright (c) 2014, Martin Björkström All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions an...
#include "stdafx.h" #include "SpriteComponent.h" #include <utility> #include "GameObject.h" #include "TextureData.h" #include "ContentManager.h" #include "SpriteRenderer.h" #include "TransformComponent.h" SpriteComponent::SpriteComponent(std::wstring spriteAsset, DirectX::XMFLOAT2 pivot, DirectX::XMFLOAT4 color): ...
#ifndef _SERVICIODOMINIO_H #define _SERVICIODOMINIO_H #include "servicio.h" #include "dominio.h" class cServicioDominio:public cServicio { public: //Constructor e iniciador cServicioDominio(cDominio *dominio); bool iniciar(); //Trae la cantidad del servicio std::string traerCantidad(); //Verifica la exi...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.ApplicationModel.Payments.Provider.2.h" WINRT_EXPORT namespace winrt { namespace Windows::ApplicationModel::Payments::Provider { struct WINRT_EBO PaymentAppManager : Wi...
// // TagDefineNamedParts.h // GAFPlayer // // Created by timur.losev on 3/6/14. // Copyright (c) 2014 CatalystApps. All rights reserved. // #ifndef __GAFPlayer__TagDefineNamedParts__ #define __GAFPlayer__TagDefineNamedParts__ #include "DefinitionTagBase.h" class TagDefineNamedParts : public DefinitionTagBase { ...
class Solution { public: string reverseWords(string s) { int pos = 0; while(pos < s.length()) { while(pos < s.length() && s[pos] == ' ') { pos++; } int left = pos; int right = pos; while(right < s.length() && s...
#ifndef FACTORY_H #define FACTORY_H #include <string> #include "component.h" class Factory { public: Factory(); virtual Component *create(std::string name) = 0; protected: Component* component; }; #endif // FACTORY_H
#include "broccoli_wrapper.h" #include "broccoli_event.h" #include "broccoli_packet.h" #include "broccoli_message_listener_interface.h" #include "proto/out.pb.h" #include "core/src/core.h" #include <QApplication> #include <QDebug> #include <QDir> #include <QLibrary> namespace { #ifdef Q_OS_WIN const QString libF...
#include<bits/stdc++.h> using namespace std; void mazeHelper(int n,int maze[][20],int **arr,int x,int y) { //cout << "yes-1" << endl; if(x==n-1 && y==n-1) { arr[x][y]=1; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { cout << arr[i][j] << " "; } cout << endl; } cout << endl; return ; ...
/* * Copyright: * Daniel D. Neilson (ddneilson@ieee.org) * University of Saskatchewan * All rights reserved * * Permission granted to use for use in assignments and * projects for CMPT 485 & CMPT 829 at the University * of Saskatchewan. */ #include <cstring> #include <cstdlib> #include "texture.h" #include ...
#if (shifter_active == 1 && stratos == 0) void ledrestore (boolean numero) { // riscrive sullo shifter la pagina 1 con luci accese o spente for(int led = 0; led < max_modifiers; led++) { shifter.setPin(led, bit_read(1,led+(numero*max_modifiers)) ); // if (lastbutton[touch_mempos[0]] == 1) shifter.se...
#include "dataStructures.h" #include "trig.h" #include "HW6_2_Utilities.h" #include<fstream> #include<SDL/SDL.h> #include<math.h> SDL_Surface *screen; SDL_Event event; void calculate_image(void) { color c; Ray ray; Uint32 *pixmem32; Uint32 sdl_color; Uint8 *p; for(int i=ImageH-1; i>=0; --i) { ...
//lcs with 3 strings by dp #include <bits/stdc++.h> using namespace std; const int N = 205; int dp[N][N][N]; int lcs(string &s1, string &s2, string &s3, int i, int j, int k) { if (i == 0 || j == 0 || k == 0) { return 0; } if (dp[i][j][k] != -1) { return dp[i][j][k]; } i...
#include <sys/wait.h> #include <unistd.h> #include <condition_variable> #include "gtest/gtest.h" #include "plib.hh" #include "script.hh" #define SETUP_PERIODIC_WATCHER() \ auto proc = plib::get_process(pid_); \ plib::PeriodicWatcher watcher(proc) class Watcher : public ::testing::Test { protected: Watc...
#include "TermDB.hpp" #include <boost/filesystem.hpp> #include <algorithm> #include <fstream> #include <iostream> TermDB::TermDB(const std::string& outDir) : _outDir(outDir) {} void TermDB::addToPostings(const std::string& token, DocID docID) { Postings::iterator it = _postings.find(token); if (it == _p...
#ifndef SERVER_H #define SERVER_H #include <unistd.h> #include <signal.h> #include <errno.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <netdb.h> #include <cstdlib> #include <netinet/in.h> #include <arpa/inet.h> #include <netinet/tcp.h> #include <vector> #include <pthread.h> #include <...
#pragma once #include <SFML\Graphics.hpp> namespace Config { const int SCREEN_WIDTH = 800; const int SCREEN_HEIGHT = 600; const int controlPanelWidth = 200; const int gridDisplaySize = 600; const int buttonSize = 100; const sf::FloatRect controlPanelRect(SCREEN_WIDTH - controlPanelWidth, 0, controlPanelWidth...
/* * Copyright (c) 2009 Andrew Wilkins <axwalk@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, ...
#include <iostream> #include <stdio.h> using namespace std; int n, m; int gx[1501][1501], gy[1501][1501]; int f[1501][1501]; int a[1501][1501]; int findmin(int x, int y, int f) { int k=min (x,y); return min(k, f); } int main () { cin>>n>>m; for (int i=1; i<=n; i++) for ...
#include <stdio.h> #include <stdlib.h> #include <conio.h> #include <locale.h> #include <math.h> int main(){ setlocale(LC_ALL, "Portuguese"); int i = 0; float a = 0; int b, porcent; float resultado; int ano; float n1,n2,n3,media; char nome[61]; int matricula; int num; int f,n; do{...
/* * Copyright 2017 WebAssembly Community Group participants * Copyright 2017 Roman Katuntsev <sbkarr@stappler.org> * * 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....
/** * Split location file into several files separated by intervals when * no data was collected. * * Jason Leake October 2019 */ #include "util.h" #include <filesystem> #include <fstream> #include <iostream> #include <libfccp/csv.h> #include <list> #include "Row.h" using namespace std; static constexpr auto pr...
// Copyright [2014] <lgb (LiuGuangBao)> //===================================================================================== // // Filename: hash.cpp // // Description: hash函数库 // // Version: 1.0 // Created: 2014年01月10日 11时06分51秒 // Revision: none // Compiler: gcc // // Au...
#include "log.h" #include <mutex> #include <string> #include <vector> #include <stdio.h> #include <stdarg.h> #include <string.h> #include <sys/time.h> static const uint32_t kPageSize = 256; struct Line { std::string text; uint32_t logSize; }; static std::mutex GMutex; static std::vector<Lin...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "AtomicList.h" #define FILL_TEXT "Fill" #define REFILL_TEXT "Refill" #define MAX_CHARS 1000 using namespace std; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWi...
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. P...
#include "OutputTermDeletionView.h" #include "../viewUtils/ViewUtils.h" #include "../../presentations/outputTerm/OutputTermPresentation.h" #include "OutputTermView.h" OutputTermDeletionView::OutputTermDeletionView() { cancelCommandEnabled = true; name = "output term deletion"; terms = OutputTermPresentatio...
/* ID: sarthak16 PROG: dualpal LANG: C++ */ #include <iostream> #include <fstream> #include <string> #include <algorithm> using namespace std; bool isDualPal(int); string con(int, int); bool isPal(string); int main() { freopen("dualpal.in", "r", stdin); freopen("dualpal.out", "w", stdout); int n, s; scanf("%d ...
// // Copyright (c) 2009 Rutger ter Borg // // 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 BOOST_NUMERIC_BINDINGS_LAPACK_KEYWORDS_HPP #define BOOST_NUMERIC_BINDINGS_LAPACK_KEYWORDS_HPP #include <boo...
/* 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...
// // Created by Twometer on 20/12/2019. // #ifndef GAMEOFLIFE_OPENGL_VBLURSHADER_H #define GAMEOFLIFE_OPENGL_VBLURSHADER_H #include "IShader.h" class VBlurShader : public IShader { private: GLuint loc_targetHeight; public: VBlurShader() { initialize("vblur", "blur"); } void bind_uniforms(...
#include<bits/stdc++.h> using namespace std; int main() { int x1,y1,x2,y2,a; cin>>x1>>y1>>x2>>y2; if(y1==y2) { a=abs(x2-x1); cout<<x1<<" "<<y1+a<<" "<<x2<<" "<<y1+a<<"\n"; } else if(x1==x2) { a=abs(y2-y1); cout<<x1+a<<" "<<y1<<" "<<x1+a<<" "<<y2<<"\n"; ...
/*********************************************************************** created: 1/3/2005 author: Paul D Turner *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2015 Paul D Tu...
class Solution { public: int numWays(int n) { if(n<=1) return 1; int dp[n+1]; dp[0] = 1; dp[1] = 1; for(int i=2;i<=n;++i){ dp[i] = (dp[i-1]+dp[i-2])%1000000007; } return dp[n]; } }; // 这种问题不应该用递归,递归速度太慢。要用动态规划,其实DP和递归思想差不多,但还是需要改...
#ifndef _TNA_SHADER_H_ #define _TNA_SHADER_H_ value #include <string> namespace tna { using shader_t = void*; shader_t* shader_create(const char* path); void shader_destroy(shader_t* shader); } /* tna */ #endif /* ifndef _TNA_SHADER_H_ */
// Copyright 2020 JD.com, Inc. Galileo Authors. All Rights Reserved. // // 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 requ...
/*************************************************************************** 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...
#include"Header.h" void OInitial(O*OperatorH,O*OperatorV,double&J,double &Energy) { complex<double> img(0,1); cx_mat Identity; Identity.eye(Xi[0],Xi[0]); vec eigval; cx_mat h; cx_mat PZ(2,2); PZ.zeros(); PZ(0,0)=1; PZ(1,1)=-1; cx_mat PI(2,2); PI.eye(2,2); cx_mat I(3,3); I.eye(3,3); cx_mat PX(2,2); PX.zeros(); ...
// // Created by Peter Chen on 5/29/16. // #ifndef CUBEWORLD_WORLDSTATUS_H #define CUBEWORLD_WORLDSTATUS_H #include <iostream> using namespace std; namespace CubeWorld { class WorldStatus { public: WorldStatus(); ~WorldStatus(); void Reset() { executedRules = 0; ...
using namespace std; extern int array[9][9]; void changeCol(int a , int b) { int transport[3][9]; int i , j; for(i=(a*3);i<(a*3)+3;i++) { for(j=0;j<9;j++) { transport[i-(a*3)][j]=array[i][j]; array[i][j]=array[i+(b-a)*3][j]; array[i+(b-a)*3][j]=transport[i-(a*3)][j]; } } for(i=0;i<9;i++) { for...
class Solution { public: vector<Interval> employeeFreeTime(vector<vector<Interval>> schedule) { if (schedule.empty()) return {}; vector<Interval> all, res; for (auto s : schedule) { all.insert(all.end(), s.begin(), s.end()); } sort(all.begin(), all.end(), [](Interval &a...
/* * File: main.cpp * Author: Rogelio Hinojosa * Created on March 7, 2016, 12:05 PM * Purpose: Calculate # of Candy Bars */ //System Libraries Here #include <iostream> using namespace std; //User Libraries Here //Global Constants Only, No Global Variables //Like PI, e, Gravity, or conversions //Function Pr...
#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...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Media.Protection.PlayReady.0.h" #include "Windows.Foundation.0.h" #include "Windows.Foundation.Collections.0.h" #include "Windows.Media.Core.0.h" #include...
#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #ifndef NULL #define NULL 0 #endif #define FILE_SIZE 512 #define BLOCK_SIZE 256 #define PAGE_SIZE 256 #define FUNC_CNT 12800 #define FILE_ID 10000 extern int readPage(int bid, int pid); extern void writePage(int bid, int pid, int data); extern in...
/* * Copyright (c) 2014, Julien Bernard * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DIS...
// // TypeSelector.cpp // DDCSSParser // // Created by 1m0nster on 2018/8/7. // Copyright © 2018 1m0nster. All rights reserved. // #include "TypeSelector.hpp" namespace future { bool TypeSelector::isBaseSelector() { return true; } int TypeSelector::weight() { return 1; } std::string TypeSelec...
#include "CommandLogFilter.h" #include "Globals.h" #include "Debug/DebugMacros.h" #include "Log/LogReader.h" #include "Log/LogServer.h" #include "Commands/CommandDescriptor.h" #include "System/TrueCandidates.h" CommandLogFilter::CommandLogFilter(QSharedPointer<LogServer> logServer, QObject *parent, void (*pre...
#include <iostream> #include <stdio.h> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int E,S,M; cin >> E >> S >> M; int e=1, s=1, m=1; int sum=1; while(true) { if (E == e &&...
/* * ofxArgs.h * graffitiWall_TUIO * * Created by Pat Long on 10/02/09. * Copyright 2009 Tangible Interaction. All rights reserved. * */ #ifndef _OFXARGS #define _OFXARGS #include <iostream> #include <vector> #include <map> #include <string> using namespace std; class ofxArgs{ private: int argc; vector<s...
#ifndef __PROCESS2NDPASS_HPP #define __PROCESS2NDPASS_HPP TTree* Process2ndPass(TTree *events); #endif
// // Created by Sweet Acid on 29.04.2021. // #pragma once #include <glm.hpp> #include <Snow/Core/SpriteComponent.h> #include <Snow/Core/TransformComponent.h> #include "Texture.h" #include "Shader.h" namespace Snow { class SpriteRenderer { public: SpriteRenderer(); ~SpriteRenderer(); ...