text stringlengths 8 6.88M |
|---|
// Created on: 1998-05-05
// Created by: Stepan MISHIN
// Copyright (c) 1998-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 ... |
#include <iostream>
using namespace std;
int main(){
int sum = 0, n;
cin >> n;
for (int i=1; i<n; i++){
for (int j=1; j<=i; j++)
sum += j;
}
cout << sum;
return 0;
}
|
#include <QtTest>
#include "test_entity_code.h"
#include "test_data_facade.h"
using namespace qi::config::qt;
using namespace qi;
const QString CICI::FILENAME = "cici";
const QString TestDB::FOLDERNAME="qi/app/im";
const QString TestDB::FILENAME = "test_db";
const QString CICI::FOLDERNAME="qi/app/im";
class core : pu... |
#pragma once
#include "bricks/core/object.h"
#include "bricks/core/returnpointer.h"
#include "bricks/core/exception.h"
namespace Bricks {
template<typename T> class Delegate;
}
namespace Bricks { namespace Collections {
namespace Internal {
class IteratorBase { };
class IterableBase { };
class IterableFastBa... |
#include "Instructions.h"
#include "llvm/ADT/Twine.h"
#include "InstrTypes.h"
#include "Instruction.h"
#include "llvm/ADT/ArrayRef.h"
#include "CallingConv.h"
#include "Attributes.h"
#include "llvm/ADT/SmallVector.h"
#include "Type.h"
#include "Value.h"
#include "Instruction.h"
#include "BasicBlock.h"
#include "Derived... |
/* -*- 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
*/
#ifndef LIBSSL_CHCIPHER_H
#define LIBSSL_CH... |
// Programmable-Air
// Author: tinkrmind
// https://github.com/orgs/Programmable-Air
//
// Factory Image
//
// PCB v1.0
#define BOARD_VER 6
#include "programmable_air.h"
#include <Adafruit_NeoPixel.h>
#include "EEPROMAnything.h"
Adafruit_NeoPixel paPixels(3, 12, NEO_GRB + NEO_KHZ800);
#define DEBUG 1
i... |
#pragma once
#include <YouMeCommon/CrossPlatformDefine/PlatformDef.h>
#include <memory>
#include <YouMeCommon/XAny.h>
#include <YouMeCommon/XSharedArray.h>
namespace youmecommon {
enum VariantType
{
VariantType_Unknow,
VariantType_String,
VariantType_Byte,
VariantType_INT16,
VariantType_INT32,
Var... |
#include "Camera.h"
#include <cmath>
using Mat4D::CVector4D;
using Mat4D::CMatrix4D;
Camera::Camera() :
m_fPitch{ 0 },
m_fYaw{ 0 },
m_fRoll{ 0 },
m_fOffset{ 1000.f },
m_fUpLock{ 3.141592f * 0.35f },
m_fDownLock{ -3.141592f * 0.35f }
{
}
Camera::Camera( const CVector4D & Position, const CVector4D & Up, float f... |
#include <ionir/passes/pass.h>
namespace ionir {
StoreInst::StoreInst(const StoreInstOpts &opts) :
Inst(opts.parent, InstKind::Store),
value(opts.value),
target(opts.target) {
//
}
void StoreInst::accept(Pass &visitor) {
visitor.visitStoreInst(this->dynamicCast<Stor... |
#ifndef SHADER_H
#define SHADER_H
#include <Common.h>
class CShader
{
public:
CShader(GLenum type, const std::string &source);
~CShader();
GLuint getId() const
{
return _id;
}
private:
GLuint _id;
void compile(const std::string &source);
void check(GLenum status);
};
#endif... |
#include <iostream>
#include <algorithm>
#include <fstream>
using namespace std;
const int mmax = 256;
ifstream fi("INPUT.INP");
ofstream fo("OUTPUT.OUT");
int n, m;
int dd[mmax];
void set(){
fi >> n >> m;
int x, i;
for(i = 0; i < n; i++){
fi >> x;
dd[x]++;
}
fo... |
#include <iostream>
// sse vec
#include <xmmintrin.h>
constexpr int size = 4 * 1000 * 1000 * 100;
void simple_loop(float *arr, float a, float b) {
std::cout << "simple" << std::endl;
for (int i=0; i<size; i++)
arr[i] = arr[i] * a + b;
}
void simple_loop_with_intrinsics(float *arr, float a, float b)... |
#include "stdafx.h"
#include <string>
#include "../ToAiEditModeButton.h"
#include "DungeonGame.h"
#include "DungeonSelect.h"
#include "../Title/ModeSelect.h"
#include "../Fade/Fade.h"
#include "../GameData.h"
#include "../GameCursor.h"
#include "../Title/SuperMonsterSelect.h"
#include "../StageSetup/StageSetup.h"
#incl... |
#include <QApplication>
#include "game.h"
#include "mainmenu.h"
#include "loginscreen.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
LoginScreen* l = new LoginScreen;
l->show();
return a.exec();
}
|
#ifndef GAMECONTROLLER_H
#define GAMECONTROLLER_H
#include <QGraphicsPixmapItem>
#include <QObject>
#include <QGraphicsItem>
#include<QTimer>
#include<QGraphicsView>
#include"Endmenu.h"
#include"Play.h"
#include "startmenuer.h"
#include <QMediaPlayer>
class Gamecontroller : public QObject
{
Q_O... |
#include <iostream>
#include "lexer.h"
#include "tests.h"
int main () {
unit_test_1();
unit_test_2();
unit_test_3();
unit_test_4();
unit_test_5();
unit_test_6();
unit_test_8();
unit_test_9();
unit_test_10();
//unit_test_7();
test();
return 0;
} |
#pragma once
#include <opencv2/opencv.hpp>
#include <iostream>
#include <math.h>
#include<string>
using namespace cv;
using namespace std;
//@breif generate code
//@author shitaotao
class QRCodeDrawer
{
private:
string data;
int currentX;//当前所需绘制矩形左上角的x坐标
int currentY;//当前所需绘制矩形左上角的y坐标
int code_pixel_col;//二维码横向像素... |
#ifndef COMLIB_H
#define COMLIB_H
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <Windows.h>
enum MSG_TYPE { NORMAL, DUMMY};
enum TYPE { PRODUCER, CONSUMER };
struct Header
{
MSG_TYPE type;
size_t length;
};
class ComLib
{
private:
HANDLE hFileMap;
void* mData;
boo... |
#include<bits/stdc++.h>
#define mod 1000000007
typedef long long ll;
using namespace std;
struct matrix{
ll a[2][2];
matrix(){
memset(a,0,sizeof(a));
}
matrix(int x){
memset(a,0,sizeof(a));
for(int i=0;i<2;i++)
a[i][i]=1;
}
ll sum(){
ll ret=0;
... |
/*----------------------------------------------------------------------------*
** sets.cpp : class definitions for set operations using bit representations.
**
** Stephen R. Schmitt
** Nettoyage et mis en c++ pure : Thibault Francois
*/
#include "sets.h"
#include <string>
#include <iostream>
#include... |
auto& pc = Serial; // the USB
auto& xdev = Serial2; // external device
#if 1
#define BAUD 115200
#else
#define BAUD 9600
#endif
void setup() {
pc.begin(BAUD);
xdev.begin(BAUD);
}
void loop() {
if(pc.available()) { xdev.print((char) pc.read()); }
if(xdev.available()) { pc.print((char) xdev.read()); }
}
|
#ifndef CUSTOMIZECORE_H
#define CUSTOMIZECORE_H
#include <QObject>
#include <QString>
#include <QStringList>
#include "appconfig.h"
#include "models/currency.h"
#include "models/user.h"
/**
* @brief The CustomizeCore class
*
* Provides functionality for customization state
*/
class CustomizeCore : public QObject
... |
#ifndef _TESTE_
#define _TESTE_
template <typename FP>
class Teste
{
public:
void bla(FP x);
void bla2(FP x);
protected:
private:
};
#endif
|
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>... |
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
using namespace std;
/*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/
#define int long long
#define ld long double
#define F first
#define S second
#define P pair ... |
#include "NameIndex.h"
NameIndex::NameIndex() : numCollisions(0),size(0),rehash(0),c(1024),maxProbe(0){
buckets.resize(c);
status.resize(c);
}
NameIndex::~NameIndex() {}
void NameIndex::expandAndRehash(){
c = 2*c;
vector<string> biggerBuckets(c);
vector<BucketStatus> biggerStatus(c);
bigger... |
#include <ros/ros.h>
#include <stdio.h>
#include <stdlib.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/video/tracking.hpp>
#include <PerFoRoControl/... |
/*
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... |
#ifndef PLOTVIEW_H
#define PLOTVIEW_H
#include "viewwidget.h"
#include "qcustomplot.h"
class PlotView : public ViewWidget
{
public:
/// Constructor
PlotView(Manager*,QWidget* =0);
~PlotView();
protected:
/// Initialise the GL scene
void initializeGL();
/// Paint the GL scene
void paintGL... |
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "MockIOUtils.h"
#include <string>
#include <vector>
using std::string;
using std::vector;
using ::testing::Return;
using ::testing::Invoke;
using ::testing::ElementsAre;
using ::testing::UnorderedElementsAre;
using ::testing::NiceMock;
using ::testing::Stric... |
//
// Created by arnoul_r on 21/01/17.
//
#ifndef GGJ17_PHYSICSENGINE_HH
#define GGJ17_PHYSICSENGINE_HH
static const float SCALE = 30.f;
#include <Box2D/Box2D.h>
#include <vector>
class PhysicsEngine {
public:
b2World *world;
float refreshFrequency;
public:
PhysicsEngine(float, float);
... |
//
// Created by arnito on 21/04/17.
//
#ifndef BEAT_THE_BEAT_GAMEOBJECT_H
#define BEAT_THE_BEAT_GAMEOBJECT_H
#include "Utils.h"
#include "Inputs.h"
class GameObject : public sf::Drawable {
virtual void event(const sf::Event& event);
virtual void update(const sf::Time& deltatime);
virtual void draw(sf::RenderTarg... |
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void Generate_Letter(string letter[],int num_lines,string thisname)
{
unsigned long max,pos;
max=letter[0].max_size();
for(int n=0;n<num_lines;n++)
{
if((pos=letter[n].find("CUSTOMER",0))<max)
{
letter[n].repl... |
#ifndef ACOROSS_RPC_SOCKET_H_
#define ACOROSS_RPC_SOCKET_H_
#include <SDKDDKVer.h>
#include <boost/asio.hpp>
#include <memory>
#include <deque>
#include <atomic>
#include "rpc_packet.h"
namespace acoross {
namespace rpc {
using boost::asio::ip::tcp;
class RpcSocket
: public std::enable_shared_from_this<RpcSocket>... |
// Copyright 2011 Yandex
#ifndef LTR_DATA_UTILITY_PARSERS_PARSE_ARFF_H_
#define LTR_DATA_UTILITY_PARSERS_PARSE_ARFF_H_
#include <boost/spirit/include/classic_parser.hpp>
#include <vector>
#include <map>
#include <string>
#include <set>
#include "ltr/data/utility/parsers/parser.h"
using boost::spirit::classic::pars... |
String AT_Command;
String Esp_SSID = "Nucleo_ArGe"; //Enter SSID
String Esp_Password = "NucleoArGe123654"; //Enter Password
String Esp_Mode="1";
String TCP_USP_ID=""; //
//
int initial()
{
Test_Module();
delay(500);
Restart_Module();
delay(500);
// Firmware_Version();
// Deep_Sleep();
// Control_Echo(... |
#include <cerrno>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <iostream>
#include <utility>
// #define DUMP_ONLY
#include <chuffed/branching/branching.h>
#include <chuffed/core/engine.h>
#include <chuffed/core/propagator.h>
#include <chuffed/globals/mddglobals.h>
#include <chuffed/support/ParseUti... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// You have a deck that contains R red and B black cards.
//
//
//
// You are playing the following game: You shuffle the deck,
// and then begin dealing the cards one by one.
// For each red card you flip you get a dollar, and for each
// black card you flip you have to ... |
#ifndef CIRCULARLIST_H
#define CIRCULARLIST_H
#define NULL 0
#include "textdisp.h"
//Basic List Node Class
template <typename T>
class CDLLNode
{
T m_nodeData;
CDLLNode<T>* m_prevNode;
CDLLNode<T>* m_nextNode;
public:
CDLLNode(T nodeData) :
m_nodeData(nodeData),
m_prevNode(NULL),
m_nextNode(N... |
#include "mainwindow.h"
#include "init.h"
#include "ui_mainwindow.h"
#include <QCoreApplication>
#include <QScrollArea>
#include <QMessageBox>
#include <QString>
#include <QSpacerItem>
#include <qdebug>
#include <iostream>
using namespace std;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new... |
#pragma once
#include "llvm/GVMaterializer.h"
namespace LLVM
{
ref class GlobalValue;
ref class Module;
public ref class GVMaterializer
{
internal:
llvm::GVMaterializer *base;
protected:
GVMaterializer(llvm::GVMaterializer *base);
internal:
static inline GVMaterializer ^_wrap(llvm::GVMaterializer *base);
publi... |
/* -*- 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
**
*/
#ifndef __SSLALERT_BASE_H
#define __SS... |
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <algorithm>
using namespace std;
//Structure required for sorting according to the first element in the lines.
//Gives the comparison rule for the std::sort algorithm.
struct FirstColumnCmp
{
bool operator()(cons... |
;*******************************************************************************
; Filename: PrtTab.asm
; Description: This runtine is involved by lsACPI.asm
; Print RSDP, RSDT ... tables.
;*******************************************************************************
assume cs:code
code segment
;*******... |
//
// Test.h
// zone/ambientLightInheritence
//
// Created by Nissim Hadar on 2 Nov 2017.
// Copyright 2013 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_test_h
#define hifi_test... |
// kumaran_14
// #include <boost/multiprecision/cpp_int.hpp>
// using boost::multiprecision::cpp_int;
#include <bits/stdc++.h>
using namespace std;
// ¯\_(ツ)_/¯
#define f first
#define s second
#define p push
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end... |
// a1_q1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
// Assignment 1 : Question 1
// Weight types: 125 lb, 75 lb, 42 lb, 15 lb, and 1 lb
// Base Object Weight : 2048 lb
// First find the quotient of the object weight divided by the largest weight type. Take this quot... |
/*
Author: Manish Kumar
Username: manicodebits
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589
#define MOD 1000000007
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(0)
#define deb(x) cout<<"[ "<<#x<<" = "<<x<<"] "
void solve(){
int n;cin>>n;
... |
#pragma once
#include <dijkstrasSearch.h>
Pathfinding::Node* FindClosestNode(float posX, float posY, std::vector<Pathfinding::Node*> _map);
|
/********************************************************************************
** Form generated from reading UI file 'firstlevel.ui'
**
** Created by: Qt User Interface Compiler version 5.13.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
*********************************... |
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int beautifulDays(int i, int j, int k) {
int reminder,rev,temp,val,c=0;
//printf("%d %d %d\n",i,j,k);
for(val=i;val<=j;val++)
{
rev=0;
temp=val;
wh... |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
UGV TRACKING AND FOLLOWING MANEUVER
*/
/////////////////////////////////////////////////////////////////////////////////////////////////////////////... |
#include "Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40319)
#error "Mixed versions compilation."
#endif
/**
* Firebase TCP Client v1.2.7
*
* Created July 10, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, free of c... |
//
// Created by cirkul on 27.11.2020.
//
#include "Herbivorous.h"
Animal *Herbivorous::spawn(Playground &pg, int i, int j) {
Herbivorous *newAnimal = new Herbivorous(pg, i, j);
++newAnimal->home->creatureCount;
newAnimal->pg->newCreatures[newAnimal] = 1;
newAnimal->pg->allAnimals.push_back(newAnimal)... |
#include <cassert>
/// In "frontend/util/"
#include <std_code.h>
#include <namespace.h>
#include <frontend/langapi/language_util.h>
#include "expression.h"
const std::string Type::id_string() const
{ return _type.id_string();}
bool Type::is_boolean_number() const
{ return _type.id()==ID_bool;}
bool Type::is_integr... |
#include <iostream>
class Cuenta
{
public:
void setX(int valor)
{
x = valor;
}
void imprimir()
{
std::cout << x << std::endl;
}
private:
int x;
};
int main()
{
Cuenta contador;
Cuenta *contadorPtr = &contador;
Cuenta &contadorRef = contador;
std::cout... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) 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 MEDIA_TIME_RANGES_H
#define MEDIA... |
#include "lights.h"
|
// **************************************
// File: KFontManager.h
// Copyright: Copyright(C) 2013-2017 Wuhan KOTEI Informatics Co., Ltd. All rights reserved.
// Website: http://www.nuiengine.com
// Description: This code is part of NUI Engine (NUI Graphics Lib)
// Comments:
// Rev: 2
// Cr... |
// Created on: 1992-10-14
// Created by: Christophe MARION
// 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 ... |
//Convert a region structure to string
string region_to_str(Region region)
{
//Initialize the output string
string str = "";
//Add the chromosome
str = str + region.chromosome + ":";
//Add the start and end positions
str = str + to_string(region.start) + "-" + to_string(region.end);
//Return the string... |
// Created on: 1993-04-30
// Created by: Yves FRICAUD
// 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 L... |
/*
* Copyright 2020 OmniSci, Inc.
*
* 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 t... |
/* XMRig
* Copyright (c) 2014-2019 heapwolf <https://github.com/heapwolf>
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it ... |
//
// $Id$
//
// Copyright (C) 1995-2002 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
#ifndef AUTODELETE_H
#define AUTODELETE_H
#include "adjunct/m2/src/glue/mh.h"
#include "adjunct/desktop_util/adt/opqueue.h"
#if... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 1000;
int G[maxn][maxn];
int d[maxn];
int n;
int dp(int i) {
if (d[i] > 0) return d[i];
d[i] = 1;
for (int j = 1; j <= n; ++j) if (G[i][j]) {
d[i] = max(d[i], dp[j] + 1);
}
return d[i];
}
void print_ans(int i) {
... |
#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<stdlib.h>
using namespace std;
class Date
{
public:
Date(int year = 2018, int month = 06, int day = 11)
:_year(year)
, _month(month)
, _day(day)
{}
Date(const Date& d)
:_year(d._year)
, _month(d._month)
, _day(d._day)
{}
//调整日期
Date& Adjust... |
/*
* Copyright (c) 2017-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
// Copyright (c) 2009 Alexander Stepanov and Paul McJones
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without
// fee, provided that the above copyright notic... |
#ifndef BST_HPP
#define BST_HPP
#include <vector>
#include <iostream>
#include <algorithm>
#include <stack>
// node structure for tree
template<typename T>
struct node {
// key data and other node pointers
T data;
node * parent, * left_child, * right_child;
// default constructor, inits all pointers... |
#include "shadow_mapping_entity_renderer.h"
#include "shadow_mapping_shader.h"
#include <terrain/terrain.h>
#include <entities/entity.h>
#include <utils/maths.h>
namespace sloth {
void ShadowMapEntityRenderer::render(const MapedEntities & entities, const MapedEntities & normalMappingEntities, const std::list<std::sh... |
#include "ofApp.h"
// ---------------------------------------------------------------------------------------------------------------------------------------------------
//
void ofApp::setup()
{
isServer = false;
fontSmall.loadFont("Fonts/DIN.otf", 8 );
ofSeedRandom();
int uniqueID = ofRandom( 999999999 ); ... |
#include<iostream>
#include<stdlib.h>
using namespace std;
class stack
{
public:
int stk[20],rear,tos,size;
stack()
{
tos=-1;
rear=-1;
cout<<"Enter size\n";
cin>>size;
}
void enque(int x)
{
if(tos==size-1)
{
cout<<"Queue overflow\n";
}
else if(tos==-1)
{
stk[++tos]=x;
cou... |
// Created on: 1996-12-05
// Created by: Jean-Pierre COMBE/Odile Olivier
// 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... |
#pragma once
#include "GlobalHeader.h" // fa::String, fa::OStream
#include <boost/operators.hpp> // boost::totally_ordered
#include "Utils.h" // fa::Id
namespace fa {
class NoteImpl final : private boost::totally_ordered<NoteImpl> {
public:
using this_type = NoteImpl;
using value_type ... |
/*
* @Description:
* @Author: Ren Qian
* @Date: 2020-03-01 18:07:42
*/
#include "lidar_localization/models/graph_optimizer/g2o/g2o_graph_optimizer.hpp"
#include "glog/logging.h"
#include "lidar_localization/tools/tic_toc.hpp"
namespace lidar_localization {
G2oGraphOptimizer::G2oGraphOptimizer(const std::string &... |
/*
* doChuChu.cpp
*
* Created on: Feb 7, 2014
* Author: Pooja
*/
#include<iostream>
int main () {
std::cout<<"hello";
//return 0;
}
|
#include "Debug.h"
#include "SpriteEntity.h"
#include "Graphics.h"
#include "Util.h"
#include <vector>
using namespace NoHope;
SpriteEntity::SpriteEntity(int x, int y, int width, int height, Texture* texture, Shader *shader):
_shader(shader),
_texture(texture)
{
init(x, y, width, height, Color(1.0f, 1.0f, 1.0f, 1... |
#include "utils.hpp"
#include "spine_ptts.hpp"
namespace nora {
namespace config {
spine_limit_ptts& spine_limit_ptts_instance() {
static spine_limit_ptts inst;
return inst;
}
void spine_limit_ptts_set_funcs() {
... |
#define ANKERL_NANOBENCH_IMPLEMENT
#include "nanobench.h"
#include "ut.hpp"
#if defined(__MACH__)
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <random>
#include <iostream>
using namespace boost::ut;
void create_array(int n, double& d) {
double nums[n];
d = nums[n-1];
}
void create_array_2(int... |
#include <iostream>
#include <stdlib.h>
#include <conio.h>
#include <string>
#include <vector>
#include <TxCoord.h>
#include <time.h>
#include <windows.h>
using namespace std;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD Written;
class Snake {
int snakeSize ;
vector <COORD> position;
public:
Snake()
{
... |
#include <queue>
#include <set>
using namespace std;
template <class T>
void time_leak::ElementUniqueFifo<T>::Push(T t)
{
if (this->Set.find(t) == this->Set.end())
{
this->Queue.push(t);
this->Set.insert(t);
}
}
template <class T>
T time_leak::ElementUniqueFifo<T>::Pop()
{
T t = this... |
#include "stdafx.h"
#include "GetConsoleInput.h"
using namespace std;
std::string pure::getConsoleInputstr(const std::string & message)
{
string response;
cout << message << ": ";
cin >> response;
return response;
}
bool pure::getConsoleInputb(const std::string & message, const std::string & errorMessage)
{
str... |
#include "OpenGL/OpenGLVertexArray.h"
#include <glad/glad.h>
using namespace Rocket;
static GLenum ShaderDataTypeToOpenGLBaseType(ShaderDataType type)
{
switch (type)
{
case ShaderDataType::Float: return GL_FLOAT;
case ShaderDataType::Vec2f: return GL_FLOAT;
case ShaderDataType::Vec3f: return GL_FLOAT;
case Sh... |
//////////////////////////////////////////////////////////////////////////////////////////////////////
///////// //////// ///////// //////// // // ////////// //// // ///////
// // // // // // // // // // // // // // \\
// ////... |
#include <iostream>
#include <queue>
#include <vector>
#include <cstring>
bool visited[100001];
int trace[100001];
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
std::memset(trace, -1, sizeof(trace));
int n, k;
std::queue<std::pair<int, int>> q;
std::cin >> n >> k;
q.pus... |
#include "SnakeGame.h"
int main()
{
snake.Print();
system("cls");
snake.load();
snake.length=5;
head.x=25;
head.y=20;
head.direction=RIGHT;
snake.Boarder();
snake.Food(); //to generate food coordinates initially
snake.life=3; //number of extra lives
bend[0]= h... |
// 阴阳师合成高星式神
#include <iostream>
using namespace std;
unsigned long long int getNum(unsigned long int num) {
unsigned long long int sum = 0;
if (num == 2) {
return 1;
} else {
return sum + num * getNum(num - 1);
}
}
unsigned long long int getRes (unsigned long int num) {
unsigned long long int res... |
#ifndef GEOMETRY_HPP
#define GEOMETRY_HPP
#include <QJsonDocument>
#include <string>
#include <vector>
enum Type {sphere, plane, none};
struct Point
{
double x;
double y;
double z;
};
double dotProduct(Point p1, Point p2);
Point subPts(Point p1, Point p2);
Point multPt(Point p, double factor);
Point addPts(Po... |
#include<stdio.h>
#include<stdlib.h>
//这里创建一个结构体用来表示链表的结点类型
struct node
{
int data;
struct node *next;
};
int main()
{
struct node *head, *p, *q, *t;
int i, n ,a;
scanf("%d", &n);
head = NULL; //头指针初始为空
for(i = 1; i <= n; i++)
{
scanf("%d", &a);
//动态申请一个空间,用来存放一个结点,并用临时指针p指向这个结点
p = (struct node *)malloc... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef _GDCMIO_DICOMCODEDATTRIBUTE_HPP_
#define _GDCMIO_DICOMCODEDATTRIBU... |
#include "Input.h"
#include "Map.h"
#include "CoinManager.h"
#include "Player.h"
#include <time.h>
#include <stdlib.h>
#include <iostream>
int main(void) {
srand(time(nullptr));
int difficulty;
int scoreToWin = 80;
clock_t start;
do {
std::cout << " ---------------" << std::endl;
std::cout << "... |
// Created on: 1997-08-01
// Created by: Jean-Louis Frenkel
// 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... |
#include<iostream>
//#include<stdio.h>
using namespace std;
class A
{
public:
int a;
static int x;
// void show()
// {
// cout<<"a= "<<a<<endl;
// cout<<"x= "<<x<<endl;
// }
};
int A::x=1;
int main()
{
int i=10,j=20;
int &r=i;
int *ptr=&i;
cout<<"r= "<<r;
cout<<"\n&r= "<<&r;
cout<<"\n&i= "<<&i... |
#include<cstdio>
#include<iostream>
using namespace std;
int n;
int b[1000];//储存每个字母的数组位置
struct node
{
char data;//数据
char lc,rc;//儿子
}a[30];
void q(int i)
{
if(a[i].data && i<=n)//不为空
{
printf("%c",a[i].data);//先输出根
if(a[i].lc!='*')//若他有左儿子
q(b[a[i].lc]);//继续前序遍历
if(a[i... |
/*
Dispenser
This sketch controls the dispensers in Robie's vending machine.
Author: Andy Tracy <adtme11@gmail.com>
*/
const int d1p_pin = 2; // Dispenser 1 positive
const int d1n_pin = 3; // Dispenser 1 negative
const int d2p_pin = 4; // Dispenser 2 positive
const int d2n_pin = 5; // Dispenser 2 negative
voi... |
#include <iostream>
#include "maze.hpp"
using namespace std;
int main() {
vector<vector<int>> maze = mkMaze(10);
for (auto x : maze) {
for (auto y : x) {
cout << (y == 1? " " : (y == 3? "==" : "██")); // esto -> ██ deben ser bloques
}
cout << endl;
}
// you should see a beautiful maze
return 0;
}
|
int segmentid, i, j;
cv::Mat labels;
seeds->getLabels(labels);
cv::Mat segment[seeds->getNumberOfSuperpixels()];
for (i = 0; i < seeds->getNumberOfSuperpixels(); i++) {
segment[i] = cv::Mat::zeros(height, width, cv_left_ptr->image.type());
}
for (i = 0; i < height; i++) {
f... |
#include <DigitalPin.h> // from BasicLibrary
DigitalPin forward(13, true);
DigitalPin backward(12, true);
DigitalPin right(7, true);
DigitalPin left(8, true);
void setup(){
Serial.begin(9600);
}
void loop() {
if (Serial.available()) {
int val = int(Serial.read()) - int('0');
if (val == 0) {
backwa... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2011 Opera Software ASA. 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"
#include "module... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.