text stringlengths 8 6.88M |
|---|
#include "position.h"
#include <algorithm>
auto minesweeper::row(Position position) -> Row {
return std::get<Row> (position);
}
auto minesweeper::column(Position position) -> Column {
return std::get<Column> (position);
}
auto minesweeper::maximumDistance(Position first, Position second) -> int {
auto const r... |
// Created by YUANZHONGJI on 2015/09
#ifndef __LOCK_GAME_LAYER_H__
#define __LOCK_GAME_LAYER_H__
#include "cocos2d.h"
#include "LBLibraryBase.h"
#include "Common.h"
USING_NS_CC;
class LockGameLayer : public WJLayer
{
private:
WJLayer *m_coverLayer;
WJLayer *m_lockLayer;
GameNumber m_gameNumber;
// 禁止屏幕点击
vo... |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{int t,h;
double const g=9.81;
cout<< "balandlik:";
cin>>h;
t=2*h/g;
cout<<sqrt(t);
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
int solve_(int x,int n)
{
if(x==0)
{
return 0;
}
if(n==0)
{
return 1;
}
n--;
return x*solve_(x,n);
}
int main()
{
int n;
int x;
cin>> x >> n;
cout << solve_(x,n) << endl;
return 0;
} |
/*
Perform a double-beta density model fitting to the surface brightness data
Author: Junhua Gu
Last modified: 2016.06.07
This code is distributed with no warrant
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include "beta_cfg.hpp"
#include "dump_fit_qdp.hpp... |
#ifndef STATSCLIENT_H
#define STATSCLIENT_H
#include <opencv2/core/mat.hpp>
#include <mutex>
#include "QObject"
#include <sys/socket.h>
#include "../Utils/Messages.h"
#include "../Utils/MutexBool.h"
#include "VehicleData.h"
#include "opencv2/core/types_c.h"
/*
enum MessageType { LEFT_IMAGE, RIGHT_IMAGE, SYSTEM_MESSA... |
#ifndef MAINMENU_H
#define MAINMENU_H
#include <SFML/Graphics.hpp>
#include "enumController.h"
class GameWindow;
class MainMenu
{
public:
MainMenu();
MainMenu(GameWindow* windowPtr);
void update();
sf::Sprite PlayText;
sf::Sprite SettingsText;
sf::Sprite ExitText;... |
#include <bits/stdc++.h>
#define ll long long
const ll MOD = 1000000007;
const ll INF = 1e18;
using namespace std;
template<typename T>
void print(const T& t) {
std::copy(t.cbegin(), t.cend(), std::ostream_iterator<typename T::value_type>(std::cout, " "));
cout << endl;
}
template<typename T>
void print2d(const T& ... |
#pragma once
#include "Vertex3Ds.h"
#include "misc.h"
#include "pole.h"
#include <vector>
class IHitable;
class ISelect;
class IScriptable;
class Collection;
class PinTable;
class IEditable
{
public:
IEditable();
virtual ~IEditable();
virtual HRESULT InitLoad(POLE::Stream* pStream, PinTable* pTable, int* pId, ... |
// Copyright (C) 2019 Greg Dionne
// Distributed under MIT License
#include <memory>
#include "expression.hpp"
OpTable::OpTable() {
// C++11 has a better way...
precedenceGroups.resize(7); // seventh (offset 6) is empty
precedenceGroups[0].push_back(Operator("|",bit_or));
precedenceGroups[1].push_back(Oper... |
#include "Joystick.h"
Joystick::Joystick()
{
for (int positionCounter = 0; positionCounter < POSITIONS_LENGTH - 1; ++positionCounter)
{
position_states[positionCounter] = NULL;
}
this->currentState = IdleJoystickState::getInstance();
this->currentMode = -1;
}
void Joystick::setMode(int newMode)
{
... |
#include "../zht/cpp_zhtclient.h"
#include "../zht/ZHTUtil.h"
#include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <ctime>
#include <time.h>
#include <sys/time.h>
#include <string>
#include <exception>
#include <fstream>
#include <sys/types.h>
#include <sys/socket.h>
#include <neti... |
/* Copyright (c) 2013 Richard Russon (FlatCap)
*
* 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 (at your option) any later
* version.
*
* This program... |
// ------------------------------------------------------------------------------------------------
#include "Database.hpp"
#include "SockAddr.hpp"
#include "Metadata.hpp"
#include "SearchNode.hpp"
#include "LookupResult.hpp"
#include "EntryDataList.hpp"
// -------------------------------------------------------------... |
/*
* 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 FLUXNODE_MEDIATYPEDATABASE_H
#define FLUXNODE_MEDIATYPEDATABASE_H
#include <flux/String>
#include <flux/PrefixTree>
#include <flux/Map>
namespace flux { te... |
#include <iostream>
#include <vector>
#include <fstream>
#include <list>
using namespace std;
struct Stare {
string eticheta;
vector<pair<char, int>> listaTranzitii;
};
struct ElTabelMultimi {
int *pVector;
};
struct ElTabelAFD {
char eticheta;
int *multime;
};
struct Automat {
Stare *stari ... |
//
// Created by WiktorW on 3/6/2018.
//
#ifndef JIMP_EXERCISES_DOUBLEBASEPALINDROMES_H
#define JIMP_EXERCISES_DOUBLEBASEPALINDROMES_H
#include <cstdint>
#include <string>
using namespace std;
uint64_t DoubleBasePalindromes(int max_vaule_exculsive);
#endif //JIMP_EXERCISES_DOUBLEBASEPALINDROMES_H
|
/* --COPYRIGHT--,BSD
* Copyright (c) 2011, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copy... |
#include <iostream>
#include <string>
using namespace std;
#include "solution3.h"
int main() {
string s, t;
Solution sol;
s = "anagram";
t = "nagaram";
cout << sol.isAnagram(s, t) << endl;
s = "rat";
t = "car";
cout << sol.isAnagram(s, t) << endl;
return 0;
} |
/*
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... |
#ifndef _CANMOVE_H_
#define _CANMOVE_H_
#include "common.h"
class SceneGame;
class Stone;
class canMove
{
public:
static canMove *createMove(SceneGame *game, int moveid, int row, int col, int killid);
canMove(SceneGame *game, int moveid, int row, int col, int killid);
virtual bool move() = 0;
int _moveid;
int... |
#include <memory>
#include <chrono>
#include <thread>
#include <ncurses.h>
#include <csignal>
#include "RegisterUser.hpp"
#include "FileHandling.hpp"
#include "GlobalVariables.hpp"
#include "SHA1.hpp"
#include "ConsoleWindow.hpp"
#include "StringSum.hpp"
#include "SignalHandling.hpp"
RegisterUser::RegisterUser(const ... |
//program to take binary input from file from same directory.
#include <iostream>
#include <fstream>
using namespace std;
int main(){
int Max = 80;
int str[Max];
for(int i=0; i<Max; i++)
str[i] = i;
ofstream os ("data.dat", ios::binary);
os.write( reinterpret_cast <char*>(str), Max*sizeof(char));
os.cl... |
#include "Address.h"
#include <vector>
#include "utils.h"
Address::Address() {
}
Address::Address(string s){
vector<string> parts = utils::split(s,'/');
town = parts.at(0);
district = parts.at(1);
street = parts.at(2);
try{
number = stoi(parts.at(3));
floor = stoi(parts.at(4));
latitude = stoi(parts.at(5)... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Sorcerer.cpp :+: :+: :+: ... |
#include <iostream>
using namespace std;
struct node{
int val;
node* left;
node* right;
int ht;
};
void LNR(node* root){
if(root == NULL)
return;
LNR(root->left);
cout << root->val << " ";
LNR(root->right);
}
node* insert(node * root, int val){
if(root == NULL){
node* newnode = new node;
newnode->... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Data structure to store a Job
struct Job {
int start, finish, profit;
};
// Function to perform binary search on the given jobs which are
// sorted by finish time. The function returns index of the last job
// which doesn't conflict ... |
#ifndef _TRINITY_WIDGET_LIST_H_
#define _TRINITY_WIDGET_LIST_H_
namespace NextAI
{
class WidgetList : public WidgetObject
{
public:
WidgetList();
virtual ~WidgetList();
private:
// Disable copy constructor
DISABLE_CLASS_COPY(WidgetList);
};
}
#endif // !_TRINITY_WIDGET_LIST_H_ |
#include "ap_fixed.h"
#include "ap_int.h"
#include "common.h"
#include <iostream>
#include <hls_opencv.h>
input_datatype input_1[INPUT_WIDTH][INPUT_HEIGHT][NO_OF_CHANNELS];
output_datatype output_1[70];
void myCNN(input_datatype input[INPUT_WIDTH][INPUT_HEIGHT][NO_OF_CHANNELS],output_datatype OUTPUT[70]);
int main()
{
... |
/***********************************************************************
created: 13/4/2004
author: Paul D Turner
purpose: Interface to base class for ListHeader widget
*************************************************************************/
/*********************************************************************... |
/*
* DiffCoeffs.cpp
*
* Created on: Jul 12, 2011
* Author: marchi
*/
#ifdef DIFFCOEFFS_H_
#include "DiffCoeffs.h"
template <unsigned int Order> int DiffCoeffs<Order>::nx=0;
template <unsigned int Order> int DiffCoeffs<Order>::ny=0;
template <unsigned int Order> int DiffCoeffs<Order>::nz=0;
template <unsign... |
// rotate.h
//
////////////////////////////////////////////////////////////////////////
#if !defined(__ROTATE_H)
#define __ROTATE_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "../fwlib/factory.h"
#include "../fwlib/fwunknown.h"
#include <kineplus.h>
#include <boundplus.h>
#inc... |
/**
* 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
*
* ... |
#ifndef STARTHELPER_H
#define STARTHELPER_H
#include <QMutex>
#include <QObject>
#include <QPointer>
class StartHelper : public QObject
{
Q_OBJECT
public:
explicit StartHelper(QObject *parent = nullptr);
static void handleStart();
private slots:
void startUpdater();
void done();
private:
static QMutex _runM... |
// RadixSortASM.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <random>
#include <time.h>
using namespace std;
extern "C" void radixSortBuckets(int radix, int numToSort, int* inputArrayPtr, int* outputArrayPtr);
static void RadixSort256(unsigne... |
#include <cstdio>
#include <algorithm>
#include <cstring>
int solve(char bits[]){
int ans = 0, len = strlen(bits), bef;
int dp[32][2] = {0, };
bef = -1;
dp[0][0] = (bits[0] == '1') ? 1 : 0;
dp[0][1] = 0;
if (bits[0] == '0'){
dp[0][1] = 1;
bef = 0;
}
for (int i = 1... |
#ifndef __ARBOLBINARIOORD_H__
#define __ARBOLBINARIOORD_H__
#include "NodoBinario.h"
#include <iostream>
#include <list>
#include <string>
template< class T >
class ArbolBinarioOrd {
protected:
NodoBinario<T>* raiz;
public:
ArbolBinarioOrd();
~ArbolBinarioOrd();
bool esVacio();
... |
/* Headers. */
#include "mex.h"
#include <mil.h>
#include "matrix.h"
/* Maximum number of images in the buffering grab queue of each digitizer.
Generally, increasing the number of buffers prevents missing frames.
*/
#define BUFFERING_SIZE_MAX 20 // 2 is minimum
/* Draw annotation in the Grab image buffers. Thi... |
/*
* 题目:跳台阶
* 日期:2020年2月1日
* 花费时间:10min
* 通过率:100%
*
*/
#include <iostream>
using namespace std;
class Solution {
public:
int jumpFloor(int number) {
if(number == 1)
return 1;
else if(number == 2)
return 2;
else
return jumpFloor(number - 1) + jump... |
#ifndef _SERVICIOPOP3_H
#define _SERVICIOPOP3_H
#include "servicio.h"
#include "dominio.h"
class cServicioPOP3:public cServicio {
public:
//Constructor e iniciador
cServicioPOP3(cDominio *dominio);
bool iniciar();
//Agrega una cuenta POP3 en el sistema
int agregarEmail(const std::string &, const std::stri... |
#include "Parser.h"
using std::ostream;
using std::list;
using std::set;
using std::string;
using std::numeric_limits;
void ParseEnv::out(ostream& o, const ParseSource& ps, int indent) {
for (list<ParseCapture>::iterator it=env.begin(); it!=env.end(); ++it) {
it->out(o, ps, indent); o << "\n";
}
}
void ParseCapt... |
#include "Window.hpp"
#include <exception>
namespace
{
void WindowClass()
{
MSG msg{ };
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
const std::wstring RegisterName()
{
const std::wstring className{ L"Default class Name" };
W... |
/*************************************************************************
> File Name: 46-50.cpp
> Author: wk
> Mail: 18402927708@163.com
> Created Time: Wed 24 Aug 2016 12:18:05 PM CST
************************************************************************/
#include<iostream>
using namespace std;
//46 不使用逻辑和加... |
#include "Collision.h"
Collision::Collision(sf::FloatRect shape, int layer, sf::Texture fond): m_shape(shape), m_layer(layer), m_fond(fond)
{
m_box = sf::RectangleShape(sf::Vector2f(shape.width, shape.height));
move(sf::Vector2f(shape.left, shape.top));
m_box.setTexture(&m_fond);
}
Collision::~Col... |
// strings class in STL
#include <bits/stdc++.h>
// #include<cstring>
using namespace std;
void i_o_f()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
//input.txt = for input
freopen("input.txt", "r", stdin);
//output.txt = for output
freopen("output.txt", "w"... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.UI.Xaml.Navigation.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.UI.Xaml.0.h"
#include "Windows.UI.Xaml.Interop.0.h"
#include "Windows.UI.Xaml.... |
/* File: ackermann.cpp
* Name: Paulo lemus
* Date: 4/3/2017
*/
/* A program that calculates the output of the ackermann
* function. This program prints out the trace for the
* function with the given input m and n.
*
* Status: Finished
*/
#include <iostream>
#include <stdexcept>
int ackermann(int m, int n);... |
#ifndef MEANPOINTCOUNTER_H
#define MEANPOINTCOUNTER_H
#include <QVector3D>
class meanPointCounter
{
QVector3D sum{0,0,0};
int amount = 0;
public:
meanPointCounter() = default;
void operator()(const QVector3D &p);
QVector3D result() const;
};
#endif // MEANPOINTCOUNTER_H
|
/***************************************************************************
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... |
#ifndef infectecd_hpp
#define infectecd_hpp
#include <SFML/Graphics.hpp>
#include "core.h"
#include "hp.h"
//#include <SFML/Audio.hpp>
class Infected
{
private:
//sf::Sound death;
float health, maxHealth, speed, maxSpeed;
sf::Texture infectedTexture, corpseTexture;
sf::Sprite infectedSprite;
enum cl... |
#include<iostream>
#include<algorithm>
using namespace std;
//The function written uses bottom up approah to create a max-heap. The complexity is O(n). though it would seem it is O(nlogn),
//logn is very small and hence can be ignored.
void buildHeap(int *arr, int n, int i) {
int left = (2*i) + 1;
int right = (2*i)... |
//
// SMART Response XE library
//
// LCD and keyboard routines for the SRXE handheld classroom communicator
//
// Copyright (c) 2018 BitBank Software, Inc.
// written by Larry Bank
// email: bitbank@pobox.com
// Project started 8/4/2018
//
// This program is free software: you can redistribute it and/or modify
// it u... |
///////////////////////////////////////////////////////////////////
//Copyright 2019-2020 Perekupenko Stanislav. All Rights Reserved.//
//@Author Perekupenko Stanislav (stanislavperekupenko@gmail.com) //
///////////////////////////////////////////////////////////////////
#pragma once
#include "CoreMinimal.h"
#include ... |
// #ifndef PARSE_H
// #define PARSE_H
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
/**
* This class stores the number of reads and writes, within
* a trace file, and has methods to to manipulate and
* obtain those values.
*/
class Parse
{
private:
// stores the total number of read... |
#include <fstream>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
ofstream ofs;
// static const openmode app = 0x01; 追加
// static const openmode ate = 0x02; 初始位置:文件尾部
// static const openmode binary = 0x04; 二进制
// static const openmode in = 0x08; 读
// st... |
#include <algorithm>
#include <iostream>
#include <vector>
int main()
{
std::vector<int> v{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
std::for_each_n(v.begin(), 7, [](int a) { a & 1 ? std::cout << a << " is odd\n" : std::cout << a << " is even\n"; });
return 0;
}
|
// by thaiph99
#include <bits/stdc++.h>
using namespace std;
// by thaiph99
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define FORR(i, a, b) for (int i = a; i >= b; i--)
#define ll long long
#define pii pair<ll, ll>
#define fi first
#define se second
#define pus push_back
#define pop pop_back
#define iosb ... |
/*
* For Gold and Sweetrolls
* Copyright (C) 2020 Piotr Wróblewski <szczypiorofix@o2.pl>
*/
#ifndef _DEFINES_H_
#define _DEFINES_H_
#pragma once
#include <string>
// =========================================================================== //
// 8bit
typedef unsigned char u8; // 0 - 255
ty... |
//
// Created by phith on 25.06.2021.
//
#include "Test.h"
|
#include <vector>
#include <iostream>
void PrintVector(const std::vector<int> &vec) {
std::cout << "[ ";
for (int i = 0; i < vec.size(); i++) {
std::cout << vec[i] << " ";
}
std::cout << "]" << std::endl;
}
void Swap(std::vector<int> &vec, int x, int y) {
int temp = vec[x];
vec[x] = vec[y];
vec[y] =... |
#ifndef DEPTHPROFILEVIZUALIZER_HPP
#define DEPTHPROFILEVIZUALIZER_HPP
#define DPV_AVERAGE_LENGTH 8
#include "depthprofilevizualizerproxy.hpp"
#include "qcustomplot.h"
#include <QWidget>
class DepthProfileVizualizer : public DepthProfileVizualizerProxy
{
Q_OBJECT
public:
explicit DepthProfi... |
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
int repeatedNTimes(vector<int>& A) {
unordered_set<int> s;
for (auto elem : A) {
if (s.count(elem))
return elem;
else
s.insert(elem);
}
return 0;
}
}; |
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2021, 4Paradigm Inc. */
#pragma once
#include "libpmemobj++/p.hpp"
#include "libpmemobj++/persistent_ptr.hpp"
#include "libpmemobj++/pool.hpp"
#include "libpmemobj++/utils.hpp"
#include "libpmemobj++/make_persistent.hpp"
#include "libpmemobj++/make_persistent_arra... |
#include <iostream>
#include <string>
#include "../class/menuWrapper/menuWrapper.h"
namespace play
{
std::string menuOptions[4] = {"> Levels", "Random Game", "Load Game", "Back"};
int lastActiveIndex = 0;
}
void print_playSelect(int y, int x, MenuWrapper& _)
{
// adjust the selected item
play::me... |
#include "stdafx.h"
#include "VesselSensorWidget.h"
#include "data/traits.h"
#include "PlanarSensorWidget.h"
#include "utilites/foreach.hpp"
CVesselSensorWidget::CVesselSensorWidget()
{
}
struct ItemShape
{
double height;
double width;
CRect rc;
};
inline int sgn(double h)
{
return h > 0 ? 1 :
... |
#ifndef __TIMESERIES_OPERATORS_HPP__
#define __TIMESERIES_OPERATORS_HPP__
namespace jflib { namespace timeseries { namespace operators {
/**
* Number - timeserie
*/
template<class TS, template<class,class> class Op>
class tsoperator1 {
public:
typedef TS tstype;
typedef typename tstype::key_type key_... |
#include "stadiummodify.h"
#include "ui_stadiummodify.h"
#include "FileManagerHeader.h"
#include <QDebug>
#include "sstream"
#include "adminmenu.h"
#include "souvedit.h"
stadiumModify::stadiumModify(QWidget *parent, QString stadiumName) :
QDialog(parent),
ui(new Ui::stadiumModify)
{
ui->setupUi(this);
... |
// 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!
==============================================================... |
#include "gjk_epa.h"
#include <vector>
using namespace std;
namespace physics
{
#ifdef DEBUG_GJKEPA
std::vector<SupportPoint> minkowskiPoints;
std::vector<Vector3> allMinkowskiPoints;
#endif
bool GjkEpa::generateContacts(Primitive *cpa, Primitive *cpb, CollisionData *cData)
{
#ifdef DEBUG_GJKEPA
minkowsk... |
// essentially just working backwards. learned to remember not to make expensive copies (ie copying a vector takes O(n) time).
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(ll i = a; i < b; ... |
#include <SFML\Graphics.hpp>
#include <Box2D\Box2D.h>
using namespace sf;
const float SCALE = 120.f;
const float DEG = 57.29577f;
b2Vec2 Gravity(0.0f, 9.8f);
b2World World(Gravity);
void setWall(int x, int y, int width, int height) {
b2PolygonShape gr;
gr.SetAsBox(width / SCALE, height / SCALE);... |
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUI.h"
#include "SystemKeys.pypp.hpp"
namespace bp = boost::python;
void register_SystemKeys_class(){
{ //::CEGUI::SystemKeys
typedef bp::class_< CEGUI::SystemKeys > SystemKeys_exposer_t;
S... |
#ifndef _VECTOR3_H_
#define _VECTOR3_H_
namespace ZyphMaths
{
class Matrix4x4;
class Vector3
{
public:
const static Vector3 ONE; // Returns a vector3 with all values set to 1.
const static Vector3 ZERO; // Returns a vector3 with all values set to 0.
const static Vector3 UPVECTOR; // Returns a vector3 with t... |
#ifndef PHDESENHOBASICO_INCLUDE
#define PHDESENHOBASICO_INCLUDE
#include <GLFW/glfw3.h>
enum formatos {
PONTO = 0,
CIRCULO = 1,
ESFERA = 2,
CUBO = 3,
PIRAMIDE = 4,
TRIANGULO = 6
};
typedef struct phPonto {
GLfloat x, y, z;
GLubyte r, g, b;
GLfloat tamanho;
formatos tipo;
} phP... |
// class Solution {
// public:
// //贪婪算法
// int cuttingRope(int n) {
// if(n < 4) return n - 1;
// long res = 1;//必须是long,否则无法用%mod
// //尽可能用3,即3的倍数的数全部用3的幂,4和2除外
// while(n > 4)//循环求余 O(n)复杂度
// {
// res *= 3;
// res %= 1000000007;
// ... |
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A1);
int sensorValue2 = digitalRead(9);
Serial.println(sensorValue);
Serial.println(sensorValue2);
Serial.println("hello");
delay(100);
}
//
//#include <time.h>
//int compteurfm = 0;
//int nbrtour = 0;
//unsigned long compte_... |
#include <iostream>
#include <string>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/optional.hpp>
#include <map>
using namespace boost::property_tree;
namespace atlnativeapi{
static const char* iniFileName = "atlnativeapi.ini";
static const char* sectionName =... |
#include <string>
#include <iostream>
#include "ClassePhysique.h"
void ClassePhysique::setPointDeSerenite(int ptsSerenite)
{
m_PtsSerenite = ptsSerenite;
}
void ClassePhysique::setPointDeSereniteMax(int ptsSereniteMax)
{
m_PtsSereniteMax = ptsSereniteMax;
}
int ClassePhysique::getPointDeSerenite(void)
{
... |
/*
* Copyright (C) 2012-2016 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 a... |
//33. Write a program in C++ to divide two numbers and print on the screen.
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
int div;
a=30;
b=10;
div=a/b;
cout << " The quotient of "<< a << " and "<<b <<" is : "<< div <<"\n\n" ;
}
|
#include "stdafx.h"
#include "CppUnitTest.h"
#include <distant/scoped_handle.hpp>
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace distant_unit_tests
{
TEST_CLASS(scoped_handle_tests)
{
private:
void compare_handles(const distant::kernel_handle& lhs, const distant::kernel_handle& rhs)
... |
#include <math.h>
#include <string.h>
#include <gsl_eigen/gsl_eigen.h>
#include <egsl/egsl_macros.h>
#include <gpc/gpc.h>
#include "../csm/csm_all.h"
#include "icp.h"
#include "time_patch.h"
#include <vector>
///////////////////////////////////////////////////////////////////////////////
// ... |
#include "stdafx.h"
#include "ApplicationProxy.h"
#include "JNIEnvHelper.h"
using namespace de::freegroup::jnipp;
std::string ApplicationProxy::className = "de/freegroup/digitalsimulator/Application";
jclass ApplicationProxy::objectClass = NULL;
jclass ApplicationProxy::_getObjectClass()
{
PROC_TRACE;
if (... |
// @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 <boost/winapi/basic_types.hpp>
#if !defined (BOOST_USE_WINDOWS_H)
#if !defined (BOOST_NO_ANSI_APIS)
BOOST_SYMBOL_IMPORT boost::winap... |
// addon_3.cc
#include <node.h>
#include "lrs/lr_3/lr_3_methods.cpp"
#include "lrs/lr_4/lr_4_methods.cpp"
#include "lrs/lr_5/lr_5_methods.cpp"
namespace lrs
{
using v8::Exception;
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Number;
using v8::Object;
using v8::String;
using v8::Value;... |
#ifndef DRIVER
#define DRIVER
#define TURNINGRIGHT 1
#define TURNINGLEFT 10
#define TURNINGBACKCW 4
#define TURNINGBACKCCW 9
#define FROZEN 0
#define MOVINGFORWARD 2
#define MOVINGBACKWARD 20
#define SLEEP 18
#define ADJUSTMOTORS 22
#define DEAD 50
#define FORWARDSPEED 11
#define BACKSPEED 8
#define TURNINGSPEED 6
#... |
// Z90KeyKeyboardDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "Z90KeyKeyboard.h"
#include "Z90KeyKeyboardDlg.h"
#include "afxdialogex.h"
#include "dcic32.h"
#pragma comment(lib, "dcic32.lib")
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
HANDLE icdev;
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
class CAboutDlg : public CDialo... |
//
// Created by 王润基 on 2017/4/8.
//
#include "IntersectInfo.h"
#include "Geometry.h"
#include "../Object/Object.h"
#include "../Material/Material.h"
using std::endl;
bool IntersectInfo::isOuter() const {
if(!needNormal)
throw std::invalid_argument("Try to test isOuter, but needNormal is false.");
re... |
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "GEE_UE2.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, GEE_UE2, "GEE_UE2" );
|
#include "Random1.h"
#include <cstdlib>
#include <cmath>
#include <iostream>
// the basic math functions should be in namespace
// std but aren't in VCPP6
#if !defined(_MSC_VER)
using namespace std;
#endif
ParkMiller pmGenerator;
double GetOneGaussianBySummation()
{
double result = 0;
for (unsigned long j = 0; j <... |
/*
* BasicServer.h
*
* Created on: 28 Mar 2011
* Author: "SevenMachines <SevenMachines@yahoo.co.uk>"
*/
#ifndef BASICSERVER_H_
#define BASICSERVER_H_
namespace cryo {
namespace networking {
class BasicServer {
public:
BasicServer();
virtual ~BasicServer();
};
}//NAMESPACE
}//NAMESPACE
#endif /* BASICS... |
//
// Created by wqy on 19-12-3.
//
#include "BeagleProperty.h"
using namespace esc;
void BeagleProperty::setProperty(string _property) {
this->property = _property;
} |
#ifndef _EXAMPLE_H_
#define _EXAMPLE_H_
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
void example_eigen();
#endif |
// $Id: GLOBAL.h,v 1.2 2013/02/12 18:56:15 david Exp $
#ifndef __PF2ASM_NODE_addressing_GLOBAL_H__
#define __PF2ASM_NODE_addressing_GLOBAL_H__
#include <cdk/nodes/Node.h>
#include "semantics/SemanticProcessor.h"
namespace pf2asm {
namespace node {
namespace addressing {
class GLOBAL: public cdk::node::No... |
#include <math.h>
#include <chrono>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <thread>
#include <sys/stat.h>
#define BYTESCHUNCKTOREAD 20
std::size_t getFileSize(std::string filename)
{
struct stat stat_buf;
int rc = stat(filename.c_str(), &stat_buf);
return rc == 0 ? stat_buf.st... |
#include <bits/stdc++.h>
using namespace std;
long long int a=10080;
long long int b=1100;
long long int c=a+b;
long long int d=b+c;
int precedence(char op)
{
if(op == '+'||op == '-')
return 1;
if(op == '*'||op == '/')
return 2;
return 0;
}
int operation(long long i... |
/**
* @file Collections.h
* @brief 3D visualization.
* @author Michael Kaess
* @version $Id: Collections.h 4232 2011-04-02 20:18:18Z hordurj $
*
* Copyright (C) 2009-2013 Massachusetts Institute of Technology.
* Michael Kaess, Hordur Johannsson, David Rosen,
* Nicholas Carlevaris-Bianco and John. J. Leonard
*
... |
//**************************************************************************
//**
//** 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 ... |
/*
Pcart is an online shopping website with N different items for sale such that all items are available in infinite quantities. Panik is opening a shop and wants to buy M items for his shop at the lowest possible price. The price of the ith item is A[i]. But there is a catch, Panik can order only 1 item at a time and... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.