text stringlengths 8 6.88M |
|---|
#include <iostream>
#include <windows.h>
typedef int(__stdcall* funcTA_MA)(int, int, const double[], int, int, double[]);
void test_taMA(funcTA_MA taMA) {
double in[] = { 1, 1, 2, 3, 4, 5., 5 };
int window = 3;
double out[10];
int size = taMA(0, 7, in, 3, 0, out); // 0 simple moving average 1 EMA
if (size == ... |
#include "stdafx.h"
#include "Conversions.h"
#include "Constants.h"
float pure::radians(float deg)
{
return deg * (pure::PI / 180.f);
}
float pure::degress(float radians)
{
return radians * (180.f / pure::PI);
}
|
// https://practice.geeksforgeeks.org/problems/zigzag-tree-traversal/1/
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int d){
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
Node* build... |
#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... |
// Copyright <2018> <Tomoyuki Nakabayashi>
// This software is released under the MIT License, see LICENSE.
//
// You might exucute these tests as root user.
#include <gtest/gtest.h>
extern "C" {
#include <libevdev/libevdev.h>
#include <linux/input.h>
#include <sys/time.h>
#include <fcntl.h>
#include <errno.h>
}
bool... |
#include <cstdint>
namespace rd
{
namespace ch1
{
/*
* converts a nonnegative integral number (specified as a uint64_t)
* to its nonnegative binary representation
*
* Example:
* decimal_to_binary<26>::value is replaced by 11010
*/
template <uint64_t input>
struct decim... |
#include<bits/stdc++.h>
using namespace std;
int dx[]={-1,1,0,0};
int dy[]={0,0,1,-1};
vis g[5][10];
void dfs(){
}
int main(){
}
|
#include "GnMeshPCH.h"
#include "GnInterfacePCH.h"
#include "GnInterfaceGroup.h"
GnImplementRTTI(GnInterfaceGroup, GnInterface);
GnInterfaceGroup::GnInterfaceGroup() : mAllPush( false )
{
SetIsCantPush( false );
}
GnInterfaceGroup::~GnInterfaceGroup()
{
for(gtuint i = 0 ; i < mChildren.GetSize() ; i++)
... |
#include "cxxtest/TestSuite.h"
#include "tinyxml/tinyxml.h"
#include "neural_network/cpu/NeuralNodeGroupCpu.h"
#include "neural_network/cpu/NeuralEdgeGroupCpu.h"
class NeuralEdgeGroupCpuTestSuite : public CxxTest::TestSuite
{
public:
void test_edge_group_can_be_loaded_from_xml_element()
{
try
{
std::vector<... |
#pragma once
#include "../../ext/freetype-gl/include/freetype-gl.h"
#include "../math/maths.h"
#include "../math/rectangle.h"
#include <string>
namespace sge{ namespace graphics{
class Font {
private:
ftgl::texture_atlas_t* m_FTAtlas;
ftgl::texture_font_t* m_FTFont;
float m_Size;
math::vec2 m_Scale;
... |
#include <iostream>
using namespace std;
int intput(int & num) {
cin >> num;
return num;
}
int converter(int number, int numSystem) {
if (number < numSystem) {
if (number > 9) {
cout << char('A' + number % numSystem - 10);
} else {
cout << number;
}
return 0;
} else {... |
#pragma once
//// Local includes
#include "Log.h"
#include "Common.h"
#include "ILocatable.h"
// Windows includes
#include <xapo.h>
#include <hrtfapoapi.h>
#include <XAudio2.h>
#include <agents.h>
#include <agile.h>
#include <collection.h>
#include <concrt.h>
#include <mfapi.h>
#include <mfidl.h>
#include <mfreadwrit... |
/****************************************************************
* TianGong RenderLab *
* Copyright (c) Gaiyitp9. All rights reserved. *
* This code is licensed under the MIT License (MIT). *
*****************************************************************/
#pragma once
namespace TG
{
// Meyer单例基... |
/*
* File: newtestclass.h
* Author: Ivan
*
* Created on May 29, 2013, 4:12:11 PM
*/
#ifndef NEWTESTCLASS_H
#define NEWTESTCLASS_H
#include <cppunit/extensions/HelperMacros.h>
class newtestclass : public CPPUNIT_NS::TestFixture {
CPPUNIT_TEST_SUITE(newtestclass);
CPPUNIT_TEST(testParseData);
CPPUN... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef _GDCMIO_DICOMPATIENTREADER_HPP_
#define _GDCMIO_DICOMPATIENTREADER... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including wit... |
// -*- 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.
//
// Adam Minchinton
//
#include "core/pch.h"
#include "adjunct/qui... |
#ifndef __DBFIELDTYPE_H
#define __DBFIELDTYPE_H
#include "_pch.h"
namespace wh{
enum FieldType
{
ftText = 0,
ftName = 1,
ftTextArray = 2,
ftLong = 100,
ftDouble = 101,
ftDateTime = 200,
ftDate = 201,
ftTime = 202,
ftLink = 300,
ftFile = 400,
ftJSON = 500,
ftBool = 600
};
struct FieldTypeItem
{
... |
#pragma once
#include "envire_visualizer/plugins/ItemFactoryInterface.hpp"
namespace envire { namespace viz
{
class SmurfItemFactory : public ItemFactoryInterface
{
public:
SmurfItemFactory();
virtual QWidget* getConfigurationWidget(const std::type_index& type);
virtual void addItem(const std::type_index& t... |
#include "matrix.h"
#include "constant.h"
#include "glm.h"
#include "entity/entity.h"
#include "entity/camera.h"
#define WIDTH static_cast<float>(WINDOW_WIDTH)
#define HEIGHT static_cast<float>(WINDOW_HEIGHT)
using namespace glm;
Matrix4 makeModelMatrix(const Entity &entity)
{
Matrix4 matrix(1);
matrix = ro... |
// Created by: Kirill GAVRILOV
// 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 as published
// by the Fre... |
//
// Actor.cpp
// GetFish
//
// Created by zs on 14-4-18.
//
//
#include "Actor.h"
#include "Common.h"
#include "GameScene.h"
#include "Tools.h"
Actor* Actor::create(const char *name)
{
Actor* pRet = new Actor();
if(pRet && pRet->init(name)) {
pRet->autorelease();
return pRet;
}
... |
#include <string>
#include "Fahrzeug.h"
#include <iostream>
#include <iomanip>
using namespace std;
extern double dGlobaleZeit;
// Standart Konstruktor
Fahrzeug::Fahrzeug(){
vInitialisierung();
p_sName = "";
p_dMaxGeschwindigkeit = 0;
};
// Konstruktor mit Initialisierungsliste, dynamische Variablen dürfe... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10420"
#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 times;
... |
#include "cConfig.h"
cConfig::cConfig()
{
N = -1;
searchParams = 0;
}
cConfig::~cConfig()
{
if (searchParams)
{
delete[] searchParams;
}
}
bool cConfig::getConfig(const char* FileName)
{
std::string value;
float weight;
float loglevel;
std::stringstrea... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2004 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/util/simset.h"
#include "... |
#include <iostream>
#include <complex>
#include "operators.h"
using namespace std;
int get_stencil_size(op_type opt)
{
switch (opt)
{
case STAGGERED:
case LAPLACE:
case LAPLACE_NC2:
case G5_STAGGERED:
return 1;
break;
case STAGGERED_INDEX: // Has around the corner
case STAGGER... |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include "CoinConf.h"
#include "Logger.h"
#include "Configure.h"
#include "StrFunc.h"
using namespace std;
static CoinConf * Instance = NULL;
CoinConf::CoinConf()
{
}
CoinConf * CoinConf::getInstance()
{
if(Instance==NUL... |
#ifndef VECTOR_H
#define VECTOR_H
struct Vector {
public:
Vector();
Vector(int size);
Vector(int size, int firstElement);
Vector(const Vector&);
Vector(Vector&&);
~Vector();
void push(int num);
int pop();
bool empty();
int size();
... |
// Created on: 1995-09-01
// Created by: Christian CAILLET
// Copyright (c) 1995-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 ... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long LL;
const int m = 1000;
LL a[1010];
int main()
{
int t;
scanf("%d",&t);
whi... |
// Generated by gencpp from file node_robot_msgs/robot_info_reportRequest.msg
// DO NOT EDIT!
#ifndef NODE_ROBOT_MSGS_MESSAGE_ROBOT_INFO_REPORTREQUEST_H
#define NODE_ROBOT_MSGS_MESSAGE_ROBOT_INFO_REPORTREQUEST_H
#include <string>
#include <vector>
#include <map>
#include <ros/types.h>
#include <ros/serialization.h... |
////////////////////////////////////////////////////////////////////////////////////////////////////
// NoesisGUI - http://www.noesisengine.com
// Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////
#inclu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Manuela Hutter
*/
#ifndef FAKE_WIDGET_STATE_MODIFIER_... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including wit... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2000-2008 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
*/
#include "core/pch.h"
#if defined(_NATIVE_SSL_SUPPORT_)
#ifdef ... |
#ifndef INTERVALSLABEL_H
#define INTERVALSLABEL_H
#include <QObject>
#include <QWidget>
#include <QLabel>
#include <QDate>
#include <QTime>
#include <QDateTime>
#include <QMouseEvent>
#include "recordingmanager.h"
class IntervalsLabel : public QLabel
{
Q_OBJECT
public:
explicit IntervalsLabel(QWidget *parent... |
#include "types.hpp"
#include "mappings.hpp"
template<typename InIt, typename OutIt>
OutIt Copy1(InIt first, InIt last, OutIt result) {
for (; first != last; ++first, ++result)
*result = *first;
}
namespace mine {
template<class T>
struct propogate_ref {
using type = T&;
};
template<class T>
struct ... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* 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 "adjunct/desktop_util/boot/DesktopBootstrap.h"
#inclu... |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <iterator>
#include <map>
#include <set>
using namespace std;
static set<string> exclude;
static map<string, int> frequency;
//static ofstream file;
struct t{
void operator()(string s){
if (exclude.find(s)==exclude.end()) return;
if (frequenc... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matt Olan, Prajjwal Bhandari
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the r... |
#include<iostream>
#include<fstream>
#include <string>
using namespace std;
class File
{
public:
string file (int line)
{
string temp;
int i=1;
ifstream quest("questions.txt");
while(getline(quest , temp))
{
if(i==line)
{
return temp;
}
i++;
}
... |
// Created on: 1996-08-09
// Created by: Herve LOUESSARD
// Copyright (c) 1996-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... |
#include "Furniture.h"
Furniture::Furniture(int x, int y, QString path):QGraphicsPixmapItem()
{
img = QImage(path);
this->setPixmap(QPixmap::fromImage(img));
this->setScale(0.02);
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
this->setX(x);
this->setY(y);
}
void Furniture::SetWidth(i... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
string simplifyPath(string path) {
//基本思想:栈,因为C++中string没有split成员函数,所以导致这道题有点复杂
//循环遍历path每个字符,遇到/../栈弹出一个元素,遇到/.../入栈,遇到/./直接跳过,遇到/.a/入栈,其他情况/a/入栈
vector<string> vec;
string res;
int i, flag, pos;
if (pat... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2011-2011 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch.h"
#include "modules/dom/src/domcss/csskey... |
#include "bluetank.h"
BlueTank::BlueTank()
{
}
|
//Author: Angelo Gonzales
//Assignment Number: Lab 3
//File Name: backwardsIterative
//Course/Selection: COSC 2436 Section 003
//Due Date: 10/11/18
//Instructor: Ku, Bernard
//Description: This program takes a text file name and runs that file
// through an iterative ... |
#include "jmm_stl_type_traits.h"
#include "jmm_stl_iterator.h"
#include <cstdlib>
#include <cstddef>
#include <new>
#ifndef JMM_STL_ALGOBASE
#define JMM_STL_ALGOBASE
namespace JMM_STL
{
template <class InputIterator1, class InputIterator2>
inline bool equal(InputIterator1 first1, InputIterator1 last1,
InputItera... |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a,b,c,x1,x2;
cin >> a >> b >> c;
double delta;
delta = pow(b,2) - (4 * a * c);
cout << "* " << delta << "\n";
x1 = sqrt(delta);
x2 = -sqrt(delta);
printf("R1 = %.5f \n",((-b + x1)/(2*a)));
printf("R2 = %.5f \n",((-b + x2)/(2*a)));
return 0... |
/* arduino_control_test.ino
* Created: 2017.11.08
* Uvindu Wijesinghe and Oliver Wilkins
*
* Description:
* This program allows the user to send steering and throttle PWM values to the ESC
* in order to test the communication between the Arduino and the ESC.
* This program can be used to find the PWM value ran... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch_system_includes.h"
#ifdef VEGA_BACKEND_OPE... |
#include "pch.h"
#include "NoInteractable.h"
#include "GameObject.h"
#include "MapRepresentation/GameObjectGridMap.h"
#include "Seed.h"
#include "StateMachine/SeedStateMachine.h"
#include "GameObjectData/SeedData.h"
#include "Components/Animator.h"
NoInteractable::NoInteractable(Vector2i aGridPosition)
: m_gridPosi... |
#ifndef Cvector_hpp
#define Cvector_hpp
#include"Cvertex.hpp"
#include"Cvector.hpp"
class C3DObject {
C3DObject();
public:
Cvertex Uposition ;
virtual double InIntersectedBy(CRay &)=0;
virtual Cvector GetNormal(Cvertex &)=0;
virtual Cvector GetTangeant(Cvertex &)=0;
~C3DObject();
};
#endif
|
#pragma once
namespace jsinput
{
}; |
// Copyright <2018> <Tomoyuki Nakabayashi>
// This software is released under the MIT License, see LICENSE.
#include <os/mock_io.h>
MOCK_IO *mock_io {};
int IO_OPEN(const char* pathname, int flags) {
return mock_io->IO_OPEN(pathname, flags);
}
ssize_t IO_WRITE(int fd, const char *buf, size_t count) {
return moc... |
// Name: Delwin Rosa
// Date: 04/19/2020
// Program: Program 5, Encryption and Decryption
// Purpose: The purpose of this program is to receive the name of a file that contains a message,
// and the name of another file you wish to write the encrypted message to as well as a shift key.
// The program ... |
#include "Resources.h"
#include "Exception.h"
#include "Core.h"
#include <iostream>
#include "Mesh.h"
#if _WIN32
#include <windows.h>
#endif
Resources::Resources(std::shared_ptr<Core> _core)
{
core = _core;
#if _WIN32
#ifdef NDEBUG
char strExePath[MAX_PATH];
GetModuleFileName(NULL, strExePath, MAX_PATH);
std::... |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int tabla[6][3194],filas,columnas;
ifstream archivo;
string txt;
void file(){
archivo.open("migraciones.txt",ios::in);
if (archivo.fail()){
cout<<"\nNo se encuentra el archivo migraciones.txt\nPor favor descarguelo de https... |
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <deque>
#include<iomanip>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cmath>
#include <string>
#incl... |
#ifndef HMAP_HPP
#define HMAP_HPP
class HMap{
private:
struct Node {
int key;
std::string value;
Node* next;
};
int size;
Node** array;
int hash(int key);
bool isEmpty();
public:
HMap();
HMap(HMap& hM);
HMap(HMap&& hM);
~HMap();
void add(int key, s... |
#ifndef CLASS_H
#define CLASS_H
#include "students.h"
class Class
{
private:
//班级学生数量
int Students_sum = 0;
//学生序号
int Students_id = 0;
public:
Class();
//学生链表头尾
Students *start = NULL;
Students *end = NULL;
void addStudents(QString Name1,QS... |
// Factorization of a number in sqrt(n)
vi fact(ll n){
vector<int> div;
for(ll i=2;i*i<=n;i++)
if(n%i==0){
div.pb(i);
while(n%i==0)
n/=i;
}
if(n!=1) div.pb(n);
return div;
} |
//
// Created by tymek on 14.01.2020.
//
#include <vector>
#ifndef TRAVELLING_SALESMAN_ANT_H
#define TRAVELLING_SALESMAN_ANT_H
using namespace std;
class Ant {
public:
int number;
vector<bool> visited;
Ant(int number, int number_of_vertex);
~Ant();
};
#endif //TRAVELLING_SALESMAN_ANT_H
|
//---------------------------------------------------------------------------
#ifndef FrmTranslationH
#define FrmTranslationH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------... |
#include <ros/ros.h>
#include "RepositionBaseExecutor.h"
int main(int argc, char* argv[])
{
ros::init(argc, argv, "hdt_base_planning");
return RepositionBaseExecutor().run();
}
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
string t, s;
cin >> t;
s = t;
reverse(t.begin(), t.end());
vector<int> w(n), e(n);
for(int i=0; i<n-1; i++){
w[i+1] += w[i];
if(s[i] == 'W') w[i+1]++;
e[i+1] += e[i];
... |
#include <iostream>
#include <queue>
using namespace std;
int n;
int count = 0;
queue<pair<int, int>> q;
void hanoi(int size, int cur, int tar){
/*
옮긴다 -> 제일 밑에부분 빼고 나머지를 현재 위치에서 목표가 아닌 다른 곳으로 옮긴다
-> 제일 밑에부분을 목표부분으로 옮긴다.
-> 나머지를 목표부분으로 옮긴다.
*/
int next = 0;
switch(cu... |
// Created on: 1997-08-04
// Created by: Jean-Louis Frenkel
// 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 the... |
#ifndef STORAGE_H
#define STORAGE_H
#include <QObject>
#include <qdebug.h>
#include "uEye.h"
#include <QTime>
#include <qfile.h>
typedef QVector<unsigned long long> ULongLongVector;
class Storage : public QObject {
Q_OBJECT
public:
Storage(QObject *parent = 0);
~Storage();
private:
QFile file;
bool first;
pub... |
// Created on: 1993-10-08
// Created by: Gilles DEBARBOUILLE
// 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 th... |
int logv[MAX+1];
void make_log() {
logv[1] = 0; // pre-computar tabela de log
for (int i = 2; i <= MAX; i++)
logv[i] = logv[i/2] + 1;
}
struct Sparse {
int n;
vector<vi> st;
Sparse(vi& v) {
n = v.size();
int k = logv[n];
st.assign(n+1, vi(k+1, 0));
forn(i, n... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int ar[1000], ar2[1000];
int n;
while(cin>>n)
{
for(int x=0; x<n; x++)
cin>>ar[x];
int i, j, k, low, high, ans=0, cnt1=0, gth=0, p=0, cnt2=0, temp, x=n-1, y=0;
for(i=0; i<n; i++)
ar2[i] = ar[i];
... |
#include "Database.h"
#include "Tools/SG_Logger.h"
#include <sstream>
#pragma comment(lib, "libmysql.lib")
MySQLConnection::MySQLConnection()
{
m_bIsConnected = false;
m_MySQLConn = nullptr;
m_sHostname = "";
m_sUsername = "";
m_sPassword = "";
m_wPort = 0;
m_sSchemaName = "";
}
MySQLConnection::~MySQLConnecti... |
#ifndef DIJKSTRA_H
#define DIJKSTRA_H
#include <eigen3/Eigen/Eigen>
#include <iostream>
#include <vector>
using namespace std;
using namespace Eigen;
class node{
private:
double distance;
node* previous;
bool has_previous;
public:
int mat_index; //contains index in adjacency matrix
int queue_ind... |
/*
* 题目:872. 叶子相似的树
* 链接:https://leetcode-cn.com/problems/leaf-similar-trees/
* 知识点:树的深度优先遍历
*/
class Solution {
public:
bool leafSimilar(TreeNode* root1, TreeNode* root2) {
vector<int> leafNodes1;
dfs(root1, leafNodes1);
vector<int> leafNodes2;
dfs(root2, leafNodes2);
r... |
#include<iostream>
#include<set>
#include<vector>
#include<algorithm>
#define MIN(a,b,c) ((a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c)))
#define FOR(i,n) for(i=0;i<n;i++)
using namespace std;
int main()
{
int i,n,bat,nb,ng,temp,size,f1,f2;
multiset<int>sb,sg;
multiset<int>::iterator it1,it2,it3;
vector<i... |
#include <string>
#include <vector>
using namespace std;
int solution(int n) {
int answer = 0;
vector<bool> v(1000001, false);
for(int i=2; i<=n/2; i++){
for(int j=2; i*j<=n; j++)
v[i*j]=true;
}
for(int i=2; i<=n; i++)
if(!(v[i]))answer++;
return ans... |
#ifndef labelrelationediteur_h
#define labelrelationediteur_h
#include <QWidget>
#include <QLineEdit>
#include <QFormLayout>
#include <QPushButton>
#include <QVBoxLayout>
#include <QMessageBox>
//#include "relation.h"
#include "mainwindow.h"
class Relation;
class labelRelationEditeur : public QWidget {
Q_OBJECT... |
int morseA [] = {0,1,-1};
int morseB [] = {1,0,0,0,-1};
int morseC [] = {1,0,1,0,-1};
int morseD [] = {1,0,0,-1};
int morseE [] = {0,-1};
int morseF [] = {0,0,1,0,-1};
int morseG [] = {1,1,0,-1};
int morseH [] = {0,0,0,0,-1};
int morseI [] = {0,0,-1};
int morseJ [] = {0,1,1,1,-1... |
/* -*- mode: c++; tab-width: 4 -*-
**
** Copyright (C) 2009 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Test for serializing native objects to output formats.
**
** Jan Borsodi
*/
group "protobuf.protocolbuffer_... |
#include <cassert>
#include <cstring>
#include <fstream>
#include <sstream>
#include <vector>
#include "gmock/gmock.h"
#include "gmock/gmock-matchers.h"
#include "perm.h"
#include "perm_group.h"
#include "perm_set.h"
#include "test_utility.h"
using cgtl::Perm;
using cgtl::PermGroup;
using cgtl::PermSet;
using cgtl::... |
#include "Map.h"
Map::Map(int a,int b, int c): taillePlan(a), taillePerlin(b), resolution(c)
{
displayList=glGenLists(1);
setNoiseMap();
setHeightMap();
setDisplayList();
}
Map::~Map()
{
glDeleteLists(displayList, 1);
}
void Map::draw()
{
glCallList(displayList);
/*
utils::RendererImage renderer;
utils::Ima... |
#include <iostream>
#include <cstdlib>
#include <time.h>
using std::cout;
using std::endl;
#include "BCS.h"
// Sebastian Wouters, November 14, 2012.
BCS::BCS(int L, int TwoSz){
srand(time(NULL));
int maxL = gMaxL();
if (L>maxL){
cout << "Maximum value of L that is supported on this machine = " << m... |
#include "stdafx.h"
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <ctime>
using namespace std;
void output(double *mass, int n)
{
for (int i = 0; i< n; i++)
{
cout << " " << mass[i];
}
cout << endl;
}
int main()
{
srand(time(0));
double *mass;
int n;
cin >> n;
mass =... |
#include "TestDB.h"
#include "DAOMakers.h"
#include <mylibs/container.hpp> // pl::printContainer
#include "FoodImpl.h"
#include <vector>
#include <iostream>
namespace testCrap {
std::ostream &operator<<(std::ostream &os, Person const &p) {
return os << p.name << STR(" ") << p.address << STR(" ") <... |
//sorted version. directly use sort() costs time.
class Solution {
public:
vector<string> findStrobogrammatic(int n) {
if(n < 0) return {};
return findHelper(n, n);
}
vector<string> findHelper(int x, int n){
if(x == 0) return {""};
if(x == 1) return {"0","1","8"};
vec... |
#include <iostream>
int main(int argc,char *argv[])
{
std::cout << "hello, testc!!!!" << std::endl;
return(0);
} |
/*! @file SDControlVol.hh
@brief Defines sensitive part (ControlVols)of simulation.
Definition of the SDControlVol class
@date 13 Oct 2015
@author D. Flechas (dcflechasg@unal.edu.co)
*/
#ifndef SDControlVol_h
#define SDControlVol_h 1
#include "ControlVolHit.hh"
#include "G4VSensitiveDetector.hh"
class G4... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2007-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"
#ifdef USE_UNICODE_LINEBREAK
#include "mo... |
/*
Author: John Grime
*/
#if !defined(MDNS_INTERFACES)
#define MDNS_INTERFACES
#include "defs.hpp" // should come before any inet headers etc
#include <ifaddrs.h> // getifaddrs(), freeifaddrs()
#include <net/if.h> // IFF_<x>, if_nametoindex(), if_indextoname()
#include <vector>
#include "SockUtil.hpp"
namespac... |
#include <GL/glut.h>
#include <algorithm>
#include "point.h"
#include "line.h"
#include "circle.h"
#include "rectangle.h"
#include "triangle.h"
bool rectangle::overlaps(const point p) const {
return this->center.x - this->xlen/2 <= p.x && p.x <= this->center.x + this->xlen/2
&& this->center.y - this->ylen/2 <= p.y... |
// Copyright 2013, Ji Zhang, Carnegie Mellon University
// Further contributions copyright (c) 2016, Southwest Research Institute
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redis... |
#include <iostream>
int& pre(int& i) {
i -= 1;
return i;
}
int post (int& i) {
int tmp = i;
i -= 1;
return tmp;
}
int main() {
int num = 0;
std::cout << pre(num) << std::endl;
std::cout << num << std::endl;
std::cout << post(num) << std::endl;
std::cout << num << std::endl;
... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int v,i;
int a[10];
cin>>v;
for(i=0; i<10; i++)
{
a[i]=v;
v=v*2;
}
for(i=0; i<10;i++)
{
cout<<"N["<<i<<"] = "<<a[i]<<"\n";
}
return 0;
}
|
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <numeric>
#define INF (1<<28)
#define EP... |
// Created on: 2009-04-06
// Created by: Sergey ZARITCHNY
// Copyright (c) 2009-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... |
#include<iostream>
#include<vector>
#include<fstream>
#include "omp.h"
#include<cmath>
#include<sys/time.h>
#include <algorithm>
using namespace std;
int main(void){
vector<int> test(1999990);
}
|
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
class Solution {
public:
vector<int> num;
vector<int> dict = { 2,3,5 };
int nthUglyNumber(int n) {
//基本思想:递归,递归遍历所有2,3,5质因数组合成的丑数
//递归函数传入的cnt表示当前得到的丑数的质因数个数
num = { 1 };
int cnt = 1;
while(num.size() < 1690)
{
long cur = 1;
... |
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main(int argc,char *argv[])
{
FILE* f,*f2;
int i,contador=0;
char buffer;
for(i=1;i<argc;i++)
printf("%s\n",argv[i]);
f=fopen(argv[3],"rw");
f2=fopen("C6Ej2Trans.txt","w");
while(!feof(f))
{
buffer=fgetc(f);
if(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.