text stringlengths 8 6.88M |
|---|
/**
* Templated interpolation functions
*/
#ifndef FISHY_MATH_INTERPOLATE_H
#define FISHY_MATH_INTERPOLATE_H
namespace core {
namespace math {
/**
* Linear Interpolate from a->b by factor
*/
template < typename tType >
tType lerp(const tType &a, const tType &b, const f32 factor) {
// Expand (a + ((b - a)*factor... |
/// @file cannonical.cc
/// @brief NPN同値類の代表関数を求めるプログラム
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "YmTools.h"
BEGIN_NAMESPACE_YM
// 3入力のNPN同値類代表関数
ymuint32 npn3rep[] = {
#include "npn3rep.h"
};
// 3入力のNPN変換を表す配列
ymuint8 npn3perm[][4] ... |
#include "authentification.h"
authentification::authentification()
{
}
|
#include<iostream>
// #include<conio.h>
class stock{
int id;
float rate;
int date;
char name;
public:
stock()
{
id=1001;rate=200;date=1;
}
~stock()
{
std::cout<<"deconstructor called "<<std::endl;
}
void reg(int i,float r)
{
id=i;
rate=r;
}
void change(int ne,int dt)
{
... |
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <cctype>
#includ... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
#ifndef MYOBJECT_H
#define MYOBJECT_H
#include <node.h>
#include <node_object_wrap.h>
#include "GSizerKLib/NextBody.h"
#include "GccAnalysis.h"
namespace demo
{
class MyObject : public node::ObjectWrap
{
public:
static void Init(v8::Isolate *isolate);
static void NewInstance(const v8::FunctionCallbackInfo<v8::V... |
/*************************************************************
* > File Name : P6477.cpp
* > Author : Tony
* > Created Time : 2020/04/25 14:41:37
* > Algorithm : SegmentTree
**************************************************************/
#include <bits/stdc++.h>
using namespace std;... |
#include "Node.h"
// default constructor
Node::Node() {
data = 0;
left = NULL;
right = NULL;
}
Node::Node(int d) {
data = d;
left = NULL;
right = NULL;
}
Node::~Node() {
if (right != NULL) {
delete right;
}
if (left != NULL) {
delete left;
}
}
|
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Management.Deployment.Preview.3.h"
#include "Windows.Management.Deployment.h"
WINRT_EXPORT namespace winrt {
namespace impl {
... |
//#include "RedkeaWiFi.h"
//
//char ssid[] = "IOTwifi";
//char pass[] = "iotpk2017";
//char deviceID[] = "-KockqvTbvZYYgXmgVg1";
//
//RedkeaWiFi redkea;
//
///**************************************************************************************************
//Use the following snippet if you want to send data from your... |
/* config.tcc -*- C++ -*-
Rémi Attab (remi.attab@gmail.com), 29 Apr 2014
FreeBSD-style copyright and disclaimer apply
Reflection-based configuration utility template implemenataion.
*/
#include "includes.h"
#pragma once
namespace reflect {
namespace config {
/***************... |
#include <QtWidgets/QApplication>
#include <QDebug>
#include "mainwindow.h"
#include "console.h"
#include "basicheaders.h"
int main(int argc, char *argv[])
{
bool console = false;
Console *workC = new Console();
if(DEBUG) std:: cout << "main function started" << std::endl;
for(int i = 0; i < argc; i++... |
/*
* Project: Unhappy Flying Reptiles
* Description: This project uses GDI+ and MFC to simulate the beginning of an Angry Birds type game.
* It uses chroma key, image scaling, and animation using a timer.
* Programmer: Cindy Do
* Date: 03-07-2016
*/
#include <windows.h>
#include <windowsx.h>
#include <gdip... |
/**
* author : Wang Shaotong
* email : wangshaotongsydemon@gmail.com
* date : 2020-04-21
*
* id : A
* name : Candies
* url : https://codeforces.com/contest/1343/problem/A
* level : 1
* tag : 枚举, 数学
*/
#include <iostream>
using namespace std;
int main()
{
int t;
cin >> t;
while (... |
//#include <iostream>
//#include <cstdio>
#include <bits/stdc++.h>
#define Inf 0x3f3f3f3f
#define NeInf 0xc0c0c0c0
using namespace std;
struct poker{
char point,color;
};
vector<poker> v[52];
bool match(poker a, poker b){
return (a.point == b.point || a.color == b.color);
}
void solve(){
while(1){
... |
#include <Model/thanos.h>
#include <Model/dataStructures/node.h>
template <typename Data>
struct LinkedList{
Node<Data> * firstNode;
Node<Data> * lastNode;
vector<Data> cache;
bool isVectorDefined;
int length;
// Constructores
LinkedList(){
firstNode = NULL;
lastNode = NULL;
length = 0;
... |
#include "mainwin.h"
int main (int argc, char *argv[]) {
// Your main function code goes here!
auto app = Gtk::Application::create(argc, argv, "edu.uta.cse1325.example");
Mainwin win;
return app->run(win);
}
|
/**
* @file NfcEmuPacket.h
* @author Lukas Schuller
* @date Sat Apr 12 15:56:20 2014
*
* @brief
*
* @license
* Copyright (C) 2014 Lukas Schuller
*
* 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
... |
#include "robot.h"
#include <iostream>
robot::robot(Json &config){
if(config["firmware"] == Json::null){
printf("firmware string missing in config.json\r\n");
exit(0);
}
std::string file_name = config["firmware"];
atmega = new atmega32(file_name.c_str());
gb = new goldboard(atmega->get_simavr_avr());... |
#ifndef _EVENT_MANAGE_
#define _EVENT_MANAGE_
#include <map>
#include <memory.h>
#include "system/ifc/ievent.h"
#define EVENT_CALLBACK(Class, Metod, Arg) Arg, Class, &Class::Metod
namespace smeta3d
{
/**
\brief Класс Вспомогательный класс для регистрации обработчиков событий
*/
class CEventCallback
... |
#include <cstdio>
#include <algorithm>
using namespace std;
int C[6], A;
int V[6] = {1,5,10,50,100,500};
void read();
void solve();
int main(){
read();
solve();
return 0;
}
void read(){
for(int i=0; i < 6; i++){
scanf("%d", &C[i]);
}
scanf("%d", &A);
}
void solve(){
int ans=0;
for (int i=5; ... |
/******************************************************************************
* 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... |
//
// Created by 梁栋 on 2019-01-17.
//
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
void nextPermutation(vector<int>& nums) {
int size = int(nums.size());
int first_decrease = -1;
for(int j=size-1;j>0;j--){
if(nums[j] > nums[j - 1]){
... |
#pragma once
#include "pb_background.h"
#include "pb_transport_viscosity_correlation.h"
namespace Popbal {
class BackgroundStatic: public Background
{
public:
~BackgroundStatic(void);
// SET THE BACKGROUND PHASE DATA
//! Constructor with temperature, pressure and the correlation
BackgroundStatic(... |
// Copyright (c) 2016 University of Szeged.
// Copyright (c) 2016 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 "sprocket/browser/devtools/devtools_manager_delegate.h"
#include "base/command_line.h"
#inclu... |
class Solution {
public:
int countZeros(vector<int> nums, int z){
int count=0;
for(int i=0;i<=z;i++){
if(nums[i] == 0){
count++;
}
}
return count;
}
int findTargetSumWays(vector<int>& nums, int S) {
//Calculating the sum of... |
#include<iostream>
#include<cmath>
typedef long long int ll;
using namespace std;
int main()
{
ll t,n,m;
long double min,max;
cin>>t;
while(t--)
{
cin>>n>>m;
min = sqrt((m*m)-(n*n));
max = sqrt((m*m) + (n*n));
cout<<min<<" "<<max<<endl;
}
}
|
#include <iostream>
using namespace std;
int main (){
cout << "Hello world" << endl;
string alphabet {"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string key {"XZNLWEBGJHQDYVTKFUOMPCIASRxznlwebgjhqdyvtkfuompciasr"};
string message {};
cout << "Please enter your message :";
getline(cin, message);
... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
string s;
cin >> s;
int start=0;
map<char,int> m;
int* arr=new int[s.size()]();
int start=0;
for(int i=0;i<s.size();i++)
{
m[s[i]]++;
}
for(int i=1;i<s.size();i++)
{
if(arr[i]==arr[i-1])
{
st... |
#include <gtest/gtest.h>
#include "proto/container_entity.h"
#include "jactorioTests.h"
namespace jactorio::proto
{
TEST(ContainerEntity, Serialize) {
ContainerEntityData container(5);
container.health = 43;
container.inventory[2].count = 89;
data::PrototypeManager proto;
... |
//
// AudioFrame.h
// IPCT
//
// Created by SteveKim on 2020/02/19.
//
#ifndef AudioFrame_h
#define AudioFrame_h
#include <stdio.h>
#include <cocos2d.h>
extern "C" {
struct AVFrame;
struct AVPacket;
struct AVFormatContext;
struct AVCodecContext;
struct SwrContext;
struct SwsContext;
}
cla... |
// ModuleManager.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Module.h"
#include "Student.h"
#include "Teacher.h"
#include <vector>
#include <iostream>
using namespace std;
//Print relevant module information
void ShowModuleInformation(vector<Module*> tempModules) {
au... |
#pragma once
#include <Windows.h>
#include <stdio.h>
#include <tchar.h>
#include <string>
using namespace std;
// NtQueryInformationProcess for pure 32 and 64-bit processes
typedef NTSTATUS(NTAPI *_NtQueryInformationProcess)(
IN HANDLE ProcessHandle,
ULONG ProcessInformationClass,
OUT PVOID ProcessInformation,
IN... |
// nearestGreater
// Given an array of integers a, return a new array b using the following guidelines:
// For each index i in b, the value of bᵢ is the index of the aⱼ nearest to aᵢ and is also greater than aᵢ.
// If there are two options for bᵢ, put the leftmost one in bᵢ.
// If there are no options for bᵢ, put -1 in... |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
#define N 10010
char word[N][20];
int Judge1(char *a, char *b, int len)
{
int i, ans = 0;
for (i = 0; i < len; ++i)
{
if (a[i] != b[i])
{
ans ++;
if (ans > 1)
... |
/***************************************************************************
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... |
// O(N^2) solution
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
if(nums.empty()) return 0;
int n = nums.size();
vector<int> dp(n, 1);
int res = 1;
for(int i = 1; i < nums.size(); i++)
{
for(int j = 0; j < i; j++)
{
... |
#ifndef _COLORSTATICST_H
#define _COLORSTATICST_H
/* NO WARRANTY
*
* BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO
* WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS
* AND/OR OTHER PARTIES PROVIDE THE PROGRAM "... |
#ifndef SSPAPPLICATION_CORE_SYSTEM_H
#define SSPAPPLICATION_CORE_SYSTEM_H
#include <SDL.h>
#include <SDL_syswm.h>
#include <omp.h>
#include <iostream>
#include "InputHandler.h"
#include "GameStateHandler.h"
#include "DebugHandler.h"
#include "Progression.h"
//Project DLLs
#include "../GraphicsDLL/GraphicsHandler.h"
#in... |
#ifndef ORDERREPOSITORY_H
#define ORDERREPOSITORY_H
#include "Drink.h"
#include <iostream>
using namespace std;
class OrderRepository
{
public:
OrderRepository();
virtual ~OrderRepository();
void write_drink(Drink drink);
protected:
private:
};
#endif // ORDERREPOSITORY_H
|
/*
FILE : Project
PROJECT : PROG8125 -Using an ultrasonic sensor and designing a reverse car sensor
PROGRAMMER : Kunal Malhotra
FIRST VERSION : 2016-08-05
DESCRIPTION : This sketch reads a PING))) ultrasonic rangefinder and returns the distance to the closest object in range. To do th... |
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char s[100010];
int left_p[100010]={0};
int right_t=0;
int main()
{
gets(s);
int num=0;
/*
for(int i=0;i<strlen(s);i++)
{
for(int j=strlen(s)-1;j>=0;j--)
{
if(i>j)break;
for(int k=strlen(s)-1;k>=0;k--)
{
if(k>j&&j>i&&s[i]==... |
//Даны целые положительные числа A и B (A < B). Вывести все целые числа от A до B включительно;
//при этом каждое число должно выводиться столько раз, каково его значение (например, число 3 выводится 3 раза).
#include <iostream>
#include <locale.h>
using namespace std;
int main()
{
int a, b, c, i, j;
setlocale(L... |
#ifndef GTASA_CLASSES_H
#define GTASA_CLASSES_H
#include <Windows.h>
#include <stdint.h>
class CAnimBlock
{
public:
const char* GetName();
bool IsLoaded();
uint16_t GetReferenceCount();
int GetIdOffset();
size_t GetAnimationCount();
DWORD GetFirstAssocGroup();
void SetAnimationCount(size_... |
#include<iostream>
using namespace std;
int A[1000];
int S[1000];
int V[1000];
int x;
int long_sub_sequence(int n)
{
int temp;
if (V[n]!=-1)
return V[n];
int max = 1;
if (A[n] >= A[n - 1]) {
x = n-1;
temp = 1 + long_sub_sequence(n - 1);
S[n] = A[n];
}
else {
temp = long_sub_sequence(n - 1);
}
if (max ... |
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n, k, total;
total=0;
cin>>n;
for(int i=1; i<=n; i++){
cin>>k;
total=total+k;
}
total=total/n;
cout<<total<<endl;
return 0;
} |
#include <stdio.h>
#include <math.h>
const double eps = 1e-8;
const double Pi = acos(-1.0);
#define Equ(a, b) (((fabs((a) - (b))) < (eps))
#define More(a, b) (((a) - (b) > (eps))
#define Less(a, b) (((a) - (b) < (-eps))
#define MoreEqu(a, b) (((a) - (b)) > (-eps))
#define LessEqu(a, b) (((a) - (b)) < (eps))
|
#include <iostream>
using namespace std;
template <typename T>
class mymax
{
public:
T operator()(T a, T b) // 重载“()”操作符,在这个操作符中实现具体功能
{
return a>b?a:b;
}
};
// 重载“()”操作符后的类成为一个函数对象
template <typename T> // 利用函数对象定义函数模板,可以理解为函数指针作为回调函数
T compare(T a, T b, mymax<T>& op)
{
return op(a,b... |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
typedef int ll;
typedef long double ld;
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--)
{
string a;
cin>>a;
int ans = 2;
for(int i = 1 ; i < a.l... |
/*
* GridContainer.cpp
*
* Created on: 22 Jun 2011
* Author: "SevenMachines <SevenMachines@yahoo.co.uk>"
*/
#include "GridContainer.h"
#include <iostream>
namespace cryomesh {
namespace spacial {
GridContainer::GridContainer() : boundingBox(), values(){
}
GridContainer::GridContainer(const Point & point,... |
#include <boost/python.hpp>
#include "WeeklyUpdatePlots.hh"
#include "Trigger.hh"
using namespace boost::python;
BOOST_PYTHON_MODULE(libbryn) {
class_<Operation::WeeklyUpdatePlots, bases<Operation::_Base> >( "WeeklyUpdatePlots",
init<const Utils::ParameterSet&>());
class_<Operation::Trigger,... |
/*
* Myradius.cpp
*
* Created on: Aug 4, 2013
* Author: marchi
*/
#include "Myradius.h"
namespace Topol_NS {
InputRadii * Myradius::IR=NULL;
RadiiDBase * Myradius::RDB=NULL;
bool Myradius::init=false;
bool Myradius::bHyd=true;
int Myradius::count=0;
double Myradius::operator()(const string Residue, const ... |
/*
Check Cyclic BFS
*/
#include<bits/stdc++.h>
using namespace std;
bool checkForCycle(int s,int V,vector<int> adj[],vector<int> &vis){
queue<pair<int,int>> q;
vis[s]=1;
q.push({s,-1});
while(!q.empty()){
int node= q.front().first;
int parent=q.front().second;
q.pop();
... |
#include "LoginDialog.h"
#include "ui_LoginDialog.h"
#include "taskmgm/TaskCommit.h"
#include <QMessageBox>
using namespace Plugins;
LoginDialog::LoginDialog(QWidget *parent) :
QDialog(parent),
user("admin"),
password("admin"),
ui(new Ui::LoginDialog)
{
ui->setupUi(this);
QString qss = "min... |
#include "Debug/ILPOptimizationData.h"
#include "Analysis/ProgramPartitionAnalysis.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ValueMap.h"
#include ... |
//
// Created by 梁栋 on 2019-01-10.
//
#include <iostream>
#include <map>
using namespace std;
class Solution {
public:
int romanToInt(string s) {
map<string, int> romanInt{
{"I", 1},
{"IV", 4},
{"V", 5},
{"IX", 9},
{"X", 10},
... |
/*
* SPDX-FileCopyrightText: 2008 Till Harbaum <till@harbaum.org>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include "pos.h"
#include "project.h"
#include <ctime>
#include <vector>
struct canvas_item_t;
enum TrackVisibility {
RecordOnly, ///< record track, nothing drawn
ShowPosition, ... |
#pragma once
/**
* \brief Holds x,y coordinates
*/
class Coordinates
{
public:
Coordinates(int x, int y);
~Coordinates();
int X();
int Y();
private:
int x_;
int y_;
};
|
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#ifndef RECTANGLE_HH_
#define RECTANGLE_HH_
#include "Shape2D.h"
#include <iostream>
class Rectangle:public shape2D {
private:
double x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4;
public:
Rectangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4,
doub... |
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <vector>
int main(int argc, char **argv)
{
if (argc != 2) {
return 0;
}
std::ifstream f(argv[1]); // first argument is the test file
while (true) {
std::string l... |
#ifndef ARDUMANFX_H
#define ARDUMANFX_H
#include <QtCore>
#include <QtSerialPort>
#include <QtGui>
#include <QProgressBar>
#define PAGESIZE 256
#define BLOCKSIZE 65536
class ArduManFX
{
public:
struct FlashData
{
QImage titleImage;
QString description;
QString hexData;
QByteArray gameData;
QByteA... |
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int pow[501];
int n,p,l;
const int max_val = 1000000001;
string make(string s)
{
string ret = "";
for(int i=0;i<s.size();i++)
{
if(s[i] == 'X')
ret += "X+YF";
else if(s[i] == 'Y')
ret += "FX-Y";
else
ret += s[i];
}
re... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QStandardItemModel>
namespace Ui {
class MainWindow;
}
struct ModuleParam
{
enum ModuleParamType
{
TypeString,
TypeReal,
TypeInt,
TypeUrl,
TypeFile,
TypeColor,
TypeAny
};
... |
#include <iostream>
using namespace std;
struct CCar
{
int price;
};
void SetPrice(struct CCar* pthis,int p)
{
pthis->price = p;
}
class Car
{
public:
int price;
void SetPrice (int p);
};
void Car::SetPrice (int p)
{
price = p; //也可以显示地写出来:this->price = p;
}
void main()
... |
#ifndef _SERVICIOSHELL_H
#define _SERVICIOSHELL_H
#include "servicio.h"
#include "dominio.h"
class cServicioShell:public cServicio {
public:
//Constructor e iniciador
cServicioShell(cDominio *dominio);
bool iniciar();
//Cambia el password de una cuenta Shell en el sistema
int cambiarClaveShell(const std::... |
#include "CIL/tls.h"
#include <mutex>
#include "CIL/error.h"
#include "CIL/singleton.h"
namespace cil {
#ifdef WIN32
#ifdef _MSC_VER
#pragma warning(disable : 4505) // unreferenced local function has been removed
#endif
#ifndef TLS_OUT_OF_INDEXES
#define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
#endif
#endif
// TLS... |
#ifndef INX_ADDR_H
#define INX_ADDR_H
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ostream>
class INX_ADDR {
public:
INX_ADDR();
INX_ADDR(const char *);
INX_ADDR(const struct in_addr&);
INX_ADDR(const struct in6_addr&);
int version();
const char *ntop... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
/*
* actor.cpp
*
* Code generation for model "actor".
*
* Model version : 1.1483
* Simulink Coder version : 8.11 (R2016b) 25-Aug-2016
* C++ source code generated on : Fri Jan 19 11:20:06 2018
*
* Target selection: grt.tlc
* Note: GRT includes extra infrastructure and instrumentation for prototypi... |
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
struct node{
int value;
struct node *left;
struct node *right;
};
typedef struct node Node;
Node * create_node(int value){
Node * temp = (Node *)malloc(sizeof(Node));
temp->value = value;
temp->right= NULL;
temp->left = NULL;
return temp;
}
Node * addNode(Node *no... |
/***************************************
Author : jt
Mail : zhuiyitaosheng@gmail.com
***************************************/
#include <iostream>
//#include <cstring>
//#include <vector>
//#include <cstddef>
using namespace::std;
int main()
{
// cout << sizeof(char) << ' ' << sizeof(unsigned char) << ' ' << sizeo... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include<iostream>
using namespace std;
int setBit(int n,int pos){
return (n & (1>>pos))!=0;
}
void unique(int arr[],int n){
int sum=0;
for(int i=0; i<n;i++){
sum= sum ^ arr[i];
}
int tempsum=sum;
int setbit=0,pos=0;
while(setbit!=1){
setbit = sum&1;
pos++;
... |
#pragma once
#include "cocos2d.h"
/*
我曾经思考过一个C++注入机制,
现在我已经实现了类似的机制,但是没能让它自动被调用注册的代码,如今有个构思
在继承阶段,派生的初始化列表中增加调用派生类的static函数或者某些特定函数的可能性,这样子就能让继承之后实现注册。
这样子添加派生类代码时无需修改原先的代码,只需要重新编译即可
*/
#ifdef STD_VECTOR_ELEM
class MoveAbleElem
#else
class MoveAbleElem :public cocos2d::Ref
#endif
{
protected:
MoveAbleElem() :_pS... |
/*
* 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 <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
map<int,int> m;
for(int i=0;i<n;i++){
int temp;
cin >> temp;
m[temp]++;
}
sort(m.begin(), m.end(), [](auto a, auto b) {
return a.second == b.second ? a.first > b.first : a.second > b.... |
#include <bits/stdc++.h>
using namespace std;
#define fl(i, a, b) for (int i = (a); i < (b); i++)
#define flr(i, a, b) for(int i = (a); i >=(b); i--)
#define itr(i, A) for(auto i=A.begin(); i != A.end(); ++i)
#define pb push_back
#define mp make_pair
#define endl '\n'
#define int long long
typedef vector<int> VI;
int m... |
#include<iostream>
#include<cstdio>
#include<map>
#include<string.h>
using namespace std;
// long int arr[100000001];
long long int coin(long long int n)
{
if(n == 0)
return 0;
else if(n == 1)
return 1;
else if(arr[n] != -1)
{
return arr[n];
}
arr[n] = coin(n/2) + coin(n/... |
#include <gtest/gtest.h>
#include <ostream>
#include <istream>
#include <sstream>
#include <vector>
#include <core/debug/Debug.h>
#include <elements/simple_text_element.h>
#include <storage/file_storage.h>
#include <tags/tagmanager.h>
#include <tags/tag.h>
#define FS_FOLDER "test_file_storage_db/"
class FileStorage... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Security.EnterpriseData.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.Networking.0.h"
#include "Windows.Storage.0.h"
#include "Windows.Storage.... |
/**
* TGA Image Resource
*/
#ifndef FISHY_TGA_PARSER_H
#define FISHY_TGA_PARSER_H
#include <CORE/BASE/status.h>
#include <CORE/MEMORY/blob.h>
#include <CORE/types.h>
#include <algorithm>
#include <vector>
namespace core {
namespace util {
namespace files {
/**
* Container for a TGA Image
*/
class TGAImage {
p... |
#include "problem.hpp"
void build_problem(double *x,
int zstart, int nz, double dz,
int ystart, int ny, double dy,
int xstart, int nx, double dx,
double k) {
const double kdx = k*dx;
const double kdy = k*dy;
const double kdz = k*dz;
... |
#ifndef _INC__RPG2k__GAME_MODE_GAMEOVER
#define _INC__RPG2k__GAME_MODE_GAMEOVER
#include <GameMode.hpp>
namespace rpg2kLib
{
namespace gamemode
{
PP_defineGameMode(GameOver);
/*
class GameOver : public GameMode
{
private:
public:
GameOver(rpg2kLib::Main& m);
void reset();
void run(input::KeyLis... |
#pragma once
#include <ID.h>
#include <ValueElement.h>
#include <memory>
#include <iosfwd>
#include <cstddef>
class MetaScale;
class MetaValueBaseImplementation {
public:
using Interface = MetaValueBaseImplementation;
enum class Attributes {
HasUncertainty,
Size,
Rows,
Cols,
TypeID,
};
u... |
#pragma once
#include <frc/commands/TimedCommand.h>
/**
* Ejecte un hatch en le relachant et en sortant les pistons
* Fin au bout de x secondes
* A la fin, les pistons sont rentrés
*/
class EjecterHatch : public frc::TimedCommand
{
public:
explicit EjecterHatch();
void Initialize() override;
void Execute()... |
#pragma once
#include <functional>
#include <string>
#include <vector>
#include "actors/human.h"
#include "inputer.h"
using std::function;
using std::string;
using std::vector;
namespace lab3 {
class OldMan : public Human {
function<void(OldMan&, Game&)> ai_state_function;
static function<void(OldMan&, ... |
#ifndef FASTCG_POINT_LIGHT_H
#define FASTCG_POINT_LIGHT_H
#include <FastCG/Rendering/Light.h>
namespace FastCG
{
class PointLight : public Light
{
FASTCG_DECLARE_COMPONENT(PointLight, Light);
public:
inline float GetConstantAttenuation() const
{
return mConstantAttenuation;
}
inline void SetConstant... |
#include <iostream>
#include "MaterialLibrary.h"
#include <QDebug>
#include <QTextStream>
#include <QFile>
#include <QFileInfo>
#include "Material.h"
MaterialLibrary::MaterialLibrary()
{
}
MaterialLibrary::~MaterialLibrary()
{
}
void MaterialLibrary::addMaterial(Material* material)
{
if (!material) {
return;
}
... |
#pragma once
namespace distant::error
{
class winapi_category;
class winapi_error_code;
class winapi_error;
}
|
//-------------------------------------------------------------------
// Stillduino tempeture control for the Turbo 500 Still
//
// Based on the Sous Vide Controller
// Based on the Arduino PID and PID AutoTune Libraries
// by Brett Beauregard
//
// Version info
//
//
//
// V6 Added Start-Up mode after Warm Up mode
//
... |
#include "Sorcerer.hpp"
Sorcerer::Sorcerer()
{
}
Sorcerer::Sorcerer(std::string name, std::string title) : _name(name), _title(title)
{
std::cout << name << ", " << title << ", is born!" << std::endl;
}
Sorcerer::~Sorcerer()
{
std::cout << getName() << ", " << getTitle()
<<", is dead! Consequences will never be ... |
#include "Triangle.h"
Triangle::Triangle()
:Shape()
{
}
void Triangle::Set( int index0 , int index1 , int index2 )
{
mIndex[0] = index0;
mIndex[1] = index1;
mIndex[2] = index2;
} |
//
// Created by 79164 on 18.11.2020.
//
#include "../inc/interaction.h"
#include <string.h>
#include <algorithm>
#include <iostream>
using namespace udp_server;
DataProcessor::DataProcessor() {
m_ready_file = false;
};
DataProcessor::~DataProcessor() = default;
DataProcessor::data_from_client DataProcessor::pr... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#include <gtest/gtest.h>
#include "jactorioTests.h"
#include "game/logic/inserter_controller.h"
#include "game/logic/item_logistics.h"
#include "proto/container_entity.h"
#include "proto/inserter.h"
#include "proto/mi... |
#ifndef __CLUCK2SESAME_PLATFORM_POWERMANAGEMENT_ISR_INC
#define __CLUCK2SESAME_PLATFORM_POWERMANAGEMENT_ISR_INC
#include "PowerManagement/PowerManagement.inc"
#endif
|
#pragma once
#include <string>
using namespace std;
/* TreeNode struct*/
struct TreeNode
{
string letter;
TreeNode* left = NULL;
TreeNode* right = NULL;
TreeNode()
{
letter = "";
}
TreeNode(string newLetter)
{
letter = newLetter;
}
}; |
/*
* ServerCLI.h
*
* Created on: Aug 27, 2017
* Author: user
*/
#ifndef SERVERCLI_H_
#define SERVERCLI_H_
#include <iostream>
#include <string>
#include "ServerManager.h"
using namespace std;
using namespace npl;
class ServerCLI /*: public MThread*/ {
public:
void runCLI();
void printMenu();
//void run()... |
/********************************************************************************
** Form generated from reading UI file 'clusteringDlg.ui'
**
** Created by: Qt User Interface Compiler version 5.9.3
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
*************************************... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.