text stringlengths 8 6.88M |
|---|
#ifndef WARLOCKSTATE_H
#define WARLOCKSTATE_H
#include <iostream>
#include <string>
#include "SpellCasterState.h"
#include "../Specifications.h"
class WarlockState : public SpellCasterState {
public:
WarlockState(const std::string& name, int health = static_cast<int>(HP::WARLOCK), int damage = static_cas... |
#include "test_lib_1.h"
#include <iostream>
void test_lib_1()
{
std::cout << "test_lib_1" << '\n';
}
|
/* ***** 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_DICOMLANDMARK_HPP_
#define _GDCMIO_DICOMLANDMARK_HPP_
#in... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Object.h>
#include <Uno.UX.Property-1.h>
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno... |
#include<cstdio>
using namespace std;
int main(){
//input
int ra,ca;
fscanf(stdin,"%d %d",&ra,&ca);
int a[ra][ca];
for(int i=0;i<ra;++i){
for(int j=0;j<ca;++j){
fscanf(stdin,"%d",&a[i][j]);
}
}
int rb,cb;
fscanf(stdin,"%d %d",&rb,&cb);
int b[rb][cb];
... |
#include "Graph.hpp"
#include <list>
#include <algorithm>
#include <functional>
#include <chrono>
#include <iostream>
#include "Dijkstra.hpp"
using namespace std::chrono;
Graph::Graph(System::Drawing::Image^ img, int max_slope)
{
System::Drawing::Bitmap^ bitmap = gcnew System::Drawing::Bitmap(img);
int scale = 2;
... |
#include <iostream>
#include <string>
using namespace std;
// 1, 11, 21, 1211, 111221, ...
string getNextSequence(string current) {
int count = 1;
string acum = "";
for (int i = 0; i < current.length(); i++) {
if (i + 1 == current.length() || current[i] != current[i + 1]) {
acum += to_string(count)... |
#ifdef _WIN32
# define TEST_EXPORT __declspec(dllexport)
#else
# define TEST_EXPORT
#endif
TEST_EXPORT int testCxxModule(void)
{
return 0;
}
|
#include<iostream>
using namespace std;
int main()
{
int n, m, i, j;
int arr[1000];
cin >> n;
m = n;
for (i = 0; i < n; i++)
{
cin >> arr[i];
}
for (i = 0; i < n; i++)
{
for (j = 0; j < n - i - 1; j++)
{
int temp = 0;
if (arr[j] > arr[j + 1])
{
temp = arr[j];
arr[j] = arr[j + 1];
ar... |
#include "congl.hpp"
using namespace ConGL::_2D;
wchar_t menu0DT [8][22] = {
L" Insanis Sphaera ",
L" ",
L" ",
L" ABOUT ",
L" ",
L" START ",
L" CREDITS ",
L" EXIT "
};
... |
#include "rvlightbulb.h"
RVLightBulb::RVLightBulb(double r)
:RVSphere(r)
{
m_radius = r;
m_minS = 0;
m_maxS = 2 * M_PI;
m_minT = - M_PI_2;
m_maxT = + M_PI_2;
}
RVLightBulb::~RVLightBulb()
{ }
float RVLightBulb::x(double s, double t)
{
return float(m_radius*qCos(t)*qCos(s)) ;
}
float RV... |
#include <iostream>
using namespace std;
int main()
{
int numsSize;
cout<<"Enter number of elements:\n";
cin>>numsSize;
int nums[numsSize];
cout<<"Enter elements:\n";
for(int i=0;i<numsSize;i++)
{
cin>>nums[i];
}
int target;
cout<<"Enter the target element:\n";
cin>>t... |
#include <iostream>
#include <string.h>
#include <map>
#include <vector>
#include <stack>
#include <sstream>
using namespace std;
typedef struct {
string name;
string type;
long memory;
bool initialized;
long begin;
long size;
} Variable;
typedef struct {
string type;
string name;
string index;
} Array;
... |
#include "BlackWhiteEffect.h"
#include "Window.h"
BlackWhiteEffect::BlackWhiteEffect() {
fbo = new Fbo(window::getWindowSize(), false);
shader.addShader("shaders/gui.vsh", GL_VERTEX_SHADER);
shader.addShader("shaders/blackWhiteEffect.fsh", GL_FRAGMENT_SHADER);
shader.start();
shader.bind... |
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include <LiquidCrystal.h>
#define LCD_RW "GND"
#define LCD_RS A0
#define LCD_EN A1
#define LCD_D4 A2
#define LCD_D5 A3
#define LCD_D6 A4
#define LCD_D7 A5
LiquidCrystal lcd(LCD_RS, LCD_EN, LCD_D4, LCD_D5, LCD_D6, LCD_D7);
R... |
void setup_DS()
{
#ifdef USE_DS18B20
LD_printString_6x8("DS on pin: ", LCDX1, 5);
for (int i = 0; i < nSensor; i++)
{
DS[i].init(DS_CONVTIME);
mb.addHreg(hrDSTEMP + i); // Модбас регистр - значение температуры
int pins[] = PIN_DS;
LD_printNumber((long)pins[i]);
if (i < (nSensor - 1)) LD_pr... |
#pragma once
#include <iostream>
#include <vector>
#include "Item.h"
using namespace std;
class Customer
{
private:
vector<Item> inventory;
int gold;
public:
Customer();
~Customer();
void ShowInventory();
int GetGold();
void SetGold(int gold);
void InsertItem(Item item);
void DeleteItem(int index);
It... |
#include <stdio.h>
#include <conio.h>
#include <group7.h>
int r,c,r2,c2;
void main () {
char *ch[]={"RECTANGULAR MATRIX",
"SQUARE MATRIX",
"DIAGONAL MATRIX",
"SCALAR DIAGONAL MATRIX",
"UNITARY MATRIX",
"ADDITION MATRIX",
"SUBTRACTION MATRIX",
"SCALAR MULTIPLICATION MATRIX... |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include "camadaenlace.h"
#include "camadafisica.h"
using namespace std;
void CamadaEnlaceDadosTransmissoraControleDeErroBitParidadePar(int quadro[]){
int size = 32;
int bit = 0;
// adiciona o novo bit no tamanho do quadro
int aux[siz... |
/**
* Copyright (C) Omar Thor, Aurora Hernandez - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
*
* Written by
* Omar Thor <omar@thorigin.com>, 2018
* Aurora Hernandez <aurora@aurorahernandez.com>, 2018
*/
#ifndef DMTK_ALGORI... |
// Pentru urmatoarele valori ale datelor:
// int i =4;
// int j = 6;
// int k = 8;
// int l = 1;
// int m = 10;
// Evaluati expressile:
// (i+j) div (m-j)
// (j+(m-l*(j+i))-k)+5
// i-j+k-l+m
// 3*j mod m - i
// j*j-i-k
#include <iostream>
#include <string>
#include <windows.h>
int main() {
int i = 4,
j = 6,
k ... |
#pragma once
#include "GlobalHeader.h" // fa::OStream
#include <utility> // std::move
#include "Nutrient.h" // fa::NutrientType
#include "NutrientTableImpl.h" // fa::NutrientTableImpl
namespace fa {
template <class Target>
class NutrientTableStaticDelegator final {
public:
using this_type... |
#include "Core_PCH.h"
#define CHECK(x) m_lastErrorCode = x; if (m_lastErrorCode != 0) { break; }
#define CHECK_EX(c, x) c->m_lastErrorCode = x; if (c->m_lastErrorCode != 0) { break; }
namespace ServerEngine
{
NetSocket::NetSocket() :
NetSocket(uv_default_loop())
{
}
NetSocket::NetSocket(uv_loop_t* loopHandle)... |
/*
Write a program that will convert US dollars amounts to Japanese yen and to euros,
storing the conversion factors in the constants YEN_PER_DOLLAR and EUROS_PER_DOLLAR.
To get the most up-to-date rates, search the internet using the term "currency
exchange rate". If you cannot find the most recent exchange rates, ... |
//
// GnIListCtrlItem.cpp
// Core
//
// Created by Max Yoon on 11. 7. 27..
// Copyright 2011년 __MyCompanyName__. All rights reserved.
//
#include "GnInterfacePCH.h"
#include "GnIListCtrlItem.h"
GnImplementRTTI(GnIListCtrlItem, GnIButton);
GnIListCtrlItem::GnIListCtrlItem(const gchar* pcDefaultImage,... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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
**
*/
#ifndef _AUTH_SN_H_
#define _AUTH_SN_H_
... |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <vector>
using ll = long long;
class SegmentTree
{
public:
SegmentTree() = delete;
SegmentTree(const std::vector<ll>& numbers);
ll GetSubSum(int idx, int start, int end, int left, int right) const;
private:
ll Init... |
#ifndef UNIVERSALFORCE_H
#define UNIVERSALFORCE_H
#include "Force.h"
class Object;
class UniversalForce : public Force
{
public:
explicit UniversalForce(Object*);
UniversalForce(const UniversalForce&);
virtual ~UniversalForce(void);
virtual void exec(void);
virtual bool isDone(void);
virtual Vector getForcePo... |
// world hello.cpp : 定义控制台应用程序的入口点。
//
#include <iostream>
#include "string-trans.h"
#include "contour_fill.h"
int main()
{
using namespace std;
contour_fill::contr_set_type lines=readdata();
vector<contour_fill::contr_set_type> contr_set_type;
contour_fill(lines,0,0,450,350).get_fill_contours(contr... |
#include<bits/stdc++.h>
using namespace std;
#define PI 3.1415926535897932
int main(){
int a;
int *lpa;
lpa=&a;
double d, e;
printf("input!!!!!\n");
scanf("%d",&a);
printf("変数a に %d 代入\n",a);
printf("変数a のアドレスは%p \n",&a);
printf("変数a をさすポインタは lpa \n");
printf("*lpa の値は%d \n",*l... |
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
vector<int> dp(amount+1, amount+1);
dp[0] = 0;
int n = coins.size();
for(int i=0;i<n;i++){
int coin = coins[i];
if(coin <= amount)
dp[co... |
#include <iostream>
#include <vector>
#include <string.h>
#include <algorithm>
bool checkString(std::string &s1, std::string &s2)
{
if( s1.length() < s2.length() ||
s1.length() == s2.length() && s1 < s2)
{
return true;
}
return false;
}
void bigSorting (std::vector<std::string> &arr)
... |
#include <opencv2/opencv.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/stitching/detail/blenders.hpp>
#include <algorithm>
using namespace cv;
using namespace std;
// Functions prototypes
void Homography(const vector<Mat> &Images, vector<Mat> &transforms);
void Fi... |
// #pragma once
#ifndef MNODE_H
#define MNODE_H
#include <vector>
#include <iostream>
#include <string>
#include <queue>
#include "utils.h"
#include "mJSON.h"
using namespace std;
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* next;
Node() : val(0), left... |
class ReverseSolver {
public:
string Reverse(string str, int from, int to) {
if (from < 0 || to >= str.size()) {
throw new exception("参数错误!!!");
}
string res{};
for (int i = to; i >= from; --i) {
res += str[i];
}
return res;
}
string ReverseSentence(string str) {
if (str.size() < 1)
return... |
#ifndef _SPRITE_H_
#define _SPRITE_H_
#include "vector.h"
#include "hgeSprite.h"
class Sprite
{
public:
Sprite();
~Sprite();
void GetPosition( Vector2f& outPosition );
void SetPosition( const Vector2f& aNewPosition );
void SetTexture( HTEXTURE aNewTexture, Vector2f& aSize );
hgeSprite* GetRawSprite() { retur... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef DOM_STYLESHEETLIST_H
#define DOM_STYLESHEETLIST_H
#in... |
/*
* Copyright 2016 Freeman Zhang <zhanggyb@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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
#include<iostream>
#include<vector>
#include<queue>
#include<assert.h>
#include<time.h>
#include<algorithm>
using namespace std;
/*有一组数据,求其中最大的前十个数据*/
#if 0
int main()
{
srand((unsigned int)time(NULL));
vector<int> vec;
for (int i = 0; i < 200000; ++i)
{
vec.push_back(i);
}
priority_queue<int,vector<int>,grea... |
#include "Explosion.h"
#include "Platy.Game.Core/Util/Util.h"
#include <Util/Util.h>
namespace Platy
{
namespace Game
{
Explosion::Explosion(
const float& aParticleMaxSize,
const sf::Vector2f& aPosition,
const sf::Color& aColor,
const size_t& aParticleCount,
const float& anIntensity,
const floa... |
#include "About.h"
#include "ui_About.h"
// RsaToolbox
using namespace RsaToolbox;
// Qt
#include <QCoreApplication>
#include <QMessageBox>
About::About(QWidget *parent) :
QDialog(parent),
ui(new Ui::About)
{
ui->setupUi(this);
this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);... |
#include "stdafx.h"
#include <math.h>
#include "Condition.h"
CCondition::CCondition()
{
}
CCondition::~CCondition()
{
}
void CCondition::SetName(const wstring& strName)
{
m_strCondtionName = strName;
}
void CCondition::SetAverage(unsigned long ulAverage)
{
m_ulAverage = ulAverage;
}
void CCondition::SetRange(u... |
#include <iostream>
using namespace std;
struct BSTNode{
BSTNode*right;
BSTNode*left;
BSTNode*up;
int key;
};
void addNode(BSTNode * &tree, int klucz)
{
BSTNode *newNode=new BSTNode;
newNode->right=NULL;
newNode->left=NULL;
newNode->up=NULL;
newNode->key=klu... |
// GoogleDriveImageTagConverter.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <string>
using namespace std;
#define ERROR_PROC() \
{\
CloseClipboard();\
::MessageBoxA(NULL, "컨버팅 실패", "Error", MB_OK);\
return 0;\
}
int _tmain(int argc, _TCHAR* argv[])... |
#include "CorrespondSurfaceAndVolumetricTemplate.h"
#include "distPoint3Triangle3.h"
using std::min;
using std::max;
using Wm5::computeClosestPoint;
CorrespondTemplates::CorrespondTemplates()
{
meshAligned = false;
originalSurfaceTemplate = NULL;
rigidlyAlignedSurfaceTemplate = NULL;
}
CorrespondTemplates::Cor... |
#include "cellogram/point_source_detection.h"
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <Eigen/Dense>
#include <igl/list_to_matrix.h>
#include <igl/Timer.h>
bool load_img(const std::string & path, Eigen::MatrixXd &res)
{
std::fstream file;
file.open(path.c_str());
if (!fi... |
#include <stdio.h>
int main()
{
int i, space, rows, k=0;
printf("Enter number of rows: ");
scanf("%d",&rows);
printf("\nPrinting....\n");
for(i=0; i<rows; i++,k=0)
{
for(space=0; space<rows-i; space++)
{
printf(" ");
}
while(k<=2*i)
{
... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "calendar.h"
#include "editwindow.h"
#include "deletedialogue.h"
#include "settingswindow.h"
#include "notelistwindow.h"
#include "note.h"
#include "notebook.h"
#include "memory"
#include "settings.h"
enum class DeleteOption{One, Outdated, All};
class MainWindow : pu... |
#pragma once
#include <SFML/Graphics.hpp>
using namespace sf;
//! Klasa Scaleable.
/*!
Klasa reprezentująca obiekt gry tj. pionek i plansza
*/
class Scaleable
{
protected:
/* textura danego obiektu*/
Texture texture;
/* rozmiar danego obiektu*/
Vector2f size;
/* skala danego obiektu*/
Vector2f scale;
/* p... |
#ifndef COVARIANCE_H
#define COVARIANCE_H
#include <gsl/gsl_math.h>
#include <gsl/gsl_blas.h>
#include "common.h"
#include "hyperspherical.h"
#include "cdmSpectrum.h"
#include "cosmology.h"
#include "cosmometry.h"
#include "growth.h"
#include "survey.h"
/**
* Calculation of auto- and cross-spectra for cosmic shear ... |
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Node{
public:
int inDegree = 0;
bool next[501] = {false, };
};
vector<string> strRet;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int testCase;
cin >> testCase;
for(int tc = 1; tc <= testCase; t... |
#pragma once
// ADD_DLG 对话框
class ADD_DLG : public CDialogEx
{
DECLARE_DYNAMIC(ADD_DLG)
public:
ADD_DLG(CWnd* pParent = NULL); // 标准构造函数
virtual ~ADD_DLG();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG2 };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECL... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const double PI = 3.14159265358979323846;
const ll MOD = 1000000007;
const int INF = 1e9;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
template<... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "xyz.h"
#include <stdio.h>
Xyz::Xyz()
: QObject()
{
}
void Xyz::doXyz()
{
printf("This is xyz !\n");
}
|
/*
* VideoCompressor.h
*
* Created on: 28 Feb 2011
* Author: two
*
* This is used to Encode the frames, currently Setup to use H.262 (MPEG2-video) but no reason as to
* why it can be adapted to others.
*
*/
#ifndef VIDEOCOMPRESSOR_H_
#define VIDEOCOMPRESSOR_H_
//Bug? with INT64_C not being decalred ... |
#include "Stitched.h"
Stitched::Stitched(vector<vector<vec2>> const & allVertices, vec2 position, vec2 velocity, float rotation, float fAngVel, float mass, float elasticity, float fFricCoStatic, float fFricCoDynamic, float fDrag, float fAngDrag, glm::vec4 colour) :
RigidBody(ShapeID::Stitched, position, velocity, ... |
// Copyright Low Entry. All Rights Reserved.
#pragma once
#include "ILowEntryFileManagerModule.h"
class FLowEntryFileManagerModule : public ILowEntryFileManagerModule
{
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
|
// Simple sound queue for synchronous sound handling in SDL
// Copyright (C) 2005 Shay Green. MIT license.
#ifndef SOUND_QUEUE_H
#define SOUND_QUEUE_H
#include <SDL2/SDL.h>
// Simple SDL sound wrapper that has a synchronous interface
class Sound_Queue {
public:
Sound_Queue();
~Sound_Queue();
/... |
#include <bits/stdc++.h>
using namespace std;
void display(stack<int> st)
{
while (!st.empty())
{
cout << st.top() << " ";
st.pop();
}
cout<<endl;
}
void insert(stack<int>&st, int temp)
{
if (st.empty())
{
st.push(temp);
return;
}
int v... |
// Created on: 2005-03-17
// Created by: OPEN CASCADE Support
// Copyright (c) 2005-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... |
#include "core/types.h"
#include "core/maths.h"
#include "mat22.h"
#include <vector>
typedef std::vector<Matrix22> NodeRow;
std::vector<Vec2> CgMul(const std::vector<NodeRow>& A, const std::vector<Vec2>& x)
{
assert(A[0].size() == x.size());
std::vector<Vec2> b(A.size());
for (size_t i=0; i < A.size(); ++i)
{... |
#include <Arduino.h>
#include "display.h"
#include "config.h"
#include "weather.h"
#include "rtc.h"
#include "ldr.h"
#include "LedControl_HW_SPI.h"
//#include "LedControl_SW_SPI.h"
LedControl_HW_SPI lc = LedControl_HW_SPI(); //Hardware SPI
//LedControl_SW_SPI lc = LedControl_SW_SPI(); //Software SPI
CRtc RtcDisplay;
C... |
#include <iostream>
using namespace std;
#include <stdio.h>
#include <cmath>
#include <vector>
vector<double> lambda = {1, 2, 3, 4, 3, 2};
vector<double> add(vector<double> x, double c1,vector<double> y, double c2)
{
vector<double> xnew;
for (int i=0; i<x.size(); i++)
{
xnew.push_back(c1*x[i] + c2... |
#ifdef HAVE_OPENCV_FEATURES2D
typedef SimpleBlobDetector::Params SimpleBlobDetector_Params;
#endif |
#ifndef SIGNAL_HPP
#define SIGNAL_HPP
#include <vector>
class Signal : public std::vector<double>
{
public:
Signal(double Te, std::size_t N = 0);
Signal(double Te, std::size_t N, double value);
//utility functions
double mean() const;
double variance() const;
//arithmetic operators
Signa... |
/**************************************************************************************
* File Name : Component.h
* Project Name : Keyboard Warriors
* Primary Author : Doyeong Yi
* Secondary Author :
* Copyright Information :
* "All content 2019 DigiPen (USA) Corporation, all rights reserved... |
#include<vector>
#include<iostream>
#include<algorithm>
#include<unordered_map>
using namespace std;
class Solution {
public:
int countRangeSum(vector<int>& nums, int lower, int upper) {
//基本思想:线段树,超时,时间复杂度O(n^2)
//建立线段树tree,然后双重循环分别遍历区间的起始和终止
//利用线段树求出[i,j]区间的和sum,如果满足[lower,upper]区间res++
... |
#ifndef QRDIALOG_H
#define QRDIALOG_H
#include <QDialog>
namespace Ui {
class QRDialog;
}
class QRDialog : public QDialog
{
Q_OBJECT
public:
explicit QRDialog(QWidget *parent = nullptr);
~QRDialog();
private:
Ui::QRDialog *ui;
};
#endif // QRDIALOG_H
|
#include "../include/AnimationAsset.h"
#include <iomanip>
#include <thread>
void CAE::AnimationAsset::loadFromFile()
{
auto task = [this]()
{
sf::Context _;
if(std::ifstream istream(assetPath.data(), ifstream::in); istream.is_open())
{
json j;
istream >> j;
... |
#include <core/maths.h>
#include <core/shader.h>
#include <core/platform.h>
#include <core/mat22.h>
#include "cg.h"
#include <iostream>
#include <cmath>
#include <functional>
#include <algorithm>
#include <vector>
#include <stdint.h>
#include <xmmintrin.h>
using namespace std;
const int kWidth = 800;
const int kHei... |
const int potPin = A0; // potentiometer
const int pwmOutPin = 3; // PWM output
int potentiometerValue; //range from 0 to 1023
int pwmValue; //range from 0 to 255
int speedPercentage; //range from 0 to 100
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // Serial Monitor Ctrl + Shift +... |
#include "precompiled.h"
#include "vfs.h"
#include "file.h"
namespace vfs
{
};
vfs::IFile::IFile(const char* filename, bool write)
{
this->m_filename = strDup(filename);
this->m_buffer = NULL;
}
vfs::IFile::~IFile()
{
delete [] m_filename;
delete [] m_buffer;
}
bool vfs::IFile::readLine(char* linebuf, U32 bufsi... |
//
// Created by mikcy on 15. 6. 7.
//
#include <iostream>
#include "Compile.h"
#include "logger.h"
//std::map<std::string, std::string> Compile::_compile_opt;
compile_result Compile::compile()
{
std::string cmd(getCommand());
InformMessage("cmd %s", cmd.c_str());
FILE *pp = popen(cmd.c_str(), "r");
... |
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main() {
bool loop = true;
char c; // for each digit
int ip = 0; // input pointer
int sum = 0;
int state = 0;
string s; // for input string
string buf; // operand
... |
[ MAIN ]
// Part A
if(NEWIND <=1) double mtime = 1E10;
// Part B
if(EVID==1) {
mtime = TIME + 1.23;
self.mevent(mtime, 33);
}
// Part C
capture past = TIME >= mtime;
|
#ifndef GTTOOLSETTINGS_H
#define GTTOOLSETTINGS_H
class GtToolSettings
{
private:
static gchar mWorkPath[GN_MAX_PATH];
static gchar mBackgroundFile[GN_MAX_PATH];
static gint32 mScalePercent;
public:
static void EBMStartup();
static void EBMShutdown();
static void SetWorkPath(const char* path);
static gchar* G... |
#include "GameManager.h"
GameManager * GameManager::s_singleton = nullptr;
GameManager::GameManager()
{
p_screen = nullptr;
p_resourcesManager = nullptr;
p_stateManager = nullptr;
init();
}
GameManager::~GameManager()
{
clear();
}
GameManager * GameManager::getSingleton()
{
if( !s_singleton )
{
s_single... |
#include <Servo.h>
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define ACELERADORSAIDA 3
#define AILERONSAIDA 5
#define LEMESAIDA 6
#define PROFUNDORSAIDA 9
Servo acelerador, aileron, leme, profundor;
RF24 radio(7, 8); // CSN, CE
const byte address[6] = "0A0A1";
int vlrAcelerador = 0;
int vlrAileron =... |
#include "views/helpview.hpp"
#include "views/viewstack.hpp"
#include "graphics.hpp"
#include "views/defaultlayout.hpp"
extern bool paused;
vector<string> help_prgh = {
"== All Modes ==",
" Escape - Return to the previous screen",
" Space - Pause",
"== Main Screen ==",
" d - Digging mode",
... |
#ifndef SHOC_OTP_HOTP_H
#define SHOC_OTP_HOTP_H
#include "shoc/mac/hmac.h"
namespace shoc {
template<class H>
uint32_t hotp(const void *key, size_t key_len, uint64_t count, int mod)
{
static_assert(H::SIZE >= 20, "HOTP hash algorithm must provide at least 20 byte long value");
byte digest[H::SIZE];
if ... |
#pragma once
#include "game.h"
class FE : public Game
{
public:
FE(void);
~FE(void);
void initialize(void);
}; |
/**
* @file Noncopyable.hpp
*
* @brief This header contains a mixin that disallows copying of an object
*
* @author Matthew Rodusek (matthew.rodusek@gmail.com)
* @date January 26, 2015
*/
#ifndef VALKNUT_CORE_UNCOPYABLE_HPP_
#define VALKNUT_CORE_UNCOPYABLE_HPP_
#if defined(_MSC_VER) && (_MSC_VER >=... |
#include "include/RT_Object.hpp"
RT_Object::RT_Object() : m_Shininess(0.0f), m_Reflectivity(0.0f) {}
RT_Object::RT_Object(const RT_Vec3& ka, const RT_Vec3& kd, \
const RT_Vec3& ks, double shi, double ref, double tra) :
m_Ka(ka), m_Kd(kd), m_Ks(ks), m_Shininess(shi), \
m_Reflectivity(ref), m_Transparency(t... |
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int N, c;
cin >> N >> c;
int cnt[N + 1];
cnt[0] = 0;
map<int, vector<int>> appear;
for (int i = 1; i <= N; ++i) {
int a;
cin >> a;
cnt[i] = cnt[i - 1] + (a == c);
appear[a].p... |
//单链表(有头结点)
#include <iostream>
using namespace std;
typedef int ElemType;
typedef struct LNode{
ElemType data;
struct LNode* next;
}LNode;
void InitList(LNode *&); //初始化list
void ListHeadInsert(LNode *&); //头插法
void ListTailInsert(LNode *&); ... |
#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 <deque>
#include <map>
#include <functional>
#include <numeric>
typed... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2000-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Luca Venturi
*/
#include "core/pch.h"
#include "modules/cache/m... |
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
#define N 10000
ll cost[N][N];
void floyd_warshall() {
for (ll k = 0; k < N; ++k) {
for (ll i = 0; i < N; ++i) {
for (ll j = 0; j < N; ++j) {
cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
}
}
... |
#include "../include/mvm0/cpu.hh"
#include <cassert>
#include <cstring>
namespace {
std::uint32_t imm(int x) {
assert(x >= 0);
return static_cast<std::uint32_t>(x);
}
} // namespace
namespace mvm0 {
CPU::CPU(const ROM &rom)
: _ram(MEM_RAM_SIZE, 0), _rom(rom), _status(Status::OK) {}
void CPU::init() {
s... |
#include <iostream>
#include <cstdio>
#include <string>
#include <assert.h>
#include <queue>
#include <algorithm>
typedef long long LL;
typedef long long ll;
typedef long double LD;
typedef long double ld;
using namespace std;
const int N = 1000111;
int n, k;
int a[N];
priority_queue< pair<int, int> > q;
int main(... |
class TwoSum {
public:
// NOTE: 进一步的优化可以是: 只使用一半大小的set, 只需遍历半个数组即可得到答案
// 这是由于输入数据是非降序的,若当前数是 sum/2,往后再遍历必 > sum, 从而无需遍历后半段
vector<int> FindNumbersWithSum(vector<int> array, int sum) {
set<int> memo;
for (auto& i : array) {
if (memo.count(i) == 0) {
memo.emplace(i);
}
}
int a = sum;
int b = sum... |
// Licensed under the GNU General Public License, Version 3.
#include "ValidationEngine.h"
#include "TransactionBase.h"
#include <libdvmcore/CommonJS.h>
using namespace std;
namespace dev
{
namespace dvm
{
ValidationEngineRegistrar* ValidationEngineRegistrar::s_this = nullptr;
void NoProof::init()
{
DVM_REGISTER... |
/*
moveniu 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 License, or
(at your option) any later version.
moveniu is distributed in the hope that it will be useful,
but WITHOUT ANY WARRAN... |
#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... |
#pragma once
#include "Template.hh"
#include <unordered_set>
namespace HotaSim {
struct BiomTemplate : public Template {
std::unordered_set<TmplId> ability_ids;
};
} |
// Created on: 1993-04-13
// Created by: JCV
// 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 GNU Lesser Gen... |
#ifndef RADICAL_H
#define RADICAL_H
#include "Real.h"
#include <typeinfo>
#include <string>
#include <iostream>
#include <sstream>
using namespace std;
class Radical : public Real{
private:
int coeficiente;
int indice;
int radicando;
public:
Radical();
Radical(int,int,int);
int getCoeficient... |
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
class KMP {
private:
string pattern;
// next 数组的值是除当前字符外(注意不包括当前字符)的
// 公共前后缀最长长度
vector<int> next;
void buildNext() {
if (pattern.size() == 0) return;
next.assign(pattern.size() + 1, 0);... |
#include <QFileInfo>
#include <QDebug>
#include <QImage>
#include <QDir>
#include "pictureshrinker.h"
PictureShrinker::PictureShrinker(QObject *parent) :
QThread(parent)
{
}
void PictureShrinker::setPath(QString path)
{
if (this->_path != path)
{
this->_path = path;
}
}
void PictureShrinker::... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.