text stringlengths 8 6.88M |
|---|
//====================================================================================
// @Title: DIALOGUE BOX
//------------------------------------------------------------------------------------
// @Location: /prolix/interface/include/cmpDialogueBox.cpp
// @Author: Kevin Chen
// @Rights: Copyrigh... |
//====================================================================================
// @Title: PROLIX ENGINE
//------------------------------------------------------------------------------------
// @Location: /prolix/engine/include/PrlxEngine.h
// @Author: Kevin Chen
// @Rights: Copyright(c) 201... |
#include<bits/stdc++.h>
using namespace std;
struct tree{
int l,r,tag,sum;
};
struct ope{
int l,r;
};
tree tr[600000];
ope o[300000];
int ans[300000],n,m;
void readit(){
scanf("%d%d",&n,&m);
for (int i=1;i<=m;i++)
scanf("%d%d",&o[i].l,&o[i].r);
}
void writeit(){
for (int i=1;i<=m;i++)
printf(... |
#include "RandomWalkModel.hpp"
void RandomWalkModel::move(Human & h)
{
h.getPos();
}
|
/********************
*-=baseobject.hpp=-*
********************
Auteur : My?terious
Description : Contient la base pour créer un objet.
*/
#ifndef HEADER_SCENE_BASEOBJECT
#define HEADER_SCENE_BASEOBJECT
//-=Inclusion des headers=-//
#include <irrlicht.h>
#include "core/basemodule.hpp"
//-=Fin de la s... |
// Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.
// Example 1:
// Input: nums = [-4,-1,0,3,10]
// Output: [0,1,9,16,100]
// Explanation: After squaring, the array becomes [16,1,0,9,100].
// After sorting, it becomes [0,1,9,... |
#include "rvstereocamera.h"
#include "math.h"
RVStereoCamera::RVStereoCamera(float eyeDistance, float focalDistance, int cameraType):
RVCamera(), m_eyeDistance(eyeDistance), m_focalDistance(focalDistance), m_cameraType(cameraType)
{
}
float RVStereoCamera::eyeDistance() const
{
return m_eyeDistance;
}
void ... |
#ifndef VISUAL_ELEMENT_H
#define VISUAL_ELEMENT_H
#include <SDL2/SDL.h>
#include <memory>
#include "../Geometry.h"
#include "PhysicsElement.h"
using namespace std;
class VisualElement: public PhysicsElement
{
public:
VisualElement(SDL_Texture* tex, const Rectangle& rect);
virtual ~VisualElement();
void draw(... |
#pragma once
#include "Turret.h"
class TurretSkinnedMesh : public hg::IComponent
{
DECLARE_COMPONENT_TYPEID
public:
TurretSkinnedMesh();
hg::IComponent* MakeCopyDerived() const;
void Start();
void Update();
void OnMessage(hg::Message* msg);
private:
hg::Transform* GetMuzzle() const;
bool CanSeePlayer(hg... |
#include<bits/stdc++.h>
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define INF ((1LL<<62)-(1LL<<31)) /*オーバーフローしない程度に大きい数*/
#define MOD 1000000007
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using pint = pair<int,int>;
const double PI = 3.14159265358979323846;
... |
//
// KObject.cpp <Keepi>
//
// Made by Julien Fortin
// contact <julien.fortin.it@gmail.com>
//
#include "DEBUG.h"
#include "KObject.hpp"
#include "KTypeException.hpp"
KObject::KObject(long long int integer)
{
this->__init();
this->__integer = new KInteger(integer);
}
KObject::KObject(double real)
{
this->__in... |
//===========================================================================
/*
This file is part of the CHAI 3D visualization and haptics libraries.
Copyright (C) 2003-2004 by CHAI 3D. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the terms o... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 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"
#include "modules/hardcore/component/Messag... |
#ifndef RUNE_H
#define RUNE_H
class Rune
{
int index;
int value;
SDL_Rect movingPosition;
float targetPosX;
float targetPosY;
int steps;
};
#endif |
/*
* 题目:全排列
* 链接:https://leetcode-cn.com/problems/permutations/
*/
class Solution {
public:
void dfs(vector<vector<int>> &ans, vector<int> &nums, vector<int> &temp, int n) {
if (nums.size() == n) {
ans.push_back(temp);
return;
}
for (int i = 0; i < nums.size(); i++... |
class Path{
public:
int start_x;
int start_y;
int dist;
string s;
Path(int a, int b, int c, string str): start_x(a), start_y(b), dist(c), s(str){}
bool operator < (const Path& p) const{
if(dist == p.dist){
return s > p.s;
}
return dist > p.dist;
}
};
class... |
/*
* 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"Display.h"
#include "iostream"
void Display::Create(ContextAttr attr)
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, attr.major);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, attr.minor);
if (attr.bProfileCore)
{
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
}
mWindow = glfwCr... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** 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"
#ifdef ACCESSIBILITY_EXTENSION_SUPPORT
... |
#pragma once
namespace NDT {
namespace internal {
template <typename T, int D>
struct IndexList {
T head;
IndexList<T, D - 1> tail;
template <typename Derived>
inline __NDT_CUDA_HD_PREFIX__ IndexList(const Eigen::MatrixBase <Derived> & indices)
: head(indices(0)), tail(indices.template t... |
/* -*- 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.
*/
#ifndef GADGET_REMOTE_DEBUG_HANDLER_H
#define GADGET_REMOTE_DEBU... |
/****************************************
@_@
Cat Got Bored *_*
#_#
*****************************************/
#include <bits/stdc++.h>
#define loop(i,s,e) for(int i = s;i<=e;i++) //including end point
#define pb(a) push_back(a)
#define sqr(x) ((x)*(x))
#define CIN ios_base::sync_with_stdio(0); cin.tie(0);
#de... |
// Copyright 2020 Fuji-Iot authors. 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
//
// Unless required by appli... |
#include "drone_esc.h"
int DroneESC::intensity_to_servo(double intensity) {
int temp_min = 0, temp_max = 10000;
int temp, ret;
temp = ((int) round(intensity * (temp_max - temp_min))) + temp_min;
ret = map(temp, temp_min, temp_max, SERVO_OUTPUT_MIN, SERVO_OUTPUT_MAX);
return ret;
}
void DroneESC::apply_inte... |
#include "shape.h"
#include <iostream>
using namespace std;
Shape::Shape(string new_name, string new_colour){
////cout << "Creating shape object for part 1." << endl;
////cout << "\tSetting shape object name to be: Shape." << endl;
////cout << "\tSetting shape object colour to be: Green." << endl;
nam... |
#include "Help.h"
#include <fstream>
#include "PointLocator.h"
namespace help
{
void printStartCount(const std::vector<dax::Id>& pointStarts,
const std::vector<int>& pointCounts,
std::iostream& stream)
{
stream << std::setw(10) << "Pt Start: ";
for (unsigned int i =... |
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <reactor/net/PollPoller.h>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <algorithm>
#include <reactor/net/Channel.h>
namespace reactor {
namespace net {
PollPoller::PollPoller():
Poller(),
channels_(),
pollfds_()
{
}
PollPoller::~Pol... |
#include "SyntaxTree.h"
SyntaxTree::SyntaxTree()
{
head = int(nodes.size()-1);
}
SyntaxTree::~SyntaxTree()
{
}
int SyntaxTree::addNode(treeNode& t) {
nodes.push_back(t);
head = nodes.size() - 1; // 默认指向最后一个位置,适用于递归建树
return head; // 返回指向刚刚加入的node的 位置,方便建树
}
void SyntaxTree::outputTreeAsFile(ofstr... |
#include "WindowComparison.hh"
#include "str.hh"
WindowComparison::WindowComparison(PG_Widget *parent,
const std::string &reference,
const std::string &hypothesis)
: WindowChild(parent, "Comparison results", 300, 530, true, true, "OK"),
m_ref... |
#ifndef BUTTONS_H
#define BUTTONS_H
#include <QWidget>
#include <QMouseEvent>
#include <QTime>
#include <QPainter>
#include <string>
class Buttons
{
public:
Buttons(int X=0, int Y=0, int wi=0, int he=0, QString = "");
bool isClicked(QMouseEvent *e);
bool isHovering(QMouseEvent *e);
QColor getColo... |
#ifndef GNLISTMANAGER_H
#define GNLISTMANAGER_H
#include "GnList.h"
template<class TListType, class TListSmartPointer>
class GnListManager : public GnSmartObject
{
protected:
GnList<TListSmartPointer> mList;
typedef GnListIterator<TListSmartPointer> ElementIterator;
typedef TListType ElementType;
public:
GnListM... |
// -*- LSST-C++ -*-
/*
* LSST Data Management System
* Copyright 2015 AURA/LSST.
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published... |
#pragma once
#include "bricks/threading/mutex.h"
namespace Bricks { namespace Threading {
class Condition : public Mutex
{
protected:
void* conditionHandle;
public:
Condition();
~Condition();
void Wait();
bool Wait(const Timespan& timeout) { return Wait(Time::GetCurrentTime() + timeout); }
bool Wait... |
#ifndef TASK_H
#define TASK_H
namespace tsk { namsespace task {
enum task_state {
TASK_CREATED,
TASK_WAITING,
TASK_STARTED,
TASK_COMPLETED
};
typedef error_code int;
class base_task {
protected :
task_state state;
error_code err;
public :
base_task():state(task_state::TASK_CR... |
#ifndef __STDX_TTYCOLOR_H
#define __STDX_TTYCOLOR_H
// Posix header files
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
// C 89 header files
#include <assert.h>
#include <errno.h>
// C++ 98 header files
#include <string>
#include <sstream>
#include <iomanip>
namespace stdx {
const char* const _... |
#include "ServerSocket.hpp"
namespace net
{
ServerSocket::ServerSocket(int port, bool ipv4)
{
m_socket = socket(ipv4 ? AF_INET : AF_INET6, SOCK_STREAM, IPPROTO_TCP);
if(m_socket == -1)
throw Exception(__PRETTY_FUNCTION__, "Failed to create a socket, error: " + std::string(strerror(... |
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
// Complete the formingMagicSquare function below.
int formingMagicSquare(vector<vector<int>> s) {
int cost = 46, costTmp = 0;
int i, j, k, l;
vector<vector<int>> matRotate = {
{4, 3, 8, 9, 5, 1, 2, 7, 6},
{6, 7, 2, 1, 5, 9, 8, 3, 4},
... |
#include <iostream>
#ifndef TABLERO_H
#define TABLERO_H
class Tablero{
private:
char** matriz;
public:
Tablero();
void crearMatriz();
void imprimirMatriz();
void llenarMatriz();
bool validarPosicionMas(int,int);
bool validarPosicionNumeral(int,int);
bool val... |
//
// GActionDamage.h
// Core
//
// Created by Max Yoon on 11. 7. 13..
// Copyright 2011년 __MyCompanyName__. All rights reserved.
//
#ifndef __Core__GActionDamage__
#define __Core__GActionDamage__
#include "GAction.h"
#include "GAttackDamageInfo.h"
class GnIProgressBar;
class GActionDamage : publi... |
#include <stdio.h>
#include <stdlib.h>
#define MAX 50
void printArray(int arr[], int size) {
int i;
for (i=0; i<size; i++) {
printf("%d ", arr[i]);
}
printf("\n");
}
void merge(int arr[], int begin, int mid, int end) {
int temp[MAX];
int i, j, itemp;
i = begin;
j = mid + 1;
itemp = begin;
while ((i<=... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/StaticMeshComponent.h"
#include "TankTrack.generated.h"
/**
* Tank Track allows movement of the tank
*/
UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
clas... |
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... |
#include "predict_update.h"
#include "particle.h"
#include "compute_steering.h"
#include "predict_true.h"
#include "add_control_noise.h"
#include "predict.h"
#include "configfile.h"
#include "pi_to_pi.h"
#include "trigonometry.h"
#include <math.h>
#include "tscheb_sine.h"
#include "linalg.h"
void predict_update(d... |
//
// chat_client.cpp
// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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 <cstdlib>
#include <deque>
#... |
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <shader.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/string_cast.hpp>
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
//设置窗口大小
const unsign... |
#include "StringHelpers.h"
namespace IRCOptotron
{
namespace MiscStringHelpers
{
// trim from start
std::string <rim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
return s;
}
// trim from end
std::string &rtrim(std::strin... |
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define rep(i, a, b) for(int i=int(a);i<int(b);i++)
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define MAX 100010
using namespace std;
typedef vector<int> vi;
typedef long long int lld;
... |
//
// Created by jerry on 2/17/2021.
//
#ifndef COMP345_WINTER2021_MAPLOADERMAIN_H
#define COMP345_WINTER2021_MAPLOADERMAIN_H
namespace mapLoader{
int main();
}
#endif //COMP345_WINTER2021_MAPLOADERMAIN_H
|
#pragma once
namespace ecs { struct Ent; }
struct Rect;
ecs::Ent* make_workroom(const Rect&);
|
/*******************************************************************************
Copyright (c) 2010, Steve Lesser
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1) Redistributions of source code must retain the above c... |
/*
* Context.h
*
* Created on: Jun 11, 2017
* Author: root
*/
#ifndef NETWORK_CONTEXT_H_
#define NETWORK_CONTEXT_H_
#include <vector>
#include "NetWorkConfig.h"
#include "../Thread/Task.h"
#include "../Memory/MemAllocator.h"
using namespace std;
namespace CommBaseOut
{
class Message_Service_Handler;
cla... |
#ifndef BOSS_H
#define BOSS_H
class Boss {
private:
byte x, y;
byte w, h;
byte cx;
bool alive;
byte timerPriv;
byte framePriv;
bool moveEnd;
byte wait;
bool muki;
void appearance();
void attack();
public:
bool getMoveEnd() const { return moveEnd; }
bool getalive() const { return alive; }... |
#pragma once
#include "EverydayTools/Bitset/EnumBitset.h"
namespace keng::graphics
{
enum class DeviceBufferBindFlags
{
None = 0,
VertexBuffer = (1 << 0),
IndexBuffer = (1 << 1),
ConstantBuffer = (1 << 2),
ShaderResource = (1 << 3),
RenderTarget = (1 << 5),
... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, j=0, k=0;
cin>>n;
int a[n];
int odd[n], even[n];
for(i=0; i<n; i++)
{
cin>>a[i];
if(a[i]%2==0)
{
even[j] = a[i];
j++;
}
else
{
odd[k] = a[i];
... |
#pragma once
#include "net/conn.hpp"
#include "net/client.hpp"
#include "net/stream.hpp"
#include "proto/ss_base.pb.h"
#include "proto/data_yunying.pb.h"
#include <memory>
#include <boost/core/noncopyable.hpp>
#include "proto/processor.hpp"
#include "utils/server_process_base.hpp"
using namespace std;
namespace ps = ... |
#pragma once
#include "Vector4.h"
#include "BasicLogicDefinitions.h"
class AvatarModel
{
public:
typedef struct {
float left,top,
right,bottom;
} Rect;
enum AvatarState {
AVATAR_STATE_IDLE,
AVATAR_STATE_MOVE_UP,
AVATAR_STATE_MOVE_DOWN,
AVATAR_STATE_MOVE_RIGHT,
AVATAR_STATE_MOVE_LEFT,
AVATAR_STATE_... |
//
// rvHeapArena.h - Heap arena object that manages a set of heaps
// Date: 12/13/04
// Created by: Dwight Luetscher
//
#ifndef __RV_HEAP_ARENA_H__
#define __RV_HEAP_ARENA_H__
class rvHeap;
// Define some limits used by a heap arena
static const int maxNumHeapsPerArena = 16; // maximum number of heaps that can be... |
//renderworld.hpp
//Contains quasi-real world objects needed for rendering
//Created by Lewis Hosie
//17-11-11
//This class is a little tricky to define, but I'll basically leave it at "it contains lights,
// occluders, particles and other things that have a graphical manifestation in the world but
// do not interact ... |
// FairMOT.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "tracker.h"
void draw_tracks(cv::Mat&img, std::vector<std::shared_ptr<STrack>>& tracks)
{
for (auto& tr:tracks)
{
cv::Rect_<float> loc = tr->to_tlwh_rect();
int color_idx = (tr->trac... |
#include <GL/glew.h>
#include <GL/glut.h>
#include <cuda_runtime_api.h>
#include <cuda_gl_interop.h>
#include <vector_types.h>
#include <vector_functions.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <AntTweakBar.h>
#include "utils.h"
#include "cutil_math.h"... |
#include "mainwindow.h"
#include "./ui_mainwindow.h"
#include <QApplication>
#include <QLabel>
#include <QScreen>
#include <QFileDialog>
#include <QMenuBar>
#include <QStatusBar>
#include <QDebug>
#include <QToolBar>
#include <QHBoxLayout>
#include <QStandardPaths>
#include <QMimeDatabase>
// following... |
//mnozenie_tablicy.hh
#ifndef TABX2_HH
#define TABX2_HH
/*!
* \file
* \brief Definicja klasy Tabx2
*
* Klasa Tabx2 jest klasa pochodna od klasy Program.
* Definiuje metode podawajajaca kazda liczbe znajdujaca sie w tablicy danych
* wskazywanej przez zmienna tab klasy Program.
*/
#include <iostream>
#include "... |
#include <cstdlib>
#include <Windows.h>
#include <pthread.h>
#include <semaphore.h>
#include "SaleItem.h"
//Function Prototypes
void *ProducerFunction (void *);
void *ConsumerFunction (void *);
void DisplayLocalConsumerData();
void DisplayGlobalStatistics();
//Shared Values
const int NUM_ITEMS=100; //This can act... |
// Copyright 2020 Fuji-Iot authors. 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
//
// Unless required by appli... |
#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 seven_ans = 56;
struct point {
int t,step,la;
};
bool vis[20001000... |
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/ml/ml.hpp>
#include <opencv2/opencv.hpp>
using namespace cv;
#include <algorithm>
#include <errno.h>
#include <fcntl.h> /* File control definitions */
#include <iostream>
#include <math.h>
#... |
#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<list>
#include<rapidxml.hpp>
#include<rapidxml_print.hpp>
bool openXML(std::string path, rapidxml::xml_document<> &xml);
std::string openHTML(std::string path);
std::string get_resources(rapidxml::xml_document<> &xml);
std::str... |
// BloomFilter.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
/*
http://blog.michaelschmatz.com/2016/04/11/how-to-write-a-bloom-filter-cpp/
Data structures which can efficiently determine whether an
element is possible a member of a set or definitely not a
member of a set. Two ... |
#pragma once
namespace func_math
{
// 범위제한
template <typename type>
static type Clamp(type src, type min, type max)
{
if (min > max)
swap(min, max);
if (min > src)
return min;
if (max < src)
return max;
return src;
}
}
namespace func_dir
{
static bool CheckDirectory(wstring path)
{
DWORD ... |
//
// Created by YCJ on 2020/7/6.
//
#ifndef COMPLIER_GRAMMARACTION_H
#define COMPLIER_GRAMMARACTION_H
#include "..\type\quatName.h"
#include "..\XTable\FunSheet.h"
#include <bits/stdc++.h>
using namespace std;
//语义动作,纯函数接口
//四元式的格式(operator,object,object,object)
//空:_
static const string fileAddr=R"(..\Files\quat.t... |
#ifndef _CBankFindPasswd_h_
#define _CBankFindPasswd_h_
#include "CHttpRequestHandler.h"
class CBankFindPasswd : public CHttpRequestHandler
{
public:
CBankFindPasswd(){}
~CBankFindPasswd(){}
virtual int do_request(const Json::Value& root, char *client_ip, HttpResult& out);
private:
int getCacheIdCod... |
#pragma once
class BossComp : public hg::IComponent
{
public:
void Start();
virtual int GetTypeID() const override { return s_TypeID; }
void LoadFromXML(tinyxml2::XMLElement* data) {}
virtual hg::IComponent* MakeCopyDerived() const { return hg::IComponent::Create(SID(BossComp)); }
static uint32_t s_TypeID;
void... |
// Calculate level crossings for the hermitian index staggered operator.
// Uses inverse power iterations to get the eigenvalues of the operator squared,
// then figure out if the proper eigenvalue is +/- sqrt(eigen).
#include <iostream>
#include <iomanip> // to set output precision.
#include <cmath>
#include <string>... |
// addrspace.cc
// Routines to manage address spaces (executing user programs).
//
// In order to run a user program, you must:
//
// 1. link with the -N -T 0 option
// 2. run coff2noff to convert the object file to Nachos format
// (Nachos object code format is essentially just a simpler
// version of the UNIX exe... |
#include <iostream>
#include <vector>
using namespace std;
/* → → → → → → → → → → → → → → → → → → → → → → → → → → → →
→ → → → → → → → → → → → → → → → → → → → → → → → → → → → */
#define int long long int
#define ld long double
#define F first
#define S second
#define P pair<int,int>
#define pb push_back
#define endl ... |
#include "Window.h"
Window::Window()
{
WinMain(SW_SHOWNORMAL);
}
BOOL CALLBACK Window::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_COMMAND:
switch (HIWORD(wParam))
{
case BN_CLICKED:
switch (LOWORD(wParam))
{
case (IDOK):
{
HWND g_han... |
#pragma once
#include<vector>
#include<set>
#include<memory>
#include <map>
#include <cgraph.h>
class Transition;
class PredicateVehicle;
/**
* A Situation consists of Objects and all outgoing Transitions.
*/
class Situation {
public:
/**
* Constructs a Situation object with the given VUT and PredicateVehicles and... |
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ONLY_PNG
#include "stb_image.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
GLuint LoadTexture(const char *file)
{
int x, y, n;
unsigned char *image = stbi_load(file, &x, &y, &n, 0);
if (image == nullptr)
{
LOG_ERROR("Faile... |
#pragma once
#include "stdafx.h"
#include "DataTypes\vec.h"
#include <map>
#include "skeleton.h"
#include "boneAbstract.h"
#include "octreeSolid.h"
#include "bvhVoxel.h"
#include "cutSurfTreeMngr2.h"
#include "boneTransform.h"
//#include "coordAssignManager.h"
extern class coordAssignManager;
enum errorCompareFlag
{
... |
#ifndef SIMULATION_H_INCLUDED
#define SIMULATION_H_INCLUDED
#include <string>
#include <vector>
#include <iostream>
#include "Grid.h"
#include "utilities.h"
#include <cmath>
#include "Resample.h"
#include "Classify.h"
#include <sstream>
class GOSIM {
public:
std::vector<Grid *> Reals; // a vector of realizatio... |
// Name: Zehua Liu
// ID: 001086969
/* When testing the wrong input detection,
re-enter the current name and score and DON'T re-enter the WHOLE form */
#include<iostream>
using namespace std;
void insert(int A[], string B[], int n) // Define the insertion sort function
{
for (int j = 1; j < n; j++)
{
/* Name... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
//基本思想:数学
int overlap_area = 0;
int x1, y1, x2, y2;
//计算重叠部分的左下角(x1, y1)和右上角(x2, y2)
x1 = max(A, E);
y1 = max(B, F);
x2 = min(C, ... |
#include "buffer.h"
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "error.h"
namespace {
GLenum toGl(Buffer::Type type)
{
switch (type) {
case Buffer::Type::ARRAY:
return GL_ARRAY_BUFFER;
case Buffer::Type::COPY_READ:
return GL_COPY_READ_BUFFER;
case Buffer::Type::COPY_WRITE:
return G... |
#ifndef WALI_UTIL_CONFIGURATION_VAR_HPP
#define WALI_UTIL_CONFIGURATION_VAR_HPP
#include <iostream>
#include <cstdlib>
#include <string>
#include <map>
#include <boost/any.hpp>
namespace wali
{
namespace util
{
template<typename BackingType>
class ConfigurationVar
{
std::map<std... |
/* -*- 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.
*
* @author Manuela Hutter (manuelah)
*/
#ifndef FEATURE_CONTROLLE... |
#include "btb.h"
#define MAX_TCM_BUNDLE 16
// A TCM entry
typedef
struct {
// Metadata for hit/miss determination and replacement.
bool valid;
uint64_t tag;
uint64_t lru;
uint64_t br_flags;
uint64_t br_mask;
uint64_t ends_in_br;
// Payload.
uint64_t tcm_bundle_length; //length of the trac... |
//
// Created by seafood on 2020-09-28
//
#ifndef _STATE_CLASSIFYING_TARGET_H_
#define _STATE_CLASSIFYING_TARGET_H_
#include "ArmorBox.h"
#include "GetFeature.h"
class StateClassifyingTarget{
public:
ArmorBox run(cv::Mat &g_srcImage,cv::Mat &g_processImage, armorBoxes armorboxes); //运行函数
private:
ArmorBo... |
//
// Created by wind on 2023/3/28.
//
#ifndef NDK_OPENGLES_ASSET_PNG_DECODER_H
#define NDK_OPENGLES_ASSET_PNG_DECODER_H
#include "../libpng/png_decoder.h"
#include <android/asset_manager.h>
#include "../log.h"
class AssetPngDecoder: public PngDecoder{
public:
AssetPngDecoder(AAssetManager* mgr ,char *fName);
... |
// detail/sp_convertible.hpp
//
// Copyright 2008 Peter Dimov
//
// SPDX-License-Identifier: BSL-1.0
// 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
#pragma once
#include <pika/config.hpp>
#include <cstdde... |
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
struct point{
double x,y;
point(double x=0,double y=0):x(x),y(y) {}
};
point a[110];
const int r = 6730;
const double pi = 3.1415926;
double dis(point i,point j)
{
double t = r*acos(sin(i.y)*sin(j.y)*cos(i.x-j.... |
#include "gwmessage/GWDeviceListRequest.h"
#include "gwmessage/GWDeviceListResponse.h"
using namespace std;
using namespace Poco;
using namespace BeeeOn;
GWDeviceListRequest::GWDeviceListRequest():
GWRequest(GWMessageType::DEVICE_LIST_REQUEST)
{
}
GWDeviceListRequest::GWDeviceListRequest(const JSON::Object::Ptr obj... |
/*
Name: Adrian Dy
SID: 861118847
Date: 5/14/2015
*/
#include "selectionsort.h"
using namespace std;
int main()
{
list<int> list0;
list0.push_back(2);
list0.push_back(4);
list0.push_back(5);
list0.push_back(1);
list0.push_back(8);
list0.push_back(9);
cout << "pre: ";
displaySin... |
#include "CombatStates.h"
#include "States/StateThings_incl.h"
State create_grounded_attack_state()
{
State ret = State("Grounded attack");
ret.Position_state = PositionState::Grounded;
ret.Action_state = ActionState::Attacking;
ret.enter = [](Player& p)
{
};
ret.exit = [](Player& p)
{
};
ret.upda... |
#include <iostream>
#include <NeuralRealisation.h>
using namespace std;
using namespace ANN;
int main()
{
cout << "hello ANN!" << endl;
cout << GetTestString().c_str() << endl;
std::vector<size_t> l;
l.push_back(3);
l.push_back(3);
l.push_back(3);
auto ann = CreateNeuralNetwork(l, ANN::ANeuralNetwork::Activatio... |
////////////////////////////////////////////////////////////////////////////////
//
// (C) Andy Thomason 2012-2014
//
// Modular Framework for OpenGLES2 rendering on multiple platforms.
//
namespace octet {
/// Scene containing a box with octet.
class example_compute : public app {
// scene for drawing box
... |
#include <fstream>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
//#include <vector.h>
#include <iostream>
#include <string>
#include <string.h>
#include <iomanip>
#include <sstream>
#include "TH2D.h"
#include "TF1.h"
#include "TH1D.h"
#include "TCanvas.h"
#include "TStyle.h"
#include "TRandom3.h"
#include "... |
#include "SCERunAction.hh"
#include "SCEAnalysis.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SCERunAction::SCERunAction(int nenergy, int nlayers, G4String fabsmaterial, dou... |
// Created on: 2005-12-19
// Created by: Julia GERASIMOVA
// 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 2.1... |
#include "precompiled.h"
#include "component/jsrendercomponent.h"
#include "component/jscomponent.h"
#include "entity/entitymanager.h"
using namespace component;
REGISTER_COMPONENT_TYPE(JSRenderComponent, JSRENDERCOMPONENT);
#pragma warning(disable: 4355) // disable warning for using 'this' as an initialize... |
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <cstdio>
#include <vector>
#include <set>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cctype>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <set>
#include <map>
using namespac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.