text stringlengths 3.08k 22k |
|---|
// This file is part of snark, a generic and flexible library for robotics research
// Copyright (c) 2011 The University of Sydney
// 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. Redistr... |
# include "conversion.h"
/*
* The following conversion functions are taken/adapted from OpenCV's cv2.cpp file
* inside modules/python/src2 folder.
*/
static void init()
{
import_array();
}
static int failmsg(const char *fmt, ...)
{
char str[1000];
va_list ap;
va_start(ap, fmt);
vsnprintf(str, ... |
/* $OpenBSD: bcrypt.c,v 1.31 2014/03/22 23:02:03 tedu Exp $ */
/*
* Copyright (c) 1997 <NAME> <<EMAIL>>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all cop... |
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "xdb_ui.h"
////////////... |
#include "ppu.h"
#include "bus.h"
#include "usefullfuncs.h"
#include <bits/stdint-uintn.h>
#include <cstring>
Ppu::Ppu()
{
t_cycle = 0;
}
void Ppu::connectBus(Bus *b)
{
bus = b;
}
void Ppu::SetLCDStatus()
{
LCDStatus.reg = bus->memRead(0xFF41);
LCDControl.reg = bus->memRead(0xFF40);
if (!LCDControl.OnOFF)
{
... |
/**
BSD-3-Clause
Copyright 2019 Alliance for Sustainable Energy, LLC
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 f... |
// Copyright (c) 2013 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 "tools/gn/args.h"
#include "base/sys_info.h"
#include "build/build_config.h"
#include "tools/gn/variables.h"
const char kBuildArgs_Help[] =... |
/**
** Copyright (c) 2011 Illumina, Inc.
**
**
** This software is covered by the "Illumina Non-Commercial Use Software
** and Source Code License Agreement" and any user of this software or
** source file is bound by the terms therein (see accompanying file
** Illumina_Non-Commercial_Use_Software_and_Source_Cod... |
#include <glib.h>
#include <unistd.h>
#include <iostream>
#define NUGU_LOG_MODULE NUGU_LOG_MODULE_APPLICATION
#include <base/nugu_log.h>
#include <base/nugu_prof.h>
#include <capability/asr_interface.hh>
#include <capability/audio_player_interface.hh>
#include <capability/capability_factory.hh>
#include <capability/... |
// Simple RAC example: integer multiplication
//#define DEBUG // uncomment to print intermediate vaules
//#define SLEC // uncomment to run SLEC
//#define HECTOR // uncomment to run Hector
#include <iostream>
#include <ac_int.h>
#include <rac.h>
using namespace std;
typedef unsigned long uint64; // Just used to... |
#include <stdlib.h>
#include <stdio.h>
#include <map>
#include <string>
#include <png.h>
#include <time.h>
#include <cstring>
#define UTF8_FULL_BLOCK "\xE2\x96\x88"
#define UTF8_DARK_SHADE "\xE2\x96\x93"
#define UTF8_MEDIUM_SHADE "\xE2\x96\x92"
#define UTF8_LIGHT_SHADE "\xE2\x96\x91"
#define UTF8_NO_BLOCK " "... |
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include "shader_s.h"
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#include <glm/glm/glm.hpp>
#include <glm/glm/gtc/matrix_transform.hpp>
#include <glm/glm/gtc/type_ptr.hpp>
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600
void frameBuff... |
#include <string>
#include <iostream>
#include <vector>
using namespace std;
#include <SDL2/SDL.h>
#include "sdlViewport.h"
sdlViewport::sdlViewport(int w, int h, const string &s,bool useGL) {
height = h; width = w;
gl_active = useGL;
// Initialize SDL.
if (SDL_Init(SDL_INIT_VIDEO) < 0)
throw new sdlViewpor... |
//===-- AArch64MCTargetDesc.cpp - AArch64 Target Descriptions ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
#include "pch.h"
#include <iostream>
#include <stdio.h>
using namespace std;
#define null NULL
const char* filename = "in.txt";
struct Student {
char* name;
int age;
};
#pragma region SLL
struct SLL {
Student* data;
SLL* next;
};
Student* createStudent(const char* buffer, int age) {
Student* student = (Studen... |
#include <cxxopts.hpp>
#include "ParseConfigFile.hpp"
#include "PipeSocketHandler.hpp"
#include "PsuedoTerminalConsole.hpp"
#include "TelemetryService.hpp"
#include "TerminalClient.hpp"
#include "WinsockContext.hpp"
using namespace et;
bool ping(SocketEndpoint socketEndpoint,
shared_ptr<SocketHandler> clie... |
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string.h>
#include <sys/stat.h>
#include "star.h"
using namespace std;
#include "math.h"
#define PI (3.141592653589793)
#define RAD2DEG 180.0/PI
#define DEG2RAD PI/180.0
int bytes_to_int(char *in) {
int int32=0;
int32=(int32 ... |
//========================================================================================
// Athena++ astrophysical MHD code
// Copyright(C) 2014 <NAME> <<EMAIL>> and other code contributors
// Licensed under the 3-clause BSD License, see LICENSE file for details
//=====================================================... |
//
// Copyright (c) 2016-2019 <NAME> (<EMAIL>)
//
// 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)
//
// Official repository: https://github.com/vinniefalco/CppCon2018
//
#include "http_session.hpp"
#include "websoc... |
// $Header: /nfs/slac/g/glast/ground/cvs/calibGenCAL/src/Thresh/fitULDSlopes.cxx,v 1.4 2008/05/19 14:17:34 fewtrell Exp $
/** @file
@author <NAME>
Fit ULD THRESHOLD DAC slopes given thresholds @ different DAC settings.
INPUTS:
ULD thresholds in non-pedestal subtracted ADC units (TXT file) for 2 config... |
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "otbn_trace_checker.h"
#include <cassert>
#include <cstring>
#include <iostream>
#include <memory>
#include "otbn_trace_source.h"
#include "sv_utils.h"
stati... |
/*------------------------------------------------------------------------------
CGMF-1.1
Copyright TRIAD/LANL/DOE - see file LICENSE
For any questions about CGMF, please contact us at <EMAIL>
-------------------------------------------------------------------------------*/
/*! @file popinit.cpp
\brief Store ... |
/* VTC Blockindexer - A utility to build additional indexes to the
Vertcoin blockchain by scanning and indexing the blockfiles
downloaded by Vertcoin Core.
Copyright (C) 2017 <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pu... |
#include <iostream>
#include <sstream>
#include <cstring>
#include "headers/device_nfc.h"
nfc_context *DeviceNFC::context = nullptr;
std::map<unsigned short, byte_t const *> DeviceNFC::PDOLValues = {
{0x9F59, new byte_t[3]{0xC8, 0x80, 0x00}}, // Terminal Transaction Information
{0x9F5A, new byte_t[1]{0x00}}, ... |
#include "rtc.h"
RTC::RTC(int num)
{
if (num == 1)
I2C(I2C0, RX8025SA);
else if(num == 2)
I2C(I2C1, RX8025SA);
this->m_iDevAddr = RX8025SA;
this->rx8025Init();
}
void RTC::rx8025Init(void)
{
Time t;
unsigned char read_buf[2], write_buf = 0;
int need_reset=0, ne... |
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
using namespace std;
int N;
int A[25], B[25];
int dp[26][2];
const int INF = 987654321;
int largeJump;
void set_bounds(int i, int parity, int &lb, int... |
//===- test_compare.cpp ----------------------------------------*- C++ --*-===//
// Copyright 2014 Google
//
// 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/l... |
/*
* Copyright (C) 2005 - 2012 MaNGOS <http://www.getmangos.com/>
*
* Copyright (C) 2008 - 2012 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2010 - 2012 ArkCORE <http://www.arkania.net/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; ... |
/*=========================================================================
*
* Copyright <NAME>, <NAME>, <NAME>. 2011.
*
* 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.o... |
/*
* This is a simple example use of ofArduino
*
* ofArduino currently only supports the standard Arduino boards
* (UNO, Duemilanove, Diecimila, NG, and other boards based on the
* ATMega168 or ATMega328 microcontrollers
* The Arduio FIO and Arduino Mini should also work.
* The Arduino MEGA and other variants ba... |
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "highlevel_feature_extractor.h"
#include <rcsc/common/server_param.h>
using namespace rcsc;
HighLevelFeatureExtractor::HighLevelFeatureExtractor(int num_teammates,
int num_opponents,
... |
/*
Name: NamedCodeConstants
Copyright: Copyright (C) 2003-2017 SIL International.
Documentation:
Description:
Create Date: 19 Jul 2011
Modified Date: 13 Dec 2012
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo: ... |
//
// Copyright (c) 2014 Wind River Systems, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <map>
#include <assert.h>
#include <sstream>
#include "fmDbAPI.h"
#include "fmFile.h"
#include "fmAPI.h"
#include "fmMsg.h"
#include "fmL... |
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
/*======
This file is part of PerconaFT.
Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
PerconaFT is free software: you can redistribute it and/or modif... |
#include <iomanip>
#include "sim/simulate.hh"
#include "graphics/graphics_syscall_helper.hh"
#include "graphics/gem5_graphics_calls.h"
#include "graphics/serialize_graphics.hh"
#include "graphics/emugl/opengles.h"
#include "base/output.hh"
#include "base/framebuffer.hh"
#include "base/bmpwriter.hh"
commandBufferCallba... |
/**
* @file
* @brief Implementation of ROOT data file reader module
* @copyright Copyright (c) 2017-2020 CERN and the Allpix Squared authors.
* This software is distributed under the terms of the MIT License, copied verbatim in the file "LICENSE.md".
* In applying this license, CERN does not waive the privileges a... |
/*! \brief Using PTI to teach a small SNN how to compute XOR.
*
*/
#include "PTI.h"
#include "../../izk/network/Network.h"
#include "../../izk/network/ConnectionScheme.h"
#include "../../izk/network/ConnectionGroup.h"
#include "../../izk/network/NeuronGroup.h"
#include "../../izk/neuron/Izhikevich4Neuron.h"
#includ... |
// Copyright (c) 2020 <NAME>
#include <getopt.h>
#include <bitset>
#include <cstdlib>
#include <iostream>
#include "bioparser/fasta_parser.hpp"
#include "bioparser/fastq_parser.hpp"
#include "biosoup/progress_bar.hpp"
#include "biosoup/timer.hpp"
#include "ram/minimizer_engine.hpp"
std::atomic<std::uint32_t> bioso... |
#include <test_defs.h>
// this enforces recompilation, responding to SINGLE...
#include "directft/dirft2d.cpp"
using namespace std;
const char* help[]={
"Tester for FINUFFT in 2d, all 3 types, either precision.",
"",
"Usage: finufft2d_test Nmodes1 Nmodes2 Nsrc [tol [debug [spread_sort [upsampfac [errfail]]]]]",
... |
/*
-----------------------------------------------------------------------------
This source file is part of
_
___ __ _ _ __ ___ __ _ ___ ___(_)_ __ ___ _ __
/ _ \ / _` | '__/ _ \/ _` / __/ __| | '_ ` _ \| '_ \
| (_) | (_| | | | __/ (_| \__ \__ \ | | | | | | |_) |
\___/ \__,... |
// Copyright 2021 PickNik Inc.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following discl... |
#include "muscle.h"
#include <math.h>
#include "pwpath.h"
#include "profile.h"
#include <stdio.h>
// Textbook Smith-Waterman affine gap implementation.
#define TRACE 0
static const char *LocalScoreToStr(SCORE s)
{
static char str[16];
if (MINUS_INFINITY == s)
return " *";
sprintf(str, "%6.2f... |
// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <sstream>
#include <exceptions/exce... |
/*
GLOBAL DOCUMENTATION
--Program Description--
This program emulates the manipulation of Cache, Register File, and Memory by instructions executed by a
MIPS CPU. The output displays the instructions, in order, that were executed by the CPU, as well as the contents
of the Register File, Cache, and Main Mem... |
/*
* Copyright 2003-2009, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* <NAME>
* <NAME>
* <NAME>
* Dr. <NAME>
* julun <<EMAIL>>
*/
#include "MarginView.h"
#include "PrinterDriver.h"
#include "PageSetupWindow.h"
#include "PrintUtils.h"
#include <stdlib... |
#include "../fixtures/util.hpp"
#include "../fixtures/fixture_log_observer.hpp"
#include <mbgl/geometry/sprite_atlas.hpp>
#include <mbgl/annotation/sprite_store.hpp>
#include <mbgl/annotation/sprite_parser.hpp>
#include <mbgl/util/io.hpp>
#include <mbgl/util/image.hpp>
using namespace mbgl;
TEST(Annotations, SpriteA... |
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "VlcFileMediaSourceFactory.h"
#include "FileMediaSource.h"
#include "Misc/Paths.h"
/* UVlcFileMediaSourceFactory structors
*****************************************************************************/
UVlcFileMediaSourceFactory::UVlcFileMediaS... |
#include "worldsound.h"
#include <Tempest/SoundEffect>
#include "game/definitions/musicdefinitions.h"
#include "game/gamesession.h"
#include "world/objects/npc.h"
#include "world/objects/sound.h"
#include "sound/soundfx.h"
#include "world.h"
#include "gamemusic.h"
#include "gothic.h"
#include "resources.h"
const flo... |
#include "debugwidget.h"
#include <ctype.h>
#include <fstream.h>
#include <iostream.h>
#include <math.h> // ceil() function
#include <stdio.h>
#include <qfiledialog.h>
#include <qstring.h>
class MyMultiLineEdit : public QMultiLineEdit {
public:
MyMultiLineEdit(QWidget *parent=0, const char *name=0) :
QMultiLineE... |
/*
KeePass Password Safe - The Open-Source Password Manager
Copyright (C) 2003-2021 <NAME> <<EMAIL>>
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
(a... |
#include "GameAssetManager.h"
#include <cstdlib>// Required to fix build issue on Windows and cygwin using 'make'.
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <glm/gtc/matrix_transform.hpp>
/**
* @file GameAssetManager.cc
* @version 1.0
*
* @section Description
*
* GameAssetManager is used... |
//----------------------------------------------------------------------------
//
// TSDuck - The MPEG Transport Stream Toolkit
// Copyright (c) 2005-2020, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following c... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <bitset>
using namespace std;
string input_arr [1000]; // An array to store in input strings.
// Shifts the input string by n bits to the right.
string shift_right(string frac, int n){
string out = frac;
for(int i = 0... |
#include "SampleCode.h"
#include "SkOSMenu.h"
#include "DebuggerViews.h"
static const char gIsDebuggerQuery[] = "is-debugger";
class DebuggerView : public SampleView {
public:
DebuggerView(const char* data, size_t size) {
fData.append(size, data);
fCommandsVisible = true;
fCommandsResiz... |
/**
Copyright (c) 2015 Beckhoff Automation GmbH & Co. KG
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, c... |
#include "fni_ext.h"
#include "pod_vaseWindow_native.h"
#include <stdlib.h>
#include <stdio.h>
#include "GL/glew.h"
#define GLFW_INCLUDE_NONE
#include "GLFW/glfw3.h"
static struct Window* getWindow(fr_Env env, fr_Obj self) {
static fr_Field f = NULL;
if (f == NULL) f = fr_findField(env, fr_getObj... |
// ==========================================================================
// Mason - A Read Simulator
// ==========================================================================
// Copyright (c) 2006-2018, <NAME>, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and... |
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2020, Raspberry Pi (Trading) Ltd.
*
* drm_preview.cpp - DRM-based preview window.
*/
#include <drm.h>
#include <drm_fourcc.h>
#include <drm_mode.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include "drm_preview.hpp"
#define ERRSTR strerror(errno... |
/*
* Copyright (C) 2006, 2007 Apple Inc. 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 condi... |
/**
*
* @file ESP8266HTTPUpdate.cpp
* @date 21.06.2015
* @author <NAME>
*
* Copyright (c) 2015 <NAME>. All rights reserved.
* This file is part of the ESP8266 Http Updater.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License... |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/views/info_bar_item_view.h"
#include "chrome/browser/views/standard_layout... |
// Copyright (c) 2019-2020 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,... |
/*
Copyright (c) 2014
Author: <NAME> <<EMAIL>>
Created: 2014-Mar-21 11:04 (EDT)
Function: reduce input, map output io
*/
#define CURRENT_SUBSYSTEM 'i'
#include "defs.h"
#include "diag.h"
#include "config.h"
#include "misc.h"
#include "network.h"
#include "mapio.h"
#include "mrmagoo.pb.h"
#include <sys/type... |
// ====================================================================================================
//
// SuPReMo: Surrogate Parameterised Respiratory Motion Model ... |
/* Copyright (c) 2007, Stanford University
* Copyright (c) 2013, <NAME> <<EMAIL>>
* 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... |
/* ========================================
* Created By : mathemage
* Points/Time :
* Total/ETA :
* Status :
==========================================*/
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b... |
#define _USE_MATH_DEFINES
#include "gmmtree.h"
#include <Eigen/Eigenvalues>
#include <cmath>
using namespace probreg;
namespace {
static const Float eps = 1.0e-15;
Float gaussianPdf(const Vector3& x, const Vector3& mu, const Matrix3& cov) {
const Vector3 d = x - mu;
const Float det = cov.determinant();
i... |
/******************************************************************************
* Project: PROJ.4
* Purpose: Apply vertical datum shifts based on grid shift files, normally
* geoid grids mapping WGS84 to NAVD88 or something similar.
* Author: <NAME>, <EMAIL>
*
***************************************... |
#include "tabs/pool-tab.h"
#include <QCloseEvent>
#include <QJsonArray>
#include <QSettings>
#include <ui_pool-tab.h>
#include "downloader/download-query-group.h"
#include "main-window.h"
#include "models/page.h"
#include "models/site.h"
#include "search-window.h"
#include "ui/text-edit.h"
PoolTab::PoolTab(Profile *p... |
/*
* Latency.cpp
*
* Created on: 13 Mar 2017
* Author: db434
*/
#include "Latency.h"
#include "../../Datatype/MemoryOperations/MemoryOperation.h"
#include <iomanip>
using namespace Instrumentation;
TimerMap Latency::coreBufferedReq;
TimerMap Latency::coreSentReq;
TimerMap Latency::memoryReceivedReq;
Timer... |
#include "modelImport.hpp"
void configureObject(configureArgs args);
/*
(polygon *) importObj takes some (importObjInfo) objInfo and builds a new
polygon struct with the members of the objInfo struct (see objInfo struct and
polygon struct documentation in modelImport.hpp for more details).
On success, (polygon *... |
// The MIT License (MIT)
// 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, modi... |
#include "cf.hpp"
#include "dsp/digital.hpp"
struct METRO : Module {
enum ParamIds {
BPM_PARAM,
RST_PARAM,
BEAT_PARAM,
ON_PARAM,
NUM_PARAMS
};
enum InputIds {
ON_INPUT,
BPM_INPUT,
NUM_INPUTS
};
enum OutputIds {
OUT_OUTPUT,
MES_OUTPUT,
BEAT_OUTPUT,
START_OUTPUT,
NUM_OUTPUTS
};
enum L... |
// Copyright (c) 2016-2021 <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, d... |
#include "Gui.h"
#include <sstream>
#include <iostream>
#include "Utils.h"
void Gui::loadSettings() {
const auto d = GDifficulty(difficulty->getSelectedItemIndex());
Tile::setTheme(TTheme(theme->getSelectedItemIndex()));
state->diff = d;
if (d == GDifficulty::custom) {
unsigned w, h;
std::istrings... |
// Copyright 2020 Makani Technologies 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 ... |
/*
kinetic viscosity of watter 1.002e-3 [m^2/s] 1.004e-6 [m^2/s] 0.1 * 1 / 1.004e-6 = 100000
kinetic viscosity of air 1.983e-5 [m^2/s] 1.568e-5 [m^2/s] 1.0 * 5 / 1.568e-5 =
=> Re = 100,000 ... 300,000
CD limits ( Re = 10,000 )
0.47 sphere
1.28 flat plate perpendicular to flow (3D)
*/
//#inc... |
#include <assert.h>
#include <core/physical_memory.h>
#include "block_allocator.h"
#include "block_bitmap.h"
#include "segment.h"
#define RESET_STATE // testing only
using namespace Component;
/*
Allocation strategy is worst-fit-first; this is because we want to enable "copy-less"
expansion as much as possible.
T... |
#include <algorithm>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <iterator>
#include <map>
#include <math.h>
#include <sys/stat.h>
#include "opencv_face_align.h"
inline bool exists(const std::string& fn)
{
struct stat buffer;
return (stat (fn.c_str(), &buffer) == 0);
}
inlin... |
/*
* Copyright (C) 2015 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... |
/***
*
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* obje... |
/***************************************************************************
*
* Copyright (C) 2016 Codeplay Software 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
*
* ... |
// rad.cpp : Defines the entry point for the console application.
//
#define MAJOR_V 0
#define MINOR_V 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "FileObject.h"
#include "Interpreter.h"
#include "Parser.h"
#include "Timer.h"
#include "c_generator.h"
#include "os.h"
#include "Profiler.h"
#in... |
// Copyright 2021 <NAME> <EMAIL> (Alternate: <EMAIL>)
#include <iostream>
#include <map>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::map;
using std::string;
using std::vector;
typedef int TileID;
class Tile {
// common interface. required.
public:
int dimension;
vector<v... |
/*
* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights t... |
#include "NetworkClass.h"
#define PORT 2001
NetworkClass::NetworkClass()
{
}
NetworkClass::~NetworkClass()
{
}
#pragma region Initialise
bool NetworkClass::Initialise()
{
std::cout << "Enter <s> for server and <c> for client" << std::endl;
std::cin >> connection;
switch (connection)
{
case 's':
{
//se... |
#include "CGL.h"
#include "HelloTexture3DShader.hpp"
std::vector<cglVert> cube_vertices = {
cglVert(cglVec4(-0.5f, -0.5f, -0.5f, 1.0f), cglVec3(0.0f, 0.0f, -1.0f), cglVec2(0.0f, 0.0f)),
cglVert(cglVec4(0.5f, -0.5f, -0.5f, 1.0f), cglVec3(0.0f, 0.0f, -1.0f), cglVec2(1.0f, 0.0f)),
cglVert(cglVec4(0.5f, 0.5f, -... |
#include "tetris.h"
void drawBoard(Board board) {
for (int i=0; i<21; i++) {
for (int j=0; j<12; j++) {
if (board[i]%2) putchar('O'); else putchar(' ');
board[i]>>=1;
}
putchar('\n');
}
std::cout << "Score: " << board.score << std::endl;
std::cout << "Pieces: " << board.pieces << std::endl;
std::co... |
#pragma GCC optimize(3)
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
using u64 = unsigned long long;
constexpr u64 MOD = 1000000007;
int n, m;
int tb[100][100] = {
{0},
{0,2,4,6,10,16,26,42,68,110,178,0},
{0,4,16,36,100,256,676,1764,4624,12100,31684,0},
{0,6,36,32,44,64,104,164,2... |
/**
* Messages sent by the html application
*
* config:calibration:save save calibration into config.json
* config:calibrate:ID:center:V set servo ID center calibration to V
* config:calibrate:ID:range:V set servo ID range calibration to V
* config:move:M:save:NAME save ... |
/**
* Copyright (C) Mellanox Technologies Ltd. 2001-2018. ALL RIGHTS RESERVED.
*
* See file LICENSE for terms.
*/
#include <common/test.h>
#include <algorithm>
#include "ucp_datatype.h"
extern "C" {
#include <ucp/dt/dt.h>
#include <ucp/dt/datatype_iter.inl>
}
class test_ucp_dt_iov : public ucs::test {
protecte... |
/*
* Copyright 2022 Institute of Parallel and Distributed Systems, Shanghai Jiao Tong University
*
* 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/license... |
#include <cstdlib>
#include <functional>
#include <iostream>
#include <string>
#include <castel/ast/expr/literal/Dict.hh>
#include <castel/ast/expr/literal/Function.hh>
#include <castel/ast/expr/literal/String.hh>
#include <castel/ast/expr/Multary.hh>
#include <castel/ast/expr/Variable.hh>
#include <castel/ast/stmt/de... |
/*
===============================================================================
Copyright (C) 2021 <NAME>. All Rights Reserved.
This file is part of Pipe Dreamer, found at:
https://github.com/escalonely/PipeDreamer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software a... |
#include "Network.h"
#include "Server.h"
#include "HTTPSocket.h"
#include "WebSocket.h"
#include "Extensions.h"
#include "Parser.h"
#include <cstring>
#include <openssl/sha.h>
#include <openssl/ssl.h>
void base64(unsigned char *src, char *dst)
{
static const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop... |
#include <QDebug>
#include <QFile>
#include <QIODevice>
#include <QTextStream>
// geos library
#include <geos_c.h>
#include "Cube.h"
#include "GisBlob.h"
#include "GisGeometry.h"
#include "GisTopology.h"
#include "IException.h"
#include "IString.h"
#include "Preference.h"
using namespace Isis;
using namespace std;
... |
/*
* SEGS - Super Entity Game Server
* http://www.segs.io/
* Copyright (c) 2006 - 2018 SEGS Team (see AUTHORS.md)
* This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
*/
/*!
* @addtogroup MapServerEvents Projects/CoX/Servers/MapServer/Events
* @{
*/
#include "In... |
#include "cmdline.hpp"
#include <QPainter>
#include <QPaintEvent>
#include "msgpack_overrides.hpp"
#include <fmt/format.h>
#include <fmt/core.h>
static auto get_font_dimensions_for(const QFont& font)
{
QFontMetrics fm {font};
return std::make_tuple(fm.averageCharWidth(), fm.height());
}
CmdLine::CmdLine(const HLS... |
/*
* --------------------------------------------------------------------------------
* File : AVL_BST_Traditional.cpp
* Project : AVL-BST-Optimized
* Author : Saurish
*
*
* Description : Traditional AVL-BST implementation.
* ---------------------------------------------------------------... |
/* RTcmix - Copyright (C) 2000 The RTcmix Development Team
See ``AUTHORS'' for a list of contributors. See ``LICENSE'' for
the license to this software and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <RTcmix.h>
#include <ugens.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.