text stringlengths 8 6.88M |
|---|
#define _USE_MATH_DEFINES
#include <cmath>
#include <string>
#include "linalg.h"
using std::string;
/*
*
* Выражение для энергетического спектра (в декартовых координатах)
*
*/
double energy(const Point & p);
/*
*
* Выражение для энергетического спектра (в полярных координатах)
*
*/
double ene... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n;
ll h, a, b, c, d, e;
cin >> n >> h >> a >> b >> c >> d >> e;
} |
#ifndef CONTINUOUS_TIME_COLLISION_HANDLER_H
#define CONTINUOUS_TIME_COLLISION_HANDLER_H
#include "CollisionHandler.h"
#include <vector>
#include <iostream>
class ContinuousTimeCollisionHandler : public CollisionHandler
{
public:
ContinuousTimeCollisionHandler(double COR) : CollisionHandler(COR) {}
virtu... |
#ifndef NOTES_H_INCLUDED
#define NOTES_H_INCLUDED
#include<string>
#include "timing.h"
#include <ctime>
using namespace TIME;
using namespace std;
/*********************************************************************/
/*********************************************************************
*** ... |
/* -*-C++-*- */
/*
* Copyright 2016 EU Project ASAP 619706.
*
* 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 appl... |
// Copyright (c) 2015 Alireza Kheirkhahan
// Copyright (c) 2014 Shuangyang Yang
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if !defined(HPX_COMPONENTS_IO_LOCAL_FILE_HPP_AUG_26_2014_1102AM)
#define HPX_C... |
//
// Car.cpp
// w06_h02_pathfollow2
//
// Created by Kris Li on 10/14/16.
//
//
#include "Car.hpp"
Car::Car(){
pos.x = ofRandom(0,100);
pos.y = ofRandom(ofGetHeight());
maxspeed = 10;
maxforce = 10;
r = ofRandom(2,4);
}
void Car::init(ofPoint _start, ofPoint _end){
// ofPoint sta... |
//===========================================================================
//! @file light_point.cpp
//! @brife 点光源
//===========================================================================
//---------------------------------------------------------------------------
//! 初期化
//----------------------------------... |
#include "dbg.h"
namespace dbg
{
int Dbg::loglevel = WARN;
std::ostream *Dbg::out = &std::cout;
} // namespace dbg
|
//
// Created by Vasili Siachko on 14.12.2019.
//
#include <iostream>
#include "Shape2d.h"
Shape2d::~Shape2d() {
}
double Shape2d::GetPerimeter() {
return perimeter;
}
|
#include <windows.h>
#include <thread>
#include "SocketHelper.h"
#include "TCPSocket.h"
#include "UDPSocket.h"
CTcpSocketHandler::CTcpSocketHandler()
{
this->SetAutoReConnect(false);
this->SetRecvFlag(false);
m_clientSocket = INVALID_SOCKET;
}
CTcpSocketHandler::~CTcpSocketHandler()
{
}
int CTc... |
#pragma once
/****************************************************************************
* Copyright (c) 2013 GeoMind Srl. www.geomind.it
* All rights reserved.
*
*---------------------------------------------------------------------------
* This software is part of the GeoFlyerPro PROJECT by GeoMind Srl... |
// Created on: 2018-12-12
// Created by: Olga SURYANINOVA
// Copyright (c) 2018 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 Lesser General Public License version 2.1 as p... |
#include "stdafx.h"
#include "PrimListAlgorithm.h"
#include <iostream>
PrimListAlgorithm::PrimListAlgorithm(Graph2 & graph):PrimMatrixAlgorithm(graph)
{
}
PrimListAlgorithm::~PrimListAlgorithm()
{
}
void PrimListAlgorithm::updatePriorityQueue(int u)
{
for (int i = 0; i < graph.neighborhoodListTable[u].size(); i++... |
1 //这是一个epoll的服务器程序
2 #include <iostream>
3 #include <sys/epoll.h>
4 #include <sys/socket.h>
5 #include <netinet/in.h>
6 #include <unistd.h>
7 #include <string.h>
8 #include <stdlib.h>
9 #include <arpa/inet.h>
10 using namespace std;
11 void ProcessConnect(int listen_fd, int epoll_fd)//连接到来
12 {
13... |
/* template number
*
*
*
*/
#include<stdio.h>
#include<cstring>
#include<iostream>
#include<algorithm> // std::sort
#include<cstring>
#include<vector>
#include<set>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<unordered_set>
#include<unordered_map>
using namespace std;
cl... |
#include "StdAfx.h"
#include "VoxelHash.h"
VoxelHash::VoxelHash(void)
{
m_hashMat = nullptr;
}
VoxelHash::~VoxelHash(void)
{
if (m_hashMat)
{
for (size_t i = 0; i < m_dimSize[0]; i++)
{
for (size_t j = 0; j < m_dimSize[1]; j++)
{
delete []m_hashMat[i][j];
}
delete []m_hashMat[i];
}
}
dele... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 2003-2007 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// shuais
//
#include "core/pch.h"
#include "adjunct/quick/manage... |
/*
Copyright (c) 2015, Vlad Mesco
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 conditions and the follo... |
// PIN SETUP CODE
// pwm pins: 4, 14, 15
#define motorPin1 4
#define motorPin2 14
#define motorPin3 15
#define directionPin1 1
#define directionPin2 2
#define directionPin3 3
// encoder pins: 5, 6, 7, 8
#define encoderPin1A 5
#define encoderPin1B 6
#define encoderPin2A 7
#define encoderPin2B 8
// analog pins: 11 to 2... |
/*You are given an integer array nums. The unique elements of an array are the elements that
appear exactly once in the array.Return the sum of all the unique elements of nums.*/
class Solution {
public:
int sumOfUnique(vector<int>& nums) {
int f[100]={0};
for(int i=0;i<nums.size();i++)
... |
#pragma once
#include "Cell.h"
class map
{
public:
map();
};
|
#include <iostream>
#include <cryptopp/hmac.h>
#include <cryptopp/sha.h>
#include "bip32.h"
unsigned char * hd_master( unsigned char * y, const unsigned char * x )
{
try
{
CryptoPP::HMAC< CryptoPP::SHA512 > hmc( reinterpret_cast<const byte*>( "Bitcoin seed" ), 12);
hmc... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCursesLabelWidget.h"
#include "cmCursesWidget.h"
cmCursesLabelWidget::cmCursesLabelWidget(int width, int height, int left,
... |
#ifndef NMOS_CLOCK_NAME_H
#define NMOS_CLOCK_NAME_H
#include "cpprest/basic_utils.h"
#include "nmos/string_enum.h"
namespace nmos
{
// Clock name
// See https://github.com/AMWA-TV/nmos-discovery-registration/blob/v1.2/APIs/schemas/clock_internal.json
// and https://github.com/AMWA-TV/nmos-discovery-regist... |
/*
* 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.
*/
#pragma once
#include <quic/api/QuicTransportBase.h>
#include <quic/api/QuicTransportFunctions.h>
#include <quic/codec/Connectio... |
// Project
#include "Example.h"
#include "Settings.h"
Example::Example() {
Q_UNUSED(APP_NAME);
}
Example::~Example() {
}
|
#include "activity_mgr_merge.hpp"
#include "prepare.hpp"
#include "utils/log.hpp"
#include "utils/proto_utils.hpp"
#include "utils/assert.hpp"
namespace nora {
void activity_mgr_merger::start() {
ASSERT(st_);
st_->async_call(
[this] {
... |
// Copyright (c) 2013 Nick Porcino, All rights reserved.
// License is MIT: http://opensource.org/licenses/MIT
#include "LandruVM/MachineCache.h"
#include "LandruVM/Exemplar.h"
#include "LandruVM/Fiber.h"
#include "LandruVM/VarObj.h"
#include <string.h>
#define MAX_STACK_DEPTH 32
#define MAX_VARS 32
namespace Land... |
#include "Game.h"
#include "MenuState.h"
#include "PlayState.h"
#include "HexaState.h"
#include "GameObject.h"
#include "LoaderParams.h"
#include "SDLGameObject.h"
#include "TextureManager.h"
#include "MenuButton.h"
#include "Block.h"
const std::string MenuState::s_menuID = "MENU";
void MenuState::update()
{
for (in... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//AC in one go. Good dp. Box stacking problem.
vector<vector<ll>> cubes(30, vector<ll>(3,-1));
vector<vector<ll>> dp(2501,vector<ll>(2501,-1));
ll n,min_area;
ll dp_rec(ll i, ll j){
if(dp[i][j]!=-1) return dp[i][j];
if(i*j < min_area){
return 0;
... |
#include "pch.h"
#include "phrasetable.h"
#include<string.h>
#include<stdio.h>
using namespace std;
phrasetable::phrasetable()
{
head = NULL;
}
void phrasetable::AddNode(char *str,int count)
{
if (str == NULL)return;
if (head == NULL)
{
head = new phrase;
strcpy_s(head->content, str);
head->count = count;
... |
//
// Created by roy on 12/18/18.
//
#include "LineParser.h"
/**
* Constructor of LineParser, used for parsing single line.
* @param symbolTable symbol table for variables access.
* @param dataReaderServer data reader server for the check if in bind table.
* @param dataSender data sender for the execution of send... |
// LeastSquares.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <iostream>
using namespace std;
vector<float> get_jth_col(vector<vector<float>>&B, int J) {
vector<float>col;
for (int i = 0; i < (int)B.size(); i++) {
for (int j = 0; j <(int)... |
#pragma once
#include <Dot++/parser/ParserStateInterface.hpp>
#include <Dot++/Exceptions.hpp>
#include <Dot++/lexer/Token.hpp>
#include <Dot++/lexer/TokenType.hpp>
#include <vector>
namespace dot_pp { namespace parser { namespace states {
template<class ConstructionPolicy>
class ReadAttributeEqualState : pu... |
int t[1001][1001];
int recur(string a, string b, int m, int n){
if(m < 0)
return n + 1;
if(n < 0)
return m + 1;
if(t[n][m] != -1)
return t[n][m];
if(a[m] == b[n])
return t[n][m] = recur(a, b, m-1, n-1);
else{
//m,n-1 is basically inserting a char in A that is not matching
//m-1,n-1 is re... |
#ifndef MYXML_H
#define MYXML_H
#include<QPoint>
#include <QtXml>
#include<QFile>
#include<QDebug>
#include<QPaintDevice>
#include<QPainter>
#include<QPaintEngine>
//#include "myxml_global.h"
struct MyRect
{
QString name;
QPoint start;
QPoint end;
int width;
int height;
};
class INFO
{
public:
... |
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <vector>
#include <fstream>
#include <sstream>
#include <chrono>
#include "creads.h"
//#include "config.h"
#include "cseq.h"
#include "mst.h"
#include "trail.h"
using na... |
#include "Particle.h"
#include <stdlib.h>
#include <math.h>
namespace pawstef {
Particle::Particle(): m_x(0), m_y(0)
{
init();
}
void Particle::init()
{
m_x=0;
m_y=0;
direction = (2* M_PI*rand())/RAND_MAX;
speed = (0.04* rand())/RAND_MAX;
speed *= speed;
}
Particle::~Par... |
//
// meshingalgs.h
// Total Control
//
// Created by Parker Lawrence on 8/23/15.
// Copyright (c) 2015 Parker Lawrence. All rights reserved.
//
#ifndef __Total_Control__meshingalgs__
#define __Total_Control__meshingalgs__
#include <stdio.h>
#include <vector>
#include "glm/glm.hpp"
//
//
//class Voxel8x8x8 {
// ... |
( English:'English';
Native:'American English';
LangFile:'english.lang';
DicFile:'english.dic';
FlagID:'us';
Letters:'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z';
LetterCount:'9,2,2,4,12,2,3,2,9,1,1,4,2,6,8,2,1,6,4,6,4,2,2,1,2,1';
LetterValue:'1,3,3,2,1,4,2,4,1,8,5,1,3,1,1... |
#pragma once
#ifndef VIEW3D_WINDOW_H
#define VIEW3D_WINDOW_H
#include <stddef.h>
#define IMGUI_DEFINE_MATH_OPERATORS
#include "imgui/imgui.h"
#include "imgui/imgui_internal.h"
#include "wimgui/window.h"
#include "painter3d.h"
namespace wimgui {
class painter3d;
class view3d : public window
{
private:
std::vecto... |
//
// Created by 송지원 on 2020/06/29.
//
//바킹독 9강 BFS boj1926
#include <iostream>
#include <queue>
#include <utility>
using namespace std;
#define X first
#define Y second
int N, M;
int dat[502][502];
bool vis[502][502];
int CNT = 0;
int MAX = -1;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
... |
// TerrainLightDialog.cpp : 实现文件
//
#include "stdafx.h"
#include "Editor.h"
#include "OgreEditor.h"
#include "TerrainLightDialog.h"
// CTerrainLightDialog 对话框
IMPLEMENT_DYNCREATE(CTerrainLightDialog, CDialog)
CTerrainLightDialog::CTerrainLightDialog(CWnd* pParent /*=NULL*/)
: CDialog(CTerrainLightDial... |
//
// GameBegin.cpp
// GetFish
//
// Created by zhusu on 15/5/12.
//
//
#include "GameBegin.h"
#include "Common.h"
#include "Tools.h"
#include "GameScene.h"
GameBegin* GameBegin::create(int score,int type,int fishID,int num,int tishi1,int tishi2)
{
GameBegin* map = new GameBegin();
if(map && map->init... |
# include <iostream>
using namespace std;
int main1() {
// 变量创建 数据类型 变量名 = 初始值
int a = 10;
cout << "a=" << a << endl;
cout << "hello world" << endl;
system("pause");
return 0;
}
|
// Strongly-connected components
const int maxn = 222;
vector<int> g[maxn]; // <-- input data
int comp[maxn]; // <-- result here ;)
bool visit[maxn];
vector<int> revg[maxn];
vector<int> que, component;
int last_comp_id;
void dfs_fwd(int v) {
visit[v] = true;
for (int u : g[v]) if (!visit[u]) dfs_fwd(u);
... |
#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... |
// Copyright (c) 2017 Mozart Alexander Louis. All rights reserved.
// Includes
#include "base_entity.hxx"
#include "engines/tmx/tmx_engine.hxx"
BaseEntity::BaseEntity(BaseGameScene* scene, ValueMap params, const string& tmx_layer)
: direction_(NONE),
game_scene_(*scene),
stats_(std::move(params)),
... |
/**
******************************************************************************
* Copyright (c) 2019 - ~, SCUT-RobotLab Development Team
* @file : referee.h
* @author : Lingzi_Xie 1357657340@qq.com
* @brief : Code for communicating with Referee system of Robomaster 2021.
************************... |
#pragma once
#ifndef WIMGUI_WINDOW_H
#define WIMGUI_WINDOW_H
#include <stddef.h>
#define IMGUI_DEFINE_MATH_OPERATORS
#include "../imgui/imgui.h"
#include "../imgui/imgui_internal.h"
namespace wimgui {
class docker;
class window {
bool visible = true;
const char *title = nullptr;
docker *dock = nullptr;
ImGuiW... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define S 20
#define T 20
int dp_1[S][T] = {0};
int dp_2[S][T][2] = {0};
int dp_3[S][T] = {0};
int dp_sumCommonPartString(string s , string t){
for (int i = 0; i < s.size(); i++)
{
for (int j = 0; j < t.size(); j++)
{
... |
#include <iostream>
#include <string>
#include "src/data.h"
#include "src/decision_tree.h"
#include "src/random_forest.h"
#include "src/metrics.h"
#include "src/time_measurement.h"
int main() {
std::string train_dataset_filename = "../data/train.csv";
std::string val_dataset_filename = "../data/val.csv";
... |
#include "dbcontroler.h"
QSqlDatabase DBControler::mydb;
bool DBControler::OpenDB(){
if(mydb.isOpen()) return true;
mydb=QSqlDatabase::addDatabase("QSQLITE");
mydb.setDatabaseName("dic.db");
if( !mydb.open() ){
qDebug() << "Open DB Error\n";
}
/*
QSqlQuery query(mydb);
... |
#include "VariableEntryWidgetGTK.h"
void VariableEntryWidgetGTK::onInternalDataChange()
{
onChangeSignal.emit();
}
/**************************************************************
*
* StringVariableEntryWidgetGTK
*
* ************************************************************/
StringVariableEntryWidgetGTK::S... |
#include <iostream>
#include <string>
int main() {
std::string firststr;
getline(std::cin, firststr);
std::string comarSeparator = ",";
std::string witeSpace = " ";
for (int i = 0; i < firststr.size(); ++i) {
if (firststr[i]==comarSeparator[0]) {
firststr[i]=witeSpace[0];
... |
/* -*- 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.
**
** This is the abstract interface class that's used for drawing th... |
//
// Search.hpp
// A_STAR
//
// Created by Reb and Santi on 1/30/18
// Copyright 2018 Smols. All rights reserved.
//
#ifndef Search_hpp
#define Search_hpp
class Search
{
private:
Graph g;
public:
Search(Graph g) : g(g) {};
friend std::ostream &operator<<(std::ostream &os, Search &s);... |
#ifndef SENDER_H
#define SENDER_H
#include <QWidget>
#include <QtNetwork>
#include <QFont>
#include <QDebug>
#include "m580_button.h"
#include "ui_sender.h"
class Sender : public QWidget, private Ui::Sender
{
Q_OBJECT
public:
Sender();
~Sender();
void WriteText(QString text);
void setroot(bool c)... |
#include <cppunit/extensions/HelperMacros.h>
#include "cppunit/BetterAssert.h"
#include "util/ClassInfo.h"
using namespace std;
namespace BeeeOn {
class ClassInfoTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(ClassInfoTest);
CPPUNIT_TEST(testEmptyConstructor);
CPPUNIT_TEST(testConstruct);
CPPUNIT_TEST(... |
/*
kamalsam
*/
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int n,t,i;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&n);
printf("%d\n",max(0,n-2));
}
return 0;
} |
#include "MyImage.h"
CMyImage::CMyImage(void)
{
m_pImage = NULL;
}
CMyImage::~CMyImage(void)
{
if (m_pImage)
delete m_pImage;
m_pImage = NULL;
}
void CMyImage::Load(char *lpstrFile)
{
if (m_pImage)
delete m_pImage;
WCHAR file[MAX_PATH];
MultiByteToWideChar(CP_ACP, NULL, lpstrFile, -1, file, MAX_PATH);
... |
#include "2-1.h"
#include <stdlib.h>
#define STACK_MAX 10
char stack[STACK_MAX];
int top = -1;
int Precedence(char ch) {
switch (ch) {
case '+':
return 12;
break;
case '-':
return 12;
break;
case '*':
return 13;
break;
case '/':
return 13;
break;
default:
return 0;
}
}
char POP() {
retur... |
// https://oj.leetcode.com/problems/multiply-strings/
class Solution {
string add(vector<string> &strs) {
int carry = 0;
string ret = "";
int idx = 0;
while (true) {
bool processed_all = true;
int sum = carry;
for (int i = 0; i < strs.si... |
#include <iostream>
#include <math.h>
using namespace std;
double babylonianRoot(double n){
return sqrt(n);
}
int main(){
double n;char a;
do{
cout<<"enter a value: ";
cin>>n;
cout<<"square root of "<<n<<" is "<<babylonianRoot(n)<<endl;
cout<<"continue? (y/n): ";
cin>... |
/** @file
*****************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and contributors (see AUTHORS).
* @copyright MIT license (see LICENSE file)
********************************************************************... |
#include "ogesolver.h"
|
#ifndef _CGetProductRoomConfig_h_
#define _CGetProductRoomConfig_h_
#pragma once
#include <string>
#include "CHttpRequestHandler.h"
class CGetProductRoomConfig : public CHttpRequestHandler
{
public:
CGetProductRoomConfig(){}
~CGetProductRoomConfig(){}
virtual int do_request(const Json::Value& root, ch... |
#ifndef FORMTSTATCONFIG_H
#define FORMTSTATCONFIG_H
#include "config.h"
#include <QWidget>
namespace Ui {
class FormTStatConfig;
}
class FormTStatConfig : public QWidget
{
Q_OBJECT
signals:
void SaveConfig();
public:
FormTStatConfig(SysConfig *config, DevSettings *devSettings, QWidget *parent = nullptr)... |
/******************************************************************************
* *
* Copyright 2018 Jan Henrik Weinstock *
* *
... |
#include <iostream>
using namespace std;
struct nod
{
int info;
nod *next;
};
nod *prim, *ultim;
void primul_element()
{
prim=new nod;
cout<<"Noul element ce urmeaza sa fie inserat in lista: ";
cin>>prim->info;
prim->next=NULL;
ultim=prim; ... |
#include <cmath>
#include <map>
#include <random>
#include <set>
#include "../space/initial_triangulation.hpp"
#include "../time/bilinear_form.hpp"
#include "heat_equation.hpp"
int bsd_rnd() {
static unsigned int seed = 0;
int a = 1103515245;
int c = 12345;
unsigned int m = 2147483648;
return (seed = (a * ... |
/*
* 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/common/test/TestUtils.h>
#include <fizz/crypto/test/TestUtil.h>
#include <fizz/protocol/clock/test/Mocks.h>
#incl... |
#pragma once
#include"ybBasicMacro.h"
#include"ybMatrix.h"
#include"ybVector.h"
NS_YB_BEGIN
class Math
{
public:
static void Multiply(Matrix4x4& out, const Matrix4x4& mat1, const Matrix4x4& mat2);
static void Multiply(Vector4& out, const Matrix4x4& mat, const Vector4& vec);
static void Identity(Matrix4x4& out);
s... |
#include <iomanip>
#include <stdexcept>
#include <string>
#include "performance.h"
#include "opencv2/core/cuda.hpp"
using namespace std;
using namespace cv;
using namespace cv::cuda;
void TestSystem::run()
{
if (is_list_mode_)
{
for (vector<Runnable*>::iterator it = tests_.begin(); it != tests_.end();... |
/*
* 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.
*/
#ifdef MVFST_USE_LIBEV
#include <glog/logging.h>
#include <quic/common/QuicEventBase.h>
namespace quic {
namespace {
void libE... |
#include <ionir/passes/pass.h>
namespace ionir {
Module::Module(ionshared::Ptr<Identifier> identifier, ionshared::Ptr<Context> context) :
Construct(ConstructKind::Module),
Identifiable(std::move(identifier)),
context(std::move(context)) {
//
}
void Module::accept(Pass &visi... |
// Question => Print all the possible subarray
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Please enter the size of array: ";
cin>>n;
int arr[n];
for(int i=0; i<n; i++){
cout<<"Please enter elements in the array: ";
cin>>arr[i];
}
// Printing all the... |
#include <reactor/net/TcpServer.h>
#include <assert.h>
#include <iostream>
#include <unistd.h>
#include <reactor/base/SimpleLogger.h>
#include <reactor/net/Channel.h>
#include <reactor/net/TcpConnection.h>
#include <reactor/net/TcpSocket.h>
using namespace std;
using namespace reactor::base;
namespace reactor {
nam... |
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<stack>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
using namespace std;
const int act[4][2] = {0,1,1,0,0,-1,-1,0};
const char sav[4] = {'R','D','L','U'};
struct node{
int x,y;
string path;
};
queue<n... |
// Copyright (c) 2016 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <pika/init.hpp>
#include <pika/runtime/config_entry.hpp>
#include <pika/strin... |
#include "CustomGraphicsView.h"
#include "View/MainWindow/MainWindow.h"
#include <QGraphicsProxyWidget>
#include <QDebug>
#include <QApplication>
#include <QDesktopWidget>
QSize CustomGraphicsView::getNormalSize()
{
return QSize(1920,1080);
}
CustomGraphicsView::CustomGraphicsView(QWidget *parent) : QGraphicsVie... |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <utility>
#include <vector>
using ll = long long;
template <typename Node>
class SegmentTree
{
public:
SegmentTree() = delete;
SegmentTree(const std::vector<ll>& numbers)
: m_size(numbers.size()),
m_height(... |
#ifndef _MSG_0X06_SPAWNPOSITION_STC_H_
#define _MSG_0X06_SPAWNPOSITION_STC_H_
#include "mcprotocol_base.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
class SpawnPosition : public BaseMessage
{
public:
SpawnPosition();
SpawnPosition(int32_t _x, int32_t _y, int32_t _z);
size_t serialize(Buffer& _dst, size... |
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
#include "../Projectile.h"
CLASS_DECLARATION( idPhysics_Base, rvPhysics_Particle )
END_CLASS
const float PRT_OVERCLIP = 1.001f;
const float PRT_BOUNCESTOP = 10.0f;
/*
================
rvPhysics_Particle::DropToFloorAndRest
Drops the ob... |
#include "op_info.h"
#include "Transaction.h"
#include "Ledger.h"
#include "Witness.h"
#include "util/keys.h"
#include "OpContext.h"
namespace credb
{
namespace trusted
{
Transaction::Transaction(IsolationLevel isolation, Ledger &ledger_, const OpContext &op_context_, LockHandle *lock_handle_)
: m_isolation(isola... |
#ifndef SparkComms_h
#define SparkComms_h
#define HW_BAUD 1000000
#include "BluetoothSerial.h"
// Bluetooth vars
#define SPARK_NAME "Spark 40 Audio"
#define MY_NAME "Heltec"
class SparkComms {
public:
SparkComms();
~SparkComms();
void start_ser();
void start_bt();
voi... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10071"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#endif
int speed,t... |
#include <chuffed/branching/branching.h>
#include <chuffed/core/engine.h>
#include <chuffed/core/propagator.h>
#include <chuffed/vars/modelling.h>
#include <cassert>
#include <cstdio>
class ProblemName : public Problem {
public:
// Constants
int n; // size of problem
// Core variables
vec<IntVar*> x; // some... |
#pragma once
#include "ARPG.h"
#include "Components/ActorComponent.h"
#include "Struct/SkillInfo/SkillInfo.h"
#include "Struct/SkillProgressInfo/SkillProgressInfo.h"
#include "SkillControllerComponent.generated.h"
UCLASS()
class ARPG_API USkillControllerComponent : public UActorComponent
{
GENERATED_BODY()
priv... |
#pragma once
#ifdef _WINDOWS
#include <GL/glew.h>
#endif
#include <SDL.h>
#include <SDL_opengl.h>
#include <SDL_image.h>
#include "SDL_mixer.h"
#include <vector>
#include "ShaderProgram.h"
#include "Matrix.h"
#include "Bullet.h"
#ifdef _WINDOWS
#define RESOURCE_FOLDER ""
#else
#define RESOURCE_FO... |
#include <bits/stdc++.h>
using namespace std;
// clang-format off
#define f first
#define s second
#define pb push_back
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)... |
#include <iostream>
#include <cstring>
using namespace std;
string sentence;
int num;
int count=0;
int main(){
ios_base :: sync_with_stdio(false);
cin.tie(0);
cin>>num;
cin.ignore();
while(num--){
getline(cin,sentence);
count=0;
int len = sentence.size();
for(int i = 0; i < len; i++){
if... |
/*
* File: Ojos.cpp
* Author: raul
*
* Created on 21 de enero de 2014, 20:47
*/
#include "Ojos.h"
Ojos::Ojos() {
}
Ojos::Ojos(GLdouble radio, GLdouble largo) : ObjetoCompuesto(2) {
_radio = radio;
_largo = largo;
_componentes[0] = new Cilindro(_radio, _radio, _largo, 40, 1);
_componentes[1... |
/*
* I2C address change for MLX90640
*/
#include <Wire.h>
#define DEBUG 1
// ==================
// SETUP
// ==================
void setup() {
#if defined(DEBUG)
Serial.begin(115200);
while (!Serial){
}
delay(44);
#endif
Wire.begin();
Wire.setClock(400000);
... |
#ifndef LIBSHARED_AND_STATIC_H
#define LIBSHARED_AND_STATIC_H
#include "libshared_and_static_export.h"
namespace libshared_and_static {
class Class
{
public:
int method() const;
int MYPREFIX_LIBSHARED_AND_STATIC_EXPORT method_exported() const;
int MYPREFIX_LIBSHARED_AND_STATIC_DEPRECATED method_deprecated() ... |
#pragma once
#include "Help.h"
#include "Radar.h"
#include "View.h"
namespace RLGM
{
struct ConstantBuffer1 //for vertex shader
{
DirectX::XMMATRIX mViewWorldProjection;
};
__declspec(align(16))
struct ConstantBuffer3 //for pixel shader
{
int radarId;
};
__declspec(align(16))
struct ConstantBuffer4 //f... |
/********************************************************************************
** Form generated from reading UI file 'error.ui'
**
** Created by: Qt User Interface Compiler version 5.9.4
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
*********************************************... |
//
// Created by ssi on 23.05.15.
//
#include "RSS.h"
#include "libxml++/libxml++.h"
namespace feed
{
std::vector< Stack< Post > > &RSS::readFeedFiles(const IDB &db, const std::string &path)
{
time_t lastDate;
using namespace boost::filesystem;
std::vector< Stack< Post > > *vector = new std::vector< Stack< Po... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, l, i, j, found;
while(cin>>n>>l)
{
found = 0;
while(n--)
{
cin>>i>>j;
if(i==l && j==0)
{
found++;
}
}
cout<<found<<"\n";
}
return... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.