text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @author Espen Sand
*/
#include "core/pch.h"
#include "platforms/quix/toolkits/x11/... |
#include "vector2.h"
//size constructor
vector2::vector2(int s) : sz{ s }, elem{ new double[s] } {
for (int i = 0; i < s; ++i)
elem[i] = 0;
}
//init
vector2::vector2(std::initializer_list<double> lst) : sz(lst.size()), elem{ new double[sz] } {
std::copy(lst.begin(), lst.end(), elem);
}
//copy copyconstructor
vecto... |
#pragma once
#include "types.h"
namespace hdd::gamma
{
class IOVector
{
public:
IOVector(uint32_t in, uint32_t out);
uint32_t Inputs() const;
uint32_t Outputs() const;
valarray_fp& operator[](const uint32_t index);
void Resize(uint32_t in, uint32_t out);
c... |
//
// Asignatura.cpp
// PrimerParcialEjercicio2
//
// Created by Daniel on 08/09/14.
// Copyright (c) 2014 Gotomo. All rights reserved.
//
#include "Asignatura.h"
Asignatura::Asignatura(){
srand((int)time(NULL));
codigo = rand() % 1000;
numAlum = rand() % 100;
unidades = rand() % 6;
montoT = nu... |
#include "Sales.h"
using namespace SALES;
int main()
{
double arr[4]{ 45.3,23.0,30,20 };
Sales s1(arr, 4);
Sales s2;
s1.showSales();
s2.setSales();
s2.showSales();
} |
#ifndef KING_CPP_INCLUDED
#define KING_CPP_INCLUDED
#include <iostream>
#include "BasePiece.h"
#include "King.h"
#include "Board.h"
extern Board board; //board is declared in the main and extern lets compiler know this
/**@summary Constructor
* @color Color of the new piece
* @pos Position of the new p... |
#ifndef __HELP_H__
#define __HELP_H__
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <dax/Types.h>
#include <dax/exec/WorkletMapField.h>
class PointLocator;
namespace help
{
void printStartCount(const std::vector<dax::Id>& pointStarts,
const std::vector<int... |
#include "mapinfo.h"
#include "ShareMemory.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <pthread.h>
#include "soapH.h"
#include "htt... |
#include <iostream>
using namespace std;
#include "05_02_DynamicArrayClass.cpp"
int main()
{
DynamicArray d1; /// default constructor
d1.add(10);
d1.add(20);
d1.add(30);
d1.add(40);
d1.add(50);
cout << d1.getCapacity() << endl;
d1.add(60);
d1.print();
cout << d1... |
// cl -W3 -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x500 libcvm.cpp cvm_test.cpp /link user32.lib
#include <tchar.h>
#include "libcvm.h"
#if !defined(NEVER_DEFINED)
#define DEBUG_CODE /##/
#else
#include <stdio.h>
#define DEBUG_CODE
#endif
namespace {
static const WORD LOOKUP_TABLE[] =
{
// 0x00-... |
#ifndef ABSTRACT_GRAPH
#define ABSTRACT_GRAPH 1
#include "include/list.hpp"
#include "include/seq_linear_list.hpp"
#include "GraphAdjacencyBase.hpp"
namespace cs202 {
enum GraphMode
{
LIST,
MATRIX
};
enum Color
{
WHITE,
GRAY,
BLACK
};
/*
* An interface to represent any type of Grap... |
/* Copyright (c) Citrix Systems Inc.
* 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
* copyright notice, this list of con... |
#pragma once
#include "WinDef.h"
#include <d3d11.h>
class Graphics
{
public:
Graphics(HWND hwnd);
Graphics(const Graphics&) = delete;
Graphics& operator=(const Graphics&) = delete;
~Graphics();
void EndFrame();
void ClearBuffer(float red, float green, float blue) noexcept;
private:
ID3D11Device* pDevice = nullp... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; -*-
*
* Copyright (C) 2007-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#ifdef POSIX_OK_SELECT
#include "platforms/posix/posix_selector... |
#include<iostream>
#include<string>
using namespace std;
#ifndef JOBDESCRIPTION_H
#define JOBDESCRIPTION_H
class Employee;
class JobDescription {
private:
string description;
Employee * emp;
public:
JobDescription();
JobDescription(string s);
~JobDescription();
Employee * getEmployee();
string ge... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <folly/portability/GTest.h>
#include <folly/Random.h>
#include <folly/io/Cursor.h>
#include <quic/codec/QuicConnectionI... |
/************************************************************************
* @project : sloth
* @class : StaticShader
* @version : v1.0.0
* @description : 和基本着色器(basic)的 uniform 变量相对应,用于修改着色器变量
* @author : Oscar Shen
* @creat : 2016年10月8日14:52:32
* @revise : 2017年2月9日14:53:47
************************... |
/*
* Funktionen.h
*
* Created on: 15.12.2016
* Author: FruehwF
*/
#ifndef FUNKTIONEN_H_
#define FUNKTIONEN_H_
#include <time.h>
#include <cmath>
#define DATA_EXT ".txt"
#define PLOT_EXT ".png"
void sleepcp(int milliseconds) // cross-platform sleep function
{
clock_t time_end;
time_end = clock() ... |
/*
Name: �ǹ�����
Copyright:
Author: Hill bamboo
Date: 2019/8/17 10:40:26
Description: ����
˼·��
ÿɨ�赽һ��С���ѣ��������ı���nά��һ����СΪn������Ȧ��
����������һ�����䱨��һ����С���ѣ�������Ȧ�Ĵ�С -1��
����ɨ�裬ֱ������Ȧ��СΪ0��
3, 3, 3, 3 => 4
2, 2, 3 => 7
0, 0, 0 => 3
1, 1, 3 => 6
3, 1, 3 => 6
4 4 4 4 4 4 4 4
=> 10
*/
... |
#include "GrowingBrushStokeAct.h"
#include "Misc.h"
GrowingBrushStokeAct::GrowingBrushStokeAct()
{
for( int i = 0; i < 80; i++ ) {
std::vector< ofPoint > emptyPoints;
dottedPoints.push_back( emptyPoints );
}
tintBuffer.allocate( Misc::getDefaultFboSettings() );
secondTintBuffer.allocate( Misc::getD... |
#include <stdio.h>
#
main(){
int M[3][3]={0};
int N[3][3]={0};
int elemento[3][3]={0};
int i,j, Op;
for(i=0; i<3; i++){
for (j=0; j<3; j++){
printf("\n Introduce la cifra [%d] [%d] para rellenar la matriz 1: ",i, j);
scanf("%d", &M[i][j]); }
}
for(i=0; i<3; i++){
for (j=0; j<3; j++){
p... |
#include "bitmap.h"
#include "window.h"
#include "actor.h"
#include "world.h"
#include "board_screen.h"
#include <lundi.hpp>
#include <fstream>
struct com_ensure_initialized {
com_ensure_initialized() { CoInitialize(0); }
~com_ensure_initialized() { CoUninitialize(); }
};
std::tuple<std::unique_ptr<world>, std::... |
#ifndef REGISTERFUNCTIONS_H
#define REGISTERFUNCTIONS_H
#include <set>
#include <string>
#include <vector>
#include <functional>
#include "SusyAnaTools/Tools/GetVectors.h"
#include "SusyAnaTools/Tools/CleanedJets.h"
#include "SusyAnaTools/Tools/RunTopTagger.h"
#include "SusyAnaTools/Tools/TopWeightCalculator.h"
class... |
//使用するヘッダーファイル
#include "GameL\DrawTexture.h"
#include "GameL\HitBoxManager.h"
#include "GameL\Audio.h"
#include "GameL\WinInputs.h"
#include "GameHead.h"
#include "CObjHeroSword.h"
#include "CObjHero.h"
//使用するネームスペース
using namespace GameL;
//コンストラクタ
CObjHeroSword::CObjHeroSword(float x, float y)
{
m_x = x;
m_y = ... |
//$$---- Form CPP ----
//---------------------------------------------------------------------------
#include <vcl.h>
#include <stdio.h>
#pragma hdrstop
#include "MainForm.h"
#include "BuildProtocol.h"
#include "PredStart.h"
//---------------------------------------------------------------------------
#p... |
#include <iostream>
int main()
{
int new_grade, index, limit_1, limit_2, freq[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// The exception definition to deal with the end of the data
class NegativeInputException {
public:
NegativeInputException() {
std::cout << "End of input data reach... |
#include <iostream>
#include<string.h>
using namespace std;
class Stack
{
public:
int top;
unsigned capacity;
char* array;
};
Stack* createStack(unsigned capacity)
{
Stack* stack = new Stack();
stack->capacity = capacity;
stack->top = -1;
stack->array = new char[(stack->capacity * sizeof(char))];
... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Animal
{
public:
virtual void speak()//虚函数
{
cout << "动物在说话" << endl;
}
};
class Dog:public Animal
{
public:
//重写虚函数 函数的返回值 参数 函数名一致
void speak()
{
cout << "狗在说话" << endl;
}
};
clas... |
#ifndef ss_math_Vector3_H_
#define ss_math_Vector3_H_
#include "ssPrerequisities.h"
namespace ssMath
{
class Vector3
{
public:
// constructors
inline explicit Vector3()
: x(0), y(0), z(0)
{
}
inline explicit Vector3(float _x, float _y, float _z)
: x(_x), y(_y), z(_z)
{
}
inline explicit V... |
/*************************************************************************
> File Name: demo.cpp
> Author: billowqiu
> Mail: billowqiu@billowqiu.com
> Created Time: 2017-05-22 14:14:52
> Last Changed: 2017-05-22 14:14:52
*************************************************************************/
#include "ThostFtd... |
//知识点:记忆化,dfs
/*
搜索 + 简单剪枝
比较简单 , 详见注释
*/
#include<cstdio>
#include<cstring>
#include<ctype.h>
#define min(a,b) a<b?a:b
const int INF = 0x3f3f3f;
const int ex[5] = {0,1,-1,0,0};//坐标变化量
const int ey[5] = {0,0,0,1,-1};
//=============================================================
int m,n,ans=INF, map[11... |
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;
int matrix[25][25];
bool visited[25][25];
vector<int> area;
void bfs(int i, int j, int maxSize, int &count){
queue<pair<int, int>> q;
q.push(make_pair(i,j));
visited[i][j] = true;
whil... |
// tareaMatrizPunteros.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí.
//
#include <iostream>
#include <windows.h>
using namespace std;
void multiplicacionMatrices();
void recorrer(int** M, int fil, int col);
void print(int** M, int fil, int col);
int... |
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int cChecked[101] ;
int bfs(int start, vector<int> a[])
{
int nResult = 0;
queue<int> q;
q.push(start);
cChecked[start] = true;
while (!q.empty())
{
int x = q.front();
q.pop();
for (int i = 0; i < a[x].size(); i++)
{
int y... |
#include "stdafx.h"
#include "GameTime.h"
GameTime::GameTime()
{
}
GameTime::~GameTime()
{
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 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 "platforms/mac/model/UnicodeRange... |
// 1006_10.cpp : 定义控制台应用程序的入口点。
//配对问题(匈牙利算法)(看了好久...)
//输入数据的第一行是三个整数K, M, N,分别表示可能的组合数目,女生的人数,男生的人数。0<K <= 1000
//1 <= N 和M <= 500.接下来的K行,每行有两个数,
//分别表示女生Ai愿意和男生Bj做partner。最后一个0结束输入
//输出最大匹配数
//匈牙利算法是寻找增广路径解决二分图匹配,达到完美匹配,即最大匹配,完全匹配
#include<iostream>
using namespace std;
const int max = 501;
int map[max][max];
int v... |
#include <gtest/gtest.h>
#include "Nodes/UnaryOperations/SigmoidUnaryOperation.hpp"
struct SigmoidUnaryOperationTest : testing::Test
{
};
struct CustomComputationNode : ComputationNode<float>
{
CustomComputationNode(float v)
: output(v)
{}
ArrayView<float const> getOutputValues() const override
... |
#include <bits/stdc++.h>
using namespace std;
const int MAX=100005;
unordered_map <int,int> mp[MAX];
int sz[MAX];
vector <int> G[MAX];
int get_map(int C,int x) {
if(!mp[C].count(x)) return x;
return mp[C][x]=get_map(C,mp[C][x]);
}
void Union(int C,int x,int y) {
x=get_map(C,x);
y=get_map(C,y);
if(x>... |
#include "BotController.h"
int main(int argc, char* argv[])
{
WORD wVersionRequested = MAKEWORD(1,1);
WSADATA wsaData;
if(WSAStartup(wVersionRequested, &wsaData) != 0)
{
std::cerr << "error starting winsock";
}
std::vector<std::string> chanlist;
chanlist.push_back("#chan1");
chanlist.push_back("#chan2");
... |
#include "datewindow.h"
#include "ui_datewindow.h"
#include <iostream>
dateWindow::dateWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::dateWindow)
{
ui->setupUi(this);
doneButton = ui->pushButton;
connect(doneButton, SIGNAL(clicked()), this, SLOT(hide()));
}
dateWindow::~dateWindow()
{
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef DEVICEAPI_OPVCARDENTRY_H
#define DEVICEAPI_OPVCARDENTRY... |
/*
* OpenGL.cpp
*
* Created on: Apr 1, 2017
* Author: Patryk
*/
#include <OpenGL.hpp>
#include <Window.hpp>
#include <ErrorManager.hpp>
#include <GLFW/glfw3.h>
using namespace core::error;
namespace core
{
bool OpenGL::initialize(const WindowDesc &desc)
{
glfwWindowHint( GLFW_CONTEXT_VERSION_MAJO... |
#ifndef _QUEUE_H_
#define _QUEUE_H_
#include "linked_list/doubly.h"
namespace cs2420 {
template <typename T>
class QueueADT {
public:
virtual void enqueue(T e) = 0;
virtual T dequeue() = 0;
virtual T peek() const = 0;
virtual void clear() = 0;
virtual bool empty() const = 0;
virtual ~QueueADT(){}
};
tem... |
#include <iostream>
using namespace std;
int max(int a,int b)
{
return a>b ? a:b ;
}
int main()
{
int size;
cout<<"Enter the size of the array: ";
cin>>size;
int nums[size];
cout<<"Enter the elements of the array: ";
for(int i=0;i<size;i++)
{
cin>>nums[i];
}
int max... |
#include "Parent.h"
void createList(ListP &L){
first(L) = nil;
}
adrP alokasiP(infotypeP x){
adrP P;
P = new elemenP;
info(P) = x;
nextP(P) = nil;
//nextC(P) = nil;
return P;
}
void insertFirst(ListP &L, adrP P){
if (first(L) == nil){
first(L) = P;
}
els... |
/*
* Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com>
* Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com>
* Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com>
* Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com>
* Copyright (c) 2011 Guillaume Pinot <guillaume.pino... |
#include "UserInfo.h"
UserInfo::UserInfo()
: userId(-1) {}
UserInfo::UserInfo(const std::string& login,
const std::string& password)
: login(login), password(password), userId(-1) {}
std::string UserInfo::encode() const {
parser->clear();
parser->addValue(login, KeyWords::... |
#include <iostream>
#include <vector>
#include <string.h>
#include <string>
#include "FreeImage.h"
#include "glew.h"
#include "glut.h"
#include "mesh.h"
#include "viewing.h"
#include "light.h"
#include "scene.h"
using namespace std;
#define NUM_TEXTURE 20
unsigned int texObject[NUM_TEXTURE];
vector<Me... |
#include<bits/stdc++.h>
using namespace std;
void count_sort(vector<int> &p, vector<int> &c){
int n = p.size();
vector<int> cnt(n);
for(auto x: c){
++cnt[x];
}
vector<int> p_new(n);
vector<int> pos(n);
pos[0]=0;
for(int i = 1; i<n; ++i){
pos[i] = pos[i-1] + cnt[i-1];
}
for(auto x: p){
int i = c[x];
... |
#include <stdio.h>
void main()
{
int grade;
printf("enter grade\n");
scanf("%d",&grade);
if (grade<=100 || grade>=90)
{
printf("letter grade is A\n");
}
if (grade<=89 || grade>=80)
{
printf("letter grade is B\n");
}
if (grade<80)
{
printf("the student bogo\n");
}
} |
#include "Vna.h"
#include "RsibBus.h"
#include "VisaBus.h"
using namespace RsaToolbox;
#include <QDebug>
#include <QString>
#include <QtTest>
#include <QSignalSpy>
#include <QScopedPointer>
class test_VnaMarker : public QObject
{
Q_OBJECT
public:
test_VnaMarker();
private:
Vna vna;
// Object to te... |
#pragma once
#include <iterator>
template <class InIt>
void Insert(InIt itLow, InIt curIt)
{
if (curIt == itLow)
{
return;
}
int inserted = *curIt;
for (; curIt != itLow && inserted < *(curIt - 1); --curIt)
{
*curIt = *(curIt - 1);
}
*curIt = inserted;
}
template <class InIt>
void InsertSort( InIt itLow... |
namespace meta {
namespace ptr {
template<typename T>
struct is_ptr {
static constexpr value = 0;
};
template<typename T>
struct is_ptr<T*> {
static constexpr value = 1;
};
template<typename T>
struct remove_ptr {
using type = T;
};
template<typename T>
struct remove_ptr<T*> {
using type = T;
};
}... |
# include<iostream>
using namespace std;
// 标识符命名规则
// 1 标识符不可以是关键字
// 2 标识符是由字母 数字 下划线构成
// 3 标识符第一个字符只能是字母或下划线
// 4 标识符是区分大小写的
// 建议 给变量起名的时候 最好能够做到见名知意
int main2() {
return 0;
}
|
#ifndef _INPUTS_H_
#define _INPUTS_H_
#include "stdafx.h"
#include "macros.h"
#define FOREACH_INPUT_CONFIG(INPUT_CONFIG) \
INPUT_CONFIG(INPUT_ASYNC_KEY_STATE) \
INPUT_CONFIG(INPUT_DIRECT)
enum INPUT_CONFIG_ENUM {
FOREACH_INPUT_CONFIG(GENERATE_ENUM)
};
static const char *INPUT_CONFIG_ENUM_ST... |
//
// State.cpp
// Landru
//
// Created by Nick Porcino on 10/28/14.
//
//
#include "State.h"
#include "FnContext.h"
#include "LandruActorVM/VMContext.h"
#include <cstdint>
#include <cstdio>
namespace Landru {
uint32_t Meta::globalAddr = 0;
void Meta::exec(FnContext& run) const
{
std::... |
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
long long int L, N;
long long int area, saida, tapetemax, numtapete;
cin >> L >> N;
numtapete = N - 1;
tapetemax = L - numtapete;
area = tapetemax * tapetemax;
saida = area + numtapete;
cout << saida;
return 0;
... |
// I initially based this on
// https://blog.forrestthewoods.com/reverse-engineering-sublime-text-s-fuzzy-match-4cffeed33fdb
// https://medium.com/@Srekel/implementing-a-fuzzy-search-algorithm-for-the-debuginator-cacc349e6c55
// and ended up rewriting pretty much all of it from scrach to improve performance
// and chan... |
// Created on: 2000-05-10
// Created by: Andrey BETENEV
// Copyright (c) 2000-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 a... |
#include <iostream>
#include <cstring>
#include <vector>
const int MAX = 101;
int n, m, d[MAX];
std::vector<int> list[MAX];
bool check[MAX];
bool dfs(int person)
{
for(int notebook : list[person])
{
if(check[notebook])
{
continue;
}
check[notebook] = 1;
if(d[... |
#include<iostream>
using namespace std;
// LEFT ROTATE THE ELEMENT BY 1
// PARAMETERS : ARRAY, LENGHT OF ARRAY
void leftRotateByOne(int arr[],int lenghtOfArray){
int temp = arr[0];
for(int elem=0;elem<lenghtOfArray-1;elem++){
arr[elem] = arr[elem+1];
}
arr[lenghtOfArray-1]= temp;
}
// WILL PR... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e10
#define REP(i,n) for(int i=0; i<n; i++)
#define R... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#include "adjunct/desktop_util/opfile/des... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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.
#ifndef BT_GLOBALS_H
#define BT_GLOBALS_H
// --------------------... |
#include "ModifierGroup.h"
// -----------------------------------------------------------------------------
// CONSTRUCTOR
// -----------------------------------------------------------------------------
ModifierGroup::ModifierGroup()
{
this->show();
this->enabled(true);
}
ModifierGroup::~ModifierGroup()
{
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2005 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 "mo... |
#include"matrix07.h"
#include<vector>
#include<cmath>
#include<gtest/gtest.h>
TEST(MulTest, meaningful) {
std::vector<std::vector<int>> left = {
{11, 12, 13, 14},
{21, 22, 23, 24},
{31, 32, 33, 34}
};
std::vector<std::vector<int>> right;
right.resize(4, std::vector<int>(3, 1.));
std::vector<std::... |
//
// Vector3D.h
// GLFW3
//
// Created by William Meaton on 07/12/2015.
// Copyright © 2015 WillMeaton.uk. All rights reserved.
#ifndef Vector3D_h
#define Vector3D_h
//A 3D vector, missing some operators but not really used in my program.
namespace Math {
class Vector3D{
public:
float x, y, z;
... |
#include "utility/file.hpp"
#include "utility/tcp.h"
#include "utility/raii.hpp"
#include "utility/encryption.h"
#include <algorithm>
using std::experimental::string_view;
using namespace std;
void cut_string (std::vector<string_view>& result, string_view origin, string_view delim)
{
result.clear();
auto it ... |
long long combination (int i,int j,int m,int n){
if(i==m-1&&j==n-1) return 1;
if(i>m||j>n) return 0;
else return combination(i+1,j,m,n)+combination(i,j+1,m,n);
}
long long numberOfPaths(int m, int n)
{
// Code Here
//m*n-2Cm+n-1
return combination(0,0,m,n);
}
|
"2002-01-18\n"
" - duuzo sie znowu dzialo ...\n"
|
#include "Bispectrum_Fisher_MPI.hpp"
#include "Log.hpp"
#include "wignerSymbols.h"
#include <omp.h>
#include <ctime>
#include <chrono>
#include <mpi.h>
using namespace chrono;
/*********************************/
/** Bispectrum_Fisher **/
/*********************************/
Bispectrum_Fisher::Bispectrum_Fis... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmFileTime_h
#define cmFileTime_h
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
/** \class cmFileTime
* \brief Abstract file modification time... |
/*!
* \file mpredialog.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for mpre dialog
*/
#ifndef MPREDIALOG_H_
#define MPREDIALOG_H_
#include <QDialog>
#include <QDialogButtonBox>
#include <QComboBox>
#include <QSpinBox>
#include <QDoubleSpinBox... |
//
// Created by 송지원 on 2020/07/03.
//
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
unsigned long long a, b;
unsigned long long diff;
cin >> a >> b;
if (a > b) swap(a, b);
diff = b - a;
if (diff>0){
cout << diff -1<< '\n';
for (unsigned long long ... |
/* -*- 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.
*/
#include "core/pch.h"
#ifdef GENERIC_PRINTING
#include "modules... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "Hypoxia.h"
#include "Keycard.h"
#include "EngineUtils.h"
#include "Engine/StaticMeshActor.h"
void AKeycard::BeginPlay() {
Super::BeginPlay();
for (TActorIterator<ADoor> ActorItr(GetWorld()); ActorItr; ++ActorItr)
{
if (Ac... |
#include "../include/scaledialog.h"
#include "ui_scaledialog.h"
ScaleDialog::ScaleDialog(QWidget *parent, int _w, int _h) : QDialog(parent), ui(new Ui::ScaleDialog),
width(_w), height(_h), fixRate(false),
... |
// Comes from:
// https://docs.nvidia.com/cuda/curand/host-api-overview.html#host-api-example
#ifdef _WIN32
# define EXPORT __declspec(dllexport)
#else
# define EXPORT
#endif
/*
* This program uses the host CURAND API to generate 100
* pseudorandom floats.
*/
#include <cuda.h>
#include <curand.h>
#include <stdio... |
#include "comn.h"
#ifndef CITY_FORCAST
#define CITY_FORCAST
bool israin(std::string scode);
class city_fst
{
private:
public:
CTime time;
int station_num;
//days 时次的最高最低
std::vector<double> max_t, min_t;
//2*days 时次是否报雨
std::vector<bool> israin;
city_fst(int days=2)
:israin(2*d... |
#include "pch.h"
#include "ImporterBFF.h"
namespace ImporterBFF
{
//Hidden
void LoadModelFromFile(ModelBFF& model)
{
std::string fullFilePath = "../../../../Models/" + model.fileName;
std::ifstream MeshFile(fullFilePath, std::ifstream::binary);
// Failed to find file, return empty model
if (!MeshFile.is_op... |
////////////////////////////////////////////////////////////////////////
// DESCRIPTION:
//
// Produces the MEL command "scanDagSyntax".
//
// This command plug-in provides the same functionality as scanDagCmd except
// that the syntax parsing is performed using syntax objects.
//
// The command accepts several flags... |
//
// Created by 钟奇龙 on 2019-05-05.
//
#include <iostream>
#include <vector>
using namespace std;
/*
* 暴力递归
*/
int process1(vector<int> arr,int index,int aim){
int res = 0;
if(index == arr.size()){
res = aim == 0 ? 1:0;
}else{
for(int i=0; i * arr[index] <= aim; ++i){
res += p... |
#pragma once
#include <string>
#include "LandScape.h"
#include<iostream>
#include "Bonus.h"
#include <map>
#include "Player.h"
#include "Cell.h"
#include "Unit_type.h"
#include "GameObj.h"
class Unit: public GameObj
{
virtual std::string getName();
//std::string Name;
//std::string unit_type;
bool De... |
//
// Created by roy on 12/24/18.
//
#include "Minus.h"
/**
* This method calculates the subtraction between left and right expressions.
* @return double value of the operation.
*/
double Minus::calculate() {
return (left->calculate() - right->calculate());
} |
#include "Analysis.hpp"
#include "Integrator.hpp"
#include "Log.hpp"
#define NUWIDTH 10
#define LIMBERWINDOW true
IntensityMapping::IntensityMapping(ModelInterface* model)
{
this->model = model;
log<LOG_DEBUG>("-> You better be using camb_ares_2D or camb_ares as your model!");
analysisID = "Intensity... |
#pragma once
#include "shortestPathAlgorithm.h"
#include "MyVector.h"
class DijkstraMatrixAlgorithm: public shortestPathAlgorithm
{
public:
DijkstraMatrixAlgorithm(Graph & graph);
virtual ~DijkstraMatrixAlgorithm();
virtual void startAlgorithm() final;
protected:
MyVector unvisitedVertrexVec;
virtual void relaxat... |
#include <iostream>
#include <vector>
using namespace std;
#define int long long
#define F first
#define S second
#define P pair<int,int>
#define pb push_back
#define endl '\n'
const int N = 3e1 + 5;
vector <int> Graph[N];
int vis[N];
int n;
vector <P> ans(N);
int row[] = {1, 0, -1, 0};
int col[] = {0, 1, 0, -1};
... |
/**
@file
@author Nicholas Gillian <ngillian@media.mit.edu>
@version 1.0
@section LICENSE
GRT MIT License
Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"... |
#include "core.h"
int** changec(int size, int** array, int colfor, int colfrom)
{
for (int i = 0; i < size; i++)
{
int tmp = array[i][colfor];
array[i][colfor] = array[i][colfrom];
array[i][colfrom] = tmp;
}
return array;
} |
/**
* @file
* @copyright defined in EOTS/LICENSE.txt
*/
#include <eotio/chain/genesis_state.hpp>
// these are required to serialize a genesis_state
#include <fc/smart_ref_impl.hpp> // required for gcc in release mode
namespace eotio { namespace chain {
chain::chain_id_type genesis_state::compute_chain_id() ... |
#pragma once
#include"Behaviour.h"
#include"Agent.h"
class PursueBehaviour : public Behaviour
{
public:
PursueBehaviour();
virtual ~PursueBehaviour();
virtual vector2 Update(Agent* agent, float deltaTime);
virtual float GetWeight() { return weight; };
void SetTarget(Agent* target) { m_target = target;}; //set th... |
#pragma once
#include <string>
#include <map>
#include <memory>
#include <tuple>
#include <wincodec.h>
#include <d2d1_2.h>
#include "util.h"
COM_MAKE_PTR(ID2D1Bitmap);
COM_MAKE_PTR(IWICBitmapFrameDecode);
COM_MAKE_PTR(ID2D1HwndRenderTarget);
enum tint {
green,
blue,
red
};
typedef std::pair<std::string, tint> ... |
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int p[300100],lazy[300100];
void build(int l,int r,int pos)
{
if (l == r)
{scanf("%d",p+pos);
return;
}
int mid = (l+r) >> 1;
build(l,mid,pos*2);
build(mid+1,r,pos*2+1);
p[pos] = p[pos*2]+p[pos*2+1];
}
void change(i... |
#pragma once
#include "IPartWndProc.h"
class KeyboardWndProc : public ytyaru::Framework::WndProc::IPartWndProc
{
public:
KeyboardWndProc(void);
~KeyboardWndProc(void);
LRESULT CALLBACK PartWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL* pIsReturn);
};
|
/*
* Copyright (c) 2014-2017 Detlef Vollmann, vollmann engineering gmbh
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#include "rectangle.hh"
#include "extgraph.hh"
namespace exercise
{
Rectangle::Rec... |
#ifndef __POW_HPP__
#define __POW_HPP__
#include "base.hpp"
#include <math.h>
class Pow : public Base {
public:
Pow(Base* op1, Base* op2) : Base(), operand1(op1), operand2(op2) {}
std::string stringify() { return "(" + operand1->stringify() + " ** " + operand2->stringify() + ")";}
double evaluate() {
return ... |
// ************************* String functions **************************
inline int numc(char c) { return c <= 'Z' ? c - 'A' : c - 'a' + 26; }
void prefix_function(const char *s, int *pi) {
int n = strlen(s);
for (int i = 1; i < n; ++i) {
int j = pi[i - 1];
while (j > 0 && s[i] != s[j]) j = pi[j - 1];
if (s[i] ... |
// Created on: 1995-06-02
// Created by: Xavier BENVENISTE
// 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.