text
stringlengths
8
6.88M
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <gmock/gmock-generated-matchers.h> #include <gmock/gmock-matchers.h> #include <gtest/gtest.h> #include "CallstackData.h" MATCHER(CallstackEven...
/* * License: * License does not expire. * Can be distributed in infinitely projects * Can be distributed and / or packaged as a code or binary product (sublicensed) * Commercial use allowed under the following conditions : * - Crediting the Author * Can modify source-code */ /* * File: IndexB...
////////////////////////////////////////////////////////////////////////// // Bwindows.cpp:编写 Windows 程序常用的一些自定义函数和类的实现 // 类包括: // CBApp 类: 管理应用程序全局信息 // CBHashLK:长整数型 key 的哈希表类 // CBHashStrK:字符串型 key 的哈希表类 // CBRecycledArr:带回收站的数组类 // CBRecycledArrInt:整型版带回收站的数组类 // CHeapMemory: 用全局对象维护所有通过 new 分配的内存指...
#include "object\SpellCard.h" #include "Config.h" #include "Resource.h" const int SpellCard::FLAG_FALSE = 0; const int SpellCard::FLAG_TRUE = 1; const int SpellCard::FLAG_ENDURANCE = 2; SpellCard::SpellCard() : SpellCard({ Ref::FLD_W * (Config::GetInstance()->GetResolutionNo() * 0.5F + 1.0F) - 8.0F - Config::GetInsta...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- * * 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. * * Espen Sand */ #ifndef X11_SKIN_ELEME...
/** hihocoder-#1317-ËÑË÷4-ÌøÎèÁ´ 15/06/16 16:22:19 xuchen **/ #include <iostream> #include <cstdio> #include <cmath> #include <vector> #include <string.h> #include <algorithm> #include <stdlib.h> #include <queue> #include <stack> #include <map> using namespace std; const int N = 105; struct Node{ int x, y; No...
#pragma once #include "log.hpp" #include "exception.hpp" #include "assert.hpp" #include "string_utils.hpp" #include "json2pb.hpp" #include <google/protobuf/descriptor.h> #include <google/protobuf/message.h> #include <google/protobuf/dynamic_message.h> #include <string> #include <fstream> #include <algorithm> #include ...
#include<iostream> using namespace std; int main() { int month[5][7] = { 0 }; int num = 1; //일 Check int start = 0; //각 월의 1일 시작점 int day; //요일 Check int x, y; cin >> x; cin>> y; //2007년 각 월의 날짜 입력 switch (x) { case 1: if (num <= 31) { for (int i = 0; i < 5; i++) { for (int j = 0; j < 7; j++) { ...
#include "JvState.h" #include "JvText.h" #include "GameState.h" JvState::JvState() : camera(NULL),defaultGroup(NULL) { _bgColor =0; if (NULL == camera) camera = new JvCamera; if (NULL == defaultGroup) defaultGroup = new JvGroup; m_ccbglayer = CCLayerColor::create(); m_ccbglayer->retain(); } JvState::~JvSt...
// // TCPServerConnection.cpp // // $Id: //poco/1.4/Net/src/TCPServerConnection.cpp#1 $ // // Library: Net // Package: TCPServer // Module: TCPServerConnection // // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "_Net/T...
// Created on: 2002-12-12 // Created by: data exchange team // Copyright (c) 2002-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...
#include <iostream> #include <fstream> #include <queue> #include "Passenger.h" #include "Event.h" using namespace std; int check = 0; struct Compare{ public: bool operator()(pair<Passenger, Passenger*> a, pair<Passenger, Passenger*> b) { if(check == 0){ if(a.first.lastTime == b.first.la...
#include "FBullCowGame.h" #include <string> using FString = std::string; using int32 = int; FBullCowGame::FBullCowGame() { Reset(); } int32 FBullCowGame::GetMaxTries() const {return MyMaxTrie;} int32 FBullCowGame::GetCurrentTry() const {return MyCurrentTry;} void FBullCowGame::Reset() { constexpr int32 MAX...
#include <iostream> #include <algorithm> using namespace std; int t, n, previ[100001], a[100001]; bool flag; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> t; for (int i = 0; i < t; i++) { cin >> n; flag = false; for (int j = 1; j <= n; j++) ...
// This test verifies that the various staggered Dslash functions are working correctly. // * Compares the \gamma5 D function with applying D then \gamma_5. // * Compares the D^\dagger function with applying \gamma_5 then D then \gamma_5 // * Compares summing applying D_{eo}, D_{oe}, and the mass term to applying D. //...
/* vim: set ai noet ts=4 sw=4 tw=115: */ // // Copyright (c) 2014 Nikolay Zapolnov (zapolnov@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 w...
#include "precompiled.h" #include "common/log.h" namespace Log { struct Consumer { Consumer(ConsumerCallback callback, void* user, U32 mask) : callback(callback), user(user), mask(mask) {} ConsumerCallback callback; void* user; U32 mask; }; typedef map<string, Consumer> consumer_map_t; ...
#include "Scope.h" #include <iostream> void Scope::Set (int Pos, std::vector<Statement>* Char) { int ArgL = 0; // Tracks where the current parenthesis is, in relation to other ones int ScopeL = 0; // Tracks where the current brackets is, in relation to other ones bool ArgOpen = false; bool ArgClose = false; bo...
#include <iostream> #include <algorithm> #include <iterator> void print( int * first_, int * last_ ) { std::cout << "[ "; while( first_ < last_ ) { std::cout << *first_ << " "; first_++; } std::cout << "]"; } void merge( int *first_a, int *last_a, int *first_b, int *las...
/* ** EPITECH PROJECT, 2019 ** tek3 ** File description: ** Message */ #ifndef MESSAGE_HPP_ #define MESSAGE_HPP_ #include <QtWidgets> #include <QApplication> #include <vector> #include <iostream> namespace babel { namespace graphic { class Message : public QWidget { Q_OBJECT publ...
/* * StringTest1.cpp * * Created on: 2014年4月9日 * Author: h3c */ #include "String.h" #include <cstdio> #include <cstring> #include <exception> #include <iostream> using namespace std; String::String() { length = 0; buf = NULL; cout << "String()" << endl; } String::String(const char * s) { if (s == NULL...
#include "compressEpub.h" compressEpub::compressEpub(QObject *parent) : QObject(parent) { } QStringList compressEpub::getAllEpubFiles(QString dirPath, QStringList list) { QDir dir(dirPath); QFileInfoList info_list = dir.entryInfoList(QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot ...
// File Name: ass4.cpp // Programmer: Tabitha Roemish // Date: February 23, 2018 // File contains: Movie class declaration // movie class is abstract class for movie types (Comedy[F], Drama[D], Classic[C]) #ifndef MOVIE_H #define MOVIE_H #include <string> class Movie { public: virtual void print() = 0; virtual ~M...
#include <bits/stdc++.h> using namespace std; const int maxn = 101; const int INF = 0x7fffffff; struct Graph{ int vexs[maxn]; int arcs[maxn][maxn]; int vexNum; int arcNum; }; bool visited[maxn]; void initGraph(Graph *G); void DFS(Graph *G); void dfs(Graph *G,int i); void BFS(Graph *G,int start); void ...
#include <iostream> #include <map> #include <vector> using namespace std; template <typename T> T gcd(T a, T b) { if (a < b) return gcd(b, a); return b == 0 ? a : gcd(b, a % b); } const int MAX = 2e7; bool isprime[MAX]; vector<int> primes; void sieve() { fill(isprime, isprime + MAX, true); for (int ...
const ld PI=acos(-1.0); ld Area(ld x1,ld y1,ld r1,ld x2,ld y2,ld r2) { ld d=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); if(d>=(r1+r2)*(r1+r2)) return 0; else if((r1-r2)*(r1-r2)>=d) { if(r1>r2) return PI*r2*r2; else return PI*r1*r1; } else { ld a1...
#ifndef PACKEDPSEUDOGENOMEBASE_H_INCLUDED #define PACKEDPSEUDOGENOMEBASE_H_INCLUDED #include "PseudoGenomeBase.h" using namespace PgSAReadsSet; namespace PgSAIndex { class PackedPseudoGenomeBase: public PseudoGenomeBase { protected: uchar symbolsPerElement; uchar bytesPerEle...
/* * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
#pragma once #include "SIngletonBase.h" #define MAXSTRSIZE 128 class TextData : public SingletonBase<TextData> { private: FILE * fp; public: TextData(); ~TextData(); HRESULT Init(); // Save void TextSave(char* saveFileName, vector<string> vStr); char* VectorArrayCombine(vector<string> vArray); // Load //...
#pragma once #include "..\Common\Pch.h" #include "..\RenderResource\Camera.h" #include "..\RenderResource\Frustum.h" #include "..\RenderResource\Light.h" #include "..\RenderResource\Material.h" #include "..\RenderResource\RenderTexture.h" #include "..\RenderResource\RenderManager.h" #include "Cube.h" #include "Sphere....
#include <iostream> using namespace std; bool isSubsequence(string s, string t) { bool flag = false; int count = 0; int count1 = 0; int i = 0; if (s.length() == 0) return true; for (i = count; i < s.length(); i++) { flag = false; for (int j = count1; j < t.length(); ...
#include <string> #include <sstream> #include <fstream> #include <map> #include "../../../HiggsAnalysis/CombinedLimit/interface/RooMultiPdf.h" using namespace RooFit; using namespace RooStats ; Double_t MMIN = 1.62; Double_t MMAX = 2.0; double signalScaler=1;///10.; double analysisLumi = 1.; // 1/fb void AddData(T...
class Solution { public: int totalNQueens(int n) { vector<int> colNumber(n,-1); int ans = 0; dfs(0,n,ans,colNumber); return ans; } void dfs(int cur,int n,int &ans,vector<int> &colNumber){ if(cur == n){ ans++; return; } for(int i...
// Example 2_1 : Built-in types, numeric limits. // Created by Oleksiy Grechnyev 2017 #include <iostream> #include <limits> // <iomanip> has std::setw(), std::setfill() for formatting output #include <iomanip> int main(int argc, char **argv){ using namespace std; // Demonstrate the danger of mixing sign...
#include <Wire.h> #include "MAX30100_PulseOximeter.h" #include <Ticker.h> #include <MedianFilter.h> #include <IOXhop_FirebaseESP32.h> #include <WiFi.h> #define FIREBASE_HOST "seb01-465f5.firebaseio.com" #define FIREBASE_AUTH "pAAbm0SufQuio0OT0uxxhBXJYtCiggSBw0llqI0o" #define WIFI_SSID "Celular Mila" #define WIFI_PASS...
#pragma once #include "stdafx.h" #include "Utils.h" #include "StructSettings.h" class SingleData { public: static SingleData* getInstance() { if (!instance) instance = new SingleData; return instance; } void addLabelToAdaptOnTheme(const QString& key, QLabel* label); void addButtoonToAdaptOnThem...
#pragma once #include <ionir/construct/inst.h> namespace ionir { class Pass; class Function; struct IcmpInstOpts : InstOpts { // TODO }; class IcmpInst : public Inst { public: explicit IcmpInst(const IcmpInstOpts &opts); void accept(Pass &visitor) override; }; }...
#include<vector> #include<iostream> #include<cstdio> #include <cstring> #include <algorithm> using namespace std; int main(){ int num[10005]; int n; cin >> n; int temp; memset(num, 0, sizeof num); for (int i = 0; i < n; ++i) { cin >> temp; if (num[temp] == 0) { num[temp]++; } } for (i...
#pragma once // CPYDlg 对话框 class CPYDlg : public CDialog { DECLARE_DYNAMIC(CPYDlg) public: CPYDlg(CWnd* pParent = NULL); // 标准构造函数 virtual ~CPYDlg(); // 对话框数据 enum { IDD = IDD_DIALOG_PY }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP(...
#define CATCH_CONFIG_MAIN #include "../external/catch2/catch.hpp" #include "../src/math/average.hpp" #include <vector> template <typename T> struct TestStruct { std::vector<T> arr; T actual; TestStruct(std::vector<T> arr, T actual) : arr(arr), actual(actual) { } }; TEST_CASE("Average ...
#include <bits/stdc++.h> using namespace std; vector<string> split_string(string); /* Prints what numbers in the cost vector add up to exactly the money input. Utilizes a binary search algorithm and hash table to reduce the time for finding the solution in large problems. The unsorted cost array is put into a C++ m...
#pragma once #include <iberbar/Utility/Platform.h> namespace iberbar { template< typename T > class TSize2 { public: TSize2() throw(); TSize2( T w, T h ) throw(); TSize2( const T* p ) throw(); T Area() const; operator T* () throw(); operator const T* () const throw(); TSize2 operator*( int a ) con...
#include <specex_unbls.h> #include <specex_mask.h> #include <specex_psf.h> #include <specex_image_data.h> specex::Mask::Mask() { } void specex::Mask::ApplyMaskToImage(specex::image_data& img, const specex::PSF& psf, const double& value) const{ int hsize = 5; for(size_t m=0;m<WaveIntervals.size();m++) { co...
// Created on: 1995-09-01 // Created by: Yves FRICAUD // Copyright (c) 1995-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 L...
#ifndef STANDARDDEVIATION_H #define STANDARDDEVIATION_H #include "../Filters/Filter.h" class StandardDeviation : public Filter { Q_OBJECT public: StandardDeviation(QObject *parent = 0); static QString GetFilterName() {return "Standard Deviation";} void run(); private: double numStdDevs; void runClou...
// // imcases.cpp // AutoCaller // // Created by Micheal Chen on 2017/7/26. // // #include "imcases.hpp" #include "imservice.hpp" #include "YouMeHttpRequest.hpp" #include <sstream> #include "audio/include/SimpleAudioEngine.h" using namespace std; IMTestController::IMTestController() { m_config = new Conifg()...
#include <algorithm> #include <iostream> #include <stack> #include <vector> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); int n, m; std::cin >> n >> m; std::vector<std::vector<bool>> graph(n, std::vector<bool>(n, false)); std::vector<bo...
#include "StdAfx.h" #include "SettingFrame.h" CSettingFrame::CSettingFrame(void) { pButton_account = NULL; pButton_generic = NULL; pButton_shortcut = NULL; pButton_backup = NULL; pButton_about = NULL; pTabLayout = NULL; } CSettingFrame::~CSettingFrame(void) { } LPCTSTR CSettingFrame::GetWindowClassName() con...
/* -*- coding: utf-8 -*- !@time: 2019-10-20 18:50 !@author: superMC @email: 18758266469@163.com !@fileName: 0_main.cpp */ #include "bilibili/twisting-machine.cpp" int main() { fun(); }
#include "PucksInHand.h" // Pointer that will need to be set in order to execute helper methods contained in this file // This variable must be declared as an extern and should be initialized prior to calling // Pucks In Hands Supervisory or RealTime Methods //extern BHAND_PUCK2 *bhandPuckTwos; #include <str...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
#pragma once #include <map> #include "CommandDescriptor.h" #include "Exceptions.h" class CommandTemplateParser { static const int TEXT = 0; static const int VARIABLE_NAME = 1; static const int ESCAPED = 2; std::string input; std::string output; CommandDescripto...
#include<iostream> using namespace std; int digit_sum(int n) { int d,t; if(n!=0) { d=n%10; return (d+digit_sum(n/10)); } else return 0; } int main() { int sum,num; cout<<"enter number\n"; cin>>num; sum=digit_sum(num); cout<<"Sum of digits of "<<num<<" is "<<sum; return 0; }
#include <Routes.h> Routes::Routes(string raw_model, int width, int height, int depth, int bytes): raw_model(raw_model), width(width), height(height), depth(depth), bytes(bytes){} Routes::~Routes() { this->raw_model.~basic_string(); }
#include <iostream> /* Sisend ja väljund */ #include <cstdlib> /* EXIT_SUCCESS jt konstandid */ #include "tstar_algo_jump.hpp" #include <vector> #include <algorithm> #include <climits> #include <unordered_set> #include <unordered_map> #include <map> #include <list> using namespace std; /* Nimeruumi valik (selgitatakse...
#ifndef ADAPTIVECANNY_H #define ADAPTIVECANNY_H class adaptivecanny { public: adaptivecanny(); }; #endif // ADAPTIVECANNY_H
#include "MainWindow.hpp" #include "EditorApplication.hpp" using namespace Maint; int main(int argc, char *argv[]) { EditorApplication a(argc, argv); a.GetMainWindow()->show(); return a.exec(); }
// // aff_list.cpp for in /home/roby_t/perso/test // // Made by Tristan Roby // Login <roby_t@epitech.net> // // Started on Thu Jan 22 20:04:59 2015 Tristan Roby // Last update Sun Jan 25 21:47:38 2015 Tristan Roby // #include "aff_list.hh" affList::affList(std::string *PokemonName) { this->PokemonName = Poke...
/************************************************************************/ /* X10 Rx/Tx library for the XM10/TW7223/TW523 interface, v1.4. */ /* */ /* This library is free software: you can redistribute it and/or modify */ /* it under the ...
#include <bits/stdc++.h> #define loop(i,s,e) for(int i = s;i<=e;i++) //including end point #define pb(a) push_back(a) #define sqr(x) ((x)*(x)) #define CIN ios_base::sync_with_stdio(0); cin.tie(0); #define ll long long #define ull unsigned long long #define SZ(a) int(a.size()) #define read() freopen("i...
#pragma once #include <vector> #include <combaseapi.h> #include "WPDUtils.h" template <class T> using ptr = std::unique_ptr<T, void (*)(T *)>; template<class T> ptr<T> mockToPtr(T &m) { return ptr<T>{&m, WPD::Utils::ComDeleter<T>}; } LPWSTR allocString(const std::wstring &src); void copyStrings(const std::vec...
#ifndef _CGetWinGoldRank_h_ #define _CGetWinGoldRank_h_ #pragma once #include <string> #include "CHttpRequestHandler.h" //活动金币排行 class CGetWinGoldRank : public CHttpRequestHandler { public: CGetWinGoldRank(){} ~CGetWinGoldRank(){} virtual int do_request(const Json::Value& root, char *client_ip, HttpRe...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2008 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #include "core/pch.h" #include "modules/libcrypto/libcrypto_module...
#include <iostream> #include <cstdio> #include <unordered_map> #include <vector> using namespace std; const char OPEN_LOOP = '['; const char CLOSE_LOOP = ']'; unordered_map<size_t, size_t> match_brackets(const char code[], size_t size) { unordered_map<size_t, size_t> brackets; unordered_map<size_t...
//=========================================================================== //! @file asset_model_manager.cpp //! @brief アセットモデル管理クラス //=========================================================================== //--------------------------------------------------------------------------- //! デストラクタ //--------------...
#ifndef INC_1_LAB_MODULES_H #define INC_1_LAB_MODULES_H #include<iostream> #include<fstream> #include<cstdlib> #include<ctime> #include<cstring> using namespace std; //Класс class Hotel { string city; string name; int star; int freeVip, freeSimple; int busyVip, busySimple; public: //Hotel(const Hotel& temp); ...
#ifndef __LOAM_COMMON_ROS_H__ #define __LOAM_COMMON_ROS_H__ #include <loam_velodyne/common.h> #include <ros/ros.h> #include <sensor_msgs/PointCloud2.h> #include <pcl_conversions/pcl_conversions.h> void loadCloudFromMsg(const sensor_msgs::PointCloud2ConstPtr& msg, pcl::PointCloud<PointType>::Ptr out_cloud, do...
#include "control.h" RRG::Control::Control() { RRG::InputManager& _inputManager = RRG::InputManager::Instance(); _inputManager.Register<RRG::InputObserver::MouseMoveEvent>([this](RRG::MouseMoveEventArg arg) { OnMouseMove(arg); }); } RRG::Control::~Control() { } void RRG::Control::OnMouse...
#include "precompiled.h" #include "window/appwindow.h" #include "settings/settings.h" namespace eXistenZ { unique_ptr<AppWindow> g_appWindow; } using namespace eXistenZ; REGISTER_STARTUP_FUNCTION(AppWindow, &AppWindow::InitSettings, 10); void AppWindow::InitSettings() { settings::addsetting("system...
#include "stdafx.h" #include "Enemy.h" #include "Tank.h" Enemy::Enemy() { } Enemy::~Enemy() { } HRESULT Enemy::Init() { _direction = TANKDIRECTION_UP; frameX = 0; frameY = 0; _image = IMAGE->AddImage("tank", "images/tank.bmp", 0, 0, 256, 128, 8, 4, true, RGB(255, 0, 255)); _speed = 100.0f; cnt = 0; cur...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2004 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include <gtk/gtk.h> #include <stdio.h...
#include "GnMeshPCH.h" #include "GnGamePCH.h" #include "GBackgroundLayer.h" GBackgroundLayer::GBackgroundLayer() { setIsTouchEnabled(true); } void GBackgroundLayer::ccTouchesBegan(CCSet* pTouches, CCEvent* event) { CCSetIterator it = pTouches->begin(); CCTouch* touch = (CCTouch*)(*it); CCPoint ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; int main() { int n; scanf("%d",&n); if (n%2) printf("%d %d\n",9,n-9)...
#ifndef DIVIDE_H #define DIVID_H #include <iostream> #include "Operation.h" class Divide : public Operation{ public: Divide(); Divide(Base*, Base*); double evaluate(); }; #endif
#include <iostream> #include <string> #include <vector> using namespace std; void test01() { // static_cast用来转换内置的数据类型,和C语言的强制类型转换一样 int a = 1; char b = 2; double c = 3.14; a = static_cast<int>(b); a = static_cast<int>(c); c = static_cast<double>(a); } class A { public: int a; }; clas...
#include <unordered_map> class File {}; class FileSystem { private: std::unordered_map<std::string, File> files; public: File& create(std::string); File& edit(std::string); const File& view(std::string); void destroy(std::string); };
#ifndef __HITTRACKER_H_INCLUDED__ #define __HITTRACKER_H_INCLUDED__ #include <string> #include <vector> class HitTracker { public: //Generators HitTracker(); HitTracker(unsigned long long hitCount, unsigned long long iterValue); HitTracker(std::vector<unsigned long long> hits, std::vector<unsigned lo...
// Created on: 1992-10-02 // Created by: Christian CAILLET // Copyright (c) 1992-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 ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** 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. ** */ #include "core/pch.h" #ifdef CANVAS_SUPPORT #ifdef CANVAS_TEX...
// BSD 3-Clause License // // Copyright (c) 2020-2021, bodand // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, th...
#pragma once #include "pytorchcpp.h" #include <torch\torch.h> #include <torch\cuda.h> #include <fstream> // debugging dll load by metatrader 5 output to txt file -> located where it started #include <mutex> #define GIGABytes 1073741824.0 namespace th = torch; extern std::ofstream debugfile; // have only used once or...
/* * 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...
DOUBLE PRECISION SCALFA COMMON/SCALF/ SCALFA
#include <bits/stdc++.h> using namespace std; int prob[102]={}; int main() { int carc[4]; int n, m, c, ant, ant2; carc[0] = carc[1] = carc[2] = carc[3] = 1; while(scanf("%d %d", &n, &m) && n && m) { for(int i=0;i<n;i++) { ant = 1; ant2 = 0; for(int j=0;j<m;j++...
#include <iostream> #include <math.h> using namespace std; int main(){ int x,y,sumx=0,sumy=0; cout<<"Ingrese X: "; cin>>x; sumx==x; cout<<"Ingrese Y: "; sumy==y; cin>>y; cout<<"\n============================\n"; while (x!=0 && y!=0){ cout<<"Ingrese X: "; cin>>x; sumx+=x; cout<<"...
bool isSafe(int x,int y,int n,int m){ return (x>=0&&y>=0&&x<n&&y<m); } int Solution::black(vector<string> &A) { queue<pair<int,int>> q; int n = A.size(); int m = A[0].size(); int count = 0; for(int i =0;i<n;i++){ for(int j =0;j<m;j++){ if(A[i][j]=='X'){ coun...
#include "reactor/net/http/HttpContext.h" #include "reactor/base/strings/strings.h" using namespace std; using namespace reactor::base; namespace reactor { namespace net { namespace http { void HttpContext::parse(const TcpConnectionPtr &conn) { char *data = conn->buffer()->as_str(); char *line = data; char *crlf...
/* Exp no : 11 Stop and wait SW simulation S1330-R-Jayadeep 06/10/2016 */ #include<iostream> #include<random> using namespace std; class Socket{ string data; public: int receive(char c,int seq){ if(random()%2){ data+=c; return seq; } else return -1;...
#ifndef LISTOFCONSTANTLENGTHREADS_H_INCLUDED #define LISTOFCONSTANTLENGTHREADS_H_INCLUDED #define ORIGINAL_INDEX_OFFSET (FLAGS_OFFSET+1) #include "ReadsListInterface.h" using namespace PgSAReadsSet; namespace PgSAIndex { template < typename uint_read_len, typename uint_reads_cnt, ...
#include<bits/stdc++.h> using namespace std; int main() { int x,y; int sum = 0; cin>>x>>y; if(x>y) { swap(x,y); } for(int i =x; i<=y; i++) { if(i%13!=0) { sum = sum + i; } } cout<<sum<<"\n"; return 0; }
#include <iostream> #include <iomanip> using namespace std; int main(){ int i; for ( i = 2;i <= 100; i++) { if(i%2 == 0){ cout << i << endl; } } return 0; }
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <dirent.h> #include <cctype> #include "asar/asardll.h" #include "cfg.h" #include "structs.h" #include "file_io.h" #define ROUTINES 0 #define SPRITES 1 #define GENERATORS 2 #define SHOOTERS 3 #define LIST 4 #define EXTENDED 5 #define CLUSTER 6 #define...
// BTS, DTS 문제 // // issue : 메모리 초과 // 원인 : BFS 함수 오류 // 해결방법 : BFS 함수에 큐를 사용한다. // // issue : 배열 초과 // 원인 : 배열 인덱스 딱 맞게 설정 // 해결방법 : 배열을 원래 조건보다 여유롭게 설정 #include <iostream> #include <algorithm> #include <vector> #include <queue> using namespace std; vector<int> vertex[1001]; queue<int> vertexQueue; int numberVerte...
#pragma once #include "bricks/core/autopointer.h" namespace Bricks { namespace IO { class StreamReader; class StreamWriter; class Stream; class Console : public Object { protected: Console(Stream* in, Stream* out, Stream* error); public: ~Console(); static Console* GetDefault(); AutoPointer<StreamR...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2008-2012 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 POSIX_OK_NETIF #include "platforms/po...
#include<stdio.h> struct student{ char name[21]; int score; }; int main(){ struct student a[10],t; int i,j,k; printf("请输入要排序的个数:"); scanf("%d",&k); for(i=0;i<k;i++) scanf("%s %d", &a[i].name,&a[i].score); for(i=0;i<k-1;i++) for(j=0;j<k-i-1;j++) { if(a[i].score > a[i+1].score) { t=a[i]; a[i...
/*First enter RGC irrespective of the order,then enter L,the dependent sources and then dependent sources */ #include<complex> #include<iostream> #include<string> #include<vector> #include<sstream> #include<cctype> #include"stdio.h" #include"stdlib.h" #include<fstream> #include<cmath> using namespace std; void print(ve...
#include <iostream> using namespace std; long Fibonacci1(unsigned long n){ int a=0; int b=1; int result; for(int i=0; i < n-1; i++){ result = (a+b); a = b; b = result; } return result; } int main() { unsigned long n = 2; cout << Fibonacci1(n) << endl; return 0; }
// Demonstrate file use #include <iostream> #include <fstream> #include <vector> void writeFile(const std::string& filename) { // .c_str() - convert std::string to a C-string (pointer to start and NULL terminator) std::ofstream outputFileStream(filename.c_str()); outputFileStream << "AARDVARK\n" << "ABRIDGE\n"...
// // EnemyBullet.cpp // ClientGame // // Created by liuxun on 15/3/3. // // #include "EnemyBullet.h" #include "Player.h" #include "Enemy2.h" EnemyBullet::EnemyBullet(){ } EnemyBullet::EnemyBullet(Enemy* enemy) { Vector2 enemyVector = MathUtil::VectorFromAngle(enemy->GetRotation() + 90.0f); Vector2 pos = ...