text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 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 QUERY_PARSER_IMPL_H_
#define QUERY_PARSER_IMPL_H_
#ifdef OPERA_... |
// g2o - General Graph Optimization
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
// 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 cod... |
#pragma once
#include "ofxKinectNui.h"
#include "ofMain.h"
#include "ofxXmlSettings.h"
#include "characters\monstro1.h"
#include "characters\monstro2.h"
#include "characters\stickman.h"
#define USE_KINECT
class testApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed ... |
/****************************************************************************
** Meta object code from reading C++ file 'CDownloadCM.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.3.2)
**
** WARNING! All changes made in this file will be lost!
*********************************************************... |
#include <iostream>
using namespace std;
int main()
{
long long n,temp1,temp2,countx1 = 0, countx2 = 0;
cin>>n;
for(int i = 0 ; i < n; i++){
cin>>temp1>>temp2;
if(temp1 < 0)
countx1++;
else
countx2++;
}
if(countx1 == 1 || countx2 == 1)
cout<<"Yes"<<... |
#include <iostream>
#include <cstdio>
#include <queue>
using namespace std;
int main(){
int n,x;
queue <int>q;
cin >> n;
for(int i = 0; i < n; i++){
cin >> x;
q.push(x);
}
int a[n];
for(int i = 0; i < n; i++){
cin >> a[i];
}
int total_time = 0, executed_job = 0;
while(!q.empty()){
int job = q.front()... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// Author: Tatparya Shankar
void next_move(int posr, int posc, vector <string> board) {
// Check if current position is clean
if( board[posr][posc] == 'd' )
{
// Clean
cout << "CLEAN" << endl... |
/* -*- Mode: c++; tab-width: 4; 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.
*
*/
#include "core/pch.h"
#include "adjunct/quick/speeddial/BitmapButton.h"
#include ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#include "modul... |
#include <bits/stdc++.h>
using namespace std;
set<int> points;
void dfs(int src, vector<int> &dis, vector<int> &low, int timer,
vector<int> adj[], int parent) {
low[src] = dis[src] = timer++;
int children = 0;
for (int child : adj[src]) {
if (child == parent) continue;
if (low[child] == -1) {
... |
#include "GridCell.h"
GridCell::GridCell(double xMin, double xMax, double yMin, double yMax, QObject *parent) :
QObject(parent),
xMin(xMin),
xMax(xMax),
yMin(yMin),
yMax(yMax)
{
cloud = new PointCloudT;
cloudPtr.reset(cloud);
}
void GridCell::addPoint(PointT point)
{
cloud->points.push_back(point);
}
Point... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#pragma once
#include "color.h"
#include "light.h"
class point_light final : public light
{
public:
point_light(vector3 center, ::color color, double intensity);
auto direction_from(const vector3& hit_point) -> vector3 override;
auto distance(const vector3& hit_point) -> double override;
auto intensity(const vec... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Base
{
public:
int a;
protected:
int b;
private:
int c;
};
// 公有继承方式:基类中是什么控制权限,继承到子类中也是什么控制权限
class A : public Base
{
public:
int d;
void show()
{
// 子类的成员函数去访问父类的成员:子类不可访问父类的私有成员
// cout <<... |
#include <Servo.h>
#include <ros.h>
#include <geometry_msgs/Twist.h> // For geometry_msgs::Twist
ros::NodeHandle nh;
Servo servo1;
void messageCb(const geometry_msgs::Twist& msg)
{
const float x = msg.linear.x;
const float z_rot = msg.angular.z;
if (x == 0.1){
servo1.write(120);
}
else if (x==... |
#pragma once
#include <vector>
#include <string>
#include "../../math/maths.h"
#include "../renderable/sprite.h"
namespace sge { namespace graphics{
class SpriteSheet{
private:
std::vector<Sprite::Tex_Coord> m_Uvs;
int m_Rows, m_Columns;
public:
SpriteSheet(int columns, int rows);
~SpriteSheet();
i... |
#include<iostream>
#include<stdio.h>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<list>
#include<unordered_map>
#include<unordered_set>
#define ll long long
#define MAX 2000
using namespace std;
int ... |
#pragma once
#include <cstdint>
#include <wrl.h>
#include <Descriptors.h>
namespace wrl = Microsoft::WRL;
// {238B3FF9-0BCB-4706-9237-E4632DA5E5C9}
DEFINE_GUID(IID_VShader,
0x238b3ff9, 0x0bcb, 0x4706, 0x92, 0x37, 0xe4, 0x63, 0x2d, 0xa5, 0xe5, 0xc9);
MIDL_INTERFACE("238B3FF9-0BCB-4706-9237-E4632DA5E5C9")
IVShader : ... |
#include <iostream>
using namespace std;
int main(){
int jk;
jk = 0; //inputan nilai
cout << "Dengan IF ELSE" << endl; // tampilkan judul
if(jk == 0){ //cek apakah nilai jk = 0
printf("Laki - Laki \n"); //apabila nilai jk = 0 maka cetak "Laki - Laki"
}else if(jk == 1){ //cek apakah n... |
#include <iostream>
using namespace std;
class Solution {
public:
bool isNumber(string str)
{
if (!str.size()) return false;
bool is_float = false; // true: 第一次出现小数点, false: 尚未出现小数点
bool is_science = false; // true : 第一次出现了e, false: 尚未出现e
bool have_digits = false; ... |
#define BOOST_SP_DISABLE_THREADS
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include "CellLocator.h"
#include "tests/TriangleMesh2DGenerator.h"
#include "Offset2CountFunctor.h"
#include "tests/unit_testing/Help.h"
using namespace dax::cont;
// main
int main(void)
{
// first gen... |
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QAndroidJniObject>
#include <QAndroidJniEnvironment>
#include <QtAndroid>
#include <QRemoteObjectNode>
#include "rep_gpsprovider_replica.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHi... |
/**
* Copyright 2015 ViajeFacil
* @author Hugo Ferrando Seage
*/
#ifndef ENTRADAHISTORIAL_H
#define ENTRADAHISTORIAL_H
#include <string>
class entradaHistorial {
private:
bool creado;
bool modificado;
bool borrado;
std::size_t asientos;
std::string origen;
std::string destino;
std::... |
#pragma once
#include "glm.hpp"
#include "gl_core_4_5.h"
#include "glfw3.h"
#include "ext.hpp"
#include <assert.h>
#include <string>
#include <vector>
class Mesh
{
public:
Mesh();
virtual ~Mesh();
void initaliseQuad();
virtual void draw();
struct Vertex // strcuts are easier to copy for raw data
{
glm::vec4 posit... |
#ifndef OFXACTIONEVENTH
#define OFXACTIONEVENTH
#include <string>
class ofxActionEvent {
private:
std::string command;
void* arg;
public:
const std::string getActionCommand() const {
return command;
}
void* getArg() const {
return arg;
}
ofxActionEvent(std::string sCommand, void* pArg = 0)
:comman... |
#ifndef __STREAMER_H__
#define __STREAMER_H__
#include <string>
#include "player/Player.h"
#include "record/MediaRecorder.h"
//CStreamer对象用于管理整个播放/录制过程的对象
////////////////////////////////////////////////////////////////////////////////
class CStreamer
{
public: //对外接口, 返回值=0: 表示成功,其他值表示失败
static CPlayer *Crea... |
//---------------------------------------------------------------------------
#ifndef WorkSpaceManagerH
#define WorkSpaceManagerH
//---------------------------------------------------------------------------
#include "SPCommon.h"
#include "ParseFileData.h"
#include "SourceData.h"
#include "AMap.h"
#include <ComCtrls.... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <set>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#de... |
#pragma once
class AI_AlignBossHead : public Hourglass::IAction
{
public:
void LoadFromXML( tinyxml2::XMLElement* data );
void Init( hg::Entity* entity );
IBehavior::Result Update( Hourglass::Entity* entity );
IBehavior* MakeCopy() const;
private:
float m_Timer;
float m_Duration;
Vector3 m_TurnToPoint;
hg... |
/*
* 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.
*/
#include <quic/QuicException.h>
#include <quic/congestion_control/SimulatedTBF.h>
#include <chrono>
namespace quic {
SimulatedT... |
//
// Created by manout on 18-2-24.
//
#include <string>
#include <iostream>
static bool check_is(int num)
{
int num_r = (num % 10) * 10 + num / 10;
return num - num_r == 27;
}
int guess_age()
{
int count_ = 0;
for (int i = 27; i < 100; ++i)
{
if (check_is(i))
{
std::... |
#include "vlc4sfml/video.h"
#include <gsl/span>
#include <vlc/vlc.h>
namespace sf {
Video::Video() noexcept
{
m_vlc_instance = CustomUniquePtr<libvlc_instance_t>(
libvlc_new(0, nullptr), [](auto* ptr) { libvlc_release(ptr); });
m_media_player = CustomUniquePtr<libvlc_media_player_t>(
libvlc_media_playe... |
#ifndef MQTT_TRANSPORT_H_
#define MQTT_TRANSPORT_H_
#include <stdint.h>
#include <netinet/in.h>
#include "frame.h"
#include "mqttError.h"
class Transport {
struct sockaddr_in* target;
public:
uint8_t readBuff[65536];
uint8_t writeBuff[65536];
int sock;
Transport(int sock, sockaddr_in* client);
... |
#include <iostream>
using namespace std;
void Passed(int value) {
if (value < 60)
cout << "you failed";
else
cout << "you passed!";
}
int main()
{
cout << "Hello World!" << endl;
// Data Types
int;
float;
double;
long;
short;
char;
str... |
/*****************************************************************************************************************
* File Name : countOccurenceSortedArray.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\arrays\page05\countOccurenceSortedArray.h
* Created on : Jan 7, 2... |
#include <iostream>
#include <queue>
#include <deque>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <math.h>
#include <string.h>
#include <bitset>
#include <cmath>
using namespace std;
int solution(int N, int number){
vector<set<int>> arr(9);
... |
#include "previousbutton.h"
previousButton::previousButton(QWidget *parent)
: DIconButton(parent)
{
setFixedSize(36, 36);
}
void previousButton::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Left ||
event->key() == Qt::Key_Right ||
event->key() == Qt::Key_Up ||
even... |
#include "../../Common/Window.h"
#include "../CSC8503Common/StateMachine.h"
#include "../CSC8503Common/StateTransition.h"
#include "../CSC8503Common/State.h"
#include "../CSC8503Common/NavigationGrid.h"
#include "TutorialGame.h"
#include "../CSC8503Common/PushdownMachine.h"
#include "../CSC8503Common/PushdownState.h... |
#include "StdAfx.h"
/*
#include "LinkedList.h"
template<class Content> LinkedList<Content>::LinkedList(void)
{
first = nullptr;
}
template<class Content> LinkedList<Content>::~LinkedList(void)
{
Link<Content>* last;
for(Link<type>* ptr = start; ptr != nullptr; ptr)
{
last = ptr->next;
free(ptr);
ptr = las... |
/* -*- 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
*/
#include "core/pch.h"
#include "modules/style/src/css_selector.h"
#include "modules/probetoo... |
/*
ID: stevenh6
TASK: shopping
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using db = double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = ... |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
template <typename T>
class Graph
{
map<T, list<T>> l;
public:
void addEdge(T x, T y)
{
l[x].push_back(y);
//l[y].push_back(x);
}
void dfs_helper(T src, map<T, bool> &visited, vector<T> &ordering)
{
//recursiv... |
/*********************************************************************
* File pong.cpp
* Author Peter Look
* Class COP 2001 201901 10410
* Purpose Main application file for the game pong.
**********************************************************************/
#include <iostream>
#include <time.h>
#include "pong.h"
#... |
class Solution {
public:
void replaceSpace(char *str,int length) {
int spaceNum = 0;
for(int i=0; i<length; ++i){
if(str[i] == ' '){
spaceNum++;
}
}
int newLen = length+2*spaceNum;
int left = length-1;
int right = newLen-1;
... |
#ifndef CONVERTER_H
#define CONVERTER_H
#include <vector>
struct Audio
{
Audio( double inF, int inB, int inC )
: mFreq(inF), mBps(inB), mCCount( inC), mDataLength(0), mData(0)
{ /*if ( mChan != 1 || mChan != 2 ) throw();*/ }
// only 1 and 2 channels supported
~Audio() { };
double mF... |
// Created on: 1995-12-01
// Created by: EXPRESS->CDL V0.2 Translator
// 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 te... |
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
float n, s, y, v[100],p[100], c[100], lim = 0.000001, curTime, chefTime, temp, t;
bool d[10000];
cin >> t;
for(int j = 0; j < t; j++){
cin >> n >> s >> y;
for(int i = 0; i < n; i++)
cin >> v[i];
... |
#include <iostream>
#include <iomanip>
#include <vector>
#include <fstream>
#include <cmath>
#include <string>
using namespace std;
//Neville
double L(double x_val, vector<double>& xi, vector<double>& yi)
{
vector<double> P = yi;
for (unsigned int i = 1 ; i<xi.size(); i++)
{
for (unsigned int j=0;... |
#include <iostream>
#include <vpp/vpp.hh>
#include <vpp/utils/opencv_bridge.hh>
#include <vpp/algorithms/pyrlk/pyrlk_match.hh>
#include <vpp/algorithms/filters/scharr.hh>
#include <opencv2/opencv.hpp>
using namespace vpp;
int main(int argc, char* argv[])
{
image2d<vuchar1> i1(100,100);
image2d<vuchar1> i2(100,1... |
/*****************************************************************************************************************
* File Name : connectivity.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\tutorials\nptel\DSAndAlgo\lecture27\connectivity.h
* Created on : Jan 24, 2014 :: 10:37:39 PM
* ... |
#include <text_renderer.h>
TextRenderer::TextRenderer(TextShader* shader, std::string filename)
{
m_shader = shader;
m_filename = filename;
// Configure VAO/VBO for texture quads
glGenVertexArrays(1, &this->m_vertexArrayObject);
glGenBuffers(1, &m_vertexArrayBuffer);
glBindVertexArray(thi... |
/* leetcode 27
*
*
*
*/
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
if (nums.empty()) {
return 0;
}
int ans = nums.size();
int i = 0;
for (int j = 0; j < nums.size(); j++) {
if (nums[j] != val) {
nums[i]... |
#include <iostream>
using namespace std;
void reverse(char* str) {
int len = 0;
while (str[len]) {
len++;
}
for (int i = 0; i < (len / 2); i++) {
swap(str[i], str[(len - 1) - i]);
}
}
void run_reverse(char* str) {
cout << str << endl;
reverse(str);
cout << str << "\n... |
#ifndef __LIB_H__
#define __LIB_H__
/*
===============================================================================
idLib contains stateless support classes and concrete types. Some classes
do have static variables, but such variables are initialized once and
read-only after initialization (they do not maintai... |
#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <clocale>
#include <stack>
#include <chrono>
#include <thread>
#include <ncurses.h>
#include "Movement.h"
#define MAP_WIDTH 40
#define MAP_HEIGHT 20
#define MAX_STAGE 6
#define DOWN_KEY 258
#define UP_KEY 259
#define LEFT_KEY 260
#defin... |
// Created on: 1997-03-28
// Created by: Philippe MANGIN
// Copyright (c) 1997-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... |
// There is an integer array nums sorted in ascending order (with distinct values).
// Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed).... |
#pragma once
#include "Decision.h"
class WanderDecision : public Decision
{
public:
virtual void makeDecision(Agent* agent, float deltaTime);
void setAngle(vector2& vec, float value);
private:
float radius = 10;
float distanceToSphere = 400;
float jitter = 1;
float angleChange = 1;
float speed = 20;
};
|
#include "PowerUp.h"
PowerUp::PowerUp()
{
points = POWERUP_DATA::POINTS;
timeEffect = POWERUP_DATA::TIME_EFFECT;
}
void PowerUp::Update()
{
}
void PowerUp::Draw()
{
Renderer::Instance()->PushSprite(objectId, objectSpriteRect, objectRect);
}
PowerUp::~PowerUp()
{
}
|
#pragma once
#include "Commonheader.h"
#include "GoalObj.h"
#include "GameSeaquenceController.h"
#include "Physics.h"
class StaticObj;
class DynamicObj;
//ゲームの状態を管理するクラス
class State
{
public:
State(){}
State(int stageID);
~State();
void PhysicsUpdate();
void Update();
void Draw();
//外から渡される情報
bool hasCleared... |
/*
***Data Structure Mesh***
Store the infomation of
Input Model;
Input Points;
Output Model;
Include:
Mesh Vertex;
Mesh Edges;
Mesh Facets;
*/
#ifndef H_MESH_H
#define H_MESH_H
#include "math_3d.h"
#include "Common.h"
#include <vector>
namespace P_RVD
{
class Line
{
public:
Line(t_index _begin, t_index _en... |
/*
duration.c
Custom serializer for xsd:duration stored in a LONG64 with ms precision
- the LONG64 int can represent 106751991167 days forward and backward
- LONG64 is long long int under Unix/Linux
- millisecond resolution (1/1000 sec) means 1 second = 1000
- when adding to a time_t value, con... |
#ifndef _FeedBackPushProc_H_
#define _FeedBackPushProc_H_
#include "IProcess.h"
#include "ProcessFactory.h"
class FeedBackPushProc :public IProcess
{
public:
FeedBackPushProc();
virtual ~FeedBackPushProc();
virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* pt) ;
virtua... |
#include "GameBoard.h"
#include "GridSection.h"
#include <cstdlib>
#include <vector>
#include <string>
using namespace std;
GameBoard::GameBoard()
: mBoard(BOARD_WIDTH, BOARD_HEIGHT)
{
}
vector<string> GameBoard::ShapeStrings() const
{
return mBoard.ShapeStrings();
}
void GameBoard::ClearMarkers()
{
mBoard.Re... |
#ifndef __SHAPE_H__
#define __SHAPE_H__
#include "Ray.h"
#include <string>
#include <fstream>
#include <vector>
class Shape{
public:
virtual float SIntersect(Ray ToIn) = 0;
virtual int GetMaterial() = 0;
virtual Vector3 GetNormal(Vector3 intPoint) = 0;
};
#endif
|
/* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */
group "layout.list_item";
require init;
include "modules/layout/box/box.h";
include "modules/logdoc/htm_elm.h";
include "modules/logdoc/src/textdata.h";
include "modules/doc/frm_doc.h";
include "modules/selftest/src/doc_st_utils.h";
global
{
// Gets the mark... |
//#include <stdio.h>
//#include <string.h>
#include <math.h>
#include "Game.h"
#include <iostream>
Minigame * MG() {
static Minigame * mg = new Minigame();
return mg;
}
void SetupEnv();
Minigame::Minigame() {
GameState = Minigame::WAITING;
Level = 0;
lmState = 0;
SetupEnv();
NewMap();
// Load default textu... |
// 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 "pch.h"
#include "WaypointAgent.h"
#include "Core\Entity.h"
#include "Core\ComponentFactory.h"
#include "Renderer\DebugRenderer.h"
namespace Hourglass
{
uint32_t WaypointAgent::s_TypeID = ComponentFactory::GetSystemComponentID();
void WaypointAgent::Init()
{
m_NeedsPath = true;
m_NeedsCurrentWaypoint... |
//Phoenix_RK
/*
https://leetcode.com/problems/queens-that-can-attack-the-king/
On an 8x8 chessboard, there can be multiple Black Queens and one White King.
Given an array of integer coordinates queens that represents the positions of the Black Queens, and a pair of coordinates king that represent the position of the... |
//
// calcArete.cpp
// main
//
// Created by Wilfried Kamga on 2017-11-30.
//
#include "common.hpp"
using namespace tp3;
cv::Mat calcArete(cv::Mat_<cv::Vec3f> force, float seuil)
{
CV_Assert(!force.empty() && force.type() == CV_32FC3 && force.isContinuous());
cv::Mat arete(force.size(), CV_8UC1);
for (... |
//
// main.cpp
// QueueSimulation
//
// Created by Quincy Copeland on 3/29/19.
// Copyright © 2019 Quincy Copeland. All rights reserved.
//
#include <stdio.h>
#include <iostream>
#include <queue>
#include <stdlib.h>
#include <array>
#include <iomanip>
#include "simulator.hpp"
//double printPercentiles (std::vect... |
/* -*- Mode: c++; tab-width: 4; 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.
*/
group "dochand.save";
language c++;
include "modules/dochand/docman.h";
include "mo... |
#include "catch.hpp"
#include "cpp_lib.h"
/// Set of test cases for the c++ library
TEST_CASE("Unit tests for the cpp library", "[cpp_lib]") {
SECTION("Constructor default") {
auto o = bambazeled::cpp_lib::CppLib();
REQUIRE(o.getValue() == 0);
}
SECTION("Constructor value") {
auto o = bambazeled::c... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// You are to populate a 5x5 square with each of the numbers
// between 1 and 25, inclusive. The numbers in each row must
// be in increasing order from left to right. Some of the
// cells are already filled in, but no more than one number
// per row. You must fill in t... |
#ifndef _ROS_asctec_hl_comm_PositionWithCovarianceStamped_h
#define _ROS_asctec_hl_comm_PositionWithCovarianceStamped_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "std_msgs/Header.h"
#include "geometry_msgs/Point.h"
namespace asctec_hl_comm
{
class PositionWithCovaria... |
/*
* License:
* License does not expire.
* Can be distributed in infinitely projects
* Can be distributed and / or packaged as a code or binary product (sublicensed)
* Commercial use allowed under the following conditions :
* - Crediting the Author
* Can modify source-code
*/
/*
* File: Dimens... |
#ifndef CODING
#define CODING
#include <QWidget>
//#include <QVBoxLayout>
#include <QGridLayout>
#include <QPushButton>
#include <QPlainTextEdit>
#include <QToolButton>
#include <QLineEdit>
#include <QLabel>
#include <QFileDialog>
#include <QDataStream>
#include <QByteArray>
#include <QFile>
#include <QMessageBox>
#i... |
#ifndef __MOUSE_H
#define __MOUSE_H
#include "common/types.h"
#include "hardwarecommunication/interrupts.h"
#include "hardwarecommunication/port.h"
class MouseDriver : public InterruptHandler
{
Port8Bit dataport;
Port8Bit commandport;
uint8_t buffer[3];
uint8_t offset;
uint8_t buttons;
public:
MouseDriver(Int... |
#ifndef _PhpReChargeProc_H_
#define _PhpReChargeProc_H_
#include "BaseProcess.h"
class PhpReChargeProc : public BaseProcess {
public:
PhpReChargeProc();
virtual ~PhpReChargeProc();
virtual int doResponse(CDLSocketHandler *clientHandler, InputPacket *inputPacket, Context *pt);
};
#endif
|
#include "MsWordWrapper.h"
MsWordWrapper::MsWordWrapper( QWidget* parent /*= nullptr */ )
: QWidget( parent )
{
}
|
#include "memory_model.h"
#include <stdio.h>
MemoryModel::MemoryModel()
: start_address_(0),
end_address_(0),
p_memory_(NULL)
{
}
MemoryModel::~MemoryModel()
{
}
uint32_t MemoryModel::get_entry_point()
{
return entry_address_;
}
bool MemoryModel::load(const std::string &filename)
{
ui... |
#include "multi_lidar_calibrator.h"
int main(int argc, char **argv)
{
ros::init(argc, argv, __APP_NAME__);
ROSMultiLidarCalibratorApp app;
app.Run();
return 0;
}
|
/************************************************************************/
/*一个 url 指向的页面里面有另一个 url,最终有一个 url 指向之前出现过的 url 或空,这两
种情形都定义为 null。这样构成一个单链表。给两条这样单链表,判断里面是否存在同
样的 url。url 以亿级计,资源不足以 hash。 */
/************************************************************************/
#include ... |
#define CATCH_CONFIG_MAIN
#include "../external/catch2/catch.hpp"
#include "../src/algorithm/is_prime.hpp"
#include <vector>
TEST_CASE("Is Prime Test", "[Is Prime]")
{
struct TestStruct
{
int val;
bool actual;
TestStruct(int val, bool actual)
: val(val), actual(actual) {}... |
#ifndef __DXCOMMON_H__
#define __DXCOMMON_H__
#pragma once
// Direct 헤더 및 lib 설정 ======================================================//
#include "d3d9.h"
#include "d3dx9.h"
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#include "NormalLine.h"
// 텍스트 화면출력
void DrawText( int _x, int _y, D3DXCO... |
//Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive.
class Solution {
public:
int rangeBitwiseAnd(int left, int right) {
int cnt = 0;
int res = 0;
int tp = 1;
while(left > 0 && right > 0){
... |
#include <stdio.h>
#include <string.h>
#include <cstdint>
#include <iostream>
#include <vector>
#include <fmt/itoa.hpp>
namespace {
uint32_t valid_itoa(int32_t n, uint32_t width, uint32_t flags, char *b) {
char fmt[8];
uint32_t p = 0;
fmt[p++] = '%';
if (flags & fmt::Flag::SignPlus) fmt[p++] = '+';
if (... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
//
// Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
#ifndef IM_OP_INPUTCONTEXT_H
#define ... |
#ifndef MYHTTP_UTILITY_H_
#define MYHTTP_UTILITY_H_
#include <sys/socket.h>
#include <sys/types.h>
#include <stdlib.h>
#include <netdb.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/epoll.h>
#include <string.h>
#include <sys/stat.h>
#include <netinet/tcp.h>
#include <strin... |
#include "Point_2D.h"
Point_2D::Point_2D() {
x = 0;
y = 0;
}
Point_2D::Point_2D(double x, double y) {
this->x = x;
this->y = y;
} |
// SPDX-FileCopyrightText: 2021 Samuel Cabrero <samuel@orica.es>
//
// SPDX-License-Identifier: MIT
#include <Arduino.h>
#include <Comm.h>
#include <Log.h>
#include <WiFi.h>
#include <UMailer.h>
#include "config.h"
#include "global.h"
static void processAlarm() {
TUMailer::Message msg;
if (Global.alarmTriggered) ... |
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stdexcept>
using namespace std;
// unsigned int is a type you can use to store and manipulate
// natural numbers (N) in C++ programs. In other words
// whole numbers that are = 0.
const unsigned int SPLIT_ERROR = 0;
class... |
#ifndef __CHATTY_CHANNEL_H__
#define __CHATTY_CHANNEL_H__
#include <stdint.h>
#include <functional>
#include <utility>
#include "EventLoop.h"
namespace chatty {
namespace net {
class Channel {
public:
typedef std::function<void(Channel *channel)> ReadCallBack;
typedef std::function<void()> WriteCa... |
/*
* lib_car_detect.h
*
* This is the class to extract car info from wheel info
*
* Author: yubocheng@live.cn
*
* Copyright (c) 2019 Jimu
* All rights reserved.
*
*/
#ifndef __LIB_CAR_DETECT_H
#define __LIB_CAR_DETECT_H
#include "transfer_msgs/CarInfo.h"
#include "transfer_msgs/WheelArray.h"
#include "tran... |
#include <iostream>
using namespace std;
class ClockArith
{
public:
ClockArith();
ClockArith(int timeIn);
ClockArith operator+ (ClockArith that);
ClockArith operator- (ClockArith that);
ClockArith operator* (ClockArith that);
ClockArith operator+ (int intTime);
bool operator< (ClockA... |
#pragma once
#include <stdexcept>
#include <boost/asio.hpp>
#include "Defines.hh"
using namespace boost;
using namespace boost::asio;
class IpFilter
{
private:
ip::address _mask;
ip::address _min;
public:
IpFilter()
: _mask(), _min()
{
this->_mask = ip::address::from_string("255.255.255.255");
... |
#pragma once
#include "shader_program.h"
#include <glm.hpp>
#include <openvr.h>
#include "ply_loader.h"
class MoveTool;
class PointCloud
{
public:
PointCloud();
~PointCloud();
bool init();
void shutdown();
void update( float dt );
void render( const glm::mat4& view, const glm::mat4& projection );
void resetP... |
#pragma once
#include "component/component.h"
#include "entity/interfaces.h"
namespace component
{
struct ControllerComponentDesc : public ComponentDesc
{
};
class ControllerComponent : public Component, public IInputConsumer
{
public:
// typedefs
typedef ControllerComponentDesc desc_type;
... |
#include "stack.h"
#include <iostream>
#include <cassert>
void stack::push(uint32_t size, std::string tag, bool is_uninitialized)
{
/* first update every node's start address so they now start from +size */
for (auto& node : nodes)
node.update_position(size);
nodes.emplace_back(size, std::move(tag), is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.