text stringlengths 3.08k 12.5k |
|---|
#include "../include/MyoCpp.hpp"
#include <fann.h>
#include <chrono>
#include <cstdlib>
void EventWorker(int event);
int main(int argc, char** argv)
{
if(argc<2) {
std::cout << "Usage: <indragon> [port]" << std::endl;
return 0;
}
std::string myoPort(argv[1]);
MyoCpp::MyoRaw myo(myoPort);
std::recursive_mu... |
/*
VGA Oscilloscope demo.
Connect a microphone or something like it to ANALOG_PIN (0V -- 3.3V
only; 0.2V -- 3.1V will probably look nicer); an attached VGA
monitor will display the signal roughly in real-time.
The thick blue line corresponds roughly to 0V.
This is a fairy crude hack, but it's fu... |
// See LICENSE_CELLO file for license and copyright information
/// @file enzo_EnzoInitialSedovArray3.cpp
/// @author <NAME> (<EMAIL>)
/// @date Tue Jan 4 19:30:35 PST 2011
/// @brief Implementation of an array of Sedov problems, one per Block
///
/// This problem is designed for weak-scaling studies. E... |
#include <GL/glut.h>
#include <stdlib.h>
// prototipos das funcoes
void init(void);
void display(void);
void keyboard(unsigned char key, int x, int y);
void mouse(int botao, int state, int x, int y);
// Variaveis de controle
int is_preenchido = 0;
// funcao principal
int main(int argc, char** argv){
glutInit(&argc... |
/*
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2019 <NAME>
*/
#include <vector>
#include <iostream>
#include <fstream>
#include <chrono>
#include "../../... |
#include "ResourceModel.h"
#include "Application.h"
#include "ModuleFileSystem.h"
#include "ModuleResourceManager.h"
RESOURCE_DEFINITION(Resource, ResourceModel);
ResourceModel::~ResourceModel()
{
for (auto iter = nodes.begin(); iter != nodes.end(); ++iter)
{
RELEASE_ARRAY((*iter)->name);
}
}
const char * Resou... |
// Copyright 2017 The Dawn Authors
//
// 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 t... |
//
// 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 conditions and the following disclaimer.
// * Redistributions in bin... |
//
// BillboardOverlay.cpp
//
//
// Created by Clement on 7/1/14.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "Application.h"
#include "GeometryUtil.h"
#include "P... |
#include <SDL.h>
#include <render/graphics.hpp>
#include <gui/imgui.hpp>
#include <game/map.hpp>
#include <render/camera.hpp>
#include <utils/utils.hpp>
#include <utils/input.hpp>
#include <data/data.hpp>
#include <data/text.hpp>
#include <utils/config.hpp>
#include <gui/gui.hpp>
#include <thread>
#include <utils/excep... |
#ifdef NO_INCLUDE_DIR
#include "tm_svr_communication.h"
#include "tm_print.h"
#else
#include "tm_driver/tm_svr_communication.h"
#include "tm_driver/tm_print.h"
#endif
#include <functional>
//
// TmSvrCommunication
//
TmSvrCommunication::TmSvrCommunication(const std::string &ip,
int recv_buf_len, std:... |
//
// COFF object format section data implementation
//
// Copyright (C) 2002-2008 <NAME>
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// ... |
/* 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, publish, distribute, sublicense, and/or sell
*... |
//-----------------------------------------
// (c) Reliable Software 1998 -- 2004
//-----------------------------------------
#include "precompiled.h"
#include "MailReader.h"
#include "SimpleMapiEx.h"
#include <LightString.h>
#include <File/Path.h>
#include <File/File.h>
#include <File/SafePaths.h>
#include <Dbg/Asse... |
// This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation... |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test
// Copyright (c) 2012 <NAME>, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to 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)
#incl... |
/*
Copyright 2020 Mauronofrio
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This file is distributed in the hope that it ... |
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/viz/vizcore.hpp>
#include <kfusion/kinfu.hpp>
#include <io/capture.hpp>
using namespace kfusion;
struct KinFuApp
{
static void KeyboardCallback(const cv::viz::KeyboardEvent& event, void* pthis)
... |
/*
* Copyright (C) 2005 - 2012 MaNGOS <http://www.getmangos.com/>
*
* Copyright (C) 2008 - 2012 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2006 - 2012 ScriptDev2 <http://www.scriptdev2.com/>
*
* Copyright (C) 2010 - 2012 ProjectSkyfire <http://www.projectskyfire.org/>
*
* Copyright (C) 2011 - 2012... |
#include "config.h"
#include "bone_geometry.h"
#include "OBJ_Loader.h"
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <glm/gtx/io.hpp>
#include <glm/gtx/transform.hpp>
/*
* For debugging purpose.
*/
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
siz... |
#include <iostream>
#include <fstream>
#include <boost/asio.hpp>
#include <discordpp/bot.hh>
#include <discordpp/plugin-overload.hh>
#include <discordpp/rest-beast.hh>
#include <discordpp/websocket-beast.hh>
#include <discordpp/plugin-responder.hh>
#include <discordpp/plugin-pretty.hh>
namespace asio = boost::asio;
... |
#pragma once
#include "very_strong_typedef.hxx"
#include "vec3f.hxx"
namespace Color
{
using Scalar = double; // TODO: Use float?
struct tag_RGBScalar {};
using RGBScalar = very_strong_typedef<Scalar, tag_RGBScalar>;
//https://codereview.stackexchange.com/questions/49502/user-defined-string-literals-and-namespace-u... |
// Copyright 2017 Yahoo Inc.
// Licensed under the terms of the Apache 2.0 License. See LICENSE file in the project root for terms.
#include "statswriter.h"
#include "options.h"
#include "protocol.h"
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <arpa/inet.h>
#include <netdb.h>
#in... |
// BrennerPotential.cpp - Asap implementation of the Brenner Potential.
//
// Copyright (C) 2010-2011 <NAME> and Center for Individual
// Nanoparticle Functionality, Department of Physics, Technical
// University of Denmark. Email: <EMAIL>
//
// This file is part of Asap version 3.
//
// This program is free software:... |
// https://learnopengl-cn.github.io/01%20Getting%20started/04%20Hello%20Triangle/
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <cstdio>
#pragma comment(lib, "glfw3.lib")
char const* vertexSS = "#version 430 core\n"
"layout (location = 0) in vec3 pos;\n"
"void main()\n"
"{ gl_Position = vec4(pos.x, pos.y, ... |
#include "DepthSource.h"
DepthSource::DepthSource()
{
width = 0;
height = 0;
backPixels = NULL;
currentPixels = NULL;
deviceMaxDepth = 0;
doDoubleBuffering = true;
#ifdef TARGET_OPENGLES
doDoubleBuffering = false;
#endif
doRawDepth = false;
isOn = false;
nearClipping=400;
farClipping=4000;
}
bool Dept... |
#include "main.h"
#include "can.hpp"
#include "slcan.hpp"
#include "led.h"
#include "usb_device.h"
#include "usbd_cdc_if.h"
extern CAN_HandleTypeDef hcan;
CAN_FilterTypeDef filter;
uint32_t prescaler = 2;
enum can_bus_state bus_state;
CAN_RxHeaderTypeDef rx_header;
uint8_t rx_payload[CAN_MTU];
uint32_t status;
uint8_... |
#include "mainwindow.h"
#include <QApplication>
#include <programa.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <shared_mutex>
#include <semaphore.h>
#include <fstream>
#include <iostream>
#include <QJsonObject>
#include <QString>
#include <QJsonDocument>
#include <QJso... |
/*
* marker2others.cpp
* save an image's markers to other formats
*
* Created by <NAME>, 2012-07-02
*/
#include "v3d_message.h"
#include "marker2others_plugin.h"
#include <vector>
#include <iostream>
using namespace std;
Q_EXPORT_PLUGIN2(marker2others, Marker2OthersPlugin);
//
void marker2others(V3DPlugin... |
/* Copyright 2017 - BSD-3-Clause
*
* Copyright Holder (alphabetical):
*
* Beikirch, Maximilian
* Cramer, Simon
* Frank, Martin
* Otte, Philipp
* Pabich, Emma
* Trimborn, Torsten
*
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* followin... |
/**
* @file client.cpp
* @author <NAME>
*
* @brief CORBA C++11 client application
*
* @copyright Copyright (c) Remedy IT Expertise BV
*/
#include "testC.h"
#include "testlib/taox11_testlog.h"
template<typename T> void swap(T& a, T& b)
{
// swap (explicit move)
T&& temp = std::move(a);
a = std::mov... |
#include "Enigma.h"
#include <algorithm>
#include <random>
#include <sstream>
Enigma::Enigma(const std::array<int, NUMBER_OF_ROTORS_INSTALLED>& rotorNumbers, const std::array<int, NUMBER_OF_ROTORS_INSTALLED>& rotorStartingPos, const std::array<int, NUMBER_OF_ROTORS_INSTALLED>& rotorRingSettings,
... |
#include<bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ii = pair<int,int>;
using ll = long long;
using llu = unsigned long long;
const int INF = numeric_limits<int>::max();
class TheKingsFactorization {
vector<ll> low_primes;
void sieve() {
bitset<50000> b;
b.reset();
lo... |
#include "nstep_replay_mem_prioritized.h"
#include <cassert>
#include <algorithm>
#include <time.h>
#include <math.h>
#define max(x, y) (x > y ? x : y)
#define min(x, y) (x > y ? y : x)
Data::Data()
{
}
LeafResult::LeafResult()
{
}
SumTree::SumTree(int _capacity){
capacity = _capacity;
tree.resize(2 * cap... |
#include <iostream>
#include <boost/thread.hpp>
#include "server.h"
#include "mulawdecoder.h"
#include "mulawencoder.h"
Server::Server() :
serverAddress(getIP()),
serverPort(8001),
acceptor(service, tcp::endpoint(serverAddress, serverPort)),
buff(5),
runningFlag(true),
backgroundFlag(true),
incomingCallFlag(... |
/* Copyright (c) 2003-2005 MySQL AB
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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHO... |
#include "zynq_driver.h"
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
//#define ZYNQ_BASE_PADDR 0x43C00000L
#define ZYNQ_BASE_PADDR 0xA0000000L
#define TSI_OUT_FIFO_DATA 0x00
#define TSI_OUT_FIFO_COUNT 0x04
#define TSI_IN_FIFO_DATA 0x08
#def... |
#include "BitmapFont.h"
#include <cstdlib>
#include <cmath>
#include <fastmath.h>
#include "starlight/_incLib/json.hpp"
using nlohmann::json;
using starlight::Vector2;
using starlight::VRect;
using starlight::Color;
using starlight::gfx::BitmapFont;
//using starlight::gfx::BitmapFont::CharInfo;
BitmapFont::BitmapF... |
/*
* Copyright 2010 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkPDFCatalog.h"
#include "SkPDFTypes.h"
#include "SkStream.h"
#include "SkTypes.h"
SkPDFCatalog::SkPDFCatalog(SkPDFDocument::Flags flags)
... |
/*
MS5xxx.h - Library for accessing MS5xxx sensors via I2C
Copyright (c) 2012 <NAME>
This file is part of arduino-ms5xxx.
arduino-ms5xxx 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, ei... |
#include <Uart/Uart.hpp>
#include <Timer/Timer.hpp>
#include <VectorTableManagement.hpp>
#include <Pi.hpp>
#include <RealTimeTask.hpp>
#include <cassert>
#include <sstream>
#include <cstdio>
#include <Uart/c_uart.hpp>
#include "ImageData.hpp"
#include <iterator>
using namespace uart;
using namespace Time;
namespace ... |
/// @file
///
/// Copyright <NAME>.
/// 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 <eagine/main_ctx.hpp>
#include <eagine/main_fwd.hpp>
#include <eagine/oglplus/gl.hpp>
#include <eagine/oglplus/u... |
// Copyright (C) 2020 <NAME> (Mynk-9)
#include <iostream>
#include <fstream>
#include <string>
#include <filesystem>
#include <chrono>
#include <windows.h>
#include <libloaderapi.h>
namespace fs = std::filesystem;
// dynamically loading libraries
HINSTANCE UrlMon = LoadLibraryA("urlmon.dll");
HINSTANCE WinInet = Lo... |
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define FZ(n) memset((n),0,sizeof(n))
#define FMO(n) memset((n),-1,sizeof(n))
#define F first
#define S second
#define PB push_back
#define ALL(x) begin(x),end(x)
#define SZ(x) ((int)(x).size())
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ... |
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trad... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the "License");
* you m... |
/////////////////////////////////////////////////////////////////
//
// Copyright <NAME> 2011-2012.
// 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 <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include "CmpGlobl.h"
#include "ListADT.h"
#include "F4Vu.h"
#include "APITypes.h"
#include "Objectiv.h"
#include "Strategy.h"
#include "Unit.h"
#include "Find.h"
#include "Path.h"
#include "ASearch.h"
#include "Campaign.h"
#include "Update.h"
#include "f4vu.h"... |
/**
* This file is part of the CernVM File System.
*/
#include "cvmfs_config.h"
#include "file_chunk.h"
#include <cassert>
#include "murmur.hxx"
#include "platform.h"
using namespace std; // NOLINT
static inline uint32_t hasher_uint64t(const uint64_t &value) {
return MurmurHash2(&value, sizeof(value), 0x07387... |
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "setupglew.h"
#include <GL/gl.h>
#include <GL/glu.h>
#include <tiffio.h>
#include "orientation.h"
#include "light.h"
#include "texture.h"
#include "texturecoord.h"
#include "material.h"
#include "drawable.h"
#include "triangles.h"
#include "primitives.h... |
//========================================================================================
//
// $File: //ai/ai13/devtech/sdk/public/samplecode/ADMNonModalDialog/Source/menuHandler.cpp $
//
// $Revision: #6 $
//
// Copyright 1987-2007 Adobe Systems Incorporated. All rights reserved.
//
// NOTICE: Adobe permits... |
/*
* This kernel performs spgemm.
* =========================== Feature : =========================
* Using inner-product method;
* Dense matrix non-transposed;
* Distributes Dense matrix columns to tiles;
* Not implementing any optimization;
* Could support arbitrary matrix size;
* Returns output as sparse ma... |
#include <weh.h>
#include "loli_island.h"
int LOLI_AUTOWRITE_LEN ;
bool LOLI::AutoWrite(const QString &file,const QString &text)
{
QFile f( file ) ;
bool s = LOLI::AutoWrite(&f,text,"UTF-8") ;
f.close();
return s ;
}
bool LOLI::P_OpenFile(QFile *file)
{
if( !file->isOpen() && !file->open(QFile::... |
/*
* Modification History
*
* 2000-December-13 <NAME>
* Created.
*
* 2001-January-11 <NAME>
* Added missing sleep() implementation.
*
* 2002-March-27 <NAME>
* Added support for gprof-friendly thread wrappers.
* Fixed a compile bug when gprof threads disabled.
*
* 2002-August-5 <NAME>
* Removed an u... |
/*
* Copyright (c) 2013, <NAME>
* 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 conditio... |
#include <Gosu/Color.hpp>
#include <Gosu/Math.hpp>
#include <cmath>
#include <algorithm>
namespace
{
struct HSV { double h, s, v; };
HSV color_to_hsv(const Gosu::Color& c)
{
double r = c.red / 255.0;
double g = c.green / 255.0;
double b = c.blue / 255.0;
double... |
#include "stdafx.h"
#include "CEditWithButtons.h"
void CEditWithButtons::AddMoreButton(std::function<void()> f) {
AddButton(L"more", f, nullptr, L"\x2026");
}
void CEditWithButtons::AddClearButton(const wchar_t * clearVal, bool bHandleEsc) {
std::wstring clearValCopy(clearVal);
auto handler = [this, clearValCopy] ... |
/*
The MIT License (MIT)
Copyright (c) 2015-2021 <NAME> <<EMAIL>>
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... |
#include "NPC.h"
//static objects
std::vector<Character> NPC::characters;
NPC::NPC(Texture textureNumber, float switchTime, float speed, std::string name, sf::Vector2u startingPosition, sf::RenderWindow *window) {
this->window = window;
this->name = name;
this->switchTime = switchTime;
setTextureAndAnimation(text... |
#include "SFApp.h"
SFApp::SFApp(std::shared_ptr<SFWindow> window) : fire(0), timer(0), Timer(0), is_running(true), sf_window(window) {
int canvas_w, canvas_h;
SDL_GetRendererOutputSize(sf_window->getRenderer(), &canvas_w, &canvas_h);
app_box = make_shared<SFBoundingBox>(Vector2(canvas_w, canvas_h), canvas_w, ca... |
/* $Id: ExpressionDatatypeFilter.cpp,v 1.10 2013/04/08 07:37:12 severin Exp $ */
/***
NAME - EEDB::SPStreams::ExpressionDatatypeFilter
SYNOPSIS
DESCRIPTION
a variation on MergeStream, but designed to be a primary source made up of many
component databases (for example a collection of OSCFileDB). Allows one to
cre... |
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include <windows.h>
#include "tcpsocket.h"
#include "IThreadedTCPSocket.h"
#include "ThreadedTCPSocketEmu.h"
#include "Th... |
#include <iostream>
#include "args.hxx"
#include "seqiter.hpp"
#include "wflign_edlib.hpp"
#include "wflign_wfa.hpp"
void parse_file_list(const std::string& file,
std::vector<std::string>& files) {
std::ifstream in(file);
if (in.fail()) {
std::cerr << "[wflign::main] error, could n... |
// -*- C++ -*-
//
// Entry point
//
// Author: <NAME> <<EMAIL>>
//
#include <iostream>
#include <fstream>
#include "fixrgraphiso/serialization.h"
#include "fixrgraphiso/acdfg.h"
//#include "fixrgraphiso/iso.h"
#include "fixrgraphiso/ilpApproxIsomorphismEncoder.h"
#include "fixrgraphiso/isomorphismResults.h"
using nam... |
// =============================================================================
//
// Copyright (c) 2009-2016 <NAME> <http://christopherbaker.net>
//
// 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 th... |
#include "L1Trigger/RPCTriggerPrimitives/plugins/PrimitivePreprocess.h"
PrimitivePreprocess::PrimitivePreprocess(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iConsumes)
: rpcToken_(iConsumes.consumes<RPCDigiCollection>(iConfig.getParameter<edm::InputTag>("Primitiverechitlabel"))),
processorvect... |
//
// Copyright (C) 2002-2003 NVIDIA
//
// File: cgfxFindImage.cpp
//-
// ==========================================================================
// Copyright 1995,2006,2008 Autodesk, Inc. All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk
// license agreement provid... |
// "Copyright [2017] <<NAME>>"
/** @file dijkstraPQ.cpp
* @brief This dijkstraPQ.cpp is an implementation of finding shortest
* path among the point cloud. The algorithm refer to here:
* http://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-using-priority_queue-stl/
*
* @author <NAME> (michael081906)
... |
#include <starpu.h>
#include <fstream>
#include <array>
#include <random>
#include <mutex>
#include <iostream>
#include <map>
#include <memory>
#include <atomic>
#include "common.hpp"
/**
* Compile with something like
* icpc -I${HOME}/Softwares/hwloc-2.2.0/install/include -I${HOME}/Softwares/starpu-1.3.2/install/i... |
//-----------------------------------------------------------------------------
//
// SensorAlarm.cpp
//
// Implementation of the Z-Wave COMMAND_CLASS_SENSOR_ALARM
//
// Copyright (c) 2010 <NAME> <<EMAIL>>
//
// SOFTWARE NOTICE AND LICENSE
//
// This file is part of OpenZWave.
//
// OpenZWave is free software: you can ... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
using namespace std;
const int MAX = 1000;
const int INF = 987654321;
int path[MAX][MAX];
int graph[MAX][MAX];
int otherVal[MAX][MAX];
int otherVal2[MAX][MAX];
vector<int> tmp;
vector<int> stations;
void findPath(int from, int to) {
int pr... |
/* -*- mode:C++; indent-tabs-mode:nil; -*- */
/* MIT License -- MyThOS: The Many-Threads Operating System
*
* 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, includi... |
/*
Exercise 21.11 & 21.12 (pg. 896)
Exercise 21.11 (Hangman Game):
Plays the game Hangman: From a list of words, pick one and display the following:
Guess the word: XXXXXX
Each X represents a letter and the user tries to guess the letters in the word.
When the user guesses a letter an appropriate response is give... |
/*
* Librarian for KiCad, a free EDA CAD application.
* The dialog with the templates for new components.
*
* Copyright (C) 2013-2016 CompuPhase
*
* 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... |
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2002 Ramshankar (aka Teknomancer).
// Copyright (c) 2011 <NAME>.
// All rights reserved.
#include "ProgressWindow.h"
#include "AppConstants.h"
#include "Archiver.h"
#include "BarberPole.h"
#include "BitmapPool.h"
#include "CommonStrings.h"
#include "MsgConstant... |
// contributed by <NAME>, CSCS, 2019-10
#include <iostream>
#include <cstdlib>
#include <chrono>
#include <stdlib.h>
#include <functional>
#include <vector>
#include <thread>
#include <memory>
#include <string>
#include <chrono>
#include <functional>
#include <sched.h>
#include <pthread.h>
template <class Callable>
... |
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
... |
/**
* Copyright (C) 2018 <NAME>
* All rights reserved.
*
* 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... |
// http://acm.tju.edu.cn/toj/showp2886.html - ACCEPTED
#ifdef ONLINE_JUDGE
#include <bits/stdc++.h>
#else
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <stri... |
/** @file
MODULE : StreamSwitcher
TAG : SS
FILE NAME : StreamSwitcher.cpp
DESCRIPTION : A class to handle switching between two independent streams
produced by SwitchCodecs. The output is a single codec
stream.
REVISION HISTORY :
COPYRIGHT : (c)CSIR, Merak... |
#include <iostream>
#include <cassert> //para generar los mensajes de error
using namespace std;
template <typename T> class myvector {
private:
T *storage; // puntero donde vamos a crear el arreglo incial en el vector
int size;
int capacity;
void resize() { // aumenta el tamaño del arreglo cuando el pushbac... |
#include "cavs/frontend/cxx/sym.h"
#include "cavs/frontend/cxx/graphsupport.h"
#include "cavs/frontend/cxx/session.h"
#include "cavs/proto/opt.pb.h"
#include <iostream>
#include <fstream>
#include <vector>
#include "common.h"
using namespace std;
DEFINE_bool(mem, false, "Mem profiling");
DEFINE_int32(batch_size, 1,... |
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
#include "meiyancpp.h"
String cascadeName = "haarcascade_frontalface_alt2.xml";//人脸的训练数据
bool isDetected = false;
bool isFace = false;
//int main(int argc, const char** argv)
//{
// Mat image;
// CascadeClassifier cascade;//创建级联分类器对象
// d... |
// Copyright 2012 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 "config.h"
#include "CCActiveAnimation.h"
#include "CCAnimationCurve.h"
#include "TraceEvent.h"
#ifdef LOG
#undef LOG
#endif
#include "base/str... |
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <time.h>
#include <unistd.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
struct buffer_object {
uint32_t width;
uint32_t height;
uint32_... |
/**************************************************************************
*
* Copyright 2011 <NAME>
* Copyright 2010 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to d... |
//
// main.cpp
// TSHttpServer
//
// Created by zhaoxy on 14-4-19.
// Copyright (c) 2014年 tsinghua. All rights reserved.
//
#include <iostream>
#include <set>
#include "CHttpRequest.h"
#include "CHttpResponse.h"
#include <signal.h>
#include <sys/select.h>
#include <unistd.h>
#include <sys/socket.h>
#include <neti... |
#include "extra.h"
void setSocketToNonBlock(const int sockfd)
{
int flags = fcntl(sockfd, F_GETFL);
if(flags == -1)
{
perror("fcntl() error");
exit(1);
}
flags = flags | O_NONBLOCK;
flags = fcntl(sockfd, F_SETFL, flags);
if(flags == -1)
{
perror("fcntl() error");
exit(1);
}
}
int create_socket(int po... |
#include "neal2_algorithm.h"
#include <Eigen/Dense>
#include <memory>
#include <stan/math/prim/fun.hpp>
#include <vector>
#include "marginal_state.pb.h"
#include "src/hierarchies/base_hierarchy.h"
#include "src/hierarchies/dependent_hierarchy.h"
#include "src/mixings/base_mixing.h"
#include "src/mixings/dependent_mix... |
#include "common.hpp"
#include <three/cameras/perspective_camera.hpp>
#include <three/core/geometry.hpp>
#include <three/materials/particle_basic_material.hpp>
#include <three/objects/particle_system.hpp>
#include <three/renderers/renderer_parameters.hpp>
#include <three/renderers/gl_renderer.hpp>
#include <three/scen... |
#include "../inc/Pinsetup.h"
#include <Arduino.h>
#include "../inc/Sensor.h"
// Receiver value of ambient light
int ambientLeft;
int ambientFrontLeft;
int ambientRight;
int ambientFrontRight;
// Receiver value raw
int rawLeft;
int rawFrontLeft;
int rawRight;
int rawFrontRight;
//True value of receiver readings
int T... |
#include "slideBar.h"
float slideBar::grabX = 0.0f;
void slideBar::init( float x, float y, float W, float H, const sf::Text& Title, float val_min, float val_max, float init_val, float* p_val )
{
mseOver = sel = false;
pos.x = x; pos.y = y;
// buttonRect
sz.x = W; sz.y = H;
initButtRects( R, W, H... |
/*
* hexdump
*
* A simple executable to show the contents of a file, or the input stream as hex. This is
* somewhat similar to the Linux hexdump utility, but is not intended to be a full reproduction,
* start with the basics and build on it from there as I find reason to.
*
* MIT License
*
* Copyright (c) 2020... |
/* -----------------------------------------------------------------------------------
*
* File Sprite.cpp
* Ported By <NAME>
* Contact <EMAIL>
*
* -----------------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XM... |
/**
@file Ordenaci�n por mezcla
*/
#include <iostream>
using namespace std;
#include <ctime>
#include <cstdlib>
#include <climits>
#include <cassert>
/* ************************************************************ */
/* M�todo de ordenaci�n por mezcla */
/**
@brief Ordena un vector por el m�todo de... |
#include <vector>
#include <random>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <algorithm>
#define MAX_TRIES 1000 /* maximum tries to add an edge */
enum community_type {NON_PROTECTED = 0, PROTECTED};
typedef struct {
std::vector<int> neighbors;
community_type community;
} ... |
#include <string.h>
#include "Common.h"
#include "Table.h"
#include "Seq.h"
void PrintUsage();
double Similarity(const char *seq1, const char *seq2, const int len)
{
int i, c;
c=0;
for( i=0; i < len; i++ )
{
if(seq1[i] != seq2[i])
c++;
}
return 1.0 - (double(c)/double(len));
}
void PrintBetter(char *st... |
/*
Copyright © 2014-2016 by The qTox Project Contributors
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre 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 versi... |
int rgb2hsv(int red, int grn, int blu);
int getKeypointHue(cv::KeyPoint keyPt, cv::Mat frame);
cv::Vec3b hsv2rgb(int hue);
//Create Blob Tracker
cv::Ptr<cv::SimpleBlobDetector> create_tracker(){
cv::SimpleBlobDetector::Params params;
params.minThreshold = 1;
params.maxThreshold = 255;
params.filterByA... |
//
// Created by <NAME> on 2019-07-13.
//
//#include <SPI.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include "oled_display.h"
#include "global_configs.h"
#include "wifi_handler.h"
#include "mqtt_client.h"
// time durations to display information
unsigned long dataInterval = 60000;
unsigned long serverInterv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.