text stringlengths 8 6.88M |
|---|
#pragma once
#include<memory>
template<typename T>
class CommonSingleton {
public:
~CommonSingleton() {}
static T& Inst() {
if(_instance.get() == nullptr) {
_instance.reset(new T());
}
return *_instance;
}
protected:
CommonSingleton() {};
static std::auto_ptr<T> _instance;
private:
CommonSing... |
#ifndef ENUMCONTROLLER_H_INCLUDED
#define ENUMCONTROLLER_H_INCLUDED
class GameWindow;
extern GameWindow* globalWindowPtr;
enum monthsEnum
{
JANUARY = 1,
FEBRUARY = 2,
MARCH = 3,
APRIL = 4,
MAY = 5,
JUNE = 6,
JULY = 7,
AUGUST = 8,
SEPTEMBER = 9,
OCTOBER = 10,
NOVERMBER = 11,... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF=1e15;
#define pii pair<ll,ll>
vector<pii>adj[100001];
vector<ll>dist(100001,INF);
void dijktra(int src)
{
priority_queue<pii,vector<pii>,greater<pii>>pq;
pq.push({0,src});
dist[src]=0;
while(!pq.empty())
{
... |
class Solution {
public:
string getPermutation(int n, int k) {
string temple;
for (int i = 1; i<=n; i++) {
temple+=i+48;
}
string result;
int xulie = 1;
for (int i = 1; i<n; i++) {
xulie*=i;
}
k--;
for(int templen = n-1;templen>0;templen--)
... |
#include <iomanip>
#include <iostream>
int inumber,iwait,iconst,in = 2, gr[50],f,l;
using namespace std;
int proverka(int gr[], int f, int in, int inumber,int iconst)
{
if (inumber % in == 0)
{
gr[f] = in;
f++;
inumber = inumber / in;
l = f;
if (inumber % in == 0)
{
return proverka(gr, f, in, inumber... |
#include "TimeStepper.hpp"
///TODO: implement Explicit Euler time integrator here
void ForwardEuler::takeStep(ParticleSystem* particleSystem, float stepSize)
{
vector<Vector3f> f = particleSystem->evalF(particleSystem->getState());
vector<Vector3f> old = particleSystem->getState();
vector<Vector3f> newState;
for (... |
#ifndef IMPVAL_H
#define IMPVAL_H
/// @file ImpVal.h
/// @brief ImpVal のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2012 Yusuke Matsunaga
/// All rights reserved.
#include "YmNetworks/bdn.h"
BEGIN_NAMESPACE_YM_NETWORKS
class ImpNode;
//////////////////////////////////////////////////... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Media.Editing.2.h"
WINRT_EXPORT namespace winrt {
namespace Windows::Media::Editing {
struct WINRT_EBO BackgroundAudioTrack :
Windows::Media::Editing::IBackgroundAudioT... |
#include "imageinfo.h"
ImageInfo::ImageInfo()
{
this->dstSize = Size(537, 269);
this->dstPtLeft[0] = Point(0, 0);
this->dstPtLeft[1] = Point(0, 269);
this->dstPtLeft[2] = Point(537, 269);
this->dstPtLeft[3] = Point(537, 0);
this->dstPtRight[0] = Point(0, 0);
this->dstPtRight[1] = Point(0, ... |
#ifndef _Boids_Network_Adapter_internal_h_
#define _Boids_Network_Adapter_internal_h_
#include "base/NetworkInterface.h"
#include "pvp.pb.h"
#include "CCLuaEngine.h"
class NetworkAdaperInternal : public cocos2d::NetworkInterface
{
public:
bool tryReceive();
};
void extendNetworkAdapter(lua_State *L);
#endif |
#ifndef PAINTWIDGET_H
#define PAINTWIDGET_H
#include <QWidget>
#include <qpainter.h>
class PaintWidget : public QWidget
{
Q_OBJECT
public:
enum PaintType
{
Line,
Rect,
None
};
explicit PaintWidget(QWidget *parent = 0);
PaintWidget(QPen *pen, QBrush *brush, PaintType ty... |
#ifndef UIPROVIDER_H
#define UIPROVIDER_H
#include <QObject>
class UiProvider : public QObject
{
Q_OBJECT
public:
explicit UiProvider(QObject *parent = 0);
void setBackgroundColor(const QColor&);
signals:
public slots:
};
#endif // UIPROVIDER_H
|
#include <mpi.h>
#include "system/Plate.cpp"
#include <stdio.h>
#include "system/Components/Temperature.cpp"
#include "system/Components/FirstConstrain.cpp"
#include "system/Components/SecondConstrain.cpp"
#include "parallels/paralel.h"
#include <pthread.h>
#include <string.h>
#include <sys/time.h>
#define REENTRANT
... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 ... |
// @copyright 2017 - 2018 Shaun Ostoic
// Distributed under the MIT License.
// (See accompanying file LICENSE.md or copy at https://opensource.org/licenses/MIT)
#pragma once
#include <distant/config.hpp>
#include <distant/agents/process.hpp>
#include <distant/support/winapi/psapi.hpp>
namespace distant {
namespace ... |
/****************************************
*
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE
* Copyright (C) 2019 Victor Tran
*
* 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 Foundati... |
#pragma once
#include "TitleScene.h"
#include <2D-Game-Engine/Game.h>
class MainGame : public Engine::EngineGame {
public:
void initGame() override;
void updateGame(float dt) override;
void destroyGame() override;
}; |
#ifndef PERMUTATIONSTREAM_H
#define PERMUTATIONSTREAM_H
#include <vector>
#include <stack>
#include <iostream>
struct PermutationState {
int targetSize;
std::vector<char> current;
std::vector<bool> used;
bool isComplete() const {
return current.size() == targetSize;
}
voi... |
#include "List.h"
#include <string>
#include <iostream>
using namespace std;
int main()
{
string str = "0";
List list;
list.pushBack(str);
list.pushBack("1");
list.pushBack("2");
list.pushBack("3");
list.insert(0, "4");
list.insert(3, "5");
list.remove(0);
list.remove(1);
list.remove(2);
List list2(list);... |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode * flattenHelp(TreeNode * root) {
if(root == nullptr) return root;
Tree... |
#include <iostream>
using namespace std;
template <class T>
class Number
{
private:
T _x;
public:
Number(const T& x) : _x(x) {}
bool operator< (const Number& rhs)
{
return this->_x < rhs._x;
}
bool operator== (const Number& rhs)
{
return this->_x == rhs._x;
}
voi... |
#ifndef LIBNDGPP_UTILITY_HPP
#define LIBNDGPP_UTILITY_HPP
#include <tuple>
namespace ndgpp
{
/// Causes a compiler error upon instantiation so the type can be examined
template <class T>
class print_type_t;
/// Helper function to generate a print_type_t compilation error
template <class T>
in... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void print(vector<int> t) {
for (int a : t)
cout << a << " ";
cout << endl;
}
int main() {
// freopen("huffman.in", "r", stdin);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i)
a[i] = i + 1;
... |
// $Id: AAP_var.hpp,v 1.2 2003/12/03 01:52:30 magh Exp $
/* ------------------------------------------------------------------------
Author: Matthew Galati (magh@lehigh.edu)
(c) Copyright 2003 Lehigh University. All Rights Reserved.
This software is licensed under the Common Public License. Please see
accompany... |
#ifndef ___ApplicationProxy_H
#define ___ApplicationProxy_H
#include <string>
#include "ProxyArray.h"
#include "PrimitiveArray.h"
#include "JStringHelper.h"
#include "JStringHelperArray.h"
using namespace de::freegroup::jnipp;
class I18NProxy
{
private:
static std::string className;
static jclass objectClass;... |
#include "linear_assignment.h"
#include <map>
linear_assignment *linear_assignment::instance = NULL;
linear_assignment::linear_assignment()
{
}
linear_assignment::~linear_assignment()
{
if(instance != NULL)
delete instance;
}
linear_assignment *linear_assignment::getInstance()
{
if(instance == NULL) ... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 ... |
#ifndef H_SPIDER_WINDOW_ELEMENT
#define H_SPIDER_WINDOW_ELEMENT
#include "VBoxElement.h"
#include "ImageLibrary.h"
#include "GraphicsContext.h"
namespace spider {
class WindowElement : public VBoxElement {
protected:
GraphicsContext * gc;
// ImageLibrary *mImages;
public:
/* ImageLibrary *images() {
... |
#pragma once
#include<iostream>
using namespace std;
struct node
{
int data;
node* left;
node* right;
};
class BST
{
protected:
node* root;
private:
int max(node* current)
{
node* current2 = current;
if (current == nullptr)
{
return 0;
}
else
{
current = current->left;... |
using namespace std;
#include <iostream>
class Time
{
int myhours;
int myminutes;
int myseconds;
public:
Time()
{
myhours = myminutes = myseconds = 0;
}
Time(int hours, int minutes, int seconds)
{
myhours = hours;
myminutes = minutes;
myseconds = seconds;
if (myseconds >= 60)
{
myminutes += m... |
//int SER_Pin = 5; //pin 14 on the 75HC595
//int RCLK_Pin = 4; //pin 12 on the 75HC595
//nt SRCLK_Pin = 0; //pin 11 on the 75HC595
/*
ShiftRegister74HC595.h - Library for easy control of the 74HC595 shift register.
Created by Timo Denk (www.simsso.de), Nov 2014.
Additional information are available on http://s... |
#include <jni.h>
#include <string>
#include "test_fixed_float.h"
extern "C" JNIEXPORT jstring JNICALL
Java_com_physics_demo_MainActivity_stringFromJNI(
JNIEnv *env,
jobject /* this */) {
std::string hello = "Hello from C++";
return env->NewStringUTF(hello.c_str());
}
extern "C" JNIEXPORT jstri... |
#include <iostream>
using namespace std;
int Fibonaci(int n)
{
// Mảng lưu kết quả các bài toán con
int *fibo = new int[n + 1];
int i;
fibo[0] = 0;
fibo[1] = 1;
for (i = 2; i <= n; i++) {
fibo[i] = fibo[i - 1] + fibo[i - 2];
}
return fibo[n];
}
int main()
{
int n;
cin >... |
#pragma once
#include "../Shader/Shader.h"
/*!
* \brief Base class for lights
*
*/
class Light
{
protected:
/*!
* Uniforms to update for a particular light and shader. Has to be overwritten.
*
* \param shader shader to be updated.
* \param index index index of the light among lights of the same type (use... |
#include "THEDEVASTATOR.h"
DEVASTATOR::DEVASTATOR()
{
DevastatorT.loadFromFile("THEDEVASTATOR.png");
Devastator.setTexture(&DevastatorT);
Devastator.setSize(sf::Vector2f(1500, 1300));
Devastator.setOrigin(1500 / 2, 1300 / 2);
Devastator.setPosition(900, 0);
AssaultArm.setSize(sf::Vector2f(10, 1000));
... |
#include "IScriptable.h"
IScriptable::IScriptable()
{
m_wzName[0] = 0;
} |
#ifndef __WHISKEY_AST_FieldReal_HPP
#define __WHISKEY_AST_FieldReal_HPP
#include <whiskey/AST/Field.hpp>
namespace whiskey {
class FieldReal : public Field {
private:
Real value;
protected:
std::unique_ptr<Field> onClone() const;
void onPrintAsLiteral(std::ostream &os) const;
bool onCompare(const Field &other) ... |
#pragma once
#include "newuser.h"
#include "gameform1.h"
#include "newgame.h"
#include "rules.h"
#include"compare.h"
#include"ranklist.h"
#include<stdlib.h>
#include<fstream>
#include<iostream>
#include<string.h>
using namespace std;
namespace miniprojectfirstassignment {
using namespace System;
usi... |
//------------------------------ Problem 2
#include <iostream>
using namespace std;
int main(){
int x,y, temp;
cout << "Enter value of of x: ";
cin >> x;
cout << "Enter value of of y: ";
cin >> y;
//swapping
temp=x;
x=y;
y=temp;
cout << "value of x is : " << x << endl;
cout << "value of y is : " << y;
return 0;
}
|
#include "widget.h"
#include "rotatedlabel.h"
#include <QtGui>
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
label = new RotatedLabel(this);
spinBox = new QSpinBox;
spinBox->setRange(-360, 360);
spinBox->setValue(0);
lineEdit = new QLineEdit("<h1>Text<sup>123</sup>Ψ</h1>");
QLa... |
#ifndef POP_HPP_INCLUDED
#define POP_HPP_INCLUDED
#include "email.hpp"
#include <iostream>
#include <sstream>
#include <queue>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/smart_ptr.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
typedef boost::function<v... |
/*
Packet for sending and receiving pings
Copyright (C) 2016 Alex Craig, Michael Wallace, Mario Garcia.
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 3 of the Lice... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Media.Playback.0.h"
#include "Windows.Devices.Enumeration.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.Foundation.Collections.0.h"
#include "W... |
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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 app... |
#include <iostream>
//#define cin ios::sync_with_stdio(false); cin
using namespace std;
typedef unsigned long long ll;
ll qmi(int m, int k, int p)
{
int res = 1 % p, t = m;
while (k)
{
if (k&1) res = res * t % p;
t = t * t % p;
k >>= 1;
}
return res;
}
int main(){
ll... |
//#include <iostream>
//#include <string>
//#include <vector>
//#include <algorithm>
//#include <sstream>
//using namespace std;
//
//int n;
//
//int sig(vector<char> &v, string s)
//{
// int p;
// int k = -1;
// bool first = true;
// for(int i = 0; i < s.size(); i++)
// {
// if(s[i] != '0' && s[i] != '.' && first)
//... |
/*
* File: Eventos2.cpp
* Author: Leonardo
*
* Created on 11 de Agosto de 2015, 09:16
*/
#include "Eventos2.h"
Eventos2::Eventos2(const Eventos2& orig) {
}
Eventos2::~Eventos2() {
}
|
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include "Game.h"
Game::Game(unsigned int screen_width, unsigned int screen_height) {
menu = std::make_unique<Menu>(screen_width, screen_height);
gameplay = std::make_unique<Gameplay>();
}
void Game::doAction(sf::RenderWindow& window) {
... |
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
const int N = 15015;
char a[N];
int k,lena,fail[N],g[N],ans = 0;
int main() {
scanf("%s",a);
scanf("%d",&k);
lena = strlen(a);
for(int i = 0 ; i < lena-2*k ; ++i) {
fail[i] = i-1;
int t = i-1;
for... |
#include <type_traits>
template<typename... Types>
struct typelist
{
template <typename T>
static constexpr bool includes(T)
{
return std::disjunction<std::is_same<T, Types>...>::value ;
}
template <typename... T>
static constexpr bool includes(typelist<T...>)
{
return (includes (T{}) && ...) ... |
#ifndef LIBNDGPP_ALGORITHM_ACCUMULATE_HPP
#define LIBNDGPP_ALGORITHM_ACCUMULATE_HPP
#include <cstddef>
#include <cstdint>
namespace ndgpp
{
/** Accumulates the value of each parameter
*
* @tparam Args The types of each parameter to accumulate
*
* @param args The parameters to accummulate
... |
#include<cstdio>
#include<iostream>
using namespace std;
int n;
char str[200005];
int main()
{
int n;
while(~scanf("%d",&n))
{
cin >> str;
int sum[5] = {0};
for(int i = 0; i < n; i++) {
if(str[i] == 'x')
sum[0]++;
else if(str[i] == 't' && su... |
#pragma once
#include "slice.h"
#include "aecollection.h"
#include "hitset.h"
#include "minmax_map.h"
#include "utilites/foreach.hpp"
namespace data
{
//////////////////////////////////////////////////////////////////////////
struct ae_layer
{
/**
* use_index_ = true - если используем индексы, то массив... |
#pragma once
#include <QMap>
#include <QDate>
#include <QList>
#include <QString>
#include <QDataStream>
uint qHash(const QDate &date);
struct Student
{
QString name;
// subject -> (date -> data)
QMap<QString, QMap<QDate, QString> > data;
};
typedef QList<Student> StudentList;
QDataStream &operator>>(Q... |
#ifndef READDATAOPENFOAM_H
#define READDATAOPENFOAM_H
#include "global_define.h"
#include "qstring.h"
#include "qtimer.h"
#include "ReadData_Base.h"
#include "vtkOpenFOAMReader.h"
#include "vtkUnstructuredGrid.h"
#include "vtkPointData.h"
#include "vtkStructuredGrid.h"
#include "vtkDataSet.h"
#include "vtkDataArray.h"... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll m,n,k;
while(cin>>n) cout<<(6* n* (n+1) /2 ) +1<<endl;
}
|
/*!
*
* \file TWebForm.h
* \author peng.John
* \date 2010.11.20
* \brief 描述信息窗口
*
* \ref CopyRight
*/
#ifndef __TDESFORM_H__
#define __TDESFORM_H__
#include "TG3.h"
#include "TCOM_TBrowser_WebPanel.h"
//#include "TCOM_TBrowser_WebClient_EventHandler.h"
/** 描述信息窗口
*
*/
class TWebForm : public TWindow
{
p... |
#include <thread>
#include <chrono>
#include "gtest/gtest.h"
#include "reduction_space_a.h"
#include "disp_engine_reduction.h"
using namespace std;
const int64_t kColCount = 1024*1024*1024;
const int64_t kCacheSize = 32*1024;//32*1024; //4*1024*1024;
const int kRepeat = 1;
class ReductionSpaceSum : public AReduction... |
#include "..\inc.h"
class input_stream
{
public:
input_stream(){srand(int(time(0)));}
// Character or -1
int read(){
return rand() % 26 + 'a';
}
};
void solve()
{
const int LEN = 7;
string seq;
map<int, vector<int> > h2i; //hash -> index
int h = 0;
input_... |
#pragma once
#include "DataManager.h"
//输入:场景结构、行人、行人生成频率、每次迭代表示的物理时长
class PedestrianSimulator
{
public:
//simulator的输入是场景结构、场景中人流频率与方向、是否可视化仿真过程以及方阵视频存储位置
PedestrianSimulator(std::string sceneFile, std::string satelliteFile,std::string pedestrianFile, int VisualRate = 0,std::string videoFile = "", std::... |
#ifndef GAMESCENE_H
#define GAMESCENE_H
#include "cocos2d.h"
#include "ui\CocosGUI.h"
USING_NS_CC;
using namespace ui;
class JewelsGrid;
class GameScene : public Layer
{
public:
static Scene* createScene();
CREATE_FUNC(GameScene);
bool init();
public:
static void addBonus(int bonus);
private:
static LoadingB... |
// odd even program.
#include <iostream>
using namespace std;
int main()
{
int n;
cout<<"plese enter any number\n";
cin>>n;
if(n%2==0)
{
cout<"Entered number is even";
}
else{
cout<<"Entered number is odd";
}
} |
//Programa : Arduino Ethernet Shield W5100 e HC-SR04
//Alteracoes e adaptacoes : FILIPEFLOP
//
//Baseado no programa exemplo de
//by David A. Mellis e Tom Igoe
//#include <Ultrasonic.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <DHT.h>
//Define os paramet... |
#include "CalcDamage.h"
|
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include <iostream>
#include <fstream>
#include "DotAndCross.h"
using namespace std;
int main()
{
int rows;
int cols;
ifstream indata("input.txt");
if(indata.is_open()){
while(indata >>rows >>cols){
DotAndCross dcObj(rows,cols);
dcObj.createABoard();
... |
#pragma once
#include <algorithm>
#include <windows.h>
#include <assert.h>
#include "common\Singularity.Common.h"
namespace Singularity
{
class Game;
class GameTask;
class BehaviorTask;
namespace Threading
{
class Task;
class WorkerThread;
class TaskScheduler;
class TaskQueue;
}
... |
/****************************************
*
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE
* Copyright (C) 2019 Victor Tran
*
* 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 Foundati... |
#include "SwervePosition2d.h"
SwervePosition2d::SwerveDelta::SwerveDelta(double x, double y, double t) {
dx = x;
dy = y;
dtheta = t;
}
SwervePosition2d::SwervePosition2d() {
m_translation = SwerveTranslation2d();
m_rotation = SwerveRotation2d();
}
SwervePosition2d::SwervePosition2d(SwerveTranslation2d tran, ... |
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... |
/*
Name: Mohit Kishorbhai Sheladiya
Student ID: 117979203
Student Email: mksheladiya@myseneca.ca
Date: 21/02/03
*/
#ifndef SDDS_ITEM_H_
#define SDDS_ITEM_H_
namespace sdds {
class Item {
char m_itemName[21];
double m_price;
bool m_taxed;
void setName(const char*... |
#pragma once
#include "IContainer.h"
#include <iostream>
class ArrayContainer : public IContainer {
private:
int size;
int capacity;
IE** elements;
void resize();
public:
ArrayContainer(int c);
ArrayContainer(const ArrayContainer& ac);
~ArrayContainer();
ArrayContainer& operator=(const ArrayContain... |
#include<bits/stdc++.h>
using namespace std;
int C[300][300], F[300][300];
vector< pair<int,int> > v[300];
int n,m;
int main(){
scanf("%d %d",&n,&m);
for(int i=1;i<=n;i++) scanf("%d",&C[0][i]);
for(int i=1;i<=m;i++) scanf("%d",&C[n+i][n+m+1]);
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
sca... |
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
==============================================================... |
/*
* DetectorNumPrimo.cpp
*
* Created on: 17 de fev de 2018
* Author: kryptonian
*/
#include <iostream>
using namespace std;
int num, ini, cnt;
int main(){
cout << "\n************************************" << endl;
cout << "**** Detector de números primos ****" << endl;
cout << "*********... |
/*void twoCloseOpen() {
servoTwo.write(180);
delay(1000);
servoTwo.write(0);
delay(1000);
servoTwo.write(90);
delay(1000);
}*/
void twoOpen() {
servoTwo.write(180);
}
void twoClose() {
servoTwo.write(0);
}
|
//$Id: StatisticAcceptFilter.cpp 1398 2015-03-03 14:10:37Z tdnguyen $
//------------------------------------------------------------------------------
// StatisticAcceptFilter
//------------------------------------------------------------------------------
// GMAT: General Mission Analys... |
/* ============================================================================
* Copyright (c) 2009-2016 BlueQuartz Software, LLC
*
* 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... |
// 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.Calls.0.h"
#include "Windows.ApplicationModel.Contacts.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.System.0.h"
#include "Win... |
#ifndef BSCHEDULER_BASE_THREAD_NAME_HH
#define BSCHEDULER_BASE_THREAD_NAME_HH
namespace bsc {
namespace this_thread {
extern thread_local const char* name;
extern thread_local unsigned number;
}
}
#endif // vim:filetype=cpp
|
// ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and OpenCL
// Version: 2019.2
// Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved.
//
// ===========================================================
#include "honeybee.h"
#in... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include <iostream>
#include <QObject>
#include <QString>
using namespace std;
#ifndef PERRO_H
#define PERRO_H
class Perro : public QObject{
Q_OBJECT
public:
explicit Perro(QObject* parent = 0);
virtual ~Perro();
QString getNombre();
QString getRaza();
int getEdad();
public slots:
void setN... |
#include <iostream>
using namespace std;
int main() {
char ch;
cin >> ch;
if ('a' <= ch && ch <= 'z')
cout << (char)(ch - 'a' + 'A') << endl;
else if ('A' <= ch && ch <= 'Z')
cout << (char)(ch - 'A' + 'a') << endl;
else cout << "none" << endl;
}
|
#include "controlador.h"
Controlador::Controlador(QObject *parent) : QObject(parent)
{
}
bool Controlador::siHaVotado(QString cedula)
{
QFile usuario("Lista de Personas que ya votaron.csv");
QTextStream io;
usuario.open(QIODevice::ReadOnly);
io.setDevice(&usuario);
while(!io.atEnd())
{
... |
//
// hwCamera.cpp
// HamsterWheel
//
// Created by OilyFing3r on 2014. 9. 2..
// Copyright (c) 2014년 OilyFing3rWorks. All rights reserved.
//
#include "hwCamera.h"
void Camera::lookAt()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(fovy, aspect, zNear, zFar);
glMatrixMode(G... |
#include "omega.h"
#include "TH1D.h"
#include "plot/root_draw.h"
#include "utils/combinatorics.h"
#include <string>
#include <iostream>
#include "TH3.h"
#include "base/Logger.h"
#include <algorithm>
#include <iostream>
#include "base/std_ext/math.h"
#include "TTree.h"
#include "base/std_ext/iterators.h"
#include "bas... |
// The best solution I have found. We do not need a vector to store the '1' in each bit of 32.
// Pay attention to the operation of & and |.
class Solution {
public:
int singleNumber(vector<int>& nums) {
int res = 0;
for(int i = 0; i < 32; i++)
{
int sum = 0;
for(int... |
#include<opencv2\opencv.hpp>
#include"opencv2\highgui\highgui.hpp"
#include<iostream>
#include<string>
using namespace std;
using namespace cv;
int H_MIN=0;
int H_MAX=256;
int S_MIN=0;
int S_MAX=256;
int V_MIN=0;
int V_MAX=256;
int x,a;
int y,n;
Mat img_rgb,img_thresh,img_hsv,drawing,output;
ch... |
#include "SceneCA.h"
#include "debug/Debug.h"
#include "basic/GlobalInstance.h"
#include "graphics/Renderer.h"
#include "graphics/Camera.h"
#include "graphics/Light.h"
#include "utility/Common.h"
#include "utility/KeyManager.h"
#include "utility/Type.h"
SceneCA::SceneCA(BlueCarrot::SceneID scene_id)
... |
#include<iostream>
#include<cstdlib>
using namespace std;
const int Max = 100;
class graph
{
private:
int n; // 정점의 갯수 ( 매트릭스 크기 )
int cost[Max][Max]; // Cost Matrix
int distance[Max]; // 정점들의 거리
bool found[Max]; // 방문 정보
public:
void init(int vertices); // graph의 초기화, 인자는 정점의 개수
void Shortestpath(int v); // 인... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QProcess>
#include <QDir>
#include <QDebug>
#include <QFile>
#include <QTextStream>
#include <QThread>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
... |
#pragma once
class CResliceControl;
class HmyLine3D;
class HmyPlane3D;
class OperateMprLines : public QObject
{
Q_OBJECT
public:
OperateMprLines(QObject *parent,int nImgWndType);
~OperateMprLines();
private:
int m_nWndType; //父窗口的类型
bool m_bShow; //是否显示
bool m_bActiveOblique; //是否允许斜切
bool m_bInitLines; //是否... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
/* Copyright 2017-2018 All Rights Reserved.
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* [Contact]
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* 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 Lic... |
//
// Created by tangzhongliang on 7/15/2016.
//
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <vector>
#include <opencv2/imgproc/imgproc.hpp>
#include <fstream>
#i... |
/*******************************************************************
* CS 307 Programming Assignment 2
* Author: Benjmin hoang
* Desc: traffic simulation
* Date: 4/15/2017
* I attest that this program is entirely my own work
*******************************************************************/
#include "... |
//Includes
#include <iostream>
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
#include "../sensors/mbed.h"
#include "../controls/pid.h"
#include "../util.h"
//Defines
#define ORIENT_DEADBAND 300
#define ALTITUDE_DEADBAND 3
//Globals
MMBED mmbed;
IMBED imbed;
PID x_regulator;
PID y_regulator;
PID alt_r... |
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
int main(){
int c = socket(AF_INET, SOCK_STREAM, 0);
if(c<0){
printf("Error on client socket\n");
}
... |
class Solution {
public:
bool isValid(string s) {
if(s.empty())
return true;
stack<char> m;
m.push(s[0]);
for(int i = 1; i < s.length(); i++)
{
if(s[i] == '(' || s[i] == '{' || s[i] == '[')
m.push(s[i]);
else
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.