text stringlengths 8 6.88M |
|---|
// OnHScrollThumbTrack.cpp
#include "OnHScrollThumbTrack.h"
OnHScrollThumbTrack::OnHScrollThumbTrack(HorizontalScroll *horizontalScroll)
:ScrollAction() {
this->horizontalScroll = horizontalScroll;
}
OnHScrollThumbTrack::OnHScrollThumbTrack(const OnHScrollThumbTrack& source)
:ScrollAction(source) {
this->horizon... |
#include "dialog2.h"
#include "ui_dialog2.h"
Dialog2::Dialog2(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog2)
{
ui->setupUi(this);
}
Dialog2::~Dialog2()
{
delete ui;
}
void Dialog2::on_buttonBox_accepted()
{
cat = new cat_rege;
cat->show();
}
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
//template <typename T>
void squares(vector<vector<int>> &ar)
{
for(int i = 0; i<5; ++i)
for(int j = 0; j<5; ++j)
{
ar[i][j] *= ar[i][j];
}
}
int main() {
std::vector<int> vi;
//std::vector<int> :: iterator i;
//s... |
#include <commentObj.h>
// #include <rose.h>
#include <string>
#include <map>
class DoxygenFile;
class DoxygenGroup;
class DoxygenComment
{
public:
/*! Create a new, blank DoxygenComment attached to the given node. */
DoxygenComment(SgLocatedNode *node);
/*! Create a DoxygenComment... |
#pragma once
#ifndef _DTL_SIMD_INCLUDED
#error "Never use <dtl/simd/intrin_avx2.hpp> directly; include <dtl/simd.hpp> instead."
#endif
#include "../adept.hpp"
#include <dtl/bits.hpp>
#include "types.hpp"
#include "immintrin.h"
namespace dtl {
namespace simd {
namespace internal {
namespace avx2 {
constexpr dtl::r... |
/*
* SPDX-FileCopyrightText: (C) 2014-2022 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RENDERVIEW_H
#define RENDERVIEW_H
#include <Cutelyst/action.h>
#include <Cutelyst/componentfactory.h>
#include <Cutelyst/cutelyst_global.h>
namespace Cutelyst {
class RenderViewPriva... |
//
// Copyright Jason Rice 2017
// 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)
//
#ifndef NBDL_WEB_ROUTE_HPP
#define NBDL_WEB_ROUTE_HPP
#include <nbdl/bind_sequence.hpp>
#include <nbdl/concept/String.hpp>
#incl... |
/*
BFS Approach
*/
#include<bits/stdc++.h>
using namespace std;
void bfs(vector<int> &matrix[],int x,int y,int r,int c)
{
if(x<0 || x>=r || y<0 || y>=c || matrix[x][y]!='1') //Boundary case for matrix
return;
//Mark current cell as visited
matrix[x][y] = '2';
... |
#include <string>
#include <QFile>
#ifndef _pfm_h_
#define _pfm_h_
using namespace std;
typedef int RC;
typedef unsigned PageNum;
const int PAGE_SIZE = 4096;
#define PAGED_FILE_HEADER_STRING "PAGED_FILE__"
const int PAGED_FILE_HEADER_STRING_LENGTH = 12;
#define SUCCESS 0... |
#include<bits/stdc++.h>
#include<string>
using namespace std;
struct et
{
string value;
et* left, *right;
};
int toInt(string s)
{
int num = 0;
for (int i=0; i<s.length(); i++)
num = num*10 + (int(s[i])-48);
return num;
}
int eval(et* root)
{
... |
#include <set>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
char buffer[32];
set<string> values;
for (int i = 0; i < 100; i++) {
snprintf(buffer, sizeof(buffer), "%2.2d", i);
values.insert(buffer);
}
auto it = values.begin();
while (it != values.end()) {
if (it->c_str... |
#include<bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *left, *right;
};
// Function to create new tree node.
Node* newNode(int key)
{
Node* temp = new Node;
temp->data = key;
temp->left = temp->right = NULL;
return temp;
}
int helper(Node* root,int& ans)
{
i... |
#ifndef MATHTOOLBOX_CLASSICAL_MDS_HPP
#define MATHTOOLBOX_CLASSICAL_MDS_HPP
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
namespace mathtoolbox
{
/// \brief Compute low-dimensional embedding by using classical multi-dimensional scaling (MDS)
///
/// \param D Distance (dissimilarity) matrix
///
... |
#include "StdAfx.h"
#include "About.h"
#include "Resource.h"
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
DDX_Control(pDX, IDC_GIFABOUT, ... |
/***********************************************************************
created: 27/01/2022
author: Vladimir Orlov
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2022 Paul ... |
#include <nodelet/nodelet.h>
#include <pluginlib/class_list_macros.h>
#include "test_nodelets/calc_diff_time.h"
namespace calculators{
class DiffTimeNodelet : public nodelet::Nodelet {
public:
DiffTimeNodelet(){}
~DiffTimeNodelet(){}
virtual void onInit()
{
ros::NodeHandle nh = this->getPr... |
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
long long int count=0,x1;
typedef struct AVLNode_t
{
long long int data,check;
long long int arr[100];
struct AVLNode_t *left,*right;
long long int height;
}AVLNode;
typedef struct AVL_t
{
AVLNode *_root;
unsigned int ... |
#include <iostream>
#define R 3
#define C 6
// #define R 4
// #define C 4
using namespace std;
void spiralPrint(int end_row, int end_col, int arr[R][C])
{
int start_row = 0;
int start_col = 0;
int curr_row = 0;
int curr_col = 0;
while (start_row < end_row && start_col < end_col) {
for (; c... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Storage.Provider.0.h"
#include "Windows.Storage.0.h"
#include "Windows.Foundation.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Storage::P... |
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
#define ll long long
#define ld long double
#define uint unsigned int
#define ull unsigned long long
void print(vector<int> &t) {
for (int i = 0; i < (int)t.size(); ++i)
cout << t[i] << " ";
cout << "\n";
}
int dp[5001][5001];
ll MOD = 1... |
// CkCert.h: interface for the CkCert class.
//
//////////////////////////////////////////////////////////////////////
// This header is generated.
#ifndef _CkCert_H
#define _CkCert_H
#include "chilkatDefs.h"
#include "CkString.h"
#include "CkMultiByteBase.h"
class CkByteData;
class CkPrivateKey;
cl... |
#ifndef _Canvas_h_
#define _Canvas_h_
#include <iostream>
#include "Bitmap.h"
#include "Global.h"
#include "Paint.h"
#include "Manager.h"
#include "RectF.h"
class Canvas
{
public:
Canvas(Bitmap *b);
Canvas(int x, int y);
virtual ~Canvas();
void drawBitmap(Bitmap *bitmap, int left, int top);
void ... |
#ifndef V2HJSONDATA_H
#define V2HJSONDATA_H
#include <QObject>
#include <QDebug>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QPixmap>
#include <QProcess>
#include <QDir>
#include <QTime>
#include "cJSON.h"
#define V2H_JSON_DATA_DEBUG
#ifdef V2H_JSON_DATA_DEBUG
#define V2H_Debug q... |
#include "PizzaService.h"
PizzaService::PizzaService()
{
pizzaRepo.init();
}
void PizzaService::makePizza(){
addPizza(pizzaStart());
}
string PizzaService::pizzaStart(){
char input;
string pizzaSize = "";
system("CLS");
while(input != '1' || input != '2' || input != '3'){
orderHe... |
#include "audio\Singularity.Audio.h"
/*
* AdaptiveEnvironment.h
*
* An adaptive environment that fits everything together.
*
* Author: Sela Davis
*
* Created: May 05, 2010 (05/05/10)
* Last modified: May 05, 2010 (05/05/10)
*/
namespace Singularity
{
namespace Audio
{
class AdaptiveEnvironment
... |
/**
* Calculate the total luminosity and flux within the specified radius.
*
* Base on 'fit_dbeta_sbp.cpp' and supersede 'calc_lx.cpp'
*
* Author: Junhua Gu
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include "vchisq.hpp"
#include "dbeta.hpp"
#include "beta_cfg.hpp"
#include <da... |
#include<bits/stdc++.h>
using namespace std;
int NumberOf1Between1AndN_Solution(int n)
{
if(n == 0)
return 0;
int res = 1,s;
for(int i = 10; i <= n; i++) {
s = i;
while(s){
if(s % 10 == 1)
res++;
s /= 10;
}
}
return res;
}
in... |
//stack的基本操作(均可直接使用STL)
//清空
void clear()
{
TOP=-1;
}
//获取栈内元素个数
int size(){
return TOP+1;
}
//判空
bool empty(){
return TOP==-1?true:false;
}
//进栈
void push(int x){
st[++TOP]=x;
}
//出栈
void pop(){
TOP--;
}
//取栈顶元素
int top()
{
return st[TOP];
}
//STL中并没有实现栈的清空,因此需要如下操作
while(!st.empty){
st.po... |
/*
* Copyright (C) 2020 Open Source Robotics Foundation
*
* 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... |
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include "faustPM.h"
faustPM faust;
AudioInputI2S in;
AudioOutputI2S out;
//AudioAnalyzeRMS gateRMS;
// gate input
//AudioConnection patchCord1(in, 0, gateRMS, 0);
// ... |
#include <iostream>
#include "SecureString.h"
#include "SecureArray.h"
using namespace std;
int main()
{
SecureString str("Hello!", 6);
SecureString cstr(" W0RLD");
str.Append(cstr);
char exc = str.AtIndex(5);
str.Append(SecureString(&exc, 1));
str.Append(exc);
str.Append("\t:D");
str.ReplaceAt(15, "D:");
... |
#include <Arduino.h>
#include <credentials.h>
#include <thingDescriptionTemplate.h>
#include <Preferences.h>
#include <ArduinoOTA.h>
#include <analogWrite.h>
#include <DHT.h>
#include <Wire.h>
#include <BH1750.h>
#include <WiFi.h>
#include <driver/adc.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <As... |
#include <stdio.h>
#include <algorithm>
using namespace std;
int n,m,cnt;
double camera[200];
double list[20000];
int main()
{
int c;
scanf("%d",&c);
while(c--)
{
scanf("%d %d",&n,&m);
for(int i=0;i<m;i++)
scanf("%lf",&camera[i]);
cnt = 0;
for(int i=0;i<m-1;i++)
for(int j=i+1;j<m;j++)
list[cnt... |
#pragma once
#include "AbstractSort.h"
class SelectionSort :
public AbstractSort
{
public:
SelectionSort();
~SelectionSort();
void sort(int arr[], int size) override;
};
|
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;
class Base
{
private:
int n;
public:
Base(int m):n(m){ cout<<"Base is called\n";}
~Base(){}
};
class Other
{
int m;
public:
Other(int a):m(a){ cout<<"Other is called\n";}
};
class Derive:publi... |
#include<bits/stdc++.h>
using namespace std;
int power(int a,int n)
{
int res=1;
while(n>0)
{
if(n&1)
{
res=res*a; n--; // at least once the power will be odd then we will increase our ans .ans will be correct because a will be changed accordingly
}
n=n/2; // pow... |
#ifndef FUZZYCORE_CALCULATION_SINGLE_VALUES_VIEW_H
#define FUZZYCORE_CALCULATION_SINGLE_VALUES_VIEW_H
#include "../abstractView/AbstractView.h"
#include "../viewUtils/ViewUtils.h"
class CalculationSingleValuesView : public AbstractView {
public:
CalculationSingleValuesView();
void displayStaticContent() ove... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.UI.Xaml.Navigation.1.h"
#include "Windows.UI.Xaml.1.h"
#include "Windows.UI.Xaml.2.h"
WINRT_EXPORT namespace winrt {
namespace Windows::UI::Xaml::Navigation {
struct LoadCo... |
// Filename: cPetChase.cxx
// Created by: dcranall (15Jul04)
//
////////////////////////////////////////////////////////////////////
#include "cPetChase.h"
#include "cMover.h"
TypeHandle CPetChase::_type_handle;
////////////////////////////////////////////////////////////////////
// Function: CPetChase::Constru... |
#include "matrix.h"
#include "stiff.h"
#include <math.h>
int ode_maxlen;
t_numatrix<double> ode_tmp;
vector< vector<double> > ode_dat;
t_LUmatrix<double> ode_jac;
int ode_nstep;
/*
template<class T>
T max(T a, T b)
{
return A > B ? A : B ;
}
template<class T>
T min(T a, T b)
{
return A < B ? A : B ;
}
*/
... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#ifndef FLUX_WAITCONDITION_H
#define FLUX_WAITCONDITION_H
#include <flux/Mutex>
namespace flux {
/** \brief Wait condition
* \see Channel
*/
class WaitConditi... |
#include "Patcher_ItemSplitQuantity.h"
#include "../Addr.h"
#include "../FileSystem.h"
//-----------------------------------------------------------------------------
// Static variable initialization
int CPatcher_ItemSplitQuantity::itemQuantity = 1;
LPBYTE CPatcher_ItemSplitQuantity::addrTargetReturn = NULL;
//------... |
/**********************************************************
* License: The MIT License
* https://www.github.com/doc97/TxtAdv/blob/master/LICENSE
**********************************************************/
#include "LuaResponseHandler.h"
namespace txt
{
LuaResponseHandler::LuaResponseHandler(LuaManager* manager, cons... |
#include<iostream>
using namespace std;
int main()
{
char* p = nullptr;
p[10] = '!';
return 0;
}
|
/**
*
* @file main.cpp
* @brief IO module test
*
**/
#include <exception>
#include <bitset>
#include <iostream>
#include <Tools/CommandLineArgumentReader.hpp>
#include <RobotStatus/Information.hpp>
#include "Communicator/TCP.hpp"
#include "Device/Sensor/IMU/VMU931.hpp"
#include "Device/Sensor/IMU/Inerti... |
#include <iostream>
#include <vector>
#include "defs.h"
#include "util.h"
using namespace std;
PatternIndex::PatternIndex ( int * x, int l, int sigma )
{
sa = new int [l+3];
isa = new int [l];
lcp = new int [l];
sa[l] = sa[l+1] = sa[l+2] = 0;
suffixArray ( x, sa, l, sigma );
for ( int i = 0; i < l; i++ )
... |
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int val;
Node *next;
Node() : val(0), next(NULL){};
Node(int val) : val(val), next(NULL){};
};
Node *insert(vector<int> nums)
{
Node *head = new Node(nums[0]), *temp = head;
int i = 1;
while (temp && i < nums.size())
{
... |
//#include <iostream>
#include <cstdio>
//#include <cstring>
//#include <algorithm>
//#include <bits/stdc++.h>
#include <queue>
#include <vector>
#include <set>
using namespace std;
typedef long long LL;
const int coeff[3]={2,3,5};
priority_queue<LL, vector<LL>, greater<LL> > mnpq;
set<LL> s;
int main()
{
//freopen... |
#include "audio\Singularity.Audio.h"
/*
* Cue.h
*
* An object allowing access to a single individual sound playing. 3d cue position is handled through AudioEmitters and AudioListeners.
*
* Author: Sela Davis
*
* Created: March 15, 2010 (03/15/10)
* Last modified: March 17, 2010 (03/17/10)
*/
namespace Si... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.ApplicationModel.DataTransfer.DragDrop.Core.0.h"
#include "Windows.ApplicationModel.DataTransfer.0.h"
#include "Windows.ApplicationModel.DataTransfer.Drag... |
#pragma once
#include <memory>
#include "Game.h"
#include "Session.h"
#include <boost\asio.hpp>
using boost::asio::ip::tcp;
class Server {
public:
Server(boost::asio::io_service& io_service, short port, Game& game);
private:
void do_accept();
tcp::acceptor acceptor_;
tcp::socket socket_;
Game& game_;
}; |
/***********************************************************************
created: Mon Jun 13 2005
author: Paul D Turner <paul@cegui.org.uk>
*************************************************************************/
/***************************************************************************
* Copyrigh... |
//
// Created by shimeng on 2021/4/11.
//
#include "common.h"
using namespace std;
/**
* 给你一个整数 n ,请你找出并返回第 n 个 丑数 。
* 丑数 就是只包含质因数 2、3 和/或 5 的正整数。
* @param n 第n个丑数
* @return
*/
int nthUglyNumber(int n) {
if (n <= 0) {
return 0;
}
vector<int> record(n);
record[0] = 1;
int p2 = 0, p3 =... |
#include "stdafx.h"
#include <iostream>
#include <filesystem>
#include <fstream>
#include <string>
#include <sstream>
#include "FbHtmlParser.h"
#include "Conversation.h"
using namespace std;
namespace fs = std::experimental::filesystem;
FbHtmlParser::FbHtmlParser(fs::path msgPathIn)
{
msgPath = msgPathIn;
}
int Fb... |
#include<iostream>
using namespace std;
class cBase
{
public:
void fun()
{
cout<<"cBase fun1 0para"<<endl;
}
};
class cDerived: cBase
{
public:
void fun(int iNo)
{
cout<<"cDerived fun1 0para";
}
};
int main()
{
cBase bobj;
cDerived dobj;
bobj.fun();
//bobj.fun(20);//not present in base clas... |
class Solution {
public:
void moveZeroes(vector<int>& nums) {
int left = 0;
int right = 0;
if(nums.size() <= 1) return;
while(left < nums.size())
{
if(nums[left] == 0)
{
while(right < nums.size() && nums[right] == 0)
{
... |
#ifndef HUMAN_H_
#define HUMAN_H_
#include "alive.h"
#include "../../Items/pill.h"
#include "../../Items/item.h"
#include <string>
#include <map>
#include <stdlib.h> /* srand, rand */
using namespace std;
namespace haunted_house
{
class Ghost;
class Human: public Alive{
public:
Human();
Human(string n... |
/*
* HeaderTrj.h
*
* Created on: May 13, 2012
* Author: marchi
*/
#ifndef HEADERTRJ_H_
#define HEADERTRJ_H_
#include <vector>
#include <string>
#include "FstreamC.h"
#include "FstreamF.h"
using std::vector;
using std::string;
using std::ifstream;
using std::ios;
const int HDIM=4;
const int TDIM=80;
const ... |
#include <iostream>
#include <cstring>
using namespace std;
class Cd
{ // represents a CD disk
private:
char * performers;
char * label;
int selections; // number of selections
double playtime; // playing time in minutes
public:
Cd(const char * s1, const char * s2, int n, double x);
Cd(const Cd & d);
... |
#include <string>
#include <iostream>
using namespace std;
struct hlist {
int flag;
hlist* ptr_next;
union {
char symb;
hlist *ptr_child;
};
};
hlist* r_make(string &mas, int &start, int &err);
hlist* del_x(hlist *now, char &x, string &output,bool info);
void print_list(hlist *now, str... |
#include "catch/catch.hpp"
#include <vector>
#include <iostream>
using namespace std;
class MDimContainer {
private:
vector<int> dims;
vector<int> data;
vector<int> mult;
int& get_at(const vector<int>& adims)
{
int offset = adims.back();
for (int i = 0; i < dims.size()-1; ++i)
... |
#ifndef __JFLIB_UBLAS_MATRIX_INVERSION_OPER_HPP__
#define __JFLIB_UBLAS_MATRIX_INVERSION_OPER_HPP__
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/triangular.hpp>
#include <boost/numeric/ublas/... |
#pragma once
#include "../dxtk/pch.h"
#include "Messages.h"
#include "../capture/all_inc.h"
class Mouse {
public:
using CURSOR = DirectX::SimpleMath::Vector2; // カーソル座標
struct CLICK {
bool l; // 左クリック
bool r; // 右クリック
bool w; // ホイールクリック
CLICK() {
l = 0;
r = 0;
w = 0;
}
};
using WHEEL = DirectX... |
#pragma once
#include <iostream>
#include <random>
#include <vector>
struct point
{
int x = 0, y = 0;
};
struct rect
{
point ll, ur;
};
struct plane
{
plane(int width, int height) : points(height, std::vector<bool>(width, false)) {}
int height() const { return static_cast<int>(points.size()); }
... |
//
// ArmatureManager.cpp
// Boids
//
// Created by Xin Xu on 10/29/14.
//
//
#include "ArmatureManager.h"
#include "Utils.h"
using namespace cocos2d;
ArmatureManager* ArmatureManager::_instance = nullptr;
ArmatureManager *ArmatureManager::getInstance() {
if( _instance == nullptr ) {
_instance = new ... |
/***********************************
* Author: Peter Dorich
* Based off code from OSC by Kenny Noble
* Back-end for send/ recieve data between hub/ valve
************************************/
#include <SPI.h>
#include <RH_RF95.h>
#include <RHReliableDatagram.h>
#include <OSCBundle.h>
/* for feather32u4
#define... |
#include "Message.h"
#include <string.h>
CMessage::CMessage( u32 uType )
: m_uType( uType )
{
}
u32 CMessage::GetType() const
{
return m_uType;
}
void CMessage::Pack( i8* pBuffer )
{
memcpy( pBuffer, &m_uType, sizeof( m_uType ) );
}
|
#include <iostream>
using namespace std;
// bubble sort
int main() {
int arr[10] = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 1};
int buf;
for(int i = 0; i < 10-1; i++) {
for (int j = 0; j < (10 - 1 - i); j++) {
if (arr[j] > arr[j + 1]) {
buf = arr[j + 1];
arr[j + 1... |
#include <iostream>
#include <functional>
// [] () mutable throw() -> int {}
// [=,&] - capture clause
// [=] / [&]
// [&, x]
// () - parameter list (optional)
// mutable / immutable - optional
// throw() - optional
// -> int: trailing-return-type (optional)
// {} - function body
template <typename T = int>
using fn_... |
#include <iostream>
using namespace std;
enum Colour { WHITE, BLACK };
//enum PieceType { KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN };
char numberToCharConvertor(int);
void alternate(Colour& c);
int convert(int a);
int convert(char a);
bool canMoveBishop(int fromRank, char fromFile, int toRank, char toFile);
string tran... |
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/photo.hpp>
#include <opencv2/imgcodecs.hpp>
#include "algorithms.h"
using namespace cv;
using namespace std;
void img_fusion_to_video(Mat &roi_front, Mat &mask, Rect b_roi, int fusion_type){
VideoCapture vca... |
#include <bits/stdc++.h>
#define MAX 1000001
#define M 1000000007
#define ll long long
#define ld long double
#define ESP 0.0001
using namespace std;
int n, a[5001];
int sign(int x) {
if (x<0) return -1;
else return 1;
}
int DP() {
int dp[n+2][n+2];
for (int i=0;i<=n;i++) dp[n+1][i] = 0;
for (int i=n;i>=1;i--) ... |
//
// Emulator - Simple C64 emulator
// Copyright (C) 2003-2016 Michael Fink
//
/// \file SoundInterfaceDevice.cpp Sound Interface Device
//
// includes
#include "stdafx.h"
#include "SoundInterfaceDevice.hpp"
using C64::SoundInterfaceDevice;
void SoundInterfaceDevice::SetRegister(BYTE bRegister, BYTE bValue)
{
bR... |
#ifndef CDATETIMEDIRECTOR_H
#define CDATETIMEDIRECTOR_H
#include "cdatetime.h"
#include "cdatetimebuilder.h"
class CDateTimeDirector
{
public:
CDateTimeDirector(CDateTimeBuilder* builder);
virtual ~CDateTimeDirector() {}
virtual void construct();
protected:
CDateTimeBuilder* mBuilder;
... |
// ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2013.4
// Copyright (C) 2013 Xilinx Inc. All rights reserved.
//
// ===========================================================
#ifndef _cache_module_HH_
#def... |
// 问题描述
// 小明对类似于 hello 这种单词非常感兴趣,这种单词可以正好分为四段,第一段由一个或多个辅音字母组成,第二段由一个或多个元音字母组成,第三段由一个或多个辅音字母组成,第四段由一个或多个元音字母组成。
// 给定一个单词,请判断这个单词是否也是这种单词,如果是请输出yes,否则请输出no。
// 元音字母包括 a, e, i, o, u,共五个,其他均为辅音字母。
// 输入格式
// 输入一行,包含一个单词,单词中只包含小写英文字母。
// 输出格式
// 输出答案,或者为yes,或者为no。
// 样例输入
// lanqiao
// 样例输出
// yes
// 样例输入
// wor... |
///////////////////////////////////////////////////////////////////////////////
// File: MessageBlock.hpp
// Author: 671643387@qq.com
// Date: 2015年12月29日 上午11:24:45
// Description:
///////////////////////////////////////////////////////////////////////////////
#ifndef UTIL_MESSAGEBLOCK_HPP_
#defin... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or... |
class Solution {
public:
int mySqrt(int x) { // 二分法
int l = 0, r = x, ans = -1;
while (l <= r) {
int mid = l + (r - l) / 2; // 防止溢出
if ((long long)mid * mid <= x) { // 小于和等于,两种情况一起考虑
ans = mid; // 等于的情况
l = mid + 1; // 小于的处理
... |
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <boost/random.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/algorithm/hex.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/timer/timer.hpp>
#include <math.h> /* pow */
#include <random>
#include <memory>
#include <iostream>
#include <fstre... |
#ifndef __SALESDATA_H__
#define __SALESDATA_H__
#include <string>
#include <iostream>
struct SalesData {
std::string Isbn() const {return book_no;}
SalesData &Combine(const SalesData &);
double AvgPrice() const;
std::string book_no; //ISBN No.
unsigned units_sold = 0; //Sold number
double revenue = 0.0; //Sol... |
#ifndef __FILE_REALMOD__
#define __FILE_REALMOD__
namespace Common
{
template<typename T>
T realmod(T const &x, T const &m)
{
T y = x % m;
return (y < 0 ? y + m : y);
}
}
#endif |
//
// main.cpp
// c-data
//
// Created by Lawrence Herman on 3/1/19.
// Copyright © 2019 Lawrence Herman. All rights reserved.
//
//#include <iostream>
//// used this for setw(x) on output
//#include <iomanip>
//// directives for reading and writing files
//#include <fstream>
#include "main.h"
int main(int arg... |
#ifndef ROSE_ESCAPE_H
#define ROSE_ESCAPE_H
#include <string>
std::string escapeString(const std::string& s);
std::string unescapeString(const std::string& s);
#endif // ROSE_ESCAPE_H
|
#pragma once
#include "IState.h"
#include "LockedState.h"
#include "ClosedState.h"
#include "OpenedState.h"
class StateContext
{
public:
StateContext();
void SetState(IState* state);
void Unlock();
void Open();
void Close();
void Lock();
virtual ~StateContext();
private:
IState* m_State;
};
|
//
// ImagePickerView.cpp
// iPet
//
// Created by KimSteve on 2017. 6. 22..
// Copyright © 2017년 KimSteve. All rights reserved.
//
#include "ImagePickerView.h"
#include "GroupSelectView.h"
#include "../Util/ViewUtil.h"
#include "../Util/OSUtil.h"
#include "../Base/ViewAction.h"
#include "../Base/ShaderNode.h"
#in... |
/*************************************************************
* > File Name : P2672.cpp
* > Author : Tony
* > Created Time : 2019/05/26 15:03:05
* > Algorithm : 贪心
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
inline ... |
//Jason Strange
//PrintItem inherits from item and is used for storing the item to be printed
#pragma once
#include "Item.h"
#include <string>
using namespace std;
class Item;
class PrintItem : public Item {
private:
string f;
public:
PrintItem (string file);
string getfile ();
}; |
#include <math.h> // only for pow
#include <iostream>
using namespace std;
void toBinary(int *&array,int &size, int n){
// convert decimal to bin
int number = n;
size=0;
while(n/2 >0) {n=n/2; size++;}
size++;
array = new int [size];
for(int i=0; i < size; i++) {array[i] = number %2; number= number/2;}
}
i... |
#ifndef PCBROUTER_GRID_DIFF_PAIR_NETCLASS_H
#define PCBROUTER_GRID_DIFF_PAIR_NETCLASS_H
#include "GridNetclass.h"
class GridDiffPairNetclass : public GridNetclass {
public:
//ctor
GridDiffPairNetclass(const int id = -1,
const int clearance = 0,
const int tr... |
/**
* Copyright (C) 2017 Alibaba Group Holding Limited. All Rights Reserved.
*
*
* 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
*
* ... |
#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class summ : public eosio::contract
{
public:
using contract::contract;
void add(uint32_t a,uint32_t b)
{
uint32_t c=a+b;
print("sum",a,b,c);
}
};
EOSIO_ABI( summ, (add))
|
#ifndef _POINT_CLOUD_MAP_
#define _POINT_CLOUD_MAP_
#include "stdafx.h"
#include "Geometry/include/geometry.h"
#include "PclPointCloud.h"
#include <gtsam/geometry/Pose2.h>
#include <gtsam/nonlinear/Values.h>
#define _RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
using... |
#pragma once
#include <iosfwd>
#include <vector>
#include <cmath>
inline bool floatEQ(const float x, const float y) {
return fabsf(x - y) < 0.00001;
}
/** Angle class (high-lvl angle handling)
* - automated normalization and constraining
* - change 'angle' through methods:
* - DO _NOT_ WRITE ::rad and ::... |
#include "repositorio_salas.h"
#include <algorithm>
#include <stdexcept>
#include <herramientas/lector_txt/lector_txt.h>
using namespace App_RepositorioSalas;
Repositorio_salas::Repositorio_salas()
{
iniciar_mapa();
}
/**
* Se extrae el primer item de la lista y se le añade un uso.
*/
const std::string Repositori... |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/client/audio_decode_scheduler.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#in... |
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "optimization.h"
using namespace alglib;
void function1_grad(const real_1d_array &x, double &func, real_1d_array &grad, void *ptr)
{
//
// this callback ... |
struct event * malloc_flow(int client_id)
{
struct event *temp_event1; // ponteiro para o novo no a inserir
temp_event1 = (event *)malloc(1*sizeof(event));
temp_event1->event_id = FLOW_EVENT;
temp_event1->client_id = client_id;
temp_event1->server_id = 0;
temp_event1->time... |
/* NO WARRANTY
*
* BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO
* WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS
* AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
* WARRANTY OF ANY KIND, EITHER E... |
#pragma once
#include "Jogador.h"
#include "Inimigo1.h"
class checarcolisao : public Jogador, Inimigo1
{
public:
protected:
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.