text stringlengths 8 6.88M |
|---|
#include <stdio.h>
#include <stdint.h>
#include "platform.h"
#include "imgui_support.h"
using namespace render;
static render::ContextPtr g_context;
static render::TexturePtr g_FontTexture;
static render::ShaderPtr g_FixedShader;
static StopWatch g_timer;
ImFont *g_font_awesome;
// Functions
voi... |
#pragma once
#include "D3DIncludes.hpp"
#include "Types.hpp"
namespace engine
{
class Device
{
public:
Device() {}
~Device() {}
Bool Create(ComPtr<IDXGIAdapter>& adapter, bool debug);
// One GPU
ComPtr<ID3D12CommandQueue> CreateDirectCommandQueue();
ComPtr<ID3D12CommandList> CreateCommandList();
Com... |
#include "Plane.h"
#include <cmath>
bool Plane::intersects(Ray* ray) {
double a = normal.x;
double b = normal.y;
double c = normal.z;
double e = ray->vector->x;
double g = ray->vector->y;
double i = ray->vector->z;
double denominator = a*e + b*g + c*i;
if(denominator == 0) {
return false;
}
r... |
#include <QApplication>
#include "MainWindow.hpp"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setOrganizationName("MAI 221_222 2012");
a.setApplicationName("Schedule");
MainWindow w;
w.show();
return a.exec();
}
|
#include <stdio.h>
#include <stdlib.h>
#include<sys/types.h>
int main() {
int pid = fork();
if (pid == 0) {
printf("This is the child process. My pid is %d and my parent's id is %d.\n", getpid(),
getppid());
}
else {
printf("This is the parent process. My pid is %d and my parent's id is %d.\n", pid,getpid());
}
retu... |
#include "KSGlobalLocker.h"
#include <mutex>
KS_UTIL_BEGIN
static std::mutex ResourcesLocker;
inline void LockResources(void)
{
ResourcesLocker.lock();
}
inline void UnlockResources(void)
{
ResourcesLocker.unlock();
}
inline bool TryLockResources(void)
{
return ResourcesLocker.try_lock();
}
KS_UTIL_END
|
//@@author A0112218W
#include "Command_Set.h"
ALREADY_COMPLETE_EXCEPTION::ALREADY_COMPLETE_EXCEPTION(int index) : std::exception() {
sprintf_s(_message, MESSAGE_SET_COMPLETE_NO_CHANGE.c_str(), index);
}
const char* ALREADY_COMPLETE_EXCEPTION::what(void) const throw() {
return _message;
}
SetCompleteCommand::SetC... |
// This file has been generated by Py++.
#ifndef TypedPropertyFloat_hpp__pyplusplus_wrapper
#define TypedPropertyFloat_hpp__pyplusplus_wrapper
void register_TypedPropertyFloat_class();
#endif//TypedPropertyFloat_hpp__pyplusplus_wrapper
|
#pragma once
#include <string>
#include <cstdarg>
#include <cstdio>
#include "utils/iTypes.h"
#include "core/concurrent/iLockable.h"
typedef enum e_debug_level
{
SILENT =-1,
NO_DEBUG = 0,
LOW_LEVEL = 1,
MEDIUM_LEVEL = 2,
HIGH_LEVEL = 3,
MAX_LEVEL = 4,
DISABLE = 5
} e_debug;... |
// Copyright ⓒ 2020 Valentyn Bondarenko. All rights reserved.
#include <StdAfx.hpp>
#include <Build.hpp>
namespace be::utils
{
uint Build::build_id(const Date& build_date, const string& current_date)
{
Date current{ };
string month_string = ""s;
std::stringstream buffer;
... |
#pragma once
#include <set>
#include <array>
#include <queue>
#include <atomic>
#include <thread>
#include <unordered_set>
#include "Buffer.h"
#include "Comparators.h"
const int CHUNK_SIZE = 16;
template <class T, size_t... S>
struct ArrayHelper;
template <class T, size_t X, size_t Y, size_t Z>
struct ArrayHelper<... |
/**
* @file MoleculeLJ.h
*
* @date 17 Jan 2018
* @author tchipevn
*/
#pragma once
#include <vector>
#include "autopas/particles/Particle.h"
namespace autopas {
/**
* lennard jones molecule class
*/
class MoleculeLJ : public Particle {
public:
MoleculeLJ() = default;
/**
* constructor of a lennard jo... |
#include <iostream>
using namespace std;
float square1(float num){
return num * num;
}
float square2(float *num){
return *num * *num;
}
void Fibonacci(int n, int i = 0, int f1 = 0, int f2 = 1){
if (i <= n ) {
if (i == 0) {
cout << 0 << ' ';
Fibonacci(n, i+1, 0, 1);
... |
#include "AppDelegate.h"
#include "OpeningMenuScene.h"
#include "LevelDemoScene.h"
#include "TransitionScene.h"
#include "global.h"
#include "EntityModel.h"
#include <fstream>
USING_NS_CC;
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate()
{
}
//if you want a different context,just modify the value of glC... |
/*
The MIT License (MIT)
Copyright 2016 Luca Beldi
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, publis... |
#include <windows.h>
#include <dbghelp.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#pragma comment(lib, "dbghelp.lib")
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
) {
ULONG cbSize;
TCHAR szMyPath[MAX_PATH];
HMODULE hModule;
PIMAGE_IMPORT_DES... |
/**
* @file TCPConnectedClient.h
* Defines the TCPConnectedClient class.
* @date Jan 21, 2014
* @author: Alper Sinan Akyurek
*/
#ifndef TCPCONNECTEDCLIENT_H_
#define TCPCONNECTEDCLIENT_H_
#include "SocketBase.h"
#include "IPAddress.h"
/**
* Manages the connection to a connected client on the server side. Wh... |
#pragma once
#pragma warning (disable: 4996 4091 4101 4018 4309 4099 4102 4800 4244 4482 4305 4005)
#define WIN32_LEAN_AND_MEAN
#include <string.h>
#include <cstdio>
#include <cstdarg>
#include <map>
#include <fstream>
#include <string>
#include <algorithm>
#include <ctime>
#include <sstream>
#include <windows.h>
#in... |
#ifndef ROSE_PATHS_H
#define ROSE_PATHS_H
// DQ (4/21/2009): If this is not set then set it here.
// For most of ROSE usage this is set in sage3.h, but initial
// construction or ROSETTA used to generate ROSE requires
// it as well.
#if !defined(_FILE_OFFSET_BITS)
#define _FILE_OFFSET_BITS 64
#endif
// DQ (4/21/2... |
#pragma once
#include <ScaleType.h>
class MetaScale : public ScaleType {
private:
void normalize();
public:
MetaScale() = default;
MetaScale(const ScaleType& copy) : ScaleType(copy) {}
template<typename ratio, uint32_t ref>
MetaScale(const Scale<ratio, ref>& scale) : ScaleType(scale) {}
Met... |
//
// NaturesAttendants.cpp
// Boids
//
// Created by chenyanjie on 3/31/15.
//
//
#include "NaturesAttendants.h"
#include "../../scene/BattleLayer.h"
#include "../../Utils.h"
#include "../UnitNodeComponent.h"
using namespace cocos2d;
NaturesAttendants::NaturesAttendants() {
}
NaturesAttendants::~NaturesAtt... |
#pragma once
#include "Client.h"
#include "OutputMemoryBitStream.h"
#include "InputMemoryBitStream.h"
enum PacketType {HELLO, WELCOME, NEWPLAYER, DISCONNECT, ACK, PING, ACKPING, ACKMOVE, SHOOT, GAMEOVER, GAMESTART, GOAL, NOTWELCOME, MOVE, MOVEBALL};
const int commandBits = 4;
const int maxBufferSize = 1300;
const int ... |
/* Copyright 2020 The TensorFlow 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 applicable law or a... |
#include <iostream>
#include <list>
#include <forward_list>
#include <string>
#include <vector>
#include <set>
#include <map>
#include "merge.h"
template<typename T>
void print(const T &t) {
for (auto el : t) {
cout << el << " ";
}
cout << endl;
}
template<typename T>
void print(const map<T, T> ... |
#include "genogram.h"
using namespace gen;
struct gen::node{
// Payload
std::string name;
std::string gender;
time_t birth;
time_t death;
bool visited;
// Structure
edge* edges;
node* prev;
node* next;
};
struct gen::edge{
node* name;
relKind kind;
edge* next;
};
//************************... |
#include "server_t.h"
server_t* listening_server;
int main(int argc, char** argv)
{
if(argc < 2)
{
std::cout << "usage: " << argv[0] << " <port number> \n";
return 0;
}
int port_selection;
errno = 0;
port_selection = (int)strtol(argv[1],NULL,10);
if(errno)
{
std::cout << "errno set... |
#ifndef TENSOR_H
#define TENSOR_H
#include "cnn.hpp"
class Batch
{
public:
Batch();
Batch(const int& nums,
const int& rows,
const int& cols,
const int& channels)
{
nums_ = nums;
channels_ = channels;
rows_ = rows;
cols_ = cols;
size_ = ... |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a, num, sum=0, sum1=0;
int r;
int n;
cout << "Enter a number" << endl;
cin >> n;
num = n;
while(num>0)
{
a=num%10;
if(a!=0)
{
sum = sum *10 + a;
}
num=num/10;
... |
#include "Game.h"
void Game::StartGame()
{
while (true) {
printf("*****生命游戏*****\n\n");
printf("1.开始演变\n\n");
printf("2.设置模式\n\n");
printf("3.设置速度\n\n");
printf("4.游戏介绍\n\n");
printf("5.退出游戏\n\n");
printf(">>");
int choose = 0;
cin >> choose;
switch (choose)
{
case 1:
S... |
/*
* PathPlanner.cpp
*
* Created on: Jun 12, 2015
* Author: colman
*/
#include "PathPlanner.h"
#include "robot.h"
#include "Behavior.h"
#include "wayPoint.h"
#include "Position.h"
Area* world;
std::vector<ANode*> OpenList;
std::vector<ANode*> CloseList;
ANode* first;
ANode* target;
Behavior** PathPlanne... |
#include "stdafx.h"
#include "AssimpImporter.h"
#include "Common/Helpers.h"
#include "../D3DBase.h"
#include "../IScene.h"
#include "../TextureManager.h"
#include "../VertexTypes.h"
#include "../ImmutableMeshGeometry.h"
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
using nam... |
//
// OSUtil.h
// SMFrameWork
//
// Created by SteveMac on 2018. 6. 20..
//
#ifndef OSUtil_h
#define OSUtil_h
#include <cocos2d.h>
#include <string>
class OSUtil {
public:
static std::string getAppDisplayName();
static std::string getAppVersionName();
static std::string getAppBuildVersion();
// ... |
#ifndef PERSON_H
#define PERSON_H
#include <string>
class Person{
public:
Person(string fn, string ln, int ag);
~Person();
private:
string FName;
string LName;
int age;
};
#endif // PERSON_H
|
#include <iostream>
#include <string.h>
using namespace std;
struct nod{
char info;
nod* next;
}*prim,*ultim;
void push(){
if(ultim==NULL)
{
nod *p = new nod;
p->info='(';
p->next=NULL;
prim=ultim=p;
}
else
{
nod *p = new nod;
p->info='(';
p->next=prim;
prim=p;
}
}
int pop()
{
n... |
#include <iostream>
using namespace std;
char l[15];
int lcs_length(char *a, char *b){
int m =3, n = 5; //toy(3) story(5)
for(int i = m; i >= 0; i--){
for(int j = n; j >= 0; j--){
if(a[i] == '\0' || b[j] == '\0') l[i,j] = 0;
else if(a[i] == b[j]) l[i,j] = 1 + l[i+1,j+1];
... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: QTAccessFile.h
Description: This object contains an interface for finding and ... |
//
// Myplane.cpp
// Fighters
//
// Created by zhutun on 15/5/25.
// Copyright (c) 2015年 zhutun. All rights reserved.
//
#include "Myplane.h"
#include "GTexture.h"
#include <SFML/System.hpp>
#include "Bullet.h"
Myplane::Myplane(Sky* mySky):Plane(mySky)
{
this->setTexture(this->texture);
this->setPosition... |
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
string str1 = "i.like.this.program.very.much";
string::size_type pos = str1.find_first_of(".");
while(pos!=string::npos) {
str1[pos]=' ';
pos = str1.find_first_of(".",pos+1);
}
int count=0;
cout<<str1<<endl;
stringstream ss;
stack<... |
// MFCApplication1Dlg.cpp: archivo de implementación
//
#include "pch.h"
#include "framework.h"
#include "MFCApplication1.h"
#include "MFCApplication1Dlg.h"
#include "afxdialogex.h"
#include "iostream"
#include "string"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// Cuadro de diálogo CAboutDlg utilizado para el coma... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 ... |
#include "SDL/SDL.h"
#include "SDL_image/SDL_image.h"
#include "SDL_rotozoom.h"
#include <string>
#include "global.h"
#include <math.h>
class Tile{
protected:
axis base;
SDL_Surface *tile;
int direction;
public:
Tile(){}
Tile(std::string filename, axis base, int direction);
void show(SDL_Surface * track... |
#include "TestScanManagement.h"
#include "TestDataFile.h"
#include "../EngineLayer/CommonParameters.h"
#include "../TaskLayer/MetaMorpheusTask.h"
#include "../EngineLayer/Ms2ScanWithSpecificMass.h"
using namespace EngineLayer;
using namespace MassSpectrometry;
using namespace MzLibUtil;
using namespace NUnit... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <memory>
#include "Settings.h"
#include "Application.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void d... |
/*!
* \file
* \author David Saxon
* \brief Inline definitions for UTF-8 implementations of the
* compute_byte_length function.
*
* \copyright Copyright (c) 2018, The Arcane Initiative
* All rights reserved.
*
* \license BSD 3-Clause License
*
* Redistribution and use in source an... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <sstream>
using namespace std;
/*
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) :
val(x), next(NULL) {
}
};*/
/*
思路1:
因为是单链表,所以从第一个公共节点之后都是两个链表共享的节点,两个链表会有相同的结尾节点。
先获取两个链... |
/**
* 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:
void inorderTraverse(TreeNode * root, int k, int &count, int &res) {
if(root == null... |
#include "NumberOne.h"
#include "../../Components/Activator.h"
#include "../../Components/AirFreshener.h"
#include "../../Components/LightSensor.h"
#include "../../Components/RGBLED.h"
#include "../../Utilities/Time.h"
#include "../../Program.h"
#include "InUse.h"
namespace Stickuino {
namespace States {
namespace ... |
/* ============================================================================
* Copyright (c) 2009-2016 BlueQuartz Software, LLC
*
* 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 ... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Web::Http {
struct HttpProgress;
}
namespace Windows::Web::Http {
struct HttpProgress;
}
namespace ABI::Windows::Web::Http {
stru... |
/**
* $Source: /backup/cvsroot/project/pnids/zdk/zls/zlang/CASTPrinter.cpp,v $
*
* $Date: 2001/11/14 19:03:08 $
*
* $Revision: 1.3 $
*
* $Name: $
*
* $Author: zls $
*
* Copyright(C) since 1998 by Albert Zheng - 郑立松, All Rights Reserved.
*
* lisong.zheng@gmail.com
*
* $State: Exp $
*/
... |
/***************************************************************************
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... |
#include <irtkImage.h>
#include <irtkTransformation.h>
// Input transformation
char *dofout_name = NULL;
// Output transformation
char *image_in_nameX = NULL;
char *image_in_nameY = NULL;
char *image_in_nameZ = NULL;
void usage()
{
cerr << "Usage: ffd2images [imageInX] [imageInY] [imageInZ] [dofout] \n" << endl;
... |
#pragma once
#include <Transformation.h>
#include <EventID.h>
#include <EventType.h>
#include <MetaFilter.h>
#include <boost/graph/adjacency_list.hpp>
#include <ostream>
#include <utility>
class CompositeTransformation : public AbstractConfiguredTransformation {
public:
class ConfiguredTransformation : public... |
#include <cutils/properties.h>
#include <string>
void inputhook_vendor_touchrotate(int32_t *width, int32_t *height, int32_t *orientation)
{
int32_t tmp = 0;
char stbMode[PROP_VALUE_MAX];
property_get("persist.tegra.stb.mode", stbMode, "0");
if (stbMode[0] != '0') {
tmp = *width;
*width... |
#include <iostream>
using namespace std;
double dzielenie(double a, double b){
if(b!=0){
return a/b;
}
else{
cout << "Nie dziel przez 0!";
return 0;
}
}
double mnozenie(double a, double b){
return a*b;
}
double odejmowanie(double a, double b){
return a-b;
}
double dodawanie(double a, double b){
return a+b;
}
|
/*
Name: Mohit Kishorbhai Sheladiya
Student ID: 117979203
Student Email: mksheladiya@myseneca.ca
Date: 21/02/03
*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstring>
#include "Item.h"
using namespace std;
namespace sdds {
void Item::setName(const char* nam... |
#include "ZobObject.h"
#include "DirectZob.h"
ZobObject::ZobObject(Type t, SubType s, std::string& name, Mesh* mesh, ZobObject* parent /*= NULL*/):ZOBGUID(t,s)
{
m_name = name;
m_parent = parent;
m_mesh = mesh;
m_translation = Vector3(0, 0, 0);
m_rotation = Vector3(0, 0, 0);
m_scale = Vector3(1, 1, 1);
if (pare... |
// server.cpp
// defines and implements functionality for a NICU baby warmer C&C server
// stdlib includes
#include <chrono>
#include <cstring>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
// custom includes
#include "../../shared/msg_util.hpp"
#include "../include/pool.hpp"
#include <zmqp... |
// github.com/andy489
#include <iostream>
using namespace std;
#define MIN 0
#define MAX 1000000000
#define mxN 100000
int getMax(int *arr, int size) {
int currentMax(0);
for (int i = 0; i < size; ++i)
if (currentMax < arr[i])
currentMax = arr[i];
return currentMax;
}
bool driesForT... |
#include <irtkImage.h>
#include <irtkHistogram.h>
#include <irtkImageFunction.h>
#include <irtkTransformation.h>
char *target_name = NULL, *source_name = NULL;
char *output_name = NULL;
char *dof_name = NULL;
void usage(){
cout << "csvHist_2D [target] [source] <options>" << endl;
cout << "Write the histogram of ... |
//
// Created by 邓岩 on 2019/5/19.
//
/*
* 大臣的旅费
问题描述
很久以前,T王国空前繁荣。为了更好地管理国家,王国修建了大量的快速路,用于连接首都和王国内的各大城市。
为节省经费,T国的大臣们经过思考,制定了一套优秀的修建方案,使得任何一个大城市都能从首都直接或者通过其他大城市间接到达。同时,如果不重复经过大城市,从首都到达每个大城市的方案都是唯一的。
J是T国重要大臣,他巡查于各大城市之间,体察民情。所以,从一个城市马不停蹄地到另一个城市成了J最常做的事情。他有一个钱袋,用于存放往来城市间的路费。
聪明的J发现,如果不在某个城市停下来修整,在连续行进过程中,他所花的路费与他已走过... |
//
// Created by matan on 1/20/20.
//
#ifndef SOLID_SERVER_REDO_CLIENTHANDLER_H
#define SOLID_SERVER_REDO_CLIENTHANDLER_H
#define DEFAULT_CAP 5
#include "IHandler.h"
using namespace std;
template<class Problem, class Solution, class Var>
class ClientHandler : public IHandler {
protected:
virtual Problem makePr... |
/**
* Copyright 2017
*
* This file is part of On-line POMDP Planning Toolkit (OPPT).
* OPPT is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License published by the Free Software Foundation,
* either version 2 of the License, or (at your option) any later ver... |
#ifndef CLIENT_HPP
#define CLIENT_HPP
#include <sys/socket.h> // Core BSD socket functions and data structures
#include <sys/fcntl.h> // for the non-blocking socket
#include <arpa/inet.h> // for manipulating IP addresses, for inet_addr()
#include <unistd.h> // for close()
#include <iostream>
#include <vector>
#... |
#include <iostream>
using namespace std;
int main(){
int num = 0;
for(int i = 100 ; i < 100000 ; i++){
int w = i;
int flag1 = false,flag2 = false;
int temp1 = w%10;
w = w/10;
int temp2 = w%10;
while(temp2<temp1){
w = w/10;
temp1 = temp2;
temp2 = w%10;
flag1 = true;
}
while(temp2>temp1){
... |
#include "MainWindow.hpp"
#include "ui_MainWindow.h"
#include <QDebug>
#include <QDir>
#include <QDesktopServices>
#include <QMessageBox>
#include "EditGroup.hpp"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
for (int i = 0; i<5; ++i)
... |
#ifndef _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_NORMAL_EQUATION_SOLVER_HPP_
#define _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_NORMAL_EQUATION_SOLVER_HPP_
#include "hs_sfm/bundle_adjustment/camera_shared_vector_function.hpp"
#include "hs_sfm/bundle_adjustment/camera_shared_augmented_normal_matrix.hpp"
#include "hs_sfm/b... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
QDate lock(2010,06,17);
if(QDate::currentDate() > lock){
ui->setupUi(this);
QString loc = QCoreApplication::applicationDirPath()+"/setting2.db";
... |
/*********************************************************
** Author: Carlos Carrillo *
** Date: 11/03/2015 *
** Description: This is the class specification file *
* of a class called Blue. This class is a derived *
* class from the Creatu... |
/***********************************************************************
created: 30th July 2013
author: Lukas Meindl
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2013 Paul... |
// Copyright 2020 JD.com, Inc. Galileo 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 requ... |
#ifndef PROP1_H
#define PROP1_H
#include <QGraphicsRectItem>
#include <QObject>
class Prop1: public QObject,public QGraphicsRectItem
{
Q_OBJECT
public:
Prop1();
public slots:
void touch();
};
#endif // PROP1_H
|
/******************************************************************************
* "THE HUG-WARE LICENSE": *
* tastytea <tastytea@tastytea.de> wrote this file. As long as you retain *
* this notice you can do whatever you want with this stuff. If we meet *
... |
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <functional>
#include <iterator>
using namespace std;
struct Permutation
{
std::vector<size_t> perm;
unsigned size, count;
void operator ++ ()
{
auto getI = [&] {
for (size_t i = size... |
#include "graphics\Singularity.Graphics.h"
namespace Singularity
{
namespace Graphics
{
#pragma region Static Methods
void GraphicsDevice::DrawMesh(Mesh* mesh, Vector3 position, Quaternion rotation, Material* material, unsigned layer, Camera* camera)
{
}
void GraphicsDevice::DrawTexture(RE... |
//! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define pb push_... |
#include "ProductEntry.h"
ProductEntry::ProductEntry(): ProductType() {}
ProductEntry::ProductEntry(const ProductType& type, const Amount amount):
ProductType(type), amount_(amount) {}
ProductEntry::ProductEntry(const BarCode barcode,
const std::string title,
... |
#pragma once
//#include "nginx.hpp"
#include "ngx_unset_value.hpp"
class NgxValue final
{
public:
NgxValue() = default;
~NgxValue() = default;
public:
template <typename T>
static bool invalid(const T& v)
{
return v == static_cast<T>(NgxUnsetValue::get());
}
template <typename T, typename U>
static void in... |
#ifndef PERSISTENCEHANDLERTESTBASE_H
#define PERSISTENCEHANDLERTESTBASE_H
#include "Utilities/Definitions.h"
#include "Utilities/MappedFileDataPersistenceHandler.h"
#include "Utilities/CodeTimer.h"
namespace UnitTesting
{
using float3 = Utilities::_storage3D<float>;
class PersistenceHandlerTestBase
{
public:
Per... |
#ifndef _EasyTcpClient_hpp_
#define _EasyTcpClient_hpp_
#include "util.h"
#include "MessageHeader.hpp"
#define BUF_SIZE 4096
class EasyTcpClient
{
SOCKET sock;
public:
EasyTcpClient()
{
sock = INVALID_SOCKET;
}
virtual ~EasyTcpClient()
{
close();
... |
#ifndef LOG_H
#define LOG_H
#define LCD
#include <Arduino.h>
#ifdef LCD
#include "Adafruit_LiquidCrystal.h"
#endif
#ifdef __arm__
// should use uinstd.h to define sbrk but Due causes a conflict
extern "C" char *sbrk(int incr);
#else // __ARM__
extern char *__brkval;
#endif // __arm__
class Log
{
private:
uint8... |
// 230. Kth Smallest Element in a BST
// Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.
// Note:
// You may assume k is always valid, 1 ≤ k ≤ BST's total elements.
// Example 1:
// Input: root = [3,1,4,null,2], k = 1
// 3
// / \
// 1 4
// \
// 2
// Outp... |
#include "Point.cpp"
using namespace std;
const double INF = 0x3f3f3f3f;
bool cmpx(P a, P b) { return a.x < b.x; }
bool cmpy(P a, P b) { return a.y < b.y; }
pair<P, P> DnC(vector<P> &p, int L, int R) {
if (R - L <= 1) return make_pair(P(-INF, -INF), P(INF, INF));
int M = (L + R) >> 1;
pair<P, P> l = DnC(p, ... |
#include <SFML/Graphics.hpp>
using namespace sf;
class LineGraph
{
public:
LineGraph(Vector2f _position, Color _lineColor, Color _dotColor, int _yMin, int _yMax, Texture* _smallNumbers);
void draw(RenderWindow* window); //draws the graph (axes, lines)
void update(float value); //Shifts all... |
//
// SimpleAiActionManager.hpp
// demo_ddz
//
// Created by 谢小凡 on 2018/3/4.
//
#ifndef SimpleAiActionManager_hpp
#define SimpleAiActionManager_hpp
#include "UICard.hpp"
#include "CardTypeHelper.hpp"
#include "CardTypeDefine.hpp"
// 底牌种类定义
enum class RestCTName
{
DoubleKing, // 双王
Three, // 三张
... |
#include <iostream>
#include<cstdlib>
#include<cmath>
//这是一个数据结构的课程设计,要求算出输入文件中的一些公式,这里我就把它做成一个支持文件格式的批处理计算器(这名字咋样哈哈,但是不支持负数计算)
//总的来说,犯的最大的错误就是用stack的top,pop等操作,没想到考虑其为空,所以导致各种崩溃,再一个,写程序先下逻辑,后具体到函数,即使暂时用注释代替也好
//免得到时候纠结于函数实现的细节,而忘了整体逻辑,导致逻辑上的失误和遗漏操作。
#include<stack>
#include<fstream>
using namespace std;
int IsOper... |
#include <FastCG/World/Transform.h>
#include <FastCG/World/FlyController.h>
#include <FastCG/Input/MouseButton.h>
#include <FastCG/Input/Key.h>
#include <FastCG/Input/InputSystem.h>
#include <FastCG/Core/Math.h>
namespace FastCG
{
FASTCG_IMPLEMENT_COMPONENT(FlyController, Behaviour);
void FlyController::OnUpdate(fl... |
/*
** Copyright (c) 2013, Xin YUAN, courses of Zhejiang University
** All rights reserved.
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the 2-Clause BSD License.
**
** Author contact information:
** yxxinyuan@zju.edu.cn
**
*/
/*
This file contains classes for g... |
#include<iostream>
#include<string>
using namespace std;
int Atoi(char ch)
{
if('0'<=ch && ch<='9')
{
return (int)ch-(int)'0';
}
if('A'<=ch && ch<='F')
{
return (int)ch-(int)'A'+10;
}
return -1;
}
int main()
{
string m;
int n;
int base=1;
cin >>m>>n;
int ans=0;
for(int i=m.size()-1;i>=0;i--)
{... |
/*
CSCN7103021W-Negussie
*/
//#include <iostream>
//#include "Customer.h"
//#include "SaveLoad.h"
//#include "Users.h"
//#include "Inventory.h"
//#include "Lists.h"
//#include "Node.cpp"
//#include "Lists.cpp"
//#include "TransactionHistory.h"
//#include "Validation.h"
//using namespace std;
//int main(void){
... |
#include<bits/stdc++.h>
using namespace std;
bool ifPossible(int a, int b, int c, int x, int y)
{
if((a+b+c) != (x+y)) //Check if enough stones are present
return false;
if(a <= x) //As smallest of existing pile must be smaller than smaller
return true;
else
return false;
}
int main()
{
fstream fin("Inpu... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
vector<ll> v1,v2;
int main(){
int n,m;ll x;
cin >> n;
for(int i=0;i<n;i++){
cin >> x;
v1.pb(x);
}
sort(v1.begin(),v1.end());
cin >> m;
for(int i=0;i<m;i++){
cin >> x;
v2.pb(x);
}
ll xx... |
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <set>
#include <stack>
#include <sstream>
#include <string>
using namespace std;
struct TreeNode
{
int val;
TreeNode* left;
Tr... |
#include "Context.h"
#include "ResourceManager.h"
#include "ActionScopeManager.h"
#include "PrimitiveRenderObjects.h"
#include "GameMapManager.h"
#include <iostream>
Context::Context(string_t name)
{
_name = name;
_keys_combined = std::list<sf::Keyboard::Key>();
_music = NULL;
_inner_elements = std::list<Conte... |
#pragma once
#include <iostream>
#include <ctime>
#include "Pet.h"
using namespace std;
class Purchase
{
public:
int purchaseId;
string custName, custPhNo, custEmail;
double totalAmount = 0;
string purchaseTimeStamp;
Purchase* next = NULL;
Pet* pets = NULL;
~Purchase()
{
while (pets != NULL)
{
Pet* nex... |
#include <iostream>
int main()
{
using namespace std;
float y, w, z = 0.05e-5, m = 6;
const double e = 2.71828;
y = cos(5*m)/pow(sin(0.4*m),2);
w = 4 * z * y - 7 * pow(e, -2 * y);
cout.unsetf(ios::dec);
cout.setf(ios::oct);
cout << "y=" << y << '\n';
cout << "w=" << w;
}
|
//
// Compiler/AST/ExpressionIdentifier.h
//
// Brian T. Kelley <brian@briantkelley.com>
// Copyright (c) 2007, 2008, 2011, 2012, 2014 Brian T. Kelley
//
// Chris Leahy <leahycm@gmail.com>
// Copyright (c) 2007 Chris Leahy
//
// This software is licensed as described in the file LICENSE, which you should have received ... |
//
// Compiler/AST/Variable.cpp
//
// Brian T. Kelley <brian@briantkelley.com>
// Copyright (c) 2007, 2008, 2011, 2012, 2014 Brian T. Kelley
//
// Chris Leahy <leahycm@gmail.com>
// Copyright (c) 2007 Chris Leahy
//
// This software is licensed as described in the file LICENSE, which you should have received as part of... |
#include<bits/stdc++.h>
using namespace std;
void flip(vector<int>& arr,int index,int n)
{
int i = 0;
int j= index;
while( i < n && j >=0 && i < j)
{
swap(arr[i],arr[j]);
i++;
j--;
}
return ;
}
void solve(vector<int>& arr,int n)
{
if(n==0)
{
return ;
}
vector<int> output;
for(int i=n-1;i>=0;i--)
... |
///////////////////////////////////////////////////////////////////////
// Screen.cpp
///////////////////////////////////////////////////////////////////////
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <string>
#include <vector>
#include "../Text/Text.hpp"
#include "Conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.