text stringlengths 8 6.88M |
|---|
#include <sys/types.h>
#include <sys/socket.h>
#include <ctime>
const int g_port = 3123;
struct Message
{
int64_t request;
int64_t response;
} __attribute__((__packed__));
static_assert(sizeof(Message) == 16, "Message size should be 16 bytes");
int64_t now()
{
struct timeval tv = {0, 0};
gettimeof... |
/**
* @file OgreApplication.h
* @brief 用于定义OgreApplication类的头文件
*/
#ifndef OGREAPPLICATION_H
#define OGREAPPLICATION_H
#include <OgreRoot.h>
#if OGRE_VERSION >= 0x00010900
#include <OgreOverlaySystem.h>
#endif
#include <QApplication>
/**
* @class OgreApplication
* @brief 继承自QApplication类.
* 在任何Qt的窗口... |
#ifndef TOMATO_H
#define TOMATO_H
#include <map>
#include <vector>
#include "task.h"
class Tomato
{
public:
Tomato( void );
~Tomato( void );
void load( void );
int addTask( Task task );
Task getTask( int id );
std::map<int,Task>::const_iterator beginForTask() {
return tasks.begin();
}
std::map<int,Task>::c... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2005 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/widgets/ColouredMultiEdi... |
//format : by using make_pair();
#include<iostream>
#include<utility>
#include<string>
using namespace std;
class student
{
string name;
int i;
public:
void set()
{
name="madhav";
i=16;
}
void show()
{
cout<<"\nname of student: "<<name;
cout<<"\nage of student : "<<i;
}
};
int main()
{
student s1,... |
#ifndef TIMEPOINT_HPP
#define TIMEPOINT_HPP
class TimePoint
{
public:
TimePoint();
TimePoint(const std::string &_time);
TimePoint(const int &_val);
TimePoint operator-(const TimePoint &rhs) const;
TimePoint operator+(const TimePoint &rhs) const;
double operator/(const TimePoint &rhs) const;
... |
/*
* @lc app=leetcode.cn id=14 lang=cpp
*
* [14] 最长公共前缀
*/
// @lc code=start
#include<iostream>
#include<vector>
#include<string>
using namespace std;
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
if(strs.size()==0)return "";
if(strs.size()==1)return strs[... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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.
*
*/
#ifndef MDE_OPPAINTER_H
#define MDE_OPPAINTER_H
#include "m... |
// Q. Dynamic Array
// https://www.hackerrank.com/challenges/dynamic-array/problem
#include<iostream>
#include<vector>
using namespace std;
vector<int> dynamicArray(int n, vector<vector<int>> queries) {
int lastAnswer=0;
vector< vector<int> > arr;
vector<int> answerArray;
arr.resize(n);
for(int i... |
// SPDX-FileCopyrightText: 2021 Samuel Cabrero <samuel@orica.es>
//
// SPDX-License-Identifier: MIT
#ifndef __STATE_ALARM_H__
#define __STATE_ALARM_H__
#include "state.h"
class TAlarm : public TState {
public:
TAlarm();
virtual const char *name() const;
virtual void enter();
virtual void loop();
virtual void ... |
// FileClientCmd.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "pch.h"
#include <fstream>
#include <iostream>
#include "../Common.h"
#include "../CBlockingSocket.h"
#include "../UdpSocket.h"
#include "../Message.h"
#include <string>
#include <process.h>
#include <windows.h>
BOOL multi_thread = false;
unsigned _... |
#include <iostream>
struct Player
{
int m_Health;
void other(int Health);
int temp;
};
void Player::other(int Health)
{
for (int i = 0; i <= Health; i++)
{
for (int j = 0; j <= Health; j++)
{
if (j < i)
{
temp = j;
j = i;
i = temp;
}
}
}
}
int main()
{
Player p1{ 100 };
Player p2{... |
#include "chandler.h"
Eigen::Matrix3f K = Eigen::Matrix3f::Zero();
std::string save_path = "";
CHandler::CHandler()
{
m_bGetLidarClouds = false;
m_bGetImage = false;
hasResult = false;
pointcloud_viewer = new pcl::visualization::PCLVisualizer("pointcloud_viewer");
m_pc = pcl::PointCloud<pcl::PointXY... |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
using namespace std;
int calculate_bid(int player, int pos, int* first_moves, int* second_moves) {
int pBalance = 100, pPos = 0, draw = 1;
int bid;
// To check if bot is player 1 or 2
if (player != 1){
swap(first_mo... |
//===========================================================================
/*
This file is part of the CHAI 3D visualization and haptics libraries.
Copyright (C) 2003-2004 by CHAI 3D. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the terms o... |
// FrequencyEdit
#include "FrequencyEdit.h"
// RsaToolbox
#include "General.h"
using namespace RsaToolbox;
// Qt
#include <QRegExp>
#include <QRegExpValidator>
#include <QKeyEvent>
#include <QDebug>
FrequencyEdit::FrequencyEdit(QWidget *parent) :
QLineEdit(parent),
_name("Value"),
_frequency_Hz(-1),
... |
#include<stdio.h>
int a,s;
main()
{
scanf("%d",&a);
s=a*(a+1)*(2*a+1)/6;
printf("%d",s);
}
|
#pragma once
#include "ofMain.h"
#include "ofxEtherdream.h"
class testApp : public ofBaseApp{
enum DemoMode {
NONE = 0,
OSCILLATIONS,
DOODLES,
TEXT,
MILKYWAY
};
enum doodle {
EYE,
TRIANGLE
};
public:
void setup();
void upda... |
#include "graphics.h"
#include "Button.h"
#include "Player.h"
#include <iostream>
#include <time.h>
#include <vector>
using namespace std;
GLdouble width, height;
bool rightRoomComplete = false;
int wd;
int counter = 0;
int expCounter = 0;
string userName;
Button spawn({1, 0, 0}, {250, 240}, 100, 50, userName);
Quad d... |
// 问题的描述:拓扑结构相同子树
// 给定一个两棵二叉树,判断树A中是否存在一棵子树与B树的拓扑结构完全相同
// 普通解法:二叉树遍历 + 匹配 O(M * N)
// 最优解法:二叉树序列化 + KMP算法(判断A序列中是否包含B序列) O(M * N)
// 测试用例有3组:
// 1、空树
// 输入:nullptr; nullptr
// 输出:false
// 2、包含相同拓扑结构的子树
// 输入:
// 1 2
// / \ / \
// 2 3 4 5
// / \
// 4 5
// 输出:true
// ... |
#include "utils/service_thread.hpp"
#include "utils/exception.hpp"
#include <cppunit/extensions/HelperMacros.h>
#include <condition_variable>
using namespace chrono;
namespace nora {
namespace test {
class service_thread_test : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(service_thread_t... |
#include <souistd.h>
#include <core/SScrollBarHandler.h>
namespace SOUI
{
SScrollBarHandler::SScrollBarHandler(IScrollBarHost *pCB, bool bVert)
:m_bVert(bVert)
,m_pSbHost(pCB)
, m_iFrame(0)
, m_fadeMode(FADE_STOP)
, m_iHitPart(-1)
, m_iClickPart(-1)
, m_nClickPos(-1)
{
SASSERT(m_pSbHost... |
// hello.h
// https://www.genivia.com/dev.html
int ns__hello(std::string name, std::string& greeting);
|
// vec_eigen_pair.h
// Mike Lujan
// July 2010
#pragma once
#include <string>
#include "complex.h"
#include "layout.h"
namespace qcd
{
template <class genvector>
struct vec_eigen_pair
{
int size;
double_complex* eval;
genvector** evec;
vec_eigen_pair(int size, lattice_desc& desc);
~vec_eigen_pair();
priv... |
volatile int32_t encoder1_ticks;
volatile uint32_t encoder1_period; // microseconds
volatile uint64_t encoder1_lastTick; // microseconds
volatile int32_t encoder2_ticks;
volatile uint32_t encoder2_period; // microseconds
volatile uint64_t encoder2_lastTick; // microseconds
void encoder_setup() {
attachInterrupt(dig... |
#include <vector>
#include <memory>
#include <string>
#include <utility>
#include <stdexcept>
template<typename T>class Blob {
public:
typedef T value_type;
typedef typename std::vector<T>::size_type size_type;
Blob();
Blob(std::initializer_list<T> il);
size_type size() const;
bool empty() const;
void push_... |
#pragma once
#pragma warning(disable : 4996)
//基于文件实现的一个vector
#include <string>
#include <iostream>
#include <stdio.h>
#include "tool.h"
using std::fstream;
template<class T>
class dataFile
{
FILE *_file;
long num;
const int Tsize;
public:
// 构造函数:参数为文件名,如果不存在就创建
dataFile(con... |
// Created on: 1997-06-19
// Created by: Christophe LEYNADIER
// 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 t... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
void fun(int A){
vector<vector<int> > v;
vector<vector<int> > ::iterator it;
int mat[2*A-1][2*A-1];
int l = 2*A-1;
int r = A-1,c = A-1;
int ... |
#include "glib.h"
#include "iostream"
int main()
{
GLIB obj("file://myconnections.xml");
obj.writeTest("test_REG");
return 0;
}
|
#include <iostream>
#include <stdlib.h>
#include "MultiMap.h"
using namespace std;
int main() {
MultiMap<string,int> myMultiMap;
myMultiMap.add("key1",5);
myMultiMap.add("key2",4);
myMultiMap.add("key2",7);
myMultiMap.add("key1",9);
cout << myMultiMap;
cout << "After removeByKey"<<endl;
myMultiMap.removeByKey(... |
#ifndef MOUSE_EVENT_HANDLER_H
#define MOUSE_EVENT_HANDLER_H
namespace sf
{
class Event;
class RenderWindow;
}
namespace Platy
{
namespace Game
{
class MouseEventHandler
{
public:
MouseEventHandler() = delete;
~MouseEventHandler() = default;
static void HandleEvent(const sf::Event& anEvent, const s... |
#include <iostream>
using namespace std;
union tipo1{
float f;
char c[4];
};
int main()
{
tipo1 A;
A.f = 13.5;
for(int i=0;i<=3;i++)
cout << "A.c[" << i << "]= " << A.c[i] << endl;
return 0;
}
|
#include "sudoku/LedSolver.h"
LedSolver::LedSolver()
{
//hog = NULL;
}
//void LedSolver::init(const char* file)
void LedSolver::init()
{
//svm = SVM::create();
//svm = svm->load(file);
kernel = getStructuringElement(MORPH_RECT, Size(3, 3));
//hog = new cv::HOGDescriptor(cvSize(28, 28), cv... |
#include <iostream>
#include "helpersStudent.h"
#include "Student.h"
int main()
{
std::string name;
std::string last_name;
std::string subjet_name;
int age;
/* Task 34 */
fillStiudentParameters(name, last_name, subjet_name, age);
Student first_student(name, last_name, subjet_name, age);
... |
// PropPg2.cpp : 实现文件
//
#include "stdafx.h"
#include "MyProp.h"
#include "PropPg2.h"
// CPropPg2 对话框
IMPLEMENT_DYNCREATE(CPropPg2, CPropertyPage)
// 消息映射
BEGIN_MESSAGE_MAP(CPropPg2, CPropertyPage)
END_MESSAGE_MAP()
// 初始化类工厂和 guid
// {8895306F-6D49-4B6B-9F65-1343B8ADCFE0}
IMPLEMENT_OLECREATE_EX(CPropPg2, "... |
#include "Indicator.h"
#include "NamedValue/NamedValue.h"
#include "Tree.h"
// :: Constants ::
const QString NAME_JSON_KEY = "name";
const QString VALUE_JSON_KEY = "value";
// :: Serilizable ::
QJsonObject Indicator::toJson() const {
QJsonObject json;
json[NAME_JSON_KEY] = getName();
json[VALUE_JSON_... |
/*
* target.h
* deflektor-ds
*
* Created by Hugh Cole-Baker on 18/12/2008.
*
*/
#ifndef deflektor_target_h
#define deflektor_target_h
#include "tile.h"
class Level;
class Target : public Tile
{
protected:
const unsigned int tileBase;
Level* const level;
unsigned int state;
unsigned int frameCounter... |
#include "Plugin.h"
#include "Netmap.h"
#include <iosource/Component.h>
namespace plugin { namespace Zeek_Netmap { Plugin plugin; } }
using namespace plugin::Zeek_Netmap;
plugin::Configuration Plugin::Configure()
{
AddComponent(new ::iosource::PktSrcComponent("NetmapReader", "netmap", ::iosource::PktSrcComponent:... |
#include <iostream>
#include <cmath>
#include <string>
#include <unistd.h>
#include <fcntl.h>
#include <error.h>
#include <cstring>
#include <fstream>
#include <deque>
#include "./Node.hpp"
#define NEXT 0
using std::getline;
using std::cout;
using std::endl;
using std::string;
using std::ifstream;
using std::deque... |
#include "PropertyObjectWidget.hpp"
#include "ui_PropertyObjectWidget.h"
#include "PropertyObjectModel.hpp"
#include "PropertyItemDelegate.hpp"
using namespace Maint;
PropertyObjectWidget::PropertyObjectWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::PropertyObjectWidget)
{
_model = new PropertyObj... |
#pragma once
#include <iberbar/Lua/LuaBase.h>
#include <iberbar/Lua/LuaCppCommon.h>
#include <iberbar/Utility/Result.h>
#include <functional>
namespace iberbar
{
namespace Lua
{
class CClassBuilder;
class CEnumBuilder;
class CVariableBuilder;
class CBuilder;
class CScopeBuilder;
typedef void (PHowToBui... |
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "Kismet/GameplayStatics.h"
#include "SMITElabs/Public/SLGod.h"
#include "SMITElabsGameModeBase.generated.h"
class UGameplayStatics;
class ASLGod;
/**
*
*/
UCLASS()
class SMITE... |
// Created on: 1994-02-18
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... |
int main()
{
int lim = 1e6;
Segtree st(lim+100);
int n, m, y, x, l, r;
cin >> n >> m;
int open=-1, close=INF; // open -> check -> close
vector< pair<int, pii> > sweep;
ll ans = 0;
for(int i=0;i<n;i++){ // horizontal
cin >> y >> l >> r;
sweep.pb({l, {open, y}});
... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#include "include/Logica.h"
#include <iostream>
/////////////////////////Variables////////////////////////////////
string id, nombre, idb, idp;
int dia, mes, anio;
float cargaDespacho;
//////////////////////////////////////////////////////////////////
int main()
{
int opcion = 21;
int opc = 0;
while (opc... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// 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.... |
#ifndef TREEFACE_SCENE_GUTS_H
#define TREEFACE_SCENE_GUTS_H
#include "treeface/scene/Scene.h"
#include "treeface/scene/SceneNode.h"
namespace treeface {
TREECORE_ALN_BEGIN(16)
struct Scene::Guts
{
TREECORE_ALIGNED_ALLOCATOR(Scene::Guts);
treecore::RefCountHolder<SceneNode> root_node = new SceneNode();... |
#ifndef Core_GItemListCtrlItem_h
#define Core_GItemListCtrlItem_h
#include "GStateListCtrlItem.h"
#include "GnINumberLabel.h"
class GItemListCtrlItem : public GStateListCtrlItem
{
GnDeclareRTTI;
private:
bool mCreateLabelPrice;
GnINumberLabel mLabelPrice;
GnINumberLabel mItemCount;
GnInterfacePtr mp... |
#include <iostream>
using namespace std;
class node{
public:
int data;
node* next;
};
class linkedList{
private:
node* head;
node* tail;
int k;
public:
linkedList(){
head = NULL;
tail = NULL;
k=0;
}
void addNode(int d){
node* temp = new node; //imp
temp->data = d;
... |
#ifndef __maze3dflyer_h__
#define __maze3dflyer_h__
#include <stdlib.h>
#include <gl/glut.h>
#include "glCamera.h"
extern void debugMsg(const char *str, ...);
extern void errorMsg(const char *str, ...);
extern void setMainMsg(float secs, const char *str, ...);
extern glCamera Cam;
extern float keyT... |
// -----------------------------------------------------------------------------
// TrackingAction.h
//
//
// * Author: Everybody is an author!
// * Creation date: 4 August 2020
// -----------------------------------------------------------------------------
#ifndef TRACKING_ACTION_H
#define TRACKING_ACTION_H 1
... |
class Ant {
private:
byte x, y, dir;
void turn();
public:
Ant() {
init();
}
void init(byte _x, byte _y, byte _dir) {
x = _x;
y = _y;
dir = _dir;
}
void init() {
init(random(0, BM_SIDE), random(0, BM_SIDE), random(0,4));
}
void walk(B... |
#include "stdio.h"
#include "conio.h"
#include "string.h"
void main(){
clrscr();
FILE *fptr;
char *name; int count=0;
printf("Enter File Name : ");
gets(name);
strcat(name,".txt");
char ch[80];
fptr=fopen(name,"r+");
while(fgets(ch, 80, fptr)!=NULL)
/*if(ch==(char)32)... |
/****************************************************************
* TianGong RenderLab *
* Copyright (c) Gaiyitp9. All rights reserved. *
* This code is licensed under the MIT License (MIT). *
*****************************************************************/
#include "Diagnostics/Win32Exception.hpp"
#... |
/*
Copyright (c) 2018-2019, tevador <tevador@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditio... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
int main(){
int N;
cin >> N;
string S,T;
cin >> S >> T;
string X;
for(int i = 0; i < N; i++){
X.push_back(S.at(i));
X.push_back(T.at(i));
}
... |
#ifndef BONUSBOMB_H
#define BONUSBOMB_H
#include "Element.h"
#include "xil_types.h"
class BonusBomb : public Element
{
public:
BonusBomb();
void Init() override;
uint8_t IsCollidable() const override;
uint8_t IsFireCollidable() const override;
uint8_t Code() const override;
};
#endif |
#include <iostream>
#include <vector>
using namespace std;
#include "TH1D.h"
#include "TH2D.h"
#include "TFile.h"
#include "TTree.h"
#include "TNtuple.h"
#include "SetStyle.h"
#include "PlotHelper4.h"
#include "CommandLine.h"
#include "ProgressBar.h"
#include "TauHelperFunctions2.h"
int main(int argc, char *argv[]);... |
/* Author: Mincheul Kang */
#ifndef HARMONIOUS_SAMPLING_MANIPULATIONREGION_H
#define HARMONIOUS_SAMPLING_MANIPULATIONREGION_H
#include <moveit/planning_scene_interface/planning_scene_interface.h>
#include <moveit/planning_scene_monitor/planning_scene_monitor.h>
#include <moveit_msgs/GetPlanningScene.h>
#include <move... |
#include <iostream>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <vector>
const int size = 5;
//LOOK AT selectionSort AND swap, SWAPPING ARRAY ELEMENTS BY REFERENCE
// swap values at memory locations to which
// element1Ptr and element2Ptr point
void swap(int* const element1Ptr, in... |
#pragma once
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
//#include <sstream>
#include "TFile.h"
#include "TTree.h"
#include "TH1F.h"
#include <TObject.h>
#include "TString.h"
#define NFEC 4
#define NAPV 16
#define NCH 128
#define DISCARD_THRESHOLD 200
using namespace std;
class RootFil... |
#ifndef REFERENCE_GKNP_KERNELS_H_
#define REFERENCE_GKNP_KERNELS_H_
/* -------------------------------------------------------------------------- *
* OpenMM-GKNP *
* -------------------------------------------------------------------------- */
#include "GK... |
#include <gtk/gtk.h>
#include <string>
#include <stdbool.h>
#include <cmath>
#include <iostream>
#include <fstream>
#define MAX_X 43
#define MAX_Y 33
#define W_SOR 1.8
#define PRECISAO_CONVERGENCIA 0.00001
using namespace std;
typedef struct {
int x;
int y;
} posicao;
typedef struct{
float matPot[MAX_Y][MAX_... |
#include <assert.h>
#include <chrono>
#include <iostream>
#include <petunia/petunia.h>
#include <petunia/ipc_medium.h>
#include <petunia/message.h>
#include <petunia/osutils.h>
#define CHANNEL_PATH_SUBFOLDER "petunia/"
namespace Petunia
{
Petunia::Petunia(IPCMedium* medium)
: m_ipc_medium(medium)
{
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2009 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 _MIMEUTIL_H_
#define _MIMEUTIL_H... |
#include "Node.h"
#include "Mesh.h"
class ClosestPointQuery
{
public:
ClosestPointQuery(const Mesh& mesh);
//!finds the closest point to mesh within the specified maximum search distance.
//!returns whether the search was successful or not.
bool operator()(const Point& queryPoint, float maxDist, Point& clo... |
#ifndef GENOTYPE_H
#define GENOTYPE_H
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/gzip.... |
#pragma once
#include <vulkan\vulkan.h>
#include <stdexcept>
static void vkOk(VkResult vkResult, const char * message) {
if (vkResult != VK_SUCCESS) throw std::runtime_error(message);
}
static void vkOk(VkResult vkResult) {
vkOk(vkResult, "Vulkan call failed!");
} |
#include "policies.hpp"
using mgr_t = WidgetManager1<OpNewCreator>;
void test0() {
mgr_t mgr{};
Widget* w = mgr.Create();
//mgr.SwitchPrototype(w); will work only for PrototypeCreator policy
}
int main() {
return 0;
}
|
/*
warrior.hpp
Purpose: Represent a warrior. A warrior is any of the characters in the game. This class is abstract, and should therefore never be instantiated. Instead instantiate a subclass-- Player or Enemy.
@author Jeremy Elkayam
*/
#pragma once
#include <cmath>
#include <SFML/Graphics.hpp>
#include <iostr... |
//By SCJ
//#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int unsigned int
int e[1005];
void pfip(int x)
{
for(int i=0;i<4;++i)
{
if(i) cout<<'.';
int tp=(x<<(i*8));
tp=(tp>>24);
cout<<tp;
}
}
main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
while(cin>>n)
{
... |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 100
struct disjoin{
int group[MAXN+5];
void init(){
for(int i = 0 ; i < MAXN+5 ; i++ )
group[i] = i;
}
int find(int k){
return group[k]==k ? k:(group[k]=find(group[k]));
}
void uni(... |
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#define INT_MAX 0x7fffffff
#define INT_MIN 0x80000000
using namespace std;
string longestPalindrome(string s){
int l = s.length();
bool ... |
/*
* GroupSession.cpp
*
* Created on: Jun 11, 2017
* Author: root
*/
#include "GroupSession.h"
#include "../Log/Logger.h"
namespace CommBaseOut
{
GroupSession::GroupSession(Context * c):m_c(c)
{
}
GroupSession::~GroupSession()
{
}
void GroupSession::DeleteGroupSession(int group, int channel)
{
GUARD_WR... |
#pragma once
#include "RefCounter.h"
//参照を管理するシェーダーやオブジェクラスの基底クラス
class BufferBase
{
RefCounter *ref;
protected:
bool last() const{
return ref->count == 1;
}
bool newCounter(){
// 唯一のオブジェクトかどうか調べる
bool status(last());
// 元の参照カウンタの管理対象から外す
if (--ref->count == 0) delete ref;
// 新しい参照カウンタを作成して, それに付け替え... |
//===-- OR1KFrameLowering.cpp - OR1K Frame Information --------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <cstdio>
//#include <cstdlib>
... |
#include <display.h>
#include <texture.h>
#include <ctime>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
constexpr double PI = acos(-1);
Display::Display(int WIDTH, int HEIGHT)
{
this->WIDTH = WIDTH;
this->HEIGHT = HEIGHT;
this->gRenderer = NULL;
this->gW... |
#pragma once
#include "EnemyLogicCalculator.h"
class EnemyPatrollingVerticallyLogicCalculator : public EnemyLogicCalculator
{
public:
EnemyPatrollingVerticallyLogicCalculator();
~EnemyPatrollingVerticallyLogicCalculator();
public:
void computeLogic();
private:
bool m_patrolling;
float m_referencePosX;
float m_re... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Job.cpp
* Author: ssridhar
*
* Created on October 11, 2017, 1:06 PM
*/
#include "Job.h"
/**
* Set_J... |
/*
* 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/QuicTransportBase.h>
#include <folly/Chrono.h>
#include <folly/ScopeGuard.h>
#include <quic/api/LoopDetectorC... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#include "modul... |
#include<iostream>
#include<map>
using namespace std;
int main(){
map<int,int> mp;
mp[0]=0;
mp[1]=1;
mp[0]=10;
for(auto it=mp.begin();it!=mp.end();it++){
cout<<it->second<<" ";
}
return 0;
}
|
#include <stdio.h>
#include <errno.h>
#include <QMessageBox>
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->pushButton_burn, SIGNAL(clicked()), this, SLOT(burnMacAdr()));
con... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
/** @brief main() and associated functions for the plugin wrapper
... |
#ifndef HUMANB_HPP
# define HUMANB_HPP
# include <string>
# include <iostream>
# include "Weapon.hpp"
class HumanB
{
private:
const std::string name_;
const Weapon *weapon_;
HumanB();
public:
void attack(void) const;
void setWeapon(const Weapon &new_weapon);
HumanB(const std::string &name, const... |
#pragma once
#include <iostream>
#include <string>
#include <vector>
using namespace std;
struct ChatRoom;
struct Person {
string name;
ChatRoom* room = nullptr;
vector<string> chat_log;
explicit Person(const string& name);
void say(const string& message) const;
void receive(const string& origin, const... |
//Program to check if the given number is even or odd.
#include<iostream>
using namespace std;
int main()
{
int n, rem; //n-number, rem-reminder
cout<<"enter the number:\n";
cin>>n;
rem=n%2;
if(rem == 0)
{
cout<<n<<" is an even number";
}
else
{
cout<<n<<" is a odd number... |
#include "functionGenerator.h"
using namespace qReal;
using namespace robots::generator;
void FunctionGenerator::generateBodyWithoutNextElementCall()
{
QByteArray byteFuncCode = mNxtGen->mApi->stringProperty(mElementId, "Body").toUtf8();
byteFuncCode.replace("Сенсор1", "ecrobot_get_sonar_sensor(NXT_PORT_S1)");
by... |
#pragma once
#include <iostream>
#include "Game.h"
#include <exception>
int main(int argc, char *argv[])
{
Game game;
if (!game.init())
{
throw new std::exception("Erro ao inicializar o jogo");
}
game.start();
game.close();
return 0;
}
|
#include <SoftwareSerial.h>
int buzzPin = 8;
int inputPin = 4;
int pirState = LOW;
int val = 0;
int blueTx = 2;
int blueRx = 3;
SoftwareSerial mySerial(blueTx, blueRx);
String myString = "";
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
pinMode(buzzPin, OUTPUT);
pinMode(inputPin, INPUT);
}
... |
#ifndef BITMAP_TEXT_RENDERER_HPP_
#define BITMAP_TEXT_RENDERER_HPP_
#include "TextRendererInterface.h"
#include <unordered_map>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <GL/glut.h>
class BitmapTextRenderer : public TextRendererInterface {
private:
typedef std::unordered_map<int, void... |
#include "Test.h"
std::string Test::operator()(char c)
{
if(c >= '0' && c <= '9')
return "NUM";
}
|
// C headers
#include <cstdint>
#include <cstdlib>
#include <ctime>
// C++ headers
#include <array>
#include <iostream>
#define EIGEN_DONT_VECTORIZE
// 3rd-party library headers
#include <Eigen/Core>
// local headers
#include "compute.hpp"
/**
@brief This example is supposed to demonstrate the intended use of th... |
#ifndef CHANNEL_HH
#define CHANNEL_HH
#include "task.hh"
#include <memory>
#include <queue>
#include <deque>
namespace ten {
// based on bounded_buffer example
// http://www.boost.org/doc/libs/1_41_0/libs/circular_buffer/doc/circular_buffer.html#boundedbuffer
struct channel_closed_error : std::exception {};
//! se... |
#ifndef __Core__GnSQLiteQuery__
#define __Core__GnSQLiteQuery__
class sqlite3_stmt;
class GnSQLiteQuery
{
enum
{
GNSQLITE_NULL = 5,
};
private:
sqlite3_stmt* mpStatement;
bool mEof;
guint mColumnCount;
public:
GnSQLiteQuery(sqlite3_stmt* pStatement, bool bEof);
virtual ~GnSQLiteQuery()... |
/*This is a user defined header file which will be included in every source code file as it cotains predefined headers,function prototypes and other statemens*/
#ifndef header_assignment2_h /*This is used to check if the statements in this header file are defined in other files where this header is included */
#define ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.