text
stringlengths
8
6.88M
#include "entity.h" using namespace std; namespace sbg { Entity::Entity(Entity&& o) = default; Entity& Entity::operator=(Entity&& o) = default; }
// // tutorialTriangle.cpp // OpenGLProjects // // Created by Dayuan Chen on 9/8/19. // Copyright © 2019 N33MO. All rights reserved. // // add "shader" file to Build Phases - Copy Files #include <iostream> // GLEW #define GLEW_STATIC #include <GL/glew.h> // GLFW #include <GLFW/glfw3.h> #include "shaderexample....
//Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #include <errno.h> #include <iface/link.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include "sys/Appfs.hpp" #include "sys/Dir.hpp" #include "sys/File.hpp" using namespace sys; int Appfs::create(const char * name, const void * buf, int nbyte,...
#include "DFCman.h" void AddComponentToMap(dfComponent* dfc) { std::type_index infer = typeid(*dfc); dfComponent* comp = dfComponentMap[typeid(*dfc)]; if(comp) { dfComponent* prev = 0; while(comp != 0) { prev = comp; comp = comp->nextInList; } prev->nextInList = dfc; dfc->nextInList = 0; } els...
/* 该函数对2^64以内的数都能有效辨别。 */ const int cstPrime[10]={2,3,5,7,11,13,17,19,23,29}; bool Miller_Rabin(ll a,ll n) { ll r=0,s=n-1; while(!(s&1)) r++,s>>=1; //n-1==2^r*s ll as=pow_mod(a,s,n); //as=a^s%n if(as==1 || as==n-1) return true; //if as==1 or as^i%n==n-1 then it is likely be prime for(int i=1;i<r;i++) { ...
#include "stdafx.h" //________________________________________ CalculadoraIMC.cpp #include "CalculadoraIMC.h" int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int cmdShow) { CalculadoraIMC app; return app.BeginDialog(IDI_CalculadoraIMC, hInstance); } void CalculadoraIMC::Window_Open(Win::Event...
#include <iostream> #include <vector> #include <map> #include <cmath> #include <queue> #include <algorithm> #include <iomanip> #include <set> using namespace std; /* → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → */ #define int long long #define ld lon...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
//O(n1 + n2). Here n1 and n2 are length of the linked lists l1 and l2 respectively. class Solution { public: ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { if(l1 == NULL && l2 == NULL){ return NULL; } if(l1 == NULL){ return l2; } if(l2 == NULL){...
#pragma once #include <System.h> #include <utility> namespace breakout { class CanvasWidget; class GuiSystem : public BaseSystem { using CurrGameState = int; public: static EBaseSystemType GetType() { return EBaseSystemType::GUI; } GuiSystem(); ...
#include "gtest/gtest.h" #include "wali/wfa/WFA.hpp" #include "wali/wfa/State.hpp" #include "fixtures.hpp" #include "../../../fixtures/StringWeight.hpp" using namespace testing; namespace wali { namespace wfa { TEST(wali$wfa$$pathSummary, canCallPathSummaryWithNoFinalStates) { Letter...
#include <node.h> #include <v8.h> using namespace v8; void hello(const FunctionCallbackInfo<Value>& args) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); if (args.Length() < 2 || !args[0]->IsString()) { isolate->ThrowException(Exception::TypeError( String::NewFromUtf8(isolate, "Wron...
/* $Id$ -*- mode: c++ -*- */ /** \file parser.yy Contains the example Bison parser source */ %{ /*** C/C++ Declarations ***/ #include <fstream> #include <stdio.h> #include <string> #include <vector> #include "expression.h" #include <magma/ast/translation_unit.h> #include <magma/parse/parser.h> using translation_un...
// Created on: 1997-02-12 // Created by: Alexander BRIVIN // Copyright (c) 1997-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the G...
#define NOMINMAX #include <functional> #include <array> #include "buffers.h" #include "ctalib.h" #include "pytorchcpp.h" #include "moneybars.h" template<class T> using vec_iterator = typename std::vector<T>::iterator; // an indicator the each sample calculated // depends itself + window-1 samples before it // or u ne...
#include <bits/stdc++.h> using namespace std; int main() { int t, n, k, dig, ans; cin >> t; for (int i = 0; i < t; i++) { cin >> n >> k; ans= 0; for (int j = 0; j < n; j++) { cin >> dig; if (i % 2){ if(abs(ans) >= 0) ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2006 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #include "core/pch.h" #include "InputManagerDialog.h" #include ...
// DrawButton.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "DrawButton.h" #define MAX_LOADSTRING 100 // Global Variables: HWND hWnd; HWND hNew; HWND hDlg; //TCHAR buff[10]; int x1 = 100, x2 = 200, y1 = 150, y2 = 300; HINSTANCE hInst; // current ...
#pragma once class CSync { private: CRITICAL_SECTION m_cs; public: CSync(); ~CSync(); void Lock(); void Unlock(); };
#pragma once #include <SFML/Network.hpp> #include <list> #include "../Shared/GameConfig.h" #include "RectangleCollider.h" class GameObject { public: GameObject(float x, float y, conf::Dir dir_, float animation_speed_, int frame_amount_, float speed_, conf::ObjectType type_); GameObject(); ...
// Created on: 1993-04-15 // Created by: Bruno DUMORTIER // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
// Lyric Player v1.0 // Date: 2015-5-12 #include <windows.h> // #define _WIN32_WINNT 0x0600 #define MAX_TAGS 128 #define MAX_LYRICS 8192 #define FAST_RUNNING_RATE 20 #define REDUNDANCY 50 CONST CONSOLE_CURSOR_INFO CURSOR_INVISIBLE = {25, FALSE}; CONST WORD FOREGROUND_N...
/* * ???????????? ?????????????? ???????? ?????????? ? ?? ??????????????? ??????? */ #pragma once class CProgram; class CMainClassDeclaration; class CClassDeclaration; class CClassDeclarationList; class CClassExtendsDeclaration; class CVariableDeclaration; class CVariableDeclarationList; class CMethodDeclaration; clas...
#include <iostream> #include <string> using namespace std; void test() { int R; string str; cin >> R >> str; int size = str.size(); for(int i=0; i<size; i++) for(int j=0; j<R; j++) cout << str[i]; cout << '\n'; } int main() { int T; cin >> T; while(T--) { test(); } return 0; }
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<ll> vll; typedef vector<vll> vvl; typedef vector<bool> vb; typedef vector<str...
// test_config.cpp #include <memory> #include <vector> #include "catch/catch.hpp" #include "BlobCrystallinOligomer/config.h" #include "BlobCrystallinOligomer/ifile.h" #include "BlobCrystallinOligomer/monomer.h" #include "BlobCrystallinOligomer/particle.h" #include "BlobCrystallinOligomer/random_gens.h" #include "Blo...
#include "Model.h" Model::Model(){ type = 0; } Model::Model(const Model &original){ type = original.type; } Model& Model::operator=(const Model& original){ if (this != &original){ type = original.type; } return *this; } Model *Model::clone(){ return new Model(*this); } Model::~Model(){ } void Model::run...
#ifndef __RPC_RESOURCE_HEADER__ #define __RPC_RESOURCE_HEADER__ #include <string> #include <map> #ifndef __RPC_RESOURCE_MANAGER_MODULE__ #error "DO NOT include this file. This head file can be included by rpc_resource_manager module only." #endif//__RPC_RESOURCE_MANAGER_MODULE__ using namespace std; /*--------...
#ifndef FLAC_STREAM_ENCODER_H_ #define FLAC_STREAM_ENCODER_H_ #include <alloca.h> #include <pthread.h> #include <unistd.h> #include <sys/stat.h> /* Iftah: for mkfifo */ #include <jni.h> #include <android/log.h> #include "FLAC/metadata.h" #include "FLAC/stream_encoder.h" #include "jni/jni_utils.h" #include "jni/FLA...
// // OutputRead.cpp // fast_convolution // // Created by Ying Zhan on 2/1/16. // Copyright (c) 2016 Ying Zhan. All rights reserved. // #include "OutputRead.h" circularBuffer<float>* OutputRead::getOutputBuffer() { return output_buffer; } void OutputRead::printOutputResult() { std::cout << "OUTPUT RESULT...
// // BUnitGetter.cpp for MyTexture in /home/paumar_a/projet/git/AW_like/Graph/Texture // // Made by cedric paumard // Login <paumar_a@epitech.net> // // Started on Sun Jul 27 12:32:59 2014 cedric paumard // Last update Tue Jul 29 17:26:40 2014 cedric paumard // #include "MyTexture.hh" const sf::Texture &MyTextu...
// Created on: 1993-08-06 // Created by: Martine LANGLOIS // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the G...
#include <iostream> #include <fstream> #include <cstdlib> using namespace std; #define LIMIT 10000000 #define REPEAT 10000 typedef int number; number a[LIMIT], b[LIMIT], c[LIMIT], * s = a, * p = b; char x; int n, offset; ifstream fin("input.txt"); void output() { for (size_t i = offset; i < offset + 8; i++) { ...
/* * Copyright 2016 Freeman Zhang <zhanggyb@gmail.com> * * 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 applic...
#include "motor.hpp" #include <Arduino.h> /** * @brief Construct a new Motor:: Motor object * * @param _pin1 direction pin, or HIGH->fwd pin * @param _pin2 pwm pin, or LOW->fwd pin * @param _isDirType Driver is direction/pwm type * @param _isInverted invert the polarity */ Motor::Motor(int _pin1, int _pin2, boo...
#ifndef __LOADER_H__ #define __LOADER_H__ #include <iostream> #include <fstream> #include <cstring> #include "BaseNode.h" using namespace std; #define LINE_SIZE 1024 #define TOKEN_LENGTH 8 enum TokenID { T_NONE=-1, T_VERT, T_FACE}; struct TokenPair { char strval[TOKEN_LENGTH]; TokenID tokID; bool operator==...
#pragma once #include <vector> #include <glm/glm.hpp> #include "PointCloud.hpp" #include <nanoflann.hpp> #include "../implicits/Implicit.hpp" #include "../implicits/GeneralQuadratic.hpp" #include "../implicits/BivariateQuadratic.hpp" #include "../implicits/UtilityFunctions.hpp" #include <limits> using namespace std; ...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #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 <deque> #include <map> #include <functional>...
#include<iostream> using namespace std; int partition(int a[], int first, int last); void quickSort(int a[], int first, int last); int main(){ int n; cout<<"Enter the no. of elements : "; cin>>n; int a[n]; // Initialization of array for n numbers. cout<<"Enter elements : \n"; for(...
#include "FloatCondition.h" FloatCondition::FloatCondition(const float min_value, const float max_value) { m_minValue = min_value; m_maxValue = max_value; } FloatCondition::~FloatCondition() = default; void FloatCondition::setTestValue(const float value) { m_testValue = value; } bool FloatCondition::Test() { re...
#include "NeuralNetwork.hpp" namespace nanoNet { NeuralNetwork::NeuralNetwork() : m_layers() { } void NeuralNetwork::addLayer(const NeuralNetworkLayer& layer) { if (layerCount() == 0 || outputCount() == layer.inputCount()) m_layers.push_back(layer); } NeuralNetworkLayer::vector_type ...
#include <iostream> #include <vector> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; void inorder(TreeNode *root,vector<int> &res) { if(root == nullptr) return; inorder(root->left, res);...
#include<iostream> //#include"adjoin_maxtrix.h" //普通邻接矩阵 #include"obj_adjoin_maxtrix.h" //面向对象邻接矩阵 #include"obj_adjoin_list.h" //面向对象邻接表 using namespace std; void Visit(char temp) { cout << setw(4) << temp << " "; } int main20171228() { char a[] = { 'A','B','C','D','E' }; //顶点 RowColWeight rcw[] = { { 0,1,10 },{ ...
#include <iostream> #define CATCH_CONFIG_MAIN #include "../../../../catch2/catch.hpp" #include "../Task5. ParseURL//UrlParser.h" SCENARIO("Пустая строка - невалидный url") { setlocale(LC_ALL, "ru"); cout << "Пустая строка - невалидный url" << endl; Protocol pr; int port; string host, document; REQUIRE(ParseURL...
// DisasterWatchDlg.cpp : 实现文件 // #include "stdafx.h" #include "DisasterWatch.h" #include "DisasterWatchDlg.h" #include "string-trans.h" #include "UsefulFunction.h" #include <atlbase.h> extern volatile bool close_alert; #ifdef _DEBUG #define new DEBUG_NEW #endif #define WM_SHOWTASK (WM_USER + 1000) ...
#include <iostream> using namespace std; int main() { int num1; cout <<"Enter the first number:"; cin >> num1; int num2; cout <<"Enter the second number:"; cin >> num2; if(num2 == 0){ throw 99; } cout <<"Result:"<<num1 / num2; return 0; }
// Copyright 2017 Elias Kosunen // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
#include <iostream> using namespace std; //! Template for function header, DO NOT TOUCH /****************************************************** ** Function: ** Description: ** Parameters: NA ** Pre-conditions: NA ** Post-conditions: NA ******************************************************/ /**********************...
/* * ObstacleTracker detects and tracks obstacles * Lidar and magnetometer is used * * THIS FUNCTION IS UNTESTED!! * * Creation date: 2019 08 08 * Author: Jan Kühnemund */ #ifndef OBSTACLETRACKER_H #define OBSTACLETRACKER_H class ObstacleTracker { public: short maxRange = 1200; short maxObstacleAmoun...
#include "line.h" Line::Line() { this->x = 0; this->y = 0; this->z = 0; } Line::Line(Point& p1, Point& p2) { this->p1 = p1; this->p2 = p2; this->v1.setX(p2.getX() - p1.getX()); this->v1.setY(p2.getY() - p1.getY()); this->v1.setX(p2.getZ() - p1.getZ()); } Line::Line...
namespace boost { template<typename T> struct hash; template<> struct hash<bool>; template<> struct hash<char>; template<> struct hash<signed char>; template<> struct hash<unsigned char>; template<> struct hash<wchar_t>; template<> struct hash<short>; template<> struct hash<unsigned short>; template<...
// BEGIN CUT HERE // PROBLEM STATEMENT // // A string p is called anti-palindrome if p[i] doesn't equal // to p[n - i - 1] for each 0 <= i < (n-1)/2, where n is the // length of p. It means that each character (except the // middle in the case of a string of odd length) must be // different from its symmetric char...
#include <iostream> using std::cout; using std::endl; using std::cin; #include <string> using std::string; #include <vector> using std::vector; double c_ctof(const char* str) { char* ptr; double fahr; double cel; cel = strtod(str, &ptr); fahr = ((1.8) * cel) + 32; cout << "Turned:" << cel << " Celius to: " <...
/* * @lc app=leetcode.cn id=855 lang=cpp * * [855] 考场就座 */ // @lc code=start #include<map> #include<set> #include<vector> using namespace std; class ExamRoom { public: class cmp{ public: bool operator () (const vector<int> &l, const vector<int> &r){ int distA = distanc...
/** * Buffer.h * * Interface that can be implemented by client applications and that * is parsed to the Connection::parse() method. * * Normally, the Connection::parse() method is fed with a byte * array. However, if you're receiving big frames, it may be inconvenient * to copy these big frames into conti...
#include <iostream> #include "Matrix.h" #include <Windows.h> void SetRuEnc() { SetConsoleCP(1251); SetConsoleOutputCP(1251); } int main() { SetRuEnc(); std::string line; while (getline(std::cin, line)) { std::ofstream out("input.txt"); out << line; out.close(); std::cout << MakeCalculation("input.txt"...
#include <iostream> using namespace std; int recursion(long long n) { // this doesn't work if (n == 1) return 1; long long x = n; while (!(x%2)) { x /= 2; } if (x == 1) return n; recursion(n-1); } int main() { // only gravity will pull me down...
#include <iostream> #include <vector> using namespace std; int k, n; vector<long long> lines; long long minLength, maxLength; long long countCompare(long long num){ long long count = 0; for(long long cur : lines){ count += cur / num; } return count; } long long find(){ while(minLength ...
// // Created by 钟奇龙 on 2019-05-01. // #include <iostream> #include <map> using namespace std; class Node{ public: int data; Node *left; Node *right; Node(int x):data(x),left(NULL),right(NULL){} }; int preorderFind(Node *root,int target,int preSum,int level,int maxLen,map<int,int> &sumMap){ if(!root...
#include "Alime_WindowBase.h" #include "Alime_TitleBar.h" #include "Alime_ContentWidget.h" #include "QFrameLessWidget_Alime.h" #include "Alime_TransparentWidget.h" #include <qpushbutton.h> #include "qlayout.h" #include "qicon.h" #ifdef Q_OS_WIN #pragma comment(lib, "user32.lib") #include <qt_windows.h> #endif Alime...
#include "stdafx.h" using std::vector; /* * Follow up for "remove duplicate from sorted array":what if duplicates are allowed at most twice * for example, given sorted array A = [1, 1, 1 ,2, 2, 3], your funtion should return length = 5, and A is * now [1, 1, 2, 2, 3] . * 紧接着 “移除已排序顺序表中重复元素”: 如果元素最多允许重复两次呢? ...
#pragma once #include <memory> #include <vector> #include "Vec.h" namespace quadtree { class Node; class Node { private: Vec pos; Vec sz; std::unique_ptr<Node> SE; std::unique_ptr<Node> SW; std::unique_ptr<Node> NW; std::unique_ptr<Node> NE; bool isLeaf() const { return !(NE || SW ...
 // TraceRouteDlg.h: 头文件 // #pragma once #include "NIC.h" #include "Device.h" #include "EthernetFrame.h" #include "ICMP.h" #define WM_RECV (WM_USER + 100) #define WM_HOST (WM_USER + 101) #define ICMP_REQUEST_ID 0x1234 // CTraceRouteDlg 对话框 class CTraceRouteDlg : public CDialogEx { // 构造 public: CTraceRouteDlg(CW...
#include <cstdio> #include <algorithm> using namespace std; //In the order of favorite color, each color is unique, so hash color to order. //The color can be duplicate so hash[i] >= hash[j] //The length of dp[] is 10010 not 210 int main(){ int n, m, l, count = 0; int pattern[210], target[10010], hash[210], d...
#include <iostream> #include <iomanip> int main(int argc, char const *argv[]) { int T; std::cin >> T; std::cout << setiosflags(std::ios::uppercase); std::cout << setw(0xf) << internal; while(T--) { double A; std::cin >> A; double B; std::cin >> B; double C; std::cin >> C; std::cout << resetiosflags(st...
#include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include "../include/command_interface.h" command_interface::command_interface(void) { show_author(); show_command_list(); } void command_interface::update_interface(void) { /* Interface variables */ string input, command, parameter, file_dir; str...
#include <iostream> #include <cmath> struct Point { public: int x = 0; int y = 0; public: static double distance; public: static void setDistance(double distance) { Point::distance = distance; } void setX(int x) { Point::x = x; } void setY(int y) { Point::y = ...
#ifndef SHOEMESSAGELOGIN_H #define SHOEMESSAGELOGIN_H #include <QByteArray> #include "shoemanagermodel_global.h" class SHOEMANAGERMODELSHARED_EXPORT ShoeMessageLogin { public: // 留作以后的标识 QString getIMEI(); void parseData(QByteArray data); private: QString mIMEI; QString mVersion; ...
#include "Jeu.h" Jeu::Jeu() { } void Jeu::rejouer() { if(m_state==STATE_FIN) { m_joueur1=Joueur(1); m_joueur2=Joueur(2); m_joueur1.m_typeAffichage=TYPE_SANS; m_joueur2.m_typeAffichage=TYPE_SANS; m_state=STATE_REPOS; m_timeStartNewState=system_clock::now(); ...
/* Author: Puttichai Lertkultanon */ #include "SuperBotConfig.h" #include "SuperBotStateSpace.h" #include "SuperBotProjection.h" #include <cmath> #include <vector> #include <sstream> namespace ob = ompl::base; SuperBotStateSpace::SuperBotStateSpace(RobotBasePtr probot) { _probot = probot; _ndof = _probot->Ge...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 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 ZLIB_STREAM_H #define ZLIB_STREAM_H ...
/* Copyright (c) 2017 Xavier Leclercq 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, copy, modify, merge, ...
#include <gtest/gtest.h> #include "utl/base.h" using namespace utl; TEST(Base, Countof) { const uint8_t arr_1[10] = {}; const uint16_t arr_2[20] = {}; const uint32_t arr_3[30] = {}; EXPECT_EQ(countof(arr_1), 10); EXPECT_EQ(countof(arr_2), 20); EXPECT_EQ(countof(arr_3), 30); }
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #ifndef __GT_DOC_PAGE_P_H__ #define __GT_DOC_PAGE_P_H__ #include "gtdocpage.h" GT_BEGIN_NAMESPACE class GtDocPagePrivate { Q_DECLARE_PUBLIC(GtDocPage) public: GtDocPagePrivate(); virtual ~GtDocPagePrivate(); public: inline void initialize(...
#ifndef TRAPEZOID_H #define TRAPEZOID_H #include "figure.h" // Наследуемся от Figure class Trapezoid : public Figure { Q_OBJECT public: Trapezoid(QObject *parent = 0); ~Trapezoid(); private: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); // Реализуем отрис...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2007 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef PLUGIN_WRAPPER_MESSAGE_LOOP...
#include "mainwindow.h" /**** PUBLIC FUNCTIONS ***/ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //ui->JackpotLabel->setStyleSheet("Background-image: url(:/Images/jackpot.jpg);"); ui->stackedWidget->setCurrentWidget(ui->w_main); this...
#include <stdio.h> #include "shader.h" GLuint compileShaderFromFile(std::string file, GLenum type) { FILE *fp = fopen(file.c_str(), "rb"); fseek(fp, 0, SEEK_END); long length = ftell(fp); fseek(fp, 0, SEEK_SET); char *buffer = new char[length]; size_t err; err = fread(buffer, sizeof(char...
#ifndef MODULES_WIDGETS_OPWIDGETSTRINGDRAWER #define MODULES_WIDGETS_OPWIDGETSTRINGDRAWER #include "modules/widgets/OpWidget.h" #include "modules/display/vis_dev.h" // VD_TEXT_HIGHLIGHT_TYPE class OpWidgetStringDrawer { public: OpWidgetStringDrawer(); void Draw(OpWidgetString* widget_string, const OpRect& rect, Vi...
#ifndef GENERATOR_H #define GENERATOR_H #include <QtWidgets> #include <algorithm> class Generator : public QObject { Q_OBJECT private: int** numbers; int difficulty; int counter; QVector<int> variants; QVector<int> buffer; QVector<int> wrongVariants; public: explicit...
#include "Obj.hh" #include "Obj2.hh" int main(int argv, char** args) { Obj obj; Obj2 obj2; return 0; }
#ifndef PROJETCCLASSVECTOR_H #define PROJETCCLASSVECTOR_H #include<iostream> #include<math.h> #include<assert.h> using namespace std; class Vecteur{ private: /**Representation des 4 coordonne du vecteur*/ double x; double y; double z; double t; // What ? C'est Quoi ça???!! float Vect[3]; int i; do...
/* BEGIN LICENSE */ /***************************************************************************** * SKFind : the SK search engine * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: mux.h,v 1.2.2.4 2005/02/21 14:22:44 krys Exp $ * * Authors: Arnaud de Bossoreille de Ribou <debossoreille @at@ idm .d...
#pragma once #include <vector> #include <iostream> #include <stdio.h> #include <fstream> #include <string> #include <cmath> #include <Eigen/Dense> #include <map> #include <limits> struct Vertex { float x; float y; float z; }; struct Face { int v1; int v1n; int v2; int v2n; int v3; ...
#pragma once #include <unordered_map> #include <typeindex> #include "../../components/interfaces/Component.h" #include "../../core/modules/interfaces/Module.h" namespace Game { class Component; class Entity : public Module { public: Entity(); ~Entity(); void update() override; void draw() override; ...
#ifndef _BOARDCLASS_ #define _BOARDCLASS_ #include <iostream> #include <array> #include <cmath> #include "BoardEnums.hpp" // * Object that represents a tictactoe board. Now with templates! template<unsigned long long Size = 3> class Board { private: std::array<std::array<BoardEnums::SpaceState, Size>, Size> Curr...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; typedef long long L...
/************************************************************************************** * File Name : Units.hpp * Project Name : Keyboard Warriors * Primary Author : Wonju Cho * Secondary Author : Doyeong Yi * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights ...
#pragma once #include "nsphere.h" #include "polytope.h" #include "abstractshapeinfo.h" namespace sbg { template<int n, typename T> struct ShapeInfo; template<int n> struct ShapeInfo<n, shape::NSphere<n>> : AbstractShapeInfo<n> { ShapeInfo(const shape::NSphere<n>& sphere); ShapeInfo(shape::NSphere<n>&& sphere); ...
class Solution { public: bool safe(int i,int j,int n,int m){ if(i<0||j<0||i>=n||j>=m){ return false; } return true; } int dfs(int i,int j,int n,int m,vector<vector<int>>& dp,vector<vector<int>>& v){ if(!safe(i,j,n,m)) return 0; if(dp[i][j]!=-1) return dp[i...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #ifdef PROTOBUF_SUPPORT #include "modules/prot...
#include "GnSystemPCH.h" #include "GnDebugAllocator.h" #ifdef GN_MEMORY_DEBUGGER GnDebugAllocator::GnDebugAllocator(GnAllocator* actualAllocator, bool writeToLog, gtuint initialSize, gtuint growBy, bool alwaysValidateAll,bool checkArrayOverruns) : mActualAlloctor(actualAllocator) { } GnDebugAllocator::~Gn...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #include "core/pch.h" #include "adjunct/quick_toolkit/widgets/Op...
/* 2016年4月26日19:45:25 #1050 : 树中的最长路 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 上回说到,小Ho得到了一棵二叉树玩具,这个玩具是由小球和木棍连接起来的,而在拆拼它的过程中,小Ho发现他不仅仅可以拼凑成一棵二叉树!还可以拼凑成一棵多叉树——好吧,其实就是更为平常的树而已。 但是不管怎么说,小Ho喜爱的玩具又升级换代了,于是他更加爱不释手(其实说起来小球和木棍有什么好玩的是吧= =)。小Ho手中的这棵玩具树现在由N个小球和N-1根木棍拼凑而成,这N个小球都被小Ho标上了不同的数字,并且这些数字都是出于1..N的范围之内,每根木棍都连接着两个不...
// // Created by fab on 01/05/2020. // #include "../../headers/debug/TextureDebug.hpp" TextureDebug::TextureDebug(const char *path) : shader("shaders/quad/") { texture.loadFrom(path, ITexture::Diffuse); vboQuad = new Vbo(1, 6); vboQuad->setElementDescription(0, Vbo::Element(3)); vboQuad->createCPUSide...
#include <string> #include <sstream> #include <rapidxml/rapidxml.hpp> #include <rapidjson/document.h> #include <boost/format.hpp> #include <lest/lest.hpp> #include <owner/json.hpp> #include <worker/command.hpp> #include <worker/graph.hpp> #include <worker/request.hpp> #include <worker/response.hpp> Graph theGraph; ...
#pragma once #include "Commonheader.h" #include "PhysicsInclude.h" #include "Physics.h" //動くオブジェクトの挙動を定義するクラス class DynamicObj { protected: vector3 position; Physics* physics; //物理データ関連のIndex int rigidBodyIndex; public: DynamicObj(); ~DynamicObj(); vector3 GetPos(); RigidbodyState States(int index){ return ...
#ifndef HUFMAN #define HUFMAN #include <string> #include <sstream> #include <tuple> #include <map> #include <unordered_map> #include <queue> #include "bool_array.h" #include <fstream> using namespace std; class Huffman { struct CharFreqSet { std::string char_set; int freq; bool operator<(const CharFreqSet& ...
#include "core.h" template<typename Type> Type** sort(int size, int sizec, Type** array, bool& error) { error = true; Type** _array = new Type* [size]; for (int i = 0; i < size; i++) _array[i] = new Type[sizec]; for (int i = 0; i < size; i++) for (int j = 0; j < sizec; j++) _array[i][j] = array[i][j]; for ...
#include "LinkQueue.h" template<typename T> LinkQueue<T>::LinkQueue() { front_ = new Node<T>; rear_ = front_; } template<typename T> LinkQueue<T>::~LinkQueue() { Node<T>* p; while (front_ != rear_) { p = front_; front_ = p->next; delete p; } delete rear_; } template<typename T> void L...