text stringlengths 8 6.88M |
|---|
/* -*- 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.
*
*/
#ifndef MDE_OPFONT_H
#define MDE_OPFONT_H
#include "modules/... |
/****************************************************************
File Name: util.C
Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995
Copyright(c) 1995 by Tian Zhang
All Rights Reserved
Permission to use, copy and modify this software must be granted
by the author and... |
#define BOOST_SP_DISABLE_THREADS
#include "PointLocatorExec.h"
///////////////////////////////////////////////////////////////////////
//
//
//
//
// Public Methods
//
//
//
//
//////////////////////////////////////////////////////////////////////
PointLocatorExec::PointLocatorExec()
{
}
PointLocatorExec::PointLoca... |
#include "QFileSearch.h"
const char* COLTAG[] = { "文件名" ,"文件夹" ,"大小" ,"修改时间" };
const int COLWIDTH[] = { 200, 300, 80, 200 };
const char* FILESIZEUNIT[] = { " B", " KB", " MB", " G" };
const char* FORMAT = "%u年%u月%u日 %u时%u分%u秒";
QFileSearch::QFileSearch(QWidget *parent)
: QMainWindow(parent)
{
QMutexLocker locker(&... |
#include<iostream>
#include<string>
using namespace std;
int main()
{
int arr[256]={0};
string s;
cin>>s;
for(int i=0;i<s.size()/2;i++)
{
if( s[i] != s[s.size()-i-1] )
{
cout<<"not palindrome";
return 0;
}
}
cout<<"... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int number, test = 1;
while(cin >> number && number > 0)
{
int hello = 1, count = 0;
while(hello < number)
{
hello+=hello;
count++;
}
cout << "Case " << test++ << ": " << count << endl;
}
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* 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.
*/
#include "core/pch.h"
#ifdef MEDIA_... |
#include "executive.h"
#include <stdexcept>
#include <string>
executive::executive(std::string _filename) {
ifstream input;
string name;
float distance;
int count_review;
string temp;
input.open(_filename);
if (input.is_open()) {
while (!input.eof()) {
getline(input, temp, ',');
int num =... |
// Created on: 1993-03-10
// Created by: Philippe DAUTRY
// 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 GN... |
// Created on: 1996-09-04
// Created by: Christian CAILLET
// Copyright (c) 1996-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 ... |
#include "use.h"
#include "teacher.h"
#include "student.h"
void doSomething(User &u)
{
u.output();
}
int main()
{
// User user;
// std::cout << User::get_user_count() << std::endl;
// std::cin >> user;
// // user.fname="pritam";
// // user.lname="sarkar";
// // user.set_status(... |
//
// Particle.cpp
// w04_h02_particle
//
// Created by Kris Li on 9/28/16.
//
//
#include "Particle.hpp"
Particle::Particle(){
setInitialCondition(ofPoint(0,0), ofPoint(0,0));
}
void Particle::setInitialCondition(ofPoint _pos, ofPoint _vel){
pos.set(_pos.x, _pos.y);
vel.set(_vel.x, _vel.y);... |
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
class Solution {
public:
string addStrings(string num1, string num2) {
string res;
int carry=0,i,j,cur;
for(i=int(num1.size())-1,j=int(num2.size())-1;i>=0||j>=0;i--,j--)
{
if(i<0)
... |
//Phoneix_RK
/*
https://leetcode.com/problems/number-of-islands/
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by wa... |
#include<iostream>
#include<string>
#define MAX 1000
using namespace std;
void showMenu(){
cout << "***************************" << endl;
cout << "***** 1、添加联系人 *****" << endl;
cout << "***** 2、显示联系人 *****" << endl;
cout << "***** 3、删除联系人 *****" << endl;
cout << "***** 4、查找联系人 *****" << endl;
cout <... |
/**
* @file library_export.hpp
*
* @todo Add description
*
* @author Matthew Rodusek (matthew.rodusek@gmail.com)
* @date Nov 30, 2015
*
*/
/*
* Change Log:
*
* Nov 30, 2015:
* - library_export.hpp created
*/
#ifndef VALKNUT_CORE_INTERNAL_LIBRARY_EXPORT_HPP_
#define VALKNUT_CORE_INTERNA... |
// OpenVDB_Softimage
// VDB_Node_MeshToVolume.h
// Mesh to Volume custom ICE node
#ifndef VDB_NODE_MESHTOVOLUME_H
#define VDB_NODE_MESHTOVOLUME_H
#include <xsi_pluginregistrar.h>
#include <xsi_status.h>
#include <xsi_icenodecontext.h>
#include <openvdb/openvdb.h>
class VDB_Node_MeshToVolume
{
public:... |
#include <PA9.h>
#include "PlayerProfile.h"
#include "DSspecs.h"
#include "InitFat.h"
#include <fat.h>
#include <unistd.h>
#include <sys/dir.h>
PlayerProfile::PlayerProfile()
:m_nameLength(0), m_level(0), m_experience(0){
SetName("");
}
PlayerProfile::PlayerProfile(const PlayerProfile &pp)
:m_lev... |
#include "Stonewt.h"
using std::cout;
Stonewt::Stonewt(double lbs) :stone((int)lbs / Lbs_per_stn), pds_left((int)lbs% Lbs_per_stn + lbs - (int)lbs), pounds(lbs)
{
}
Stonewt::Stonewt(int stn, double lbs) : stone(stn), pds_left(lbs), pounds(stn* Lbs_per_stn + lbs)
{
}
Stonewt::Stonewt() : stone(0), pds_left(0), pounds(... |
//
// CompositeByteCompressor.cpp
// Garmin-Encode
//
// Created by Quinn Ramsay on 2018-11-28.
// Copyright © 2018 Quinnter. All rights reserved.
//
#include "CompositeByteCompressor.h"
CompositeByteCompressor::CompositeByteCompressor()
{
}
CompositeByteCompressor::~CompositeByteCompressor()
{
for(auto com... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@tiliae.eu *
* ~~~~~~~~ *
* Lice... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2002 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"
#ifdef ECMASCRIPT_DEBUGGER
#include "module... |
#ifndef EVENTPULL_H
#define EVENTPULL_H
#include <thread>
#include <string>
#include <queue>
class APIPULL
{
std::thread apiThread;
std::string URI;
bool isRunning;
std::queue<std::string> *statusQueue;
void doWork();
public:
APIPULL(std::string URI);
~APIPULL();
void Run();
void addToStatusQueue(const std::... |
//
// Created by cis505 on 12/1/17.
//
#include <grpc++/grpc++.h>
#include "../common/WriteServiceClient.h"
#include <thread>
int main(int argc, char *argv[]) {
string address1 = "0.0.0.0:50051";
WriteServiceClient client1(grpc::CreateChannel(address1, grpc::InsecureChannelCredentials()));
vector<string> r... |
//
// GFireAttack.h
// Core
//
// Created by Max Yoon on 11. 8. 29..
// Copyright 2011년 __MyCompanyName__. All rights reserved.
//
#ifndef Core_GFireAttack_h
#define Core_GFireAttack_h
class GFireAttack : public GFarAttack
{
GnDeclareCreateAttack;
public:
static GFarAttack* CreateAttack(guint32 u... |
#include <stdio.h>
#include <math.h>
#include "Maze.h"
int** _maze;
bool inSquare = false;
int c_x, c_z;
Maze::Maze(void)
{
_sizeWidth = 50; // Default size
_sizeHeight = 50;
c_x = -1;
c_z = -1;
}
Maze::~Maze(void)
{
}
void Maze::newMaze(int width, int height)
{
_mazeGen.generateNewMaze(width, height);
_ma... |
#include "ofApp.h"
//-----------------------------------------------------------------------------------------
//
void ofApp::setup()
{
//ofSetLogLevel( OF_LOG_VERBOSE );
ofSetFrameRate( 60 );
fontSmall.loadFont("Fonts/DIN.otf", 8 );
ofxGuiSetDefaultWidth( 300 );
int texSize = 128;
particles.init( texSize... |
//
// Created by 송지원 on 2020-01-24.
//
#include <iostream>
using namespace std;
int main()
{
int N, K;
long long mod = 1000000000;
long long d[201][201] = {0, };
cin >> N >> K;
for (int n=0; n <= N; n++) {
d[1][n] = 1;
}
for (int k=2; k<=K; k++) {
for (int n=0; n<=N; n++... |
#include "player.hpp"
#include <algorithm>
namespace Game
{
void Player::setName(const std::string& name)
{
this->name = name;
for(PlayerActionListener* l : listeners)
l->setName(name);
changed();
}
void Player::setActiveVehicle(Vehicle* vehicle)
{
if(vehicles.getIndexOf(vehicle) != -1)
activeVehicle = ... |
//
// Created by ischelle on 05/05/2021.
//
#pragma once
#include "Player.hpp"
namespace pandemic {
class Scientist : public Player {
public:
int n;
Scientist(Board board, City city, int n);
// Player discover_cure(); // Can discover a cure with `n` cards instead of 5
... |
#include <Wire.h>
#include <stdlib.h>
#include <Servo.h>
#include <IRremote.h>
#define ACTIVATED HIGH
unsigned long elapsed_time;
unsigned long last_time_print;
/*--- Propeller Servos -------------------------------------------------------*/
Servo right_prop;
Servo left_prop;
double throttle = 1100;
int button_state =... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright 2002 Opera Software ASA. All rights reserved.
*
* ECMAScript regular expression matcher -- test code
* Lars T Hansen
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//testing
#include "scaffold.h"
//testing
... |
/** This file holds the core program logic behind the user interface.
* Implemented functions are work (for calculating bmi and updating
* the UI), and reset (for restoring the UI into its default state).
* + minor helper functions female_checked, male_checked and close.
* @author Daniel "3ICE" Berezvai
* @st... |
// 이 MFC 샘플 소스 코드는 MFC Microsoft Office Fluent 사용자 인터페이스("Fluent UI")를
// 사용하는 방법을 보여 주며, MFC C++ 라이브러리 소프트웨어에 포함된
// Microsoft Foundation Classes Reference 및 관련 전자 문서에 대해
// 추가적으로 제공되는 내용입니다.
// Fluent UI를 복사, 사용 또는 배포하는 데 대한 사용 약관은 별도로 제공됩니다.
// Fluent UI 라이선싱 프로그램에 대한 자세한 내용은
// http://msdn.microsoft.com/off... |
#pragma once
#include <Dot++/lexer/TokenizerStateInterface.hpp>
namespace dot_pp { namespace lexer { namespace states {
class SlashLineCommentState : public TokenizerStateInterface
{
public:
TokenizerState consume(const char c, FileInfo& info, Token& token, std::deque<TokenInfo>& tokens) const... |
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/vespalib/data/smart_buffer.h>
#include <vespa/vespalib/net/tls/tls_context.h>
#include <vespa/vespalib/net/tls/transport_security_options.h>... |
#include<bits/stdc++.h>
using namespace std;
void dec_to_bin(int n)
{
int binarr[100],i=0;
while(n>0)
{
binarr[i]=n%2;
n=n/2;
i++;
}
for(int j=i-1;j>=0;j--)
{
cout<<binarr[j]<<" ";
}
}
int main(){
int n;
cin>>n;
dec_to_bin(n);
}
|
//: C10:NamespaceOverriding1.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
#include "NamespaceMath.h"
int main() {
using namespace Math;
Integer a; // Zaslania Math::a;
a.setSign(neg... |
#ifndef CUSTOMGRAPHICSVIEW_H
#define CUSTOMGRAPHICSVIEW_H
#include <QGraphicsView>
class MainWindow;
class CustomGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
static QSize getNormalSize();
public:
CustomGraphicsView(QWidget *parent = Q_NULLPTR);
CustomGraphicsView(QGraphicsScene *scene, QWid... |
#include "./platform/UnitTestSupport.hpp"
#include <Dot++/Exceptions.hpp>
#include <Dot++/NullConstructionPolicy.hpp>
#include <Dot++/lexer/TokenInfo.hpp>
#include <Dot++/parser/states/ReadLeftBracketVertexAttributeState.hpp>
namespace {
using namespace dot_pp::lexer;
using namespace dot_pp::parser;
... |
int ledPin = 12;
int durations[] = {200, 200, 200, 500, 500, 500, 200, 200, 200};
void setup() // run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop() // run over and over again
{
for (int i = 0; i < 9; i++)
{
... |
#include "treeface/graphics/guts/SubPath.h"
#include "treeface/graphics/guts/LineStroker.h"
using namespace treecore;
namespace treeface
{
void SubPath::stroke_complex( Geometry::HostVertexCache& result_vertices,
treecore::Array<IndexType>& result_indices,
... |
#pragma once
#ifndef _LR_CONSTRUCTOR_PRODUC_ITEM_
#define _LR_CONSTRUCTOR_PRODUC_ITEM_
#include <iostream>
#include <vector>
#include <set>
#include "LrContext.h"
#include "Produc.h"
using namespace std;
class ProducItem
{
private:
//该项目对应的产生式编号
size_t produc_no;
public:
//该项目对应的产生式
Produc produc;
//该项目当前进度位置
s... |
#include "lib_guide_screen.h"
/* note
提示屏如果两条语音间隔小于0.5秒,后一条语音会覆盖前一条语音
如果一条语音开始播放,要等播放完才会放下一条语音
*/
guide_screen::guide_screen(const char * ip, short port)
{
modbus = NULL;
is_connected = false;
monitor_quit = false;
timeout = 0;
dev_ip = ip;
dev_port = port;
last_gs_index = 0;
gs... |
#include "Folder.h"
#include <io.h>
#include <direct.h>
#include <algorithm>
#include <iostream>
using namespace std;
Folder::Folder()
{
}
Folder::~Folder()
{
}
bool Folder::operator<(const Folder& a)
{
return this->getPath() < a.getPath();
}
bool Folder::init(const char* path)
{
FileList.clear();
SubList.clear()... |
/*
* 题目:131. 分割回文串
* 地址:https://leetcode-cn.com/problems/palindrome-partitioning/
* 知识点:dfs + dp
*/
class Solution {
public:
void dfs(string &s, int i) {
if (i == n) {
ans.push_back(temp);
return;
}
for (int j = i; j < n; j++) {
if (dp[i][j]) {
... |
#include "clientinfo.h"
// This makes sure the cpp and header refer to the same vector
std::vector<ClientInfo> ClientInfo::clients;
ClientInfo::ClientInfo(char *hostName, char *ipAddress ) {
this->hostName = hostName;
this->ipAddress = ipAddress;
// this->fileNames = new std::vector<std::string>;
}
ClientInfo::... |
//=====================================================
// File : STL_algo_interface.hh
// Author : L. Plagne <laurent.plagne@edf.fr)>
// Copyright (C) EDF R&D, lun sep 30 14:23:24 CEST 2002
//=====================================================
//
// This program is free software; you can redistribute it and/or
... |
/*!
\author Ken Jinks
\date Aug 2018
\file jinks_math.cpp
\brief This file contains math functions not in math.h
*/
#include "jinks_math.h"
namespace JinksMath
{
}
|
/* -*- 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.
*/
#ifndef OP_TIME_WIDGET_H
#define OP_TIME_WIDGET_H
#include "modu... |
#ifndef DESIGNPATTERN_OBSERVER_SUBJECT_H_
#define DESIGNPATTERN_OBSERVER_SUBJECT_H_
#include <vector>
#include "isubject.h"
namespace DesignPatter
{
class Subject : public ISubject
{
public:
virtual bool Register(IObserver*);
virtual bool Notify() const;
private:
typedef std::vector<IObserver*> ObserverVec;
O... |
/*
Copyright (c) 2005-2022 Xavier Leclercq
Released under the MIT License
See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt
*/
#include "TestSequence.hpp"
namespace Ishiko
{
TestSequence::TestSequence(const TestNumber& number, const std::string& name)
: Test(number, name), m_item... |
#include <fstream>
int main(){
std::fstream i("input.txt"), o("output.txt", 2);
int a, b = 0;
i >> a;
while (a > 0) {
b += a % 2;
a /= 2;
}
o << b;
} |
#pragma once
#include "checksum_crc.h"
#include "interface.h"
#include "bitbuf.h"
#include "dt_common.h"
#include "dt_recv.h"
#include "../../../Utils/Utils.h"
struct model_t;
class CSentence;
struct vrect_t;
struct cmodel_t;
class IMaterial;
class CAudioSource;
class CMeasureSection;
class SurfInfo;
class ISpatialQue... |
// Copyright 2017 Elias Kosunen
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
#include "mythreadpool.h"
MyThreadPool::MyThreadPool()
{
}
void MyThreadPool::pthread_pool_create(int max,int min,int queue_max)
{
this->thread_shutdown = true;
this->thread_max = max;
this->thread_min = min;
this->thread_busy = 0;
this->thread_alive = 0;
this->thread_exitcode = 0;
this->... |
/***************************************************************************
* Sketch Name: Lighting Control System
* Description: This sketch illustrates how an Arduino Yun can be controlled
remotely by subscribing to an MQTT broker
* Created On: March 01, 2016
* Author: Adeel Javed
* Book: ... |
#include <iostream>
#include <vector>
#include <complex>
#include <cmath>
#include <random>
#include <cassert>
using std::vector;
using std::complex;
using std::cout;
using std::endl;
typedef complex<double> Complex;
typedef vector<double> DArray;
typedef vector<Complex> ComArray;
typedef vector<ComArray> ... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
using namespace std;
class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
//基本思想:字典排序(二进制排序)子集,以字典序的顺序获得全部组合,第一个序为000,最后一个序为111,对应nums元素,vec[i]=1则将nums[i]加入cur
vector<vector<int>> res;
vector<int> cur;
vector<int> v... |
#ifndef _PlayerManager_H_
#define _PlayerManager_H_
#include "CDL_Timer_Handler.h"
#include "RobotUtil.h"
#include "Player.h"
#include "Util.h"
#include <map>
struct RobotID
{
int uid;
bool hasused;
};
class PlayerManager
{
typedef std::map<int, Player*> MapPlayer;
Singleton(PlayerManager);
public:
static... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
int main(){
int N , K;
cin >> N >> K;
vector<vector<int>>T(N,vector<int>(N));
rep(i,N){
rep(j,N){
cin >> T[i][j];
}
}
//ここま... |
#pragma once
#include <queue>
#include <mutex>
#include <utility> // move 사용
using namespace std;
template<typename T>
class LockQueue
{
public:
LockQueue() { }
LockQueue(const LockQueue&) = delete;
LockQueue& operator=(const LockQueue&) = delete;
void Push(T value)
{
lock_guard<mutex> lock(_... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
bool ans = false;
cin >> n;
int div_2 = 0, div_4 = 0, others = 0;
for(int i=0; i<n; i++){
int a;
cin >> a;
if(a%4 == 0) div_4++;
else if(a%2 == 0) div_2++;
else others++;
}
... |
//Name: Dan Haub
//Student ID#: 2315346
//Chapman Email: haub@chapman.edu
//Course Number and Section: CPSC 350-01
//Assignment: 4 - Registrar Simulation
#ifndef WINDOW_H
#define WINDOW_H
#include "GenDoubleLinkedList.h"
#include "Student.h"
#include <iostream>
#include <string>
using namespace std;... |
#pragma once
#include <iostream>
#include "Employee.h"
using namespace std;
class FullTimeEmployee : public Employee
{
private:
double weekSalary;
public:
// Default Constructor
FullTimeEmployee() : Employee() {
weekSalary = 0.0;
}
// Constructor
FullTimeEmployee(int a, string b, string c, ... |
#include<stdio.h>
#include<math.h>
#include <stdlib.h>
#include<iostream>
#define MAXSIZE 10000
#define STACKINCREMENT 2000
typedef struct {
int stacksize;
int *top, *base;
}SqStack;
typedef struct {
int stacksize;
long long int *top, *base;
}SqStackL;
void InitStack(SqStack &S) {
S.base = (int*)malloc(MAXSI... |
#pragma once
#include "../CHARINFO.h"
namespace NETWORKMODEL {
namespace IOCP {
namespace DETAIL {
struct CONNECTION;
}
}
}
namespace PACKET {
namespace CHARINFO {
void PacketProcessor(FUNCTIONS::CIRCULARQUEUE::QUEUEDATA::CPacketQueueData* const Data);
void ProcessNewCharacter(const NETWORKMODEL::IOCP:... |
#include <vector>
#include <iostream>
#include <time.h>
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
#ifndef __QUAD__
#define __QUAD__
//用于表示网格的四个角的坐标
class Quad
{
public:
Point2f V00;//左上角
Point2f V01;//左下角
Point2f V10;//右上角
Point2f V11;//右下角
Quad();
Quad(const Quad &inQuad);//复制构造函数... |
#include <iostream>
using namespace std;
int nums[13];
int matrix[13];
int n;
void combination(int matrix[], int tn, int tr, int index, int tcount){
if(tr <= index){
//end
for(int i = 0; i < tr; i++){
cout << nums[matrix[i]] << " ";
}
cout << '\n';
return;
}... |
#include "library.h"
int FCILibraryBooks::getMaxInt(vector<int>& v)
{
return *max_element(v.begin(), v.end());
}
void FCILibraryBooks::printMenu()
{
cout<<"0 - Exit."<<endl;
cout<<"1 - Add Book."<<endl;
cout<<"2 - Search by name."<<endl;
cout<<"3 - Search by author."<<endl;
cout<<"4 - List books in... |
/* This file is part of the Pangolin Project.
* http://github.com/stevenlovegrove/Pangolin
*
* Copyright (c) 2011 Steven Lovegrove
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Softw... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10474"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 10000
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#... |
#include "Config.h"
#ifdef USING_OGL
#include "ModelGL.h"
#include "Utils.h"
#include "XLoader.h"
#include "Timer.h"
#include <iostream>
#include "TextureGL.h"
#include "Mesh.h"
#include "RenderAttributes.h"
#include <vector>
extern sf::RenderWindow window;
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
void ModelGL... |
#include "DepthImageComp.h"
int vcount=0;
unsigned char cdata[120000];
int cbuffer_size=120000;
// Callback function gets invoked during compression...
// It returns the compressed data byte by byte...
void OwnWriteFunction(int byte)
{
if(vcount<cbuffer_size)
cdata[vcount]=(unsigned char)byte;
... |
// Project 19 Tune Player
int soundPin = 11;
byte sine[] = {0, 22, 44, 64, 82, 98, 111, 120, 126, 127,
126, 120, 111, 98, 82, 64, 44, 22, 0, -22, -44, -64, -82,
-98, -111, -120, -126, -128, -126, -120, -111, -98, -82,
-64, -44, -22};
int toneDurations[] = {120, 105, 98, 89, 78, 74, 62};
char* song = "e e ee e ... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef FOO_H
#define FOO_H
#include <QObject>
class Foo
#ifdef FOO
: public QObject
#endif
{
Q_OBJECT
public:
Foo();
public slots:
void doFoo();
};
#endif
|
#include "frame.h"
#include "util.h"
#include "gtest/gtest.h"
#include <string>
#include <iostream>
TEST(UtilTest, NormalTest) {
std::string data = "hello world";
uint8_t enc_a_wire[30];
const uint8_t e_wire[13] = {0x00, 0x0b, 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};
int32_t enc_a_len = ... |
#include "skybox.h"
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "stb_image.h"
#include <iostream>
void skybox::loadCubemap(GLuint& skytexture)
{
//unsigned int textureID;
glGenTextures(1, &skytexture);
glBindTexture(GL_TEXTURE_CUBE_MAP, skytexture);
int width, height, nrChannels;
... |
#include<iostream>
#include<memory>
#include<vector>
#include "konto.h"
#include "person.h"
#include "bank.h"
using namespace std;
int main(){
auto konto=make_shared<Girokonto>();
auto person1=make_shared<Person>("Gregor");
auto person2=make_shared<Person>("Melanie");
person2->addKonto(*konto);
person2->konto_teilen(... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
// you can use includes, for example:
// #include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
int solution(vector<int> &A, vector<int> &B) {
// write your code in C++14 (g++ 6.2.0)
int N = A.size();
int sol = 0;
int j = 0;
int i... |
#pragma once
#include <vector>
#include <utility>
#include <string>
#include <ionir/construct/type.h>
#include <ionir/tracking/symbol_table.h>
namespace ionir {
typedef std::pair<ionshared::Ptr<Type>, std::string> Arg;
class Args {
private:
ionshared::Ptr<ionshared::SymbolTable<Arg>> items;
... |
/* -*- 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.
*
* @author Arjan van Leeuwen (arjanl)
*/
group "desktop_util.optightvector";
include ... |
//
// StringLib.cpp
// Landru
//
// Created by Nick Porcino on 10/29/14.
//
//
#include "StringLib.h"
#include "LandruActorVM/Fiber.h"
#include "LandruActorVM/Generator.h"
#include "LandruActorVM/Library.h"
#include "LandruActorVM/VMContext.h"
#include <algorithm>
#include <string>
#include <cmath>
#include <memo... |
#include "sfr_list.h"
SFR_List::SFR_List(QObject *parent) :
QObject(parent)
{
}
SFR_List::Add(SFR_Object *sfr)
{
SFR_List::sfrList.push_back(sfr);
// TODO: Добавить проверку зависимостей и добавление отсутствующих в списке ФТБ.
}
|
# include <iostream>
using namespace std;
int main()
{
int num;
cin >> num;
int *arr = (int *)malloc(num * sizeof(int));
for(int i = 0; i < num; i += 1) {
cin >> arr[i];
}
for(int i = num; i > 0; i -= 1) {
cout << arr[i-1] << endl;
}
return 0;
} |
#include "monstro2.h"
monstro2::monstro2()
{
for(int i = 0; i < 20; i++) {
shapes[i] = new sphere();
shapes[i]->updateMesh(20, 20, 20);
shapes[i]->updateMaterial(0, 255, 0);
}
}
void monstro2::update()
{
float value = shapes[NUI_SKELETON_POSITION_HAND_LEFT]->position.x - shapes[NUI_SKELETON_POSITION_HAND_RIG... |
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... |
#include "skipUicGen.hpp"
#include "skipUicNoGen1.hpp"
#include "skipUicNoGen2.hpp"
int main(int, char**)
{
skipGen();
skipNoGen1();
skipNoGen2();
return 0;
}
// -- Function definitions
void ui_nogen1()
{
}
void ui_nogen2()
{
}
|
#ifndef CHASSIS_H
#define CHASSIS_H
//#include "Infantry_Funtion.h"
//#include "main.h"
#include "FreeRTOS.h"
#include "PID.h"
#include <main.h>
#include "drv_can.h"
#include "motor.h"
#include "arm_math.h"
#include "math.h"
extern CAN_HandleTypeDef hcan1;
extern CAN_HandleTypeDef hcan2;
extern Motor_G... |
#include <stdio.h>
#define GC_DEBUG
#include "gc_cpp.h"
#define CHECK_LEAKS() GC_gcollect()
class Foo: public gc{};
int main() {
GC_find_leak = 1;
Foo *f;
while(1){
f =new Foo; //t2.cpp line10
// delete f;
CHECK_LEAKS();
}
}
|
#include <iostream>
using namespace std;
template<class...Args>
struct type_list;
template<>
struct type_list<>
{
};
template<class T>
struct type_list<T>
{
using first = T;
using remain = type_list<>;
};
template<class T, class...Args>
struct type_list<T, Args...>
{
using first = T;
using remain = type_list<Args.... |
// Copyright 2017 Elias Kosunen
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
/**
* @file DTWRecognizer.h
* @brief Gesture Recognition Algorithm using DTW(Dynamic Time Warping) Algorithm
* @author Dae-Hyun Lee
*/
#if !defined(__DTW_RECOGNIZER_H__)
#define __DTW_RECOGNIZER_H__
#include <vector>
#include "Singleton.h"
#include "Recognition.h"
#define dtwRecognizer (DTWRecognizer::instan... |
/*
* Copyright (c) 2016, The Regents of the University of California (Regents).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the a... |
// Created on: 1997-03-17
// Created by: Yves FRICAUD
// 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 GNU L... |
// https://www.boost.org/doc/libs/1_74_0/libs/tokenizer/doc/escaped_list_separator.htm
// simple_example_2.cpp
#include<iostream>
#include<boost/tokenizer.hpp>
#include<string>
int main(){
std::string csv = "Field 1,\"putting quotes around fields, allows commas\",Field 3";
boost::tokenizer<boost::escaped_list_se... |
#pragma once
#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
//using namespace sf;
class Cloud
{
private:
int m_CloudId;
sf::Texture m_Texture;
sf::Sprite m_Sprite;
float m_StartingYpos;
float m_SpriteSpeed = 0.0f;
bool ... |
//
// Created by 钟奇龙 on 2019-05-18.
//
#include <iostream>
using namespace std;
/*
* 定义点
*/
class Point{
public:
double x;
double y;
Point(double x1,double y1):x(x1),y(y1){
}
};
/*
* 定义二维向量
*/
class Vec{
public:
double x;
double y;
Vec(Point *from,Point *to){
this->x = from->x -... |
#include <iostream>
#include <vector>
using std::vector;
using std::cin;
using std::cout;
int main() {
int C;
cin>>C;
vector<int> input(C);
int N = 0;
for (int i = 0; i < C; ++i) {
cin>>input[i];
if(input[i] > N){
N = input[i];
}
}
vector<int> ret(N + 1,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.