text stringlengths 8 6.88M |
|---|
// file : liblava/base/memory.hpp
// copyright : Copyright (c) 2018-present, Lava Block OÜ
// license : MIT; see accompanying LICENSE file
#pragma once
#include <liblava/base/base.hpp>
#include <vk_mem_alloc.h>
namespace lava {
struct allocator {
explicit allocator(VkPhysicalDevice physical_device, VkD... |
#include "PrestigieusGebouwCard.h"
PrestigieusGebouwCard::PrestigieusGebouwCard()
{
}
std::unique_ptr<Card> PrestigieusGebouwCard::Create()
{
std::unique_ptr<Card> card(new PrestigieusGebouwCard());
return std::move(card);
}
PrestigieusGebouwCard::~PrestigieusGebouwCard()
{
}
|
#pragma once
#include <fstream>
#include "LinkedList.h"
class LogFileWriter {
private:
std::ofstream output{"output.txt"};
public:
void Log(LinkedList* list) {
while (list->Count() > 0) {
output << list->Pop() << std::endl;
}
}
}; |
#include "include/tuple.h"
#include "include/transform.h"
#include "include/canvas.h"
#include <iostream>
int main() {
auto * canvas = new raytracer::Canvas(400, 400);
auto * color = new raytracer::Color(1.0, 0.0, 0.0);
auto * radius = new raytracer::Point(3 * canvas->width / 8, 0.0, 0.0);
auto * ro... |
// add your brute force code here |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Core.h"
#include "Engine.h"
#include "GameFramework/Actor.h"
#include "XItem.generated.h"
UCLASS()
class XPROJECT_API AXItem : public AActor
{
GENERATED_BODY()
public:
// Sets default values fo... |
#include "OutputFormat.h"
OutputFormat::OutputFormat()
{
}
OutputFormat::OutputFormat(int lon, int lat, int tours, int satellite, int numberOfPhotos, std::string path, std::string fileName)
{
int long;
longitude= lon ;
latitude = lat;
this->tours = tours;
this->satellite = satellite;
this->numberOfPhotos = n... |
/*
Copyright (c) 2013-2014 Sam Hardeman
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, merge, publish, dist... |
#include <cmath>
#include <map>
#include <stdexcept>
#include <string>
#include <iostream>
#include "BMPImage.hpp"
BMPImage::BMPImage(const char* const filepath) {
std::ifstream inFile;
inFile.open(filepath, std::ios::binary | std::ios::in);
// check state
if (!inFile) {
throw std::runtime_error("cannot fin... |
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
struct Student
{
// 用char[]会把name的也吃进来,同时name自己还是有,不知道什么鬼
int id;
char name[8 + 1];
int grades;
}stu[100000];
bool cmp1(Student stu1, Student stu2)
{
// 注意不能直接用<, char[]是没有重载<的
return stu1.id < stu2.id;
}
bool cmp2... |
/*************************************************************************
> File Name: timer4.cpp
> Author: Jason
> Mail: jie-email@jie-trancender.org
> Created Time: Thu Jun 15 19:14:40 2017
************************************************************************/
#include <muduo/net/EventLoop.h>
#include <mudu... |
#include "ComponentManager.h"
Bag<Component*> ComponentManager::GetComponentsFor(Entity* e, Bag<Component*> fillVector)
{
std::bitset<BITSIZE>* componentBits = e->GetComponentBits();
for (int i = 0; i < BITSIZE; i++)
{
if (componentBits->test(i))
fillVector.add(componentsByType->get(i)... |
#include "pepper_arm_manager/pepper_arm_manager.h"
int main(int argc, char *argv[]){
pepper_arm_manager::eSide side;
if (std::string(argv[1]) == "left"){
side = pepper_arm_manager::LEFT;
ros::init(argc,argv,"pepper_arm_manager_left");
}else if (std::string(argv[1]) == "right"){
side = pepper_arm_man... |
// inspired by http://www.lighthouse3d.com/tutorials/view-frustum-culling/
#pragma once
#include "glm/glm.hpp"
/*!
* \brief Class for Frustum plane
*
*/
class FrustumPlane {
private:
glm::vec3 normal, point;
float d;
public:
/*!
* Constructs frustum plane from three points. The orientation of the plane is de... |
#include "ScriptProcess.h"
#include "ScreenMainGame.h"
#include "OperateBuy.h"
struct cmd_music : public Command
{
virtual int getNextPos(const char *code, int start)
{
printf("cmd_music\n");
return start + 4;
}
virtual Operate *getOperate(const char *code, const int start)
{
... |
/**
* author : Wang Shaotong
* email : wangshaotongsydemon@gmail.com
* date : 2020-04-08
*
* id : poj 1006
* name : Biorhythms
* url : http://poj.org/problem?id=1006
* level : 1
* tag : 枚举, 数学, 数论, 中国剩余定理
*/
#include <iostream>
using namespace std;
const int P = 23;
const int E = 28;
const ... |
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv) {
Mat r = Mat(10, 3, CV_8UC3);
randu(r, Scalar::all(0), Scalar::all(255));
//... |
#include <avr/power.h>
#include <avr/sleep.h>
#define LED1 9 //PB0
#define LED2 11 //PB2
#define LED3 14 //PB5
#define LED4 16 //PB7
#define BUTTON1 10 //PB1
#define BUTTON2 12 //PB3
#define BUTTON3 13 //PB4
#define BUTTON4 15 //PB6
#define BUZZER1 6
#define BUZZER2 7
#define TONE1 880
#define TONE2 1760
#define T... |
/* This file is part of SableCC ( http://sablecc.org ).
*
* See the NOTICE file distributed with this work for copyright information.
*
* 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
*
... |
#include <fstream>
#include <sstream>
#include <vector>
#include <cmath>
#include <fantom/algorithm.hpp>
#include <fantom/fields.hpp>
#include <fantom/register.hpp>
using namespace fantom;
namespace {
/**
* Interpolates scattered data values on another set of points
*/
class InterpolateGeoDataAlgorit... |
/*题目: 判断圆形和矩形是否相交*/
//只要两个中心在水平和垂直方向上的投影之间的距离,都分别小于等于edge/2+R,便可相交
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
using namespace std;
struct point
{
double x;
double y;
}circle,a,b,c,d;
double r;
double dis(point &a,point &b)
{
return sqrt(... |
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <sstream>
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include "InterpolationForStereo/InterpolationForStereo.hpp"
using namesp... |
#include "pch.h"
#include "Matrix.h"
#include <string>
#include <algorithm>
#include <vector>
#include <thread>
#include <mutex>
#include <math.h>
#include <future>
#include "ThreadPool.h"
void add_matrix(int **sum_matrix, int cell, unsigned rows, unsigned columns, Matrix matrix1, Matrix matrix2)
{
unsigned row = cel... |
#include "process.h"
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include <sstream>
#include <vector>
//#include <pthread.h/LINUX>
int size;
using namespace std;
int main() {
// clock_t start;
// start=clock();//setting
int size=0;
int my_num=0;
string line;
ifstream myfile;
int ... |
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int N = 50;
int M = 3;
double *x = new double[N];
double *y = new double[N];
double *z = new double[N];
double **r = new double
return 0;
} |
#include<bits/stdc++.h>
using namespace std;
// topological sorting - ordering of vertices such that u always comes before v in the ordering if u -> v.
// time O(V+E) and O(V) auxillary space
void dfs(map<int,vector<int>>& adj,int start,vector<int>& stack,vector<bool>& visited)
{
visited[start]=true;
// explore it's... |
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int four_sum(vector<int> &nums, int target)
{
sort(nums.begin(), nums.end());
int n = nums.size();
for (int i = 0; i < n; i++)
{
}
}
};
int main()
{
return 0;
} |
#include "Application.h"
int main()
{
Application myApl;
myApl.onCreate();
myApl.Running = true;
do
{
myApl.onUpdate();
} while (myApl.Running == true);
myApl.onDestroy();
}
|
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <stdlib.h>
using namespace std;
int main()
{
int R, C;
cin >> R >> C;
cout << "the number of requirements needed are: " << R << " and the number of courses we can choose from: " << C << endl;
int u, n;
int coursere... |
#include <iostream>
using namespace std;
// SYNTAX :
// datatype function_name(parameter){
// }
void PrintHello(){
cout<<"Hello World!"<<endl;
return;
}
void SUM1(int x,int y){
cout<<"SUM is :"<<x+y<<endl;
}
int SUM2(int a,int b){
// return (a+b);
int ans=a+b;
return ans;
}
// void checkPrime(int); // FO... |
#include "stdafx.h"
#include "SettingsManager.h"
#include "Common/Helpers.h"
#include <fstream>
#include <rapidxml/rapidxml_print.hpp>
#include <rapidxml/rapidxml_utils.hpp>
using namespace Common;
using namespace GraphicsEngine;
using namespace std;
using namespace rapidxml;
using namespace Microsoft::WRL;
constex... |
#ifndef EVENTS_H
#define EVENTS_H
#include <limits.h>
#include <DList.h>
#define EVENTLISTENER_PTR(classname, classinstancePtr, callbackname) \
EventListener(static_cast<EventReciever*>((classinstancePtr)), \
static_cast<EventListener::callback_t>(&classname::callbackname))
#define EVENTLISTENER_PTR... |
#include <regex>
#include <algorithm>
#include <numeric>
#include <limits>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <map>
#include <list>
#include <set>
#include <regex> // this could be replaced...
template <typename State>
std::string stringState(State state);
template ... |
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 3e7;
char s[maxn];
int n = 0;
void read() {
s[n++] = '#';
char c;
while ((c = getchar()) && 'a' <= c && c <= 'z') {
s[n++] = c;
s[n++] = '#';
}
}
int longestPalindrome(... |
#ifndef WIZXMLRPC_H
#define WIZXMLRPC_H
#include "wizxml.h"
enum WizXmlRpcError
{
errorNetwork,
errorContentType,
errorXmlFormat,
errorXmlRpcFormat,
errorXmlRpcFault
};
/* ------------------------- CWizXmlRpcValue ------------------------- */
// Abstract base class for all XML-... |
/*题目:小区便利店正在促销,用 numExchange 个空酒瓶可以兑换一瓶新酒。
你购入了 numBottles 瓶酒。如果喝掉了酒瓶中的酒,那么酒瓶就会
变成空的。请你计算最多能喝到多少瓶酒。*/
#include<stdio.h>
int numWaterBottles(int numBottles, int numExchange);
int main()
{
int numBottles, numExchange;
scanf("%d%d",&numBottles,&numExchange);
if(numExchange != 1){
int drink_wink = numWater... |
#include "A.h"
int A::m_entierStatic = 10;
A::A()
{
this->m_entierStatic = 32;
}
A::~A()
{
}
|
#include "Vector3.h"
#include <math.h>
#include <sstream>
double Vector3::magnitude()
{
// Calculate the magnitude of the vector and return it
return sqrt((this->x * this->x) + (this->y * this->y) + (this->z * this->z));
}
Vector3* Vector3::normalize()
{
// Get the magnitude of the vector
double mag = this->magni... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fr1(i,n) for(ll i=1;i<=n;i++)
#define fr(i,n) for (ll i=0;i<n;i++)
#define ll long long
ll ans[200005],posi[200005],posf[200005],a[200005];
int main()
{
ll m,n,i,k,j,f;
cin>>n>>k;
fr1(i,n) posi[i]=-... |
#pragma once
#include <SFML/Graphics.hpp>
#include "DrawingVertex.h"
#include "DrawingText.h"
#include "DrawingBezierCycle.h"
class LogicEditor
{
public:
static DrawingVertex* dv;
static DrawingText* dt;
static void handleLogic(sf::RenderWindow& renderWindow);
static bool bezierzeichenen;
static int bezierpoints;... |
#include "WaterEffect.h"
WaterEffect::WaterEffect(GVector2 position) : BaseObject(eID::WATEREFFECT)
{
this->_beginPosition = position;
}
WaterEffect::~WaterEffect() {
};
void WaterEffect::init()
{
this->_sprite = SpriteManager::getInstance()->getSprite(eID::WATEREFFECT);
this->_sprite->setScale(SCALE_FACTOR);
... |
#include <iostream>
int silniaWielokrotna(unsigned int n, unsigned int k){
if(k > n && n>=0){
return 1;
}else if(n >= k){
return n * silniaWielokrotna(n-k, k);
}else {
return n;
}
}
int main(){
int size = 0;
int numOfTests = 0;
int n = 0, k = 0;
std::cin>>num... |
// github.com/andy489
#include <cstdio>
#include <vector>
using namespace std;
vector<vector<int>> moves = {
{0},
{1, 2, 3},
{2, 4, 6},
{3, 6, 9},
{4, 8, 12},
{5, 10, 15},
{6, 12, 18},
{7, 14, 21},
{8, 16, 24},
{9, 18, 27},
... |
//
// Created by Nathanael Gutierrez on 10/29/20.
//
#include "PostfixStack.h"
void PostfixStack::push(int val) {
array[++position] = val;
}
int PostfixStack::pop() {
return array[position--];
}
int PostfixStack::top() {
return array[position];
}
bool PostfixStack::isEmpty() {
return position == -1... |
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include <iomanip>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include <unordered_map>
#include<vector>
#include<cstring>
#i... |
//
// CalendarDayCell.h
// IMKSupply
//
// Created by KimSteve on 2017. 9. 7..
//
//
#ifndef CalendarDayCell_h
#define CalendarDayCell_h
#include "../Base/SMView.h"
#define CELL_SIZE 80
#define CELL_FONT_SIZE 30.0f
std::string convertInt(int number);
class CalendarDayCellListener
{
public:
virtual void onCa... |
#include<iostream>
#include<cstdlib>
#include<cstdio>
using namespace std;
int main()
{
long long int t,i,n,m,k,l,p,c,flag = 0,add;
scanf("%lld",&t);
while(t--)
{
scanf("%lld%lld%lld%lld",&n,&m,&k,&l);
while(l--)
{
scanf("%lld%lld",&p,&c);
add = m+p;
... |
/*
* SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef CUTELYSTMEMCACHED_H
#define CUTELYSTMEMCACHED_H
#include <Cutelyst/cutelyst_global.h>
#include <Cutelyst/plugin.h>
#include <QDataStream>
#include <QVersionNumber>
namespace Cute... |
#ifndef __MATRIX3_H__
#define __MATRIX3_H__
#include "types.h"
#include "quaternion.h"
namespace physics
{
class Matrix3
{
public:
ffloat data[9];
public:
Matrix3()
{
data[0] = data[1] = data[2] =
data[3] = data[4] = data[5] =
data[6] = data[7] = data[8] = ffzero;
}
Matrix3(con... |
#ifndef VERKOOP_TAB_READER_H_
#define VERKOOP_TAB_READER_H_
#include <istream>
#include "BarCode.h"
#include "Price.h"
#include "Amount.h"
#include "ProductType.h"
#include "ProductEntry.h"
class TabReader {
protected:
std::istream& in_;
public:
TabReader(std::istream& in);
class ValueReader {
std::l... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.System.Diagnostics.TraceReporting.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation::Collections {
#ifndef WINRT_GENERIC_9520e64b_15b2_52a6_98ed_3191fa... |
#include <iostream>
using namespace std;
#include <fstream>
#include "Data_Array.h"
#include "Data_Point.h"
Data_Array::Data_Array (int sz) {
size = sz;
elt = new Data_Point * [size];
for (int i = 0; i < size; i++)
elt[i] = 0;
}
Data_Array::Data_Array () {
size = DEFAULT_SIZE;
elt = new Data_Point* [siz... |
/*
* File: Common.cpp
* Author: gmena
*
* Created on 23 de agosto de 2014, 04:26 PM
*/
#include "Common.h"
using namespace std;
string Common::strToChar(string str)
{
return str.c_str();
}
|
// SYSMonitorDLL.cpp : 定义 DLL 应用程序的导出函数。
//
#include "stdafx.h"
#include "SYSMonitorDLL.h"
#include "ISYSInstanceManager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// 唯一的应用程序对象
CWinApp theApp;
using namespace std;
//全局函数
CISYSComponent ISYS;
long func_long_sysmonitor_init()
{
long long_ret = 0;
static BOOL b... |
#include "factory.h"
Factory::Factory()
{
}
Component *Factory::create(std::string name)
{
}
|
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "codegen/il2cpp-codegen.h"
#include "vm/CachedCCWBase.h"
#include "os/Unity/UnityPlatformConfigure.h"
#include "il2cpp-object-internals.h"
// System.Byte[]
struct ByteU5BU5D_tD06FDBE814... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.