text stringlengths 8 6.88M |
|---|
#include <SPI.h>
#define SS PA4
static const int spiClk = 250000; // 250kHz
auto& ser = Serial1;
void setup() {
pinMode(SS, OUTPUT);
digitalWrite(SS, HIGH);
ser.begin(115200);
ser.println("Hello from stm32 spi master");
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV8);//divide the clock by 8
}
v... |
#include <QNetworkDatagram>
#include <QDebug>
#include <QNetworkInterface>
#include <QNetworkConfiguration>
#include "udpfinderclient.h"
UdpFinderClient::UdpFinderClient(QHostAddress address, QObject *parent) : QObject(parent)
{
m_udpSocket.bind(address, 5556);
m_myAddress = address;
connect(&m_udpSocket... |
#include "StdAfx.h"
#include "NumWalker.h"
#include <algorithm>
using namespace std;
NumWalker::NumWalker(void)
{
counter = 0;
face = 'N';
skin = 6;
}
NumWalker::~NumWalker(void)
{
}
void NumWalker::step()
{
counter--;
}
void NumWalker::takeInput(char in)
{
if(counter < 1 && in >= '1' && in <= '9')
{
coun... |
#include "movie.h"
#include <iostream>
#include <cstring>
using namespace std;
// Constructor
Movie::Movie(char* _director, char* _duration, char* _rating, char* _year, char* _title):Media() {
director = new char[24];
rating = new char[24];
duration = new char[10];
strcpy(director, _director);
strcpy(ratin... |
#include "Ray.h"
#include <cfloat>
Ray::Ray(Vector3 vOrg, Vector3 vDir){
Origin = vOrg;
Direction = vDir;
t = FLT_MAX;
}
|
#include <iostream>
#include <vector>
#include <string>
#include <random>
#include <ctime>
#include <fstream>
void game_play(std::vector<int> vector)
{
for (int i = 0; i < vector.size(); i++)
{
std::cout << vector[i] << std::endl;
}
}
void play_game()
{
std::vector<int> guesses;
int... |
// 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 ... |
/* leetcode 498
*
*
*
*/
class Solution {
public:
vector<int> findDiagonalOrder(vector<vector<int>>& matrix) {
int row = matrix.size();
if (row == 0) {
vector<int> ans;
return ans;
}
int col = matrix.at(0).size();
vector<int> ans;
int sums ... |
#include <GL/glut.h>
#include<math.h>
#include <stdio.h>
#include <stdlib.h>
int clicks = 0,x0,y,cenX,cenY,a=40,b=80;
void DrawEllipse(int x0, int y0){
glColor3f(0.0, 0.0, 0.0);
glPointSize(2.0);
float p1 = b*b+a*a/4-a*a*b;
float dx, dy;
float x = 0;
float y = b;
float p2 = ((b... |
#ifndef RRG_FRAMERATE_H
#define RRG_FRAMERATE_H
#include "interval.h"
namespace RRG {
class FrameRate {
public:
FrameRate();
virtual ~FrameRate();
void Update() {
// increase the counter by one
m_fpscount++;
// one second elapsed? (= 1000 millisec... |
#pragma once
#include "plbase/PluginBase.h"
#pragma pack(push,4)
class PLUGIN_API CReference
{
public:
class CReference *m_pNext;
class CEntity **m_ppEntity;
};
#pragma pack(pop)
VALIDATE_SIZE(CReference, 8); |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int hIndex(vector<int>& citations) {
//ๅบๆฌๆๆณ๏ผไบๅๆฅๆพ
int res=0;
int n=citations.size();
int low=0,high=n-1;
while(low<=high)
{
int mid=(low+high)/2;
... |
#include "Shape.h"
namespace Shapez
{
}
|
#include <string>
#include <iostream>
#include <cstring>
// e : ํ์ฌ ๊ณ๋ ๊ฐ๊ฒฉ (1 <= e <= 10^14)
// ์ด์ ๊ณ๋ ๊ฐ๊ฒฉ์ m ์ ๋ฐฐ์ (2 <= m <= 20)
// ์ถ๋ ฅ์, ๊ฐ๋ฅํ ๊ฐ๊ฒฉ์ ์๋ฅผ 1,000,000,007๋ก ๋๋ ๋๋จธ์ง
std::string e;
//e ์์ ์ค๋ณต๋๋ ์ซ์๊ฐ ์์ ๋ ๊ฐ์ฅ ๋จผ์ ์ค๋ ๊ฒ๋ง ๊ณ์ฐ ํ๊ธฐ ์ํด
//e์ ์๋ฆฟ์๋ฅผ ์ ๋ ฌ ํ ๊ฒ
std::string digits;
// e์ ์๋ฆฟ์
int n;
int m;
const int MOD = 1000000007;
int... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef VISITEDSEARCH_H
#define VISITEDSEARCH_H
#include "module... |
#ifndef BOOK_H
#define BOOK_H
#include <QString>
class Book
{
public:
Book();
void setBook(int id, QString author, QString name, int year, QString publishingHouse, int pageCount);
int getId();
QString getAuthor();
QString getName();
QString getPublishingHouse();
int getYear();
int getP... |
#include "GameOverScreen.h"
#include "AssetLib.h"
bool GameOverMenu::loaded = false;
// Set our start values and load our menu textures if it's our first time at the screen.
GameOverMenu::GameOverMenu()
{
setCurrentSelection(0);
setChangedSelection(false);
setExiting(false);
beatScore = false;
setSelectedTextur... |
#ifndef _DX11_RENDER_WINDOW_H_
#define _DX11_RENDER_WINDOW_H_
#include "RenderTarget.h"
#include "d3d11.h"
namespace HW{
/** This class is used to store a render target as window
* A render window for dx11 has color and depth/stencil buf and their resourceView
* And the viewport
* @Remarks: This class ju... |
/* -*- 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.
*
* @author Arjan van Leeuwen (arjanl)
* @author Cihat Imamoglu (ci... |
๏ปฟ/*
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, ... |
// Solaris needs non-empty content so ensure
// we have at least one symbol
int Solaris_requires_a_symbol_here = 0;
|
#ifndef _FA_MONITOR_COMM_NAMEPIPE
#define _FA_MONITOR_COMM_NAMEPIPE
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <tchar.h>
#include "Comm.h"
#include "fmt.h"
class NamePipe : public Comm {
public:
NamePipe() : Comm(1) {}
NamePipe(char* pipename)
: Comm(1),
pipename_(pipe... |
#include "gtest/gtest.h"
#include "buddy/bdd.h"
// ::std
#include <iostream>
#include <vector>
#include <utility>
#include <limits>
#include <sstream>
#include <string>
#include <cstdlib>
#include <map>
#include <boost/cast.hpp>
#include <boost/static_assert.hpp>
// ::wali::domains::binrel
#include "wali/domains/b... |
#pragma once
#include<queue>
#include"phrasetable.h"
using namespace std;
void get_cmd(int argc, char *argv[]);
int turn_lowercase_and_WordLine_count(char *);
char *Get_phrase(char *str, int pos, int len);
void pos_word(char *str,queue<int>&);
int Get_end(char *str, int i);
void Data_output(phrasetable); |
// Program to reverse the string entered by the user.
// The user can enter any no. of strings that he/she wants to.
#include <iostream>
#include <vector>
using namespace std;
int main()
{ int n;
char c = '1';
string A;
while(c =='1')
{
cout<<"Enter the string"<<endl;
cin>>A;
n = A.length();
... |
#include <sys/stat.h>
#include "m6502/src/System.hxx"
#include "OSystem.hxx"
#include "atariemu.h"
#include <string>
#include <cstring>
namespace {
int fileExists(const char *filename)
{
struct stat buffer;
return (stat (filename, &buffer) == 0);
}
const int RAM_SIZE = 128;
const int PADDLE_DELTA=23000,... |
#include <octomap/octomap.h>
#include <octomap/ColorOcTree.h>
using namespace std;
using namespace octomap;
int main(int /*argc*/, char** argv) {
std::string filename(argv[1]);
std::ifstream infile(filename.c_str(), std::ios_base::in |std::ios_base::binary);
if (!infile.is_open()) {
cout << "file "<< fil... |
#if !defined(DM_PLATFORM_IOS)
extern "C" void siwa()
{
}
#endif
|
//
// user_types.hpp
// rod-cut
//
// Created by mndx on 26/10/2021.
//
#ifndef user_types_h
#define user_types_h
typedef struct optimum_cut_info {
int cut_index;
int max_rev;
} opt_cut_info;
typedef struct table_element {
bool is_set;
opt_cut_info optimum_cut_info;
} t_elem;
#endif /* user_types... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2000-2011 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 _COOKIE_MANAGER_H_
#define _COOKIE_MANAGER_H_
class Cook... |
#include "NhanVienVP.h"
NhanVienVP::NhanVienVP()
{
}
NhanVienVP::NhanVienVP(unsigned soNgayLamViec)
{
this->soNgayLamViec = soNgayLamViec;
}
NhanVienVP::~NhanVienVP()
{
}
long NhanVienVP::tinhLuong()
{
return soNgayLamViec * 100000;
}
void NhanVienVP::nhap()
{
NhanVien::nhap();
cout << "Nhap so ngay lam vie... |
#ifndef CAFFE_UTIL_MATH_FUNCTIONS_SPARSE_H_
#define CAFFE_UTIL_MATH_FUNCTIONS_SPARSE_H_
#include <stdint.h>
#include <cmath> // for std::fabs and std::signbit
#include <fstream>
#include <sstream>
#include "glog/logging.h"
#include "caffe/common.hpp"
#include "caffe/util/device_alternate.hpp"
#include "caffe/util/m... |
#pragma once
#define CONCAT(a,b) a##b
#define REGISTER_STARTUP_FUNCTION(name,function,order) static registeredfunctions::StartupFunction CONCAT(name,_startup)(#name,function,order)
#define REGISTER_SHUTDOWN_FUNCTION(name,function,order) static registeredfunctions::ShutdownFunction CONCAT(name,_shutdown)(#name,func... |
//
// main.cpp
// Lab 3 - Hybrid Car
//
// Created by Jesse Millar on 9/9/13.
// Copyright (c) 2013 Jesse Millar. All rights reserved.
//
#include <iostream>
#include <string>
using namespace std;
int milesPerYear;
double gasPrice;
double hybridCarCost;
int hybridMilesPerGallon;
double hybridResale;
double non... |
#ifndef STUDENTENVERWALTUNG_H
#define STUDENTENVERWALTUNG_H
#include <iostream>
#include <vector>
#include <student.h>
#include <fstream>
#include <string>
#include <stdlib.h>
using namespace std;
class Studentenverwaltung
{
public:
Studentenverwaltung();
void add(Student s){
studenten.push_back(... |
#pragma once
#include "common.h"
namespace StreamCompaction {
namespace CPU {
StreamCompaction::Common::PerformanceTimer& timer();
void scan(int n, int *odata, const int *idata);
int compactWithoutScan(int n, int *odata, const int *idata);
int compactWithScan(int n, int *odata, const int *idata);
... |
void main(){
clrscr();
printf("hello students");
getch();
} |
// Created on: 2001-01-04
// Copyright (c) 2001-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 Sof... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef COLUMN_H
#define COLUMN_H
#include "modules/widgets/OpBut... |
/*
* OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees
* https://octomap.github.io/
*
* Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg
* All rights reserved.
* License: New BSD
*
* Redistribution and use in source and binary forms, with or without
* modificat... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
double num, avg;
int pos = 0;
double sum = 0.0;
for(int i=0; i<6; i++)
{
cin>>num;
if(num>0)
{
pos++;
sum = sum+num;
}
}
avg = sum/pos;
cout<<pos<<" valores positivos\n";
... |
#ifndef GUIEVENTDISPATCHER_H_
#define GUIEVENTDISPATCHER_H_
#include <QObject>
#include <QImage>
#include <QMutex>
#include <QWaitCondition>
#include "StdIncl.hpp"
#include "Logger.hpp"
namespace uipf
{
namespace gui
{
enum GraphViewSelectionType {
NONE /*no selection (transparent)*/,
CURRENT /*t... |
/*
The MIT License (MIT)
Copyright (c) 2017 Paul Marc Liu
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 rights
to use, copy, modify, merge,... |
/**
* Copyright (c) 2007-2012, 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 ... |
#pragma once
#include <stdio.h>
#include "user_defined_functions.h"
#include <Windows.h>
#define STATUS_HIBERNATE 0x00
#define STATUS_SLEEP 0x20
#define STATUS_ON 0x40
#define STATUS_POWER 0x60
extern char ACK[5];
extern char NACK[10]; // both of these have been defined in the initACKNACK.cppS
extern HANDLE hSerial; /... |
#pragma once
#include "bricks/core/returnpointer.h"
#include "bricks/core/string.h"
#include "bricks/core/value.h"
#include "bricks/threading/threadlocalstorage.h"
#include <jni.h>
namespace Bricks { namespace Java {
class JClass;
namespace JniVersion {
enum Enum {
Unknown = 0,
JNI1_1 = JNI_VERSION_1_1,
... |
#include <iostream>
int gcd(int a, int b)
{
while (b)
{
a %= b;
std::swap(a, b);
}
return a;
}
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
int n;
std::cin >> n;
for (int i = 0; i < n; ++i)
{
int a, b;
std::cin >> a >> b... |
// Created on: 1995-10-19
// Created by: Bruno DUMORTIER
// 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 GN... |
#include <iostream>
#include <stdio.h>
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <conio.h>
#include <string.h>
using namespace std;
HANDLE console =GetStdHandle(STD_OUTPUT_HANDLE);
COORD CursorPosition;
inline void d()
{
unsigned long ms=(10);
Sleep( ms );
}
void title();
void game_start();... |
#include "MatrixFunctions.h"
#include "Matrix.h"
#include <algorithm>
#include <stdio.h>
#include <iostream>
using namespace MatrixFns;
//A library of functions that act on matrices
//template <typename T>
const char MatrixFns::MatrixFunctions::unstablePivot[] = "Pivot is < epsilon, result is unstable";
template ... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
//Adjaceny matrix:Use only for a small input sets not for 10 to the power 5********************
//declaration of adjaceny matrix
int adj[n][m];
//take edges as input
for(int i=0;i<m;i++){
int u,v;
cin>>u>>v... |
#pragma once
#include <openssl/conf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
//#include <openssl/applink.c>
#include <openssl/buffer.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <string>
#include <vector>
#include <chilkat\include\CkJavaKeyStore.h>
#include <chilkat\include\CkCert.h>
#inc... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Alexander Remen (alexr)
*/
#ifndef MAIL_PANEL_H
#define MAIL_P... |
#pragma once
#include "libpytorch.h"
std::ofstream debugfile("pytorchcpp.txt");
// have only used once or twice for debugging
std::mutex m; // to ensure Metatrader only calls on GPU
c10::TensorOptions dtype32_option = th::TensorOptions().dtype(th::kFloat32).requires_grad(false);
c10::TensorOptions dtype64_option = t... |
//////////////////////////////////////////////////////////////////////
///Copyright (C) 2011-2012 Benjamin Quach
//
//This file is part of the "Lost Horizons" video game demo
//
//"Lost Horizons" is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published ... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
// You have two lists of numbers, X and Y, each containing
// exactly N elements. You can optionally apply any number
// of circular shifts to each list. A circular shift means
// removing the last element from a list and re-inserting it
// before the first element. For exa... |
#include "outdecl.hpp"
void test_user2() {
out(6);
}
#include "out.cpp"
|
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include "client.h"
#include "Graph.h"
int main() {
std::string line;
int start = 0, end = 0, weight = 0, index = 1;
std::ifstream inputStream;
std::ofstream outputStream;
std::string file;
std::cout << "Enter the file... |
#pragma once
#include <string>
namespace BeeeOn {
/*
* @brief The class is intended to contain a specific
* ModuleType Type name.
*/
class CustomTypeID {
public:
enum {
MAX_LENGTH = 64
};
CustomTypeID();
CustomTypeID(const std::string &id);
std::string toString() const;
static CustomTypeID parse(const ... |
#ifndef VULKAN_IMAGE_INFO
#define VULKAN_IMAGE_INFO
#include "vulkan.h"
#include "macro.h"
class ImageInfo {
public:
ImageInfo();
ImageInfo(VkDevice& vkDevice);
ImageInfo(VkDevice& vkDevice, uint32_t width, uint32_t height);
virtual ~ImageInfo();
ImageInfo& operator=(ImageInfo other);
uint32_t width, heigh... |
//
// main.cpp
// Task2
//
// Created by Simon Burrows on 09/02/2015.
// Copyright (c) 2015 Simon Burrows. All rights reserved.
//
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <cmath>
#include <string.h>
#include <stdio.h>
using namespace std;
bool isNumber(string str);
... |
#include "Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40319)
#error "Mixed versions compilation."
#endif
/*
* TCP Client Base class, version 1.0.10
*
* Created June 9, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
*
*
* Permission is hereby granted, ... |
#include "vm.h"
VM::VM(const cmdline::parser &cmd, Ran &myran) {
Lx = cmd.get<double>("Lx");
Ly = cmd.exist("Ly") ? cmd.get<double>("Ly") : Lx;
v0 = cmd.get<double>("v0");
double rho0 = cmd.get<double>("rho0");
N = int(Lx * Ly * rho0);
eta = cmd.get<double>("eta");
extra_torque = cmd.get<double>("ext_tor... |
#pragma once
#include <vector>
#include <string>
#include <iostream>
using namespace std;
class Message {
private:
vector<string> subjectvec;
vector<string> datavec;
public:
// map<string, string> message; //map gets rid of duplicates though
void store(string subject, string data) {
subjectvec.push_b... |
#pragma once
#include <cstdint>
#include <vector>
#include <glm/glm.hpp>
class PixelMap
{
public:
PixelMap() = default;
PixelMap(std::vector<uint8_t> pixels, glm::ivec2 size);
const uint8_t* pixels() const;
const glm::ivec2& size() const;
private:
std::vector<uint8_t> mP... |
#include "DarkGDK.h"
#include "Buttons.h"
#include "Global.h"
//===============================================================================================================================================
// PAUSE BUTTON
//=============================================================================================... |
#include <iostream>
#include "vector.hpp"
int main() {
Vector myVec;
myVec.buildArr(10, 8);
int index = 5;
std::cout << index << "-th element is:\t" << myVec.getElem(index) << "\n";
index = 25;
myVec.getElem(index);
myVec.push(10);
myVec.push(10);
myVec.push(10);
myVec.push(10)... |
#include "Integrator.hpp"
int Base_interp::locate(const double x)
{
int ju, jm, jl;
if (n < 2 || mm < 2 || mm > n) {
wcout << "locate size error" << endl;
throw("locate size error");
}
bool ascnd = (xx[n-1] >= xx[0]);
jl = 0;
ju = n-1;
while (ju+jl > 1) {
jm = (ju+jl... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matt Olan
*
* 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 rights
* to use, co... |
#pragma once
#include "Interface/IRuntimeModule.h"
#include "Interface/IEvent.h"
#include "Event/Event.h"
#include "Utils/Timer.h"
#include "Utils/ThreadSafeQueue.h"
#include <entt/entt.hpp>
#include <functional>
#include <queue>
#include <list>
#include <map>
struct GLFWwindow;
constexpr uint16_t EVENTMANAGER_NUM_QU... |
#pragma once
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include"MemoryFile.h"
MemoryFile::MemoryFile(CString fileName)
{
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS /*CREATE_ALWAYS*/, FILE_ATTRIBUTE_NORMAL, NULL);
if ... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ncurses.h>
#include <string>
using namespace std;
int val[111], dem[111], n;
int temp, ind, maxCount;
void input() {
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &val[i]);
}
void ... |
/***********************************************************
Starter code for Assignment 3
This code was originally written by Jack Wang for
CSC418, SPRING 2005
implements scene_object.h
***********************************************************/
#include <cmath>
#include <iostream>
#... |
// Question 40 => Find the row with maximum number of 1s
#include<bits/stdc++.h>
using namespace std;
int row_with_max_ones(vector<vector<bool>> mat, int n, int m){
int j = m-1;
while(j>=0 && mat[0][j] == 1){
j--;
}
int row = 0;
for(int i=1; i<n; i++){
while(j>=0 && mat[i][j] == ... |
#ifndef MATRIX_H
#define MATRIX_H
#include <c++/cstdlib>
#include <c++/ostream>
#include <c++/iomanip>
#include "matrix_lib.h"
using namespace std;
namespace matrix {
template<typename T, size_t N, size_t M>
class Matrix {
public:
Matrix() {
for (int i = 0; i < N; ++i) {
... |
#include"vector.h"
void InputVector(double a[], int n)
{
for (int i = 0; i < n; i++)
{
cout << "\nNhap phan tu thu " << i + 1 << " trong vector: ";
cin >> a[i];
}
}
void OutputVector(double a[], int n)
{
for (int i = 0; i < n; i++)
{
cout << a[i] << " ";
}
cout << endl;
}
void multiVector(double a[], int... |
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdlib>
... |
#ifndef DNN_GEOMETRY_EUCLIDEAN_DYNAMIC_H
#define DNN_GEOMETRY_EUCLIDEAN_DYNAMIC_H
#include <vector>
#include <algorithm>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/vector.hpp>
#include <cmath>
#include <hera/common/infinity.h>
namespace hera
... |
// Created on: 2000-08-11
// Created by: Andrey BETENEV
// Copyright (c) 2000-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 a... |
#ifndef UTILS_PREPROCESS_H
#define UTILS_PREPROCESS_H
#include "string"
bool pick_option(std::vector<std::string>& args, const std::string& option);
std::string pick_option(std::vector<std::string>& args, const std::string& option, const std::string& default_value);
Parameters init_params(const std::string& file_para... |
#include <bits/stdc++.h>
#define loop(i,s,e) for(int i = s;i<=e;i++) //including end point
#define pb(a) push_back(a)
#define sqr(x) ((x)*(x))
#define CIN ios_base::sync_with_stdio(0); cin.tie(0);
#define ll long long
#define ull unsigned long long
#define SZ(a) int(a.size())
#define read() freopen("input.txt"... |
#ifndef _RAY_HH_
#define _RAY_HH_
#include "Vector3F.hh"
class Ray{
Vector3F orig;
Vector3F dir;
public:
Ray(const Vector3F &orig, const Vector3F &dir, bool normalize = true);
Vector3F get_orig(void) const;
Vector3F get_dir(void) const;
Vector3F getPointAtT(float t) const;
};
#endif /* _RAY_HH_ */
|
#pragma once
#include <QVariant>
#include <QString>
class NamedValue {
public:
// :: Lifecycle ::
NamedValue(const QString &name = QString(),
const QVariant &value = QVariant());
// :: Accessors ::
const QString &getName() const;
void setName(const QString &name);
const Q... |
#ifndef MENU_H
#define MENU_H
#include <string>
#include <vector>
#include <cstdlib>
#include "base_menu.h"
using namespace std;
class Menu : public BaseMenu
{
public:
class MenuIterator : public Iterator<BaseMenu*>
{
public:
MenuIterator(Menu *m)
{
_menu=m;
}
void first()... |
#include "femb.h"
#include <unistd.h>
#include <cstdio>
constexpr size_t CD_I2C_ADDR[] = { 0xA0010000, 0xA0040000, 0xA0050000, 0xA0060000, 0xA0070000, 0xA0080000, 0xA0090000, 0xA00A0000 };
// for all coldata chips
constexpr size_t CD_FASTCMD_ADDR = 0xA0030000;
io_reg_t FEMB::coldata_fast_cmd;
FEMB::FEMB(int _index)... |
#include "CombinedWorkspace.h"
int main( int arc, char* argv[] ) {
CombinedWorkspace combWS;
// combWS.SetModel( CombinedWorkspace::Model::Couplings12Cat );
// combWS.SetModel( CombinedWorkspace::Model::CouplingsInclusive );
combWS.CombineChannels();
return 0;
}
|
//programm polinom elder.cpp
#include <iostream.h>
#include <iomanip.h>
#include <math.h>
#include <cstdlib>
//#include <conio.h>
#include <stdio.h>
char pp;
void stop ()
{
cout << "Press any key & Enter to continue...";
cin >> pp;
// system("PAUSE");
return;
}
void error ()
{
cout << "You have typed an illigal va... |
#include <iostream>
#include <vector>
#include <string>
int main() {
std::vector<std::string> weekDays;
weekDays.push_back("Sund1ay");
weekDays.push_back("Monday");
weekDays.push_back("Tue58sday");
weekDays.push_back("Wed&nesday");
weekDays.push_back("Turs*day");
weekDays.push_back("Fr##ida... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <quic/common/BufAccessor.h>
namespace quic {
SimpleBufAccessor::SimpleBufAccessor(size_t capacity)
: buf_(folly::IO... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef VEGA_H
#define VEGA_H
#ifdef ... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
#include<deque>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
#define inf 9999
void Init_TreeNode(TreeNode** T, vector<int>& vec, int& pos)
{
if (vec... |
#include "BattleManager.h"
#include "MPLogger.h"
MP_SINGLETON_IMPLEMENT(BattleManager)
BattleManager::BattleManager() : meplay::MPThread("BattleThread")
{
}
BattleManager::~BattleManager()
{
}
void BattleManager::Run()
{
while (!IsThreadFinal())
{
m_tLastTime.Now();
UpdateBattle();
auto mil... |
#include <catch2/catch.hpp>
#include <replay/vector_math.hpp>
TEST_CASE("Non-colinear lines intersect")
{
replay::line2 lhs({ 0.f, 1.f }, { 1.f, -1.f });
replay::line2 rhs({ 1.f, -2.f }, { -1.f, 0.f });
auto intersection = intersect_planar_lines(lhs, rhs);
SECTION("And the intersection is valid")
... |
#include "creator.h"
Creator::Creator(int productType)
: productType(productType)
{
}
Creator::~Creator(void)
{
}
int Creator::getProductType(void)
{
return productType;
}
|
// ่ฟๆฎตไปฃ็ ๅ่ชpojๆ้ข็ฎ๏ผไบๅ็ญๆกๅ๏ผ้ช่ฏๆฏๅฆๅญๅจ่ดๆ็ฏ
// ่พนๆ็่ฎก็ฎๆฏๅฝๅไปทๆ ผๅๅป่ดง็ฉ็ไปทๆ ผ๏ผๅไนไธไธชไปไนใ
bool negloop(int beg,int wealth)
{
qtail = 1;
q[++qhead] = beg;
dist[beg] = wealth;
while(qhead >= qtail)
{
int now = q[qtail++];
inq[now] = 0;
for(node * p =head[now];p;p=p->next)
{
double len =... |
#include "jpeg_persister.h"
#include "../include/jpgd.h"
#include "../include/jpge.h"
namespace persistence {
model::Image *JpegPersister::load(const std::string &fileName) {
int width, height, composition;
core::byte *pixels = jpgd::decompress_jpeg_image_from_file(
fileName.c_str(), &width, &height, &compo... |
/**
* @file responderbluetooth.cpp
*
* @brief Bluetooth responder system
* @version 0.1
* @date 2021-08-27
*
* @copyright Copyright (c) 2021
*
*/
#include "responderbase.h"
class BluetoothResponder : public ResponderBase {
public:
private:
}; |
int _index=0;
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print(_index++);
Serial.print("\n");
delay(500);
}
|
#ifndef _FMT_FORMAT_HPP_
#define _FMT_FORMAT_HPP_
#include <climits>
#include <stdexcept>
#include <string.h>
#include <fmt/flag.hpp>
#include <fmt/itoa.hpp>
namespace fmt {
class InvalidFormatString : public std::invalid_argument {
public:
InvalidFormatString(const std::string& msg = "") : std::invalid_argument(... |
#pragma once
#include <mutex>
#include <list>
namespace iberbar
{
// ๆถๆฏ้ๅ
// ็บฟ็จๅฎๅ
จ
template < typename TMsg, typename TAllocator = std::allocator<TMsg> >
class TMsgQueue
{
public:
TMsgQueue();
TMsgQueue( const TAllocator& Al );
TMsgQueue( const TMsgQueue& Queue ) = delete;
~TMsgQueue();
public:
// ๆทป... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.