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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
00db65754fefa27afd0ed38cfbde904f305f6a5d | C++ | vehar/la10cee | /src/DBThread.cpp | UTF-8 | 5,517 | 2.625 | 3 | [] | no_license | #include "DBThread.h"
DBThread::DBThread(StatMaps* statMaps, const string& dbConnectionOptions)
: m_statMaps(statMaps)
{
m_lastStatOutput = time(NULL);
m_dbConnection = new connection(dbConnectionOptions);
}
DBThread::~DBThread()
{
stop();
}
bool DBThread::run()
{
cerr << "<DBThread>\tStarting" << endl;
try
... | true |
37c0d8dac17d1953c3cfe25d48e9dd182287bdb3 | C++ | paperfrog1228/Algorithm | /Baekjoon/6603_로또.cpp | UTF-8 | 646 | 2.515625 | 3 | [] | no_license | #include<stdio.h>
int k,lotto[15],visit[15],ans[7],cnt=-1;
void Lotto(int i){
if(visit[i])
return;
visit[i]++;
cnt++;
ans[cnt]=lotto[i];
if(cnt<6)
for(int j=i;j<=k;j++)
Lotto(j);
else{
for(int i=1;i<=6;i++)
printf("%d ",ans[i]);
... | true |
5ee96fd1a5c139148a0a77944a5ca58699ffaf8b | C++ | dandaso/uds_loadtester | /src/uds_loadtest.cpp | UTF-8 | 2,919 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/thread/thread.hpp>
#include <boost/progress.hpp>
#include <boost/timer.hpp>
#include <boost/program_options.hpp>
#include <boost/thread/mutex.hpp>
#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
using boost::asio::local::stream_protocol;
#el... | true |
eebfa0003be43843064793a516c422f89b276c03 | C++ | PPXComputer/study | /graph1.h | GB18030 | 13,971 | 3.234375 | 3 | [] | no_license | /* ļ洢йؼͼĴ
*ʵֹͼڽӱ( ά List_[0]={ 2,3 3,4 } ʾ 0--2 Ϊ Ȩֵ3 0---3ΪȨֵ4 ʺϡͼ ȱظ¼ )
*ע ڽ̲ ڽӱ ıʾ vector<list<T>> List List[0] ={ 2->3->4 }ʾ 02 3 4
*ڽӾ(Matrix[3][4]=2 ʾ3---4 ΪȨֵ 2 ȨֵΪ INT_MAX ʾûб ʺϳͼ Ǿ洢Խʡռ )
* ڽӾ ȱ߽ vector<list< T>> list List List[0... | true |
f4e917b5cac334edb254ef62b55cf8e4fe48b0ad | C++ | ThorbenQuast/RepellingInteractionTrajectory | /integral.cc | UTF-8 | 4,120 | 2.90625 | 3 | [] | no_license | //compile and run:
//g++ integral.cc -o integral.out && ./integral.out
#include <iostream>
#include <cmath>
double c = 299792458.0; //speed of light in m/s
double m_e = 0.511*10e-3; //electron mass in keV
double pi = 3.1415926535897;
double deg_to_rad = (pi/180);
double invGev_to_m2 = 0.389379*pow(10, -... | true |
8b59a2b92165771bb4a981a1a2dbe2bcb96b17f8 | C++ | Slava/competitiveProgramming | /more-source/2010-2011/Karaganda_camp_7_8/solutions/7.3/c.cpp | UTF-8 | 281 | 2.65625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main() {
int n,next,temp,counter=0;
cin>>n;
cin>>next;
for(int i=1; i<n; i++) {
cin>>temp;
if(next==temp) {counter++;}
next=temp;
}
cout<<counter;
return 0;
} | true |
87f77c73011fbd601c5c84287a5c4e0b708494c6 | C++ | edrummon/NetBeans | /AccCpp/Acc10ArraysPointers/main.cpp | UTF-8 | 2,848 | 3.40625 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Instinct212
*
* Created on May 26, 2014, 7:52 PM
*/
#include <fstream>
#include <cstring>
#include "median.h"
#include "stringList.h"
using std::string; using std::ifstream;
using std::cout; using std::endl;
using std::cin; using std::cerr;
using s... | true |
f736989cf8b2e493b7c60439361e4f530380daf1 | C++ | yistabraq/pcsc-cenxfs-bridge | /XFS/Logger.h | UTF-8 | 944 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef PCSC_CENXFS_BRIDGE_XFS_Logger_H
#define PCSC_CENXFS_BRIDGE_XFS_Logger_H
#pragma once
#include <sstream>
// Для WFMOutputTraceData.
#include <xfsadmin.h>
namespace XFS {
/** Перенаправляет весь вывод в XFS трассу. Логгирование осуществляется в деструкторе.
*/
class Logger {
... | true |
51d087fdf29df06d63825c5cb257c1072b1cc206 | C++ | everything411/BIT_Exercises | /乐学/计算理论与算法2020/符号三角形问题.cpp | UTF-8 | 1,231 | 2.625 | 3 | [
"Unlicense"
] | permissive | #include <iostream>
#include <cstring>
using namespace std;
int sum;
int half;
int n;
int p[30][30];
void backtrack(int t, int c)
{
if (c > half || t * (t - 1) / 2 - c > half)
{
return;
}
if (t > n)
{
sum++;
return;
}
for (int i = 0; i < 2; i++)
{
p[1][t] ... | true |
4390d2ff0027b00fc49801be764e4ee6f0682fa3 | C++ | jorgeblnz/DrumIlluminator | /DumIlluminatorFunctions.cpp | UTF-8 | 2,955 | 3.28125 | 3 | [] | no_license | /***************************************************
* Colección de Funciones para Arduino
* Archivo: DumIlluminatorFunctions.cpp
* Autor: Jorge Ignacio Balanz Pino
* Fecha: mayo de 2016
* Descripción: Colección de funciones que me
facilitarán las tareas de programación.
*
***************************************... | true |
eb3dc77a4cf392b5f471f3e15cd7c5f7da4cc9fb | C++ | velenk/CPP | /C++Primer/3.2.3count_punctuation.cpp | UTF-8 | 394 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <string>
using std::string;
using std::cin;
using std::cout; using std::endl;
int main() {
string s("Hello World!!!");
decltype(s.size()) punct_count = 0;
//Statistic the number of punctuation characters in s.
for (auto c : s) {
if (ispunct(c))
punct_count++;
}
cout <<... | true |
22364b6dce643080b5a209333c1310207d3b6d39 | C++ | eagle-deep-blue/mobile_base_modelling | /src/perception/perception_lidar_node.cpp | UTF-8 | 2,119 | 2.75 | 3 | [] | no_license | /*
* perception_laser_scan.cpp
*
* Created on: Dec 7, 2017
* Author: solomon
*/
#include <ros/ros.h>
#include <sensor_msgs/LaserScan.h>
void callbackLaser(const sensor_msgs::LaserScanConstPtr& msg);
int main(int argc, char** argv) {
ros::init(argc, argv, "perception_laser_scan_node");
ros::NodeHandle h... | true |
3a27a127267c509b526b9b1d8d7dc8d03f597c2b | C++ | roddehugo/utc | /lo21/td4/UTProfiler.cpp | ISO-8859-1 | 4,446 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "UTProfiler.h"
#include <fstream>
#include <sstream>
//UVManager* UVManager::instanceUnique = 0; //
UVManager::Handler UVManager::handler=Handler();
ostream& operator<<(ostream& f, const UV& uv){
return f<<uv.getCode()<<", "<<uv.getCategorie()<<", "<<uv.getNbCredits()<<" credits, "<<uv.getTitre();... | true |
d4000a3b135b2d814145582fbf23dc456ed4bf58 | C++ | DCubix/another-engine | /src/rendering/framebuffer.cpp | UTF-8 | 5,412 | 2.5625 | 3 | [] | no_license | #include "framebuffer.h"
#include <iostream>
namespace ae {
void FrameBuffer::free() {
if (m_id) {
glDeleteFramebuffers(1, &m_id);
m_id = 0;
}
if (m_rboID) {
glDeleteRenderbuffers(1, &m_rboID);
m_rboID = 0;
}
m_colorAttachments.clear();
}
void FrameBuffer::create(uint32 width, uint32 height,... | true |
ad479105126e7c701dbdc8bc07be616f65bd9d86 | C++ | helloketty1028/sky.github.io | /CrowdedHospital/CrowdedHospital/main.cpp | UTF-8 | 4,235 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include "hospital.hpp"
using namespace std;
Hospital* CreateHospital();
void InitBedLayout(Hospital *hospital);
PatientType InputPatientType();
void CinClear();
int main(int argc, const char * argv[]) {
auto *hospital = CreateHospital();
InitBedLayout(hospital);
... | true |
a458d2a4917bf1124f5a7b3e2437d4878f05255c | C++ | pcatrina/CPP | /Module05/ex00/main.cpp | UTF-8 | 507 | 2.625 | 3 | [] | no_license | #include <iostream>
#include "Bureaucrat.hpp"
int main()
{
try
{
Bureaucrat putin("Vova");
putin.inc();
std::cout<<putin;
}
catch (std::exception & e)
{
std::cerr<<e.what()<<std::endl;
}
try
{
Bureaucrat putin("Vova");
putin.dec();
std::cout<<putin;
}
catch (std::exception & e)
{
std::cerr<<... | true |
9db30b7668ff278a732dc096f1efe8d50c535857 | C++ | pmackle/Monopoly | /Property.h | UTF-8 | 1,832 | 2.640625 | 3 | [] | no_license | #ifndef CPPHOARDING_PROPERTY_H
#define CPPHOARDING_PROPERTY_H
#include <string>
//#include "Player.h"
#include "Space.h"
class Property : public Space
{
public:
Property(int index, std::string type, std::string name, int setID,
int intrasetID, int propertyCost, int houseCost, int hot... | true |
5b035aec9d8411b5cb222729f62c6c0e296a576d | C++ | wiidev/usbloadergx | /source/network/URL_List.cpp | UTF-8 | 2,661 | 2.625 | 3 | [] | no_license | /****************************************************************************
* URL List Class
* for USB Loader GX
* by dimok
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gctypes.h>
#include "URL_List.h"
URL_List:... | true |
4a852d102e30298cf5f8f49a8be7c401efd53997 | C++ | Allyrax/Bomberman | /Server.cpp | UTF-8 | 3,779 | 3.25 | 3 | [] | no_license | #include "thread.h"
#include "socketserver.h"
#include <stdlib.h>
#include <time.h>
#include <list>
#include <pthread.h>
#include <vector>
#include <string>
class GameThread: public Thread {
private:
Socket sP1;
Socket sP2;
int* grimReaper;
public:
GameThread(Socket const & sPa, Socket const & sPb, int* grimRe... | true |
cf3ceab68a09773229805a6d52d1bddb869e19d9 | C++ | eputh/using-multi-dimensional-arrays | /magic-square.hpp | UTF-8 | 1,343 | 3.6875 | 4 | [] | no_license | //
// Name: Emily PUth
// ID: 28239807
//
// The Magic Square program reads a given file and
// determines whether the grid contained in the file
// is a Lo Shu Magic Square. A Lo Shu Magic Square
// 3 X 3 grid (1) contains the numbers 1 through 9 exactly
// once AND (2) has a sum of 15 for each row, each column
// an... | true |
e54588523aeb311d920dbe8068f4ed03eb3df6ab | C++ | NEITGNART/LeetCode | /179. Largest Number Solution1.cpp | UTF-8 | 409 | 3.0625 | 3 | [] | no_license | class Solution {
public:
string largestNumber(vector<int>& nums) {
sort(nums.begin(), nums.end(), [](int x, int y) {
string sx = to_string(x);
string sy = to_string(y);
return sx + sy > sy + sx;
});
string res;
for (auto num : nums)
... | true |
ee1916d9a1186edcc0a1475b1fee2d4cf56674ad | C++ | puer99miss/Xapiand | /src/geospatial/convex.h | UTF-8 | 4,169 | 2.671875 | 3 | [
"MIT",
"GPL-2.0-only",
"Apache-2.0",
"GPL-1.0-or-later",
"BSD-3-Clause"
] | permissive | /*
* Copyright (c) 2015-2018 Dubalu LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, pub... | true |
75cdf909bb543572003592774c35f40e5ed8a9b2 | C++ | export-default/uva-problems | /src/591.cpp | UTF-8 | 723 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <vector>
// https://uva.onlinejudge.org/external/5/591.html
int main() {
int n;
int set = 0;
while (std::cin >> n && n != 0) {
int tmp;
std::vector<int> vec;
int mid = 0;
for (int i = 0; i < n; ++i) {
std::cin >> tmp;
vec... | true |
06005f52eb67b176750773a261e925a2f99df6a5 | C++ | AlexanderRusak/DevIncubator | /HW2/HW Task1.cpp | UTF-8 | 740 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
/* int numbers[]={1,2,3,4,5};
for(int i=0;i<5;i++){
cout<<i+1<<endl;
}*/
/* int numbers[]={-2,-1,0,1,2};
for(int i = 0; i < 5 ; i++){
cout<<i-2<<endl;
}*/
/* int numbers[]={-2,0,2,4,6};
for(int i = 0; i < 5 ; i++){
cout<<2*i-2<<endl;
... | true |
3aed4d8f347146fd888d6a3878bec0af29dc60c6 | C++ | AndrePim/Test_RFID | /src/main.cpp | UTF-8 | 3,483 | 2.578125 | 3 | [] | no_license | /*
* Typical pin layout used:
* -----------------------------------------------------------------------------------------
* MFRC522 Arduino Arduino Arduino Arduino Arduino
* Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro
* Signal Pin... | true |
47522f696528b488faab1dacb135ea8e24222104 | C++ | hopeyouguessmyname/progs | /210601.cpp | UTF-8 | 2,813 | 3.5625 | 4 | [] | no_license | //decorator
#include <iostream>
#include <string>
/* Standardowy nieudekorowany samochod */
class Samochod
{
protected:
std::string samochod;
double wartosc;
public:
Samochod()
{
std::cout<<"Samochod()";
samochod = "Samochod podstawowy";
wartosc=0;
}
virtual ~Samochod()... | true |
03cdf861330dbf0420407605f9bd41d27a53d8e0 | C++ | dleybz/PIC10B | /4.Eight-Queens-Problem/EightQueensApp.cpp | UTF-8 | 987 | 3.375 | 3 | [] | no_license | /*
Daniel Leybzon PIC 10B Intermediate Programming
ID: 804503913 Spring 2015
Email: dannyleybzon@gmail.com
Section:
Honesty Pledge:
I, Daniel Leybzon, pledge that this is my own independent work, which conforms to the guideliens of academic honesty as described in the course syllabus.
List of known bu... | true |
767a9d2ae94dd986438ceb62ada422d29266cc10 | C++ | xumenger/xumenger.github.shit | /C++Test/书本上的作业题、代码等/2上机作业/06.06.13构造一个函数将输入的两个字符串连接在一起,并且用new去找到一个新的地址去存储新的字符串/未命名1.cpp | WINDOWS-1252 | 596 | 3.46875 | 3 | [] | no_license | #include<iostream>
#include <cstring>
#include <cassert>
using namespace std;
char* cat(const char* str1,const char* str2)
{
assert(str1!=NULL && str2!=NULL);
int len1=strlen(str1);
int len2=strlen(str2);
char *str=new char(len1+len2+1);
if(str==NULL)
cout<<"ڴʧ\n";
strcpy(str,str1);
... | true |
b1947d360f03a4c8d5d4f4bb57f015a91ad99d4d | C++ | yongduek/myGraphics | /2/src/myGL.h | UTF-8 | 4,449 | 2.953125 | 3 | [] | no_license | #include <vector>
#include <math.h>
#include <iostream>
using namespace std;
typedef unsigned char uchar;
struct mPointf {
float x, y;
mPointf(float xx=0, float yy=0) : x(xx), y(yy) {}
};
struct mPointi {
int x, y;
mPointi(int xx=0, int yy=0) : x(xx), y(yy) {}
};
struct mColor {
uchar r, g, b;
... | true |
6beea93ae3d7837f7606c9ed5ea74f435620ac4b | C++ | 6gales/CompTech | /CompTech/SpellChecker/BruteForce.cpp | UTF-8 | 496 | 2.828125 | 3 | [] | no_license | #include "BruteForce.h"
std::multimap <size_t, std::string> BruteForce::checkWord(const std::string &source)
{
const size_t editDistance = editDistFormula(source.size());
std::string tmp;
std::multimap <size_t, std::string> suggestions;
while (dictionary.good())
{
dictionary >> tmp;
size_t dist = Levenshtei... | true |
346c7a44d0b25b4ccd0591629718a96ea2f1a832 | C++ | Lyuekiller/Pressurelog | /Pressurelog.h | UTF-8 | 683 | 2.546875 | 3 | [] | no_license | #ifndef LOG_H
#define LOG_H
#include <QDate>
#include <QTime>
class Pressurelog
{
public:
Pressurelog();
void setDate(QDate date);
void setTime(QTime time);
void setSand_ratio(double sand_ratio);
void setSand_concentration(double sand_concentration);
void setPressure(double pressure);
void ... | true |
66d7cd342f5c31d159c77a93c9e0d934bcc0940d | C++ | matze999/MathX | /pi/scanner/SkipScanner.h | UTF-8 | 1,862 | 2.546875 | 3 | [] | no_license | #ifndef _SKIPSCANNER_H_
#define _SKIPSCANNER_H_
#include "../operator/Repeat.h"
#include "../scanner/Scanner.h"
namespace pi {
class skip_scanner_tag {};
template <class Parser, class Scanner = pi::Scanner>
class SkipScanner: private skip_scanner_tag
{
typedef _::repeat_p <Parser, 0, -1> SkipParser;
pu... | true |
3d7209aa9d575c049abcd5068b21eb86a1bc2638 | C++ | gjbr5/othello | /localgame.cpp | UTF-8 | 1,526 | 3.078125 | 3 | [] | no_license | #include "localgame.h"
#include <QDebug>
#include <QMessageBox>
#include <cstdlib>
#include <ctime>
LocalGame::LocalGame(BoardModel* bm, PanelModel* pm, Player* player1, Player* player2)
: Game(bm, pm)
, black(player1)
, white(player2)
{
}
LocalGame::~LocalGame()
{
delete black;
delete white;
}
v... | true |
966f04217eb827e6776f3b57cb4d29388437d525 | C++ | Omargw/CPP-iHUB | /session1.cpp | UTF-8 | 4,140 | 3.3125 | 3 | [] | no_license | // Example program
#include <iostream>
#include <string>
using namespace std;
// constants
#define LENGTH 10
#define WIDTH 5
#define NEWLINE '\n'
int main()
{
cout << "Hello world \a " << endl;
// printf("Hello world \n");
// Escape sequence
/*
\\ \ character
\' ' cha... | true |
f63c7496a6525c442f5ed80ff9016f4c2652b971 | C++ | BoostGSoC18/Advanced-Intrusive | /include/boost/graph/HLD/hld_ds.hpp | UTF-8 | 4,345 | 3.109375 | 3 | [
"BSL-1.0"
] | permissive | namespace boost{
namespace graph{
/*!
<ul>
<li>This is the main class which contains all the methods related to Heavy light decomposition.</li>
<li>This is a very popular decomposition because it has many applications in solving tree based problems.</li>
<li>With this decomposition we can travel between any 2 node... | true |
4d6628e324817c0a1a060ff045f433a911ebba16 | C++ | dayeondev/AlgoStudy | /etc/10886_cute.cpp | UTF-8 | 296 | 2.75 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int n;
int t = 0, f = 0;
int main(void){
cin >> n;
int tmp;
for(int i = 0; i < n; i++){
cin >> tmp;
if(tmp) t++;
else f++;
}
if(t < f) cout << "Junhee is not cute!";
else cout << "Junhee is cute!";
}
| true |
5fa7d2f85615d37a738e5d5e915b7234a0f54ac2 | C++ | EricPolman/Micro-Machines-in-3D | /Code/RaceManager.cpp | UTF-8 | 4,782 | 2.65625 | 3 | [] | no_license | #include "RaceManager.h"
#include <iostream>
#include "TextRenderer.h"
#include <sstream>
#include "Boat.h"
#include "Camera.h"
using namespace GameLayer;
RaceManager::~RaceManager(void)
{
m_waypoints.clear();
m_racerData.clear();
}
void RaceManager::Init()
{
TextRenderer::GetInstance()->AddString("lapcounte... | true |
44a0a86f7b582ee71b46dd12e71515daaa6e534e | C++ | AparAhuja/COL216_Lab | /A3/main.cpp | UTF-8 | 18,601 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
using namespace std;
string file_path = "/Users/aparahuja/Desktop/IITD/COL216 - Arch/COL216_Lab/A3/A3/input.txt";
int PC = 0;
int PARTITION = 0;
int memory[1048576];
string decimalToHexadecimal(long long a) {
string a... | true |
9007bea7209a9db30bde93f4946326a8ca166bb8 | C++ | ren082215/LeetCode | /src/cpp/0150-evaluateReversePolishNotation.cpp | UTF-8 | 567 | 2.984375 | 3 | [] | no_license | class Solution {
public:
int evalRPN(vector<string>& tokens) {
int op = (int)tokens.size() - 1;
return helper(tokens, op);
}
int helper(vector<string>& tokens, int& op) {
string str = tokens[op];
if (str != "+" && str != "-" && str != "*" && str != "/") return stoi(str);
... | true |
0c93f18fcc7153a58db7fc2cd64edde2d18a1fba | C++ | darcyliu/mlpack | /src/mlpack/methods/ann/performance_functions/sse_function.hpp | UTF-8 | 1,540 | 2.9375 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* @file sse_function.hpp
* @author Marcus Edel
*
* Definition and implementation of the sum squared error performance function.
*/
#ifndef MLPACK_METHODS_ANN_PERFORMANCE_FUNCTIONS_SSE_FUNCTION_HPP
#define MLPACK_METHODS_ANN_PERFORMANCE_FUNCTIONS_SSE_FUNCTION_HPP
#include <mlpack/core.hpp>
namespace mlpack {
... | true |
d6f257b02c6c8531387df7864ab35d7a9a7849ff | C++ | SX-CPP/sci_computing_cpp_wi2019 | /exercises/solution/sheet5/exercise3a.hh | UTF-8 | 2,194 | 3.703125 | 4 | [] | no_license | #pragma once
#include <cassert>
#include <vector>
struct Matrix1
{
// Default initialization
// NOTE:
// - The keyword `= default` means: use the default implementation for that function.
// - The default implementation of the default constructor is: default-construct all
// members of the class.
Matrix... | true |
8d39b9d16a3969425c45c5bf3e3b3efd74404c42 | C++ | carlosngo/pseudocode | /res/question_9.cpp | UTF-8 | 1,345 | 3.78125 | 4 | [] | no_license | #include <iostream>
using namespace std;
void printF(int fontSize){
for(int i = 0; i<fontSize; i++){
cout << "*";
}
cout << endl;
cout << "*";
cout << endl;
for (int j = 0; j < fontSize -1; j++){
cout << "*";
}
cout << endl;
for(int i = 0; i<fontSize-2;... | true |
bfc2b80e030442b127736c8513c2a09abee770b1 | C++ | ooeyusea/OEngine2D | /src/OEngine2D/system/FileSystem.cpp | UTF-8 | 492 | 2.75 | 3 | [
"MIT"
] | permissive | #include "FileSystem.h"
#include <fstream>
namespace oengine2d {
bool FileSystem::Init() {
return true;
}
void FileSystem::Release() {
}
bool FileSystem::ReadFile(const std::string& path, std::string& buffer) {
std::ifstream file(path, std::ios::ate | std::ios::binary);
if (!file.is_open()) {
return ... | true |
aad0754322ad8acf065f15423a002a670d7ec9b9 | C++ | DongjunLim/algorithm_study | /프로그래머스/큰수 만들기.cpp | UTF-8 | 620 | 3.109375 | 3 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
using namespace std;
string solution(string number, int k) {
string answer = "";
int leng = number.length() - k;
int idx = 0;
int count = 0;
char max;
while (k > 0 && answer.length() < leng) {
max = number[idx];
for (int i = idx; i < idx + k; i++) {
... | true |
17282f32bf491c773f25b3cca14e8976d5d4d7bf | C++ | juanjp600/pge | /Src/Graphics/Texture/TextureOGL3.cpp | UTF-8 | 4,724 | 2.546875 | 3 | [
"Zlib"
] | permissive | #include "../GraphicsOGL3.h"
#include <stdlib.h>
using namespace PGE;
static int getCompressedFormat(Texture::CompressedFormat fmt) {
switch (fmt) {
using enum Texture::CompressedFormat;
case BC1: { return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; }
case BC2: { return GL_COMPRESSED_RGBA_S3TC_DXT3_... | true |
c1f352c75b5052adbf7755a701f27a3d3bf8cc10 | C++ | drleq/CppDicom | /DicomTest/dicom_test/data/URTest.cpp | UTF-8 | 2,366 | 2.65625 | 3 | [
"MIT",
"BSL-1.0"
] | permissive | #include "dicomtest_pch.h"
#include "CppUnitTestFramework.hpp"
#include "dicom/data/UR.h"
#include "dicom/Tags.h"
#include "dicom_test/data/detail/constants.h"
using namespace std;
using namespace dicom;
using namespace dicom::data;
namespace {
struct URTest {};
}
namespace dicom_test::data {
TEST_CASE(URT... | true |
8666be07b6f7c0947f7f1b71956c3762b3a47549 | C++ | uc4w6c/CompetitiveProgramming | /tutorial/3.04/main.cpp | UTF-8 | 348 | 3.125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Book {
string name;
int price;
};
int main() {
vector<Book> books;
books.push_back({ "アルゴリズムとデータ構造", 4000 });
books.push_back({ "リーダブルコード", 2000 });
for (Book book: books) {
cout << book.name << ", " << book.price << endl;
}
}
| true |
e27ae0a1691969e4335af32da72afe65ab48ba4d | C++ | byebye/TimeGuard | /timeguardgui/timelimit.h | UTF-8 | 1,017 | 2.859375 | 3 | [] | no_license | #ifndef TIMELIMIT_H
#define TIMELIMIT_H
#include <QObject>
#include <QTime>
#include <QStringList>
class TimeLimit : public QObject
{
Q_OBJECT
public:
explicit TimeLimit(QObject *parent = 0);
TimeLimit(int timeSeconds, QObject *parent = 0);
TimeLimit(QString timeString, QObject *parent = 0);
TimeLimit(QTime... | true |
4add26fd2ae1dfa2a017d40b27911a22843b2a70 | C++ | ybouret/upsylon | /src/main/y/geometry/iso2d/coordinate.cpp | UTF-8 | 2,156 | 2.734375 | 3 | [] | no_license | #include "y/geometry/iso2d/coordinate.hpp"
#include "y/type/block/zset.hpp"
namespace upsylon {
namespace geometry {
namespace Iso2D {
Coordinate:: Coordinate(const unit_t I,
const unit_t J,
const short Q) throw() :
... | true |
52875d6a585559cd0cb76c59e3d8a74a5e66a452 | C++ | wovert/CTutorials | /C++/函数对象/函数对象/main.cpp | UTF-8 | 487 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
#include <string>
using namespace std;
void test01() {
vector<int> v;
v.push_back(8);
v.push_back(2);
v.push_back(3);
v.push_back(5);
v.push_back(1);
v.push_back(3);
sort(v.begin(), v.end(), greater<int>());
for_each(v.begin()... | true |
e0991c4bf34b52166084f154722f30f72002887a | C++ | TheRolfFR/YellowSubmarine | /Sensors/HumiditySensor.h | UTF-8 | 536 | 2.640625 | 3 | [] | no_license | #ifndef H_HUMI_SENSOR
#define H_HUMI_SENSOR
#include "Sensor.h"
class HumiditySensor: public Sensor<float> {
public:
HumiditySensor(): Sensor<float>(HumiditySensorType) {}
HumiditySensor(std::string name): Sensor<float>(HumiditySensorType, name) {}
HumiditySensor(const HumiditySensor& o) : Sens... | true |
82075292905d1cf36196781d6ad6ddcc4fe729fc | C++ | IritaSee/LearningArchive | /qwerty.cpp | UTF-8 | 342 | 2.65625 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
int main()
{
bool hasil;
int x;
char nama[50];//karena nama
cout<<"nama: "; gets(nama);//karena char
cout<<"nilai: "; cin>>x;
hasil = x > 70;//definisi boolean
if (hasil)
cout<<x<<"\nalhamdulillah "<<nama<<" lulus ";
else
cout<<x<<"\nGUOB... | true |
535643f71bf6a3d041def5f34088f4124079e2ca | C++ | CJHMPower/Fetch_Leetcode | /data/Submission/323 Number of Connected Components in an Undirected Graph/Number of Connected Components in an Undirected Graph_1.cpp | UTF-8 | 1,358 | 2.953125 | 3 | [] | no_license | //-*- coding:utf-8 -*-
// Generated by the Fetch-Leetcode project on the Github
// https://github.com/CJHMPower/Fetch-Leetcode/
// 323 Number of Connected Components in an Undirected Graph
// https://leetcode.com//problems/number-of-connected-components-in-an-undirected-graph/description/
// Fetched at 2018-07-24
// S... | true |
702b588a546717011d93cf39e7ea1e75df179238 | C++ | liuxw7/ipc-pubsub | /lib/Subscriber.h | UTF-8 | 1,248 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <functional>
#include <memory>
#include <string>
#include <string_view>
#include <thread>
#include <vector>
struct msghdr;
namespace ipc_pubsub {
struct IPCMessage {
public:
static std::shared_ptr<IPCMessage> Create(size_t vecLen, const struct msghdr& msgh);
IPCMessage(std::string_vie... | true |
5446e62cdcf5d9c461b36c408f6fd73744d45e1d | C++ | smdi17/Laboratornie-raboty | /LR8/LR8/LR8.cpp | UTF-8 | 3,999 | 2.96875 | 3 | [] | no_license | // LR8.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
void chislo()
{
int number;
cout << "Введите пятизначное число" << endl; //Ввод числа
cin >> number;
for (int i = 0; i < 5; i+... | true |
9702df88528908c011c5fa606bc7bdd9e56f2762 | C++ | Zzhc3321/cpp | /模板/Linklist.h | WINDOWS-1252 | 785 | 3.140625 | 3 | [] | no_license | #include "Node.h"
template<class T>
class Linklist{
private:
Node<T>*front,*rear;
Node<T>*prevPtr,*currPtr;
int size;
int position;
Node<T> *newNode(const T&item,Node<T> *ptrNext=NULL);
void freeNode(Node<T>*p);
void copy(const Linklist<T>&L);
public:
Linklist();
Linklist(const Linklist<T> &L);
~Li... | true |
b9bd4c036372298125ab74acdaa6341dd735b65b | C++ | wonbae/Algorithm | /BOJ/BOJ_10815/BOJ_10815.cpp | UTF-8 | 889 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
// freopen("input.txt", "rt", stdin);
int N, M, lt = 0, rt, mid, num;
cin>>N;
vector<int> v(N);
for(int i = 0; i < N; i++){
cin>>v[i];
... | true |
9e40b374fce0eae9d818a0bb3c5a8819f3799d5d | C++ | evanchime/visualStudioProjects | /Projects/chapter_1_tab/chapter_1_tab/chapter_1_tab.cpp | ISO-8859-1 | 5,504 | 2.84375 | 3 | [] | no_license | // chapter_1_tab.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
/*
* Exercise 1-20
* Write a program detab that replaces tabs in the input
* with the proper number of blanks to space to the next tab stop.
* Assume a fixed set of tab stops, say every n columns.
* Should n be a v... | true |
d381301adf00c674935e9a50203a553bc9fc841d | C++ | pablo-jenne/Cpp | /project_CPP/draw.cpp | UTF-8 | 5,494 | 2.796875 | 3 | [] | no_license | #include "draw.h"
bool Draw::getGameover() const
{
return gameover;
}
bool Draw::Snoepje1() const
{
return snoepje1;
}
bool Draw::Snoepje2() const
{
return snoepje2;
}
bool Draw::Snoepje3() const
{
return snoepje3;
}
bool Draw::EERSTE_SNOEPJE() const
{
return eerste_s... | true |
22d2f8299a6b5f82f0240fac80d3c61446e21e61 | C++ | suzyli123/leetcode | /cpp/328. Odd Even Linked List.cpp | UTF-8 | 1,453 | 3.609375 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* oddEvenList(ListNode* head) {
ListNode *odd = NULL, *even = NULL, *odd_head = NULL, *even_head = NULL, *temp;
... | true |
ea3cd0ff3a8b3a4643ed81e1d8c6054d9b25a17f | C++ | HTDPNJ/leiShuZuDeXunLian | /类数组的训练/myArray.h | UTF-8 | 273 | 2.625 | 3 | [] | no_license | #pragma once
#include<iostream>
using namespace std;
class Array {
private:
int m_length;
int *m_space;
public:
Array();
Array(int a);
Array(const Array& obj);
~Array();
public:
void setData(int index,int value);
int getData(int index);
int length();
protected:
}; | true |
df0fa13e5e07c4fe7c0babb5d1047ee79fc1b426 | C++ | HappyRa1n/Sort | /Counting_Sort/counting_sort.cpp | UTF-8 | 525 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
void Sort(int* mas, int k, int n) {
int* c = new int[k + 1];
for (int i = 0; i < k + 1; i++)
c[i] = 0;
for (int i = 0; i < n; i++)
c[mas[i]]++;
int tmp = 0;
for (int i = 0; i < k + 1; i++) {
while (c[i] > 0) {
mas[tmp++] = i;
c[i]--;
}
}
delete[] c;
}
int m... | true |
84da41ba9e0de8e0563abb2b4c30c392f133c61e | C++ | cedi/cryptopals | /libcryptopals/src/Hexadecimal.cpp | UTF-8 | 1,092 | 3.140625 | 3 | [] | no_license | #include <stdexcept>
#include <sstream>
#include <iomanip>
#include <string>
#include <cstdint>
#include "Hexadecimal.hpp"
#include "Utils.hpp"
using namespace std;
const string Hexadecimal::table = "0123456789ABCDEF";
string Hexadecimal::encode(const string& input)
{
vector<uint8_t> vec;
for(char c : input)
{
... | true |
3e87a4c08b408e6bfc36a0f85c76dcc250a3702a | C++ | rainlee/itint5 | /13-maxTreePathSum.cpp | GB18030 | 862 | 3.515625 | 4 | [] | no_license | /*
Ķ(벻Ҫڴж)
struct TreeNode {
int val;
vector<TreeNode*> children; //ýĶӽ
};
*/
// rootβ·ֵ
// ¼rootУrootβ֧
int maxTreePathSumRec(TreeNode *root, int &maxp)
{
if (!root)
return 0;
int max1 = 0,max2 = 0; // ¼֧
for (int i = 0; i < root->children.size(); ++i)
{
int tmp = maxTree... | true |
e91a353787f71188d3f728e384f8202eaaf2bc29 | C++ | samarjeet/cses | /src/rectangleCutting.cpp | UTF-8 | 1,078 | 2.65625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
typedef long long ll;
#define INF 1e7
int main(int argc, char** argv){
int a, b;
std::cin >> a >> b;
/*
// Approch : Greedy algorithm : incorrect
int min, max;
if (a<b){
min = a; max=b;
}
else {
min=b; max=a;
... | true |
026878b43d0e0f1149bca8b79371e1988e2248ac | C++ | pjdu/STM32duino_LED_Matrix | /sketch_jan07a_arduino_json_newline_test/mserial.ino | UTF-8 | 1,828 | 2.609375 | 3 | [] | no_license | #include "mserial.h"
/*
* 这个串口以"行"为单位进行处理 即 \n
* 用在stm32上适合,Arduino 未必
*/
char serial_cache[SERIAL_CACHE];//常驻内存,提高性能
byte CRC8( char *data, int len)
{
byte crc = 0x00;
while (len--)
{
byte extract = *data++;
for (byte tempI = 8; tempI; tempI--)
{
byte sum = (crc ^ extract) & 0x01;
... | true |
00670b5dd59114a57583532208b3dfeb539c9e36 | C++ | RodH257/Node.net | /v8/spikes/filetest.cc | UTF-8 | 4,448 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <v8.h>
// atlstr lets us use CString
#include <atlstr.h>
#using <System.Net.dll>
#using <mscorlib.dll>
#using <System.dll>
// Extracts a C string from a V8 Utf8Value.
const char* ToCString(const v8::String::Utf8Value& value) {
return *value ? *value : "<string conversion failed>";
}
using namespace v8;
... | true |
33f02b0c69355823a2e6961268f5feebed34c268 | C++ | WalterGoedecke/ceres | /Walter-togo/projects-togo/tut/EricLee/C++/HW10-Netflix/Library.h | UTF-8 | 702 | 3.015625 | 3 | [] | no_license | /**
* @author E.S.Boese
* @version Fall 2014
* project #2
*/
#ifndef LIBRARY_H
#define LIBRARY_H
#include "User.h"
#include "Book.h"
class Library
{
private:
std::vector<Book> bookList;
std::vector<User> userList;
/*
std::vector<string> authorList;
std::vector<string> titleList;
std:... | true |
8b5ce21356814a7874de302a8c935cb2ca707c04 | C++ | msatul1305/codechef-beginner-solutions | /removeNonSmallAlphabets.cpp | UTF-8 | 340 | 3.28125 | 3 | [] | no_license | #include<iostream>
using namespace std;
main()
{
string s;
getline(cin,s);
cout<<"original string= "<<s<<" with length= "<<s.size()<<endl;
for(int i=0;i<s.size();i++)
{
if(s[i]<'a'||s[i]>='z')
{
s[i]=NULL;
}
}
cout<<"changed string removing all non small alphabets= "<<s<<" with length= "<<... | true |
4555d2d9f8a59b81320e4416ba0adde50f36cad3 | C++ | TaylorClark/PrimeTime | /Base/DynamicBuffer.h | UTF-8 | 2,849 | 3.484375 | 3 | [
"MIT"
] | permissive | //=================================================================================================
/*!
\file IUpdatable.h
Base Library
Updatable Interface Header
\author Taylor Clark
\date May 13, 2006
This header contains the interface definition for the updatable base class.
*/
//=============================... | true |
0d63602160049ddf059d1fdb3ea2bfbc67c4bd5b | C++ | dreamer-dead/myxml | /src/myxml.hpp | UTF-8 | 10,691 | 2.703125 | 3 | [] | no_license | #if defined _MSC_VER && _MSC_VER >= 1300
#pragma once
#endif
#if !defined __HDR_MYXML_HPP__
#define __HDR_MYXML_HPP__
/* need for
XML_T macro
myxml::char_t type
*/
#include "config.hpp"
/*
need for
std::basic_string<>
*/
#include <string>
/*
need for
std::pair<>
*/
#include <utility>
... | true |
e4f2ae2a8b0260949a4f458c870d119ddb4f209f | C++ | RitchieLab/PLATO | /method_lib/mdrpdt/foldproduction.cpp | UTF-8 | 3,989 | 2.703125 | 3 | [] | no_license | //
// C++ Implementation: sibshipfoldproduction
//
// Description:
//
//
// Author: <>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "foldproduction.h"
#include <iomanip>
#include <sstream>
namespace MdrPDT {
using namespace std;
/**
* @brief performs the production, f... | true |
de5a67cd1c298ab7a34d110ef201c418ac3f6e47 | C++ | commondude/edu | /fiit_graphs_algo/2 Stalker/Stalker_error_branch.cpp | UTF-8 | 1,621 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
int n,k,i,j,roads,start_building,finish_building;
int main(){
if (in.is_open())
{
in>>n;
in>>k;
cout<<n<<"\n";
cout<<k<<... | true |
f1480fd61769ef46f858ab15cb00021952080332 | C++ | QuRyu/CS232 | /project7/assembler/assembler.cpp | UTF-8 | 1,960 | 2.890625 | 3 | [] | no_license | /**
* Qingbo Liu
* A simple machine code translator
*/
#include <map>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <ios>
using namespace std;
map<string, string> tokens = {{"Load", "0000"}, {"Store", "0001"},
{"Jump", "0010"}, {"Branch", "001100"}, {... | true |
f196417192def97e644564f637061ab80cfe4a1f | C++ | Blubcharge/The-Great-Escape | /ZombieArena/ZombieArena/TextureHolder.cpp | UTF-8 | 986 | 3.125 | 3 | [] | no_license | #include "stdafx.h"
#include "TextureHolder.h"
//include assert feature
#include <assert.h>
TextureHolder* TextureHolder::m_s_Instance = nullptr;
TextureHolder::TextureHolder()
{
assert( m_s_Instance == nullptr );
m_s_Instance = this;
}
Texture & TextureHolder::GetTexture(string const & filename)
{
// get a re... | true |
807c08fafc77fdf8e4133d285679893c491b0cef | C++ | gromchek/glconsole | /CommandArgs.cpp | UTF-8 | 674 | 3.0625 | 3 | [
"MIT"
] | permissive | #include "CommandArgs.h"
#include <sstream>
CommandArgs::CommandArgs( std::string_view command )
{
Tokenize( command );
}
void CommandArgs::Tokenize( std::string_view command )
{
constexpr std::string_view delims( " " );
size_t first = 0;
while( first < command.size() || argc >= MAX_ARGS )
{
... | true |
f592a6e6db96d2c344517e6ce04c9cd3c6964c73 | C++ | dseerutt/7Wonders | /7Wonders/7Wonders/openings.hpp | UTF-8 | 3,297 | 3.203125 | 3 | [] | no_license | #ifndef __OPENINGS_HPP__
#define __OPENINGS_HPP__
#include "allocator.hpp"
#include <vector>
#include "display_node.hpp"
namespace mcts
{
class openings
{
allocator alloc_;
node* root_;
const unsigned int nb_visits_before_expansion_;
void copy(node* src, node* dst, allocator& alloc) const;
te... | true |
deecfb2a908db0ecc04e0c422d2c506138c4308a | C++ | Priyadarshanvijay/Codingblocks-2018 | /week2/ArraysWavePrintRowWise.cc.cpp | UTF-8 | 998 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
void inputArray(int arr[][10],int column,int row)
{
for(int i=0;i<row;i++)
{
for(int j=0;j<column;j++)
{
cin >> arr[j][i];
}
}
}
void outputArray(int arr[][10],int column,int row)
{
bool startFromTop = true;
bool startFromBottom = false;
... | true |
fab3e6609ab526b71d6d8299d725d14e8dd2655e | C++ | mrc-ide/covfefe | /src/base_model.Dispatcher.cpp | UTF-8 | 34,665 | 2.71875 | 3 | [
"MIT"
] | permissive |
#include "base_model.Dispatcher.h"
#include "probability.h"
using namespace std;
//------------------------------------------------
// default constructor for Dispatcher class
Dispatcher::Dispatcher() {
// objects for sampling from probability distributions
sampler_age_stable = Sampler(age_stable, 1000);
s... | true |
ba8de9600b1151ff1df7c36c4f27cb7168fb43a1 | C++ | kakaxi1100/utopia | /SFML/practice/Framework/Framework/Animation.h | UTF-8 | 865 | 2.84375 | 3 | [] | no_license | #pragma once
#include <vector>
#include <memory>
#include "AnimationFrame.h"
class Animation
{
public:
Animation() = default;
Animation(unsigned int frameRate);
Animation(unsigned int frameRate, int loop);
~Animation() = default;
void addFrame(std::shared_ptr<AnimationFrame> frame);
void setLoop(int loop);
vo... | true |
41535fd7624f0e4f52c0db9d4eaa43e1563e3d74 | C++ | CarloDubini/Proyecto-Diciembre | /siete_y_media_vfinal.cpp | ISO-8859-1 | 18,240 | 2.546875 | 3 | [] | no_license | /*
Eduardo Abad Ibarrola
Carlo Dubini Marqus
*/
#include <iostream>
#include <fstream>
#include <list>
#include <istream>
#include <string>
#include <conio.h>
#include <stdio.h>
#include <cstdlib>
#include <ctime>
using namespace std;
const int HUMANO = 1;
const int MAQUINA = 2;
const int MAX = 8;
const int TAMBARAJ... | true |
a24820dc07375b1f6d90c69a9d9a04136459d063 | C++ | sikeking/AtcoderBeginingContest | /ABC128/B.cpp | UTF-8 | 486 | 2.96875 | 3 | [] | no_license |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int N;
cin >> N;
vector <pair<string, int> > S[N];
for(int i = 0;i < N;i++){
cin >> S[i].first >> S[i].second;
}
/*
for(int i = 0;i < N;i++){
if(min > S[i].first){
min ... | true |
5102d1827b32e3245b1fcb81cf054ab25a56634a | C++ | VarickQ/ACM | /HaveDone/大二暑假练习/第七场多校联合比赛解题报告+数据+标程/第七场多校联合比赛解题报告+数据+标程/Water World I/forcecode_0.cpp | UTF-8 | 2,540 | 2.609375 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#include<memory.h>
#define EPS 1e-6
#define PI acos(-1)
int n,i,j,k,maxi,iszero;
double angle,h[10005],th[10005],unitL,currH,tmph,sum;
struct TPoint{
double x,y;
}s,t,c;
double cross(const TPoint &a,const TPoint &b,const TPoint &c){
return (b.x-a.x)*(c.y-a.y) - (b.y-a.y)*(c.x-... | true |
30781f3aa716ed835ba2848dda66d52bc90d17b3 | C++ | apfitzen/Wireframes-Calc | /Wireframes Calc/Optimization.cpp | UTF-8 | 4,816 | 2.703125 | 3 | [] | no_license | //
// Optimization.cpp
// Wireframes Calc 4
//
// Created by Aaron Pfitzenmaier on 1/3/15.
// Copyright (c) 2015 Aaron Pfitzenmaier. All rights reserved.
//
#include <vector>
#include <ctime>
#include <cmath>
#include "Optimization.h"
#include "Compound.h"
#include "Frame.h"
#include "Utilities.h"
#include "Polyh... | true |
803dfab5521288163f228019d47fc9b23121fc21 | C++ | AndyChiangSH/Assembly-Language-Final-Project | /SICXE/pass1&2_XE.cpp | UTF-8 | 19,954 | 2.734375 | 3 | [] | no_license | // **pass1&2 SIC/XE assembler**
// Author: 4108056005 Andy Chiang
// Time: 2021/06/28
// Line: 790
// Description: This is a program for Assembly-Language and System-Software final project.
// This program can complete pass1 and pass2, then convert source code (assembly language) into object code.
// Input(pass1): sour... | true |
3a3b907ac99f4e5cb026bd1fe85ccc75e78849b9 | C++ | TaniyaPeters/BorealEngine | /include/IndexBuffer.h | UTF-8 | 1,041 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
namespace Boreal {
/**
* @brief Allows user to create and manage index buffers
*
* @section Description
*
* The index buffer class allows the user to create, bind, and unbind index buffers. This is used to create models along with the vertex buffer.
*
*/
class IndexBuffer {
public:
/**
* @br... | true |
d2328dd29fd18209d7e67185cdb037b0f0b1c87b | C++ | wangxiaobai-dd/MyRep | /cpp/TestPythonInvoke/py2cppboostclass.cpp | UTF-8 | 442 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive |
#include <boost/python.hpp>
using namespace boost::python;
class Test
{
public:
int Add(const int x, const int y)
{
return x + y;
}
int Del(const int x, const int y)
{
return x - y;
}
};
BOOST_PYTHON_MODULE(test3)
{
class_<Test>("Testt")
.def("Add", &Test::Add)
.def("Del", ... | true |
03bd0910038719f979dd58fb32709620d6470604 | C++ | galin-kostadinov/Software-Engineering | /C++/C++ Fundamentals Sept 2019/05. STRINGS AND STREAMS/codecpp/src/CompareArraysAgain.cpp | UTF-8 | 1,115 | 3.921875 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include<string>
#include<sstream>
#include<vector>
void read(std::vector<int> &numbers, const std::string line) {
std::istringstream lineStream(line);
int currentNumber;
while (lineStream >> currentNumber) {
numbers.push_back(currentNumber);
}
}
bool areEqual(std::vector<i... | true |
a4347becc77d7e98ff99055dc330484b6f7d6003 | C++ | jamiemott/Ant | /Validation.cpp | UTF-8 | 1,755 | 3.5 | 4 | [] | no_license | #include "Validation.hpp"
#include <iostream>
#include <string>
#include <sstream>
using std::istringstream;
using std::string;
using std::istream;
using std::cout;
using std::cin;
using std::endl;
using std::getline;
/*This defines the getline() function used to check the user
input. If it can pull in... | true |
9db1f3c60ef277eec662224b7bde1e760992cb27 | C++ | Robotonics/nikos | /firmware/PlainFFT.cpp | UTF-8 | 5,465 | 2.90625 | 3 | [
"MIT"
] | permissive | /*
PlainFFT Library
No warranty, no claims, just fun
Didier Longueville invenit et fecit October 2010
Modified by Ted Hayes 2011 to use only Hamming windowing to optimize compiled object size.
*/
#include "PlainFFT.h"
#define twoPi 6.28318531
#define fourPi 12.56637061
PlainFFT::PlainFFT(void) {
// Constructor
}
Pl... | true |
9905b29c20759301b4f5b7367c546e1a765b2c4e | C++ | ivycorinne/Arduino | /debounceWithTimer/debounceWithTimer.ino | UTF-8 | 3,506 | 3.34375 | 3 | [] | no_license |
int i;
/*
timer de-bounce
When the pushbutton is bouncing, Arduino sees a rapid sequence of
on and off signals.
There are many techniques developed to do de-bouncing.
Here, we will attempt to de-bounce using a timer.
Turn on and off a LED connected to a digital pin, without using
the delay() functio... | true |
c7b0b2e3fab0e3dd0b2a55e0e463c608bfe5f24e | C++ | fredollinger/kscope | /kscope-binary-only-works-on-lucid/include/kregexp.h | UTF-8 | 3,957 | 2.75 | 3 | [] | no_license | /* This file is part of the KDE libraries
Copyright (c) 1999 Torben Weis <weis@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed i... | true |
4a8d96827c7e1af1528da19c138d181b88887c46 | C++ | tectronics/cse167chinook | /HeightMap.cpp | UTF-8 | 12,379 | 2.578125 | 3 | [] | no_license | #include "HeightMap.h"
//const float HeightMap::WATERLEVEL = 80.f;
const float HeightMap::WATERLEVEL = 105.f;
const float HeightMap::SANDLEVEL = 110.f;
const float HeightMap::GRASSLEVEL = 160.f;
const float HeightMap::DIRTLEVEL = 220.f;
const float HeightMap::MAXLEVEL = 256.f;
Vector3 HeightMap::dwater(0,0... | true |
6826b2221632f70c8b015caa2094f164efd052ff | C++ | jeremiemartel/Arduino | /docs/ST/Codes arduino/Grove_Buzzer/Grove_Buzzer.ino | UTF-8 | 1,250 | 3.15625 | 3 | [] | no_license | // Objectif :
// - Emettre une alarme en appuyant sur le bouton "USER"
// - Afficher un message sur le LCD
// Attention : le shield Grove doit être positionné sur 5V (pou le LCD)
// Pour gérer le LCD
#include <Wire.h>
#include "rgb_lcd.h"
rgb_lcd lcd;
const int BUZZER_PIN = 6; // broche du buzzer D6
const int c... | true |
6527d08e61ec35f4fc0e1ba376d7fe12c5cb9e78 | C++ | sonuishaq67/cprograms | /basic/j.cpp | UTF-8 | 242 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> a = { 1, 7, 2, 4, 8, 3 };
qsort(a.begin(), a.end());
for (int i; i < a.size(); i++)
std::cout << a[i] << " ";
return 0;
}
| true |
1937a3d7ec97b1d6e1ba7a2cfa5155e7c167fbe7 | C++ | archetype2142/cpp-projects | /do_while_loop_try_1.cpp | UTF-8 | 502 | 3.3125 | 3 | [] | no_license | // do while
#include <iostream>
using namespace std;
int main()
{
int a = 0; // a is zero
do //then do loop executesok comes back here
{
a++; //a becomes 1
cout << "abc" << endl; // this executes this executes
}
while( a < 7); //lets try samaj aaya? haan tabhi abc 3 baar aaya na yes now tell how many time... | true |
ab4c69e6737004e6d4de92226bdf47658c579aef | C++ | junyoung-o/PS-Cpp | /BFS & DFS/1012.cpp | UTF-8 | 1,648 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
#define max_node 51 * 51 + 1
vector<int> graph[max_node];
vector<int> result;
bool is_visit[max_node] = { false, };
bool is_one[max_node] = { false, };
int m, n, k, cnt;
void init();
void set_graph();
void point_one();
void bfs(int node);
int main(void) {
... | true |
63821c007e9f268b049f1043cd137f39b332cdce | C++ | marcinn714/p2p | /applicationLogic/threads/TcpMainService.cpp | UTF-8 | 1,200 | 2.609375 | 3 | [] | no_license | //
// Created by marcin on 16.05.18.
//
#include "TcpMainService.h"
#include "../fileTables/FilesTableReceive.h"
Command * TcpMainService::getCommand(size_t opcode, int socketFd, struct in_addr sendingIp)
{
Command * command = nullptr;
switch(opcode){
case 31: //get file
command = new Rec... | true |
fd672f58f73df1ff9582c0a547098df385fa5727 | C++ | EchelonBoo/A-E | /A_E/A_E.cpp | UTF-8 | 2,334 | 3.625 | 4 | [] | no_license | // A_E.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include "PriorityQueue.h"
#include <iostream>
#include <string>
using namespace std;
struct Patient {
string name;
int priority;
bool operator < (Patient p1)
{
return p1.priority > priority;
}... | true |
1b6e1bd17af8160f36b0157ea184d2741ed0e3df | C++ | laszlopapai/UAVOnboardController | /UAV/Interact/Magnetometer.cpp | UTF-8 | 1,506 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #include "Magnetometer.h"
#include <Filter/MagnetometerFilter.h>
using namespace IoT::UAV;
Magnetometer::Magnetometer(const float outputFrequency)
: StreamNode<Core::Vector3>([this](auto& dataInfo) { this->run(dataInfo); })
, m_logger(Core::ILogger::getDefault())
, m_outputFrequency(outputFrequency)
, m_acquireDe... | true |