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 |
|---|---|---|---|---|---|---|---|---|
ad5c443a39b4a925c8228f0fbe1bf719922220c4 | 37172f4dd2b7ad850300fb06b4319a7b027401bd | imulan/procon | /codeforces/gym/Samara_XII/l.cpp | C++ | cpp | 2,696 | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U... |
014b8ac336790286f7f487321e9d7fb850a6a84a | efb63bd8e3fd420e5b6d2d4e3b3daf18db01b440 | truongthanh96/ggEngine | /ggEngine/ggEngine/Window.cpp | C++ | cpp | 1,482 | no_license | #include "Window.h"
#include <iostream>
#include "MyStackWalker.h"
namespace ggEngine {
LONG WINAPI MyFilter(EXCEPTION_POINTERS * pExp/*ExceptionInfo*/)
{
std::cout << "An uncaught exception was detected!\n";
MyStackWalker sw;
sw.ShowCallstack(GetCurrentThread(), pExp->ContextRecord);
return EXCEPTION_EXECUTE... |
bf8ab3603ae9d81666e1ce00ed6656f08da68a43 | 0f49bd8423c16c7e1f4500bdf80d92c0b8d2f374 | dawidjaja/competitive-programming | /TOKI/pelatnas/2016/PJJ/2nd Week/C.cpp | C++ | cpp | 511 | no_license | #include <algorithm>
#include <cstdio>
using namespace std;
int n,list[150],temp,maks,tnd[150],ctr,bts,tinggi;
int main ()
{
scanf("%d",&n);
for (int i=1;i<=n;i++)
{
scanf("%d",&list[i]);
}
sort(list+1,list+1+n);
for (int i=1;i<=n;i++)
{
if (tnd[i]==0)
{
ctr++;
// printf("%d\n",list[i... |
3d69ca9ad71a9ca00ef4fe8767d00b770ae22d46 | 52ac001a0ada9affc72e506ce81b9a12f285cd41 | Deepakku28/Leetcode | /368. Largest Divisible Subset.cpp | C++ | cpp | 878 | no_license | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
int len=nums.size();
sort(nums.begin(),nums.end());
vector<int> dp(len,1);
vector<int> result;
int maxLen=1;
for(int i=1;i<len;i++){
for(int j=0;j<i;j++){
if(n... |
8013ec1af3c731789ef951629f6eb04d72d50e86 | 4d5a8fb764e4cb403fc52aa3f2241a8184fc739a | WagnerPaulino/Estudos | /estudoC++/estudo/pilha/Pilha.cpp | C++ | cpp | 934 | no_license | /*#include <iostream>
#include <stack>//precisa dessa biblioteca para se trabalhar com pilhas
using namespace std;
int main(){
stack <string> cartas;//criando uma pilha
if(cartas.empty()){//retorna verdadeiro quando a pilha está vazia
cout << "Pilha vazia\n\n";
}else{
cout << "Pilha com cartas\n\n";
}
cartas.p... |
611d6440afc541ba4fed5c47234d469939e55b48 | f7f9e5a0ddbec6233a5bf241f0e9ce510a05f707 | ThoseBygones/ACM_Code | /AOJ/AOJ ALDS1_6_C.cpp | C++ | cpp | 1,872 | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MAXN 100010
#define INF 0x3f3f3f3f
struct Card
{
char suit;
int value;
};
Card L[MAXN/2],R[MAXN/2];
int n;
void conquer(Card a[],int left,int mid,int right)
{
int n1=mid-left;
int n2=right-mid;... |
4a72353385a2d6e7a7ba6622480a3bc648d2cf51 | 50123e220c0434ad4d0a84822cc95b311b7a39f3 | jmintser/chemfiles | /tests/files/memory-file.cpp | C++ | cpp | 4,211 | permissive | // Chemfiles, a modern library for chemistry file reading and writing
// Copyright (C) Guillaume Fraux and contributors -- BSD license
#include <fstream>
#include "catch.hpp"
#include "helpers.hpp"
#include "chemfiles/files/MemoryFile.hpp"
#include "chemfiles/files/MemoryBuffer.hpp"
#include "chemfiles/Error.hpp"
usin... |
8fb5e1439d9e00c12fd8ddf8795a0b54293677da | a41f36618864b25abfb0b68c97ea272fc070637d | waaberi/chromium | /ui/gl/init/create_gr_gl_interface.cc | C++ | cc | 35,750 | permissive | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gl/init/create_gr_gl_interface.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "base/trace_event/trac... |
3ca5e00e44287e4ffd8f1be70bc589df5f0fca11 | cb3f9eb126f568334647e9177b8dcd914bf76bf8 | asdlei99/directx-vs-templates | /d3d11game_win32_dr/Main.cpp | C++ | cpp | 7,243 | permissive | //
// Main.cpp
//
#include "pch.h"
#include "Game.h"
using namespace DirectX;
#ifdef __clang__
#pragma clang diagnostic ignored "-Wcovered-switch-default"
#pragma clang diagnostic ignored "-Wswitch-enum"
#endif
#pragma warning(disable : 4061)
namespace
{
std::unique_ptr<Game> g_game;
}
LRESULT CALLBACK WndPro... |
b6895b23db562092fdc3454b82816b325591bc47 | 13ac839a056e7d10e2f23ded750ed5ec9488ac50 | AllexisAlvarico/AnimationFSM | /AnimationFSM/main.cpp | C++ | cpp | 2,159 | no_license | #include <iostream>
#include <SFML/Graphics.hpp>
#include <AnimatedSprite.h>
#include <Player.h>
#include <Input.h>
#include <Debug.h>
using namespace std;
int main()
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// Load a sprite to display
sf::Texture texture;
if ... |
04df4469695a21b5d13cddce96fa14f7e26dd2db | 17cbd688f5e08d05f3918b3bb7713981f59bee0d | PurbayanNC/Far_Behind | /NotInCookbook/DP_div_conq_knuth_optimization.cpp | C++ | cpp | 4,754 | no_license | // You have an array of size L.You need to split it into G intervals minimizing the cost. (G<=L otherwise we can just split in 1-intervals).
// There is a cost function C[i,j] of taking an interval.The cost function satisfies : C[a,b]+C[c,d]<=C[a,d]+ C[b,c] for all a<=c<=b<=d. Basically [a,b] and [c,d] are intersecting... |
670212b5dc5760742620919518338a8e5c498f00 | d6928fb02fa75af1acb2d9ad593a36a0fe4cb001 | smitha3/graphAlgo | /Source.cpp | C++ | cpp | 2,433 | no_license |
#include<iostream>
#include <list>
#include <queue>
using namespace std;
# define INF 0x3f3f3f3f
typedef pair<int, int> iPair;
class Graph
{
int V;
list< pair<int, int> >* adj;
public:
Graph(int V); // Constructor
// function to add an edge to graph
void insertEdg... |
128476a69fb9ab6653b2edeb67a0aea74f60a84a | 7ec172467802ca01d6dabac228c0eed6f72b225f | MiguelRavello/Discretas3 | /escitala.cpp | C++ | cpp | 1,998 | no_license | #include<iostream>
#include<string>
using namespace std;
string encripto(string &xs,int row){
string* grupos=new string[row];
int i=0;
bool estado=false;//desenso
for(string::iterator it=xs.begin();it!=xs.end();it++){
if(estado){//true ascende
grupos[i]+=*it;
i--;
if(... |
662e49771e55d0a8b1feca7e4f2405ab6a764118 | 571686150b36b87ad4b6b19e00b7bb22659f2d22 | muhammadali493/Competitive-coding | /20140506/b.cpp | C++ | cpp | 1,096 | no_license | #include <bits/stdc++.h>
using namespace std;
const int N = 1 << 11;
int current[N], last[N];
int solve(int m, int n) {
memset(last, 0, sizeof last);
for (int i = 1; i <= m; ++i) {
int k = i >> 1, remain = n;
sort(last, last + i - 1); // 对上一轮的结果排序
memset(current, 0, sizeof current);
for (int j =... |
c577c2cc5be5804b46bb4629bd45258fa062929d | cfc976848e265736a6092c19645361900c27ed74 | DerZc/SE-Experiment | /tests/TemplateChecker/example.cpp | C++ | cpp | 880 | no_license | #include <stdio.h>
static int gx = 0;
void *inc_1(void *x_void_ptr)
{
/* increment x to 100 */
int *x_ptr = (int *)x_void_ptr;
for(int i = 0; i<100; i++)
{
++(*x_ptr);
gx++;
}
printf("x increment finished\n");
/* the function must return something - NULL will do */
... |
a11baaffe8f06686308bcedc08ceb790c551b314 | ca1c2222b6b1afc30f5a870a7ada502a6084df6f | monad-one/chromium | /components/reading_list/core/reading_list_model_impl.cc | C++ | cc | 22,554 | permissive | // Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/reading_list/core/reading_list_model_impl.h"
#include "base/check_is_test.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/f... |
77c7bd46eb44c90095a397f94482fc8d7800eb67 | 4d854f9f15e6d95986810a6e553053d0731ad4e2 | sibStephen/phantomjs | /src/filesystem.cpp | C++ | cpp | 14,668 | permissive | /*
This file is part of the PhantomJS project from Ofi Labs.
Copyright (C) 2011 Ivan De Marino <ivan.de.marino@gmail.com>
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 r... |
8451b4fedeaa22ecc6056592aae4a5d35ed5d798 | 8248fd82115213df6b15a873675666354d7f0220 | Shantnu12345/Astar | /src/main.cpp | C++ | cpp | 594 | no_license | //Author: Shantnu Kakkar
#include "Planner.h"
#include <fstream>
void to_csv(vector<State> const& path){
std::ofstream ofs("Path.csv");
ofs << "x,y" << std::endl;
for(auto const& point:path){
ofs << point.x << "," << point.y << endl;
}
}
int main() {
State start(0.0f, 0.0f, 0.0f);
Sta... |
083368f3ca30a9682e8906376a97b701841754d1 | bdc84b7a153b7ac9c3622c6da3c05526cf0234bb | torarvid/gecko-dev | /gfx/skia/src/image/SkSurface_Picture.cpp | C++ | cpp | 2,694 | permissive | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkSurface_Base.h"
#include "SkCanvas.h"
#include "SkImagePriv.h"
#include "SkPicture.h"
/**
* What does it mean to ask for more than one canvas from a picture?
*... |
deabecaeeafbec4104920d6bea3aad38e7871633 | b4984fbee3c581ebe5e58214e8bd04646b36fcb5 | vandermerwewaj/RED4ext.SDK | /include/RED4ext/Scripting/Natives/Generated/game/data/AIActionSecurityAreaType_Record.hpp | C++ | hpp | 706 | permissive | #pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/Scripting/Natives/Generated/game/data/TweakDBRecord.hpp>
namespace RED4ext
{
namespace game::data {
struct AIActionSecurityAreaType_Record : game::data::TweakDBRecord
{
stati... |
429f2a6ee2a8c4df42a2cedefd889adf4d006aea | fec4704b943362a0ccc7688803db1cf97ddeaa52 | flyingalex/cpp_lox | /test.cpp | C++ | cpp | 782 | permissive |
#include <iostream>
#include <string>
#include <memory>
#include <map>
#include <algorithm>
#include <exception>
#include <vector>
using std::cout;
using std::endl;
using std::shared_ptr;
using std::string;
using std::map;
using std::vector;
class Foo {
public:
int foo;
explicit Foo(int foo_);
string fo... |
bcf4acb77c58e1aeb815313e063749a0c670cd82 | 88b4752e6b76bdbc1070e12afba364a49a69feed | KhronosGroup/webcl-clang-dev | /test/CXX/temp/temp.res/temp.dep/p3.cpp | C++ | cpp | 591 | permissive | // RUN: %clang_cc1 -fsyntax-only -verify %s
// expected-no-diagnostics
struct A0 {
struct K { };
};
template <typename T> struct B0: A0 {
static void f() {
K k;
}
};
namespace E1 {
typedef double A;
template<class T> class B {
typedef int A;
};
template<class T>
struct X : B<T> {
A* b... |
a019d4263c99bfb9d697cbc723906f80724fd2a4 | da46742044138fd4dda2582f640037edec406eb3 | njrafi/Competitive-Programming-Solutions | /CodeForces/101655B - Bones’s Battery - 40942047.cpp | C++ | cpp | 3,455 | no_license | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define gc getchar
#define pc putchar
#else
#define gc getchar_unlocked
#define pc putchar_unlocked
#endif
using namespace std;
#define vi vector<int>
#define si set<int>
#define vs vector<string>
#define pii pair<int, int>
#define vpi vector<pii>
#define pri priority_queue... |
c5bf6c94a6fe9005a86a943d8051da9e36056d5b | ba195b43c6221f98b20298491c4c9698ddde1912 | praduk/cfd_demoAdjoint | /grid.cc | C++ | cc | 1,701 | permissive | /*
* grid.cc
*
* Copyright (c) 2018 Pradu Kannan. All rights reserved.
*/
#include "grid.hh"
#include "mempool.hh"
State FreeStream = { 290.0, 101325, 1.22, 0, 300.0 };
MemPool<InteriorNode, 1<<16 > iNodeMem;
MemPool<LeafNode, 1<<18 > lNodeMem;
Grid grid;
void LeafNode::calcNeighbors()
{
if( containsBody() )
... |
bb247f438e97a9c11266796267b47b1af4f45fd3 | e1715c0130a0c84bc768359d8fd79284b40009ae | AaronNGray/GenomeWorkbench | /src/algo/sequence/gene_model.cpp | C++ | cpp | 178,037 | permissive | /* $Id: gene_model.cpp 592639 2019-09-05 15:02:54Z mozese2 $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government W... |
169220f5b4dc8f96d5504f4548db4bd98ec0a819 | f8eb13a86493f6c9d5e911aa14194d3638b913bc | Jonathonfidiam/GameDevMath_Vectors | /vector/Vector.cpp | C++ | cpp | 2,517 | no_license | #include "pch.h"
#include "Vector.h"
unsigned int Vector::length() {
return sqrt(x * x + y * y);
}
void Vector::addVector(const Vector v1) {
x += v1.getX();
y += v1.getY();
}
void Vector::operator=(const Vector& v1) {
this->x = v1.getX();
this->y = v1.getY();
}
Vector operator-(const Vector& v1, const Vector& ... |
fa8e417f2d7d8e08445170c379662e543e7c60b9 | f243de1e36c4cc742e4ca81b8b3c89e044006828 | mcanthony/PatchComparison | /Tests/DiffusionDistanceTest.cpp | C++ | cpp | 1,107 | no_license | #include <iostream>
#include <vector>
#include "DiffusionDistance.h"
#include "Helpers.h"
int main()
{
std::vector<Eigen::VectorXf> allPoints;
unsigned int numberOfFeatures = 6;
// Add many points that are close to each other
for(unsigned int patchId = 0; patchId < 30; ++patchId)
{
Eigen::VectorXf poin... |
e6b180404a4096b0102eb1161e5518383c58ad1f | fe375bf69b10f5940289e74c51279a045b66a2a0 | PCC-UIUC/chrome_quic | /quic/quic_session.cc | C++ | cc | 26,332 | no_license | // Copyright (c) 2012 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 "net/quic/quic_session.h"
#include "base/stl_util.h"
#include "net/quic/crypto/proof_verifier.h"
#include "net/quic/quic_connection.h"
#incl... |
3fa87ea9ec29f9a8f7514545c4785f40991cd2a1 | 1fab04962989083c98fbc3e250a5af811b2a646e | achuwilson/perception_blort | /blort_ros/src/nodes/detector_node.cpp | C++ | cpp | 7,123 | no_license | /*
* Software License Agreement (Modified BSD License)
*
* Copyright (c) 2012, PAL Robotics, S.L.
* 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... |
254478b71559cf6ba7c690a6831ddf1dc95dd49a | 2a92385184b5157b2ed99ff508b0cd0b588f9073 | vanekk95/system_programming | /dll_injection/dll_injection/patching.cpp | C++ | cpp | 3,604 | no_license | #include "patching.h"
unsigned char loop[] = {
0x90, // loop: nop
0x90, // nop
0x90, // nop
0x90, // nop
0x90, // nop
0xEB, 0xF9 // jmp loop
};
unsigned char get_base_image[] = {
0x65, 0x4C, 0x8B, 0x24, 0x25, 0x60, 0x00, 0x00, 0x00, // mov r12, gs:[0x60] ;peb
0x4D, 0x8B, 0x64, ... |
8db77e97e7fb59c509dc5b8375f70f96bbbe6855 | eb472f054ef53fe7d05e464e0b7dd46bb1cd9440 | kifish/prac_code | /gallery/百炼oj/2016年计算机科学技术研究所优秀大学生夏令营上机考试.cpp | C++ | cpp | 285 | no_license | //A.
#include<cstdio>
int main(){
int n,m;
int sum;
while(scanf("%d %d",&m,&n)!=EOF){
sum=0;
for(int i=m;i<=n;i++){
if(i%17==0) sum+=i;
}
printf("%d",sum);
}
return 0;
}
//http://bailian.openjudge.cn/jssxly2016/A/
|
7623f285de3f5424a9de827802e8f1599be767a2 | f77aa03d1c117870afe7aa9c302af59e1147f857 | gosoares/Uri-Solutions | /Iniciante/1175.cpp | C++ | cpp | 358 | no_license | #include <iostream>
using namespace std;
int main() {
int n[20], i, aux;
for(i = 0; i < 20; i++)
cin >> n[i];
for(i = 0; i < 10; i++){
aux = n[i];
n[i] = n[19 - i];
n[19 - i] = aux;
}
for(i = 0; i < 20; i++)
cout << "N[" << i << "] = " ... |
fa3feba08174992b9b049a9a057fa64e721fb46c | 691d129495e7981fc2f222d6d6a52abe77983199 | TonyCrane/OI | /Exam/19-11-14/Tony_Wong/pie.cpp | C++ | cpp | 481 | permissive | #include <bits/stdc++.h>
using namespace std;
inline int read() {
int x = 0, f = 1; char ch = getchar();
while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }
while (isdigit(ch)) { x = x * 10 + ch - 48; ch = getchar(); }
return x * f;
}
const int maxn = 2010;
const int mod = 1e9 + 9;
int ans, n, k, a[... |
10ad81d966e643e46c3f995983e3baa56e56075f | b9c3f0888e624ec500acd44c83f64ef641573447 | avinashw50w/Coding-problems | /Graph theory/Graph - nitish and magic spells.cpp | C++ | cpp | 1,450 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long int ll;
const int MAXN = 10002;
const int INF = (1<<30);
vi vist, order, Rank;
vector<int> G[MAXN];
int N, M, K;
int C[MAXN];
ll dp[MAXN][303];
void init() {
vist.clear();
order.clear();
Rank.clear();
for(int i=0;i<N;++i) G[... |
902b34cce2120c8e5c3bb3cfd9a7a8f56635c1ed | 1c66ae2ac3c56e6f8004b18e2ba2097eace202b5 | peacebytrade/peacebytrade | /src/qt/paymentserver.cpp | C++ | cpp | 4,518 | permissive | // Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QApplication>
#include "paymentserver.h"
#include "guiconstants.h"
#include "ui_interface.h"
#include "util.h"
#i... |
16aa0f86dcd77ed8310f7d0abe5b1e0f03044eb9 | 2c34cd3693627ff4b5edbf1fb4e8670f495add5f | moteesh-in2tive/chromium | /chrome/browser/ash/input_method/native_input_method_engine.cc | C++ | cc | 39,960 | 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/ash/input_method/native_input_method_engine.h"
#include <utility>
#include "ash/constants/ash_features.h"
#include "ash/constan... |
3c137f69434b6e010cad807bdd322d62e0e2bec5 | 5ec75fe12b0374cdaa8752949a85b49c80de1920 | connectthefuture/psdmrepo | /pypdsdata/tags/V00-00-17/pyext/DataObjectFactory.cpp | C++ | cpp | 8,261 | no_license | //--------------------------------------------------------------------------
// File and Version Information:
// $Id$
//
// Description:
// Class DataObjectFactory...
//
// Author List:
// Andrei Salnikov
//
//------------------------------------------------------------------------
//-----------------------
// T... |
ccc682812c35390fafdaf89fab77c46adb4f3ef3 | f1cc0b0192c5471acf0ccd50144647103f7b19eb | XRay3D/MAN2_GUI | /mainwindow.cpp | C++ | cpp | 2,959 | no_license | #include "mainwindow.h"
#include "settings.h"
#include <QLineEdit>
#include <QMessageBox>
#include <QSerialPortInfo>
#include "devicemodel.h"
#include "sernummodel.h"
MainWindow::MainWindow(QWidget* parent)
: QMainWindow(parent)
, m_statusBarTimer(0)
, statusBarTime(new QLineEdit(this))
{
new DeviceM... |
91541e353671b2d923658a694ca59ecb349c68a3 | c64c891e35e114f0ffc1f875f6072ba7d3c804e9 | sengeiou/android-nn-driver | /ArmnnPreparedModel_1_2.hpp | C++ | hpp | 7,175 | permissive | //
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include "ArmnnDriver.hpp"
#include "ArmnnDriverImpl.hpp"
#include "RequestThread.hpp"
#include "ModelToINetworkConverter.hpp"
#include <NeuralNetworks.h>
#include <armnn/ArmNN.hpp>
#include <armnn/Threadpool.hpp>
#... |
d52c45a6f933e73885d17c9f8ef7685494da5ad2 | d3f04cafae80643f3295ff3ebf24daa112a70bab | winnerineast/pytorch-vision | /torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp | C++ | cpp | 34,298 | permissive | /*!
******************* BEGIN Caffe Copyright Notice and Disclaimer
*****************
*
* COPYRIGHT
*
* All contributions by the University of California:
* Copyright (c) 2014-2017 The Regents of the University of California (Regents)
* All rights reserved.
*
* All other contributions:
* Copyright (c) 2014-2... |
fe04419cb95e4b1fd40f7af90cf94acc872779bf | 42d6495786041ebb4b897a1c0d574d1ac5f843ef | lardratboy/thevoid | /thevoidView.cpp | C++ | cpp | 4,314 | permissive | // thevoidView.cpp : implementation of the CThevoidView class
//
#include "stdafx.h"
#include "thevoid.h"
#include "thevoidDoc.h"
#include "thevoidView.h"
#include "ListWindowsDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////... |
d2e1f6624b76ed838e13971ea596098768360811 | 875afe0968033152d1f5cc3458a0ef82aac79adb | fabiogaluppo/samples | /events/qconsp2017/code/sample-6/inject2.hpp | C++ | hpp | 6,361 | no_license | //Sample provided by Fabio Galuppo
//April 2017
#ifndef INJECT2_HPP
#define INJECT2_HPP
#include <zmq.hpp>
#include "zmq_utils.hpp"
#include "socket_pair.hpp"
#include "socket_pair_ops.hpp"
#include <chrono>
#include <thread>
#include <atomic>
#include <vector>
#include <array>
#include <iostream>
#include <iomani... |
982c920757f72b313faae19d93570f0d95ce7bf8 | 040bdf216183a1d534190ddd96d190b42da467b3 | rengdjim/Programming-Principles-and-Practice-Using-C- | /14/ex15.cpp | C++ | cpp | 1,416 | no_license | /* Chapter 14 Exercise 15
Most class hierarchies have nothing to do with graphics. Define a class Iterator with a pure virtual function next() that returns
a double* (see Chapter 17). Now derive Vector_iterator and List_iterator from Iterator so that next() for a Vector_iterator yields
a pointer to the next element o... |
dadcf44736571f076c6c4060dceb778a70a8f4c0 | dfdaaf0c5fac95e5624d3e766d12576d317c5106 | cms-sw/cmssw | /DQM/SiOuterTracker/plugins/OuterTrackerMonitorTTTrack.cc | C++ | cc | 36,197 | permissive | // Package: SiOuterTracker
// Class: SiOuterTracker
//
// Original Author: Isis Marina Van Parijs
// Modified by: Emily MacDonald (emily.kaelyn.macdonald@cern.ch)
// system include files
#include <memory>
#include <numeric>
#include <string>
#include <vector>
#include <bitset>
// user include files
#include ... |
95cc67f0dd0c48dcabf67e73c95e5673d6e31ef4 | 63a4a15488fa2f00ab13bd4060eb686d4a16c7c8 | jeffamstutz/boost.simd | /include/boost/simd/function/scalar/shr.hpp | C++ | hpp | 605 | permissive | //==================================================================================================
/**
Copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
**/
//====================================... |
c1b216912eed63ab030984811a89304986469b32 | 9dcbdbca0c29abc57c4a7831e88cd64dcff8dbf8 | bxh7425014/BookCode | /CppPrimer4th/5/vec_init.cpp | C++ | cpp | 2,194 | no_license | /*
* This file contains code from "C++ Primer, Fourth Edition", by Stanley B.
* Lippman, Jose Lajoie, and Barbara E. Moo, and is covered under the
* copyright and warranty notices given in that book:
*
* "Copyright (c) 2005 by Objectwrite, Inc., Jose Lajoie, and Barbara E. Moo."
*
*
* "The authors and publis... |
627190444cdc021dc11d9cc40081ee9147aa0e56 | 9f2a2e536884e5145aa8fdd0442fcabd2cc69084 | dk1978/serialization | /include/boost/serialization/collections_save_imp.hpp | C++ | hpp | 2,352 | no_license | #ifndef BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP
#define BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// collections_save_imp.hpp: serializati... |
447e66f6548bba790a7d6e34a4863f14ece13ffb | 96a86f406c9dc92e353ef99defba60c0a0ffd8e1 | tmpsantos/chromium | /chromeos/cryptohome/homedir_methods_unittest.cc | C++ | cc | 6,454 | permissive | // Copyright 2014 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 "chromeos/cryptohome/homedir_methods.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base... |
bae21b81e20e80536214dcaf73b41b3123ab6b33 | 3d0ca820b5fbbb5182cd95c836abf517b70c7747 | JakubStraszkiewicz/MultiplayerGameProject | /ProgramowanieRozproszoneKlient/ProgramowanieRozproszoneKlient/Game.cpp | C++ | cpp | 5,928 | no_license | #include "Game.hpp"
Game::Game(RenderWindow* window, MainMenu* menu, int maxPlayers, int *myIndex, Bullet *bulletToSend, vector<Bullet*> *bullets, Mutex *bulletsToSendMutex, Mutex* sendFlagMutex, Mutex *playerMutex, Mutex *gameStateMutex)
{
this->bulletsToSendMutex = bulletsToSendMutex;
this->gameStateMutex = gameSt... |
a8d1eb00f91605f7dcf6bcb113c10ff6df13a380 | b7b157163a00c971f699cb23ce793cbceac8694f | aydar-sheffield/Chaste | /linalg/src/FourthOrderTensor.hpp | C++ | hpp | 12,419 | permissive | /*
Copyright (c) 2005-2019, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
2824855c61337137905c3f7e47295673fb99370e | aa1851b31e52d61fa9c640b9ccc82e5a70ab1a08 | rbgorbet/Hylozoic-Series-3 | /Software/libraries/Series3Common/rawhid_communicator.cpp | C++ | cpp | 1,250 | no_license | #include "rawhid_communicator.h"
void RawHIDCommunicator::init(){
unsigned long clearing_counter = 0;
while (receive_msg()){
// this prevents the Teensy from being stuck in infinite loop
clearing_counter++;
if (clearing_counter>10){
break;
}
}
}
//=================================... |
7d569d3d27d3533dbd703c097178428866c0c84b | a8e65e4bfb8114c1e831d4dfa985f0e550abc862 | yang123vc/Mednafen-Core | /mednafen/pce_fast/huc.cpp | C++ | cpp | 9,085 | no_license | /* Mednafen - Multi-system Emulator
*
* Portions of this file Copyright (C) 2004 Ki
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your optio... |
caf78583de3af744d514960ea0108fe4af07f805 | efa7b15e8982a709bdcec35948d3b5b4e2cbe645 | KMtheStarter/algo-study | /N과M/15657 N과 M(8).cpp | C++ | cpp | 845 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, M;
vector<int> seq;
vector<int> list;
// 백트래킹 기법
void func() {
int size = seq.size();
if (size == M) {
for (int i = 0; i < M - 1; i++){
if(seq[i] > seq[i + 1])
return;
}
... |
b62f562c417bf8af95bc1b808d3e6937beb3c579 | ecb2e7522553bd22507f4876b9fa8190ef6e3e76 | MPDR200011/CAL_FEUP | /cal_fp01/src/Test.cpp | C++ | cpp | 2,263 | no_license | #include "Defs.h"
#include "Factorial.h"
#include "Change.h"
#include "Sum.h"
#include "Partitioning.h"
#include "cute/cute.h"
#include "cute/ide_listener.h"
#include "cute/xml_listener.h"
#include "cute/cute_runner.h"
void factorialTest()
{
ASSERT_EQUAL(120,factorialRecurs(5));
ASSERT_E... |
9c0215f01af351bb3bf149b44c24b515a05a34ab | d47c0906cbf7351560f60fae0fdecdd9721bab46 | sreedhr92/Leetcode-Submissions | /codes/accepted_codes/Number of Submatrices That Sum to Target_482071518.cpp | C++ | cpp | 882 | no_license | class Solution {
public:
int numSubmatrixSumTarget(vector<vector<int>>& A, int target) {
int res = 0, m = size(A), n = size(A[0]);
for (int row = 0; row < m; row++)
for (int col = 1; col < n; col++)
A[row][col] += A[row][col - 1];
// cursum, occurences
unordered_map<int, ... |
5c43d9df6d2c5d4aceafe0afade04c2e0bcfb3e7 | 82dbac1a2db90525634b153abb27b4a4cd51740b | hedbergj/OpenSpace | /modules/skybrowser/src/wwtcommunicator.cpp | C++ | cpp | 12,854 | permissive | /*****************************************************************************************
* *
* OpenSpace *
* ... |
0b4f2faf9be784691f7f44816c407fe3771477ae | 62c5a6f727b8551b14619306078c2a31dc57dcf8 | jjy192219/JingyingJiang_OFanimation2015 | /w03_h02_lookAtMe/src/arrow.cpp | C++ | cpp | 762 | no_license | //
// arrow.cpp
// w03_B_lookAtMe
//
// Created by Eric Jiang on 2/24/15.
//
//
#include "arrow.h"
void Arrow::setup() {
pos.set(0);
}
void Arrow::update(float _x, float _y) {
ofVec2f newPos;
newPos.set(_x, _y);
pos = (pos * 0.97 + newPos *0.03);
}
void Arrow::rotation(float _x... |
0ba47a93ea8f0ec34b66d3edcb9d9c6d8ad4918a | 4a1e5a07f2f9a9fe14a2a3902120d582e49fd503 | samaelsacred/Wow-4.3.4 | /src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp | C++ | cpp | 3,048 | no_license | /*
* Copyright (C) 2015 DevKM <http://facebook.com/krizttianmoreno>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* 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 Fou... |
e2df0710b1f0e6627e7cdba619b2f55abf279d7b | 6f4dacfdb5cdc878a0b22f55484c57adf6881fca | djsona12/ProgramsInUndergrad | /ACM/gcj/coinsgame.cpp | C++ | cpp | 479 | no_license | #include <algorithm>
#include <cstdio>
int calc(int N, int K, int C){
int sum = K / N * N;
if(sum >= C)
return C;
int ret = 0;
C -= sum;
ret += sum;
K -= sum;
ret += N - K;
ret += C;
return ret;
}
int main(){
int T, caseCnt = 0;
scanf("%d", &T);
while(T --){
int N, C, K;
scanf("%d%d%d", &N, &K, &C);
... |
ece23b489db4924c5e1900fa09124bbfed892eca | a43c64c6570fd339dfed27dd7dd46bbfbffc23cd | KevinMathewT/Competitive-Programming | /SelectTrainingSet.cpp | C++ | cpp | 986 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
// Kevin Mathew T
// Birla Institute of Technology, Mesra
// GitHub - https://github.com/KevinMathewT
// CodeForces - https://codeforces.com/profile/KevinMathew
// CodeChef - https://www.codechef.com/users/KevinMathew
// HackerRank ... |
e9f1c798bb20c525f288b850bed7d763030c7edc | 9f5c5f3cefef09b55d56a223b96e2b7836698493 | JFrandon/Romain-Boat-Arduino | /boat.cpp | C++ | cpp | 3,107 | no_license | #include <stdlib.h>
#include <stdio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <Adafruit_MMA8451.h>
#include <Adafruit_Sensor.h>
#define DELAY 500
#define DATASIZE 100
Adafruit_MMA8451 mma = Adafruit_MMA8451();
int i;
File data;
void setup(void) {
// Open serial communications and wait for port... |
71dd0efd2ce0bc1ead5c51d507d39806606f25ba | acfde7d8bd0bb6a46301a21ed0d0b7f713b266b8 | LevyForchh/llvm-project | /clang/lib/Driver/Distro.cpp | C++ | cpp | 6,748 | permissive | //===--- Distro.cpp - Linux distribution detection support ------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
26407b6a5e1e3e409fb370fe058ac0667eae75dc | 88c9f70780bc09462e5084cc186a52203cbd2dec | Ottabotics-IARC17/XUDroidLibrary | /main.cpp | C++ | cpp | 670 | no_license | #include "main.h"
#include "SerialPort.cpp"
#include <stdio.h>
/*
* "What should I name the library" - Brennan
* "Name it Daddy" - Someone who regrets what they said
*/
class Daddy {
private:
char* port_name = "\\\\.\\COM2";
bool connected = false;
SerialPort arduino;
public:
void tryConnect(){
... |
a7ff27a35f3142b21907e9d85142da23f1f8182b | 3dad361f15d4cd4387afbf65b506d913d581e047 | CU-0xff/juliet-cpp | /000/095/779/CWE36_Absolute_Path_Traversal__char_console_fopen_02.cpp | C++ | cpp | 4,465 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE36_Absolute_Path_Traversal__char_console_fopen_02.cpp
Label Definition File: CWE36_Absolute_Path_Traversal.label.xml
Template File: sources-sink-02.tmpl.cpp
*/
/*
* @description
* CWE: 36 Absolute Path Traversal
* BadSource: console Read input from the console
* Good... |
0c591b9ff7c3a4c2e2eb2815b19540e5612c9cb1 | a7aa39c40180215955ec46d2c1d347cfd8d67732 | ArensKyle/MachineLearningCS6037 | /GroupProject/Code/Sample_Programs/Heap_Sort.cpp | C++ | cpp | 888 | no_license | // C program for implementation of heap sort
#include <stdio.h>
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
void heapify(int arr[], int n, int i)
{
int largest = i;
int l = 2*i + 1;
int r = 2*i + 2;
if (l < n && arr[l] > arr[largest])
largest = l;
... |
e224af2485302eace2b1480c1eaa266f6c780b75 | 4e24e170ea6612d1190cdb251b76e520940fa4c8 | krantirk/Algorithms-and-code-for-competitive-programming. | /online_judges/Codeforces/363/C/code.cpp | C++ | cpp | 830 | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
int a[n];
for(int i = 0; i < n; i++) scanf("%d", &a[i]);
int ans = 0;
for(int i = 0; i < n; i++) {
if(i == 0 && a[i] != 0) ans++;
else {
if(a[i] == 1 && (a[i-1] != 1)) ... |
ef7921e778e26753bb9d9f1025acebde12ad25d2 | f34deaca1ea6cbdd01aad5a549833a91607a2c63 | shincekbaby/beingpro | /lab4_q4.cpp | C++ | cpp | 453 | no_license | //include the library
#include<iostream>
using namespace std;
//write main
int main()
{cout<<"\n{NOTE: It is arbitrarily chosen that a year=365 days}";
//declare varibles
int d,y,w,D;
//ask for no of days
cout<<"\n Enter number of days to convert it into years weeks and days\n";
cin>>d;
//calculate no of years week... |
06acfcbe1b71c49cbfb565450ae5f989fcb8ee4f | 3082a42271c350b0a0dedd4e9cb59bfa94365c40 | baaaam771/algorithm | /DFS.cpp | C++ | cpp | 1,116 | no_license | #include <stdio.h>
#include <malloc.h>
int n, m;
int ** e, * q;
int * visited, count = 0;
void DFS(int s);
void aDFS(int s);
int main(void) {
int x, y, s;
scanf("%d", &n);
scanf("%d", &m);
n++;
q = (int*)malloc(sizeof(int) * n-1);
e = (int**)malloc(sizeof(int*) * n);
for(int i=0; i < n; ... |
d77916b7e5d64aaf34060ad5763bc9d9da756602 | 4d6abf4650adf692dff94e7a8cf68a3c6ef4279a | Asrasadik/Cpp-crash-course | /4. Polymorphism/1. Compile time/2. Operator overloading/Unary/Complex2.cpp | C++ | cpp | 599 | no_license | #include<iostream>
using namespace std;
class Complex{
int real,imag;
public:
void print(){
if(imag>=0)
cout<<real<<"+"<<imag<<"j"<<endl;
else
cout<<real<<imag<<"j"<<endl;
}
void operator ++(){ //overloading operator
real++;
imag++;
}
void operator ++(int){ //overloading operator
++rea... |
3ad2b36948bc77318248648c7442c48c30f59575 | 920bf36a83cfa137904c3ad81cf89fc660f62650 | schnorr/phenovisr | /src/metrics.cpp | C++ | cpp | 1,242 | no_license | #include "metrics.h"
int is_black (rgb RGB) {
return !(RGB.r + RGB.g + RGB.b);
}
rgb get_rgb_for_pixel(int pixel, image_t *image) {
unsigned char *iimage = image->image;
unsigned char r = iimage[pixel];
unsigned char g = iimage[pixel + 1];
unsigned char b = iimage[pixel + 2];
rgb RGB = {(double)r / 255, ... |
8be21c2903e5aac4ee3a1058288ef81b4443a7b9 | 3f09e1b06add985152171ad2c0344087a3f2591a | tianzhuoaza/hpc_in-memory | /all-transports/adios-all/lammps-adios/lammps_mpiio_con.cpp | C++ | cpp | 7,006 | permissive | /*
* ADIOS is freely available under the terms of the BSD license described
* in the COPYING file in the top level directory of this source distribution.
*
* Copyright (c) 2008 - 2009. UT-BATTELLE, LLC. All rights reserved.
*/
/* ADIOS C Example: read global arrays from a BP file
*
* This code is using the ge... |
70a7bed507721ae09f72e4a1d967c939e78117f3 | 01a7f583d6ff45e9a24d884797fdad00a984fe4b | saga-project/saga-cpp-legacy-projects | /applications/MapReduce/branches/MapReduce.terasort/external/boost-log/boost/log/sinks/threading_models.hpp | C++ | hpp | 2,331 | permissive | /*
* (C) 2007 Andrey Semashev
*
* Use, modification and distribution is subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
* This header is the Boost.Log library implementation, see the library documentation
* at http://... |
32f0f96cb088f94a3c98c3eb6438fe0a3ec3e374 | c68f6775967481b940041ab6c853b33702e34577 | meniossin/src | /third_party/blink/renderer/core/frame/performance_monitor.cc | C++ | cc | 12,802 | permissive | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/frame/performance_monitor.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blin... |
dea817b7d1a1633290434d0c682e4448c83ce979 | f65a2ccde2cfa99f4f6d74bbf9ac1a0c1752cb25 | wehnersteffensielaff/CPPWebFramework | /CPPWebFramework/cwf/metaclassparser.cpp | C++ | cpp | 2,040 | permissive | /*
Copyright 2017 Herik Lima de Castro and Marcelo Medeiros Eler
Distributed under MIT license, or public domain if desired and
recognized in your jurisdiction.
See file LICENSE for detail.
*/
#include "metaclassparser.h"
CWF_BEGIN_NAMESPACE
MetaClassParser::MetaClassParser(QObject *object)
{
co... |
04d2b7218547fbec922214aaed312ac942963653 | 2ccbbefe9d188e67bd44568aaf213e7b77ec8b2b | fork-myloti/bde | /groups/bsl/bsls/bsls_compilerfeatures.cpp | C++ | cpp | 1,557 | permissive | // bsls_compilerfeatures.cpp -*-C++-*-
#include <bsls_compilerfeatures.h>
#include <bsls_ident.h>
BSLS_IDENT("$Id$ $CSID$")
#include <bsls_bsltestutil.h> // for testing only
#include <bsls_buildtarget.h> // for testing only
#if defined(BSLS_COMPILERFEATURES_INTIIALIZER_LI... |
6a8d1c46b06da2ba3937ad0d79297560ced5a731 | 95a51675a45c63e5ed3dfae731670c77a4748ad4 | KernelPanic-OpenSource/Win2K3_NT_admin | /snapin/dnsmgr/record.cpp | C++ | cpp | 80,968 | no_license | //+-------------------------------------------------------------------------
//
// Microsoft Windows
//
// Copyright (C) Microsoft Corporation, 1998 - 1999
//
// File: record.cpp
//
//--------------------------------------------------------------------------
#include "preDNSsn.h"
#include <SnapBase.h>
#incl... |
3f595e160dbd98ac6cec6aa58154be4e7c23c30d | a2d5112526e5e2c1f250b08f432018dcf3817e72 | tahsinsoha/Problem-solving- | /Codeforces/vanya and lanterns.cpp | C++ | cpp | 463 | no_license | #include<bits./stdc++.h>
using namespace std;
int main(){
long long n,l,pos;
cin>>n>>l;
long double arr[n+5];
for(long long i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
long double ans = 0;
for(long long i=1;i<n;i++){
ans = max(ans,arr[i]-arr[i-1]);
}
//ans = max (ans, l-arr[n-1]);
long double res;
res = ans/2;
i... |
634cde0777c5efae3cfc1a554f0fa9453abcc395 | a4affdff6bcc3b580ea6d4d3dd2d966c2c1b19d2 | ailyanlu/ACM_Code | /HDU/HDU_4982.cpp | C++ | cpp | 3,184 | no_license | /**
* @file HDU_4982.cpp
* @brief 一个经典的构造问题
* @hint 参考注释
* @feeling 被cha了,郁闷……好在也cha了别人
* @author FinalTheory
* @version 0.1
* @date 2014-08-26
*/
#if defined(__GNUC__)
#pragma GCC optimize ("O2")
#endif
#if defined(_MSC_VER)
#pragma comment(linker, "/STACK:36777216")
#endif
#include <iostream>
#include <s... |
b575ba9fea10908bdd91df8559879cc4b2cfcdea | ae515c70f0af91302b0c4a174cd914629cfc9fdc | voicechain/voicechain | /src/qt/test/rpcnestedtests.cpp | C++ | cpp | 8,242 | permissive | // Copyright (c) 2016 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 "rpcnestedtests.h"
#include "chainparams.h"
#include "consensus/validation.h"
#include "validation.h"
#include "rpc/regi... |
1a864b729c6fbf302fb26343d73d63f7bdf26352 | bb92760a14cab9aec4e98302dd32a13e57074d58 | yangtianqiowen/De-Anza-CIS22A | /jackandjill.cpp | C++ | cpp | 465 | no_license | /*
* Tianqi Yang
* CIS 22A M/W
*/
#include <iostream>
using namespace std;
int main ()
{
int i = 1;
for(i; i <= 150; i++){
if ( i%5==0 && i%7==0){
cout << "Went Up the Hill" <<endl;
}
else if (i%7 == 0){
cout << "Jill" << endl;
}
el... |
0a9c692eb0ae65443b6cbaf5f71e21048b0d7745 | 18f764ff5e15e21fd222c28e2bd9e42d7e2978c7 | asdwb/leetcode | /Dungeon Game/Dungeon Game.cpp | C++ | cpp | 1,102 | no_license | /*
用dp[i][j]表示从(i,j)到(n-1,m-1)时在(i,j)上至少需要多少HP
那么转移方程就是 dp[i][j] = max(min(dp[i+1][j],dp[i][j+1]) - dungeon[i][j],1);
注意在每个点上至少都要有1的生命值
时间复杂度 O(nm)
空间复杂度 O(nm)
*/
class Solution {
public:
int calculateMinimumHP(vector<vector<int>>& dungeon) {
int n = dungeon.size();
int m = dun... |
1370cdc44f704e60e8a6987e49189f0436d63487 | f56ae3358c9263deb4e3bb9993deb67bf751573d | thomas-huet/mapbox-gl-native | /src/mbgl/style/image.cpp | C++ | cpp | 677 | permissive | #include <mbgl/style/image.hpp>
#include <mbgl/style/image_impl.hpp>
#include <mbgl/util/exception.hpp>
namespace mbgl {
namespace style {
Image::Image(std::string id, PremultipliedImage&& image, const float pixelRatio, bool sdf)
: baseImpl(makeMutable<Impl>(std::move(id), std::move(image), pixelRatio, sdf)) {
}
... |
3ad3d986ca63ae872380207ecf1ac5a19585c519 | 36045c52174421201d5bd9f5f50be780647cadaf | berber1016/chromium | /headless/lib/browser/headless_print_manager.cc | C++ | cc | 12,906 | permissive | // Copyright 2017 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 "headless/lib/browser/headless_print_manager.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/memory/ref_counted_memory... |
5b3929933e94904020e21433c22a9ace5873463d | 924b24e40702af158e7cbc9952664dfc156ab4bb | DamianChrzanowski/Train-station-simulator | /sources/transfer_center.hpp | C++ | hpp | 3,533 | no_license | #ifndef TRANSFER_CENTER_H
#define TRANSFER_CENTER_H
#include <random>
#include <atomic>
#include <memory>
#include <ncurses.h>
#include "screen_printer.hpp"
#include "passenger.hpp"
#include "bus.hpp"
#include "subway.hpp"
#include "target.hpp"
#include "place.hpp"
#include "stairs.hpp"
#include "ticket_machine.hpp"... |
083e811be9046a9f57354b1f06011f0878d4a14e | 0f064a885898ebbd17d37f544491557326f486af | edisite01/CP-gateway-integration | /bin/temp/transmitter_6768_old.cpp | C++ | cpp | 55,415 | no_license | /*
COMPILE COMMAND
g++ -o [exe name] [cpp name] -lcurl -I /usr/include/mysql /usr/lib/libmysqlclient_r.so
g++ -o mysql2clients mysql2clients.cpp -lcurl -I /usr/include/mysql /usr/lib/libmysqlclient_r.so
LOCAL VARIABLE NAMING
i - INTEGER
u - UNSIGNED INTEGER
s - STRING
c - CHAR
t - OBJECT/CLASS/DATABAS... |
9788b483f68c95768f3ee7648db6334409fe35ff | 3b791fc989e7b8d33a430001e91c53f566b3d08e | AdrianGuo/MQTT-hc | /Drivers/IO/IO.hpp | C++ | hpp | 3,600 | no_license | /*
* IO.hpp
*
* Created on: Dec 12, 2016
* Author: taho
*/
#ifndef DRIVERS_IO_HPP_
#define DRIVERS_IO_HPP_
#include <Map.hpp>
#include <RTimer.hpp>
#include <Locker.hpp>
#include <LED.hpp>
#include <Button.hpp>
#ifdef MT7688
#define IO_Init() {IO::GetInstance();}
#define Notify(x) {IO::GetInstance()->In... |
be4894b785c13b070e9c52b300309410284ff95a | 8afbd7d563e3c3dd98f7735bc5f1ed9239007665 | cvolo4yzhka/ALPS_n1_zte_a476 | /vendor/mediatek/proprietary/custom/zte_blade_a476_n1_x32/hal/aal/cust_aal.cpp | C++ | cpp | 2,188 | no_license |
extern "C" {
// The LCM number which this project can support
int LCM_COUNT = 1;
// The gamma of LCM
// This value must be configured correctly.
// LcmGamma[0] is for LCM 0, LcmGamma[1] is for LCM 1, ... etc,
// if this project supports multiple LCM.
float LcmGamma[] = { 2.2 };
// ---------------------------------... |
e433958eed2ea16e0486c3c7d3beb528ba8f79d5 | b6f527601585760c266171ebf1acba2905e39700 | fujunwei/chromium-crosswalk | /chrome/browser/safe_browsing/safe_browsing_blocking_page.cc | C++ | cc | 24,322 | permissive | // Copyright (c) 2012 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.
//
// Implementation of the SafeBrowsingBlockingPage class.
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
#include <string>
... |
298dd6bde162a82125e9b00eb58ce3218073366e | 49e7e86a3526f15e23440b3a5ee55f808bcd8541 | tetricas/CorpotationsAI | /src/game_space.cpp | C++ | cpp | 4,414 | no_license | #include "game_space.h"
#include <QImage>
#include <QPoint>
#include <QtDebug>
CGameSpace::CGameSpace(QQuickItem* parent):
QQuickPaintedItem(parent),
m_blockSideSize(1),
m_blocksCount(10),
m_shift(1),
m_iPosX(0),
m_iPosY(0),
m_color(QColor(255, 0, 0, 100)),
m_type(eMT_gold),
m_easyBot(&m_map, QColor(0, 255, ... |
cb65415e67ab2d71731c5a9d63a93f1b6defcf4a | aba6f8450aba299b963204a63987e9dfca4d9f1b | miho/iNumerics | /odeint/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp | C++ | hpp | 2,256 | permissive | /*
[auto_generated]
boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp
[begin_description]
Enable the factory functions for the controller and the dense output of the Rosenbrock4 method.
[end_description]
Copyright 2009-2011 Karsten Ahnert
Copyright 2009-2011 Mario Mulansky
Distributed under ... |
37a17bc16e8a5187de4323a8ba44239a6007b02e | 8d2eb2850bd043853391fc7bd4f4e9b6af7853d4 | pybender/InvisibleTreasure | /test_edgeBlend/src/testApp.cpp | C++ | cpp | 4,519 | permissive | #include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
ofSetFrameRate(60);
ofSetVerticalSync(true);
blender[0].setup(640, 480, 2, 20, ofxProjectorBlend_Horizontal);
blender[0].setWindowToDisplaySize();
blender[1].setup(640, 480, 2... |
057c11b4343133536d082a04a70e628f48750c8b | d84c24f0bd16ff4bdabf751c06a7ff84017a1720 | IAmAnubhavSaini/cryptoAlgorithm-nt5src | /Source/XPSP1/NT/inetsrv/intlwb/kor/register.cxx | C++ | cxx | 17,805 | no_license | //+---------------------------------------------------------------------------
//
// Copyright (C) 1998 - 1999, Microsoft Corporation.
//
// File: Register.cxx
//
// Contents: Self-registration for Word Breaker /Stemmer.
//
// Functions: DllRegisterServer, DllUnregisterServer
//
// History: 12-Jan-98 ... |
01a0622aa31d50d8561d216b0b7c27732f5e3e26 | f698a971a3ab3a7a6629b2f26b9c713343e8cd1a | raywu0123/ICCAD2019-Problem-E | /src/splitLib/splitter.cpp | C++ | cpp | 15,905 | no_license | #include "splitter.h"
#include "sweep_plane.h"
#include "BipGraph.h"
#include "MyGraph.h"
#include "../bLib/bLibRTree.h"
namespace gtl = boost::polygon;
bool Comparator_XY(const pair<Point, Point>& a, const pair<Point, Point>& b) {
if (a.first.x() != b.first.x()) return a.first.x() < b.first.x();
return a.fi... |
6019c33f16f96a8793b08dd1bb4cbede0925390b | e34511875bce21fb9e34b21c7d4ae323a3121acc | projectceladon/dldt | /inference-engine/src/vpu/graph_transformer/include/vpu/graph_transformer.hpp | C++ | hpp | 2,898 | permissive | // Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include <memory>
#include <unordered_map>
#include <set>
#include <utility>
#include <ie_icnn_network.hpp>
#include <vpu/utils/enums.hpp>
#include <vpu/utils/p... |
053be16e340c84ea98c76594b50edfcf2875ebc2 | 268986b65c528b3b38d799734561a30c6bc2cc80 | sxweetlollipop2912/MaCode | /.LHP/.Lop11/.T.Hung/GG_1/DUTCAP/DUTCAP/DUTCAP.cpp | C++ | cpp | 1,313 | permissive | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#define maxN 100001
#define maxM 1000001
#define pA first
#define pB second
typedef long maxn, maxm;
typedef std::pair <maxn, maxn> p_t;
maxn n, A, B, low[maxN], num[maxN], par[maxN], CNT;
maxm m, res;
std::vector <maxn> ad[maxN];
bool a[ma... |
b580f59b0d7c58ef6dc19d7d777cf3bc0632f838 | 81cd4b664e50ba311b1b00cbb674d6f9d830acd4 | Serega2005/CreationalPatterns | /CreationalPatterns/main.cpp | C++ | cpp | 1,977 | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#include<ctime>
using namespace std;
class Singleton
{
static Singleton* instance;
string last_name;
string first_name;
tm birth_date;
protected:
Singleton()
{
cout << "Constructor:\t" << this << endl;
}
~Singleton()
{
cout << "Desturcto... |
50ddec4a73c5cdadae7c709da9d8690bebe08661 | b1d36570930d9c6cf8b56977aa5f59a4947a08a7 | nigomezcr/Programming-Basics | /09-Intro-to-OOP/3-classes.cpp | C++ | cpp | 1,362 | no_license | #include<iostream>
//Define the class
class Fractional
{
public:
int m_num {0};
int m_den {1};
void print()
{
std::cout << m_num << "/" << m_den << std::endl;
}
Fractional operator+(const Fractional & f2);
Fractional operator-(const Fractional & f2);
Fractional operator*(const... |
9e0ec26be08bb9b6fca5569cf60a516c3f9a0930 | 0f93131cadefd10dc3a4ffcd50840630b154cf03 | cjang/chai | /Random123/R123Philox.cpp | C++ | cpp | 16,831 | permissive | // Copyright 2012 Chris Jang (fastkor@gmail.com) under The Artistic License 2.0
//
// This code is derived from the R123Philox library version 1.06 .
//
// The design of the R123Philox library relies on compile-time metaprogramming
// using the C preprocessor and awk. This is fine for static compilation. It is
// impra... |
daa834e72d0450ec5f860ad8c97b210590f2d24b | 3a81333889f022ea6a7cc5577620ca10202af96b | isabella232/stdcxx | /examples/manual/strstreambuf.cpp | C++ | cpp | 3,136 | permissive | /***************************************************************************
*
* strstreambuf.cpp - strstreambuf example.
*
* $Id$
*
***************************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreeme... |
48b2990db01c3c46161ed600247087d4ed467a14 | 8e1654e07f7d8dc0fe60cdb078295f459a5c8bca | clevertrack1/mbed-os | /TEST_APPS/device/exampleapp/main.cpp | C++ | cpp | 2,055 | permissive | /*
* Copyright (c) 2018 ARM Limited. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
* 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.