text stringlengths 8 6.88M |
|---|
#include "cpollingthread.h"
#include "cserialportprivate.h"
#include <QDebug>
CPollingThread::CPollingThread(CSerialPortPrivate *sp, QObject *parent) :
QThread(parent)
{
this->sp = sp;
stopFlag = false;
charTimeout = 18000;
packTimeout = 100;
}
void CPollingThread::setCharTimeout(qint64 us)
{
... |
#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... |
// _ ___ _______ ___ ___ ___ ___ _ _ ___ _____ ___
// / |_ )__ / \ / __|_ _| _ \/ __| | | |_ _|_ _/ __|
// | |/ / |_ \ |) | | (__ | || / (__| |_| || | | | \__ \
// |_/___|___/___/ \___|___|_|_\\___|\___/|___| |_| |___/
//
// Trafic Lights V.1
//
// Made by augusto augusto_273@hotmail.com
// Li... |
//Bank abstract base class
#ifndef BANKUSER_H
#define BANKUSER_H
#include <string>
#include <vector>
class BankUser {
public:
BankUser (const std::string&, const std::string&);
virtual ~BankUser() = default;
void setFirstName (const std::string&);
std::string getFirstName () const;
void ... |
#pragma once
#include "Entities.h"
#include <string>
class Map
{
private:
int** map;
unsigned int n, m; //borders
unsigned int c; //number of enemies
bool canAttack;
int id;
bool completed;
bool failed;
bool next;
bool prev;
Entity** enemies;
RECT WinCoord = {};
HDC hDCmap;
public:
Map();
~Map();
vo... |
#include "enter_data.h"
#include "chebyshev.h"
#include "hankel.h"
#include "simple_math.h"
using namespace mth;
void Enter_Data ( cmpx kappa, double ConstEps, Matrix& M)
{
// N: Integer:= M.all'Last(1);
const cmpx A0 = 1.0 / (2.0*kappa);
const cmpx ConstA1 = -kappa / 4.0;
const cmpx ConstG0 = ((M_PI *... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 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 "adjunct/quick_toolkit/widgets/Op... |
#ifndef __TRIANGLE_H__
#define __TRIANGLE_H__
#include <opencv2/core/utility.hpp>
#include <opencv2/opencv.hpp>
using namespace cv;
void draw_point(Mat& img, Point2f fp, Scalar color);
void draw_delaunay(Mat& img, Subdiv2D& subdiv, Scalar delaunay_color);
#endif |
#include "G_Particle_type.h"
#include "G_Particles_IO.h"
#include "G_Global_IO.h"
#include <fstream>
#include <vector>
#include <ctime>
#include <omp.h>
using namespace std;
char *path = "c:/mydata.st";
void writeList()
{
ofstream fout;
fout.open(path,ios_base::binary);
// first
char *attname="houdini";
g_part... |
#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;
int n, k, a, b;
int p[100010];
ll rec(ll l, ll r) {
// 区間内のa_iの数
ll num = upper_bound(p, p + k, r) - upper_bound(p, p + k, l);
if (num == 0) return a; // 空区間をスキップ
if (r - l == 1) return b * num; // 長さが1のときは... |
#ifndef OPCACHE_H_
#define OPCACHE_H_
class OpCache {
public:
OpCache(unsigned int sz);
~OpCache();
unsigned int check(char op, unsigned int a, unsigned int b); // Returns UINT_MAX on failure.
void insert(char op, unsigned int a, unsigned int b, unsigned int res);
typedef struct {
unsigned int hash;
char o... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
typedef long long ll;
ll gcd(ll x, ll y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}
int main()
{
int n, m;
cin >... |
#include <iberbar/RHI/D3D11/CommandContext.h>
#include <iberbar/RHI/D3D11/Device.h>
#include <iberbar/RHI/D3D11/Buffer.h>
#include <iberbar/RHI/D3D11/Shader.h>
#include <iberbar/RHI/D3D11/ShaderState.h>
#include <iberbar/RHI/D3D11/ShaderVariables.h>
#include <iberbar/RHI/D3D11/VertexDeclaration.h>
#include <iberbar/RH... |
#include<bits/stdc++.h>
using namespace std;
#define CAT 1
#define DOG 2
#define RAT 4
#define RABBIT 8
int main(){
int a=CAT|DOG;
int b=RAT;
int c=CAT|DOG|RAT|RABBIT;
int d=DOG|RAT;
printf("A pet is (cat=%d, dog=%d, RAT=%d, RABBIT=%d)\n",(a&CAT)!=0,(a&DOG)!=0,(a&RAT)!=0,(a&RABBIT)!=0);
printf... |
#include "precompiled.h"
#pragma hdrstop
/*
============
idLangDict::idLangDict
============
*/
idLangDict::idLangDict( void ) {
args.SetGranularity( 256 );
hash.SetGranularity( 256 );
hash.Clear( 4096, 8192 );
baseID = 0;
}
/*
============
idLangDict::~idLangDict
============
*/
idLangDict::~idLangDict( void )... |
#include "FileSystem.h"
#include "EverydayTools/Preprocessor/ExpotImport.h"
extern "C"
{
void EXPORT __cdecl CreateSystem(void** result) {
*result = new keng::filesystem::FileSystem;
}
}
|
#include "Kdtree.h"
#include <cstdio>
#include <algorithm>
#include <numeric>
#include <cmath>
namespace P_RVD{
// Eww global. Need this for the sort function
// A pointer to the class itself, allows the sort function to determine the splitting axis to sort by
static KDtree *myself = NULL;
KDtree::KDtree()
{
m... |
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <cstdlib> // for exit()
using namespace std;
// incomplete
// this struct is to describe words that COULD be placed on the board
// not sure this is the best way to deal with possible words, but it feels like it
struct Words {
str... |
#pragma once
#include "ShaderBase.h"
class Shader : public ShaderBase
{
public:
//empty shader
Shader();
//default shader
Shader(const char* vertexPath, const char* fragPath, const char* geoPath, bool debug);
~Shader();
bool CompileFromCode(const char* vertexCode, const char* fragCode, const char* geoCode);
... |
// test_dslash_multi_cpu.cpp
// Andrei Alexandru
// Jan 2010
#include <stdlib.h>
#include "comm/comm_low.h"
#include "su3.h"
#include "dslash_multi_cpu.h"
#include "layout_minsurface.h"
#include "dslash_legacy.h"
#include "timer.h"
#include "options.h"
#include "random_vectors.h"
using namespace qcd;
#define node0_... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2008-2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Jan Borsodi
*/
#ifndef OP_SCOPE_TRANSPORT_MESSAGE_H
#define OP... |
/* -*- 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.
*/
#include "core/pch.h"
#include "platforms/mac/subclasses/MacThre... |
/*
Kristjan von Bulow CSE 232 Project 11
This project deals with linked lists
*/
#ifndef SINGLELINK_H
#define SINGLELINK_H
#include<iostream>
using std::ostream; using std::cout; using std::endl;
#include<sstream>
using std::ostringstream;
#include<utility>
using std::swap;
#include<string>
using std::string;
// ... |
#include "drilling_calibration_request_subscriber.h"
CDrillingCalibrationRequestSubscriber::CDrillingCalibrationRequestSubscriber() :
m_pOnDataAvailable(nullptr),
m_pOnSubscriptionMatched(nullptr)
{
}
CDrillingCalibrationRequestSubscriber::~CDrillingCalibrationRequestSubscriber()
{
}
bool CDrillingCalibratio... |
#pragma once
#include <iberbar/RHI/Types.h>
#include <iberbar/RHI/Resource.h>
//#include <unordered_map>
namespace iberbar
{
namespace RHI
{
class __iberbarRHIApi__ IVertexDeclaration abstract
: public IResource
{
public:
IVertexDeclaration( const UVertexElement* pVertexElements, uint32 nVertexElements... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
#define INT_MIN (1<<31)
#define INT_MAX (~INT_MIN)
#define UNREACHABLE (INT_MAX>>2... |
#ifndef __CC_GREEREQUESTDIALOG_H__
#define __CC_GREEREQUESTDIALOG_H__
#include "CCStdC.h"
#include "cocoa/CCString.h"
#include "cocoa/CCDictionary.h"
#include "GreeExtensionMacros.h"
// setParams
#define GD_REQUEST_DIALOG_PARAM_KEY_TITLE "title" // to be set with CCString
#define GD_REQUEST_DIALOG_PARAM_KEY_BODY "b... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef WEBSERVERSTATELISTENER_H
#define WEBSERVERSTATELISTENER_H... |
/*
* @lc app=leetcode.cn id=704 lang=cpp
*
* [704] 二分查找
*/
// @lc code=start
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
int n = nums.size();
if(n==0)return -1;
int l = 0, r = n - 1;
while(l<=r... |
#include <assert.h>
#include <getopt.h>
#include <limits.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
#include "timer.h"
#include "rapl.h"
#define DEFAULT_DURATION 10000
#define DEFAULT_INITIAL 256
#define DEFAULT_NB_THREADS ... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
#include <bits/stdc++.h>
using namespace std;
double precision=0.000001;
int main()
{
int t;
double x, y, c, h1, h2, h, wide, low, high;
cin >> t;
for(int i = 1 ; i <= t ; i++){
cin >> x >> y >> c;
low = 0;
high = x > y ? x : y;
for(int j = 0 ; j < 50 ; j++)... |
#include <GL/glut.h>
#include "Luce.h"
Luce::Luce() {
disegnaLuce();
}
void Luce::setPosizione(Posizione pos1) {
posizione = pos1;
}
Posizione Luce::getPosizione() {
return posizione;
}
void Luce::move(double x, double y, double z) {
}
void Luce::disegnaLuce() {
GLfloat light_position[] ... |
//
// Drone.h
// SAD
//
// Created by Marquez, Richard A on 4/11/15.
// Copyright (c) 2015 Richard Marquez. All rights reserved.
//
#pragma once
#include "Packet.h"
#include "Command.h"
#include "Motor.h"
#include "Rangefinder.h"
#include "DigitalCompass.h"
// Right motor
#define H_ENABLE_PIN_1 3
#define H_CON... |
// 0920_6.cpp : 定义控制台应用程序的入口点。
//
#include <iostream>
using namespace std;
int main()
{
int AH, AM, AS, BH, BM, BS;
int N, flag = 1;
int second, minute, hour;
cin >> N;
while (flag<=N)
{
cin >> AH >> AM >> AS >> BH >> BM >> BS;
if ((AS + BS) >= 60)
{
minute = 1;
second = AS + BS - 60;
}
else
... |
#include "Player.hh"
#include "Play.hh"
#include "umlrtcommsportrole.hh"
#include "umlrtmessage.hh"
#include "umlrtslot.hh"
#include <cstddef>
#include "umlrtcapsuleclass.hh"
#include "umlrtframeservice.hh"
class UMLRTRtsInterface;
struct UMLRTCommsPort;
Capsule_Player::Capsule_Player( const UMLRTCapsuleClass * cd, ... |
#pragma once
#include "QuestionWithChoices.h"
#include "GradedChoice.h"
#include "MultipleChoiceQuestion_fwd.h"
namespace qp
{
class CMultipleChoiceQuestion : public CQuestionWithChoices
{
public:
LOKI_DEFINE_CONST_VISITABLE()
CMultipleChoiceQuestion(std::string const &description, double score = 0.0, const CGrade... |
#pragma once
#include <stdio.h>
#include <time.h>
#include <iostream>
#include <string>
#define LOG_PREFIX "log-"
//feel free to C++ this.
//as long as we have a printf-like-function
struct Logger {
std::string file_location;
FILE *out_file;
Logger(const char* filename);
~Logger();
//return: bytes wri... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 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)
*
*/
#inclu... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
char str[maxn];
int cnt[10];
int main() {
scanf("%s",str);
int len=strlen(str);
for(int i=0; i<len; i++) {
if(str[i]=='B') cnt[0]++;
else if(str[i]=='u') cnt[1]++;
else if(str[i]=='l') cnt[2]++;... |
/* -*- 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.
*/
#include "core/pch.h"
#include "platforms/mac/pi/ui/MacOpUiInfo.... |
/*
cheali-charger - open source firmware for a variety of LiPo chargers
Copyright (C) 2013 Paweł Stawicki. All right reserved.
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, eit... |
#include<stdio.h>
#include<string.h>
#define N 10
main()
{
char str1[N],str2[N];
int i,j=0;
gets(str1);
for(i=1;i<=strlen(str1)-1;i+=2)
if(str1[i]%2==1)
str2[j++]=str1[i];
str2[j]='\0';
puts(str1);
puts(str2);
}
|
//http://codeforces.com/contest/570/problem/C
#include <iostream>
using namespace std;
int main() {
int n, m, tempAns, ans;
string s;
cin >> n >> m >> s;
tempAns = ans = 0;
for(char ch : s) {
if(ch == '.')
tempAns++;
else {
if(tempAns != 0)
ans += tempAns - 1;
tempAns = 0;
}
}
if(tempAns != 0... |
// kumaran_14
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define p push
#define mp make_pair
#define pb push_back
#define foi(i, a, n) for (i = (a); i < (n); ++i)
#define foii(i, a, n) for (i = (a); i <= (n); ++i)
#define fod(i, a, n) for (i = (a); i > (n); --i)
#define fodd(i, a, n... |
#include <Windows.h>
#include <iostream>
#include <vector>
#include "FileMemMapper.h"
#define GetDOSHeader(filep) ((PIMAGE_DOS_HEADER)filep)
#define GetPEHeader(filep) ((PIMAGE_NT_HEADERS)((DWORD)GetDOSHeader(filep) + GetDOSHeader(filep)->e_lfanew))
#define GetFileHeader(filep) ((PIMAGE_FILE_HEADER)&GetPEHeader(filep... |
#include "Room.h"
#include <iostream>
#include <string>
using namespace std;
Room::Room(){}
string Room::getName(){
return name;
}
void Room::setName(string room_name){
name = room_name;
}
Status Room::getStatus(){
return status;
}
void Room::setStatus(Status status){
this->status = status;
}
string Room::getTy... |
// ----------------------------------------------------------------------------
// nexus | MaterialsList.cc
//
// Definition of materials of common use.
//
// The NEXT Collaboration
// ----------------------------------------------------------------------------
#include "MaterialsList.h"
#include <G4Material.hh>
#inc... |
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
#define window_height 400
#define window_width 600
float rotation = 1;
float zoom = 1;
float trans = 1;
float mouseX = 0 , mouseY = 0;
float red = 1;
float green = 0;
float blue = 0;
void display(void);
void tela(GLsizei w, GLsizei h);
//void keyboard(unsig... |
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include "class.h"
#include <QDialog>
#include <QLineEdit>
#include <QPushButton>
#include <QMessageBox>
#include <QFile>
#include <QTextStream>
#include <QTimer>
#include <QTimerEvent>
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESP... |
#include "Logger.h"
namespace Log
{
} |
#include <iostream>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
void printValue(unsigned int* val, int size) {
for(int i = 0; i < size / 16; i++) {
if (i > 0) {
cout << ' ';
}
cout << setfill('0') << setw(8) << hex << val[... |
#include <stdio.h>
#include "SDL2_net.h"
using namespace SDL2;
#pragma comment(linker, "/subsystem:console")
int main(int argc, char **argv)
{
SDL sdl;
Net net;
TCP tcp("127.0.0.1", 9999);
if (!tcp)
{
printf("tcp:%s\n", net.GetError());
}
else
{
printf("connect ok,%X,%d\n", tcp.GetPeerAddress().host(), tc... |
/*
Name: ±»3Õû³ý
Copyright:
Author: Hill bamboo
Date: 2019/8/14 22:09:08
Description:
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int lo, hi;
scanf("%d %d", &lo, &hi);
int ans = 0;
int s = 0;
for (int i = 1; i <= lo; ++i) {
s += i;
}
if (s % 3 == 0) ++ans;
for (int i = lo + 1; i <= hi... |
#include <iostream>
using namespace std;
#define MOD 1000000007;
int main()
{
int n;
cin >> n;
// initially ant is at d
long long zD = 1;
long long zABC = 0;
for (int i = 1; i <= n; i++)
{
//number of ways of going to a or b or c from d
long long nzD = zABC * 3 % MOD;
... |
//#include"stdafx.h"
#include"countOccurances.h"
int countOccurances(string mainStr, string search) {
int counter = 0, pos = 0;
while (pos != -1) {
pos = mainStr.find(search, pos);
if(pos != -1) {
counter++;
pos = pos + search.length();
//pos = mainStr.find(s... |
#include <chuffed/core/propagator.h>
void bool_rel(BoolView x, BoolRelType t, BoolView y, BoolView z) {
// NOT_SUPPORTED;
BoolView v[3] = {x, y, z};
int u = 0;
for (int l = 1; l <= 3; l++) {
for (int i = 0; i < 8; i++) {
if (bitcount<int>(i) != l) {
continue;
}
for (int j = 0; j < 8; j++) {
if ... |
/******************************************************************************************************//**
* @file dirscanstatistics.cpp
* @brief 目录扫描 源文件
*
* 递归扫描自定目录, 过滤后缀名, 获取文件名
* @author coolweedman
* @version V1.00
* @date 2016-7-8
*******************************... |
/**
* @file main.cpp
* @brief Stream compaction test program
* @authors Kai Ninomiya, Ruoyu Fan
* @date 2015, 2016
* @copyright University of Pennsylvania
*/
#include <stream_compaction/cpu.h>
#include <stream_compaction/naive.h>
#include <stream_compaction/efficient.h>
#include <stream_compactio... |
#include <iostream>
#include "handler.h"
#include "Factory.h"
using namespace std;
int main() {
Factory fa;
rectangle *re;
triangle *tr;
int type;
int offsetX, offsetY;
int k = 10;
cout<< "\n Меню:\n"
"0. Закрыть программу\n"
"1. Проверить на пересечение\n"
... |
#ifndef COMMON_H
#define COMMON_H
#include <iostream>
#include <cuda_runtime.h>
#include <cuda.h>
#define RT_CHECK(ans) \
{ rtAssert((ans), __FILE__, __LINE__); }
inline void rtAssert(cudaError_t code, const char *file, int line,bool abort = true) {
if (code != cu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2004-2007 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Tord Akerbęk
*/
#include "core/pch.h"
#ifdef PREFS_FILE_DOWN... |
//
// Created by JACK on 11/17/2015.
//
#ifndef CEF07B_MULTIMAP_H
#define CEF07B_MULTIMAP_H
#include "DynArray.h"
template <typename K,typename V>
class MultiMap {
private:
DynArray<K>* key;
DynArray< DynArray<V>* >* value;
public:
MultiMap(){
value = new DynArray< DynArray<V>* >();
key = new DynArray<K>();
}... |
/*
Programación Orientada a Objetos
PROYECTO 3
Ana Elisa Estrada Lugo
A01251091
05/06/2020
*/
//Disco.h
#include <iostream>
#include <string>
#ifndef DISCO_H
#define DISCO_H
#include "Material.h"
using namespace std;
class Disco:public Material{
public:
Disco();
Disco(int idM, string t, int d... |
#include<iostream>
#include<cstdio>
#include<map>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
void exc(char &a,char &b)
{
char t = a;
a = b;
b = t;
}
int main()
{char a,b,c;
while (cin >> a >> b >> c)
{
if (a > b... |
#include <Tanker/Trustchain/Block.hpp>
#include <Tanker/Crypto/Crypto.hpp>
#include <Tanker/Errors/Exception.hpp>
#include <Tanker/Serialization/Serialization.hpp>
#include <Tanker/Serialization/Varint.hpp>
#include <Tanker/Trustchain/Actions/Nature.hpp>
#include <Tanker/Trustchain/Errors/Errc.hpp>
#include <Tanker/Tr... |
#include<bits/stdc++.h>
using namespace std;
class Graph{
int V;//no of nodes/Vertices
list<int>*l;//list<int>*l=new list<int>[V]//create of list of pointers pointing to each vertice's/node's neighbours
public:
Graph(int V){//parameterised constructor
this->V=V;//set above n(private) to this value of n passi... |
#pragma once
#include "header.h"
#include "JPGImage.h"
#include "displayableobject.h"
class player :
public DisplayableObject
{
public:
player(BaseEngine* pEngine);
~player(void);
void Draw(void);
void DoUpdate(int iCurrentTime);
ImageData playersprite;
int movementFactor;
};
|
/*
ID: stevenh6
TASK: dualpal
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
ofstream fout ("dualpal.out");
ifstream fin ("dualpal.in");
bool palindrome(string num) {
for (int i = 0; i < num.length(); i++) {
if (num[i] != num[num.length() -... |
/*
* FriendClass.hpp
*
* Created on: Mar 27, 2017
* Author: sabinghimire
*/
#ifndef FRIENDCLASS_HPP_
#define FRIENDCLASS_HPP_
class FriendClass {
public:
FriendClass();
virtual ~FriendClass();
};
#endif /* FRIENDCLASS_HPP_ */
|
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#include <numeric>
typed... |
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
#define SIZE 26
// https://leetcode.com/problems/word-search-ii/
class Trie{
public:
Trie();
~Trie();
void insert(string key);
Trie* find(char key) const;
bool isInAns;
const string& getWord() const;
private:
... |
#pragma once
#include <maya/MPxDeformerNode.h>
class SwirlDeformer : public MPxDeformerNode
{
public:
static void *creator() { return new SwirlDeformer; }
static MStatus initialize();
virtual MStatus deform(MDataBlock&, MItGeometry&, const MMatrix&, unsigned int);
static MTypeId typeId;
static MString typeName... |
//[UVA][¯x°}] 10229 - Modular Fibonacci
#include <iostream>
using namespace std;
struct M
{
long long v[2][2];
} I = {1,0,0,1}, o = {0,0,0,0}, A = {1,1,1,0};
void mult(M &a, M &b, int m)
{
int i, j, k;
M t = o;
for(i = 0; i < 2; i++)
{
for(j = 0; j < 2; j++)
{
for(k = ... |
#include <iostream>
#include "mylib.h"
int main (void) {
int a = 2;
int b = 3;
std::cout << a << " + " << b << " = " << Sum(a, b);
return 0;
} |
{
RTMScope rtm;
{
// code protected by the RTM
}
};
|
#include "Rectangle.h"
class Platform : public Rectangle
{
public:
Platform()
{
size_x = 70;
size_y = 20;
color = 0xFFFFFFF00;
}
/*void check_collisions(Bonus *bonuses, Ball *balls)
{
}*/
void tick_bonuses(float dt)
{
}
void move(int input)
{
pos_x += input / 1... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* 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.
*/
#ifndef RE_EXECUTE_H
#define RE_EXECUTE_H
#include "modules/regexp/src/re_... |
#include <iostream>
#include "BulletTransform.h"
namespace Game
{
Transform BulletTransform::fromPhysics()
{
Transform transform;
transform.position.x = mTransform.getOrigin().x();
transform.position.y = mTransform.getOrigin().y();
transform.position.z = mTransform.getOrigin().z();
ret... |
#include "ofApp.h"
#include "snappy.h"
void ofApp::setup() {
kinect.open();
kinect.initDepthSource();
kinect.initColorSource();
kinect.initInfraredSource();
kinect.initBodyIndexSource();
kinect.initBodySource();
kinect.getColorSource()->setYuvPixelsEnabled(true);
ofBackground(40);
this->buffer.allocate(50... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node
{
char num[10];
char desc[100];
struct node *next;
};
typedef struct node nd;
nd *p, *list;
int search(char *sx)
{
int found=0;
p=list;
if(list!=NULL)
{
while(p!=NULL)
{
if(!strcmpi(p->num,sx))
{
... |
#pragma once
#include "Argument.hpp"
#include <vector>
namespace models {
class Operation
{
std::string name;
std::string returnType;
std::vector<Argument> arguments;
public:
Operation() {};
Operation(const std::string &name, const std::string &retType, const std::vector<Argument> &arguments);
... |
#if !defined(__GAME_TIMER_H__)
#define __GAME_TIMER_H__
#define GAME_TIMEUNIT_MSEC 1
#define GAME_TIMEUNIT_SEC 2
#define GAME_TIMEUNIT_USEC 3
class GameTimer
{
public:
virtual bool start(void) = 0;
virtual bool stop(void) = 0;
virtual bool pause(void) = 0;
virtual bool resume(void) = 0;
vi... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// CSS property names are typically all lowercase and written
// in dash-separated notation, which means that each pair of
// adjacent words is separated by a single dash. For
// example, "z-index", "padding-left", and "border-collapse"
// are typical names. However, if ... |
// Created on: 1995-06-22
// Created by: Flore Lantheaume
// 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 G... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include<iostream>
#include<stdlib.h>
#include<string.h>
using namespace std;
int main()
{
int n,count;
count=0;
char temp[20];
cout<<"Enter number to be checked\n";
cin>>n;
itoa(n,temp,10);
int l1=strlen(temp);
for(int i=0;i<l1;i++)
{
for(int j=i+1;j<l1;j++)
{
if(temp[j]==temp[i])
{
count++;
... |
#include <iostream>
#include "camerasensor.hpp"
// #include <librealsense2/rs_option.h>
////////////////////////////////////////////////////////////////////////////////
std::vector<CameraSensor*> CameraSensor::connected_devices = std::vector<CameraSensor*>();
rs2::context CameraSensor::ctx_;
////////////////////////... |
/*
* STR.h
*
* Created on: Nov 14, 2019
* Author: lucas
*/
#ifndef STR_H_
#define STR_H_
#include <list>
#include "STRTask.h"
class STR {
private:
std::list<Task> tasks;
int size;
public:
STR(std::list<Task> tasks, int size){
this->tasks = tasks;
this->size = size;
}
int getSize() const {
ret... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include <iostream>
#include <algorithm>
#include "thread_group.hpp"
#include "async.hpp"
#include "../time_invocation/time_invocation.hpp"
#include <cassert>
inline void fill(int *x, int val, std::size_t n)
{
using namespace test::this_thread_group;
const int gid = get_id();
// XXX gcc miscompiles this... |
// Author: Jakub Precht
#ifndef RECORDER_H
#define RECORDER_H
#include <essentia/algorithmfactory.h>
#include <QTimer>
#include <QAudioRecorder>
#include <QAudioProbe>
#include <QAudioInput>
class Settings;
class Recorder : public QObject
{
Q_OBJECT
public:
Recorder(QObject *parent = nullptr);
bool i... |
#include <iostream>
#include "Output.h"
#include "GameController.h"
using namespace std;
int main()
{
GameController game;
bool val = game.Simulate();
//(val==1)?cout<<"Enemy Commander defeated":cout<<"User Defeated";
Output* out;
out = Output::getInstance();
cout<<out->jsonMsg... |
/**
* Copyright (c) 2020, 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... |
#include "CHttpConnection.h"
const char *OK_TITILE = "OK";
const char *ERROR_400_TITLE = "Bad Request";
const char *ERROR_400_FORM = "Your request has bad syntax or is inherently impossible to satisfy.\n";
const char *ERROR_403_TITLE = "Forbidden";
const char *ERROR_403_FORM = "You do not have permission to get file ... |
#include "list.h"
void InitList(DATA dataArray[], uint length, std::list<DATA> &List){
for(uint i = 0; i < length; ++i){
List.push_back(dataArray[i]);
}
}
bool GetData(const std::list<DATA> &List, uint pos, DATA &data){
std::list<DATA>::const_iterator iter = List.begin();
if(pos > List.size()){
return false;
... |
/* -*- 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.
*/
#include "core/pch.h"
#ifdef M2_SUPPORT
# include "adjunct/m2/s... |
#include "Main.cpp"
#include "Common/Math.cpp"
#include "Services/Font.cpp"
#include "Services/Input.cpp"
#include "Services/Timer.cpp"
#include "Services/Window.cpp"
#include "Services/ImmediateRenderer2D.cpp"
#include "ECS/Entity.cpp"
#include "ECS/Component.cpp"
#include "Components/Transform2DComponent.cpp"
#inc... |
#pragma once
#include "CImg.h"
#include "glm.hpp"
#include <iostream>
#include "parser.h"
#include <fstream>
#include <cstdlib>
using namespace glm;
using namespace std;
void insert_objects(vector<Sphere> spheres, Plane plane, Mesh mesh, vector<shared_ptr<Shape>> &all_shapes); //Need to include triangle ... |
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <set>
using namespace std;
int main(int argc,char* argv[]){
int genRandPoints(int,FILE*);
if (2!=argc){
fprintf(stderr,"usage: rand xxx\nxxx is the number of points to gen\n");
return 1;
}
int num;
if (1!=sscanf(argv[1],"%d",&num)||num<0){
fprint... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.