text stringlengths 3.08k 22k |
|---|
/*
Exercise 7.28 (Palindromes):
Palindrome: string that's spelled the same way forward and backward.
Recursive function testPalindrome that returns true if a string is a palindrome.
Exercise 7.32 pg 335-336 (Find The Minimum Value in an array):
Recursive function recursiveMinimum that accepts integer array, starting... |
#include <iostream>
#include <vector>
#include <opencv2/core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/video.hpp>
#include <opencv2/cudaoptflow.hpp>
#include <opencv2/cudaimgproc.hpp>
#include <opencv2/cudaarithm.hpp>
using namespace std;
... |
/*
* ESP32 Ping library
*
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software
* and its documentation for any purpose and without fee is hereby
* granted, provided that the above copyright notice appear in all
* copies and that both that the copyright notice and this
* permission no... |
// @@@LICENSE
//
// Copyright (c) 2010-2013 LG Electronics, 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 require... |
#include "datatypes/raster.h"
#include "datatypes/raster/typejuggling.h"
#include "raster/profiler.h"
#include "raster/opencl.h"
#include "operators/operator.h"
#include "msg_constants.h"
#include "util/sunpos.h"
#include <limits>
#include <memory>
#include <math.h>
#include <ctime> // struct std::tm
#include <str... |
/// @file
/// @brief an utility to extract level of autocorrelations per beam for port mapping test
/// @copyright (c) 2007 CSIRO
/// Australia Telescope National Facility (ATNF)
/// Commonwealth Scientific and Industrial Research Organisation (CSIRO)
/// PO Box 76, Epping NSW 1710, Australia
/// <EMAIL>
///
/// This f... |
#include <math.h>
#include <uWS/uWS.h>
#include <iostream>
#include <string>
#include "json.hpp"
#include "PID.h"
// for convenience
using nlohmann::json;
using std::string;
// For converting back and forth between radians and degrees.
constexpr double pi() { return M_PI; }
double deg2rad(double x) { return x * pi() ... |
#include "Def.h"
#include "GridRTree.h"
#include "Grid.h"
#include "BCell.h"
#include "Data.h"
#include <ctime>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <cstdlib>
using namespace std;
#define CORE_POINT 1
#define NOT_CORE_POINT 0
#define SUCCESS 0
#define FAILURE -3
#define NO... |
/*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2021, by the GROMACS development team, led by
* <NAME>, <NAME>, <NAME>, and <NAME>,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*
* GROMACS is f... |
#include <vector>
#include "json/json.h"
#include "TMath.h"
#include "DEMPEvent.hxx"
#include "Asymmetry.hxx"
#include "SigmaL.hxx"
#include "SigmaT.hxx"
#include "SigmaLT.hxx"
#include "SigmaTT.hxx"
#include "Constants.hxx"
#include "correction.h"
#include "SigmaCalc.hxx"
using namespace std;
using namespace con... |
// license:BSD-3-Clause
// copyright-holders:<NAME>
/***************************************************************************
aquarius.c
Functions to emulate the video hardware of the aquarius.
***************************************************************************/
#include "emu.h"
#include "includes/aq... |
/*
SampledAnisotropicDiffGather.cpp
<NAME>
10/20/2010
*/
#include <algorithm>
using namespace std;
#include <math.h>
#include "SampledAnisotropicDiffGather.hpp"
#include "Utility.hpp"
#include "Exception.hpp"
SampledAnisotropicDiffGather::SampledAnisotropicDiffGather(const JacobianField & jacobian_field, con... |
/* -*- mode: C++; indent-tabs-mode: nil; -*- */
/** \file
* \brief The main SMNChai program.
*
* Requires YARP.
*
* This file is part of the openBuildNet simulation framework
* (OBN-Sim) developed at EPFL.
*
* \author <NAME> (<EMAIL>)
*/
#include <cstdlib> // getevn
#include <signal.h>
#include <iostream... |
// Copyright (c) 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 "ipc/ipc_message.h"
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include "base/atomic_sequence_num.h"
#include "base/loggin... |
/*
* Copyright (c) 2016 Shanghai Jiao Tong 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.... |
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
<NAME>, <EMAIL>
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with San... |
/*
* Regular expression implementation.
* Supports only ( | ) * + ?. No escapes.
* Compiles to NFA and then simulates NFA
* using Thompson's algorithm.
*
* See also http://swtch.com/~rsc/regexp/ and
* <NAME>. Regular Expression Search Algorithm,
* Communications of the ACM 11(6) (June 1968), pp. 419-422.
*
... |
#include "icsneo/communication/packet/canpacket.h"
#include "icsneo/platform/optional.h"
using namespace icsneo;
static optional<uint8_t> CANFD_DLCToLength(uint8_t length) {
if (length < 8)
return length;
switch(length) {
case 0x9:
return uint8_t(12);
case 0xa:
return uint8_t(16);
case 0xb:
retur... |
#include "neural_net.h"
#include "activation.h"
#include <iostream>
#include <vector>
#include "zip.h"
#include <algorithm>
#include <cmath>
#include <random>
NeuralNet::NeuralNet(std::vector<int> s) : _sizes(s)
{
_numLayers = _sizes.size();
std::vector<int> from(_sizes.begin() + 1, _sizes.end());
std::vec... |
//
// Created by Waylon.Yuen on 09/28/2019.
// Copyright © 2019年 Oracragron. All rights reserved.
//
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int const SIZE = 9;
struct Data {
char Bin[SIZE]; //文件讀取到的二進位資料保存陣列
int LengthOfBin; //Bin陣列中的實際內容長度 (... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef ll ptype;
#define REMOVE_REDUNDANT
// content of DSU reference
class dsu{
public:
vector<int> sets;
void init(int n)
{
sets.resize(n);
for(int i=0;i<n;i++)
{
sets[i] = -1;
}
}
... |
#include <ReactESP.h>
#include <Adafruit_ADS1015.h>
#include "../../../config.h"
#include "ads1115.h"
#define SMOOTHING_GAIN 0.2
Adafruit_ADS1115 ads;
ADSSensorInfo::ADSSensorInfo(String addr) {
strcpy(address, addr.c_str());
signalKPath[0] = "";
signalKPath[1] = "";
signalKPath[2] = "";
signalKPath[3] =... |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <math.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include "fastmath.h"
#include "Vec3.h"
#include "Mat3.h"
#include "quaternion.h"
#include "raytrace.h"
#include "Solids.h"
#include "DynamicOpt.h"
#include "SoftBody.h"
... |
// Licensed under the MIT License.
#include <string>
#include <map>
#include <vector>
#include "script.h"
#include "menu.h"
#include "pages.h"
#include "menuitemfunctions.h"
// todo: automate this...
int optionsInThisPage;
void DrawPage(double pageIndex)
{
if (pageIndex == 0.0) {
SetHeader("HEADER");
SetSubHead... |
#include "BenchMuParser230.h"
#include <cmath>
//#include <windows.h>
//-------------------------------------------------------------------------------------------------
#include "muparser230/muParser.h"
using namespace mu;
//-----------------------------------------------------------------------------------------... |
/**
* The MIT License (MIT)
*
* Copyright (c) 2014 <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... |
/*
* Copyright (C) 2011 The Android Open Source Project
*
* 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 app... |
// Core.cpp
#include <cmath>
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <vector>
#include <sstream>
#include "Core.h"
using namespace std;
Core::Core(InputParameter& _inputParameter, Technology& _tech,
MemCell& _cell, ReadParam& _readParam):
inputParamete... |
//-----------------------------------------------------------------------------
// z80asm
// list files
// Copyright (C) <NAME>, 2011-2022
// License: The Artistic License 2.0, http://www.perlfoundation.org/artistic_license_2_0
//-----------------------------------------------------------------------------
#include "i... |
/*
* tiny1614.cpp
*
* Created: 5/16/2020 4:00:58 PM
* Author : MQUEZADA
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/sleep.h>
#include <stdlib.h>
#include "PinMap.h"
#include "TWI_S.h"
#include "SerialIO.h"
#include "PWM.h"
#include "Timer0.h"
#include "Registers.h"
#in... |
/* Accesspoint - station communication without router
* see: https://github.com/esp8266/Arduino/blob/master/doc/esp8266wifi/station-class.rst
* Works with: accesspoint_bare_01.ino
*/
/* Connection table
FTDI ESP8266, ESP-01
---- ---------------
3V3 3V3 (VCC)
3V3 EN (CH_PD)
TX RX
RX TX
... |
#include <GLUT/glut.h>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <iostream>
#include "main.hpp"
#include "func.hpp"
#include "method.hpp"
#include "display.hpp"
struct _State Airplane[N];
struct _Point A, ARRON, AWARD, ADDU... |
#include <glog/logging.h>
#include <leveldb/db.h>
#include <leveldb/write_batch.h>
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/io.hpp"
#include <iostream>
#include <stdlib.h>
//#include <direct.h>
#include <sys/stat.h>
#include <sys/types.h>
//#include <io.h>
#include <iomanip>
#include <cv.h>
//#inclu... |
// 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 may... |
/*
* Copyright (c) 2005, <NAME> and IFS Institute for Software at HSR Rapperswil, Switzerland
* All rights reserved.
*
* This library/application is free software; you can redistribute and/or modify it under the terms of
* the license that is included with this library/application in the file license.txt.
*/
#in... |
#include <QtWidgets>
#include "timeline.h"
#include <QDebug>
#include <QPoint>
#include <QRect>
#define DEFAULT_ZOOM_INTERVAL 1.0f / 32.0f
#define DEFAULT_SCROLL_INTERVAL 1.0f / 32.0f
#define DEFAULT_ZOOM_INTERVAL 1.0f / 32.0f
// TODO: Slots and signals
// TODO: Find correct Qt::Keys for - and + for zooming
// TO... |
/***copyright @ bizhi***/
/***2021/3/27***/
#include "opencv_include_all.h"
#include <iostream>
#include <list>
using namespace cv;
using namespace std;
/***initializing map parameters***/
#define s_len 800//square board pixels length
#define block_pixels 19//square block pixels length and width
#define ran... |
#include <Arduino.h>
#include <Ps3Controller.h>
#include <esp32-hal-ledc.h>
#define LERP_FACTOR 10
#define FORWARD 0
#define BACKWARD 1
#define LEFT 2
#define RIGHT 3
typedef struct {
const uint8_t speed;
const uint16_t angle;
} trajectory;
typedef struct {
const uint8_t pin;
const uint8_t aBit;
const u... |
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace std;
// carregamento do vídeo
cv::VideoCapture videoLoad;
cv::Mat originalCapture, frame;
// Mascaras de efeito
cv::Mat imagemVerde, imagemRosa;
// Cores segmentadas na... |
#include "filter.h"
#include "mbed.h"
#include "electrode.h"
/********************/
/* Global Variables */
/********************/
#define GAIN_VALUE (.1)
#define NOTCH_N (2) // The number of cascaded second-order filters
// making up the notch filter
#define NOTCH_Q (31) ... |
#include <ossim/base/ossimArgumentParser.h>
#include <ossim/base/ossimDpt.h>
#include <ossim/base/ossimFilename.h>
#include <ossim/base/ossimRefPtr.h>
#include <ossim/imaging/ossimImageHandlerRegistry.h>
#include <ossim/imaging/ossimImageDataFactory.h>
#include <ossim/imaging/ossimTiffWriter.h>
#include <ossim/imaging/... |
/*
* Player - One Hell of a Robot Server
* Copyright (C) 2003
* <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 optio... |
/*
* ParticleColorSignedDistance.h
*
* Copyright (C) 2015 by <NAME>
* Alle Rechte vorbehalten.
*/
#include "ParticleColorSignedDistance.h"
#include "mmcore/param/BoolParam.h"
#include "stdafx.h"
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <cstdint>
#include <nanoflann.hpp>
using namespace m... |
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <stack>
#include <deque>
#include <string>
#include <vector>
#include <functional>
#include <tuple>
#include <map>
#include <cctype>
#include <sstream>
#include <iomanip>
#include <cmath>
using namespace std;
typedef string simple_token;
map<string... |
//
//=============================================================================
// MEX Compilation example (with OpenCV 2.4.8):
// mex akaze.cpp -I '..\src\lib\' -L'..\build\lib\Release\' -I'c:\files\libs\opencv\build\include' -L'c:\files\libs\opencv\build\x64\vc10\lib' -lopencv_calib3d248 -lopencv_contrib248 -lopen... |
//==- hier_par_basic.cpp --- hierarchical parallelism API test -------------==//
//
// 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 "retro_light.h"
float retro3d::Light::CalculateIntensityAtVertex(const mmlVector<3> &point, const mmlVector<3> &normal) const
{
float dist = 0.0f;
if (falloff != None) {
switch (type) {
case Direction:
dist = mmlMax(std::numeric_limits<float>::epsilon(), retro3d::Plane(origin, direction).GetDistance(... |
/*
* Copyright (c) 2019 <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, dis... |
#include <ncException.h>
using namespace std;
using namespace netCDF;
using namespace netCDF::exceptions;
// Default object thrown if a netCDF exception is encountered.
NcException::NcException(const string& name,const string& complaint,const char* file,int line) :
message(complaint),
exceptionName(name),
fileN... |
/*
This file is part of CubicVR.
Copyright (C) 2003 by <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, ... |
#include <iostream>
#include <vector>
#include <stdlib.h> // srand y rand
#include <algorithm> // sort y random_shuffle
#include <time.h>
using namespace std;
int EVALS=0; // Llamadas a evaluación
const int LIMIT=100000; // Límite de evaluaciones
const int CHROMOSOMES=50; // Nº cromosomas
float PROB_MUT=0.1;... |
//----------------------------------------------------------------------------
//
// License: See top level LICENSE.txt file.
//
// Author: <NAME>
//
// Description: Test of ossimBandLutFilter.
//
// $Id$
//----------------------------------------------------------------------------
#include <iostream>
using namespa... |
#include "math.h"
#include "tinyxml.h"
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <climits>
// ITK Dependencies
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkImage.h"
#include "itkImageRegionIteratorWithIndex.h"
const unsigne... |
/*Samsung wants to explore some of the rare elements for its semiconductor manufacturing. Scientists use one vehicle to explore the region in order to find the rare elements. The vehicle can move only in explored region where roads have already been constructed. The vehicle cannot move on unexplored region where roads ... |
/* Copyright 2021 The TensorFlow Authors. 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 required by applicable law or a... |
/******************************************************************************
** DARWIN: A FRAMEWORK FOR MACHINE LEARNING RESEARCH AND DEVELOPMENT
** Distributed under the terms of the BSD license (see the LICENSE file)
** Copyright (c) 2007-2017, <NAME>
** All rights reserved.
**
************************************... |
#include <algorithm>
#include <fstream>
#include <glibmm.h>
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/md5.h>
#include <random>
#include <sstream>
#include <vector>
#include "evp_cipher.h"
#include "helper.h"
#include "keychain.h"
namespace {
using OpensslKeyData = std::pair<EVPKey, EVPIv>... |
//<NAME>
//To compile, please use: g++ -o proj main.cpp -lm -fopenmp
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <omp.h>
// print debugging messages?
#ifndef DEBUG
#define DEBUG false
#endif
// setting the number of threads:
#ifndef ... |
#include <ros/ros.h>
#include <visualization_msgs/Marker.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <Eigen/Dense>
#include <tms_msg_ss/Beacon.h>
#include "kalman-Ndof.hpp"
using namespace std;
using namespace Eigen;
#define N 4
ros::Subscriber beacon_sub;
ros::Publisher marke... |
// Author: <NAME>
// Hill Cipher
#include <bits/stdc++.h>
using namespace std;
#define LONG int64_t
#define MAT vector<vector<int64_t>>
#define CHAR_SET_SIZE 26
#define LOWER_LIMIT 65
string read_file(string file_name)
{
char temp; string data = "";
ifstream file(file_name.c_str(), ios::binary);
if(!fi... |
//==========================================================================================
// Secret Legacy of the Ancient Caves (SLAC)
//
// Copyright (c) 2020-2021 <NAME> / Holy Meatgoat Software
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and assoc... |
#include "TSL2561.h"
#include "config.h"
extern Serial pc;
#define DEBUG_PRINTX(z,x) if(z==1) pc.printf(x);
#define DEBUG_PRINTLNX(z,x) if(z==1) {pc.printf(x); pc.printf("\r\n");}
#define DEBUG_PRINTXY(z,x, y) if(z==1) pc.printf(x, y);
#define DEBUG_PRINTLNXY(z,x, y) if(z==... |
/*
Real Time File Streaming copyright (c) 2014 <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,... |
#include <future>
#include "encryptionlayer.hpp"
#include "GF256.hpp"
#include "sbox.hpp"
#include "omp.h"
// Enumerations of the differents AES Mode (128, 192 and 256)
enum AES_Mode : size_t {
AES_128 = 128,
AES_192 = 192,
AES_256 = 256
};
extern std::array<uint8_t, 255> round_const;
// Homomorphic Eva... |
/*
* TODO This file needs to be rewritten and integrated better
* _______ ____ __ ___ ___
* \ _ \ \ / \ / \ \ / / ' ' '
* | | \ \ | | || | \/ | . .
* | | | | | | || ||\ /| |
* | | | | | | ... |
/*---------------------------------------------------------------------------------
Copyright (C) 2007 Acekard, www.acekard.com
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 restrictio... |
/*
** hw_draw2d.cpp
** 2d drawer Renderer interface
**
**---------------------------------------------------------------------------
** Copyright 2018-2019 <NAME>
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following c... |
//Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved.
//For the list of developers, see <http://www.MercuryDPM.org/Team>.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions are met:
// * Redistributions ... |
#include "DSClient.h"
#include <signal.h>
#include <fstream>
#include <cmdline.h>
#include <netinet/in.h>
#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>
#include <errno.h>
#include <arpa/inet.h>
#include <linux/ip.h>
using namespace std;
static int signaled = 0;
static int state = 0; ... |
/*
* Copyright 2003, 2004, 2005, 2006 PathScale, Inc. All Rights Reserved.
*/
/*
Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the ... |
#include "Terrain.hh"
#include <glow/objects/Texture2D.hh>
void gamedev::Terrain::Init(SharedEngineECS& ecs) { mECS = ecs; }
void gamedev::Terrain::setGroundMesh(std::filesystem::path mesh_path)
{
mMeshGround.loadFromFile(mesh_path.string());
mVaoGround = mMeshGround.createVertexArray();
}
void gamedev::Terra... |
/*
*
* Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
*
* 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 opti... |
#include "uitreeviewglobalsearch.hpp"
#include "projectsearch.hpp"
#include <eepp/graphics/primitives.hpp>
#include <eepp/ui/doc/syntaxdefinitionmanager.hpp>
#include <eepp/ui/doc/syntaxtokenizer.hpp>
#include <eepp/ui/uicheckbox.hpp>
#include <eepp/ui/uiscenenode.hpp>
#include <eepp/ui/uistyle.hpp>
UITreeViewGlobalSe... |
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <random>
#include <utility>
#include <cstdio>
#include <cmath>
#include <glm/glm.hpp>
#include <glm/gtx/io.hpp>
#include <png.h>
class RandomVectorGenerator
{
private:
std::mt19937_64 generator;
std::normal_distribution<>... |
// Copyright 2020 <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... |
//
// Author: <NAME> <<EMAIL>>
// Copyright (c) 1994-2018 <NAME>
//
// The MIT License
//
// 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 limitati... |
//
// Created by Dado on 2019-05-17.
//
#include "xatlas_dump.hpp"
#include <cstdint>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <stb/stb_image_write.h>
#include <poly/baking/xatlas.h>
static void RandomColor(uint8_t *color)
{
for (int i = 0; i < 3; i++)
color[i] = uint8_t((rand() %... |
#include "../include/ascii.hpp"
void ascii::manifesto()
{
/*
arte. l'ultimo vero movimento artistico totale: musica, letteratura, pittura, architettura....
tutto il resto e' noooooooiaaaaaaa
*/
static std::vector<std::string> manifesto_futurista =
{
"Manifesto dei futurismo.",
"",
"1. Noi vogliamo cantare... |
#include<unordered_map>
#include<stack>
#include<vector>
#include<string>
#include<iostream>
#include<memory>
#include<time.h>
#include<random>
#include<algorithm>
#include<cassert>
inline int rand_between(int a, int b) {
if (a >= b) {
return a;
}
return rand() % (b - a) + a;
}
... |
/**
* HebbianLearning.cpp
*
* @date Feb 2, 2011
* @author <NAME>
* @see HebbianLearning.hpp
*/
#include <algorithm>
#include <math.h>
#include "HebbianLearning.hpp"
//#define DEBUG_LEARNING
//#define DEBUG_LEARNING_VERBOSE
/** default parameterization, @see setParameters */
static const float DEFAULT_PARAM... |
//
// Created by kellerberrin on 28/02/18.
//
#include "kel_utility.h"
#include "kel_exec_env.h"
#include "kgl_variant_factory_vcf_parse_cigar.h"
#include <edlib.h>
#include <boost/algorithm/string.hpp>
#include <sstream>
namespace kgl = kellerberrin::genome;
namespace bt = boost;
bool kgl::ParseVCFCigar::parse... |
#include "system/EntityManager.h"
#include "utility/math/Vector.h"
#include "utility/math/VectorMath.h"
#include "io/ascii/Graphics.h"
#include "io/ascii/Input.h"
#include <algorithm>
using namespace Ascii;
namespace
{
struct LinkData
{
LinkData(int previous) :
prevLinkedId(previous),
nextLinkedI... |
#include <stdio.h>
#include <assert.h>
char data[0x10000];
//-----------------------------------------------------------------------------
void write_mem_1(FILE * out, FILE * ucf, int bank, int bit, const char * data)
{
fprintf(out, "-- content of m_%d_%d\r\n", bank, bit);
for (int col = 0; col < 16; col++)
... |
#include "AudioSystem.h"
#include <fmod_studio.hpp>
#include <fmod_errors.h>
#include <SDL_log.h>
#include <vector>
#include "SoundEvent.h"
namespace
{
FMOD_VECTOR VecToFMOD(const Vector3& in)
{
// Convert from our coordinates (+x forward, +y right, +z up)
// to FMOD (+z forward, +x right, +y up)
FMOD_VECTOR v... |
/******************************************************************************
** Copyright (C) 1995 CEA
*******************************************************************************
**
** UNIT
**
** Version: 1.0
**
** Author: <NAME>
**
** Date: 16/03/2000
**
** File: wcomp.cc... |
/*MIT License
Copyright (c) 2016 <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, distribu... |
#include "step.h"
using namespace Vipster;
Step::Step(AtomFmt fmt, const std::string &c)
: StepMutable{std::make_shared<atom_source>(fmt),
std::make_shared<BondList>(),
std::make_shared<std::string>(c)}
{}
Step::Step(const Step& s)
: StepMutable{std::make_shared<atom_sourc... |
#include "game.h"
#include "keyboard.h"
#include "level.h"
#include "image_base.h"
#include "animation.h"
#include "vgagfx.h"
#include "physics.h"
#include "version.h"
#include "vector.h"
#include "exception.h"
#include "compiled_sprite.h"
#include "joystick.h"
#include "game_save.h"
#include "text.h"
#include "i18n.h"... |
/**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: <NAME>
*/
#include "particle_filter.h"
#include <algorithm>
#include <chrono>
#include <array>
#include <boost/format.hpp>
#include <boost/log/trivial.hpp>
#include <cmath>
#include <ctime>
#include <eigen3/Eigen/Geometry>
#include <iostream>
#incl... |
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <csignal>
#include <map>
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <inttypes.h>
#include <unistd.h>
#include <sys/time.h>
#include "rdtsc.h"
#include "rtm.h"
using namespac... |
// https://leetcode-cn.com/problems/largest-rectangle-in-histogram/
#include <cstdio>
#include <vector>
using namespace std;
class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
//printf("============\n"); for (auto e : heights) { printf(" %d", e); }; printf("\n");
int n = heights.size();
i... |
#include "core.h"
/*! @brief The constructor. */
Core::Core(QObject *parent) : QObject(parent) {
connect(basis, &Basis::warn, this, &Core::got_warning);
connect(basis, &Basis::send, this, &Core::got_message_from_script);
connect(basis, &Basis::search_again, this, &Core::got_message_to_search_again);
connect(ba... |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2015 <NAME>, Amsterdam, the Netherlands.
// Copyright (c) 2013-2015 <NAME>, Lodz, Poland.
// This file was modified by Oracle on 2014, 2015, 2016.
// Modifications copyright (c) 2014-2016 Oracle and/or its affiliates.
// Contributed and/or m... |
//<NAME>
#include "table.h"
#include <iostream>
#include <unordered_map>
#include <string>
#include <fstream>
#include <cctype>
#include <algorithm>
using namespace std;
bool isNumber(const string& str)
{
for (char const &c : str) {
if (std::isdigit(c) == 0) return false;
}
return true;
}
unorde... |
////////////////////////////////////////////////////////////////////////////
// Created : 06.05.2009
// Author : <NAME>
// Copyright (C) GSC Game World - 2009
////////////////////////////////////////////////////////////////////////////
#include "pch.h"
#include "create_body_cmd.h"
#include "body_node.h"
#in... |
// ClockTool.cc
// Copyright (c) 2003 - 2006 <NAME> (fluxgen at fluxbox dot org)
// and <NAME> (rathnor at users.sourceforge.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... |
// license:BSD-3-Clause
// copyright-holders:<NAME>,<NAME>
/***************************************************************************
delegate.cpp
Templates and classes to enable delegates for callbacks.
***************************************************************************/
#include "delegate.h"
#i... |
///
/// Parallel distributed dense matrix-matrix multiplication by the
/// SUMMA algorithm.
///
///
#include <upcxx.h>
#include "matrix.h"
using namespace upcxx;
#include <cstdlib>
#include <algorithm> // for std::generate
#include <time.h>
#include <sys/time.h>
// For debugging and testing
#include "verify.cpp"... |
//
// Created by basti on 19.12.2020.
//
#include <iostream>
#include <logging.h>
#include "ArgumentCallbackFunctions.h"
#include "version.h"
#include <sstream>
using namespace std;
int port = 5555;
bool generateAPI = true;
bool cliHighlighting = true;
BaseProductionStation *newStartStation = nullptr;
extern BasePr... |
// Copyright 2019 <NAME>
#include "SevenSeg.h"
const int SEG_WIDTH = 80;
const int SEG_HEIGHT = 90;
const int BAR_HEIGHT = 10;
int hex_digit[16] = {
0b00111111, // 0
0b00000110, // 1
0b01011011, // 2
0b01001111, // 3
0b01100110, // 4
0b01101101, // 5
0b01111101, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.