text
stringlengths
8
6.88M
// 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> #include <vector> #include <iterator> #include <algorithm> #include <list> #include <sequtils.h> using namespace std; int main(int argc, char *argv[]) { list<int> col; for (int i = 1; i <= 6; ++i) { col.push_front(i); col.push_back(i); } print_seq(col, "pre\t"); list<int>::itera...
#include "SLAM.hpp" using namespace std; using namespace cv; SLAM::LineFeature::LineFeature(const Mat_<imtype> & im, const CameraState & state, const Point2f & pt2d, int rx, int ry) :descriptor(im(Range(max(0, iround(pt2d.y-ry)), min(im.size().height, iround(pt2d.y+ry+1))), Range(max(0, iround(...
#include <iostream> #include <vector> #include <map> using namespace std; int m, res = 0; map< pair<int, int>, int> flagMap; bool isNotOver(vector< vector< pair<int, int> > > &inputVec) { int len = inputVec.size(); for(int i = 0; i < len; i++) { for(int j = 0; j < len; j++) { if...
//Convert Binary tree to doubly linked list - sorted //lowest will be the left most leaf //Get some basic objects to work with //BinaryTreeNode (value, ptr to left, ptr to right) //BinaryTreeNode* - pointer to root of tree usually //DLList (value, ptr back, ptr forward) //DLList* - pointer to first element of list /...
// Copyright 2012 Yandex #include "ltr/scorers/decision_tree_scorer.h"
#include "mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { qApp->installEventFilter(this); my_mainWidget = new QWidget(this); setCentralWidget(my_mainWidget); setWindowTitle("M580 IHM"); my_mainWidget->setStyleSheet("background-color: rgb(254, 245, 231)...
// Copyright 2017 Google Inc. All rights reserved. // // 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, ...
#ifndef _VERTEX_POSITION_H_ #define _VERTEX_POSITION_H_ #include "vertex.h" #include "spriteaiengine.h" class Position : VertexInterface { public: explicit Position(int, int, int); ~Position(); virtual int getx(); virtual int gety(); virtual int getz(); virtual void setx(int); virtual void sety(int)...
#include "myqpushbutton.h" MyQPushButton::MyQPushButton(const QString &text, QWidget * parent) : QPushButton(parent) { setText(text); connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked())); }
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <quic/api/test/Mocks.h> #include <folly/portability/GMock.h> #include <folly/portability/GTest.h> #include <quic/api/Q...
/* Problem: 1006 Author: Kevin Washington (@kevinwsbr) */ #include <iostream> #include <stdio.h> using namespace std; int main(){ float a, b, c; cin >> a; cin >> b; cin >> c; printf("MEDIA = %.1f\n", (a*2 + b*3 + c*5)/(2+3+5)); return 0; }
#pragma once #include "MovementComponent.h" #include "PhysicsComponent.h" #include "Input.h" #include "Model.h" class GameObject { protected: bool m_visible; bool m_collidable; bool m_isStatic; bool m_shouldDrawBB; bool m_useDeceleration; int m_wvpCBufferIndex; // Componenets MovementComponent* m_movementCo...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- * * 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. * */ #ifndef MDE_OPVIEW_H #define MDE_O...
// https://www.youtube.com/watch?v=eeSC43KQdVI&list=PL_dsdStdDXbrzGQUMh2sy6T8GcCCst3Nm #include <future> #include <initializer_list> #include <iostream> #include <thread> #include <vector> #include <windows.h> using namespace std; void ThreadFn(int &v1, int v2) { cout << "a thread function" << endl; cout << ...
#include<bits/stdc++.h> using namespace std; vector<deque<int> > pile; set<vector<deque<int> > > status; bool can[8]; int cnt=0; int ans=0; bool check(int x) { if(pile[x].size()<3) return false; int f1=pile[x].front(); pile[x].pop_front(); int f2=pile[x].front(); pile[x].pop...
#ifndef F3LIB_MOTION_H_ #define F3LIB_MOTION_H_ #include "Bone.h" #include "Skeleton.h" #include "f3lib/types/Matrix.h" #include <string> #include <vector> namespace f3 { class MotionAttribute { public: unsigned int m_attributes; int m_soundId; float m_frame; }; class Motion { pub...
#include<stdio.h> int main() { int t, a, b, c, max; scanf("%d",&t); for (int i = 1; i <=t; ++i) { scanf("%d%d%d",&a,&b,&c); if(a>=b && a>=c) max = a; else if(b>=a && b>=c) max = b; else if(c>=a && c>=b) max = c; if(max == a) { if(max<=(b+c)) pr...
#include <iostream> #include <vector> #include <fstream> #include <sstream> #include <iomanip> #include "PendingProcess.h" #include "Scheduler.cpp" vector<PendingProcess> readPendingProcessList(istream& in); using namespace std; int main() { int seconds = 0; int SIZE; ifstream in; in.op...
/* -*- Mode: c++; tab-width: 4; 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. * * Espen Sand */ #include "core/pch.h" #include "modules/display/color.h" #include "mo...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. */ #ifndef COCOA_FILECHOOSER_H #define COCOA_FILECHOOSER_H #include...
#include "pwm_class.h" #define PWM_CHANNEL 0 #include "pin.h" #include "bcm2835.h" // This controls the max range of the PWM signal #define RANGE 1024 PWM_CLASS::PWM_CLASS(int factor_umplere ,int frecventa) { this->frecventa=frecventa; this->factor_umplere=frecventa * factor_umplere/100; bcm2835_pwm_set_cl...
#include <iostream> #include <sstream> #include <vector> #include <list> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <unordered_map> #include <string> #include <cstdio> #include <cstring> #include <climits> using namespace std; struct student { string name, id; int grade; st...
// // Created by Tanguy on 28/11/2017. // #ifndef MEDIATORPROJECT_AGENT_HPP #define MEDIATORPROJECT_AGENT_HPP #include <memory> #include "IMediator.hpp" #include "MediatorPacket.hpp" class Agent { std::string name; std::shared_ptr<IMediator> mediator; public: Agent(std::string const& _name, std::shared...
/* -*- 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. */ #ifndef OP_TREE_VIEW_H #define OP_TREE_VIEW_H #include "modules/p...
#include <iostream> #include <vector> #include <map> using namespace std; typedef char EdgeData; class EdgeNode { public: int adjvex; EdgeData data; EdgeNode * next; EdgeNode(int adjvex, EdgeData data, EdgeNode * next) : adjvex(adjvex), data(data), next(next) { } EdgeNode() :next(NULL) { } }...
// 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...
#include "codestatisticswindow.h" #include <QApplication> #include <windows.h> #include "applanguage.h" #include <QTranslator> int main(int argc, char *argv[]) { QApplication app(argc, argv); CAppLanguage *phLanguage = new CAppLanguage(); QTranslator *pTrans = new QTranslator; pTrans->load( phLanguage...
/* * This is a C++ class: CsampleSpace * 描述样本空间 * 双色球有33个红球,16个蓝球,共49个 * 大乐透有35个红球,12个蓝球,共47个 * data file format: * xxxx yy yy yy .. yy : zz zz ## */ #ifndef CSAMPLESPACE_HPP_INCLUDED #define CSAMPLESPACE_HPP_INCLUDED #include "CbaseBall.hpp" #include "Cgame.hpp" #include <list> using namespace std; ...
// Created on: 1996-01-09 // Created by: Jacques GOUSSARD // 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 G...
#include <chuffed/core/sat.h> #include <chuffed/vars/int-var.h> #include <iostream> extern std::map<IntVar*, std::string> intVarString; // val -> (val-1)/2 IntVarLL::IntVarLL(const IntVar& other) : IntVar(other), ld(2), li(0), hi(1) { ld[0].var = 0; ld[0].val = min - 1; ld[0].prev = -1; ld[0].next = 1; ld[1].v...
#include <simplecpp> main_program{ int count; cout << "How many numbers: "; cin >> count; float num,maximum; cout << "Give the next number: "; cin >> maximum; repeat(count-1){ cout << "Give the next number: "; cin >> num; maximum = max(maximum,num); } cout << "Maximum i...
#pragma once #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> #include "configfile.h" #include "compute_steering.h" #include "predict_true.h" #include "particle.h" /*! Calculates the particles and their positions. Mostly calls other functions. @param[out] particles All particles ...
#ifndef __LOAM_LASER_ODOMETRY_H__ #define __LOAM_LASER_ODOMETRY_H__ #include <loam_velodyne/common.h> #include <loam_velodyne/build_transform.h> #include <loam_velodyne/scanRegistrationLib.h> #include <opencv/cv.h> #include <pcl/kdtree/kdtree_flann.h> class LaserOdometry { private: const float scanPeriod; float...
#include "DataBaseConnector.h" DataBaseConnector::DataBaseConnector(std::string companyName) : uri("mongodb://localhost:27017"), client(uri) { db = client[companyName]; } bool DataBaseConnector::userIsRegistered(std::string &login) { mongocxx::collection coll = db["users"]; if (coll.find_o...
#ifndef DESKTOP_TASK_QUEUE_H #define DESKTOP_TASK_QUEUE_H class OpTask { public: virtual ~OpTask() {} virtual void Execute() = 0; }; /** DesktopTaskQueue is a pi class that conceptually is an execution queue. Tasks added must be executed one after the * other, in the order given. UNDER NO CIRCUMSTANCE can tasks o...
#include <stdlib.h> #include <samplerate.h> #include <iostream> #include "pitchContour.h" using std::cout; using std::cin; using std::endl; JackClient::JackClient() : JackCpp::AudioIO("pitchContour", 1, 1) { start(); sample_rate = getSampleRate(); if (sample_rate != 48000){ cout << "sample rate must be ...
//Q 7 #include"stdio.h" #include"conio.h" void main() { clrscr(); int largest=0; int smallest=0; int A[5][5]={ 5, 2, 3, 6, 10, 7, 9, 8, 4, 15, 17, 29,38,44, 55, 37,119,98,34,215, 87, 90, 1,46,105}; int i, j; //for forLoop for(i=0; i<5; i++){ for(j=0; j<5; j++) if(A[i...
/* * Control_Module_Door_From_UART.cpp * * Created: 6/10/2015 1:11:03 PM * Author: Jimmy */ #define F_CPU 16000000L #include <avr/io.h> #include "MEGA88A_UART_LIBRARY.h" #include <util/delay.h> //Initializes an LED attached to Port B pin 0. void LED_Init() { DDRB |= (1<<DDB0); PORTB |= (1<<DDB0); } void LED...
/* * @Description: front end 任务管理, 放在类里使代码更清晰 * @Author: Ren Qian * @Date: 2020-02-10 08:38:42 */ #include "lidar_localization/mapping/front_end/front_end_flow.hpp" #include "glog/logging.h" #include "lidar_localization/global_defination/global_defination.h" namespace lidar_localization { FrontEndFlow::FrontEndFlo...
#pragma once #ifdef QP_SOLVER_SPARSE #include <Eigen/Sparse> #endif #include <Eigen/Dense> #include <limits> #include <vector> #define QP_SOLVER_PRINTING namespace qp_solver { /** Quadratic Problem * minimize 0.5 x' P x + q' x * subject to l <= A x <= u */ template <typename Scalar = double> struc...
#include <iostream> #include <vector> #include <fstream> #include <string> #include <cassert> using namespace std; class AdjMatrix{ private: int V; int E; int** adj; void isValidVertex(int v) const{ assert(v >= 0 && v < V); } public: AdjMatrix(string file):V(0), E(0), adj(nullptr){ ...
#ifndef CLIENT_VEHICLETABLEMODEL_HPP #define CLIENT_VEHICLETABLEMODEL_HPP #include "game/vehicle.hpp" #include "objecttablemodel.hpp" class VehicleTableModel : public ObjectTableModel<Game::Vehicle> { public: ObjectTableModel<Game::Vehicle>::Field name; ObjectTableModel<Game::Vehicle>::Field price; VehicleTab...
// Spline3Dlg.cpp : implementation file // #include "stdafx.h" #include "Interpolater.h" #include "Spline3Dlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSpline3Dlg d...
//: C03:Global2.cpp {O} // Kod zrodlowy pochodzacy z ksiazki // "Thinking in C++. Edycja polska" // (c) Bruce Eckel 2000 // Informacje o prawie autorskim znajduja sie w pliku Copyright.txt // Dostep do zewnetrznych zmiennych globalnych extern int globe; // (Odwolanie zostanie okreslone przez program laczacy) ...
/* -*- Mode: c++; tab-width: 4; 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. */ #include "core/pch.h" #if !defined(LIBGOGI_PLATFORM_IMPLEMENTS_OPBITMAP) && !defined(V...
#include "Plugin.h" using namespace studio; std::vector<PluginPtr> PluginManager::plugins; PluginPtr PluginManager::makePlugin(const std::string & dllPath) { auto p = std::make_shared<Plugin>(dllPath); plugins.push_back(p); return p; }
/** * AUTHOR: I M * * Date: 03/09/21 */ #include "doctest.h" #include "City.hpp" #include "Board.hpp" using namespace pandemic; #include <string> #include <algorithm> using namespace std; TEST_CASE("GOOD INPUT") { // CHECK_NOTHROW(bool temp); CHECK_NOTHROW(bool temp); CHECK_NOTH...
/* ============================= * | Name: Abhishek Mantha | * | Email: amantha@usc.edu | * | GitHub: abmantha | * | Date Submitted: 2/13/15 | * | HW 3 | * ============================== * * Filename: settest.cpp * * Test file for the setint.h and setint.cpp fi...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<algorithm> #include<cmath> using namespace std; struct point{ long long x,y; const point operator -(const point& rhs) { point ans; ans.x =...
/* leetcode 66 * * * */ #include <vector> #include <deque> #include <algorithm> using namespace std; class Solution { public: vector<int> plusOne(vector<int>& digits) { for (int i = digits.size() - 1; i >= 0; i--) { digits[i]++; digits[i] = digits[i] % 10; if (digits[i...
/* * Player - One Hell of a Robot Server * Copyright (C) 2000 Brian Gerkey & Kasper Stoy * gerkey@usc.edu kaspers@robotics.usc.edu * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published...
#include"Winsock.h" #include"windows.h" #include"stdio.h" #pragma comment(lib,"wsock32.lib") #define RECV_PORT 5012 #define MaxNum 10 //最大连接数 #define MaxLength 1024 //最大消息长度 DWORD ClientTread(void * PD); // SOCKET ServerSock; sockaddr_in ServerAddr; int Addrlen; HANDLE HdTread[MaxNum]; struct { char name[10]; c...
#include "selectWidget.h" #include "ui_selectWidget.h" selectWidget::selectWidget(QWidget *parent) : QWidget(parent), ui(new Ui::selectWidget) { ui->setupUi(this); connect(ui->allCBox, &QCheckBox::clicked, [this](bool checked){ checked ? selectAllChecked() : clearAllChecked(); });...
#include "core/pch.h" #if defined(USE_FREETYPE) && defined(FT_INTERNAL_FREETYPE) && defined(FT_USE_LZW_MODULE) extern "C" { #include "ftlzw.c" } #endif // USE_FREEYYPE && FT_INTERNAL_FREETYPE && FT_USE_LZW_MODULE
#include<bits/stdc++.h> using namespace std; int countMoves(int array[], int n); int main(){ int array[] = { 7, 8, 9 }; int len = 3; cout<<countMoves(array, len); return 0; } int countMoves(int array[], int n){ int letsmovee = 0; while (1){ int zeroes = 0; for (int i = 0; i < n; i++)...
#ifndef CHAT_PANEL_H #define CHAT_PANEL_H #if defined(M2_SUPPORT) && defined(IRC_SUPPORT) #include "adjunct/quick/panels/HotlistPanel.h" #include "modules/widgets/OpWidgetFactory.h" /*********************************************************************************** ** ** ChatPanel ** *****************************...
#include <iostream> #include <cstdlib> using namespace std; int ile; float mediana; void quicksort(float *tablica, int lewy, int prawy) { int v=tablica[(lewy+prawy)/2]; int i,j,x; i=lewy; j=prawy; do { while(tablica[i]<v) i++; while(tablica[j]>v) j--; if(i<=j) { ...
#pragma once #include "server.h" #include <string.h> #include <vector> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <arpa/inet.h> #include <iostream> using namespace std; class Worker { public: Worker(int in_client); ~Worker(); vector<string...
/* * Stopping Times * Copyright (C) Leonardo Marchetti 2011 <leonardomarchetti@gmail.com> */ #include "wrappedFunction1D.h" /* Class WrappedFunction1D has template methods. To see their implementation look at wrappedFunction1D.inl file. */ namespace StoppingTimes{ }
#include <iostream> void drawM(char** &arr, char simbol, int chap) { for(int i = 0; i < chap; ++i) { arr[i][0] = simbol; } for(int i = 0;i < chap; ++i) { arr[i][chap -1] = simbol; } if(0 != chap % 2) { for(int i = 1;i <= chap / 2; ++i) { arr[i][i] = simbol; } for(int i = 1;i <= chap / 2; ++i) { ar...
/* There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats very much. Last week, he won a scholarship and he wanted to share his pleasure with cats. So he bought some really t...
#include"Character.h" #include"TextPanel.h" #include"Potion.h" #include<cmath> #include<iostream> Character::Character(int x, int y, char display, std::string type, int hp, int atk, int def):Entity(x,y,display,type) { this->initHp = hp; this->hp = hp; this->atk = atk; this->def = def; this->curFloorAtkBoost = 0;...
#pragma once // Здесь представленно описание класса "Социальная сеть" и прототипы всех необходимых методов. #include "Group.h" #include "Member.h" class SocNetwork { public: SocNetwork(); ~SocNetwork(); void AddGroup(const Group &); // Метод "Добавление группы". void DeleteGroup(const Group &); // ...
/** * \copyright * (c) 2012 - 2015 E.S.R. Labs GmbH (http://www.esrlabs.com) * All rights reserved. */ #ifndef SLINKEDLIST_H_ #define SLINKEDLIST_H_ #include "util/SBaseTypes.h" #include "util/SIteratorBaseTypes.h" #include "util/CompileTimeConstraints.h" #include <cassert> template<typename T> class SLinkedList...
// GuessTheNumberGUI.cpp : Defines the entry point for the application. // #include "framework.h" #include "GuessTheNumberGUI.h" #include <string> #include <random> #define MAX_LOADSTRING 100 // Global Variables: HINSTANCE hInst; // current instance HWND hGTN; // "Guess The Nu...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<algorithm> #include<cmath> using namespace std; const double win[9][9] = { 0.50, 0.58, 0.59, 0.45, 0.56, 0.58,0.57,0.39,0.38, 0.42, 0.50, ...
#include "ManagerUtils/PlotUtils/interface/Common.hpp" #include "TriggerEfficiency/EfficiencyPlot/interface/EfficiencyPlot.h" #include "TEfficiency.h" #include <iostream> using namespace std; extern double ErrorProp(const double& x1, const double& m1, const double& x2,const double& m2) { double result = sqrt( (...
/*********************************************************\ * 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...
int sensor = 4; int ler; void setup() { Serial.begin(9600); pinMode(sensor, INPUT); } void loop() { ler = digitalRead(sensor); if (ler==1) Serial.println("Livre"); else Serial.println("Detectado"); delay(1000); }
/* nicole cranon <nicole.cranon@ucdenver.edu> csci 4640, fall 2015 assignment 6 - predicate generator */ #include "predictGenerator.h" #include "grammerAnalyzer.h" #include <iostream> #include <algorithm> int main (int argc, char *argv[]) { if (argc < 2) { std::cerr << "\nNot enough arguments provided!\n"; r...
/* * arrayStack.hpp * * Created on: 2017年3月21日 * Author: lcy */ #ifndef ARRAYSTACK_HPP_ #define ARRAYSTACK_HPP_ #include "Stack.hpp" template<typename T> class arrayStack : public stack<T> { public: arrayStack(int initialCapacity = 10); ~arrayStack() {delete [] stack;} bool empty() const {return stackTo...
( English:'French'; Native:'Français'; LangFile:'french.lang'; DicFile:'francais.dic'; FlagID:'fr'; Letters:'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z'; LetterCount:'9,2,2,3,15,2,2,2,8,1,1,5,3,6,6,2,1,6,6,6,6,2,1,1,1,1'; LetterValue:'1,3,3,2,1,4,2,4,1,8,10,1,2,1,1,3,8,1,1,1,1,4,10,10,10,10'; N...
#include "scoreboard.h" #include "game.h" extern Game* game; ScoreBoard::ScoreBoard(QObject* parent, int f, int s, int u, int t, int sc, int lv) { Q_UNUSED(parent) setRect(QRectF(0,0,400,400)); setBrush(Qt::darkBlue); QPen pen(Qt::green, 2); setPen(pen); finished_processes ...
#include "PointersManager.h" bool PointersManager::checkMouseInPointer(std::shared_ptr<Pointer> ptr, Position pos) { float x = ptr->getPosition().x - ptr->getSize().width/2; float y = ptr->getPosition().y - ptr->getSize().height / 2; if (x < pos.x && pos.x < x + ptr->getSize().width && y < pos.y && pos.y < y + ptr->...
// Created on: 1993-11-09 // Created by: Laurent BOURESCHE // 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 #include "Vectors.h" #include <windows.h> #include <gl\gl.h> #include <gl\glu.h> #include "Texgen.h" #include "includelist.h" #include "Splines.h" #include "ParticleEngine.h" #define aDDict_DEFAULTSHADE 0 #define aDDict_FLATSHADE 1 #define aDDict_GOURAUDSHADE 2 #define aDDict_SCALE 0 #define aDDict_ROTA...
#pragma once #include <iostream> #include <vector> #include <functional> namespace fsm { /** * @brief Class for state machine. * * @tparam Enum A enum class of states */ template <typename Enum> class state_machine { public: template<class F, class...Args> static auto guard(F&& f, Args&&... arg...
/* cheali-charger - open source firmware for a variety of LiPo chargers Copyright (C) 2013 Paweł Stawicki. All right reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, eit...
// Copyright (c) 2012-2017 The Cryptonote developers // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once #include "INode.h" #include <mutex> #include <condi...
#include "../logger.h" using std::cout; using std::endl; int main() { logger *l = new logger(); cout << "log threshold: " << l->threshold() << endl; l->debug("hello"); l->error("hello"); l->print("hello"); l->threshold(logger::dbg); cout << "log threshold: " << l->threshold() << endl; l->debug("h...
#include<bits/stdc++.h> using namespace std; int main() { string name1, name2; string choice1, choice2; int num1, num2, t, sum; cin>>t; while(t--) { cin>>name1>>choice1>>name2>>choice2>>num1>>num2; sum=num1+num2; if(sum%2==0) { if(choice1=="PAR") ...
#include "IMAGELoad.h" #include "Model.h" #include "PNGLoad.h" #include "BMPLoad.h" #include "DDSLoad.h" GLuint loadTex(const char* path) { int pathLen = strlen(path); char* imgExt = path + pathLen - 3; char bmp[3] = {'b', 'm', 'p'}; char png[3] = {'p', 'n', 'g'}; char dds[3] = {'d', 'd', 's'}; ...
// // CHttpClient.h // client // // Created by Sergey Proforov on 09.05.16. // Copyright (c) 2016 Proforov Inc. All rights reserved. // #ifndef __client__CHttpClient__ #define __client__CHttpClient__ #include <memory> #include "IConnection.h" #include "IService.h" //Класс для работы с HTTP севером class CHttpCli...
/* Copyright (c) 2013 Randy Gaul http://RandyGaul.net This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including com...
#ifndef GAMEOBJECT_H #define GAMEOBJECT_H #include <iostream> #include <SDL.h> class LoaderParams; class GameObject { public: virtual void draw() =0; virtual void update() =0; virtual void clean() =0; virtual void load(const LoaderParams* pParams) =0; protected: GameObject () {} virtual ~GameObject() {} }...
// // main.cpp // word-ladder-ii // // Created by xiedeping01 on 15/11/12. // Copyright (c) 2015年 xiedeping01. All rights reserved. // #include <iostream> #include <vector> #include <string> #include <unordered_map> #include <unordered_set> #include <queue> using namespace std; class Solution { public: vecto...
#include"pch.h" #include"Timer.h" using namespace std::chrono; Timer::Timer(const bool remember) { m_startTime = high_resolution_clock::now(); m_stopTime = high_resolution_clock::now(); m_isRunning = false; m_timeAdd = 0; m_remeber = remember; m_resumeValue = 0; } double Timer::timeElapsed() const { if (m_isRun...
#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 <cstdio> #include <cstdlib> #include <cstring> #include <numeric> #include <bits...
#ifndef FSS_H_ #define FSS_H_ #include "libdpf/libdpf.h" #include "typedef.h" class fss1bit { private: AES_KEY aes_key; public: fss1bit(); uint gen(unsigned long alpha, uint m, uchar *keys[2]); void eval_all(const uchar *key, uint m, uchar *out); void eval_all_with_perm(const uchar *key, uint m, ...
#pragma once #include "Tool.h" #include "AppColors.h" #include <vector> #include <SFML/Graphics.hpp> #include <imgui-SFML.h> #include <opencv2/imgproc/types_c.h> #include <opencv2/imgproc/imgproc_c.h> #include <opencv2/imgproc.hpp> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui_c.h> #include <openc...
#include <iostream> #include "term.h" #include "triangleTerm.h" #include "strings.h" bool Term::enableTypes[TermTypeCount] = { }; bool Term::fuzzificationTypes[TermTypeCount] = { }; bool Term::defuzzificationTypes[TermTypeCount] = { }; Term::Term(std::string name, TermType type, bool isIn) { this->name = name; ...
#include "Headers.h" bool compareRect(const Rect& r1, const Rect& r2) { if (r1.y < r2.y - r2.height) { return true; } return r1.x < r2.x; } bool compareRectX(const Rect& r1, const Rect& r2) { return r1.x < r2.x; }
/* Implementation and tests for normalize path.*/ #include "cc/shared/common.h" void normalize_path(char* buffer) { RT_ASSERT(buffer); // Process: overwrite in place using a read-head and write-head. char* write = buffer; for (char* read = buffer; read[0]; ++read) { // If the next 3 characters are not "/.....
class Solution { void Util(vector<string> &ans, string op, int o, int c, int n) { if(op.size() == 2*n) { ans.push_back(op); return; } if(o > 0) { op.push_back('('); Util(ans, op, o-1, c, n); op.pop_back(); } if(c > o) { op.push_back(')'); Util(an...
#include "Sound.h" #include "stb_vorbis.h" #include <vector> //!The ALSound class. This controlls the API individual sounds struct ALSound { ALSound() { alGenBuffers(1, &bufferId); } ~ALSound() { alDeleteBuffers(1, &bufferId); } //!The function loads the sound interacts with the API void Load(std::strin...
// RekeningGiro.h #ifndef REKENINGGIRO_H #define REKENINGGIRO_H #include "Rekening.h" // include the Account header file class RekeningGiro : public Rekening { public: // Konstruktor menginisialisi saldo (parameter 1) dan suku bunga (parameter 2) // Set suku bunga 0.0 apabila suku bunga bernilai negatif RekeningGi...
#ifndef CAR_H #define CAR_H #include <iostream> #define MAX_AC 4 #define MIN_AC 0 #define MAX_GEAR 6 #define MIN_GEAR 1 using namespace std; enum Fuel {premium, pertamax, solar}; class Car { private: Fuel fuel; int gear; int ac_power; bool on; public: // Ctor // Menginisiasi jenis fuel dengan t_fuel,...
#ifndef MRJR_CHECKER #include <iostream> #include <string> #include <fstream> using namespace std; class checker { public: // Takes in a filestream, checks for errors, and returns a bool for the error/lack thereof static bool cycle(ifstream& currentStream); private: // Takes in a character and tells if i...
#include <Drawables/Drawable.h> CDrawable::CDrawable(GLenum drawMode, GLsizei elementsCount) : _drawMode(drawMode) , _elementsCount(elementsCount) { } void CDrawable::updateVertices(GLsizeiptr size, const void *data, GLenum drawType) { _vao.bind(); _vbo.bind(); _vbo.updateData(size, data, drawTy...