text stringlengths 8 6.88M |
|---|
// compile (for debugging): g++ -Wall -Wextra -fsanitize=undefined,address -D_GLIBCXX_DEBUG -g <file>
// compile (as on judge): g++ -x c++ -Wall -O2 -static -pipe <file>
// Output file will be a.out in both cases
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
/*
S... |
class Solution {
public:
vector<int> grayCode(int n) {
vector<int> result(pow(2,n),-1);
result[0] = 0;
if(n == 0) return result;
result[1] = 1;
int pos = 2;
for(int i = 1; i < n; i++)
{
int temp = 1<<i;
for(int j = pow(2,i)-1; j >= 0; j... |
#include<bits/stdc++.h>
using namespace std;
void solve(int n)
{
int* fib = new int[n];
fib[0]=0;
fib[1]=1;
for(int i=2;i<n;i++)
{
fib[i]=fib[i-1]+fib[i-2];
}
for(int i=n-1;i>=0;i--)
{
cout << fib[i] << " ";
}
cout << endl;
return ;
}
int main()
{
int n;
cin >> n;
solve(n);
return 0;
} |
#ifndef BTREE_BTREE_H
#define BTREE_BTREE_H
#define NULL 0
#include <algorithm>
// btree节点
struct b_node {
int num; // 当前节点key的数量
int dim;
int pos_in_parent; // 在父节点中的位置
int* keys;
b_node* parent; // 父节点
b_node** childs; // 所有子节点
b_node() {
}
b_node (int _dim) : num(0), parent(NULL), pos_in_parent(... |
/**
* ****************************************************************************
* Copyright (c) 2015, Robert Lukierski.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributi... |
#include "stuManager.h"
/*
【公用函数】——————————————————————————————————————
*/
// 输入数字
int inputInt() {
int a, result;
fflush(stdin);
a = scanf("%d",&result);
if(a == 0)
{
printf("\n【输入数字】输入错误,请重新输入: ");
result = inputInt();
}
return result;
}
// 功能表
void menu()
{
printf("\n\n **... |
#include "UpdateAutocall.h"
void UpdateAutocall::update(FDM & fdm) const
{
}
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "RawFileReaderComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class RAWFILEREADERUE4_API URawFileRea... |
/* methods for Tree class */
#include <assert.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// (re)compute height
template <class T>
void Tree<T>::updateHeight()
{
if (left == NULL && right == NULL)
{
height = 0;
}
else if (left == NULL)
{
right->updateHeight();
height... |
#include<iostream>
using namespace std;
void allorder(string str,int index)
{
if (index == str.size() - 1) //当分解到最后一个字符时 输出序列
{
for (int i = 0; i < str.size(); i++)
{
cout << str[i];
}
cout << endl;
}
else {
for (int i = index; i < str.size(); i++) //相当于固定第一位 共有n种 就也就是遍历完string每个元素都可做第一位
{
... |
#ifndef _HS_SFM_SYNTHETIC_RELATIVE_PAIR_GENERATOR_HPP_
#define _HS_SFM_SYNTHETIC_RELATIVE_PAIR_GENERATOR_HPP_
#include "hs_math/random/normal_random_var.hpp"
#include "hs_math/random/uniform_random_var.hpp"
#include "hs_math/geometry/euler_angles.hpp"
#include "hs_sfm/sfm_utility/camera_type.hpp"
#include "hs_sfm/sf... |
#include "MChar.hpp"
#include <string>
#include <stdexcept>
using UTF8 = std::char_traits<char>;
using namespace MUSCII;
//------------------------------------------------------------------------------ Constructor(s)
MChar::MChar ()
{
}
MChar::MChar (int8_t position)
{
this->position = position;
}
MChar::MChar... |
#ifndef TCPSERVER_H
#define TCPSERVER_H
#include <functional>
#include <list>
#include <memory>
#include <boost/asio.hpp>
#include <boost/regex.hpp>
struct Client
{
Client(boost::asio::io_service * servise) : sock(*servise) {}
boost::asio::ip::tcp::socket sock;
boost::asio::streambuf buff;
};
class TcpServer
{
p... |
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<vector>
#include<set>
using namespace std;
using pii = pair<int, int>;
unordered_set<int> prod; // valid product list
unordered_map<string, int> htab; // tag hash table
set<pii> s[1003]; // tag별 poduct list ( first:가격, second: id )
int tcn... |
# include <iostream>
using namespace std;
inline int find(int *a, int n, int v) { for (int i = 0; i < n; ++i) if (a[i] == v) return i; }
inline void update(int *a, int n, int i, int j) {
if (i < j) for (int c = i; c + 1 <= j; ++c) swap(a[c], a[c + 1]);
else for (int c = i; c - 1 >= j; --c) swap(a[c], a[c - 1... |
#include "Weapon.hpp"
Weapon::Weapon(RenderWindow* window, b2World* World, TempObjectHandler* toh, float PositionX, float PositionY, int Ammunition){
Window=window;
world=World;
TOH=toh;
damage=3;
clipsize=10;
clip=clipsize;
ammunition=Ammunition-clip;
... |
#include "CUnit.h"
#include "Integrator.h"
#include "CUnit.h"
#include "Differentiator.h"
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define EPS (1.E-8)
#define EPS1 (1.E-9)
double Linear(double x) {
return x;
}
//5x³-3x²-x+9
double Polynominal(double x) {
return 5 * x * x * x + (-3) * x * x + (... |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Name: Braydon Hampton
// File: main.cpp
#include <iostream>
#include <limits>
#include "mystring.h"
// Global Variables
const int MAX_BUF = 1024;
char name[MAX_BUF];
char status[MAX_BUF];
char delim[MAX_BUF] = {" ,.?!\";:"};
void name_... |
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int n,num,nbits,mask,i,suma;
n=sizeof(int)*8;
nbits=0;
mask=00000001;
printf("Introduzca numero en binario: \n");
scanf("%d",&num);
for(i=0;i<n;i++)
{
suma=num&mask;
if (suma==00000001)
{
nbits++;
}
}
printf("numero... |
#ifndef _PLAINVANILLA_PAYOFF_H_
#define _PLAINVANILLA_PAYOFF_H_
#include "payoff.h"
#include "option.h"
class PlainVanillaPayoff: public Payoff {
public:
PlainVanillaPayoff(double strike, OptionType type);
virtual double operator()(double s);
private:
double strike_;
OptionType type_;
};
#endif
|
#pragma once
#include <iostream>
struct DataRecord
{
int pid;
int rid;
char name[768];
friend std::ostream& operator <<(std::ostream& os, DataRecord &r)
{
return os << "{" << "pid = " << r.pid << ", " << "rid = " << r.rid << ", " << "name = " << r.name << "}";
}
}; |
#pragma once
#include <torch/extension.h>
#include <vector>
#include "adjacency.h"
#include "iterate.h"
using namespace at;
using namespace std;
inline int64_t pair(int64_t u, int64_t v) {
return u >= v ? u * u + u + v : u + v * v;
}
inline Tensor convert(Tensor x) {
auto range = torch::empty(x.size(1), x.opti... |
#pragma once
#include <string>
class TextFile
{
public:
TextFile();
~TextFile();
public:
void load(const char* fileName);
void save(const char* fileName);
void clear();
void write(const char* data);
void display() const;
private:
std::string _data{};
};
|
#include <gtest/gtest.h>
#include <memory>
#include <stdext/path.h>
#include <stdext/path_iterator.h>
#if defined(_WIN32) || defined(_WIN64)
std::string to_winsep(const char *s) {
std::string t(s);
std::replace(t.begin(), t.end(), '/', '\\');
return t;
}
std::wstring to_winsep(const wchar_t *s) {
std::wstring ... |
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#include "pins_arduino.h"
#include "WConstants.h"
#endif
#include "_DART_Touch_Sensor.h"
CapacitiveSensor::CapacitiveSensor(uint8_t sendPin, uint8_t receivePin)
{
uint8_t sPort, rPort;
sBit = digitalPinToBitMask(sendPin); ... |
/*
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... |
/**
* Reduce dataset size by subsampling.
*
* Jason Leake October 2019
*/
#include "Mean.h"
#include "Row.h"
#include "Rows.h"
#include "cleaner_files/Reduce.h"
#include "util.h"
#include <filesystem>
#include <fstream>
#include <iostream>
#include <map>
using namespace std;
using namespace cleaner;
/**
* Subsa... |
/***********************************************************************
created: 27/01/2022
author: Vladimir Orlov
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2022 Pau... |
#include <irtkTransformation.h>
char *dofin_name1 = NULL;
char *dofin_name2 = NULL;
char *affine_out_name = NULL;
void usage()
{
cerr << "Usage: affinecompose [doffile1] [doffile2] [doffileOut]" << endl;
cerr << " doffile1 doffile2" << endl;
cerr << "src1 <------- tgt1 = src2 <------- tg... |
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_TrenchCoatAdministrator.h"
class TrenchCoatAdministrator : public QMainWindow
{
Q_OBJECT
public:
TrenchCoatAdministrator(QWidget *parent = Q_NULLPTR);
private:
Ui::TrenchCoatAdministratorClass ui;
};
|
// find the sum of the series x^3/36 + x^5/56 + x^7/76 +...+x^11/116
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int i,sum=0,x,a=36;
cout<<endl<<"enter the value of x: ";
cin>>x;
// logic for the sum of the series
for(i=3;i<=11;i+=2,a+=20)
sum=sum+(pow(x,i)/a);
... |
#include "BeamTree.h"
#include "WblsDaqEvent.h"
#include "WFAnalyzer.h"
#include "TTree.h"
#include "TFile.h"
#include <iostream>
#include <vector>
#include <string>
#include <cstdio>
using namespace std;
BeamTree::BeamTree(int startRun, int endRun, string desc, bool isLS)
{
fStartRun = startRun;
fEndRun = ... |
#pragma once
#include <string>
#include <vector>
#include "Arc.h"
using namespace std;
class Node {
string id;
string type;
vector<Arc> successors;
public:
Node(string, string);
Node();
string getId();
string getType();
void addSuccessor(Arc);
vector<Arc> getSuccessors();
};
Node::Node... |
#include "navigation.h"
#include "ui_navigation.h"
navigation::navigation(QWidget *parent) :
QWidget(parent),
ui(new Ui::navigation)
{
ui->setupUi(this);
}
navigation::~navigation()
{
delete ui;
}
|
#pragma once
#include "IndexBuffer.h"
#include "Shader.h"
#include "TextureManager.h"
#include "VertexBuffer.h"
#include "D3DX9.h"
#include <bgfx/bgfx.h>
class RenderDevice
{
public:
enum TransformStateType
{
TRANSFORMSTATE_WORLD = D3DTS_WORLD,
TRANSFORMSTATE_VIEW = D3DTS_VIEW,
TRANSFORMSTATE_PROJECTION = D... |
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cmath>
#include "mc.h"
#include "auxiliary.h"
using namespace std;
void mc :: read_from_in(ifstream& in)
{
string label_act_p = "begin_action_probability";
string tmp;
strin... |
//
// Recorder - a GPS logger app for Windows Mobile
// Copyright (C) 2006-2019 Michael Fink
//
/// \file DisplayOffManager.cpp Display off manager
//
#include "StdAfx.h"
#include "DisplayOffManager.hpp"
#include "VideoPowerManager.hpp"
#include "Logger.hpp"
// note: these are defined in <winuserm.h>
struct VKeyToName... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.ApplicationModel.Chat.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.Media.MediaProperties.0.h"
#include "Windows.Security.Credentials.0.h"
#inc... |
#ifndef SHADER_H
#define SHADER_H
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
namespace renderer {
class Shader {
public:
unsigned int ID;
Shader(const char* vertex_path, const char* fragment_path) {
std::string vertex_code... |
#ifndef _H_NEWTON_UTILS_
#define _H_NEWTON_UTILS_
class NewtonWorld;
class NewtonCollision;
#include <irrlicht.h>
#include "types.h"
struct SObject
{
SObject(vector3 const & position, NewtonCollision *nwtn_collision_) :
pos(position), nwtn_collision(nwtn_collision_)
{
}
//Irrlicht scene node
//irr::scene::... |
#include <iostream>
#include <vector>
using namespace std;
int n;
void gen(string s, int prev) {
if (s.size() == 2*n) {
cout << s << endl;
return;
}
gen(s + '0' + " ", 0);
if (prev != 1) {
gen(s + '1' + " ", 1);
}
}
int main() {
cin >> n;
gen("", 0);
return 0... |
#include "Logging.h"
#include <QDebug>
Logging::Logging()
{
}
void Logging::logStatus(QString status)
{
qDebug() << QString("TIME: ")
.append(QTime::currentTime().toString())
.append(" STATUS: ")
.append(status);
}
void Logging::logWarning(QString warning)
{
qD... |
#include "CPlayer.h"
#include "CBaseEngine.h"
#include "macros.h"
#include "DescriptorList.h"
#include "utils/math.h"
#include "utils/FilteredClosestRayResultCallback.h"
void CPlayer::think(){
m_yaw += -engine->input->getMouseDelta().x * engine->getTimeScale() * 0.005;
m_pitch += -engine->input->getMo... |
/***************************************************************************
* Filename : Buffer.cpp
* Name : Ori Lazar
* Date : 29/10/2019
* Description : Creates buffers dependent on their respective APIs.
.---.
.'_:___".
|__ --==|
[ ] :[|
|__| I=[|
/ / ____|
|-/.____.'
/___\ /___\
*... |
/*
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>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
using namespace std;
//@一航代码
const int inf = 99999999;//不可到达
int main()
{
int n, m, s, t, a;
while (cin >> n >> m >> s >> t >> a)
{
vector<vector<int>> e(n + 2, vector<int>(n + 2)); //邻接矩阵
vector<... |
#pragma once
#include "StaticObject.h"
class House :
public StaticObject
{
public:
House();
House(int id, std::string name, int posX, int posY);
~House();
};
|
// Copyright Steinwurf ApS 2011-2013.
// Distributed under the "STEINWURF RESEARCH LICENSE 1.0".
// See accompanying file LICENSE.rst or
// http://www.steinwurf.com/licensing
#pragma once
#include <cstdint>
#include <cassert>
#include <string>
#include <functional>
#include <kodoc/kodoc.h>
#include <memory>
namespa... |
//
// CircularProgress.h
// SMFrameWork
//
// Created by KimSteve on 2016. 12. 1..
//
// Material CircularProgressView (Android opensource)
// https://github.com/rahatarmanahmed/CircularProgressView
#ifndef CircularProgress_h
#define CircularProgress_h
#include <2d/CCNode.h>
#include <base/ccTypes.h>
#include <... |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long long range = 1;
int count = 1;
long long t = 1;
while (1) {
if (range >= n)
break;
t = 6 * (count++);
range += t;
}
cout << count << endl;
return 0;
} |
#include "Color.h"
#include <math.h>
#include <sstream>
const Color Color::BLACK(0.0f, 0.0f, 0.0f);
const Color Color::WHITE(1.0f, 1.0f, 1.0f);
const Color Color::GRAY(0.5f, 0.5f, 0.5f);
const Color Color::RED(1.0f, 0.0f, 0.0f);
const Color Color::GREEN(0.0f, 1.0f, 0.0f);
const Color Color::BLUE(0.0f, 0.0f, 1.0f);
con... |
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include "opencv2/core/core.hpp"
using namespace cv;
using namespace std;
int main()
{
int i, j, a[256] = { 0 }, pos;
long total, sum;
Mat img = imread("C:\\Users\\ariji\\Desktop\\a.png", 0);
for (i ... |
//
// AccountHandler.cpp
// BankAccount
//
// Created by ace on 2016. 5. 23..
// Copyright © 2016년 origin. All rights reserved.
//
#include "AccountHandler.hpp"
#include "SQLquery.hpp"
#include "Account.hpp"
#include "config_file.hpp"
AccountHandler::AccountHandler()
{
Acc = new Account;
sqlquery = new ac... |
/***************************************************************************
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 <bits/stdc++.h>
#define ll long long
using namespace std;
ll dp[102][102],n,k;
ll mod=1000000;
ll go(ll cnt,ll sum)
{
ll ans=0;
if(sum>n)return 0;
if(sum==n && cnt==k)
{
return 1;
}
if(cnt>=k || sum>n || (cnt>=k && sum!=n))return 0;
if(dp[cnt][sum]!=-1)return dp[cnt][sum];
... |
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << ": " << x << endl;
#define iosbase ios_base::sync_with_stdio(false)
#define tie cin.tie();cout.tie();
#define endl '\n'
typedef pair<int, int> ii;
typedef long long ll;
int n, m;
int main(){
iosbase;
tie;
int t; cin >> t;
while( t... |
#include <cstring>
#include "library.h"
#include <iostream>
using namespace std;
void letraM(int vC[25], const std::string& frase){
int ascii = 65;//maiusculo
int tamanho = frase.length();
for(int i=0;i<=25;i++){
for(int j=0; j < tamanho;j++){
if(frase[j] == ascii) vC[i]++;
... |
// This file has been generated by Py++.
#ifndef OpenGLRenderer_hpp__pyplusplus_wrapper
#define OpenGLRenderer_hpp__pyplusplus_wrapper
void register_OpenGLRenderer_class();
#endif//OpenGLRenderer_hpp__pyplusplus_wrapper
|
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#include <whiskey/Printing/Precedence.hpp>
#include <whiskey/Core/Assert.hpp>
namespace whiskey {
Precedence getPrecedence(NodeType type) {
switch (type) {
case NodeType::None:
return Precedence::None;
case NodeType::List:
return Precedence::None;
case NodeType::TypeVoid:
return Preced... |
// This file has been generated by Py++.
#ifndef RenderEffect_hpp__pyplusplus_wrapper
#define RenderEffect_hpp__pyplusplus_wrapper
void register_RenderEffect_class();
#endif//RenderEffect_hpp__pyplusplus_wrapper
|
// caml_dgesvd.cpp -- Glue routine to LAPACK dgesvd() function
//
// DM/MCFA 11/06
// ---------------------------------------------------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <string.h>
#include <Accelerate/Accelerate.h>
double *c_matrix_to_fo... |
// cigarParser.h
// Author: Izaak Coleman
#ifndef CIGAR_PARSER
#define CIGAR_PARSER
#include <string>
class CigarParser {
/* Provides array access to cigar elements as the main functional interface.
Two functions in the main functional interface:
CigarParser::length_at(i) -> returns number of bases assi... |
/*
*
*/
#ifndef __OBJECT_H
#define __OBJECT_H
#include "terrain.h"
#include "vector.h"
#include "h.h"
class Object
{
public:
enum object_type
{
ENEMY,
PLAYER,
ROCKET,
UNDEFINED,
};
enum object_status
{
DEFAULT,
STAND,
SQUAT,
CRAWL,
IS_JUMPING,
IS_NOT_JUMPING,
... |
//
// Copyright Jason Rice 2015
// 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)
//
#ifndef NBDL_HASH_HPP
#define NBDL_HASH_HPP
#include <functional>
namespace nbdl {
namespace detail {
// sort of excerpted fro... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int p, q, l;
long long m, s, baris, kolom;
cin>>p>>l>>s;
if (p>=1&&p<=1000000&&l>=1&&l<=1000000&&s>=1&&s<=1000000){
if (p<s&&l<s){
cout<<"0"<<endl;
... |
#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class user : public eosio::contract
{
public:
using contract::contract;
/// @abi table details i64
struct details
{
uint64_t id;
account_name name;
uint64_t prim... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#include <gtest/gtest.h>
#include <filesystem>
#include "core/crash_handler.h"
int main(int ac, char* av[]) {
current_path(std::filesystem::path(av[0]).parent_path());
jactorio::RegisterCrashHandler();
... |
#ifndef SPARSEMATRIX
#define SPARSEMATRIX
#include<vector>
struct SparseMatrix
{
unsigned int dimension;
std::vector<float> val;
std::vector<unsigned int> col;
std::vector<unsigned int> rowptr;
void AddConnection(const unsigned int row, const unsigned int column, float value);
void EraseConnec... |
#include <bits/stdc++.h>
using namespace std;
void print(vector<int> v){
for(int i=0;i<v.size();i++){
cout << v[i]<< ","; }
cout << endl;
}
int main(){
int Q;
cin >> Q;
for(int a0 = 0; a0 < Q; a0++){
int n;
cin >> n;
string b;
cin >> b;
bool unde... |
#include "gtest/gtest.h"
#include "common.h"
#include "c8.h"
#include "c8_private.h"
// determinted by a objectively random dice roll on my table
const uint32_t TEST_SEED = 4;
class c8_opcode : public ::testing::Test {
protected:
C8_Random_ptr _rnd;
C8_Display_ptr disp;
C8_Keyboard_ptr keys;
C8_ptr... |
//------------------------------------------------------------------------------
// File: TagInfo.cpp
//
// Description: Tag information object
//
// License: Copyright 2013, Phil Harvey (phil at owl.phy.queensu.ca)
//
// This is software, in whole or part, is free for use in
// non... |
#include "Application.h"
#include "GraphicsEngine/CameraAnimation.h"
#include "GraphicsEngine/FogAnimation.h"
#include <functional>
#include "GraphicsEngine/KeyAnimation.h"
#include "GraphicsEngine/GeneralAnimation.h"
using namespace Common;
using namespace Win32Application;
using namespace GraphicsEngine;
using nam... |
#include "ReplyButton.h"
#include "View.h"
ReplyButton::ReplyButton( QGraphicsScene *Scene , int season , int level) : replayButtonScene{Scene}
{
clickReplayButton = false;
//set picture
setPixmap(QPixmap(":/images/replay.png"));
//add to scene
Scene->addItem(this);
//setPos
setPos(750... |
#pragma once
/** Summary:NOTE!!!
29,31,32,33 are broken values for my charset which length is 30.
*/
class Affine
{
private:
char Turkish[30] = {' ', 'a','b','c','ç','d','e','f','g','ð','h','ý','i','j','k','l','m','n','o','ö','p','r','s','þ','t','u','ü','v','y','z' };
public:
void Encryption(char* mesaj, int key... |
/**
* **** Code generated by the RIDL Compiler ****
* RIDL has been developed by:
* Remedy IT
* Westervoort, GLD
* The Netherlands
* http://www.remedy.nl
*/
#ifndef __RIDL_TESTC_H_BHCDAACA_INCLUDED__
#define __RIDL_TESTC_H_BHCDAACA_INCLUDED__
#pragma once
#include /**/ "ace/pre.h"... |
#ifndef CODEVISITOR_H
#define CODEVISITOR_H
//forward declarations
class AddressI;
class ArrayAllocI;
class ArrayAccessI;
class ArrayAssignmentI;
class ArrayParamI;
class BinAssignmentI;
class CallI;
class GotoI;
class IfI;
class LengthI;
class ParamI;
class ReadI;
class ReturnI;
class RetValI;
class SimpleAssignment... |
/**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include "particle_filter.h"
#include <math.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include "helper_functions.h"
using namespace st... |
/*
*
* 对特征做了缩放处理,能涨到0.6645左右
*
* feat_value /= sum_feat_value
* feat_value *= sqrt(sum_feat_value)
*
train auc:0.69211 test auc:0.664456
train auc:0.692249 test auc:0.66446
train auc:0.692388 test auc:0.664459
train auc:0.692525 test auc:0.664463
train auc:0.692662 test auc:0.664463
trai... |
// github.com/andy489
// https://www.hackerrank.com/contests/practice-2-sda/challenges/monster-world/
#include <cstdio>
#include <algorithm>
using namespace std;
const int mxN = 200000 + 5;
int n, x, p, A[mxN],i;
int main() {
scanf("%d%d", &n, &x);
for (; i < n; ++i)
scanf("%d", &A[i]);
sort... |
#include <ros/ros.h>
#include "sh2interface/encoder.h"
#include "calc_odometry/EncoderData.h"
EncoderData::EncoderData()
{
encoder_sub_ = nh_.subscribe("encoder", 1000, &EncoderData::encoderCallback, this);
clear();
}
EncoderData EncoderData::operator=(const EncoderData &other)
{
encoder_data_[0] = other.encode... |
/*
GameKit
Copyright (c) 2009 Erwin Coumans http://gamekit.googlecode.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any pu... |
// p213
#include <iostream>
using namespace std;
int cache[2500][2500];
int someObscureFUnc(int a, int b){
if (...) return ...;
int& res = cache[a][b];
// -1이 아니라는 것은 이미 방문한 곳.
if(res!=-1) return res;
...
return res;
}
int main(){
memset(cache, -1, sizeof(cache));
}
|
// Filename: cPetBrain.h
// Created by: darren (13Jul04)
//
////////////////////////////////////////////////////////////////////
#ifndef CPETBRAIN_H
#define CPETBRAIN_H
#include "toontownbase.h"
#include "nodePath.h"
class EXPCL_TOONTOWN CPetBrain {
PUBLISHED:
CPetBrain();
bool is_attending_us(NodePath &us, Nod... |
#pragma once
#include "analysis/physics/Physics.h"
#include "plot/PromptRandomHist.h"
#include <vector>
class TH1D;
class TTree;
namespace ant {
namespace analysis {
namespace physics {
class IMPlots : public Physics {
public:
PromptRandom::Switch prs;
std::vector<PromptRandom::Hist1> m;
unsigned MinNG... |
// This code demonstrates:
//
// - A class derived from c4_Strategy to implement encrypted storage.
// - Disabling the Flush calls issued during Commit() for speed.
// - Using c4_Strategy objects as the basis of all file I/O in Metakit.
#include "mk4.h"
#include "mk4io.h"
#include <string.h>
////////////////////... |
//
// WindowData.hpp
// PaperBounce3
//
// Created by Chaim Gingold on 9/12/16.
//
//
#ifndef WindowData_hpp
#define WindowData_hpp
#include "View.h"
#include "PipelineStageView.h"
#include <memory>
class PaperBounce3App;
class WindowData {
public:
WindowData( WindowRef window, bool isUIWindow, PaperBounce3App... |
#pragma once
#include "Vector"
class Object;
class Scene;
class Material;
class Ray final
{
public:
Ray()
:m_ActiveScene{ nullptr }
, m_Origin{0,0,0}
, m_Direction{ vec3{0,0,-1.f}.Normalised() }
, m_RenderDist{1000.0f}
{
}
Ray(Scene* pScene, const vec3& o, const vec3& d, const float renderDist)
:m_Active... |
#include "mbed.h"
Ticker tiTimer;
DigitalIn Button(PC_13);
DigitalOut ledGreen(PB_3);
DigitalOut ledYellow(PB_5);
DigitalOut ledRed(PB_4);
// --- Types ---
enum STATE {
stINIT, stGREEN, stYELLOW, stRED, stWAIT, stYELLOW_RED
};
// --- Variables ---
STATE enState = stINIT;
int nTime = 0;
int nStateChanged = 0;
/... |
/* #line 1 "/home/demo/rose/src/ROSETTA/Grammar/grammarAST_FileIoHeader.code" */
#ifndef AST_FILE_IO_HEADER
#define AST_FILE_IO_HEADER
#include "AstSpecificDataManagingClass.h"
#include <ostream>
#include <string>
/* JH (11/23/2005) : This class provides all memory management ans methods to handle the
file storage... |
/* 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 "AS IS" WITHOUT
* WARRANTY OF ANY KIND, EITHER E... |
#include <cmath>
#include <complex>
#include "CImg.h"
using namespace std;
complex<double> f( complex<double> z ) {
if( abs( z ) < 0.000001 ) {
return 0;
}
return z + complex<double>( 1 ) / z;
}
void painting( const int height, const int width, const char* src_file_name ) {
cimg_library::CIm... |
/* unparser.h
* This header file contains the class declaration for the newest unparser. Six
* C files include this header file: unparser.C, modified_sage.C, unparse_stmt.C,
* unparse_expr.C, unparse_type.C, and unparse_sym.C.
*/
#ifndef UNPARSER_FORTRAN
#define UNPARSER_FORTRAN
#include "unparser.h"
class For... |
// RecordDialog.cpp : implementation file
//
#include "stdafx.h"
#include "ComputerizedDanceClassroomApplication.h"
#include "RecordDialog.h"
#include "afxdialogex.h"
#include "ComputerizedDanceClassroomApplicationDlg.h"
#include <string>
#include "ExitDialog.h"
#include "CheckFilesDialog.h"
#include "GlutRecordDialog... |
#include <iostream>
#include <ctime>
using namespace std;
const int MAXRAND = 7;
class graph{
/* for creating undirected graphs */
public:
graph(int i = 25, double d = .1):num_nodes(i),density(d),num_edges(0){ // density must be between 1 and 0
array = static_cast<int **>(malloc(num_nodes * sizeof(int*)));
... |
#pragma once
#include "gui/BMFont.h"
namespace ouzel
{
enum UTFChars
{
ASCII = 1,
ASCIIPLUS = 1 << 1
};
class FTFont : public BMFont
{
public:
FTFont();
FTFont(const std::string& filename, uint16_t pt, UTFChars flag = ASCII);
protected:
bool parseF... |
//
// Compiler/IR/LLVMContextProvider.h
//
// Brian T. Kelley <brian@briantkelley.com>
// Copyright (c) 2014 Brian T. Kelley
//
// This software is licensed as described in the file LICENSE, which you should have received as part of this distribution.
//
#ifndef COMPILER_IR_LLVMCONTEXTPROVIDER_H
#define COMPILER_IR_LLV... |
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 8 // DS18B20 pin
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("");
Serial.println("");
Serial.println("Inicializan... |
#include "include/ray.h"
#include "include/sphere.h"
#include "include/tuple.h"
#include "include/transform.h"
#include "include/matrix.h"
#include "gtest/gtest.h"
#include <cmath>
class SphereFixture : public ::testing::Test {
protected:
virtual void SetUp()
{
ray = new raytracer::Ray();
tr... |
#pragma once
#include "../Model.h"
#include "AffinityMatrix.h"
#include "../Clustering/SelfTuning/SpectralClustering.h"
#include "../Clustering/NCut/ncutLib/include/ncuts/ncutW.h"
class CSceneList;
class CModelKernel
{
public:
CModelKernel(void);
~CModelKernel(void);
CModelKernel(CSceneList *pSceneList);
////... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.