text string | size int64 | token_count int64 |
|---|---|---|
/**
* @file TextureBrushDictionary.cxx
* @author Thomas Lindemeier
* @brief
* @date 2020-09-29
*
*/
#include "painty/renderer/TextureBrushDictionary.hxx"
#include <filesystem>
#include <fstream>
#include <iostream>
#include <map>
#include <random>
// #include "opencv2/highgui/highgui.hpp"
#inclu... | 5,572 | 2,144 |
#include "ComponentProgressBar.h"
#include "GameObject.h"
#include "ComponentCanvas.h"
#include "ComponentRectTransform.h"
#include "Texture.h"
#include "Application.h"
#include "ModuleResources.h"
ComponentProgressBar::ComponentProgressBar(GameObject * attached_gameobject)
{
SetActive(true);
SetName("ProgressBar");... | 3,477 | 1,260 |
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writ... | 10,043 | 3,660 |
#include <bangtal.h>
using namespace bangtal;
int main() {
SoundPtr sound = Sound::create("Sound/bgm.mp3");
sound->play();
ScenePtr scene1 = Scene::create("첫번째 방", "RoomEscape/배경-1.png");
ScenePtr scene2 = Scene::create("두번째 방", "RoomEscape/배경-2.png");
auto crush = Object::create("RoomEscape/균열1... | 3,944 | 1,575 |
#include <algorithm>
#include <iostream>
#include <string>
int main()
{
std::cout << "How many names do you wish to enter? ";
std::size_t namesAmount{};
std::cin >> namesAmount;
std::string *namesArray{ new std::string[namesAmount]{} };
for (size_t i{ 0 }; i <= namesAmount; ++i)
{
std::cout << "Enter name #"... | 676 | 270 |
// Copyright © 2017 by Donald King <chronos@chronos-tachyon.net>
// Available under the MIT License. See LICENSE for details.
#include "crypto/internal.h"
namespace crypto {
namespace internal {
std::string canonical_name(base::StringPiece in) {
std::string out;
out.reserve(in.size());
for (char ch : in) {
... | 597 | 231 |
// Generated from /POI/java/org/apache/poi/ss/usermodel/DataConsolidateFunction.java
#include <org/apache/poi/ss/usermodel/DataConsolidateFunction.hpp>
#include <java/io/Serializable.hpp>
#include <java/lang/ArrayStoreException.hpp>
#include <java/lang/Comparable.hpp>
#include <java/lang/Enum.hpp>
#include <java/lang/... | 5,642 | 2,091 |
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020 Darby Johnston
// All rights reserved.
#include <djvAV/TIFFFunc.h>
#include <array>
using namespace djv::Core;
namespace djv
{
namespace AV
{
namespace IO
{
namespace TIFF
{
void readPalett... | 3,353 | 999 |
#ifdef IOT_HTTP_SERVER_TESTS
#include <iostream>
#include "../UriParser.h"
//#define BOOST_TEST_MODULE UriParserTest
#include <boost/test/unit_test.hpp>
using namespace saba::web;
BOOST_AUTO_TEST_CASE(UriParserTest_path1)
{
UriParser uriParser("/");
BOOST_CHECK_EQUAL(uriParser.getPath(), "/");
... | 3,005 | 1,249 |
#include "Util.h"
#include "Enums.h"
#include "../common/Macros.h"
Axis CubeFaceAxisMapping[(uint32_t)CubeFace::COUNT][(uint32_t)NormCoordAxis::COUNT] =
{
{ Axis::Y, Axis::Z, Axis::X },
{ Axis::Y, Axis::Z, Axis::X },
{ Axis::Z, Axis::X, Axis::Y },
{ Axis::Z, Axis::X, Axis::Y },
{ Axis::X, Axis::Y, Axis::Z },
{ A... | 5,300 | 2,186 |
#include <uWS/uWS.h>
#include <iostream>
#include "json.hpp"
#include "PID.h"
#include <math.h>
#include <limits>
// for convenience
using json = nlohmann::json;
// best tau values (manually selected, based on comfort feeling)
double K_P = 0.12;
double K_I = 0.0015;
double K_D = 5.0;
// calibrated tau values, based ... | 8,987 | 3,028 |
template<typename T, std::size_t R, std::size_t C>
inline Matrix<T, R, C>::Matrix()
{
for (unsigned int i = 0; i < R; i++)
{
for (unsigned int j = 0; j < C; j++)
{
m[i][j] = (T)((i == j) ? 1 : 0);
}
}
}
template<typename T, std::size_t R, std::size_t C>
inline Matrix<T, ... | 14,212 | 6,974 |
int main(int argc, char **argv) {
int a = 10;
int b = 100;
if (argc - 1) {
a = 20;
} else {
a = 30;
b = 300;
}
return a + b;
} | 150 | 85 |
#include "MagicCamera.h"
namespace Upp{
glm::mat4 MagicCamera::GetProjectionMatrix()const noexcept{
if(type == CameraType::PERSPECTIVE){
return glm::perspective(glm::radians(GetFOV()),float( ScreenSize.cx / ScreenSize.cy),GetDrawDistanceMin(),GetDrawDisanceMax());//We calculate Projection here since multiple camera ... | 8,286 | 3,287 |
#include <sstream>
#include "util/test.h"
#include "mathematica_graphics.h"
#include "2d/barrel/square_detector.h"
#include "2d/barrel/scanner_builder.h"
#include "2d/geometry/line_segment.h"
#include "2d/geometry/pixel_grid.h"
#include "2d/barrel/options.h"
#include "common/types.h"
using LOR = PET2D::Barrel::LOR... | 3,633 | 1,626 |
#include "headers/Patch.h"
Patch::Patch(){
}
Patch::Patch(vector<Point> p){
controlPoints = p;
}
void Patch::multMatrixVector(float *m, float *v, float *res){
for (int j = 0; j < 4; ++j){
res[j] = 0;
for (int k = 0; k < 4; ++k)
res[j] += v[k] * m[j * 4 + k];
}
}
Patch::Patch(int tess... | 8,309 | 3,046 |
// numerics.cpp
//
// Anton Betten
//
// started: February 11, 2018
#include "foundations.h"
using namespace std;
#define EPSILON 0.01
namespace orbiter {
namespace foundations {
numerics::numerics()
{
}
numerics::~numerics()
{
}
void numerics::vec_print(double *a, int len)
{
int i;
cout << "(";
for... | 63,888 | 34,434 |
#include<iostream>
#include<fstream>
using namespace std;
int main() {
fstream file;
file.open("file.txt");
string line;
while(line != "end") {
getline(cin, line);
file << line << endl;
}
file.close();
return 0;
} | 259 | 90 |
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QMimeData>
#include <QTextEdit>
#include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
textEdit = new QTextEdit;
setCentralWidget(textEdit);
textEdit->setAcceptDrops(false);
setAcceptDrops(true);
setWindowTitle(tr(... | 861 | 310 |
// Copyright 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 <stddef.h>
#include <memory>
#include <utility>
#include "base/callback.h"
#include "base/macros.h"
#include "base/path_service.h"
#include "ba... | 53,079 | 16,701 |
#include "MyThermostat.hpp"
#if defined(__APPLE__) || defined(__linux)
#include <fstream>
#include <iostream>
#include <ostream>
#endif
#if defined(__linux) || defined(ARDUINO)
#include <stdint.h>
#include <string.h>
#endif
| 227 | 87 |
// 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... | 1,541 | 457 |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Human.hpp :+: :+: :+: ... | 1,219 | 344 |
<?hh // strict
namespace Zynga\Framework\ShardedDatabase\V3\Test\UserSharded\Config\Mock\Base;
use
Zynga\Framework\ShardedDatabase\V3\Config\Mock\Base as ConfigBase
;
use Zynga\Framework\ShardedDatabase\V3\ConnectionDetails;
class NoPassword extends ConfigBase {
public function shardsInit(): bool {
$this->ad... | 410 | 136 |
#include "frontend/lex/numbers.h"
#include <string>
#include <string_view>
#include <variant>
namespace frontend {
namespace {
template <int Base>
int64_t DigitInBase(char c) {
if constexpr (Base == 10) {
return ('0' <= c and c <= '9') ? (c - '0') : -1;
} else if constexpr (Base == 2) {
return ((c | 1) ==... | 3,758 | 1,480 |
// Copyright (c) 2021 Graphcore Ltd. All rights reserved.
#include <iostream>
#include <string>
#include <poprithms/error/error.hpp>
#include <poprithms/schedule/shift/graph.hpp>
namespace {
using namespace poprithms::schedule::shift;
void test0() {
Graph g0;
/*
*
* A B (allocs)
* : :
... | 3,961 | 1,629 |
// Copyright 2020 The TensorStore Authors
//
// 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 ... | 26,959 | 8,302 |
#include <Arduino.h>
#include <ArduinoUnitTests.h>
#include <ci/ObservableDataStream.h>
#include "Devices/DateTime_TC.h"
#include "MainMenu.h"
#include "PHCalibrationMid.h"
#include "PHControl.h"
#include "TankControllerLib.h"
const uint16_t PIN = 49;
/**
* cycle the control through to a point of being off
*/
void... | 4,575 | 1,791 |
#include <cstdio>
#include "process.hpp"
int main() {
memory* mem = get_memory_info();
printf("%u\t%u\t%u\t%u\t%u\n",
mem->memTotal,
mem->memFree,
mem->MemAvailable,
mem->Buffers,
mem->Cached);
delete(mem);
} | 261 | 101 |
#include <boost/fusion/algorithm.hpp>
| 38 | 14 |
#include "Editor/EditorMapInfo.h"
#include "Editor/EditScreen.h"
#include "Editor/EditSys.h"
#include "Editor/EditorDefines.h"
#include "Editor/EditorItems.h"
#include "Editor/EditorMercs.h"
#include "Editor/EditorTaskbarUtils.h"
#include "Editor/EditorTerrain.h" //for access to TerrainTileDrawMode
#include "Editor/E... | 8,401 | 3,581 |
/*
Operators
Copyright 2010-201x held jointly by LANS/LANL, LBNL, and PNNL.
Amanzi is released under the three-clause BSD License.
The terms of use and "as is" disclaimer for this license are
provided in the top-level COPYRIGHT file.
Author: Konstantin Lipnikov (lipnikov@lanl.gov)
*/
#include <cstdlib... | 5,812 | 2,505 |
#pragma once
#include <crucible/Math.hpp>
class PointLight {
public:
vec3 m_position;
vec3 m_color;
float m_radius;
PointLight(vec3 position, vec3 color, float radius);
}; | 190 | 68 |
// JadenCase 문자열 만들기
// 2019.06.28
#include<string>
using namespace std;
string solution(string s)
{
s[0] = toupper(s[0]);
for (int i = 1; i<s.size(); i++)
{
if (s[i - 1] == ' ')
{
s[i] = toupper(s[i]);
}
else
{
s[i] = tolower(s[i]);
}
}
return s;
}
| 275 | 163 |
#include <Urho3D/UI/UI.h>
#include <Urho3D/Resource/ResourceCache.h>
#include <Urho3D/UI/Text.h>
#include <Urho3D/UI/Font.h>
#include "ScoreboardWindow.h"
#include "../../Player/PlayerEvents.h"
#include "../../Globals/GUIDefines.h"
ScoreboardWindow::ScoreboardWindow(Context* context) :
BaseWindow(context)
{
}
Sco... | 3,361 | 1,086 |
#include "aquila/global.h"
#include "aquila/functions.h"
#include "UnitTest++/UnitTest++.h"
#include <vector>
SUITE(Functions)
{
const std::size_t SIZE = 3;
double arr1[SIZE] = {0, 1, 2};
std::vector<double> v1(arr1, arr1 + SIZE);
double arr2[SIZE] = {1, 2, 3};
std::vector<double> v2(arr2, arr2 + ... | 3,376 | 1,515 |
#include "skiadrawing.h"
#include <System/Types/Const.h>
#include <System/Types/Structure.h>
#include <System/Graphics/SkiaPaint.h>
#include <System/Interop/System.h>
#include "SkTextOp.h"
#include <Skia/effects/SkGradientShader.h>
#include <Skia/core/SkTypeface.h>
namespace suic
{
SkiaDrawing::SkiaDrawing(Handle ... | 17,977 | 6,349 |
#include <iostream>
#include <map>
#include <chrono>
#include <thread>
#include "cache.h"
#include "datetime_utils.h"
int main() {
SimpleCache<std::string, std::string> cache;
std::string value1 = "1";
std::string key1 = "a";
cache.put(key1, value1, current_time() + 3);
std::string value2 = "2";
std::string ke... | 622 | 248 |
#include "window.hpp"
#include "Circle.hpp"
//#include "Rectangle.hpp"
//#include "Vec2.hpp"
#include <GLFW/glfw3.h>
#include <utility>
#include <cmath>
#include <set>
#include <iostream>
#include <vector>
#include <string>
int main(int argc, char* argv[])
{
Window win{std::make_pair(800,800)};
std::cout<<"P... | 2,445 | 1,144 |
#pragma once
#include "../base_def.hpp"
namespace lol {
struct LolChatPlayerPreferences {
std::string data;
std::string hash;
std::string type;
uint64_t modified;
};
inline void to_json(json& j, const LolChatPlayerPreferences& v) {
j["data"] = v.data;
j["hash"] = v.hash;
j["type"]... | 637 | 250 |
#include <libcryptosec/certificate/ObjectIdentifier.h>
ObjectIdentifier::ObjectIdentifier()
{
this->asn1Object = ASN1_OBJECT_new();
// printf("New OID: nid: %d - length: %d\n", this->asn1Object->nid, this->asn1Object->length);
}
ObjectIdentifier::ObjectIdentifier(ASN1_OBJECT *asn1Object)
{
this->asn1Object = asn1Ob... | 2,173 | 878 |
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a;
cin>>b;
cin>>c;
cin>>d;
if (a==0 && b==0) cout<<"INF";
else if ( a==0 || b%a!=0 || c*(-b/a)+d==0) cout<<"NO";
else cout<<-(b/a);
} | 235 | 124 |
//
// Created by byeonggon on 2018-11-12.
//
#include "IO.h"
#include "TRANSFORM/Transform.h"
#include <stdio.h>
#include <ctype.h>
#include <iostream>
int CellSpace_ID=1;
int CellSpaceBoundary_ID=1;
int State_id=1;
int Transition_id=1;
int OSM_NODE_ID=-1;
int OSM_WAY_ID=-30000;
int OSM_RELATION_ID=-60000;
namespace I... | 864 | 341 |
//-------------------------------------------------------------------------------------------------
// File : a3dDescriptorSetLayout.cpp
// Desc : Descriptor Set Layout Implementation.
// Copyright(c) Project Asura. All right reserved.
//-----------------------------------------------------------------------------... | 12,976 | 4,018 |
#include "glpp/asset/scene.hpp"
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <assimp/Importer.hpp>
namespace glpp::asset {
void traverse_scene_graph(
const aiScene* scene,
const aiNode* node,
glm::mat4 old,
std::vector<mesh_t>& meshes
);
struct light_cast_t {
const aiScene*... | 9,726 | 3,958 |
// Copyright 2016 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 "components/previews/core/previews_data_savings.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "components/dat... | 2,992 | 1,022 |
//
// Created by Airtnp on 10/18/2019.
//
#ifndef ACPPLIB_SOURCE_LOCATION_EXTEND_HPP
#define ACPPLIB_SOURCE_LOCATION_EXTEND_HPP
#include <utility>
namespace sn_Exception {
namespace source_location {
/// For `std::source_location` after variadic template argumentss
template <typename ...Ts>
... | 580 | 208 |
/************************************************************************/
/* */
/* Copyright 1998-2004 by Ullrich Koethe */
/* Copyright 2011-2011 by Michael Tesch */
/* ... | 20,518 | 6,375 |
/** \file Config.hpp
*
* \brief Declares various constant maps and such for rom-specific info. May
* well be in external files someday, but this works for now.
*
*/
#pragma once
#include <map>
#include <string>
namespace Config {
enum class Region {
UNKNOWN,
NTSC,
PAL,
... | 1,004 | 374 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/rekognition/model/S3Destination.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
nam... | 1,267 | 478 |
/*
** Copyright 2011-2013,2017 Centreon
**
** This file is part of Centreon Engine.
**
** Centreon Engine is free software: you can redistribute it and/or
** modify it under the terms of the GNU General Public License version 2
** as published by the Free Software Foundation.
**
** Centreon Engine is distributed in the... | 4,790 | 1,290 |
class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
vector<vector<string>> ans;
map<string, vector<string>> m;
for(auto s: strs){
string key = s;
sort(key.begin(), key.end());
m[key].push_back(s);
}
... | 407 | 128 |
//
// MovingPercentileTests.cpp
// tests/shared/src
//
// Created by Yixin Wang on 6/4/2014
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "MovingPercentileTests.h"
... | 4,489 | 1,315 |
/*------------------------------------------------------------------------*/
/* Copyright 2010 Sandia Corporation. */
/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
/* license for use of this work by or on behalf of the U.S. Government. */
/* Export o... | 3,269 | 1,028 |
#ifndef CENTIPEDE_CPP_
#define CENTIPEDE_CPP_
//#include "Board.h"
#include "util.h"
#include <iostream>
#include<string>
#include<cmath>
#include<fstream>
using namespace std;
int players; // global variable to record number of players
string playerNames[4]={}; // string array to store player names
int playerColors[... | 193,857 | 64,345 |
/*++
Copyright (c) 1999-2002 Microsoft Corporation
Module Name:
gen.c
Abstract:
Generic routines for minidump that work on both NT and Win9x.
Author:
Matthew D Hendel (math) 10-Sep-1999
Revision History:
--*/
#include "pch.cpp"
#include <limits.h>
//
// For FPO frames o... | 70,302 | 22,379 |
#include <ros/ros.h>
#include <iostream>
#include "robot_driver/robot_driver.h"
int main(int argc, char** argv) {
ros::init(argc, argv, "robot_driver_node");
ros::NodeHandle nh;
RobotDriver robot_driver(nh, argc, argv);
robot_driver.spin();
return 0;
}
| 268 | 116 |
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use... | 52,915 | 17,705 |
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
int left = 0, right = nums.size() - 1;
while (left < right) {
int pivot = nums[left];
int i = left, j = right;
while (i < j) {
while (i < j && nums[j] < pivot) j--;
... | 646 | 228 |
//===================================================================================================================
//
// scheduler-arch.cc -- Architecture-specific functions elements for the process
//
// Copyright (c) 2021 -- Adam Clark
// Licensed under "THE BEER-WARE LICENSE"
// See License... | 4,527 | 1,357 |
#include <stdlib.h>
#include "threshold.h"
void threshold(inout_int_t red[1000], inout_int_t green[1000], inout_int_t blue[1000], in_int_t th) {
for (int i = 0; i < 1000; i++) {
int sum = red[i] + green [i] + blue [i];
if (sum <= th) {
red[i] = 0;
green [i] = 0;
blue [i] = 0;
}
}
}
#define AMOUN... | 828 | 475 |
/*
Source File : OutputFile.cpp
Copyright 2011 Gal Kahana PDFWriter
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 req... | 2,491 | 727 |
//
// Created by Brad Hefta-Gaub on 2016/12/7
// Copyright 2016 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <mutex>
#include <QtCore/QObject>
#include <QtCore/QtPlugin>
#include <Qt... | 1,222 | 416 |
#pragma once
#include <elle/das/cli.hh>
#include <memo/cli/Object.hh>
#include <memo/cli/Mode.hh>
#include <memo/cli/fwd.hh>
#include <memo/cli/symbols.hh>
#include <memo/symbols.hh>
namespace memo
{
namespace cli
{
class KeyValueStore
: public Object<KeyValueStore>
{
public:
using Self =... | 7,004 | 1,917 |
#include "gfa/types.h"
#include "gfa/line.h"
GfaVariance::GfaVariance() {
is_set = false;
}
void GfaVariance::set(unsigned long _val) {
is_set = true;
val=_val;
}
ostream& operator<< (ostream &out, const GfaVariance &v) {
v.print(out);
return out;
}
void GfaVariance::print(ostream &out) const {
if (!is_set... | 1,205 | 485 |
#include <movepoints.hpp>
#include "figureknight.hpp"
FigureKnight::FigureKnight(const uint x, const uint y, FigureIntf::Color side,
QObject *parent)
: FigureIntf(x, y, side, new MovePoints(), parent) {
MovePoints *points = defMoveList();
points->addPoint(2, 1);
points->addPoint(... | 583 | 219 |
#include <Engine/Material/BSDF_CookTorrance.h>
#include <Basic/Math.h>
using namespace Ubpa;
using namespace std;
float BSDF_CookTorrance::NDF(const normalf & h) {
cout << "WARNING::BSDF_CookTorrance:" << endl
<< "\t" << "not implemented" << endl;
return 0.f;
}
float BSDF_CookTorrance::Fr(const normalf & wi, c... | 1,251 | 505 |
#include "inculde/headers.h"
#include <iostream>
#include <iomanip>
using namespace ML;
using namespace std;
int main(){
// // cout<<setprecision(numeric_limits<double>::max_digits10);
string trainF = "/Users/Amit/Desktop/Python/ML/test/cars";
// string testF = "/Users/Amit/Desktop/Python/ML/test/data";
... | 1,652 | 662 |
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <chrono>
#include <cmath>
struct Matrix {
int N;
std::vector<double> data;
Matrix operator+(Matrix const& that) const {
Matrix result;
result.N = N;
result.data.resize(data.size());
for (uns... | 2,415 | 939 |
// License: The Unlicense (https://unlicense.org)
#include "lynel/matrix.hpp"
#include <doctest/doctest.h>
using namespace tybl::lynel;
TEST_CASE("matrix::operator==()") {
matrix<double,3,3> a = { 0,1,2,3,4,5,6,7,8 };
matrix<double,3,3> b = { 0,1,2,3,4,5,6,7,8 };
matrix<double,3,3> c = { 1,1,2,3,4,5,6,7,8 };
... | 1,148 | 633 |
#include "StdAfx.h"
#include "Projection.h"
#include "ProjectionUtils.h"
#include "ProjectionEckert4.h"
#define _USE_MATH_DEFINES
#include <math.h>
CProjectionEckert4::CProjectionEckert4 ()
{
}
CProjectionEckert4::~CProjectionEckert4 ()
{
}
void CProjectionEckert4::Initialize (CCfgMapProjection & proj)
{
a =... | 1,598 | 732 |
// Solved 2021-04-09 11:34
// Runtime: 4 ms (80.85%)
// Memory Usage: 6.5 MB (67.36%)
class Solution {
public:
int maxNumberOfBalloons(string text) {
unordered_map<char, int> lookup[2]{
{{'a', 0}, {'b', 0}, {'n', 0}},
{{'l', 0}, {'o', 0}}};
for (auto &ch : text) {
... | 805 | 298 |
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> sortArray(vector<int>& nums) {
sort(nums.begin(), nums.end());
return nums;
}
};
| 213 | 75 |
/**
* Project: The Stock Libraries
*
* File: globals.hpp
* Created: Jun 05, 2012
*
* Author: Abhinav Sarje <abhinav.sarje@gmail.com>
*
* Copyright (c) 2012-2017 Abhinav Sarje
* Distributed under the Boost Software License.
* See accompanying LICENSE file.
*/
#ifndef __GLOBALS_HPP__
#define __GLOBALS_... | 4,140 | 2,160 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/proton/model/ListRepositorySyncDefinitionsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#... | 1,424 | 464 |
/*
* Copyright 2016 Anand Muralidhar
*
* 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 applica... | 3,096 | 957 |
class X {
int y;
void foo() {
X::y++;
}
};
| 53 | 27 |
////////////////////////////////////////////////////////////////////////////////
//! \file ToolsDialog.hpp
//! \brief The ToolsDialog class declaration.
//! \author Chris Oldwood
// Check for previous inclusion
#ifndef TOOLSDIALOG_HPP
#define TOOLSDIALOG_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include <WCL/C... | 1,663 | 575 |
__declspec(naked) int rounding_common()
{
__asm
{
fnstcw [ESP-8]
fldcw [ESP]
fistp dword ptr [ESP]
pop EAX
fldcw [ESP-12]
ret
}
}
__declspec(naked) int __cdecl floorf(float x)
{
__asm
{
fld dword ptr [ESP+4]
... | 1,558 | 653 |
/*
Copyright (c) 2018-2019 Alexander A. Ganin. All rights reserved.
Twitter: @alxga. Website: alexganin.com.
Licensed under the MIT License.
See LICENSE file in the project root for full license information.
*/
#include "stdafx.h"
#ifdef HAVE_MPI
# include <mpi.h>
#endif
#include "Utils/utils.h"
using namesp... | 11,305 | 4,528 |
/** @file flint_termlisttable.cc
* @brief Subclass of FlintTable which holds termlists.
*/
/* Copyright (C) 2007,2008 Olly Betts
*
* 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 ve... | 4,838 | 1,752 |
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <stack>
#include <algorithm>
#include <cctype>
#include <vector>
#include <queue>
#include <tr1/unordered_map>
#include <cmath>
#include <map>
#include <bitset>
#include <set>
using namespace std;
typedef long long ll... | 3,101 | 1,455 |
#include "duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp"
#include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp"
#include "duckdb/common/exception.hpp"
#include "duckdb/common/field_writer.hpp"
#include "duckdb/parser/parsed_data/create_sequence_info.hpp"
#include "duckdb/catalog/dependency_manager.... | 2,177 | 751 |
#include <gtest/gtest.h>
#include <internal.h>
//
//
//
TEST(Internal, init)
{
using Key = int;
using Data = int;
btree::Internal< Key, Data > internal( nullptr );
const Key key = 2;
const Data data = 3;
const btree::Leaf< Key, Data >::value_type x( key, data );
internal.insert_value( 0... | 1,077 | 431 |
#include <Arduino.h>
#include "Note.h"
#include "MusicPlayer.h"
#define NOTE_QUEUE_SIZE 100
float _beats_per_second = 1.0;
bool _is_buzzer_high;
bool _is_playing;
bool _is_mid_song;
int _buzzer_pin = A0;
int _note_index_in_queue;
unsigned long _micros_of_last_buzzer_switch;
unsigned long _micros_of_note_start;
unsig... | 2,793 | 1,117 |
#include "Panels/AudioPanel.h"
#include <imgui.h>
namespace GameGuy {
AudioPanel::AudioPanel()
: Panel("Audio Panel ", false, true)
{
}
AudioPanel::~AudioPanel()
{
}
void AudioPanel::addSample(size_t time, double left, double right)
{
std::lock_guard<std::mutex> lc(mMutex);
if (mSamples.size() > MAX... | 1,246 | 569 |
#include "Client.h"
#include <sstream>
#include <fstream>
#include <iostream>
#include <thread>
#include <mutex>
#include <sys/stat.h>
#include <condition_variable>
#include "../strutil.h"
Client::Client(std::string &host_name, std::string &port_number,
std::string &requests_file, bool dry_run) {
socket = ... | 5,842 | 1,792 |
//Copyright (c) 2016 Singapore-MIT Alliance for Research and Technology
//Licensed under the terms of the MIT License, as described in the file:
//license.txt (http://opensource.org/licenses/MIT)
/*
* TenureTransitionRate.hpp
*
* Created on: 5 Feb 2016
* Author: Chetan Rogbeer <chetan.rogbeer@smart.mit.edu>
*... | 1,324 | 374 |
/*
TODO: rename to fenchel
lap_sqm_mex(x1, y1, z1, x2, y2, z2, g2, fun_id, sign) calculates
R[j] = max_j {g2[j] - f(xyz1[i], xyz2[j])} when sign = +1
R[j] = min_j {g2[j] - f(xyz1[i], xyz2[j])} when sign = -1
returns R and ind = argmax/argmin
The kernel f is defined by fun_id:
fun_id = 0 : f = -(x1 x2 + y1... | 5,614 | 3,097 |
#include <Windows.h>
#include "../Global/NativeRegistry.h"
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
LPCSTR error = NULL;
BOOL removed = FALSE;
// Delete registry value HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\(Default), where Injector.exe is ... | 2,387 | 961 |
//
// Created by yanxi on 2019/10/28.
//
#include "IPlayBuilder.h"
#include "IPlayer.h"
#include "IDemux.h"
#include "XLog.h"
#include "IDecode.h"
#include "IResample.h"
#include "IAudioPlay.h"
#include "IVideoView.h"
IPlayer *IPlayBuilder::BuildPlayer(unsigned int index) {
IPlayer *play = CreatePalyer(index);
... | 1,029 | 408 |
/*
* (C) 2006-2020 see Authors.txt
*
* This file is part of MPC-BE.
*
* MPC-BE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
... | 133,992 | 67,759 |
#ifndef __USER__
#define __USER__
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
/* The differents enumerations we need to our algortithm */
enum class Terminal_device { Phone, Pc, ChromeCast, Tablet};
enum class Quality { Auto, p144, p240, p360,p480,p720,p1080};
enum clas... | 839 | 283 |
#include "basic_psi.h"
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <sys/time.h>
#include "tfhe.h"
#include "polynomials.h"
#include "lwesamples.h"
#include "lwekey.h"
#include "lweparams.h"
#include "tlwe.h"
#include "tgsw.h"
using namespace std;
// *******... | 8,270 | 2,936 |
#include <iostream>
#include "b36.hpp"
#include "board.hpp"
using namespace std;
void execute(uint64_t bp, uint64_t wp, int turn, int alpha, int beta) {
Board<B36> board;
int result = board.getBestResult(bp, wp, turn, alpha, beta);
cout << board.getFinalBoardString() << endl;
cout << "Initial = " << board.getIni... | 1,086 | 505 |
// ----------------------------------------------------------------------------
//
// Basecode Bootstrap Compiler
// Copyright (C) 2018 Jeff Panici
// All rights reserved.
//
// This software source file is licensed under the terms of MIT license.
// For details, please read the LICENSE file.
//
// --------------------... | 23,964 | 6,531 |
#include "library/BlackBox_Ring.hpp"
#include "library/BlackBox_pinout.hpp"
#include <SmartLeds.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <mutex>
namespace BlackBox {
int Index::trim(int index) {
return (60 + (index % ledCount)) % ledCount;
}
Index& Index::trimThis() {
m_value = trim(... | 4,689 | 1,864 |
#include "globals.h"
#include "utils.h"
bool emergencyStop = false;
static const char* WHITESPACE = " \t\n\r\f\v";
static const char* SEPARATORS = "/\\";
void ErrorException::print() const
{
std::cerr << message << '\n';
}
bool beginsWith(const std::string& value, const std::string& ending)
{
if (ending.siz... | 1,718 | 587 |
/*
Copyright (c) 2007-2013 William Andrew Burnson.
Copyright (c) 2013-2020 Nicolas Danet.
*/
/* < http://opensource.org/licenses/BSD-2-Clause > */
// -----------------------------------------------------------------------------------------------------------
// ------------------------------------------... | 7,764 | 1,917 |
#ifndef VG_RENDER_TARGET_HPP
#define VG_RENDER_TARGET_HPP
#include "graphics/global.hpp"
namespace vg
{
class BaseRenderTarget {
public:
BaseRenderTarget(uint32_t framebufferWidth = 0u
, uint32_t framebufferHeight = 0u
);
uint32_t getFramebufferWidth() const;
ui... | 1,910 | 610 |