blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
7e04015a7a177baa8aea60aa1e9c3b926c9c1313 | 2653af5ecfcd9227d18e84c83e2195d7fd0624e8 | nwjs/chromium.src | /chrome/browser/ui/views/tabs/tab.cc | C++ | cc | 41,492 | permissive | // Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/tabs/tab.h"
#include <stddef.h>
#include <algorithm>
#include <limits>
#include <memory>
#include <utility>
#include "base/debug/alias.h"
#... |
ef7deea26e271543f34ea9242aa402bdf74bde83 | b81aa9464aca3a9fb150725a1d2484a61b1f24c1 | aglevine/UCT2015 | /plugins/UCT2015Producer.cc | C++ | cc | 32,960 | no_license | //
// Package: UCT2015Producer
//
// Original Author: Sridhara Rao Dasu
// Created: Thu Jun 7 13:29:52 CDT 2012
//
// system include files
#include <memory>
#include <math.h>
#include <vector>
#include <list>
#include <TTree.h>
// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
... |
15a1196271a055559b5ffb75625d075ccbef4568 | 0035ac64cd777cf0e5535e3eccb67a9cc4fc36a0 | TheDylanViper/Albany | /src/LCM/evaluators/HeliumODEs_Def.hpp | C++ | hpp | 12,263 | permissive | //*****************************************************************//
// Albany 2.0: Copyright 2012 Sandia Corporation //
// This Software is released under the BSD license detailed //
// in the file "license.txt" in the top-level Albany directory //
//**************************************... |
5ea37bcc60a01837a2307ff3914f15bc41e21ca7 | 630b0c2de0866173c6f262a4e3719ff0ebd81d2b | bmildner/aws-sdk-cpp | /aws-cpp-sdk-cognito-identity/source/model/ListIdentitiesResult.cpp | C++ | cpp | 1,810 | permissive | /*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file... |
fb7a69768000917cde78752d0bfee72db794bd06 | 3cbffc7d0b03d782b3b5cb9df6e36dd8936fe308 | buch8/GrinPlusPlus | /Wallet/WalletUtil.cpp | C++ | cpp | 882 | no_license | #include "WalletUtil.h"
#include <Consensus/BlockTime.h>
#include <algorithm>
uint64_t WalletUtil::CalculateFee(const uint64_t feeBase, const int64_t numInputs, const int64_t numOutputs, const int64_t numKernels)
{
return feeBase * CalculateTxWeight(numInputs, numOutputs, numKernels);
}
uint64_t WalletUtil::Calcula... |
75c8e0b7268a803f2caabfd78be0d62d623650a1 | a5f700940afc4caa9ca4b0697e12181ee6ed8c4a | PsymonLi/sw | /nic/metaswitch/stubs/mgmt/pds_ms_lim_utils.cc | C++ | cc | 8,474 | no_license | // {C} Copyright 2019 Pensando Systems Inc. All rights reserved
// Purpose: Helper APIs for metaswitch LIM stub programming
#include "nic/infra/core/trace.hpp"
#include "nic/metaswitch/stubs/mgmt/pds_ms_mgmt_utils.hpp"
#include "nic/metaswitch/stubs/mgmt/pds_ms_config.hpp"
#include "nic/metaswitch/stubs/common/pds_ms_... |
0a459c1a871b2c11ff2d01505c1cade091a3ec50 | 724b6afc58eb26ead30312d668ed6af9bc917e33 | williamfu24/CS241-CSIII- | /CS III/Projects/Project 1/Fu-BlackJack/main.cpp | C++ | cpp | 8,564 | no_license | /*********************
William Fu
Comp Sci 241
Project 1- BlackJack
Due: 1/26
Betsy Sanders
*********************/
#include <iostream>
#include "Card.h"
#include "Hand.h"
#include "Deck.h"
#include "Player.h"
#include "BlackJackPlayer.h"
#include "Player.h"
#include "Dealer.h"
#include <algorithm>
... |
f8a950b79599780f85dc634c608c2ddd8cb07871 | 2ca28d291c4666f39f93d90f8c26777cfa0ca65c | shakilsustswe/programming | /IMPORTANT/binomial Cofficient.cpp | C++ | cpp | 325 | no_license | #include<bits/stdc++.h>
using namespace std;
int binomialCof(int n,int k)
{
///Base case
if(k==0||k==n)
{
return 1;
}
//recur
return binomialCof(n-1,k-1)+binomialCof(n-1,k);
}
int main()
{
int n,k;
cin>>n>>k;
int ans = binomialCof(n,k);
cout<<ans<<endl;... |
982ca87a74f07ad2d404f60a7ad9f5aaff26899c | 0323efbd9d5d0630fa408328d280ad1cd8471cd1 | UBC-Snowbots/IGVC2015 | /sb_jaus/JAUS++/src/cxutils/networking/TCPListenSocket.cpp | C++ | cpp | 14,908 | no_license | ////////////////////////////////////////////////////////////////////////////////////
///
/// \file TCPListenSocket.cpp
/// \brief This file contains software for creating TCP Listen Socket. A Listen
/// socket waits for incomming TCP client connections. Once a connection is
/// made, a pointer to a new TcpSe... |
17521b4b4c4a1d1789978ecac6da44f5b4be7b7a | b73f514a086f4beb5d2c6c81f01807474cd73080 | heshuai64/ebo-print | /UploadAddressDlg.cpp | C++ | cpp | 3,448 | no_license | // UploadAddressDlg.cpp : implementation file
//
#include "stdafx.h"
#include "dlldemo.h"
#include "sqlite3.h"
#include "URLEncode.h"
#include "eBayBOService.h"
#include "HTTPSocket.h"
#include "LoginDlg.h"
#include "SKUBarcodeDlg.h"
#include "UploadAddressDlg.h"
#include "dlldemoDlg.h"
#ifdef _DEBUG
#... |
f864787944640af0e8cdae89b6bd44cbb807e9dc | d6d6ad11d7483bd6b76c967d387ca2764d423636 | Shinyj/Tera | /Tera/cGrid.cpp | C++ | cpp | 1,466 | no_license | #include "stdafx.h"
#include "cGrid.h"
cGrid::cGrid()
{
D3DXMatrixIdentity(&m_matWorld);
}
cGrid::~cGrid()
{
}
void cGrid::Setup()
{
int nNumLine = 50;
float fInterval = 1.0f;
float fMax = fInterval * nNumLine;
m_vAxisX = D3DXVECTOR3(fMax, 0, 0);
m_vAxisZ = D3DXVECTOR3(0, 0, fMax);
ST_PC_VERTEX v;
for (... |
bd3c4bf8a775847f760599b057430117d99e09d3 | 43185622a3b8b8f0193812371e0f62e92739daf4 | JGoldstone/OpenColorIO | /src/bindings/python/PyConfig.cpp | C++ | cpp | 60,025 | permissive | // SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.
#include <fstream>
#include <sstream>
#include "PyOpenColorIO.h"
#include "PyUtils.h"
namespace OCIO_NAMESPACE
{
namespace
{
enum ConfigIterator
{
IT_ENVIRONMENT_VAR_NAME = 0,
IT_SEARCH_PATH,
IT_COLOR_SPACE_NA... |
0c507d2fafb701709ac077c5f8f5003ef491cbc8 | c623302fb499f23948234cd37e366e2950cf43cc | everscalecodes/knapsack-snark | /libs/algebra/include/nil/crypto3/algebra/curves/detail/h2c/ep.hpp | C++ | hpp | 6,407 | permissive | //---------------------------------------------------------------------------//
// Copyright (c) 2020-2021 Mikhail Komarov <nemo@nil.foundation>
// Copyright (c) 2020-2021 Ilias Khairullin <ilias@nil.foundation>
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of t... |
4cdc55e4ae55c693e5797f4e8ebc609275eaaea1 | b82c185bd10cc55a0a716be31138006489e1a3a2 | jangellx/TMProLWPlugIns | /Projects/Portable/StringTools/StringTools.cpp | C++ | cpp | 9,534 | no_license | //
// StringTools.cpp
//
// This file contains the implementation of the StringTools class
//
#include "StringTools.h"
// CountWords():
// Returns the number of words in a string, white space delimited.
// If quoted_word is true, then anything within quotes is considered
// a single word.
int StringTools::CountW... |
8c02b252a356b24ce47d258be87b0151697e02cb | e13072fc66486a34a2733dc34c146d0283a4332c | zurajacoco/procon_in_Mac | /Atcoder/ABC/ABC095/B.cpp | C++ | cpp | 873 | no_license | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#de... |
95a682698cfe24dbd11f16771e4b2c726e7e1d49 | 8a460bc8f845f00de9f9afa4c6d71d371ecd72b9 | spillerrec/dump-tools | /archive/video_dump/src/render.hpp | C++ | hpp | 1,176 | no_license | #include <QWidget>
#include <QMutex>
struct libvlc_media_player_t;
struct Plane;
class ARender : public QWidget{
Q_OBJECT
public:
virtual void lock( void **p_pixels ) = 0;
virtual void unlock( void *id, void *const *p_pixels ) = 0;
virtual void display( void *id ) = 0;
virtual void format( char *chroma, ... |
2a4f6286d98958b39e740e42fb76500e78bd5dd0 | 37db103bf7aa2bc094b872808e8a119dc04bc2cd | dshevchyk/qtExtension | /src/admob/admobqml.cpp | C++ | cpp | 2,845 | no_license | #include "admobqml.h"
#include "admobimpl.h"
AdMobQml::AdMobQml(QQuickItem *parent):
QQuickItem(parent),
impl_(new AdMobImpl())
{
connect(this, SIGNAL(parentChanged(QQuickItem *)), this, SLOT(slotParentChanged()));
connect(this, SIGNAL(widthChanged()), this, SLOT(slotOnWidthChanged()));
connect(thi... |
2f885f4d9d2d46f072e7bfd578343057a8ad3781 | 32a9b24737326f4e3e09a13547d85aed953967dc | georgekrueger/FFTVisual | /Audio/Audio.cpp | C++ | cpp | 5,911 | no_license | /*
* Audio System
*
* Created by George Krueger on 2/26/11.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "../../portaudio/include/portaudio.h"
#include "wavfile.h"
#include "AudioDefines.h"
#include "Audio.h"
#include "pthread... |
32262ec75065609d26e9c065feffee0e66f5bd9a | c26c449b0a72bcfad0a382a99c1d94984094c10d | lygood2007/Interview | /algo_1.31.cpp | C++ | cpp | 1,790 | no_license | //
// main.cpp
// luohao
//
// Created by Yan on 2/1/14.
// Copyright (c) 2014 Yan. All rights reserved.
//
#include <iostream>
#include <string>
#include <set>
#include <vector>
using namespace std;
bool wordBreakBT(string str, set<string>& dict, string& result)
{
if(str == "")
return true;;
... |
9d0fbe57f5256cf9032b921a8bb3bdfbe3023288 | 36081e62be453a9ff23b125b8a42f6b1acf53b85 | amallia/NYU-School-Shizzle | /Semes2/OS/Lab1/code/MainProgram.cpp | C++ | cpp | 731 | no_license | #include <iostream>
#include <fstream>
#include "Symbol.h"
#include "Module.h"
#include "Linker.h"
using std::cout;
using std::string;
using std::ofstream;
ofstream myfile;
void write(string input)
{
cout << input;
myfile << input;
}
int main(int argc, char *argv[])
{
// Input file will be argv[1]
... |
d73fffaaeb1736b65176bf78447cc646505ffe72 | 6c69c2d8ec0568329839ece225a0a43bb23646f3 | vchen30/Kratos | /applications/SolidMechanicsApplication/custom_strategies/schemes/residual_based_rotation_simo_scheme.hpp | C++ | hpp | 18,308 | permissive | //
// Project Name: KratosSolidMechanicsApplication $
// Created by: $Author: JMCarbonell $
// Last modified by: $Co-Author: $
// Date: $Date: August 2017 $
// Revision: $Revision: 0.0 $
//
//
#if !defin... |
0f50af68536f4ea1acca356829ace3e6f3755ac3 | dc5d4e91d730d6e7eb24a5469d763e1e8417a171 | jufenghua596/book | /dp/HeadFirstDesignPatterns/c_plusplus/Silver/Decorator/Starbuzz.cpp | C++ | cpp | 886 | no_license | #include "Starbuzz.hpp"
using namespace HeadFirstDesignPatterns::Decorator;
int main( int argc, char* argv[] ) {
Beverage* beverage = new Espresso();
std::cout.setf( std::ios::showpoint);
std::cout.precision(3);
std::cout << beverage->getDescription()
<< " $"
<< beverage->cost()
<< std::endl;
... |
b2cf5e1d75ce96ba708187f3784fb527c9dadd45 | 88cf6ca638334b8c5057ca03f21cd7179a5faa18 | ej2xu/LeetCode | /33search-in-rotated-sorted-array.cc | C++ | cc | 1,964 | no_license | class Solution {
public:
int search(vector<int>& a, int target) {
int last = a.size()-1, l = 0, h = last, m = 0;
while (l < h) {
m = l+h+1 >> 1;
if (a[m] < a[l])
h = m-1;
else
l = m;
}
if (target >= a[0])
l = 0;
else {
l = h+1;
h = last;
}
... |
61ff614eea976f74a9813300b3e5431f11f2f393 | c93c04f56fb651e2a42452baba2bd1310b98ab90 | DylanPerdigao/Algorithmic-Strategies-Problems | /Training2/ProblemC/ProblemC/main.cpp | C++ | cpp | 1,179 | no_license | //
// main.cpp
// ProblemC
//
// Created by Dylan Perdigão on 19/02/2021.
//
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int count(int k, pair<int,int> point, pair<int,int> center){
if(k<1){
return 0;
}
int c=0;
if(center.first-k<=point.first && point.fi... |
2ca4af9b9c977d01d9cc05f6d09b957cddba70b2 | 2f0dfe1b3df698cfce6f1aba28c326809c327703 | kgdunn/TU-Delft-job-interview | /delftdemo/flotation.cpp | C++ | cpp | 21,605 | no_license |
#include <cstdio>
#include <iostream>
#include <memory>
#include <algorithm>
#include <vector>
#include <cmath>
// 3rd party libraries. Please see README.txt to see how to install and set up.
#include <fftw3.h>
#include "bitmap_image.hpp"
#include "Eigen/Core"
#include "opencv2/opencv.hpp"
#include "opencv2/core/core... |
3c2abdd0b2b0c1681f99d624ce9140874d19ef98 | 93da11253beae1e6bf5968a44555714dd6109e26 | xbelikov/ginger | /source/utils/utils.cpp | C++ | cpp | 1,244 | no_license | #include "utils.h"
#include <cstdlib>
namespace ginger {
void string_to_wstring(std::string& s, std::wstring &ws)
{
int wchars_num = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, NULL, 0);
wchar_t* wstr = new wchar_t[wchars_num];
MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, wstr, wchars_num);
ws = wstr;
... |
2921a26eceb60e92b1947c4344a35140c9aae8c9 | b6043d485cd5734590bc14edf5018a1940211912 | datafiction/carnd-t3-Naive-Bayes-Classifier-for-Vehicle-Maneuvers-Prediction | /classifier.cpp | C++ | cpp | 4,169 | no_license | #include <iostream>
#include <sstream>
#include <fstream>
#include <math.h>
#include <vector>
#include "classifier.h"
/**
* Initializes GNB
*/
GNB::GNB() {
}
GNB::~GNB() {}
void GNB::train(vector<vector<double>> data, vector<string> labels)
{
/*
Trains the classifier with N data points and labels.
INPUTS
d... |
603447bde2291f24af146d58f4062151c14474f0 | 4788be01d6806701a2d0076408ba551a40aa853b | PyroOS/Pyro | /Native/System/Preferences/Network/Hosts.cpp | C++ | cpp | 2,507 | no_license | // Syllable Network Preferences - Copyright 2006 Andrew Kennan
//
// This 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... |
8f7f10009d8caa9da56aa4e98e66f116d24c7d65 | 54ebadbff0bb5cb885c63fff3e9fad0462a5abf0 | kpadrenaline/Karabiner-Elements | /appendix/dump_hid_value/main.cpp | C++ | cpp | 5,606 | permissive | #include "device_properties_manager.hpp"
#include "dispatcher_utility.hpp"
#include "event_queue.hpp"
#include "iokit_utility.hpp"
#include <csignal>
#include <iomanip>
#include <pqrs/osx/iokit_hid_manager.hpp>
#include <pqrs/osx/iokit_hid_queue_value_monitor.hpp>
namespace {
class dump_hid_value final : public pqrs::... |
8b653b2d791a32b5b90bfacd60fe02febf3215ee | 666c132e498270966f406c7b3fa7c00b24ab6955 | xanxys/reconstruction | /src/recog/shape_fitter.cpp | C++ | cpp | 11,163 | no_license | #include "shape_fitter.h"
#include <algorithm>
#include <complex>
#include <numeric>
#include <set>
#include <stdexcept>
#include <fstream>
#include <boost/math/constants/constants.hpp>
#include <boost/range/irange.hpp>
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <jsoncpp/json/json.h>
#include <pcl/po... |
4427f13f0b3963d3a4b4b5f134ca4dee06c1eb6f | ced42a2b965ed8027f221622e48733ec9353e9e1 | BruceChen7/ToysCode | /Cpp/LeetCode/Trees/SameTree.cc | C++ | cc | 350 | no_license | class Solution {
public:
bool isSameTree(TreeNode* p, TreeNode* q) {
if (p == NULL && q != NULL)
return false;
if (p != NULL && q == NULL)
return false;
if (p == NULL && q == NULL)
return true;
if (p->val == q->val) {
return isSameTree(p->left, q->left) && isSameTree(p->right, q->right);
}
else... |
7f15a16f46a4ad4bef30b044a9ebfffdb3c01de6 | 2c7a07b57b28de0ff2cdbfe7d87059f56cd17ee5 | yu1741588584/X-CTRL | /Transmitters/Old Version/X_CTRL_STM32F4xx/X_CTRL_GUN/USER/Game/doom-nano/entities.cpp | C++ | cpp | 741 | permissive | #include <stdint.h>
#include "entities.h"
#include "types.h"
#include "constants.h"
Player create_player(double x, double y){
Player player = {
create_coords((double) x + 0.5, (double) y + 0.5),
create_coords(1, 0),
create_coords(0, -0.66),
0,
100,
};
return player;
}
Entity create_ent... |
74deb609b1138e283663877084b69cc65fe37ec4 | 40c83ea96a3a8927f8cb83fed3372430baa72da5 | eppingere/terrier | /benchmark/runner/transaction_logging_gc_runner.cpp | C++ | cpp | 9,594 | permissive | #include <string>
#include <vector>
#include "benchmark/benchmark.h"
#include "benchmark_util/data_table_benchmark_util.h"
#include "common/dedicated_thread_registry.h"
#include "common/scoped_timer.h"
#include "metrics/metrics_thread.h"
#include "storage/garbage_collector_thread.h"
#include "storage/write_ahead_log/l... |
f0f66599580ee724ebfa4c9b1670ada26c4300c5 | e2082302c455b215061d786f0dbc4723ceeea884 | Articula/RPG-Game-Engine | /drawable.cpp | C++ | cpp | 310 | permissive | /*
* drawable.cpp
*
* Created on: Dec 8, 2013
* Author: faye
*/
#include <string>
#include "include/drawable.h"
Drawable::Drawable()
{
this->positionLeft_ = 0;
this->positionTop_ = 0;
this->width_ = 0;
this->height_ = 0;
this->imageName_ = std::string("");
}
Drawable::~Drawable()
{
}
|
8383cf925bb6f838485b7733e42262766733720f | 6e139bff473ae618d936de391ce15c4ba1d746ad | s20499-pj/prg1 | /zjazd5/zadanie4.cpp | C++ | cpp | 390 | no_license | #include <iostream>
using namespace std;
int main()
{
string tab[10][10];
for(int i=0; i<10; i++)
{
for(int j=0; j<10; j++)
{
tab[i][j]=" ";
}
}
int n;
cin >> n;
for(int i=0; i<n; i++)
{
int x, y;
cin >> x;
cin >> y;
tab[9-y][x]="*";
}
for(int i=0; i<10; i++)
{
for(int j=0; j<10; j... |
97f60f8a1f42f0676b187731267b37495d4910c7 | cfa7447ac54fe92a93e8c83b7a67384f06e2ba50 | SorenRogiers/Programming_TextBasedGame | /TextBasedGame_KingsAssassin/Objects.cpp | C++ | cpp | 828 | no_license | #include "stdafx.h"
#include "Objects.h"
#include "Inventory.h"
#include <vector>
#include <string>
#include <JsonBox.h>
#include "LivingEntity.h"
Objects::Objects(std::string id,std::string name, Inventory items):JsonEntity(id),m_Name(name),m_ItemsInObject(items)
{
}
Objects::Objects(std::string id, JsonBox::Value... |
a8f7e4c61037825bbb8d593f451103cf0604b6f2 | 0bd696a410ef614e30ddcf6e88606347edad0675 | jdolds09/Jerry-Olds-Projects | /Object Oriented/jdo3643_HW11/jdo3643_Main_Window.cpp | C++ | cpp | 2,972 | no_license | #include "jdo3643_Main_Window.h"
Main_Window::Main_Window()
{
// Set size and title
set_size_request(400,200);
set_title("Main Menu");
// Vertical box
Gtk::Box *vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0));
add(*vbox);
// Menu Bar
Gtk::MenuBar *menubar = Gtk::manage(new Gtk::MenuBar());
Gtk::... |
9fd1cac4d57caaf1638356c18102b02986e46ce2 | 5f5af6a0f20509334397a2f2e99d2af2d74ee793 | dan-zheng/swift-apis | /Sources/x10/xla_tensor/elementwise.cpp | C++ | cpp | 9,594 | permissive | // Copyright 2020 TensorFlow 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... |
99be3c2f88547953ef62109569019b1919ef80de | f37790720d3f76da6bc92ff03badac9318be933f | markuspeloquin/fluks | /test/common.hpp | C++ | hpp | 945 | no_license | #ifndef TEST_COMMON_HPP
#define TEST_COMMON_HPP
#include <cstdlib>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
namespace test {
inline uint8_t
dehex(char c)
{
if ('0' <= c && c <= '9') return c - '0';
if ('A' <= c && c <= 'F') return 10 + c - 'A... |
8074f7ee341e415efeaf8b1190c01247872dee85 | d9451dce3a816f6975595957cf29875738f159c8 | CSLP/Cpp-Primer-5th-Exercises | /ch3/3.16.cpp | C++ | cpp | 1,026 | permissive | #include <iostream>
#include <vector>
#include <string>
using std::vector;
using std::string;
void print_vector_int(const vector<int> &v) {
for (const auto & elem : v)
std::cout << elem << " ";
std::cout << std::endl;
}
void print_vector_string(const vector<string> &v) {
for (const auto & elem : v)
std:... |
a7aadcc1120e82fd59131da3a7b43b13f9ead4a7 | 11c9aa6e2cf8ea434d2ec961892ceca641b13d84 | wout-dev/LiquidSim | /OverlordProject/TestScene.cpp | C++ | cpp | 3,367 | no_license |
#include "stdafx.h"
#include "TestScene.h"
#include "GameObject.h"
#include "Prefabs.h"
#include "Components.h"
#include "PhysxProxy.h"
#include "PhysxManager.h"
#include "ContentManager.h"
#include "MeshFilter.h"
#include "Materials\ColorMaterial.h"
#include "Materials\UberMaterial.h"
#include "ModelComponent.h"
... |
22847b071d9e6f96626dcb825189e629dce72315 | 144db0bbb8e8df94183eb20ddfd157585929751c | TheFullResolution/Chopper-Game | /src/components/Tile/Tile.cpp | C++ | cpp | 966 | permissive | //
// Created by Jedrzej Lewandowski on 05/02/2020.
//
#include "Tile.h"
Tile::Tile(int sourceRectX, int sourceRectY, int x, int y, int tileSize,
int tileScale) {
sourceRectangle.x = sourceRectX;
sourceRectangle.y = sourceRectY;
sourceRectangle.h = tileSize;
sourceRectangle.w = tileSize;
destina... |
b5f2e1d574ef1f8758c339f3cf160b9809917241 | a9d5025d44eef99d7e0bc059993509344a1115d2 | seankmartin/inviwo | /modules/vectorfieldvisualization/properties/streamlineproperties.cpp | C++ | cpp | 2,358 | permissive | /*********************************************************************************
*
* Inviwo - Interactive Visualization Workshop
*
* Copyright (c) 2015-2018 Inviwo Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided th... |
da0804a1bcca7fd447c0e0aaf799de49e2eb03fb | 0fb3069bcab05f290792421e12cf4335ca4e6937 | litao1009/SimpleRoom | /externals/OCCTLib/inc/Handle_ShapeFix_SequenceNodeOfSequenceOfWireSegment.hxx | C++ | hxx | 898 | no_license | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _Handle_ShapeFix_SequenceNodeOfSequenceOfWi... |
4031e320a267513f91d2eb00ce5ba9740ff325ce | e9ea8cf420782376a81be644fce96ab3cff1d961 | jashwant1234/DSA | /leetCode/36. Valid Sudoku.cpp | C++ | cpp | 1,291 | no_license | class Solution {
public:
bool valid(vector<vector<char>>& board,int i,int j){
unordered_map<int,int>uumb;
int l=i+3,m=j+3;
for(;i<l;i++){
for(;j<m;j++){
cout<<i<<" "<<j<<endl;
if(board[i][j] != '.'){
uumb[board[i][j]]++;}
... |
d6d50ca06ce39f0c278e1a91b8f2680455316277 | f83dbd87a3685b39068638985d0a88571e5efe56 | avityuk/cmake-template | /test/foo_test.cc | C++ | cc | 219 | no_license | #include "foo.h"
#include "gtest/gtest.h"
class FooTest : public ::testing::Test {
protected:
virtual void TearDown() {
}
virtual void SetUp() {
}
};
TEST_F(FooTest, Bar) {
ASSERT_EQ(3, Foo().Bar(3));
}
|
3b4f41de232b193d184235b50cebdbdcb1a8cbf6 | a7b87efe44dc4802a5fc3493979bbb07284afc26 | SRiYaa/Codes | /Basics/Diamond.cpp | C++ | cpp | 573 | no_license | #include <stdio.h>
int main()
{
int n, c, k, space = 1;
printf("Enter number of rows\n");
scanf("%d", &n);
space = n - 1;
for (k = 1; k <= n; k++)
{
for (c = 1; c <= space; c++)
printf(" ");
space--;
for (c = 1; c <= 2*k-1; c++)
printf("*");
pri... |
88690f75711f845d15982295ab5d614cf88ded1e | 25716e44a0d872ab2dd5c523d6ef87e582778b5b | forhannoor/datastructure | /bracket_matching.cpp | C++ | cpp | 2,915 | no_license | #include<stack>
#include<string>
#include<cstdio>
// Determines if char is an opening bracket symbol.
bool is_open(char symbol);
// Determines if char is a closing bracket symbol.
bool is_close(char symbol);
// Determines if char symbols matches.
bool matches(char symbol, char open_symbol);
int main()
{
// Sample... |
190f0f0b2454fc5b7b87afc9dba021a48d022015 | 54d7998a3656f9b0d5535d587885db98202f412b | xlsay/PSO | /gfunctions.cpp | C++ | cpp | 666 | no_license | #include<Ctime>
#include<Cstdlib>
//generate n double numbers between start and end, and store them in p
void random(int start,int end,int n,double *p)
{
//srand((unsigned)time(NULL));//set seed
int temp;
double dt;
for(int cn=0;cn<n;cn++)
{
temp=start+rand()%(end-start+1);//note:rand() return a value belongi... |
10edb91f61b61852176d23b0687616bf9f0bf481 | ab4ff6bffe9fa670dd628b0ffba698d203fa4593 | SimJung/Baekjoon_20190704 | /p14501.cpp | C++ | cpp | 594 | no_license | #include <iostream>
using namespace std;
int n, maxx, prev_max = 0;
int arr[2][16];
int dp [16];
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> arr[0][i] >> arr[1][i];
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= i; j++)
... |
c1af9d13bafa57ce2e1f5c81b891a4f38ce61922 | dcd8eaffcd86c734f6c429f6f68c08512540d769 | bobsmile/chromium | /chrome/browser/ui/global_media_controls/cast_media_session_controller.cc | C++ | cc | 2,873 | permissive | // Copyright 2019 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/ui/global_media_controls/cast_media_session_controller.h"
#include "base/time/time.h"
#include "chrome/common/media_router/mojom... |
db78de3acf08e1f01443253e2568cab3151a3cc8 | 1d692b45006c653286f31c68aa58fe280eb1adad | p-lots/codewars | /7-kyu/progressive-spiral-number-position/c++/solution.cpp | C++ | cpp | 211 | no_license | #include <cmath>
int layers(int n)
{
if (n == 1) return 1;
int pow = 1, pow_res = 1, ret = 0;
while (pow_res < n) {
pow_res = std::pow(pow, 2);
ret++;
pow += 2;
}
return ret;
} |
d2cd35a31be0e93cc98e1a42be2479a8e4619654 | d382cd11f344231c3bac1660e50da9598b24665e | open-rdc/autonomous-vehicle | /Comm.cpp | C++ | cpp | 2,734 | permissive | // Comm.cpp : 実装ファイル
//
#include "stdafx.h"
#include "Comm.h"
OVERLAPPED sendop, recop;
/*!
* @class CComm
* @brief シリアル通信を行うためのクラス
*/
/*!
* @brief コンストラクタ
*/
CComm::CComm() : com_port(0)
{
}
/*!
* @brief デストラクタ
*/
CComm::~CComm()
{
}
/*!
* @brief COMポートのオープン
* 通信開始時には,必ず実行... |
f35bc835991905b81af6ad32e906d369e97a5b9e | 8537d86866a656d508c82a086a0d42e1a0fc0e04 | namwkim/sirikata | /space/src/FairServerMessageReceiver.cpp | C++ | cpp | 6,665 | permissive | /* Sirikata
* FairServerMessageReceiver.cpp
*
* Copyright (c) 2010, Ewen Cheslack-Postava
* 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... |
a70393b82de1ee5f7c79b9143b5480e1fcb8bc41 | 3fcea342fda74ace4858f8a7373670e7c655a1e8 | MCLXI/HTS | /src/qt/receivecoinsdialog.cpp | C++ | cpp | 9,700 | permissive | // Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "receivecoinsdialog.h"
#include "ui_receivecoinsdialog.h"
#include "addressbookpage.h"
#include "addresstablemodel.... |
824c90f3b6114e96b6c85e44635f34925e93bdce | 262e1e3518ad5a2e4c3be2f6e7a5ea36160194b1 | rupertford/dawn | /src/dawn/CodeGen/Cuda/ASTStencilDesc.cpp | C++ | cpp | 4,454 | permissive | //===--------------------------------------------------------------------------------*- C++ -*-===//
// _
// | |
// __| | __ ___ ___ ___
// / _` |/ _` \ \ /\ / / '_ |
// | (_| | (_| |\ V V /| | | |
// ... |
e5c71f91539f97202255598aefdc6c88032a235e | 0ed429976929a079e8e1a9a5abf79214ef028436 | narayanr7/HeavenlySword | /code/3rdparty/hk410/include/physics/hkdynamics/constraint/chain/ballsocket/hkBallSocketChainDataClass.cpp | C++ | cpp | 3,972 | no_license | /*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent.This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Level 2 and Level 3 source code contains trade secrets of ... |
8e47e7651dc7f517b6fee3e36da64ff8d4ca61c1 | 54988f60e2a02354123bc7cbb61d30ccc8d2a542 | wuyou33/Enabling-Robust-State-Estimation-through-Measurement-Error-Covariance-Adaptation | /3rdparty/RobustGNSS/gtsam/gtsam/gpstk/YumaData.hpp | C++ | hpp | 4,514 | permissive | #pragma ident "$Id$"
//============================================================================
//
// This file is part of GPSTk, the GPS Toolkit.
//
// The GPSTk is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free S... |
0e85c29a4ff220550be932c7dba0e83e332b27a6 | 1aa66fed20c5ffb5ddbb4e1c624219d3db0013e5 | JohanMabille/boost.simd | /bench/function/simd/interleave_second/regular.float.m10_10_m10_10.cpp | C++ | cpp | 881 | permissive | // -------------------------------------------------------------------------------------------------
// Copyright 2016 - NumScale SAS
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// ... |
f0e034d63427f38cd7e2a13db9820922944e7b3b | 03324b788f27679085564d4d4664308e33d07d2e | apocas/one | /src/vnm/AddressRangePool.cc | C++ | cc | 18,940 | permissive | /* -------------------------------------------------------------------------- */
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may ... |
300d41c3c6e9ebce9061c80f06412cedc1c09bf1 | fa5331cd2b87a0fa4eb5c738e2cbe6d16fa52656 | ababook/Ponce | /Ponce/src/utils.cpp | C++ | cpp | 25,569 | permissive | //! \file
/*
** Copyright (c) 2016 - Ponce
** Authors:
** Alberto Garcia Illera agarciaillera@gmail.com
** Francisco Oca francisco.oca.gonzalez@gmail.com
**
** This program is under the terms of the BSD License.
*/
//C++
#include <stdio.h>
#include <string>
#include <iostream>
... |
5cbbac17aabca17602d9b4fdccc153c7c6d28e9c | d6a71b157da4826b2e680a34b1a68c03aa9ecce5 | shawvi/ydk-cpp | /cisco-ios-xe/ydk/models/cisco_ios_xe/fragmented/Cisco_IOS_XE_native_36.hpp | C++ | hpp | 184,004 | permissive | #ifndef _CISCO_IOS_XE_NATIVE_36_
#define _CISCO_IOS_XE_NATIVE_36_
#include <memory>
#include <vector>
#include <string>
#include <ydk/types.hpp>
#include <ydk/errors.hpp>
#include "Cisco_IOS_XE_native_0.hpp"
#include "Cisco_IOS_XE_native_19.hpp"
#include "Cisco_IOS_XE_native_35.hpp"
namespace cisco_ios_xe {
namespac... |
c33fc8b640a810f574d57ee54f517028173aa145 | d0812292edef0bd9d9361ae6bb9fad520455e2a2 | oturan-boga/Windows2000 | /private/windows/shell/accesory/hypertrm/comstd/comstd.hh | C++ | hh | 11,849 | no_license | /* comstd.hh -- Private header file for stdcom communications driver module
*
* Copyright 1994 by Hilgraeve Inc. -- Monroe, MI
* All rights reserved
*
* $Revision: 2 $
* $Date: 2/05/99 3:19p $
*/
// -=-=-=-=-=-=-=-=-=-=-=-=-=- DEBUG CONTROL -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// These constants are ... |
b901c215da23c44367e23f6102e31dc74fea6de4 | 439fe66fa046c8284247ea704847fb554eaa44fc | niuxu18/logTracker-old | /second/download/httpd/gumtree/httpd_patch_hunk_3820.cpp | C++ | cpp | 787 | no_license | }
}
if ((sc->proxy_ssl_check_peer_name != SSL_ENABLED_FALSE) &&
hostname_note) {
apr_table_unset(c->notes, "proxy-request-hostname");
if (!cert
- || SSL_X509_match_name(c->pool, cert, hostname_note,
- ... |
d0fe6115fb651a1ba9b00403e507f90d65021776 | 88ea46f868c1fae0d08101ae87d969e964fbac8a | zeldaret/botw | /src/Game/AI/Action/actionGiantNavMeshWalkWithVibration.cpp | C++ | cpp | 838 | no_license | #include "Game/AI/Action/actionGiantNavMeshWalkWithVibration.h"
namespace uking::action {
GiantNavMeshWalkWithVibration::GiantNavMeshWalkWithVibration(const InitArg& arg)
: NavMeshAction(arg) {}
GiantNavMeshWalkWithVibration::~GiantNavMeshWalkWithVibration() = default;
bool GiantNavMeshWalkWithVibration::init_(... |
41bb6b3bd1cb849cab278796fde837681dc74b70 | 3cb65f4fcfb47e9c7bc0d9072e39e76f63273f39 | salonitayal/DataStructuresAndAlgorithms | /LeetcodeSolutions/March-leetcoding-challenge-2021/set-mismatch.cpp | C++ | cpp | 428 | no_license | class Solution {
public:
vector<int> findErrorNums(vector<int>& v) {
vector<int> res;
sort(v.begin(), v.end());
for(int i=0; i<v.size(); i++)
{
if(v[abs(v[i])-1] > 0)v[abs(v[i])-1]*=-1; //taking v[i] as index
else res.push_back(abs(v[i]));
}
for... |
dea2269eea6ba86e114d8158d71c0ea965ebbb57 | d882bbc0300c6f8935af94586cd95e70c551d736 | monjurul0007/UVa-problem-solves | /UVa-11015 05-2 Rendezvous.cpp | C++ | cpp | 1,113 | no_license | #include <bits/stdc++.h>
using namespace std;
#define inf 1<<15
#define pu(i,j,k) push(iii(i,ii(j,k)))
#define pb(i,j,k) push_back(iii(i,ii(j,k)))
typedef pair<int , int> ii;
typedef pair<int, ii> iii;
int main(){
//freopen("input.txt","r",stdin);
int n,m,mat[25][25],mi[25]... |
c7ff751844f38734fa9647c4136e49d8b317fcde | 12a64bafbbc8d92a488cddf42309f10e25edd540 | marvinfy/Trainings | /qt/cursoQt/apostila/04_threads/04_05_threads_wait_sem/main.cpp | C++ | cpp | 2,785 | no_license | /*
Este exemplo dá conta de uma situação
em que um thread precise esperar
qualquer ponto de processamento de outro thread
que não seja a finalização desse thread.
Para isso pode ser usado um semáforo
com seu contador iniciado com zero.
Neste exemplo, "main" irá esperar
que cada "TestThr... |
fe8531ded1b0496e8c592fd8e2f5809ef0bae1f3 | c40e0c5544176afc49825728c02b285ff1ffee50 | erwincoumans/bullet3 | /examples/ReducedDeformableDemo/ReducedGrasp.cpp | C++ | cpp | 18,765 | permissive | /*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2019 Google Inc. http://bulletphysics.org
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 t... |
a4fc1f7d686d0e65cfe812db893fd7bb1d58723d | 81b1dc92ab2ff3381fa3c701f930769f05c6561c | artur-kink/nhns | /Engine/Networking/NetworkHandler.cpp | C++ | cpp | 2,949 | permissive | #include "NetworkHandler.hpp"
NetworkHandler::NetworkHandler(){
inPort = outPort = 50012;
lastMessageAddress = new char[20];
}
/**
* Bind the socket to the given port. Opens Socket to listen
* to connections on given port.
* @param port Port to bind to.
*/
void NetworkHandler::bind(unsigned short port){
... |
1d5586a5a77f71149156bb84125516069dff43a1 | 23be898a3c29b8c528fddcdc9bb8b424b9106fd0 | LucasEBSkora/jogo-tecnicas | /Mementos/CasterMemento.cpp | C++ | cpp | 1,372 | no_license | #include "CasterMemento.hpp"
namespace DIM {
namespace Mementos {
CasterMemento::CasterMemento(Utils::VectorF pos, Utils::VectorF vel, float dly, float max_vx, float max_vy) {
position = pos;
velocity = vel;
delay = dly;
max_speed_x = max_vx;
max_speed_y = max_vy;
}
Utils:... |
ae2168afd50a892d2e2e9b35f7737f29fdf6ef96 | 94ea8159f5bf34e1af71df8f1e0b068aee4a55b1 | PTRFmX/Leetcode-practice | /389.找不同.cpp | C++ | cpp | 389 | no_license | /*
* @lc app=leetcode.cn id=389 lang=cpp
*
* [389] 找不同
*/
// @lc code=start
class Solution {
public:
char findTheDifference(string s, string t) {
int s_s = 0, t_s = 0;
for (int i = 0; i < s.length(); i++) {
s_s += s[i];
t_s += t[i];
}
t_s += t[s.length()]... |
be29cee1bd7d8f64b3a371c4c0d8a9700b7ad1c4 | 5d978d82ebb153eb4616e5fad621f1197bde74eb | AntSan813/Spring-CSCI-271 | /-CSCI-271-Custom_Sort_Algorithms/selectionSort.cpp | C++ | cpp | 3,915 | no_license | /*****************************************************************************
* Antonio Santos
* Spring 2017 - CSCI 271
* Program 4 - Due 3/27/2017
*****************************************************************************/
#include <time.h>
#include <iostream>
#include <cctype>
#include <fstream>
#include <cstdlib... |
8c7ef47034cb3f5008e789217a92f4a65adf778b | ae0a6ca89aeee44c88042b07062e79836b19661b | ajaysharma388/webinar-code-in-cpp | /Dec 19/parenthesis_generator.cc | C++ | cc | 515 | no_license | #include<iostream>
using namespace std;
void generate_paranthesis(char *a, int n, int open = 0, int close = 0, int i = 0) {
//base case
if (i == 2 * n) {
a[i] = '\0';
cout << a << endl;
return;
}
//open
if (open < n) {
a[i] = '(';
generate_paranthesis(a, n, open + 1, close, i + 1);
}
//closing
if (cl... |
fcd632044f162657990b2e74ffad9ac4ee3c6b37 | cfa630853b9c7b8f809ad4d23119c4800fd40d5f | pfeilbr/webassembly-playground | /embind-example/example.cpp | C++ | cpp | 500 | no_license | // example.cpp
#include <emscripten/bind.h>
#include <iostream>
#include <sstream>
using namespace emscripten;
float lerp(float a, float b, float t) {
return (1 - t) * a + t * b;
}
void echo(std::string s) {
std::cout << s << std::endl;
}
std::string greeting(std::string name) {
std::ostringstream os;
... |
ed983a3e4ac490979499fe02d57e0da19a673c9f | b5bb7082de7999a626b4d7dd99903e961c4cbb3c | pkgw/casa | /code/msvis/MSVis/VisibilityIterator.cc | C++ | cc | 46,412 | no_license | #include "VisibilityIterator.h"
#include "VisibilityIteratorImpl.h"
#include "VisibilityIteratorImplAsync.h"
#include "UtilJ.h"
#include <casa/System/AipsrcValue.h>
//#include <measures/Measures/MDoppler.h>
//#include <measures/Measures/MRadialVelocity.h>
#define CheckImplementationPointerR() Assert (readImpl_p != N... |
30ef92cdce5672f65afd87a236eca8b37955c7c2 | 02b4b2cf3ae63c030a92666970f92b8237a1e8cd | wangxm47/Data-Structures | /list/main.cpp | C++ | cpp | 2,425 | no_license | #include <iostream>
#include <windows.h>
#include "array_list.hpp"
#include "link_list.hpp"
using namespace std;
int main(){
while(1)
{
system("cls");
cout<<"please select list:"<<endl;
cout<<"1. array list"<<endl;
cout<<"2. link list"<<endl;
cout<<"0. quit"<<endl;
char a;
cin>>a;
if(a=='0')
{
br... |
6abed11b4b0e7cc13e85088a990dc5dd02461fed | 2506a01d2951b0ba66810770d6fe0e27fbf3e482 | TomSms/VSEngine2 | /VSMath/VSRectangle3RelationWith.cpp | C++ | cpp | 8,621 | no_license | #include "VSRectangle3.h"
#include "VSSegment3.h"
#include "VSAABB3.h"
using namespace VSEngine2;
int VSRectangle3::RelationWith(const VSLine3 &Line,bool bCull,VSREAL fRectangleParameter[2],VSREAL &fLineParameter)const
{
return Line.RelationWith(*this,1,fLineParameter,fRectangleParameter);
}
/*-----------------------... |
39212245479c27056360dd83becf5d99bbcccc91 | a4587747956ba1567ba57c23a7a954e8cc6a6e93 | jawaff/CollegeCS | /CS312/2013-SP-CS-312-LA-03-JakeW-v2/Problem2_5/main.cpp | C++ | cpp | 2,817 | permissive | ///page 115 Problem #2
///1. Year and Semester : 2013 SPRING
///2. Course Number : CS-312
///3. Course Title : OO Design/Implementation
///4. Work Number : LA-03
///5. Work Name : Exercises Ch 03
///6. Work Version : Version 2
///7. Long Date : Wednesday, 13, February, 2013
///8. Author(s) Name(s) : Jake Waffle
#incl... |
841e2b292582f61753b44d3769dc51a34ec83fbc | e81f007ee93426e3ffa184b37fd234f9429ca155 | camilne/xenon-engine | /include/Camera.hpp | C++ | hpp | 1,183 | no_license | #ifndef XENON_CAMERA_HPP
#define XENON_CAMERA_HPP
#include <glm/glm.hpp>
namespace xe {
class Camera {
public:
static Camera createPerspective(float fov, float aspect, float zNear, float zFar);
Camera& lookAt(const glm::vec3& center);
void update();
void processInput(double deltaTime);
void s... |
e208c95da8d57ab33981add7f6b97203d3eb6d7d | b374701d2aa02ea2ece80977b9f77f6759380579 | QuangTrongNhan/LabC | /CSP0005_60LOC_roi/CSP0005.cpp | C++ | cpp | 590 | no_license | #include<stdio.h>
#include<conio.h>
#define ESC 27
int checkNumber ()
{
int n;
char m;
do
{
if (n == m){
scanf ("%c",&m);
printf ("error");
else {
}
}
if(n<1 || n>9)
{
printf("Error\n");
}
}while(n<1 || n>9);
}
void multiplication (int n){
int i;
for(i=1;i<11;i++)
{
printf("%d x %d = %... |
e6ac34b54818093002dd4fa02d5006135e296212 | 75d603b0d38d781ec6086ba20a0ceb189248a417 | elgamar/cobalt-clone | /src/glimp/stub/gles/texture_impl.cc | C++ | cc | 1,977 | permissive | /*
* Copyright 2016 Google Inc. 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 by applica... |
7da29b384118c1f1efcd792a75daa6d072b7a597 | 8f2e6b8af1d193717011a016063a52a55a61b130 | asraa/rules_fuzzing | /examples/new_buffer_overflow_fuzz_test.cc | C++ | cc | 1,119 | permissive | // Copyright 2020 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 w... |
1d5887d69763d7ebfa013fae5c3583272d5398d9 | bdda9f529663b8b772799f81567fa015f385feb9 | PsymonLi/sw | /nic/sdk/lib/timerfd/timerfd.hpp | C++ | hpp | 814 | no_license | //------------------------------------------------------------------------------
// {C} Copyright 2017 Pensando Systems Inc. All rights reserved
//
// timerfd library is a wrapper around linux timerfd APIs
//------------------------------------------------------------------------------
#ifndef __SDK_TIMERFD_HPP__
#def... |
1209252eb6994cd4f383652d457119621f0f2959 | ae4870c951e4c3d9b431654be961ff1cc14866fe | Capcicum/TIARDI | /BlackJack/include/OSAL/INET/INETAddr.hpp | C++ | hpp | 947 | no_license | /*
* INET_Addr.hpp
*
* Created on: 28. sep. 2016
* Author: Andersen
*/
#ifndef INCLUDE_OSAL_WIN32_INET_ADDR_HPP_
#define INCLUDE_OSAL_WIN32_INET_ADDR_HPP_
#include <DataType.hpp>
namespace OSAL {
namespace INET {
class INETAddr {
public:
/**
*@brief - INETAddr class constructor
*@param port - the p... |
66c899ef5cf7aa015ab13f7eab0ffc847ba1b6d6 | 48ec9d77f1a410dd2eb28deeb500737361274893 | ksercs/school_olympiads | /2016-2017/Ломоносов_1_тур/C/C.cpp | C++ | cpp | 678 | no_license | #include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <utility>
#define SZ size()
#define VEC vector
#define PB push_back
#define MP make_pair
#define SS second
#define FF first
#define... |
e337eabdc011b37ab39195668eb799b659ba4a22 | 64cece87a824c6b5eda94ac066aa32eca41b9463 | cloudy064/leetcode | /leetcode.001-050/009.palindrome-number/main.cpp | C++ | cpp | 1,126 | permissive | //
// Created by cloudy064 on 2018/6/19.
//
#include "common.h"
/// Solution for https://leetcode-cn.com/problems/palindrome-number/description/
class Solution {
public:
bool isPalindrome(int x) {
if (x < 0) return false;
if (x < 10) return true;
int digits[10];
int len = 0;
... |
a6c12b3523a05937e4e277545567f81ccc2b3088 | c77506f320343e3ebab705554c1014e02b6c71c8 | jonas2602/ParserGenerator | /ParserCore/src/Test/ListParser/ListInterpreter.cpp | C++ | cpp | 1,396 | no_license | #include "ListInterpreter.h"
#include "ListLexer.h"
#include "ListAlphabet.h"
void ListInterpreter::Analyse(const std::string& ListContent, std::vector<ParserCore::Node_CONST*>& OutNodes)
{
std::vector<ParserCore::Token*> TokenStream = ListLexer(ListContent).GetTokenStream();
for (int i = 1; i < TokenStream.size();... |
8d837d310c75bb4bb4c4b91097aeab26a205f308 | 48056cd68fd679df56b9adefb1ff9b005633d62e | srj31/upsolve | /1256F.cpp | C++ | cpp | 1,393 | no_license | #include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define forn(i,a,b) for(int i =a;i<b;i++)
#define fi first
#define se second
#define fast ios_base::sync_with_stdio(false);
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
void... |
1f6f5aa0abd9ced15b293d02ac26318ec7f87782 | 7c21caa5478e3ac7acea7b9d666304b2bab8edb3 | eiji03aero/dpcpp | /test/dpcpp/structural/proxy.cpp | C++ | cpp | 2,908 | no_license | #include "gtest/gtest.h"
#include <iostream>
namespace dpcpp { namespace structural {
/**
* The Subject interface declares common operations for both RealSubject and the
* Proxy. As long as the client works with RealSubject using this interface,
* you'll be able to pass it a proxy instead of a real subject.
*/
cl... |
02592a212346e3f20a39fdde8fd344dd4614da0d | f98aeb2273577d2605133e43dd510ec267f47166 | VladyslavVelychko/c-davis-exercises | /3.3(131)/main.cpp | C++ | cpp | 278 | no_license | #include <iostream>
#include <cstdlib>
#include <locale.h>
using namespace std;
int main()
{
setlocale(LC_CTYPE,"Russian");
int i;
int sum=0;
for(i=1;i<=10; sum+=i++);
cout<<"Сумма чисел равна "<<sum<<".";
return 0;
}
|
494f7159237d7491618e6baf2d7ff8b67763a50f | 503764265c43adffd855997c429489aaa0fb89b3 | Devang-25/acm-icpc | /project-euler/p139.cpp | C++ | cpp | 625 | no_license | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
const int N = 100000000;
int result;
void generate(int p1, int q1, int p2, int q2)
{
int p = p1 + p2;
int q = q1 + q2;
if (2 * q * q + 2 * q < N) {
if (q - p & 1) {
int a = q * q - p * p;
int b = ... |
8062c2300b75411e16d72a19eea2de8bf12a9bc7 | e6f3287c80576b632d0f67f9ab5fa6d3c99bbb6a | deeplearning4j/deeplearning4j | /libnd4j/include/ops/declarable/generic/nn/apply_sgd.cpp | C++ | cpp | 2,153 | permissive | /* ******************************************************************************
*
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* See the NOTICE file distributed wit... |
e174595efb748d4f6e0b46fe5cd7b0b8cd77dde5 | eaca5c1a7698c63c73c15115b3a0813c70caf675 | shinigamirex888/A2oj-ladders | /Marathon.cpp | C++ | cpp | 4,077 | no_license | #include <bits/stdc++.h> //yaad rkhne layak baatein
#include <bits/stdc++.h> // bool found = false use it to find some number after the given number with some cond.
// while (!found)
#include <iostream> // freq.table-> int freq[26] = {0}; for (ll i = 0; i < s1.length(); i++) freq[s1[i] ... |
e5dbe0aac941a5fab82059872253d7e64541c49d | 1cbc062238bc1fd8f38a98a31c0c18ecacc5369f | agmkv70/EmonLibCM | /emonLibCM3ph.cpp | C++ | cpp | 33,213 | no_license | /* agmkv70 fork of
emonLibCM.cpp - Library for openenergymonitor
GNU GPL
- cleared temperature and pulse count, adding 3 phase voltage mesurement
*/
// This library provides continuous single-phase monitoring of real power on up to five CT channels.
// All of the time-critical code is now contained within the IS... |
a2602fb198f46729540128bade12c4d4fba065e0 | 3bebf2597c3c3fee97c30ffbe72b4810ddb7e0f3 | Oh-kyung-tak/Algorithm | /Baekjoon/baekjoon_1436.cpp | C++ | cpp | 548 | no_license | #include <iostream>
#include <string.h>
#include <algorithm>
#include <queue>
using namespace std;
int n;
int main()
{
int N;
int count = 0;
int num = 666;
scanf("%d", &N);
while(1)
{
int tempnum = num;
int sixcount = 0;
int check = 1;
while (tempnum > 0)
{
if (tempnum % 10 == 6)
{
six... |
702b4e8e60e0230c0f3db2515c7b81aada54a01d | ce68d482fd92f62df44018eeb92c5698cf9741d4 | ThomasThorpe/AdventOfCode2019 | /AdventOfCode2019/AdventOfCode2019/Day8Puzzle1/Solution.cpp | C++ | cpp | 1,686 | no_license | /**
* @file AdventOfCode2019/Day8Puzzle1/Solution.cpp
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using String = std::string;
void GetLayers(const String filename, const int layerLength, std::vector<String> &layers)
{
std::ifstream input(filename)... |
e4796fcf25d651725a59f76de3989986a13c65a8 | e040f6afe46739c5e09d3b1de444473ded3f09f6 | tectronics/ucb-cs164-hilo.code | /HILO/hilomodule/procutil.cpp | C++ | cpp | 2,208 | no_license | #include "procutil.h"
DWORD const getPidFromExe( char const * const exeName ) {
DWORD pid = NULL;
PROCESSENTRY32 processEntry;
HANDLE hSnapshot = CreateToolhelp32Snapshot ( TH32CS_SNAPPROCESS, NULL );
processEntry.dwSize = sizeof(processEntry);
if ( hSnapshot && Process32First( hSnapshot, &processEntry... |
038a44853ddd097bede5975aa44f1d452cef90ab | 8d3379144e42695da989e84c8385b7c30881d34c | jabway/GLTest2 | /GL/VertexArrayObject.cpp | C++ | cpp | 2,166 | no_license | #include "VertexArrayObject.h"
VertexArrayObject::VertexArrayObject()
{
MaxAttribs = 0;
GLenum ErrorCheckValue = glGetError();
glGenVertexArrays(1, &VaoId);
glBindVertexArray(VaoId);
glBindVertexArray(0);
ErrorCheckValue = glGetError();
if (ErrorCheckValue != GL_NO_ERROR)
{
... |
69538312cde94a91b3d50c7fc57bb4f13adcaac9 | 9acec07d5f675bad81a9ae4e1af2ffdd550b5a0d | Yulei-Duan/Algorithms | /BFS_go.cpp | C++ | cpp | 1,698 | no_license | #include <stdio.h>
#include <queue>
using namespace std;
int map[20][20];
int nb,nw;
int n,b,w;
int d[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
struct Node
{
int x,y;
}p,k;
void bfs(int x,int y)
{
int num=0;
queue<Node> q;
p.x=x;
p.y=y;
q.push(p);
map[x][y]=3;
int flag1=0,flag2=0;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.