text stringlengths 8 6.88M |
|---|
#ifndef MOON_H
#define MOON_H
#include <string>
#include <vector>
class Moon {
private:
std::vector<int> pos;
std::vector<int> initPos;
std::vector<int> vel;
public:
Moon(int x, int y, int z);
int GetEnergy();
bool AtStart();
bool AtStart(int dimension);
void Move();
void Move(int... |
#include <iostream>
#include <cassert>
using namespace std;
string urlify(char* s, const size_t size){
int count = 0;
for(int i=0; i<=size; i++){
if(s[i] == ' '){
count++;
}
}
size_t newStrIndex = size + count * 2;
size_t originStrIndex = size;
while(count > 0){
... |
#include <iostream>
using namespace std;
class TwoStack
{
public:
int n;
TwoStack(int size)
{
n = size;
}
int *arr = new int[n];
int top1=-1; //init
int top2=n; //init
int size1()
{
if (top1 >= 0)
{
return top1 + 1;
}
retu... |
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 GN... |
#pragma once
#include <maya/MPxCommand.h>
#include <maya/MDGModifier.h>
class MeltCmd : public MPxCommand
{
public:
virtual MStatus doIt(const MArgList&);
virtual MStatus redoIt();
virtual MStatus undoIt();
static void *creator() { return new MeltCmd; }
private:
MDGModifier dgMod;
};
|
#include <iostream>
using namespace std;
istream & readfile(istream &in)
{
in.clear();
string str;
while (in >> str, !in.eof()) {
if(in.bad())
{
;//throw runtime_error("test");
}
if(in.fail())
{
cerr << "Get input failed,try again!";
in.clear();
continue;
}
cout << str << endl;
}
cout ... |
#include <QMessageBox>
#include <QDateTime>
#include "windows.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
// this is for solving PSTR conversion problem in GetWindowText
#define UNICODE
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
QString display_num;
... |
#ifndef RESTREAMSDIALOG_H
#define RESTREAMSDIALOG_H
#include <iostream>
#include <QDialog>
#include <QMenu>
#include <QModelIndex>
#include <QMessageBox>
#include <QCloseEvent>
#include "vsmongo.h"
extern VSMongo* vsmongo;
extern bool cerrar;
extern std::string exec_id;
extern QString icons_folder;
struct Restream{... |
#include <vector>
#include <inttypes.h>
namespace TerrainGen {
extern std::vector<uint8_t> compress(
const std::vector<uint8_t>& input,
size_t inp_size,
size_t pixels_to_compress,
size_t out_size,
size_t patch_offset_x,
size_t patch_offset_y );
};
|
//
// Coins.h
// GLWF
//
// Created by Rodrigo Castro Ramos on 1/28/19.
// Copyright © 2019 Rodrigo Castro Ramos. All rights reserved.
//
#ifndef Coins_h
#define Coins_h
#include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>
// Other Libs
#include "SOIL2/SOIL2.h"
// GLM Mathematics
#include <glm/glm.hpp>
#includ... |
//Given a no check whether it can be represented as sum of 2020 and 2021
#include <iostream>
using namespace std;
bool sum(int n)
{
while(n>=2020)
{
if(n%2021==0)
n=0;
if(n%2020==0)
n=0;
else
{
if(n>=2021)
... |
//
// Clock.cpp
// Odin.MacOSX
//
// Created by Daniel on 04/06/15.
// Copyright (c) 2015 DG. All rights reserved.
//
#include "Clock.h"
#include <chrono>
#include <time.h>
namespace odin
{
namespace core
{
UI64 Clock::getCycles()
{
return static_cast<F64>(clock());
}
... |
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <bitset>
#include <queue>
#include <algorithm>
#include <functional>
using namespace std;
class GogoXBallsAndBinsEasy {
public:
int solve(vector <int> T)
{
vector<int> S(T);
sort(S.begin(), S.end(), greater<int>());
int ans = 0;... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#ifndef _SSL_VER_H_
#define _SSL_VER_H... |
#pragma once
#ifndef IOMANAGER_H
#define IOMANAGER_H
#include <vector>
#include <fstream>
class IOManager {
public:
static bool realFileToBuffer(std::string filePath, std::vector<unsigned char>& buffer);
};
#endif |
// Created on: 2014-11-13
// Created by: Maxim YAKUNIN
// Copyright (c) 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 Lesser General Public License version 2.1 as publ... |
#ifndef PORT_NEURON_H
#define PORT_NEURON_H
#include "synfire_constants.h"
#ifdef __GPU_BUILD__
#include "cuda_utils.h"
#include <cuda_runtime.h>
#define CUDA_CALLABLE __host__ __device__
#define INLINE
#else
#define CUDA_CALLABLE
#define INLINE inline
#endif
class Neuron {
public:
#ifdef __GPU_BUILD__
fri... |
#include "streamencoder.h"
#include "profiler.h"
#include "xor.h"
#include <memory>
#include <iostream>
#include <random>
#include <set>
#include <chrono>
#include <iomanip>
#include <cstring>
#include <omp.h>
using namespace std;
trevi::StreamEncoder::StreamEncoder(int encodingWindowSize, int numSourceBlockPerCo... |
#ifndef TEXT_H
#define TEXT_H
class Text{
public:
void split(std::string s, std::string delimiter, std::string filename);
bool checkSame(std::vector<std::string> list, std::string str);
};
#endif |
/*****************************************************************************************************************
* File Name : quantityConversions.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\fun\maths\school\class05\quantityConversions.h
* Created on : Dec 26, 2013 :: 11:39:16 PM
... |
// Lesson 1:
//#include <iostream>
// int main()
// {
// std::cout << "Hello World!" << std::endl;
// return 0;
// }
//#include <iostream>
// int main()
// {
// int x=8;
// int y=6;
// std::cout << std::endl;
// std::cout << x - y << " " << x * y << " " << x + y;
// std::cout << std::endl;
// ... |
#include <algorithm>
#include <cctype>
#include <cerrno>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "profile_run.h"
#include "profile_timer.h"
namespace
{
void dup_fd(int from, int to)
{
... |
#include "dpdk_metric_interface.h"
DPDKMetricInterface::DPDKMetricInterface(){
}
DPDKMetricInterface::~DPDKMetricInterface(){
rte_metrics_deinit();
printf("Metric Interface is destroyed\n");
}
bool DPDKMetricInterface::initialize_metrics(void *data){
socket_id = *((int *)data);
rte_metrics_init(... |
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "BatteryCollector.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, BatteryCollector, "BatteryCollector" );
|
#ifndef BDD_NODE_H
#define BDD_NODE_H
/*
* File bdd_node.h
*
* Created 5/2003 by Karl Rosaen
*
* Modified 9/22/2004 by Karl Rosaen
* - added use of smart pointers
*
* Contains definition of class Bdd_node and prototypes for
* helper functions
*/
#include <iostream>
#include <set>
#include "smart_pointer.h"... |
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved
#ifndef MQ_HPP_
#define MQ_HPP_
#ifndef __link
#include <iface/link.h>
#include <mqueue.h>
#include <fcntl.h>
#include <cstring>
namespace sys {
class Mq;
/*! \brief Message Queue Attribute Class */
class MqAttr {
friend class Mq;
public:
MqA... |
// Header:
// RsaToolbox
#include "About.h"
using namespace RsaToolbox;
bool isAboutMenu(int argc, char *argv[]);
// main:
if (isAboutMenu(argc, argv))
return 0;
// Defined:
bool isAboutMenu(int argc, char *argv[]) {
if (argc != 2)
return false;
QString arg(argv[1]);
arg = arg.trimmed... |
// Aluno Rodrigo Yuji
#include <iostream>
#include <omp.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
int nthreads, i, tid;
float total;
#pragma omp parallel shared(nthreads) private(i,tid,total)
{
tid = omp_get_thread_num();
if (tid == 0) {
nthreads = omp_get_... |
#include "mnist.h"
#include <fstream>
#include <opencv2/opencv.hpp>
namespace mnist
{
inline int reverseInt(int i)
{
unsigned char ch1, ch2, ch3, ch4;
ch1 = i & 255;
ch2 = (i >> 8) & 255;
ch3 = (i >> 16) & 255;
ch4 = (i >> 24) & 255;
return ((int)ch1 << 24) + ((in... |
#ifndef _MY_DHCP_H_
#define _MY_DHCP_H_
#pragma once
#include "common.h"
typedef struct IpAndMac{
ip_addr ip;
UINT8 macAddr[6];
struct IpAndMac *pNext;
};
typedef struct IpAndMacHead{
UINT16 len;
struct IpAndMac *pHead;
};
class mydhcp{
private:
IpAndMacHead queueHead;
static mydhcp... |
#ifndef MYCANVAS_H
#define MYCANVAS_H
#include <QWidget>
#include <QColor>
#include <QPainter>
#include <vector>
#include <math.h>
#include <stack>
using namespace std;
enum ModeAdd
{
SIMPLY,
HORIZONTAL,
};
struct RectangleCutter
{
QPoint min_point = {-1, -1};
QPoint max_point = {-1, -1};
};
struct... |
#ifndef __MISC_HH_
#define __MISC_HH_
#include <string>
#include <llvm/IR/Type.h>
#include <llvm/IR/Value.h>
#include <llvm/IR/Module.h>
#define UNITS_UNIT(s) \
(s) < 2048 ? "B" : \
(s) / 1024 < 1024 ? "K" : \
(s) / (1024 * 1024) < 1024 ? "M" : "G"
#define UNITS_SIZE(s) \
(s) < 204... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef OP_PROGRESS_H
#define OP_PROGRESS_H
#include "modules/wi... |
#include "pitch.h"
#include <string.h> // for memcpy
#include <assert.h>
Pitch::Pitch(int window_size, int sample_rate) :
window_size_(window_size),
sample_rate_(sample_rate)
{
//ctor
init();
}
Pitch::~Pitch()
{
//dtor
del_fvec(yin_in);
del_fvec(yin_out);
del_aubio_pitch(o);
aubio_cleanup();
}
int ... |
#include "Water.h"
void Water::Draw(aie::Renderer2D* r) {
r->drawBox(position.x, position.y, 200, 200); // Draw
} |
#pragma once
#include <iosfwd>
#include <cmath>
#include <utility>
#include "vector.h"
#include "type_traits.h"
namespace sbg {
template<typename T>
struct Vector<2, T> {
static_assert(std::is_arithmetic<T>::value, "Vector must be aritmetic");
using MathType = typename std::conditional<std::is_floating_point<T>:... |
/*
* economy.cc
*
* Created on: May 28, 2015
* Author: arun
*/
#include "economy.hpp"
//static int randSeed = 1;
Economy::Economy(int numHouseholds, int seed):myHHs(),econSize(numHouseholds){
myHHs=new Household*[numHouseholds];
distr = uniform_real_distribution<double>(0.0, 1.0);
gener = mt19937(seed);... |
#include "AudioDevice.h"
#include "AudioProcessingUnit.h"
#include "CartridgeReader.h"
#include "CentralProcessingUnit.h"
#include "GameController.h"
#include "MemoryBus.h"
#include "MemoryMapper.h"
#include "PictureProcessingUnit.h"
#include "RenderingWindow.h"
#include <iostream>
#define CLOCK_DIVIDER_CPU_NTSC (12u... |
//---------------------------------------------------------
//
// Project: dada
// Module: gl
// File: GL.h
// Author: Viacheslav Pryshchepa
//
// Description:
//
//---------------------------------------------------------
#ifndef DADA_GL_GL_H
#define DADA_GL_GL_H
#ifdef DADA_WITH_GLEW
... |
void recieveUSB() //USB data receive event function
{
/*
* This function:
* 1. Reads data from USB in correct format
*/
char readChar;
String numberStr = "";
int i = 0;
while (i < RX_SIZE) //waits to end of message or end of space
{
readChar = ' ';
if (SerialUSB.available())
{
re... |
#include "stdafx.h"
#include "ConvolutionalLayer.h"
ConvolutionalLayer::~ConvolutionalLayer()
{
}
/*
void ConvolutionalLayer::startTrainingOnButch()
{
}
*/
void ConvolutionalLayer::applyWeighChanges()
{
std::vector<std::pair<double, int>> changes;
changes.resize(numInOne);
for (int i = 0; i < links.size(); i++)
... |
// Created on: 1997-12-01
// Created by: Jean-Louis Frenkel
// 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... |
/****************************************************************************
* AAMLibrary
* http://code.google.com/p/aam-library
* Copyright (c) 2008-2009 by GreatYao, all rights reserved.
****************************************************************************/
#include <iostream>
#include "AAM_Mov... |
#include "ExerciseEquipment.h"
#include "textdisp.h"
CExerciseEquipment::CExerciseEquipment(int historyLength) : m_historyLength(historyLength), m_totalTickCount(0)
{
//Preallocate for historyLength
while(m_tickHistoryList.GetListSize() < m_historyLength)
{
m_tickHistoryList.PushBack(0);
}
m_listCu... |
#include "Constant.h"
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
// Depending on your servo make, the pulse width min and max may vary, you
// want these to be as small/large as possible without hitting the hard stop
// for max range. You'll have to tweak them as necessary to match the servos you
// have... |
#include "GameLayer.h"
GameLayer::GameLayer(WindowRef window) {
setWindow(window);
}
GameLayer::GameLayer(sf::Vector2<float> translation) {
this->translation = translation;
}
void GameLayer::drawLayer() {
for (GameObject* i : objects) {
i->update();
}
}
void GameLayer::add(GameObject& item) {
//std::cout << "... |
#pragma once
#include "ICommand.h"
#include <iostream>
#include <fstream>
class Sort : public ICommand {
private:
std::string word;
public:
Sort() {}
Sort(std::string args) {}
std::string execute(std::string & text) override;
}; |
//By SCJ
//#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
string s;
bool fg=0;
while(getline(cin,s))
{
for(int i=0;i<s.size();++i)
{
if(s[i]=='"')
{
if(fg==0) cout<<"``";
else cout<<"''";
fg^=1;
}
else ... |
/*
* Copyright 2019 LogMeIn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in w... |
#include "ShoeMessageWifiPosition.hpp"
#include <QDateTime>
#include <QDebug>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
void ShoeMessageWifiPosition::parseData(QByteArray data)
{
/*
wifi/lbs
eg. 7878 03 69 160413031849 1475905BD30E25 001E10BBF7635D 14759006E62656 05 ... |
#ifndef BSTREE_HPP
#define BSTREE_HPP 1
#include "BinaryTree.hpp"
namespace cs202 {
template <class Key, class Value>
class BSTree : public BinaryTree<Key, Value> {
/* Inherit as many functions as possible from BinaryTree.
* Only override those where you can decrease the time complexity and where you abso... |
/**********************************************************************
* Polly Scop Profiler Runtime
* Copyright (C) 2018 Dominik Adamski
*
* 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... |
#include "CookieJar.h"
#include <QDebug>
#include <QNetworkCookie>
#include <QElapsedTimer>
namespace wpp
{
namespace qt
{
CookieJar::CookieJar(LocalStorage &localStorage)
: localStorage(localStorage)
{
}
QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const
{
//return cookies for attaching to t... |
#include <bits/stdc++.h>
using namespace std ;
const int N = (int)2e6 + 5 ;
int L[N] ;
int R[N] ;
int T[N] ;
int version ;
int root[N] ;
int src[N] ;
int pos[N] ;
void build(int i, int b, int e) {
if (b == e) {
T[i] = 0 ;
return ;
}
L[i] = ++version ;
R[i] = ++version ;
int mid = ... |
#include "Scheme_values/Atom.hpp"
#include "Environment.hpp"
#include "Scheme_values/Scheme_value.hpp"
#include "fmt/format.h"
Symbol::Symbol(const std::string& atom) : name(atom)
{
}
std::string Symbol::as_string() const
{
return name;
}
|
#ifndef ZOMBIE3_H
#define ZOMBIE3_H
#include <QImage>
#include <QRect>
#include "zombie.h"
class Zombie3:public Zombie
{
public:
Zombie3();
~Zombie3();
public:
void resetState();//spawn location
void autoMove(); //handles automatic movement
};
#endif
|
#include<bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=1;i<=n;i++)
#define py printf("YES\n")
#define pn printf("NO\n")
#define pb push_back
#define ll long long
#define speed ios_base::sync_with_stdio(false); cin.tie(NUll);cout.tie(NUll);
#define D(x) cout << #x " = " << (x) << endl
#def... |
// stdafx.cpp : 只包括标准包含文件的源文件
// Week1-ex-1.pch 将作为预编译头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"
|
// Copyright 2012 Yandex
#ifndef LTR_LEARNERS_DECISION_TREE_UTILITY_UTILITY_H_
#define LTR_LEARNERS_DECISION_TREE_UTILITY_UTILITY_H_
#include <vector>
#include <string>
#include "ltr/data/data_set.h"
#include "ltr/learners/decision_tree/condition.h"
using std::string;
namespace ltr {
namespace decision_tree {
voi... |
#include "StdAfx.h"
#include "GcPropertyGridFloatSpinProperty.h"
#include "GcFloatSpinButtonCtrl.h"
#define AFX_PROP_HAS_LIST 0x0001
#define AFX_PROP_HAS_BUTTON 0x0002
#define AFX_PROP_HAS_SPIN 0x0004
GcPropertyGridFloatSpinProperty::GcPropertyGridFloatSpinProperty(const CString& strGroupName, DWORD_PTR dwData,
BOOL... |
#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... |
// Functions.hpp
// MakeVector
// Created by Quincy Copeland on 9/10/18.
// Copyright © 2018 Quincy Copeland. All rights reserved.
#ifndef Functions_hpp
#define Functions_hpp
#include <stdio.h>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
template <typename T>
class myVector {... |
//
// Created on 21/01/19.
//
#pragma once
#include <armadillo>
namespace Algorithms
{
class IterativeSVD
{
public:
static void recoveryIterativeSVD(arma::mat &X, uint64_t rank);
};
} // namespace Algorithms
|
#pragma once
#include <SFML/Graphics.hpp>
class VolumeBar
{
private:
public:
}; |
#ifndef __TABLETOOLBAR_H
#define __TABLETOOLBAR_H
#include "BaseTable.h"
#include "MTable.h"
namespace wh{
//-----------------------------------------------------------------------------
class VTableToolBar:
public wxAuiToolBar
,public ctrlWithResMgr
{
public:
VTableToolBar(wxWindow* parent,
wxWindowID id = wx... |
#include <cstdio>
#define MAX_SIZE 10000
using namespace std;
int main() {
int n, input;
int count[MAX_SIZE + 1] = {};
scanf("%d", &n);
for(int i=0; i<n; i++) {
scanf("%d", &input);
count[input]++;
}
for(int i=0; i<=MAX_SIZE; i++) {
for(int j=0; count[i] > 0 && j<count[i]; j++) {
prin... |
= まえがき
あなたは、技術同人誌は好きですか?
「We Love 技術同人誌 -技術書界隈を盛り上げる本-」を手に取っていただきありがとうございます。
この本を手に取っていただいたということは、あなたも技術同人誌に関わっているうちの一人です。
この本は、技術同人誌に関わる人による、技術同人誌に関わる人のための、技術同人誌への「愛」を詰め込んだ本です。
この本には、多数の著者が技術同人誌への関わり方や想いを語っています。
あなたがこの本を読めば、今よりもっと技術同人誌が好きになれること間違いありません。
そして、この本を読み終わったら、SNSなどでこの本の感想や、心が動かされたことについて伝えてみま... |
// Created on: 1995-01-27
// Created by: Marie Jose MARTZ
// 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... |
#include <windows.h>
#include <stdio.h>
#include <time.h>
int main()
{
char buffer[]="Write this text to file";
DWORD dwWritten; // number of bytes written to file
HANDLE hFile;
hFile=CreateFile(TEXT("C:\\test.txt"),GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
if(hFile==IN... |
#pragma once
#ifndef Room_h
#define Room_h
#include "PuzzleArea.h"
#include <list>
class Room {
struct Wall {
char direction;
Wall* next;
Wall* previous;
std::list<PuzzleArea*>puzzles;
};
public:
Wall* walls;
void WeNeedToBuildAWall();//Tworzenie listy scian
void AddNewPuzzle(char,int , int , int , int... |
#pragma once
bool is_zero(float f, float tolerance = 0.0001f)
{
return (f >= -tolerance) && (f <= tolerance);
}
bool is_between(float f, float min, float max, float tolerance = 0.0001f)
{
return (f >= min - tolerance) && (f <= max + tolerance);
}
template <typename T>
struct vec3
{
using type = T;
us... |
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode *head = NULL;
int carry = 0;
ListNode *prev =... |
#include<bits/stdc++.h>
using namespace std;
char str[505];
int C;
int w[55];
int n;
void getc(){
n=0;
int len=strlen(str);
for(int i=0;i<len;i++){
if(str[i]==' '){
n++;
}
else{
w[n]=w[n]*32+(str[i]-'a'+1);
}
}
}
int judge(){
... |
#include "GnMainPCH.h"
#include "GnTransform.h" |
#include "checkerHeader.h"
#include "menuHeader.h"
#include "utilityHeader.h"
void verify(int& option, int number, int startRow, string askInput) {
while (option < 1 || option > number) {
goToXY(0, number + startRow);
for (int i = 0; i <= number + startRow + 1; i++) {
cout << " ... |
#include <iostream>
#include <vector>
using namespace std;
template <typename T>
class MultiStack {
private:
struct StackData {
int stack_num;
T data;
bool safe_to_delete = false;
};
int num_of_stacks;
vector<StackData> data {};
vector<... |
/* -*- Mode: c++; tab-width: 4; 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.
*
* Espen Sand
*/
#ifndef __UNIXUTILS_H__
#define __UNIXUTILS_H__
class OpFile;
class D... |
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
int sensorVal=0;
int mg=0;
const int buttonPin=2;
int buttonState=0;
SoftwareSerial MyBlue(0, 1 ); // RX | TX
LiquidCrystal_I2C lcd(0x3F,16,2);
int cal;
void setup() {
lcd.init();
lcd.backlight();
MyBlue.begin(9600);
Seri... |
#include "flashdialog.h"
#include <QAxWidget>
#include <QLayout>
FlashDialog::FlashDialog(QWidget *parent /* = 0 */)
{
flashwidget = new QAxWidget;
flashwidget->setControl(QString::fromUtf8("{d27cdb6e-ae6d-11cf-96b8-444553540000}"));
QVBoxLayout *mainlayout = new QVBoxLayout;
mainlayout->addWidget( flashwidget);... |
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
const int maxN = 100000 + 100, maxM = 100000 + 100;
bool deleted[maxN];
int loc[maxN], sum[maxN], n, k, m;
int main() {
#ifndef ONLINE_JUDGE
freopen("in", "r", stdin);
#endif
... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t, num, tot=0;
scanf("%d", &t);
while(scanf("%d", &num)!=EOF)
if(num==t)
tot++;
printf("%d\n", tot);
return 0;
}
|
#include "EntityCache.h"
void CEntityCache::Fill()
{
if (m_pLocal = GET_ENT_I(LOCAL_IDX)->As<CTFPlayer>())
{
int nLocalTeam = m_pLocal->m_iTeamNum();
if (nLocalTeam != TEAM_RED && nLocalTeam != TEAM_BLU) {
m_pLocal = nullptr;
return;
}
m_pWeapon = GET_ENT_H(m_pLocal->m_hActiveWeapon())->As<CTFWeaponB... |
// MIT License
// Copyright (c) 2020 Marnix van den Berg <m.a.vdberg88@gmail.com>
// 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 limitation the ri... |
#pragma once
#include "Keng/GraphicsCommon/FwdDecl.h"
#include "Keng/GraphicsCommon/SwapChainParameters.h"
namespace keng::graphics
{
class WindowRenderTargetParameters
{
public:
SwapChainParameters swapChain;
};
} |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) Opera Software ASA 2006-2012
*
* Web server implementation -- overall server logic
*/
#include "core/pch.h"
#ifdef WEBSERVER_SUPPORT
#include "modules/webserver/webserver_filename.h"
#include "modules/formats/uri_escape.... |
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(){
// seed
srand(time(NULL)); // 이게 선언된 다음 부터는 time(NULL) 안에 들어있는 seed 값에 따라서 난수가 발생한다.
for(int i=1; i<=10; i++){
printf("%d\n", rand()%10);
}
}
|
#pragma once
#include "game.h"
#define HEIGHT 6
#define WIDTH 7
#define LENGTH 4
class ConnectXGame : public Game
{
public:
ConnectXGame(void);
~ConnectXGame(void);
void initialize(void);
};
|
// Created on: 1993-10-29
// Created by: Christophe MARION
// 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 ... |
#ifndef SRC_SAMPLER_H
#define SRC_SAMPLER_H
#include <algorithm>
#include <cstdlib>
#include <numeric>
#include <random>
#include <utility>
#include <vector>
#include "src/util.h"
class BaseSampler {
public:
BaseSampler(
std::vector<std::pair<size_t, double> >& data_weights
);
virtual ~BaseSam... |
#include "stdafx.h"
#include "CheckDxccCountry.h"
#include "DxccCountryManager.h"
#include "DxccCountry.h"
#include "StringUtils.h"
bool CheckDxccCountry(string arg, DxccCountryManager* dxccCountryManager)
{
string key;
string callsign;
string errorMsg;
bool status = StringUtils::GetKeyValuePair(arg, key, callsi... |
#include "SDL2.hpp"
#include<string.h>
#include<iostream>
#pragma once
class Scene {
public:
Scene(std::string name);
std::string getName(void);
virtual void events(const float &delta, const Dimension<int> &screen, const SDL_Event& evnt) = 0;
virtual void update(const float &delta, const Dimension<in... |
/*
Copyright 2021 University of Manchester
Licensed under the Apache License, Version 2.0(the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http: // www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, s... |
//$$---- Thread CPP ----
//---------------------------------------------------------------------------
#include <vcl.h>
#include <math.h>
#include <algorith.h>
#include <stdio.h>
#pragma hdrstop
#include "RecordThrd.h"
#include "PredStart.h"
#include "BuildProtocol.h"
#include "CalcParams.h"
#include "... |
#include "junction_maneuvering/junction_maneuvering_ros.h"
JunctionManeuveringROS::JunctionManeuveringROS(ros::NodeHandle& nh): nh_(nh), junction_maneuvering_server_(nh,"/junction_maneuvering_server",
boost::bind(&JunctionManeuveringROS::junctionManeuveringExecute, this, _1),false), monitored_heading_(0), monitored_... |
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct Point {
int x;
int y;
Point() : x(0), y(0) {}
Point(int a, int b) : x(a), y(b) {}
};
Point reff(0, 1);
bool cmp(Point a, Point b){
return atan2(a.y - reff.y, a.x - reff.x)... |
#include"random.h"
using namespace std;
namespace shady_engine
{
random::random()
{
mRandEngine.seed(chrono::steady_clock::now().time_since_epoch().count());
}
random::~random()
{
}
void random::update()
{
mRandEngine.seed(chrono::steady_clock::now().time_since_epoch().count());
}
float rand... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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.
*
* George Refseth, rfz@opera.com
*/
#ifndef OPERA7IMPORTER_H
... |
#include <bits/stdc++.h>
using namespace std;
struct tNode{
int data;
tNode *left;
tNode *right;
tNode(int x):data(x),left(NULL),right(NULL){}
};
class Solution{
public:
//递归转换
tNode* convert_bst_to_dll(tNode *root){
root = sub_convert(root);
while(root->left){
roo... |
#ifndef _POINTBASE_H_
#define _POINTBASE_H_ 1
class PointBase {
public:
// GETTERS / SETTERS
double getX();
void setX( double x );
double getY();
void setY( double y );
double getZ();
void setZ( double z );
double getW();
double* asVector();
protected:
// MEMBER VARIABLES
double x,y,z,w;
};
#endif
|
#include "utils.hpp"
#include "poetry_pool_ptts.hpp"
namespace nora {
namespace config {
poetry_pool_ptts& poetry_pool_ptts_instance() {
static poetry_pool_ptts inst;
return inst;
}
void poetry_pool_ptts_set_funcs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.