text stringlengths 8 6.88M |
|---|
#include<cstdio>
#include<cmath>
using namespace std;
bool zhi[21000];
int ans[3];
int judge=0;
void zz(int a,int s)
{
if(s==1)
{
if(zhi[a]==0 && a>=2)
{
ans[2]=a;
judge=1;
printf("%d %d %d",ans[0],ans[1],ans[2]);
}
return ;
}
for(int i=2;i<=a;i++)
{
if(... |
#define LED 13 // Pin 13 onde esta conectado o LED
char rxChar= 0; // RXcHAR holds the received command.
//Funcao com menu
void printMenu(){
Serial.println("--- Serial Monitor ---");
Serial.println("a -> Ligar o LED");
Serial.println("d -> Desligar o LED");
Serial.println("s -> Status do LED");
}
void setup(){
Se... |
#include <stdio.h>
#include <stdlib.h>
#define MAX_QUEUE_SIZE 10 //최대 큐 크기
//함수 선언
void enqueue(char);
void dequeue();
void peek();
//큐 구조체
struct queue {
char array[MAX_QUEUE_SIZE]; //배열로 만든 환형 큐
int front = 0; //front 인덱스
int rear = 0; //rear 인덱스
} queue;
int main(void)
{
//예1
printf("예1\n"... |
#ifndef TRAININGDATAGENERATIONDIALOG_H
#define TRAININGDATAGENERATIONDIALOG_H
#include <QDialog>
#include "ui_TrainingDataGenerationDialog.h"
class TrainingDataGenerationDialog : public QDialog
{
Q_OBJECT
public:
TrainingDataGenerationDialog(QWidget *parent = 0);
~TrainingDataGenerationDialog();
public slots:
v... |
// Copyright (C) 2012-2013 Mihai Preda
#include "SymbolTable.h"
#include "GC.h"
#include "Object.h"
#include "Array.h"
#include "String.h"
#include <stdio.h>
SymbolTable::SymbolTable() {
((Object *) this)->setType(O_SYMTAB);
enterBlock(true);
}
SymbolTable::~SymbolTable() {
exitBlock(true);
}
void Symbo... |
#include<iostream>
#include<vector>
using namespace std;
//caluculate area of rectangle
int area(int length, int width) {
return length*width;
}
double area(double length, double width) {
return length*width;
}
int framed_area(int x, int y) {
return area(x - 2, y - 2);
}
int main() {
int x = -1;
int y = 2;
in... |
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,n;
int ok(int x){
if(x>=1&&x<=n)
return 1;
else return 0;
}
int main(){
cin>>n>>a>>b>>c>>d;
int e;
long long int ans=0;
for(int i=1;i<=n;i++){
e=i;
if(ok(e+a-d)&&ok(e+b-c)&&ok(e+a+b-c-d))
... |
// Created on: 1999-11-26
// Created by: Andrey BETENEV
// Copyright (c) 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 Less... |
#include "stdafx.h"
#include "BitmapTooltip.h"
IMPLEMENT_DYNAMIC(CBitmapTooltip, CWnd)
BEGIN_MESSAGE_MAP(CBitmapTooltip, CWnd)
ON_WM_SIZE()
ON_WM_PAINT()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
CBitmapTooltip::CBitmapTooltip( CRect& rect )
{
// Register your unique class name that you wish to use
... |
//
// George O'Neill @ University of York, 2020
//
// This file holds methods for gates, except they actually are all short enough for the header
//
#include "../include/Gate.h"
namespace fnt{ // create unique working area
} // end namespace fnt
void Gate(){} // allow root compilation |
// Fill out your copyright notice in the Description page of Project Settings.
#include "Cpp.h"
#include "BattleHUD.h"
#include "TargetActor.h"
void ABattleHUD::DrawHUD()
{
const FVector2D ViewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY());
ViewportSizeX = ViewportSize.X;
ViewportSizeY = Vie... |
void nextComb(int left, int sum, vector<int> A, int B, vector<int> comb, vector<vector<int> > &ans) {
if (sum == B) {
ans.push_back(comb);
return;
}
// if (sum == B) {
// if (ans.empty())
// ans.push_back(comb);
// else if (ans[ans.size() - 1] != comb)
// ans.push_back(comb);
// ... |
/*
* This code prints that how many
* days in a day with user input
* In this code switch-case method was used
*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
int month = 0;
int year = 0; //for february
printf("Enter yhe month (in numbers): ");
scanf("%d", &month);
switch (month)
{
case 2:
printf("... |
#include<iostream>
using namespace std;
class stack{
int arr[50],top,max,x;
public:
stack()
{
top=-1;
max=25;
}
int isfull()
{
return(top==max);
}
int isempty()
{
return(top<0);
}
void push()
{
if (isfull())
cout<<"stack overflow";
else{
cout<<"enter the numb... |
/*********************************************************************************************
cfglp : A CFG Language Processor
--------------------------------
About:
Implemented by Tanu Kanvar (tanu@cse.iitb.ac.in) and Uday
... |
//#include "globalTypes.h"
#include "tableParser.h"
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <dirent.h>
using namespace std;
#define MAX_ROWS_CHUNK 128
uint32_t rowChunk[MAX_ROWS_CHUNK][MAX_COLS];
vector<string> getTokens(string const &in){
const size_t len = in.length()... |
//: C03:SimpleStruct3.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Uzywanie wskaznikow do struktur
typedef struct Structure3 {
char c;
int i;
float f;
double d;
} Structure3;... |
#include <iostream>
#include <algorithm>
#include <chrono>
#include <thread>
#include "DatabaseClientApi.hpp"
std::string random_string(size_t length)
{
auto randchar = []() -> char
{
const char charset[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxy... |
#ifndef TEXTURE_H_INCLUDED
#define TEXTURE_H_INCLUDED
#include <string>
/* forward declarations begin */
struct SDL_Point;
struct SDL_Rect;
struct SDL_Texture;
/* forward declarations end */
struct FailedToLoadTextureException {};
class Texture {
public:
Texture();
Texture(char const* path);
~Texture();... |
/*
Name: �����߷�
Copyright:
Author: Hill bamboo
Date: 2019/8/15 20:23:01
Description: ����
�տ�ʼ�뵽����DFSд�ģ����Ǻ������ֲ�����д�����Ǻ�����ֱ������ķ�ʽ����ʵ�����ַ���Ҳ�ܿ��
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 10 + 5;
int maze[maxn][maxn];
int m, n;
int main() {
maze[0][0] = 1;
scanf("%... |
#include "CollisionCircle.hpp"
#include "CollisionControl.hpp"
#include <algorithm>
namespace game {
//インスタンス実体化
CollisionControl CollisionControl::m_instance;
CollisionControl::~CollisionControl()
{
}
void CollisionControl::PushCollisionData(CollisionData & colliData)
{
m_collisions.emplace_back(std::uni... |
#include<iostream>
using namespace std;
int fact(int n) {
int f = 0;
if (n <= 1) {
f = 1;
}
else {
f = n * fact(n - 1); // 5 * (5 - 1), 6 * (4 - 1) ect.
}
return f;
}
int fact2(int n) {
int f = 1;
cout << "Множители: " << n << endl;
if (n > 1) {
f = n * fact... |
#include "Tema1.h"
#include <iostream>
using namespace std;
Tema1::Tema1()
{
}
Tema1::~Tema1()
{
delete paddle;
delete ball;
delete wall;
delete brickManager;
}
void Tema1::Init()
{
// Initialize camera
camera = new Camera(glm::vec3(0, 0, 40), glm::vec3(0, 0, 0),
glm::vec3(0, 1, 0));
// Set logic space
... |
/*
* pirflinx
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <iostream>
#include <sys/stat.h>
#include <unistd.h>
#include <syslog.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <execinfo.h>
#include "Logger.h"
#define D... |
#include "Ammunition.h"
#include "math.h"
void Ammunition::generateNewBullets(float delta, Scene* scene, Sprite* hero) {
for (auto numDirection = 0; numDirection < m_Direction.size(); numDirection++)
{
m_bullets.pushBack(this->generateSimpleBullet(delta, scene, hero, m_Direction[numDirection]));
}
;
if (isFlas... |
#include <iostream>
#include <conio.h>
#include <string>
#include <vector>
using namespace std;
struct Employee
{
int ID;
string firstName;
string lastName;
double payRate;
int hours;
};
void Print(Employee const&e)
{
cout << "Here is your employee report: " << endl;
cout << e.ID << " " << e.firstName << ... |
#ifndef HEADER_CURL_MEMDEBUG_H
#define HEADER_CURL_MEMDEBUG_H
#ifdef CURLDEBUG
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* ... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
long long int a , b , c;
for (int i = 0; i < t; i++)
{
cin>>a>>b>>c;
if (a < c)
{
cout<<1<< " ";
}
else if (a >= c)
{
cout<<-1<<" ";
... |
#include "msg_0x2a_removeentityeffect_stc.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
RemoveEntityEffect::RemoveEntityEffect()
{
_pf_packetId = static_cast<int8_t>(0x2A);
_pf_initialized = false;
}
RemoveEntityEffect::RemoveEntityEffect(int32_t _entityId, int32_t _effectId)
: _pf_entityId(_entityId)
,... |
#pragma once
#include <QStandardItemModel>
#include <envire_core/items/Transform.hpp>
namespace envire { namespace viz {
/**A qt model for TransformWithCovariance that can be used with tables and
* tree views etc. */
class TransformModel : public QStandardItemModel
{
Q_OBJECT
public:
TransformModel();
signa... |
//
// Created by Yujing Shen on 29/05/2017.
//
#ifndef TENSORGRAPH_RELUNODE_H
#define TENSORGRAPH_RELUNODE_H
#include "../SessionNode.h"
namespace sjtu{
class ReluNode: public SessionNode
{
public:
ReluNode(Session *sess, const Shape& shape);
~ReluNode();
virtual Node forward() o... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#ifdef MEMTOOLS_ENABLE_STACKGUARD
#include "modules/memtools/stackt... |
#pragma once
namespace json {
class Object;
class Array;
template<typename Provider, typename Parent, typename Index>
class AutoCommitT: public Provider {
public:
AutoCommitT(const Value &oldVal, Parent &parent, const Index &index)
:Provider(oldVal),parent(parent),index(index) {}
~AutoCommitT() {
if ... |
//
#include <iberbar/Paper2d/ComponentSystem.h>
//#include <iberbar/Paper2d/Component_Updatable.h>
//#include <iberbar/Paper2d/Component_HandleMouseInput.h>
//#include <iberbar/Paper2d/Component_HandleKeyboardInput.h>
//#include <iberbar/Paper2d/Node.h>
//
//
//
//iberbar::Paper2d::CComponentSystem_Updatable* iberbar::... |
//////////////////////////////////////////////////////////////////////////
//
// This software is distributed under the terms of the GNU GENERAL
// PUBLIC LICENSE Version 2, June 1991. See the package LICENSE
// file for more information.
//
//////////////////////////////////////////////////////////////////////////
... |
#include "service.h"
#include "health.h"
const KeyStroke KeyStrokes[]= {
{ SHINE_RCVD_SIG, "SHINE_RCVD", 'i'},
{ CENTRAL_BUTTON_PRESSED_SIG, "CENTRAL_BUTTON_PRESSED", 'b'},
{ TIME_TICK_1S_SIG, "TIME_TICK_1S", 's'},
{ TIME_TICK_1M_SIG, ... |
/*! @file LogVol_CCHardCovering_Base.hh
@brief Defines mandatory user class LogVol_CCHardCovering_Base.
@date August, 2012
@author Flechas (D. C. Flechas dcflechasg@unal.edu.co)
@version 1.9
In this header file, the 'physical' setup is defined: materials, geometries and positions.
This class defines the... |
#pragma once
#include "Unit.h"
#include "Cell.h"
#include <map>
#include "LandScape.h"
#include "Bonus.h"
class Cavalry : public Unit
{
public:
std::map<std::string, int> getMap();
static std::map<std::string, int> CBonus;
std::string getName();
//bool doAction(std::string);
Cavalry(int Health, int De... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Игра "Угадай букву!". Пример использования оператора break в бесконечном цикле
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include <iostream>
int main() {
using namespace std;
int co... |
#include <stdio.h>
#include <stdlib.h>
#include "Player.h"
#include "Logger.h"
#include "BaseProcess.h"
#include "HallHandler.h"
#include "GameCmd.h"
#include "ProcessManager.h"
#include "Configure.h"
//static int betnum[7]={100, 500, 1000, 2000, 5000, 10000, 50000};
static int betnum[6] = { 100, 500, 1000, 5000, 100... |
#include "HealthBar.h"
HealthBar::HealthBar() {
TextureManager::Instance()->load("...Assets/Textures/HealthBar3.png", "healthbar3");
TextureManager::Instance()->load("...Assets/Textures/HealthBar2.png", "healthbar2");
TextureManager::Instance()->load("...Assets/Textures/HealthBar1.png", "healthbar1");
TextureMana... |
#include <iostream>
using namespace std;
int partition(int A[], int p, int r){
int x = A[r];
int i = p-1;
for(int j=p; j<r; j++){
if(A[j] <= x){
i++;
swap(A[i], A[j]);
}
}
swap(A[i+1], A[r]);
return i+1;
}
int main(void){
int n;
int A[100001];
... |
#include <iostream>
#include <cmath>
#include <unordered_map>
using namespace std;
class Solution {
public:
string fractionToDecimal(long numerator, long denominator) {
if(numerator == 0)
return "0";
string res;
if((0 > numerator) ^ (0 > denominator))
res +=... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* 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.
*
* @author Anders Karlsson (pugo)
*/
... |
//
// ZXSpectrum.cpp
// Clock Signal
//
// Created by Thomas Harte on 17/03/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#include "ZXSpectrum.hpp"
#include "Video.hpp"
#define LOG_PREFIX "[Spectrum] "
#include "../../../Activity/Source.hpp"
#include "../../MachineTypes.hpp"
#include "../../.... |
#include<iostream>
#include<cstring>
#define FOR(i,n) for(i=0;i<n;i++)
#define MAX(a,b) (a)>(b)?(a):(b)
using namespace std;
long long A[21][21][21];
long long calcsum(int i,int l,int j,int m, int k)
{
long long s=0;
s=A[l][m][k];
if(i>0)s-=A[i-1][m][k];
if(j>0)s-=A[l][j-1][k];
if(i>0&&j>0)s+=A[i-1]... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** 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.
**
*/
#include "core/pch.h"
#include "mo... |
#include <iostream>
#include <vector>
#include <set>
using namespace std;
void solve () {
int n;
cin >> n;
int a[n];
for (auto& it: a) cin >> it;
vector<vector<int>> pref(26, vector<int>(n + 1));
for (int i=0; i<n; ++i) {
for (int j=0; j<26; ++j) pref[j][i+1] = pref[j][i];
++pref[a[i]-1][i+1];
... |
//
// 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.
//
// @author Arjan van Leeuwen (arjanl)
//
#ifndef MISC_COMMANDS_H
#define MISC_COMMANDS_H
#include "adjunct/m2/src/backend/imap/commands/Ima... |
// Copyright (C) 2004 Id Software, Inc.
//
#ifndef __RENDERER_H__
#define __RENDERER_H__
/*
===============================================================================
idRenderSystem is responsible for managing the screen, which can have
multiple idRenderWorld and 2D drawing done on it.
======================... |
#ifndef EXAMPLE_CLASS_HPP
#define EXAMPLE_CLASS_HPP
class ExampleClass{
public:
ExampleClass();
virtual ~ExampleClass();
int setNewAndReturnLast(int n);
private:
int x;
};
#endif //EXAMPLE_CLASS_HPP |
#include <wpp/qt/QGuiApplication.h>
#include <wpp/qt/QQmlApplicationEngine.h>
int main(int argc, char *argv[])
{
wpp::qt::QGuiApplication app(argc, argv);
wpp::qt::QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}
|
#pragma once
#include "MarchingCubes.hpp"
#include "LookupTables.hpp"
#include "atlas\utils\Utils.hpp"
#include "atlas/math/Math.hpp"
#include <math.h>
#include <iostream>
namespace assignment2
{
void MarchingCubes::createMesh(std::vector<Sphere*>& SceneSpheres, std::vector<Normal> &vertices, std::vector... |
//A*
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
const int maxn = 5010;
const int maxm = 400010;
const int inf = 2e9;
int n, m, s, t, k, u, v, ww, H[maxn], cnt[maxn];
int cur, h[maxn], nxt[maxm], p[maxm], w[maxm];
int cur1, h1[maxn], nxt1[maxm], p1[maxm], w1[maxm];
bo... |
#include <iostream>
#include <getopt.h>
#include <string>
#include <fstream>
#include <Eigen/Dense>
#include "quadtree.h"
using namespace std;
using namespace Eigen;
template <typename T>
T load_csv(const std::string &path)
{
std::ifstream in;
in.open(path);
std::string line;
std::vector<double> values;... |
//
// Created by Nikita Kruk on 08.08.18.
//
#ifndef SPRAPPROXIMATEBAYESIANCOMPUTATION_FREEBOUNDARYCONDITIONSCONFIGURATION_HPP
#define SPRAPPROXIMATEBAYESIANCOMPUTATION_FREEBOUNDARYCONDITIONSCONFIGURATION_HPP
#include "../Definitions.hpp"
#include "BoundaryConditionsConfiguration.hpp"
#include "Vector2D.hpp"
#includ... |
#ifndef VECTOR_HPP
#define VECTOR_HPP
#define SIZE 4
class Vector {
private:
double _coords [SIZE];
public:
Vector();
Vector(const Vector & v);
Vector(double x, double y, double z, double s);
~Vector();
bool isPosition();
bool isDirection();
double getXCoord ();
double getYCoord ();
double... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#include "modules... |
//
// ArbolBinario.cpp
// Arboles
//
// Created by Daniel on 20/10/14.
// Copyright (c) 2014 Gotomo. All rights reserved.
//
#include "ArbolBinario.h"
|
// Created on: 1994-08-31
// Created by: Jacques GOUSSARD
// 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 G... |
#include <cstdint>
#include <iostream>
#include <string.h>
#include <vector>
#include <sched.h>
namespace {
class Value {
public:
Value(std::string &f, int64_t v)
: format(f), value(v) {}
std::string format;
int64_t value;
};
#if defined(__i386__)
uint64_t rdtsc() {
uint64_t x;
__asm__ volatile (".b... |
#ifndef NODO_H
#define NODO_H
#include <iostream>
using namespace std;
class Nodo
{
private:
int valor;
Nodo* siguiente;
public:
Nodo(int v, Nodo* s = NULL){
valor = v;
siguiente = s;
}
int dameTuValor(void){
return valor;
}
... |
#include "talents.hpp"
#include <QDebug>
TalentsGUI::TalentsGUI()
: m_Layout_Talents(new QVBoxLayout)
, m_Layout_TopRow(new QHBoxLayout)
, m_Layout_BottomRow(new QHBoxLayout)
, m_Frame_TopRow(new QFrame)
, m_Frame_BottomRow(new QFrame)
, m_Frame_Talents(new QFrame)
{
initGUI();
}
TalentsGUI::TalentGroup::TalentGroup... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... |
#include<iostream>
#include<vector>
using namespace std;
int main(void){
double d = 98.25;
vector<int> result;
vector<int> result_d;
int a = floor(d);
double b = d - a;
int op;
while(a){
op = a % 2;
a = a / 2;
result.push_back(op);
}
while(b){
op = floor(b * 2);
b = b*2 - op;
result_d.pu... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "OnlineSubsystem.h"
#include "OnlineSessionInterface.h"
#include "MenuSystem/MenuInterface.h"
#include "ArenaNetGameInstance.generated.h"
/**
*
*/
UCLASS()... |
#pragma once
#include "Interface/IRuntimeModule.h"
namespace Rocket
{
Interface IMemoryManager : inheritance IRuntimeModule
{
public:
IMemoryManager() = default;
virtual ~IMemoryManager() = default;
virtual void* AllocatePage(size_t size) = 0;
virtual void FreePage(void* p)... |
//////////////////////
//My name in "fade".//
//////////////////////
#include "stdafx.h"
#include "Fade.h"
Fade::Fade()
{
m_black = NewGO<SpriteRender>(31, "sp");
m_black->Init(L"Assets/sprite/fade_black.dds", 1280,720);
m_black->SetMulCol(m_mulcol);
}
void Fade::OnDestroy()
{
DeleteGO(m_black);
}
void Fade:... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* 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.
*
* @author Anders Karlsson (pugo)
*/
... |
/**********************************************************************
*Project : EngineTask
*
*Author : Jorge Cásedas
*
*Starting date : 24/06/2020
*
*Ending date : 03/07/2020
*
*Purpose : Creating a 3D engine that can be used later on for developing a playable demo, with the engine as static library
*
***... |
#include <fstream>
#include <iostream>
#include <vector>
#include <assert.h>
#include <string>
#include "openAddress.cpp"
using namespace std;
int main ()
{
ifstream read;
vector <string> dict;
read.open("dict.txt");
while(!read.eof())
{
string Buffer;
getline(read,Buffer,'\n');
dict.push_back(Buffer);
}... |
/*
* Copyright [2017] <Bonn-Rhein-Sieg University>
*
* Author: Torsten Jandt
*
*/
#include <mir_planner_executor/actions/executor_action.h>
#include <ros/console.h>
void ExecutorAction::initialize(KnowledgeUpdater* knowledge_updater) {
knowledge_updater_ = knowledge_updater;
}
|
class Convolution{
private:
// ATTRIBUTES
int method;
int convKernel[3][3];
// CONTRUCTORS
Convolution(){
method = 0;
for (int i = 0; i < 3; i++){
for (int j = 0; j < 3; j++){
convKernel[i][j] = 0;
}
... |
#ifndef DMA_H
#define DMA_H
/*
* DMA.h
*
* Used to define the DMA: allows devices to stream data directly from RAM
* CPU --write--> DMA --command--> (GPU/SPU/MDEC..)
*/
// includes
#include <Memory.h>
#include <vector>
// all devices which have a DMA channel inherit from this class.
class dmaDevice
{
... |
//
// C++ Implementation: UdpData
//
// Description:
//
//
// Author: cwll <cwll2009@126.com> ,(C)2012
// Jally <jallyx@163.com>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
// 2012.02 在接收消息中去掉了群组模式,群组模式只用来发消息
//
#include "config.h"
#include "UdpData.h"
#include "ProgramData.h"
#... |
#include "../headers/Window.h"
/* Constructor por defecto. */
Window::Window():pWindow(NULL){
}
/* Este metodo podria borrarse y pasar todo su codigo al constructor de Window. Ver después.
* @return: true si salió todo bien (que debería ser siempre)
*/
bool Window::Create(const char* title, int width, int height)... |
#include "core.h"
void ArrayOut(int size, double* array)
{
cout << "Array: ";
for (int i = 0; i < size; i++)
cout << array[i] << ' ';
cout << endl;
}
|
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
using namespace std;
void leftviewprint(struct node *root,int level,int *max_level);
struct node
{
struct node *left;
struct node *right;
int data;
};
struct node *newnode(int a)
{
struct node *n = (struct ... |
// #include <stdio.h>
// #include <unistd.h>
// #include <string.h>
// #include <sys/socket.h>
// #include <arpa/inet.h>
// #include <openssl/ssl.h>
// #include <openssl/err.h>
// #include <iostream>
// //https://security.stackexchange.com/questions/90422/ssl-certificates-and-cipher-suites-correspondence
// int crea... |
#pragma once
#include <vector>
#include <SDL2/SDL_image.h>
#include "fwd.hpp"
#include "engine/graphics/PhysicsObject.hpp"
#include "engine/net/ServerNet.hpp"
#include "engine/net/ClientNet.hpp"
using namespace std;
enum FLOOR_TYPE{
GRASS,
STONE
};
enum WALL_TYPE{
ORANGE,
BROWN,
SILVER,
SI... |
#ifndef VLEX_TOKEN_H
#define VLEX_TOKEN_H 1
#include <string>
#include <FlexLexer.h>
namespace vlex{
struct YYSTYPE{
int pos;
int ival;
std::string sval;
};
extern YYSTYPE yylval;
extern yyFlexLexer *lexer;
const int ID = 257;
const int STRING = 258;
const int INT = 259;
const int COMMA = 260;
const int C... |
#ifndef APRIORI_H
#define APRIORI_H
#include <bitset>
#include <vector>
const int MAX_ITEM_LEN_ = 100;
const int MAX_INPUT_LINE_ = 3200;
using namespace std;
using std::bitset;
class Apriori
{
private:
bitset<MAX_ITEM_LEN_> data[MAX_INPUT_LINE_];
vector<bitset<MAX_ITEM_LEN_>> L1_item;
vector<int> L1_sup... |
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;
const int INF = 987654321;
string N;
// N[a..b] 구간의 난이도를 반환한다.
int classify(int a, int b){
// 숫자 조작을 가져온다.
string M = N.substr(a, b-a+1);
// 첫글자만으로 이루어진 문자열과 같으면 난이도는 1
if(M == string(M.size(), M[0])) re... |
#include <thread>
#include <vector>
#include <iostream>
std::mutex g_m;
thread_local int counter = 0;
void func1() {
std::lock_guard<std::mutex> lck{g_m};
std::cout << "thread " << std::this_thread::get_id() << " counter address "
<< &counter << std::endl;
}
void test() {
std::mutex mmm;
... |
// This example illustates basic use of the NMEA library.
// It assumes that a GPS receiver is connected to serial
// port 'Serial1' at 4800 bps, and that a LED is connected
// to digital i/o pin 0.
//
// A GPS data connection of type GPRMC is created, and
// used to get position information. When the GPS position
// i... |
#pragma once
namespace jstexture
{
void init();
} |
#pragma once
#include "x/x_platform.h"
namespace x
{
class X_API x_Android : public x_Platform
{
public:
x_Android();
virtual ~x_Android();
x_Bool createWindow(x_String windowTitle, x_Sint32 width, x_Sint32 height);
void destroyWindow();
x_Sint32 messagePump();
x_WindowHandler getWindowHandler();
vo... |
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main()
{
string DEFAULT_HOST = "localhost";
int DEFAULT_PORT = 10036;
double DEFAULT_GREMLIN_COR = 0.0;
double DEFAULT_GREMLIN_DRO = 0.0;
double DEFAULT_GREMLIN_DEL = 0.0;
int DEFAULT_GREMLIN_DEL_T = 0;
string DEF... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <iostream>
#include "mp3manager.h"
#include "mp3filemanager.h"
#include "taglib/taglib/tag.h"
#include "bass/bass.h"
#include <string>
#include "mp3player.h"
#include <thread>
#include <vector>
#include <QTimer>
namespace Ui {
class MainWindow;
}... |
#include ".\waypoint.h"
#include "graphics.h"
#include "input.h"
extern Input *input;
Waypoint::Waypoint(void)
{
type = E_WAYPOINT;
family = EF_ENVIRONMENT;
}
Waypoint::~Waypoint(void)
{
}
void Waypoint::render() {
if (input->inputContext == EditMode) {
glPushAttrib(GL_ALL_ATTRIB_BITS);
gl... |
#include <iostream>
using namespace std;
using ll = long long;
int main() {
int n;
ll t;
cin >> n >> t;
ll a[n];
for (int i = 0; i < n; ++i) cin >> a[i];
ll ans = 0;
while (true) {
ll cnt = 0, cost = 0;
for (int i = 0; i < n; ++i) {
if (t - cost >= a[i]) {
... |
#include <bitset>
#include <ostream>
namespace precision
{
template<std::size_t N>
class UnsignedInteger
{
private:
std::bitset<N> bits;
const std::size_t size = N;
public:
const std::bitset<N> &get_bits() const
{
return bits;
}
void set_bits(const std::bitset<N> &new_bits)
{
bits = new_bits... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2009-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef GEOLOCATION_TOOLS_H
#define GEOLOCATION_TOOLS_H
#ifdef ... |
//
// Created by 송지원 on 2020-03-08.
//
//exit code 11 뜸. 출
// 뭔가 알아봤는데 sort() 함 수 내에서 자신을 호출할 때,
// 두번째 호출에서 sort(mid +1, end) 이렇게 호출해야 하는데
// 그냥 mid를 호출함.
// typo error!
#include <iostream>
using namespace std;
int a[1000000];
int b[1000000];
//void swap(int &x, int &y) {
// int z = x;
// x = y;
// y = z... |
//
// Created by 钟奇龙 on 2019-05-17.
//
#include <vector>
#include <iostream>
using namespace std;
/*
* 原问题
*/
void leftUnique(vector<int> &arr){
if(arr.size() < 2) return;
int left = 0;
int right = 1;
while(right < arr.size()){
if(arr[right] != arr[left]){
swap(arr[left+1],arr[rig... |
#include <LeftistHeap.h>
#include <iostream>
#include <Wrapper.h>
#include <PuttingVisitor.h>
int main(void)
{
LeftistHeap lh;
Int *ip1 = new Int(1);
Int *ip2 = new Int(2);
Int *ip3 = new Int(3);
Int *ip4 = new Int(4);
Int *ip5 = new Int(5);
Int *ip6 = new Int(6);
Int *ip7 = new Int(7);
using name... |
#include "../include/Scaleable.h"
using namespace sf;
Texture Scaleable::getTexture()
{
return texture;
}
Vector2f Scaleable::getSize()
{
return size;
}
Vector2f Scaleable::getScale()
{
return scale;
}
Vector2f Scaleable::getPosition()
{
return position;
}
void Scaleable::setTexture(Texture t)
{
texture = t... |
#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn=100000+10 ;
struct P
{
int id ; LL val ;
bool operator < (const P &rhs) const
{
return val>rhs.val ;
}
};
int n,m,k ;
LL h[maxn],a[maxn],num[maxn],p ;
priority_queue<P> pq ;
bool check(LL h0)
{... |
/**
@file
@author Nicholas Gillian <ngillian@media.mit.edu>
@version 1.0
@section LICENSE
GRT MIT License
Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.