text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#ifdef DOM_DEVICE_ORIENTATION_EVENT_SUPPOR... |
#include <cstdio>
int main()
{
int nota;
do{
printf("Introduzca la nota [0-10]: ");
scanf("%d", ¬a);
if ((nota<0) || (nota>10)) {
printf("Nota no valida. Valor fuera de rango\n");
}
}while ((nota<0) || (nota>10));
switch (nota) {
... |
#ifndef MYLIBFUNC_H_
#define MYLIBFUNC_H_
#include <opencv2/core/core.hpp>
using namespace cv;
using namespace std;
void find_feature_matches ( const Mat& img_1, const Mat& img_2,
vector<KeyPoint>& keypoints_1,
vector<KeyPoint>& keypoints_2,
... |
#include "chrome/browser/extensions/api/transform/transform_api.h"
#include <string>
#include "chrome/browser/extensions/extension_tab_util.h"
#include "extensions/browser/extension_function_registry.h"
#include "extensions/browser/extension_function.h"
#include "extensions/common/extension.h"
#include "chrome/brows... |
//
// Created by 송지원 on 2020/06/27.
//
//바킹독님 덱 강의 STL 사용하지 않고 직접 구현하는 버젼
#include <iostream>
using namespace std;
const int MAX = 10005;
int dat[2*MAX+1];
int head = MAX, tail = MAX;
int N;
string s;
int t;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> N;
while (N--) {
cin >> s;... |
#include "board.h"
#include "brick.h"
#include <fstream>
#include <iostream>
using namespace std;
Board::Board()
{
//初始化块,时间间隔,分数
brick = new Brick(this);
//从文件读入最高分
FILE *fd =fopen("score.bin","rb+");
for(int i=0;i<10;i++)
fscanf(fd, "%d", scoreRank+i);
//... |
// Created on: 1995-03-22
// Created by: Jean-Louis Frenkel
// 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 th... |
static unordered_map<char, int> romandata = { {'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, {'C', 100}, {'D', 500}, {'M', 1000}};
int Solution::romanToInt(string s) {
int res = 0;
int prevNum = 0;
for(int i = s.size()-1; i>=0; i--){
int n = romandata[s[i]];
res += (prevNum<=n)?n:-n;
prev... |
#pragma once
#include "stdafx.h"
class Payload {
public:
Payload(_In_ LPCWSTR outName, _Outptr_ IAppxPackageWriter**);
~Payload();
HRESULT GetPackageWriter();
HRESULT AddPayloadFiles();
void cleanup();
private:
LPCWSTR encryption;
_In_ LPCWSTR outName;
_Outptr_ IAppxPackageWriter** writer;
HRESULT hr;
... |
#pragma once
//BaseViewを継承して、ここでオーバライドしたものをLoadBalancingListenerから呼ぶようにしてる
class TestView : public BaseView
{
public:
TestView();
~TestView();
void SetLBC(ExitGames::LoadBalancing::Client* lbc, LoadBalancingListener* lbl);
virtual void updateState(int state, const ExitGames::Common::JString& stateStr, const ExitGa... |
#pragma once
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#pragma comment(lib, "ws2_32.lib")
#include <iostream>
#include <string>
#include <WinSock2.h>
#include <shared_mutex>
#include "Global.h"
#include "PacketManager.h"
#include <vector>
#include <shared_mutex>
#include "Global.h"
#include "Connection.h"
class Ser... |
#include "odb/server/tcp-data-server.hh"
#include <arpa/inet.h>
#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include "odb/mess/tcp-tr... |
/*
* File: main.cpp
* Author: varsha
*
* Created on July 3, 2013, 11:56 AM
*/
#include <iostream>
#include <sstream>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "libfreenect.h"
#include <pthread.h>
#include <opencv2/opencv.hpp>
#include <opencv2/... |
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
... |
#include "RegularGrid.h"
RegularGrid::RegularGrid(QObject *parent):
Grid(parent)
{
rows = 10;
cols = 10;
}
RegularGrid::~RegularGrid()
{
for (int i=0; i<grid.length(); ++i)
delete grid[i];
}
PointCloudT *RegularGrid::getCloudData(int row, int col)
{
return grid[row*cols + col]->getCloud();
}
void RegularG... |
// Problem => We have to find the length of longest arithmetic array
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Please enter the size of array: ";
cin>>n;
int arr[n];
for(int i=0; i<n; i++){
cout<<"Please enter elements in the array: ";
cin>>arr[i];
}
... |
#pragma once
#include "ofMain.h"
#include "ofxGui.h"
#include "functions.h"
#include "kalman.hpp"
#include <vector>
#include <Eigen/Dense>
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void exit();
void keyPressed(int key);
void keyReleased(int key);
void... |
#ifndef FEED_H
#define FEED_H
#include <QObject>
#include <QGraphicsRectItem>
#include "bio.h"
class Feed : public QObject, public QGraphicsRectItem, public Bio
{
Q_OBJECT
public:
Feed();
Feed(QGraphicsScene * s);
~Feed();
void Draw();
void Move();
};
#endif // FEED_H
|
#pragma once
#include <string>
class GameProgressManager
{
public:
enum GameProgressState
{
NOT_STARTED,
LOADING_LEVEL,
LOADING_SAVED_GAME,
IN_PROGRESS,
PAUSED,
FINISHED,
GAME_OVER
};
public:
friend class Core;
GameProgressManager();
~GameProgressManager();
void init();
GameProgressState getGam... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; -*-
*
* Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#ifdef XML_AIT_SUPPORT
#include "modules/... |
/*
* Stopping Times
* Copyright (C) Leonardo Marchetti 2011 <leonardomarchetti@gmail.com>
*/
#include "tester.h"
using namespace std;
namespace StoppingTimes{ namespace Testing{
Tester::~Tester(){
tests_.clear();
}
void Tester::add(Test *t)
{
tests_.push_back(unique_ptr<Test>(t));
}
void Tester::loadAll(cons... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2006 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_DOMSTRINGMAP
#define DOM_DOMSTRINGMAP
#include "modul... |
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <bitset>
#include <queue>
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <sstream>
using namespace std;
int daya[] = {31,28,31,30,31,30,31,31,30,31,30,31};
int ldaya[] = {31,29,31,30,31,30,31,31,30,... |
/*
* Md To USB
* (Arduino Pro Micro)
*
*DSUB9P(Md) -- pro micro gpio
* 1 -- d4(D0) d4
* 2 -- d5(D1) c6
* 3 -- d6(D2) d7
* 4 -- d7(D3) e6
* 5 -- Vcc(+5V)
* 6 -- d2 (D4) d1(int1)
* 7 (9) -- d3 (D5) d0(i... |
#ifndef _GRAPH_REG_H
#define _GRAPH_REG_H
#include "smat.h"
#include "tron.h"
#include <algorithm>
// Solvers
enum {
L2R_LS_FULL=0, L2R_LS_MISSING=1,
O2R_LS_FULL=10, O2R_LS_MISSING=11,
GLR_LS_FULL=20, GLR_LS_MISSING=21,
ARR_LS_FULL=30, ARR_LS_MISSING=31,
};
// Bilinear Problems with L2/output Regulariz... |
/**
* Definition for undirected graph.
* struct UndirectedGraphNode {
* int label;
* vector<UndirectedGraphNode *> neighbors;
* UndirectedGraphNode(int x) : label(x) {};
* };
*/
//bfs
class Solution {
public:
unordered_map<UndirectedGraphNode*, UndirectedGraphNode*> mp;
UndirectedGraphNode *c... |
#include<vector>
using std::vector;
#include<iostream>
#include<algorithm>
#include<memory>
using std::shared_ptr;
#include<string>
using std::string;
#include<stack>
using std::stack;
#include<queue>
using std::priority_queue;
/*
Implement next permutation, which rearranges numbers into the lexicographically next gre... |
#include "wnd.h"
#include <glad/glad.h>
Context *activeOpenGLContext = NULL;
Context::Context() : windowContext(NULL), openglContext(NULL), window(NULL) {
}
Context::Context(HDC hdc, HGLRC hglrc, WND *wnd) : windowContext(hdc), openglContext(hglrc), window(wnd) {
}
void WND::CreateContext(void) {
PIXELFORMATDESCR... |
//
// Created by gurumurt on 9/21/18.
//
#ifndef OPENCLDISPATCHER_SELECTION_H
#define OPENCLDISPATCHER_SELECTION_H
#endif //OPENCLDISPATCHER_SELECTION_H
#include "../include/headers.h"
class selection{
string name = "SELECTION";
double execution_time = 0.0;
unsigned int* result;
enum condition{... |
/*
Name: TimerTest.ino
Created: 29.07.2018 0:35:38
Author: Павел
*/
USBSerial usb;
HardwareTimer milli(2);
HardwareTimer micro(3);
void USBPrintln(char const* text)
{
if (usb) usb.println(text);
}
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(LED_BUILTIN, OUTPU... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
/*
* Designer/architect: Petter Reinholdtsen <pere@opera.com>
*... |
/*****************************************************************************
* ExploringSfMWithOpenCV
******************************************************************************
* by Roy Shilkrot, 5th Dec 2012
* http://www.morethantechnical.com/
**********************************************************... |
#include <iostream>
#include <opencv2/core/core.hpp>
#include <common/utility.hpp>
#include "calibration.hpp"
////////////////////////////////////////////////////////////////////////////////
static const std::vector<std::string> CAMERA_SERIALS {
"810512060827",
"747612060748",
};
/////////////////////////////////... |
#pragma once
#include <API/Code/Graphics/Texture/Texture2D.h>
#include <API/Code/Graphics/Shader/Shader.h>
#include <API/Code/Graphics/PostProcess/GaussianBlur.h>
/// <summary>Pass generating the normal map from the height map.</summary>
class NormalGeneration
{
public:
/// <summary>Initialize the pass.</summary>
/... |
#pragma once
#include "StdAfx.h"
#include "Npc.h"
#include "UIObject.h"
#include "Camera.h"
#include "Map.h"
typedef std::vector<CObject*> OBJECTS;
typedef std::vector<CObject*>::iterator OBJ_ITR;
class CSceneManager
{
public:
CSceneManager();
~CSceneManager(){m_pHge->Release();}
bool Init();
void Render();
... |
//网络杂项
#pragma once
#include "xr_include.h"
namespace xr
{
enum FD_TYPE
{
UNUSED = 0,
LISTEN = 1,
PIPE = 2,
CLIENT = 3,
MCAST = 4,
ADDR_MCAST = 5,
UDP = 6,
CONNECT = 7,
SERVER = 8,
};
struct net_util_t
{
//用于通过网卡接口(eth0/eth1/lo...)获取对应的IP地址。支持IPv4和IPv6。
//nif 网卡接口.eth0/eth1/lo...
//af 网络地址类型。AF_INET或者AF... |
//
// Created by Zhao Xiaodong on 2017/6/4.
//
#ifndef MINISQL_RECORDMANAGER_H
#define MINISQL_RECORDMANAGER_H
#include <string>
#include <vector>
#include <map>
#include <limits>
#include "../index+catalog+buffer/table.h"
#include "../index+catalog+buffer/buffermanager.h"
#include "../index+catalog+buffer/catalogman... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout... |
#ifndef HEADER_CURL_THREADS_H
#define HEADER_CURL_THREADS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* |... |
#include <iostream>
#include "circle.hpp"
int main() {
Circle c1, c2(2);
std::cout << c1 << ' ' << c2 << '\n';
c1.set_radius(3);
std::cout << c1 << '\n';
Circle c3 = c1;
c3.set_radius(7);
std::cout << c3 << '\n';
/*
Sphere s1, s2(2);
Sphere s3 = s1;
s3.set_radius(5);
s2 = s2 * 2;
std::cout << s1 << '\... |
// Copyright (c) 2012-2017 The Cryptonote developers
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include "Chaingen.h"
struct get_tx_validation_base... |
// Created by: DAUTRY Philippe
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public Li... |
#include<stdio.h>
#include<conio.h>
int prime(int);
int main()
{
int num, x;
printf ("Enter a number :");
scanf("%d",&num);
x=prime(num);
if(x==1)
{
printf("It is a prime number\n\n");
}
else
{
printf("It is not a prime number\n\n");
}
main();
getch();
return 0;
}
int prime(int num... |
// 200118
// 백준 #2293 : 동전 1
// DP : 본 풀이 방법으로는 메모리 초과됨.
// 4Bytes x (101+101x10001) = 4,080,408 Bytes = 약 3.9MB
#include <iostream>
int n, k;
int c[101];
// int dp[10001];
int d[101][10001];
int main() {
scanf("%d %d", &n, &k);
for(int i=1; i<=n; i++) {
scanf("%d", &c[i]);
d[i][0]=1;
}... |
// Copyright (C) 2004 Id Software, Inc.
//
#ifndef __CINEMATIC_H__
#define __CINEMATIC_H__
// RAVEN BEGIN
//nrausch: I made some semi-heavy changes to this entire file
// - changed to idCinematic to use a private implementation which
// is determined & allocated when InitFromFile is called. A different
// PIMPL is us... |
#include "Snitch.h"
Snitch::Snitch()
{
radius = SNITCH_RADIUS;
center = Point3(0, SNITCH_HEIGHT, 0);
float theta = random(360);
theta = jiao2hu(theta);
colour = color + BLACK;
v.axis[0] = cos(theta) * SNITCH_SPEED;
v.axis[1] = sin(theta) * SNITCH_SPEED;
colour = color + GOLDEN;
}
Snit... |
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include "test_precomp.hpp"
using namespace cv;
namespace {
static const char * const keys =
"{ h help | | pr... |
#include <Stepper.h>
int motorPin1 = 8;
int motorPin2 = 13;
int motorPin3 = 9;
int motorPin4 = 12;
int trigger = 5;
int echo = 4;
int led = 13;
long dauer = 0;
long entfernung = 0;
int motorSpeed = 10;
int entfernungZumStartenVomHochziehen = 200;
int pauseNachHochziehen = 10000;
int umdrehung = 200;
int umdrehungenDe... |
#pragma once
#include "ICommandMaker.h"
#include "CommandFactory.h"
template <typename T>
class CommandMaker : public ICommandMaker {
public:
CommandMaker(const std::string& key) {
try {
CommandFactory::Instance().RegisterMaker(key, this);
}
catch (std::string e) {
HANDLE hConsole = GetStdHandle(STD_OUT... |
void setup() {
Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(14, OUTPUT);
attachInterrupt(5, blink1, RISING);
pinMode(5, INPUT_PULLDOWN);
attachInterrupt(6, blink2, RISING);
pinMode(6, INPUT_PULLDOWN);
attachInterrupt(7, blink3, RISING);
pinMode(7, INPUT_PULLDOWN);
attachInterrupt(8... |
#include "transform.hpp"
using namespace std;
using namespace Eigen;
int main(int argc, char* argv[]) {
// Check to see if there is a text file to read
if (argc == 2) {
// Open the text file of transformations
fstream file;
file.open(argv[1]);
if (!file) {
cout << ... |
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "Nerucci.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, Nerucci, "Nerucci" );
DEFINE_LOG_CATEGORY(LogNerucci)
|
#pragma once
namespace aeEngineSDK
{
struct AE_UTILITY_EXPORT aeSphere
{
/*************************************************************************************************/
/* Constructors declaration
/*************************************************************************************************/
public:
... |
//
// Created by Jonathan Gerber on 1/17/17.
//
#include "TimeMe.hpp"
#include "catch.hpp"
SCENARIO("testing timeme") {
GIVEN("a timeme instance") {
TimeMe me{1000};
THEN("lenght should be 1000")
REQUIRE(me.getLength() == 1000);
}
} |
/*
* 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 <quic/congestion_control/CongestionControllerFactory.h>
#include <quic/congestion_control/Bbr.h>
#include <quic/congest... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
#include <iostream>
using namespace std;
int main() {
for(int i= 0; i<10; i++){
for(int j=0; j<i; j++){
cout << j+1 ;
}
cout << endl;
}
return 0;
}
|
/**
* 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:
int countUnivalSubtrees(TreeNode* root) {
return visit(root, 0);
}
int visit(Tr... |
#include <iostream>
#include <SFML/Graphics.hpp>
#include "fun.h"
#include "Pt.h"
#include "Ray.h"
#include "fps.h"
#include <stdio.h>
int main()
{
sf::RenderWindow window(sf::VideoMode(1200, 900), "Ray Casting");
sf::Event ev;
Pt point(20, &window);
sf::Vertex walls[10][2];
spawnWalls(walls... |
#ifndef COMMON_HEADER
#define COMMON_HEADER
#include <stdint.h>
#include <time.h>
typedef int nrfs;
typedef char* nrfsFile;
#define MAX_MESSAGE_BLOCK_COUNT 10 /* Max count of block index in a message. */
typedef struct
{
uint16_t node_id;
uint64_t offset;
uint64_t size;
} file_pos_tuple;
struct file_pos_in... |
#include "CaptureImageProvider.h"
#include <QImage>
#include <QDebug>
namespace wpp
{
namespace qt
{
CaptureImageProvider::CaptureImageProvider()
: QQuickImageProvider(QQuickImageProvider::Image), id(0)
{
}
int CaptureImageProvider::setImage(const QImage& image)
{
qDebug() << __FUNCTION__ << "param(image):" <<... |
#pragma once
#include "MyMainFrame.h"
class CTestFrame :
public CMyMainFrame
{
MY_DECLARE_DYNCREATE(CTestFrame)
public:
CTestFrame();
virtual ~CTestFrame();
};
|
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
struct ListNode{
int val;
ListNode* next;
ListNode(int x):val(x),next(NULL){}
};
void printLL(ListNode* head){
ListNode* temp = head;
while(temp!=NUL... |
#include <bits/stdc++.h>
using namespace std;
int main(){
map<string, vector<int>, greater<string>> m;
m["aa"].push_back(100);
m["aa"].push_back(200);
m["bb"].push_back(200);
for (auto p: m){
cout << p.first << ":" << endl;
for (auto i: p.second) cout << i << " ";
cout ... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxm = 1e6;
int f[maxm + 100][5];
int dfs(int r,int k) {
if (k == 3... |
/* A class that monitors X11 cursor changes and sends the cursor image over the
* streaming virtio port.
*
* \copyright
* Copyright 2016-2018 Red Hat Inc. All rights reserved.
*/
#include "cursor-updater.hpp"
#include "error.hpp"
#include <spice/stream-device.h>
#include <spice/enums.h>
#include <cstring>
#inc... |
#include "views/unitviews/unitviewmode.hpp"
#include "needs/needssystem.hpp"
using namespace ecs;
using namespace needs;
struct NeedsMode : UnitViewModeInstance<NeedsMode> {
static inline string title() { return "Units Roster (Needs)"; }
using List_t = std::array<std::string, 3>;
static List_t List;
static i... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup" -*-
*
* Copyright (C) 1995-2005 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 "modules/xmlutils/xmlu... |
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <sstream>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
typedef long long LL;
typedef unsigned long long ULL;
#defin... |
#include "point.h"
#include <algorithm>
#include <vector>
using namespace std;
vector<Cuboid*> CuboidManager;
double pointtoplanedistance(const Point3D &o, const Point3D &p, const Point3D &q, const Point3D &r) {
Point3D temp = ((r - p) * (q - p)).resize(1);
return (o - p) % temp;
}
inline void pointtolinecheck(doub... |
#pragma once
#include "DijkstraMatrixAlgorithm.h"
#include "MyVector.h"
class DijkstraListAlgorithm: public DijkstraMatrixAlgorithm
{
public:
DijkstraListAlgorithm(Graph & graph);
virtual ~DijkstraListAlgorithm();
protected:
virtual void relaxation(int, int) final;
virtual void relaxationForNeighborhoods(int) fina... |
#include "foo.h"
int foo()
{
return 42;
}
|
// todo 简化之
class RebuildTree {
public:
TreeNode* reConstructBinaryTree(vector<int> pre, vector<int> vin) {
return __reConstructBinaryTree(pre, 0, pre.size() - 1, vin, 0,
vin.size() - 1);
}
TreeNode* __reConstructBinaryTree(vector<int> pre, int p1, int p2,
vector<int> vin, int v1, int v2) {
TreeNode* root... |
#include "bst.h"
#include <cstring>
#include <string>
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
void toLower(string & str);
int main(int argc, char*argv[])
{
//int argc = 3; char*argv[3] = { "a4.exe", "fouly.txt", "frequentWord" };
if (argv[1] == NULL) { cout <... |
#include "tab.hpp" // no rect button
#include "rectbutton.hpp"
/* The Scene class contains four tabs, three different buttons, and other
* shapes that are needed to be displayed across all tabs (non tab-specific
* shapes).
*
* It manages all the updates and displaying for the programme. */
class Scene {
pub... |
#pragma once
#include <random>
class Util
{
public:
static float getRandomFloat(float min, float max){
return ((static_cast <float>(rand())) * (max - min) / (static_cast<float>(RAND_MAX))) + min;
}
static int getRandomInt(int min, int max){
int r = getRandomFloat(min-1, max+1);
i... |
#include "SpaceShip.h"
#include "Bullet.h"
SpaceShip::SpaceShip(std::shared_ptr<Model> model, std::shared_ptr<Shader> shader, std::shared_ptr<Texture> texture)
: Sprite2D(model, shader, texture)
{
Init();
}
SpaceShip::SpaceShip(std::shared_ptr<Model> model, std::shared_ptr<Shader> shader, std::shared_ptr<Texture> t... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
int n;
std::cin >> n;
for (int i = 1; i <= n; ++i)
{
int a, b;
std::cin >> a >> b;
std::cout << "Cas... |
#ifndef _TIMER_H
#define _TIMER_H
#if (ARDUINO >= 100)
# include <Arduino.h>
#else
# include <WProgram.h>
#endif
static const uint8_t TIMER_PB = 0;
static const uint8_t TIMER_IN = 1;
struct tcon_s {
union {
uint32_t val;
struct {
unsigned _unused:1;
unsigned tcs:1;
unsigned tsync:1;
unsigned _spare:... |
// Copyright (c) 2015 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special ... |
/* -*-mode:c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include "thunk.hh"
#include <unistd.h>
#include <cstring>
#include <iostream>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <regex>
#include "protobufs/util.hh"
#include "thunk/ggutils.hh"
#include "thunk/facto... |
// Created on: 1993-01-09
// Created by: CKY / Contract Toubro-Larsen ( TCD )
// 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
/... |
#include<iostream>
using namespace std;
typedef enum{dg,fg
}L;
int main(){
L d = fg;
cout<<d;
return 0;
}
|
#pragma once
#include <vector>
#include "AbstractScreen.h"
class MinecraftClient;
class TilePos;
class UIRenderContext;
class InputMode;
class DirectionId;
class MCOEvent;
class MojangConnectionStatus;
class Button;
class GuiElement;
class StickDirection;
class Font;
class TextBox;
//Size : 212
class Screen : public... |
//====================================================================================
// @Title: TEXTBOX
//------------------------------------------------------------------------------------
// @Location: /prolix/interface/include/cmpTextbox.cpp
// @Author: Kevin Chen
// @Rights: Copyright(c) 2011... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
// Created on: 2002-10-29
// Created by: Michael SAZONOV
// Copyright (c) 2002-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 ... |
/*****************************************************************
* Copyright (C) 2017-2018 Robert Valler - All rights reserved.
*
* This file is part of the project: DevPlatformAppCMake.
*
* This project can not be copied and/or distributed
* without the express permission of the copyright holder
******... |
#ifndef WEZEL_H
#define WEZEL_H
#include <iostream>
#include <string>
#include <cstdlib>
template <typename T>
class MyList;
template <typename T>
class MyNode{
private:
T element; // zawartosc elementu
MyNode<T>* next; // wskaznik na nastepny element
friend class MyList<T>; // lista zaprzyjaznionych klas... |
#include <cppunit/extensions/HelperMacros.h>
#include <Poco/Exception.h>
#include <Poco/NamedMutex.h>
#include <Poco/Process.h>
#include "cppunit/BetterAssert.h"
#include "util/SingleInstanceChecker.h"
using namespace std;
using namespace Poco;
namespace BeeeOn {
class SingleInstanceCheckerTest : public CppUnit::T... |
#include "AncillaryRecords/AncillaryRecord.h"
#include "AncillaryRecords/LongIdRecord.h"
#include "PrimaryRecord.h"
#include <sstream>
#include "StreamUtilities.h"
using namespace OpenFlight;
using namespace std;
//-------------------------------------------------------------------------
//--- PrimaryRecord
//------... |
// Created on: 1992-04-03
// Created by: Laurent BUCHARD
// Copyright (c) 1992-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... |
#include <iostream>
#include <vector>
using namespace std;
int findHigher(int now, std::vector<int> vec, int gap) {
int max = 0;
for(int i = 0; i < vec.size(); i++) {
if((now < vec[i]) && ((now + gap) >= vec[i])) {
if(vec[i] > max) {
max = vec[i];
}
}
}
return max;
}
int main() {
... |
#ifndef Stash_h
#define Stash_h
#include "EtherCard.h"
/** This structure describes the structure of memory used within the ENC28J60 network interface. */
typedef struct {
uint8_t count; ///< Number of allocated pages
uint8_t first; ///< First allocated page
uint8_t last; ///< Last allocated ... |
// Delwin Rosa
// CSCI 238
// Program 6 - Pets
// Date: 04/25/2020
// Program Assignment 6 - Polymorphic Pets Program P3
/* Add a virtual method called eat to the base class Pet
this method should say "" in the base class of Pet
then in dog class it should say "petname eats dog food"
Add a new class Cat that inherits... |
/*SOLUTION*/
#include <bits/stdc++.h>
using namespace std;
bool arr[1000010];
long long i,j,k,a,b,arr1[1000010],m,x;
void prime(long long b){
m=0;
for(i=2;i<=sqrt(b);i++){
if(!arr[i])
for(j=i+i;j<=b;j=j+i){
arr[j]=1;
}
}
for(k=2;k<=b;k... |
//
// Created by abel_ on 01-07-2022.
//
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
int main(){
// write a code to extract integers 012 and 045 from string '012,045'
string s = "122,145";
int n = s.length();
string pwl = s.substr(0, 3);
string pwr = s.substr(4, 3);
cout << p... |
#include<iostream>
#include<stdlib.h>
using namespace std;
int main(){
int t;
int max;
int l,r;
cin>>l>>r;
max=-1;
for(int j=l;j<=r;j++){
for(int k=l;k<=r;k++){
if(max<(j^k))
max=j^k;
}
}
cout<<max<<"\n";
return 0;
} |
#ifndef _POPULATION_H_
#define _POPULATION_H_
#include <map>
#include <vector>
#include <random>
#include <algorithm>
#include "NanoTimer.h"
#include "Individual.h"
#include "Pool.h"
using namespace std;
class Population{
private:
// unsigned int n_inds;
vector<Individual> inds;
// Notar que el pool es de la sim... |
#include <Eigen/Dense>
#include <Eigen/Eigenvalues>
#include <map>
#include <list>
using Eigen::MatrixXd;
using Eigen::VectorXd;
class TICAEstimator {
public:
double dt;
int lag;
int nDescriptors;
int nReplicas;
std::map<int, std::list<VectorXd> > rData;
VectorXd rsum;
int nsum;
MatrixXd rcross;
MatrixXd rcross0;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.