text stringlengths 7 961k |
|---|
//
// KinetManager.cpp
// ckLightsExample
//
// Created by Alex Olivier on 11/17/14.
//
//
// A manager class for Philips ColorKinetics lighting products
// The manager class can perform high-level testing functions
// such as cycling all lights or strands
// The manager class holds all references to KinetPowerSup... |
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp ma... |
#include <chrono>
#include <fstream>
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include <gtest/gtest.h>
#include <AVSCommon/SDKInterfaces/KeyWordObserverInterface.h>
#include <AVSCommon/SDKInterfaces/KeyWordDetectorStateObserverInterface.h>
#include <AVSCommon/AVS/AudioInputStream.h>
#... |
/*=========================================================================
Program: Visualization Toolkit
Module: GraphItem.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is dis... |
/*
Author: Jerry Yang C.H. (tico88612)
Date: 2020/1/24
*/
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#incl... |
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2016-2019 The PIVX developers
// Copyright (c) 2020 The Klimatas developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
#include "GAMER.h"
extern int KH_RefineShearMaxLv;
extern int KH_PeriodicZFactor;
//-------------------------------------------------------------------------------------------------------
// Function : Flag_KelvinHelmholtzInstability
// Description : Check if the element (i,j,k) of the input data satisfies ... |
#include "../../csgo.hpp"
namespace render
{
namespace fonts
{
HFont m_main;
HFont m_menu;
void init()
{
const auto font = [ & ]( HFont & font, const char* name, const int size, const int weight, const int flags ) -> void
{
font = ctx::csgo.surface->CreateFont_();
ctx::csgo.font_manager->SetFo... |
// Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... |
/*
* Copyright 2020 Rockchip Electronics Co. LTD
*
* 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... |
/**
* Copyright (C) 2019-2020 Xilinx, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may
* not use this file except in compliance with the License. A copy of the
* License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... |
#include <fsciolib/fixedpoint.hpp>
#include <fsciolib/fscio.hpp>
#include "test_api.hpp"
void test_fixedpoint::create_instances()
{
{
// Various ways to create fixed_point128
fscio::fixed_point128<18> a(12345667);
fscio::fixed_point128<18> b(12345667);
fscio::fixed_point128<16> c(1234... |
// 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 "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
#include ... |
//////////////////////////////////////////////////////////////
// PseudoCmdInterface.cc: Fills pseudocolor LUT
//////////////////////////////////////////////////////////////
#include "PseudoCmdInterface.h"
#include "Cmd.h"
#include "CmdList.h"
#include "PseudoValue.h"
#include "ColorModel.h"
#include "SwatchView.h"
#i... |
#define _GLIBCXX_USE_CXX11_ABI 1
#include <omp.h>
#include <sstream>
#include "../src/util/util.h" // arguments
#include "../src/util/file_graph.h" // graph
#include "../src/sampler/vc_sampler.h" // sampler
#include "../src/mapper/lookup_mapper.h" // mapper
... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void print(vector<int> v) {
for (int i=0; i<v.size(); i++)
cout << v[i] << " ";
cout << endl;
}
int binarySearch(vector<int> &v, int val) {
int low = 0;
int big = v.size()-1;
int mid = (big+low)/2;
while (low <= big) {
mi... |
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGfx/Bitmap.h>
#include <LibGfx/ShareableBitmap.h>
#include <LibGfx/Size.h>
#include <LibIPC/Decoder.h>
#include <LibIPC/Encoder.h>
#include <LibIPC/File.h>
namespace Gfx {
ShareableBitmap::Shar... |
#include "macro.cpp"
string folder="../../data/";
string train_file="train_wkt_v4.csv";
//";
// For only serial code //////////
string grid_file="grid_sizes.csv";
ifstream read_write::train_fp((folder+train_file).c_str()); // handle for input image file
ifstream read_write::grid_fp((folder+grid_file)... |
/*
* BearLibTerminal
* Copyright (C) 2013-2016 Cfyz
*
* 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... |
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as f... |
#include <StdAfx.h>
#include <UI/Dialogs/Editors/restriction/RestrictEditor.h>
#include <UI/Dialogs/Editors/restriction/ResAndOrEditor.h>
#include <UI/Dialogs/Editors/propeditor/ipropeditor.h>
#include <core/sortlistdata/resData.h>
#include <core/mapi/mapiMemory.h>
#include <core/utility/output.h>
#include <core/addin/... |
/*=========================================================================
*
* Copyright NumFOCUS
*
* 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.or... |
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
const int mod = 1000000009;
int C[31][31];
int F[31];
int ways[31][31]; // [l][r] to pick words from l to r i... |
#include "patches.h"
namespace patches
{
bool PatchAll()
{
if (*config::patchDisableChargenPrecache)
PatchDisableChargenPrecache();
if (*config::patchEnableAchievementsWithMods)
PatchEnableAchievementsWithMods();
if (*config::patchFormCaching)
Patch... |
#ifndef _CPPCHALLENGER_CLASS
#define _CPPCHALLENGER_CLASS
#include "CppChallengerBase.hpp"
#include "FederateConfigParser.h"
#include "FederateConfig.h"
#include <boost/lexical_cast.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <ctime>
#include <map>
... |
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "VulkanWindow.h"
#include <vulkan/vulkan.h>
#ifdef Q_OS_LINUX
#undef None
#undef Status
#undef Bool
#undef CursorShape
#endif
#include <QVulkanInstance>
#include <QPlatformSurfaceEvent>
#include <QThread>
#include <QCoreApplication>
#include <QLoggingCategory>
#inc... |
int main(int argc, char **argv) {
int sum = 0;
for (int i = 1; i <= argc; ++i) {
sum += i;
}
return sum;
} |
/*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Product and Trade Secret source code contains trade secrets ... |
// This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation... |
#include "../../../include/common/monolish_common.hpp"
#include "../../../include/common/monolish_dense.hpp"
#include "../../../include/common/monolish_logger.hpp"
#include "../../../include/common/monolish_matrix.hpp"
#include "../../internal/monolish_internal.hpp"
namespace monolish {
namespace matrix {
template <t... |
#include "filesys.h"
BBFile::BBFile( FILE *file ):_file(file){
}
BBFile::BBFile( BBString *file,int mode ):_file(0){
const char *md;
switch( mode ){
case READ:md="rb";break;
case WRITE:md="wb";break;
case READWRITE:md="r+b";break;
default:bbError( "Illegal file mode" );
}
_file=fopen( file->c_str(),md );
}
... |
//=================================================================================================
/*!
\file GUILayout_Stats.cpp
Game Play Library
Game GUI Layouts Source
\author Taylor Clark
\date July 10, 2006
This source file contains the implementation for the game GUI layout classes.
*/
//=================... |
#include "PursuePathBehavior.h"
MathLibrary::Vector2 PursuePathBehavior::findDestination(Agent* owner)
{
MathLibrary::Vector2 targetPosition = getTarget()->getWorldPosition();
MathLibrary::Vector2 targetVelocity = getTarget()->getVelocity();
return targetPosition + targetVelocity;
} |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"
#include "WindowManager.h"
#include "MonarchFactory.h"
#include "CommandlineArgs.h"
#include "../inc/WindowingBehavior.h"
#include "FindTargetWindowArgs.h"
#include "WindowManager.g.cpp"
#include "../../types/inc/utils.hpp"
u... |
/*
BSD 3-Clause License
Copyright (c) 2020, Brenden Davidson
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, ... |
// Name: SeaOfThieves, Version: 2.0.23
#include "../pch.h"
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Functions
//--------------------------------------------... |
/******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
* Modifications Copyright (c) 2018 LG Electronics, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file exce... |
#include "duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp"
#include "duckdb/main/client_context.hpp"
#include "duckdb/parser/expression/function_expression.hpp"
#include "duckdb/planner/expression/bound_aggregate_expression.hpp"
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
#incl... |
#ifndef CPU_TEST_CLASS_H
#define CPU_TEST_CLASS_H
#include <chrono>
#include <iostream>
#include "matar.h"
using namespace std;
using namespace std::chrono;
class cpu_test_class {
public:
int size1, size2, size3, size4, size5, size6;
int length;
//arrays for testing
//FArray
FArray <int> f_arr1;
FArra... |
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include "Tools/scan_number.hpp"
#include "Grid/Grid.hpp"
using namespace std;
int main(int argc, const char * argv[]) {
srand (time(NULL));
cout <<"\033[2J\033[1;1H"; // clears screen
cout << " __ __ ______ _ _____ ____ __ __ _... |
// Copyright 2014 epc Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
#include "Math.h"
#include <cmath>
namespace epc
{
std::default_random_engine gRandomEngine;
std:... |
// ------------------------------------ //
#include "ClientApplication.h"
using namespace Leviathan;
// ------------------------------------ //
DLLEXPORT ClientApplication::ClientApplication(){
}
DLLEXPORT ClientApplication::~ClientApplication(){
} |
// Copyright 2018-2020 mik14a / Admix Network. All Rights Reserved.
#include "Vox.h"
#include "Chunk/Layr.h"
#include "Chunk/Main.h"
#include "Chunk/Matl.h"
#include "Chunk/Matt.h"
#include "Chunk/Pack.h"
#include "Chunk/Rgba.h"
#include "Chunk/Size.h"
#include "Chunk/Xyzi.h"
#include "Node/Group.h"
#include "Node/Sha... |
// Copyright 2018 Google 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 w... |
/* Copyright 2017 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... |
#ifndef CAFFE_LAYER_H_
#define CAFFE_LAYER_H_
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/layer_factory.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/coords.hpp"
#include "caffe/util/device_alternate.hp... |
// 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 "base/nix/xdg_util.h"
#include <string>
#include "base/base_paths.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#inclu... |
//
// File: AbstractOptimizer.cpp
// Created by: Julien Dutheil
// Created on: Mon Dec 22 12:18:09 2003
//
/*
Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
This software is a computer program whose purpose is to provide classes
for numerical calculus.
This software is governed by the Ce... |
// Copyright 2019 The Fuchsia 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 "garnet/bin/trace2json/trace_parser.h"
#include <lib/syslog/cpp/macros.h>
namespace tracing {
FuchsiaTraceParser::FuchsiaTraceParser(std::ostre... |
// Use of this source code is governed by a BSD-style license
// that can be found in the License file.
//
// Author: Shuo Chen (chenshuo at chenshuo dot com)
#include "muduo/base/TimeZone.h"
#include "muduo/base/noncopyable.h"
#include "muduo/base/Date.h"
#include <algorithm>
#include <stdexcept>
#include <string>
#... |
#include <event/event.h>
#include <event/manager.h>
#include <logger/logger.h>
#include "handler_timer1.h"
bool HandlerTimer1::Init(HandlerContext* context) {
EventManager* mgr = EventManager::GetManager();
std::string handler_name = context->GetHandlerName();
timer_ = new Timer("timer1");
timer_->SetTimer(1... |
/*
* Handles the BLE connection between Feather Bluefruit LE and Unity
* https://www.adafruit.com/product/3235
*/
#include <Adafruit_BLE.h>
#include <Adafruit_BluefruitLE_SPI.h>
#include "BluefruitConfig.h"
#include "Adafruit_BluefruitLE_UART.h"
#include "util.h"
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLU... |
#include "MaskInfo.h"
MaskInfo::MaskInfo(qrInfo* inf) : info(inf){}
void MaskInfo::fillData(std::vector<bool>& dataFinal, QR_Field& qr_field)
{
std::cout << "Writing QR Code ...\n";
genFormatInfo();
if (info->version + 1 >= 7){
genVersionInfo();
}
for (int i = 0; i < info->size; i++){
qr_field.push_back(std:... |
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// 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 re... |
// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp-simd %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,omp50 -f... |
// Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2018 The PIVX developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "utilitydialog.h"
#inc... |
//------------------------------------------------------------------------------
// Memory.cc
//------------------------------------------------------------------------------
#include <memory>
#include <cstdlib>
#include <cstring>
#include "Memory.h"
#if ORYOL_USE_VLD
#include "vld.h"
#endif
namespace Oryol {
//... |
// Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2018-2019 The Bitnow Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licen... |
#include "bmm150.h"
#include <Arduino.h>
#include <Wire.h>
BMM150::BMM150()
{
}
int8_t BMM150::initialize(void)
{
//Wire.begin();
/* Power up the sensor from suspend to sleep mode */
set_op_mode(BMM150_SLEEP_MODE);
delay(BMM150_START_UP_TIME);
/* Check chip ID */
uint8_t id = i2c_read(BMM150_CHIP_ID_A... |
// -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*-
#include "SyntaxOptions.h"
#include <vector>
#include <iostream>
#include "moses/StaticData.h"
#include "moses/TypeDef.h"
#include "moses/Factor.h"
#include "moses/InputFileStream.h"
namespace Moses {
SyntaxOptions::
SyntaxOptions()
: s2t_parsing_algo(... |
#include "Timer.h"
/* Null, because instance will be initialized on demand. */
Timer* Timer::instance = NULL;
Timer* Timer::getInstance() {
if (instance == NULL) {
// If no object is created at all, it will create one and store the pointer pointing on itself.
instance = new Timer();
}
// If an object i... |
// Copyright (c) 2019, QuantStack and Mamba Contributors
//
// Distributed under the terms of the BSD 3-Clause License.
//
// The full license is in the file LICENSE, distributed with this software.
#ifndef MAMBA_UTIL_HPP
#define MAMBA_UTIL_HPP
#include <array>
#include <iomanip>
#include <limits>
#include <random>
#... |
#include "tools/ToolsCommon.h"
#include "tools/Debug.h"
#include <intrin.h>
size_t alignToIndex(size_t align)
{
ASSERT(align > 0, "Can not align to 0 alignment");
unsigned long index;
unsigned char isNonzero;
isNonzero = _BitScanReverse64(&index, static_cast<unsigned long long>(align));
if (isNonze... |
#include <gtest/gtest.h>
#include <MonteCarloTreeSearch.h>
#include <NeuralNetworks/DefaultNeuralNet.h>
#include <TicTacToe/TicTacToeAdapter.h>
#include <tuple>
#include <thread>
#include <vector>
#include <MultiThreadingNeuralNetManager.h>
TEST(MonteCarloTreeSearch, test_sum_vector)
{
std::vector<int> test{ 0,1,2,3... |
// Copyright 2017 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 "content/browser/storage_partition_impl.h"
#include <string>
#include "base/test/bind.h"
#include "build/build_config.h"
#include "content/publ... |
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#endif
#include "splashscreen.h"
#include "networkstyle.h"
#... |
// Copyright (c) 2017-2019, The Monero Project
//
// 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
/... |
/*
* 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... |
//===--- Differentiation.cpp - SIL Automatic Differentiation --*- C++ -*---===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2018 - 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
#include <opencv2/opencv.hpp>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
using namespace cv;
using namespace std;
#define MAX_NUM 500 // 预期最大细胞数量
#define WIDTH 640 //图片宽度
#define HEIGHT 480 //图片高度
int label[HEIGHT][WIDTH]; //每个像素点的标记,其大小代表细胞序号
uchar pixel[HEIGHT][WIDTH]; //记录每个像素点的灰度值
int area[MAX... |
/*
* FILE: 918A.cpp
*
* @author: Arafat Hasan Jenin <arafathasanjenin[at]gmail[dot]com>
*
* LINK:
*
* DATE CREATED: 29-01-18 20:37:20 (+06)
* LAST MODIFIED: __last_modified
*
* DESCRIPTION:
*
* DEVELOPMENT HISTORY:
* Date Version Description
* --------------------------------------------------... |
/*
* ArcScripts for ArcEmu MMORPG Server
* Copyright (C) 2009 ArcEmu Team <http://www.arcemu.org/>
* Copyright (C) 2008-2009 Sun++ Team <http://www.sunscripting.com/>
* Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/>
* Copyright (C) 2007-2008 Moon++ Team <http://www.moonplusplus.info/>
*
* This p... |
#include "novaembed.h"
#include "ui_novaembed.h"
#include <QFileDialog>
#include <QTreeView>
#include <QDebug>
#include <QDir>
#include <QStatusBar>
#include <QMessageBox>
#include <QPixmap>
#include <QSettings>
#include <QUrl>
#include <QtCore>
#include <QDesktopServices>
//#include <QHostInfo>
#include <QDirIterator>... |
#include "hwlib.hpp"
#include "TEA5767.hpp"
int main( void ){
namespace target = hwlib::target;
auto scl = target::pin_oc( target::pins::d8 );
auto sda = target::pin_oc( target::pins::d9 );
auto i2c_bus = hwlib::i2c_bus_bit_banged_scl_sda(scl, sda);
auto oled = hwlib::glcd_oled( i2c_bus, 0x3c )... |
#include "SelectionHandle.hpp"
void SelectionHandle::setup(const ofRectangle& bounds, const ofVec2f position, const float radius) {
m_bounds = bounds;
m_position = position;
m_radius = radius;
m_radius_double = radius * 2.f;
m_color.set(255, 0, 0);
m_alpha_min = 51;
m_alpha_max = 230;
... |
// Local-Hyperion includes
#include "LedDeviceNanoleaf.h"
#include <ssdp/SSDPDiscover.h>
#include <utils/QStringUtils.h>
// Qt includes
#include <QEventLoop>
#include <QNetworkReply>
#include <QtEndian>
//std includes
#include <sstream>
#include <iomanip>
// Constants
namespace {
const bool verbose = false;
const b... |
/*************************************************************************/
/* memory_pool_dynamic_prealloc.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... |
#include <TestSupport.h>
#include <ApplicationPool2/Process.h>
using namespace Passenger;
using namespace Passenger::ApplicationPool2;
using namespace std;
namespace tut {
struct ApplicationPool2_OptionsTest {
ApplicationPool2_OptionsTest() {
}
};
DEFINE_TEST_GROUP(ApplicationPool2_OptionsTest);
TEST_METH... |
/*
* lists_testcase.cpp
*
* Created on: 2013-4-9
* Author: yinqiwen
*/
#include "db.hpp"
#include <string>
using namespace ardb;
void test_lists_zip_lpush(Ardb& db)
{
DBID dbid = 0;
db.LClear(dbid, "mylist");
int ret = db.LPushx(dbid, "mylist", "value0");
CHECK_FATAL(ret != 0, "lpushx mylis... |
#include "Fuji_Internal.h"
#if MF_DISPLAY == MF_DRIVER_X11
#include "MFWindow_Internal.h"
#include "MFDisplay_Internal.h"
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include "X11_linux.h"
struct MFWindow_X11 : MFWindow
{
Window window;
Colormap colorMap;
XSizeHints *sizeHints;
};
extern Display *xdisplay;
... |
#include <array>
#include <cstddef>
#include <iostream>
#include <queue>
#include <tuple>
namespace {
using std::size_t;
constexpr size_t max_size {20u};
using Grid = std::array<std::array<bool, max_size>, max_size>;
Grid get_grid(const size_t n, const size_t m)
{
Grid grid {};
... |
//
// ccon
//
// Jun-2019, Michael Lindner
// MIT license
//
#include "blackboard.h"
#include <cassert>
namespace ccon
{
///////////////////
Blackboard::Blackboard(const std::string& prompt)
: m_prompt{prompt}
{
startNewInputLine();
}
std::size_t Blackboard::countLines() const
{
return m_content.size();
}... |
// Copyright 2014 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.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_part... |
#pragma once
#include <physics/diviner/broadphasecollisionalgorithms/broadphasecollisionalgorithm.hpp>
namespace legion::physics
{
class BroadphaseBruteforce : public BroadPhaseCollisionAlgorithm
{
public:
/**@brief Collects collider pairs that have a chance of colliding and should be checked in n... |
//
// Created by zhongzhendong on 2018/8/5.
//
#include "gtest/gtest.h"
#include "thread.hpp"
#include <stdlib.h>
#include <vector>
#include <thread>
#include <mutex>
class TestBuffer {
public:
void Add(); //生产
int Reduce(); //消费
TestBuffer():count_(0){
};
private:
int count_;
std::vect... |
/********************************************************************************
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
* Copyright (c) 2010-2020 Daniel Chappuis *
**************************************************************************... |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__char_console_w32_spawnvp_81a.cpp
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-81a.tmpl.cpp
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: console Read input from the console
... |
//
// Created by caedus on 01.02.2021.
//
#pragma once
#include <Runtime/Interface/IEvaluatorFactory.hpp>
namespace nastya::runtime {
template<typename Evaluator>
class GenericEvaluatorFactory : public IEvaluatorFactory
{
public:
std::unique_ptr<IEvaluator> create() const override {
std::unique_ptr<IEva... |
// Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
#define LOG_WITH_G... |
#include <stdio.h>
int main(){
int n, m, o, soma;
int vel;
int vet[1001];
while(scanf("%d", &n) != EOF){
scanf("%d", &m);
vel = 0;
for(int i = 0; i < n; i++){
scanf("%d", &o);
for(int j = 0; j < m; j++){
if(o > vel){
... |
/*
written by Pankaj Kumar.
country:-INDIA
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll ;
typedef vector<ll> vl;
#define speed cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
/... |
// Copyright (c) 2007-2013 Hartmut Kaiser
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
///////////////////////////////////////////////////////////////////////////////
#if !defined(HPX_LCOS_ASYNC_CONTINUE_... |
auto Cartridge::MBC5::mmio_read(uint16 addr) -> uint8 {
if((addr & 0xc000) == 0x0000) { //$0000-3fff
return cartridge.rom_read(addr);
}
if((addr & 0xc000) == 0x4000) { //$4000-7fff
return cartridge.rom_read((rom_select << 14) | (addr & 0x3fff));
}
if((addr & 0xe000) == 0xa000) { //$a000-bfff
... |
/*
* Copyright (c) 2019, Intel Corporation
*
* 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, publis... |
# include <stdio.h>
# include "Data.h"
// show data in stdout
void show_data(Data* data) {
printf("word: %s", data->word);
printf("translation: %s", data->translation);
}
// get data from stdin
void get_data(Data* data) {
puts("Input word:");
fgets(data->word, WORDS_SIZE, stdin);
puts("Input its translation:");... |
/* -------------------------------------------------------------------------- *
* OpenSim Muscollo: MucoIterate.cpp *
* -------------------------------------------------------------------------- *
* Copyright (c) 2017 Stanford University and the Authors *
... |
# ifndef CPPAD_UTILITY_SPEED_TEST_HPP
# define CPPAD_UTILITY_SPEED_TEST_HPP
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
CppAD is distributed under multiple licenses. This distribution is under
the terms of ... |
#pragma once
#include <vector>
#include <rai/common/util.hpp>
namespace rai
{
class Provider
{
public:
Provider() = delete;
enum class Id
{
INVALID = 0,
ALIAS = 1,
};
static std::string ToString(Id);
enum class Filter
{
INVALID = 0,
... |
#include <ATen/cuda/CUDAContext.h>
#include <torch/extension.h>
#include <vector>
#include "custom_cuda_layers.h"
template <typename T>
at::Tensor ds_quantize(at::Tensor& vals, int groups, int bits)
{
auto t_size = vals.sizes();
int size = 1;
for (auto dim : t_size) size *= dim;
if ((((size / groups) ... |
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
BOOST_PROTO_EXTENDS_FUNCTION_()
BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PP_EMPTY)
BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(BOOST_PROTO_CONST)
#else
#include <boost/proto/detail... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.