text stringlengths 8 6.88M |
|---|
#include <iostream>
#include <string>
using namespace std;
void rowm(char i, char f, int lado, bool s){
if(s){ i = ' '; f = '*';}
printf("%c%s%c%s%c\n", i, string(lado-1,' ').c_str(), '*', string(lado-1,' ').c_str(),f);
}
void extr(char i, char f, int lado, bool s){
if(s){ i = '*'; f = ' ';}
printf("%c... |
#include "TsFileReader.h"
#include "PrintLog.h"
#include <memory.h>
CTsFileReader::CTsFileReader()
{
m_file = NULL;
m_file_size = 0;
m_cur_pcr = -1;
m_first_pcr = -1;
m_last_pcr = -1;
}
CTsFileReader::~CTsFileReader()
{
if( m_file != NULL )
fclose( m_file ), m_file = NULL;
}
int CTsFileReader::Init( const ch... |
//////////////////////////////////////////////////////////////////////////////////////////////
// Automatic regression tests for the EmBrowser API
//////////////////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#ifdef WIN32
#include <windows.h>
#include <wchar.h>
#in... |
#include <QDebug>
const quint8 SData[16][16]={
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
{0xD6, 0x90, 0xE9, 0xFE, 0xCC, 0xE1, 0x3D, 0xB7, 0x16, 0xB6, 0x14, 0xC2, 0x28, 0xFB, 0x2C, 0x05},
{0x2B, 0x67, 0x9A, 0x76, 0x2A, 0xBE, 0x04, 0xC3, 0xAA, 0x44, 0x13... |
#include "dummy_guesser.h"
#include "utils.h"
int DummyGuesser::decideGuess() const
{
return randomNumber();
}
|
//
// Created by heze on 17-12-29.
//
#ifndef DATASTRUCTURE_BINARYSORTINGTREE_H
#define DATASTRUCTURE_BINARYSORTINGTREE_H
//建立二叉排序树,二叉排序树是数据元素不重复的。内部有序,左子树小于根,右子树大于根
#include<iostream>
#include <iostream>
#include <algorithm>
#include <ctime>
using namespace std;
//定义树结点
template<typename DataType>
struct BiTreeNod... |
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include <locale.h>
#include <ctype.h>
float cotacao,quantidade,real;
int x=0;
int main()
{
printf("\n Digite a cotacao atual do dolar:\n");
scanf("%f",&cotacao);
printf("\n ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef _SVG_RENDERER_
#define _SVG_RENDERER_
#ifdef SVG_SUPPORT
#... |
/**
* @file sum_of_squares.cc
* @author Gerbrand De Laender
* @date 17/12/2020
* @version 1.0
*
* @brief E091103, Master thesis, HLS testing
*
* @section DESCRIPTION
*
* IP that calculates the sum of the squares of an incoming AXI stream.
*
*/
#include <hls_stream.h>
#include <ap_axi_sdata.... |
#ifndef SAVEHYPER_H
#define SAVEHYPER_H
#include <QtWidgets/QDialog>
#include "ui_SaveHyperDialog.h"
class SaveHyper : public QDialog
{
Q_OBJECT
public:
SaveHyper(QString defaultProject, QString currentDir, QString imageSize, QString currentCam, QWidget *parent = 0);
~SaveHyper();
public slots:
void... |
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define lld long long int
#define N 4
int ans[N][N] = {0};
int moveX[] = {0, 1};
int moveY[] = {1, 0};
void print() {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++)
cout << setw(2) << ans[i][j] << " ";
cout << endl;
}... |
/**
* Unit Tests for Piezas
**/
#include <gtest/gtest.h>
#include <iostream>
#include "Piezas.h"
#define fot(i,j) for(int i = 0, j = 0; j < BOARD_ROWS && i < BOARD_COLS; (i == BOARD_ROWS) ? i = 0, j++ : i++)
class PiezasTest : public ::testing::Test
{
protected:
PiezasTest(){} //constructor runs before each test... |
#pragma once
#include <map>
#include <vector>
#include <string>
#include <algorithm>
class BagOfWords {
std::map<std::string, int> wordMap;
public:
BagOfWords(std::string review);
int getNumberOfOccurencesOfWord(std::string word);
std::vector<std::string> findUniqueWords();
bool operator==(const BagOfWords& rhs... |
/*----------------------------------------------------
<<CHSStackテンプレートクラス>>
機能:汎用スタック
作成日:2015/12/13
作成者:ヒロソフ
----------------------------------------------------*/
#ifndef __HS_STACK__
#define __HS_STACK__
template<typename T> class CHSStack {
private:
template<typename T> struct THSStackData {
T ... |
/**糖果大战
*https://blog.csdn.net/wuxinxiaohuangdou/article/details/10263103
*f(A) = f(A|B1)f(B1) + f(A|B2)f(B2) + f(A|B3)f(B3) +....
*1获胜的概率p,2获胜的概率q
*设f(A)为手上有A个糖果时获胜的概率
*f(A) = f(A+1)q(1-p) + f(A-1)p(1-q) + f(A)(1-(1-p)-(1-q))
/////////////////////
*p(1-q)*(f(i+1)-f(i)) = q(1-p)*(f(i)-f(i-1))
*令g(i)=f(i)-f(i-1),
则有p(1-... |
#include <X11/Xlib.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
int main() {
Display *display;
Window window;
XEvent e;
const char *msg = "Hello World!";
int screen;
display = XOpenDisplay(nullptr);
if (display == nullptr) {
fprintf(stderr, "Cannot open display\n");
... |
#pragma once
#include "..\stm\Inc\usbReports_t.h"
public ref class tmc2590Converter
{
public:
static void getDRVCTRL_SDOFF_0bits(int regValue, int% MRES, int% DEDGE, int% INTPOL);
static int getDRVCTRL_SDOFF_0(int MRES, int DEDGE, int INTPOL);
static void getDRVCTRL_SDOFF_1bits(int regValue, int% CB, int% PHB, int%... |
#pragma once
#include "utils/ptts.hpp"
#include "proto/config_tower.pb.h"
using namespace std;
namespace pc = proto::config;
namespace nora {
namespace config {
using tower_ptts = ptts<pc::tower>;
tower_ptts& tower_ptts_instance();
void tower_ptts_set_funcs();... |
// Created on: 2004-11-24
// Created by: Michael SAZONOV
// Copyright (c) 2004-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 "SM_Matrix2D.h"
#include "SM_Math.h"
#include <string.h>
#include <cmath>
namespace sm
{
Matrix2D::Matrix2D()
{
Identity();
}
Matrix2D::Matrix2D(const Matrix2D& mt)
{
memcpy(x, mt.x, sizeof(x));
}
Matrix2D& Matrix2D::operator = (const Matrix2D& mt)
{
memcpy(x, mt.x, sizeof(x));
return *this;
}
static... |
//
// download.cpp
//
// $Id: //poco/1.4/NetSSL_OpenSSL/samples/download/src/download.cpp#1 $
//
// This sample demonstrates the URIStreamOpener class.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "_/URIStreamOpener.h"... |
#pragma unmanaged
#include <stddef.h>
#pragma managed
#include "Position.h"
#include "TilePosition.h"
#include "WalkPosition.h"
namespace BroodWar
{
namespace Api
{
BWAPI::TilePosition ConvertTilePosition(TilePosition^ position)
{
if (position == nullptr)
return BWAPI::... |
/**
* @file Key.cpp
* @author Jichan (development@jc-lab.net / http://ablog.jc-lab.net/146 )
* @class Key
* @copyright Copyright (C) 2019 jichan.\n
* This software may be modified and distributed under the terms
* of the Apache License 2.0. See the LICENSE file for details.
*/
#include "Ke... |
#pragma once
#include <Component.h>
#include <FreeListObjectPool.h>
#include <FreeListPoolElement.h>
#include <unordered_map>
#include <functional>
#include <any>
#include <vector>
#include <iostream>
namespace breakout
{
class ComponentManager
{
using ObjPool = std::any;
template<class componentStruct>
u... |
#include "pch.h"
#include "AI.h"
#include "console.h"
#include "captain.h"
#include "player.h"
#include <ctime> // For time()
#include <cstdlib> // For srand() and rand()
#include <vector>
using namespace std;
AI::AI()
{
srand(time(0)); // Initialize random number generator.
for (int i = 0; i < 10; i++)
for... |
#include "AvatarModel.h"
AvatarModel::AvatarModel():
m_lifePoints(100)
{
}
AvatarModel::~AvatarModel()
{
}
|
//
// Contrato.cpp
// Ordenamiento
//
// Created by Daniel on 04/09/14.
// Copyright (c) 2014 Gotomo. All rights reserved.
//
#include "Contrato.h"
bool Contrato::operator > (Contrato &c){
if(ano==c.ano){
if(mes == c.mes){
return dia>c.dia;
}
else{
return mes>c.... |
#ifndef SCAVTRAP_HPP
# define SCAVTRAP_HPP
# include "ClapTrap.hpp"
class ScavTrap: public ClapTrap
{
private:
static const int _challengeNums = 5;
ScavTrap();
protected:
static std::string _challengeNames[_challengeNums];
public:
ScavTrap(std::string const &name);
ScavTrap(ScavTrap const &toCopy);
Sca... |
#include "ppm.h"
#include <iostream>
#include <queue>
#include <string>
#include <sstream>
#include <chrono>
using namespace std::chrono;
using namespace std;
typedef high_resolution_clock clk;
struct pos{
int i;
int j;
};
bool labeling(ppm &source, int i, int j, int label){
int index = i*source.width + j;
uns... |
//
// MainScene.cpp
// AutoCaller
//
// Created by Micheal Chen on 2017/7/4.
//
//
#include "MainScene.hpp"
#include "cocostudio/CocoStudio.h"
#include <vector>
//#include "AutoRandTest.hpp"
USING_NS_CC;
using namespace ui;
Scene* MainScene::createScene()
{
auto scene = Scene::create();
auto layer = Mai... |
/* -*-C++-*- */
/*
* Copyright 2016 EU Project ASAP 619706.
*
* 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 appl... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
// fwTools
#include <fwTools/dateAndTime.hpp>
// gdcmIO
#include "gdcmIO/... |
// Maze.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
char **create(int size1, int size2)
{
char **arr = new char*[size1];
for (int i = 0; i < size1; i++)
arr[i] = new char[size2];
return arr;
}
class Maze {
char **maz... |
#include<bits/stdc++.h>
using namespace std;
int a[100];
bool mark[100] = {false};
int res[100];
int n;
void print(){
for(int i = 1; i <= n; i++)
cout << a[i] << " ";
cout << endl;
}
void backTrack(int k){
for(int i = 1; i <= n; i++){
if(!mark[i]){
mark[i] = true;
a[k] = i;
if(k == n... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "GameObjectManager.h"
//GameObjectManager::GameObjectManager()
//{
//}
//
//GameObjectManager::~GameObjectManager()
//{
//}
|
//
// startDraw.cpp
// baekjoon
//
// Created by Honggu Kang on 2020/06/20.
// Copyright © 2020 Honggu Kang. All rights reserved.
//
#include<stdio.h>
int DrawStar(int N){
for(int i=0;i<N;i++){
for (int j=0;j<i;j++){
printf("*");
}
if(i>0){
printf("\n")... |
//
// Created by xukexin on 2019/4/4.
//
#ifndef INC_8SORT_TESTCLASS_H
#define INC_8SORT_TESTCLASS_H
class Sort {
protected:
int *data;
int dataCnt;
protected:
int partition (int lo, int hi);
void quiRec (int lo, int hi);
void merge (int lo, int mid, int hi);
void merRec (int lo, int hi);
pub... |
//
// OCXMLElementFactory.h
//
// Created by Wes Souza.
//
// ------------------------
// Copyright 2013 Zynga Inc.
//
// 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://ww... |
#include "treeface/misc/PropertyValidator.h"
#include <treecore/Array.h>
#include <treecore/HashMap.h>
#include <treecore/Identifier.h>
#include <treecore/String.h>
#include <treecore/Variant.h>
using namespace treecore;
namespace treeface {
struct PropertyValidator::Impl
{
Array<Identifier> required_keys;
... |
#include"Camera.h"
#include"Globals.h"
#include<glm/gtc/matrix_transform.hpp>
Camera::Camera(const glm::vec2& point)
{
init(point);
}
void Camera::init(const glm::vec2& point)
{
view = glm::mat4();
position = glm::vec3(point.x - (Globals::WIDTH / 2.0f), point.y - (Globals::HEIGHT / 2.0f), .1f);
view = glm::lo... |
#ifndef OPENGLCONTROLLER_H_
#define OPENGLCONTROLLER_H_
#include "gl_compat_3_2.h"
#include <swisseph/swephexp.h>
#ifdef HAS_FTGL
#include <FTGL/ftgl.h>
#endif
//#include <ctime>
#include <cstdlib>
#include <vector>
//#include "config.h"
#include "sphere.h"
#include "ring.h"
#include "shaderprogram.h"
#include "pla... |
/**
* File Name: countPrimes.cpp
* Author: Jia Bowei
* Mail: jowishu@163.com
* Created Time: 五 4/ 1 16:34:48 2016
*/
#include <cmath>
#include <iostream>
using namespace std;
int countPrimes(int);
bool isPrime(int);
int main(){
//int countPrimes(int);
int count;
count = countPrimes(999983);
co... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 1995-2008 Opera Software ASA. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// Espen Sand
//
#ifndef __EXEC_MONITOR_H__
#define __EXEC_MONIT... |
#pragma once
#include "Value.h"
class CFunc {
byte type;
tfunc cfunc;
CFunc(tfunc f);
public:
enum {
CFUNC_CALL = 0,
CFUNC_INIT = 1,
CFUNC_DELETE = 2,
CFUNC_GC_TRAVERSE = 3,
};
byte data[0];
~CFunc();
static CFunc *alloc(GC *gc, tfunc f, unsig... |
/*
* MCB_Main.ino
* Main file for the Motor Control Board
* Author: Alex St. Clair
* Created: December, 2017
*
* This is the main file that should be used to program
* the motor control board (MCB) for FLOATS and RACHuTS on
* the Strateole 2 flights.
*/
#include <HardwareMCB.h>
#include <... |
#include <bits/stdc++.h>
#include "dispatcher_visitor_test.h"
using namespace std;
void Dispatcher_visitor_test::Dispatch(Argument_list& z) {
cout << "Visited Argument List\n";
for(auto&y: z.arguments) {
y->Accept(*this);
}
}
void Dispatcher_visitor_test::Dispatch(Assignment_statement& z) {
co... |
/*
* simple_rpc_client.cpp
*
* Libevent RPC framework Sample Program - simple_rpc_client
*
* Copyright (C) 2010 Yoichi Kawasaki All rights reserved.
* yokawasa at gmail dot com
* yk55.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with ... |
#include "pothole.h"
#include "globals.h"
#include "physics.h"
#include "game.h"
#include "math_extra.h"
#include <math.h>
/**
* Allocate and initialize a new Pothole object.
*
*
* @param[in] x The x location of the pothole
* @param[in] y The y location of the pothole
* @return T... |
#ifndef RGBADAPTER_H
#define RGBADAPTER_H
#include <QObject>
#include <QTcpSocket>
#include "adapterbase.h"
class RGBAdapter : public AdapterBase
{
Q_OBJECT
Q_PROPERTY(QString address READ address WRITE setAddress NOTIFY addressChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChange... |
#include<bits/stdc++.h>
using namespace std;
int a[100000];
main()
{
int n, k;
while(cin>>n>>k)
{
int i, j, mn=1000000, mx=0;
for(i=0; i<n; i++)
{
cin>>a[i];
mn = min(mn, a[i]);
mx = max(mx, a[i]);
}
if(mx-mn>k)cout<<"NO"<<endl;
... |
#include "scrollimp.h"
ScrollImp::ScrollImp()
{}
|
/***************************************************************************
* Sketch Name: Complex Flows - Node-RED
* Description: This sketch illustrates how Arduino can publish an HTTP
message to start a Node-RED flow
* Created On: March 01, 2016
* Author: Adeel Javed
* Book: Buildi... |
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <algorithm>
using namespace std;
unsigned long long S[51] = {0};
unsigned long long p[51] = {0};
int layerstate[51] = {0};
void init(){
S[0] = 1;
p[0] = 1;
for(int i = 1; i < 51; i++)
{
S[i] = S[i-1] * 2 + 3;
p[i] = p[... |
#pragma once
#include <Windows.h>
#include "SimpleLogger.h"
#define VAS_MANAGER L"vas-manager"
class CServiceManege
{
public:
static CServiceManege*GetInstance();
~CServiceManege();
DWORD GetStartType(LPCTSTR lpszServiceName);
BOOL SetStartType(LPCTSTR lpszServiceName, DWORD dwStartType);
DWORD GetStatus(LPCT... |
#include "_pch.h"
#include "CtrlBrowser.h"
#include "CtrlNotebook.h"
#include "CtrlClsEditor.h"
#include "CtrlObjEditor.h"
#include "CtrlFav.h"
#include "CtrlHelp.h"
using namespace wh;
//---------------------------------------------------------------------------
//-----------------------------------------------------... |
#include <bits/stdc++.h>
using namespace std;
long long i,j,a,l,m,y,b,c;
long long riv(long long k){
l=0;
j=k;
while(1){
l=l*10;
l=l+j%10;
j=j/10;
if(j==0){
return l;
}
}
}
long long prime(long long x){
y=0;
for(i=2;i<=sqrt(x);i++){
... |
#include "queue.hpp"
int main() {
Queue* queue1 = new Queue;
Queue* queue2 = new Queue(5,0);
queue1 -> push(9);
queue1 -> print();
queue1 -> push(2);
queue1 -> print();
queue1 -> push(7);
queue1 -> print();
queue2 -> print();
queue2 -> pop();
queue2 -> print();
queue2 -> push(10);
queue2 -> print();
que... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "406"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 1000
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#end... |
#include <vector>
#include <stack>
#include <map>
#include <iostream>
#include <sstream>
#include <functional>
#include "SFML/Graphics.hpp"
#include "SFML/System.hpp"
#include "SFML/Window.hpp"
#include "SFML/Audio.hpp"
#include "SFML/Network.hpp"
using namespace std;
using namespace sf;
class Stat... |
#ifndef BASICSHADER_H
#define BASICSHADER_H
#include "abstractshader.h"
class BasicShader : public AbstractShader
{
public:
BasicShader(const std::string &vertexFile = "basic.vert",
const std::string &fragmentFile = "basic.frag");
void loadProjectionViewMatrix(const Matrix4 &matrix);
void... |
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <stdio.h>
#include <vector>
using namespace std;
const int N = 111;
vector< int > g[N];
int ke;
int a[N], b[N], c[N];
int from[N], to[N];
bool used[N];
int f[N], bsum[N];
struct cell {
int a, b;
cell(int ax = 0, int ay = 0) : a(ax), b(ay) ... |
#pragma once
#include "aePrerequisitesUtil.h"
#include "aeZiggurat.h"
namespace aeEngineSDK
{
class AE_UTILITY_EXPORT PerlinNoise
{
private:
// The permutation vector
Vector<int> p;
public:
// Initialize with the reference values for the permutation vector
PerlinNoise();
// Generate a new permutation ... |
#ifndef OP_SYSTEM_INFO_H
#define OP_SYSTEM_INFO_H
class OpSystemInfo
{
public:
double GetTimeUTC();
double GetRuntimeMS();
unsigned int GetRuntimeTickMS();
#if defined _MACINTOSH_ || defined UNIX || defined(MSWIN) && !defined(_MSC_VER)
OpSystemInfo();
int DaylightSavingsTimeAdjustmentMS(double t) { return IsDST... |
#include "add_observation_noise.h" // import file to test
#include <cmath>
#include "ut.hpp"
using namespace boost::ut;
using namespace boost::ut::bdd;
int main() {
//! This seed was set in the add_observation_noise() function implemented in the yglee code,
//! in order to be able to take the respective inp... |
// File: Path.cpp
// Author: Rionaldi Chandraseta - 13515077
// Written on 2017-03-31
#include "Path.h"
Path::Path() {
TotalCost = 0;
}
Path::Path(const Path& P) {
for (int i=0; i<P.TravelPath.size(); i++) {
TravelPath.push_back(P.TravelPath.at(i));
}
TotalCost = P.TotalCost;
}
void Path::addNode(int no... |
//
// InterpreterBuilder.hpp
// ItsyForth
//
// Created by Dad on 5/1/21.
//
#ifndef InterpreterBuilder_hpp
#define InterpreterBuilder_hpp
#include "Compiler.hpp"
class Runtime;
class InterpreterBuilder {
public:
static const int TIB_LENGTH = 256;
InterpreterBuilder(Runtime* runtime);
void reset();
privat... |
#include<iostream>
#include<cstdlib>
using namespace std;
struct node{
int data;
struct node* next;
};
struct node* head;
void appendatlast(int data){
struct node* newnode=(struct node*)malloc(sizeof(struct node));
newnode->data=data;
newnode->next=NULL;
if(head==NULL){
head=newnode;
return;
}
str... |
#include<stdio.h>
#include<string.h>
int main()
{
int t, i, j=0 ,k=0, count, l1, l2;
char a[25],b[25];
scanf("%d",&t);
getchar();
while(t--)
{
count=0;
gets(a);
gets(b);
l1=strlen(a);
l2=strlen(b);
if(l1!=l2)
{
printf("No\n");
continue;
}
for(i=0;i<l1;i++)
{
if (a[i]=='a' ||a[i]=='e' ... |
#define _CRT_SECURE_NO_WARNINGS
#include "DxLib.h"
#define GAME_WIDTH 800
#define GAME_HEIGHT 600
#define GAME_COLOR 32
#define GAME_MAP_YOKO_SIZE 32
#define GAME_MAP_TATE_SIZE 32
#define GAME_MAP_BUN_YOKO_CNT 32
#define GAME_MAP_BUN_TATE_CNT 41
#define GAME_MAP_YOKO 40
#define GAME_MAP_TATE ... |
#ifndef STYLECONFIGWINDOW_H
#define STYLECONFIGWINDOW_H
#include <fstream>
#include <QDialog>
#include <iostream>
extern std::string BASE_DIR;
extern int alert_items_max_font;
extern int alert_items_min_font;
extern int alerts_items_max_count;
extern QString alerts_items_color;
namespace Ui {
class StyleConfigWin... |
#include <iostream>
#include <sstream>
using namespace std;
string deobfuscate(const char* in) {
string d(in);
d = d.substr(5);
int p = d.find("__E__");
d = d.substr(0, p);
for(size_t i = 0; i < d.size(); ++i)
d[i] = d[i] ^ 0xff;
return d;
}
#define DEOB(s) deobfusc... |
// Copyright 2013 Peter Wallström
//
// 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 agreed to in writing,... |
#include "file_manager.h"
#ifdef __ANDROID__
ANativeActivity* FileManager::activity = nullptr;
AAssetManager* FileManager::assetManager = nullptr;
const char* FileManager::internalStoragePath = nullptr;
Assimp::AndroidJNIIOSystem* FileManager::newAssimpIOSystem() {
return new Assimp::AndroidJNIIOSystem(FileManage... |
#include "SceneManager.h"
//--------------Translation类的定义----------------------
//下面定义了三种不同的转场,
class FadeWhiteTransition :public CCTransitionFade
{
public:
static CCTransitionFade* transitionWithDuration (float t ,CCScene* s)
{
return CCTransitionFade::create(t, s,ccBLACK);
}
};
class Zoom... |
#ifndef ACTUATOR_HPP
#define ACTUATOR_HPP
#include <vector>
#include <string>
#include <chrono>
namespace aci {
struct ActuatorDataRT {
double volt, amp, linvel, linpos, angvel, angpos, torque, force, powerM, powerE, efficiency;
std::chrono::high_resolution_clock::time_point timestamp;
}
enum OutputType { OutSpee... |
#include "big_integer.h"
rsa::big::big() { mpz_init(mpz); }
rsa::big::big(int i) { mpz_init_set_si(mpz, i); }
rsa::big::big(const rsa::big& other) { mpz_init_set(mpz, other.mpz); }
rsa::big::big(const std::vector<unsigned char>& str) {
mpz_init(mpz);
mpz_import(mpz, str.size(), 1, sizeof(unsigned char), 0, ... |
#pragma once
#pragma warning(disable: 4800)
#include <mpirxx.h>
#pragma warning(disable: 4800)
#include <vector>
class MerkleHellman
{
public:
MerkleHellman();
~MerkleHellman();
void GenerateKey(int numBits = 104);
void Encrypt(std::string &message, mpz_t ciphertext);
void Decrypt(mpz_t ciphertext, std::string ... |
/**
* @copyright (C) 2017 Melexis N.V.
*
* 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 agr... |
#include <Rendering/Renderer.h>
#include <Rendering/Display.h>
#include <System/Logger.h>
using namespace Sourcehold;
using namespace Rendering;
using namespace System;
static SDL_Renderer *_renderer;
static SDL_Window *_window;
static Texture *_target = nullptr;
static double tx,ty,tw,th;
bool Renderin... |
#include <iostream>
#include "ClnUtils.h"
namespace SliceTesterNS
{
void testSliceImpl()
{
std::vector<float> v1 = { 1, 2, 3 };
wv::slice<float> s1 = wv::make_view(std::begin(v1), std::end(v1));
for (auto& f : s1)
{
std::cout << f << std::endl;
}
float* pData = &v1[0];
wv::slice<float> sPointer = w... |
#ifndef ANGULOOBT_H
#define ANGULOOBT_H
#include <math.h>
class anguloObt
{
public:
anguloObt();
void setAngulo(double);
double getAngulo();
private:
double Angulo;
};
#endif // ANGULOOBT_H
|
#pragma once
#include <string>
#include <vector>
#include "color.h"
#include <boost/thread/mutex.hpp>
class image
{
public:
image(size_t width, size_t height);
~image();
auto width() const -> size_t;
auto height() const -> size_t;
auto aspect_ratio() const -> double;
auto set_pixel(size_t x, size_t y, color c... |
#include<iostream>
using namespace std;
int main() {
//char en = '`';
char en = 'a' - 1;
while (en < 'z') {
++en;
cout << en << " ";
}
cout << " " << endl;
return 0;
} |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @file
* @author Owner: Karianne Ekern (karie)
* @author Co... |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define vi vector<int>
void solve();
unordered_map<char, int> mp;
bool comp(string a, string b){
int len = min(a.size(), b.size());
for(int i = 0; i<len; i++){
if(mp[a[i]] == mp[b[i]]) continue;
retur... |
/// Will Bahnmiller | 2017 | :p
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "GridSection.h"
#include "GameBoard.h"
#include "Piece.h"
#include "PreparationRow.h"
#include "PieceManager.h"
#include "InputManager.h"
#include "ConsoleManager.... |
/*
* File: AGG.cpp
* Author: juane
*
* Created on 07 March 2018, 23:44
* AGG
* USO: ./agg [<"name.dat">] <seed> <1,2>
*/
#include <dirent.h>
#include <fstream>
#include <algorithm>
#include "timer.h"
#include "random.h"
#include "comun.h"
int main(int argc, char** argv) {
if (argc < 2 ||... |
// Created on: 2016-04-07
// Copyright (c) 2016 OPEN CASCADE SAS
// Created by: Oleg AGASHIN
//
// 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 as publi... |
#include <iostream>
#include <string>
#include <torch/torch.h>
#include "FashionMnistData.hpp"
struct ReLu: torch::nn::Module {
ReLu() {}
torch::Tensor forward(torch::Tensor x) {
return torch::relu(x);
}
};
struct LogSoftMax : torch::nn::Module {
LogSoftMax() {}
torch::Tensor forward(torch::Tensor x) ... |
/**
* Copyright (c) 2014, Timothy Stack
*
* All rights reserved.
*
* 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 retain the above copyright notice, this
* list of condi... |
#pragma once
#include "ofMain.h"
#include "Model/Mask.h"
#include "Controller/SelectShape.h"
#include "Controller/EditShape.h"
#include "Controller/File/MyFile.h"
#include "View/AboutText.h"
#include "View/DatGui.h"
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void exit();
... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... |
#include<iostream>
using namespace std;
bool sum_series(int n){
int series,sum;
cout<<"Series: ";
for(int i=1;i<=n;i++){
series = series*10 + i;
sum = sum+series;
cout<<series<<"+";
//sum++;
}
int sum1 = sum-1;
cout<<endl;
cout<<"Sum of series is "<<sum1;
}
int main(){
int n;
cout<<"Enter a ... |
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
class PikachuEasy {
public:
string check(string word)
{
string p[3] = {"pi","ka","chu"};
bool isDivide = false;
while (!word.empty()) {
isDivide = true;
for (int i=0; i<3; ++i) {
if (word.find(p[i]) == 0) {
isDivide = ... |
#include "MeshBuilder.h"
#include <boost/scoped_ptr.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <pcl/common/pca.h>
#include <pcl/features/normal_3d.h>
#include <pcl/filters/statistical_outlier_removal.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/surface/concave_hull.h>
#i... |
#include <gtest/gtest.h>
#include "Json.h"
using namespace std;
TEST(JsonParserTests, EmptyJsonTest) {
string jsonText = "";
JsonObject testObject = parser::parse(jsonText);
JsonObject emptyObj;
EXPECT_EQ(testObject, emptyObj);
}
TEST(JsonParserTests, IndentPlacementTest) {
string jsonText = "{\"e... |
// #include <iostream>
// #include <future>
#include <experimental/coroutine>
#include "cppcoro/task.hpp"
//#include "../../../cppcoro/include/cppcoro/sync_wait.hpp"
#include "cppcoro/sync_wait.hpp"
cppcoro::task<void> print_and_sleep()
{
// std::cout << "sleeping..." << std::endl;
co_await std::experimental::... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmJsonObjects_h
#define cmJsonObjects_h
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
#include <vector>
#include "cm_jsoncpp_value.h"
class cm... |
#include <iostream>
#include <vector>
#include <algorithm>
#include "Graph.h"
using namespace std;
class Path{
private:
Graph G;
int s;
int t;
vector<bool> visited;
vector<int> pre;
bool dfs(int v, int parent){
// parent represents the previous node
visited[v] = true;
... |
int check(vector<int> &nums1, vector<int> &nums2,int n1,int n2) {
if(n1==0||n2==nums2.size()) {
if(nums1[n1]>=nums2[n2-1]) {return 0;}
return 1;
}
if(n2==0||n1==nums1.size()) {
if(nums2[n2]>=nums1[n1-1]) {return 0;}
return -1;
}
if(nums1[n1]>=nums2[n2-1]) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.