text stringlengths 8 6.88M |
|---|
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this ... |
#include "ColorFade.h"
#include "Globals.h"
#include "rrrandom.h"
void ColorFade::setup() {
_color.set(CRGB::Black);
_color.setOnIdle([this](AnimatorRGB &anim) {
CRGB toColor = CRGB::White;
if (_fadeToWhite) {
toColor = CHSV(randi(255), randi(255), 255);
}
_fadeToWhite = !_fadeToWhite;
an... |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int read() {
int x = 0; bool m = 0; char c = getchar();
while (!isdigit(c) && c != '-') c = getchar();
if (c == '-') m = 1, c = getchar();
while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
if (m) return -x; else return x;
}
#define plus(x,y) ... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll LIS(vector<ll> &arr, ll n){
vector<ll> dp(n,1);
ll m = 1;
for(ll i=1;i<n;i++){
for(ll j=0;j<i;j++){
if(abs(arr[i]) > abs(arr[j]) && ((arr[i]>0 && arr[j]<0) || (arr[j]>0 && arr[i]<0))){
dp[i] = max(dp[i], 1+dp[j]);
if(dp[i]>m)... |
#ifndef RTPSERVER_H
#define RTPSERVER_H
#include "rtpclass.h"
class rtpServer : public rtpClass
{
Q_OBJECT
public:
rtpServer(QObject *parent = 0);
void rtp_recv_init(int port);
~rtpServer();
protected:
void OnNewSource(RTPSourceData *dat);
void OnBYEPacket(RTPSourceData *dat);
void OnRemov... |
#include "Vna.h"
#include "VisaBus.h"
using namespace RsaToolbox;
#include <QDebug>
#include <QString>
#include <QtTest>
#include <QSignalSpy>
#include <QScopedPointer>
class test_VnaCalKit : public QObject
{
Q_OBJECT
public:
test_VnaCalKit();
private:
Vna vna;
Connector type;
NameLabel nameLa... |
#include <Unixfunc.h>
#include <iostream>
using namespace std;
//read.cpp
int main()
{
int fdr = open("pipe", O_RDONLY);
ERROR_CHECK(fdr, -1, "open r");
char buf[100] = {0};
int ret;
while (1)
{
memset(buf, 0, sizeof(buf));
ret = read(fdr, buf, sizeof(buf));
if (ret == 0... |
// 2018-03-23 thewinds
// [题目] PAT A-1007
// 求最大子序列的和
// [考点] 处理子序列问题
// [心得]
// 这题折腾了好久才过,首先这是一个经典的题目,
// 解决方案从O(N*N*N)到 O(N)都有,所以选择死磕O(N)的算法,
// 可以知道如果想要得到最大的子序列,该子序列要有能继续增大的潜力,
// 也就是说这个子序列加上之后的一段序列(或者一个数)可以继续增大,
// 所以该子序列的和应该是大于0的。
// 因此可以从前到后遍历一次,如果到某一个位置的和小于等于0,就将和清零从下一个位置
// 进行尝试。如果大于0就与最大和进行比较,更新最大和和起始位置,要注意的是当... |
#include <algorithm>
#include <iostream>
#include <vector>
using std::vector;
int sortDescending(const int & l, const int & r){
return l > r;
}
long long max_dot_product(vector<int> a, vector<int> b) {
std::sort(a.begin(),a.end(),sortDescending);
std::sort(b.begin(),b.end(),sortDescending);
// write your ... |
// ****************************************************************************
// 1、线程安全;
// 2、苛求性能和间接性时,可以主动释放dll(一定要明白自己在做什么!)
//
// ****************************************************************************
#pragma once
#include <dlfcn.h>
#include <map>
#include <boost/smart_ptr.hpp>
#include "interface.h"
name... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "TankPlayerController.h"
#include "Engine/World.h"
#include "DrawDebugHelpers.h"
#include "Engine.h"
#include "Runtime/Engine/Public/UnrealClient.h"
#include "TankAimingComponent.h"
// Called when the game starts or when spawned
v... |
#include "xchat.hpp"
Xchat::Xchat(QObject *parent) :
QObject(parent)
{
}
QString Xchat::messageTXT()
{
return m_messageTXT;
}
void Xchat::setmessageTXT(const QString &messageTXT)
{
if (messageTXT == m_messageTXT)
return;
m_messageTXT = messageTXT;
emit messageTXTChanged();
}
Xchat... |
#include "_pch.h"
#include "CtrlMain.h"
#include "config.h"
#include "globaldata.h"
#include "RecentDstOidPresenter.h"
#include "whLogin.h"
using namespace wh;
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//... |
#include <stdio.h>
#include <ncurses.h>
#include <string.h>
#include "controller.hpp"
#include "graphics.hpp"
#include "views/widget.hpp"
using namespace std;
using NativeKeyboardKey = long;
struct Graphics_Ncurses : Graphics {
Graphics_Ncurses();
// Methods
void drawString(int x, int y, const std::string& ... |
//
// nehe34.h
// NeheGL
//
// Created by Andong Li on 10/17/13.
// Copyright (c) 2013 Andong Li. All rights reserved.
//
#ifndef __NeheGL__nehe34__
#define __NeheGL__nehe34__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#include "utils.h"
#include "SOIL.h"
#include <iostream>
#include ... |
class Supply_Crate_DZE: MiningItems {
scope = 2;
model = "\z\addons\dayz_epoch\models\ammo_supply.p3d";
armor = 40;
displayName = $STR_EPOCH_BULK_NAME;
class DestructionEffects : DestructionEffects {
class Ruin1 {
simulation = "ruin";
type = "\z\addons\dayz_epoch\models\ammo_supply_wreck.p3d";
position... |
#ifndef AONE_H
#define AONE_H
#include <QDialog>
#include<QString>
#include"atwo.h"
namespace Ui {
class aone;
}
class aone : public QDialog
{
Q_OBJECT
public:
explicit aone(QWidget *parent = 0);
~aone();
private slots:
void on_pushButton_clicked();
void on_pushButton_2_c... |
#pragma once
#include"Anyinclude.h"
class PauseMenu
{
public:
PauseMenu(float width, float height);
~PauseMenu();
void draw(sf::RenderWindow& window);
void Moveup();
void Movedown();
int GetPressedItem() { return PselectedItem; }
int PselectedItem = 0;
private:
sf::Texture PmenuTexture[PMax_Items];
sf::Spri... |
#include <fwTools/dateAndTime.hpp>
#include <fwTools/System.hpp>
#include <fwRuntime/EConfigurationElement.hpp>
#include <fwData/Object.hpp>
#include <fwData/Patient.hpp>
#include <fwData/PatientDB.hpp>
#include <fwData/Study.hpp>
#include <fwTest/Data.hpp>
#include <fwTest/DicomReaderTest.hpp>
#include <fwDataToo... |
// Copyright 2012 Yandex
#include <gtest/gtest.h>
#include <map>
#include <string>
#include "ltr/data/object.h"
#include "ltr/data/data_set.h"
#include "ltr/data/feature_info.h"
#include "ltr/utility/indices.h"
#include "ltr/utility/numerical.h"
#include "ltr/feature_converters/feature_converter.h"
#include "ltr/fe... |
// Author: Miles Meacham
// Course: CS-1410-X01-deBry-Fall 2015
// Instructor: Professor deBry
// File: Account.cpp
// Date: 9/12/2015
// Contents: project02 The cpp file for the "Account" class
// I delcare that the following source code was written solely by me, or provided by the instructor.
// I understand that c... |
#include <cstdio>
#include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
bool wordBreak(string s, unordered_set<string> &dict){
int length = s.length();
bool sign[length+1];
sign[0] = 1;
string s1;
for(int i=1;i<=length;i++){
sign[i] = 0;
}
for(int i=0;i<length;i++){
... |
//
// Created by 송지원 on 2020/06/25.
//
//200625 바킹독 4강 강의듣고 다시 풀어보는 문제인데 시간 초과 나서 바킹독님 코드다시 쳐봄
//#include <bits/stdc++.h>
#include <iostream>
#include <list>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string init;
cin >> init;
list<char> L;
for (auto c : init) L... |
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int globalN;
int globalM;
vector<vector<int>> visited1;
vector<vector<int>> diff;
struct Compare{
public:
bool operator()(pair<pair<int, int>, int> a, pair<pair<int, int>, int > b) {
... |
#include <iostream>
using namespace std;
float f(float& x)
{
x +=1;
}
int main()
{
float x = 3.141592;
f(x);
cout << x << endl;
}
|
#ifndef APPLICATION_MESSAGE_H
#define APPLICATION_MESSAGE_H
#include "BaseObject.h"
#include "KeyWords.h"
// Message object
class Message : public BaseObject {
public:
Message();
Message(int chatId, const std::string& text,
int idOwner, time_t timeSend, unsigned int number);
Message(int chatI... |
/**
* Main class
* @author Clayton Williams
* @date September 2016
*/
#include <iostream>
#include "Utilities.h"
#include "Huffman.h"
#include <stdio.h>
#include <sys/types.h>
using namespace std;
/**
* Main
**/
int main() {
/** our huffman program **/
Huffman huffman;
/** Read and write file descr... |
#include "DictionaryFileReader.h"
namespace fileio
{
DictionaryFileReader::DictionaryFileReader(const string& path)
{
this->path = path;
}
bool DictionaryFileReader::char_isspace(char c)
{
return std::isspace(static_cast<unsigned char>(c));
}
Dictionary* DictionaryFileReader::readFileToDictionary()
{
s... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int T, N, K, map[29], shiftmap[29];
char arr[29];
vector<int> cnt;
<<<<<<< HEAD
/*
testestes123123
newtest
*/
=======
>>>>>>> parent of dbd05a9... test
int return_hex(char array1) {
switch (array1)
{
case '0': return 0;
case '1':... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2009 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef _OBML_ID_MANAGER_H
#define _OBML_ID_MANAGER_H
#ifdef WEB_TURBO... |
/********************************************************************************
** Form generated from reading UI file 'affichesolutions.ui'
**
** Created by: Qt User Interface Compiler version 4.8.6
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
**********************************... |
#include <iostream>
#include "module1.h"
#include "module2.h"
#include "module3.h"
int main(int argc, char** argv) {
std::cout << "Hello world!" << "\n";
std::cout << Module1::getMyName() << "\n";
std::cout << Module2::getMyName() << "\n";
using namespace Module1;
std::cout << getMyName() << "\n"; // (A) <- выз... |
// Author: Ilya Khramov
// Copyright (c) 2019 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 Software F... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2008-2010 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** @author Haavard Molland <haavardm@opera.com>
** @author Alex... |
#ifndef LEMON_H
#define LEMON_H
#include<iostream>
#include "citrusfruit.h"
class Lemon : public CitrusFruit {
public:
Lemon(float ph) : CitrusFruit(ph){}
const char * getName();
float getPh();
};
#endif
|
#pragma once
#include <functional>
#include <map>
#include <pangolin/utils/registration.h>
namespace pangolin {
// Based on http://simmesimme.github.io/tutorials/2015/09/20/signal-slot
template <typename... Args>
class Signal
{
public:
using Id = size_t;
using Reg = Registration<Id>;
S... |
/**
* Copyright (c) 2017, 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... |
/*
This file is part of SMonitor.
Copyright 2015~2016 by: rayx email rayx.cn@gmail.com
SMonitor 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, either version 3 of the License, or
(at your option) any later ver... |
mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());
ll uniform(ll l, ll r){
uniform_int_distribution<ll> uid(l, r);
return uid(rng);
}
ll mul(ll a, ll b, ll m) {
ll ret = a*b - ll(a*(long double)b/m+0.5)*m;
return ret < 0 ? ret+m : ret;
}
ll expo(ll a, ll b, ll m) {
if (!... |
/* -*-mode:c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include <iostream>
#include <vector>
#include <chrono>
#include <thread>
#include <tuple>
#include <cstdlib>
#include <getopt.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "execution/reductor.hh"
#include "net/s3.hh"
#include... |
/*************************************************************************
> File Name: stonewt.h
> Author: JY.ZH
> Mail: xw2016@mail.ustc.edu.cn
> Created Time: 2018年07月20日 星期五 12时10分26秒
************************************************************************/
#ifndef STONEWT_H_
#define STONEWT_H_
... |
//######################################## Friends Pairing Problems #####################################
// Given N,friends who want to go to a party on bikes. Each guy can go as single ,or as a couple.
// Find the Number of ways in which N friend cna go to the party.
// N=3,Ways=4;
#include<iostream>
using name... |
#include <iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int input;
cin >> input;
int ret[input];
for(int i = 0; i < input; i++){
int a, b;
cin >> a >> b;
ret[i] = a+b;
}
for(int i = 0; i < input; i++){
cout <... |
#pragma once
#include "TemperatureSensor.h"
#include "Stub.h"
#include "DS18B20.h"
#include "DS18B20Bus.h"
namespace Codingfield {
namespace Brew {
namespace Sensors {
namespace Temperature {
class Factory {
public:
enum class Types {Stub, DS18B20};
static TemperatureS... |
/*
TouchKeys: multi-touch musical keyboard control software
Copyright (c) 2013 Andrew McPherson
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, either version 3 of the License, or
(at you... |
/*
MATH578a Spring 2016 HW2 - Liana Engie
This program finds the banded alignment of pairs of sequences from a file with several input sequences
Input:
File with FASTA sequences,
w(match),
w(mismatch),
w(indel)
Output:
d, distance between sequences
T, optimal alignment in a .tex file
*/
#include... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// Author: Tatparya Shankar
int crypt( int character, int key )
{
int ciphered;
// Cipher character
if( character < 91 )
{
// Capital chars
if( character + key > 90 )
... |
#include <glfwpp/glfwpp.h> |
#pragma once
#include "object\GameObject.h"
#include "eItemType.h"
class Item : public GameObject {
double angle;
double speed;
bool isIndraw;
eItemType type;
public:
Item();
Item(Vector2 pos);
~Item() = default;
void Init();
void Fin();
void Update();
void Draw() const;
void OnCollide(GameObject* obj);
}... |
#include "router_hal.h"
#include "router_hal_common.h"
#include <stdio.h>
#include <ifaddrs.h>
#include <linux/if_packet.h>
#include <map>
#include <net/if.h>
#include <net/if_arp.h>
#include <pcap.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include... |
// Copyright Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
====================================================================... |
#include <stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int hitpat;
cout << "Enter a hitpattern number: ";
cin >> hitpat;
int nbits = floor(log2(hitpat)) + 1; //calc num of bits req for num
int lay_i = 0;
int nlaymiss = 0;
bool seq = 0;
for (int i=0; i<nbits; i++)... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#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>... |
#pragma once
#include <iostream>
#include <string>
using namespace std;
class Employee
{
private:
string firstname, lastname;
int employeeID;
public:
// Default Constructor
Employee() {
employeeID = 0;
firstname = " ";
lastname = " ";
}
// Constructor
Employee(int a, string b, string... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2003-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Morten Stenshorne
*/
#ifndef X11_UI... |
#ifndef TUTORIALENEMY_H
#define TUTORIALENEMY_H
#include "Enemy.h"
namespace gnGame {
// 1-3で登場する動かないチュートリアル用の敵
class TutorialEnemy : public Enemy{
public:
TutorialEnemy(const Vector2 _pos);
~TutorialEnemy() = default;
virtual void onStart() override;
virtual void onUpdate() override;
private:
AnimS... |
#ifndef COMMON_THREAD_THREAD_POOL_H_
#define COMMON_THREAD_THREAD_POOL_H_
#include <functional>
#include <vector>
#include "common/thread/lock.h"
#include "common/thread/thread.h"
#include "common/base/nocopy.h"
#include "common/thread/concurrent_queue.h"
#include "thirdparty/tbb/concurrent_queue.h"
namespace common ... |
#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; }
templa... |
//
// Created by manout on 18-3-26.
//
#include <vector>
#include <algorithm>
#include "common_use.h"
using std::sort;
using std::vector;
int TaxiTime(Point office, vector<Point>& taxis,int walktime, int taxitime)
{
auto cond = [&](Point& a, Point& b)
{
return a.sum() < b.sum();
};
so... |
#include <QtCore/QCoreApplication>
#include <QLibrary>
#include "crayfish_viewer.h"
#include "crayfish_e4q.h"
#include "crayfish_colormap.h"
#include "crayfish_dataset.h"
#if 0
void dumpL2P(double x, double y, const E4Qtmp& t)
{
double Px, Py;
E4Q_mapLogicalToPhysical(t, x, y, Px, Py);
qDebug("[%f,%f] -> [%f,%f... |
#ifndef __PORT_UTILS__
#define __PORT_UTILS__
/*
#ifndef IS_11
#define IS_11
#endif
*/
#ifdef IS_11
namespace std {
template<typename T, typename... Args>
unique_ptr<T> make_unique(Args&&... params) {
return unique_ptr<T>(new T(std::forward<Args>(params)...));
}
}
#endif
#endif
|
#include "GreeJniHelper.h"
#include <string.h>
#include <jni.h>
#include "CCDirector.h"
#include "cocoa/CCDictionary.h"
#include "jni/Java_org_cocos2dx_lib_Cocos2dxGreePlatform.h"
using namespace cocos2d;
using namespace cocos2d::gree_extension;
extern "C" {
bool launchJni(){
JniMethodInfo t;
bool ret;
if(JniH... |
/*====================================================================
Copyright(c) 2018 Adam Rankin
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 Software without restriction, including without limitati... |
#include "Robot.h"
const float whiteValue = 0.15;
const float blackValue = 0.08;
Robot::Robot():
RobotBase(),
ultraLeft(4, 5),
ultraRight(A0, 13),
ultraBack(12, 11),
lightLeft(A1),
lightRight(A2),
gyro(0x68),
ir(10, A4, A3, A5),
pixy(0x54),
//encoderA(11, 12),
//encoderB(A0, 13),
//encoderC(6, 7),
//enco... |
#include "fastIO.h"
FastIO::FastIO()
{
}
FastIO::~FastIO()
{
}
void FastIO::begin(uint8_t pin)
{
mask = digitalPinToBitMask(pin);
port = digitalPinToPort(pin);
outputReg = portOutputRegister(port);
inputReg = portInputRegister(port);
modeReg = portModeRegister(port);
}
void FastIO::pinMode(uint8... |
// demo.cpp : 定义控制台应用程序的入口点。
//
#include <stdio.h>
#include "iostream"
#include "fstream"
#include "vector"
#include "list"
using namespace std;
int NodeNum, LinkNum, CostNum, ServeCost;
//以二位数组形式存储地图,由于每条链路有两个值,
//所以最内层也是一个数组,第一个值为带宽,第二个为单位租用费
//若两个节点之间不相连,则值全为0,int默认值
vector<vector<vector<int>>> Net;
//将消费节点单独存放,内部数... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#ifndef EXECUTIVE_H
#define EXECUTIVE_H
#include "HashMap.h"
#include <fstream>
#include <iostream>
// #include "LinkedList.h"
class executive {
private:
public:
executive(std::string _filename);
~executive();
void ShowMeun();
HashMap MyHashMap;
//====================================
};
#endif |
#include <iostream>
#include <cstdlib>
#include <cmath>
#include "Coord.h"
#include "gnuplot_i.hpp"
using namespace std;
double tmp = 2;
double etot;
// Time step.
const double DT = 1e-3;
// Distance between two particles in the original configuration (measured in A).
double DENSITY_FACTOR; // = 1.077217345;//1.709975... |
#include <iberbar/RHI/Texture.h>
iberbar::RHI::ITexture::ITexture( void )
: IResource( UResourceType::Texture )
, m_Format( 0 )
, m_Size( 0, 0 )
{
} |
/* -*- 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.
*/
#include "core/pch.h"
#include "CertificateDetailsDialog.h"
#incl... |
#include <SFML/Graphics.hpp>
#include <cmath>
int oscillate(float frequency) {
const float pi = 3.14159;
const int windowWidth = 400;
const int windowHeight = 400;
float r = 10;
float x = windowWidth/2;
float y = windowHeight/2;
sf::RenderWindow window(sf::VideoMode(windowWidth, windowH... |
#include<iostream>
#include<string>
using namespace std;
string st;
int main()
{
while (getline(cin,st))
{while (st.find("you") != st.npos)
{int loc = st.find("you");
st.replace(loc,3,"we");
}
cout << st << endl;
}
return 0;
}
|
#include "mainwindow.h"
#include <QApplication>
#include <QMetaType>
#include "ballstate.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
qRegisterMetaType<BallState>("BallState");
MainWindow w;
w.show();
return a.exec();
}
|
#include "USBECM.hpp"
#include <cstdio>
USBECM::USBECM() {
if0 = {
DL_INTERFACE,
DT_INTERFACE,
0,
0,
1,
UC_COMM,
USB_CDC_SUBCLASS_ETHERNET,
0,
0,
};
if0.setupReceiver = this;
cdcheader = {
USB_CDC_LENGTH_HEADER,
DT_CDC_DESCRIPTOR,
USB_CDC_SUBTYPE_HEADER,
0x0110,
};
cdcunion = {
USB_C... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.UX.PropertyAccessor.h>
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno{namespace UX{stru... |
/**
Factorial of N = N * (N-1) * (N-2) ....... 3 * 2 * 1;
Factorial of N = N * Factorial of (N-1)
@author: Karthick
@github: Karthikn2098
*/
#include <bits/stdc++.h>
using namespace std;
/**
* @desc: recursive function to compute factorial of the Number.
* @param: integer N.
* @return: factoria... |
#pragma once
#include <opencv2/opencv.hpp>
/*Среднее значение уровня яркости для полутоновых байтовых изображений*/
#define MIDDLE_LEVEL 127
/*Максимальное значение уровня яркости для полутоновых байтовых изображений*/
#define MAX_LEVEL 255
/**Вывести на экран изображение типа CV_64FC1. Для отрисовки надо вызвать wai... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
//
//
// Copyright (C) 1995-2000 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 M2_SUPPORT
#include "smtpmodu... |
class Odometry{
private:
WbDeviceTag left_motor;
WbDeviceTag right_motor;
// position sensors
WbDeviceTag left_ps, right_ps;
double left_enc = 0;
double right_enc = 0;
struct Encoders
{
double left,right;
};
Position *pos = nullptr;
Position *wheel_po... |
#include<bits/stdc++.h>
using namespace std;
const int siz=20005;
const int INF=0x3f3f3f3f;
struct node{
int v,w;
};
vector<node> G[siz];
int d[siz],vis[siz];
void spfa(int s){
int i,u,v,w;
queue<int> qu;
memset(d,INF,sizeof(d));
memset(vis,0,sizeof(vis));
d[s]=0,vis[s]=1;
qu.push(s);
w... |
#include<stdio.h>
int main()
{
int a[100],i,j,k,t;
printf("ΕΕΠς΅ΔΈφΚύΣΠ£Ί");
scanf("%d",&k);
for(i=1;i<=k;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<=k-1;i++)
for(j=1;j<k-i;j++)
{
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]= t;
}
}
for(i=1;i<=k;i++)
{
printf("%d ",a[i]);
}
retu... |
#include "bartending_moveit_service.hpp"
#include <trajectory_msgs/JointTrajectory.h>
#include <trajectory_msgs/JointTrajectoryPoint.h>
#include <geometry_msgs/PoseStamped.h>
#include <moveit_msgs/AttachedCollisionObject.h>
#include <moveit_msgs/CollisionObject.h>
#include <moveit_msgs/OrientationConstraint.h>
#includ... |
#include <iostream>
#include "golf.h"
#include <cstring>
Golf::Golf()
{
strncpy(fullname,"no name", Len);
handicap = 0;
}
Golf::Golf(const char * name, int hc)
{
strncpy(fullname, name, Len);
handicap = hc;
}
void Golf::setgolf(const char * name, int hc)
{
strncpy(fullname, name, Len);
handicap = hc;
}
/*
int G... |
#include <iostream>
#include <vector>
using namespace std;
#define ARRMAX 100001
int cnt[ARRMAX][2] = {0};
int maxcnt[2] = {0};
int maxcntnum[2] = {0};
int max2ndcnt[2] = {0};
int max2ndcntnum[2] = {0};
vector<int> even,odd;
void lanking(){
for (int i = 0; i < ARRMAX; i++){
for(int j = 0; j < 2... |
// Programmable-Air
// Author: tinkrmind
// https://github.com/orgs/Programmable-Air
//
// Basic example of using Vent function of the Programmable-Air board.
// The neopixels show pressure. Cyan for low pressure and Purple for high pressure
// Brighter color means more extreme pressure. Bright cyan means lower press... |
#include <stdio.h>
#include <algorithm>
using namespace std;
int main() {
int x, y, w, h;
scanf("%d %d %d %d", &x, &y, &w, &h);
printf("%d", min(min(x, w - x), min(y, h -y)));
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2000-2007 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 CORE_BOO... |
#include "hhAnalysis/multilepton/interface/EvtHistManager_hh_2lss.h"
#include "tthAnalysis/HiggsToTauTau/interface/histogramAuxFunctions.h" // fillWithOverFlow(), fillWithOverFlow2d()
EvtHistManager_hh_2lss::EvtHistManager_hh_2lss(const edm::ParameterSet & cfg)
: HistManagerBase(cfg)
{
central_or_shiftOptions_["n... |
#include <iostream>
#include "search.h"
#include "dictionary.h"
#include "nth_root_finder.h"
int main() {
int list[] = {1,2,4,5,6,7,8,9};
int array_length = 8;
int number = 3;
std::string words[] = {"123","122222","1234","123","123"};
std::string words2[] = {"1233","1222","1234","13323","123"};
std::c... |
#include "Cards.h"
#include "Action.h"
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <random>
#include <chrono>
using namespace std;
Card::Card() {
good = nullptr;
action = nullptr;
}
Card::Card(const int myGood, const Action& myAction) {
good = new int(myGood);
ac... |
#include "parsedefaultfile.h"
#include <fstream>
#include <stdexcept>
#include <cstdlib>
#include <cstring>
using namespace DataLoader;
using namespace EAnalyzer;
using namespace std;
ParseDefaultFile::ParseDefaultFile()
{
}
void ParseDefaultFile::LoadFromFile(const std::string &filename)
{
ifstream file;
fi... |
#pragma once
#include <string>
#include <vector>
struct Compiler {
std::wstring platform;
std::wstring vsInstallDir;
std::wstring windowsSdkDir;
};
struct Settings {
std::wstring PATH;
std::wstring INCLUDE;
std::wstring LIB;
std::wstring SystemRoot;
};
struct VSObjectList {
std::wstring workingDir;
std::ws... |
#include <iostream>
using namespace std;
int x,y;
void intercambio(int &x,int &y)
{
int var=x;
x=y;
y=var;
}
int main()
{
cout<<"Ingrese dos numeros:"<<endl;
cin>>x>>y;
intercambio(x,y);
cout<<"El intercambio es:"<<x<<"-"<<y;
}
|
#include "WorkerClient.h"
vector<string> WorkerClient::Nume;
WorkerClient* WorkerClient::Instance;
WorkerClient::WorkerClient()
{
this->IncarcareNume();
}
WorkerClient::~WorkerClient()
{
//dtor
}
WorkerClient* WorkerClient::GetInstance()
{
if (!Instance)
{
Instance = new Worker... |
#ifndef BRANCHANDBOUND_H
#define BRANCHANDBOUND_H
#include <vector>
#include "simplex.h"
class BranchAndBound
{
public:
int rows;
int cols;
int Max ;
vector<float> SolInteger;
Simplex PL ;//= new Simplex();
vector <vector<float>> A;
vector <float> B;
vector <float> C;
vector <st... |
#include "../idlib/precompiled.h"
#pragma hdrstop
#include "Game_local.h"
/*
==============
idPlayer::HandleCheats
==============
*/
void idPlayer::HandleCheats() {
}
void idPlayer::ClearCheatState() {
}
|
#include "pch.h"
#include "framework.h"
#include "FastHtmlRichEditCtrl.h"
#define KEY_TAG_START '<'
#define KEY_TAG_END '>'
#define KEY_DBL_QUOTE '"'
#define COMMENT_START _T("<!--")
#define COMMENT_END _T("-->")
#define TIMER_BACKGROUNDCOLORING 100
/////////////////////////////////////////////////////... |
//------------------------------------------------------------------------------
/*
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... |
unsigned long chek;
boolean flag = true;
int legVuhodFirst = 11;
int legVuhodSecond = 11;
void setup() {
pinMode(7,OUTPUT);
pinMode(3,INPUT);
pinMode(4,INPUT);
pinMode(5,INPUT);
pinMode(legVuhodFirst,OUTPUT);
pinMode(legVuhodSecond,OUTPUT);
digitalWrite(6,LOW);
digitalWrite(legVuhodFirst , LOW);
digitalW... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.