text
string
size
int64
token_count
int64
#include <QApplication> #include "buttons.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); Buttons window; window.resize(290, 170); window.setWindowTitle("Buttons"); window.show(); return app.exec(); }
238
94
/* * Copyright (C) 2009 Ericsson AB * 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...
3,510
1,116
#include "ns.h" extern int func(); // Note: the following function must be before the using. void test_lookup_before_using_directive() { // BP_before_using_directive std::printf("before using directive: func() = %d\n", func()); // eval func(), exp: 1 } using namespace A; void test_lookup_after_using_directive() { ...
702
242
/* * Copyright 2014 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkRecordDraw.h" namespace { // This is an SkRecord visitor that will draw that SkRecord to an SkCanvas. class Draw : SkNoncopyable { public: explicit Draw(SkCa...
6,300
2,337
/* * Copyright 2018 The Polycube 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 agree...
4,763
1,364
#include <string> #include <iostream> int main(int argc, char *argv[]) { std::string phrase; std::cout << "Enter a phrase: "; std::getline(std::cin, phrase); std::cout << phrase.size() << std::endl; int word_start = 0, temp_end = 0, word_end = 0, words = 0, proper = 0, repeat = 0; while (word_e...
2,009
601
//========================================================================== // ObTools::ObCache::SQL: storage.cc // // Implementation of SQL storage manager // // Copyright (c) 2008 Paul Clark. All rights reserved // This code comes with NO WARRANTY and is subject to licence agreement //==============================...
1,614
472
/* Copyright 2001, 2019 IBM Corporation * * 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 * following d...
14,375
6,185
#include <iostream> using std::cout; using std::endl; // author: https://github.com/AnotherGithubDude, 2022 int main(){ int valueOne = 15, valueTwo = 8; cout << "valueOne original:" << valueOne << endl; cout << "valueTwo original:" << valueTwo << endl; valueOne += valueTwo; // 15 + 8 = 23 ...
571
200
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #include "test_precomp.hpp" #include "test_intrin_utils.hpp" #define CV_CPU_SIMD_FILENAME "test_intrin_utils.hpp" #define CV...
6,911
2,542
// // LineSegment.hpp // CPP_2.3 // // Created by Zhehao Li on 2020/2/26. // Copyright © 2020 Zhehao Li. All rights reserved. // #ifndef LineSegment_hpp #define LineSegment_hpp #include "Point.hpp" #include <iostream> using namespace std; class LineSegment { private: Point startPoint; // e1 ...
1,150
325
// // Created by Icyblazek on 2021/5/27. // Github https://github.com/icyblazek // #include <cstdio> #include <uv.h> #include <httplib.h> #include <nlohmann/json.hpp> #include "args.hxx" #include <spdlog/spdlog.h> #ifdef _WIN32 #pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "IPHLPAPI.lib") #pragma comment(li...
14,529
5,025
#include "../ComponentName.hpp" #include "../Context.hpp" #include "../Intent.hpp" #include "../IntentSender.hpp" #include "./ApplicationInfo.hpp" #include "./LauncherActivityInfo.hpp" #include "./LauncherApps_Callback.hpp" #include "./LauncherApps_PinItemRequest.hpp" #include "./LauncherApps_ShortcutQuery.hpp" #includ...
7,756
3,032
/********************************************************************************************************************** This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich. Licensed under the BSD-2 license (see LICENSE file in main directory) ***************...
2,486
790
#include<bits/stdc++.h> using namespace std; int main() { long long int V,H,O,ans=0; cin>>V>>H>>O; for(long long int i=0;i<O;i++) { long long int x1,y1,x2,y2; cin>>x1>>y1>>x2>>y2; ans= ans+ abs(x1-x2); //cout<<"out"<<ans<<endl; if(((y1==1 && y2==1))|| ((y1==y2)&&...
604
261
/** * @author zly * * The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) * * P A H N * A P L S I I G * Y I R * And then read line by line: "PAHNAPLSIIGYIR" * * Write the code tha...
843
317
/************************************************************** * * 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...
32,257
9,805
#include "POLYParser.h" #include "IOUtils.h" #include <iostream> #include <fstream> #include <sstream> #include <Core/EigenTypedef.h> #include <Core/Exception.h> using namespace PyMesh; bool POLYParser::parse(const std::string& filename) { std::ifstream fin(filename.c_str()); if (!fin.good()) { std:...
3,148
1,137
// // Copyright (c) 2016, Scientific Toolworks, Inc. // // This software is licensed under the MIT License. The LICENSE.md file // describes the conditions under which this software may be distributed. // // Author: Jason Haslam // #include "StartDialog.h" #include "AccountDialog.h" #include "CloneDialog.h" #...
26,447
8,098
/* 1 3 2 6 1 4 5 5 9 2 3 79 3 -5 */ #include <iostream> using namespace std; void leggo(int n[], int& dim); void seqCrescente(int [], int, int&, int&); int main() { int n[100]; int dim = 0; int lunghezzaSeq; int lmax, imax; leggo(n, dim); if (dim > 0) { seqCrescente(n, dim, imax, lmax); ...
1,414
617
// kv_dictionary_test_harness.cpp /*====== This file is part of Percona Server for MongoDB. Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. Percona Server for MongoDB is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public ...
15,227
4,367
// 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 "src/connectivity/overnet/lib/testing/flags.h" DEFINE_bool(verbose, false, "Enable debug output in tests");
283
92
/* Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array nums = [1,1,1,2,2,3], Your function should return length = 5, with the first five elements of nums being 1, 1, 2, 2 and 3. It doesn't matter what you leave beyond the new length. */ class Solution { p...
818
266
#include <opencv2/objdetect/objdetect.hpp> #include "highgui.h" #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <unistd.h> #include <iostream> #include <stdio.h> #include <cstdlib> using namespace std; using namespace cv; // Captures images from each camera. Facetime and other ca...
2,145
697
// LlilumWin32.cpp : Defines the entry point for the console application. // #include "stdafx.h" extern int LlosWin32_Main(void); int main() { return LlosWin32_Main(); }
179
73
/////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// // // CCC AAA V V ...
6,219
1,662
#include "PrettyPrinter.h" #include <iostream> #include <sstream> void PrettyPrinter::print(ASTProgram *p, std::ostream &os, char c, int n) { PrettyPrinter visitor(os, c, n); p->accept(&visitor); } void PrettyPrinter::endVisit(ASTProgram * element) { std::string programString = ""; bool skip = true; for (a...
12,963
4,211
#pragma once #include "./AlertDialog.hpp" namespace android::content { class Context; } namespace android::os { class Bundle; } namespace android::widget { class TimePicker; } namespace android::app { class TimePickerDialog : public android::app::AlertDialog { public: // Fields // QJniObject forward t...
1,129
387
#include <cstdio> #include <vector> #include <cassert> #include <algorithm> const int MAXN = 100001; const int MAXM = 200001; const int MAXQ = 100001; const int MAXT = 600001; const int MAXI = 3000001; const int Maxlog = 30; struct Edge{ int node, next; }e[MAXM]; struct Query{ int op, x, y, answer; }q[MAXQ]; stru...
3,131
1,727
#include "lppch.h" #include "Terrain.h" #include "Lamp/Core/Application.h" #include "Lamp/Rendering/Buffers/VertexBuffer.h" #include "Lamp/Rendering/Shader/ShaderLibrary.h" #include "Lamp/Rendering/RenderPipeline.h" #include "Lamp/Rendering/Textures/Texture2D.h" #include "Lamp/Rendering/Swapchain.h" #include "Lamp/Re...
5,648
2,461
#ifndef COURSE_HPP #define COURSE_HPP #include "xstring.hpp" struct Course { lab::xstring code; lab::xstring name; bool four_year; Course(const lab::xstring& code, const lab::xstring& name, const bool four_year) :code(code), name(name), four_year(four_year) ...
351
125
#include <iostream> #include <chrono> using namespace std; #include "LayerConvolution2D.h" ////////////////////////////////////////////////////////////////////////////// void compare_im2col() { cout << "Comparing im2col() and im2col_LUT():" << endl; Index iNbSamples=7, inRows = 31, inCols = 23, inChannels = 13, ou...
11,641
5,070
#ifndef OPENJIJ_UTILITY_CREATE_GEOMETRIC_PROGRESSION_HPP__ #define OPENJIJ_UTILITY_CREATE_GEOMETRIC_PROGRESSION_HPP__ namespace openjij { namespace utility { template<typename ForwardIterator, typename T> void make_geometric_progression(ForwardIterator first, ForwardIterator last, T value, T ratio)...
513
165
#include <bitsery/bitsery.h> #include <bitsery/adapter/buffer.h> //include flexible header, to use flexible syntax #include <bitsery/flexible.h> //we also need additional traits to work with container types, //instead of including <bitsery/traits/vector.h> for vector traits, now we also need traits to work with flexibl...
1,562
502
#include "Southpole.hpp" struct Pulse : Module { enum ParamIds { TRIG_PARAM, REPEAT_PARAM, RESET_PARAM, RANGE_PARAM, DELAY_PARAM, TIME_PARAM, AMP_PARAM, // OFFSET_PARAM, SLEW_PARAM, NUM_PARAMS }; enum InputIds { TRIG_INPUT, CLOCK_INPUT, // REPEAT_INPUT, /...
6,846
2,988
/*/ * Project: Wireless Proximity Analyzer * * Repository: https://github.com/ForensicTools/WirelessProximityMonitor_474-2135_Pittner-Sirianni-Swerling * * Authors: * Joe Sirianni * Cal Pittner * Ross Swerling * * License: Apache v2 /*/ #include "filter.h" //Static lists of user input strings static co...
9,012
3,921
#include <sstream> #include <stdio.h> #include <string> #include <cstring> #include <iostream> #include <vector> #include <map> #include <stack> #include <queue> #include <cmath> #include <algorithm> #include <cfloat> #include <climits> //#include <unordered_map> using namespace std; /* Time Complexity : O(n...
2,642
898
void AESState::expand_generic(const uint8_t* key, std::size_t len) { uint32_t nk = (len / 4); uint32_t n = num_rounds * 4; for (uint32_t i = 0; i < nk; ++i) { enc.u32[i] = RBE32(key, i); } for (uint32_t i = nk; i < n; ++i) { uint32_t temp = enc.u32[i - 1]; uint32_t p = (i / nk); uint32_t q = (...
3,223
1,827
// This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2002, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here...
1,891
691
// SPDX-FileCopyrightText: 2021 Jorrit Rouwe // SPDX-License-Identifier: MIT #pragma once namespace JPH { Mat44 Body::GetWorldTransform() const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return Mat44::sRotationTranslation(mRotation, GetPosition()); } Mat44 Bo...
7,522
2,641
// Copyright (c) 2005 - 2015 Marc de Kamps // 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 copyright notice, this list of condition...
2,981
1,080
#include "mvc_env.h" #include "graph.h" #include <cassert> #include <random> #include <algorithm> #include <set> #include <queue> #include <stack> MvcEnv::MvcEnv(double _norm) { norm = _norm; graph = nullptr; numCoveredEdges = 0; CcNum = 1.0; state_seq.clear(); act_seq.clear(); action_list.clear(); reward_seq.clear()...
8,968
3,465
#if 0 #include "opencv2/opencv.hpp" using namespace cv; using namespace std; int main(int argc, char** argv) { // Read source image. Mat im_src = imread("book2.jpg"); // Four corners of the book in source image vector<Point2f> pts_src; pts_src.push_back(Point2f(141, 131)); pts_src.push_back(Point2f(480, 159)); ...
1,058
458
// Copyright 2020 Tier IV, 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 i...
11,402
4,262
#include <string> #include <iostream> #pragma once enum log_level {DEBUG = 0, INFO, WARNING, ERROR, LogLevelMax}; class Loggeable { public: void mute() {m_mute = true;}; void unmute() {m_mute = false;}; void filter(log_level min_lvl) {m_min_lvl = min_lvl;}; void prefix(std::string prefix) {m_prefix...
1,581
571
#include <LogicalPlan.h> #include <Lexer.h> #include <Parser.h> namespace pdb { LogicalPlan::LogicalPlan(const std::string &tcap, Vector<Handle<Computation>> &computations) { init(tcap, computations); } LogicalPlan::LogicalPlan(AtomicComputationList &computationsIn, pdb::Vector<pdb::Handle<pdb::Computation>> &all...
1,652
569
#include <CGAL/Simple_cartesian.h> #include <CGAL/IO/read_points.h> #include <CGAL/property_map.h> #include <vector> #include <deque> #include <iostream> #include <fstream> typedef CGAL::Simple_cartesian<double> Kernel; typedef Kernel::Point_3 Point_3; typedef Kernel::Vector_3 Vector_3; typedef std::pair<Point_3, V...
10,027
3,672
//Nguyen X. Vinh, Jeffrey Chan, Simone Romano and James Bailey, "Effective Global Approaches for Mutual Information based Feature Selection". //To appear in Proceeedings of the 20th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD'14), August 24-27, New York City, 2014. // (C) 2014 Nguyen Xuan Vinh ...
6,680
3,078
#include "DBTableWidget.h" #include "Exceptions.h" #include "GUIHelper.h" #include <QHeaderView> #include <QAction> #include <QApplication> #include <QClipboard> #include <QKeyEvent> DBTableWidget::DBTableWidget(QWidget* parent) : QTableWidget(parent) { //general settings verticalHeader()->setVisible(false); setS...
7,143
2,547
#include <xpcc/architecture/driver/accessor.hpp> namespace bitmap { FLASH_STORAGE(uint8_t skull_64x64[]) = { 64, 64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x60, 0x30, 0x18, 0x08, 0x0c, 0x0c, 0x04, 0x06, 0x06, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0...
3,218
3,081
/** * \class L1RetrieveL1Extra * * * Description: retrieve L1Extra collection, return validity flag and pointer to collection. * * Implementation: * <TODO: enter implementation details> * * \author: Vasile Mihai Ghete - HEPHY Vienna * * */ // this class header #include "L1Trigger/GlobalTriggerAnalyzer...
36,384
13,021
class Solution { public: string convert(string s, int n) { //OM GAN GANAPATHAYE NAMO NAMAH //JAI SHRI RAM //JAI BAJRANGBALI //AMME NARAYANA, DEVI NARAYANA, LAKSHMI NARAYANA, BHADRE NARAYANA if(n == 0 || n == 1) return s; string res; for(int i = ...
1,093
344
class Solution { public: vector<int> countSubTrees(int n, vector<vector<int>> &edges, string labels) { vector<vector<int>> g(n); for (auto &v : edges) { g[v[0]].push_back(v[1]); g[v[1]].push_back(v[0]); } vector<int> ans(n); dfs(ans, g, labels); return ans; } vector<int> dfs(...
697
288
#include <QApplication> #include <QFontDatabase> #include <QWidget> #include <QVBoxLayout> #include "keyboard.h" #include "display.h" int main(int argc, char **argv) { QApplication a(argc, argv); QFontDatabase::addApplicationFont(":/gemunu-libre.bold.otf"); Display* disp = new Display(12); Keyboard* kb = n...
552
218
/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: itkVersion.cxx Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) Insight Software Consortium. All rights reserved. See ITKCopyright.txt or http...
1,257
419
//Author:LanceYu #include<iostream> #include<string> #include<cstring> #include<cstdio> #include<fstream> #include<iosfwd> #include<sstream> #include<fstream> #include<cwchar> #include<iomanip> #include<ostream> #include<vector> #include<cstdlib> #include<queue> #include<set> #include<ctime> #include<algorithm> #includ...
1,071
592
// ModelView.c++ - an Abstract Base Class for a combined Model and View for OpenGL #include <iostream> #include "ModelView.h" #include "Controller.h" cryph::AffPoint ModelView::eye(0, 0, 2); cryph::AffPoint ModelView::center(0, 0, 0); cryph::AffVector ModelView::up(0, 1, 0); double ModelView::mcRegionOfInterest[6] ...
7,264
2,776
/*************************************************************************** qgsdecorationlayoutextentdialog.cpp ---------------------------- begin : May 2017 copyright : (C) 2017 by Nyall Dawson email : nyall d...
3,263
963
#define _WIN32_WINNT 0x0600 #include <algorithm> #include <iostream> #include <regex> #include <string> #include <windows.h> #define DEBUG 1 #define HKCR HKEY_CLASSES_ROOT #define HKCU HKEY_CURRENT_USER #define HKLM HKEY_LOCAL_MACHINE #define HKU HKEY_USERS #define HKCC HKEY_CURRENT_CONFIG HKEY Cr...
2,754
1,058
#include <algorithm> #include <fstream> #include <iostream> #include <queue> #include <sstream> #include <tuple> #include <vector> #include "utils/types.h" #include "utils/utils.h" #include "graph/graph.h" Graph::Graph() : edge_count_(0) , vlabel_count_(0) , elabel_count_(0) , neighbors_{} , elabels_{} , updates_{} , ...
6,849
2,519
#include "caffe2/core/net.h" #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include "caffe2/core/operator.h" #include "caffe2/core/static_tracepoint.h" #include "caffe2/core/timer.h" #include "caffe2/proto/caffe2.pb.h" #include "caffe2/utils/proto_utils.h" CAFFE2_DEFINE_bool( ...
20,577
6,660
/// HEADER #include <csapex/io/request.h> using namespace csapex; uint8_t Request::getPacketType() const { return PACKET_TYPE_ID; } Request::Request(uint8_t id) : request_id_(id) { } void Request::overwriteRequestID(uint8_t id) const { request_id_ = id; } uint8_t Request::getRequestID() const { return ...
335
134
/* * Vulkan Example - Indirect drawing * * Copyright (C) 2016 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) * * Summary: * Use a device local buffer that stores draw commands for instanced rendering of different meshes stored * in th...
15,195
4,728
#include "day4.h" #include <iostream> int main(void) { static constexpr auto input = "yzbqklnj"; std::cout << "Day 4, part 1: " << day4::mineAdventCoin(input, false) << '\n'; std::cout << "Day 4, part 2: " << day4::mineAdventCoin(input, true) << '\n'; }
268
111
#include "controllers/SmartController.h" using namespace wml::controllers; bool SmartController::Exists(tAxis axis, bool value) { try { _axes.at(axis.id); } catch (std::out_of_range) { return !value; } return value; } bool SmartController::Exists(tButton button, bool value) { try { _buttons.a...
5,328
1,892
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2012 UniPro <ugene@unipro.ru> * http://ugene.unipro.ru * * 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...
16,225
5,449
/** Sunny and Johnny together have MM dollars they want to spend on ice cream. The parlor offers N flavors, and they want to choose two flavors so that they end up spending the whole amount. You are given the cost of these flavors. The cost of the ith flavor is denoted by ci. You have to display the indices of the tw...
2,820
918
#ifndef WXSFMLCANVAS_HPP #define WXSFMLCANVAS_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <SFML/Graphics.hpp> #include <wx/wx.h> //////////////////////////////////////////////////////////// /// wxSFMLCa...
2,536
618
// Copyright (C) 2018-2019 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 <config.h> #include <process/config_...
6,257
2,171
#include "test_load_ntdll.h" #include "peconv.h" #include <iostream> #include "shellcodes.h" int (_cdecl *ntdll_tolower) (int) = NULL; NTSTATUS (NTAPI *ntdll_ZwAllocateVirtualMemory)( _In_ HANDLE ProcessHandle, _Inout_ PVOID *BaseAddress, _In_ ULONG_PTR ZeroBits, _Inout_ PSIZE_T RegionSize, ...
2,009
808
// Copyright 2022 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...
3,300
991
/* * Copyright 2009, Google 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: * * * Redistributions of source code must retain the above copyright * notice, this list of conditio...
9,898
3,256
// ----------------------------------------------------------------------------- // File IO_TTY.CPP // // (c) by Elijah Koziev all rights reserved // // SOLARIX Intellectronix Project http://www.solarix.ru // https://github.com/Koziev/GrammarEngine // // Content: // Реализац...
15,072
5,992
/*** Copyright (c), The Regents of the University of California *** *** For more information please refer to files in the COPYRIGHT directory ***/ /* This is an interface to the Ticket management system. */ #include "irods_client_api_table.hpp" #include "irods_pack_table.hpp" #include "rods.h" #include ...
31,899
11,036
/* ****************************************************************************** * Copyright (C) 2015, International Business Machines Corporation and * others. All Rights Reserved. ****************************************************************************** * * File UNIFIEDCACHE.CPP ********************************...
18,666
5,830
//========================================================================= // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE...
5,642
1,924
/* * This file is part of ACADO Toolkit. * * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, * Milan Vukov, Rien Quirynen, KU Leuven. * Developed within the Optimization in Engineering Center (OPTEC) * u...
5,111
1,754
/*===========================================================================*\ * * * OpenMesh * * Copyright (C) 2001-2012 by Computer Graphics Group, RWTH Aachen * * ...
12,073
3,743
class Solution { public: int longestStrChain(vector<string>& words) { set<pair<int, string>> lengthWordSet; unordered_map<string, int> dp; for(const string& WORD: words){ lengthWordSet.emplace(WORD.length(), WORD); dp[WORD] = 1; } in...
891
277
#include <bits/stdc++.h> #define _ ios::sync_with_stdio(0);cin.tie(0); using namespace std; int main(){ long long int N,M; while(~scanf("%lld %lld",&N,&M)&&N){ int cnt[1024][128]={0}; int RUN=N*M-1; char str[1024]; getchar(); while(RUN--){ fgets(str,1024,stdin); for(int i=0;str[i]!='\n';i++){ cnt[...
497
304
/* Table.cpp By Jim Davies Jacobus Systems, Brighton & Hove, UK http://www.jacobus.co.uk Provided under the MIT license: https://github.com/jacobussystems/ArdJack/blob/master/LICENSE Copyright (c) 2019 James Davies, Jacobus Systems, Brighton & Hove, UK Permission is hereby granted, free of charge, to any pers...
5,096
2,065
/* A zero-indexed array A consisting of N different integers is given. The array contains integers in the range [1..(N + 1)], which means that exactly one element is missing. Your goal is to find that missing element. Write a function: int solution(int A[], int N); that, given a zero-indexed array A, returns the value ...
598
192
// // Created by Spud on 7/16/21. // #include "npf/layout/ask.hpp" void Ask::populateBlocks(const JSON_ARRAY &array) { // TODO Comments blocks = std::vector<int>(array.Size()); for (JSON_ARRAY_ENTRY &entry : array) { if (entry.IsInt()) { blocks.push_back(entry.GetInt()); } } } void Ask::populateNPF(JSON_OB...
567
231
/** * \file dnn/src/rocm/pooling/opr_impl.cpp * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * ...
3,450
1,139
#include "Shape.h" Shape::Shape() { log("Shape::Shape()"); } Shape::Shape(const Shape& shp) { log("Shape::Shape(const Shape&)"); } Shape::~Shape() { log("Shape::~Shape()\n"); } bool Shape::operator==(const Shape& rhs) { return numberOfSides() == rhs.numberOfSides(); } bool Shape::operator!=(const Shape& rhs) { ...
740
267
// Problem Link: // https://practice.geeksforgeeks.org/problems/top-view-of-binary-tree/1 // Recursive and Iterative // TC: O(n) // SC: O(n) #include <bits/stdc++.h> using namespace std; #define ll long long #define deb(x) cout << #x << ": " << x << "\n" class TreeNode { public: TreeNode *left; int val; ...
2,223
834
#include "bits/stdc++.h" using namespace std; #define X first #define Y second class Board { public: static map<Board*, vector<Board*>> adj; static map<Board, Board*> all; Board* par; char data[6][6]; Board(); Board(Board*); ~Board(); void Fill(char); void draw(); string r...
2,250
947
// 06-point3.cpp : Point type with global operator+ defined import std.core; using namespace std; struct Point{ int x{}, y{}; }; Point operator+ (const Point& lhs, const Point& rhs) { Point result; result.x = lhs.x + rhs.x; result.y = lhs.y + rhs.y; return result; } int main() { Point p1{ 100, 200 }, p2{ 200,...
400
184
/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors ...
17,039
6,048
/**************************************************************************** * Copyright (c) 2015 - 2016, CEA * 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 mus...
10,128
3,765
// Copyright (c) 2017-2019 Tkeycoin Dao. All rights reserved. // Copyright (c) 2019-2020 TKEY DMCC LLC & Tkeycoin Dao. All rights reserved. // Website: www.tkeycoin.com // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may...
1,856
661
#include "StdAfx.h" #include "ShooterRecord.h" #include "Msg.h" #include "Resource.h" #define SEPARATOR ";" ShooterRecord::ShooterRecord( LPCTSTR membership_number /* = NULL */, LPCTSTR shooter_name /* = NULL */, LPCTSTR license /* = NULL */, LPCTSTR club /* = NULL */, LPCTSTR category /* = NULL */, __time64_t ...
3,852
1,763
#include "eventmanager_p.h" #include "cachemanager_p.h" #include "interfacemanager_p.h" #include "client.h" #include "channel.h" #include "connection.h" #include "exception.h" #include "teamspeakevents.h" namespace TeamSpeakSdk { class EventManagerPrivate { public: EventManagerPrivate() { memset(&cli...
29,874
8,478
<<<<<<< HEAD #include<iostream> using namespace std; int main() { int a[100001],i,j,n; cin>>n;int ct=0; int flag[100001]={0}; for(i=0;i<n;i++) cin>>a[i]; for(i=1;i<n;i++) { if(flag[i]==0&&((a[i+1]-a[i])!=(a[i]-a[i-1]))||flag[i-1]==-1) { ...
1,182
529
#include "i_core.h" #include "../../../patterns.h" #include <utils/hooking/hooking.h> namespace SDK { namespace ue::sys::core { C_Core *I_Core::GetInstance() { return hook::this_call<C_Core *>(gPatterns.I_Core__GetInstance); } } // namespace ue::sys::core } // namespace SDK
314
111
#include <iostream> #include <cstring> using std::cin; using std::cout; using std::endl; using std::cerr; using std::begin; using std::end; using std::strcmp; using std::strcpy; using std::strcat; int main() { const char a[] = "A test"; const char b[] = "about it"; char c[16]; strcpy(c, a); strcat...
372
140
// Copyright (c) 2016 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special ...
1,122
390
// ---------------------------------------------------------------------------------------- // COPYRIGHT NOTICE // ---------------------------------------------------------------------------------------- // // The Source Code Store LLC // ACTIVEGANTT SCHEDULER COMPONENT FOR C++ - ActiveGan...
4,732
2,025
// $Id: EC_Masked_Type_Filter.cpp 1861 2011-08-31 16:18:08Z mesnierp $ #include "orbsvcs/Event/EC_Masked_Type_Filter.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_EC_Masked_Type_Filter:: TAO_EC_Masked_Type_Filter (CORBA::ULong source_mask, CORBA::ULong type_mask, ...
2,609
1,033
// Copyright 2016 Junbo Zhang // // 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 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANT...
3,363
1,373