text string | size int64 | token_count int64 |
|---|---|---|
///////////////////////////////////////////////////////////////////////////////
/// \file proto_typeof.hpp
/// Type registrations so that proto1 expression templates can be used together
/// with the Boost.Typeof library.
//
// Copyright 2007 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0.... | 3,645 | 1,467 |
// The cell graph is a graph in which each vertex
// corresponds to a cell.
// An undirected edge is created between two vertices
// if the there is good similarity between the
// expression vectors of the corresponding cells.
#ifndef CZI_EXPRESSION_MATRIX2_CELL_GRAPH_HPP
#define CZI_EXPRESSION_MATRIX2_CELL_GRAPH_HPP
... | 8,475 | 2,427 |
#pragma once
#include <stddef.h>
#include "Array.hpp"
#include "IntegerSequence.hpp"
#include "make_array.hpp"
#include "MakeIntegerSequence.hpp"
namespace T27
{
namespace intern
{
template <class T, int... inds1, int... inds2>
constexpr Array<T, sizeof...(inds1) + sizeof...(inds2)> concat_(
... | 955 | 315 |
#include "header.h"
#if defined(_MSC_VER)
#include <SDL_syswm.h>
#endif
#include <math.h>
#include "BaseEngine.h"
#include "DisplayableObject.h"
#include "DrawingSurface.h"
#include "DrawingFilters.h"
#include "FontManager.h"
#include "templates.h"
/*
Template function to swap two values... | 31,512 | 13,625 |
#include <iostream>
#include <server.hpp>
#include <ssl.hpp>
using namespace std;
template<class Request>
auto make_response(const Request & req, const string & user_body){
boost::beast::http::string_body::value_type body(user_body);
auto const body_size = body.size();
boost::beast::http::response<boo... | 7,457 | 4,303 |
/*
** Author: ASC_8384
** Website: www.ASC8384.top
** License: CC0
** Time: 2020-11-21 22:55:51
*/
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int size = 2e5 + 9;
const ll mod = 1e9 + 7;
int a[size];
string s1, s2;... | 1,102 | 635 |
#include "Taiga_Biome.h"
void Taiga_Biome::drawBiome(Shader shader, Block_Heavy & data, glm::mat4 model)
{
//draw the trees
for (int i = 0; i < trees.size(); i++) {
for (int j = 0; j < trees[i].part1.size(); j++) {
int x = trees[i].part1[j].x, y = trees[i].part1[j].y, z = trees[i].part1[j].z;
model[3][0] = x... | 1,906 | 889 |
#include <GLSL/VAO.h>
namespace gl {
#if 0
VAO::VAO()
:id(0)
{
}
VAO::~VAO() {
id = 0;
}
bool VAO::setup() {
if(id) {
LC_ERROR(ERR_GL_VAO_ALREADY_SETUP);
return false;
}
glGenVertexArrays(1, &id);
if(!id) {
LC_ERROR(ERR_GL_VAO_CANNOT_CREATE);
return fa... | 1,923 | 805 |
#include "ConfigData.h"
#include <QTranslator>
#include <QApplication>
/**
* @brief ConfigData::ConfigData Creates the ConfigData object.
*/
ConfigData::ConfigData() : QSettings("IOSB", "CoBaB"){
Q_INIT_RESOURCE(application);
languages.insert("German", QLocale(QLocale::German));
languages.insert("Englis... | 4,489 | 1,350 |
/*
* Author: xiaohei_AWM
* Date:5.3
* Mutto: Face to the weakness, expect for the strength.
*/
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<ctime>
#include<utility>
#include<functional>
#include<vector>
#include<assert.h>
using namespace std;
#define reg regist... | 1,988 | 884 |
//
// main.cpp
// 393. UTF-8 Validation
//
// Created by Jaylen Bian on 7/26/20.
// Copyright © 2020 边俊林. All rights reserved.
//
#include <map>
#include <set>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <cstdio>
#include <numeric>
#include <cstdlib>
#include <utility>
#include <... | 1,131 | 436 |
#include <bits/stdc++.h>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int factorial(int n) {
int fact = 1;
for (int v = 1; v <= n; v++) {
fact = fact * v;
}
return fact;
}
return 0;
}
| 280 | 118 |
/* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certai... | 4,058 | 1,460 |
#include "ExpressionManager.h"
#include <diesel.h>
ExpressionManager::ExpressionManager() {
_vmCtx = vm_create_context();
vm_add_variable(_vmCtx, "TIMER", 0.0f);
vm_add_variable(_vmCtx, "PI", ds::PI);
vm_add_variable(_vmCtx, "TWO_PI", ds::TWO_PI);
}
ExpressionManager::~ExpressionManager() {
vm_destroy_context(_v... | 1,051 | 402 |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <button_checker.h>
#include <fcntl.h>
#include <fuchsia/camera/test/cpp/fidl.h>
#include <fuchsia/camera2/cpp/fidl.h>
#include <lib/devmgr-integra... | 6,855 | 2,427 |
// 909 Snakes and Ladders
// https://leetcode.com/problems/snakes-and-ladders
// version: 1; create time: 2020-01-12 11:30:15;
class Solution {
public:
int snakesAndLadders(vector<vector<int>>& board) {
const int m = board.size();
if (m == 0) return -1;
const int n = board.size();
i... | 1,419 | 491 |
/******************************************************************************
* _ _____ __________ *
* | | / / _ | / __/_ __/ Visibility *
* | |/ / __ |_\ \ / / Across *
... | 2,649 | 768 |
#include <stdlib.h>
#include <chrono>
#include <thread>
#include <iostream>
#include <sys/time.h>
#include <string.h>
#include "../headers/Thread.hpp"
using namespace std;
Mutex::Mutex() : mutex(PTHREAD_MUTEX_INITIALIZER) {}
void Mutex::lock() {
pthread_mutex_lock(&mutex);
}
void Mutex::unlock() {
pthread_m... | 2,762 | 1,023 |
#include"http.h"
http::http(){
std::cout<<"http is created!"<<std::endl;
}
http::~http(){
}
/*
报文的请求方法解析,成功返回请求方法,失败返回nullptr;
*/
char* http::http_Request_method(char in_str[],char out_str[]){//数组不能引用
int len=0;
for(len=0;len<10;++len){
if(in_str[len]!=' '){
out_str[len]=in_str[len]... | 15,937 | 5,957 |
// Copyright 2017 Google 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 in... | 5,403 | 1,586 |
/*
* Copyright (c) 2009-2011 Hazard (hazard_x@gmx.net / twitter.com/HazardX)
*
* 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
* ... | 8,997 | 3,185 |
#include "class_2.h"
#include "class_1.h"
#include "class_3.h"
#include "class_0.h"
#include "class_4.h"
#include "class_6.h"
#include <lib_47/class_0.h>
#include <lib_1/class_6.h>
#include <lib_11/class_4.h>
#include <lib_54/class_5.h>
#include <lib_47/class_7.h>
class_2::class_2() {}
class_2::~class_2() {}
| 311 | 157 |
#include <iostream>
#include <queue>
using namespace std;
int main() {
int m[100001];
fill_n(m, 100001, 100002);
int n, k;
cin >> n >> k;
m[n] = 0;
queue<int> q;
q.push(n);
while (!q.empty()) {
int cur = q.front();
q.pop();
if (cur + 1 < 100001 && m[cur + 1] ... | 740 | 352 |
#include "DemoApp.h"
int main(int *arg, char **argv)
{
DempApp app;
std::cout<<"Enter: Screen Shot"<<std::endl;
app.Start();
return 0;
} | 141 | 63 |
/*
For a positive integer n let's define a function f:
f(n)?=??-?1?+?2?-?3?+?..?+?(?-?1)nn
Your task is to calculate f(n) for a given integer n.
Input
The single line contains the positive integer n (1?=?n?=?1015).
Output
Print f(n) in a single line.
Examples
inputCopy
4
outputCopy
2
inputCopy
5
outputCopy
-3
Note... | 640 | 308 |
// Copyright (c) 2019 Intel Corporation
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
#include "carla/rss/RssCheck.h"
#include "carla/client/Map.h"
#include "carla/client/Vehicle.h"
#include "carla/client/Waypoint.h"
#include "carla/road/elem... | 19,128 | 6,592 |
#include "win.h"
#include "ui_win.h"
#include "mainwindow.h"
Win::Win(QWidget *parent) :
QDialog(parent),
ui(new Ui::Win)
{
ui->setupUi(this);
}
Win::~Win()
{
delete ui;
}
void Win::on_retry_clicked()
{
MainWindow *mainwindow = new MainWindow();
mainwindow->show();
}
| 295 | 123 |
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: SDIDOC.CPP
** COMPONENT: Windows C++ Library.
** DESCRIPTION: CSDIDoc class definition.
**
*******************************************************************************
*/
#include "Common.hpp"
#includ... | 956 | 268 |
/************************************************************************************
*
* D++, A Lightweight C++ library for Discord
*
* Copyright 2021 Craig Edwards and D++ contributors
* (https://github.com/brainboxdotcc/DPP/graphs/contributors)
*
* Licensed under the Apache License, Version 2.0 (the "License... | 8,899 | 3,159 |
// ============================================================================
// Copyright 2018 Paul le Roux and Calvin Maree
//
// 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 ... | 2,010 | 695 |
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
using namespace std;
void error(const char *msg)
{
perror(msg);
exit(1);
}
int main(int argc,char *argv[])
{
if(argc<2)
{
cout<<"Po... | 1,686 | 648 |
/**
* Copyright (C) 2013, Niklas Rosenstein
* All rights reserved.
*
* SmearHistory.cpp
*/
#include "SmearHistory.h"
#include "nrUtils/Memory.h"
#include "nrUtils/Normals.h"
using namespace nr::memory;
Bool SmearState::Resize(Int32 count) {
Bool success = true;
success = success && Realloc<Vector>(orig... | 5,051 | 1,661 |
#include <iostream>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode()
{
val = 0;
left = nullptr;
right = nullptr;
}
TreeNode(int x)
{
val = x;
left = nullptr;
right = nullptr;
}
TreeNode(i... | 1,290 | 435 |
# include "Value.hpp"
namespace riscv {
int8_t SignedValue::As8() {
return static_cast<int8_t>(_value);
}
int16_t SignedValue::As16() {
return static_cast<int16_t>(_value);
}
int32_t SignedValue::As32() {
return static_cast<int32_t>(_value);
}
int64_t SignedValue::As64() {
return _value;
}
SignedV... | 939 | 391 |
/*
** Copyright 2011-2013 Merethis
**
** 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 hope... | 10,578 | 3,747 |
/*M///////////////////////////////////////////////////////////////////////////////////////
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | 33,490 | 10,787 |
#include "atFBXParser.h"
#include "atFBXCommon.h"
#include "atHashMap.h"
struct _atFbxParseContext
{
atMesh *pMesh;
// Node ptr to bone index
atHashMap<int64_t, int64_t> boneLookup;
int64_t poseID = -1; // ID of the active pos
};
FbxAMatrix _GetGeometry(FbxNode *pNode)
{
FbxDouble3 pivotTrans = pNode->GetG... | 15,614 | 6,080 |
inline void VideoReply::parseData(const JSON& json)
{
if (json.find("data") != json.end()) {
const auto& data = json["data"];
if (!data.empty()) {
const auto& video = data.front();
QList<MutedSegment> mutedSegmentsList;
if (video.find("muted_segments") != video.... | 5,278 | 1,336 |
#include <iostream>
using namespace std;
int main()
{
for (char c='a'; c<='z'; c++)
cout<<"[ \""<<c<<"\" ], ";
cout<<"[ \"\\c\" ]";
}
| 140 | 66 |
#include "Area.h"
Area::Area(const std::string& t_Source)
{
// TODO calculate width and height from t_Source
m_W = 25;
m_H = 10;
// Resize 2D grid accordingly
m_Parts.resize(m_W);
for (size_t x = 0; x < m_Parts.size(); x++)
{
m_Parts[x].resize(m_H);
}
// TODO Generate Whol... | 2,535 | 912 |
/* * * * * * * * * * * * * Author's note * * * * * * * * * * * *\
* _ _ _ _ _ _ _ _ _ _ _ _ *
* |_| |_| |_| |_| |_|_ _|_| |_| |_| _|_|_|_|_| *
* |_|_ _ _|_| |_| |_| |_|_|_|_|_| |_| |_| |_|_ _ _ *
* |_|_|_|_|_| |_| |_| |_| |_| |_| |_| |_| |_... | 10,254 | 3,772 |
__attribute__((constructor)) void before_main();
__attribute__((destructor)) void after_main();
void before_main() {}
void after_main() {}
struct S {
int data;
S(int data) : data(data) {}
~S() {}
};
S s(0);
int main() {}
| 231 | 86 |
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sourc... | 1,476 | 508 |
#include <cstdio>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <cstring>
#include <string>
#include <set>
#include <stack>
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
using namespace std;
int... | 852 | 338 |
/*
* zmqConsumerPoll.cpp
*
* Created on: May 31, 2013
* Author: service
*/
#include "../include/zmqConsumerPoll.h"
using std::string;
zmqConsumerPoll::zmqConsumerPoll(ppcLogger *log, uint num_consumers_to_poll, int timeout_ms)
: _log(log)
, _num_consumers(num_consumers_to_poll)
, _timeout_ms(timeout_ms)
{... | 2,406 | 911 |
/*
** PROGRAM: Matrix Multiply
**
** PURPOSE: This is a simple matrix multiply program.
** It will compute the product
**
** C = A * B
**
** A and B are set to constant matrices so we
** can make a quick test of the multiplication.
**
** USAGE: Right now, I hardwire t... | 2,341 | 1,059 |
#include <iostream>
#include <limits>
#include <random>
#include <thread>
#include "boson/queues/weakrb.h"
#include "catch.hpp"
TEST_CASE("Queues - WeakRB - serial random integers", "[queues][weakrb]") {
constexpr size_t const sample_size = 1e4;
std::random_device seed;
std::mt19937_64 generator{seed()};
std:... | 1,444 | 485 |
/***************************************************************************
* Copyright 1998-2015 by authors (see AUTHORS.txt) *
* *
* This file is part of LuxRender. *
* ... | 64,611 | 27,988 |
class Solution {
public:
string simplifyPath(string path) {
stack<string> s;
string ans;
int len = path.length();
if (len == 0) return ans;
int start, end;
for (int i = 0; i < len; i++) {
if (i > 0 && path[i] != '/' && path[i - 1] == '/') {
... | 934 | 289 |
/*
A0-> 1
A1-> 1 1
A2-> 1 2 1
A3-> 1 3 3 1
for A, pascal triangle will have A+1 elements
*/
vector<int> Solution::getRow(int A) {
vector<int> result;
int value = 1, index;
for( index = 0; index <= A ; index++){
result.push_back(value);
value = value * (A - index)/(i... | 362 | 139 |
/* -*-C++-*-
// @@@ START COPYRIGHT @@@
//
// 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 Licen... | 44,492 | 15,148 |
/////////////////////////////////////////////////////////////////////
// Mapper 83
void NES_mapper83::Reset()
{
regs[0] = regs[1] = regs[2] = 0;
// set CPU bank pointers
if(num_8k_ROM_banks >= 32)
{
set_CPU_banks(0,1,30,31);
regs[1] = 0x30;
}
else
{
set_CPU_banks(0,1,num_8k_ROM_banks-2,num_8... | 5,497 | 2,704 |
#include "stdio.h"
int main()
{
int b=8;
int &a=b;
printf("%d",a);
b+=2;
printf("%d",a);
} | 103 | 53 |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/securityhub/model/AwsEc2VpcEndpointServiceDetails.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
n... | 8,112 | 2,735 |
#include <PnC/DracoPnC/DracoCtrlArchitecture/DracoCtrlArchitecture.hpp>
#include <PnC/DracoPnC/DracoStateMachine/Initialize.hpp>
Initialize::Initialize(const StateIdentifier state_identifier_in,
DracoControlArchitecture* _ctrl_arch,
RobotSystem* _robot)
: StateMachine(... | 1,974 | 644 |
//
// user.cpp
// HelloWorktile
//
// Created by Frank Lin on 3/23/16.
// Copyright © 2016 Frank Lin. All rights reserved.
//
#include "user.h"
#include "json11/json11.hpp"
using std::string;
using std::unique_ptr;
NS_WTC_BEGIN
////////////////////////////////////////////////////////////////////////////////
//... | 1,788 | 664 |
// license:GPL-2.0+
// copyright-holders:Kevin Thacker
/***************************************************************************
pcw.c
Functions to emulate the video hardware of the Amstrad PCW.
***************************************************************************/
#include "emu.h"
#include "includes/p... | 5,763 | 2,658 |
#pragma once
#include "Core/Components/Component.hpp"
namespace KGE
{
class ComponentAudioClip : public Component
{
};
}; | 127 | 43 |
#include <iostream>
#include <fstream>
#include <cassert>
#include <cmath>
#include <boost/utility.hpp>
#include <boost/program_options.hpp>
#include <boost/program_options/variables_map.hpp>
#include "boost/tuple/tuple.hpp"
#include "fdict.h"
#include "sparse_vector.h"
using namespace std;
namespace po = boost::pro... | 4,866 | 1,698 |
// ===================================================================
//
// Description
// Contains the implementation of BBEvent
//
// Revision history
// Date Description
// 30-Nov-2012 First version
//
// ===================================================================
#include "BBEvent.h"
namespace Sfs... | 1,404 | 391 |
#ifndef INSANITY_INTERFACE_STREAM_SOCKET
#define INSANITY_INTERFACE_STREAM_SOCKET
#include "Constants.hpp"
#include "IObject.hpp"
namespace Insanity
{
class IByteArray;
class INSANITY_API IStreamSocket : public virtual IObject
{
public:
//=================================================
//Create a new Strea... | 1,883 | 520 |
#include "Input_Configuration.h"
namespace haft {
Device *Input_Configuration::get_device(const std::string name) const {
for (auto &device: devices) {
if (device->get_name() == name)
return device.get();
}
return nullptr;
// throw runtime_error(string("Invalid device name "... | 344 | 106 |
// Copyright 2021 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/browser/commerce/coupons/coupon_service_factory.h"
#include "chrome/browser/commerce/coupons/coupon_db.h"
#include "chrome/browser/comme... | 1,276 | 385 |
#include <iostream>
#include <string>
#include <regex>
#include <algorithm>
using namespace std;
string helloWorld() {
return "Hello, World!";
}
string alternate(string first, string second) {
string result;
int i;
for (i = 0; i < first.length() && i < second.length(); i++)
result += first.substr(i, 1) +... | 1,523 | 622 |
/**************************************************************
*
* 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... | 5,179 | 1,960 |
#include "Core.h"
#include <iostream>
#include "gl.h"
#if defined(FL_PLATFORM_ANDROID)
#include "platform/android/AndroidSystem.h"
#endif
namespace fl {
#if defined(FL_PLATFORM_WINDOWS)
void Init()
{
}
#elif defined(FL_PLATFORM_ANDROID)
void Init(void* env, void* mainView)
{
AndroidSystem::Init((JNIEnv*)e... | 726 | 299 |
#ifndef PINHOLE_CAMERA_MODEL_HPP_INCLUDED
#define PINHOLE_CAMERA_MODEL_HPP_INCLUDED
#include "MathTypes.hpp"
namespace gazeestimation{
class PinholeCameraModel
{
private:
Vec3 camera_angles;
Mat3x3 actual_rotation_matrix;
public:
// camera intrinsic
double principal_point_x;
double principal_point_y;
double p... | 2,044 | 850 |
#include "IndependentSet.hpp"
IndependentSet::IndependentSet(){
definedGraph = false;
}
IndependentSet::IndependentSet(Graph _graph){
setGraph(_graph);
}
int IndependentSet::searchLargestIndependentSet(){
for(int k=0 ; k<graph.getNVertex() ; k++){
vector<int> vertex_list(graph.getNVertex());
... | 1,356 | 536 |
#ifndef LIEF_SPAN_H
#define LIEF_SPAN_H
#include <LIEF/third-party/span.hpp>
namespace LIEF {
template <typename ElementType, std::size_t Extent = tcb::dynamic_extent>
using span = tcb::span<ElementType, Extent>;
}
#endif
| 225 | 92 |
// 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/test/ui/ui_test.h"
class LocaleTestsDa : public UITest {
public:
LocaleTestsDa() : UITest() {
launch_arguments_.AppendSw... | 1,067 | 399 |
#include "HelperFiles/a_funcs.hpp"
//relu
inline float Relu(float x)
{
return (x > 0) * x;
}
inline float ReluPrime(float x)
{
return x > 0;
}
//leaky relu
inline float ReluLeaky(float x)
{
if (x < 0)
{
return x * A;
}
else
{
return x;
}
}
... | 953 | 415 |
#include "corder.h"
// corder destructor
corder::~corder() {
vector < int > ().swap(l);
vector < int > ().swap(item);
vector < int > ().swap(sitem);
vector < vector < int > > ().swap(stypeindex);
vector < vector < int > > ().swap(stypelist);
vector < string > ().swap(mode);
vector < string > ().swap(type);
vec... | 8,845 | 4,528 |
#include <iostream>
using namespace std;
int suma(int vector1[], int N);
void dataRequest();
void showVector();
int N, vector[100];
int main(int argc, char** argv)
{
// pidiendo los datos al usuario
dataRequest();
showVector();
int addition = suma(vector, N);
cout << "La suma de todos los numeros del vector es... | 767 | 302 |
#pragma comment (lib, "avfilter.lib")
#pragma comment (lib, "avformat.lib")
#pragma comment (lib, "avcodec.lib")
#pragma comment (lib, "avutil.lib")
#include "fileAudioEncoder.h";
using namespace std;
void fileAudioEncoder::cleanUp()
{
if (this->codecContext)
{
avcodec_close(this->codecContext);
avcodec_free_c... | 13,087 | 5,189 |
/* Copyright 2016 Rohm Semiconductor
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 ... | 2,446 | 853 |
// -*- C++ -*-
//
// Package: Core
// Class : FWParameterizable
//
// Implementation:
// <Notes on implementation>
//
// Original Author: Chris Jones
// Created: Sat Feb 23 13:36:27 EST 2008
//
// system include files
// user include files
#include "Fireworks/Core/interface/FWParameterizable.h"... | 1,072 | 361 |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/ui/scenic/lib/gfx/resources/has_renderable_content_visitor.h"
#include <lib/ui/scenic/cpp/commands.h>
#include <gtest/gtest.h>
#include "s... | 2,093 | 737 |
/* vim: set tabstop=4 : */
#include "MemStream.hpp"
#include <stdlib.h>
#include <algorithm>
#include <stdexcept>
#include <typeinfo>
#include <errno.h>
#if defined(_MSC_VER)
# include <intrin.h>
#pragma intrinsic(_BitScanReverse)
//#pragma intrinsic(_BitScanReverse64)
#endif
#include <boost/predef/other/endian.h>
#... | 8,978 | 3,927 |
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS... | 5,706 | 1,819 |
/*
"Do I really belong in this game I ponder, I just wanna play my part."
- Guts over fear, Eminem
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false); cin.tie(NULL); cout.ti... | 1,040 | 490 |
/******************************************************************
*
* Copyright 2016 Samsung Electronics 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
*
... | 8,788 | 3,189 |
/*
* LeetCode 3 Longest Substring Without Repeating Characters
* Medium
* Shuo Feng
* 2021.9.15
*/
/*
* Solution 1:
* Begin with a starting point and check characters after, update a set and record the maximum size.
* When meet a repeating character, remove the previous point in set till there have not re... | 2,051 | 604 |
#include "Row.hpp"
#include "Page.hpp"
using namespace std;
#include <iostream>
#include <iterator>
#include <map>
const int LENGHT_ROW=100;
Page::Page(){
}
void Page::add(int col,int row,Direction dir, string str){
if(dir == Direction::Horizontal){
int size = str.size();
if (col + size > LENGHT_RO... | 2,789 | 887 |
#include <sys/time.h>
#include <sys/timeb.h>
int
main(int argc, char *argv[])
{
struct timeb *tp; ftime(tp);
return 0;
}
| 130 | 59 |
/*
* Copyright (c) 2018 Sune Vuorela <sune@vuorela.dk>
*
* 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, ... | 3,866 | 1,280 |
#if !defined(_BTK_IMPL_MIXER)
#define _BTK_IMPL_MIXER
//Implment for mixer
#include <SDL2/SDL_audio.h>
#include <SDL2/SDL_error.h>
#include <SDL2/SDL_rwops.h>
#include "../mixer.hpp"
#include "../rwops.hpp"
#include "../function.hpp"
#include "atomic.hpp"
#include <vector>
#include <mutex>
#include <list>
#endif // _B... | 334 | 160 |
//==============================================================================
//
// (c) Copyright, 2013 University Corporation for Atmospheric Research (UCAR).
// All rights reserved.
//
// File: $RCSfile: arguments.cc,v $
// Version: $Revision: 1.2 $ Dated: $Date: 2013/09/27 16:47:01 $
//
//===... | 5,631 | 2,036 |
#include "includes/CameraStreamer.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;
int main(int argc, char** argv) {
// IP Câmera - urls
/*
vector<string> capture_source = {
"",
""
};
*/
// USB Câmera - índices
vector<int> capture_index = {0, 2, 4};
vector<strin... | 748 | 271 |
// Include custom headers
#include "io.h"
// Include standard library headers
#include <iostream>
int readNumber()
{
std::cout << "Enter an integer: ";
int x{ };
std::cin >> x;
return x;
}
void writeAnswer(int answer)
{
std::cout << "The answer is " << answer << '\n';
}
| 285 | 101 |
/**
* > Author: UncP
* > Github: www.github.com/UncP/Mushroom
* > License: BSD-3
* > Time: 2017-04-23 10:23:53
**/
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include <cstring>
#include <cassert>
#include <cerrno>
#includ... | 3,766 | 1,633 |
#include <wintoastlib.h>
#include <filesystem>
#include <GarrysMod/Lua/Interface.h>
//using namespace WinToastLib;
const auto AUMI = WinToastLib::WinToast::configureAUMI(L"Facepunch", L"Garry's Mod");
bool is_usable = true;
static const char* error_reasons[] = {
"No error",
"Not inialized",
"OS is not supported",
... | 2,847 | 1,155 |
#include "nano/nano.h"
const char *nano_version()
{
return "0.0.1";
}
const char *nano_module_name()
{
return "nano";
}
| 130 | 60 |
//*********************************************************
// Household_List.cpp - read the household list file
//*********************************************************
#include "ModeChoice.hpp"
#include "Utility.hpp"
//---------------------------------------------------------
// Household_List
//---------------... | 1,208 | 440 |
/*=========================================================================
*
* Program: Bifurcation Analysis Library
* Module: basin.cpp
*
* Copyright (C) 2009 Daniele Linaro
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public L... | 2,824 | 1,168 |
// Copyright 2018 Google LLC. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "packager/media/base/proto_json_util.h"
#include <google/protobuf/util/json_util.h>
#in... | 1,342 | 407 |
// https://nanti.jisuanke.com/t/31460
#include<stdio.h>
#include<string.h>
typedef long long ll;
const int maxn=100005;
ll arr[(1<<18)+2],iarr[(1<<18)+2],M;
void update(ll*a,int x,ll val){
for(a[x+=M]=val,x/=2;x;x/=2)
a[x]=a[2*x]+a[2*x+1];
}
ll query(ll*a,int l,int r){
ll ans=0;
for(l+=M-1,r+=M+1;l^... | 1,186 | 591 |
/* FILE: lock.cc -*-Mode: c++-*-
*
* Data structure locking class
*
*/
#include "oc.h"
#include "lock.h"
#include "oxsexcept.h"
OC_USE_STD_NAMESPACE; // Specify std namespace, if supported
/* End includes */
OC_UINT4m Oxs_Lock::id_count=0;
Oxs_Lock::~Oxs_Lock()
{
if(write_lock>0)
OXS_THR... | 1,936 | 813 |
// -*- C++ -*-
//
// ----------------------------------------------------------------------
//
// Brad T. Aagaard, U.S. Geological Survey
// Charles A. Williams, GNS Science
// Matthew G. Knepley, University of Chicago
//
// This code was developed as part of the Computational Infrastructure
// for Geodynamics (http://... | 6,197 | 1,955 |
class Solution {
public:
bool isIsomorphic(string s, string t) {
if (s.length() != t.length())
return false;
int n = s.length();
vector<char> from(260,'#'),to(260,'#');
for (int i = 0; i < n; ++i)
{
if (from[t[i]] == '#' && to[s[i]] == '#')
{
f... | 507 | 209 |
#include "point.hpp"
namespace mbgl {
namespace android {
namespace geojson {
jni::Local<jni::Object<Point>> Point::New(jni::JNIEnv& env, const mbgl::Point<double>& point) {
static auto& javaClass = jni::Class<Point>::Singleton(env);
static auto method = javaClass.GetStaticMethod<jni::Object<Point> (jni::jdou... | 1,036 | 354 |