text stringlengths 8 6.88M |
|---|
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
namespace {
boost::mutex m1;
boost::recursive_mutex m2;
void threadmain()
{
boost::lock_guard<boost::mutex> lock1(m1);
boost::lock_guard<boost::recursive_mutex> lock2(m2);
boost::filesystem::path p(boost::filesystem::current_path());
}
}
int main()
... |
#include "stdafx.h"
#include "ReportWriter.h"
#include "Station.h"
#include "TextFile.h"
#include "StringUtils.h"
#include "AllLocations.h"
#include "CategoryMgr.h"
#include "Category.h"
#include "Contest.h"
// Sorts Callsigns based on district first (0-9), then length of call, then alphabetical
bool CallsignLessTha... |
/*
* Main1.cpp - For Color Image Transform
*/
#include "Color_Transform.h"
int main(int argc, char* argv[]){
if(argc < 3){
cout << "Please enter source color image path and source background image path!" << endl;
exit(1);
}
CImg<float> src1(argv[1]);
CImg<float> src2(argv[2]);
Color_Transformer cter(src1, sr... |
// Blood_List.cpp
// Ben Howe
// COSC 2030
// 10/24/2018
// The data structure for this project: a doubly-linked list
// with a diy iterator.
// Each node contains min, max, sum, delta, prev pointer and next pointer.
// List has pointers for first, last, and an iterator (or fence)
#include "Blood_List.h"
... |
#ifndef WINDOW_HPP
#define WINDOW_HPP
#include "../Common/Configuration.hpp"
#include "Input.hpp"
class Window final
{
public:
Window(const char* title, s32 width, s32 height);
~Window();
Window(Window&& window);
const Window& operator=(Window&& window);
void setTitle(const char* title);
... |
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <cassert>
using namespace std;
typedef long double LD;
int c[5][111];
// T N K B
int f[222][111][5][5];
struct Tp {
int y, t, c;
Tp() {}
Tp(int y, int t, int c) : y(y), t(t), c(c) {}
};
vec... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) 2009-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"
#ifdef MEDIA_... |
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
typedef long long LL;
typedef unsigned long long ULL;
#define PI 3.141592653589... |
#ifndef PASCAL_ANNOTATION_H
#define PASCAL_ANNOTATION_H
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/foreach.hpp>
using namespace std;
// Defining PASCAL Annotation
//! Pascal SOURCE node annotation
struct source_annotation
{
string database;
string... |
// Copyright (c) 2011-2014 Bryce Adelstein-Lelbach
// Copyright (c) 2007-2014 Hartmut Kaiser
// Copyright (c) 2013 Thomas Heller
// Copyright (c) 2013 Patricia Grubel
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1... |
/// \file NiCfTrajectory.hh
/// \brief Definition of the NiCfTrajectory class
#ifndef NiCfTrajectory_h
#define NiCfTrajectory_h 1
#include "G4ParticleDefinition.hh"
#include "G4VTrajectory.hh"
#include "G4Allocator.hh"
#include "G4TrajectoryPoint.hh"
class G4Track;
// From G4Trajectory.hh
typedef std::vector<G4VTra... |
#ifndef _HEXAPI_CONTROL_H
#define _HEXAPI_CONTROL_H
#include <vector>
#include "ros/ros.h"
#include <tf2/LinearMath/Vector3.h>
#include "std_msgs/Int32MultiArray.h"
/**
* Directions are defined, from the perspective of the robot facing forward.
* Z axis is upwards, X axis is forward, Y axis follows the left hand fr... |
#include "sx/ResourceUID.h"
#include "sx/GlyphStyleID.h"
namespace sx
{
UID ResourceUID::Glyph(int unicode, const GlyphStyle& gs)
{
uint64_t style_id = GlyphStyleID::Instance()->Gen(gs);
uint64_t id = ((style_id & 0xffffffff) << 32) | unicode;
return Compose(id, KeyType::GLYPH);
}
UID ResourceUID::String(const st... |
#include "SoundManager.h"
#include "Core.h"
#include <iostream>
FMODManager SoundManager::m_fmodManager;
SoundManager::SoundManager()
{
}
SoundManager::~SoundManager()
{
}
void SoundManager::init()
{
m_fmodManager.init();
}
void SoundManager::update()
{
m_fmodManager.update();
}
void SoundManager::addSound(c... |
#include<iostream>
using namespace std;
struct point{
int x,y,z;
};
bool check (point p,point p1,point p2,point p3)
{
p1.x-=p.x;p1.y-=p.y;p1.z-=p.z;
p2.x-=p.x;p2.y-=p.y;p2.z-=p.z;
p3.x-=p.x;p3.y-=p.y;p3.z-=p.z;
cout << p1.x*p2.y*p3.z+p2.x*p3.y*p1.z+p3.x*p1.y*p2.z-p3.x*p2.y*p1.z-p1.x*p3.y*p2.z-p2.x*p1.y*p... |
#pragma once
#include "../../System.hpp"
#include <stdlib.h>
#define State_Arkanoid_BrickRow 10
namespace States
{
class Arkanoid
{
public:
int8_t run(void);
private:
struct
{
const int8_t radius = 3;
double x = Display::Width / 2;
double y = Display::Hight - 10;
... |
/*
* Created by Peng Qixiang on 2018/4/1.
*/
/*
* 替换空格
* 请实现一个函数,将一个字符串中的空格替换成“%20”。
* 例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
*
*/
# include <iostream>
using namespace std;
/*
* 在字符串尾部填充任意字符,使得字符串的长度等于字符串替换之后的长度。
* 因为一个空格要替换成三个字符(%20),因此当遍历到一个空格时,需要在尾部填充两个任意字符。
* 令 P1 指向字符串原来的末尾位置,P2 指向字符串现在的末... |
/*
* 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 <folly/io/async/ScopedEventBaseThread.h>
#include <quic/server/QuicServer.h>
#include <quic/server/async_t... |
// Copyright (c) 2012-2017 The Cryptonote developers
// 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.
#include <vector>
#include "gtest/gtest.h"
#include "CryptoNote... |
#include "GL/glew.h"
#include "vtkConeSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindow.h"
#include "vtkCamera.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkSmartPointer.h"
#include "vtkOpenGLRenderWindow.h"
#include "vtkOpenGLProperty.h"
#include "vtkRiftRenderPass.h"
#include "vtkC... |
#include "cserialpolling.h"
#include "cpollingthread.h"
#include "cserialportprivate.h"
CSerialPolling::CSerialPolling(QObject *parent) :
QObject(parent)
{
sp = new CSerialPortPrivate();
connect(sp, &CSerialPortPrivate::dataReady, this, &CSerialPolling::dataReady);
connect(sp, &CSerialPortPrivate::res... |
#include <node_buffer.h>
#include <cmath>
#include <algorithm>
#include <stdint.h>
#include "image-diff.hpp"
#include "colors.hpp"
#include "utils.hpp"
#include "antialiasing.hpp"
using namespace node;
using namespace v8;
using namespace std;
float colorDelta(const ColorRGB &firstColor, const ColorRGB &secondColor) {... |
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int cow_number;
ifstream in("lab3_in",ios::in);
in>>cow_number;
vector<int>cow(cow_number);
int total=0;
for(int i=0;i<cow_number;++i)
in>>cow.at(i);
sort(cow.begin(),cow.end());
for(int... |
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <sstream>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <cmath>
#include <unistd.h>
#include <algorithm>
#include <map>
#include <numeric>
#include <assert.h>
#include <time.h>
#include <omp.h>
using namespace std;
... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "Hypoxia.h"
#include "DestructibleJunk.h"
ADestructibleJunk::ADestructibleJunk() {
DestructibleMesh = CreateDefaultSubobject<UDestructibleComponent>(TEXT("Destructible"));
DestructibleMesh->SetupAttachment(Item);
Item->SetVisi... |
/*********************************************
C++ Program for 1D linear-hyperbolic problem
Symmetric-TVD scheme(minmod,superbee)
**********************************************/
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstdlib>
#include <iostream>
#include <string>
#include <fstream>
#include <ss... |
#include "../Headers/Parser.h"
#include <math.h>
#include <stack>
#include<string>
bool is_number(const std::string s)
{
std::string copied_str = "";
for (int i = 0; i < s.length(); i++)
{
if (s[i] != '.')
copied_str += s[i];
}
return !copied_str.empty() && std::find_if(copied_str.begin(),
... |
#include <PrefabsManager.h>
using namespace breakout;
PrefabsManager::PrefabsManager()
{
}
PrefabsManager::~PrefabsManager()
{
}
PrefabsManager& PrefabsManager::Get()
{
static PrefabsManager prefabsManager;
return prefabsManager;
}
void PrefabsManager::DeleteEntityId(EntityId id, ComponentUniqueId componentId)... |
// Created on: 1993-03-26
// Created by: Christian CAILLET
// Copyright (c) 1993-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 ... |
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2006 Marcin Kalicinski
//
// 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)
//
// For more information,... |
#ifndef F3_UTILS_FILEEXTENSIONS_H_
#define F3_UTILS_FILEEXTENSIONS_H_
namespace f3 {
constexpr const char* EXT_3DMODEL = "o3d";
constexpr const char* EXT_3DMODEL_ANIMATION = "ani";
constexpr const char* EXT_3DMODEL_SKELETON = "chr";
constexpr const char* EXT_WORLD_LANDSCAPE = "lnd";
constexpr const char* EXT... |
//
// Created by 10160097 on 2020/10/30.
//
#ifndef OPENCV_SOLIBRARY_NATIVE_HEAD_H
#define OPENCV_SOLIBRARY_NATIVE_HEAD_H
#include <jni.h>
#include <string>
#include "../opencv2/opencv.hpp"
#include "../opencv2/imgcodecs.hpp"
extern "C" JNIEXPORT jstring JNICALL
Java_com_example_opencv_1solibrary_MainActivity_strin... |
/*****************************************************************
* Copyright (C) 2017-2018 Robert Valler - All rights reserved.
*
* This file is part of the project: DevPlatformAppCMake.
*
* This project can not be copied and/or distributed
* without the express permission of the copyright holder
******... |
// $Id$
//
// Copyright (C) 2014 Novartis Institutes for BioMedical Research
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#pragma once
... |
#include <string>
#include "ThrowCardProc.h"
#include "HallManager.h"
#include "Logger.h"
#include "Room.h"
#include "Configure.h"
#include "ErrorMsg.h"
#include "GameCmd.h"
#include "ProcessManager.h"
#include "BaseClientHandler.h"
#include "json/json.h"
#include "IProcess.h"
using namespace std;
ThrowCardProc::Thr... |
#pragma once
#include <cstdint>
#include "DLLDefines.h"
class ISerializable //interface
{
public:
//return the total size of the serialized object
virtual int32_t serializeSize() const = 0;
//return the char* corresponding to the serialized data of the calling object
virtual char* serialize() = 0;
//get the ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 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 "adjunct/quick/widgets/OpLin... |
#include <iostream>
#include "DMA.h"
#include <vector>
int main()
{
using std::cout;
using std::endl;
using std::vector;
vector <base*> objArray;
baseDMA shirt("Portabelly", 8);
lacksDMA ballon("red", "Blimpo", 4);
hasDMA map("Mercator", "Buffalo Keys", 5);
cout << "Displaying baseDMA object:\n";
shirt.View(... |
#include <iostream>
using namespace std;
int buscar(int n){
int arr[] = {1,3,4,5,17,18,31,33};
int low = 0;
int high = 7;
int mid = (low + high) / 2;
if (arr[mid]!=n && (low==high)) return (-1);
}
int main (){
int x;
cout << "Ingrese el numero a buscar: " << endl;
cin >> x;
if (buscar (x) == -1)
cout <<... |
#ifndef DECK_TAROT_HPP
#define DECK_TAROT_HPP
#include "Deck56.hpp"
class DeckTarot : public Deck56{
public :
DeckTarot();
};
#endif
|
// Created on: 2013-12-20
// Created by: Denis BOGOLEPOV
// Copyright (c) 2013-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 Lesser General Public License version 2.1 ... |
#pragma once
#include "components/component.hpp"
#include <unordered_set>
#include <unordered_map>
namespace ecs {
struct System;
struct Ent {
typedef std::unordered_map<int, Component*> map_t;
typedef std::unordered_set<System*> set_t;
~Ent();
/// Overload for get<T>()
... |
/*
* ****************************************************************************
* * *
* * Copyright 2008, xWorkshop Inc. *
* * All rights reserved. *
*... |
/*
* File: Fecha.h
* Author: Daniel
*
* Created on 14 de agosto de 2014, 07:10 AM
*/
#ifndef FECHA_H
#define FECHA_H
class Fecha {
public:
Fecha();
Fecha(const Fecha& orig);
virtual ~Fecha();
Fecha sumarDia(int dias) = 0;
Fecha sumarMes(int mes) = 0;
Fecha sumarAnos(int anos) = 0;... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Tomasz Golczynski (tgolczynski@opera.com)
*/
#include "... |
//
// main.cpp
// assign6
//
// Created by macbook on 7/15/19.
// Copyright © 2019 team9. All rights reserved.
//
#include <iostream>
#include "tree.h"
void increase_size(node *root)
{
while(root != NULL)
{
++root->size;
root = root->parent;
}
}
// Insert an item into the subtree rooted at "root... |
#ifndef OPTIONS_H
#define OPTIONS_H
#include <time.h>
#include <string>
#include "Typedef.h"
#include "Game/GameConfig.h"
class Configure : public GameConfig
{
public:
Singleton(Configure);
public:
bool LoadGameConfig();
public:
uint16_t port;
uint16_t id;
std::string name;
std::string head_url;
//扫描监控时间
u... |
//
// Created by agrmv on 14.09.2019.
//
#pragma once
#include <string>
#include <unordered_map>
#include <cstring>
#include <FlexLexer.h>
enum Token {
WhiteSpace = 258,
NewLine,
Identifier,
NumericConstant,
Plus,
Minus,
Div,
Mul,
LeftBrace,
RightBrace,
LeftParen,
Right... |
// Copyright (c) 2015 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 published
// by the Free Software Foundation, with special ... |
#ifndef __SESERVICELOCATOR_H__
#define __SESERVICELOCATOR_H__
#include <string>
#include "SEConfigurationLoader.h"
#include "SERenderService.h"
#include "SEWindowManager.h"
#include "SEFlowController.h"
class SEServiceLocator
{
friend class SimpleEngine;
public:
void configRenderService(SERenderService::tRe... |
#pragma once
#include "scene/log.hpp"
#define TOOL_TLOG __TLOG << setw(20) << "[TOOL] "
#define TOOL_DLOG __DLOG << setw(20) << "[TOOL] "
#define TOOL_ILOG __ILOG << setw(20) << "[TOOL] "
#define TOOL_ELOG __ELOG << setw(20) << "[TOOL] "
|
../polyp_detector/filesystem_tools.cpp |
/**
* @file test.cpp
*
*
* @author Fan Kai(fk), Peking University
* @date 2008年04月02日 19时36分21秒 CST
*
*/
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
template<typename T>
int f(T &t) {
t = T();
return 0;
}
class Base {
public:
Base() {
cout <... |
#include<Servo.h>
Servo myservo[6];
int ctrl=3;
int stop_1=2;
void setup() {
myservo[1].attach(11);
myservo[2].attach(10);
myservo[3].attach(9);
myservo[4].attach(6);
myservo[5].attach(5);
pinMode(ctrl,INPUT);
pinMode(stop_1,INPUT);
attachInterrupt(digitalPinToInterrupt(stop_1), stop_all, RISING);
ran... |
// Created on: 1999-09-17
// Created by: Denis PASCAL
// 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 Lesser... |
/**************************************************************************************
* File Name : GameManager.cpp
* Project Name : Keyboard Warriors
* Primary Author : Doyeong Yi
* Secondary Author :
* Copyright Information :
* "All content 2019~2020 DigiPen (USA) Corporation, all rights... |
#ifndef CVML_H
#define CVML_H
#include <CStrUtil.h>
#include <CStrParse.h>
#include <CFile.h>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <sys/types.h>
using uchar = unsigned char;
#define CVML_MAGIC "CVML"
#define CVML_VERSION 1
#define CVML_MEMORY_MAX 0177777
#define OP_ARG_2 1... |
#include <iostream>
#include <fstream>
#include <sstream>
#include <chrono>
#include <string>
using namespace std;
int max(int a, int b) {
if (a > b) {
return a;
}
else {
return b;
}
return 0;
}
int sub_problem(int ** t, string x, string y, int i, int j) {
if (x[i] == '\0' || y[j] == '\0') {
return 0;
}
... |
#include "stdafx.h"
#include "up_konstanten.h"
#include "up_matritzen.h"
void up_matritzen(M_struct &M1){
MatrixXd KM(8, 8);
MatrixXd KMBieg(4, 4);
MatrixXd KMTors(2, 2);
MatrixXd KMZug(2, 2);
MatrixXd MM(8, 8);
double Tors_Fakt;
double ZG_Fakt;
double Bieg_Fakt;
double Massen_Fakt;
double phi;
int i;
... |
#ifndef LES_H
#define LES_H
#include <iostream>
using namespace std;
template<typename T>
class les{
public:
T* buffer;
int capacity;
int size;
les(int n): buffer(new T[n]), capacity(n), size(0){}
bool insert(T value){
if(size == capacity)
re... |
#include "gamewidget.h"
#include <QPalette>
#include <QFont>
#include <QString>
#include <QPixmap>
#include <QIcon>
#include <QImage>
#include <time.h>
#include <QDebug>
#include <QMessageBox>
Gamewidget::Gamewidget(QWidget *parent) :
QWidget(parent)
{
//设置背景
this->setAutoFillBackground(true);
this->r... |
#include "Course.h"
#include <iostream>
void Course::Print()
{
cout.precision(3);
cout << code << ": " << name << "(" << credit << ", " << score <<")";
}
|
#ifndef ScrollView_ScrollView_h
#define ScrollView_ScrollView_h
#include "cocos2d.h"
USING_NS_CC;
// 触摸误差
const int TOUCH_DELTA = 5;
class ScrollView : public CCLayer
{
private:
// 按下点
Point m_TouchDownPoint;
// 抬起点 配合使用判断是否为点击事件
Point m_TouchUpPoint;
// 当前触摸点
Point m_TouchCurPoint;
p... |
/* XMRig
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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 Fr... |
#include "Cenario.h"
Cenario::Cenario()
{
}
Cenario::~Cenario()
{
destroy_bitmap(fundo); // Destrói a imagem;
}
void Cenario::Desenha()
{
draw_sprite(buffer,fundo, x, y);
}
/* Sets */
void Cenario::setimg( BITMAP* IMG)
{
fundo = IMG;
}
void Cenario:... |
// -*- LSST-C++ -*-
/*
* LSST Data Management System
* Copyright 2008-2015 LSST Corporation.
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License ... |
//javier Alvarez Reyes
#include <cstdlib>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include<string>
#include <sstream>
using std::string;
#include "vigenere.h"
using std::string;
using namespace std;
int main()
{
int aea;
string m("Pablo Neruda");
string sifrado;
cout << "seleccione(1) si va a... |
#include <iostream>
#include "HackGame.h"
using namespace std;
void main()
{
int diff;
cout << "FALLOUT INDUSTRIES (TM) TERMALINK PROTOCOL" << endl;
cout << "ENTER DIFFICULTY(1 - 5): ";
cin >> diff;
cout << endl << "OPENING TERMINAL. ENTER CREDENTIALS TO PROCEED..."
<< endl << endl;
HackGame *game;
game =... |
#include "tree.cpp"
#include "time.h"
int main()
{
cout<<"Testing Directory Tree!!!\n";
Tree t("input_test.txt");
int c;
vector<string> result;
string lca;
int pts=0;
int success=1;
int count;
result = t.Locate("CS 578");
if(result.size() != 0){
if (result[result.size()-2] == "Spring'13"){
pts++;
co... |
// Generated from D:/4IF/PLD-COMP/Compilateur01\fichierAntlr.g4 by ANTLR 4.7
#pragma once
#include "antlr4-runtime.h"
#include "fichierAntlrVisitor.h"
/**
* This class provides an empty implementation of fichierAntlrVisitor, which can be
* extended to create a visitor which only needs to handle a subset of the ... |
#ifndef UTILS_H
#define UTILS_H
#include <cmath>
#include <vector>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <string>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
template<typename T>
T value_at_precision(const T val, unsigned int precision)
{
return (std::round(val * std::pow(10, preci... |
#pragma once
#include <iostream>
#include <time.h>
#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
#include "global.h"
/*产生数据,
data:每行为一个数据,列数为其特征维数*/
void generate_data(cv::Mat& data,const int samples,const int DIM);
/*聚类
input:
data:输入数据矩阵
feature_name_v: 输入数据矩阵,每行向量对应的照片名称
k: 计算k近邻
K: 计算样本间K个近邻的平... |
#ifndef PROCCESS_H
#define PROCCESS_H
#include <QObject>
#include <QRectF>
#include <QGraphicsItem>
#include <QBrush>
#include <QPainter>
#include <QTimer>
#include <QQueue>
class Proccess: public QObject
{
Q_OBJECT
public:
explicit Proccess(QObject* parent = nullptr);
private:
QTim... |
#include "conversationsmanager.h"
ConversationsManager::ConversationsManager()
{
}
QVector<Conversation *> ConversationsManager::getConversations()
{
return this->conversations;
}
void ConversationsManager::addConversation(QString name)
{
this->conversations.push_back(new Conversation(name));
}
Conversatio... |
// MatrixCalculatorDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MatrixCalculator.h"
#include "MatrixCalculatorDlg.h"
#include "Matrix.h"
#include "Complex.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////... |
#include "KeyForm.h"
#include "ui_ScaleForm.h"
#include "Entities/Key/Key.h"
#include "Entities/Scale/Scale.h"
typedef AddPartOfKeyForm AddForm;
KeyForm::KeyForm(Scale *scale,
Questions *questions,
QWidget *parent) :
QWidget(parent),
m_scale(scale),
m_key(scale->getKey(... |
#include "net/client.hpp"
#include "net/conn.hpp"
#include "net/stream.hpp"
#include "login/logind.hpp"
#include "proto/processor.hpp"
#include "proto/ss_login.pb.h"
#include "proto/cs_login.pb.h"
#include <memory>
#include <condition_variable>
#include <cppunit/extensions/HelperMacros.h>
namespace ps = proto::ss;
na... |
#pragma once
#include <Eigen/Sparse>
#include <Eigen/SparseLU>
#include <vector>
#include "basis.hpp"
#include "triangulation_view.hpp"
namespace space {
struct OperatorOptions {
// Options for all operators.
bool dirichlet_boundary = true;
// Whether or not to build the matrix for a forward operator.
bool ... |
#include <bits/stdc++.h>
using namespace std;
void recursion(vector<long long> &a, int lo, int hi) { // works only for 2^i
if (lo > hi)
return;
if (hi - lo == 1)
return;
int mid1 = (lo + hi) / 2;
int idx = mid1 + 1;
int mid2 = (lo + mid1) / 2;
for (int i ... |
/*
* @Description: 发布tf的类
* @Author: Ren Qian
* @Date: 2020-03-05 15:23:26
*/
#include "lidar_localization/publisher/tf_broadcaster.hpp"
namespace lidar_localization {
TFBroadCaster::TFBroadCaster(std::string frame_id, std::string child_frame_id) {
transform_.frame_id_ = frame_id;
transform_.child_frame_i... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long l... |
#include "detector.h"
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
if(argc != 3) {
cout << "Uso: <ext> <filename>" << endl;
return 0;
}
Mesh mesh;
if(strcmp(argv[1], "off") == 0) {
mesh.loadOffFile(argv[2]);
} else if (strcmp(argv[1], "mat... |
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool isPalindrome(ListNode* head) {
if(!head || !head->next) return true;
ListNode *slow = head;
ListNode *f... |
#ifndef ___GAME_WINDOW_HPP___
#define ___GAME_WINDOW_HPP___
#include <SDL\SDL.h>
#include <GLM\glm.hpp>
#include <chrono>
#include <core\system\graphics_mode.hpp>
#pragma warning(push)
#pragma warning(disable: 4312)
#pragma warning(push)
#pragma warning(disable: 4800)
namespace GameWindowFlags
{
enum... |
//算法:DP/背包
//由题意得:
// 选取和不超过S的若干个不同的正整数,
//使得所有数的约数(不含它本身)之和最大。
//则可以将此题看作一个容量为S的01背包
//求出各数的约数和作为权值,跑01背包即可
#include<cstdio>
#include<algorithm>
using namespace std;
int s,yue[1010],f[1010];
int main()
{
scanf("%d",&s);
for(int i=1;i<=s;i++)//求出(不包括它本身的)约数和
for(int j=2;i*j<=s;j++)// 使i的倍数的约数中加... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2007-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef POSIX_NETWORK_ADDRESS_H
#define POSIX_NETWORK_ADDRESS_H
# ifdef POSIX_OK_NETADD... |
#pragma once
#include "EyeImage.h"
#include "MoveIncludes.h"
#include "MoveBall.h"
#include "MoveColors.h"
#define NUM_COLORS 6
namespace Move
{
class BallColorManager
{
EyeImage* image;
volatile bool automaticColors;
int calibrated;
static ColorRgb colors[];
float colorError[NUM_COLORS]... |
#include "precompiled.h"
#include "script/jsvector.h"
#include "script/script.h"
#include <js32/src/jscntxt.h>
namespace jsvector
{
JSObject* vector_prototype = NULL;
JSBool vector_normalize(JSContext *cx, uintN argc, jsval *vp);
JSBool vector_length(JSContext *cx, uintN argc, jsval *vp);
JSBool vector... |
/*
* File: main.cpp
* Author: Daniel Canales
*
* Created on July 7, 2014, 8:01 PM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
//inputs
float mass;
//get mass
cout << "Enter the objects mass" << endl;
cin >> mass;
/... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* AWeapon.cpp :+: :+: :+: ... |
#include "gtest/gtest.h"
#include "../../../../options/Option.hpp"
#include "../../../../options/OptionPut.hpp"
#include "../../../../binomial_method/case/CroxRossRubinsteinaCase.hpp"
#include "../../../../binomial_method/method/regular/american/AmericanBinomialMethod.hpp"
TEST(AmericanGeneralTests, CRR_1) {
Opti... |
#ifndef MOVE_H
#define MOVE_H
#include "../../Rosalila/Rosalila.h"
#include "Frame.h"
#include "Character.h"
class Character;
class Frame;
class Move
{
public:
Character* character;
vector<Frame*> frames;
int tick;
int current_frame;
bool finished;
vector<string> cancels;
vector< vector<s... |
/*****************************************************************************************
* *
* owl *
* ... |
#ifndef OUTPUT_H
#define OUTPUT_H
#include <LiquidCrystal.h>
#include <arduino.h>
/*
* rs pin ->50, en pin -> 52, d4 - d7 -> 53, 51, 49, 47
* singleton design
*/
class Output {
Output(int rs, int en, int d4, int d5, int d6, int d7)
: lcd(rs, en, d4, d5, d6, d7) {
lcd.begin(COLNUM, ROWNUM);
}
Outpu... |
//
// PolyDataReceiver.cpp
// Hololens polydata receiver
//
// Created by Longquan Chen on 8/22/16.
//
//
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cstdlib>
#include <cstring>
//OpenIGTLink Include
#include "igtlOSUtil.h"
#include "igtlClientSocket.h"
#include "igtlMessa... |
#include "kernel_ctx/kernel_ctx.h"
#include "drv_image/drv_image.h"
#include "raw_driver.hpp"
int __cdecl main(int argc, char** argv)
{
if (argc < 2)
{
std::perror("[-] invalid use, please provide a path to a driver\n");
return -1;
}
std::vector<std::uint8_t> drv_buffer;
util::open_binary_file(argv[1], drv_b... |
/****************************************************************************
* AAMLibrary
* http://code.google.com/p/aam-library
* Copyright (c) 2008-2009 by GreatYao, all rights reserved.
****************************************************************************/
#ifndef AAM_UTIL_H
#define AAM_UTIL_H... |
/*
* Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com>
* Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com>
* Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com>
* Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com>
* Copyright (c) 2011 Guillaume Pinot <guillaume.pino... |
#include<iostream>
using namespace std;
int count(int arr[],int n)
{
int beg,end,mid;
beg=0;end=n-1;
while(end>=beg)
{
mid=beg+(end-beg)/2;
if((arr[mid]==1)&&(mid==end||arr[mid+1]==0))
{
return mid+1;
}
else if(arr[mid]==1)
{
beg=mid+1;
}
else end=mi... |
/**
\file quaternaryMask.cpp
\author UnBeatables
\name quaternaryMask
*/
#include "quaternaryMask.h"
//#define DEBUG 1
void quaternaryMask::setMask(int blackLMax, int whiteLMin, int greenHMean, int greenHVar, int greenSMin/*, int gray_thresh*/){
this->blackLMax = blackLMax;
this->whiteLMin = whit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.