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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
053fc3ffd63fc144bb56282996fab112cc691fc1 | C++ | hasiek/IVsem | /OJP/Tekstowa/Goal.h | UTF-8 | 242 | 2.625 | 3 | [] | no_license | #pragma once
class CGoal {
int x;
int y;
int side;
public:
CGoal();
CGoal(int x1, int y1, int side1);
void set_x(int x1);
void set_y(int y1);
void set_side(int side1);
int get_x();
int get_y();
int get_side();
~CGoal();
};
| true |
3f39e61068fabbe16fb73bbd61e0d99a25328826 | C++ | abhishekchandra2522k/CPPrograms | /Basic/perfect_number.cpp | UTF-8 | 544 | 3.734375 | 4 | [] | no_license | #include <iostream>
using namespace std;
// A perfect number is one whose sum of divisors is equal to the number itself
class Solution
{
public:
bool isPerfect(int n)
{
int sum = 1;
for (int i = 2; i < n; i++)
{
if (n % i == 0)
{
sum += i;
... | true |
daa55beb6ab0f9d6417ef93b5aaadc5b87438d12 | C++ | Kozoriz/PointClasteringTool | /src/Model/Common/ValueStamp.h | UTF-8 | 509 | 2.734375 | 3 | [] | no_license | #ifndef __VALUESTAMP__
#define __VALUESTAMP__
#include "utils/containers/string.h"
#include "utils/date_time.h"
#include "utils/containers/converters.h"
class ValueStamp
{
public:
enum class ValueType
{
CPU,
RAM,
IO_READ,
IO_WRITE
};
public:
utils::String ToString() const { return utils::date... | true |
7d64a7865b906312c3fa72f4c056285112068ce1 | C++ | Olney-James/CISS242 | /Employee/Employee/Employee.h | UTF-8 | 532 | 3.125 | 3 | [] | no_license | #ifndef EMPLOYEE_H
#define EMPLOYEE_H
#pragma once
#include <string>
#include <iostream>
using namespace std;
//Employee class declaration
class Employee {
public:
Employee(string n, int i, string d, string p) {
name = n;
idNumber = i;
department = d;
position = p;
}
Employee(string n, int i) {
name = n;... | true |
a4158b5b51c51abe446d9b549828c3ad6626202f | C++ | Ser123rus/AIP_semest2_homework_ANTONIUKss | /week14,15/week14,15_1(а)/Source.cpp | UTF-8 | 223 | 2.671875 | 3 | [] | no_license | #include <iostream>
int main() {
int masiv[101];
for (int i = 0; i < 101; i++) {
masiv[i] = rand() % 11;
}
for (int i = 0; i < 101 - 1; i++)
std::cout << i << " - " << masiv[i] << ", " << std::endl;
return 0;
} | true |
a4c8ad3b8c20eb66082aa3f0bd39afbe96ba4d87 | C++ | iitalics/Synth | /SynthManager.cpp | UTF-8 | 873 | 2.6875 | 3 | [] | no_license | #include "includes.h"
#include "Part.h"
#include "SynthManager.h"
SynthManager::SynthManager ()
{
parts.clear();
Time = 0;
}
SynthManager::~SynthManager ()
{
for (std::vector<Part*>::iterator i = parts.begin(); i != parts.end(); i++)
delete *i;
}
void SynthManager::AddPart (Part* part)
{
part->Manager = t... | true |
6f89588005198fdf402e151d0f7df9111bdfaa4e | C++ | Sunday361/leetcode | /leetcode_73.h | UTF-8 | 1,774 | 3.40625 | 3 | [] | no_license | //
// Created by panrenhua on 1/21/21.
//
#ifndef LEETCODE_LEETCODE_73_H
#define LEETCODE_LEETCODE_73_H
#include "allheaders.h"
/** 73. 矩阵置零
* 矩阵置零 将 [i, j] 所在的行列的头置为0, 随后扫描第一行和第一列
* 注意特殊点 [0, 0] 即 i = 0 或 j = 0 时 需要额外考虑
* */
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int c ... | true |
822ece9566f158df2078c89cfcaaa2dc73556b26 | C++ | geeooleea/palestradialgoritmi2018 | /intro-day1/soluzioni/easy2.cc | UTF-8 | 259 | 2.609375 | 3 | [] | no_license | #include<fstream>
using namespace std;
int main() {
ifstream in("input.txt");
ofstream fout("output.txt");
int N, a, b, out=-1;
in>>N;
for(int i=0;i<N;i++) {
in>>a>>b;
a+=b;
if(a%2==0) out=max(out, a);
}
fout<<out;
in.close();
fout.close();
}
| true |
7df70187363bfba25c96fc50094bb35ce2cc8777 | C++ | europaplus/CPP_modules | /CppModule03/ex04/ClapTrap.hpp | UTF-8 | 2,616 | 2.796875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ClapTrap.hpp :+: :+: :+: ... | true |
b53297d05d6fdfeeef01e03b344253fff303651a | C++ | jbsilva/Programming_Challenges | /URI/01133-resto_da_divisao.cpp | UTF-8 | 807 | 2.59375 | 3 | [] | no_license | // ============================================================================
//
// Filename: 01133-resto_da_divisao.cpp
//
// Description: URI 1133 - Resto da Divisão
//
// Version: 1.0
// Created: 09/30/2012 03:22:18 PM
// Revision: none
// Compiler: g++
//
// Author... | true |
e5f2551ccd3dc617a003b9b17f0cd144195b8579 | C++ | hyperion-project/hyperion.ng | /include/utils/FileUtils.h | UTF-8 | 2,141 | 2.6875 | 3 | [
"MIT",
"GPL-1.0-or-later",
"MPL-2.0",
"CC-BY-4.0",
"LicenseRef-scancode-protobuf",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"OFL-1.1",
"GPL-2.0-only",
"Apache-2.0",
"Hippocratic-2.1",
"BSD-2-Clause",
"GPL-2.0-or-later",
"LicenseRef-scancode-hidapi"
] | permissive | #pragma once
// qt includes
#include <QFile>
#include <QString>
#include <QByteArray>
// util includes
#include "Logger.h"
namespace FileUtils {
QString getBaseName(const QString& sourceFile);
QString getDirName(const QString& sourceFile);
///
/// @brief remove directory recursive given by path
/// @param[in]... | true |
7dcc4c8afb05c08d977a5ea9b1f24fc748989142 | C++ | Roy-kunal-96/Cpp_code_tutorial | /OPoverload2.cpp | UTF-8 | 592 | 3.609375 | 4 | [] | no_license | // Operator overloading
#include<iostream>
using namespace std;
class complex
{
int real;
int img;
public:
int set_val(int x,int y)
{
real=x;
img=y;
}
void display()
{
cout<<"complex no: "<<real<<" + "<<img<<"j"<<endl;
}
complex operator -()
{ ... | true |
a09b7c59eea5de09eb894cd7fc7c4e03b687b357 | C++ | Michal-Fularz/ProjectEuler | /ProjectEuler/Problems_other.cpp | UTF-8 | 3,105 | 3.078125 | 3 | [
"MIT"
] | permissive | #include "ProjectEuler.h"
#include <iostream>
#include <list>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string>
#include "SupportFunctions.h"
using std::cout;
using std::cin;
using std::endl;
/*
St. Petersburg Lottery
Problem 499
A gambler decides t... | true |
25162cf2d6e88bab879107711d24f58e733fe36c | C++ | SiYa2020/T-Watch-Projects | /7 T-Watch TFT_eSPI + LVGL/src/main.cpp | UTF-8 | 4,233 | 2.5625 | 3 | [
"MIT"
] | permissive | /* Switch between TFT_eSPI and LVGL screen on a TTGO T-Watch
* Landing page is created with TFT_eSPI library
* Arduino IDE or PlatformIO
*
* Step by step tutorials
* https://diyprojects.io/ttgo-t-watch-mix-lvgl-tft_espi-libraries-same-esp32-project/
* https://projetsdiy.fr/ttgo-t-watch-mixer-librairies-lvgl-tft_... | true |
1286eee282546816f736bec1b8fac8c06887c479 | C++ | Loflif/alpha-tankett | /tankett-server/source/serverEntityManager.cpp | UTF-8 | 5,922 | 2.75 | 3 | [] | no_license | #include "serverEntityManager.h"
namespace tankett {
serverEntityManager::serverEntityManager() {
createLevel();
createBulletBuffer();
createTankBuffer();
}
serverEntityManager::~serverEntityManager() {
}
void serverEntityManager::parseClientMessage(message_client_to_server message, uint8 clientID, const... | true |
5ab9964237d1625965b05bab75416aba290c9491 | C++ | iMajesticButter/BetaFrameworkProjects | /Asteroids/Source/Asteroids.cpp | UTF-8 | 3,935 | 2.59375 | 3 | [] | no_license | #include "stdafx.h"
#include "Asteroids.h"
#include "Level1.h"
#include "Level2.h"
#include "PlayerShip.h"
#include <sstream>
//------------------------------------------------------------------------------
// Public Functions:
//------------------------------------------------------------------------------
// Cre... | true |
3f168253fbf2bc7cd1c7c51a72a4c1dcd77b23f3 | C++ | VakarisL/OOP_3Uzduotis | /Main/GenerateTestFile.cpp | UTF-8 | 1,119 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <random>
#include <chrono>
#include <fstream>
#include "../Main/Headers/GenerateTestFile.h"
/**
* @brief Generates a Test.txt file and fills it with pseuodo-random grade values between 1 and 10 in the form of:
* [name] [surname] [grade] [grade] [grade] [grade] [grade] [exam grade]
... | true |
527a075eb67211d4e9539061b01b91df0a3354fb | C++ | Ekwy/Spatial_Simulator | /Source/PhysicObject.h | UTF-8 | 2,816 | 3.28125 | 3 | [] | no_license | /// \brief Interface donnant des propriétés physique à un objet
#ifndef SOURCE_PHYSICOBJECT_H
#define SOURCE_PHYSICOBJECT_H
#include <stack>
#include <map>
#include "Material.h"
#include "MaterialManager.h"
#include "Vector3d.h"
#include "Material.h"
#include "MaterialManager.h"
#define FRICTION 0.005
class PhysicO... | true |
1fb5865d400bd9736890ec75c826a01fa035eb09 | C++ | arduinonsk/T1 | /examples/readSensorsToSerial/readSensorsToSerial.ino | UTF-8 | 955 | 2.890625 | 3 | [] | no_license | // подключаем библиотеку
#include <t1.h>
// создаем объект класса Т1 и называем его telega
T1 telega = T1();
void setup(){
// стартуем последовательное соединение с ПК
// на скорости 19200
Serial.begin(19200);
}
void loop(){
// читаем значение с левого сенсора и печатаем
// без переноса строки
Serial.print... | true |
817dc3b72193348cec207625092cbc63bc7f4927 | C++ | wgnet/wds_qt | /qtbase/src/3rdparty/angle/src/compiler/preprocessor/Input.cpp | UTF-8 | 1,272 | 2.625 | 3 | [
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-commercial-license",
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"GFDL-1.3-only",
"LicenseRef-scancode-qt-commercial-1.1",
"LGPL-3.0-only",
"LicenseRef-scancode-qt-company-exception-lgpl-2.1",
... | permissive | //
// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "Input.h"
#include <algorithm>
#include <cassert>
#include <cstring>
namespace pp
{
Input::Input() : mCount(0), mString(0)
{
}
... | true |
0f3dcdc969ee559b6000b2c0136528eddbeb746e | C++ | VibhorKanojia/LeetCode | /DiameterOfBT.cpp | UTF-8 | 638 | 3.25 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
private:
int pathLength(TreeNode * root){
if (root == NULL) return 0;
else return (1 + ... | true |
a8d01eeaedc652236240aaa9142236e746138477 | C++ | andreasjhkarlsson/ai5 | /AI5Runtime/HashMapVariant.h | UTF-8 | 1,157 | 2.6875 | 3 | [] | no_license | #pragma once
#include "variant.h"
#include "IteratorVariant.h"
#include <unordered_map>
#include "VariantReference.h"
class HashMapVariant :
public Variant
{
public:
friend class GC;
typedef std::unordered_map<VariantReference<>,VariantReference<>,VariantKeyHasher,VariantKeyComparator> VariantMap;
stat... | true |
23fe5facbb8e131cb8690d183450663c6be67d86 | C++ | bdamer/dukat | /include/dukat/renderstage2.h | UTF-8 | 682 | 2.53125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <string>
#include "renderlayer2.h"
namespace dukat
{
// A render stage represents one or more layers rendering
// to the same screen buffer.
struct RenderStage2
{
const int id;
// list of layers ordered by priority
std::list<std::unique_ptr<RenderLayer2>> layers;
// composite prog... | true |
dbd7a61076e67c8876ab9441ac0df4b1c250eded | C++ | wzj1988tv/code-imitator | /data/dataset_2017/dataset_2017_8_formatted_macrosremoved/Loud.Scream/3264486_5633382285312000_Loud.Scream.cpp | UTF-8 | 904 | 2.859375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
for (int c = 1; c <= t; ++c) {
cout << "Case #" << c << ": ";
int n;
cin >> n;
int num = n;
vector<int> digs;
while (num > 0) {
digs.push_back(num % 10);
... | true |
44fee0495ec2d8ddf3e8a1fe95aca121ed61b853 | C++ | Ragefart/Baum | /Baum/Node.h | UTF-8 | 394 | 2.796875 | 3 | [] | no_license | #pragma once
#include <iostream>
using namespace std;
class Node {
public:
Node();
Node(int startvalue);
Node(Node* a);
//Node(const Node* orig);
virtual ~Node();
Node* getleftchild();
Node* getrightchild();
int getvalue();
void setvalue(int newnumber);
void setleftchild(Node* left);
void setrightchild(Nod... | true |
d54a4dde883a0fe16b4662deebf06612d1197763 | C++ | shoaibrain/cse1325--school-projects | /P03/bonus/fraction.h | UTF-8 | 907 | 2.96875 | 3 | [
"MIT"
] | permissive | #ifndef __FRACTION_H
#define __FRACTION_H
#include <vector>
#include <string>
#include <iostream>
#include <limits>
class Fraction
{
private:
int _n;
int _d;
public:
Fraction(int numerator=0, int denominator=1);
static int gcd(int a, int b);
void reduce();
//Multiplication Operator ove... | true |
3ad6cd1e2755bae41b508c7208fa484e205cdfb1 | C++ | Isaak-Malers/MicroDrv | /Drivers.cpp | UTF-8 | 1,532 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "Arduino.h"
#include "Drivers.h"
Drivers::Drivers(int boardRevision)
{
_boardRevision = boardRevision;
//Allows for pinout changes with future board revisions.
switch(_boardRevision){
case 4:
_IN1 = 4;
_IN2 = 14;
_PWM1 = 5;
_IN3 = A1;
_IN4 = A0;
_PWM2 = 6;
_IN5 = 8;
_IN6 = 7;
... | true |
a8a6f30f006cd6a7fd9d50ca0145af0817d54b2b | C++ | ttalexander2/chroma-public | /Chroma/src/Chroma/Scene/ComponentRef.h | UTF-8 | 1,046 | 2.984375 | 3 | [] | no_license | #pragma once
#include "ECS.h"
#include "Scene.h"
#include "spdlog/fmt/ostr.h"
namespace Chroma
{
//Forward Declarations
class EntityRef;
template <class T>
class ComponentRef
{
friend class Scene;
public:
T* operator->() { return m_Ptr; }
Scene* GetScene() { return m_Scene; }
EntityID GetEntityID() { r... | true |
6502628bb783aa8c78296b078f981a91c89f39bf | C++ | kevinwall/GREMLINS | /include/SLPool.hpp | UTF-8 | 822 | 2.515625 | 3 | [] | no_license | #ifndef _SLPool_
#define _SLPool_
#include <iostream>
#include "StoragePool.hpp"
class SLPool: public StoragePool
{
public:
struct Header
{
unsigned int m_length;
Header() : m_length(0u){ /* Empty */ }
};
struct Block : public Header
{
enum { BlockSize = 16 };
union {
Block *m_next;
... | true |
8544202aeb381f5acb8ae08a913868a371fdd456 | C++ | finwarman/raytracer | /src/geometricobjects/geometricobject.cpp | UTF-8 | 740 | 3 | 3 | [] | no_license | // this file contains the definition of the class GeometricObject
#include "constants.h"
#include "rgbcolour.h" // todo - material
#include "geometricobject.h"
// default constructor
GeometricObject::GeometricObject(void) : colour(black) {}
// copy constructor
GeometricObject::GeometricObject(const GeometricObject &... | true |
fcc1c006fac324b3b113bce55d91b3badee6861e | C++ | yebra06/core-examples | /c++/datastructures/linkedlist/list.cpp | UTF-8 | 2,731 | 3.578125 | 4 | [
"MIT"
] | permissive | #include "list.h"
#include "node.h"
using namespace std;
#include <iostream>
list::list()
: len(0), head(nullptr) {}
list::list(const list& other)
: len(other.len), head(nullptr) {
node* temp = other.get_head();
while (temp != nullptr) {
insert_last(temp->data);
temp = temp->next;
}
}
list::~list() {
delete... | true |
be19f3367426c8bb7e5b16b6db9bc99d3b8a201d | C++ | rohitamrutkar1204/dsc-hacktoberfest-2021 | /Submissions/Trapping_Rain_Water/Sneha_Baser.cpp | UTF-8 | 1,823 | 3.546875 | 4 | [
"CC0-1.0"
] | permissive | //Trapping Rain Water problem
//Approach:
/*An element of the array can store water if there are higher bars on the left and right.
The amount of water to be stored in every element can be found out by finding the heights of bars on the left and right sides.
The idea is to compute the amount of water that can be stored... | true |
7ed77f11c44a11af930b8ea2e96ccb52830d6ae5 | C++ | kim-hwi/Algorithm | /BFS/불!BFS.cpp | UTF-8 | 1,892 | 2.71875 | 3 | [] | no_license | #include<iostream>
#include<utility>
#include<queue>
using namespace std;
string board[1002];
//bool vis[1002][1002];
int distF[1002][1002];
int distJ[1002][1002];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int main (void){
queue<pair<int,int> > J;
queue<pair<int,int> > F;
int x,y;
cin>>x>>y;
for(i... | true |
1e357cca771cf586076d29d5af64b64925127fe9 | C++ | nhzc123/leetcode | /UniquePaths.cpp | UTF-8 | 577 | 3.015625 | 3 | [] | no_license | /**
* @file UniquePaths.cpp
* @brief
* @author charles.nhzc@gmail.com
* @version 1.0.0
* @date 2014-09-04
*/
class Solution {
public:
int uniquePaths(int m, int n) {
int dp[101][101];
memset(dp, 0, sizeof(dp));
for (int i = 0; i < m; i ++){
dp[i][0] = 1;
}
... | true |
055141648fe10e5605a134bdf123564f17fa728f | C++ | huoshan017/hs_common | /hs_packetworker.cpp | GB18030 | 3,384 | 2.84375 | 3 | [] | no_license | #include "hs_packetworker.h"
#include "hs_define.h"
#include "boost/asio.hpp"
#include <iostream>
using namespace std;
// ӳΪsizeİpacket_dataлȡûݰuser_data_offsetΪpacket_dataƫƣuser_data_sizeΪûݳ
int HSPacketWorker::DecodePacket(char* packet_data, size_t size, size_t& user_data_offset, size_t& user_data_size)
{
if (!pac... | true |
b94372b6c46d405ec24c9b84def41f8f4eded587 | C++ | luputona/Chapter_03 | /Chapter_03/NewObject.cpp | UTF-8 | 313 | 3.265625 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
using namespace std;
class Simple
{
public:
Simple()
{
cout << "I'm simple constructor!" << endl;
}
};
void main2()
{
cout << "case 1: ";
Simple *sp1 = new Simple;
cout << "case 2: ";
Simple *sp2 = (Simple*)malloc(sizeof(Simple) * 1);
delete sp1;
free(sp2);
} | true |
9af086149d200a15ea6cbb73a4941a903abc2062 | C++ | mariuszskon/UTCTF-20 | /reversing-babymips/main.cpp | UTF-8 | 1,557 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <signal.h>
#include <iomanip>
class nodebug {
public:
nodebug() {
if (ptrace(PTRACE_TRACEME, 0, 1, 0) == -1) {
*((unsigned int *)0) = 0xDEADBEEF;
}
}
};
nodebug nice_try;
class decryptme {
private:
char encrypted_string[... | true |
e9fe1f44facfc0ba951a83eadb95811f245a7063 | C++ | diulianguo/leetcode | /0927leetcode/0927leetcode/54.cpp | UTF-8 | 1,110 | 3.140625 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
vector<int> spiralOrder(vector<vector<int>>& matrix)
{
vector<int> res;
int x = matrix.size();
if (x == 0)
return res;
int y = matrix[0].size();
if (y == 0)
return res;
vector<vector<bool>> vis(x, vector<bool>(y));
in... | true |
dc9706e83d8ff366c64505185785cfeff4c00641 | C++ | azais-corentin/Bluetrackr | /firmware/common/common/blt/uart.cpp | UTF-8 | 576 | 2.625 | 3 | [
"MIT"
] | permissive | #include <blt/uart.hh>
#include <blt/hal_include.hh>
#include <string>
namespace blt::uart {
UART_HandleTypeDef* uart_handle = nullptr;
void init(UART_HandleTypeDef* huart) {
uart_handle = huart;
}
void transmit(uint8_t data) {
HAL_UART_Transmit(uart_handle, &data, 1, HAL_UART_TIMEOUT_VALUE);
}
void transmit... | true |
f53ccfbb1146462fe63d4b41ba1ea83d1f73bf02 | C++ | golborneville/BOJAlgorithm | /BOJAlgorithm/2583영역구하기.cpp | UTF-8 | 1,231 | 2.53125 | 3 | [] | no_license | #include<iostream>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
int res = 0;
vector<int> resar;
int M, N, K;
int arr[102][102];
int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int chk_area(int i, int j) {
queue<pair<int, int>> qu;
int sum = 1;
arr[i][j] = 1;
res++;
qu.push({ i,j }... | true |
3ac866e20e82b0475baf8cd3b700c1410ff2de67 | C++ | pranjularora/TypeBased-DependencyAnalysis | /NoSqlDB/noSqlDB.h | WINDOWS-1252 | 6,496 | 2.78125 | 3 | [] | no_license | #pragma once
/////////////////////////////////////////////////////////////////////////////
// NoSqlDb.h - key/value pair in-memory database //
// //
// ver 1.1 /... | true |
5b595a941fe737735da2b8ee97e86711b8318b4b | C++ | Pilaniya1/ProcessingShoppingList | /ProcessingShopingList.cpp | UTF-8 | 1,822 | 3.65625 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
const int m =50;
class ITEMS
{
int itemCode[m];
float itemPrice[m];
int count;
public:
void CNT(void){count =0;}//intilaizes count to 0
void getitem(void);
void displaySum(void);
void remove(void);
void displayItems(void);
... | true |
5f56152e971e8dfdc1e678818fe02a9fa5d2e7fc | C++ | SecMeant/pwr-snake | /TextureManager/TextureManager.hpp | UTF-8 | 3,305 | 2.734375 | 3 | [] | no_license | #ifndef TEXTUREMANAGER_H
#define TEXTUREMANAGER_H
#include "stdint.h"
#include <SFML/Graphics.hpp>
// Im not sure about correctness of below code.
// Maybe i should perform transform operations
// textures instead of adding each variant as
// separate file. TODO: maybe change it in future
struct SnakeHeadTex
{
sf::... | true |
0b0dc1b0d4db7d685e711ad45cc69700b77b35b1 | C++ | ddizhang/ECSp1 | /directory.cpp | UTF-8 | 2,710 | 2.953125 | 3 | [] | no_license | //
// directory.cpp
//
//
// Created by Di Zhang on 15/1/15.
//
//
#include "directory.h"
/*void showPath(){
print()
}*/
creatDirectory(Directory *rootDir, int umask ){
rootDir->name = &"/";
rootDir->time = 0;
rootDir->dirPermit = creatPermission(7, umask)
}
void showPath(Directory *curre... | true |
e6ae8fe614a093bb26c2a4ea9b8dc134c48ab4a3 | C++ | fuzzwaz/ParticleShooter | /ParticleShooter/UI/HealthBar.h | UTF-8 | 957 | 2.578125 | 3 | [
"Apache-2.0",
"CC-BY-4.0"
] | permissive | //
// HealthBar.h
// Particle Shooter
//
// Created by Ramy Fawaz in 2021
// Copyright (c) 2021 Ramy Fawaz. All rights reserved.
//
#pragma once
#include "GraphicAssetResources.h"
#include "GraphicObject.h"
#include "PlayerInfo.h"
//Class representing the Player's health bar
class HealthBar : public GraphicObjec... | true |
4a7b98d253ac9e7340c6ab87506c1a9ef85a6524 | C++ | ankitpriyarup/online-judge | /kattis/familydag.cpp | UTF-8 | 1,874 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 222;
using ll = long long;
vector<string> all_names;
vector<pair<string, string>> edges;
void reset() {
all_names.clear();
edges.clear();
}
void solve() {
sort(begin(all_names), end(all_names));
all_names.erase(unique(begin(all_name... | true |
252cfdaf3e7de4687f60ad4dcdc5662a6191817e | C++ | SubhamChoudhury/Back_to_Basics | /Arrays/Sahil/cpp/cyclically_rotate_an_array_by_one.cpp | UTF-8 | 830 | 4.25 | 4 | [] | no_license | /*
* Given an array, cyclically rotate the array clockwise by one.
Examples:
Input: arr[] = {1, 2, 3, 4, 5}
Output: arr[] = {5, 1, 2, 3, 4}
* */
#include <iostream>
#include <array>
using namespace std ;
int main() {
array<int, 5> arr = {1, 2, 3, 4, 5} ;
int number_... | true |
ffad6b0393461d0a89b509f855be4788ed0e945a | C++ | DyslexikStonr240/backup | /Machine_Learning/ConvoNet/ConvNet/src/headers/node/InternalNode.h | UTF-8 | 3,174 | 2.875 | 3 | [] | no_license | #ifndef INTERNALNODE
#define INTERNALNODE
#include <Eigen/Dense>
#include "BaseNode.h"
class internalNode: public baseNode{
private:
baseNode& _previousNode;
public:
internalNode (baseNode& previousNode, int numberOfNeurons);
void backwardPass (float STEP_SIZE, float lambda);
void ... | true |
0daa73cf21377ed1f8a6c1f6a5615997235b5549 | C++ | micro500/treasure-master-hack | /bruteforce/tm_64_8_test/tm_64_8_test.cpp | UTF-8 | 4,448 | 2.765625 | 3 | [] | no_license | #include "data_sizes.h"
#include "tm_64_8_test.h"
#include "tm_64_8.h"
#include "rng.h"
tm_64_8_test::tm_64_8_test()
{
this->rng_table = new uint16[256*256];
generate_rng_table(this->rng_table);
regular_rng_values = new uint8[0x10000 * 128];
generate_regular_rng_values_8(regular_rng_values, rng_table);
regular_... | true |
4f05f6048d5ea24e69a1a9c70e70767db8100e0c | C++ | pts211/CS206 | /student.cpp | UTF-8 | 1,399 | 3.140625 | 3 | [] | no_license | #include "student.h"
Student::Student()
{
}
int Student::getId() const
{
return id;
}
void Student::setId(int value)
{
id = value;
}
QString Student::getUsername() const
{
return username;
}
void Student::setUsername(const QString &value)
{
username = value;
}
QString Student::getFirstName() const
{... | true |
f4ebccde714fc9c45ac0a02dcfe377dc42a9353a | C++ | achen9/ee590 | /hw5/null.hh | UTF-8 | 278 | 2.59375 | 3 | [] | no_license | #ifndef _NULL_H_
#define _NULL_H_
#include "object.hh"
class Null : public Object {
public:
Null() {}
Null * clone() { return new Null(*this); }
bool is_null() { return true; }
std::string stringify() { return std::string("null"); }
};
#endif
| true |
e142eb86d3169ce5fd877decc3627ddeeb49bf2d | C++ | ricardoferreira68/Introducao_programacao_em_c | /ordem_inversa.cpp | UTF-8 | 475 | 3.4375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(void)
{
int i, numero[10];
system("clear");
for(i=0;i<10;i++)
{
cout << "Digite o "<<i+1<<"o número: ";
cin >> numero[i];
}
cout << endl;
cout << "Relação dos números na ordem inversa"<<endl;
cout << "------------------------... | true |
39bd384e6730aea41c5833dcf382aa6d1441d5f5 | C++ | GregLando113/GWToolboxpp | /GWToolbox/GWToolbox/Viewer.h | UTF-8 | 1,554 | 2.984375 | 3 | [] | no_license | #pragma once
#include <Windows.h>
#include <d3d9.h>
/*
This class represents a window on screen where you can draw.
It stores the view transformation and sets up matrices in RenderBegin()
*/
class Viewer {
public:
Viewer();
void RenderSetupClipping(IDirect3DDevice9* device);
void RenderSetupProjection(IDirect3DD... | true |
64b801d7d586ad6326aefbf1be4f8d0047e97dcd | C++ | kjnh10/pcl | /library/cpp/math/sieve.hpp | UTF-8 | 2,989 | 3.1875 | 3 | [] | no_license | #pragma once
#include "../header.hpp"
//%snippet.set('sieve')%
//%snippet.config({'alias':'prime_factor_by_sieve'})%
//%snippet.fold()%
struct Sieve {/*{{{*/
// エラトステネスのふるい O(NloglogN)
ll n; // n: max number for defined minfactor and primes
vector<ll> minfactor; /... | true |
e7be49c2d2fa58bfbcd983b96aadfd8cdd20be1c | C++ | M-Kobryn/MK-Electronic | /Produkt.h | UTF-8 | 964 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <list>
using namespace std;
class Produkt
{
string nazwa;
double cena;
string opis;
public:
friend bool operator==(const Produkt& T1, const Produkt& T2);
Produkt();
Produkt(string nazwa, double cena, string opis... | true |
d86dccef14dab17b2906bcb25facc8d8ee9cc472 | C++ | tursynbekoff/robotic_hand | /Control/Sample_i2c_slave/Sample_i2c_slave.ino | UTF-8 | 1,766 | 3.140625 | 3 | [] | no_license | // Include the required Wire library for I2C<br>#include <Wire.h>
#include <Wire.h>
int LED = 4;
int x = 0;
char c;
void setup() {
// Define the LED pin as Output
pinMode (LED, OUTPUT);
// Start the I2C Bus as Slave on address 9
Wire.begin(9);
// Attach a function to trigger when something is recei... | true |
39d649d6269caab8120770cbe9baf4dab41fe090 | C++ | Mabdel-03/CS163-RedBlackTreeDeletion | /Node.h | UTF-8 | 616 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
class Node{
public:
//these function declarations are all pretty self explanatory :)
Node(int);
int getVal();
void setVal(int);
Node* getRight();
Node* getLeft();
Node* getParent();
void setRight(Node*);
void setLeft(Node*);... | true |
2b56c47682e85634275664d791348aab3d62752f | C++ | yeshasvitirupachuri/graph_hri | /aonode.h | UTF-8 | 1,566 | 2.953125 | 3 | [] | no_license | #ifndef AONODE_H
#define AONODE_H
#include <iostream>
#include <vector>
using namespace std;
// Definition Node Class
class aoNode{
public:
int nCost; //The initial node cost is same for all the nodes
int nIndex; //Node Index
int nHyperArcs; //Each node has fixed number of hyperarcs in the global gra... | true |
88ddc9854b0b1c2977dd8b5ec5bef045dc13f0a1 | C++ | XMJYever/learn_CPP_Primer_plus | /C++practice/practice13_4/practice13_4/tabtenn1.h | UTF-8 | 772 | 3.09375 | 3 | [] | no_license | // tabtenn1.h -- a table-tennis base class
#ifndef TABTENN1_H_
#define TABTENN1_H_
#include <string>
using std::string;
// base class
class TableTennisPlayer
{
private:
string firstname;
string lastname;
bool hasTable;
public:
TableTennisPlayer(const string & fn = "none",
const string & ln = "none", bool ht = f... | true |
fc41a33f049a1a8c0a3f6a4d30e1820c639c55d7 | C++ | sejinik/Discovering_modern_cpp | /c++03/hello42.cpp | UTF-8 | 222 | 2.546875 | 3 | [] | no_license | #include <iostream>
int main(){
std::cout<<"The answer to Ultimate Question of Life, \n"
<<"the Universe, and Everything is:"
<<std::endl<<6*7<<std::endl;
return 0;
} | true |
4320085ab16e4120365b9df85043f4368274f7d0 | C++ | babest/embedded-systems | /Blatt06/aufgabe6.1/aufgabe6.1.ino | UTF-8 | 7,699 | 2.84375 | 3 | [] | no_license | #include <SPI.h>
#include <SD.h>
extern unsigned char font[95][6];
int PIN_SCE = 4;
int PIN_RESET = 6;
int PIN_DC = 8;
int PIN_SDIN = 4;
int PIN_SCLK = 3;
int PIN_BGLIGHT = 10;
int PIN_SCE_SD = 52;
int LCD_C = LOW;
int LCD_D = HIGH;
const int LCD_X = 84;
const int LCD_Y = 48;
const int LCD_BA... | true |
3a50b32709d515a82fb06552375c460c5877363b | C++ | Make-It-Work/RandomDungeon | /RandomDungeon/RandomDungeon/Enemy.cpp | UTF-8 | 1,611 | 3.25 | 3 | [] | no_license | #include "stdafx.h"
#include "Enemy.h"
#include <string>
#include <map>
#include <iostream>
Enemy::Enemy()
{
}
Enemy::~Enemy()
{
}
int Enemy::attack() {
std::cout << "Your enemy attacked, you lost " << strength << " of your health points"<< std::endl;
return strength;
}
bool Enemy::hit() {
if (level <= 4) {
he... | true |
48215524b8da77d2c18a8b78650e3d20a8da468e | C++ | MTASZTAKI/ApertusVR | /core/sceneManager/network/3rdParty/raknet/DependentExtensions/DXTCompressor/Src/main.cpp | UTF-8 | 4,855 | 2.90625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause",
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "DXTCompressor.h"
/* ------------------------------------------------------------------------------------------------------------------------------------ */
bool LoadTGAFromFile( const char* pFilename, void **image, int* width, int* height )
{
typed... | true |
c1d6a111756f9d6e8e6974d8233b160d417178f7 | C++ | Darling1116/Darling_1116 | /lesson_8_19/Algorithm_1/test_1.h | GB18030 | 988 | 3.53125 | 4 | [] | no_license | #pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string.h>
#include <unordered_set>
using namespace std;
//һַsһ鵥dictжsǷÿոָһ
//ʹõеĵʶdictеĵʣпһʣ
bool wordBreak(string s, unordered_set<string> &dict) {
if (s.empty())
return true; //ַҲҪ
//arrayʾǰiַָܷ
vector<bool> array(s.length() + 1, ... | true |
f745ce948c3f1062a66e2118aac15a366e30b113 | C++ | liuhangyang/Study_notes | /C++_code/第三章/34.cpp | UTF-8 | 929 | 2.765625 | 3 | [] | no_license | /*************************************************************************
> File Name: 34.cpp
> Author:yang
> Mail:yanglongfei@xiyoulinux.org
> Created Time: 2015年11月29日 星期日 09时38分27秒
************************************************************************/
#include<iostream>
int main(int argc,char *argv[])
{
... | true |
c7c8b834a4c63c85c72321993d1ca78b8b4e92da | C++ | XoDeR/DODCallback | /Src/Entity.cpp | UTF-8 | 563 | 2.8125 | 3 | [] | no_license | #include "Entity.h"
#include "Registry.h"
// to see the output
#include <iostream>
//
Entity::Entity(Registry& registry)
: registry(registry)
{
EntityCallback entityCallback;
typedef void(*VoidFunction)();
entityCallback.f = (VoidFunction)(&Entity::entityFunction);
entityCallback.instance = (void*)(this);
regi... | true |
2e1417e073922fe71285f748ffebefffd585eb97 | C++ | larnin/Awesome_rogue_tools | /Awesome_rogue_editor/src/Map/hitbox.h | UTF-8 | 783 | 2.625 | 3 | [] | no_license | #ifndef HITBOX_H
#define HITBOX_H
#include <SFML/System/Vector2.hpp>
#include <SFML/Graphics/Rect.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <vector>
struct Line
{
Line(const sf::Vector2f & _pos1, const sf::Vector2f & _pos2)
: pos1(_pos1), pos2(_pos2) {}
sf::Vector2f pos1;
sf::Vector2f... | true |
efb11c3b5396fc52bec7b5e770784c70dd88e51b | C++ | eliogovea/solutions_cp | /Kattis/oil2.cpp | UTF-8 | 2,311 | 2.703125 | 3 | [] | no_license | // https://icpc.kattis.com/problems/oil2
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2005;
inline int sign(LL x) {
if (x < 0) {
return -1;
}
if (x > 0) {
return 1;
}
return 0;
}
struct pt {
int x, y;
};
pt operator - (const pt &a, cons... | true |
48cebc4a73d5f7793414d7c1bf2f2e3481117138 | C++ | anshu06468/lifecycle | /heap.cpp | UTF-8 | 1,144 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include <cmath>
using namespace std;
int count=0;
void print(int a[],int n)
{
for(int i=1;i<=n;i++)
cout<<i<<"\t"<<a[i]<<endl;
}
void heap(int a[],int k,int sz)
{ int l=2*k;
int r=2*k+1;
int largest=0;
if(l>sz && r>sz)
return;
if(l<=sz && a[l]>a[k]) {
count++;
largest=l;
}
... | true |
c4045cdf23c0772c0bb5aa94ed3ee892a7178a59 | C++ | LiuYangMrLY/Cpp-Experiment | /special/5/CppExp.cpp | GB18030 | 1,356 | 3.34375 | 3 | [] | no_license | #include "Image.cpp"
#include <iostream>
using namespace std;
int main()
{
Image img;
img.Read("Fruits.jpg");
img.Write("FruitsCopy.jpg");
cvNamedWindow("Image", CV_WINDOW_AUTOSIZE);
img.Show("Image");
//·ת img.Flip(true)
img.Flip(true);
img.Show("Image");
// ҷת img.Filp(false)
img... | true |
d2c832d6cb38de99f2638c3c145c76122b6d1f9f | C++ | Hybbon/spc | /roteiro00/spojbr_minhoca/main.cpp | UTF-8 | 799 | 3.578125 | 4 | [] | no_license | // A solução para o problema consiste em verificar o maior valor dentre as
// somas de cada coluna e de cada linha. O maior valor encontrado corresponde
// ao maior número de minhocas que pode ser coletado.
#include <iostream>
#include <vector>
int main(){
int n, m;
std::cin >> n >> m;
std::vector<int> co... | true |
c2aec816af8975d0ac8824b218d40bada798af45 | C++ | Yumin2019/Tetris-Console | /Tetris Console/Object/CShapeS.cpp | UTF-8 | 1,255 | 3 | 3 | [] | no_license | #include "CShapeS.h"
CShapeS::CShapeS()
{
}
CShapeS::CShapeS(const CShapeS & s) :
CShape(s)
{
}
CShapeS::~CShapeS()
{
}
bool CShapeS::Init()
{
m_eShape = ST_S;
m_tShape[1][2] = '0';
m_tShape[1][3] = '0';
m_tShape[2][1] = '0';
m_tShape[2][2] = '0';
return true;
}
void CShapeS::Rotation(bool left)
{
if ... | true |
bab6da83c3d9bfc8191cba07fc123ec76b54dd36 | C++ | sapsey19/2019CppProjects | /ProgLangHW3/main.cpp | UTF-8 | 1,887 | 3.46875 | 3 | [] | no_license | #include <string>
#include <fstream>
using namespace std;
ofstream out;
char token;
string expression;
int counter = 0;
int error = 0;
//function declarations
void exp();
void term();
void factor();
void number();
void digit();
void parse();
void getToken() {
token = expression[counter];
//if there's a space, ign... | true |
3e7b24f332f1c26a5a298edf9f7cd85585d2a29b | C++ | kidc2458/Q1 | /Q1-A/Q1-A.cpp | UTF-8 | 339 | 2.859375 | 3 | [] | no_license | // ConsoleApplication1.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include "pch.h"
#include <iostream>
int main()
{
for (int i = 0; i < 81; ++i)
std::cout << (i / 9 + 1) << " X " << (i % 9 + 1) << " = " << (i / 9 + 1)*(i % 9 + 1) << '\n';
return 0;
} | true |
cc2ca924b44b67b06848f0ea0d7dfcf783d28560 | C++ | d-cheung/EC527-Project | /Serial Code/FastHessian.cpp | UTF-8 | 10,778 | 2.84375 | 3 | [] | no_license | #include "IPoint.h"
#include <cmath>
#include <vector>
#include "FastHessian.h"
#include "IntegralImage.h"
// Static one-call do it all method
std::vector<IPoint> * FastHessian::getIpoints(float thresh, int octaves, int init_sample, IntegralImage * img)
{
FastHessian fh(thresh, octaves, init_sample, img);
return fh.... | true |
034b8232f9b53db2ee9f5c9583f12ed9d4f7a1e4 | C++ | mahimahans111/cpp_codes | /trees/printLeafNodesFromPreorderTraversal.cc | UTF-8 | 1,275 | 3 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
// -----------------------------------------------------
// This is a functional problem. Only this function has to be written.
// This function takes as input an array
// It should print the required output
vector<int> NGE(vector<int> &pre, int n){
vector<i... | true |
55544b6780a97f612ce0d35772d8aa1f36b671a5 | C++ | Yashavanth-CP/Data-Structures-and-Algorithms | /poly/base_d.cpp | UTF-8 | 3,291 | 3.65625 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Base{
public:
Base(){
//std::cout <<" Base::Base() called "<< std::endl;
}
void print(){
std::cout << " Base:print() called" << std::endl;
... | true |
408e83013aa600756b67e33307067def8e2326a2 | C++ | WilliamNTN/Competitive-Programming | /google kickstart/kickstart 2018 - round B/a-nonine.cpp | UTF-8 | 866 | 2.53125 | 3 | [] | no_license |
// Correct for small
#include <bits/stdc++.h>
using namespace std;
#define LL long long int
#define pii pair<int,int>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
const int maxN = 0;
LL t;
LL f,l;
LL solve(LL val){
vector<int> digits;
LL n = val;
while(n){
digits.pb(n%10);
... | true |
2de29dd3e596ada08491aa221fca0d33f2ca2931 | C++ | polmonroig/graph_percolation | /src/graph/grid.cpp | UTF-8 | 741 | 3.09375 | 3 | [] | no_license | #include "grid.h"
Grid::Grid(unsigned int num){
n = num;
}
std::string Grid::name() const{
return "grid2d";
}
Graph Grid::createGraph() const{
Graph g;
g.reserve(n * n);
// add vertices
for(auto i = 0; i < n * n; ++i){
g.addSite();
}
// O(|V|) |V| == n*n
for(auto i = 0;... | true |
115f8be59e07192edcfec90d441358dcd7630e08 | C++ | Rakibul-CoU/Numerical-Analysis-3rd-Semester | /ramanuzan methods.cpp | UTF-8 | 1,162 | 2.671875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
double degree,arr[20],b[20];
double Function(int c)
{
int i;
double sum=0;
for(i=1;i<=3;i++)
{
sum+=arr[i]*b[c];
c--;
}
return sum;
}
int main()
{
int i,n,divider;
double accuracy,value;
cout<<"PLE... | true |
8872d7841a25dd40a71dd39c8aee11119bbf93a3 | C++ | lanillo/QMSat-Satellite | /OBC/Tests/Steps/Peripherals/GPIO-evaluator.hpp | UTF-8 | 1,528 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /*
* GPIO-evaluator.hpp
*
* Created on: 2018-03-10
* Author: Luis Anillo
*/
#ifndef GPIO_EVALUATOR_HPP_
#define GPIO_EVALUATOR_HPP_
#include "EFM32_GPIO.hpp"
#include "GPIO-mock.hpp"
#include <cstdio>
#define NUMBER_OF_BANKS 6
#define MASK 65535
class GPIOEvaluator
{
private:
//EFM32_GPIO m_UUT;
EFM... | true |
0e11f334c82aeba87973b969fc68a353be6a4cc6 | C++ | arunjayabalan/SystemC | /Lab1_Task2/Lab1_Task2/channel.cpp | UTF-8 | 527 | 3.046875 | 3 | [] | no_license | #pragma once
#include "channel.h"
void channel::write(char c) {
if (num_elements == max)
wait(read_event);
data[(first + num_elements) % max] = c;
++num_elements;
//next_trigger(write_event);
write_event.notify();
}
void channel::read(char &c)
{
if (num_elements == 0)
wait(write_event);
c = data[... | true |
d3fac18d375118bc3037237854d95c79e957cb1a | C++ | xunshuidezhu/TinyWeb | /src/tiny_base/condition.h | UTF-8 | 1,569 | 2.71875 | 3 | [
"MIT"
] | permissive | /*
*Author:GeneralSandman
*Code:https://github.com/GeneralSandman/TinyWeb
*E-mail:generalsandman@163.com
*Web:www.generalsandman.cn
*/
/*---Configer Class---
*We need to upgrade this class
*in order to handle config file error
****************************************
*
*/
#ifndef CONDITION_H
#define CONDITION_H
#inc... | true |
f863b51b1ef96f88502651543399525e49595d89 | C++ | blabla132/keepit-php | /temp/0w7b135tleVaMgEjadntVc3qnmQoVI2QAaNFV8PZRLNAboLuaL/Program 10.cpp | UTF-8 | 1,639 | 3.40625 | 3 | [] | no_license | //
// main.cpp
// Program 1
//
// Created by Liyang Zhang 2016 on 6/10/13.
// Copyright (c) 2013 Liyang Zhang 2016. All rights reserved.
//
//precompiler directives:
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
using namespace std;
int main( )
{
// ***********... | true |
d9bd5079c08ecb2ac7d73598f31246deecb19aae | C++ | guangpanqian/Chat | /ChatClient/Encrypter.cpp | UTF-8 | 1,209 | 2.671875 | 3 | [] | no_license | #include "StdAfx.h"
#include "Encrypter.h"
#include "..\include\Package\packetDef.h"
#include <iterator>
Encrypter::Encrypter(void)
{
encryption_DES.SetKey((const unsigned char*)(DES_KEY),DES::KEYLENGTH);
decryption_DES.SetKey((const unsigned char*)(DES_KEY),DES::KEYLENGTH);
}
Encrypter::~Encrypter(void)
{
}
void... | true |
56a06fcdaf009f641205de36635b4e07f6db3e7a | C++ | copydev/CodeForces | /Hello2020/A.cpp | UTF-8 | 467 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(ll i = 0;i<n;++i)
int main() {
int n,m;
vector<string> strn;
vector<string> strm;
cin>>n>>m;
REP(i,n){
string s;
cin>>s;
strn.push_back(s);
}
REP(i,m){
string s;
cin>>s;
strm.push_back(s);
}
ll q;
cin>>q... | true |
6528841f4971bac5497e969fc451a2124335e60e | C++ | akshitagupta15june/100daysofcode_hackerblock_akshita | /square_root_to_precision.cpp | UTF-8 | 682 | 2.828125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
double squareroot(long long int a,long long int p)
{
int s=0;
int e=a;
int mid;
double ans;
while(s<=e)
{
mid=(s+e)/2;
if(mid*mid==a)
{
ans=mid;
break;
}
if(mid*mid<a)
{
... | true |
d24d3c16e14564c9e99d7e2c57e420041f3dcbf6 | C++ | ilkerhalil/CacheLib | /cachelib/navy/scheduler/tests/OrderedThreadPoolJobSchedulerTest.cpp | UTF-8 | 8,293 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | true |
9118cb533bc9483c70297f7f6c72deb2af2b7e01 | C++ | nachobit/CodePLUS | /MP/VectorMatriz/MEMODinamica/matriz_med_varianza_amp.cpp | UTF-8 | 942 | 3.546875 | 4 | [] | no_license | //MEMORIA DINAMICA
//EJEMPLO NOTAS ALUMNOS MEDIA Y VARIANZA
#include <iostream>
using namespace std;
void LeerNotas(double *v, int n){
for (int i = 0; i < n; i++)
{
cout << "Introduce la nota " << i;
cin >> v[i];
}
}
double Media(const double *v, int n){
double m=0.0;
for (int i = 0; i < n; i++){
m+=v[i];
... | true |
0bb95a015a25e25bbda6c3590c1c2c821dba644a | C++ | EAxxx/EA872 | /examples/portaudio/01-playback.cpp | UTF-8 | 3,742 | 2.78125 | 3 | [] | no_license |
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <random>
#include "01-playback.hpp"
using namespace Audio;
Sample::Sample() {
}
Sample::~Sample() {
}
bool Sample::finished() {
if ( (this->position) >= (this->data.size())) return true;
else return false;
}
void Sample::l... | true |
8956da4442eb57414eb998a631679c6059e0efea | C++ | FoFabien/mhse | /main.hpp | UTF-8 | 1,229 | 2.671875 | 3 | [] | no_license | #ifndef MAIN_HPP_INCLUDED
#define MAIN_HPP_INCLUDED
// compilation flag ****************
#define ENGINE_OS 1 // 1 = windows, 2 = linux, 3 = mac, others = undefined
// macro ***************************
#define cdelete(x) {delete x; x = NULL;}
#define adelete(x) {delete [] x; x = NULL;}
#define ABS(x) ((x)<0 ? -(x) : (... | true |
27f09bc7bfb4490c6572f9c42ebad660ae674525 | C++ | Rupisecter/JoanPatricioSalasRondon | /AlgebraAbstracta-Vigenere/Vigenere1/clase.h | UTF-8 | 4,413 | 2.859375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
using namespace std;
class Vigenere
{
private:
string clave;
public:
string abc;
Vigenere();
string cifrarabc(string msj);
string descifrarabc(string msj);
string cifraraqui(string msj);
string descifraraqui(string msj);
... | true |
bfd0fc8ffd1b7aa641fb949ebd1da219a9f8dcee | C++ | AlexDmr/b207 | /Route 66/V3/slimlib-3.0/misc/sources/Tokenizer.cpp | UTF-8 | 1,760 | 3.09375 | 3 | [] | no_license | #include <Misc/Tokenizer.h>
//----------------------------------------------------------------------------------------
Tokenizer::Tokenizer(const char* string, const char *sep)
{
last = NULL;
firstToken = true;
this->string = NULL;
nbReadToken = 0;
if(sep != NULL)
{
this->sep.set(sep);
}
else
{
this->... | true |
b35d43152d1273a6ff8f44ae51899802b05d40ab | C++ | nguyengiabk/programming_contest | /codeforces/149/149B.cpp | UTF-8 | 1,151 | 2.828125 | 3 | [] | no_license | #include<stdio.h>
int a[5], b[5];
int mu(int a, int n){
int i, kq=1;
for(i=0;i<n;i++){
kq*=a;
}
return kq;
}
int tinh(int p[], int n, int base){
int i,sum=0;
for(i=n-1;i>=0;i--){
sum+=p[i]*mu(base,n-i-1);
}
return sum;
}
int main(){
int i,na, nb, ma=0,mb=0,max,check=0;
char c;
i=0;
while((c=getchar()... | true |
2fa6050310ef4d9959ab3ed10ad0ed7dd0df7220 | C++ | gonzalezerik/College-Programming-Assignments | /LAPC - CO SCI 575 C++ Programming Fundamentals For Computer Science/ICEs/ICE 4-25/AnalyzeNumberscpp.cpp | UTF-8 | 990 | 4 | 4 | [] | no_license | /*Erik Gonzalez
CO SCI 575
AnalyzeNumbers.cpp
calculates the sum, average, positive and negative numbers of a size-5 array entered by users. */
#include <iostream>
#include <string>
using namespace std;
int main()
{
const int FIVE_NUMS = 5;
double num[FIVE_NUMS];
cout << "You can enter 5 integer numbe... | true |
0c68cb9633de8724a821d7c9eb09e5b2db26c9f5 | C++ | gembancud/CompetitiveProgramming | /uva/problemsolvingparadigms/completesearch/harditerativethreeormore/sumsets/a2.cpp | UTF-8 | 1,985 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool cmp(vector<long long> a,vector<long long> b){
return (a[0]<b[0]);
}
int main(){
int n;
while(cin>>n){
if(n==0) break;
vector<long long> v(n);
for(auto&i:v) cin>>i;
vector<vector<long long>> ab;
vector<vector<long l... | true |
a343879d83e18302f84d9dfa949352b8749eeda3 | C++ | sskender/hackerrank | /maximizing-xor.cpp | UTF-8 | 313 | 3.390625 | 3 | [] | no_license | #include <iostream>
int maxXOR(int l, int r)
{
int max = 0;
for (int i = l; i <= r; i++)
for (int j = i; j <= r; j++)
if ((i ^ j) > max) { max = i ^ j; }
return max;
}
int main()
{
int l, r; std::cin >> l >> r;
std::cout << maxXOR(l, r) << std::endl;
//system("pause");
return 0;
} | true |
14751c8323c4e05f6c4f0c5184667f0781ee7e7b | C++ | Digital-Safety-and-Security/rtamt-cpp | /source/node/stl_addition_node.hpp | UTF-8 | 1,495 | 3.203125 | 3 | [] | no_license | #ifndef STL_ADDITION_NODE_H
#define STL_ADDITION_NODE_H
#include <node/stl_node.hpp>
#include <node/stl_sample.hpp>
#include <visitor/stl_visitor.hpp>
#include <array>
namespace node {
/**
* @brief This class defines the Node for the
* STL Addition operation and implements the monitoring algorithm
* for computin... | true |
748d18466df9852f151960c09f8904bff490f7d0 | C++ | eirikraha/FYS4150 | /warmup/warmup.cpp | UTF-8 | 1,920 | 3.140625 | 3 | [] | no_license | /* Fancy program */
#include <stdio.h> /* printf */
#include <math.h> /* mathfunctions */
#include <iostream> /* output */
#include <fstream> /* output to file */
#include <iomanip> /* pretty, pretty */
using namespace std;
int singleprec()
{
float hstop, dfdx2, dfdx3, x, h;
float fpluss... | true |
1cec67e4e04afe925d2b0fdc4bad2970c537eaa0 | C++ | Seongil-Shin/Algorithm | /백준/solutions/2206 벽수부고 이동하기/2206 벽부수고 이동하기.cpp | UTF-8 | 1,367 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <list>
using namespace std;
bool map[1000][1000];
int width, height, result = 2000000000;
int check[1000][1000];
list<pair<pair<int, int>, pair<bool, int>>> q;
int min(int a, int b) {
return a < b ? a : b;
}
void BFS();
void push(int r, int c, bool t, int s) {
bool temp = map[r][c] ? !... | true |