text stringlengths 8 6.88M |
|---|
#include "core\Singularity.Core.h"
namespace Singularity
{
namespace Threading
{
struct TASK_OPTIONS
{
int Iterations;
float Frequency;
int Affenity;
};
enum TaskState { Ready = 1, PendingExecute = 2, Executing = 3, PendingComplete = 4, Complete = 5, PendingRecycle = 6, Recycle = 7 };
... |
//
// Created by ori294 on 1/10/20.
//
#ifndef EX4__SEARCHABLE_H_
#define EX4__SEARCHABLE_H_
#include <list>
#include "State.h"
#include "Path.h"
/**
* Searchable interface.
* @tparam T mostly a Point
*/
template<class T>
class Searchable {
public:
virtual State<T> *GetInitialState() = 0;
virtual State<T> *G... |
#ifndef SQLITE_SET_H
#define SQLITE_SET_H
#include <QDialog>
#include<QFileDialog>
namespace Ui {
class sqlite_set;
}
class sqlite_set : public QDialog
{
Q_OBJECT
public:
explicit sqlite_set(QWidget *parent = 0);
~sqlite_set();
QString loc_data;
QString set_data;
private slots... |
/*************************************************************
* > File Name : P1522.cpp
* > Author : Tony
* > Created Time : 2019ๅนด01ๆ24ๆฅ ๆๆๅ 16ๆถ13ๅ02็ง
**************************************************************/
#include<bits/stdc++.h>
using namespace std;
const int maxn = 200;
const in... |
class TimeMap {
public:
/** Initialize your data structure here. */
TimeMap() {
}
void set(string key, string value, int timestamp) {
m[key].emplace_back(timestamp, value);
}
string get(string key, int timestamp) {
if (m.find(key) == m.end()) return ""; // not exist
... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
//
// BonesRain.h
// Boids
//
// Created by chenyanjie on 3/31/15.
//
//
#ifndef __Boids__BonesRain__
#define __Boids__BonesRain__
#include "SkillNode.h"
class BonesRain : public SkillNode {
private:
float _damage;
cocos2d::Point _dir;
cocos2d::Point _init_pos;
float _radius;
float _interval;
... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Data::Xml::Xsl {
struct IXsltProcessor;
struct IXsltProcessor2;
struct IXsltProcessorFactory;
struct XsltProcessor;
}
namespace Windo... |
๏ปฟ//
// Copyright (C) 2017 Ruslan Manaev (manavrion@yandex.com)
// This file is part of the Modern Expert System
//
#pragma once
#include "PropertyViewPage.g.h"
#include "MainPageController.h"
namespace modern_expert_system
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
extern int N;
extern double *x;
extern double *y;
extern double *output;
extern double Lx, dx,dy,dz;
extern complex<double> *local_data;
extern complex<double> *local_temp;
extern int n_fields;
extern int local_nx;
extern int local_x_start;
extern int local_ny_after_transpose;
extern int local_y_start_after_transpose... |
#include "audio\Singularity.Audio.h"
/*
* AdaptiveParameter.h
*
* An adaptive parameter that we can get the current setting from.
*
* Author: Sela Davis
*
* Created: May 05, 2010 (05/05/10)
* Last modified: May 05, 2010 (05/05/10)
*/
namespace Singularity
{
namespace Audio
{
class AdaptiveParam... |
/****************************************
*
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE
* Copyright (C) 2019 Victor Tran
*
* 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 Foundati... |
/**
* Reduce dataset size by subsampling.
*
* Jason Leake October 2019
*/
#pragma once
#include <filesystem>
#include "cleaner_files/Parameters.h"
/**
* This class is a functor for reducing the amount of data by
* aggregating all the values read in each second into a mean value
* for that second.
*/
class R... |
/*
* urSTK.mm
* urMus
*
* Created by gessl on 10/16/09.
* Copyright 2009 Georg Essl. All rights reserved. See LICENSE.txt for license conditions.
*
*/
#include "urSound.h"
#include "urSTK.h"
/*
#include "ADSR.h"
#include "Asymp.h"
#include "BandedWG.h"
#ifdef SAMPLEBASED_STKS
#include "BeeThree.h"
#endif
#... |
#include <iostream>
#include <cstring>
struct CandyBar{
char brand[30];
double weight;
int heat;
};
void set(CandyBar &, const char * brand="Millennium Munch", double weight=2.85, int heat=350);
void show(const CandyBar &);
int main(void)
{
using namespace std;
CandyBar cb;
char brand[] = "M... |
/*
cash3.h
Matt Porter
COP3014
Summer 2010
Project 2 Solution
This is an example solution to the problem here:
http://ww2.cs.fsu.edu/~porter/cop3014/summer2010/projects/Project%202.htm
*/
#ifndef CASH3_H
#define CASH3_H
#include <cstdlib>
//The Cash3 class declaration.
class Cash... |
#ifndef SCORE_H
#define SCORE_H
#include <QGraphicsSimpleTextItem>
#include <QMediaPlayer>
class Score : public QGraphicsTextItem
{
friend class Sun;
private:
int playerScore;
QMediaPlayer * scorePlayer;
public:
Score(QGraphicsItem *parent = 0);
void addToScore(int s);
~Score();
int getSc... |
/***********************************************************************
created: Fri Apr 22 2011
author: Paul D Turner <paul@cegui.org.uk>
*************************************************************************/
/***************************************************************************
* Copyrigh... |
#include <stdio.h>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
vector<Point2f> vpoint;
Mat src, showimg;
void draw_transform() {
showimg = src.... |
#include "../../include/circulo.h"
#include "../../include/punto.h"
#include "../../include/avanzar.h"
#include <fstream>
#include <cmath>
#include <iostream>
using namespace std;
/*
void Avanzar(istream& is)
{
while (isspace(is.peek()) || is.peek()=='#') {
if (is.peek()=='#')
is.ignore(1024,'\n'); // Sup... |
//
// Created by wxy on 2018/2/25.
//
//
// Created by wxy on 2018/2/25.
//
//
// Created by wxy on 2018/2/25.
//
//
// Created by wxy on 2018/2/24.
//
#include <set>
#include <vector>
#include <iostream>
using namespace std;
namespace p220 {
class Solution {
public:
bool containsNearbyAlmostDupl... |
//queue.size()ๅๅป้ๅๅ
ๅ
็ด ็ไธชๆฐ
#include<stdio.h>
#include<queue>
using namespace std;
int main()
{
queue<int> q;
for(int i=1;i<=5;i++)
q.push(i);//push(i)็จไปฅๅฐiๅๅ
ฅ้ๅ
printf("%d",q.size());
return 0;
}
|
// WordChecker.cpp
//
// ICS 46 Winter 2021
// Project #4: Set the Controls for the Heart of the Sun
//
// Replace and/or augment the implementations below as needed to meet
// the requirements.
#include <algorithm>
#include <set>
#include "WordChecker.hpp"
WordChecker::WordChecker(const Set<std::string>& words)
... |
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define scd(x) scanf("%lf",&x)
#define pfi(x) printf("%d",x)
#define pfl(x) printf("%lld",x)
#define pfd(x) printf("%lf",x)
#define pfc(x) printf("Case %d: ",x++)
#define... |
int dirpin = 2; // it's on a static pulse pin (direction input)
int steppin = 5; // it's on a PWM~ pin (velocity of step input)
int onoffpin = 4; // it's on a static pulse pin (on and off input)
int potpin = A0;
int userpin = A1;
int switchpin1 = 7;
int switchpin2 = 8;
int currentSpeed = 100... |
#include <afxext.h>
#include <winsock.h>
// ็ผ่ฏๆถ้ไฝฟ็จ็ๅบ
#pragma comment(lib,"wsock32.lib")
// select()ๆๅๅฎไน
#define ZERO (fd_set *)0
// ๅ้ๅฎไน
int maxth, scanok, scannum;
int portip, hoststart, hoststop, startport, endport; //ๅฎไนไบๅผๅงIๅ็ปๆPๅฐๅ๏ผๅผๅงๅ็ปๆ็ซฏๅฃ
long searchnum, searched;
void usage(char *); // ๅฎไนๆพ็คบไฝฟ็จๆนๆณๅฝๆฐ
void playx(int)... |
/***********************************************************************
* Copyright (C) 2019 Yinheyi. <chinayinheyi@163.com>
*
* 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
* vers... |
/**
* Copyright (C) 2017 Alibaba Group Holding Limited. 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
*
* ... |
/*
* For Gold and Sweetrolls
* Copyright (C) 2020 Piotr Wrรณblewski <szczypiorofix@o2.pl>
*/
#include "MainMenu.h"
#include "Engine.h"
MainMenu::MainMenu(State& _state) : state{ _state } {
this->x = 10;
this->y = 10;
this->moveX = 0;
this->moveY = 0;
this->mapMoveDirectionX = -MAP_SPEED_X;
... |
#include "SMSystem.h"
#include <fstream>
#include <string>
using namespace std;
SMSystem test = SMSystem();
void display()
{
test.Simulate();
//test.DrawWireframe();
test.DrawCloth();
test.DrawGraphyics();
glFlush();
}
void Init()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1, 1, -1, 1, -1, 1);
... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <sstream>
#include <cmath>
#include<unordered_set> // ้่ฆc++ 11ๆ่ฝๆฏๆ
using namespace std;
class Render {
public:
vector<int> renderPixel(vector<int> screen, int x, int y) {
for(int i = x... |
#pragma once
#include "shape.h"
class Rec :public Rotatable
{
public:
Rec(Point & _head, const char _c);
void takeShapeUp() override;
virtual string type() const override { return "rec"; }
};
|
// Copyright (c) 2015 University of Szeged.
// Copyright (c) 2015 The Chromium Authors.
// All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPROCKET_BROWSER_UI_AUTHENTICATION_DIALOG_H_
#define SPROCKET_BROWSER_UI_AUTHENTICATION_DIALOG_... |
#ifndef __M_BULLET__
#define __M_BULLET_
#include "Bullet.h"
#define M_BULLET_SPEED 500.0f
class MBullet : public Bullet
{
public:
MBullet(GVector2 startPosition, float degree);
~MBullet();
void init() override;
private:
};
#endif // __M_BULLET__
|
#ifndef SORT_H
#define SORT_H
namespace sort
{
/*Helper function*/
// Swap two integer
void swap(int&, int&);
// Ascending order
bool ascend(const int&, const int&);
// Descending order
bool descend(const int&, const int&);
/*Selection sort*/
// Sorting array using selection sort algorithm
void selectionS... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: main.cpp
Description: main function to drive streaming server on Linux platform.
Com... |
//
// Created by wronwikt on 02.03.18.
//
#ifndef JIMP_EXERCISES_REVERSESTRING_H
#define JIMP_EXERCISES_REVERSESTRING_H
#include <string>
#include <iostream>
std::string Reverse(std::string str);
#endif //JIMP_EXERCISES_REVERSESTRING_H
|
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
class Matrix{
private:
int row;
int col;
vector<vector<int>> data;
public:
Matrix(int row, int col) :data(row),row(row),col(col){
for (int i = 0; i < row; i++){
data[i].resize(col);
... |
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) scanf("%lld", &n)
#define fr(i,n) for (ll i=0;i<n;i++)
#define fr1(i,n) for(ll i=1;i<=n;i++)
#define pfl(x) printf("%lld\n",x)
#define endl ... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "ButtonInteraction.h"
#include "Components/WidgetComponent.h"
#include "Components/BoxComponent.h"
#include "Net/UnrealNetwork.h"
// Sets default values
AButtonInteraction::AButtonInteraction()
{
// Set this actor to call Tick(... |
//////////////////////////////////////////////////////////////////////////
// Randomness
//////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef RL_RANDOMNESS_H
#define RL_RANDOMNESS_H
#include "extern/mt19937int.h"
#include <time.h>
namespace RL {
inline
void InitRandomness... |
#include <iostream>
#include "a_car.h"
Acar::Acar() : next_(NULL) {
set_width(2);
set_height(3);
}
void Acar::MoveX(int num_move = 1) { set_cx(get_cx() + num_move); }
void Acar::set_next(Acar* next) { next_ = next; }
Acar* Acar::get_next() const { return next_; } |
#include <bits/stdc++.h>
using namespace std;
bool checkValidString(string s)
{
int low = 0, high = 0;
for (char c : s)
{
low += c == ')' ? 1 : -1;
high += c != '(' ? 1 : -1;
if (high < 0)
break;
low = max(low, 0);
}
return low == 0;
}
int main()
{
st... |
#ifndef CUSTOMOUTPUT_H
#define CUSTOMOUTPUT_H
#include <QDialog>
#include "graphicrender.h"
#include "nodequeque.h"
#include <QFileDialog>
#include <fstream>
#include <sstream>
#include <iostream>
namespace Ui {
class customOutput;
}
class customOutput : public QDialog
{
Q_OBJECT
public:
explicit customOutp... |
#include"Object.h"
SDL_Texture* Object::getTexture()
{
return Tex;
}
SDL_Rect* Object::getSrc()
{
return source;
}
SDL_Rect* Object::getDest()
{
return destination;
}
void Object::setSrc(int x, int y, int h, int w)
{
src.x = x;
src.y = y;
src.h = h;
src.w = w;
}
void Object::setDe... |
#include "blit.h"
void blit_test(){
img* a = blit_gen(5,9,5);
img* b = blit_gen(3,10);
img* frac = blit_power(a,b);
img* ans = blit_con(frac,b);
blit_cdraw(ans);
blit_freeimg(a,b,frac,ans,0);
}
img* blit_createimg(int w, int h){
return blit_createimg(w, h, 0);
}
img* blit_createimg(int w, int h, int base){
img... |
//
// Copyright Jason Rice 2017
// 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)
//
#include <emscripten.h>
#include <nbdl/catch.hpp>
#include <nbdl/endpoint_handler.hpp>
#include <nbdl/hold.hpp>
#include <nbdl/h... |
#include<stdio.h>
#include<malloc.h>
struct node {
int data;
struct node *next;
};
int printLast(struct node *head,int k){
struct node *temp=head;
int len=0;
int i;
int n=k;
while(temp!=NULL){
temp=temp->next;
len++;
}
if(len<n)
return 0;
temp=head;
for(i=0;i<len-n+1;i++){
temp=te... |
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int size = nums.size();
if (size<2)
return size;
int cur = 0;
for (int i = 1; i<size; i++)
{
if (nums[i] != nums[cur])
nums[++cur] = nums[i];
}
return cur + 1;
}
};
int ... |
// IoSupport.h: interface for the CIoSupport class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_IOSUPPORT_H__F084A488_BD6E_49D5_8CD3_0BE62149DB40__INCLUDED_)
#define AFX_IOSUPPORT_H__F084A488_BD6E_49D5_8CD3_0BE62149DB40__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif ... |
// Copyright (C) 2017 Elviss Strazdins
// This file is part of the Ouzel engine.
#include "core/CompileConfig.h"
#if OUZEL_SUPPORTS_OPENAL
#include "AudioAL.h"
#include "utils/Log.h"
namespace ouzel
{
namespace audio
{
bool AudioAL::checkALCError(bool logError)
{
ALCenum error = ... |
#ifndef __ABSTRACT_H__
#define __ABSTRACT_H__
#include <string>
class Abstract
{
public:
std::string make();
protected:
virtual std::string bread() = 0;
virtual std::string jam() = 0;
};
#endif // __ABSTRACT_H__
|
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include <iostream>
#include <string>
#include <stdlib.h>
#include "info.h"
#include "config.h"
#include "call_api.h"
using namespace std;
int main(int argc, char * argv[]) {
system("mkdir -p queries");
system("mkdir -p queries/headers");
system("mkdir -p queries/bodies");
// Credentials from T... |
#include "Math.h"
#include "base/math_functions/AsymGaus.h"
TF1*ant::Math::AsymGaus()
{
return math::AsymGaus::GetTF1();
}
|
#pragma once
#include "../main.h"
class cCheat
{
public:
bool bLastDead;
cCheat()
{
bLastDead = false;
}
bool IsPlayerWeaponUseAmmo( int iIndex );
bool IsLocalWeaponUseAmmo();
bool IsLocalWeaponSniper();
bool IsLocalWeaponKnife();
void ClearPlayers();
};
extern cCheat g_Cheat; |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::ApplicationModel::Resources::Management {
struct IIndexedResourceCandidate;
struct IIndexedResourceQualifier;
struct IResourceIndexer;
... |
#ifndef AFFINENET_H_
#define AFFINENET_H_
#include "Modules/Linear.h"
#include "Modules/ReLU.h"
namespace StaticNet
{
class AffineNet : public Module<float>
{
public:
AffineNet()
: Module<float>("AffineNet"),
conv1(this),
relu1(this),
conv2(thi... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
#ifndef DISPLAYTRIP_H
#define DISPLAYTRIP_H
#include <stack>
#include <QDialog>
namespace Ui {
class displaytrip;
}
class displaytrip : public QDialog
{
Q_OBJECT
public:
explicit displaytrip(QWidget *parent = 0,std::stack<std::string> *stk = 0,int weight = 0);
~displaytrip();
private slots:
void on_... |
#ifndef RUNNING_MN
#define RUNNING_MN
#include "iter_getter.h"
struct update_mean{
int power;
__host__ __device__ update_mean(int p): power(p){}
template<typename Tup>
__host__ __device__ void operator()(Tup t){
thrust::get<0>(t) = thrust::get<0>(t) + (pow(thrust::get<1>(t),power) - thrust::get<0>(t)) / t... |
/*************************************************************
* > File Name : P3952.cpp
* > Author : Tony
* > Created Time : 2019ๅนด04ๆ17ๆฅ ๆๆไธ 16ๆถ07ๅ14็ง
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
string str1, str2;
int ... |
//
// Created by matan on 1/21/20.
//
#ifndef SOLID_SERVER_REDO_SERIALSERVER_H
#define SOLID_SERVER_REDO_SERIALSERVER_H
#include "BasicServer.h"
class SerialServer : public BasicServer {
public:
SerialServer();
SerialServer(int numOfListeningPorts);
void run() override;
};
#endif //SOLID_SERVER_REDO... |
#ifndef TINYENGINE_LTE_SERIALIZE_H_
#define TINYENGINE_LTE_SERIALIZE_H_
#pragma once
#include <iostream>
#include "LTE_Utils.h"
#include "LTE_Globals.h"
bool LTE_GetMustSave() { return LTE_GLOBAL_MUST_SAVE; }
bool LTE_GetMustLoad() { return LTE_GLOBAL_MUST_LOAD; }
void LTE_SetMustSave(bool must) { LTE_GLOBAL_MUST_S... |
class Solution {
public:
bool isValid(string s) {
stack<char> sta;
int sz = s.length();
if(sz == 0) return true;
sta.push(s[0]);
for(int i = 1;i < sz;i++){
if(sta.empty()) {sta.push(s[i]);continue;}
char tmp = sta.top();
if( (tmp == '(' && ... |
#include "CDoorRotating.h"
#include "DescriptorList.h"
#include "utils/math.h"
#include "elements/Model.h"
CDoorRotating::CDoorRotating():
CDoorBase()
{
m_rotationAxis = vec3d(0., 1., 0.);
m_rotationAngle = 90.;
}
void CDoorRotating::init(){
CDoorBase::init();
m_model->setPhysics(P_KINEMATIC);... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
# include <iostream>
# include <cstring>
# include <vector>
# include <list>
using namespace std;
vector<vector<int>> adj_mat;
vector<list<pair<int, int>>> adj_list;
vector<int> euler;
bool visited[100005];
void dfs(int v) {
visited[v] = true;
euler.push_back(v);
for (auto &adj : adj_list[v])
if... |
/*
* UAE - The Un*x Amiga Emulator
*
* SanaII emulation
*
* partially based on code from 3c589 PCMCIA driver by Neil Cafferke
*
* Copyright 2007 Toni Wilen
*
*/
#include "sysconfig.h"
#include "sysdeps.h"
#include "threaddep/thread.h"
#include "options.h"
#include "memory.h"
#include "custom.h"
#include "events.h"
#i... |
#pragma once
class Array
{
//private:
public:
//array
int* array;
//array size
int size;
public:
//default constructor (128 elements)
Array();
//constructor
Array(int size);
//copy constructor
//Array();
//default destructor
~Array();
//returns array size
... |
#include<bits/stdc++.h>
using namespace std;
int final_cost, final_dest, found;
#define big_value 1000000007LL
#define buff_size 1024
typedef struct ucs* PIPE_BLOCK;
struct ucs
{
int st[60],et[60],n;
};
void dfs(int source, vector< pair<string,int> > v[], int visited[], int cost, int isgoal[], map<string,int>nodes... |
/**********************************************************
* License: The MIT License
* https://www.github.com/doc97/TxtAdv/blob/master/LICENSE
**********************************************************/
#include "catch.hpp"
#include "TextStyleSheet.h"
#include "TextMarkup.h"
namespace txt
{
TEST_CASE("TextStyleShe... |
// https://www.acmicpc.net/problem/2178
#include <iostream>
#include <queue>
using namespace std;
int n, m;
int map[101][101]={0,};
int visit[101][101]={0,};
int dir[4][2] = {{1,0},{-1,0},{0,1},{0,-2}};
void bfs(){
queue<pair<int, int> > q;
q.push(pair<int,int> (0,0));
while(q.size()!=0){
pair<int, int> cu... |
#include <iostream>
#include <string>
#include <Eigen/Dense>
using Eigen::MatrixXd;
using std::string;
extern "C" {
MatrixXd newMatrixXd(int aCols,int aRows,double* aRaw)
{
MatrixXd m(aCols,aRows);
for(int i=0;i<aCols;i++)
{
for(int j=0;j<aRows;j++)
{
m(i,j) =aRaw[i*aRows+j];
... |
/**
Copyright 2019 Mikhail Paulyshka
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... |
// 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 <stdlib.h>
#include <math.h>
#include <time.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int nx, ny, nz, N, maxrun;
double J, kb, T;
double h, h0, p;
int count=0;
int order[8][2] = {{-1, -1}, {-1, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, 0}, {0, 1}};
void display(Mat image);
Mat ... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Devices::PointOfService {
struct IBarcodeScanner;
struct IBarcodeScanner2;
struct IBarcodeScannerCapabilities;
struct IBarcodeScannerCa... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Devices.WiFi.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation::Collections {
#ifndef WINRT_GENERIC_670a3c41_ecc8_55c2_84d4_51864496a328
#define WINRT_... |
#include <Wire.h>
// I/O
const int ARMED_SWITCH = 2; // Pin for switch to arm alarm
const int ARMED_LED = 4; // Pin for notify that alarm is armed
const int BUZZER = 3; // Pin for buzzer/piezo speaker
const int SIREN = 8; // Pin for siren/claxon
c... |
/*
* UAE - The U*nix Amiga Emulator
*
* Picasso96 Support Module
*
* Copyright 1997 Brian King <Brian_King@Mitel.com, Brian_King@Cloanto.com>
*
* Theory of operation:
* On the Amiga side, a Picasso card consists mainly of a memory area that
* contains the frame buffer. On the UAE side, we allocate a block of ... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/*์ค์ ํด์ผ ํ ์ ๋จ๊ธฐ์ ๊ธธ์ด๋ฅผ ์ด์ง ํ์์
์ด์ฉํ์ฌ ์ฐพ๋๋ค. ์์ฐจ ํ์์ ์ด์ฉํด๋
๋ต์ ๊ตฌํ ์๋ ์์ง๋ง, ๋ก ๊ธธ์ด์ ๋ฒ์๊ฐ
10์ต ๊น์ง ์์ผ๋ฏ๋ก ์ด์ง ํ์์ด ํ์๋ค.*/
int main(){
int n, m, element, answer;
cin >> n >> m;
vector<int> array;
for(int a = 0; a < n; a++){
cin >> ele... |
#include "GpioPin.h"
#include <QDebug>
GpioPin::GpioPin(int nr) :
_nr(nr)
{}
bool GpioPin::isDirection(const char *text) {
QFile file;
if(!open(&file, "/sys/class/gpio/gpio%1/direction", QIODevice::ReadOnly))
return false;
QByteArray direction(file.readAll());
file.close();
return direction.startsWith(text);... |
#include <memory>
#include <string>
using namespace std;
class StringSingleton
{
public:
// Some accessor functions for the class, itself
std::string GetString() const
{
return mString;
}
void SetString(const std::string &newStr)
{
mString = newStr;
}
// The magic func... |
/*
* UAE - The Un*x Amiga Emulator
*
* LUA Scripting Layer
*
* Copyright 2013 Frode SOlheim
*/
#include "sysconfig.h"
#include "sysdeps.h"
#include <lualib.h>
#include "options.h"
#include "savestate.h"
#include "memory.h"
#include "debug.h"
#include "identify.h"
#include "luascript.h"
#include "uae.h"
#include "zfi... |
#include<iostream>
#include <algorithm>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution
{
public:
int dfsH(TreeNode *root)
{
if (root == NULL)
return 0;
int leftH = dfsH(root->left);
if (... |
// Copyright (c) The HLSL2GLSLFork Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.txt file.
// Implementation of support library to generate GLSL functions to support HLSL
// functions that don't map to built-ins
#include <map>
... |
#include <gdk--/gc.h>
#include <gtk--/box.h>
#include <gtk--/checkbutton.h>
#include <gtk--/drawingarea.h>
#include <gtk--/entry.h>
#include <gtk--/frame.h>
#include <gtk--/label.h>
#include <gtk--/main.h>
#include <gtk--/menu.h>
#include <gtk--/menubar.h>
#include <gtk--/notebook.h>
#include <gtk--/radiobutton.h>
#inc... |
#include <iostream>
using namespace std;
bool palcheck(int n)
{
int a=n ,temp = 0;
while(a>0)
{
temp = temp*10 + (a);
a=a/10;
}
return (n==temp);
}
int rev(long long int a)
{
int ans=0,flag=0;
while(a>0)
{
if(a != 0 || flag==1)
{
ans =... |
#pragma once
#include <netinet/in.h>
#include <string>
#include "Util.h"
START_NAMESPACE
class InetAddress {
public:
InetAddress() = default;
InetAddress(uint32_t ip, uint16_t port);
explicit InetAddress(const std::string& ip, uint16_t port);
sockaddr* address() { return reinterpret_cast<sockad... |
#pragma once
#include "stdafx.h"
// Programmable Interrupt Controller Emulator
//
// This class emulates some of the functionality of the interrupt
// controller. Edge sensing on the interrupt inputs is not currently
// supported. The edge sensing on the clock interrupts is emulated
// by resetting the interrupt input ... |
#include <iostream>
using namespace std;
//the rotate function
int rotate(int row, int col, int degree){
switch(degree){
case 0: return (row * 4 + col );
case 1: return ( 12 + row - (col*4));
case 2: return ( 15 - (row *4) - col);
case 3: return ( 3 - row + (col*4));
}// end... |
#include <bits/stdc++.h>
using namespace std;
struct node
{
vector <node *> children;
};
int find_depth(node * root)
{
if((root->children).size()==0)return 0;
else if((root->children).size()==1) return 1+find_depth((root->children)[0]);
{
int depth=find_depth((root->children)[0]);
for(int i=1;i<(root->children)... |
#include "inttypes.h"
#include "vkdevice.h"
#include "string.h"
#include <set>
#include "../../common.h"
#include "vkswapchain.h"
namespace tna
{
bool
check_device_extension_support(VkPhysicalDevice device,
const char** device_extensions,
uint32_t num_... |
// Copyright (c) 2015 University of Szeged.
// Copyright (c) 2015 The Chromium Authors.
// All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sprocket/android/jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/andro... |
/* @brief PermutationCipher.cpp
* Este programa realiza la operacion de permutacion
* a nivel de caracter y a nivel de bits.
*/
#include <bits/stdc++.h>
using namespace std;
extern map<int, int> tablePermutation;
void encryptAndDecryptPermutation( string *contenttoEncrypt, string *finalText ){
int positi... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#ifndef FLUXMAKE_BUILDPLAN_H
#define FLUXMAKE_BUILDPLAN_H
#include <flux/PrefixTree>
#include <flux/Map>
#include "Module.h"
#include "BuildParameters.h"
#include "... |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int dp[100];
int sumRange(int i, int j) {
if(i == 0)
return dp[j];
else
return dp[j] - dp[i-1];
}
void NumArray(vector<int>& nums) {
int len = nums.size();
dp[0] = nums[0];
for(int i = 1;... |
#include <iostream>
#include <stdio.h>
#include <iomanip>
using namespace std;
int main()
{
float a,b;
cin>>a>>b;
cout<<setprecision(10)<<"a+b="<<a+b<<"\na-b="<<a-b<<"\nab="<<a*b<<"\na/b="<<a/b;
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.