text
stringlengths
8
6.88M
#include "githabic.h" #include <iostream> using namespace std; int task3(){ int x,y; cout << "Used task 21 (IF) from Abramyan book" << endl; cout << "Enter your coordinates (x,y):" << endl; cin >> x >> y; if ((x == 0) && (y == 0)){ cout << 0; } else { if (x !=...
#include <boost/test/unit_test.hpp> #include <iostream> #include <cassert> #include <list> #include <boost/type_traits.hpp> #include <boost/lambda/lambda.hpp> #include "../util/Math.h" BOOST_AUTO_TEST_SUITE (UtilTest); BOOST_AUTO_TEST_CASE (testBasic) { BOOST_CHECK (Util::Math::nextSqr (1) == 1); BO...
#include "precompiled.h" #include "script/script.h" #include "input/jsinput.h" #include "input/input.h" #include "input/bind.h" #include "script/jsfunction.h" namespace jsinput { typedef jsscript::jsfunction<void(int, int)> JSBindFunctionCall; void init(void); void release(void); JSBool jsbind(JSContext *cx, uintN...
#ifndef _validity_h_ #define _validity_h_ #include "clustering.h" #include "AbstractMetric.h" struct ThreadDistanceData { public: ThreadDistanceData(Cluster *, Cluster *, AbstractMetric *); static void* threaded_distance(void*); float distance(); Cluster* pCluster1; Cluster...
// StatusDialog.cpp : 实现文件 // #include "stdafx.h" #include "OgreEditor.h" #include "Editor.h" #include "StatusDialog.h" // CStatusDialog 对话框 IMPLEMENT_DYNAMIC(CStatusDialog, CDialog) CStatusDialog::CStatusDialog(CWnd* pParent /*=NULL*/) : CDialog(CStatusDialog::IDD, pParent), mX(0.0f), mY(0.0f), mZ(...
#include "stdafx.h" #include "cutBoneGroupDlg.h" #include "afxdialogex.h" #include "groupCutManager.h" #include "MainControl.h" IMPLEMENT_DYNAMIC(cutBoneGroupDlg, CDialogEx) cutBoneGroupDlg::cutBoneGroupDlg(CWnd* pParent /*=NULL*/) : CDialogEx(cutBoneGroupDlg::IDD, pParent) { } cutBoneGroupDlg::~cutBoneGroupDlg() ...
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> #include <ss...
#pragma once #include "InetAddress.h" #include <cassert> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> static const in_addr_t kInAddrAny = INADDR_ANY; assert(sizeof(InetAddress) == sizeof(struct sockaddr_in)); InetAddress::InetAddress(uint16_t port) { bzero(&addr_, sizeof addr_); a...
#include <iostream> #include <vector> #include <queue> #include <stack> #include <cstring> int n, m, ID[100000], indegree[100001], group[100001], ID_indexing; std::vector<int> link[100000]; bool finished[100000]; std::vector<std::vector<int>> SCC; std::stack<int> stk; std::queue<int> q; int dfs(int idx) { ID[idx]...
#ifndef I2CMOTOR_H #define I2CMOTOR_H #include <Phantom.h> #include <MotorBase.h> #include "I2CRemoteIO.h" class I2CMotor: public Phantom::MotorBase { public: I2CRemoteIO io; I2CMotor(uint8_t address, uint8_t pinPWM, uint8_t pinDirA, uint8_t pinDirB); void set(float speed); void setMin(uint8_t min); void setM...
#include "player.hpp" #include <cstdlib> #include <algorithm> #include <iterator> #include <math.h> #include <limits> const int NUM_COLUMNS = 4; const int NUM_ROWS = 4; const int MAX_DEPTH = 3; namespace TICTACTOE { int sumCols(const GameState &state, uint8_t player){ int sum = 0; int counter = 0; uint...
#ifndef AMVK_CMD_PASS_H #define AMVK_CMD_PASS_H #include "vulkan.h" class CmdPass { public: CmdPass(const VkDevice& vkDevice, const VkCommandPool& vkCommandPool, const VkQueue& vkQueue); ~CmdPass(); VkCommandBuffer buffer; private: const VkDevice& mVkDevice; const VkCommandPool& mVkCommandPool; const VkQueue& ...
#ifndef MENUITEM_H #define MENUITEM_H #include <Windows.h> #include <string> #include "..\Caller.h" // base class from which all items in a menu are derived class MenuItem { public: MenuItem(std::string itemText, UINT id = 0); virtual ~MenuItem(); const std::string text; const U...
/* Write a program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile: loan payment, insurance, gas, oil, tires, and maintenance. The program should then display the total monthly cost of these expenses, and the total annual cost of these expenses. A...
#ifndef _AllinProc_H_ #define _AllinProc_H_ #include "BaseProcess.h" class Table; class Player; class AllinProc :public BaseProcess { public: AllinProc(); virtual ~AllinProc(); int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket, Context* pt); int doResponse(CDLSocketHandler* clientHandler...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * restriction, including wit...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) 2000-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Yngve Pettersen */ #include "core/pch.h" #if defined(_NATIVE...
#pragma once #include "DrawGraph.h" class DrawRectangle : public DrawGraph { public: DrawRectangle(); ~DrawRectangle(); virtual void initBuffer() override; virtual void drawGraph() override; private: float vertices[12] = { // 矩形的4个顶点 0.5f, 0.5f, 0.0f, // 右上角 0.5f, -0.5f, 0.0f, // 右下角 -0.5f, -0.5f, 0.0f, ...
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #pragma once #include "Serialization/Serialize.hpp" #include <cstdint> namespace Push { struct Color { Color(); ...
#include<iostream> #include<queue> #include<algorithm> #include<vector> #include<cstring> #include<stdio.h> using namespace std; int N; int arr[102][102]; int MAX = 0; struct is { int y; int x; }; is worm[2][5]; int dx[] = { -1, 0, 1, 0 }; // ¼­ ºÏ µ¿ ³² int dy[] = { 0,-1,0,1 }; void func(int cy, int cx, int dir,...
#ifndef __SettingsDialog__ #define __SettingsDialog__ #include "gui.h" class SettingsDialog: public SettingsDialog1 { private: wxFont settingsFont; void setFont(wxFont& font); protected: void FontChanged(wxFontPickerEvent& event); public: SettingsDialog(wxWindow* parent, wxFont& font); wxFont getF...
#include<iostream> #include<cstdio> #include<algorithm> #include<vector> #define MOD 1000000007 using namespace std; struct object { int s1,s2; }; vector<object> a; bool myfunction (object i,object j) { return (i.s1<j.s1); } bool myfunction1 (object i,object j) { if(i.s1==j.s1) return (i.s2<j.s2); } int main() {...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXTITL 40 #define MAXBKS 10 char * s_gets(char st, int n); //函数声明 char * s_gets(char st, int n) //函数定义 { char * ret_val; char * find; ret_val = fgets(st, n, stdin); //从标准输入流(键盘)获取数据 printf("ret_val = %s\n", ret_val); if(ret_val != NULL) { find...
#include<iostream> #include<algorithm> #include<vector> using namespace std; class Solution { public: int rob(vector<int>& nums) { //基本思想:动态规划,一维动态规划dp[i]表示如果小偷到当前房屋,在当前房屋下最大偷窃值 //所以dp[i]=dp[i]+max(dp[i-2],dp[i-3]),可以用nums当dp数组这样就不用申请额外空间 //或者dp[i]表示截止当前房屋小偷最大偷窃值,dp[i]=max(dp[i-1],dp[i-2]+nums[i]) if (nums.siz...
#pragma once class MonsterSelectBack :public GameObject { public: MonsterSelectBack(); void OnDestroy(); void Update(); private: SpriteRender* m_back = nullptr; //黒い後ろのやつ std::vector<SpriteRender*> m_hexs; //hex no kazari float m_addrot[2] = { 0.5,0.7 }; float m_rot[2] = { 0,0 }; };
#include <nan.h> void requestReview(const Nan::FunctionCallbackInfo<v8::Value> &info); static void InitModule(v8::Local<v8::Object> exports) { v8::Isolate *isolate = exports->GetIsolate(); v8::Local<v8::Context> context = isolate->GetCurrentContext(); exports->Set(context, Nan::New("requestReview").ToLocalChec...
#include "sample_module.h" #include <memory> #include <string> #include "shell.h" namespace microshell { namespace modules { namespace sample_module { using namespace microshell::core; using namespace std; void SampleModule::initialize(const Shell&) { } vector<shared_ptr<BuiltinFactory>> SampleModule::get_builtin...
#include "message.h" Message::Message() { } Message::Message(const Message &other) { m_body = other.m_body; m_headers = other.m_headers; } Message::~Message() { } Message::Message(const QString &body, const QStringList &headers) { m_body = body; m_headers = headers; qDebug() ...
#include "ResourceSystem.h" #include "Keng/ResourceSystem/IResource.h" #include "Keng/ResourceSystem/IResourceFabric.h" #include "Keng/ResourceSystem/IDevice.h" #include "Keng/Base/Serialization/OpenArchiveJSON.h" #include "Keng/Base/Serialization/SerializeMandatory.h" #include "Keng/FileSystem/ReadFileToBuffer.h" #inc...
/* * Copyright (c) 2016 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_DETAIL_FLOATING_POINT_WEIGHT_H_ #define CPPSORT_DETAIL_FLOATING_POINT_WEIGHT_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <cmath> nam...
//Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #include <stratify/stratify.h> #include <iface/link.h> #include "hal.hpp" #include "sys/Kernel.hpp" using namespace sys; Kernel::Kernel() { // TODO Auto-generated constructor stub m_current_task = 0; } int Kernel::launch(const char * path, char * exec_path,...
/* * Copyright (c) 2015-2020 Morwenn * SPDX-License-Identifier: MIT */ #include <forward_list> #include <iterator> #include <list> #include <type_traits> #include <vector> #include <catch2/catch.hpp> #include <cpp-sort/adapters/hybrid_adapter.h> #include <cpp-sort/sorter_facade.h> #include <cpp-sort/sorter_traits.h>...
#include <iostream> #include <string> #include <fstream> #include <cstdio> #include <cstdlib> void print(const std::string& str) { std::cout << str << "\n"; } void show() { std::cout << "input names & dates \n"; std::cout << "Meliq 11/02/2018 12:25, \nMiqael 12/05/2008 13:05, \nAnush 24/04/2007 15:00, \nAr...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Manuela Hutter (manuelah) */ #ifndef WEBSERVER_STATUS_...
#include "UCC.h" enum State { ST_WAITING_ITEM_REQUEST, ST_WAITING_ITEM_CONSTRAINT, ST_NEGOTIATION_FINISHED }; UCC::UCC(Node *node, uint16_t contributedItemId, uint16_t constraintItemId) : Agent(node), _contributedItemId(contributedItemId), _constraintItemId(constraintItemId), _negotiationAgreement(false) { ...
class Solution { public: string simplifyPath(string path) { vector<string> stack; string res, temp; stringstream p(path); while (getline(p, temp, '/')) { if (temp == "" or temp == ".") continue; if (!stack.empty() && temp == "..") stac...
// // TSP.hpp // ADT // // Created by Jalor on 2020/12/11. // Copyright © 2020 Jalor. All rights reserved. // #ifndef TSP_hpp #define TSP_hpp #include <iostream> using namespace std; const int TSP_MAX = 1; class TSP{ private: int vert[TSP_MAX];//顶点集合 int edge[TSP_MAX][TSP_MAX];//对应地图 int vertNum = 0,e...
#ifndef EVENT_HPP #define EVENT_HPP /* * @author: Grzegorz Mirek */ class Event { public: virtual void trigger() = 0; }; #endif
#pragma once #include <QDialog> #include "ui_ChangePwdDialog.h" #include "SQLiteOperator.h" class ChangePwdDialog : public QDialog { Q_OBJECT public: ChangePwdDialog(User* user, QWidget* parent = Q_NULLPTR); ~ChangePwdDialog(); signals: void changePwd(QString); private slots: void onCkbChe...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. ** */ #include "core/pch_system_includes.h" #ifdef VEGA_BACKEND_DIR...
#include <stdio.h> #include <string.h> int main() { char str[1007]; int length; int sum = 0; while (gets(str) != NULL) { length = strlen(str); sum = 0; for(int i = 0; i < length; i++) { if (str[i] == ')') sum--; else if(str[i] == '(') sum++; if(sum < 0) { break; } } if(su...
#include <fstream> #include <getopt.h> #include <iostream> #include "Messages/Messages.h" #include "ProgramLogic/ProgramLogic.h" int main(int argc, char** argv) { ProgramLogic* programme = new ProgramLogic(); int opt; opterr = 0; unsigned options = 0; while((opt=getopt(argc, argv, "a:bcd")) != -...
#include "leg_detector/leg_detector_lib.h" LegDetector::LegDetector(const std::string& model_path) : mask_count_(0), feat_count_(0), next_p_id_(0), no_observation_timeout_s_(0.5), max_second_leg_age_s_(2.0), max_track_jump_m_(3.0), max_meas_jump_m_(3.0), leg_pair_separation_m_(2.0), ...
#include "BurrowsWheelerTransform.h" #include "SuffixArray.h" #include <string> BurrowsWheelerTransform::BurrowsWheelerTransform() { } BurrowsWheelerTransform::~BurrowsWheelerTransform() { } char* BurrowsWheelerTransform::transform(char* str, int strlength) { //int strlength = strlen(str); SuffixArray* suffixArr =...
#include <iostream> #include <cstdio> #include <cassert> #include <cstring> using namespace std; int Hash[27][27][27][27][27]; int main(){ int n; int count = 0; char str[10]; int a,b,c,d,e; //cin >> n; scanf("%d",&n); for(int i = 0; i < n; i++){ //cin >> str; scanf("%s",str); a = 0,b = 0, c= 0, d= 0, e=0...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <stdio.h> #include <string.h> #include <time.h> #include <numeric> using namesp...
#include <iostream> using namespace std; int main() { int n, cur = 0; string s; cin >> n >> s; for (int i = 0; i + cur <= n; i += 1) { cout << s[i + cur]; cur++; } }
//--------------------------------------------------------------------------- //更新记录 #ifndef srvthreadH #define srvthreadH //--------------------------------------------------------------------------- #include <Classes.hpp> #include <ScktComp.hpp> class CServerSocket; enum ThreadState{tsWAIT,tsCLIENT_CONNECT,tsSERVERC...
/* * Given a binary tree and a sum, find all root-to-leaf paths * where each path's sum equals the given sum. * * For example: * Given the below binary tree and sum = 22, * 5 * / \ * 4 8 * / / \ * 11 13 4 * / \ / \ * 7 2 5 1 * ...
#pragma once #include "Vector.h" #include "windows.h" class Vertex { public: Vertex(); Vertex(float, float, float); Vertex(const Vertex&); // Accessors float GetX() const; void SetX(const float); float GetY() const; void SetY(const float); void SetZ(const float); float GetZ() const; float GetW() const; voi...
// Copyright Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ========================================================================...
#include <vector> #include <iostream> #include <algorithm> #include "BinaryTree.h" int main() { std::vector<int> v = {5, 4, 1, 3, 7, 6, 8}; BinaryTree<int> tree; tree.Create(v.begin(), v.end()); tree.MideOrder([](int x) {std::cout << x << std::endl; }); std::cout << std::endl; tree.PreOrder([](int x) {std::cout ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- ** ** Copyright (C) 1995-2003 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #include "modu...
#ifndef __VPROPCTRLPANEL_H #define __VPROPCTRLPANEL_H #include "TViewCtrlPanel.h" #include "DPropEditor.h" //------------------------------------------------------------------------------------------------- namespace wh{ namespace view{ typedef TViewCtrlPanel<CtrlTool::All, DPropEditor, true> VPropCtrlPanel; //---...
#include <iostream> #include<memory> using namespace std; class A { public: ~A() //소멸자에서는 throw를 하지 않는것이 좋음(필수권장사항!!!!) { throw "error"; } }; int main() { try { int* i = new int[1000000]; unique_ptr<int> up_i(i); throw "error"; //delete[] i; // unique_ptr덕분에 필요 없음, 영역을 벗어나면(try, throw) unique_poi...
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { vector<vector<int>> result; sort(nums.begin(), nums.end()); for (int i = 0; i < nums.size(); ++i) { if (i != 0 && nums[i] == nums[i-1]) ...
#include "Buffer.h" #include "google/protobuf/message.h" #include "protocol.pb.h" #include "Poco/Net/SocketReactor.h" #include "Poco/Net/SocketAcceptor.h" #include "Poco/Net/SocketNotification.h" #include "Poco/Net/StreamSocket.h" #include "Poco/Net/ServerSocket.h" #include "Poco/Net/NetException.h" #include "Poco/NOb...
#include <iostream> #include "log4cplus/logger.h" #include <unistd.h> #include "Dip.h" using namespace log4cplus; class pubErrorHandler: public DipPublicationErrorHandler { public: ~pubErrorHandler() { } inline void handleException(DipPublication* pub, DipException& ex) throw (DipException) { throw ex; } }; cl...
// -*- LSST-C++ -*- /* * LSST Data Management System * Copyright 2013 LSST Corporation. * * This product includes software developed by the * LSST Project (http://www.lsst.org/). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as pu...
#pragma once #include "GameSeaquence.h" class GameSeaquenceController; class Clear:public GameSeaquence { public: Clear(); ~Clear(); Boot* Update(GameSeaquenceController*); private: //クリア画面のイメージ int mCount; };
/* * TODO: put your own comments here. Also you should leave comments on * each of your methods.@wwyqianqian */ #include <math.h> #include "recursion.h" #include "map.h" #include "vector.h" #include "set.h" #include "gwindow.h" #include "gobjects.h" #include "tokenscanner.h" using namespace std; ...
class Solution { public: bool dfs(vector<int>& arr, vector<int>& vis, int curr){ vis[curr] = true; if(arr[curr] == 0) return true; int left = curr - arr[curr]; int right = curr + arr[curr]; bool ans = false; if(left >= 0 && vis[left] == false){ ans = ...
// KC Text Adventure Framework - (c) Rachel J. Morris, 2012 - 2013. zlib license. Moosader.com #ifndef _MISSION #define _MISSION #include "../LuaWrappers/MissionWrapper.h" class Mission { public: void Init( lua_State* state ); int DisplayMissionList(); bool SelectMission( int episode ); void Disp...
#include "Weapon.h" int Weapon::increment = 1000; Weapon::Weapon(string name, int damages, int hit, int range, int crit, int worth, int uses, WeaponType type):TYPE(type) { id = new int(increment++); this->name = name; this->damages = damages; this->hit = hit; this->range = range; th...
#include "MapSelection.h" #include "MenuGameMode.h" #include "ModeShipVSTower.h" #include "TutorialShipVSTower.h" //#include "" //#include "GamePlayDemo.h" // //#include "cocos-ext.h" //#include "UIScene.h" //#include "UISceneManager.h" //#include "editor-support/cocostudio/CCSGUIReader.h" //#include "CocosG...
#include <iostream> using namespace std; int main(){ int tc; int sc; int min; int max; int temp; cin >> tc; while(tc--){ cin >> sc; min = 100; max = -1; while(sc--){ cin >> temp; if(temp > max){ max = temp; ...
// Copyright (c) 2019 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special ...
// // Created by Dustin Tracy on 7/1/15. // #ifndef PROJECTEULER_VECFUNC_H #define PROJECTEULER_VECFUNC_H #include <vector> #include <iostream> template<class T> class vecFunc { public: vecFunc(std::vector<T> &list) { setVector(list); } // The constructor, requiring a vector void setVector(s...
class Solution { public: void sortColors(vector<int>& nums) { int n = nums.size(); int zeroIndex = 0, twoIndex = n-1; for(int i=zeroIndex;i<=twoIndex;i++){ if(nums[i] == 0){ swap(nums[i], nums[zeroIndex]); zeroIndex++; } else if(nums[i] == 2){ ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef EXTENSIONS_MODEL_H #define EXTENSIONS_MODEL_H #include "...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- * * Copyright (C) 1995-2011 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" // FIXME: clean...
#include <QtWidgets/QApplication> #include "mainwidget.h" #include "loginwidget.h" int main(int argc, char **argv) { QApplication app(argc, argv); Window w; LoginWidget login; QObject::connect(&login, SIGNAL(authSucceeded(QString)), &w, SLOT(saveToken(QString))); login.show(); return app.exec(); }
/* -*- 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) */ group "quick_toolkit.widgetcreator"; require ...
#include "stratified_resample.h" // import file to test #include <cmath> #include "ut.hpp" using namespace boost::ut; using namespace boost::ut::bdd; int main() { srand(1994); "stratified_resample"_test = [] { given("Working stratified_random function and calling with w, N_w, Neff, keep") = [] { ...
#pragma once class AIEditMode; class AIEditNode; class AIEditNodeInequ; class AIEditNodeNum; class AIEditNodeClick; class AIEditLine; class GameCursor; class AIEditNodeTarget; class AIEditNodeProcess; class AIEditNodeTechnique; class AIEditNodeAbnormalState; class AIEditNodeSelectFonts; class AIEditNodeDeleteKey; enum...
/* Copyright 2021 University of Manchester Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http: // www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
#include <cstdio> #include <cstdlib> int main(int argc, const char *argv[]) { const int N = atoi(argv[1]); FILE *f = fopen(argv[2], "rb"); int *x = new int[2147483647]; for (int i = 0; i < N; i++) { int x; fread(&x, sizeof(int), 1, f); printf("Origin : %d\n", x); ...
#pragma once #include "stdafx.h" #include "skeleton.h" #include "MeshCutting.h" #include "TransformerSkeleton.h" enum AnimationStep{ CONNECTING_BONE_ROTATION, CONNECTING_BONE_LENGTH, BONE_SHELL_ROTATION, DONE, NUM_ANIMATION_STEPS }; enum AnimationMode{ PLAY_ANIMATION, PAUSE_ANIMATION, RESTART_ANIMATION, ANIM...
#include "../Solution.h" Node *Solution::connect(Node *root) { }
#include "widget.h" Widget::Widget(QWidget *parent) : QWidget(parent) { layout_main = new QGridLayout(this); layout_vehicule = new QBoxLayout(QBoxLayout::TopToBottom); layout_main->addLayout(layout_vehicule, 0, 0); layout_aboutIt = new QBoxLayout(QBoxLayout::TopToBottom); layout_main->addLayout(l...
#include "moves.h" #include <iostream> #include <string> moves::moves() { moveName; moveType; moveDamage; } void moves::setFireSpin() { moveName = "Fire Spin"; moveType = "Fire"; moveDamage = 4; } void moves::setFlamethrower() { moveName = "Flamethrower"; moveType = "Fire"; moveDamage = 10; } void moves::se...
#pragma once #include <string> #include <tuple> #include <span> #include "ShaderCommon.h" #include <VeritasMath.h> struct DumbVertex { dx::XMVECTOR data[16]; SV_VertexID SV_VertexID; }; struct DumbVSOut { dx::XMVECTOR attributes[16]; uint32_t reserved; //not in use }; struct DumbPSOut { uint32_t SV_Target; }; ...
// // ThreadManager.hpp // Fishnap // // Created by 山内一祥 on 2019/09/04. // Copyright © 2019 Crux One. All rights reserved. // #ifndef ThreadManager_hpp #define ThreadManager_hpp #include <iostream> #include <stdio.h> #include <thread> #include <vector> class ThreadManager { public: void run(std::vector<std::...
#include <iostream> #include <exception> class DocElementVisitor; class DocElement { public: virtual void Accept(DocElementVisitor&) = 0; virtual ~DocElement() {} }; class Paragraph : public DocElement { public: void Accept(DocElementVisitor& v) override; unsigned int NumChars() const { return 1; } ...
/*---------------------------------------------------------------------------------------* * * * Library name: (M)otor 28BYJ48 Vs 1 * * Author: Marco Palladino - marck....
// You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. // Merge nums1 and nums2 into a single array sorted in non-decreasing order. // The final sorted array should not be returned by the funct...
// Created on: 1993-03-24 // Created by: JCV // 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 GNU Lesser Gen...
#pragma once class Date { public: Date(); bool isequal(char*, char*); int dateraznost(char*); int raznost(char*, char*); bool compare(char*, char*); ~Date(); };
// Created on: 2009-04-06 // Created by: Sergey ZARITCHNY // Copyright (c) 2009-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1...
#include "BattleTimeManager.h" BattleTimeManager::BattleTimeManager() : ManagerModule(eBattleMgr_Time) { } BattleTimeManager::~BattleTimeManager() { } bool BattleTimeManager::Awake() { return true; } bool BattleTimeManager::AfterAwake() { return true; } bool BattleTimeManager::Execute() { ...
#include <iostream> #include <ctime> #include <vector> #include <string> #include <array> #include <algorithm> #include <sstream> #include <map> using namespace std; unsigned long long solve(unsigned long long); unsigned long long solve(size_t depth, size_t branch); unsigned long long search(unsigned long long); void...
#include "precompiled.h" #include "game/jsgame.h" #include "game/game.h" #include "script/script.h" #include "window/appwindow.h" namespace jsgame { JSBool jsstartMap(JSContext *cx, uintN argc, jsval *vp); JSBool jsquit(JSContext *cx, uintN argc, jsval *vp); JSBool jstimestamp(JSContext *cx, uintN argc, jsva...
#pragma once /**************************************************************************** * Copyright (c) 2011 GeoMind Srl. www.geomind.it * All rights reserved. * *--------------------------------------------------------------------------- * This software is part of the GeoTree library by GeoMind Srl; * ...
//------------------------------------------------------------------------------ /* This file is part of Beast: https://github.com/vinniefalco/Beast Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com> Portions of this file are from JUCE. Copyright (c) 2013 - Raw Material Software Ltd. Please visi...
#include "Noise.hpp" namespace rlrpg { noise_t noise(noise_coord_t n) { n = n ^ (n << 13); return n * (n * n * 15731 + 789221) + 1376312589; } noisef_t noisef(noise_coord_t n) { return noise(n) / (noisef_t) ~(noise_t)0; } }
#include<iostream> using namespace std; int getBit(int n,int pos);//O(1) int setBit(int n,int pos);//O(1) int clearBit(int n,int pos);//O(1) int updateBit(int n,int pos,int val);//O(1); bool isPowerOf2(int n);//O(1) int twosComplement(int n);//O(1) int numberOfOnes(int n); //O(1) void printSubsets(int A[],int ...
#include <iostream> #include <algorithm> #include <numeric> using namespace std; int main() { int N; cin >> N; int a[N]; for (int i = 0; i < N; ++i) cin >> a[i]; sort(a, a + N); int sum = accumulate(a, a + N, 0); int ans = sum; for (int x = 2; x <= 100; ++x) { int b = 0; ...
// // Created by dwb on 2019-07-22. // #include "AnimalFactory.h" int AnimalFactory::size = 0; void AnimalFactory::addAnimal(Animal &animal) { animal.m_name = "Monkey"; animal.m_weight = 80; }
#include "CommandProcessor.h" CommandProcessor::CommandProcessor(string _commandFile,string _logFile): commandFile(_commandFile),logFile(_logFile),UNDERLINE("------------------------------------------------------------------------------------------") { log = Logger::getLog(logFile); } CommandProcessor:: ~...
#include "engine/graphics/PhysicsObject.hpp" pair<int,int> CollisionRect::getVertex(int i){ double diag = sqrt(1.0*w*w+h*h)/2; // if(w==36){ // cout << w << " " << h << " " <<uw << " " << uh << endl; // } double dangle = atan2(h,w); switch (i) { case 0: dangle -= PI; ...