text stringlengths 8 6.88M |
|---|
/******************************************************************************
* Copyright (c) 2018, Xilinx, 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:
*
* 1. Redistribut... |
/***************************************************************************
mi_fstream.cpp - description
-------------------
begin : mar abr 15 2003
copyright : (C) 2003 by Oscar G. Duarte V.
email : ogdu... |
/*
* ÀÚ·á ÀúÀå _ stl set
*/
#include<algorithm>
#include<set>
#include<unordered_map>
#include<string.h>
using namespace std;
#define MAXLEN (5)
int ucnt, scnt;
unordered_map<string, int> utab, stab;
struct Data {
int id, tick, recieved;
bool operator<(const Data& r) const {
return tick != r.tick ? t... |
#include "cut_prim.hpp"
namespace l2func {
// ============= Inner Product ==============
template<class F> F LowerGamma(int n, F z) {
if(n <= 0)
throw "n must be positive";
if(n == 1) {
return 1.0-exp(-z);
} else {
F surface = -pow(z, n-1)*exp(-z);
F prev = LowerGamma(n-1, z... |
#include "../inc.h"
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode *buildTree(vector<int> &inorder, vector<int> &postorder) {
... |
/* KJL 10:19:41 30/03/98 - ConsoleLog.hpp
This file handles the mirroring of the console text
to a log file.
*/
#ifndef ConsoleLog_h_included
#define ConsoleLog_h_included
extern void OutputToConsoleLogfile(char *messagePtr);
#ifdef __cplusplus
extern "C"
{
#endif
extern void OutputBugReport... |
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* analisis.cpp
* Copyright (C) Jose Cappelletto, Dimitar Ralev 2009 <>
*
* convexhull 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 Soft... |
#include <fwidget.h>
FWidget::FWidget(QWidget *parent)
: QWidget(parent),bg1(this),glayout(this),
bdegree(tr("度")),bradian(tr("弧度")),bgradient(tr("梯度")),
line1("1"),line2("1"),line3("0"),line4("0"),line5("-10"),line6("10"),
label1("y="),label2("x+"),label3(")+"),label4(tr("定义域:")),label5(tr("~")... |
/***************************************************************************
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 MAINWINDOW_H
#define MAINWINDOW_H
/// @file MainWindow.h
/// @brief MainWindow のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2013 Yusuke Matsunaga
/// All rights reserved.
#include <QMainWindow>
namespace nsYm {
namespace nsLed {
/////////////////////////////////////////////////////... |
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcovered-switch-default"
#pragma clang diagnostic ignored "-Wsign-compare"
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wshift-sign-overflow"
#include <gtest/gtest.h>
#pragma clang diagnostic pop
#pragma clang diagnos... |
//
// SMPageView.cpp
// SMFrameWork
//
// Created by KimSteve on 2016. 11. 9..
//
//
#include "SMPageView.h"
#include "../Interface/SMScroller.h"
#include <cocos2d.h>
#define CLEANUP_FALG (true)
SMPageView::SMPageView() :
onPageScrollCallback(nullptr),
onPageChangedCallback(nullptr)
{
}
SMPageView::~SMPageV... |
#pragma once
#include <SFML/Graphics.hpp>
#include "defs.h"
#include "character.h"
#include "gunBullets.h"
#include "camera.h"
#include "inventory.h"
#include "weapon.h"
#include "Gun.h"
#include "RocketLauncher.h"
#include "Grenade.h"
#include "Sniper.h"
#include "HealingStaff.h"
class Player : public... |
#ifndef _GRFMTS_H_
#define _GRFMTS_H_
#include "grfmt_base.hpp"
#include "grfmt_bmp.hpp"
#include "grfmt_jpeg.hpp"
#include "grfmt_png.hpp"
#endif/*_GRFMTS_H_*/
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
int f[200001];
while( t --){
int n;
cin >> n;
int a[n];
memset(f, 0, sizeof(f));
bool flag = true;
int max_num = 0;
int mx_1 = 0;
for(int i = 0; i < n; i++){
... |
/* Rishabh Arora
IIIT-Hyderabad */
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> II;
typedef vector<int> VI;
typedef vector<II> VII;
typedef long long int LL;
typedef unsigned long long int ULL;
#define rep(i, a, b) for(i = a; i < b; i++)
#define rev(i, a, b) for(i = a; i > b; i--)
#define I... |
//! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#defi... |
#ifndef CLOUD_TO_LASER_H
#define CLOUD_TO_LASER_H
#include<pcl_ros/point_cloud.h>
#include<pcl/point_types.h>
#include<pcl/io/pcd_io.h>
#include<Eigen/StdVector>
#include <string>
#include<iostream>
#include "ros/ros.h"
#include "sensor_msgs/LaserScan.h"
const std::string frame_id = "/filtered";
typedef pcl::PointClou... |
#pragma once
#include <complex>
namespace dsperado {
namespace XCorr {
/*
* Complex 2D cross correlation.
* Params:
* m1 - first 2D array [size1][size2]
* m2 - second 2D array [size1][size2]
* size1 - ...
* size2 - ...
* ind1 - ...
... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#include "FileMerge.h"
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <cstdlib>
struct point
{
int tid, docid;
point(){}
point(int _tid, int _docid):tid(_tid), docid(_docid){}
};
int cmp(const point &p1, const point &p2)
{
if (p1.tid == p2.tid) return p1.docid < p2.docid;
retu... |
#include "ControleDePagamentos.h"
#include <iostream>
#include <string>
#define MAX 3
using namespace std;
void ControleDePagamentos::setPagamentos(Pagamento pg[MAX]){
pagamentos[MAX] = pg[MAX];
}
Pagamento ControleDePagamentos::getPagamentos(){
return pagamentos[MAX];
}
double ControleDePagamentos::calculaTota... |
#include "window_event.h"
namespace photon {
bool window_event::is_empty() {
return this->empty;
}
int window_event::get_type() {
return this->type;
}
int window_event::get_key() {
return this->key;
}
};
|
#include<iostream>
#include<string>
#include<set>
using namespace std;
// pair对组的创建
// 成对出现的数据,利用对组可以返回两个数据
void test01()
{
//第一种方式
pair<string,int> p("Tom",10);
cout<<"姓名:"<<p.first<<" 年龄:"<<p.second<<endl;
// 第二种方式
pair<string,int> p2 = make_pair("li",20);
cout<<"姓名:"<<p2.first<<" 年龄:"<<p2.... |
int num_array[10][7] = { { 1,1,1,1,1,1,0 }, // 0
{ 0,1,1,0,0,0,0 }, // 1
{ 1,1,0,1,1,0,1 }, // 2
{ 1,1,1,1,0,0,1 }, // 3
{ 0,1,1,0,0,1,1 }, // 4
{ 1,0,1,1,0,1,1 }, // 5
... |
#ifndef CONFIG_MANAGER_H
#define CONFIG_MANAGER_H
/*
* @author Paradoxon powered by Jesus Christ
* takes care about loading and saving the ConfigMessage for ProjectConceptor and the plugins
*/
#include <app/Message.h>
#include <storage/File.h>
#include <stdlib.h>
#include "ConfigWindow.h"
#include "Mess... |
#include "stdafx.h"
#include "RSCBImporter.h"
#include "RBoneHierarchy.h"
#include "RMesh.h"
bool RSCBImporter::Import(TString& Filename, RAnimationSequence*& AnimationSequence, RBoneHierarchy*& BoneHierarchy, RMesh*& Model) {
char* fn = Filename.Str;
TString NodeName;
TString ParentNodeName;
... |
#include "computationthread.h"
#include "VideoScanner.h"
#include "FaceRecognizer.h"
#include <QStringList>
//----------------------------------------------------------------------------//
ComputationThread::ComputationThread( VideoScanner *vs, FaceRecognizer *fr,
QObject *parent)
:... |
#include <iostream>
#include <queue>
using namespace std;
const int INF = ~(1 << 31);
struct Edge{
int w;
int to;
Edge(int w_ = 0, int to_ = 0):w(w_), to(to_){}
};
bool operator < (const Edge & a, const Edge & b){
return a.w > b.w;
}//priority_queue puts bigger elements on the top
Edge g[105][1... |
/**
* 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
*
* ... |
#include <iostream>
#include <gtest/gtest.h>
#include <Eigen/Core>
#include "../src_cpp/gtest_plus.hpp"
#include "../src_cpp/eigen_plus.hpp"
#include "erfc.hpp"
#include "r1_lc.hpp"
#include "r1basis.hpp"
using namespace std;
using namespace Eigen;
using namespace cbasis;
TEST(Erfc, real_erfc) {
using namespace e... |
#include "../Include/Triangle.h"
Triangle::Triangle()
{
}
bool Triangle::isGrabbed(int x, int y)
{
int centerX = startPosX + width / 2;
int centerY = startPosY - height / 2;
int absWidth = width > 0 ? width : -width;
int absHeight = height > 0 ? height : -height;
if (x < centerX + absWidth / 2 && x > centerX - ... |
#include <SDL.h>
#include <SDL_opengl.h>
#include <stdio.h>
#include <SDL_image.h>
#include "string"
#include <SDL_mixer.h>
#define BLOCOS 18 // QUANTIDADE
#define TIROS 18
//configuracoes
GLuint loadTexture(const std::string&fileName)
{
SDL_Surface *imagem = IMG_Load(fileName.c_str());//carrega imagem
SDL_D... |
//
// Created by 王润基 on 2017/4/15.
//
#ifndef INC_2RAYTRACE_RENDERER_H
#define INC_2RAYTRACE_RENDERER_H
#include <opencv2/opencv.hpp>
#include "../World/World.h"
#include "../Camera/Camera.h"
class Renderer {
public:
bool enable = false;
string name = "renderer";
bool enableRecolor = false;
bool enab... |
#include<iostream>
#include<stdlib.h>
#include<climits>
using namespace std;
class kstacks{
int *array;
int *top;
int *next;
int n,k;
int free;
public:
kstacks(int n1,int k1){
n=n1;
k=k1;
array=new int[n];
top=new int[k];
next=new int[n];
free=0;
for( int i=0;i<n-1;i++ ){
next[i]=i+1;
}next[n-1... |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/base/event.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(USE_X11)
#include <X11/Xlib.h>
#include "ui/base/x/x11_util.h"
... |
#pragma once
#include "cocos2d.h"
#include "Entity.h"
#include "Bullet.h"
#include <string>
#include <memory>
USING_NS_CC;
enum EnemyState
{
ENEMY_STAY,
ENEMY_WANDERING,
ENEMY_APPROACHING,
ENEMY_ASTAR_APPROACHING
};
class Enemy : public Entity
{
public:
bool init() override;
CREATE_FUNC(Enemy);
void SetHero... |
#include "GeoCommandCreateBoxComplex.h"
#include "geometry/geometrySet.h"
#include "geometry/geometryData.h"
#include <TopoDS_Shape.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <gp_Ax2.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrimAPI_MakeCone.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <... |
#pragma once
#include "application.h"
#if (SYSTEM_VERSION < SYSTEM_VERSION_v061)
#error This library requires FW version 0.6.1 and above.
#endif
/// LogHandler that writes logs to SdCard and then sends them to the cloud. Before using this class it's best to
/// familiarize yourself with Particle's loggin facility ht... |
#ifndef FASTCG_MOUSE_BUTTON_H
#define FASTCG_MOUSE_BUTTON_H
#include <cstdint>
namespace FastCG
{
enum class MouseButton : uint8_t
{
LEFT_BUTTON = 0,
MIDDLE_BUTTON,
RIGHT_BUTTON,
};
enum class MouseButtonState : uint8_t
{
PRESSED = 0,
RELEASED,
};
}
#endif |
#ifndef TREN_H
#define TREN_H
#include "Escenario.h"
#include<string>
using namespace std;
class Tren:public Escenario{
public:
Tren();
Tren(string);
void Carrito();
void Especial();
};
#endif
|
#pragma once
// Add BY WUSHENGYONG
// Date : 20180831
// DESCRIPTION :
// 20180831 First Add
#include <Windows.h>
#include <string>
#include <time.h>
///////////////////////////////////////////////////////////////////////////////////////////////////////////
/// 配置
#define LOG_SETTING_CONF_FILE... |
#include "mov-writer.h"
#include "mov-format.h"
#include "mpeg4-avc.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
extern "C" const struct mov_buffer_t* mov_file_buffer(void);
#define H264_NAL(v) (v & 0x1F)
enum { NAL_IDR = 5, NAL_SEI = 6, NAL_SPS = 7, NAL_PPS = 8 };
static uint8_t s_buffer[2 * 1024 ... |
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv) {
Mat image = imread("baboon2.jpg");
if (!image.data) {
cout << "read image e... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stack>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
if(n==0) break;
char x;
int p;
stack<int> s;
while(n--)
{
scanf(" %c",&x);
if(x=='P')
... |
#pragma once
#include"Window.h"
#include<GL\glew.h>
#include<GL\glut.h>
static PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL |
PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
16,
0, 0, 0, 0, 0, 0,
0,
0,
0,
0, 0, 0, 0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0
};
... |
vector<int> Solution::slidingMaximum(const vector<int> &A, int B) {
int n=A.size(),i;
multiset<int,greater<int>> st;
vector<int> ans;
for(i=0;i<n;i++)
{
if(i<B)
st.insert(A[i]);
else
{
ans.push_back(*st.begin());
st.erase(st.find(A[i-B]));
... |
/*NameTest.cpp
Name
copyright Vixac Ltd. All Rights Reserved
*/
#include "Name.h"
#include "NodeStore.h"
#include <gtest/gtest.h>
namespace VI = vixac;
namespace IN = VI::inout;
TEST(Name, aTest)
{
IN::NodeStore store;
IN::Name empty(&store);
EXPECT_EQ(empty.name(), "");
empty.setName("vic");... |
//
// Created by yulichao on 2020/6/29.
//
#define NDEBUG //用来控制assert是否有效 打开assert则无效,注释掉则assert有效,并且该宏的定义需要在include前
#include <string>
#include <iostream>
#include <cassert>
#include <array>
#include <numeric>
using namespace std;
//constexpr修饰的函数,是在编译期就能够确定的表达式 c++11中该函数能有含有一行语句, return语句。
constexpr int squar... |
#include "veritas.hpp"
#include "gitsha1.hpp"
#include "Settings.hpp"
Settings::Settings(const Input &grid, const Particles &particles, const Output &out) {
output = out;
int maxleft = 29, maxright = 25;
//Set input values to settings
dx = grid.dx;
dp = particles.dp;
maxDepth = grid.Lfinest - ... |
#include "AsciiMap.h"
#include "Graph.h"
#include "../helperFunctions.h"
#include "../perlin.h"
AsciiMap::AsciiMap()
{
initVars();
}
AsciiMap::AsciiMap( int rows, int cols )
{
initVars();
setSize( rows, cols ) ;
}
AsciiMap::AsciiMap( char ** inputMap, int rows, int cols )
{
// copy over the... |
#include <iostream>
using std::cout;
using std::endl;
struct ABC {
int a, b, c;
};
void ChangerValeurs(ABC* p, int valeur) {
p->a = valeur - 1;
p->b = valeur;
p->c = valeur + 1;
}
int main() {
ABC maStruct;
ChangerValeurs(&maStruct, 10);
cout << "Valeurs :";
cout << " a = " << maStruct.a;
cout << " b = "... |
#include <errno.h>
#include <string.h>
#include <malloc.h>
#include <log/log_system.h>
#include "dev/proximity_hal.h"
#include "dev/proximity_sensor.h"
#define LOG_TAG "PROX"
static int poll_proximity_sensor(proximity_sensor_device_t *dev, int precision) {
SLOGV("Polling proximity sensor");
if (!dev) {
... |
#include<stdio.h>
int main() {
int a = 100000;
while (a > 0) {
printf("%d ", a);
a = a - 1;
}
return 0;
}
|
// This file has been generated by Py++.
#ifndef FontEventArgs_hpp__pyplusplus_wrapper
#define FontEventArgs_hpp__pyplusplus_wrapper
void register_FontEventArgs_class();
#endif//FontEventArgs_hpp__pyplusplus_wrapper
|
#include "snippetcontroller.h"
SnippetController::SnippetController(LatexTextEditor * parentPtr):
QObject(), parent(parentPtr){
}
SnippetController::~SnippetController(){
}
Snippet::Snippet(){
}
Snippet::~Snippet(){
}
int Snippet::size(){
return endPos-startPos;
}
QString SnippetController::previousWor... |
#pragma once
#include "Ray.h"
#include "Material.h"
class GeoObject {
public:
virtual bool intersect(Ray ray, float &dist, ShadeRec &rec) const = 0;
};
|
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
int main(){
int n;
cin >> n;
string s[n];
for(int i = 0; i < n; i++){
cin >> s[i];
}
int len = s[0].size();
unordered_map<string,pair<int,int>> m;
for(int i = 0; i < (len); i++){
string curr = s[0].substr(i... |
#include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"Please enter a positive number:";
cin>>n;
cout<<"Enter " <<n<<" elements:";
int array[n];
for(i=0;i<n;i++)
cin>>array[i];
in... |
// Alg8_0725.cpp : Defines the entry point for the console application.
//Linear-Time prefix averages algorithm
#include <iostream>
using namespace std;
int main()
{
int count = 0, sum = 0;
int num[10000] = { 0 };
double avg[10000] = { 0 };
cout << "Total number : " << endl;
cin >> count;
for... |
#include "kth_cprog_simple_container.hpp"
UIntVector::UIntVector()
{
size_ = 0;
data_ = nullptr;
}
UIntVector::UIntVector(const std::size_t size)
{
// ** Allocate space
data_ = new unsigned int[size];
size_ = size;
// ** Initialize elements to zero
for(std::size_t i = 0; i < size_; i++)
... |
/*
==============================================================================
OnsetDetection.cpp
Created: 25 Apr 2018 5:05:45pm
Author: Hanyu Liu
==============================================================================
*/
#include "OnsetDetection.h"
#include <math.h>
#include ".... |
#include<bits/stdc++.h>
using namespace std;
double x1=(double)1/2,x2=-(double)1/2,x3=-(double)1/2;
void jacobi( )
{
double a=x1,b=x2,c=x3;
x1=(double)1/4*(2-b-c);
x2=(double)1/5*(-6-2*c-a);
x3=(double)1/3*(-4-2*b-a);
cout<<x1<<" " <<x2<<" " <<x3<<" "<<endl;
}
int main()
{
for(int i=0;i<50;i++)
... |
// github.com/andy489
// https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree/problem
int height(Node *root) {
if (root == nullptr)
return -1;
else {
int leftHeight = height(root->left);
int rightHeight = height(root->right);
return (leftHeight > rightHeight ? lef... |
#include "wndControl.h"
#include <string>
#include <commdlg.h>
#include <fstream>
#include <vector>
using namespace std;
extern HINSTANCE hInst;
void SetClientSize(HWND hWnd, int nDestClientWidth, int nDestClientHeight)
{
::SetWindowPos(hWnd, NULL, 0, 0, nDestClientWidth, nDestClientHeight, SWP_NOMOVE);
RECT stWin... |
#ifndef MC68328_H
#define MC68328_H
#define SCR 0xfffff000
#define PCR 0xfffff003
#define IDR 0xfffff004
#define IODCR 0xfffff008
#define CSGBA 0xfffff100
#define CSGBB 0xfffff102
#define CSGBC 0xfffff104
#define CSGBD 0xfffff106
#define CSUGBA 0xfffff108
#define CSCTRL1 0xfffff10a
#define ... |
/*
* Copyright 2016-2017 Flatiron Institute, Simons 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 ... |
#include "entities.hpp"
#include "component_instance.hpp"
static PyObject* SkpComponentDefinition_getentities(SkpComponentDefinition *self, void *closure) {
SKP_GET_SINGLE_ELEMENT(
SkpEntities,
SkpEntitiesType,
SUComponentDefinitionGetEntities,
_su_def,
_su_entities,
"cannot get entities"
)... |
#include <bits/stdc++.h>
using namespace std;
int check(char prev, char prev_prev){
int val = prev - '0' + 10*(prev_prev - '0');
// cout << val << endl;
if(val <= 26 && val >= 1){
return true;
}
return false;
}
long long solve(string s, int n){
vector<long long>dp(n+1);
dp[0] = 1;... |
#pragma once
//----------------------------------------------------------------------------------------
// Copyright © 2004 - 2018 Tangible Software Solutions, Inc.
// This class can be used by anyone provided that the copyright notice remains intact.
//
// This class is used to perform bankers' rounding in nat... |
#pragma once
#include "ofMain.h"
#include "ofxTimedInterpolation.h"
#include "ofxGui.h"
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void mousePressed(int x, int y, int button);
void start();
void overBang();
void setTime(int &time);
//Inte... |
//
// Created by Tidesun on 2019-04-25.
//
#include "traverse_algorithm.hpp"
vector<int> TraverseAlgorithm::calculateCandidateArmLens(Vertex candidate,vector<Vertex> BFBPath, vector<int> lastArmLens){
vector<int> candidateArmLens(1,0);
// indicate whether a palindrome suffix is found if add candidate
int l... |
// Filename: dnaData.h
// Created by: shochet (24May00)
//
////////////////////////////////////////////////////////////////////
#ifndef DNADATA_H
#define DNADATA_H
#include "toontownbase.h"
#include "typedReferenceCount.h"
#include "filename.h"
#include "coordinateSystem.h"
#include "pnotify.h"
#include "dSearchPat... |
#include "StdAfx.h"
#include "BLight.h"
#include "RShaderClasses.h"
BLight::BLight(void) {
}
BLight::~BLight(void) {
}
void BLight::ConfigureShader(RShader* Shader) {
float Radius = 200.0f;
TVector3 Position(0.0f, 0.0f, 0.0f);
float Power = 2.0f;
Shader->SetShaderConstantF("LightRadius", &Radius);
... |
/*
* Copyright (C) 2012 Arthur O'Dwyer
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publ... |
#include "ChromaticNumber_AtMost.h"
extern "C" {
std::map<std::string, std::string> *metadata() {
return new std::map(ChromaticNumber_AtMost_Core::metadata());
}
DynamicCore *create(const parameterType ¶meters) {
return new ChromaticNumber_AtMost_Core(parameters);
}
}
|
#include <bits/stdc++.h>
using namespace std;
void print(char a[][3])
{
cout<<a[0][0]<<"\t|"<<a[0][1]<<"\t|"<<a[0][2]<<"\n";
cout<<a[1][0]<<"\t|"<<a[1][1]<<"\t|"<<a[1][2]<<"\n";
cout<<a[2][0]<<"\t|"<<a[2][1]<<"\t|"<<a[2][2]<<"\n";
}
void insert(char t,char h,char a[][3])
{
for(int i=0;i<3;i++)
for(int ... |
// queue with array
// _ ____ __ _ _ __
// (_/_(_(_(_)(__ / (_(_/_(_(_(_/__(/_/ (_
// /( .-/ .-/
// (_) (_/ (_/
#include "../_library_queue_.h"
// ------------ Queue ------------ //
// Initialize
struct Queue
{
Data *arrQueue;
Index... |
#include <testbench.h>
#include "Valu.h"
class AluTest : public Testbench<Valu> {
protected:
void ResetState() {
dut->a_in = 0;
dut->b_in = 0;
dut->decimal_enable = 0;
dut->carry_in = 0;
dut->sum_en = 0;
dut->and_en = 0;
dut->eor_en = 0;
dut->or_en = 0;
dut->shift_en = 0;
}
void Te... |
#include "DepthProfileVizualizer.hpp"
#include <iostream>
DepthProfileVizualizer::DepthProfileVizualizer(QCustomPlot* custom_plot, QCustomPlot* custom_plot2, QWidget* parent)
: DepthProfileVizualizerProxy(parent),
custom_plot_(custom_plot),
custom_plot2_(custom_plot2),
transport_data_(200),
t... |
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2013 The Bitcoin developers
// Copyright (c) 2013+ The Coin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparams.h"
#include "assert.h... |
#ifndef QTDSP_H
#define QTDSP_H
#include <winsock2.h> // no redefinition errors result if before Qt includes
#include <qsocketdevice.h>
#include <qsocketnotifier.h>
#include <qevent.h>
#include <qtextedit.h> // ?why needed here?
#include "QtDSPBase.h"
#include "../include/CP2.h" // CP2-wide Definition... |
int Led = 13; // define LED pin
int buttonpin = 3; // define photo interrupter signal pin
int val; //define a numeric variable
void setup()
{
pinMode(Led, OUTPUT); // LED pin as output
pinMode(buttonpin, INPUT); //photo interrupter pin as input
}
void loop()
{
val = digitalRead(buttonpin); //read the value of t... |
#include<bits/stdc++.h>
using namespace std;
// time O(n) and space O(n)
int solve(vector<int>& arr,int n,int k)
{
if(n==0 || n==1)
{
return 0;
}
int count = 0;
unordered_map<int,int> hash;
for(int i=0;i<n;i++)
{
hash[arr[i]]+=1;
}
unordered_map<int,int> :: iterator it;
for(auto it=hash.begin();it!=hash.... |
#include<iostream>
#include<cstdlib>
#include<ctime>
#include<limits.h>
using namespace std;
int random(int min,int max){
if(min==max) return min;
return rand()%(max-min+1) + min;
}
template<class T>
bool buscar(T *vector,int n, int dato){
for(int i=0;i<n;i++){
if(vector[i]==dato){
return true;
}
... |
#ifndef UISCANNERSETTINGS_H
#define UISCANNERSETTINGS_H
//
#include <QDialog>
#include "ui_scanner_settings.h"
//
class VideoScanner;
class UIScannerSettings : public QDialog, public Ui::scannerDialog
{
Q_OBJECT
public:
UIScannerSettings( VideoScanner *vi,
QWidget * parent = 0, Qt::WFlags f = 0 );... |
#ifndef _EXAMPLE_NODE_H
#define _EXAMPLE_NODE_H
#include <iostream>
using namespace std;
void example_node();
#endif
|
/***********************************************************************
created: 15th August 2015
author: Lukas Meindl
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2015 Pa... |
#include <stdlib.h>
#include<iostream>
#include<fstream>
#include <windows.h>
#include <mmsystem.h>
#include"opencv/cv.h"
#include"opencv/highgui.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "XnCppWrapper.h"
#include <SFML/Audio.hpp>
usi... |
/*
* vector 6932ms
* list 9068ms
*/
#include<stdio.h>
#include<list>
#include<vector>
using namespace std;
using pii = pair<int, int>;
const int LM = 4003;
const int SIZE = 1 << 24;
//vector<pii> htab[SIZE];
list<pii> htab[SIZE];
int A[LM], B[LM], C[LM], D[LM];
int probing(int key, bool ins = 1) {
int hidx = (uns... |
#include "stdafx.h"
#include "FilterDlg.inl"
#include "MonpacDlg.inl"
#include "QuickFilter.inl"
#include "StagesDlg.inl"
#include "aboutdlg.inl"
#include "CreateDlg.inl"
#include "NagDlg.inl"
#include "PropertyDlg.inl"
#include "registrationDlg.inl"
#include "SettingsDlg.inl"
namespace Dialogs
{
void Monpac()
{
... |
/*
* ConvTemp.cpp
*
* Created on: 25 de fev de 2018
* Author: kryptonian
*
* Este c�digo é baseado no exercicio da Aula 14 do curso de Python3, Mundo 1
*
* Conversor de Temperatura
*
*/
#include <iostream>
#include <clocale>
using namespace std;
int main(){
setlocale(LC_ALL, ""... |
/**
* @file TCPServer.cpp
* Implements the TCPServer class.
* @date Jan 21, 2014
* @author: Alper Sinan Akyurek
*/
#include "TCPServer.h"
TCPServer::TCPServer( void )
{
}
TCPServer::~TCPServer( void )
{
}
void
TCPServer::SetAddress( IPAddress& address )
{
if ( -1 == bind( this->m_socketId, ( struct socka... |
/*
*****************************************************************************
* ___ _ _ _ _
* / _ \ __ _| |_| |__(_) |_ ___
* | (_) / _` | / / '_ \ | _(_-<
* \___/\__,_|_\_\_.__/_|\__/__/
* Copyright ... |
class Solution {
public:
vector<string> summaryRanges(vector<int>& nums) {
vector<string> result;
if(nums.size() == 0) return result;
int start = nums[0];
for(int i = 1; i < nums.size(); i++)
{
if(nums[i]!=1 + nums[i-1])
{
if(nums[i-1] ... |
#include "Level3Button.h"
#include "View.h"
Level3Button::Level3Button(QGraphicsScene *Scene) : level3Scene{Scene}
{
clickl3 = false;
//set picture
setPixmap(QPixmap(":/images/level3.png"));
//add to scene
Scene->addItem(this);
//setPos
setPos(539,476);
//create level2 button music... |
#include <iostream>
#include <algorithm>
// #include <vector>
#include <list>
using namespace std;
int main()
{
string n;
string search_value;
list<string> sv;
int cnt;
cin >> search_value;
while (cin >> n) {
sv.push_back(n);
}
cnt = count(sv.begin(), sv.end(), search_value);
cout << cnt << endl;... |
//
// SMImageEditorItemThumbView.h
// iPet
//
// Created by KimSteve on 2017. 5. 22..
// Copyright © 2017년 KimSteve. All rights reserved.
//
#ifndef SMImageEditorItemThumbView_h
#define SMImageEditorItemThumbView_h
#include "../../SMFrameWork/Base/SMImageView.h"
#include <functional>
class LoadingSprite;
class S... |
#include "iLockable.h"
#include "iThread.h"
#include "core/log/iLogger.h"
#include <unistd.h>
#include <signal.h>
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
namespace Comm
{
uint32 Thread::ms_sleep_secs = Thread::SLEEP_SECS;
Thread::Thread ()
: m_pthread (0), m_pthread_attr ()
{
m_tid = 0;
... |
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include <iomanip>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.