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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
82230559e0d480875a135799a58390da40b22e8f | C++ | Gaston11/Trabajo-Pr-ctico-N-2 | /Equipo.cpp | UTF-8 | 2,289 | 3 | 3 | [] | no_license | /*
* Equipo.cpp
*
* Created on: 22/05/2016
* Author: gaston
*/
#include "Equipo.h"
Equipo::Equipo(std::string numero, Antena* antena){
this->numero = numero;
this->llamadas = new Lista<Llamada*>;
this->ultimaConexionAntena = new Conexion(antena);
this->llamadasEntrantes = 0;
this->llam... | true |
bab679d7d210175b5a1b6b36c3ed2fe368b6e8ad | C++ | jrgagnon/FinalTriggerofLegend | /ftol_tile.cpp | UTF-8 | 1,219 | 3.171875 | 3 | [] | no_license | #include "ftol_tile.h"
ftol_tile::ftol_tile(int x, int y, int tileType, SDL_Rect tileBox)
{
myType = tileType;
boundingBox.x = x;
boundingBox.y = y;
boundingBox.w = TILE_WIDTH;
boundingBox.h = TILE_HEIGHT;
myTileBox = tileBox;
}
void ftol_tile::render(SDL_Rect camera, SDL_Renderer* passed_renderer, SDL_... | true |
104d8847eec1fd0836b1a9a95445cac9d9f8d723 | C++ | Kunal-khanwalkar/coding-practise | /gfg_mustdo/Strings/makePalindrome.cpp | UTF-8 | 1,047 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void bruteForce(string str)
{
int cnt = 0;
int i,j;
while(str.length())
{
int l = str.length();
int flag = 0;
for(i=0,j=l-1; i<=j; i++,j--)
if(str[i]!=str[j])
{
flag = 1;
break;
}
if(flag == 0)
{
... | true |
34d493dea6873e067026d947c24064b20768f61c | C++ | pragya-chauhan/dsa | /Leetcode/April-Challenge/max-subarray.cpp | UTF-8 | 500 | 3.359375 | 3 | [
"MIT"
] | permissive | // Kadane's Algorithm:
// -2 1 -3 4 -1 2 1 -5 4
// moves from L -> R
// O(1) space Time Complexity
class Solution {
public:
int maxSubArray(vector<int>& nums) {
// INT_MIN == -infinity for atleast one element in an array
// otherwise can be taken as 0 as well, if it was a empty array!
int ... | true |
401ab630883fc228e6b42ecee3074c6f03b2dad8 | C++ | Garciat/competitive | /leetcode/hamming-distance.cpp | UTF-8 | 297 | 2.890625 | 3 | [] | no_license | // https://leetcode.com/problems/hamming-distance/
class Solution {
public:
int hammingDistance(int x, int y) {
int z = x ^ y;
int i = 0;
while (z != 0) {
i += z & 1;
z >>= 1;
}
return i;
}
};
| true |
8a6cd1ad96f7f964a2c619bd80092a4cd0bde52f | C++ | alrus2797/EDA | /Lab4 - Huffman/hNodo.h | UTF-8 | 2,040 | 3.359375 | 3 | [] | no_license | #ifndef HNODO_H
#define HNODO_H
#include <iostream>
using namespace std;
string operator+(const string& a, const int& b) { //outside the class
return a + to_string(b);
}
string operator+(const string& a, const char& b) { //outside the class
return a + to_string(b);
}
class hNodo
{
private:
char... | true |
d243ff47fd40b17618f3a226824d5b9cf722c655 | C++ | lctran/Fight-My-Squad | /lineup.hpp | UTF-8 | 1,260 | 2.9375 | 3 | [] | no_license | /*********************************************************************
** Program name: Project 4 - Fantasy Combat Game TOURNAMENT EDITION
** Author: Laura Tran (932373639)
** Date: 19 NOV 2017
** Description: Creates lineup hpp file. Defines the functions
that will store and remove character* pointers from a lis... | true |
1ed54a31ee66798908e6300784b07e5375318a55 | C++ | LiamDurnst/Parallel-Breadth-First-Search | /good_example/Bag.h | UTF-8 | 2,064 | 3.015625 | 3 | [] | no_license | /*************************************
* Bag.h *
* by Dane Pitkin and Nathan Crandall*
* for CS140 Final Project *
* in Parallel BFS Algorithm *
* *
* *
************************************/
#ifnd... | true |
b7cae607b68c487ef1b5dfd26fd8e57b485c1253 | C++ | alexey-petrusevich/Milestone_1 | /eau2/include/eau2/dataframe/fielders/print_fielder.h | UTF-8 | 565 | 3 | 3 | [] | no_license | #pragma once
#include "fielder.h"
/**
* A Fielder that prints every value of the given row.
*/
class PrintFielder : public Fielder {
public:
/**
* Default constructor of this PrintFielder.
*/
PrintFielder();
// accept method for int
void accept(int i);
// accept method for double
... | true |
f2438c416a3b24913851123df697da33ac637ae0 | C++ | naikkartik/competitive_coding_problem | /project_euler/reverse_bits.cpp | UTF-8 | 344 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
long long int solution(long long int n){
long long count = 0;
long long int ans =0;
while(n>0){
count++;
n = n>>1;
cout<<n<<endl;
}
return ans;
}
int main(){
long long int n;
cin>>n;
long long int ans = solution(n);
... | true |
7a8471d8527ad127820afb9011ce1469670b4fa6 | C++ | hometao/graphene | /qt/plugins/povray_plugin/Scene_graph_converter.h | UTF-8 | 2,945 | 2.84375 | 3 | [] | no_license | #ifndef GRAPHENE_SCENE_GRAPH_CONVERTER_H
#define GRAPHENE_SCENE_GRAPH_CONVERTER_H
#include <graphene/gl/gl_includes.h>
#include <graphene/scene_graph/Scene_graph.h>
#include <graphene/scene_graph/Base_node.h>
#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include <sstream>
using namespace ... | true |
1b534d44f4d2d97d634e432cbb63d0e3fb5ba03d | C++ | bford26/kinetic_psim | /test/core/UtilityTests.cpp | UTF-8 | 496 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include "Utils.hpp"
// testing v2d operations
// testing v3d operations
// testing v3d and v3i interactions
using namespace std;
int main(int argc, char** argv)
{
// all operators +-*/ += -= *= /=
v3d x, x0, dh;
x = {1,1,1};
x0 = {0.5,0.75,0.25};
dh = {0.25,0.25,0.25};
... | true |
068b229285e9070e4ed4141fdc78858894903437 | C++ | Gelio/p3-lab1415 | /2. laby stringi/zadanie_a/planeta.h | UTF-8 | 755 | 2.875 | 3 | [] | no_license | #ifndef PLANETA_H
#define PLANETA_H
#include <set>
#include <ostream>
#include "senator.h"
class KomparatorSenatorow {
public:
bool operator()(const Senator& s1, const Senator& s2);
};
class Planeta
{
private:
// nie modyfikujemy definicji tego pola
const std::string nazwa;
std::set<Senator, KomparatorS... | true |
84ab4453837def44098c494718b44a363ae4561c | C++ | OliverSchmitz/lue | /source/framework/algorithm/test/kernel_test.cpp | UTF-8 | 5,676 | 2.828125 | 3 | [
"MIT"
] | permissive | #define BOOST_TEST_MODULE lue framework algorithm kernel
#include "lue/framework/algorithm/kernel.hpp"
#include "lue/framework/test/stream.hpp"
#include <hpx/config.hpp>
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(kernel_bool_1d)
{
using Weight = bool;
lue::Rank const rank = 1;
using Kernel =... | true |
096222fbbefcb77b26d96f88f3c89a7cb847a43c | C++ | sdarkhovsky/feature_detector | /feature_detector/learner.h | UTF-8 | 17,860 | 2.515625 | 3 | [] | no_license | #pragma once
#include "lpngwrapper.hpp"
#include "param_context.h"
#include <vector>
#include <map>
#include <random>
#include <iostream>
#include <fstream>
using namespace std;
namespace Learner {
static const int num_arm_joints = 3;
class c_statistic
{
public:
void calculate_linear_stat... | true |
5d13b4187eb825d33f74672b4711fd9f1cdc021c | C++ | jwurzer/glslScene | /include/gs/system/file_change_monitoring.h | UTF-8 | 9,097 | 2.65625 | 3 | [
"LicenseRef-scancode-public-domain",
"Zlib",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef GLSLSCENE_FILE_CHANGE_MONITORING_H
#define GLSLSCENE_FILE_CHANGE_MONITORING_H
#include <string>
#include <memory>
#include <map>
#include <set>
#include <thread>
#include <mutex>
#if defined(_MSC_VER)
//#define _WIN32_WINNT 0x0550
#include <windows.h>
#endif
namespace gs
{
/**
* Supports linux and windows.... | true |
e56beecf95ae4c8d99c92db9eaf168c17c24cef1 | C++ | assassint2017/leetcode-algorithm | /Combinations/Combinations.cpp | UTF-8 | 1,113 | 3.453125 | 3 | [] | no_license | // 典型的回溯法
// Runtime: 84 ms, faster than 66.79% of C++ online submissions for Combinations.
// Memory Usage: 11.8 MB, less than 66.84% of C++ online submissions for Combinations.
class Solution
{
public:
vector<vector<int>> combine(int n, int k)
{
// 边界条件处理
if (k <= 0 || n <= 0 ||... | true |
0ddd35e43fa76b1276a6aed1f0d0e799da3adf24 | C++ | alvesrod/tableproject | /Engine/roomcontroller.cpp | UTF-8 | 33,480 | 2.875 | 3 | [] | no_license | #include "roomcontroller.h"
RoomController::RoomController(RoomDescription *description, UserSettings *settings)
{
if (description == NULL) {
qWarning() << "Cannot instantiate a Room Controller without a Room Description.";
return;
}
/* Make sure the Engine is running: */
if (!Engine::... | true |
a0d6ee06d40ac108040e9bec3fafa88f2d8c35ed | C++ | kepkakarol/monopoly | /PunishmentSquare.cpp | UTF-8 | 361 | 2.65625 | 3 | [] | no_license | #include "PunishmentSquare.h"
#include "Player.h"
void PunishmentSquare::doStepAction(std::shared_ptr<Piece> player)
{
std::cout<<"stepping on punishment square; " << "-" << MONEY <<std::endl;
player->payMoney(MONEY);
}
void PunishmentSquare::doPassAction(std::shared_ptr<Piece> player) {
std::cout<<"pass... | true |
2f80de1b223b7c2de72c85693ac3980254dc9537 | C++ | patrikpihlstrom/Convex-Polygon-Editor | /src/map/Quadtree.hpp | UTF-8 | 1,197 | 2.6875 | 3 | [
"Unlicense"
] | permissive | #pragma once
#include <memory>
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <SFML/Graphics.hpp>
#include "../application/Math.hpp"
const unsigned char MAX_LEVEL = 6;
class Quadtree : public sf::Drawable
{
public:
Quadtree();
Quadtree(const sf::Vector2f& position, const ... | true |
209600d7efa942cf094c10f456cad7175eb09b87 | C++ | EeeUnS/2020CppStudy | /week2/study/set.cpp | UTF-8 | 932 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <random>
#include <algorithm>
typedef long long ll;
int main()
{
int a = 0x7FFFFFFF;//max 0111 1111 1111 1111 11111111 1111 1111
int b = 0X80000000; //min
std::cout << a << ' ' << b << '\n';
std::mt19937_64 rng;
rng.seed(std::random_device()());
std::uniform_int_di... | true |
206e043e04e894359dab413c8a989a63071a8290 | C++ | keisuke-kanao/my-UVa-solutions | /Contest Volumes/Volume 100 (10000-10099)/UVa_10098_Generating_Fast_Sorted_Permutation.cpp | UTF-8 | 475 | 2.8125 | 3 | [] | no_license |
/*
UVa 10098 - Generating Fast, Sorted Permutation
To build using Visual Studio 2008:
cl -EHsc -O2 UVa_10098_Generating_Fast_Sorted_Permutation.cpp
*/
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
while (n--) {
string s;
c... | true |
c4c0a345d323a943aff2053311243fb3ea520197 | C++ | Sanerins/Cpp_Progs | /2 semester/8.1 FinalTestHelper/QueueArray.hpp | UTF-8 | 2,388 | 3.390625 | 3 | [] | no_license | #ifndef QUEUE_QUEUEARRAY_HPP
#define QUEUE_QUEUEARRAY_HPP
#include "Queue.hpp"
#include "QueueOverflow.hpp"
#include "QueueUnderflow.hpp"
#include "WrongQueueSize.hpp"
template<typename T>
class QueueArray final: public Queue<T> // модификатор final запрещает наследование от класса
{
public:
explicit QueueArray(siz... | true |
8fdc412810668028f61dd64aee1925bcf4463c7c | C++ | akozlins/util | /spinlock/main.cpp | UTF-8 | 1,305 | 3.03125 | 3 | [] | no_license |
#include <iostream>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
class Mutex
{
private:
class ShortLock
{
public:
volatile long locked;
ShortLock(): locked(0) { }
void lock() { while(BOOST_INTERLOCKED_COMPARE_EXCHANGE(&... | true |
457e8576a2e81ea6485adb72b46ee225917de872 | C++ | MrRen-sdhm/arm_robot_controller | /User/BSP/base_motor.hpp | UTF-8 | 2,735 | 2.921875 | 3 | [] | no_license | #pragma once
#include <cstring>
#include <array>
#include <list>
#include <numeric>
#include <utility>
#include <algorithm>
namespace hustac {
class BaseMotor {
public:
static constexpr float invalid_output = std::numeric_limits<float>::signaling_NaN();
BaseMotor() = default;
explicit BaseMotor(const cha... | true |
c5e08a128637f847ab8fb85e3c50b94eeb9f2ee9 | C++ | davega-code/Algorithms | /Strings/LCP.cpp | UTF-8 | 4,224 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int maxN = 20;
struct tuple
{
int indxs[2];
int pos;
}L[maxN];
int cmp(struct tuple a, struct tuple b) // Check tuples current step and next one to give sorting index.
{
return (a.indxs[0] == b.indxs[0]) ? (a.indxs[1] < b.indxs[1]?1:0) : (a.indxs[0] <... | true |
434c4bcccd2fa779d1b65dade53219282bc80faa | C++ | timkostka/cert3d | /firmware/GSL/inc/gsl_lcd_hx8357d.h | UTF-8 | 19,912 | 2.578125 | 3 | [] | no_license | #pragma once
// This file includes an interface for communicating with an LCD screen through
// the HX8357D controller.
// for instance, on this breakout board:
// https://www.adafruit.com/products/2050
#include "gsl_includes.h"
struct GSL_LCD_HX8357D {
// color scheme
struct ColorSchemeStruct {
uint16_t bac... | true |
30418674db70bd164fdab191d302d8b7e12d7af8 | C++ | MoriokaReimen/MoonRakerServer | /include/Command.hpp | UTF-8 | 4,081 | 2.609375 | 3 | [] | no_license | /*!
-----------------------------------------------------------------------------
@file Command.hpp
----------------------------------------------------------------------------
@@
@@@@@@
@```@@@@
@` `@@@@@@
@@` `@@@@@@@@
@@` `@@@@@@@@@ Tohoku University
@` ... | true |
15ea24e2a0c44c0d34d7f2f2ed759530a58b492d | C++ | carlygrizzaffi/Robotics | /buildacircuit/buildacircuit.ino | UTF-8 | 927 | 2.78125 | 3 | [] | no_license | #include <Servo.h>
int piezo = A0;
int sensorReading = 0;
int threshold = 490;
Servo servoLeft;
Servo servoRight;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
servoLeft.attach(13); // Attach left signal to pin 13
servoRight.attach(12); ... | true |
e58e299a78d3c9ec4872c61d502ea77d4e032248 | C++ | theoemms/Psycles | /Vector3.cpp | UTF-8 | 2,723 | 3.5625 | 4 | [] | no_license | #include "includes.h"
#include <sstream>
#include <string>
#include<math.h>
using namespace std;
Vector3::Vector3(float X, float Y, float Z) //Constructor
{
x = X;
y = Y;
z = Z;
}
Vector3::Vector3()
{
x = y = z = 0;
}
Vector3 Vector3::operator+(const Vector3 rhs)
{
return ... | true |
01bf825d4692d1cf65c9c27040bcc9c93be1df4c | C++ | AugustoPedron/CollaborativeEditor | /Editor/Editor/CRDT/CRDT.h | UTF-8 | 2,258 | 2.6875 | 3 | [] | no_license | #pragma once
#include <vector>
#include <exception>
#include <fstream>
#include <string>
#include <iostream>
#include "Symbol.h"
#include "Message.h"
#include "Cursor.h"
#include "../Editor/UserInterval.h"
#define INSERT 0
#define DELETE_S 1
#define CHANGE 2
class CRDT
{
private:
int m_senderId;
int m_counter;
s... | true |
fddef5f1d61210abfb94eb0c21c17218043bfac6 | C++ | yutaka-watanobe/problem-solving | /Uva/Uva2008/11100/11100Acc.cpp | UTF-8 | 1,592 | 2.625 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
using namespace std;
#define MAX 10000
typedef vector<int> vint;
int bugs[10000001];
int n, size;
class scmp {
public:
bool operator()(const vint& a,const vint &b){
return a.size() < b.size();
}
};
void compute(){
mul... | true |
c1f15cea47daa824f76e378ec196f18beb8d567f | C++ | OnlyCheng/MyCorner | /IsPopOrder.cpp | UTF-8 | 1,296 | 3.71875 | 4 | [] | no_license | //借助一个辅助栈来实现
class Solution {
public:
bool IsPopOrder(vector<int> pushV,vector<int> popV) {
int size1 = pushV.size();
int size2 = popV.size();
if(size1 != size2)
return false;
stack<int> s;//辅助栈
int index = 0;
int i = 0;
for(; i<size2; i++... | true |
c4bf0a1c118823c32d4bea45d45008fa2ca20a01 | C++ | NREL/EnergyPlus | /third_party/Windows-CalcEngine/src/SingleLayerOptics/tst/units/CircularPerforatedCell.unit.cpp | UTF-8 | 4,097 | 2.609375 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | #include <memory>
#include <gtest/gtest.h>
#include "WCECommon.hpp"
#include "WCESingleLayerOptics.hpp"
using namespace SingleLayerOptics;
using namespace FenestrationCommon;
class TestCircularPerforatedCell : public testing::Test
{
private:
std::shared_ptr<CCircularCellDescription> m_DescriptionCell;
std::... | true |
ac16df0f7a30f23ef968cfafe5b772481a17b91d | C++ | vseledkin/SumProductNetwork | /PoonSPN/PoonParameter.h | UTF-8 | 4,326 | 2.796875 | 3 | [] | no_license | /*
Like Poon's "Parameter" class
Stores variables and process arguments
This should be a singleton. The reasoning is that it will be inconviente to make fast changes if I have to pass parmaters or a param object around all the time.
I should pass it into the main class though and try to pass it through as much as po... | true |
a2ff2960abbc8100942015eb4e72ab3cb20f65b9 | C++ | INFO-ID-2018-2021/POO | /Problema 1/Problema 1.cpp | UTF-8 | 409 | 3.25 | 3 | [] | no_license | // Problema 1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "Rational.h"
int main()
{
try {
Rational<int> f = Rational<int>(2, 3);
Rational<int> g = Rational<int>(2);
Rational<int> h = f / g;
std::cout << h;
}
catch (std::invalid_argu... | true |
bcf9d706f4cafaabc34865b8ae5c1025230c070b | C++ | chrishaukap/GameDev | /angel_1_1/Code/Tetris/Game.cpp | UTF-8 | 2,892 | 2.671875 | 3 | [] | no_license | #include "StdAfx.h"
#include "Game.h"
#include "Grid.h"
#include "Block.h"
#include <assert.h>
using namespace CDH;
using namespace Tetris;
#define DEBUG_BLOCKS
#define BLOCK_MOVE_SPEED 1.0f
#define BLOCK_FALL_SPEED 0.5f
const float Game::BlockMoveSpeed = BLOCK_MOVE_SPEED;
Game::Game(CHUint rows, CHUint cols) :
m_... | true |
dac353dcf2b2e31a8b27fe001f28276537f90b38 | C++ | AlexHeiden/Portfolio_cpp | /A4/main.cpp | UTF-8 | 2,884 | 3 | 3 | [] | no_license | #include <iostream>
#include <stdexcept>
#include <memory>
#include "shape.hpp"
#include "rectangle.hpp"
#include "circle.hpp"
#include "base-types.hpp"
#include "matrix.hpp"
#include "composite-shape.hpp"
int main()
{
try
{
stepanov::Rectangle rectangleForFirstLayer({ 4.0, 2.0, {0.0, 0.0} });
... | true |
0a1678884cd29a9eeee186621807585a6a933fe7 | C++ | Seottle/OJ-RESOLUTION | /POJ/1077/12856833_AC_750ms_8124kB.cpp | UTF-8 | 3,278 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <stack>
using namespace std;
//A* 八数码问题
int idist[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
char strpath[4] = {'d', 'u', 'r', 'l'};
char key[10];
int factor[10];
struct _Node{
int val, pos;
int f, g, h;
_N... | true |
921f23d6bf47bb46187d80ce0bd2eb26982f7c29 | C++ | SpaceMonkeyClan/FreeNOS-1.0.3 | /lib/libstd/Index.h | UTF-8 | 5,489 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2015 Niek Linnenbank
*
* 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 di... | true |
4eb02e5b4009dba3eb1bb4be42a628ce1847c5f2 | C++ | weimingtom/db-verkstan | /db-util/src/helpers.cpp | UTF-8 | 2,022 | 2.9375 | 3 | [] | no_license | #include "db-util.hpp"
Vec3 normalize(const Vec3 &v)
{
float l = length(v);
if (l != 0.0f)
{
return v / l;
}
else
{
return Vec3(1, 0, 0);
}
}
Vec2 normalize(const Vec2 &v)
{
float l = length(v);
if (l != 0.0f)
{
return v / l;
}
else
{
return Vec2(1, 0);
}
}
Vec3 cros... | true |
461726f11d4533d1f228691816a51cf1624b57b6 | C++ | bsmith18/Roboscape | /ExampleCode/Threading/Threading.cpp | UTF-8 | 4,443 | 2.8125 | 3 | [] | no_license | // Threading.cpp
/* This program introduces a thread that handles images as they come into a queue from the
* EventHandler.
*/
#include "roboscape.h"
static uint32_t numGrabbed = 0;
static deque<Mat> cvQueue;
// Number of images to be grabbed.
static const uint32_t c_countOfImagesToGrab = 1000;
static const int b... | true |
6c16c71f1f4843232353a03df7d1d11d649c4c82 | C++ | UnnamedOrange/OI | /Source Code/图论/二分图匹配 模板.cpp | UTF-8 | 1,871 | 2.578125 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
typedef int INT;
using std::cin;
using std::cout;
using std::endl;
inli... | true |
46b38e195d56828647f724aa021c6c71a57bb20d | C++ | Grandmother/stroustrup_book_tasks | /chapter 4/exercise10.cpp | UTF-8 | 864 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int random(int number)
{
int result;
if ( number > 10 )
{
result = number * (number % 100);
return result;
}
return 4;
}
int main()
{
enum variant {STONE=0, SCISSORS, PAPER};
int turn = 31;
cout << "Press any key to start.\n";... | true |
64640c64e36eac9f66edb51994df53d228f7a986 | C++ | DeagleGross/C-Algo-Structures | /Algorithms/KDZ/Debugger.h | UTF-8 | 732 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <vector>
#ifndef KDZ_DEBUGHELPER_H
#define KDZ_DEBUGHELPER_H
class DebugHelper
{
public:
void logMatrix(const vector<vector<int>>& matrix)
{
std::cout << "\nMatrix::\n";
for (int i = 0; i < matrix.size(); ++i)
{
for (int j = 0... | true |
16fd192c2f43998156757b5a7e5f92de071ffe02 | C++ | regehr/solid_code_class | /compress/group4/test/1each-gen.cpp | UTF-8 | 459 | 2.8125 | 3 | [] | no_license | #include <algorithm>
#include <vector>
#include <cstdio>
#include <cassert>
int main(int argc, char* argv[]) {
char bytes[256];
for (int i = 0; i < 256; i++)
bytes[i] = i;
std::random_shuffle(bytes, bytes+256);
FILE* out = fopen("1each.bin", "w");
assert(out != NULL);
// Ain't nobody got time for wri... | true |
6c28e87d6e218d1f6081ea18cca2a00db604dfe1 | C++ | anukritiagarwal/OOP_Programs-CPP- | /A1.CPP | UTF-8 | 443 | 2.796875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
struct details
{
char name[30];
int age;
int employeeid;
};
int main()
{
struct details d;
clrscr();
printf("enter name\n");
gets(d.name);
printf("enter age\n");
scanf("%d",&d.age);
printf("enter the id\n");
scanf("%d",&d.employeeid);
printf("name of employee:%s \n"... | true |
5fb3adfcba1ed9fbbff89c0a843cd5d8e341f6b7 | C++ | cesarvr/ZEnginePlus | /ZEnginePlus/zeBuffer.cpp | UTF-8 | 875 | 2.640625 | 3 | [] | no_license | //
// zeBuffer.cpp
// ZEnginePlus
//
// Created by Cesar Luis Valdez on 12/09/13.
// Copyright (c) 2013 Cesar Luis Valdez. All rights reserved.
//
#include "zeBuffer.h"
void zeBuffer::crearVertexBuffer(float *vertices, int size){
std::cout << "sizeoffloat:" << sizeof(float)<< std::endl;
int co... | true |
4f3d16d34d856c1c8a4410bbfb65268e87f76776 | C++ | kasprus/zpr_game | /Communication/gamescoremessage.cpp | UTF-8 | 704 | 2.65625 | 3 | [] | no_license | #include "gamescoremessage.h"
#include "communication.h"
#include "messagevisitor.h"
namespace Communication {
GameScoreMessage ::GameScoreMessage(int playersCount) : scores(playersCount, 0), playersCount(playersCount)
{
}
GameScoreMessage::~GameScoreMessage() {
}
int GameScoreMessage::getHeader() const {
ret... | true |
2b6f796397e79a3755fdc356da340170ef6e5b58 | C++ | DarranThomas/FileSimilar_GUI | /Similarities/Win32/CMemory.cpp | UTF-8 | 11,022 | 2.53125 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////////
#include "pch.h"
///////////////////////////////////////////////////////////////////////////////////
#include "macro.h"
///////////////////////////////////////////////////////////////////////////////////
#include "CMemory.h"
/////... | true |
8ea006166ff4b51cee4a1987089e8b3a87f0a778 | C++ | dincerunal/design_patterns | /022-Memento/devicememento/Project/DeviceInfo.h | UTF-8 | 687 | 2.71875 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <cstdint>
#include <cstddef>
#include <memory>
class DeviceInfoMemento;
class DeviceInfo { // Originator
public:
DeviceInfo(const std::string &name, const std::string &url)
: m_name(name), m_url(url)
{}
public:
std::string GetName() const { return m_nam... | true |
441c66334c03f6d95eb9b60fbd971fdb82a92bde | C++ | toteisla/Tanks-Game-Client- | /lmc/Cliente/Game.cpp | UTF-8 | 6,168 | 2.546875 | 3 | [] | no_license | #include "game.h"
void Game::guardar_config(){
cout << "Guardando configuracion" << endl;
ofstream file;
file.open("config.txt");
if (file.is_open()) {
file << "res_w " << resX << endl;
file << "res_h " << resY << endl;
if (ventana_completa)
file << "completa 1" << ... | true |
030ef55c3ab395ea84f28eb20788dac88515efd3 | C++ | Boldie/cpp14ByExamples | /A3E_RangeBased_Solution.cpp | UTF-8 | 556 | 3.4375 | 3 | [] | no_license | /*
* A1_RangeBased.cpp
*
* Created on: 28 Feb 2017
* Author: sven
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
{
vector<int> myVec{1,2,3,4,5,6,7,8,9,10};
for (auto &x: myVec)
x = x * x;
for (const auto x: myVec)
cout << x << " ... | true |
5a48565854ded3d028af2d23bf7e9dcfa6d5ccdb | C++ | kjuk02/repository | /c++/복소수/복소수/header_cpp.cpp | UTF-8 | 4,489 | 3.625 | 4 | [] | no_license | #include "header.h"
// Constructor
myComplex::myComplex(int real, int imag)
{
realPart = real;
imaginaryPart = imag;
} // Copy constructor
myComplex::myComplex(const myComplex& number)
{
realPart = number.realPart;
imaginaryPart = number.imaginaryPart;
} // Accessor functions
int myComplex::getRealPart() con... | true |
4de7847ae5107987bef808e03c61e5b7786fe65d | C++ | niuxu18/logTracker-old | /second/download/git/gumtree/git_repos_function_6363.cpp | UTF-8 | 833 | 2.75 | 3 | [] | no_license | static int convert_date_line(char *dst, void **buf, unsigned long *sp)
{
unsigned long size = *sp;
char *line = *buf;
char *next = strchr(line, '\n');
char *date = strchr(line, '>');
int len;
if (!next || !date)
die("missing or bad author/committer line %s", line);
next++; date += 2;
*buf = next;
*sp = siz... | true |
8f9d42fe6399fd1f6792364ea55b6afc3598931d | C++ | conanwu777/CPP_piscine | /day04/ex02/Squad.cpp | UTF-8 | 1,215 | 2.796875 | 3 | [] | no_license | #include "ISquad.hpp"
#include "Squad.hpp"
#include "ISpaceMarine.hpp"
Squad::Squad() : units(NULL), count(0){}
Squad::Squad(Squad & src) : units(NULL), count(0){
*this = src;
}
Squad::~Squad(){
for (int i = 0; i < this->count; i++) {
delete this->units[i];
}
delete this->units;
}
Squad & Squad::operator=(Squ... | true |
a5e8a5b6c47f02076f4d611055bbc8ffd7fd5acb | C++ | olinanton/RopeSlinger | /Game/Main.cpp | UTF-8 | 297 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include "Window.h"
int main(int argc, char* argv[])
{
Window window("My Game", 500, 500);
if (window.Init())
{
while (window.IsRunning())
{
window.Update();
}
}
else
{
std::cerr << "Initialization failed with SDL error code: " << SDL_Error;
}
return 0;
} | true |
58d6489db9e6453291521e54c438c8924fd4d78e | C++ | hov001/data-structures | /stack/validParentheses.cpp | UTF-8 | 1,172 | 3.96875 | 4 | [] | no_license | #include<iostream>
#include<stack>
#include<string>
using namespace std;
bool isOpen(char ch)
{
return ch == '{' || ch == '[' || ch == '(';
}
bool isPair(char open, char close)
{
return open == '{' && close == '}' ||
open == '[' && close == ']' ||
open == '(' && close == ')';
}
bool isBalanced(st... | true |
1f03d078a2a9086a87d7c8515a6894112557f734 | C++ | vmmc2/Competitive-Programming | /UVA 00336 - A Node Too Far.cpp | UTF-8 | 2,049 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <sstream>
#include <cmath>
#define pb push_back
#define INF 99999999
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
vector<int> adjlist[100000];
int visitados[100000];
int dist[100000];
void reset_graph(){
for(int i = 0; i < 100000; i++){
adj... | true |
a4bdd1b13cb04cf6f9f26b4981f68039ece03581 | C++ | ChihMin/UVA_code | /11297.cpp | UTF-8 | 2,279 | 2.6875 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
#define N 600
using namespace std;
const int INF = 2147483647 ;
const int _INF = -2147483647;
struct Packet{
int max , min ;
};
struct ST{
ST *L , *R ;
int min , max;
ST(){
min = INF , max = _INF ;
L = R = 0;
}
} *root[N];
int n , m ;
int MAP[N][N] ;
void build( in... | true |
22ec8580f5dc6e6e6060ca1844467a259521a356 | C++ | ufoproger/calgon | /lab3.cpp | UTF-8 | 5,438 | 3 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>
#include <algorithm>
#include <type_traits>
#include "flags.hh/Flags.hh"
#include "lab2_types.hh"
bool debug = false;
vv readFromFile(const std::string &filename, bool skipOrientation)
{
std::ifstream fin(filename);
vv m;
... | true |
051162381b70f025c3931e38c369c116167f4d52 | C++ | eightofeighteen/BigInteger | /sharedmemory2.cpp | UTF-8 | 2,518 | 3.15625 | 3 | [] | no_license | #include "sharedmemory2.h"
SharedMemory2::SharedMemory2()
{
if (DEBUG) std::cout << "Init SharedMemory2." << std::endl;
//root = 0;
rootMemoryController = 0;
}
SharedMemory2::~SharedMemory2()
{
if (DEBUG) std::cout << "Destruct SharedMemory2 - " << this << std::endl;
detachMemoryController();
... | true |
9aa4aa2c04d4235fa2004250cfd1f68f2ae60f80 | C++ | zinsmatt/Programming | /LeetCode/medium/Minimum_Domino_Rotations_For_Equal_Row.cxx | UTF-8 | 838 | 2.625 | 3 | [] | no_license | class Solution {
public:
int minDominoRotations(vector<int>& tops, vector<int>& bottoms) {
int res = -1;
for (int k = 1; k <= 6; ++k) {
int nb_top = 0, nb_bot = 0;
int count = 0;
for (int i = 0; i < tops.size(); ++i) {
bool ok = false;
... | true |
14e163692a84f07a6cf763498b1fac4ac1e6c2ef | C++ | jthanh8144/CPlusPlus | /VScode/abc.cpp | UTF-8 | 848 | 3.5 | 4 | [] | no_license | #include <iostream>
using namespace std;
int can(int s[], int i, int j) {
int sum = 0;
for (int k = i; k <= j; k++) {
sum += s[k];
}
return sum;
}
int ABC(int s[], int i, int j) {
if (i >= j)
return 0;
int tmp = (j-i+1)/3;
int a = can(s, i, i + tmp -1);
int b = can(s, i... | true |
4ff9a88adc75722871d64f04ac555b2a68284458 | C++ | mt2522577/TranMelvin_CSC5_40717 | /Class_Lab/GameOfLife/main.cpp | UTF-8 | 776 | 2.875 | 3 | [] | no_license | /*
* File: main.cpp
* Author: melvintran
*
* Created on February 4, 2015, 10:59 AM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
const int COL=30;
//Function Prototype
void filAray(char [][COL],int,char);
void prntAry(char [][COL],int);
void inject(char [... | true |
dfc31d0bc72b7836461d9ca8731716bfe175c0e9 | C++ | fernandoperez0330/Gestor-Monedas | /Lista.cpp | UTF-8 | 1,476 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include "Lista.h"
Lista::Lista(){
primero = NULL;
ultimo = NULL;
size = 0;
}
Objeto* Lista::getPrimero(){
return primero;
}
int Lista::getSize(){
return this -> size;
}
Objeto* Lista::getUltimo(){
return ultimo;
}
void Lista::agregar(Objeto* objeto){
if (getPrimero(... | true |
1ccd1fdb81b16e79a18d657413f3d949867fadf3 | C++ | Matbe34/EDA-FIB | /Divide_&_Conquer/P29212_ca/P29212.cc | UTF-8 | 299 | 3.125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int quick(int n, int k, int m){
if(k == 0) return 1;
int aux = quick(n,k/2,m)%m;
if(k%2 == 0) return (aux*aux)%m;
return (((aux*aux)%m)*n)%m;
}
int main(){
int n, k, m;
while(cin >> n >> k >> m){
cout << quick(n,k,m) << endl;
}
}
| true |
913fd4ce36ef02ce6f3d6b97f26be91f4800ff80 | C++ | Bluemi/FourWins3D | /src/misc/Debug.hpp | UTF-8 | 965 | 2.84375 | 3 | [] | no_license | #ifndef __DEBUG_CLASS__
#define __DEBUG_CLASS__
#include <vector>
#include <string>
#include <fstream>
#define NOTE_COLOR FBLUE
#define ERROR_COLOR FRED
#define WARN_COLOR FYELLOW
#define TEST_COLOR FPURPLE
#define DEFAULT_COLOR "\u001B[0m"
#define FBLACK "\u001B[30m"
#define FRED "\u001B[31m"
#define FGREEN "\u001B... | true |
1248638810bd9f19792369a309f328712bd2dfd4 | C++ | Striiderr/DSA | /Assignments/Day3/Recurn_Sort.cpp | UTF-8 | 1,159 | 2.75 | 3 | [] | no_license | #include<iostream>
using namespace std;
void swap(int *x, int *y){
int t;
t=*x;
*x=*y;
*y=t;
}
int Max(int a[],int n,int &max,int &loc){
if(n==0){
if(a[0]>max){max=a[0]; loc=0;}
else{max;}
return a[0];
}
else{
if(a[n]>max){ max=a[n]; loc=n;}
else{max;}
return a[n]+ Max(a,n-1,max,loc);
}... | true |
838ad43850a98d2be5c060ceb8e8a717aeceb7c9 | C++ | weidingbang/SamSelect | /UseCount.cpp | UTF-8 | 747 | 2.59375 | 3 | [] | no_license | /*============================================
# Filename: UseCount.cpp
# Ver 1.0 2014-06-08
# Copyright (C) 2014 ChenLonggang (chenlonggang.love@163.com)
#
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 Foundat... | true |
105e4c854969946e0e77d223e567f933557708d4 | C++ | DionysiosB/CodeChef | /SALARY.cpp | UTF-8 | 453 | 2.75 | 3 | [] | no_license | #include <cstdio>
#include <vector>
int main(){
int t; scanf("%d\n", &t);
while(t--){
int n; scanf("%d\n", &n);
std::vector<long> a(n);
long min = 10000001;
for(int p = 0; p < n; p++){
scanf("%ld", &a[p]);
min = (a[p] < min) ? a[p] : min;
}
... | true |
efae4c15dc378191ae3c3a5072058f9edd582a6e | C++ | lokehoke/Morph-1 | /src/python/function.h | UTF-8 | 9,685 | 2.75 | 3 | [] | no_license | #pragma once
#include "python/cast.h"
#include "python/pythonapi.h"
#include <tuple>
#include <type_traits>
#include <utility>
namespace py
{
template <typename... Args>
struct Init {};
namespace detail
{
template <typename Return, typename... Args>
struct FnSignatureT {};
template <typename T>
struct FnSignat... | true |
3832e3916e42013e1289108fa378c4c52c93687f | C++ | bcavus/SergeantEngine | /Sergeant3DEngine/Core/Vertex/vertex.h | UTF-8 | 392 | 2.890625 | 3 | [] | no_license | #include <glm.hpp>
#ifndef VERTEX_H
#define VERTEX_H
class Vertex {
public:
Vertex(const glm::vec3 &position, const glm::vec2 &tex_coord, const glm::vec3& normal);
~Vertex();
const glm::vec3 &Position() const;
const glm::vec2 &TexCoord() const;
const glm::vec3& Normal() const;
private:
glm::vec3 m_position;
... | true |
4b06ab35cd55647b45235f167d59f6fc28ecda06 | C++ | halilg/NoiseTreeOps | /CycledH1D.h | UTF-8 | 3,618 | 3.453125 | 3 | [] | no_license | #ifndef CycledH1D_h_
#define CycledH1D_h_
//
// A wrapper around TH1D which implements ManagedHisto interface
// and knows how to fill the underlying root histogram in a cycle.
// Use the "CycledH1D" helper function to create instances of this
// wrapper.
//
// I. Volobouev
// March 2013
//
#include "ManagedHisto.h"
... | true |
4ec3bbf746ec5ed7c3a0eba353bfbc001f53c482 | C++ | mvp18/Embedded-Systems-Codes | /Expt7/7c.ino | UTF-8 | 1,920 | 2.828125 | 3 | [] | no_license | int sine [255];
const int POT = A0;
int value = 0;
int freq = 0;
int amp = 0;
int data1 = 0;
int data2 = 0;
int data3 = 0;
int frequency;
int freqCurrent;
unsigned int freqscaled;
void setup () {
pinMode ( 2 , OUTPUT );
pinMode ( 3 , OUTPUT );
pinMode ( 4 , OUTPUT );
pinMode ( 5 , OUTPUT );
pinMode ( 6... | true |
83a1c8d006346a1e34c339cdf0c441e2dad293c1 | C++ | SebasDiaz01182/I-Proyecto-Programado-Trenes | /CodigoFuente/listaDoble.h | UTF-8 | 1,892 | 3.359375 | 3 | [] | no_license |
#include <iostream>
using namespace std;
class nodoDoble {
public:
nodoDoble(string v)
{
valor = v;
siguiente = NULL;
anterior =NULL;
}
nodoDoble(string v, nodoDoble * signodoDoble)
{
valor = v;
siguiente = signodoDoble;
}
string valor;
... | true |
4f9394d31663e80cb24a3de2914d06f0fc35b07d | C++ | anhle199/Code_Cpp | /Projects/Poker/main.cpp | UTF-8 | 1,962 | 2.828125 | 3 | [] | no_license | // main.cpp
#include "cardGame.h"
int main()
{
int n(6), s, choice;
const int start(1), end(5);
vector<vector<int>> deck(SUITS, vector<int>(FACES, 0));
vector<INFO_HAND> info_card(CARDS);
vector<int> ranking(n), ranking_s_times;
system("cls");
do
{
cout << "-------------------... | true |
102cf2a8cbb849719a8302079521b7364dc90b45 | C++ | avast/retdec | /src/utils/math.cpp | UTF-8 | 635 | 2.921875 | 3 | [
"MIT",
"Zlib",
"JSON",
"LicenseRef-scancode-unknown-license-reference",
"MPL-2.0",
"BSD-3-Clause",
"GPL-2.0-only",
"NCSA",
"WTFPL",
"BSL-1.0",
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] | permissive | /**
* @file src/utils/math.cpp
* @brief Mathematical utilities.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include "retdec/utils/math.h"
namespace retdec {
namespace utils {
/**
* @brief Counts all 1 bits in the given number.
*/
unsigned countBits(unsigned long long n) {
unsigned count... | true |
19883d79b1763e5a9edecb7817ee89a4a69debf5 | C++ | shravanAngadi/seafile-client | /src/api/commit-details.cpp | UTF-8 | 1,475 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | #include "commit-details.h"
namespace {
QString getStringFromJsonArray(const json_t *array, size_t index)
{
return QString::fromUtf8(json_string_value(json_array_get(array, index)));
}
void processFileList(const json_t *json, const char *key, std::vector<QString> *files)
{
json_t *array = json_object_get(jso... | true |
5ddbdb19d8341c21de2861d498b284445d5245ee | C++ | longyangzz/OpenVizEarth | /src/Core/DCScene/scene/ScreenshotHandler.h | UTF-8 | 742 | 2.578125 | 3 | [] | no_license | #ifndef _SCREENSHOT_HANDLER_H_
#define _SCREENSHOT_HANDLER_H_
#include <QtCore/QObject>
#include <osg/Image>
#include <osgViewer/ViewerEventHandlers>
class ScreenshotHandler :
public QObject, public osgViewer::ScreenCaptureHandler::CaptureOperation
{
Q_OBJECT
public:
ScreenshotHandler(const std::string... | true |
a95989db272759fcd9509696849a13ca1aa5d6a6 | C++ | cubeman99/RussianStudyTool | /source/gui/Widget.h | UTF-8 | 2,398 | 2.84375 | 3 | [] | no_license | #pragma once
#include "gui/GUIObject.h"
#include "gui/KeyShortcut.h"
class Layout;
class Widget : public GUIObject
{
public:
friend class GUIManager;
Widget();
virtual ~Widget();
const AccentedText& GetWindowTitle() const { return m_windowTitle; }
Layout* GetLayout() const { return m_layout; }
bool IsFocus... | true |
fa27501b4ee957f80771a6fdd29653a7daf44842 | C++ | Jim-Holmstroem/dd2447_project | /src/randomize.cpp | UTF-8 | 14,756 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <iterator>
#include <functional>
#include <algorithm>
#include <numeric>
#include <vector>
#include <cmath>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <strings.h>
#include <sys/time.h>
/*
* The SGI std::identity newer made it to the std :(
* However it's kinda easy... | true |
de5434fd6c84c9568c9c7e320c959f7407ee294a | C++ | PESITSouthCompSoc/vtu-cse-resources | /10CSL68-USP_and_CD_Lab/02/02.cpp | UTF-8 | 2,293 | 2.9375 | 3 | [] | no_license | /*
* Authored & Documented by:
Aditi Anomita Mohanty
github.com/rheaditi
Abinav Nithya Seelan
github.com/abinavseelan
* Problem Statement:
Write a C/C++ POSIX compliant program that prints the POSIX
defined configuration options supported on any given system
using feature test macros.
* Description... | true |
630e62fd28cb6e5b77f267558da19be1afa16677 | C++ | MonZop/BioBlender21 | /scivis_tool/Point3f.h | UTF-8 | 2,868 | 3.390625 | 3 | [
"BSD-2-Clause"
] | permissive | //----------------- PUNTI -----------------------
#include <math.h>
#include <stdio.h>
#pragma once
class Point3f
{
protected:
float _v[3];
public:
// Costruttori & assegnatori
inline Point3f()
{
_v[0] = 0;
_v[1] = 0;
_v[2] = 0;
}
inline Point3f( const float nx, const float ny, const float nz )
{
... | true |
bb3aca2167ef8a4280b7916d56e6f5f4a742cc27 | C++ | JoeCitizen/EtherPi | /Send.cpp | UTF-8 | 1,315 | 2.84375 | 3 | [] | no_license | #include <Common.h>
#include <Send.h>
namespace EtherPi
{
void Send::Init()
{
wiringPiSetupGpio();
pinMode(GPIO::Data_0, OUTPUT);
pinMode(GPIO::Data_1, OUTPUT);
pinMode(GPIO::Data_Ready, OUTPUT);
pinMode(GPIO::Data_Acknowledge, INPUT);
pullUpDnControl(GPIO::Data_Acknowledge, PUD_DOWN);
TurnOffDa... | true |
1e5c1b4f34025d8feddcc77a555e19b4cc892e16 | C++ | dushyant-goel/leetcode | /152.MaximumProductSubarray.cpp | UTF-8 | 485 | 2.859375 | 3 | [] | no_license | class Solution
{
public:
int maxProduct(vector<int> &nums)
{
int min_prod, max_prod, res;
res = min_prod = max_prod = nums[0];
for (int i = 1; i < nums.size(); i++)
{
int t1 = max_prod;
int t2 = min_prod;
max_prod = max({nums[i], t1 * nums[... | true |
94a376ae5fd694aa269959a11f3bee65436294e7 | C++ | gnishida/TensorTest | /TensorTest/main.cpp | UTF-8 | 14,505 | 2.84375 | 3 | [] | no_license | #include <glm/glm.hpp>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <random>
#include <iostream>
#include <list>
#ifndef M_PI
#define M_PI 3.14159265358
#endif
double delta = 1e-6f;
/**
* 座標pt、角度angleから開始して1本の道路を生成する。
*
* @param size ターゲットエリアの一辺の長さ
* @p... | true |
cd0a6c8f3a10000d388529ffc224a71546512175 | C++ | dmbonsall/BeagleBoneBlackIOLib | /inc/HardwareDevice.hpp | UTF-8 | 4,740 | 3.515625 | 4 | [] | no_license | /**
* @file HardwareDevice.h
* @author David Bonsall
* @version 1.0
* @see HardwareDevice.cpp
* TODO Need to set all appropriate methods to const and do the same for other classes
*/
#pragma once
#include <string>
/**
* Enumeration describing the different device types for any known children
* of the ::Hardw... | true |
22b526c4325fdd4d9df606d04a32fac58ca50874 | C++ | Shubham16103020/codes | /char_pointer.cpp | UTF-8 | 376 | 2.9375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int i =65;
char c = i;
cout<< c<<endl;
int *p = &i;
char *pc =(char*) &i;
cout<<*p<<endl;
cout<< *pc <<endl;
cout<< p <<endl;
cout << pc <<endl;
// int typecasing
cout<< " int typecasting "<<endl;
char ck ='A';
int k = ck;
cout<< k<<endl;
char *cl = &ck;
int *pl =(i... | true |
1848d1ae7adcd4c934d1ee4ab4daf2c382b3fd06 | C++ | ArghaKamalSahoo/class | /dyna_init_constu.cpp | UTF-8 | 1,349 | 3.46875 | 3 | [] | no_license | #include<iostream>
using namespace std;
class fixed_deposit
{
long int p_value;
int year;
float rate;
float R;
public:
fixed_deposit(){}
fixed_deposit(long int p,int y,int r);
fixed_deposit(long int p,int y,float r=0.12);
void display(void);
};
fixed_deposit::fixed_deposit(long int p,int... | true |
ae1d33146a26d6e7528858c0e6d4f30407d27b22 | C++ | Team302/Y1Bot2016 | /LoadBall.cpp | UTF-8 | 2,248 | 2.75 | 3 | [
"MIT"
] | permissive | /*=============================================================================================
* LoadBall.cpp
*=============================================================================================
*
* File Description:
*
* This controls loading a ball into the shooter.
*=================================... | true |
63ae23e3b4b6fa6f7e3465e4135af03935b15e7f | C++ | goo-gy/Algorithm | /baekjoon/3830_unionFind.cpp | UTF-8 | 1,709 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int N, M;
vector<int> v_parent;
vector<long long> v_weight;
void reset()
{
v_parent.clear();
v_weight.clear();
}
int find(int node)
{
if (v_parent[node] == -1)
return node;
int root = find(v_parent[node]);
v_weight[node] += v_wei... | true |
ef361b15b2e9aa92781e70082cf3a876fdc3b88e | C++ | Bob1Bob/eli-roject | /SFML Learn 1/Weapon.cpp | UTF-8 | 1,574 | 2.828125 | 3 | [] | no_license | #include "Weapon.h"
Weapon::Weapon(sf::Mouse mouse, Player play)
{
}
void Weapon::fireWeapon(sf::Mouse mouse, Player play, sf::RenderWindow & window)
{
m_mouse = mouse;
m_play = play;
sf::Vector2i mousePos = mouse.getPosition(window);
m_mousePosition = window.mapPixelToCoords(mousePos);
float changeInY =... | true |
e85204dcc9dbbc37d6c43e94904c5f4985816592 | C++ | hthuwal/competitive-programming | /old/mixed/cpp/cubnum.cpp | UTF-8 | 573 | 2.6875 | 3 | [] | no_license | #include <cstdio>
#define N 111111
#define f(i,k,n) for(int i=k;i<n;i++)
int cubes[50]; //49^3 > N
int dp[N];
void cube()
{
f(i,0,50) cubes[i]=i*i*i;
}
void dyn()
{
int x;
dp[0]=0;
f(i,1,N)
{
dp[i]=N;
f(j,1,50)
{
x = j*j*j;
if(x > i)
... | true |
9a0c8e57d888e1630944456a35c577e512b8eaf9 | C++ | byeongkeunahn/word2vec | /word2vec/heap.h | UTF-8 | 400 | 3.09375 | 3 | [] | no_license |
#pragma once
typedef struct {
int id;
int num;
} heap_data;
class heap
{
public:
heap(int nmax);
~heap();
void add(const heap_data &item);
heap_data extract_min();
int count() const;
int min_id() const;
int min_num() const;
private:
void bubble_up(int idx);
void bubble_do... | true |
8435038483dd9934990a3c8dfe1ec13e8dbd5d71 | C++ | huakaitingqian/MHE_new | /Classes/CompeteStateController.cpp | WINDOWS-1252 | 1,998 | 2.578125 | 3 | [] | no_license | #include "CompeteStateController.h"
USING_NS_CC;
CompeteStateController::CompeteStateController()
{
time = 0;
visibleSize = Director::sharedDirector()->getVisibleSize();
}
CompeteStateController::~CompeteStateController()
{
}
CompeteStateController* CompeteStateController::create(NPC* npc, Vec2 gravity, BulletMan... | true |
53cced7a766ecf0e34ae33eb3b0916439d744230 | C++ | blueskin90/piscine_cpp | /d03/ex01/ScavTrap.cpp | UTF-8 | 3,811 | 3.1875 | 3 | [] | no_license | #include "ScavTrap.hpp"
ScavTrap::ScavTrap(void) : _hp(ScavTrap::maxhp), _ep(ScavTrap::maxep), _level(1), _name("Unnamed"), _meleeDamage(20), _rangedDamage(15), _armorReduc(3)
{
std::srand(time(NULL));
std::cout << "Vanilla SC4V-TP was born, behold it's mightiest scavenging abilities !" << std::endl ;
}
ScavTrap::S... | true |
0dea50e167b70273f234a20a9995e7a872c1cfb0 | C++ | remram44/bomberlua | /Display.cpp | UTF-8 | 9,077 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "Display.h"
#include <sstream>
static SDL_Surface *loadImage(const char *path) throw(Display::InitException)
{
SDL_Surface *surf = IMG_Load(path);
if(!surf)
{
std::ostringstream oss;
oss << "Error loading: " << path << " : " << IMG_GetError ();
throw Display::InitException... | true |
d840c16feb1863f4d41de9a25fd92495d3fe83db | C++ | deSigntheClutch/competitive-programming-code-repository | /Codeforces/Gym/2015-2016 Petrozavodsk Winter Training Camp, Makoto rng_58 Soejima Сontest 4/B.cpp | UTF-8 | 1,761 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define debug(x, a, b) for(int (ii)=(a);(ii)<(b);(ii++)) printf("%d: %d\n", ii, x[ii]);
#define mp make_pair
#define pb push_back
#define fi first
#define se second
const int N = 1e5 + 10;
struct edge {
int x, y, cost;
bool operator < (struct edge e) const {
... | true |
354883ee85e3d0ace33928ee9a471200c065e45f | C++ | ibrahimshiyam/SymphonyIDE | /ide/plugins/interpreter/external-system-template/src/QuoteSenderExample.hpp | UTF-8 | 2,056 | 2.53125 | 3 | [] | no_license | #ifndef CO_SIMULATION_QUOTE_HPP
#define CO_SIMULATION_QUOTE_HPP
#include <iostream>
#include <CoSimulationTransportLayer.hpp>
#include <CoSimulationFramework.hpp>
#include "ExternalSystem.hpp"
namespace ExternalSystem
{
//callback class, will be called by the cosim framework
class QuoteSenderExampleImpl : public ... | true |