text stringlengths 8 6.88M |
|---|
#include "stdafx.h" //________________________________________ CalculadoraIMC.cpp
#include "CalculadoraIMC.h"
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int cmdShow) {
CalculadoraIMC app;
return app.BeginDialog(IDI_CalculadoraIMC, hInstance);
}
void CalculadoraIMC::Window_Open(Win::Event... |
#include "RObjA.hpp"
RObjA::RObjA()
{
}
RObjA::~RObjA()
{
}
// Relaxed include should moc the header instead
#include "RObjA.moc"
|
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout... |
/*
* Copyright (c) 2019, NVIDIA CORPORATION.
*
* 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 ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Petter Nilsen (pettern@opera.com)
*/
#include "core/pc... |
#pragma once
#include "stdafx.h"
#include <memory>
#define SISÄINENHINTA 3.0 // vaihtoehto 2: const float HELSINKIHINTA = 3.0; // C++:n nimetty vakio
#define SEUTUHINTA 4.8
using namespace std;
enum Matkatyyppi {SISÄINEN, SEUTU};
class Matkakortti
{
private:
/*
string *omistajanNimi; // T4
float *saldo; // T4
... |
#include "basicLocator.h"
#include "basicLocatorManip.h"
#include <maya/MFnPlugin.h>
MStatus initializePlugin(MObject obj)
{
MStatus stat;
MString errStr;
MFnPlugin plugin(obj, "jason.li", "1.0", "Any");
stat = plugin.registerNode(BasicLocator::typeName,
BasicLocator::typeId,
&BasicLocator::creator,
&BasicL... |
#define _CRT_SECURE_NO_WARNINGS
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "mat.h"
#include "vec.h"
#include "InitShader.h"
#include <iostream>
#include "glm/glm/glm.hpp"
#include "glm/glm/gtc/matrix_transform.hpp"
#define BUFFER_OFFSET( offset ) ((GLvoid*) (offset))
void gasketSetKeyCallback(G... |
#ifndef QROSCALLBACKQUEUE_H
#define QROSCALLBACKQUEUE_H
#include <QObject>
#include <ros/callback_queue.h>
#include <QSocketNotifier>
class QRosCallBackQueue : public QObject, public ros::CallbackQueue{
Q_OBJECT
public:
QRosCallBackQueue();
virtual ~QRosCallBackQueue();
virtual void addCallback(const... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
/** @file blockbox.h
*
* Inline box class prototypes for docume... |
#pragma once
#include <comn.h>
#include <read_aws_from_mysql.h>
// MeteorSearchB 对话框
class MeteorSearchB : public CDialog
{
DECLARE_DYNAMIC(MeteorSearchB)
public:
MeteorSearchB(CWnd* pParent = NULL); // 标准构造函数
virtual ~MeteorSearchB();
// 对话框数据
enum { IDD = IDD_METEOR_SEARCH_B };
protected... |
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2017 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 as published
// by the Free S... |
/*
Copyright (c) 2014 Mircea Daniel Ispas
This file is part of "Push Game Engine" released under zlib license
For conditions of distribution and use, see copyright notice in Push.hpp
*/
#pragma once
#include "Core/Log.hpp"
#include <new>
#include <string>
#include <utility>
#include <cassert>
#include <type_traits>
... |
/*
Programación Orientada a Objetos
PROYECTO 3
Ana Elisa Estrada Lugo
A01251091
05/06/2020
*/
//Material.h
#include <iostream>
#include <string>
#ifndef MATERIAL_H
#define MATERIAL_H
using namespace std;
class Material{
public:
Material();
Material(int idM, string t);
void setIdMaterial(int... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "1234"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 10000
struct edge{
int one,two,weight;
bool operator < (const edge &r ) const{
return weight > r.weight;
}
};
int main(int argc, char const *argv[])... |
#include "CocosPillar.h"
#include "Definitions.h"
USING_NS_CC;
// Initialize instance (physics)
bool CocosPillar::init()
{
// Super init first
if (!Pillar::init())
return false;
auto topPillarBody = PhysicsBody::createBox(topPillar_->getContentSize());
auto botPillarBody = PhysicsBody::createBox(botPillar_->ge... |
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without f... |
#include <fstream>
int main() {
std::fstream i("input.txt"), o("output.txt", 2);
int a, b, c, d, x = -100;
i >> a >> b >> c >> d;
for (; x < 101; ++x)
if ( x*(a*x*x + b*x + c) == -d)
o << x << " ";
} |
/**
* Definition for a binary tree node.
*/
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};
cla... |
#include "../device.hpp"
void BufferMul()
{
Device clDevice;
clDevice.Init();
//! Init data
//create input data on CPU
int num = 1024;
float *h_idata = (float*)malloc(sizeof(float)* num);
for (int i = 0; i < num; i++){
h_idata[i] = i;
}
//allocate memory for the results on CPU
float *h_odata = (float*)mal... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int x,y;
int sum = 0;
cin>>x>>y;
if(x>y)
{
for(int i=(y+1); i<x; i++)
{
if(i%2 != 0)
{
sum = sum+i;
... |
//
// Created by xiang on 18-11-19.
//
#include <iostream>
#include <opencv2/core/core.hpp>
#include <ceres/ceres.h>
#include <chrono>
using namespace std;
// 代价函数的计算模型
struct CURVE_FITTING_COST {
CURVE_FITTING_COST(double x, double y) : _x(x), _y(y) {}
// 残差的计算
template<typename T>
bool op... |
#include <iostream>
#include <unistd.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <assert.h>
#include <stdint.h>
#include "globalTypes.h"
#include "linkBlocks.h"
#include <vector>
using namespace std;
vector<uint32_t> schedule[MAX_NUM_CMDS];
vector<uint32_t> cmdInd;
uin... |
#include "forme.h"
int main()
{
Circle c;
return 0;
} |
#pragma once
#ifndef _CALCULATOR_LEXICAL_ANALYSIS_H_
#define _CALCULATOR_LEXICAL_ANALYSIS_H_
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include "KyleBase.h"
#include "Symbol.h"
using namespace std;
class LexicalAnalysis
{
public:
//进行词法解析,简单实现
static vector<Symbol>& analysis(string st... |
#ifdef TASK_INFO
void Info_task(void * parameter)
{
for (;;)
{
delay(100);
#else
void update_Info()
{
{
#endif
if ((millis() - msPrint) > SHOW_PERIOD)
{
check_ZeroCross();
Pset = selectPower();
print_Serial();
update_DS();
#ifndef TASK_INFO
display_Oled();
#endif //!TASK_SHOW
update_Modbus(... |
// Created on: 1991-04-11
// Created by: Laurent PAINNOT
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-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 GN... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "11854"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 100
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#en... |
#ifndef __SHADE_H__
#define __SHADE_H__
#include "cocos2d.h"
USING_NS_CC;
class Shade : public Node
{
public:
virtual bool init();
void initWithLevel(int level, int index);
// implement the "static create()" method manually
CREATE_FUNC(Shade);
public:
Sprite* sp;
int level; //color
int index; //pos
};
#end... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef OP_SPEED_DIAL_LISTENER_H
#define OP_SPEED_DIAL_LISTENER_H... |
#include "MQ135.h"
#include <ESP8266WiFi.h>
#define ANALOGPIN A0
WiFiClient client;
String apiKey = "Z1T563WF17IV62TW"; // Enter your Write API key from ThingSpeak
const char *ssid = "Moto G3 TE"; // replace with your wifi ssid and wpa2 key
const char *pass = "physics@science";
const char* server = "api.thin... |
#include <iostream>
using namespace std;
const int max_arr = 16;
int search_num = 421;
int recursion_binary_search(int * p, int left_n, int right_n, int num);
int main()
{
int arr[max_arr] = {1,31,61,91,121,151,181,211,241,271,301,331,361,391,421,999};
int num = recursion_binary_search(arr, 0 , max_arr,search_num);... |
#include "Timer.h"
#include "AudioListener.h"
#include "KeyboardListener.h"
#include <QDebug>
#include <QThread>
#include <QTime>
#include <StatsUtility.h>
#include <mainui.h>
#include <TaskerPerf/perftimer.h>
#include <iostream>
using namespace Engine;
using namespace util;
using namespace udata;
Timer *Timer::thisIns... |
/*
* @lc app=leetcode.cn id=698 lang=cpp
*
* [698] 划分为k个相等的子集
*/
// @lc code=start
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
bool canPartitionKSubsets(vector<int>& nums, int k) {
int sum = 0;
for(int i : nums)sum+=i;
if(sum %... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <folly/Chrono.h>
#include <folly/Optional.h>
#include <quic/QuicConstants.h>
#include <quic/codec/Types.h>... |
#include<bits/stdc++.h>
using namespace std;
class Polynomial {
public :
int *degCoeff; // Name of your array (Don't change this)
int capacity; // total size
public :
Polynomial() {
degCoeff = new int[10];
for(int i=0;i<10;i++)degCoeff[i]=0;
capacity = 10;
}
Polynomial(const Polynomial ... |
// Created on: 1993-04-29
// Created by: Yves FRICAUD
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-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 L... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2008-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Jan Borsodi
*/
#ifndef OP_PROTOBUF_UTILS_H
#define OP_PROTOBU... |
// Created on: 1995-08-04
// Created by: Modelistation
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-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 ... |
#pragma once
#include "Image.h"
class GameNode
{
private:
static Image* m_backBuffer;
HDC _hdc;
public:
GameNode();
~GameNode();
virtual HRESULT Init();
virtual void Release();
virtual void Update();
virtual void Render();
virtual void Render(HDC hdc);
HDC GetMemDC() { return m_backBuffer->GetMemDC(); }
... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Building;
class GoodGay
{
public:
GoodGay(string hall, string bedroom); // 类内声明,类外实现
void visit();
Building *b;
};
class Building
{
// friend void print_Building(Building &b);
// friend class GoodGay;//一个类成为另一个类的友... |
#ifndef PID_H
#define PID_H
#include<math.h>
#include <iostream>
class PID {
private:
unsigned int step = 0;
double const twiddle_upd_param = 1.1;
double const twiddle_dwn_param = 0.9;
double dp[3] = {1.0, 1.0, 1.0};
//TODO : double max would be better then a high number
double best_err = 1000... |
//: C07:UnionClass.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Unie z konstruktorami i funkcjami skladowymi
#include<iostream>
using namespace std;
union U {
private: // Kontrola do... |
//interrupt vector
TIMER0_COMPA //timer/counter0 compare match
ISR (TIMER0_COMPA);
TCCR0A = 0;
TCCR0A |= (1<<WGM01);// CTC mode
OCR0A = 0xff;
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2004 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#include "core/pch.h"
#include "WindowsOpLocale.h"
char *StrToL... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
//
// Copyright (C) 2005-2011 Opera Software ASA. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
#include "core/pch.h"
#ifdef WEBFEEDS_BACKEND_SUPPORT
#include... |
#include "Types.hpp"
#include "Log.hpp"
////////////////////////////////////////////////////////////////////////////////////////////
StateStatistics::StateStatistics(){
nSegments=0;
nTransitions=0;
};
StateStatistics::StateStatistics(uint64_t label_){
nSegments=0;
nTransitions=0;
label=label_;
};
void StateSta... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author karie, adamm
*/
#ifndef DESKTOP_WIDGET_WINDOW_H
#defin... |
#include "LiveStreamMediaSource.hh"
#include "GroupsockHelper.hh"
#include "RtspSvr.hh"
LiveStreamMediaSource* LiveStreamMediaSource::instance = NULL;
//default sps pps
static char sps[15] = { 0x67,0x42,0x00 ,0x29,
0x8d,0x8d,0x40,0x3c ,
0x03 ,0xcd ,0x00,0xf0,
0x88 ,0x45,0x38};
stati... |
// https://oj.leetcode.com/problems/palindrome-number/
class Solution {
public:
bool isPalindrome(int x) {
if (x < 0) {
return false;
}
// In case of overflow
long long base = 1;
while (x / (base * 10) > 0) {
base = base * 10;
}
... |
/**
@author Umaralikhon Kayumov
@since 3.1
@version 7.7
*/
/*
Название отеля, Город, Количество звезд, Информация о общем количестве номеров для каждого класса
Реализовать возможность сортировки массива объектов класса с применением перегрузки оператора сравнения на основе:
- количеств... |
#include <iostream>
using namespace std;
int main()
{
int time;
float litr =2;
double pow ,div ;
float bottle=1.5;
cout << "Enter : How long you stay at shower(in minutes)?" << endl;
cin >> time ;
if ( time<=40 ){
pow = time * litr;
cout << "You spent "<<pow<<" lit... |
//
// Created by aleksey on 18.04.2019.
//
#include "MyVisCommandSceneAddElectricField.h"
#include "G4UIcmdWithAnInteger.hh"
#include "G4VisManager.hh"
#include "G4TransportationManager.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4ApplicationState.hh"
#include "G4... |
// Здесь будет представленна реализация класса "Участник" и всех необходимых методов.
#include "Member.h"
Member::Member()
{
}
Member::Member(const char *nick, const char *sts)
{
}
Member::~Member()
{
}
|
//
// Created by arnito on 4/06/17.
//
#include "Quote1Actor.h"
Quote1Actor::Quote1Actor(int player,Quote &q, Scene &s)
: Actor(player, s){
_quote = &q;
}
Quote1Actor::~Quote1Actor(){
}
void Quote1Actor::update(const sf::Time& deltatime) {
}
void Quote1Actor::action(Inputs::Key key){
if(key == Inpu... |
//this is a code to multiply two given numbers
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i,j,mul;
cout>>"Enter numbers to multiply: ">>endl;
cin<<i<<j;
mul=i*j;
cout<<"Result: "<<mul<<endl;
return 0;
} |
#include <stdio.h>
void shell_sort(int arr[], int len)
{
int gap, i, j, k, g, temp;
for(gap = len / 2; gap > 0; gap = gap / 2)
{
for(g = 0; g < gap; g++)
for(i = gap + g; i < len; i = i + gap)
{
for(j = i - gap; j >= g; j = j - gap)
{
... |
#pragma once
#include "ARPG.h"
#include "Enum/SkillRangeDirection.h"
#include "SkillRangeInfo.generated.h"
USTRUCT(BlueprintType)
struct ARPG_API FSkillRangeInfo
{
GENERATED_USTRUCT_BODY()
public:
// Sphere Trace 사용 여부를 나타냅니다.
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool bUseSphereTrace;
// 캐릭터가 기준이 되는 트... |
#include "qinput.h"
namespace qEngine
{
/************************************ qInput::qInput *************************************
description:
Constructor
access: public
------------------------------------------------------------------------------------------
created: 30.10.02 - 17:21:10
creator: qDot
********... |
#include <bits/stdc++.h>
using namespace std;
bool hassh[100];
int countt = 0;
int main()
{
char str1[100],str2[100];
scanf("%s%s",str1,str2);
for(int i =0;i < strlen(str1);i++)
{
hassh[str1[i]%26] = 1;
}
for(int i = 0; i < strlen(str2);i++)
{
if(hassh[str2[i]%26] == 0... |
#include<iostream>
using namespace std;
int main() {
// referance variable
string food = "chapathi";
string &tiffen = food;
cout << food << endl;
cout << tiffen << endl;
// get memory address
cout << &food << endl ;
cout << &tiffen << endl;
retu... |
#ifndef __REQUEST_HANDLER_ECHO_H_DEFINED__
#define __REQUEST_HANDLER_ECHO_H_DEFINED__
#include <communicating_tcp_socket.hpp>
#include <generic_handler.hpp>
namespace request_handler {
class echo_handler : public generic_handler {
public:
virtual void handle(server::net::communicating_tcp_socket socket);... |
//
// Iterator.hpp
// Sorted_Doubly_Linked_List
//
// Created by 세광 on 2021/08/12.
//
#ifndef Iterator_hpp
#define Iterator_hpp
#include "DoublyLinkedList.hpp"
class Iterator {
public:
Iterator(const DoublyLinkedList &dlist);
~Iterator();
DoublyLinkedList GetdList() const;
NodeType* GetpCurPo... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
// only gravity will pull me down
// Minimum Operations
int t, n;
cin >> t;
while (t--) {
cin >> n;
int dp[n+1];
dp[1]=1;
dp[2]=2;
for(int i=3; i<=n; i++) {
if(i%2)
dp[... |
#include <iostream>
using namespace std;
int main()
{
int p = 1;
for (int x = 1; x <= 4; x++)
{
for (int y = 1; y <= x; y++)
{
cout << p << " ";
p++;
}
cout << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
... |
#include<bits/stdc++.h>
using namespace std;
int n, a[1000][1000], b[1000][1000];
void input(){
cin >> n;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
cin >> a[i][j];
}
}
}
bool MTDX(){
for(int i = 0; i < n-1; i++){
for (int j = i+1; j < n; j++) {
if(a[i][j] != a[j][i])
... |
#include <iostream>
#include <string.h>
#include <vector>
#include <algorithm>
using namespace std;
// -1은 아직 답이 계산되지 않았음을 의미한다.
// 1은 해당 입력들이 서로 대응됨을 의미한다.
// 0은 해당 입력들이 서로 대응되지 않음을 의미한다.
int cache[101][101];
// 패턴과 문자열
string W, S;
// 와일드카드 패턴 W[w..]가 문자열 S[s..]에 대응되는지 여부를 반환한다.
bool matchMemoized(int w, int s)... |
// Created on: 2016-07-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 <cstdio>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <set>
#include <time.h>
#include <sstream>
#include <fstream>
typedef unsigned int uint;
using namespace std;
struct Edge
{
uint v;
unsigned long long w;
Ed... |
/*
** EPITECH PROJECT, 2019
** tek3
** File description:
** TcpServer
*/
#ifndef TCPSERVER_H
#define TCPSERVER_H
#include <QObject>
#include <QTcpSocket>
#include <QTcpServer>
#include <QDebug>
namespace babel {
class Core;
namespace network {
class TcpServer : pu... |
#include <Poco/Exception.h>
#include <Poco/Logger.h>
#include "di/Injectable.h"
#include "util/CryptoConfig.h"
#include "util/CryptoParams.h"
BEEEON_OBJECT_BEGIN(BeeeOn, CryptoConfig)
BEEEON_OBJECT_PROPERTY("algorithm", &CryptoConfig::setAlgorithm)
BEEEON_OBJECT_PROPERTY("passphrase", &CryptoConfig::setPassphrase)
BE... |
//-------------------------------------------------------------------------------------------------
//
// llreplace 9/16/2016 Dennis Lang
//
// Regular expression file text replacement tool
//
//-------------------------------------------------------------------------------------------------
//
// Author: ... |
//https://onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=353
#include <bits/stdc++.h>
#define PI 3.1415926535897932384626433832795
#define loop(i,n) for(i = 0; i < n; i++)
#define sz (int) 1e5 + 5
#define ll long long
using namespace std;
int arr[55];
int gcd(int x, int y) {
if(y > x)
... |
// -*- C++ -*-
//
// Package: EgammaHLTAlgos
// Class : EgammaHLTEcalIsolation
//
// Implementation:
// <Notes on implementation>
//
// Original Author: Monica Vazquez Acosta
// Created: Tue Jun 13 12:16:00 CEST 2006
//
// system include files
// user include files
#include "RecoEgamma/EgammaHL... |
#include "finance.h"
facture::facture()
{
}
facture::facture(QString Nom,QString Adresse,QString Num_Tel,QString courriel,int ID,QString Info,QString paiement,QString Tpaiement)
{
this->Nom=Nom;
this->Adresse=Adresse;
this->Num_Tel=Num_Tel;
this->courriel=courriel;
this->ID=ID;
this->Info=In... |
#pragma once
#include "ParallelPrimeFinder.h"
class NaivePar :
public ParallelPrimeFinder
{
// Inherited via ParallelPrimeFinder
virtual std::string name() override;
virtual int* find(int min, int max, int* size) override;
}; |
#include <iostream>
#include "CameraPositionShifter.h"
namespace Game
{
CameraPositionShifter::CameraPositionShifter(Camera &camera)
: mCamera(camera)
{
}
void CameraPositionShifter::onKeyPress(sf::Event::KeyEvent event)
{
switch (event.code)
{
case sf::Keyboard::Down:
mCamera.moveDown(true);
... |
#include "Character.hpp"
namespace rlrpg
{
Character::Character(
unsigned level,
attrs_t const& base_attributes,
Inventory && inventory):
m_level(level),
m_base_attributes(base_attributes),
m_inventory(std::move(inventory)),
m_health(base_attributes[size_t(Attr::Health)]) { }
unsigned Character::healt... |
#pragma once
#include "Proto/paxoskv.pb.h"
class PaxosKVServiceImpl
{
public:
static PaxosKVServiceImpl *GetInstance();
static void SetInstance(PaxosKVServiceImpl *);
static int BeforeServerStart(const char * czConf) {
return 0;
}
int BeforeWorkerStart() {
return 0;
}
int Get... |
/*
* string.c
*
* Created on: 27 mai 2013
* Author: droper
*/
#include "string.h"
#include <cstdlib>
#include <cstring>
#include <iostream>
const char *str_find_exp(const char *begin, const char *end, const char *pat) {
const char *i, *j;
unsigned short k = 0;
for (i = begin; i < end && *i != '\0'; ++... |
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int test(int h, int w, int n) {
int x = ceil((float)n / h);
int y = n % h;
if(y == 0) y = h;
return y * 100 + x;
}
int main() {
int T;
cin >> T;
while(T--) {
int h, w, n;
cin >> h >> w >> n;
cout << test(h, w... |
// Copyright 2016 Google Inc. 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 applicabl... |
//
// GnITabButton.h
// Core
//
// Created by Max Yoon on 11. 7. 25..
// Copyright 2011년 __MyCompanyName__. All rights reserved.
//
#ifndef Core_GnITabButton_h
#define Core_GnITabButton_h
class GnITabPage;
class GnITabButton : public GnIButton
{
private:
GnITabPage* mpTabPage;
public:
GnITab... |
#pragma once
#include <functional>
#include <string>
namespace Poco {
class Thread;
}
namespace BeeeOn {
/**
* @brief The class implements working with POSIX signals.
*/
class PosixSignal {
private:
PosixSignal();
public:
typedef std::function<void(unsigned int)> Handler;
/**
* Send signal to a process o... |
#include "Utils.h"
namespace dyablo {
/** Basic algebraic operations on vectors **/
Vec operator+(const Vec &v1, const Vec &v2) {
return Vec{v1[0]+v2[0], v1[1]+v2[1], v1[2]+v2[2]};
};
Vec operator-(const Vec &v1, const Vec &v2) {
return Vec{v1[0]-v2[0], v1[1]-v2[1], v1[2]-v2[2]};
}
Vec& operator+=(Vec &v1, co... |
#ifndef CRASHRESULT_H
#define CRASHRESULT_H
#include "CrashEvent.h"
#include "Vector.h"
class Field::CrashEvent::CrashResult
{
public:
enum ResultCode {FAIL, POLYGON_AND_VERTEX, LINE_AND_LINE};
CrashResult(void);
CrashResult(const CrashResult&);
virtual ~CrashResult(void);
const CrashResult& operator=(const C... |
#include "btn.h"
#include <QDebug>
#include <QMessageBox>
BTN::BTN(QString text, QWidget *parent)
: QPushButton(parent), m_text(text)
{
setText(m_text);
setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
}
BTN::~BTN()
{
qDebug() << "Destruction !" ;
}
//void BTN::ActionButton()... |
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> v(N);
for (int i = 0; i < N; ++i) {
cin >> v[i];
}
sort(v.rbegin(), v.rend());
int x = v.front();
int y = 0;
for (int i = 0; i < N; ++i) {
if ... |
#pragma once
#include "physics/physics.h"
namespace jsphysics
{
JSObject* CreatePhysicsManagerObject(physics::PhysicsManager* manager);
void DestroyPhysicsManagerObject(physics::PhysicsManager* manager);
} |
#include<iostream>
#include<fstream>
using namespace std;
int main(int argc, char* argv[])
{
ifstream dna_file (argv[1]);
char x;
int A=0;
int T=0;
int C=0;
int G=0;
while(dna_file.get(x)){
if (x=='A'){
A+=1;
}else if(x=='T'){
T+=1;
}else if (x=='C'){
C+=1;
}else if (x=='G'){
... |
#include "Renderer.h"
Renderer::Renderer()
{
// --- INIT ---
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) throw "No es pot inicialitzar SDL subsystems";
// --- WINDOW ---
m_window = SDL_CreateWindow("SDL...", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);
if (m_window ... |
class Solution {
public:
string decodeAtIndex(string S, int K) {
int n = S.size();
long size = 0;
for(int i = 0; i<n; i++) {
if(isdigit(S[i])) {
size *= S[i] - '0';
}
else {
size++;
}
}
for(int i = n-1; i>=0; i--) {
K =... |
#ifndef GRID_H
#define GRID_H
#include <vector>
#include <memory>
#include <random>
#include "Cell.h"
extern std::mt19937 myRandomSeed;
namespace Minesweeper {
class Grid {
private:
int gridHeight;
int gridWidth;
int numOfMines;
int numOfMarkedMines = 0;
int numOfWronglyMarkedMines = 0;
int numOfVis... |
//////////////////////////////////////////////////////////////////////
///Copyright (C) 2011-2012 Benjamin Quach
//
//This file is part of the "Lost Horizons" video game demo
//
//"Lost Horizons" is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published ... |
/*
* Copyright (c) 2020-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_SIZED_ITERATOR_H_
#define CPPSORT_DETAIL_SIZED_ITERATOR_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <utility>
#include "a... |
#ifndef GET_SYS_INFO_H
#define GET_SYS_INFO_H
#if defined(OS_ANDROID)
#include <sys/stat.h>
#define PROCESS_ITEM 14//进程CPU时间开始的项数
typedef struct //声明一个occupy的结构体
{
unsigned int user; //从系统启动开始累计到当前时刻,处于用户态的运行时间,不包含 nice值为负进程。
unsigned int nice; //从系统启动开始累计到当前时刻,nice值为负的进程所占用... |
#include "ConnectGameState.h"
#include "MenuGameState.h"
namespace platformer {
ConnectGameState::ConnectGameState(Game *game) : game(game) {}
void ConnectGameState::onButtonAPress() {
stop();
}
void ConnectGameState::onButtonBPress() {
stop();
}
void ConnectGameState::onBut... |
/**
* @file serialretiever.cpp
*
* @brief Definition of class defined in serialreriever.h
* @version 0.1
* @date 2021-07-22
*
* @copyright Copyright (c) 2021
*
*/
#include <Arduino.h>
#include "globals.h"
#include "serialretriever.h"
#include "utils.h"
#include "message.h"
#include "printe... |
#include <types.hpp>
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>
#include <random>
#ifdef __linux__
#include <GLFW/glfw3.h>
#elif __MINGW32__
#include <GLFW/glfw3.h>
#elif __WIN32
#include <GL/glfw3.h>
#endif
#include <types.hpp>
#include <property.hpp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.