blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 117 | path stringlengths 3 268 | src_encoding stringclasses 34
values | length_bytes int64 6 4.23M | score float64 2.52 5.19 | int_score int64 3 5 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | text stringlengths 13 4.23M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
ae0501e6bdd16b20326bacf4ccac66caa576e710 | C++ | NHERI-SimCenter/smelt | /src/beta_dist.cc | UTF-8 | 911 | 2.625 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | #include <vector>
#include <boost/math/distributions/beta.hpp>
#include "beta_dist.h"
stochastic::BetaDistribution::BetaDistribution(double alpha, double beta)
: Distribution(),
alpha_{alpha},
beta_{beta},
distribution_{alpha, beta_}
{}
std::vector<double> stochastic::BetaDistribution::cumulative_dist_f... | true |
b030261a235273d8c6e2c0a3530b68b4c5dce7c3 | C++ | SlawomirKwiatkowski/Arkanoid | /CMapEditorState.cpp | UTF-8 | 4,619 | 2.71875 | 3 | [] | no_license | #include "CMapEditorState.h"
CMapEditorState::CMapEditorState(RenderWindow* window, stack<CState*>* states)
:CState(window,states)
{
background.setSize(Vector2f(window->getSize().x, window->getSize().y));
background.setFillColor(Color::Black);
initBlock();
}
CMapEditorState::~CMapEditorState()
{
saveToFile();
... | true |
94f87e6c25245c10f9e2cbadcc3e5f3b8717084b | C++ | brandonRichardson/uml-acm-games | /game_engine/Player.h | UTF-8 | 865 | 3.015625 | 3 | [] | no_license | /*
* File: Player.h
* Author: J. Madden
*
* Created on February 8, 2013, 12:16 PM
*/
#ifndef PLAYER_H
#define PLAYER_H
/*
* TODO: A lot, most of which is not doable until
* we decide where we're going with this project.
*/
#include <string>
#include "stats.h"
#include "Inventory.h"
#inc... | true |
48dc441488f53b1a9ce2193170c37dd7fbc167e3 | C++ | minhazmiraz/Codeforces_AC_Submission | /900A[Find_Extra_One].cpp | UTF-8 | 285 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,neg=0,pos=0;
cin>>n;
for(int i=1;i<=n;i++){
int a,b;
cin>>a>>b;
if(a<0)
neg++;
if(a>0)
pos++;
}
if(neg<=1 || pos<=1)
cout<<"Yes\n";
else
cout<<"No\n";
return 0;
}
/*
Powered by Buggy plugin
*/ | true |
f1cf218d1762e464ef333dbf40c472c9163f1fa6 | C++ | grtushar/LightOJ | /loj1374_BNUOJ_13220_confusion_in_the_problemset.cpp | UTF-8 | 837 | 2.625 | 3 | [] | no_license | using namespace std;
#include<iostream>
#include<cstdio>
#include<cstring>
int count[1000010];
int main()
{
long long int arr[10010];
int T,n,Case=1,i,flag;
scanf("%d",&T);
while(T--)
{
memset(count,0,sizeof(count));
scanf("%d",&n);
for(i=0;i<n;i++)
{
... | true |
4ea2708811cd44926a0a7892170faea4349e6489 | C++ | cxwcfea/uva-code | /232.cpp | UTF-8 | 2,896 | 2.75 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: 232.cpp
*
* Description:
*
* Version: 1.0
* Created: 07/04/2014 19:54:49
* Revision: none
* Compiler: g++
*
* Author: cxwcfea(cxwcfea@163.com),
* Or... | true |
492444df9b1a8cace6576504faebd93ac9228a93 | C++ | ruszkait/DefQuery | /test/ListTest.cpp | UTF-8 | 463 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #include "gtest/gtest.h"
#include <DefQuery/from.h>
#include <DefQuery/list.h>
#include <array>
#include <list>
TEST(ListTest, SubCollectionTest)
{
std::vector<int> vector = {1, 2, 3, 4};
auto subVectorList = DefQuery::from(vector).list();
ASSERT_EQ(std::list<int>({1, 2, 3, 4}), subVectorList);
}
TEST(ListTest, ... | true |
55e88bc71f0c3b8f2c7d788a7f6c8386eaf39b1c | C++ | luisco96/accelerated_cpp | /chapter_3/exercise_3_5.cpp | UTF-8 | 1,256 | 3.265625 | 3 | [] | no_license | #include <algorithm>
#include <iomanip>
#include <ios>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
vector<string> names;
vector<double> grades;
string name;
double midterm, final, homework = 0, x;
// ask for and read the student's name
cout << "P... | true |
1d4c7654ebb9fa7c6b054481f6b4891c885216e0 | C++ | FriendedCarrot4z/cs235 | /w09/bnode.h | UTF-8 | 4,819 | 3.59375 | 4 | [] | no_license | /*******************************************************************************
* Header File
* node
* Summary:
* BNode struct.
* Author:
* Maximiliano Correa, Esteban Cabrera and Tony Moraes.
*******************************************************************************/
#include <stdlib.h>
#ifndef BNODE_... | true |
4880ed8c354c088375c205f01875f23b82111c91 | C++ | TeoPaius/Projects | /c++/Contests/olimpiada/subiecte/oji2012/oji2012/Solutii9_12/Solutii9_12/OJI10/10_OJILIC/p1-compresie/Solutii/compresie_cristina_sichim.cpp | UTF-8 | 1,460 | 2.71875 | 3 | [] | no_license | /*
Solutie prof. Cristina Sichim
*/
# include <fstream>
# include <cstring>
using namespace std;
char s[1000001], a[1001][1001];
int i,n,l,j,k,Nr;
ifstream f("compresie.in");
ofstream g("compresie.out");
int dimensiune()
{ n=0;
int i=0,nr;
while(i<l){ if(s[i]=='*') Nr++,i++;
else if(s[i]>='a' && ... | true |
245a2b7eb7c8b70d7d1281fa9150f614e4e12586 | C++ | thamurath/Variant | /Common/NonCopyable.hpp | UTF-8 | 591 | 3 | 3 | [] | no_license | #ifndef __COMMON_BASE_POCILIES_NONCOPYABLE_HPP__
#define __COMMON_BASE_POCILIES_NONCOPYABLE_HPP__
namespace Base
{
namespace Polycies
{
/**
* @brief Utility class to mark another one as non-copyable.
*
* Just use private inheritance to use it.
* @class NonCopyable*/
class NonCopyable
... | true |
42c0f520982b3ddaff7ffba157a8a336bb6ef0e9 | C++ | microsoft/CCF | /src/node/test/channel_stub.h | UTF-8 | 1,345 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache 2.0 License.
#pragma once
#include "node/node_types.h"
#include <vector>
namespace ccf
{
class ChannelStubProxy
{
public:
std::vector<std::vector<uint8_t>> sent_encrypted_messages;
ChannelStubProxy() {}
temp... | true |
a9de91bbf6b1fcdc01b9d98b489cf4bcb9338d9d | C++ | ddjddd/Algorithm-Study | /Backjoon_Onlie_Judge/2000/2178.cpp | UTF-8 | 1,688 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
typedef struct Node {
int x;
int y;
int len;
} node;
int main() {
int n, m;
cin >> n >> m;
int arr[n][m];
bool visited[n][m];
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
scanf("%1d", &arr[i]... | true |
689dd75f3737bb3e36540cc6ee002eeb4efe7c32 | C++ | wusatteam/WUSATP1 | /CubeSat_GPS/LED.ino | UTF-8 | 298 | 2.828125 | 3 | [] | no_license | void LED_init() {
pinMode(LED, OUTPUT);
digitalWrite(LED,LOW);
}
void LED_on() {
digitalWrite(LED,HIGH);
}
void LED_off() {
digitalWrite(LED,LOW);
}
void LED_flash(int time) {
LED_on();
delay(time);
LED_off();
delay(time);
}
void Error() {
while(true)
LED_flash(100);
}
| true |
d2f05176069fb7c2b90770825298c250d0b67b77 | C++ | defacto2k15/pwAsteroids | /src/Model/components/PositionComponent.cpp | UTF-8 | 915 | 2.78125 | 3 | [] | no_license | //
// Created by defacto on 24.10.15.
//
#include <Model/python/PythonModule.h>
#include "PositionComponent.h"
PositionComponent::PositionComponent( PythonModule &python)
: position_(0.0, 0.0), rotation_(0.0), visibility_(python) {
}
Point PositionComponent::getPosition() {
return position_;
}
Rotation Position... | true |
9d20b2ad1152478e09c2846181ec2c2ad677b440 | C++ | haka913/boj | /1764.cpp | UTF-8 | 562 | 2.859375 | 3 | [] | no_license | /*
* 1764.cpp
*
* Created on: 2018. 11. 13.
* Author: paul
*/
#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
set<string> s;
vector<string> ans;
string a;
while(n--){
cin >> a;
s.insert(a);
}
w... | true |
c8785067aeff6087a4d424983a4e6818257a682b | C++ | kanikapoor-dot/learn-DSA | /uniontry.cpp | UTF-8 | 332 | 3.21875 | 3 | [] | no_license | #include<iostream>
using namespace std;
union uniontry
{
int a;
int b;
char c;
float f;
};
int main(){
union uniontry t;
t.c = 'w';
t.f = 12.3;
cout << t.f << " ";
t.b = 5;
cout << t.b << " ";
t.a = 1;
cout << t.a << " ";
cout << t.f; //Garbage value
... | true |
a491f02d611b08ddee17e2764649fdf39f1def8d | C++ | DimitriRocha/quickSortVisualization | /main.cpp | UTF-8 | 730 | 2.84375 | 3 | [] | no_license | #include <SFML/Graphics.hpp>
#include "QuickSort.h"
#include <future>
int main()
{
sf::RenderWindow window(sf::VideoMode(1200, 800), "Quick Sort Visualization SFML", sf::Style::Close);
QuickSort* qSort = new QuickSort(1200, 800);
auto future = std::async(&QuickSort::sortArray, qSort ,&qSort->arr, 0, (in... | true |
6a204b7b7ab6b09b8d3c37366bffeb035f081aba | C++ | KepAmun/BSplineSurfaceModeling | /Vertex3d.h | UTF-8 | 928 | 2.8125 | 3 | [] | no_license | #ifndef VERTEX3D_H
#define VERTEX3D_H
#include <iostream>
#include <cmath>
using namespace std;
class Vertex3d
{
private:
double m_v[3];
public:
Vertex3d();
Vertex3d(double*v);
Vertex3d(double x, double y, double z);
Vertex3d(Vertex3d* v);
double* Get3dv();
double X() const;
double ... | true |
82c0383cfb5298d92d201932fcd1aab4f1e491cd | C++ | fbi-octopus/biggles | /include/biggles/simulate.hpp | UTF-8 | 5,798 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | /// @file simulate.hpp Simulate the dynamic model to generate synthetic datasets
#ifndef BIGGLES_SIMULATE_HPP__
#define BIGGLES_SIMULATE_HPP__
#include <boost/shared_ptr.hpp>
#include "model.hpp"
#include "point_2d.hpp"
#include "track.hpp"
namespace biggles {
/// @brief Simulate ground truth data and synthetic in... | true |
818730f07b73fb145fb295f4d17c01dbb023e587 | C++ | razvanw0w/university | /sda/SDA_SortedBag_BST/SortedBag.cpp | UTF-8 | 6,872 | 2.8125 | 3 | [] | no_license | //
// Created by razvan on 23.05.2019.
//
#include "SortedBag.h"
SortedBag::SortedBag(Relation r): root{-1},
numberOfElements{0},
capacity{16},
firstFree{0},
r{r}
... | true |
008c6dea85f8a32a9621066b2672e0ce20fd5478 | C++ | Daniel95/MuseEngine | /MuseEngine/Muse/src/Platform/OpenGL/Buffer/OpenGLFrameBuffer.cpp | UTF-8 | 2,978 | 2.515625 | 3 | [] | no_license | #include "MusePCH.h"
#include "OpenGLFrameBuffer.h"
#include "glad/glad.h"
#include "Core/Instrumentor.h"
namespace Muse
{
static const uint32_t s_MaxFramebufferSize = 8192;
OpenGLFrameBuffer::OpenGLFrameBuffer(const FrameBufferProperties& spec)
: m_Properties(spec)
{
Invalidate();
}
... | true |
8db6e25dc20a31c44ab939b55a9e776a2263bdae | C++ | fatihkaan22/CSE241 | /hw2/src/ioHandler.h | UTF-8 | 5,419 | 3.109375 | 3 | [] | no_license | #ifndef UNTITLED_IOHANDLER_H
#define UNTITLED_IOHANDLER_H
#include <iostream>
#include <string>
#include <fstream>
#include "gameStructures.h"
using namespace std;
string getDataFromLine(const string &line) {
return line.substr(line.find(':') + 1);
}
// Overloaded load functions for different data types
void lo... | true |
14c8a5cec276d255247ecc6f5685230f06ffabdb | C++ | jaychao1973/smartHome | /及時資料庫/2touch_sensor/touchSensor/touchSensor.ino | UTF-8 | 1,958 | 3.03125 | 3 | [] | no_license | // Firebase
// 使用arduino nano 33 iot
/*
*連線Firebase realtimeDatabase
*touch sensor 狀態改變,立即上傳至firebase
*/
//Example shows how to connect to Firebase RTDB and perform basic operation for set, get, push and update data to database
//Required WiFiNINA Library for Arduino from https://github.com/arduino-libraries/WiFiNI... | true |
e1fb7065fe2e329f86a5ebd19206050159354ae8 | C++ | tybenz/cerebro | /lib/LightGrid/LightGrid.cpp | UTF-8 | 2,133 | 2.984375 | 3 | [] | no_license | #include <LightGrid.h>
#define NUM_LEDS 9
int MODE_RED = A0;
int MODE_GREEN = A1;
int MODE_BLUE = A2;
LightGrid::LightGrid(int serPin, int rClockPin, int srClockPin, int lastPin) {
// Pin mode set by shifter lib
_shifter = new Shifter(serPin, rClockPin, srClockPin, 1);
_lastPin = lastPin;
pinMode(_las... | true |
ec1dc4ea5f3922651c773e839179936f3944336e | C++ | xCrypt0r/Baekjoon | /src/2/2693.cpp | UTF-8 | 570 | 2.96875 | 3 | [
"MIT"
] | permissive | /**
* 2693. N번째 큰 수
*
* 작성자: xCrypt0r
* 언어: C++14
* 사용 메모리: 1,984 KB
* 소요 시간: 0 ms
* 해결 날짜: 2020년 9월 10일
*/
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
const int size = 10;
int T;
cin >>... | true |
42841126258278fd5b8b70e8c7686f9768fd16a7 | C++ | anthonycj04/bitReader-Writer | /bitReader.h | UTF-8 | 1,156 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
class BitReader{
private:
int fileLength;
int currentPosition;
int bitPosition;
ifstream fileHandler;
char buffer;
public:
BitReader(){
}
void open(const char * fileName){
fileHandler.open(fileName, ios::in | ios::binary);
fileHandler.seekg(0... | true |
4bbbbe8b3b95b80a7829db5fe0e032eb34c9797b | C++ | seb9465/inf1995 | /tp4/pb2/pb2.cpp | UTF-8 | 3,711 | 2.9375 | 3 | [] | no_license | /*
* Equipe no71
*
* WILLIAM LABERGE 1852751
* COLIN STEPHENNE 1852773
* SÉBASTIEN CADORETTE 1734603
*
* 26 janvier 2017
*
* TRAVAIL PRATIQUE 4 - INF1995
* Probleme 2
*/
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
#include <math.h>
#define PORT_SORTIE 0xff
#define F_1... | true |
21d7d4d08bd277835129c36746a6a01c481c79c7 | C++ | cosensible/LeetCode | /LeetCode/283-MoveZeroes.h | WINDOWS-1252 | 1,322 | 4.03125 | 4 | [] | no_license | #include <vector>
#include <algorithm>
#include <iostream>
/*
Given an array `nums`, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.
*/
class Solution_283 {
public:
void moveZeroes(std::vector<int>& nums) {
//// stable_partition
//std::stable_part... | true |
1f54a1ffc560554910d1f7b05578ddf0410c0eaf | C++ | risooonho/AStarPathFinding | /Source/Pathfinding/Path.h | UTF-8 | 2,286 | 2.578125 | 3 | [] | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "Grid.h"
#include "Path.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class PATHFINDING_API UPath : public UActorCompo... | true |
2e4cc05f5f3f0c7604b97d8362118edd61362f4f | C++ | LenyKholodov/wood | /src/Tests/misc/test10.cpp | WINDOWS-1251 | 1,053 | 2.625 | 3 | [] | no_license | #include <misc\tree.h>
#include <kernel.h>
void main ()
{
K_FastInit ("test10.map");
int i = 0;
try
{
BinTree<int> tree;
for (i=0;i<100;i++)
{
int x = random (100);
// int x = i;
BinTree<int>::diter iter = tree.find (x);
if (iter.valid ())
{
dout<<":\t"... | true |
6d0676d1b37149391d8230c209d638c996ff5a33 | C++ | matitr/Roguelike-Game | /CombatTextManager.cpp | UTF-8 | 1,772 | 2.6875 | 3 | [] | no_license | #include "CombatTextManager.h"
#include "CombatText.h"
#include "Unit.h"
#include "Settings.h"
#include "DataBase.h"
#include "PassivesManager.h"
#include <sstream>
#include <iomanip>
void CombatTextManager::update() {
std::vector<CombatText*>::iterator it_combatText = combatTexts.begin();
while (it_combatText != c... | true |
6e5b1fb6ab3ac1d48b8f599072fbdf26663dc2fe | C++ | Shahdee/firework | /Contrib/Engine/include/Distortion.h | UTF-8 | 1,578 | 2.5625 | 3 | [] | no_license | #pragma once
#include "Utils/IPoint.h"
#include "Render/VertexBuffer.h"
// Назначение: описывает поведение "искажающей сетки"
enum RefPoint
{
REF_NODE,
REF_CENTER,
REF_TOPLEFT
};
class Distortion
{
VertexBufferIndexed _drawBuffer;
// Размер сетки
int _nRows,_nCols;
// Размер ячейки
float _c... | true |
7539128febbda35dba7f399ccca7174c86bc969e | C++ | MagicalGuy/CPP_ODebugger | /TangDebugger/TangDebugger/Expression.cpp | GB18030 | 11,324 | 2.71875 | 3 | [] | no_license | #include "stdafx.h"
#include "Expression.h"
Expression::Expression(DbgObject* pDbgObj)
: m_pDdbgObj(pDbgObj)
{
}
Expression::~Expression()
{
}
/*
: BYTE/WORD/DWORD/QWORD [ ʱ,Ȼȡ[]ʽеֵ
Ĵ,ȡĴֵ.
ȼ: 0~9, ֵԽȼԽ.
ÿκĵöᴫһȼֵ,ȼ֧
ܴȼIJ
*/
const char *skipspace(const char *p)
{
for (; *p == ' ' || *p == '\t'; p++);
return p;
... | true |
545bb814085203e05dd7212d6f5e13f5db3c8c31 | C++ | kmc7468/lowi | /src/lowi/instructions/nop.cc | UTF-8 | 730 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <lowi/instructions/nop.hh>
namespace lowi
{
namespace instructions
{
nop::nop()
: instruction_type("nop", 0)
{}
bool nop::operator==(const nop& nop) const noexcept
{
return equal(nop);
}
bool nop::operator!=(const nop& nop) const noexcept
{
return !equal(nop);
}
nop& nop::assign... | true |
4a0e389b621e88fe0d45850f066d6359d0f4e4cc | C++ | simion-iulian/wavelamp | /_3ServoSweep.ino | UTF-8 | 1,391 | 3.28125 | 3 | [
"CC0-1.0"
] | permissive | /* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo servo1;
Servo servo2;// create servo object to control a servo
Servo servo3;
const int NUM_SERVOS = 3;// tw... | true |
2f61d4bf49c84e3c3bf386bbe898f47934ce7dcd | C++ | goodann/AlgorithmsStudy | /JHS/01 - Algorithm/02 - Implementation/53 - Fair Rations.cpp | UHC | 1,301 | 3.15625 | 3 | [] | no_license | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | true |
aef6e21f906cc320e48224229c06884156cfe536 | C++ | AdityaKarn/cp-cpp | /codeforces/1397/C.cpp | UTF-8 | 2,105 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#define REP(i, n) for (int i = 1; i <= n; i++)
#define mod 1000000007
#define pb push_back
#define ff first
#define ss second
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define lli long long int
#define INF 10000... | true |
1be5b1c8e915a735b877554688ba29d0917f90ea | C++ | Argasz/CPROGLib | /EventLoop.h | UTF-8 | 2,171 | 2.625 | 3 | [] | no_license | //
// Created by Aron on 2018-11-23.
//
#ifndef CPROGLIB_EVENTLOOP_H
#define CPROGLIB_EVENTLOOP_H
#include <vector>
#include <SDL.h>
#include "Sprite.h"
#include "Entity.h"
#include "Window.h"
#include "Background.h"
#include "Map.h"
#include "DebugInfo.h"
#include "PhysicsObject.h"
#include "MemPtrCommand.h"
#incl... | true |
b77f00fb3e48d8fd6e637df8b092deb9feafdfd1 | C++ | HenryLoo/cozybirdFX | /cozybirdFX/Texture.cpp | UTF-8 | 683 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #include "Texture.h"
#include <glad/glad.h>
#include <iostream>
namespace
{
const std::string ASSET_PATH{ "assets/" };
const std::string TEXTURE_PATH{ "texture/" };
}
Texture::Texture(unsigned int textureId, int width, int height, int numChannels) :
m_textureId(textureId), m_width(width), m_height(heigh... | true |
4410e8d1b3989d237ca796f55ad470957d88780a | C++ | wis-niowy/Programming-2---Object-Oriented | /lab2/lab2_2016/lamana.h | UTF-8 | 529 | 2.578125 | 3 | [] | no_license | #pragma once
#include <iostream>
using namespace std;
#include "punkt.h"
const int num = 5;
class Lamana
{
Odcinek ol[num];
int number;
public:
Lamana() { };
Lamana(int number);
Lamana(Odcinek*, int number);
friend Lamana operator+(const Lamana&, const Lamana&);
friend ostream& operator<<(o... | true |
b7263f6149f3e31ae69a0f742678dd1c72be663c | C++ | nursyazaathirah/smartshirt | /bit_test/bit_test.ino | UTF-8 | 888 | 2.875 | 3 | [] | no_license | #include <binary.h>
byte data = 0;
boolean step_taken;
int body_temp; //needs to be between 0 and 32
int BPM;
boolean danger_location;
boolean danger_hit;
boolean byte_flag = true;
void setup() {
Serial.begin(9600);
step_taken = true;
body_temp = 15;
BPM = 100/10;
danger_hit = true;
danger_location = 0;
}... | true |
d997690b2ddde318bcd38e3be0aecff773de76d4 | C++ | dmironov1993/acmp | /acmp/0340.cpp | UTF-8 | 1,114 | 3.203125 | 3 | [] | no_license | //https://acmp.ru/asp/do/index.asp?main=task&id_course=1&id_section=2&id_topic=31&id_problem=1216
#include <bits/stdc++.h>
using namespace std;
bool firstCan(vector<int> v1, vector<int> v2) {
for (int i = 0; i < 3; i++) {
if (v1[i] > v2[i]) {
return false;
}
}
return true;
}
b... | true |
5e4a5a20f0e1a8431b3ea7cc778d1de0e004319b | C++ | diwujiahao/leetcode | /220. Contains Duplicate III/solution1.cpp | UTF-8 | 959 | 3.359375 | 3 | [] | no_license | // 利用集合的红黑树查找功能--实现候选数字的快速确定
class Solution {
// |x - nums[i]| <= t ==> -t <= x - nums[i] <= t;
public:
bool containsNearbyAlmostDuplicate(vector<int>& nums, int k, int t) {
set<double> window; // set is ordered automatically
for (int i = 0; i < nums.size(); i++) {
// 保证集合窗口大小... | true |
1bc112d720da401813bf53d72b3b01905b918434 | C++ | adrianohrl/alliance | /alliance/src/utilities/has_name.cpp | UTF-8 | 698 | 2.53125 | 3 | [] | no_license | /**
* This source file implements the HasName class.
*
* Author: Adriano Henrique Rossette Leite (adrianohrl@unifei.edu.br)
* Maintainer: Expertinos UNIFEI (expertinos.unifei@gmail.com)
*/
#include "utilities/has_name.h"
namespace utilities
{
HasName::HasName(const std::string& name, const std::string& id)
... | true |
88c4ede3a993a30d8c2dfb630caadd4610573b56 | C++ | mementum/codeeval | /01-easy/0230-football/0230-football.cpp | UTF-8 | 3,297 | 2.796875 | 3 | [] | no_license | /*
Copyright (C) 2016 Daniel Rodriguez
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 3 of the License, or
(at your option) any later version.
This program is distributed... | true |
4eb785cb982ea7329b2474a775c9d2e02bede06b | C++ | harp07/HumberPhysicsGame | /Classes/AudioManager.h | UTF-8 | 798 | 2.859375 | 3 | [] | no_license | /* AudioManager.h
** Manages all the sound effects and music for the game.
** use .wav files since they are supported by all platforms
*/
#include <SimpleAudioEngine.h>
#include <string>
class AudioManager {
private:
//The Audio Engine
SimpleAudioEngine *audioEngine;
//Sounds. These will all be strings of... | true |
d0ca409dcf6c6bf2007f70e712e102605deb33bd | C++ | TallanGroberg/EECS183 | /testing/testing/coinCounter.cpp | UTF-8 | 2,724 | 2.9375 | 3 | [] | no_license | //
//
//
////
//// coinCounter.cpp
//// testing
////
//// Created by Tallan Groberg on 1/26/21.
////
//
//#include <iostream>
//#include<string>
//#include<cmath>
//#include<cassert>
//using namespace std;
//
//string pluralize(string singluar, string plural, double amount) {
// if(amount > 1 || amount == 0){
// ... | true |
874fc84e94727181147761683efd4413b41cd92f | C++ | libocca/occa | /tests/src/internal/lang/parser/scope.cpp | UTF-8 | 4,451 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "utils.hpp"
void testScopeUp();
void testScopeKeywords();
void testScopeErrors();
int main(const int argc, const char **argv) {
setupParser();
testScopeUp();
testScopeKeywords();
testScopeErrors();
return 0;
}
const std::string scopeTestSource = (
// root[0]
"int x;\n"
// root[1]
"typede... | true |
9717d277bf1a46c4e500b2f1414f97d0df594f93 | C++ | Thugday/BOJ | /11725.cpp | UTF-8 | 903 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#define MAX 100001
using namespace std;
int depth[MAX], d[MAX], parent[MAX];
bool check[MAX];
vector<int> a[MAX];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for (int i = 0; i < n - 1; i++) {
i... | true |
7e157bb12e047666c219375f15d861afc486d396 | C++ | HaoLIU94/Heat_diffusion | /2dimension/square.cpp | UTF-8 | 5,335 | 2.75 | 3 | [] | no_license | # include <cstdlib>
# include <iostream>
# include <iomanip>
# include <cmath>
/*
[x] = read("/home/hao/ensiieS3/PAP/project/2dimension/square/square_u0001.txt",1000,1000)
set(gcf(),"color_map",[jetcolormap(64);hotcolormap(64)])
zm = min(x); zM = max(x);
colorbar(zm,zM,[1,64])
Sgrayplot(1:1000,1:1000,x,strf="041",rect... | true |
3713ffeab105d19fe986fd199920b90d97c97ac9 | C++ | taichuai/cpp_practice | /code/逻辑运算符.cpp | UTF-8 | 390 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | #include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
//逻辑运算符
// 非 !
int a = 10;
// 在c++中,除了0都为真
cout << !a << endl;
// 与 &,同真为真,其余为假
int b = 0;
cout << (a && b) << endl;
//或 ||
cout << (a || b) << endl;
// 提示: | & 与 | &有所区别
return 0... | true |
80a82079822a4119862f58503f580b18cdba7bf2 | C++ | binghe2001021/leetcode | /leetcode#71.cpp | UTF-8 | 1,113 | 2.875 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#define maxn 1111
using namespace std;
class Solution {
public:
string simplifyPath(string path) {
size_t found = path.find('/');
string ans;
stack<int> q;
path.push_back('/');
... | true |
9ca7e27bf69defa4aea0eca9f6dcbd70f11ddebf | C++ | sahilahmed7707/Basic-C-Calculator | /next_permutation.cpp | UTF-8 | 486 | 2.8125 | 3 | [] | no_license | #include "bits/stdc++.h"
using namespace std;
class Solution {
public:
void nextPermutation(vector<int>& nums) {
vector<int> a = nums;
int idx = -1;
int n = a.size();
if (n == 1) {
return;
}
int i = n - 2;
while (i >= 0 and a[i] >= a[i + 1])i--;
if (i >= 0) {
int j = n - 1;
while (a[j... | true |
8632aee90f0d6cb72f00a2fb908288bad9c578e7 | C++ | d01000100/tank_game | /ProtocolManager/ProtocolManager.cpp | UTF-8 | 5,961 | 2.609375 | 3 | [] | no_license | #include "ProtocolManager.h"
int getGameStateSize(GameStateMessage* message);
int getSMessageTank_size(sMessageTank smTank);
int getSMessageBullet_size(sMessageBullet smBullet);
SendBuffer writeMessage(OliMessage* message) {
// int int
// [theLength][message_type]
SendBuffer buffer;
buffer.writeInt(8... | true |
f03c5a7d1d507671f4a6a00093e667603e0ed64e | C++ | arjunbhatt670/CodeForces | /1118C - Palindromic Matrix.cpp | UTF-8 | 2,300 | 2.90625 | 3 | [] | no_license | /*
* User: Isanchez_Aguilar
* Problem: CodeForces 1118C - Palindromic Matrix
*/
#include <bits/stdc++.h>
using namespace std;
using Long = long long;
int main(void)
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
map<int, int> freq;
for (int i = 0; i < n * n; ++i)
{
int v... | true |
1ce52e1bc1a3cc34bd884ee35bc1ad3bcd4193f2 | C++ | itomomoti/Basics | /test/StepCode_Test.cpp | UTF-8 | 7,648 | 2.8125 | 3 | [] | no_license | #include "StepCode.hpp"
#include <gtest/gtest.h>
#include <stdint.h>
namespace itmmti
{
class StepCode_Test : public ::testing::Test
{
};
TEST_F(StepCode_Test, Constructor)
{
const size_t num = 32;
// { // Compare with different SizeT
// StepCode<16, uint64_t> code1;
// code1.printStat... | true |
2224fd3c79547d9c97b8e2496c0cfabdbdb9ad31 | C++ | masiko/humanoid | /12pwmTest/12pwm.cpp | UTF-8 | 1,065 | 2.5625 | 3 | [] | no_license | #include "mbed.h"
#include "ServoControl.h"
/*
class Softpwm{
public:
Softpwm(PinName pin) : _pin(pin) {
_pin = 0;
}
void setf(){
_pin = 1;
wait_us(1500);
_pin = 0;
}
private:
DigitalOut _pin;
};
class Servo{
public:
Servo(PinName pin) : _softpwm(pin) {
ser.attach(&_softpwm, &Soft... | true |
d2da1f380c2389a2fb9251e5d1ce4d923367ad05 | C++ | moguchev/KKM | /src/Исходники DLL модели ФН/FP/uart.cpp | UTF-8 | 1,131 | 2.828125 | 3 | [] | no_license | // Leonid Moguchev (c) 2020
#include "pch.h"
#include "uart.h"
Uart::Uart() {
reset();
}
void Uart::reset() {
rxCompleted = false;
rxData = 0x0;
rxState = 0;
txCompleted = true;
txData = 0x0;
txState = 0;
}
void Uart::txDat(uint8_t data) {
txData = data;
txState = 1;
}
bool Uart::txBit() {
if (!txComplet... | true |
1bdb7197ec4738a878255c223b106593befbbfa4 | C++ | rbock/hana | /include/boost/hana/ext/std/integer_sequence.hpp | UTF-8 | 2,272 | 2.71875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSL-1.0"
] | permissive | /*!
@file
Adapts `std::integer_sequence`.
@copyright Louis Dionne 2014
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_EXT_STD_INTEGER_SEQUENCE_HPP
#define BOOST_HANA_EXT_STD_INTEGER_SEQUENCE_HPP
#include... | true |
47bb23fc9a94c74bcc195557536fa4ee70f83c76 | C++ | ChoiWooHyuk2/Dicon | /Entity.cpp | UTF-8 | 1,353 | 2.78125 | 3 | [] | no_license | #include "DXUT.h"
#include "Entity.h"
Entity::Entity()
:pos(0, 0),
scale(1, 1),
scaleCenter(0, 0),
rotation(0),
rotationCenter(0, 0),
rect(0, 0, 0, 0),
visibleRect(0, 0, 0, 0),
visible(true),
updateEnabled(true),
renderChildrenEnabled(true),
parent(nullptr),
removing(false),
deleting(false),
tag("")
{
}
... | true |
ec98f1a8045fd5824211c52069e8b3cc13e7a38f | C++ | MariusHerget/LMU-SS18-cpppc | /Assignments/06/solution/list_base.h | UTF-8 | 4,948 | 3.296875 | 3 | [] | no_license | #include <iterator>
namespace cpppc {
template <typename ValueT, ValueT default_value = ValueT()> class list {
typedef list<ValueT, default_value> self_t;
typedef typename std::size_t size_type;
public:
struct list_node {
list_node *next;
ValueT value;
};
using list_node_t = list_node;
template <... | true |
0c0780274c5029315bb6b56167cd883b5afb924a | C++ | UZerbinati/Suite | /LA/iteractive.cpp | UTF-8 | 2,997 | 2.859375 | 3 | [] | no_license | #include "../suite.hpp"
#include "iteractive.hpp"
#include <iostream>
#include <string>
#include <algorithm>
#include <omp.h>
int ResidualStop(spmat &A,vec b,vec x,double eps){
vec r(b.getLen());
r = b-A*x;
if (r.norm(2) < eps){
return 1;
}else{
return 0;
}
}
vec Jacobi(spmat &A,vec b,vec guess,int JacobiIT,d... | true |
945d086877eb128cccc0988288f82e73a0e67ea7 | C++ | ellynhan/challenge100-codingtest-study | /hall_of_fame/gusah009/[PGS]_weekly6.cpp | UTF-8 | 1,336 | 2.71875 | 3 | [] | no_license | #include <string>
#include <vector>
#include <algorithm>
#define FOR(i, j) for(int i = 0; i < j; i++)
using namespace std;
int matches[1001] = {0};
int win[1001] = {0};
int heavyWin[1001] = {0};
vector<int> solution(vector<int> weights, vector<string> head2head) {
vector<int> answer;
FOR(i, head2head.size()... | true |
52486fae48a9d364d94d4f026149e91d81eb99ed | C++ | suyashagno3/Beginner_Codeforces_Problems | /Solutions(cpp)/ColorfulField(79)working.cpp | UTF-8 | 818 | 2.578125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n, m, k, t, a, b, i, j, t0;
cin >> n >> m >> k >> t;
int w[k];
for (int in = 0; in < k; in++)
{
cin >> a >> b;
w[in] = ((a - 1) * m) + b - 1;
}
s... | true |
c888342ec8e29d5ddd3a65fe4b3967504be1f6e5 | C++ | George8327/rail-canyon | /src/util/config.cc | UTF-8 | 2,989 | 3.1875 | 3 | [
"Zlib"
] | permissive | #include "common.hh"
struct ConfigEntry {
std::string key;
std::string value;
};
static bool isConfigLoaded = false;
static std::vector<ConfigEntry> config;
static void config_load() {
if (!isConfigLoaded) {
isConfigLoaded = true;
FILE* f = fopen("config.ini", "r");
if (!f) return;
fseek(f, 0, SEEK_END);... | true |
75618a462beb4ad135859c77425ff68ba91b21ba | C++ | renbou/personal-cpp-lib | /utility.hpp | UTF-8 | 1,085 | 3.578125 | 4 | [
"GPL-3.0-only"
] | permissive | // Artem Mikheev 2019
// GNU GPLv3 License
#ifndef UTILITY_HPP
#define UTILITY_HPP
// Various utility classes for use in code and other structures
// Template structure for creating linked-list based structures
template<typename T>
struct listNode {
T * elem;
listNode * next = nullptr;
listNode(T t_val): elem(ne... | true |
2f6dfa77b9e1e2bdb73e82c867a09324e81216cb | C++ | Andydiaz12/Estructura-de-Datos-con-Muratalla | /Ejercicios de parciales/2 parcial/CH02_3_230216_24500468.cpp | ISO-8859-1 | 1,052 | 3.625 | 4 | [] | no_license | /* Jos Andrs Daz Escobar
23 de Febrero del 2016
Ingrese N nmeros, cree un programa que identifique los nmeros pares e impares ya ingresados.
FUNCIN 1: funcin sin parmetros que solicite el nmero a analizar y lo regrese al main.
FUNCIN 3: funcin que le pasarn como parmetro el nmero e imprimir si se trata de un nme... | true |
e0294d7ff0be2b44f4b02a987ddf73686b369dd5 | C++ | mattmcmenamin/Lab8 | /BinaryTree.h | UTF-8 | 5,993 | 3.328125 | 3 | [] | no_license | #pragma once
#ifndef _BIN_TREE_H
#define _BIN_TREE_H
#include "RandomUtilities.h"
#include<iostream>
#include<string>
#include<vector>
#include<queue>
//***Binary Tree class ***//
class BinaryTree
{
protected:
class BinaryNode
{
public:
short entry_;
BinaryNode * l... | true |
bc13eab24a521590abd1f90e98556e0be496f1c1 | C++ | extramaster/2DLevelGenerator | /src/main.cpp | UTF-8 | 1,047 | 3.015625 | 3 | [
"MIT"
] | permissive | #include <cstdlib>
#include <ctime>
#include <SFML/Graphics.hpp>
#include "Level.hpp"
#include "LevelGenerationAlgorithm.hpp"
#include "ModifiedKruskalsMazeGen.hpp"
int main()
{
std::srand(std::time(0));
sf::RenderWindow app(sf::VideoMode(15*32, 15*32), "Level");
ModifiedKruskalsMazeGen generator;
Level level(&gen... | true |
2ab5216711bef33311f5096edfe2541a8c49bd25 | C++ | CARDSflow/cardsflow_gazebo | /include/cardsflow_gazebo/muscle/ISee.hpp | UTF-8 | 2,868 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include <vector>
#include <boost/numeric/odeint.hpp>
#include <cmath>
#include <ros/ros.h>
# define M_PI 3.14159265358979323846 /* pi */
#define toRadian( x ) ( (x) / 180 * M_PI )
#define toDegree( x ) ( (x) / M_PI * 180 )
namespace cardsflow_gazebo
{
using namespace std;
using namespace... | true |
2f10cfb801b79c1157df5fce35b8989f091a3334 | C++ | AlexisLeveque/Piscine_CPP | /day04/ex03/Ice.cpp | UTF-8 | 498 | 2.953125 | 3 | [] | no_license | //
// Created by Alexis LEVEQUE on 6/1/18.
//
#include "Ice.hpp"
Ice::Ice(void) : AMateria("ice") {}
Ice::Ice(Ice const &src) : AMateria("ice") {
this->_xp = src.getXP();
}
Ice &Ice::operator=(Ice const &rhs) {
this->_xp = rhs.getXP();
}
Ice::~Ice(void) {}
void Ice::use(ICharacter &target) {
std::cout... | true |
3913b9adb25325ced701c3792a166e1d83d3293b | C++ | nickgreenquist/GraphicsProgrammingProject | /DirectX11_Starter/BoundingBox.cpp | UTF-8 | 2,904 | 3.125 | 3 | [] | no_license | #include "BoundingBox.h"
BoundingBox::BoundingBox()
{
}
BoundingBox::BoundingBox(std::vector<Vertex>& verts)
{
startMin = XMFLOAT3(999.0f, 999.0f, 999.0f);
startMax = XMFLOAT3(-999.0f, -999.0f, -999.0f);
// loop through the vector of verts provided by the mesh
// and apply to set up the original min/max values
... | true |
e8088dbaa92f2c9c6b4cc50c9eb56a6957bac952 | C++ | sayuree/leetcode-problems | /stack/1047.RemoveAllAdjacentDuplicatesInString.cpp | UTF-8 | 706 | 3.609375 | 4 | [] | no_license | //My NOT very efficient solution
//O(n+m) time and O(n) space
//Pushing into stack and checking whether it matches with upcoming element
//Then concatenating final elements of a stack into new string
//Then reverse it (due to FIFO nature of Stack DS)
class Solution {
public:
string removeDuplicates(string S) {
... | true |
48b8301b8c5a1ff4c6a78998a883a151ac1541bc | C++ | khadijaAssem/Compiler | /src/Parser.cpp | UTF-8 | 8,147 | 2.984375 | 3 | [] | no_license | //
// Created by hp on 06/05/2021.
//
#include "../include/Parser.h"
using namespace std;
vector<string> RULES_SET;
set<char> puncs;
map<string ,string> REs;
map<string ,string> RDs;
vector<string> RDKeys;
set<string> keyWords;
void Parser:: read_file(){
freopen(RULES_FILE, "r", stdin);
string input;
wh... | true |
2f2ed440b7ac1263af9e2874c1ab4877a1e57247 | C++ | BGCX067/ezgame-svn-to-git | /EzGame-1.0.0/CoreLibs/EzAnimation3D/EzInterpolator.cpp | UTF-8 | 2,480 | 2.5625 | 3 | [] | no_license | #include "EzInterpolator.h"
EzImplementRTTI(EzInterpolator, EzObject);
InterpFunction EzInterpolator::InterpFunctions[NUMKEYCONTENTS*MAX_ANI_KEYFREAMTYPE];
void EzInterpolator::RegisterLoader()
{
static bool bRegistered = false;
if(bRegistered)
return;
bRegistered = true;
setInte... | true |
4985433a84b97550d42992b2c98f4007ebf27636 | C++ | Showrin/codeforces-catagory-A- | /A - String Task.cpp | UTF-8 | 984 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n;
string input_word;
string output_word;
string word;
cin >> input_word;
for (int i=0; i<input_word.length(); i++) {
if (input_word.at(i) == 'A' || input_word.at(i) == 'E' || input_word.at(i) == 'I' || input_word.at(i) ==... | true |
5ef623e1a1cb4e7e4e3dc66ec150c8679b3f36a3 | C++ | AnantaYudica/basic | /include/type/trait/rem/Pointer.h | UTF-8 | 842 | 2.59375 | 3 | [
"MIT"
] | permissive | #ifndef BASIC_TYPE_TRAIT_REM_POINTER_H_
#define BASIC_TYPE_TRAIT_REM_POINTER_H_
namespace basic
{
namespace type
{
namespace trait
{
namespace rem
{
template<typename T>
struct Pointer
{
typedef T type;
typedef typename Pointer<T>::type Type;
};
template<typename T>
struct Pointer<T*>
{
typedef T type;
... | true |
5ed186158c7a26545654c5a5e1bdcddad8bd52a1 | C++ | takumhonde9/Cpp-Projects | /Data Structures/Queues/Queue/tests.cpp | UTF-8 | 1,151 | 3.0625 | 3 | [] | no_license | /*
* tests.cpp
*
* Created on: May 4, 2018
* Author: takudzwamhonde
*/
#include "tests.hpp"
void test1(){
Queue<std::string> CoffeeShopList;
CoffeeShopList.enqueue("Jonathan Burt - Frapaccino (XL) & Apple Crumble");
CoffeeShopList.enqueue("Melissa Funck - Cafe Americano (M) & Chocolate Chip Cookie")... | true |
51e04e9806f8b0e50246972d0335d9b596ba283d | C++ | loerac/BB-usr-led | /main.cpp | UTF-8 | 2,851 | 3.71875 | 4 | [] | no_license | /*
* Simple BBB on-board LED flashing program
* This program uses all USR LED's and can be executed in three ways
* - on
* - off
* - flash
* - status
*
* Author: Christian Loera
*/
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
// The path to the four LED's
#define PATH "/sys/c... | true |
cfef2e87c38bc23e03b38727ab499529144ba5c7 | C++ | itu-robotics/intro-to-cpp | /week3/src/week3.cpp | UTF-8 | 3,521 | 4.28125 | 4 | [] | no_license | //============================================================================
// Name : week3.cpp
// Author :
// Version :
// Copyright :
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <vec... | true |
97fbd4bbb20e28094cf048787a8e02e9ca1374c3 | C++ | OfficineSistemiche/Double-Click | /double_click_arduino_2014_04_22_BLACKnWHITE/double_click_arduino_2014_04_22_BLACKnWHITE.ino | UTF-8 | 1,930 | 2.984375 | 3 | [] | no_license | // doubleCLICK - by OfficineSISTEMICHE - april 2014
#include <Servo.h>
Servo servoPen, servoRadar; // create servo objects
// a maximum of eight servo objects can be created
int brighRead;
int posPen = 171;
int touchPen = 3;
boolean downPen = false;
boolean downPPen = false;
boolean invertRadar = false;
int posR... | true |
0a86c3b9af8ae14d6a6c56e9355dc178645112c5 | C++ | vayush/coding-in-c | /DIFFICULT/ALL SUBARRAY WITH SUM ZERO/ALL SUBARRAY WITH SUM ZERO.cpp | UTF-8 | 493 | 2.921875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void print(int a[],int start,int end){
for(int i=start;i<=end;i++){
cout<<a[i]<<" ";
}
cout<<endl;
}
void printAll(int a[],int n){
map<int,int>m;
int sum =0;
for(int i=0;i<n;i++){
sum = sum+a[i];
if(sum == 0)
print(a,0,i);
if(m.find(sum)!=m.end()){
... | true |
b3d74dbeb933b8e7b3d8031d259c76a259e22d07 | C++ | EvanMcGorty/expression-evaluator | /include/expression-evaluator/features/stl_optional_utilities.h | UTF-8 | 1,565 | 2.640625 | 3 | [] | no_license | #include"../../../implementation/function_sets.h"
namespace expr
{
namespace impl
{
template <typename t>
struct type_operation_info<std::optional<t>> : public wrapper_type_operation_trait
{
static std::string print(std::optional<t> const& tar)
{
if (tar)
{
return "?" ... | true |
7229215ac3d260a77ff76641ef588c60dbaeba4c | C++ | SauravPati08/FacePrep-CPP | /1D Array/Array insertion.cpp | UTF-8 | 580 | 3.359375 | 3 | [
"MIT"
] | permissive | #include<iostream>
using namespace std;
int main()
{
int n,loc,val,i,temp;
cin>>n;
int a[n+1];
for(i=0;i<n;i++)
cin>>a[i];
cout<<"Enter the number of elements in the array\nEnter the elements in the array\nEnter the location where you wish to insert an element\n";
cin>>loc>>val;
if(loc>n || lo... | true |
c8bd1e36a8bfc2a9eed1947d4116d96439272755 | C++ | hebinbing/rover_navigation | /nodes/convert_pcl_node.cpp | UTF-8 | 2,348 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | // rover_navigation
#include "rover_navigation/GridMap.hpp"
// ROS
#include <ros/ros.h>
// grid_map
#include <grid_map_ros/grid_map_ros.hpp>
#include <grid_map_core/iterators/GridMapIterator.hpp>
// pcl
#include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl_ros/point_cloud... | true |
390a97605e9f7221fe5c13d569f96689dab2173f | C++ | alexandraback/datacollection | /solutions_5640146288377856_0/C++/sankettotala/cj_1c_q1.cpp | UTF-8 | 246 | 2.796875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
for(int iiii=1; iiii<=t; iiii++){
int r, c, w;
cin>>r>>c>>w;
int min = c/w;
min *= r;
min += w;
if(c%w == 0) min--;
cout<<"Case #"<<iiii<<": "<<min<<endl;
}
}
| true |
221bdb8b24e6260ac432429028611e7eea667795 | C++ | jsharf/plasticity | /symbolic/numeric_value.h | UTF-8 | 1,683 | 2.890625 | 3 | [
"MIT"
] | permissive | #ifndef NUMERIC_VALUE_H
#define NUMERIC_VALUE_H
#include "symbolic/expression_node.h"
#include <experimental/optional>
#include <iostream>
#include <set>
#include <string>
#include <unordered_map>
namespace symbolic {
class NumericValue : public ExpressionNode {
public:
NumericValue(double a) : is_bound_(true), ... | true |
3ec2a2bbf430d2f8b8c604cd440ad64b2c78bc8d | C++ | PVDVliet/EDS-Assignment-5 | /Inc/Timer.h | UTF-8 | 511 | 3.21875 | 3 | [] | no_license | #ifndef TIMER_H
#define TIMER_H
#include "ITimer.h"
#include <inttypes.h>
class Timer : public ITimer
{
public:
Timer() : Timer(0) { }
Timer(uint64_t time) : m_time(time) { }
~Timer() { }
// ITimer
uint64_t GetTime() const { return m_time; }
void SetTime(const uin... | true |
bd2d786a2ebb4d133ee46b9abaebc70d18bedd2e | C++ | strifey/2804hw4 | /src/processor.h | UTF-8 | 662 | 2.75 | 3 | [] | no_license | #ifndef processor_h
#define processor_h
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include "storage.h"
#include "instruction.h"
class Processor {
private:
StorageFile registers;
StorageFile memory;
Storage PC;
Instruction *curr_instr;
bool halted;
unsigned int instr_run;... | true |
8d998c39837e94395a8b43d55969d77ee81c98c6 | C++ | jaskaranbhatia/Interview-Prep | /Basics/DereferenceOperator.cpp | UTF-8 | 485 | 3.828125 | 4 | [] | no_license | #include<iostream>
using namespace std;
// * is used for multiplication, creating pointer and dereferencing
// In dereferencing, we derefer a pointer
// & of a variable -> address
// * of a addrress -> variable
int main(){
int x = 10;
int *ptr;
ptr = &x;
cout<<*ptr<<endl; //variable
cout<<*&x<<endl; //variable
c... | true |
38139bf527d20243d831cdd5904d0007d924f547 | C++ | TheRoD2k/Algorithm_OOP_DIHT | /SEM_2/MODULE_2/C/source.cpp | UTF-8 | 6,687 | 3.25 | 3 | [] | no_license | /*Задача A. Восьминашки
Имя входного файла: puzzle.in
Имя выходного файла: puzzle.out
Ограничение по времени: 1 секунда
Ограничение по памяти: 256 мегабайт
«Восьминашки» – упрощенный вариант известной головоломки «Пятнашки».
Восемь костяшек,
пронумерованных от 1 до 8, расставлены по ячейкам игровой доски 3 на 3,
одна... | true |
f188e015a16c1aaee39c30c2636ed9bdd531a302 | C++ | vineet21tiwari/Algorithm | /BST_Insertion_Searching.cpp | UTF-8 | 1,371 | 3.359375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
class BST{
public:
Node* root;
BST(){
root = NULL;
}
void inorder(Node* root){
if(root!=NULL){
inorder(root->left);
... | true |
1b90af9eeb1558bdbe5afa4f25d446ea5f914c26 | C++ | halmer/oop | /lab08/Paint/Model.h | UTF-8 | 1,186 | 2.578125 | 3 | [] | no_license | #pragma once
#include "Shape.h"
class CModel
{
public:
using AddShapeSignal = boost::signals2::signal<void(std::shared_ptr<CShape> const & shape, boost::optional<size_t> position)>;
using DeleteShapeSignal = boost::signals2::signal<void(boost::optional<size_t> position)>;
using DeleteAllShapesSignal = boost::signal... | true |
2a40bc1542bc6f8911d46c6bfecf3ca453d7eae9 | C++ | linneox/NCC_CIS17C | /HW_5a/main5a.cpp | UTF-8 | 1,649 | 3.953125 | 4 | [
"MIT"
] | permissive | // ========================================================================
// Attached: HW_5ab
// ========================================================================
// Project: HW_5a
// ========================================================================
// Programmer: Johnny Valles
// Class: CIS 17C
... | true |
de3aa1646b32620b1cf80e61cd31c0c275494837 | C++ | kasuuuu4423/taruhi | /main-alt-reverse-3leds/sketch_jan06a.ino | UTF-8 | 599 | 2.8125 | 3 | [] | no_license | #include <FastLED.h>
#define PIN 0
#define NUM_LED 600
#define BRIGHTNESS 64
CRGB leds[NUM_LED];
void setup()
{
Serial.begin(115200);
delay(100);
FastLED.addLeds<WS2812B, PIN, GRB>(leds, NUM_LED);
FastLED.setBrightness(BRIGHTNESS);
FastLED.showColor(CRGB::Black);
Serial.println("init");
}
void loop() {
... | true |
b0f3b97e07004b8eea03f3a635f5193c7965b31e | C++ | jimlinntu/gym | /leetcode/191/main-divide-bits.cc | UTF-8 | 546 | 2.875 | 3 | [] | no_license | class Solution {
public:
const int n = 1 << 8;
const int mask = n-1; // 11111111
int count[1 << 8];
void precompute(){
for(int i = 0; i < n; i++){
int num = i;
int c = 0;
for(; num > 0; num = num & (num-1)){
c++;
}
count... | true |
babad96fa01ef869cac31fcf86780f853268e1fe | C++ | DariusL/invaders2 | /invaders v2/Texture.h | UTF-8 | 883 | 2.5625 | 3 | [] | no_license | #pragma once
#include "includes.h"
#include "Globals.h"
enum TEXTURE_VIEW
{
TEXTURE_VIEW_RENDER_TARGET = 1 << 0,
TEXTURE_VIEW_SHADER_RESOURCE = 1 << 1,
TEXTURE_VIEW_UNORDERED_ACCESS = 1 << 2
};
class Texture
{
e::ComPtr<ID3D11Texture2D> texture;
e::ComPtr<ID3D11ShaderResourceView> shaderResourceView;
e::ComPtr<... | true |
16cf8e0e7d1df7bb59b16b677f5a43333e9fff33 | C++ | yasir18/ncrwork | /Ds Assignment/Sorting/QuickSort.cpp | UTF-8 | 961 | 3.828125 | 4 | [] | no_license | #include<iostream>
using namespace std;
int partition(int *,int,int);
void QuickSort(int *,int,int );
void swap(int &x,int &y){
int temp;
temp=x;
x=y;
y=temp;
}
int main(){
int num;
cout<<"Enter the count of numbers";
cin>>num;
int *arr=new int [num];
cout<<"Enter the numbers: ";
for(int i=0;i<num;i++){
ci... | true |
7a7bdea7b51333480f4e5004ec083c04d4799e9b | C++ | VasuGoel/leetcode | /challenge/2020/september-leetcoding-challenge/largest-time-for-given-digits.cpp | UTF-8 | 492 | 3.03125 | 3 | [] | no_license | // O(24) time. Checking all 4! = 24 permutations
class Solution {
public:
string largestTimeFromDigits(vector<int>& arr) {
sort(arr.begin(), arr.end(), greater<int>());
do {
if((arr[0] < 2 or (arr[0] == 2 and arr[1] < 4)) and arr[2] < 6)
return to_string(arr[0]) ... | true |