text string | size int64 | token_count int64 |
|---|---|---|
/*************************************************************************
* PLEASE SEE THE FILE "license.txt" (INCLUDED WITH THIS SOFTWARE PACKAGE)
* FOR LICENSE AND COPYRIGHT INFORMATION.
*************************************************************************/
/**************************************************... | 19,518 | 6,151 |
#include <pch.h> // IWYU pragma: keep
#include <TriangleSplitter/TriangleSplitterFixedLeafSize.h>
#include <TriangleGrouper/TriangleGrouperClosestCentroid.h>
TriangleSplitterFixedLeafSize::TriangleSplitterFixedLeafSize(const VertexList &inVertices, const IndexedTriangleList &inTriangles, uint inLeafSize, uint in... | 5,858 | 2,326 |
#include <map>
class Solution {
public:
int majorityElement(vector<int>& nums) {
map<int,int> elementos;
for (int i = 0; i < nums.size(); i++){
// No está en mi map
if(elementos.find(nums[i]) == elementos.end()){
ele... | 672 | 210 |
#include <assert.h>
#include "common.h"
#include "tia.h"
#include "../commands.h"
#include "command.h"
#define HALT_ON_UNIMPLEMENTED 0
Tia::Tia()
: rasterX(0)
, rasterY(0)
, frameNum(0)
, rasterCount(0)
, rasterCountLatched(0)
, region(ERegion::NTSC)
, bHaltOnTick(false)
, bHaltOnHBlank(false)
, bHaltOnVBlank(false)... | 19,471 | 9,111 |
#include <objects/camera/camera.h>
void Camera::move_x(const double &shift) {
current_pos.set_x(current_pos.get_x() + shift);
}
void Camera::move_y(const double &shift) {
current_pos.set_y(current_pos.get_y() + shift);
}
void Camera::move_z(const double &shift) {
current_pos.set_z(current_pos.get_z() + s... | 560 | 216 |
#ifndef Treegen_hpp
#define Treegen_hpp
#include "lexer.hpp"
#include <vector>
#include <string>
#include <iostream>
#define TN_UNDEFINED -1
#define TN_FUNC_CALL 0
#define TN_GROUP 1
#define TN_VALUE 2
#define TN_OPERATOR 3
#define TN_BLOCK 4
#define TN_IF 5
#define TN_EXHAUST 6
#pragma region Nodes
class TreeNode
... | 5,164 | 1,691 |
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be usefu... | 3,279 | 1,202 |
/******************************************************************************
* Copyright 2019 ETC Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/l... | 2,491 | 775 |
// Copyright (c) 2010 The WebM project authors. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing projec... | 4,629 | 1,793 |
#include "Terminal.h"
#include <windows.h>
#pragma comment(linker, "/defaultlib:kernel32.lib")
// This file should have the majority of OS dependent code in it.
//
//int Write(const char *szData, int cbLength)
//{
// DWORD cbWritten;
//
// WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), szData, cbLength, &cbWritten, n... | 539 | 206 |
#include <xpcc/architecture/platform.hpp>
#include <xpcc/processing.hpp>
#include <xpcc/processing/protothread.hpp>
#include <xpcc/driver/color/tcs3414.hpp>
#include <xpcc/io/iostream.hpp>
#include <xpcc/architecture/interface/gpio.hpp>
xpcc::IODeviceWrapper< Usart2, xpcc::IOBuffer::BlockIfFull > device;
xpcc::IOSt... | 2,922 | 1,309 |
#include "PWM_Module.h"
void PWM_Module::Stop(ledc_channel_t channel_num, bool highspeed) {
ledc_mode_t speed_mode = highspeed ? LEDC_HIGH_SPEED_MODE : LEDC_LOW_SPEED_MODE;
ledc_stop(speed_mode, channel_num, 0);
}
void PWM_Module::Setup(ledc_timer_t timer_num, ledc_channel_t channel_num, bool highspeed, ledc_... | 1,194 | 443 |
// Copyright (c) 2015-2016 Vittorio Romeo
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: http://opensource.org/licenses/AFL-3.0
// http://vittorioromeo.info | vittorio.romeo@outlook.com
#pragma once
#include <ecst/config.hpp>
#include <ecst/mp/edge.hpp>
#include <ecst/mp/adjacency_list/ndp.hpp>... | 2,509 | 827 |
/*
* Copyright (c) 2021 The Foundation for Research on Information Technologies in Society (IT'IS).
*
* This file is part of iSEG
* (see https://github.com/ITISFoundation/osparc-iseg).
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "Precompiled.h"
#inc... | 28,647 | 13,042 |
#include <stdio.h>
#include<stdlib.h>
int check();
void freee();
int l1;
int l2;
struct BST
{
struct node *pointer;
struct BST *left;
struct BST *right;
struct BST *parent;
}*root=NULL;
struct node
{
int a;
struct node *next;
}*head=NULL,*head1=NULL;
//inserting the no. in the ... | 12,273 | 4,449 |
std::vector<int> prefixSums(std::vector<int> a) {
std::vector<int> b(1, a[0]);
for (int i = 1; i < a.size(); i++) {
b.push_back(b[i - 1] + a[i]);
}
return b;
}
| 174 | 88 |
//=--Utils.cpp----------------------------------------------------*- C++-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | 8,881 | 3,036 |
#include <iostream>
using namespace std;
constexpr int new_sz()
{
return 42;
}
constexpr size_t scale(size_t cnt)
{
return new_sz() * cnt;
}
int main()
{
constexpr int foo = new_sz();
cout << foo << endl;
const size_t sc = scale(10);
cout << sc << endl;
int arr[scale(2)]; //ok
cout << arr << endl;
int... | 397 | 175 |
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/TextTestProgressListener.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cstdlib>
int ... | 1,075 | 328 |
#include <iostream>
using namespace std;
const int N = 111111;
int n;
int a[N], b[N];
pair<int, int> ans[N];
void recover() {
for (int i = 0; i < n; i++) {
a[i] = b[i];
}
}
int check() {
for (int i = 0; i < n; i++) {
if (a[i] != a[(i + 1) % n]) {
return 0;
}
}
... | 3,000 | 1,161 |
#include "battery.h"
#include "Arduino.h"
// IMPORTANT: has to run before initialising wifi!
float measure_battery_voltage()
{
const int adcpin = 13;
const float measure_min = 2296;
const float measure_max = 2590;
const float voltage_min = 3.45f;
const float voltage_max = 4.08f;
// throw-away value
analogRead(adc... | 592 | 258 |
#include "ProfileIterator.hpp"
#include <limits>
#include "../Math/Constants.hpp"
#include "LineString.hpp"
#include "Profile.hpp"
namespace JEBMath {
using namespace std;
ProfileIterator::ProfileIterator(const Profile* prof, size_t* index)
: m_Profile(prof),
m_Index(index),
m_UndefinedHeight(numeri... | 1,713 | 580 |
#include "StdAfx.h"
#include "TDFakeObjSystem.h"
#include "TDException.h"
WX_IMPLEMENT_DYNAMIC_VIRTUAL(tFakeObjSystem, GETCLASS(tNode));
| 138 | 68 |
#include "modify_exit.h"
#include "ui_modify_exit.h"
modify_exit::modify_exit(QWidget *parent) :
QDialog(parent),
ui(new Ui::modify_exit)
{
ui->setupUi(this);
}
modify_exit::~modify_exit()
{
delete ui;
}
void modify_exit::on_id_exit_valueChanged(int arg1)
{
}
void modify_exit::on_buttonBox_accepted... | 328 | 144 |
#include "ast/Module.h"
bool Module::declare(Function& func) {
if (func.pub) pub_functions.push_back(&func);
auto key = std::make_pair(func.token.str(), func.param_names.size());
auto iter = functions.find(key);
if (iter == functions.end()) {
std::vector<Function*> vec;
vec.push_back(&func);
functions[key] =... | 2,619 | 938 |
//
// MainPage.xaml.cpp
// MainPage 类的实现。
//
#include "pch.h"
#include "MainPage.xaml.h"
using namespace Gomuku;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::System::Threading;
using namespace Windows::UI::Xaml;
using namesp... | 4,194 | 1,839 |
// SPDX-license-identifier: Apache-2.0
// Copyright © 2022 Dylan Baker
#include <algorithm>
#include <array>
#include <future>
#include <iostream>
#include <mutex>
#include "argument_extractors.hpp"
#include "exceptions.hpp"
#include "log.hpp"
#include "passes.hpp"
#include "private.hpp"
namespace MIR::Passes {
nam... | 7,047 | 2,100 |
/*
* Copyright (c) 2013 Jonan Cruz-Martin
*
* Distributed under the terms of the MIT license, see the accompanying
* file COPYING or http://opensource.org/licenses/MIT.
*/
#include "cylindrical.hpp"
#include "cartesian.hpp"
#include "spherical.hpp"
PointCylindrical3D::PointCylindrical3D()
{
point = new PointCy... | 3,294 | 1,339 |
/*
* k-d tree Node
* Author: Kiran Mohan
*/
// C++ Standard Library
#include <iostream>
// KdTree
#include <kdtree/kdtree.h>
int main(int argc, char** argv)
{
kd_tree::KdPointList point_list = {{2,3},{5,4},{9,6},{4,7},{8,1},{7,2}};
kd_tree::KdTree tree(point_list);
tree.traverseTree();
tree.printMinInAll... | 341 | 153 |
/**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include "particle_filter.h"
#include <math.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include <assert.h>
#include "helper_functions.h"... | 7,500 | 2,446 |
#include "TChain.h"
#include "TStopwatch.h"
#include "skim.hpp"
using namespace std;
int main(int argc, char **argv) {
std::string infile;
std::string outfile;
if (argc == 2) {
infile = argv[1];
outfile = infile.substr(0, infile.size() - 5) + "_skim.root";
} else if (argc == 3) {
infile = argv[1]... | 819 | 355 |
//=========================================================================
// Copyright (C) 2012 The Elastos 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
//
// ... | 11,470 | 4,248 |
/*
* Copyright (c) 2004-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.
*
*/
#in... | 7,185 | 2,483 |
/*
* Copyright 2019 Xilinx Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | 3,836 | 1,525 |
#include "internal/step/StepManager.hpp"
#include "internal/hook/HookRegistrar.hpp"
#include "internal/ContextManager.hpp"
#include "internal/Macros.hpp"
#include "internal/drivers/DriverSelector.hpp"
| 202 | 67 |
#pragma once
#include "z5/dataset.hxx"
#include "z5/metadata.hxx"
#include "z5/handle/handle.hxx"
namespace fs = boost::filesystem;
namespace z5 {
// factory function to open an existing zarr-array
inline std::unique_ptr<Dataset> openDataset(const std::string & path, const FileMode::modes mode=FileMode::a) {... | 5,456 | 1,552 |
/*
* Automatically Generated from Mathematica.
* Thu 23 May 2019 13:10:07 GMT-04:00
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "Jp_toe_joint_right.h"
#ifdef _MSC_VER
#define INLINE __forceinline /* use __forceinline (VC++ specific) */
#else
#define INLINE static inline ... | 39,157 | 29,031 |
//@ {
//@ "targets":[{"name":"output_file.test","type":"application", "autorun":1}]
//@ }
#include "./output_file.hpp"
#include "./membuffer.hpp"
#include "./file_structs.hpp"
#include <cassert>
#include <algorithm>
#include <random>
#include <cstring>
namespace
{
Wad64::MemBuffer generateData()
{
Wad64::WadInf... | 4,996 | 2,041 |
#include <FalconEngine/Graphics/Renderer/Platform/OpenGL/OGLTexture1d.h>
#include <cstring>
#include <FalconEngine/Graphics/Renderer/Platform/OpenGL/OGLUtility.h>
namespace FalconEngine
{
/************************************************************************/
/* Constructors and Destructor ... | 1,089 | 337 |
#include <clpch.h>
#include <GL/glew.h>
#include <Graphics/Renderer.h>
namespace cl{
int Renderer::Init(){
GLenum err = glewInit();
if (GLEW_OK != err){
CL_CORE_ASSERT("Unable to initialize GLEW!", glewGetErrorString(err));
return -1;
}
GLCall(glEnable(GL_D... | 1,152 | 424 |
#include "main.h"
using namespace okapi;
std::shared_ptr<okapi::ChassisControllerIntegrated> controller;
std::unique_ptr<okapi::Motor> dl1, dl2, dl3;
std::unique_ptr<okapi::Motor> dr1, dr2, dr3;
namespace drive {
void init() {
// creating a ChassisControl object using the MotorGroups defined above,
// setting ... | 1,367 | 576 |
#pragma once
#include <QWidget>
#include <string>
namespace Ui {
class SettingsPage;
}
class SettingsPage : public QWidget
{
Q_OBJECT
public:
explicit SettingsPage(QWidget *parent = 0);
~SettingsPage();
private slots:
void on_menuButton_clicked();
///
/// It stores setting data into a file.
///
v... | 421 | 149 |
#include "enclave.h"
extern "C"
{
#include "ecall_batchnorm_layer.h"
}
#include "types.h"
// void ecall_gemm(int TA, int TB, int M, int N, int K, float ALPHA,
// float *A, int lda,
// float *B, int ldb,
// float BETA,
// float *C, int ldc, int a_size, int b_size, int c_size) {
// ... | 11,150 | 4,708 |
#include "Texture.h"
#include "Game_core.h"
#include <SDL_image.h>
#include <SDL_ttf.h>
#include "Colors.h"
namespace Game
{
namespace Graphics
{
Texture::Texture(Renderer& renderer, const std::filesystem::path& file_path)
: Texture{
std::unique_ptr<SDL_Surface, Sdl_deleter>{IMG_Load(file_path.string().c_s... | 1,817 | 794 |
/*
* Copyright © 2016 Lukas Rosenthaler, Andrea Bianco, Benjamin Geer,
* Ivan Subotic, Tobias Schweizer, André Kilchenmann, and André Fatton.
* This file is part of Sipi.
* Sipi is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by ... | 2,950 | 850 |
// Copyright information can be found in the file named COPYING
// located in the root directory of this distribution.
#include "windowManager/x11/x11WindowMgr.h"
#include "console/console.h"
#include "core/stream/fileStream.h"
//#include "game/resource.h"
//#include "game/version.h"
#include "math/mRandom.h"
#inclu... | 22,148 | 7,218 |
#include <iostream>
#include <string>
#include "TrianglePattern.h"
using namespace std;
TrianglePattern::TrianglePattern():ShapePattern(){
this->height = 0;
}
TrianglePattern::TrianglePattern(int x){
set_height(x);
}
void TrianglePattern::set_height(int x){
this->height = x;
}
int TrianglePattern::pattern... | 791 | 271 |
// OpenVPN -- An application to securely tunnel IP networks
// over a single port, with support for SSL/TLS-based
// session authentication and key exchange,
// packet encryption, packet authentication, and
// packet compression.
//
// Copyright (C) 2012-201... | 3,044 | 1,028 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v;
for(int i=0;i<10;i++){
v.push_back(i);
}
cout << "Size: " << v.size() << endl;
v.pop_back();
cout << "Size: " << v.size() << endl;
} | 264 | 108 |
#include<bits/stdc++.h>
using namespace std;
int get(int a , int b){
if(b == 0) return 1;
if(b == 1)return a % 10;
int x = get(a , b / 2) % 10;
x = x * x % 10;
if(b & 1)
x = (x * a) % 10;
return x;
}
int main(){
int n ;
cin >> n;
cout << get(1378 , n) << endl;
}
| 280 | 158 |
// raytrace/scene.cpp - Johan Smet - BSD-3-Clause (see LICENSE)
#include "scene.h"
namespace rtiow {
Material &Scene::material_create_default() {
auto &mat = m_materials.emplace_back();
mat.m_albedo = {0.0f, 0.0f, 0.0f};
mat.m_specular_chance = 0.0f;
mat.m_specular_color = {0.0f, 0.0f, 0.0f};
mat.m_specular_rou... | 2,331 | 973 |
#include "ODESimulator.h"
#include "ODECommon.h"
#include "ODECustomGeometry.h"
#include "Settings.h"
#include <list>
#include <fstream>
//#include "Geometry/Clusterize.h"
#include <geometry/ConvexHull2D.h>
#include <statistics/KMeans.h>
#include <statistics/HierarchicalClustering.h>
#include <utils/EquivalenceMap.h>
#... | 41,447 | 16,528 |
#include <iostream>
class Base {
public:
Base(int a, int b){
this->a = a;
this->b = b;
}
public:
virtual void print(){
std::cout << "member: a=" << a << ", b="
<< b << std::endl;
}
public:
int... | 1,284 | 413 |
/**
* Upbit Open API
* ## REST API for Upbit Exchange - Base URL: [https://api.upbit.com] - Official Upbit API Documents: [https://docs.upbit.com] - Official Support email: [open-api@upbit.com]
*
* OpenAPI spec version: 1.0.0
* Contact: ujhin942@gmail.com
*
* NOTE: This class is auto generated by the swagger co... | 13,700 | 4,488 |
#include "MemSystem.h"
#include <AI/PropActorBrain.h>
namespace AI
{
void CMemSystem::Update()
{
float Now = 0.f;//(float)GameSrv->GetTime();
CArray<CSensor*> ValidationSensors;
// Here we validate facts that reside in memory but weren't updated by the last
// sensor activity session. Facts will be accepted or... | 2,296 | 856 |
#include <qtphonemes.h>
#define SYL_RISE 1
#define SYL_EMPHASIS 2
#define SYL_END_CLAUSE 4
#define PITCHfall 0
#define PITCHrise 2
#define PITCHfrise 4 // and 3 must be for the variant preceded by 'r'
#define PITCHfrise2 6 // and 5 must be the 'r' variant
#define PITCHrisefall 8
#define N_TONE_H... | 34,574 | 9,749 |
#pragma once
#include "Component.hpp"
namespace nen {
class circle_component : public base_component {
public:
circle_component(class base_actor &owner);
void SetRadius(float radius) noexcept { mRadius = radius; }
vector3 GetRadius() const;
const vector3 &GetCenter() const;
bool Intersect(const circle_compon... | 405 | 122 |
#ifndef __SPECIAL_FB_GUIDE_H__
#define __SPECIAL_FB_GUIDE_H__
#include "scene/speciallogic/speciallogic.hpp"
#include "other/fb/fbguideconfig.hpp"
#include "protocal/msgfb.h"
class SpecialFbGuide: public SpecialLogic
{
public:
SpecialFbGuide(Scene *scene);
virtual ~SpecialFbGuide();
virtual void OnRoleLeaveScene... | 628 | 245 |
#ifndef EDepSim_GPSKinematicsGenerator_hh_Seen
#define EDepSim_GPSKinematicsGenerator_hh_Seen
#include <globals.hh>
#include <G4LorentzVector.hh>
#include "kinem/EDepSimVKinematicsGenerator.hh"
class G4Event;
class G4VPrimaryGenerator;
/// This is an interface to use the General Particle Source (GPS).
namespace EDe... | 820 | 269 |
// Copyright (c) 2019 PaddlePaddle 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... | 13,811 | 4,609 |
/*
Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
2004, 2005, 2006 Rob Buis <buis@kde.org>
2005 Apple Computer, Inc.
This file is part of the KDE project
This library is free software; you can redistribute it and/or
modify it under the terms of ... | 4,066 | 1,316 |
#ifndef CCPI_RECON_NEXUS
#define CCPI_RECON_NEXUS
namespace CCPi {
bool read_NeXus(pixel_data &pixels, pixel_2d &i_dark, pixel_2d &f_dark,
pixel_2d &i_bright, pixel_2d &f_bright, int &nh_pixels,
int &nv_pixels, std::vector<real> &angles, int &nangles,
real &hsize, real &vsize, const std::string filenam... | 506 | 224 |
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture, development version *
* (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH *
* *
... | 32,762 | 9,737 |
#include "../include/Event.h"
////////////////////////////////
/// Public Member Functions ////
////////////////////////////////
Event::Event() {
init();
}
void Event::init(){
m_exist = false;
m_title = "No Event";
m_day = 1;
m_month = 1;
m_year = 1900;
}
void Event::set_title(std::string t_title) {
m_titl... | 760 | 312 |
#include<iostream>
int main()
{
int arr[50] = {1,2,3,4,5};
int sum = 0, currSum = 0, subIndex = 0;;
int i = 0;
cout<<"\nEnter Proposed Sum\n";
cin>>sum;
currSum = 0;
subIndex = 0;
for(i = 0 ; i < 5 ; i++)
{
currSum += arr[i];
if(currSum > sum)
currSum -= a... | 489 | 198 |
// Copyright 2015 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 "ui/ozone/platform/drm/gpu/mock_scanout_buffer_generator.h"
#include "ui/ozone/platform/drm/common/drm_util.h"
#include "ui/ozone/platform/drm/g... | 809 | 274 |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, i;
cin >> n >> i;
n = n ^ (1<<i);
cout << n;
return 0;
} | 141 | 61 |
#include "Mesh.h"
#include <vector>
void Mesh::init(Vertex* vertices, unsigned int numVertices, unsigned int* indices, unsigned int numIndices)
{
IndexedModel model;
for (unsigned int i = 0; i < numVertices; i++)
{
model.positions.push_back(*vertices[i].GetPos());
model.texCoords.push_back(*vertices[i].GetTex... | 3,201 | 1,184 |
/*
Searching for critical points of the Kopal potential Omega of the
misaligned binary star:
Omega(x,y,z,params) =
1/r1 + q(1/r2 - x/delta^2) +
1/2 (1 + q) F^2 [(x cos theta' - z sin theta')^2 + y^2]
r1 = sqrt(x^2 + y^2 + z^2)
r2 = sqrt((x-delta)^2 + y^2 + z^2)
The critical poin... | 2,287 | 1,050 |
/**************************************************************
*
* 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 y... | 2,586 | 795 |
#include "gles_common.h"
static GLuint gvPositionHandle;
PACKED(struct params
{
GLuint count;
GLuint primCount;
GLuint first;
GLuint baseInstance;
});
const char *vertex_shader_source[] = GLSL_VS(
in vec4 vPosition;
flat out int texcoord;
void main()
{
gl_Position = vPosition;
texcoord = int(floor(vPosit... | 3,371 | 1,560 |
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int cache[501][501];
int search_path(vector<vector<int>>& tri, int y, int x) {
if (y == tri.size())
return 0;
int& ret = cache[y][x];
if (ret != -1)
return ret;
ret = 0;
ret = max(re... | 839 | 384 |
#include "Arduino.h"
#include "MultiDirectionalMotor.h"
MultiDirectionalMotor::MultiDirectionalMotor(String name, int motorLeftForwardPin, int motorLeftReversePin, int motorRightForwardPin, int motorRightReversePin, int motorRightSpeedPin, int motorLeftSpeedPin){
_name = name;
_motorLeftForwardPin = motorLeftForw... | 2,844 | 1,035 |
#include "ez_qbuffer.h"
namespace ez
{
void qbufferInit(void)
{
}
bool qbufferCreate(qbuffer_t *p_node, uint8_t *p_buf, uint32_t length)
{
bool ret = true;
p_node->in = 0;
p_node->out = 0;
p_node->len = length;
p_node->size = 1;
p_node->p_buf = p_buf;
return ret;
}
bool qbufferCreateBySiz... | 2,190 | 1,036 |
/****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyri... | 9,611 | 3,574 |
#include "_Head.h"
extern jmp_buf home_page_jump;
extern jmp_buf secondary_inerface_jump;
void Enter()
{
_interface* inter = new _interface();
Sign* sign = new Sign();
std::string& choose = inter->FirstChoose();
sign->AorB(choose);
sign->Password(choose);
delete sign;
delete inter;
}
void Operate()
{
Reader... | 557 | 273 |
#include <unistd.h>
#include <stdio.h>
int main()
{
int n = 0;
while (1) {
sleep(1);
printf("while_loop %d\n", ++n);
fflush(stdout);
}
return 0;
}
| 158 | 84 |
#include <pybind11/pybind11.h>
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include <ceres/ceres.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <sophus/se3.hpp>
namespace py = pybind11;
// Example autodiff cost function from ceres tutorial
struct ExampleFunctor {
template<typename T>
bool o... | 13,193 | 4,822 |
/*
** Modified from https://github.com/efficient/cuckoofilter
** (1) simplify the design
** (2) add serialize/deserialize interfaces
** Thanks discussions with Minglang Dong
*/
#ifndef KUNLUN_CUCKOO_FILTER_HPP
#define KUNLUN_CUCKOO_FILTER_HPP
#include "../include/std.inc"
#include "../utility/murmurhash3.hpp"
#includ... | 17,552 | 5,919 |
/** @file
*
* A brief file description
*
* @section license License
*
* 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... | 10,214 | 3,822 |
#include <bits/stdc++.h>
using namespace std;
void resultData(vector<string> identifier,
vector<int> timeSbm,
vector<string> result,
int sbm)
{
vector<string> crt, inctr;
int s = 0;
int p = 0;
for (int i = 0; i < sbm; ++i) {
if (result[i].compare("correct") == 0) {
s++;
... | 1,230 | 441 |
/*
* IndvidualVehicleOwnershipLogsumDao.hpp
*
* Created on: Jan 20, 2016
* Author: gishara
*/
#pragma once
#include "database/dao/SqlAbstractDao.hpp"
#include "database/entity/IndvidualVehicleOwnershipLogsum.hpp"
namespace sim_mob
{
namespace long_term
{
/**
* Data Access Object ... | 1,522 | 448 |
#ifndef LIBSOCKS5_DETAIL_THROW_ERROR_HPP
#define LIBSOCKS5_DETAIL_THROW_ERROR_HPP
#include <boost/system/error_code.hpp>
#include <boost/system/system_error.hpp>
namespace socks5::detail {
inline void throw_error(const boost::system::error_code &ec) {
if (ec) {
throw boost::system::system_error {ec};
... | 364 | 142 |
/*
* Debug.cpp
*
* Created on: Jul 18, 2015
* Author: syroegkin
*/
#include "ADebug.h"
#if ADEBUG_STATUS == 1
unsigned char ADebug::wasInit = 0;
ErrorTypes ADebug::etypes;
/**
* Initialize Serial interface
*/
void ADebug::init(void) {
if(ADebug::wasInit != 1){
#if ADEBUG_INFO == 1
ADebug::etypes.i ... | 1,256 | 508 |
/* perm_gen_base.inl
This header file defines the PermutationGeneratorBase template class.
Copyright(c) 2019 David Krikheli
Modification history:
14/Nov/2019 - David Krikheli created the module.
*/
#include <algorithm>
namespace dk {
template <class T>
PermutationGeneratorBase<T>::PermutationGeneratorBase()
... | 3,447 | 1,435 |
#include "event.hpp"
#include <mutex>
#include <unordered_set>
namespace beltpp_socket_impl
{
using namespace beltpp;
using std::unordered_set;
event_handler_ex::event_handler_ex()
: m_impl()
{
}
event_handler_ex::~event_handler_ex() = default;
event_handler_ex::wait_result event_handler_ex::wait(std::unorder... | 3,515 | 1,287 |
/**
* Copyright 2016 Alexander Scheel
*
* Map objects implementation file
**/
#include <stdlib.h>
#include <stdio.h>
#include "map.h"
#include "object.h"
#include "map_object.h"
#include "utils.h"
void map_objects_init(map_c* current)
{
current->object_count = 35 + (rand() % 15);
current->objects = (obj... | 1,709 | 581 |
/*
* IKSDL - C++ wrapper for SDL
* Copyright (C) 2021 InternationalKoder
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this softwar... | 2,310 | 729 |
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: ipermute.cpp
//
// MATLAB Coder version : 3.0
// C/C++ source code generated on : 27-Jan-... | 1,203 | 522 |
//
// Created by Ivan Kishchenko on 05.09.2021.
//
#include "ZeroMQWriter.h"
#include "ZeroMQFlag.h"
std::error_code ZeroMQWriter::writeData(const void *data, std::size_t size) {
write((const char*)data, size);
if (!(*this)) {
return std::make_error_code(std::errc::message_size);
}
return {};... | 1,394 | 505 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/awstransfer/model/WorkflowStep.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
name... | 2,575 | 900 |
/* #define IN_spa */
#include "species_advance_efield.h"
//----------------------------------------------------------------------------//
// Top level function to select and call particle advance function using the
// desired particle advance abstraction. Currently, the only abstraction
// available is the pipeline a... | 1,079 | 268 |
//==============================================================================
// Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI
// Copyright 2012 - 2014 MetaScale SAS
//
// Distributed under the Boost... | 2,297 | 858 |
#include<iostream>
#include<string.h>
using namespace std;
class elective {
private:
int code;
int capacity;
int reserved;
public:
elective(int code, int capacity, int reserved);
void printStatus();
void add(int n);
void reduce(int n);
};
void elective::printStatus() {
floa... | 902 | 319 |
// Copyright (c) 2004-2022 Yoshikatsu Fujita / LittleWing Company Limited.
// See LICENSE file for terms and conditions of use.
#include "core.h"
#include "hash.h"
#include "arith.h"
#include "equiv.h"
#include "utf8.h"
#define EQUAL_HASH_DEPTH_LIMIT 100
uint32_t address_hash1(void* adrs, uint32_t bound) { return ((... | 15,716 | 7,147 |
/// Source : https://leetcode.com/problems/reverse-string-ii/description/
/// Author : liuyubobobo
/// Time : 2018-06-04
#include <iostream>
using namespace std;
/// Simulation
/// Time Complexity: O(n)
/// Space Complexity: O(1)
class Solution {
public:
string reverseStr(string s, int k) {
for(int i ... | 667 | 253 |
/*
Copyright (c) 2015 Anon authors, see AUTHORS file.
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... | 30,969 | 10,149 |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include <CppUnitTest.h>
#include <CppRuntimeOptions.h>
#include <Networking/IHttpResource.h>
#include <Networking/OriginPolicy.h>
#include <Test/HttpServer.h>
// Standard Library
#include <future>
using namespace Microsoft::Vis... | 37,377 | 11,859 |
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include "execute.h"
#include "component.h"
#include "connector.h"
using namespace std;
int main(){
OriginalClass* command = new OriginalClass("command",1); //simliar to a base class but slightly different, there is a single instance of this class at all... | 1,778 | 479 |
// Copyright (c) 2021 Ethan Margaillan <contact@ethan.jp>.
// Licensed under the MIT License - https://raw.githubusercontent.com/Ethan13310/ECS/master/LICENSE
#include <ECS/Detail/SystemHolder.hpp>
ecs::detail::SystemHolder::~SystemHolder()
{
removeAllSystems();
}
void ecs::detail::SystemHolder::removeAllSystems()
... | 753 | 325 |