text stringlengths 3.08k 12.5k |
|---|
// Problem # : 526
// Created on : 2018-05-30 20:11:09
// Title : String Distance and Transform Process
// Accepted : No
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <algorithm>
#include <bitset>
#include <deque>
#include <f... |
/*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2009-2014, <NAME>, Inc.
* Copyright (c) 2014-, Open Perception, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permi... |
#include "OptimizeBitwidth/deps.h"
#include "OptimizeBitwidth/operations.h"
#include <cassert>
#include <cmath>
ArgDeps::ArgDeps(uint8_t arg_bitwidth)
: mDeps(), mSnapshot(arg_bitwidth)
{ }
void ArgDeps::addDependency(const Info* i) {
// add i to dependencies iff it's not already in
if (std:... |
#include "segment/image.h"
#include "segment/misc.h"
#include "segment/filter.h"
#include "segment/segment-graph.h"
#include "segment.h"
// random color
rgb random_rgb(){
rgb c;
double r;
c.r = (uchar)random();
c.g = (uchar)random();
c.b = (uchar)random();
return c;
}
// dissimilarity measure betwee... |
#include "nd.h"
inline void assignToRoot (int* ch, vector<subcore>& skeleton) {
vector<int> acc;
int s = *ch;
while (skeleton[s].root != -1) {
acc.push_back (s);
s = skeleton[s].root;
}
for (int i : acc)
skeleton[i].root = s;
*ch = s;
}
inline void assignToRepresentative (int* ch, vector<subcore>& skeleto... |
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2008
* <NAME>
*
*
* 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 y... |
#include "functions.cpp"
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include <iostream>
#include <fstream>
#include <string>
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
using namespace llvm;
// the gra... |
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <string.h>
#include <unistd.h>
#include <random>
#include <string>
#include "kcpsess.h"
#define SERVER_PORT 8888
// because `int result = kcpServer.Send(... |
/******************************************************************************
*
* Project: ADAGUC Server
* Purpose: GeoJSON helper files.
* Author: <NAME> (KNMI)
* Date: 2016-08
*
******************************************************************************
*
* Copyright 2013, Royal Netherlands Mete... |
/******************************************************************************
* Copyright (c) 2014,2015, AllSeen Alliance. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyrigh... |
//------------------------------------------------------------------
//
// @@@ START COPYRIGHT @@@
//
// 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. ... |
//=======================================================================
// Copyright <NAME> 2011-2016.
// Distributed under the MIT License.
// (See accompanying file LICENSE or copy at
// http://opensource.org/licenses/MIT)
//=======================================================================
#include <unorder... |
#include "saxpy.hpp"
using namespace std::chrono;
auto
check_saxpy(vector<int> in1, vector<int> in2, vector<int> out, int size, float constant)
{
auto pos = -1;
for (auto i = 0; i < size; ++i) {
int v = (constant * (float)in1[i]) + in2[i];
if (v != out[i]) {
cout << "[" << i << "] = " << v << " != "... |
#include <codegen/generate.hpp>
#include <fstream>
#include <set>
#include <mustache.hpp>
using namespace kainjow;
std::string read_file(fs::path path) {
std::ifstream file(path);
if (!file) { return ""; }
return std::string{std::istreambuf_iterator<char>{file}, {}};
}
void create_file(fs::path path) {... |
#include "obstacles_trajectory_predictor/obstacle.h"
Obstacle::Obstacle(void)
{
x = Eigen::Vector4d::Zero();
initialize();
}
Obstacle::Obstacle(const Obstacle& obstacle)
{
x = obstacle.x;
p = obstacle.p;
r = obstacle.r;
h = obstacle.h;
likelihood = obstacle.likelihood;
last_time = obs... |
#include<string.h>
#include<iostream>
enum types{
NUM, SUM, MIN, MUL, DIV, SPC
};
class ERROR{};
class leksem{
types type;
int64_t value;
bool isSign(char c);
size_t isNum(const char* str);
int normalizeFirst();
public:
leksem *next;
leksem(const char *expr);
types gettype(){
... |
#include "ofApp.h"
// before looking at this check out the basics examples and the scoring1 example
// this is a more advanced example of some of ofxPDSP sequencing, check out score.h for the bass pattern code
//--------------------------------------------------------------
void ofApp::setup(){
//----------... |
/*
* Twiddle.cpp
*
* Created on: Apr 5, 2018
* Author: <NAME>
*
* Implemented a Generic Twiddle Algorithm
*/
#include <iostream>
#include <math.h> // fabs
#include "Twiddle.h"
const unsigned PENALTY_MULTIPLIER = 10;
const unsigned FIXED_PENALTY = 0.1;
Twiddle::Twiddle(const std::vector<double>& initP, ... |
// hkxcmd.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "hkxcmd.h"
#include "hkxutils.h"
#include "log.h"
using namespace std;
#pragma comment(lib, "shlwapi.lib")
using namespace std;
#pragma warning(disable : 4073)
#pragma init_seg(lib)
hkxcmd::hkxcmdListType hkxcmd::hk... |
////////////////////////////////////////////////////////////////////////////////
//! \file
//! \author <NAME>
//! \date 11/12/2003
//!
//! \brief Source for Message_t
//!
////////////////////////////////////////////////////////////////////////////////
#include "Message_AMOS.hh"
#include <cstdio>
using namespace AMOS;
... |
#include <iostream>
#include <set>
#include <stack>
#include <string>
#include <fstream>
#include <sstream>
#include <exception>
#include <map>
#include <memory>
#include <cstdlib>
using namespace std;
struct RuntimeStack {
private:
void release_handle() {
stk = nullptr;
p = nullptr;
}
public... |
#include "sphere.h"
#include "parse.h"
#include "material.h"
#include "main.h"
#include "common.h"
#include "roots.h"
#include <math.h>
#include <iostream>
#define PI 3.14159
// single glu quadric object to do opengl sphere drawing
static GLUquadricObj* sphereQuadric = gluNewQuadric();
Sphere::Sphere (... |
#include "cloth_gen.h"
int index (int i , int c, int sizeY)
{
return i * sizeY + c;
}
bool validIndex (int i, int c, int sizeX, int sizeY)
{
if (i * c > sizeX * sizeY - 1)
return false;
if (i < 0 || c < 0) return false;
if (i > sizeX -1 || c > sizeY -1)
return false;
}
void... |
/*
ID: hogao81
PROG: ttwo
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstring>
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
using namespace std;
struct tPos {
int r, c, dir;
};
struct tCycle {
int start, end, len;
tPos pos;
};
void FindPaths(int pos[10][10][... |
#include "iogroup-softpwm.hpp"
#include <sstream>
using namespace std;
IoGroupSoftPWM::IoGroupSoftPWM(DBus::Connection &connection,std::string &dbuspath, GpioRegistry ®istry)
: IoGroupDigital(connection,dbuspath, registry)
{
}
void IoGroupSoftPWM::Initialize(libconfig::Setting &setting)
{
IoGroupDigital... |
// globals.c - global variables/needed across modules
//
// Copyright (c) 1988-1990, Microsoft Corporation. All rights reserved.
//
// Purpose:
// This is the routine in which global variables reside.
//
// HackAlert:
// The functionality explained in the Notes below work only because of the way
// Micro... |
/*
* This software is copyrighted as noted below. It may be freely copied,
* modified, and redistributed, provided that the copyright notice is
* preserved on all copies.
*
* There is no warranty or other guarantee of fitness for this software,
* it is provided solely "as is". Bug reports or fixes may be sent
... |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* Copyright (c) 2021 <NAME>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
... |
/*
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:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following discl... |
#include "../../../include/BP-Main.h"
/*
* Blockparty Packet Capture Utilities:
* ------------------------------------------
*
*/
/*
* This is a default pcap callback function which can be used with BP_StartPacketCapture if no
* capture is set.
*/
void BP_CaptureFilter(u_char *userData, const struct pcap_pkth... |
#include "BWham.h"
namespace WhamRegistry
{
registry<Bwham> registerBwham("Bwham");
}
Bwham::Bwham(const WhamInput& input)
:Wham(input)
{
// intialize the timeseries
initializeTimeSeries();
// initialize the bins
initializeBins();
// Bin the data set
bindata();
// initialize the B... |
#include "input.h"
#include "output.h"
#include "screen.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
#include <string>
#include <readline/readline.h>
#include <execinfo.h>
#include <signal.h>
#include <cxxopts.hpp>
std::unique_ptr<Screen> gScreen;
enum Action {
ACTION_NONE,
ACT... |
//===--- PILFunctionBuilder.cpp -------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
/*
* Copyright (c) 2018, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at w... |
/*
* Copyright 2020 Improbable Worlds Limited
*
* 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... |
/*
* Scheduler.cc : part of the Mace toolkit for building distributed systems
*
* Copyright (c) 2011, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are... |
/// \file minHashSim.cc
/// \author <NAME> (<EMAIL>)
/// \brief implement the interface defined in MinHash simulator
/// \version 0.1
/// \date 2019-08-13
///
/// \copyright Copyright (c) 2019
///
#include "../../include/minHashSim.h"
ChunkInfo::ChunkInfo() {
memset(fp, 0, FP_SIZE + 1);
size = 0;
}
ChunkInf... |
#include "leastSquaresAverage.hpp"
#include "utilities/mathUtilities.hpp"
#include "utilities/petscError.hpp"
void ablate::finiteVolume::stencil::LeastSquaresAverage::Generate(PetscInt face, ablate::finiteVolume::stencil::Stencil& stencil, const domain::SubDomain& subDomain,
... |
#include <bits/stdc++.h>
using namespace std;
#define long int64_t
// *****
template <typename T>
struct rangenum {
static_assert(is_integral<T>::value);
array<T, 2> n = {};
rangenum() = default;
rangenum(array<T, 2> ab) : n(ab) {}
rangenum(T v) : n({v, v}) {}
rangenum(T a, T b) : n({a, b})... |
/**
* Author : <NAME>
* Date : 10/10/2011
* Subject : One-Dimensional Integer Array Class
* Assignment no. : 5
*/
#include <iostream>
#include <myexception>
using namespace std;
using namespace exception;
class ArrayIndexOutOfBoundsException:public Exception {
public:
ArrayIndexOutOfBoundsExcept... |
/*
Borealis, a Nintendo Switch UI Library
Copyright (C) 2019-2020 natinusala
Copyright (C) 2019 p-sam
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 3 of the... |
#include "Poly.hpp"
Poly::Poly()
{
// points = new float2[100];
num = 0;
this->numNorm = 0;
x.resize(VERTS);
y.resize(VERTS);
z.resize(VERTS);
norm.resize(VERTS);
triNorm.resize(TRIANGLES);
abcnorm.resize( TRIANGLES / 3 );
d.resize( TRIANGLES / 3 );
red.resize(VERTS);
bl... |
// Copyright (c) 2018 ASMlover. 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 ofconditions and... |
/* MIT License
*
* Copyright (c) 2018 <NAME>, <NAME>, <NAME>
*
* 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... |
#include <iostream>
//#include "sw-src/api_pb/api.pb.h"
//#include "sw-src/api_pb/api.grpc.pb.h"
#include "sw-src/dataplane/pipeline.h"
#include "sw-src/dataplane/physical_layer.h"
#include "sw-src/api/dataplane_server.h"
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <unistd.h>
#include <thread>
DE... |
/* Copyright © 2021 <NAME>. All rights reserved.
*
* Test program for c++ snippest to try to out some features.
*
*/
#include <cstdio>
#include <forward_list>
#include <iostream>
#include <iterator>
#include <memory>
#include <string>
#include <utility>
#include <vector>
// template
template <typename T> const T ... |
////////////////////////////////////////////////////////////////////////////////
// Copyright 2007, <NAME>, all rights reserved.
////////////////////////////////////////////////////////////////////////////////
#if defined(ORK_OSX)
#include <mach-o/dyld.h>
#endif
#include <orktool/orktool_pch.h>
#include <orktool/qtui... |
#include "game.h"
#include <iostream>
Game::Game()
{
mWindow = nullptr;
mIsRunning = true;
}
bool Game::initialize()
{
//std::cout << "initialization start" << std::endl;
int sdlResult = SDL_Init(SDL_INIT_VIDEO);
if(sdlResult)
{
//The SDL_GetError function returns an error message a... |
/*
*Copyright (C) MIT.
*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, sublic... |
/*========================================================================*
* *
* Distributed by Whiteley Research Inc., Sunnyvale, California, USA *
* http://wrcad.com *
* Copyright (... |
/////////////////////////////////////////////////////////////////////////////////////////////////
// Author:- <NAME>
// Organisation:- IIITDM KANCHEEPURAM
// Topic:- Performance of selective gain combiner using BPSK in Rayleigh fadding channel
////////////////////////////////////////////////////////////////////////////... |
// Bindings
#include "CPyCppyy.h"
#include "CPPFunction.h"
#include "CPPInstance.h"
// Standard
#include <algorithm>
//- CFunction helpers -----------------------------------------------------------
bool CPyCppyy::AdjustSelf(PyCallArgs& cargs)
{
#if PY_VERSION_HEX >= 0x03080000
if (cargs.fNArgsf & PY_VECTORCALL_... |
/*
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain s... |
// Copyright (C) 2015 <NAME> <<EMAIL>>
// Licensed under the MIT license.
#include <iostream>
#include <stdexcept>
#include <string>
#include <ekutils/uri.hpp>
using handtruth::ekutils::uri;
void test_call(bool succeeded, char const *what)
{
std::cout << (succeeded ? "PASSED: " : "FAILED: ") << what << std::endl <<... |
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
laserWidth = 800;
laserHeight = 800;
laser.setup(laserWidth, laserHeight);
laser.maskRectangle.height = 600;
laser.connectToEtherdream();
ofxGuiSetDefaultWidth(300);
laserGui.setup();
laserGui.add(lase... |
/// HEADER
#include "path_follower/utils/extended_kalman_filter.h"
/// SYSTEM
#include <Eigen/Dense>
#include <ros/console.h>
#include<tf/tf.h>
#include<ros/ros.h>
#include <tf2/LinearMath/Quaternion.h>
namespace {
double angleDiff(const double a1, const double a2)
{
return std::atan2(std::sin(a1 - a2), std::co... |
#include "types.hh"
#include "misc.hh"
#include "io.hh"
#include "tcrdist.hh"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline
Real
compute_NNdistance_nosorting(
Size const num,
Reals const & dists // should already be sorted in increasi... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
#include <string>
#include <sstream>
#include "utilityFunctions.h"
#include "scraper.h"
//each vector stores a piece of information of a stock
std::vector<Json::Value> stockPrice;
std::vector<Json::Value> companyName;
std::vector<Json::Value>... |
/**
* @file synchronize.cpp
* @author <NAME> <<EMAIL>>
* @date 29.11.2017
*
* @brief Synchronize boost::threads
* See: https://theboostcpplibraries.com/boost.thread-synchronization
*
* Coding Standard:
* wiki.ros.org/CppStyleGuide
*
* @bug
*
*
* @todo
*
*
*
*/
#include... |
/* -*- mode:C++; c-basic-offset:4 -*-
Shore-MT -- Multi-threaded port of the SHORE storage manager
Copyright (c) 2007-2009
Data Intensive Applications and Systems Labaratory (DIAS)
Ecole Polytechnique Federale de Lausanne
All Rights Reser... |
#include "axlib.h"
#include <functional>
#include <iostream>
#include <regex>
#include <stdexcept>
#include <string>
#include <thread>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
using namespace axlib;
namespace {
constexpr int max_buf_s... |
//
// Created by <NAME> on 2021/10/2.
//
#include "des_crypt.h"
#ifdef Debug
#include <iostream>
#elif Release
#include <stdexcept>
#endif
#include <cstring>
/**
* @brief 初始化密钥
* @details DES 加密算法,密钥 8 位,多余丢弃,不足补 0
* @param _password 8 位密钥
* @return bool
*/
bool DesCrypt::Init(const std::string &_password) {
... |
/***************************************************************************************/
/* */
/* Copyright 2018 by <NAME>, <NAME> and <NAME> */
/* *... |
#include <stdio.h>
#include <stdlib.h>
#include <stack>
#include <queue>
using namespace std;
#define Status int
#define OK 1
#define ERROR 1
typedef int ElemType;
typedef struct BiTree{ //结构定义
ElemType data;
BiTree * lch;
BiTree * rch;
}BiTree, * pTree;
pTree newNode(ElemType data){ //newNode
pTree... |
// scream_03.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "VideoEnc.h"
#include "RtpQueue.h"
#include "NetQueue.h"
#include "ScreamTx.h"
#include "ScreamRx.h"
#include <iostream>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#include <string.h>
#inclu... |
#include "window.h"
#include <string>
#include "GL/glew.h"
#include "../utils/logger.h"
Window::Window(const char* title, int width, int height, int openGLMajorVersion,
int openGLMinorVersion, bool vsync, bool fullscreen) :
_title(title),
_width(width),
_height(height),
_windowedWidth(width),... |
#include "CamDxf/camleads.h"
/// @bug: some loops are drawn on top of leads, which make them unselectable thius can be solved by setting
/// their parent loop to a higher z value
Lead::Lead(Loop *loop):QGraphicsItem(loop){
leadRadius= settings.value("Leads/radius").toDouble();
if (leadRadius<=0 ) ... |
#include <getopt.h>
#include <stdio.h>
#include <Application.h>
#include <DataIO.h>
#include <Directory.h>
#include <File.h>
#include <FindDirectory.h>
#include <image.h>
#include <Message.h>
#include <Path.h>
#include <PrintTransportAddOn.h>
static struct option longopts[] = {
{ "help", no_argument, NULL, 'h' ... |
#include <iostream>
#include <list> // a container of STL
using namespace std;
/*
* Random Access : Slow
* Middle Insertion : Fast
* Ins./Del. at the end : Fast
More about list : https://www.cplusplus.com/reference/list/list/
*/
template <class T>
void display(list<T> &l){
// Iterators play... |
// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and
// other Axom Project Developers. See the top-level LICENSE file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
/*! \file core_containers.cpp
* \brief This example code is a demonstration of the Axom Core containers.
*/
/* This e... |
/*
* Copyright (C) 2014 <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 ... |
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
ofstream file;
void nekoGirl () {
cout << "\nYou open the box and a cute fluffy neko girl jumps out!\n";
cout << "She says that she was kidnapped and put into a box to kill you.\n";
cout << "But she doesn't like to kill people, ... |
#include "hls_design_meta.h"
const Port_Property HLS_Design_Meta::port_props[]={
Port_Property("s_axi_s_axilite_AWVALID", 1, hls_in, -1, "", "", 1),
Port_Property("s_axi_s_axilite_AWREADY", 1, hls_out, -1, "", "", 1),
Port_Property("s_axi_s_axilite_AWADDR", 10, hls_in, -1, "", "", 1),
Port_Property("s_axi_s_axilite... |
#include "http.h"
#include "tinyformat.h"
#include <curl/curl.h>
#include <stdio.h>
#include <string.h>
#include <memory>
// Only for troubleshooting. This should be removed before production.
#include "util.h"
enum class logattribute {
// Can't use ERROR here because it is defined already in windows.h.
ERR,... |
//
// DDFFIeldDefining.cpp
// ISO/IEC 8211 - Specification for a data descriptive file for information interchange
//
// Created by <NAME> on 23/02/2015.
// Copyright (c) 2015 Cellyceos. All rights reserved.
//
#include "iso8211.h"
#include <cstring>
#include <iostream>
using namespace std;
using namespace Stand... |
/*
MIT License
Copyright (c) 2018 <NAME>, <NAME> and <NAME>
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, merg... |
#include "mex.h"
#include <iostream>
#define M_SQRT2 1.41421356237309504880
#define setDist(x, y, back, stepSize) \
{ \
mwSize idx = (x) * h + (y); \
if ( \
y >= 0 && y < h && \
x >= 0 && x < w && \
image[idx] && \
( \
mxIsInf(dist[idx]) || \
dist[idx] > dist[back] + stepSize \
) \
){ \
dist[idx]... |
#include "smart-darkgdk/Game.h"
#include <vector>
using namespace std;
int score = 0;
int PROFUNDIDADE_CENARIO = 20000;
int LARGURA_CENARIO = 500;
//Airplane control
float acceleration = 0.03,
friction = 0.01,
speed = 0,
maxSpeed = 3,
gravity = 0.005,
flyAcceleration = 0.006,
gr... |
/************************************************************
*
* OPEN TRANSACTIONS
*
* Financial Cryptography and Digital Cash
* Library, Protocol, API, Server, CLI, GUI
*
* -- Anonymous Numbered Accounts.
* -- Untraceable Digital Cash.
* -- Triple-Signed Receipts... |
#include "ofxFirstPersonCamera.h"
ofxFirstPersonCamera::ofxFirstPersonCamera()
:m_isControlled (false)
,m_isMouseInited (false)
,upvector (0,1,0)
,movespeed (1.00f)
,rollspeed (1.00f)
,sensitivity (0.10f)
,keyUp (GLFW_KEY_E)
,keyDown (GLFW_KEY_C)
,keyLeft (GLFW_KEY_A)
... |
/*
Copyright 2013 GHI Electronics LLC
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, software... |
#include "SDL.h"
#include "SDL_ttf.h"
#include "Sprite.h"
#include "SDLManager.h"
#include "Font.h"
//CSprite
SDL_Rect CSprite::GetRect()
{
SDL_Rect Rect;
Rect.x = (int)roundf(m_Position.x);
Rect.y = (int)roundf(m_Position.y);
Rect.w = (int)roundf(m_Size.x);
Rect.h = (int)roundf(m_Size.y);
return Rect;
}
//CI... |
/**
* \file routes.cpp
* \author <NAME> <<EMAIL>>
* \brief A simple routes test program.
*/
//Use the behavior of Boost from bevor 1.63
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#include <asiotap/asiotap.hpp>
#include <asiotap/route_manager.hpp>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#incl... |
/**************************************************************************/
/*!
@file BLEUart.cpp
@author hathach
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2016, Adafruit Industries (adafruit.com)
All rights reserved.
Redistribution and use in source ... |
#pragma once
#include <vector>
#include <dwmapi.h>
#include "Util.h"
#include "Debug.h"
bool IsFullScreenWindow(HWND hWnd)
{
const auto hMonitor = ::MonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY);
MONITORINFO monitorInfo;
monitorInfo.cbSize = sizeof(MONITORINFO);
if (!::GetMonitorIn... |
/*! \file config_parser.cpp
*
* \brief parsing and validation for application configuration stored as JSON
*
*
* \author <NAME>
*/
/********************************** Includes *******************************************/
#include "config_parser.hpp"
#include <algorithm>
#include <functional>
#include <iostream>
#incl... |
/**
* Created by sixdi on 2/5/2022.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <array>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <algorithm>
#define SOCK_NAME "/tmp/DemoSocket"
#define BUFFER_SIZE 128
#define MAX_CLIENT_SUPPORTED 32
#defi... |
#include <cmath>
#include <cstdint>
#include <iostream>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::string;
using std::vector;
class HashTable {
public:
explicit HashTable(int size)
: size_(size),
hash1_(size + 1),
hash2_(size + 1),
seed1_(size + 1)... |
#include "Circle.h"
#include "Date.h"
#include "DynamicArray.h"
#include "Fraction.h"
#include "Line.h"
#include "Rectangle.h"
#include "Student.h"
#include "Time.h"
#include "Triangle.h"
#include <iostream>
#include <limits>
template <typename T>
T input(std::string prompt)
{
T obj;
std::cout << prompt;
... |
#include "Context.h"
Context::Context(cv::Point aRedCenter, cv::Point aYellowCenter, cv::Point aGreenCenter,
int aLampRadius, cv::Point aTopLeft, cv::Point aBotRight)
{
redCenter = aRedCenter;
yellowCenter = aYellowCenter;
greenCenter = aGreenCenter;
lampRadius = aLampRadius;
topLeft = aTopLeft;
botRight = aB... |
/*
* Copyright (c) 2017 <NAME>
*
* 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,
* ... |
#include "FindSignature.h"
#include "FindChildByName.h"
#include "FindPointerToFunctionType.h"
#include "FindBaseType.h"
//It receives a parmlist or template_arg_list operator
std::string FindSignature::find(VTP_TreeP &tree, std::vector<std::string> *types) {
std::string name;
VTP_TreeP tmp_tree,child;
tmp_tree =... |
#include <clocks.h>
#include <gpio.h>
#include <uart.h>
#include <spi.h>
#include <pwr.h>
#include <exti.h>
typedef HSE_OSC_T<> HSE;
typedef PLL_T<HSE, 72000000> PLL;
typedef SYSCLK_T<PLL> SYSCLK;
typedef SYSTICK_T<SYSCLK> SYSTICK;
typedef TIMEOUT_T<SYSTICK> TIMEOUT;
#ifdef OLIMEXINO
typedef GPIO_T<PA, 3, OUTPUT_10MH... |
// Copyright 2018 Google LLC
// Copyright 2018-present Open Networking Foundation
// SPDX-License-Identifier: Apache-2.0
#include "basic/status/status_macros.h" // IWYU pragma: associated
#include <basic/logging.h>
#include <algorithm>
#include <base/compiler_specific.h>
#include <base/logging.h>
#include <base/str... |
//===--- FixItRewriter.cpp - Fix-It Rewriter Diagnostic Client --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
// Generated from /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/rt.jar
#pragma once
#include <fwd-POI.hpp>
#include <java/lang/fwd-POI.hpp>
#include <java/math/fwd-POI.hpp>
#include <java/time/temporal/fwd-POI.hpp>
#include <java/util/fwd-POI.hpp>
#include <java/util/regex/fwd-POI.hpp>
#inc... |
#include <cosma_run.hpp>
#include <gtest/gtest.h>
#include <gtest_mpi/gtest_mpi.hpp>
MPI_Comm subcommunicator(int new_P, MPI_Comm comm = MPI_COMM_WORLD) {
// original size
int P;
MPI_Comm_size(comm, &P);
// original group
MPI_Group group;
MPI_Comm_group(comm, &group);
// new comm and new... |
// 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 ... |
/*
Copyright (c) 2003-2007 <NAME> <<EMAIL>>
Modified by <NAME> <<EMAIL>>
Copyright (c) 2015-2018
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 cod... |
#include <bits/stdc++.h>
#include "validate.h"
using namespace std;
long long safe_parse(const string& to_parse) {
try {
size_t idx;
long long a = stoll(to_parse, &idx, 10);
if(idx != to_parse.size())
wrong_answer("Wrong answer: String contains non-digit characters (%s).\n", to_parse.data());
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.