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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b34f2404de87e6b98b5eb19d8c54d13612eaaf0c | C++ | Lukious/2020_Kwangwoon_Univ_CE_DS_Project_3 | /Window/MinHeap.h | UTF-8 | 1,875 | 3.546875 | 4 | [] | no_license | #ifndef MIN_HEAP_H
#define MIN_HEAP_H
#include <utility>
#include <vector>
template<typename TKey, typename TValue>
class MinHeap
{
private:
// array for the elements which should be heap-sorted
std::vector<std::pair<TKey, TValue>> m_vec;
public:
MinHeap() {}
/// <summary>
/// insert key-value p... | true |
f3df787b4bee0058ece2370514b3e01432ed4507 | C++ | SuYuxi/yuxi | /Algorithms/Design/460. LFU Cache.cpp | UTF-8 | 1,618 | 3.5 | 4 | [] | no_license | //Least Frequently Used Cache
using namespace std;
class LFUCache {
public:
LFUCache(int _capacity) : capacity(_capacity)
, size(0)
, minFreq(0)
{}
int get(int key) {
if(hash.count(key) == 0) return -1;
int value = hash[key].first;
int freq = hash[key].second++;
hashList[freq].... | true |
5c39818727ce5e290f3a443bc79e9cf87fbd5d31 | C++ | ag2400036/GrambergsAdam_CIS5_40652 | /Hmwk/Assignment_3/Gaddis_8thEd_Ch4_Problem4_AreasOfRectangles/main.cpp | UTF-8 | 750 | 3.734375 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Adam Grambergs
* Created on January 17, 2018, 7:50 PM
* Purpose: Determine if the date is magic based on day * month = year.
*/
//System Libraries
#include<iostream>
using namespace std;
int main()
{
int L1, W1, L2, W2;
cout << "Enter the lengths and widths of two rect... | true |
32bbf63b1a92d1c7ecdfdd558df8959bed171d43 | C++ | RandomVar/ACM | /专题合集/数学/Leftmost Digit.cpp | UTF-8 | 510 | 2.546875 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include<queue>
#include<cmath>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
const int INF=0x3f3f3f3f;
int main(){
int t;cin>>t;
while(t--){
ll n;
cin>>n;
/* double x;
x=n*(log10((double)n));
x-=(ll)x;
x=pow(10,x);
... | true |
aa755ec667288d7dbb23dd5d0d63959d3087c7b1 | C++ | AradiPatrik/sc2Bot | /GameMap.cpp | UTF-8 | 2,705 | 2.8125 | 3 | [] | no_license | #include "GameMap.h"
#include "Bot.h"
#include <algorithm>
#include <iostream>
#include "Predicates.h"
#include "BaseLocation.h"
#include "Utils.h"
GameMap::GameMap(Bot &bot)
: m_bot(bot)
, m_width(0)
, m_height(0)
{
}
void GameMap::OnStart()
{
// this needs cleaning up
m_width = m_bot.Observation()->GetGameInf... | true |
b17e4e9ef9a60e4ffebc4d6b498d5a8fb292ac58 | C++ | JoshuaSledden/Networking-ASIO | /Engine/Network/client.h | UTF-8 | 2,314 | 2.640625 | 3 | [] | no_license | #pragma once
#include <cstdlib>
#include <deque>
#include <iostream>
#include <thread>
#include <boost/asio.hpp>
#include "message.h"
#include "global_frame.h"
using boost::asio::ip::tcp;
typedef std::deque<message> message_queue;
class client
{
public:
client(boost::asio::io_context& io_context,
const tcp::re... | true |
3525d062cc36213daedb910a2c2164f3b5d13ac9 | C++ | PaisMariano/UNQ | /ED/C++/LinkedLists/AppendableListsRecorribles/AppendableListsRecorribles.cpp | UTF-8 | 5,948 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <malloc.h>
#include "..\Prelude\Prelude.h"
#include "AppendableListsRecorribles.h"
void consLink(lNode* x, List& xsref);
void snocLink(List& xsref, lNode* x);
/*************************************/
/* Implementacion de las operaciones */
/* */
/* O... | true |
490ffa5552da0179da88b6521773c1bb25e7de41 | C++ | rlskinner/Dev | /Pixelator/tieDye/trash/zz-old-src/weight.h | UTF-8 | 553 | 2.859375 | 3 | [] | no_license | #ifndef _weight_h_
#define _weight_h_
//
// define a anstract weight class that can change the weight based
// on location (absolute or relative), or history, etc.
//
class weight {
protected:
int isConst;
double constWgt;
virtual double getFunctionalWgt( int nDim, int abs[], int rel[] );
public:
weight() { isC... | true |
3980d1fb7f8f026890dead8b08008f3ba4597561 | C++ | GreenWizardOg/huskey | /HuskeyServer.cpp | UTF-8 | 4,094 | 2.703125 | 3 | [] | no_license | /*
* HuskeyServer.cpp
*
* Main class for managing tasks, defining options and displaying help
*
* Created on: June 30, 2011
* Author: barryodriscoll
*/
#include "HuskeyServer.hpp"
#include "InfoTask.hpp"
#include "Poco/Util/Option.h"
#include "Poco/Util/OptionSet.h"
#include "Poco/Util/HelpFormatter.h"
#i... | true |
6377b46dc1a12804c57c23377a1579f290a6de41 | C++ | SaartjeCodde/Chip8Emulator | /pdev_saartje.codde/PDevEmulator/Chip8.cpp | WINDOWS-1250 | 14,143 | 2.53125 | 3 | [] | no_license | #include "Chip8.h"
bool Chip8::Initialize(const char *path)
{
for (int i = 0; i < 4096; i++)
{
memoryBuffer[i] = 0;
}
for (int i = 0; i < 16; i++)
{
reg[i] = 0;
stack[i] = 0;
keys[i] = 0;
}
for (int i = 0; i < 2048; i++)
{
display[i] = 0;
}
regI = 0;
regPC = 0x200;
stackPointer = 0;
delayTime... | true |
6787eb228c711a6c1838063656b1fcdfebeff6f2 | C++ | LamFSangUk/GA_maxcut | /prj1/chromosome.h | UTF-8 | 1,352 | 2.59375 | 3 | [] | no_license | #ifndef __CHROM_H__
#define __CHROM_H__
#include "global.h"
#define NORMALIZE
#define EQUAL_CROSSOVER_THRESHOLD 0.6
#define MUTATION_THRESHOLD 0.01
using namespace std;
class Chromosome{
public:
/* Constructors */
Chromosome();
Chromosome(Graph*);
Chromosome(Graph*, int);
Chromosome(const... | true |
a85ba0e0233503f536740924c83415ba7f3601b0 | C++ | IE-KMITL/Pre-Project-Robot10 | /prepro_final_project/prepro_final_project.ino | UTF-8 | 2,939 | 2.640625 | 3 | [] | no_license | #include <HCSR04.h>
HCSR04 hc(A0,A1);//initialisation class HCSR04 (trig pin , echo pin)
int ma1 = D2; // motor A
int ma2 = D3; // motor A
int mb1 = D4;// motor B
int mb2 = D5;// motor B
int sensor_A = A2; // sensor ตรวจจับสิ่งกีดขวางทาง ขวา
int sensor_B = A4; // sensor ตรวจจับสิ่งกีดขวางทาง ซ้
int s... | true |
64c7a336e8a1b4c86bca6ffb5939f784ede00b79 | C++ | sahil901/BTP200 | /WS03/in-lab/CRA_Account.h | UTF-8 | 721 | 2.671875 | 3 | [] | no_license | /*
Name: Sahil Patel
Seneca Student ID: 159-065-176
Seneca Email: spatel392@myseneca.ca
Date of completion: Summer 2019
Prof Name: Reid Kerr & Nargis Khan
Class Section: NAA
Decleration: I have done all the coding by myself and only copied the code that my professor provided to complete my workshops and assignments.
*/... | true |
926bb89de28edd3fc6ab3251ad4295665620fa03 | C++ | valentineoradiegwu/HelloWorld | /functions.cpp | WINDOWS-1252 | 36,497 | 3.15625 | 3 | [] | no_license | #include "functions.h"
#include <map>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <limits.h>
#include <algorithm>
#include <typeinfo>
#include <string.h>
#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>
#include <sstream>
#include <memory>
#include <functional>
... | true |
8d33ce5ba841052a485434456c23510ef6045d78 | C++ | spoonless/glviewer | /src/sys/src/Duration.cpp | UTF-8 | 735 | 2.8125 | 3 | [
"MIT"
] | permissive | #include <chrono>
#include "Duration.hpp"
namespace
{
using clock = std::chrono::steady_clock;
using milliseconds = std::chrono::duration<unsigned long int, std::milli>;
auto beginningOfTime = clock::now();
inline unsigned long getDuration()
{
return std::chrono::duration_cast<milliseconds>(clock::now() - begin... | true |
0cf2845ea1d7409e9d690f330fee4ab590a0a016 | C++ | vspinu/VSR | /src/mean.cpp | UTF-8 | 1,918 | 2.625 | 3 | [] | no_license | #include <Rcpp.h>
#include <vector>
// #include <boost/math/special_functions/beta.hpp>
// this doesn't work, added export PKG_CXXFLAGS=-std=c++11 to bash
// [[Rcpp::plugins("cpp11")]]
using namespace Rcpp;
using std::vector;
// from: http://stackoverflow.com/a/12399290/453735
vector<size_t> order(const NumericVect... | true |
1aa924d563b4d5ddf0bf0a206fdf39f4e53c69ee | C++ | bobekjan/edetect | /src/edetect/cpu/CpuEuclideanNormFilter.cxx | UTF-8 | 1,083 | 2.578125 | 3 | [] | no_license | /** @file
* @brief Definition of class CpuEuclideanNormFilter.
*
* @author Jan Bobek
* @since 19th April 2015
*/
#include "edetect.hxx"
#include "IImage.hxx"
#include "cpu/CpuEuclideanNormFilter.hxx"
/*************************************************************************/
/* CpuEuclideanNormFilter ... | true |
cb935266a3d1851bdd5025c7a0faba6434ccbb7d | C++ | skzr001/Leetcode | /7. Reverse Integer/lc7.cpp | UTF-8 | 869 | 3.796875 | 4 | [] | no_license | /*
It is specified that the intergers is within the 32-bits signed.
So we don't have to consider big numbers.
The solution is rather straightforward. We extract the last digits of given interger, and multiply it 10 one time and add next digit.
For example.
Input:123.
num=3
num=num*10+2=32
num=num*10+1=321
if num exceed... | true |
c714ea312ec55a0bc294289566aec8c3a0fbce62 | C++ | Voyager2718/Docs | /CPlusPlus_App/_基础学习代码/类模板/Cpp1.cpp | UTF-8 | 430 | 3.265625 | 3 | [] | no_license | #include <iostream>
using namespace std;
template <typename T>
class Test{
public:
// Test(T a,T b){
// x=a;y=b;}
T x;T y;
T Max(T x,T y);
T Min(T w,T z){
return (w<z)? w:z;
}
friend a(Test&);
};
void f(){
Test<float> b;
cout<<"___________"<<b.x<<" "<<b.y<<endl;
}
template <class T>
T Test<T>::Max(T x,T y){
... | true |
c56e4478963cff8ef8bcba5debb6a66725dc167d | C++ | wkdehdlr/Doo-it | /Algorithm/백준/알고리즘 중급/다이나믹 프로그래밍/다이나믹 프로그래밍/BOJ 2193 이친수.cpp | WINDOWS-1252 | 471 | 2.78125 | 3 | [] | no_license | #pragma warning(disable : 4996)
#include<cstdio>
#include<cstring>
int N;
long long dp[91][3];
long long func(int n,int num)
{
//
if (n == 1) {
if (num)return 1;
else return 0;
}
long long& ret = dp[n][num];
if (ret != -1)return ret;
if (num) {
ret = func(n - 1, 0);
}
else {
ret = func(n - 1, 1) + func... | true |
0df7ed3452c85d00a11c7596b70621cd203a909c | C++ | GiakoumidisStylianos/Linux-terminal-chess | /src/Rook.cpp | UTF-8 | 891 | 3.3125 | 3 | [
"MIT"
] | permissive | #include "Rook.h"
Rook::Rook(int row, int col, int player) : Piece(row, col, player) {
character = player == 1 ? 'R' : 'r';
}
bool Rook::checkMove(int destRow, int destCol) {
// Cannot go to the same cell.
if (row == destRow && col == destCol)
return false;
if (row == destRow || col == destCol)
return true;... | true |
aa46d71df0cbb13e35a3b511c3b08aebdb859bd3 | C++ | tewalds/pentagod | /agentmcts.h | UTF-8 | 8,702 | 2.875 | 3 | [] | no_license |
#pragma once
//A Monte-Carlo Tree Search based player
#include <cmath>
#include <cassert>
#include "time.h"
#include "types.h"
#include "move.h"
#include "board.h"
#include "depthstats.h"
#include "thread.h"
#include "xorshift.h"
#include "compacttree.h"
#include "log.h"
#include "agent.h"
class AgentMCTS : public... | true |
5cea924c2a901cb5e77678ff35de6cbc506e7b59 | C++ | jscrane/Interrupted | /src/watchdog.h | UTF-8 | 580 | 2.75 | 3 | [
"MIT"
] | permissive | #ifndef __WATCHDOG_H__
#define __WATCHDOG_H__
/**
* A Watchdog timer; resolution in seconds.
*/
class Watchdog: public Device {
public:
Watchdog(int id, unsigned secs=1): Device(id), _secs(secs), _left(0) {}
void ready() {
if (_left)
_left = _update_prescaler(_left);
else {
Device::ready();
disable()... | true |
96300737c432836fb3a8ffda7d2626fce3d21e21 | C++ | hgfeaon/leetcode | /SortList.cpp | UTF-8 | 2,889 | 3.421875 | 3 | [
"BSD-3-Clause"
] | permissive | #include <iostream>
#include <cstdlib>
using namespace std;
class ListNode {
public:
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *_sortList(ListNode *head) {
if (head == NULL || head->next == NULL) return head;
ListNode *h1 = NULL... | true |
54c14a08b6b595d0fae3df6cea9cbd4ccb472272 | C++ | OOP2019lab/lab3-l181068bilalahmed | /l181068_Lab3_Q1.cpp | UTF-8 | 3,926 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include "gitHubUser.h"
using namespace std;
void readDataFromFile( gitHubUser *&user, string filepath){
ifstream fin("C:\\Users\\Bilal Ahmed\\Desktop\\sample.txt");
if (fin.fail())
cout << "Could not locate" << endl;
//Storing Data whle reading... | true |
2a89c0c65a99f79bd687ad832de6b634a8371eca | C++ | edison-caldwell/SchoolWork | /CSCI385/assign4/Bucket.cpp | UTF-8 | 3,575 | 3.4375 | 3 | [] | no_license | #include "Bucket.h"
Bucket::Bucket()
{
head = NULL;
tail = NULL;
current = NULL;
}
Bucket::~Bucket()
{
if(head){
Reset();
GetNext(head);
while(head)
{
delete current;
GetNext(head);
GetNext(current);
}
... | true |
001f9153d2f4275ae24a04b8b4b3776ee4f57b37 | C++ | sekheng/SP2 | /MyGraphics/Source/StationScene.cpp | UTF-8 | 7,494 | 2.828125 | 3 | [] | no_license | #include "StationScene.h"
#include "MyMath.h"
#include "Application.h"
/******************************************************************************/
/*!
\brief - a default constructor, with all variables becoming default value
*/
/******************************************************************************/
Statio... | true |
5cc459ff339549187b2f06b323eabdf6b9f5ae0f | C++ | Vitor-labs/Trabalhos_ufc | /testes/controles/exceptions.cpp | UTF-8 | 928 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <exception>
using namespace std;
class exceptions : public exception{
protected:
string message;
public:
exceptions(string message){
this->message = message;}
virtual string what(){
return this->message;}
};
int fat(int n){
if (n < 0){
... | true |
7e21224ca80f0f2b2ac0414666ca40d285fbddc9 | C++ | ruiwenhe-10/Data-structure-Implementation-and-Practice-CPP | /Data Structure(C++)/Binary Search Tree/test.cpp | UTF-8 | 571 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <stack>
#include <queue>
#include <list>
#include <fstream>
#include <string>
using namespace std;
int main() {
list<int> c;
c.push_back(1);
c.push_back(2);
c.push_back(3);
c.push_back(4);
c.push_back(5);
for (list<int>::iterator it = c.begin(); it != c.en... | true |
d1710e2ef332351a9648f4e985d778406864495b | C++ | IkhyeonJo/New_C_Quizs | /Quiz5/Quiz5/main.cpp | UTF-8 | 332 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
int main(void) {
int a[3][4] = { { 0,1,2,3 },{ 4,5,6,7 },{ 8,9,10,11 } };
int count[2];
for (count[0] = 0; count[0]<3; count[0]++) {
for (count[1] = 0; count[1]<4; count[1]++) {
a[count[0]][count[1]] += a[count[0]][count[1]];
printf("%d ", a[count[0]][count[1]]);
}
printf("\n");
}
... | true |
a7be7806a1048e80904453ae999c4703aad4b16b | C++ | ufocombat/clock-d1 | /clock-d1.ino | UTF-8 | 2,502 | 2.703125 | 3 | [] | no_license | #include "Arduino.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "RTClib.h"
#include "AlarmLib.h"
#define PIR_PIN D2 // Пир датчик
RTC_DS1307 rtc;
LiquidCrystal_I2C lcd(0x3F,16,2); // 1-Выяснить адрес дисплея
/* Плата D1
* SCL - дисплея и часов
* SDA - дисплея и часов - подкючаются параллельно
* B... | true |
7c430c6fed9f27bfca608cd0fa761c64c713babd | C++ | spectaclelabs/elvin | /elvin/basic_event.h | UTF-8 | 463 | 2.640625 | 3 | [] | no_license | #ifndef ELVIN_BASIC_EVENT_H
#define ELVIN_BASIC_EVENT_H
#include <memory>
#include "time_data.h"
#include "event.h"
namespace elvin {
class BasicEvent : public Event {
public:
BasicEvent(uint32_t time, void(*callback)()) :
Event(time), callback(callback) {}
virtual bool process(const TimeData &time... | true |
d5f52c017b3ba8fb8911b18af37ecdd206cec175 | C++ | drkvogel/retrasst | /paulst/db/DBConnection.h | UTF-8 | 831 | 3.078125 | 3 | [] | no_license | #ifndef DBCONNECTIONH
#define DBCONNECTIONH
#include <string>
namespace paulstdb
{
class Cursor;
/*
Abstract representation of a connection to a database that
can be queried and updated.
*/
class DBConnection
{
public:
DBConnection();
virtual ~DBConnection();
virtual void clos... | true |
18f6338999c257dc391aa568987ce26701415f76 | C++ | alffore/Colonias | /src/ITRF2CCL.cpp | UTF-8 | 2,098 | 2.828125 | 3 | [] | no_license | /*
* File: ITRF2CCL.cpp
* Author: alfonso
*
* Created on July 14, 2013, 2:02 PM
*/
#include "ITRF2CCL.hpp"
ITRF2CCL::ITRF2CCL() {
phy1 = 0.30543262; //17.5 grados en rad
phy2 = 0.51487213; //29.5 grados en rad
phyf = 0.20943951; //12grados en rad
lambdaf = -1.7802358; //102grados oeste en ... | true |
d1745276e8ca9ba356ee248b69b263ade7096b1c | C++ | Mishkuh/wsu | /wsu/csci/labs/Lab_CPP_Complex/Source.cpp | UTF-8 | 318 | 2.609375 | 3 | [] | no_license | #include "Header.h"
int main(void)
{
Complex number1(10.0, 3.3);
Complex number2(1.1, 2.2);
Complex number3;
number3.setReal(6.9);
number3.setImaginary(1.2);
number2.printComplex();
number2 = number2 + number1;
number2.printComplex();
number2 = number2 - number1;
number2.printComplex();
return 0;
} | true |
9731a73b7cbd81648199520a20ea2fa09069f504 | C++ | neslon/dprep | /src/Discrete.cpp | UTF-8 | 6,709 | 2.546875 | 3 | [] | no_license | #include <R.h>
#include <Rmath.h>
#define MAX 10000
using namespace std;
double mid_point(double n1, double n2);
double entCI(double input[], int cMatrix[], double partition,int nrows, int begin, int end);
double logd(double x);
double ent(double s[], int cs[], int sCount);
double fullent(double s[], int cs[], in... | true |
2f51acb81fc5cdb8abff301a3428b77b35ab046d | C++ | HayeonP/HyundaiSelfDriving_2019 | /Autoware/ros/src/computing/perception/detection/vision_detector/packages/vision_darknet_detect/include/headers/roadsign_class_score.h | UTF-8 | 3,117 | 2.5625 | 3 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | #include <sstream>
#include <string>
namespace Yolo3
{
enum RoadsignClasses//using coco for default cfg and weights
{
SPEED_OTHER, CHILD_PROTECT, NO_LEFT, NO_RIGHT, NO_PARKING, CROSSWALK, NO_UTURN,
ROTATE, SLOW, SPEED_BUST, UNPROTECTED_LEFT, UTURN, NO_STRAIGHT, SPEED_20, SPEED_30,
SPEED... | true |
18ee1e14fbe95b34d153b2181e0d7dce2ee694e7 | C++ | felixqin/pfw | /drv/obj.cpp | GB18030 | 3,816 | 2.8125 | 3 | [] | no_license | #include "precomp.h"
#include "obj.h"
void CObjectTbl::Initialize()
{
m_link = NULL;
KeInitializeSpinLock( &m_guard );
}
void CObjectTbl::Uninitialize()
{
Clear();
}
void CObjectTbl::Clear()
{
KIRQL irql;
KeAcquireSpinLock( &m_guard, &irql );
OBJECT_TABLE_ENTRY *p = m_link, *q;
while ( p )
{
q = p;
p = p... | true |
cb6178ed6ac70d9d28620e2f0c0e36497ef9d145 | C++ | wangxx2026/universe | /ideas/procpp/mixin_handler/ThreadPool.h | UTF-8 | 536 | 2.875 | 3 | [] | no_license | #pragma once
#include <functional>
#include <thread>
#include <vector>
#include <queue>
#include <mutex>
#include <condition_variable>
using namespace std;
class IThreadPool
{
public:
using Task = function<void(void)>;
virtual void execute(Task t) = 0;
};
class ThreadPool : public IThreadPool
{
public:
... | true |
456497e6f150eeb91d780bcfafd0e0de5124ad2c | C++ | sparshsinha123/competetive-programming | /codesnippets/lazysegtree.cpp | UTF-8 | 3,885 | 2.8125 | 3 | [] | no_license | template<typename segment, typename update>
class segmenttree{
public:
struct node {
segment seg;
update upd;
};
int sz;
vector<node> tree;
segmenttree(){}
segmenttree(int n){
init(n);
}
void init(int n){
sz = 1;
while(sz < n){
sz <<= 1;
}
tree.assign(2 * sz, node... | true |
969767e208a91b4741cbdb173a8620c58e1d7bb0 | C++ | PaigeG/Comp-Sci-1-2017 | /phonePad.cpp | UTF-8 | 1,415 | 3.234375 | 3 | [] | no_license | //Paige Gadapee
//Oct 12, 2017
//code for string of built in functions
#include <iostream>
using namespace std;
int main ()
{
//varibales
int i, len;
string phone;
char token, rerun;
do
{
//input
cout << " Enter phone (1-800-Flowers) : ";
cin >> phone;
//processing
len = phone.le... | true |
d217c38e4b3c097106aa95bf05861bf3d446448f | C++ | dushibaiyu/DsbyLiteProjects | /AES/main.cpp | UTF-8 | 2,010 | 2.5625 | 3 | [] | no_license | #include <QString>
#include <iostream>
#include "aes.h"
#include "aeshelper.h"
#include <fstream>
int main(int argc, char *argv[])
{
/* char mingwen[] = "123456";
char miwen_hex[1024];
//char miwen_hex[] = "8FEEEFE524F8B68DC1FCA2899AC1A6B82E636F6D";
char result[1024];
unsigned char key... | true |
fe49624d2cd96ef3f907b5bde89aca205fc3ff27 | C++ | chenhongqiao/USACO | /P3669/P3669.cpp | UTF-8 | 663 | 2.890625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <algorithm>
using namespace std;
struct cow
{
int num, milk;
} c[100005];
bool cmp(const cow &a, const cow &b)
{
return a.milk < b.milk;
}
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> c[i].num >> c[i].milk;
}
sort(c, c + n, cmp);... | true |
53418c5ee09e7484daf61a93c858730d074ac214 | C++ | arafathali122333/Accident-Avoidance-Detection-System | /Code/Accident Avoidance/Using_Ultrasonic.ino | UTF-8 | 828 | 2.546875 | 3 | [] | no_license | #define trigPin 2
#define echoPin 3
#define motor 10
#define motor2 12
void setup(){
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(motor, OUTPUT);
pinMode(motor2, OUTPUT);
}
void loop(){
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicrosecond... | true |
89b5d19f9c7c7dcf86f6fcf88ec9e0c8f80efc1e | C++ | shlomog12/Systems_Programming_Course_b | /ThePandemicGame/partB/sources/FieldDoctor.cpp | UTF-8 | 720 | 2.578125 | 3 | [] | no_license | #include "FieldDoctor.hpp"
namespace pandemic{
Player& FieldDoctor::treat(City city){
if (this->current_location!=city && !this->board.is_nei(current_location,city)){
throw std::out_of_range("It is not possible to remove an illness from a city where you are not");
}
... | true |
3b42c13a822590a64dabd522a6186d2493a86c5e | C++ | cooper-zhzhang/engine | /tools/util_func.cpp | UTF-8 | 553 | 2.640625 | 3 | [] | no_license |
#include "../public/auto_mem.h"
#include "../public/var_list.h"
#include "util_func.h"
#include <string>
#include <math.h>
#include <time.h>
#include <vector>
#include <algorithm>
float util_normalize_angle(float angle)
{
float value = ::fmod(angle, PI2);
if (value < 0)
{
value = value + PI2;
}
if (val... | true |
63c8dde3a04a46110841e084652b8fd49a53d011 | C++ | iximiuz/DifferentialWheeledRobot | /src/engine/renderer.cpp | UTF-8 | 2,812 | 2.6875 | 3 | [] | no_license | #include "engine/renderer.hpp"
#include <exception>
#include <string>
#include <SDL.h>
static void SDL_OK(int code) {
if (code != 0) {
throw std::runtime_error(
"SDL call failed with code " + std::to_string(code) + ": "
+ std::string(SDL_GetError()));
}
}
Texture::Te... | true |
1a7c92c314bebe697f969fb32dfb8ba9a9302398 | C++ | fhtw/grafl_mueller | /TWMailer/TWMailer/client.cpp | UTF-8 | 2,331 | 2.828125 | 3 | [] | no_license | /*
client.cpp
BIF 3C1
Alexander Grafl
Philipp Müller
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define BUF 1024
using namespace std;
int main (int argc, char **argv)
{
... | true |
baf107743fb23f672eb0248bbf467726e75b3d42 | C++ | xiaoqixian/Wonderland | /leetcode/garbageCollection.cpp | UTF-8 | 1,081 | 2.828125 | 3 | [] | no_license | /**********************************************
> File Name : garbageCollection.cpp
> Author : lunar
> Email : lunar_ubuntu@qq.com
> Created Time : Sun Aug 28 11:46:06 2022
> Location : Shanghai
> Copyright@ https://github.com/xiaoqixian
**********************************************/
#incl... | true |
301f25f1146e91c2fdc8cfb4bde9d8e215254473 | C++ | RajalakshmiSomasundaram/ProblemSolving | /RadixSort.cpp | UTF-8 | 3,159 | 3.375 | 3 | [] | no_license | /******************************************************************************
Radix Sort
Sample input
5
77 23 17 5 12
Output
12 23 5 17 7
5 12 17 23 77
*******************************************************************************/
#include <iostream>
#include <cmath>
#include<string>
using namespace std;
... | true |
afd816f38c03d3f05d0447fbf6071e10b968601b | C++ | SayedKhaledd/CS316LastTask | /ClientData.cpp | UTF-8 | 2,270 | 3.171875 | 3 | [] | no_license | #include <string>
#include "ClientData.h"
using namespace std;
// default ClientData constructor
ClientData::ClientData(int accountNumberValue, int branchIDValue,const string &lastName, const string &firstName, double balanceValue)
: accountNumber(accountNumberValue), balance(balanceValue),branchID(branchIDValue) {
... | true |
6aee59774a4f5c939888135f9eb9d872d7364818 | C++ | LnC-Study/Acmicpc-net | /__19 Summer Coding/1 택시/ckw_cpp.cpp | UTF-8 | 746 | 3.203125 | 3 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
bool desc(int a, int b) {
return a > b;
}
int solution(vector<int> s) {
int answer = 0;
vector<bool> taken = vector<bool>(s.size());
sort(s.begin(),s.end(),desc);
for (int i = 0; i < s.size(); i+... | true |
ea44d4fa2acc0ff8fbae8f27c779832eb01e43f6 | C++ | tbilodea/Unreal-Cpp-TankGame | /TankGame/Source/TankGame/Private/Mortar.cpp | UTF-8 | 746 | 2.546875 | 3 | [] | no_license | // Copyright Bilodeau 2020
#include "Mortar.h"
// Sets default values
AMortar::AMortar()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = false;
}
void AMortar::BeginPlay()
{
Super::BeginPlay();
CurrentHealth = ... | true |
3ff8797e019ac0d16c5ee4b5c6b299e5003a923b | C++ | adityanjr/cb_launchpad | /Class Lectures/Lecture07/sum_subArray.cpp | UTF-8 | 363 | 2.71875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int arr[5] = {5, 6, -7, 8, -9};
int maxsum = INT_MIN;
for (int i = 0; i < 5; i++) {
for (int j = i; j < 5; j++) {
int sum = 0;
for (int k = i; k <= j; k++) {
sum += arr[k];
}
if (sum > maxsum) {
maxsum = sum;... | true |
702e532167dcb90f8f3f4aeaac745efd20801c9e | C++ | terrymunro/uni-work | /assignment-1/Question_2/RecursiveCalculator/RecursiveCalculator.cpp | UTF-8 | 4,309 | 3.40625 | 3 | [] | no_license | #include "RecursiveCalculator.h"
#include <cmath>
#include <cassert>
#include <iomanip>
#include <iostream>
RecursiveCalculator::RecursiveCalculator(int bufferSize)
{
bufferIndex = 0;
buffer = new char[bufferSize];
assert(buffer != NULL);
for (int i = 0; i < bufferSize; i++)
buffer[i] = 0;
}
... | true |
20ac12108e1f1f8bc19ef708dc1aed7eb4bae9b5 | C++ | alexkats/Code | /School/IOIP-2009/B/Help.cpp | UTF-8 | 1,038 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <time.h>
#include <cassert>
#include <assert.h>
#define DEBUG
#define ASSERT
#define NAME "Hel... | true |
5677213b3ecc49c3ed1fb4a8b4920fed9fd31e40 | C++ | 3enceH/cv-algos | /core/src/cudaenv.cpp | UTF-8 | 834 | 2.84375 | 3 | [] | no_license | #include "cudaenv.h"
#include <iostream>
CUDAEnv::CUDAEnv() {
CHECK_CUDA(cudaGetDeviceCount(&_deviceCount));
CHECK(_deviceCount > 0, "No devices");
_deviceProps.resize(_deviceCount);
for (int i = 0; i < _deviceCount; i++)
CHECK_CUDA(cudaGetDeviceProperties(&_deviceProps[i], i));
cudaSetDevi... | true |
e074a97ac0d2445d7151e16ccab46bf3e510e68a | C++ | MarkRDavison/AdventOfCode | /test/2020/Day05PuzzleTests.cpp | UTF-8 | 648 | 2.828125 | 3 | [
"MIT"
] | permissive | #include <catch/catch.hpp>
#include <2020/Day05Puzzle.hpp>
namespace TwentyTwenty {
TEST_CASE("Day 5 getSeatInfo works", "[2020][Day05]") {
const auto indexes = Day05Puzzle::getSeatInfo("FBFBBFFRLR");
REQUIRE(44 == indexes.row);
REQUIRE(5 == indexes.column);
REQUIRE(357 == indexes.seatId);
}
TEST_C... | true |
fae54ba7bd0e5ca5f498310d43b2d8e7ac0975ae | C++ | TAKAYA888/PUTCORE | /ShootingGameFramework/ShootingGame/src/canTouch/GameObject/MainObject/Item/Item.cpp | SHIFT_JIS | 1,444 | 2.765625 | 3 | [] | no_license | #include "ItemScript.h"
ItemScript::ItemScript()
{
}
// t[Ă
void ItemScript::update()
{
// ړ
move();
// ̗͂OȉɂȂ
if (m_hp <= 0)
{
getComponent<SePlayer>().lock()->playSe();
// E
getGameObject().lock()->destroy();
}
}
// ՓˊJnŌĂ
void ItemScript::onCollisionEnter(GameObjectPtr other)
{
// Փˑ̃^OuGAME_OBJEC... | true |
fd719d0c2ce467cd395ea39455d0d68927044354 | C++ | clarkok/parsical | /src/symbol-info.cpp | UTF-8 | 3,241 | 2.609375 | 3 | [] | no_license | #include "report.hpp"
#include "symbol-info.hpp"
#include "token-info.hpp"
using namespace parsical;
void
SymbolInfoVisitor::reportDuplicated(parser::TId *met, parser::TreeNode *prev)
{
Report::getReport().error(
Report::positionedMessage(
met->location,
"duplicated sym... | true |
33fd797ed66c374e85d6870b2e94aacfad0eeb61 | C++ | rossbishop/slabtop-power-management-system | /adapter.cpp | UTF-8 | 739 | 2.75 | 3 | [] | no_license | #include "adapter.h"
//CONSTANTS
//AC
#define AC_MIN_MILLIVOLTS 18000
#define MAX_CHARGER_CURRENT 14000
//constructor - create a function with same name as the class and no type
// could have some variables set in here
Adapter::Adapter()
{
}
bool Adapter::getStatus(Measure *measureRef)
{
if (getV... | true |
492320f0226b1f10d8a451826bebf241f534075b | C++ | plong0/openFrameworks | /addons/ofxImageColourIndexer/src/ofxImageColourIndexer.cpp | UTF-8 | 5,049 | 2.921875 | 3 | [] | no_license | /*
* ofxImageColourIndexer.cpp
* emptyExample
*
* Created by Eli Smiles on 11-03-16.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#include "ofxImageColourIndexer.h"
ofxImageColourIndexer::ofxImageColourIndexer(ofImage image){
myImage = image;
hasAverage = false;
hasPopular = false;
set... | true |
de8846c193c4327bfdc7c75e7902dd797ab5c8ba | C++ | TashreefMuhammad/UVA_Problem_Solutions | /UVA_00913.cpp | UTF-8 | 314 | 2.6875 | 3 | [] | no_license | #include <stdio.h>
int main(void)
{
long long n;
while(scanf("%lld", &n) != EOF)
{
if(n == 1)
printf("1\n");
else
{
n = (n+1)>>1;
n *= n;
printf("%lld\n", n*n - (n-3)*(n-3));
}
}
return 0;
}
| true |
3fe818a1ee2a78c201f220b5a86a9f5d81ee5a49 | C++ | Lyd1995/Leetcode | /C++/1281. 整数的各位积和之差.cpp | UTF-8 | 723 | 2.953125 | 3 | [] | no_license | #include<algorithm>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<math.h>
using namespace std;
class Solution {
public:
int subtractProductAndSum(int n) {
int ans, sum = 0, acc = 1;
vector<int> nums;
helper(n, nums... | true |
9fd8e9d424bc47662e409cf0c6ae32f9e5876a8f | C++ | concatto/sfml-experiments | /SFML/MovementManager.h | UTF-8 | 902 | 2.984375 | 3 | [] | no_license | #ifndef MOVEMENTMANAGER_H
#define MOVEMENTMANAGER_H
#include "Character.h"
#include "Updatable.h"
#include "World.h"
#include <SFML/Graphics.hpp>
class MovementManager : public Updatable
{
const float Gravity = 0.5;
enum Direction {Up, Down, Left, Right};
const World& world;
Character& character;
pub... | true |
4114aaa61448f52ceb70be24790aacf21b7881d8 | C++ | vsuley/Alight | /Mesh.h | UTF-8 | 873 | 2.609375 | 3 | [] | no_license | // Mesh.h: interface for the CMesh class.
//
//////////////////////////////////////////////////////////////////////
# ifndef _MESH_H
# define _MESH_H
# include "Shape.h"
# include "Triangle.h"
class CMesh : public CShape
{
public:
CMesh (CPoint3D pos, CColor col, CPoint3D *pptVertices, CVector *pvecNormals, unsi... | true |
d5ffd6ca244993a12f4767edf6865ef87195d7c7 | C++ | alexandraback/datacollection | /solutions_5690574640250880_0/C++/nick993/2_1.cpp | UTF-8 | 4,017 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string.h>
using namespace std;
int posx[9]={-1 ,-1, -1,0,0,0,1,1,1 };
int posy[9]={-1,0,1,-1,1,0,-1,0,1};
int ansBoard[50][50];
bool isValidPos(pair<int,int> loc,int board[50][50],int rows,int cols)
{
if(loc.first... | true |
01ed8856a3f62867abc9f6161404cf9180642ebf | C++ | Folleas/CCP_plazza_2019 | /src/Encapsulation/ThreadPool.cpp | UTF-8 | 2,784 | 3.0625 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2020
** CCP_plazza_2019
** File description:
** ThreadPool
*/
#include "Encapsulation/ThreadPool.hpp"
#include <chrono>
#include <iostream>
Plazza::Encapsulation::ThreadPool::ThreadPool(std::size_t threads) : _workers(),
_taskQu... | true |
807886a53736a4027859d3decb056ce65a76a9f8 | C++ | x3ent3nte/SimulationProject | /src/Simulator/InsertionSorter.h | UTF-8 | 1,656 | 2.515625 | 3 | [] | no_license | #ifndef INSERTION_SORTER_H
#define INSERTION_SORTER_H
#include <Utils/ShaderFunction.h>
#include <vulkan/vulkan.h>
#include <vector>
class InsertionSorter {
private:
VkPhysicalDevice m_physicalDevice;
VkDevice m_logicalDevice;
VkQueue m_queue;
VkCommandPool m_commandPool;
VkBuffer m_wasSwappe... | true |
450df17092a94890725c0766fbfe023e3df15f8a | C++ | chinlin0514/CLEOD | /aseparation/Frontend/Scanner.h | UTF-8 | 1,788 | 3.0625 | 3 | [] | no_license | //
// Created by jonwi on 10/7/2019.
//
#ifndef CLEOD_SCANNER_H
#define CLEOD_SCANNER_H
#include <fstream>
#include <sstream>
#include "Token.h"
class Scanner {
private:
// Private variables
int start = 0;
int current = 0;
uint64_t line = 1;
char c; // character in the source file
std::st... | true |
a8e270011937acecb2b57aa00b91a32a09f4c562 | C++ | k-Enterprises/Rohan-codes | /linkedList/deleteNodeRecursively/deleteNodeRecursively.cpp | UTF-8 | 1,020 | 3.9375 | 4 | [] | no_license | #include <iostream>
using namespace std;
#include "Node.cpp"
Node * takeInput() {
int data;
cout << "Enter the data: ";
cin >> data;
Node * head = NULL;
Node * tail = NULL;
while(data != -1) {
Node * newNode = new Node(data);
if(head == NULL) {
head = newNode;
tail = newNode;
} else {
tail -> next... | true |
dbfe2d123e4ff18e86676c70beeaef682a6cd625 | C++ | AnthonyG1371/College-Assignments | /Data Structures/Lecture5/01-sorted_ops/main.cpp | UTF-8 | 788 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include "node.h"
#include "node_utils.h"
using namespace std;
int main() {
Node *list = new Node(1, new Node(3, new Node(5)));
//Prints Lists Contents
cout << "Initial List of Nodes 1,3,5" << endl;
Node *templist = list;
while (list) {
cout << *list;
list = list->next;
if (list... | true |
dfbb8500048565364f80ad1afdcb73ec32b08601 | C++ | VitKad/Pac-man | /Curs/Player.cpp | WINDOWS-1251 | 3,041 | 3 | 3 | [] | no_license | #include "stdafx.h"
#include "Player.h"
using namespace sf;
Player::Player(Image &image, float X, float Y, int W, int H) :Entity(image, X, Y, W, H)
{
playerScore = 0;
dir = 1;
sprite.setTextureRect(IntRect(0, 0, w, h));
}
int Player::getScore()
{
return(playerScore);
}
void Player::setScore(int score)
{
player... | true |
d85fd1c3e47691b6cbd597bcffef1894d1486035 | C++ | zalandemeter12/Barkochba | /binarytree.h | UTF-8 | 3,599 | 3.171875 | 3 | [] | no_license | #ifndef BARKOCHBA_BINARYTREE_H
#define BARKOCHBA_BINARYTREE_H
/// \file binarytree.h
#include <string>
/// Bináris fa elemet megvalósító osztály.
/// Dinamikus példányai keletkeznek, amik a
/// BinárisFa osztály destruktorában szabadulnak fel.
class BinaryTreeElement{
protected:
std::string text; ///< ... | true |
8fb8f581c5ac7358a94e9c43f5f7ca4b56a24c62 | C++ | geo000/clustering-1 | /src/kmeans.h | UTF-8 | 1,642 | 2.84375 | 3 | [] | no_license | #ifndef __KMEANS_H__
#define __KMEANS_H__
#include<limits>
template <typename S, typename T>
void kmeans(const Matrix<S> &pts, const u32 nclusters, Vec<u8> &labels, Matrix<T> &clusters) {
bool change;
double mind, d;
u8 minl;
Vec<S> pt;
Vec<float> mean;
u32 dim = pts.cols();
u32 npts = pts.rows();
u32... | true |
095817cbe0c56668873ba4d13c89215d204035f5 | C++ | unbgames/Lucity | /game/src/TileSet.cpp | UTF-8 | 757 | 2.984375 | 3 | [
"MIT"
] | permissive | #include "TileSet.h"
TileSet::TileSet(GameObject& associated, std::string file, int tileWidth, int tileHeight) : tileSet(associated, file) {
TileSet::tileWidth = tileWidth;
TileSet::tileHeight = tileHeight;
rows = tileSet.GetHeight()/tileHeight;
columns = tileSet.GetWidth()/tileWidth;
}
TileSet::~TileSet() {
}
... | true |
b2d5d525620180faae4091d4ab8464353047fb81 | C++ | zakaryael/Projet-cpp | /validation1.cpp | UTF-8 | 1,499 | 3.296875 | 3 | [] | no_license | #include "Vecteur.h"
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char const *argv[]) {
/* code */
//1 creation et affichage de u et v:
float u_t[3] = {1, 1, 1};
Vecteur u(3, u_t);
cout << "Affichage du vecteur u: \n";
u.affiche();
float v_t[4] = {3, 4, 0, 0};
Vecteur ... | true |
716b6f385657ff6047263920f9fb2be6c92b9361 | C++ | kiranmuddam/leetcode | /google-online-assessment/394347.cpp | UTF-8 | 1,768 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class wateringPlants {
public:
static int findTotalRefills(vector<long long int> plantWeights, int capacity1, int capacity2) {
long long int currCapacity1 = 0;
long long int currcapacity2 = 0;
int totalRefi... | true |
4de1674c667f01fc4fef432e5c52340bdb431123 | C++ | nnshi-s/TTMPPreviewer | /TTMPFile/inc/DxtUtil.h | UTF-8 | 2,093 | 2.671875 | 3 | [] | no_license | //#pragma once
//#include <cstdint>
//#include <memory>
//
//namespace Tt
//{
// // adopted from https://stackoverflow.com/questions/19016099/lookup-table-with-constexpr
// template <int AnyNumber>
// struct LookupTables
// {
// constexpr LookupTables() : rb5To8(), g5To8()
// {
// for (unsigned i = 0; i != 32; ++i)... | true |
56ed4700418a7bd8cf461ba14ca03fd23927caed | C++ | geakw/ServerSocket | /src/Server.cpp | GB18030 | 1,466 | 2.859375 | 3 | [] | no_license | #include <stdio.h>
#include <winsock2.h>
#include <iostream>
int main(int argc, char* argv[])
{
//ʼWSA
WORD sockVersion = MAKEWORD(2, 2);
WSADATA wsaData;
if (WSAStartup(sockVersion, &wsaData) != 0)
{
return 0;
}
//
SOCKET slisten = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (slisten == INVALID_SOCKET)... | true |
d1388e0e750c9ebff515ab4f1f8cb79774086955 | C++ | heinemann9/CppPractice | /STLPractice/SetClassIterating/SetClassIterating.cpp | UTF-8 | 1,188 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <set>
#include <string>
using namespace std;
template <typename T>
void print_set(set<T>& s)
{
for (typename set<T>::iterator it = s.begin(); it != s.end(); ++it)
{
cout << *it << endl;
}
}
class Todo
{
int priority;
string job_desc;
public:
Todo(int p... | true |
bdac3768877bb7a40318860f7d30d8769d0a9b2f | C++ | jjzhang166/RTP-19 | /odita/src/ofApp.cpp | UTF-8 | 4,056 | 2.609375 | 3 | [] | no_license | #include "ofApp.h"
bool sortDescending(int i, int j) { return (j < i); }
//--------------------------------------------------------------
void ofApp::setup(){
ofSetWindowShape(1280, 720);
}
//--------------------------------------------------------------
void ofApp::update(){
}
//--------------------------------... | true |
8139db25eb5996a781543bc4a15497406513375e | C++ | KumpelStachu/ZadaniaSCI | /main.cpp | UTF-8 | 389 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <iostream>
int main()
{
const int rozmiar = 7;
int tablica[rozmiar] = { -1, 10, -102, 4, 6, 0, -1 };
int a = 5;
float b = 7.7f;
std::cout << cube(a) << std::endl;
// ...
multiply(tablica, rozmiar, a);
std::string temp = "";
for(int i = 0; i < rozmiar; i++)
temp += std::to_string(tablica[... | true |
a86762a884111d49d9af5d8bbeaed6d91d5a079a | C++ | snwfdhmp/neural-networks | /simpleBitRecognition/recognizer.cpp | UTF-8 | 504 | 2.671875 | 3 | [] | no_license | #include <fann.h>
#include <time.h>
#include <math.h>
#define NUMBERS_TO_GEN 2
#define MAX 500
int main(int argc, char const *argv[])
{
srand(time(NULL));
struct fann *ann = fann_create_from_file("trained.net");
int i;
float numbers[NUMBERS_TO_GEN];
printf("Nombres testés : \n");
for (i = 0; i < NUMBERS_TO_GEN;... | true |
004d46f02b854436696839de0fdc12c6f51cfbb4 | C++ | jkl0727/algorithm | /Jungol/3220.cpp | UTF-8 | 1,989 | 2.5625 | 3 | [] | no_license | #include <stdio.h>
struct puzzle {
int id , same;
int num[4];
};
int N, M, T, S, NN;
int p_i = 0;
int check[2510] = { 0, };
int p_idx[51][51];
int wrong_piece[5];
puzzle piece[2510];
int encode(char *str) {
int ret = 0, temp;
for (int i = 1; i < M - 1; ++i) {
if (str[i] == '0') temp = 1;
... | true |
90fd1e94a2e412434081a3705535322eec2f6bcd | C++ | jbomyso1/ablScouting | /pitcher.h | UTF-8 | 1,151 | 2.828125 | 3 | [] | no_license | #ifndef PITCHER_H_
#define PITCHER_H_
struct pitcherNum
{
unsigned short rIF;
unsigned short rOF;
unsigned short efCF;
unsigned short rg1;
unsigned short gcf;
unsigned short efOF;
unsigned short rg2;
unsigned short sg;
unsigned short hbp;
unsigned short sgl;
unsigned short dbl;
unsigned short deep;
unsigned short efT... | true |
0a9e0308650b487ea071cb29f531b207b9ffe810 | C++ | twestura/yarn-cloth-sim | /src/Simulator/Headers/Clock.h | UTF-8 | 1,749 | 3.328125 | 3 | [] | no_license | //
// Clock.h
// Visualizer
//
// Created by eschweickart on 2/24/14.
//
//
#ifndef Visualizer_Clock_h
#define Visualizer_Clock_h
#include "Constants.h"
/// A class that controls the passage of time within a simulation. Decides and keeps track of the
/// timestep, and records how much time has passed since the si... | true |
53239d2e3fe0f5ffe142e8fded4a8e0196049e7f | C++ | JimmyCarter5417/leetcode | /cpp/0784. Letter Case Permutation.cpp | UTF-8 | 1,395 | 3.828125 | 4 | [] | no_license | // Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create.
// Examples:
// Input: S = "a1b2"
// Output: ["a1b2", "a1B2", "A1b2", "A1B2"]
// Input: S = "3z4"
// Output: ["3z4", "3Z4"]
// Input: S = "123... | true |
47ffba0a904d66c928572e28f06c6bceb08e2547 | C++ | gitguuddd/Learncpp-examples | /IntArray_Class/IntArray.h | UTF-8 | 849 | 3.140625 | 3 | [] | no_license | //
// Created by Mindaugas K on 7/23/2019.
//
#ifndef INTARRAY_CLASS_INTARRAY_H
#define INTARRAY_CLASS_INTARRAY_H
#include <cassert>
#include <iostream>
class IntArray {
private:
int m_length=0;
int* m_array= nullptr;
public:
IntArray(int length):m_length(length){
assert(m_length>0&&"array length... | true |
33b8e357717b7fdb6dd2f71dfddf04c0fa2f1a3d | C++ | epics-extensions/ChannelArchiver | /LibIO/MultiArchive.h | UTF-8 | 5,350 | 2.53125 | 3 | [] | no_license | // -*- c++ -*-
// --------------------------------------------------------
// $Id$
//
// Please refer to NOTICE.txt,
// included as part of this distribution,
// for legal information.
//
// Kay-Uwe Kasemir, kasemir@lanl.gov
// --------------------------------------------------------
#ifndef __MULTI_ARCHIVEI_H__
#defi... | true |
8799785e59bd4f036987bde7e7225a98dd229aaf | C++ | Lilybon/leetcode | /src/909. Snakes and Ladders.cpp | UTF-8 | 1,035 | 2.546875 | 3 | [] | no_license | class Solution {
public:
int snakesAndLadders(vector<vector<int>>& board) {
const int n = board.size(),
CELL_VISITED = -2;
queue<pair<int, int>> q;
q.push({1, 0});
board[n - 1][0] = CELL_VISITED;
while (!q.empty()) {
auto [curr, moves] = q.front();
... | true |
19ede297a6f987d091a147cab3aa9195219e3719 | C++ | skapin/AirPrinterController | /tempcontroller.cpp | UTF-8 | 2,469 | 2.71875 | 3 | [] | no_license | #include "tempcontroller.h"
int TempController::MAX_TEMP_LIST=60*60*24;
TempController::TempController(QObject *parent) :
QObject(parent)
{
}
int TempController::openDevice(string path) {
_device.setPortName( path );
return ( _device.openDevice() );
}
Uart* TempController::getDevice() {
return &_de... | true |
219e990dc85329e10f2ee335ef4a79e8a117b99e | C++ | vladnoskoff/work | /тесты/Untitled1.cpp | WINDOWS-1251 | 4,703 | 2.59375 | 3 | [] | no_license | #include "Books/TXlib.h"
struct Hero
{
int x, y;
int vx, vy;
HDC photo;
int FrameSizeX;
int FrameSizeY;
int status, oldstatus;
int UP, DOWN, LEFT, RIGHT, STOP;
void Phisica ();
void Logic ();
void KeyState ();
void DrawHero (int t);
void Mouse (int leftm, ... | true |
b94a4186f46a2a6efe506232b32f960425d1723d | C++ | Stasychbr/Calculator-2.0 | /ExprParser.cpp | UTF-8 | 263 | 2.625 | 3 | [] | no_license | #include "ExprParser.h"
#include <sstream>
vector<shared_ptr<Lexem>> ExprParser::parseLexems(string& expression) {
vector<shared_ptr<Lexem>> lexems;
while (!expression.empty()) {
lexems.push_back(getLexem(expression));
}
return lexems;
}
| true |
4804630008eec0af54123f4dab74a0bff4586469 | C++ | NQLong/sang-sang | /Library/Source/Catalog.cpp | UTF-8 | 4,890 | 3.140625 | 3 | [] | no_license | #include "../Header/Catalog.h"
#include "../Header/Library.h"
Catalog::Catalog()
{
}
Catalog::~Catalog()
{
}
Catalog::Catalog(list<Book> books)
{
this->books = books;
}
// friend ostream &operator<<(ostream &os, const Catalog &);
// friend bool operator==(const Catalog &lhs, const Catalog &rhs);
... | true |
968194e67e14b73c75e9473e52326c24e8004216 | C++ | lawtonsclass/f20-code-from-class | /csci40/lec01/hello.cpp | UTF-8 | 487 | 3.984375 | 4 | [] | no_license | #include <iostream>
using namespace std; // now we can skip the "std::"s
int main() {
// a complete C++ statement ends with a semicolon
// think of << as arrows that point in the direction of data
// transfer
cout << "Hello, world!\n"; // std::cout prints the text you give it to
... | true |
b89e1470739005c917ab6304312e86e34f932375 | C++ | ahmadmamdouh-10/OOP-With-C- | /Day1/Day1.1/main.cpp | UTF-8 | 959 | 4.15625 | 4 | [] | no_license | #include <iostream>
using namespace std;
//struct declaration:
struct point
{
int x, y;
};
//function prototype:
int Sum(int x,int y);
double Sum(double x, double y);
point Sum(point p1, point p2)
{
point result;
result.x=p1.x+p2.x;
result.y=p1.y+p2.y;
return result;
}
i... | true |
a1424a564896cd8fe2fe1b38a3e20ffc515820ee | C++ | lesleyping/leetcode-together | /src/offer14.cutRope/cupRope.cpp | UTF-8 | 1,015 | 3.375 | 3 | [] | no_license | class Solution1 {
public:
int cutRope(int number) {
if(number <= 2)
return number;
if(number == 3)
return 2;
int* res = new int[number+1];
res[0] = 0;
res[1] = 1;
res[2] = 2;
res[3] = 3;
int max = 0;
for(int i = 4; i <= ... | true |
1e1a25c9476b5c31d6e76ed033ce04f46178c4e2 | C++ | hnutank163/algor | /leetcode/maxSlidingWindow.cpp | UTF-8 | 2,317 | 3.265625 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <deque>
using namespace std;
class Solution{
public:
int max(vector<int>::iterator iter1, vector<int>::iterator iter2){
int maxNum = *iter1;
if(iter1>=iter2)
return 0;
while(iter1!=iter2)
{
if(maxNum < *iter1)
... | true |
2c3f40bf13bb84c5189cac5ad5c9218a7138320d | C++ | rahul2412/C_plus_plus | /overstring.cpp | UTF-8 | 1,600 | 3.34375 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
class test {
char *value;
int len;
public:
test(){
len=0;
value=0;
}
test(char *s){
len=strlen(s);
value=new char[len+1];
strcpy(value,s);
}
test (test &s)
{
len=strlen(s.value);
value=new char[len+1];
strcpy(value,s.value)... | true |