text
stringlengths
8
6.88M
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** 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. ** */ #ifndef WINDOWS_OPMESSAGE_LOOP_H #...
#ifndef EDITORWIDGET_H #define EDITORWIDGET_H #include <QWidget> #include <QLabel> #include <QHBoxLayout> #include <QDoubleSpinBox> #include <QFormLayout> #include <QComboBox> #include "Editor.h" #include "EditorView.h" class EditorView; /** * @brief Widget that allow ModifierGroup edition and modification of editi...
/* BEGIN LICENSE */ /***************************************************************************** * SKCore : the SK core library * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: textfile.cpp,v 1.11.2.2 2005/02/17 15:29:21 krys Exp $ * * Authors: Alexis Seigneurin <seigneurin @at@ idm .dot. fr> ...
/* 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 <type_traits> namespace Push { template<typename T> typename std::enable_if<std::is_integral<T>::valu...
// --- This file is distributed under the MIT Open Source License, as detailed // by the file "LICENSE.TXT" in the root of this repository --- #include "hurchalla/util/traits/extensible_make_signed.h" #include "hurchalla/util/compiler_macros.h" #include "gtest/gtest.h" #include <cstdint> #include <type_traits> names...
/********************************************************************************** camera.h This file contains the class definition, attributes, and methods For the camera. The Pixy2 camera uses the Arduino library that can be downloaded from the pixy website (https://pixycam.com/downloads-pixy2/). Th...
#include "RGB.h" #include <Arduino.h> RGB::RGB() { this->_r = 0; this->_g = 0; this->_b = 0; this->_l = 0; } RGB::RGB(byte *__rgb) { this->_r = __rgb[0]; this->_g = __rgb[1]; this->_b = __rgb[2]; this->_l = 50; } RGB::RGB(byte r, byte g, byte b) { this->_r = r; this->_g = g; this->_b = b; thi...
class Category_629 { class FoodCanBakedBeans { type = "trade_items"; buy[] = {2,"ItemSilverBar"}; sell[] = {1,"ItemSilverBar"}; }; class FoodCanFrankBeans { type = "trade_items"; buy[] = {2,"ItemSilverBar"}; sell[] = {1,"ItemSilverBar"}; }; class FoodCanPasta { type = "trade_items"; buy[] = {2,"Ite...
#include <string> #include <cstring> #include <iostream> using namespace std; #define MAX 1000002 int N, p[MAX]; string s; void kmp() { s = " " + s; p[1] = 0; int j = 0; for(int i=2; i<=N; ++i) { while(s[j+1]!=s[i] && j) j = p[j]; if(s[j+1] == s[i]) ++j; ...
#include <iostream> #include <vector> #include <stdio.h> using namespace std; const int N = 1000111; const int INF = 1e9; int a[N]; int n, k; int order[N + N]; int PS[N*2]; vector<int> st; int* pos = PS + N; int nexto[N], nextc[N]; int main() { freopen("brackets.in", "r", stdin); freopen("brackets.out", "w", stdou...
// Created on: 1997-05-13 // 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...
#include <iostream> #include <fstream> struct Point { int x,y,z; constexpr Point up(int d) const { return {x, y, z+d}; } constexpr Point move(int dx, int dy) const { return {x+dx, y+dy}; } friend std::ostream& operator<<(std::ostream& os, Point const& p) { return (os << p.x << " " << p.y << "...
#include <iostream> #include <algorithm> #include <string> using namespace std; string scheme(string s){ size_t found; found = s.find("://"); if (found == string::npos) return s; cout<<"scheme:"<<s.substr(0,found)<<endl; return s.substr(found+3); } string domain(string s){ size_t found; if (s=="") return s; ...
#include "CCivilianPed.h"
#include <iostream> export module solid; class Shape { public: virtual ~Shape() noexcept = default; virtual double getArea() const = 0; //virtual void draw() const = 0; // Violate ISP, and maybe SRP }; class Drawable { public: virtual ~Drawable() noexcept = default; virtual void draw() const = 0; //virtual voi...
#include "stdafx.h" #include "feature.h" #include "utils.h" double descr_dist_sq(struct feature* f1, struct feature* f2) { double sum = 0; double diff = 0; for (int i = 0; i < f1->n; i++) { diff = f1->x[i] - f2->x[i]; sum += diff * diff; } return sum; }
#include "thirdmonster.h" #include <cmath> #include <ctime> int ThirdMonster::Num = 0; ThirdMonster::ThirdMonster(QObject *parent) : Monster(parent) {} ThirdMonster::ThirdMonster(int x, int y, int width, int height, QObject *parent) : Monster(x, y, width, he...
// C headers extern "C" { #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/mount.h> #include <sys/wait.h> #include <signal.h> #include <libgen.h> } // C++ headers #include <iostream> #include <system_error> #incl...
#include <chuffed/core/propagator.h> #include <iostream> class BoolArgMax : public Propagator { public: int const sz; BoolView* const x; IntView<> const y; int offset; BoolArgMax(vec<BoolView> _x, int _offset, IntView<> _y) : sz(_x.size()), x(_x.release()), y(_y), offset(_offset) { priority = 1; for (int ...
// Created on: 1994-11-08 // Created by: Jean Yves LEBEY // Copyright (c) 1994-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...
/* =========================================================================== Copyright (C) 2017 waYne (CAM) =========================================================================== */ #pragma once #ifndef ELYSIUM_CORE_LOGGING_LOGLEVEL #define ELYSIUM_CORE_LOGGING_LOGLEVEL namespace Elysium { nam...
// Created on: 1996-11-14 // Created by: Philippe MANGIN // Copyright (c) 1996-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...
#include<stdio.h> int a,s=0; main() { scanf("%d",&a); for(int b=1; b<=10; b++) { printf("%d*%d=%d\n",a,b,s=a*b); } }
#include "platform/i_platform.h" #include "item_loader_repo.h" #include "property_loader.h" #include "item.h" #include "plasma_gun.h" #include "pistol.h" #include "shotgun.h" #include "rocket_launcher.h" #include "ion_gun.h" #include "gatling_gun.h" #include "gauss_gun.h" #include "lucky_rocket.h" #include "rusty_reape...
#include <iostream> #include <tuple> #include <vector> using namespace std; using ll = long long; const ll MOD = 1000000007; template <typename T, typename U> T mypow(T b, U n) { if (n == 0) return 1; if (n == 1) return b % MOD; if (n % 2 == 0) { return mypow(b * b % MOD, n / 2); } else { ...
#include "PortManager.hh" #include "Defines.hh" #include "Format.hpp" #include <regex> #include <iostream> #include <iomanip> //Initialization of the ressources and properties of Port Manager command PortManager::PortManager() : ACommand() { this->_minArg = 1; this->_command = "-port"; this->_mandatory = true;...
class Solution { public: bool canConvertString(string s, string t, int k) { int n = s.size(); vector <int> v; unordered_map <int, int> m; if(s.size() != t.size()) return false; for(int i=0; i<n; i++) { if(s[i] != t[i]) { int diff = s[i] <...
#pragma once #include "../NetIOCP/ISession.h" using namespace NetIOCP; class CSession { public: CSession(ISession* session); ~CSession() = default; public: void recv(); private: ISession* mpSession; };
#include<stdio.h> #include<conio.h> using namespace std; int kadanes(int arr[],int n) { int m1=0,m2=0; for(int i=0;i<n;i++) { m1 = m1+arr[i]; if(m1 <0) m1 = 0; if(m2<m1) m2=m1; } return m2; } int main() { i...
#include<iostream> using namespace std; /* viet chuong trinh nhap vao 1 phan so.cho biet phan so do am hay duong hay bang 0 */ class phanso { private: int tuso,mauso; public: void nhap() { cout<<"\n nhap vao tu so:\t"; cin>>this->tuso; cout<<"\n nhap vao mau so:\t"; cin>>...
#include "mainwindow.h" #include "ui_mainwindow.h" #include "qpainter.h" #include <QThread> #include <QLabel> #include <QMovie> #include <QTime> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); movie = new QMovie("source/dice.gif");...
// Created on: 2002-11-18 // Created by: Vladimir ANIKIN // 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.1 ...
int trigPin = 8; int echoPin = 7; int led = 13; int buz = 5; int motion = 2; int button = 3; int servoPin = 9; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(led, OUTPUT); pinMode(buz, OUTPUT); pinMode(motion, INPUT...
#include "quat.hh" using namespace Eigen; // Constructor Quat::Quat() { qs = 1.0; Vector3d v; v << 0.0, 0.0, 0.0; qv = v; } Quat::Quat(double s, double x, double y, double z) { qs = s; Vector3d v; v << x, y, z; qv = v; } Quat::Quat(double s, Vector3d v) { qs = s; qv = v; } ...
// 2 The Edge - Team 8: Liam Hall, Dan Powell, Louis Mills, Mo Patel, Ethan Gangotra, Hencraft, keasibanda #pragma once #include "CoreMinimal.h" #include "Components/TextRenderComponent.h" #include "GameFramework/Actor.h" #include "PlayerNameHeader.generated.h" UCLASS() class TWOTHEEDGE_API APlayerNameHeader : publ...
/* * @Description: 订阅激光点云信息,并解析数据 * @Author: Ren Qian * @Date: 2020-02-05 02:27:30 */ #ifndef LIDAR_LOCALIZATION_SUBSCRIBER_CLOUD_SUBSCRIBER_HPP_ #define LIDAR_LOCALIZATION_SUBSCRIBER_CLOUD_SUBSCRIBER_HPP_ #include <deque> #include <mutex> #include <thread> #include <ros/ros.h> #include <sensor_msgs/PointCloud2....
#include "MySound.h" void JigsawSound::loadSounds() { SimpleAudioEngine::sharedEngine()->preloadBackgroundMusic("backgound1.mp3"); SimpleAudioEngine::sharedEngine()->preloadEffect("sound1.mp3"); SimpleAudioEngine::sharedEngine()->preloadEffect("sound2.mp3"); SimpleAudioEngine::sharedEngine()->preloadEffect("sound3...
#include "stdafx.h" #include <string> void printMePCH() { std::string v = "PCH"; std::cout << v << ":" << v << std::endl; }
// mesh.h: interface for the mesh class. // ////////////////////////////////////////////////////////////////////// #ifndef AFX_MESH_H_ #define AFX_MESH_H_ #include <stdio.h> #include <stdlib.h> #include <map> #include <vector> #include <string> class Material { public: float Ka[4]; //ambient coefficient float Kd[...
#ifndef MACOPDRAGMANAGER_H #define MACOPDRAGMANAGER_h #include "modules/pi/OpDragManager.h" class MacOpDragManager : public OpDragManager { public: MacOpDragManager(); virtual ~MacOpDragManager(); virtual OP_STATUS StartDrag(DesktopDragObject* drag_object); virtual void StopDrag(); virtual BOOL IsDragging(...
#ifndef BIG_INTEGER_H #define BIG_INTEGER_H #include <array> #include <cstring> #include <mpc.h> #include <vector> namespace rsa { struct big { big(); big(int i); big(big const& other); explicit big(std::vector<unsigned char> const& str); explicit big(std::string const& str); big& operator*=...
// // EPITECH PROJECT, 2018 // nanotekspice // File description: // simulate chipsets // #ifndef __C4071_HPP__ # define __C4071_HPP__ # include "AComponent.hpp" # include "Gate.hpp" # include <vector> namespace nts { class C4071 : public nts::IComponent { const int nb_in; const int nb_out; std::string ...
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved. #include "ActionCue_editor.h" #include "ActionCue_editorStyle.h" #include "ActionCue_editorCommands.h" #include "AudioUtills.h" #include "LevelEditor.h" #include "Editor.h" #include "Engine.h" #include "Engine/Selection.h" #include "Widgets/Docking/SDockT...
#ifndef HEADER_CURL_MD5_H #define HEADER_CURL_MD5_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_...
#pragma once #include "texture.hpp" namespace leaves { namespace pipeline { template <> struct texture_traits<texture_1d_array> : texture_traits_base { static constexpr bool is_texture_1d() noexcept { return true; } static constexpr object_type type() noexcept { return object_type::texture_1d; }...
#include <MsTimer2.h> #include <Adafruit_NeoPixel.h> #define PIN 6 #define LEDNUM 35 double bpm = 90.0; double interval = 60.0/bpm; double tt = interval*1000; double half_tt = tt/2; double pre_time = 0; double cal_time = 0; // for calculating accuracy double start_time = 0; Adafruit_NeoPixel strip = Adafruit_NeoPixe...
#ifndef INTEGER_H #define INTEGER_H #include "Data.hpp" namespace uipf{ // Integer which is a specification of Data class Integer : public Data { public: typedef SMARTPOINTER<Integer> ptr; typedef const SMARTPOINTER<Integer> c_ptr; public: // default constructor Integer() : i_(0) {}; // constructor I...
#include "hotelwindow.h" #include <QApplication> #include "lde.h" #include "les.h" #include "no.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); HotelWindow w; w.show(); return a.exec(); }
// // Table.h // Project 4 // // Created by Hender Lin on 6/5/21. // #ifndef Table_h #define Table_h #include <string> #include <vector> #include <list> class Table { public: Table(std::string keyColumn, const std::vector<std::string>& columns); ~Table(); bool good() const; ...
#include "componentprovider.h" using namespace std; namespace sbg { template <int n> ComponentProvider<n>::ComponentProvider(Provider<Vector<n, double>> position, Provider<Vector<freedom(n), double>> orientation) : _orientation{move(orientation)}, _position{move(position)} {} template <int n> Vector <freedom(n), ...
// MIT License // Copyright (c) 2020 Marnix van den Berg <m.a.vdberg88@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 ri...
char* menu1[]={"Search&Destroy","Sabotage","Domination" }; char* menu2[]={"Game Config","Sound Config", "Mosfet Test", "Auto Test" }; char* GAME_TIME="Game Time:"; char* BOMB_TIME="Bomb Time:"; char* ZERO_MINUTES="00 minutes"; char* ARM_TIME="Arm Time:"; char* ZERO_SECS="00 seconds"; char* ...
/* * Academic License - for use in teaching, academic research, and meeting * course requirements at degree granting institutions only. Not for * government, commercial, or other organizational use. * File: rtwtypes.h * * MATLAB Coder version : 3.3 * C/C++ source code generated on : 24-Apr-2018 18:2...
#include "Task.h" #include <algorithm> #include <string> Task::Task() { // } Task::Task(int task_id, int period, int execution_time) : task_id(task_id), period(period) { // } double Task::utilization() const { if (period != 0) { return (double)execution_time / period; } return 0; } ...
#include <iostream> #include <cmath> using namespace std; int main() { int ws[5] = {3, 4, 1, 2, 3}; int ps[5] = {2, 3, 2, 3, 6}; int maxw = 10; // dp[x][y] ... x: x番目の価値, y: 重さ int dp[6][11]; int ret = 0; // 初期化 for (int i = 0; i <= maxw; i++) dp[0][i] = 0; for (int i = 0; i < 5...
#include "GameCmd.h" #include "CDLReactor.h" #include "Despatch.h" #include "HallHandler.h" #include "Logger.h" #include "Despatch.h" #include "PlayerManager.h" using namespace std; static InputPacket pPacket; //=================HallHandler========================= HallHandler::HallHandler() { uid = -1; } HallHandl...
/* Author: Puttichai Lertkultanon */ #ifndef SUPERBOT_SETUP_ #define SUPERBOT_SETUP_ #include <openrave-core.h> #include <openrave/openrave.h> #include <ompl/control/SimpleSetup.h> namespace ob = ompl::base; namespace oc = ompl::control; class SuperBotSetup : public oc::SimpleSetup { public: SuperBotSetup(Robo...
#include "ObjectManager.h" void ObjectManager::Exit() { }
// Copyright 2012 Yandex #include <cmath> #include <stdexcept> #include "logog/logog.h" #include "ltr/learners/decision_tree/classification_result.h" namespace ltr { ClassificationResult::ClassificationResult(int n) { INFO("Resizing probability_ vector to %d elements.", n); probability_.resize(n, 0.0); } Class...
#ifndef __HEAP_H__ #define __HEAP_H__ /* =============================================================================== Memory Management This is a replacement for the compiler heap code (i.e. "C" malloc() and free() calls). On average 2.5-3.0 times faster than MSVC malloc()/free(). Worst case performance is 1...
// Copyright 2018 The Chromium 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 "chrome/browser/chromeos/crostini/crostini_share_path.h" #include "base/bind.h" #include "base/files/file_path.h" #include "base/files/file_util....
/* ID: stevenh6 TASK: game1 LANG: C++ */ #include <fstream> #include <iostream> #include <string> #include <cstring> #include <vector> #include <algorithm> using namespace std; ofstream fout("game1.out"); ifstream fin("game1.in"); int sol[101][101]; vector<int> board; int solve(int i, int j) { if (i > j) { ...
/* * Copyright (c) 2016, The Regents of the University of California (Regents). * 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 a...
// Created on: 1993-06-11 // Created by: Jean-Louis FRENKEL // 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...
#pragma once namespace Reflection { namespace Meta { class Method {}; class Property {}; } }
/* -*- 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/widgets/OpPlugin...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/ecmascript.h" #include "modules/ecmascript/carakan/src/object/es_object.h" #include "modules/ecmascript/cara...
//==================================================================================== // @Title: BATTLE HUD //------------------------------------------------------------------------------------ // @Location: /game/battle/include/cBattleHud.h // @Author: Kevin Chen // @Rights: Copyright(c) 2011 Vis...
#pragma once #include <crtdbg.h> #include <math.h> #include <iostream> #include <vector> #include <algorithm> #include <map> #include <string> #include <fstream> using namespace std; const char* fileName = "lena256.raw"; const char* fileName_compressed = "lena256_compressed.raw"; const char* fileName_out = "lena256...
#include<cstdio> using namespace std; int main(){ //input int a_capacity,b_capacity; fscanf(stdin,"%d %d\n",&a_capacity,&b_capacity); int n; fscanf(stdin,"%d",&n); int a_shout[n+5]; int b_shout[n+5]; int a_sum[n+5]; int b_sum[n+5]; for(int i=0;i<n;++i){ fscanf(stdin,"%d...
// Ed Callaghan // Early waveform studies // April 2016 #include <iostream> #include <cmath> #include <stdio.h> #include <stdlib.h> #include "argParse.h" #include <TAxis.h> #include <TF1.h> #include <TFile.h> #include <TGraph.h> #include <TTree.h> #include <TProfile.h> using namespace std ; int wformA(char *fname...
#include <iostream> #include <queue> #include <deque> #include <algorithm> #include <string> #include <vector> #include <stack> #include <set> #include <map> #include <math.h> #include <string.h> #include <bitset> #include <cmath> using namespace std; int solution(vector<int> money) { int answer = 0; int N = ...
#define HAS_NRFS #ifndef __USE_FILE_OFFSET64 #define __USE_FILE_OFFSET64 #endif #include "mpi.h" #ifdef HAS_NRFS #include "nrfs.h" #endif #ifdef HAS_CEPH #include <cephfs/libcephfs.h> #endif #ifdef HAS_GLFS #include "api/glfs.h" #include "api/glfs-handles.h" #endif #include <stdio.h> #include <stdlib.h> #include <s...
#ifndef CONTINUOUS_TIME_UTILITIES_H #define CONTINUOUS_TIME_UTILITIES_H #include <vector> #include <list> #include <cassert> #include <iostream> #include "rpoly.h" struct Interval { Interval(double s, double e): m_s(s), m_e(e) {assert(m_s <= m_e);} double m_s, m_e; bool operator<(const Interval &othe...
#include <iostream> #include <fstream> #include <algorithm> #include <vector> using namespace std; ofstream ansFile; //Have to define globally to be able to use inside display function and main() void displayAnswer(vector<int> answer, int tcase){ ansFile<<"Case #"<<(tcase+1)<<": "; for(int i = 0; i < an...
#pragma once #include "neighbor.h" class BoneMapTreeNode { public: BoneMapTreeNode(); ~BoneMapTreeNode(); public: int depth; std::vector<BoneMapTreeNode*> children; BoneMapTreeNode *parent; public: int indexOfMesh; // leaf node std::map<int,int> boneMeshIdxMap; }; class BoneMapTree { public: BoneMapTree(...
template<typename T> struct hungarian { int n, m; vector<vector<T>> a; vector<T> u, v; vector<int> p, way; T inf; hungarian(int n_, int m_) : n(n_), m(m_), u(m+1), v(m+1), p(m+1), way(m+1) { a = vector<vector<T>>(n, vector<T>(m)); inf = numeric_limits<T>::max(); } pair<...
#include "stdafx.h" #include "TestBase.h" #include "TestError.h" TestError::TestError(TestBase *testBase, const string& msg) : m_testBase(testBase), m_errorMsg(msg) { m_testName = testBase->GetCurrentTest(); } string TestError::ToString() { string msg = string("Error in test ") + m_testName + string(" : ...
/************************************************************************* > File Name: mytime1.h > Author: JY.ZH > Mail: xw2016@mail.ustc.edu.cn > Created Time: 2018年07月19日 星期四 19时00分26秒 ************************************************************************/ #ifndef MYTIME0_H_ #define MYTIME0_H_ c...
// ---------------------------------------------------------------------------- // nexus | PmtR11410.cc // // Geometry of the Hamamatsu R11410 photomultiplier. // // The NEXT Collaboration // ---------------------------------------------------------------------------- #include "PmtR11410.h" #include "MaterialsList.h" ...
#include "Fingerprint.h" using namespace std; Fingerprint::Fingerprint(string fn, int s, int ww) { kgram = s; win_width = ww; unsigned char* buffer = new unsigned char[max_length]; FILE * fp = fopen(fn.c_str(), "rb"); //binary if (!fp) { fprintf(stderr, "Error when reading files\n"); exit(-1); ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Owner: Deepak Arora (deepaka) & Karianne Ekern (karie) */ #ifn...
#include<iostream> #include<vector> #include<string> using namespace std; class Solution { public: string countAndSay(int n) { vector<string> res; res.push_back("1"); int i, j, counter; //基本思想:循环29次,根据前一个序列值,遍历,得到下一个序列值,直到得到所有30个序列值,返回下标值对于序列值 for (i = 1; i < 30; i++) { //计算当前下标的序列值 string curent; ...
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <cstdlib> #include <random> using namespace std; int main() { setlocale(LC_ALL, "Russian"); //Добавление русского языка random_device rd; mt19937 mersenne(rd()); // инициализируем Вихрь Мерсенна случайным стартовым числом int i, j;...
#include <QCoreApplication> #include <robot.h> #include <mcl.h> #include <map.h> #include <iostream> #include <mainwindow.h> #include <unistd.h> using namespace std; int main(int argc, char *argv[]) { //--------- SETTINGS ----------- int sizeMap = 580; int amountPartic = 2000; int timeThread = 300; ...
//===- MBlazeCallingConv.td - Calling Conventions for MBlaze ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-----------------------------------------------------...
#include "pch.h" GateIocp* GateIocp::_Instance = nullptr; DWORD WINAPI GameThreadCallback(LPVOID parameter) { GateIocp* iocp = (GateIocp*)parameter; while (TRUE) { iocp->GameThreadCallback(); Sleep(1); } } DWORD WINAPI KeepThreadCallback(LPVOID parameter) { GateIocp *Owner = (GateIocp*)parameter; Owner...
class equip_garlic_bulb : FoodEdible { scope = 2; count = 1; displayName = $STR_ITEM_NAME_equip_garlic_bulb; descriptionShort = $STR_ITEM_DESC_equip_garlic_bulb; model = "\z\addons\dayz_communityassets\models\herb_garlic_bulb.p3d"; picture = "\z\addons\dayz_communityassets\pictures\equip_garlic_bulb_ca.paa"; bl...
#include "Game.h" #include "SnakeNode.h" void setDir(SnakeNode *node, int touchX, int touchY, int nodeX, int nodeY); bool nodeImpact(Node * node, Rect * edage); void setNodeLocation(SnakeNode * newNode, SnakeNode * preNode); Game::Game(void) { } Game::~Game(void) { } int Game::sepHeight = 0; int Game::sepWidth...
#pragma once #include <GL/glew.h> #include "Window.h" #include "Camera.h" class TPSCamera : public Camera { public: TPSCamera(float distance, float pitch, float rotation); void update(); float distance = 0, pitchTps = 0, rotation = 0; glm::vec3 center; private: float pitchSpeed = 0, rotationSpeed...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2009 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef JSON_SERIALIZER_H #define JSON_SERIALIZER_H class JSONSerial...
#include <iostream> using namespace std; class Mpg_log{ private: double last_odometer; double this_odometer; double this_gas; double initial_odometer; public: Mpg_log(double starting_odometer){ last_odometer = starting_odometer; } void gas(double initodometer) { initi...
#ifndef GerstnerWaveModel_H #define GerstnerWaveModel_H #include "GerstnerWave.h" #include "WaveModel.h" #include <vector> class GerstnerWaveModel : public WaveModel { private : std::vector<GerstnerWave> gerstnerWaveList; public: GerstnerWaveModel(); GerstnerWaveModel(const GerstnerWaveModel & gWM); voi...
// Created on: 1994-11-04 // Created by: Christian CAILLET // Copyright (c) 1994-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 ...
class PluginVersion { public: static void CreateVersionString(); static char VersionString[64]; private: static void AddVersion(char* FileName); };
// Created on: 1993-06-17 // Created by: Jean Yves LEBEY // 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...
#include "ZipDialog.h" ZipDialog::ZipDialog(wxWindow *parent) :wxDialog(parent, wxID_ANY, "Import Template ZipFile") { wxBoxSizer* dlgbox = new wxBoxSizer(wxVERTICAL); wxBoxSizer* dlgbox1 = new wxBoxSizer(wxHORIZONTAL); wxStaticText* pathtext = new wxStaticText(this, wxID_ANY, "Path: "); zip_path = new wxTextCt...
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 // 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) ///////...
// NOTE: this doesn't really test anything except that things compile #include "gtest/gtest.h" #include "opennwa/Nwa.hpp" #include "opennwa/nwa_pds/plusWpds.hpp" #include "Tests/unit-tests/Source/opennwa/fixtures.hpp" using namespace wali::wpds; namespace opennwa { namespace nwa_pds { TEST(op...
#ifndef TREEFACE_QUAT_H #define TREEFACE_QUAT_H #include "treeface/math/Vec4.h" #include <treecore/FloatUtils.h> namespace treeface { /** * Quaternions are frequently used in 3D rotation. */ template<typename T> struct Quat { typedef treecore::SimdObject<T, 4> DataType; typedef typename treecore::similar_f...