text stringlengths 8 6.88M |
|---|
#include "stdio.h"
#include "conio.h"
void main(){
clrscr();
int c=49;
for(int i=0; i<2; i++){
for(int j=0; j<3; j++){
printf("%c\t",c);
c++;
}
printf("\n");
}
getch();
} |
/*
* Copyright (c) 2016-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_SWAP_RANGES_H_
#define CPPSORT_DETAIL_SWAP_RANGES_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <cstddef>
#include <iterato... |
#include "accel.h"
SimpleAccelSensor::SimpleAccelSensor() {
}
void SimpleAccelSensor::initialize() {
sensor.initialize();
}
void SimpleAccelSensor::get_accel_gyro(Vector *accel, Vector *gyro) {
int16_t ax, ay ,az;
int16_t gx, gy, gz;
sensor.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
accel->x = (double)ax;
... |
#include "testlib.h"
using namespace std;
int main(int argc, char *argv[]) {
registerGen(argc, argv, 1);
int n=rnd.next(1,100);
println(n);
for(int i=1;i<=n;i++){
cout<<rnd.next(1,10)<<" ";
}
cout<<endl;
}
|
/*
输入:
4
20 35 23 40
输出:
2
输入第二行是4个题目对应的rating值,每场考试要求三道题的rating满足a<=b<=c,b-a<=10,c-b<=10,目的是最少添加多少道题能让已有的题目全部应用到考试里。
*/
#include <bitset>
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
using namespace std;
int main()
{
int n;
vector<int> data;
data.reserve(100010);
int tmp;
... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout... |
#ifndef __MP4FILE_H__
#define __MP4FILE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#ifdef __cplusplus
}
#endif
#include "common.h"
////////////////////////////////////////////////////////////////////////////////
class CMp4file
{
public:
CMp4file(const... |
#ifndef CONFD_H
#define CONFD_H
#include <eeprom_cli.h>
/*
#define KEY_SAVED_FLAF_ADDR (KEY_ADDR + KEY_SIZE)
#define KEY_SAVED_FLAG_VAL 0xAA
#define FIRST_RUN_ADDR (KEY_SAVED_FLAF_ADDR + 1)
#define FIRST_RUN_VAL 0xBB
*/
#define START_ADDRESS 0x0000
#define SENSOR_ADDR_START (START_ADDRESS + 10)
#define SENSOR_AMOUNT ... |
/*
Copyright (c) 2016, Los Alamos National Security, LLC
All rights reserved.
Copyright 2016. Los Alamos National Security, LLC. This software was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the ... |
#pragma once
#include "Observer.h"
#include "Observable.h"
#include <string>
// PhaseObserver is a concrete Observer that will observe be updated when game changes
class PhaseObserver : public Observer
{
private:
// we need the game as a subject so when it notifies the PhaseObserver of a change
// the phase obse... |
#include "Semaphore.h"
#include <assert.h>
#define INCREMENT_AMOUT 1
#ifdef _MSC_VER
#include <Windows.h>
#endif // _MSC_VER
#ifndef NULL
#define NULL 0
#endif // !NULL
#ifndef LONG_MAX
#define LONG_MAX 2147483647l /* maxinum (signed) ling value*/
#endif // !LONG_MAX
struct Semaphore::SemaphoreInternal
{
voi... |
#include<bits/stdc++.h>
#define maxn 3000010
using namespace std;
using ll=long long;
int phi[maxn];
void getphi() {
phi[1]=1;
for(int i=2; i<maxn; i++)
phi[i]=i;
for(int i=2; i<maxn; i++)
if(i==phi[i])
for(int j=i; j<maxn; j+=i)
phi[j]=phi[j]/i*(i-1);... |
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <functional>
#include "Batcher.h"
#include "Params.h"
#include "PickingManager.h"
#include "TextBox.h"
class GlCanvas;
class Gl... |
/**
* @file UserWidget.h
* @brief 用于定义UserWidget类的头文件
*/
#ifndef USERWIDGET_H
#define USERWIDGET_H
#include <qwidget.h>
#include <OgreCamera.h>
#include <OgreFrameListener.h>
#include <OgreRenderWindow.h>
#include <OgreSceneManager.h>
#include <OgreRoot.h>
#include "State.h"
class MainWindow;
class QTextEdi... |
/*
* Time.cpp
*
* Created on: 07-Apr-2015
* Author: kishor
*/
#include "Time.h"
#include <iostream>
Time::Time() {
m_hour = 0;
m_minutes = 0;
}
Time::Time(const int hour, const int minutes=0)
{
m_hour = hour;
m_minutes = minutes;
}
void Time::addHour(const int hour) {
m_hour += hour;
}
void Time::a... |
// Sharna Hossain
// CSC111
// percentages.cpp
#include <iostream>
using namespace std;
void get_percent(int num, double percent)
{
double res = num * percent;
int percentage = percent * 100;
cout << percentage << " percent of " << num << " is " << res << endl;
}
int main()
{
int num1, num2, num3;
... |
#pragma once
class Station;
class Location;
class QsoItem;
class QsoTokenType;
class QsoError;
class QsoInfo;
class AllLocations;
class Contest;
class DxccCountryManager;
enum HamBand { eUnknownBand=-100, eAnyBand=-10,
e160m=0, e80m=1, e40m=2, e20m=3, e15m=4, e10m=5, e6m=6, e2m=7, e440=8, eHamBand... |
#include <cassert>
namespace techniques {
template<bool>
struct CompileTimeChecker {
CompileTimeChecker(...);
};
template<>
struct CompileTimeChecker<false> {};
#define STATIC_CHECK_1(expr, msg)\
{\
class ERROR_##msg {};\
(void)sizeof(CompileTimeChecker<(expr) != 0>((ERROR_##msg{})));\
}
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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
**
*/
#include "core/pch.h"
#include "modules/... |
// Copyright 2015 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sharer_sender.h"
#include "base/logger.h"
#include "base/ptr_utils.h"
#include "sender/video_sender.h"
#include <string>
namespace sharer {
Sha... |
#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;
int a[600][600];
i... |
#include "stdafx.h"
#include "boneSphere.h"
boneSphere::boneSphere()
{
}
boneSphere::boneSphere(bone* b)
{
originBone = b;
}
boneSphere::boneSphere(boneSphere *b)
{
*this = *b;
}
boneSphere::~boneSphere()
{
}
|
// --- This file is distributed under the MIT Open Source License, as detailed
// by the file "LICENSE.TXT" in the root of this repository ---
#ifndef HURCHALLA_UTIL_EXTENSIBLE_MAKE_SIGNED_H_INCLUDED
#define HURCHALLA_UTIL_EXTENSIBLE_MAKE_SIGNED_H_INCLUDED
#include "hurchalla/util/compiler_macros.h"
#include <type_t... |
#ifndef KWIK_LEXER_H
#define KWIK_LEXER_H
#include <string>
#include <memory>
#include "utf8cpp/utf8.h"
#include "parser.h"
#include "token.h"
#include "io.h"
namespace kwik {
class Lexer {
public:
Lexer(ParseState& s);
Token get_token();
private:
SourceRef getref(size_t line, s... |
// Created on: 1996-01-29
// Created by: Jean Yves LEBEY
// 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 "ReiaEngine/Scene.h"
#include "ReiaEngine/UI.h"
class MainScene : public Scene
{
public:
MainScene() {
points.Anchor = TOP_LEFT;
points.Position.X = 10;
points.Position.Y = 10;
Renderer.AddObject(&points);
}
private:
Text points;
};
|
// BEGIN CUT HERE
// PROBLEM STATEMENT
// A non-negative integer n is said to be a sum of two
// perfect powers if there exist two non-negative integers a
// and b such that am + bk = n for some positive integers m
// and k, both greater than 1. Given two non-negative
// integers lowerBound and upperBound, return t... |
#include "Battipaglia.h"
#include "MyBattipagliaProjectile.h"
#include "GameFramework/ProjectileMovementComponent.h"
AMyBattipagliaProjectile::AMyBattipagliaProjectile(const class FObjectInitializer& PCIP)
:
Super(PCIP),
acceleration(100.0f),
velocity(0.0f)
{
PrimaryActorTick.bCanEverTick = true;
}
void AMyBatt... |
/*
题目描述
请实现一个函数,用来判断一颗二叉树是不是对称的。注意,如果一个二叉树同此二叉树的镜像是同样的,定义其为对称的。
思路:左子树的左孩子和右子树的右孩子相等,左子树的右孩子和右子树的左孩子相等,符合这两个条件就是对称
*/
#include<iostream>
using namespace std;
#include<vector>
#include<map>
#include<algorithm>
#include<deque>
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode... |
// Copyright (c) 2020 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 Foundation, with special ... |
#ifndef LEARNING_CADDON
#define LEARNING_CADDON
#include <math.h>
class MyPoint
{
public:
MyPoint() : x(0), y(0){};
// MyPoint(MyPoint sp) { x = sp.x, y = sp.y; }
/* 构造函数不能引用构造本类作为参数:印象中是可以的,不知错哪了? */
MyPoint(double x0, double y0) { x = x0, y = y0; };
void Set(double x0, double y0)... |
#include "Core/Core.h"
DWORD WINAPI MainThread(LPVOID lpParam)
{
g_Core.Load();
while (!g_Core.ShouldUnload())
Sleep(100);
g_Core.Unload();
FreeLibraryAndExitThread(static_cast<HMODULE>(lpParam), EXIT_SUCCESS);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
DisableThreadLib... |
//everytime char goes to " " space, goes to next line
#include<iostream>
#include "showWords.h"
void showWords(string st) {
for (int i = 0; i < st.length() i++) {
}
} |
#include <iostream>
#include <string>
#include <string.h>
int main(int argc, char* argv[]){
{
// copy from string to char array
char* charArray = (char*)malloc(sizeof(char) * 1024);
memset(charArray, 'A', 1024);
std::string strTemp;
strTemp.resize(strlen(charArray));
... |
#ifndef SPHPARTICLEPROPEPRTY_H
#define SPHPARTICLEPROPEPRTY_H
#include <cuda_runtime.h>
//--------------------------------------------------------------------------------------------------------------
/// @author Idris Miles
/// @version 1.0
/// @date 01/06/2017
//-----------------------------------------------------... |
// EMERGENT GAME TECHNOLOGIES PROPRIETARY INFORMATION
//
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with Emergent Game Technologies and may not
// be copied or disclosed except in accordance with the terms of that
// agreement.
//
// Copyright (c) 199... |
class Solution {
public:
int ladderLength(string beginWord, string endWord, unordered_set<string>& wordList) {
unordered_set<string> beginSet({beginWord}), endSet({endWord});
int transLen = 2;
while(!beginSet.empty() && !endSet.empty()){
if(beginSet.size() > endSet.size()){
... |
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2006 Marcin Kalicinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information,... |
#include "Physics.h"
Physics::Physics(pos_t pos /*0, 0*/, pos_t vel /*0, 0*/, pos_t acc /*0, 0*/)
{
position = pos;
velocity = vel;
acceleration = acc;
}
void Physics::move(int dt, bool resistance /*false*/)
{
double acc_sd = 0.930001;
double vel_sd = 0.92043;
if (resistance) acceleration = acc... |
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
const int INF = 1<<29;
const int MOD=1000000007;
#define pp pair<ll,ll>
typedef long long int ll;
bool... |
#include <bits/stdc++.h>
using namespace std;
#define prev PREEVEV
const int N = 35000 + 10;
const int oo = 0x3f3f3f3f;
struct Node;
void modify(Node *nd, int lf, int rg, int L, int R, int delta);
struct Node {
int vmax;
int flag;
Node *ls, *rs;
void update() {
vmax = max(ls->vmax, rs->vmax);
}
void pushdown(... |
#include "../include/mirrordialog.h"
#include "ui_mirrordialog.h"
MirrorDialog::MirrorDialog(QWidget *parent) : QDialog(parent), ui(new Ui::MirrorDialog),
horizontal(false), vertical(false) {
ui->setupUi(this);
connect(ui->checkBoxHor, SIGNAL(stateChanged(int)), th... |
//float unit_cost=5.5;// per unit cost 5.5 tk
// this code will be uploaded on esp8266-12E
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
char ssid[] = "IoTCodeLab";//ssid
char wifiPassword[] = "@IoTCodeLab";//password
// Cayenne authentication info.... |
// system includes
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
// project includes
#include "Polymorphic.h"
#include "CRect.h"
#include "CPolyLine.h"
#include "xmlParser.h"
// global namespace declaration
using namespace std;
CShape::CreationMapType CS... |
#include<bits/stdc++.h>
using namespace std;
bool Parenthesis(string str);
int main()
{
string str = "{()}[{}]";
if (Parenthesis(str)) { cout <<"true";}
else { cout<<"false";}
return 0;
}
bool Parenthesis(string str)
{
if (str.length() & 1) {
return false;
}
stack<char> stack;
fo... |
/* -*- 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
**
*/
#include "core/pch.h"
#if defined(_NAT... |
//
// Created by jeremyelkayam on 10/14/20.
//
#include "special_item.hpp"
SpecialItem::SpecialItem(sf::Texture &texture, sf::SoundBuffer &used_sound_buffer, float a_appear_time) :
Entity(0.f,0.f,texture), appear_time(a_appear_time) {
consumed = false;
active = false;
age = 0;
color = sf::Color::Yellow;
use... |
#include<due_can.h>
#include"variant.h"
CAN_FRAME msg;
void setup()
{
Serial.begin(9600);
Serial.println("---- CAN Sender ----");
}
void sender()
{
msg.id=0x5A1;
msg.extended=LOW;
msg.priority=LOW;
msg.length=8;
msg.rtr=LOW;
msg.data.byte[0]=0x0;
msg.data.byte[1]=0x1;
msg.data.byte[2]=0x2;
m... |
/*!
* @copyright © 2017 UFAM - Universidade Federal do Amazonas.
*
* @brief Interface da classe "mkl_TPMPulseWidthModulation.h".
*
* @file mkl_TPMPulseWidthModulation.h
* @version 1.0
* @date 02 Agosto 2017
*
* @section HARDWARES & SOFTWARES
* +board FRDM-KL25... |
#ifndef SCENE_H
#define SCENE_H
#include <vector>
#include "GL/gl.h"
#include "GL/glext.h"
#include "../mat.h"
#include "Terrain.h"
class App;
extern App* a;
class Scene
{
public:
Scene();
virtual ~Scene();
void render();
Terrain* ter;
protected:
private:
GLuin... |
// 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 Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with spe... |
// -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
//
// Copyright (C) 2012 Opera Software ASA. All rights reserved.
//
// This file is an original work developed by Opera Software ASA
#ifdef POSIX_AUTOUPDATECHECKER_IMPLEMENTATION
#include <string.h>
#include <unistd.h>
#include <sys/utsname... |
#include <iostream>
using namespace std;
const int money_rank1[7] = {0, 5000000, 3000000, 2000000, 500000, 300000, 100000};
const int money_rank2[6] = {0, 5120000, 2560000, 1280000, 640000, 320000};
void calculate(int rank1, int rank2){
int ch_rank1 = 0;
int ch_rank2 = 0;
if(rank1 == 0){
ch_rank... |
#include <bits/stdc++.h>
#define INF 1917483645
using namespace std;
const int maxn = 20, maxm = 1010;
int n, m, dis[maxn], a[maxn][maxn];
void DFS(int u, int k, int cnt, int val) {
if (cnt == n) {
ans = min(ans, val);
return ;
}
for (int v = 1; v <= n; v++)
if (dis[u] + a[u][v] * k < dis[v]) {
dis[v] = dis... |
//===-- OProfileJITEventListener.cpp - Tell OProfile about JITted code ----===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#include "core/pch.h"
#if !TARGET_RT_MAC_MACHO
#include <OpenTpt... |
#include<iostream>
#include<windows.h>
using namespace std;
struct winm//winvalue array
{
int a,b,c;
};
struct aimove
{
int x;
int score;
aimove(){}
aimove(int s)
{
score=s;
x=0;
}
};
class engine
{
public:
bool gameover,check,multi;
int k,humval,comp,rv;
struct winm w[8];
int state[9],mat[5][5];
... |
#ifndef ADJACENCIA_H
#define ADJACENCIA_H
#include<stdlib.h>
#include<iostream>
class No;
class Adjacencia
{
public:
Adjacencia(No* inicio, No* fim, int peso);
~Adjacencia();
void setProx(Adjacencia* adj);
Adjacencia* getProx();
int getPeso();
No* getNoInicio();
... |
//
// Game.hpp
// MirrorChess
//
// Created by Sergio Colado on 22.04.20.
// Copyright © 2020 Sergio Colado. All rights reserved.
//
#ifndef Game_hpp
#define Game_hpp
#include <SFML/Graphics.hpp>
#include "Piece.hpp"
#include "Board.hpp"
using namespace sf;
enum class InputState
{
Pressed,
Released,
... |
#include "plane_parameterization.h"
PlaneParameterization::PlaneParameterization()
{
}
PlaneParameterization::~PlaneParameterization() {}
bool PlaneParameterization::Plus(const double* x,const double* delta,double* x_plus_delta) const
{
ceres::HomogeneousVectorParameterization hvp(3);
hvp.Plus(x,delta,x_plus_... |
#ifndef WARRIOR_H
#define WARRIOR_H
#include<string>
#include<sstream>
#include<random>
#include "Character.h"
#include<iostream>
#include<thread>
#include<vector>
#include "Sword.h"
#include "Axe.h"
using std::string;
using std::stringstream;
using std::cout;
using std::endl;
using std::vector;
... |
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <unordered_set>
#include <queue>
using namespace std;
int solve(string start,string end,unordered_set<string> &dict, int length){
string alphebet = "abcdefghijklmnopqrstuvwxyz";
int res =0;
for(int j=0;j<start.... |
#include <Poco/Exception.h>
#include <Poco/Logger.h>
#include "loop/StopControl.h"
#include "util/Loggable.h"
using namespace std;
using namespace Poco;
using namespace BeeeOn;
StopControl::Run::Run(StopControl &control):
m_control(control)
{
m_control.clear();
}
StopControl::Run::~Run()
{
try {
m_control.clea... |
//Kaveh Pezeshki
//literally just turns an LED on
#include "easySamIO.h"
#include <stdio.h>
int main(void) {
samInit();
//Testing Digital I/O
/*
pinMode(10, OUTPUT);
while (1) {
digitalWrite(10, LOW);
for(int i = 0; i < 100000; i++);
digitalWrite(10, HIGH);
for(int i = 0; i < 100000; i++);
}*/
//... |
#include"ServerSenderr.h"
HttpMessage ServerSender::makeMessage(size_t n, const std::string& body, const EndPoint& ep)
{
HttpMessage msg;
HttpMessage::Attribute attrib;
EndPoint myEndPoint = "localhost:8080"; // ToDo: make this a member of the sender
// given to its constructor.
msg.clear();
switch ... |
#include "dataview.h"
DataView::DataView()
: mModel{nullptr}
{
}
DataModel *DataView::model() const
{
return mModel;
}
void DataView::setModel(DataModel *model)
{
if(model && mModel != model)
{
mModel = model;
}
}
|
#include "sensorsDHT11.h"
#include "json.h"
#include "HTTPinit.h"
extern ESP8266WebServer HTTP;
#define DHTPIN 4 // GPIO4 or D2 - what digital pin we're connected to
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
// humidity => 0
// temperature => 1
void initDht(void){
HTTP.on("/sensors.json", ... |
#pragma once
namespace arithmetic_parser
{
enum class TokenType
{
None = 0,
Number,
Variable,
BuiltinFunction,
Parentheses,
Comma,
Constant
};
} |
#include "core/pch.h"
#include "modules/libgogi/mde.h"
// == MDE_Region ==========================================================
MDE_Region::MDE_Region()
: rects(NULL)
, num_rects(0)
, max_rects(0)
{
}
MDE_Region::~MDE_Region()
{
Reset();
}
void MDE_Region::Swap(MDE_Region *other)
{
int _max_rects = max_rect... |
// Copyright (c) 2012-2017 The Cryptonote developers
// 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 <thread>
#include <System/Context.h>
#include <System/Di... |
/****************************************************************
File Name: cutil.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, ... |
#include "temp_controller.h"
#include "http_request.h"
#include "screen1.h"
#include <ESP32Encoder.h>
void TempController::init()
{
// Update the encoder position based on the new set temp.
_encoder.setCount(_temp_to_count(_set_temp));
} // init()
bool TempController::update()
{
// Early return if it isn't tim... |
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int size, x, y, temp;
char arr[100];
cout << "Enter Array Size: ";
cin >> size;
cout << "\nEnter " << size << " characters: ";
for(x=0; x<size; x++)
{
cin >> arr[x];
}
y = x - 1;
x = 0;
while(x<y)
{
temp = arr[x];
arr[x] = ... |
#include "utils/file/filewriter.h"
#include <iostream>
#include <fstream> // TODO: Re-implement as my own?
#include <stdio.h>
namespace utils {
namespace file {
namespace filewriter {
} // namespace filewriter
} // namespace file
} // namespace utils
|
#include "SpringObject.h"
using namespace std;
SpringObject::SpringObject():SelectGravityObject()
{
}
SpringObject::SpringObject(int weight, Vector* position, Vector* speed, Vector* acceleration, map<GravityObject*,vector<double> >* links):SelectGravityObject(weight, position, speed, acceleration), _links(links)
{
... |
//算法:贪心
//对每个人按照接水时间升序排序, 时间相同则按照序号升序排序
//因为要让平均值最小,即使所有人等待时间之和最小
//就需要让时间小的先接完水,
//把较小的等待时间累加到需要时间较多的人身上
//排序后顺序即题目要求的接水顺序
//计算后输出即可
#include<cstdio>
#include<algorithm>
using namespace std;
struct baka//存每个人编号与时间
{
int data,bian;
}a[1010];
bool cmp(baka x,baka y)//排序比较函数
{
if(x.data==y.data)
... |
#pragma once
#include "../nt.h"
#include "../../driver/gina.h"
#include <string>
namespace gina
{
namespace driver
{
constexpr const auto device_path = L"\\Device\\Null";
static nt::handle handle = {};
bool open();
void close();
bool opened();
bool is_present();
std::uintptr_t get_i... |
#include <TinyGPS++.h>
#include "HX711.h"
TinyGPSPlus gps;
#define trigPin 12
#define echoPin 11
#define DOUT A3
#define CLK A2
HX711 scale(DOUT, CLK);
float calibration_factor = 182540;
String Message;
int d;
int duration, distance, binweight;
int MQ7map;
float flat,flon;
String lat, lon, flag;
unsigned ... |
#ifndef CAFFE_DXY_TEMP_LAYER_HPP_
#define CAFFE_DXY_TEMP_LAYER_HPP_
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "boost/dynamic_bitset.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
using boost::dynamic_bitset;
/**
* @brief According to the First input blob , Maks the second blob .
* ... |
//
// Created by abel_ on 29-06-2022.
//
/*
* PROBLEM LINK : https://www.codechef.com/problems/MAXORMIN
* PROBLEM CODE : MAXORMIN
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
int T;
cin >> T;
while(T--){
long long int N;
cin >> N;
vector<long long int> ones;
... |
#define _REENTRANT
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/sem.h>
int signal = 0;
char buffer[1000];
void *function(void *args);
int main()
{
pthread_t a_thread;
int res;
res = pthread_create(&a_thread, NULL, function, NULL);
if(res != NULL)
{
printf("create... |
#ifndef APPLICATION_GETSERVERLOGS_H
#define APPLICATION_GETSERVERLOGS_H
#include "BaseCommand.h"
/*
* Get server logs command class
*/
class GetServerLogs: public BaseCommand {
public:
explicit GetServerLogs(boost::property_tree::ptree& params);
~GetServerLogs() override = default;
/*
* Executing a... |
/*
* Copyright (C) 2013 Tom Wong. All rights reserved.
*/
#ifndef __GT_LOGIN_DIALOG_H__
#define __GT_LOGIN_DIALOG_H__
#include "gttabview.h"
#include "gtusermanager.h"
#include "ui_gtlogindialog.h"
GT_BEGIN_NAMESPACE
class GT_APP_EXPORT GtLoginDialog : public QDialog, public GtObject
{
Q_OBJECT
public:
ex... |
#pragma once
#include "../../../Toolbox/Toolbox.h"
#include "Mesh3D.h"
namespace ae
{
/// \ingroup graphics
/// <summary>
/// Simple 3D colored cube.
/// </summary>
/// <seealso cref="Mesh3D" />
/// <seealso cref="Drawable" />
class AERO_CORE_EXPORT CubeMesh : public Mesh3D
{
public:
/// <summary>Create a ... |
#include <iostream>
#include <vector>
using namespace std;
#define int long long
#define pb push_back
#define endl '\n'
const int N = 1e5 + 5;
vector <int> Graph[N];
int cat[N];
int n, m;
int ans = 0;
void dfs(int src, int par, int safe) {
if (safe > m)
return ;
int valid = 1;
for (auto to : Graph[src]) {
if... |
#include "Gameboard.h"
#include "GameInterface.h"
using namespace std;
Game_specs GameInterface::reportSpecs(){
return board_specs;
}
/* Send game commands to the gameboard
* commands are 5 characters long
* Allowed commands are:
* getsq x,y - returns integer value of square x,y
* picsq x,y - pic... |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
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 a... |
#include "SieveParAlternative2.h"
std::string SieveParAlternative2::name()
{
return "Sieve Algorith, split range array, separate dividers";
}
int* SieveParAlternative2::find(int min, int max, int* size)
{
int dividersSize = sqrt(max) + 1;
int arraySize = max - min;
// Initialize array
bool* array = ... |
#include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
//Constructor
node(int d){
data = d;
next = NULL;
}
};
node* insertFront(node*& head,node *ab)
{
if(ab==NULL)
{
//head=new node(ab->data);
return head;
}
node *n = new node(ab->data);
n-... |
#ifndef AWS_NODES_PARSERNODE_H
#define AWS_NODES_PARSERNODE_H
/*
* aws/nodes/parsernode.h
* AwesomeScript Parser Node
* Author: Dominykas Djacenka
* Email: Chaosteil@gmail.com
*/
#include <ostream>
#include "nodeexception.h"
#include "translatesettings.h"
namespace AwS{
namespace Nodes{
class ParserNode{
... |
#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 <map>
#include <SFML/Graphics.hpp>
namespace Sonar
{
class AssetManager
{
public:
AssetManager() = default;
~AssetManager() = default;
void LoadTexture(const std::string name, const std::string fileName);
const sf::Texture& GetTexture(const std::string& name);
void LoadFont(const... |
#include <stdio.h>
#include <sys/dir.h>
#include <maxmod9.h> // Maxmod definitions for ARM9
#include <utility>
#include <list>
#include "soundbank.h"
#include "tile.h"
#include "mirror.h"
#include "spinmirror.h"
#include "spinblocker.h"
#include "spinreflector.h"
#include "teleporter.h"
#include "laser.h"
#include... |
../1068/E.cpp |
/*
* 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: Shader... |
// Copyright (c) 2021 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// #5488: pika::util::detail::bind doesn't bounds-check placeholders
#include <pika/f... |
#define MAX 100
int is_opening ( char ch )
{
if ( ch == '(' || ch == '[' || ch == '{' ) return 1 ;
else return 0 ;
}
int is_closing ( char ch )
{
if ( ch == ')' || ch == ']' || ch == '}' ) return 1 ;
else return 0 ;
}
char counter ( char ch )
{
if ( ch == ')' ) return '(' ;
else if ( ch == ']' ) ... |
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <locale.h>
using namespace std;
void charcreate(int &str, int &agi, int &iq, int &gold, char *s)
{
int k,n;
cout << "Введите имя персонажа: ";
gets_s(s,100);
n = strlen(s);
for... |
// Sort the given string
#include<iostream>
#include<algorithm> // To use the sort function
#include<string>
using namespace std;
int main(){
string s1 = "dhvfljrejghejgrljhgardfjghbadbyugukgkruhu";
sort(s1.begin(), s1.end());
cout<<s1<<endl;
} |
#include<Wire.h>
#include<Math.h>
#include <Servo.h>
// raw values passed from the C++ program. Kept as seperate variables mainly for intuitiveness
int RT, LT, R3, L3, RB, LB, UpD, DownD, LeftD, RightD, A, B, X, Y, Start, Back, Verification;
int palmVX = 0, palmVY = 0, palmVZ = 0, palmPitch = 0, palmYaw = 0, palmRoll,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.