text stringlengths 3.08k 12.5k |
|---|
// Copyright (c) 2020 The BCZ Core Developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chain.h"
#include "main.h"
#include "stakeinput.h"
#include "wallet/wallet.h"
//Normal Stake
bool CBczStake::InitFromTxIn(... |
// =================================================================
// Copyright (C) 2020 Hochschule Karlsruhe - Technik und Wirtschaft
// This program and the accompanying materials
// are made available under the terms of the MIT license.
// =================================================================
// Author... |
/*
* TheXTech - A platform game engine ported from old source code for VB6
*
* Copyright (c) 2009-2011 <NAME>, original VB6 code
* Copyright (c) 2020-2021 <NAME> <<EMAIL>>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "... |
/*
Proxy.cpp - Library to control a generic proxy object prototype
Created by <NAME>, April 24, 2016.
*/
#include "Arduino.h"
#include "Proxy.h"
Proxy *Proxy::_activeProxy;
Proxy::Proxy(int stepsPerRevolution, int stepperPort, int stepperMode, int buttonPin, void(*beep)(int), void(*light)(int))
{
Serial.printl... |
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2017 Couchbase, Inc.
*
* 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
*
* ... |
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <CNGui/CNGui.hpp>
#include <random>
#include <chrono>
#include <time.h>
#include <stdio.h>
#include <windows.h>
#include <dwmapi.h>
#include... |
#include "capture.h"
#include <QString>
#include <QVector>
static const char *const names[16] = {
"black",
"red",
"green",
"yellow",
"blue",
"magenta",
"cyan",
"white",
"bright black",
"bright red",
"bright green",
"bright yellow",
"bright blue",
"bright magenta... |
//
// repo_list_vm.cpp
// mx3
//
// Created by <NAME> on 5/19/15.
//
//
#include "repo_list_vm.hpp"
#include "../github/client.hpp"
#include "../sqlite/sqlite.hpp"
#include "../sqlite_query/query_diff.hpp"
#include <iostream>
#include <thread>
using mx3_gen::RepoListVmObserver;
using mx3_gen::RepoListVmCell;
name... |
#include <glog/logging.h>
#include <algorithm>
#include <fstream>
#include <iostream>
#include "proto/job.pb.h"
#include "proto/singa.pb.h"
#include "utils/cluster_rt.h"
#include "utils/common.h"
singa::SingaProto global;
const int SUCCESS = 0;
const int ARG_ERR = 1;
const int RUN_ERR = 2;
// show log dir in global c... |
//===- ExportQuartusTcl.cpp - Emit Quartus-flavored Tcl -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
#include <iomanip>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <iostream>
#include <typeinfo>
#include <boost/lexical_cast.hpp>
using Clock = std::chrono::high_resolution_clock;
using std::cout;
using std::cerr;
using std::endl;
auto makeNumbe... |
/* Copyright (c) 2005, Regents of Massachusetts Institute of Technology,
* Brandeis University, Brown University, and University of Massachusetts
* Boston. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condit... |
// license:BSD-3-Clause
// copyright-holders:<NAME>, <NAME>
/*************************************************************************
Kyuukoukabakugekitai - Dive Bomber Squad
*************************************************************************/
#include "emu.h"
#include "includes/divebomb.h"
#include "vide... |
// ************************************************************************** //
//
// Model-view-view-model framework for large GUI applications
//
//! @license GNU General Public License v3 or higher (see COPYING)
//! @authors see AUTHORS
//
// ********************************************************************... |
// A toy implementation of the RSA algorithm.
// Use -std=c++20.
#include "miller-rabin.h"
#include <cmath>
#include <iostream>
#include <numeric>
#include <utility>
#define assert(X) do { if (!(X)) std::abort (); } while(0)
using key_type = long int;
using key_pair = std::pair<key_type, key_type>;
/* The ring of i... |
#include <iostream>
#include <armadillo>
#include <cmath>
#include <cstdlib>
#include <time.h>
#include <fstream>
using namespace std;
using namespace arma;
void RHO_A_FILL(vec &rho, mat &A, int N,double rhoN); //rho, kind of like a linespace
//A, Tridiagonal matrix
voi... |
//========================================================================
// Offscreen rendering example
// Copyright (c) <NAME> <<EMAIL>>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this sof... |
/**********
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
This libr... |
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
// STL
#include <cmath>
#include <vector>
#include <cstdlib>
#include <iterator>
// OpenGL
#include <GLFW/glfw3.h>
constexpr auto g_cWindowsWidth = 640 * 2;
co... |
/*
* vhd_unix.cpp -- support for disk images in vhd format
*
* (C) 2010 <NAME>
*
* 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 version 2 of the License, or
* (at your option) a... |
#include "SimG4CMS/HGCalTestBeam/interface/HGCalTBMB.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "SimG4Core/Notification/interface... |
#include <iostream>
#include <thread>
#include<boost/program_options.hpp>
#include "Chick.h"
#include "Parent.h"
#include "PrintThread.h"
namespace po = boost::program_options;
/**
* Read options from command line
*
* @param chicks_number
* @param baby_chick_iters
* @param parents_number
* @param portion_size... |
#include "main.h"
#include <libhcan++/transport_connection.h>
#include <libhcandata/data_file_writer.h>
#include <boost/program_options.hpp>
#include <sys/types.h>
#include <pwd.h>
#include <signal.h>
#include <sys/types.h>
#include <stdio.h>
namespace po = boost::program_options;
using namespace hcan;
volatile boo... |
// Copyright (c) 2009 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 "chrome/browser/gtk/bookmark_tree_model.h"
#include <gtk/gtk.h>
#include "app/resource_bundle.h"
#include "base/string_util.h"
#include "ch... |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
/*
* Shell library
* Worker thread (tneo)
*
* Copyright (c) 2017 Softland. All rights reserved.
* Licensed under the Apache License, Version 2.0
*/
/*
* Revision history:
*
* Revision 1.0, 13.03.2017 11:53:12
* Initial revision.
*
*/
#include "tn.h"
#include "shell/config.h"
#include "shell/she... |
// std lib
#include <iostream>
#include <sstream>
// OpenCV
#include <opencv2/core.hpp>
#include "opencv2/objdetect.hpp"
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/features2d.hpp>
static const int DOMINO_PIECE_AREA_MIN = 1000;
static const int DOMINO_PIECE_AREA_MAX = 10000;
unsi... |
/*************************************************************************/
/* */
/* Centre for Speech Technology Research */
/* University of Edinburgh, UK */
/* ... |
#include "Application.h"
#include "ModuleScene.h"
#include "PanelElements.h"
#include "Primitive.h"
#ifdef _DEBUG
//#define TEST_MEMORY_MANAGER
#include "mmgr/mmgr.h"
#endif
PanelElements::PanelElements(const char* name) : Panel(name)
{
active = true;
}
PanelElements::~PanelElements()
{
}
void PanelElements::Draw... |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
/**
* Copyright (c) 2009 Carnegie Mellon University.
* 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... |
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/****************************************************************************
FILE: OSVersion.cpp
PROJECT: UTILS.LIB
DESC: Implementation of OSVERSION structures and functionality
OWNER: JoeA
****************... |
/**
* \file
*
* \brief Utilities that convert pressure to altitude
*
* This is a collection of high-level utility functions that will convert a
* given pressure to an altitude within the Earth's atmosphere using the
* International Standard Atmosphere (ISA) model. The ISA is an ideal model
* of how pressure, t... |
/** @file
MODULE : CodedBlkPatternH264VlcDecoder
TAG : CBPH264VD
FILE NAME : CodedBlkPatternH264VlcDecoder.cpp
DESCRIPTION : A coded block pattern Vlc decoder implementation used in
H.264 Recommendation (03/2005)Table 9.4(a) on page 196.
This implementation is implemented with... |
/**
* @file SparsePyrLKOpticalFlow_.cpp
* @brief mex interface for cv::SparsePyrLKOpticalFlow
* @ingroup video
* @author Amro
* @date 2017
*/
#include "mexopencv.hpp"
#include "opencv2/video.hpp"
using namespace std;
using namespace cv;
// Persistent objects
namespace {
/// Last object id to allocate
int last_id... |
#include <sstream>
#include "edit_vehicle_ui.h"
#include "../../../util/io_util.h"
#include "../../../exception/invalid_schedule_exception.h"
#include "../../../exception/invalid_date_exception.h"
EditVehicleUI::EditVehicleUI(UIManager &ui_manager) : controller(
*ui_manager.getCompany().getUserManager().getProvider(... |
// Writed by yijian (<EMAIL>)
// Redis命令扩展module
#include "redismodule.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
// 带超时的INCRBY命令
// 格式:INCRBYEX KEY SECONDS INCREMENT
//
// 示例:
// ex.incrbyex k1 10 1
// ex.incrbyex k1 10 2
int incrbyex_RedisCommand(RedisModuleCt... |
#include "common.h"
#include "bmpio.h"
#include "world.h"
#include "tracer.h"
using namespace std;
extern World world;
extern Bmp bmp;
extern Camera camera;
extern Tracer tracer;
Color Tracer::Diffuse(Ray X,double dis,Primitive &pri){
Vector3 pi,N;
pi = X.Origin + X.Direction * dis;
Color ret;
double shade,rdis... |
/******************************************************************************
*
* Terminal.cc
*
* Author: mSatyam
*
* 2016, September
*
* Represents our virtual terminal which accepts user input in non-canonical
* mode , processes it and displays desired output to the user.
*
* ***************************... |
#include <cmath>
#include "glcamera.h"
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <glut.h>
#endif
#include <QDebug>
GLCamera::GLCamera()
{
moveSpeed = 10.0;
x = -1.0;
y = 0.4;
z = 1.0;
look_x = -1.0;
look_y = 0.4;
look_z = 0.0;
zoomLevel = 1.0;
zoomSpeed = 0... |
/*
This file is for unit testing the physical hardware connected to the Mega 2560 microcontroller.
This taste case runs to check the RGB Led, Various LEDs, Speakers, Potentiometer, LCD, and buttons.
*/
#include <unity.h>
#include <studio-libs/tune_studio.h>
#include <debug/test_hardware.h>
// The amount of times a... |
/**************************************************************
*
* 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 y... |
// Copyright 2015 <NAME> All Rights Reserved.
//
// AIMP RadioTrack Recorder
//
// Licensed under the Creative Commons Attribution NonCommercial Share-Alike (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://creativecommons.org/l... |
/*
* Copyright (c) 2020, NVIDIA CORPORATION. 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 co... |
#include "../../../../common/stdafx.h"
#include "world.h"
#include "../../../../common/core.h"
#include "../../../../common/sys.h"
#include "../../../../common/font.h"
#include "../Entities/Entity.h"
#include "../Entities/Components/linear_vel_comp.h"
#include "../Entities/Components/collision_comp.h"
#include "../Enti... |
#include "HelloWorldScene.h"
#include "SimpleAudioEngine.h"
#include "CreatureModule.h"
#include "CreatureRenderer.h"
#include "CreaturePackModule.hpp"
#include "CreaturePackRenderer.h"
USING_NS_CC;
Scene* HelloWorld::createScene()
{
return HelloWorld::create();
}
// Print useful error message instead of segfaul... |
/**
* Copyright (c) 2020 University of Luxembourg. All rights reserved.
*
* 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 notice, this list of
*... |
//
// This file is part of khmer, http://github.com/ged-lab/khmer/, and is
// Copyright (C) Michigan State University, 2009-2013. It is licensed under
// the three-clause BSD license; see doc/LICENSE.txt. Contact: <EMAIL>
//
#include "node.hh"
enum { A, C, G, T };
unsigned int factorial(unsigned int n) {
int ret ... |
#include "recognizer.h"
#include <iostream>
#include <fstream>
#include "sqlite3.h"
void Recognizer::initialize(double threshold)
{
model = createFisherFaceRecognizer();
model->set("threshold", threshold);
}
bool Recognizer::train(string fileInfo, string databaseFolder)
{
ifstream info;
string input, path;
info.... |
#include "ui.hpp"
#include "engine/api.hpp"
#include "engine/engine.hpp"
#include "engine/input.hpp"
using namespace blit;
void UIItem::render() {
if(selected && children.empty()) {
screen.pen = {255, 255, 255, 90};
screen.rectangle(display_rect);
}
screen.pen = {255, 255, 255};
swi... |
/*
* doorn2.cpp
* Author: <NAME> (2518074)
* October 10th 2019
*
* This program aims to provide the functionality described in assignment 2 'Keurig'. It will ask the user to input a
* tab-width and the file they want to check and where the result should go to. The program will remove all comments
* made using //... |
#include <gtest/gtest.h>
#include <ctrigrid/TriQueries.h>
#include "MathTestUtils.h"
// utility for returning the count of elements in a C array, type-safe
template <typename T, size_t N>
constexpr size_t countof(T const (&)[N]) noexcept { return N; }
// TODO: edge cases
struct ClosestDistQueryTestData
{
ctr... |
// ratslam headers
#include <Ratslam.hpp>
#include <RatslamGraphics.h>
// boost property trees
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
// opencv for video input.
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <string>
#include <iostream>
... |
//----------------------------------------------------------------------------------
// File: NvVkUtil/NvAppNativeContextVK.cpp
// SDK Version: v3.00
// Email: <EMAIL>
// Site: http://developer.nvidia.com/
//
// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
//
// Redistribution ... |
#include "Utils.h"
#include <iostream>
#include <fstream>
int Utils::loadShaderSource(char* filename, std::string& text)
{
std::ifstream ifs;
ifs.open(filename, std::ios::in);
std::string line;
while (ifs.good()) {
getline(ifs, line);
text += line + "\n";
}
return 0;
}
GLint Utils::logProgramLin... |
#include "debug.h"
#include "context.h"
#include "printimpl.h"
using namespace ch::internal;
enum class fmttype {
Bool,
Int,
Float,
Enum,
};
struct fmtinfo_t {
fmttype type;
int index;
fmtinfo_t() : type(fmttype::Bool), index(-1) {}
};
static bool is_escape(const char* str) {
return (str[0] == '\\'... |
#include <QCoreApplication>
#include <GenericExpressInstanceParser.h>
#include <ExpressSyntaxPrinter.h>
#include <XmlSyntaxPrinter.h>
#include <sstream>
#include <string>
#include <fstream>
#include <iostream>
namespace config {
enum OutputDialect { // missing c++11 atm
XML,
EINST
};
cla... |
#include "features/features.h"
#include "helpers/autowall.h"
#include "globals.h"
#include "helpers/input.h"
#include "helpers/console.h"
#include "helpers/entities.h"
bool IntersectionBoundingBox(const Vector& src, const Vector& dir, const Vector& min, const Vector& max, Vector* hit_point)
{
/*
Fast Ray-Box Interse... |
//Student Exercise #15
//Vectorized implementation of Student Exercise #14
//Part_Twenty_One's ItemList.cpp
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
//Class Product and its member methods
class Product
{
private:
string name;
double price;
int qty;
public:
... |
/*
Copyright 2019 <NAME>
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, so... |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#include "bfindex.h"
#include "bloom.h"
#include "point_indexed/point_index_io.h"
using namespace std;
/************************************************
PUBLIC FUNCTIONS
***********************************************/
BFIndex::BFIndex() ... |
#include "Builtins.h"
#include "Codegen.h"
#include "FuncDef.h"
#include "Parser.h"
#include "Printer.h"
#include "Program.h"
#include "SimpleJIT.h"
#include "TokenStream.h"
#include "Typechecker.h"
#include <llvm/IR/LegacyPassManager.h>
#include <llvm/IR/PassManager.h>
#include <llvm/Transforms/IPO/PassMa... |
// Copyright 2013 Cloudera, Inc.
//
// 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 ... |
#include "pascalvocexporter.h"
void PascalVocExporter::splitData(float split, bool shuffle, int seed){
if(split < 0 || split > 1){
qCritical() << "Invalid split fraction, should be [0,1]";
}
if(shuffle){
std::random_device rd;
std::mt19937 generator(rd());
generator.seed(s... |
#include "pch.h"
#include "RayMarching.h"
using namespace glm;
//
// Kaleidoscope Tunnel
// Created by kaneta in 2019-02-10
// https://www.shadertoy.com/view/WsSGWG
//
#define PI 3.141592654
inline mat2 rot(float x)
{
return mat2(cos(x), sin(x), -sin(x), cos(x));
}
inline vec2 foldRotate(vec2& p, float s) {
floa... |
#include <iostream>
#include <vector>
using namespace std;
int i;
bool existe(vector<int> pessoas, int x) {
for(i = 0; i < 6; i++){
if( pessoas[i] == x)
return true;
}
return false;
}
int contar(vector<int> pessoas, int x) {
int cont { 0 };
for(i = 0; i < (int) pessoas.size(); i++){
if(pessoas[i] == x) cont... |
#include "TransformPoly.h"
#include <newmat/newmat.h>
#include "ErrorHandling.h"
#include <iostream>
#include <math.h>
using namespace NEWMAT;
//#define USE_OLD_POLYNOMIAL_EQ
#define HIGHEST_ALLOWED_POLY 100
vector<double> GetCoeff(int order, double x, double y)
{
vector<double> out;
#ifdef USE_OLD_POLYNOMIAL_EQ
... |
#include <bits/stdc++.h>
#include <opencv4/opencv2/opencv.hpp>
using namespace std;
using namespace cv;
#define relativeMode 2
#define immediateMode 1
#define positionMode 0
#define white 1
#define black 0
const int mapSize = 200;
struct coords {
int x;
int y;
coords(int _x, int _y) : x{_x}, y{_y} {};
boo... |
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd. 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... |
/*-------------------------------------------------------------------------
This source file is a part of Placid
For the latest info, see http:www.marrin.org/
Copyright (c) 2018-2019, <NAME>
All rights reserved.
Use of this source code is governed by the MIT license that can be
found in the L... |
/**
* @file DependenceCollector.cpp
* @author <NAME>
*
* LLVM analysis pass that collects the results of the built-in memory dependence analysis and exposes this with a
* simple interface.
*
* @note Code heavily inspired by and partially copied from the native llvm/lib/Analysis/MemDepPrinter.cpp file.
*/
#inclu... |
#include "LeetCodeLib.h"
/*
* @lc app=leetcode id=61 lang=cpp
*
* [61] Rotate List
*
* https://leetcode.com/problems/rotate-list/description/
*
* algorithms
* Medium (27.21%)
* Likes: 631
* Dislikes: 823
* Total Accepted: 198.2K
* Total Submissions: 723.7K
* Testcase Example: '[1,2,3,4,5]\n2'
*
* ... |
#include <iostream>
#include <sstream>
#include "application.h"
#include "display.h"
#include "main_menu_state.h"
#include "play_state.h"
#include "options_state.h"
#include "button.h"
Main_menu_state::Main_menu_state(Application *app): Game_state(app){
init_entities();
std::cout << "Main_menu... |
/**************************************************************************\
*
* This file is part of the Coin 3D visualization library.
* Copyright (C) by <NAME> & Gas Technologies.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License... |
#include <array>
#include <iostream>
#include <unordered_map>
#include <string>
#include <asdfm/main/asdf_defs.h>
#include <asdfm/utilities/utilities.h>
#include "plant_generator.h"
#include "plant_printer.h"
#include "stress_test.h"
using namespace plantgen;
using namespace plant_printer;
using namespace asdf::util... |
#include "grid_axis.hpp"
GridAxis::GridAxis(int gridDim) :
dim(gridDim),
nbPoints((dim+1)*(dim+1)),
nbIndices(2*(dim+1)*(2*dim)),
gridShader("../shaders/grid/vertex.glsl", "../shaders/grid/fragment.glsl"),
axisShader("../shaders/axis/vertex.glsl", "../shaders/axis/fragment.glsl")
{
grid = new float[nbPoints * 3]... |
#include <Grappa.hpp>
#include <GlobalVector.hpp>
#include <graph/Graph.hpp>
#include "coloring.hpp"
#define NO_TEST 3
/* Options */
DEFINE_bool(metrics, false, "Dump metrics");
DEFINE_int32(scale, 23, "Log2 number of vertices.");
DEFINE_int32(edgefactor, 24, "Average number of edges per vertex.");
DEFINE_int32(root,... |
#ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#include "MBAggStencil.H"
#include "IntVectSet.H"
#include "NamespaceHeader.H... |
#include "winsock2.h"
#include "osc/OscReceivedElements.h"
#include "VizUtil.h"
#include "VizSocket.h"
#include "VizOscInput.h"
#include "VizOscTCPInput.h"
VizOscTcpInput::VizOscTcpInput(std::string host, int port, VizOscListener* processor) : VizOscInput(processor) {
DEBUGPRINT2(("VizOscTcpInput constructor"));
m_o... |
#include "GlobalConfig.h"
char* GlobalConfig::usage =
"/// USAGE"
"\n"
"\nGeneral and view:"
"\n ESC: exit app."
"\n ALT : captura / free cursor."
"\n V : block / free rotation(and add orange frame)."
"\n M : switch bottom view."
"\n N : switch FPS between top - down view."
"\n Comma y + / -: edit ce... |
/*-----------------------VERTICAL ORDER TRAVERSAL---------------------------
In this we have to get the vertical order of the tree
-> The approach is to Level order traverse the Binary tree
-> keep a track of the horizontal distance and vertical distance of the nodes from the root which
is at origin or say at (0,0)
-... |
/*
* The MIT License
*
* Copyright (c) 1997-2019 The University of Utah
*
* 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
* right... |
#include "terrain/Terrain.hpp"
#include "core/Transform.hpp"
#include <iostream>
#include "graphics/ShaderProgram.hpp"
#include "graphics/GLTexture.hpp"
#include "core/Files.hpp"
#include <algorithm>
#include <imgui/imgui.h>
Terrain::Terrain() :
center(0,0,0),
terrain_origin(0,0,0),
chunk_lookup(),
chunks(),
draw_di... |
#ifndef __PLOT2D_H
#include "plot2d.h"
#endif
//#ifndef __GMMETH_H
//#include "gmmeth.h"
//#endif
//#include <math.h>
//---------------------------------------------------------------------------------------------------
CWinContPlot2D::CWinContPlot2D(double** FuncValues, double** ArgValues, double* ArgStart, double... |
// Source : https://oj.leetcode.com/submissions/detail/16903707/
// Author : <EMAIL>
// Date : 2014-12-19
/**********************************************************************************
*
* Compare two version numbers version1 and version1.
* If version1 > version2 return 1, if version1 < version2 return -1, othe... |
// (C) 2020-2021 by <NAME> <<EMAIL>>, released under Apache License v2.0
#include <algorithm>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/type... |
/*
30. Substring with Concatenation of All Words
Hard
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
Example 1:
Input:
s = "ba... |
#include "level.h"
Level::Level(){};
Level::Level(std::string levelPath)
{
beginLevelPath = &levelPath.at(0);
tex_wall.loadFromFile("assets/wall.png");
tex_exit.loadFromFile("assets/exit.png");
tex_screws.loadFromFile("assets/screws.png");
tex_workbench.loadFromFile("assets/workbench.png");
//
initLevel();... |
#include "stdafx.h"
#include "atlenc.h"
#include <afxinet.h>
#include <fstream>
#include <sstream>
#include <iterator>
#include <vector>
#include <iostream>
#include <string>
#include "Uploader.h"
#define _EMPTY ""
#define new DEBUG_NEW
Uploader::Uploader() {
// Grab settings here in a variable.
}
Uploader::~Upl... |
// This class inititalizes the kalman filter when a first measurement is made.
// It calls the predict and update methods of kalman_filter class instance ekf_.
#define _USE_MATH_DEFINES
#include <math.h>
#include "FusionEKF.h"
#include <iostream>
#include "Eigen/Dense"
#include "tools.h"
using Eigen::MatrixXd;
using E... |
#include <cstdio>
#include <dirent.h>
#include <unistd.h>
#include <fstream>
#include <c_graph.h>
#include <sys/stat.h>
#include <algorithm>
#include "datastore.h"
bool is_directory(const std::string path)
{
struct stat st;
if (0 != stat(path.c_str(), &st)) {
return false;
}
... |
/*
<NAME>
Assignment 3
Due Wednesday, October 22nd
Theory of Computing, MW 5:45
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <stack>
#include <string>
#include <cstdlib> // for atoi
using namespace std;
const string ACCEPT_MSG = "ACCEPT";
const string REJECT_MSG = "REJE... |
// Copyright (c) 2007-2009 Google Inc.
// Copyright (c) 2006-2007 Jaiku Ltd.
// Copyright (c) 2002-2006 <NAME> and <NAME>
//
// This software is licensed at your choice under either 1 or 2 below.
//
// 1. MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software ... |
#include "simulation/ElementCommon.h"
int Element_FIRE_update(UPDATE_FUNC_ARGS);
static int update(UPDATE_FUNC_ARGS);
static int graphics(GRAPHICS_FUNC_ARGS);
static void create(ELEMENT_CREATE_FUNC_ARGS);
void Element::Element_PHOT()
{
Identifier = "DEFAULT_PT_PHOT";
Name = "PHOT";
Colour = PIXPACK(0xFFFFFF);
Men... |
#include <stdio.h>
#include <tchar.h>
#include <windows.h>
#include <Shlwapi.h>
#include "CmdService.h"
#include "ServiceCtrl.h"
#include "getopt.h"
#include "api.h"
CmdService cmdService;
static const opt_struct OPTIONS[] = {
{'h', 0, "help"},
{'?', 0, "usage"},/* help alias (both '?' and 'usage') */
... |
#include <sticker.h>
// Inicializa constantes estaticas
VAO *Sticker::sticker_sd;
GLfloat Sticker::offset = 0.5L;
// Constructor
Sticker::Sticker (const FACE &dir, Texture *const img)
{
// Asigna direccion y textura
side = dir;
texture_sd = img;
// Construye la etiqueta indicada
switch (side)
{
// Arriba
... |
/* frame_grabber
* Grabs frames from the video stream and writes to the disk using
* libVLC and SDL and modelled using the ROS framework.
* Author: <NAME> (<EMAIL>)
* Date: 21 Feb 2011
*/
#include <iostream>
#include <sstream>
#include <string>
#include <vlc/vlc.h>
#include <SDL/SDL.h>
#include <SDL/SDL_mutex... |
#include <iostream>
#include <fstream>
#include <cstring>
#include <set>
#include <vector>
#include <algorithm> // std::count
extern "C"
{
#include <tourtre.h>
// need this to access ctx info directly
#include "ctContext.h"
}
#include "Data.h"
#include "Mesh.h"
#include <unistd.h>
using std::cin;
using std::cout;
... |
// Documentation on defining PXT blocks:
// https://www.pxt.io/defining-blocks
#include "pxt.h"
#include "SDFileSystem.h"
using namespace pxt;
SDFileSystem *sd;
char buf[50];
struct stat buffer;
FILE *f;
DIR *dir;
struct dirent *ent;
enum class Pins{
P0= 3,
P1= 2,
P2= 1,
P3= 4,
P4= 5,
P5= 17,
P6= 12,
P7= 11... |
#define GLFUNCS_EXT
#include "glfuncs.h"
#include <stdio.h>
#ifdef _DEBUG
void CheckGLErrors(const char *func, int line)
{
int lasterror = glGetError();
if (lasterror)
{
printf("OpenGL error in %s, %i: err=%i\n", func, line, lasterror); fflush(stdout);
}
}
#endif
struct GLFuncEntry
{
void ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.