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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
d34fe4b54af85f10922846b146b088536d54296b | C++ | tcsantanello/tokengov | /include/token/api/core/database.hh | UTF-8 | 9,127 | 2.609375 | 3 | [
"BSD-2-Clause"
] | permissive |
#ifndef __TOKENIZATION_DATABASE_HH__
#define __TOKENIZATION_DATABASE_HH__
#include "token/api/core/vaultinfo.hh"
#include "token/api/token_entry.hh"
#include <boost/thread/lock_guard.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <dbc++/dbcpp.hh>
#include <memory>
#include <string>
#include <uri/uri.hh>
name... | true |
1c1c57f538faac624da11630df06d622007c98ea | C++ | NSchertler/GeneralizedMotorcycleGraph | /include/FencedRegionRepresentativeCalculator.h | UTF-8 | 5,141 | 3.078125 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include "common.h"
#include "MotorcycleGraph.h"
#include "FencedRegion.h"
#include "MotorcycleOptionsInPatch.h"
//Calculates the representative singular point for a fenced region along with the initial paths.
class FencedRegionRepresentativeCalculator
{
//Run motorcycles from the patch boundary to the ... | true |
c87643fc40295280bf9b4affa34069443cd2db9e | C++ | mridul88/Programs | /self made - all working/TRIP.CPP | UTF-8 | 521 | 3.09375 | 3 | [] | no_license | /* Input : number of persons gone to trip and then their respective expense
Outut: min no. of amount to be transfered, so that the expense will be equal to all
*/
#include<cstdio>
using namespace std;
int main()
{
int n,i;
float avg=0,m=0,s=0,*a;
scanf("%d",&n);
a=new (float [sizeof(n)]);
for(i... | true |
309150d04a10e53a054276d9613276a9aa365074 | C++ | SaiSudheerRedddy/Code_Library | /409 - FibonacciNumber.cpp | UTF-8 | 547 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int res = 0;
int fib_find(int n,int* memo) {
cout<<n<<memo[n]<<endl;
if(memo[n] == -1){
if(n == 0 || n==1){
res = n;
}else{
res = fib_find(n-1,memo) + fib_find(n-2,memo);
}
memo[n] = res;
... | true |
af8aa25faa4a92c389c3dc248cd49a54b6e9ce50 | C++ | meiyindeng/cs162 | /Notes/Bucky/20Sentinel.cpp | UTF-8 | 624 | 3.46875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
//special code -1
//enter the age of all people
//calculate the average age
int age;
//initialize ageTotal starts with 0
int ageTotal = 0;
//initialize count starts with 0
int count = 0;
cout << "Enter first persons age or -1 to quit" << endl;
cin >> age... | true |
8cb6fe85d4ca9c2f59f9a3a4c1300ce05300d020 | C++ | KaravolisL/ARM-ISA-Simulator | /tests/DataStructures/QueueUT.cpp | UTF-8 | 690 | 3.296875 | 3 | [
"MIT"
] | permissive | /////////////////////////////////
/// @file QueueUT.cpp
///
/// @brief Unit Test for Queue
///
/// @author Luke Karavolis
/////////////////////////////////
// SYSTEM INCLUDES
// (None)
// C PROJECT INCLUDES
// (None)
// C++ PROJECT INCLUDES
#include <catch2/catch.hpp>
#include "Queue.hpp" // Test class
TEST_CASE("... | true |
9819cfe9f0b912365637a532d8e887af16f73e69 | C++ | JessicaShi/CS249Project | /CS249MovieRecommendation/modular.cpp | UTF-8 | 5,717 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include "movie.h"
using namespace std;
struct CF_candidate_t
{
int mid;
double score;
int date;
};
struct movie_candidate_t
{
int mid;
float score;
int year;
};
struct output_list_t
{
int mid;
float score;
};
int sqr(int num)
{
return num*num;
}
int min(int a, int b)
{
if (a<b)
retur... | true |
406487c6056ac6049cabb87bc8d48b7e9b7f51a1 | C++ | aqfaridi/Competitve-Programming-Codes | /SPOJ/SPOJ/HACKRNDM.cpp | UTF-8 | 1,520 | 3.40625 | 3 | [
"MIT"
] | permissive | /**
* SPOJ Problem Set (classical)
* 9734. Hacking the random number generator
* Problem code: HACKRNDM
*
* You recently wrote a random number generator code for a web
* application and now you notice that some cracker has cracked it. It
* now gives numbers at a difference of some given value k more
* predomina... | true |
b39dcebf125de1d9fe8062a69391794264567c54 | C++ | Renata300/Exercicio-Git | /C++/main.cpp | UTF-8 | 902 | 3.703125 | 4 | [] | no_license | /* Esse código consiste da implementação de aluguel de carros através da linguagem C++ */
#include <iostream>
#include <string>
using namespace std;
class Carro {
private:
string nome;
public:
Carro(string);
Carro();
~Carro();
void setNome (string);
string getNome();
};
Carro::Carro(string nome)
{
this... | true |
aa3c8f01565b3292fc91690b1baea136abaa0199 | C++ | rotifyld/algorithms-and-data-structures-2018z | /mat/main.cpp | UTF-8 | 912 | 3.28125 | 3 | [] | no_license | #include <iostream>
using namespace std;
const int end_char = '\n';
int main() {
int n = 1; // wczytanych znaków łącznie
int o = 0; // ostatnia wczytana litera
int m = 1000002; // minimalna odległość między dwoma różnymi literami
int c;
for (c = getchar(); c == '*'; c = g... | true |
52f42fbd513505963315be9a1e0273be113555b4 | C++ | alexuglav/Labs | /Lab20/Tree.cpp | UTF-8 | 2,036 | 3.65625 | 4 | [] | no_license | #include "Tree.h"
Tree::Tree()
{
left = NULL;
right = NULL;
parent = NULL;
}
Tree::Tree(int newData)
{
data = newData;
left = NULL;
right = NULL;
parent = NULL;
}
Tree::~Tree()
{
if (this != NULL)
delete this;
}
void Tree::insertRight(int newData)
{
Tree* node = new Tree(newData);
if (this->right != NULL... | true |
99160253da566d829d38d231b0a424452bfea86c | C++ | QuentinCG/Arduino-Ultrasonic-Proximity-Sensor-Library | /examples/ShowDistanceInSerial/ShowDistanceInSerial.ino | UTF-8 | 1,085 | 3.09375 | 3 | [
"MIT"
] | permissive | /*
* \brief Show distance between Ultrasonic proximity sensor and any element every second
*
* \author Quentin Comte-Gaz <quentin@comte-gaz.com>
* \date 27 December 2021
* \license MIT License (contact me if too restrictive)
* \copyright Copyright (c) 2021 Quentin Comte-Gaz
* \version 1.0
*/
#include <Ultrason... | true |
9fe1e148e0508920b386a3838160809f41094bfd | C++ | FredericJacobs/Lattices-Jacobi_Method | /include/tools.h | UTF-8 | 3,893 | 2.515625 | 3 | [
"MIT"
] | permissive | template<typename T>
std::istream& operator>>(const std::string& in, T& v)
{
static std::istringstream* iss = 0;
if (iss) delete iss;
iss = new std::istringstream(in);
*iss>>v;
return *iss;
}
#define PARSE_MAIN_ARGS \
std::ostringstream message; \
message << argv[0]; \
for (int i=0; i<... | true |
d665df3ac28bd9db22eb49b3e3a571dfa211504b | C++ | curiousTauseef/codility-3 | /src/PermMissingElem.cpp | UTF-8 | 449 | 2.890625 | 3 | [] | no_license | // Accessible from https://app.codility.com/programmers/lessons/3-time_complexity/perm_missing_elem/
//
// Task Score: 100%
// Correctness: 100%
// Performance: 100%
// Detected Time Complexity: O(N) or O(N * log(N))
int solution(vector<int> &A) {
unsigned int n = A.size() + 1;
long long int estimated = n * (n... | true |
b0eab1beba3f6393ae6161c202d6617c6260bcc0 | C++ | sarthak0906/cpp-implimentation | /stack implimentation.cpp | UTF-8 | 490 | 3.03125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int top = -1;
bool is-empty(){
if (top == -1) return true;
else return false;
}
void push(int stack[],int a,int n){
if (top == n-1) cout << "stack full overflow condition" << endl ;
else {
top++;
stack[top] = a;
}
}
void pop(){
if (t==-1) return ;
else {
stack[top] ... | true |
cbdbc8d41961a9030dad96047534d6de344b95c3 | C++ | hseyinsade/Veri-Yapilari-Dizi | /src/Test.cpp | UTF-8 | 1,006 | 2.8125 | 3 | [] | no_license | /**
* @date 31.10.2018
* @author hseyinsade
*/
#include "Yonetim.hpp"
int main()
{
ifstream fileread;
fileread.open("Okul.txt", ios::in);
string okunan,sc1,sc2;
Yonetim *yonetim=new Yonetim();
while (!fileread.eof())
{
getline(fileread, okunan);
yonetim->SinifEkle(okunan);
//cout <... | true |
c3d25f7b527770e3083441efed46f546671be0d0 | C++ | samindaa/TopoFramework | /representations/perception/Groundtruth.h | UTF-8 | 3,109 | 3.03125 | 3 | [] | no_license | /**
* @file RobotPose.h
* Contains the Groundtruth representation.
*/
#ifndef GROUNDTRUTH_H
#define GROUNDTRUTH_H
#include "kernel/Template.h"
#include "math/Pose2D.h"
#include "math/Pose3D.h"
#include "math/Vector2.h"
#include "math/Vector3.h"
#include "representations/modeling/OtherRobots.h"
REPRESENTATION(Grou... | true |
7f55c4e277b62fc636beb408d61ec48d8ef11d8f | C++ | jadhavhninad/Competitive_Code_Repos | /328_Odd_Even_Linked_List.cpp | UTF-8 | 1,335 | 3.453125 | 3 | [] | no_license | /*
328_Odd Even Linked List
*/
/**
* 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) {
if(head == NULL || head->next == NULL)
... | true |
5e03553665d8b45ca625b5835e09c7c1213f7019 | C++ | geminy/pro-appfw | /appfw/AppLauncher/AppLauncherLib/include/applauncher/IApp.h | UTF-8 | 989 | 2.640625 | 3 | [] | no_license | /**
* @file IApp.h
* @brief class EIApp
*/
#ifndef EVO_IAPP_H
#define EVO_IAPP_H
#ifndef __cplusplus
# error ERROR: Only for cpp file.
#endif
#include <string>
#include "Global.h"
class EICreator;
/**
* @class EIApp
* @brief Interface for app
*/
class EVO_APICALL EIApp
{
public:
explicit EIApp(std::stri... | true |
bbb693e225bc982986745b0cdd2f789feb9626c7 | C++ | alexwbt/asio-demo | /net_common/src/message_queue.h | UTF-8 | 2,040 | 3.109375 | 3 | [] | no_license | #pragma once
#include <mutex>
#include <queue>
#include <demo.pb.h>
namespace net
{
struct Header
{
uint64_t command = 0;
uint64_t body_size = 0;
};
struct MessageItem
{
Header header;
std::shared_ptr<const google::protobuf::Message> body = nullptr;
};
st... | true |
1e40b910e33fd4db8ef128cbdb20b7c63de5c226 | C++ | ly-tcp-udp-ftp/networklib | /socket-2013/c++/sample/hostToIp.cpp | UTF-8 | 829 | 3.125 | 3 | [] | no_license | /*
* write by tiankonguse
* email:i@tiankonguse.com
* reason:
* socket 编程往往需要使用ip,但是我们往往只有域名,那我们就需要做一个具有由域名得到ip的功能的程序。
* 由于一个域名可能有多个ip,我们返回的时候,就需要返回一个二维数组了,来保存这个ip列表
* 但是,我这里就只返回一个ip,如果ip不存在,则返回 NULL
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "hostToIp.hpp"
int main(int argc, char ... | true |
bfddf0bbbb43a2cb96df7734df35dbe1196e70b6 | C++ | Mikhael777/tiitDeliveryLab1 | /021702/Dvoretskiy/myTree.h | UTF-8 | 567 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string.h>
#include <math.h>
#include <time.h>
#include <fstream>
struct node
{
int max = -1e9, leftPos, rightPos, add = 0;
node *left, *right;
};
class tree
{
private:
int elementsNumber;
public:
static node* build(const std::vector<int>& a, int leftBord... | true |
042f45a65acda13cb55e43dbc4445300bcd0c0e7 | C++ | sieunK/Algorithm | /2133.cpp | UTF-8 | 455 | 2.640625 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define MAX 30
int res[MAX+1];
int fibo[MAX+1];
void preprocess(void)
{
fibo[0] = 1;
fibo[1] = 1;
for(int i=2;i<=MAX;++i)
fibo[i] = fibo[i-1]+fibo[i-2];
res[0] = 3;
res[2] = 3;
for(int i=4,j=1;i<=MAX && j<=MAX;i+=2,j+=2)
res[i] = res[i-2]*res[2]+2*fibo[j];
}
... | true |
d78ab5aff7d26b64b0bd6d25bbacb91888cc998d | C++ | KrotchYB/untitled | /agtgpdot.cpp | UTF-8 | 2,278 | 2.765625 | 3 | [] | no_license | #include "agtgpdot.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <sstream>
#include <vector>
agtGpDot::agtGpDot(std::string name_c, agtTypPoint get_point, agtTypColor get_rgb)
{
this->point = get_point;
this->rgb = get_rgb;
this->name = name_c;
}
void agtGpDot::update(agtT... | true |
b7df0f0d6a9cefdbe59d7f9fa7b1f7fbad1f8939 | C++ | Dess96/Paralela-openmp | /Proyecto/main.cpp | UTF-8 | 3,051 | 3 | 3 | [] | no_license | #include<stdlib.h>
#include<iostream>
#include<string>
#include<omp.h>
#include<thread>
#include<chrono>
#include"Person.h"
#include"Simulator.h"
using namespace std;
using namespace std::chrono;
#define _CRT_SECURE_NO_WARNINGS 1 // para deshabilitar errores por uso de funciones deprecated sobre CRT o con... | true |
c228b339ee8d69e952501f5c50a84a185986ee44 | C++ | mkalte666/Dragon2D_FlushPrototype | /source/Classes/ScriptLibHelper.h | UTF-8 | 3,765 | 2.59375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "base.h"
namespace Dragon2D {
//since chaiscript cant global, and we also need to make shure that global variables are deleted way before chaiscript does it, there is a wrapper
//every class has its own container for global variables, accessed with Global##classname(identifier) (example: Glob... | true |
ecb9ef6c7c5f4735008a084baa8be781f2e47fdf | C++ | kimyujeong/Algorithm | /백준/STL/10866 deque.cpp | UTF-8 | 390 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <pair>
#include <string>
using namespace std;
int main() {
cout << "hello world";
/*
list<pair<int, int>> a;
int n;
cin >> n;
cout << n;
/*
for (int i = 1;i < n+1;i++) {
int j;
cin >> j;
a.push_back({ i,j });
}
auto it = a.begin();
while (n--) {
cout <... | true |
2c395d62f2e4b5a021bccdad594c788c7544e2cd | C++ | jinzhu6/openMVG_Pose_Estimation | /SfM_Aided/SfM/Rt_transform/Rt_transform.cpp | GB18030 | 4,051 | 2.9375 | 3 | [] | no_license | /*
* R,t and Euler angle transform
*
* https://github.com/orocos/orocos_kinematics_dynamics/blob/master/orocos_kdl/src/frames.cpp
*/
#include "Rt_transform.h"
#include <opencv2/stitching/detail/util_inl.hpp>
using namespace std;
using namespace cv;
#define M_PI 3.141592653589793
cv::Mat RPY(double roll,double... | true |
d1cf695ee1c1b2bbfab93c7177f1401003232d1f | C++ | nanenchanga53/BackJoonAlgorithems | /algorithms/algorithms2/2565_전깃줄.cpp | UTF-8 | 500 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;
int n;
int x, y;
int beam[501];
int dp[501];
int ret;
int main()
{
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> x >> y;
beam[x] = y;
}
ret = 0;
for (int i = 1; i <= 500; i++)
{
if (beam[i] == 0) continue;
... | true |
e7334cc52c4593b9c0d4d05e161fd070b13458a9 | C++ | tonychen007/Intel.Assembly | /X64_IntegerArithmetic/src/funcs.cc | UTF-8 | 5,712 | 2.546875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include "../header/MiscDef.h"
using namespace std;
void IntegerAddTest() {
Int64 a = 100;
Int64 b = 200;
Int64 c = -300;
Int64 d = 400;
Int64 e = -500;
Int64 f = 600;
Int64 sum = IntegerAdd(a, b, c, d, e, f);
printf("Result f... | true |
c7920cb706203becd5e04b096c3bd4f38b3beab8 | C++ | ujnomw/golovatskikh_m_e | /test01/gray_black_white.cpp | UTF-8 | 2,266 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <opencv2/opencv.hpp>
#include <vector>
using namespace cv;
using namespace std;
int main() {
int white = 255;
int gray = 127;
int black = 0;
Mat images[6];
int COLS = 256;
int ROWS = 256;
// IMAGE CREATION
Mat result(2*ROWS, 3*COLS, CV_8UC1);
images[0] ... | true |
99270805004760899e2184db43d99ed78f94865b | C++ | HJPyo/C | /boj17408.cpp | UTF-8 | 1,923 | 2.75 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<queue>
#define MAX 100001
#define M ((L+R)>>1)
using namespace std;
int n, m, Bnum;
pair<int,int> tree[MAX<<1];
pair<int,int> update(int L, int R, int Node, int T, int Val)
{
if(T <= L && R <= T){
return tree[Node] = make_pair(Val,0);
}
else if(R < T || T < L){
r... | true |
e78c41c8fdb1652e20e769a9b1b7b83d55240fa8 | C++ | sjhalayka/kinect_opencv | /kinect1.8_opencv.cpp | UTF-8 | 3,777 | 2.6875 | 3 | [] | no_license | #include "kinect1.8_opencv.h"
int main(void)
{
INuiSensor *m_pNuiSensor = NULL;
INuiSensor *pNuiSensor = NULL;
HANDLE m_hNextDepthFrameEvent;
HANDLE m_pDepthStreamHandle;
HRESULT hr;
int iSensorCount = 0;
hr = NuiGetSensorCount(&iSensorCount);
if (FAILED(hr))
{
cout << "NuiGetSensorCount erro... | true |
31211a6dd3cc060f11998affad291675c36751b7 | C++ | marcotmarcot/chess | /rook.cc | UTF-8 | 1,018 | 3 | 3 | [
"MIT"
] | permissive | #include "rook.h"
#include <string>
#include <vector>
#include "board.h"
#include "color.h"
#include "movement.h"
#include "piece.h"
#include "position.h"
std::string Rook::String() const { return GetColor() == kWhite ? "♖" : "♜"; }
std::vector<Position> Rook::GetMoves(const Board& board, Position from) const {
s... | true |
0473fffb3665b0087257cb245e4bd9407ba41bd6 | C++ | eliasm2/problem-solving | /Codeforces/Avito 2018/C.cpp | UTF-8 | 1,032 | 2.765625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[])
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int> degree(n+1, 0);
for (int i = 1; i < n; ++i)
{
int u, v;
cin >> u >> v;
++degree[u];
++degree[v];
}
int high_degree = 0;
i... | true |
3c0950fca4a16225f28fd60761d358af35f58013 | C++ | EchoAbstract/logl | /apps/scaffold-test/src/scaffold-test.cc | UTF-8 | 538 | 2.5625 | 3 | [
"MIT"
] | permissive | #include <memory>
#include <libOlga/App.hh>
#include <libOlga/Color.hh>
class MyApp : public App {
void setup() override { setBackgroundColor(Color(0.0, 1.0, 0.0, 1.0)); }
std::string appName() const override { return "scaffold-test"; }
// void renderFrame (double atTime, int64_t frameNumber) override {
// ... | true |
2a0a7db1020835aa3ebbdb0c771c4fe9093cfbea | C++ | nirgoth/nirgoth | /cpp/cpp04/ex01/Character.hpp | UTF-8 | 623 | 2.8125 | 3 | [] | no_license | #ifndef CHARACTER_HPP
# define CHARACTER_HPP
# include <iostream>
# include <sstream>
# include <ostream>
# include "AWeapon.hpp"
# include "Enemy.hpp"
class Character
{
private:
Character(void);
std::string _name;
int _ap;
AWeapon* _weap;
public:
Character(std::string const & name);
~Character();
C... | true |
f83f4e2fcd00e713621fe777cab0cfd4946bb851 | C++ | HelioStrike/Arjuna-Code | /2018 March 25/prog2.cpp | UTF-8 | 4,175 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
/*
2 Predators and Prey
David King, a budding scientist, has designed a small game of wars with three types of characters Vofnan, Nural and Baf.
These that live in different colonies arranged in the form of a grid.
Each type of character regularly w... | true |
0d79e227c98233133e358b513594ff4c66440261 | C++ | Remit/misdcompiler | /AST/LogicalExpression.cpp | UTF-8 | 6,663 | 2.828125 | 3 | [] | no_license | #include "../include/LogicalExpression.h"
LogicalExpression::LogicalExpression()
{
op = OP_LOGICAL_UNDEFINED;
BinExpr_LHS = NULL;
BinExpr_RHS = NULL;
lbl = AST_LOGICALEXPRESSION;
exp_bool_vars_list = NULL;
}
LogicalExpression::LogicalExpression(cond_op_types a_op, Base_AST* LHS_AST, Base_AST* RHS_AST, std::vecto... | true |
a648b86a4b09289c5f4c9cd467aea5f9468ada20 | C++ | Aslem1/univ | /Objets connectes-programmation microcontroleur/TP/TP1/ex3-2/ex3-2.ino | UTF-8 | 759 | 2.984375 | 3 | [] | no_license | #define X 14
#define LOW 0
#define HIGH 1
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(X, INPUT_PULLUP);
}
void loop() {
int value = digitalRead(X);
int etat = digitalRead(LED_BUILTIN);
if (value == LOW) {
unsigned long tempsDebut = millis(); // Temps au moment ou on appuie sur le b... | true |
e1482e89d1456eb359c64a5faabed2c54e90234b | C++ | X-DataInitiative/tick | /lib/cpp/hawkes/model/model_hawkes_sumexpkern_loglik_single.cpp | UTF-8 | 2,753 | 2.515625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // License: BSD 3 clause
#include "tick/hawkes/model/model_hawkes_sumexpkern_loglik_single.h"
ModelHawkesSumExpKernLogLikSingle::ModelHawkesSumExpKernLogLikSingle()
: ModelHawkesLogLikSingle(), decays(0) {}
ModelHawkesSumExpKernLogLikSingle::ModelHawkesSumExpKernLogLikSingle(
const ArrayDouble &decays, const... | true |
644ae262243dffca52e3b1d0d63ec7866aea650c | C++ | commondude/edu | /fiit_graphs_algo/6 Battle of Dul-Guldur/Dul_guldur_alter.cpp | UTF-8 | 3,446 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
#include <utility>
using namespace std;
ofstream out("output.txt");
int make_graph(string filename, vector<vector<int>> &wizards, vector<vector<pair<int,int>>> &graph);
void print_graph(vector<vector<int>> &wizards, vector<vec... | true |
37c904abcbe12fe47b469e302c29db37fe1bbcc2 | C++ | gsm1011/cppweka | /core/pmml/Function.cpp | UTF-8 | 9,381 | 2.515625 | 3 | [] | no_license | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that... | true |
113e9fa1cc212b7f28549c3babb7c1195b1a7135 | C++ | Jeonghwan-Yoo/BOJ | /ExponentiationBySquaring/1629.cpp | UTF-8 | 415 | 3.140625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int ModPow(long long a, int n, int p)
{
if (n == 0)
return 1;
if (n & 1)
return a * ModPow(a, n - 1, p) % p;
return ModPow(a * a % p, n >> 1, p);
}
int main()
{
freopen("in.txt", "r", stdin);
ios::sync_with_stdio(false);
cin.tie(nu... | true |
c9e2471437c499a0608fae991ae17e4cb05e9f14 | C++ | 95301505/cpp-template-yjwen | /ex09/ex09_04.hpp | UTF-8 | 760 | 2.921875 | 3 | [] | no_license | #include <functional>
#include <algorithm>
template<typename Iterator0, typename Iterator1>
bool all_are_multiples(Iterator0 begin0, Iterator0 end0, Iterator1 begin1)
{
using namespace std;
// 首先利用iterator_traits得到迭代器所指数据类型
typedef iterator_traits<Iterator0> traits;
typedef typename traits::value_type ... | true |
e1c9ad09fc43165e738d7af0df78abcebbcfb3a7 | C++ | uditangshu2000dey/Assignments | /C++/Password_Generator.cpp | UTF-8 | 4,657 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <ctime>
std::string versionNumber = "1.1.0";
char special[] = { '!', '@', '#', '$', '%', '^', '&', '*' };
char capital[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
char ... | true |
2e6fdaa964397ba23effc50962cc22ec3638a94f | C++ | 0I00II000I00I0I0/C_Base | /DemoUnion/DemoUnion.cpp | UTF-8 | 1,914 | 3.171875 | 3 | [] | no_license | /*
1、共用体中有结构体
2、结构体中有共用体
*/
#include <iostream>
typedef struct _DATE
{
int year;
int month;
int day;
}DATE, * PDATE;
typedef union STUDENT
{
int nID;
char szName[16];
DATE AdmissionTime;
}STUDENT, * PSTUDENT;
typedef struct _INFORMATION
{
STUDENT unionStu;
char* szDate;
}INFORMATION, * PINFORMATION;
// 判断... | true |
801f4cf9df2bc48f4ebae98a622030e8418ecf96 | C++ | EOSIO/eosio-swift | /Sources/Abieos/eosio/check.hpp | UTF-8 | 3,953 | 2.9375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"JSON",
"BSD-3-Clause",
"BSL-1.0"
] | permissive | /**
* @file
* @copyright defined in eos/LICENSE
*/
#pragma once
#ifdef __eosio_cdt__
#include <cstdint>
namespace eosio {
namespace internal_use_do_not_use {
extern "C" {
__attribute__((eosio_wasm_import, noreturn))
void eosio_assert_message(uint32_t, const char*, uint32_t);
__attribute__((eosio_wasm_import, nore... | true |
3f96ea158fce4d1e23152cfdecf6599ffa3b4420 | C++ | Alfan11/Lapas | /TUBES FIX/lapasd.cpp | UTF-8 | 2,177 | 3.03125 | 3 | [] | no_license | #include "lapasd.h"
bool isEmpty(List L) {
return (first(L) == NULL);
}
void createList(List &L){
first(L) = NULL;
last(L) = NULL;
}
adrC alokasi(infotypeC x){
adrC P;
P = new elemenC;
infoC(P) = x;
next(P) = NULL;
return P;
}
void insertFirstC(List &L, adrC &P){
... | true |
d6dd02cd4d8f3de51c038dda07aa362ea5e19a77 | C++ | Tsuguri/TerrainGenerator | /TurboEngine/ShaderProgram.cpp | UTF-8 | 377 | 2.515625 | 3 | [] | no_license | #include "ShaderProgram.h"
#include "ShaderUtility.h"
ShaderProgram::ShaderProgram()
{
programId = 0;
}
ShaderProgram::ShaderProgram(char * vertexPath, char * fragmentPath)
{
programId = ShaderUtility::LoadShader(vertexPath, fragmentPath);
}
void ShaderProgram::SetAsActive()
{
glUseProgram(programId);
}
ShaderPr... | true |
c25f02155a9af5bdb01d58225f382e2ec0848e4d | C++ | tomaszhof/interval_arithmetic | /GPENakaoFDM/src/ExampleGPE08.h | UTF-8 | 13,820 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Example09.h
*
* Created on: 30-05-2020
* Author: thof
*/
#ifndef EXAMPLEGPE08_H_
#define EXAMPLEGPE08_H_
#include "Utils.h"
//#include "Interval.h"
#include "BoundaryConditions.h"
using namespace interval_arithmetic;
namespace interval_arithmetic {
template<typename T>
class ExampleGPE08: public Bo... | true |
9530f2123cee9f3883a0120c4885cffa163cc866 | C++ | ordinary-developer/education | /cpp/std-11/a_williams-cpp_concurrency_in_action/code/ch_02-basic_thread_management/03-launching_a_thread_3/main.cpp | UTF-8 | 561 | 3.46875 | 3 | [
"MIT"
] | permissive | #include <thread>
#include <iostream>
class background_task {
public:
void operator() () const {
do_something();
do_something_else();
}
private:
void do_something() const {
std::cout << "do_something\n";
}
void do_something_else() con... | true |
ab51ec01b97617dfa46925ee29cecff792868990 | C++ | kobe24o/LeetCode | /algorithm/leetcode1228.cpp | UTF-8 | 350 | 2.984375 | 3 | [] | no_license | class Solution {
public:
int missingNumber(vector<int>& arr) {
int maxgap = INT_MIN, gap, l, r;
for(int i = 0; i < arr.size()-1; ++i)
{
gap = arr[i+1]-arr[i];
if(abs(gap) > maxgap)
{
maxgap = abs(gap);
l = i, r = i+1;
}
}
return gap <= 0 ? arr[l]-maxgap... | true |
48a821352701eb81d63f3ab0d8b5a5e0e677a763 | C++ | lele121314/my_purplebook | /上机练习/清华机试/九度oj/2003_3.cpp | UTF-8 | 597 | 2.609375 | 3 | [] | no_license | #include<cstdio>
#include<set>
#include<iostream>
using namespace std;
set<int> p;
int a[15];
int total=0;
void solve(int x){
p.insert(total);
if(x>=15) return ;
total+=a[x];
solve(x+1);
total-=a[x];
solve(x+1);
}
int main(){
a[0]=8;
a[1]=8;
a[2]=8;
a[3]=8;
a[4]=8;
a[5]=1... | true |
0f59f5f98145a7101db01c1ee7ab9122c4121d73 | C++ | Rafael2208/exerciciosc | /calcularMedia.cpp | UTF-8 | 408 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main(){
float n1,n2,n3,media;
printf("Digite a nota 1: ");
scanf("%f",&n1);
printf("Digite a nota 2: ");
scanf("%f",&n2);
printf("Digite a nota 3: ");
scanf("%f",&n3);
media= (n1+n2)/2, (n1+n3)/2,(n2+n3)/2;
printf("A media e %f",media);
printf("\... | true |
b6dfc6e6627a0d26a8e80b57b134aaca1cf932c4 | C++ | saifulkhan/dphil_project_search_index | /Search-Interface-Qt/GUI/_old_code/Mapping/SizeMapping.h | UTF-8 | 1,176 | 2.875 | 3 | [] | no_license | #ifndef SIZEMAP_H
#define SIZEMAP_H
#include <QtCore>
#include <QVector>
#include <QGraphicsItem>
#include <QPainter>
#include <QPen>
#include <QWidget>
template <typename Type>
qreal linear(Type u, Type v, qreal alpha)
{
return static_cast<qreal> ( u * (1.0 - alpha) + v * alpha);
}
struct Bound
{
qreal val... | true |
782f8934b0339b2e7444681b2d11de55fd3b9297 | C++ | DBHeise/fileid | /test/common_test.hpp | UTF-8 | 15,892 | 2.6875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "doctest.h"
#include "testhelp.hpp"
#include "../fileid/common.hpp"
TEST_SUITE("common") {
TEST_CASE("checkMagic") {
SUBCASE("basic") {
unsigned char actual[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
unsigned char exp_a[] = { 0x01, 0x02, 0x03, 0x04 };
unsigned char exp... | true |
955406a18068cc2fb4a7a11b662a0eb0ee2d8408 | C++ | LangLiGeLangLLT/CppPrimer | /Test_19_03/Test_19_03.cpp | UTF-8 | 869 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
class A
{
public:
A() { cout << "A()" << endl; }
virtual ~A() { cout << "~A()" << endl; }
};
class B :public A
{
public:
B() { cout << "B()" << endl; }
virtual ~B() { cout << "~B()" << endl; }
};
class C :public B
{
public:
C() { cout << "C()" << endl; }
virtual ~C() {... | true |
885fac41b7fd5c490dd3c4606b8658abc7042dd8 | C++ | ConstantineStehoff/simple_library | /history.h | UTF-8 | 1,230 | 2.65625 | 3 | [] | no_license | //
// history.h
// lab4
//
// Created by Konstantin Stekhov on 3/3/14.
// Copyright (c) 2014 Konstantin Stekhov. All rights reserved.
//
#ifndef __lab4__history__
#define __lab4__history__
#include <iostream>
#include "transaction.h"
using namespace std;
class Factory;
class Client;
//--------------------------... | true |
92f8c8105c902551d75219f38e580efffd4ef0cc | C++ | acdemiralp/acd | /include/acd/partitioner.hpp | UTF-8 | 3,584 | 3.296875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <algorithm>
#include <array>
#include <cstddef>
#include <functional>
#include "indexing.hpp"
#include "prime_factorization.hpp"
namespace acd
{
// Partitions an N-dimensional domain of domain_size to a hyperrectangular grid of grid_size,
// which consists of blocks of block_size based on the ... | true |
9e78eb2864e2ebacf7c002960b5a6668935f1bac | C++ | dycforever/program | /cpp_prog/stl/inserter.cpp | UTF-8 | 1,589 | 3.8125 | 4 | [] | no_license | #include <iterator>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
template <typename T>
void PRINT_ELEMENTS(T coll){
copy(coll.begin(), coll.end(), ostream_iterator<typename T::value_type>(cout, " "));
cout << endl;
}
int main()
{
list<... | true |
7d4ffd0e7609d9cb31692f1ec98b43cb60c5d2c8 | C++ | stevenng308/OS-3243-Project-6 | /partOneTest.cpp | UTF-8 | 47,064 | 2.78125 | 3 | [] | no_license | // CS3243 Operating Systems
// Fall 2013
// Project 6: Disks and File Systems
// Jestin Keaton and Steven Ng
// Date: 12/2/2013
// File: partone.cpp
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <math.h>
#include <stdio.h>
#include <vector>
#define BYTECOUNT 1474560
#define BEGIN_BYTE_ENTRY 16896... | true |
64c7b95474f64852c01db5efa51ad3b7a3fded2a | C++ | nkh361/interview_prep | /comp_programming/chapter1notes.cpp | UTF-8 | 1,238 | 3.46875 | 3 | [] | no_license | #include <bits/stdc++.h>
// g++ -std=c++11 -O2 -Wall chapter1notes.cpp -o chap1
/* Another way of shortening code is to use macros, a macro means that certain strings in the code
* will be changed before the compilation.
*/
#define F first
#define S second
#define PB push_back
#define MP make_pair
// macros can al... | true |
58f97f762248b587b116fa95ba6433668b9e38af | C++ | wallenben/CSI | /Lab02p2/Lab02p2/Rectangle.cpp | UTF-8 | 1,235 | 4.15625 | 4 | [] | no_license | /**
* @file Rectangle.cpp
*
* @brief Computes the area and perimter of a rectangle.
*
* This computes the area and perimeter of a rectangle given
* the rectangle's length and width.
*
* @author turners
* @date 2016-09-12
*
*/
#include <string>
#include <iostream>
using namespace std;
/**
* @brief Computes the area and ... | true |
b2275dd4bcce09de512f8d60fdee9ee9cbb47f98 | C++ | Hide-on-bush2/leetcode | /leetcode524.cpp | UTF-8 | 919 | 3.234375 | 3 | [] | no_license | #include<algorithm>
#include<string>
#include<vector>
using namespace std;
class Solution {
public:
struct cmp{
bool operator()(string& a, string& b){
if(a.size() != b.size()){return a.size() > b.size();}
else{return a < b;}
}
}myCmp;
bool isSubstr(string& d, string... | true |
bdf526901a2cacce3abc889ac18b9f3bbe11a346 | C++ | SaulBerrenson/FaceDetectorFolder | /src/FaceDetector.cpp | UTF-8 | 1,010 | 2.609375 | 3 | [] | no_license | #include "FaceDetector.h"
#include <qdir.h>
#include <QFile>
SharedPtr<FaceDetector> FaceDetector::create()
{
return SharedPtr<FaceDetector>(new FaceDetector());
}
FaceDetector::FaceDetector()
{
auto path = QDir::cleanPath(QDir::currentPath() + QDir::separator() + QString::fromStdString(m_model_name));
if (!QFil... | true |
0a9fc9ad4dae8dfd05521f9d2f0d9ce90562a69a | C++ | GregorySam/Software_Algorithms_3 | /CryptoCurrencyRecommendation/Tweet/Tweet.cpp | UTF-8 | 430 | 2.671875 | 3 | [] | no_license | //
// Created by greg on 23/12/2018.
//
#include "Tweet.h"
Tweet::Tweet(const vector<double>& vd, unsigned int id):id(id),t_v(vd)
{}
void Tweet::AddCC(unsigned int cc_id)
{
cc_ref.insert(cc_id);
}
void Tweet::SetScore(double newscore)
{
Score=newscore;
}
double Tweet::GetScore()
{
return Score;
}
se... | true |
6b2e1ef39abda76b32742be0cb4fcdfdc8aafded | C++ | hongliuliao/ehttp | /test/http_multi_thread_demo.cpp | UTF-8 | 2,004 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /*
* http_server_test.cpp
*
* Created on: Oct 26, 2014
* Author: liao
*/
#include <sstream>
#include <cstdlib>
#include <unistd.h>
#include "gtest/gtest.h"
#include "simple_log.h"
#include "http_server.h"
#include "threadpool.h"
pthread_key_t g_tp_key;
void test_start_fn() {
pthread_t t = pthread_sel... | true |
649268eb2730bdb7575baf52552dfc301a8140e6 | C++ | ashar-sarwar/Object-oriented-programming-uni-work | /paycut/paycut/secretrary.h | UTF-8 | 193 | 2.578125 | 3 | [] | no_license | class secretary:public employee
{
public:
void paycut(float amt)
{
cout<<"is angry\n";
salary -=amt;
}
secretary(float s,string n):employee(n,s)
{
}
}; | true |
863fbf78ccd492f44cf28f7fe627f8fdafd8846d | C++ | Fakizer/RayTracing | /sources/Camera.cpp | UTF-8 | 556 | 2.765625 | 3 | [] | no_license | #include "Camera.hpp"
Camera::Camera() {}
Camera::Camera(Vect o, Vect la) : origin(o), look_at(la) {
this->cw = origin.add(look_at.negative()).normalize();
this->cu = cw.negative().crossProduct(Vect(0, 0, 1)).normalize();
this->cv = cw.negative().crossProduct(cu);
}
void Camera::calcRay(double xam... | true |
0a9c8881ba8b18784ff974cbd4275a3c7ed8299c | C++ | HunterOnToss/learn_cplusplus_class | /teacher.h | UTF-8 | 708 | 2.796875 | 3 | [] | no_license | //
// Created by hunter on 03.03.16.
//
#ifndef TESTCLAS_TEACHER_H
#define TESTCLAS_TEACHER_H
#include "human.h"
#include <string>
class teacher : public human {
public:
teacher(string last_name,
string name,
string second_name,
// Количество учебных часов ... | true |
8b16bd450cef385074146068acfaff7b8fb429d1 | C++ | broflowsky/sturdy-barnacle | /src/main.cpp | UTF-8 | 3,774 | 2.921875 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: Mar 7, 2018
* Author: vpuyf
*/
#include "GraphException.h"
#include <iostream>
#include <list>
#include <exception>
#include "GraphDirected.h"
using namespace std;
int main(){
try{
GraphDirected graph1;
GraphDirected graph2;
GraphDirected graph3;
GraphDirected g... | true |
424b33f1df91518b4bc1cf9652fd0d90d169fd0d | C++ | chanadech/warehouse | /depositproduct.cpp | UTF-8 | 1,787 | 2.671875 | 3 | [] | no_license | #include "depositproduct.h"
#include "ui_depositproduct.h"
#include "menu.h"
#include "depositproductnext1.h"
#include "typeinfo.h"
#include "depositproductnext2.h"
#include "depositproductnext3.h"
#include "login.h"
#include <qdebug.h>
DepositProduct::DepositProduct(QWidget *parent,QString username) :
QDialog(pare... | true |
f39db962e18ff9c388d03c24bec076fd03c173e3 | C++ | ranebrown/Brown_S_CSCI2270_FinalProject | /main.cpp | UTF-8 | 1,829 | 3.265625 | 3 | [] | no_license | /* Project: cppWebSearch
* File: main.cpp
*
* Created by Rane Brown 4/19/2015
*
*/
#include "cppWebSearch.h"
int main(/*int argc, char *argv[]*/) {
WebSearch *newSearch = new WebSearch;
std::string url, sDepth, searchWord;
int selection, depth;
bool quit = false;
// display menu and get user input
while(!q... | true |
eb6f2a16d8619ad07fd55803bc1133191c188053 | C++ | regelo/booleen | /booleen.cpp | UTF-8 | 190 | 2.8125 | 3 | [] | no_license | #include "booleen.hpp"
Booleen::Booleen(int valeur) {
if (valeur == 0) this->contenu = false;
else this->contenu = true;
}
bool Booleen::getContenu() {
return this->contenu;
} | true |
ad744c120d5a29408183aeaa248e9b4eb9b9694e | C++ | Fahien/cardspot | /src/main.cc | UTF-8 | 2,646 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <cstdlib>
#include <fmt/format.h>
#include <spot/gfx/graphics.h>
#include "spot/card/card.h"
#include "spot/core/log.h"
namespace spot
{
const math::Vec2 card_size = { 2.5f, 3.5f };
const math::Vec2 card_offset = { -card_size.x / 2.0f, -card_size.y / 2.0f };
const math::Vec2 card_b = { card_size.x / 2.0f, c... | true |
4a26bcedc2d9a3299627c9201871a0dfb7141f6d | C++ | moyamos/nrr_icp | /geometry2D.h | UTF-8 | 2,436 | 3.0625 | 3 | [] | no_license | #ifndef GEOMETRY_2D_H_
#define GEOMETRY_2D_H_
#include <vector>
//
// Basic Structures
//
struct Point {
double x;
double y;
};
struct Pose {
Point p;
double phi;
};
struct Line {
Point first;
Point second;
};
//
// Utility functions
//
typedef struct _TrICP_Pack{
Point a;
Point b;
double di2;
}nrr_TrIC... | true |
cedb07ebee673a0874fa18145b2c1c6f9ae186f0 | C++ | yzheng51/image-processing | /src/mosaic.cpp | UTF-8 | 7,550 | 2.90625 | 3 | [] | no_license | /**
* @file mosaic.c
* @yzheng
* @mosaic
* @version 0.1
* @date 2019-03-08
*
* @copyright Copyright (c) 2019, yzheng
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libppm.h"
#include "filter.h"
#include "cuda_filter.h"
#define FAILURE 0
#define SUCCESS !FAILURE
void print_help();
... | true |
865439f69288b50ed77acb427b1979c6b22b0cb8 | C++ | rodea0952/competitive-programming | /AtCoder/ABC/049/D.cpp | UTF-8 | 1,304 | 2.859375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int MOD=1e9+7;
ll INF=1e18;
int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
class UnionFind{
private:
//親と木の深さ
int par[200010];
int rank[200010];
public:
void init(int n);
int find(int x);
void ... | true |
bcbeeddb8d45cc2fc21156720e0bc62f07be6a91 | C++ | syoutetu/ColladaViewer_VC8 | /AccessorElement.cpp | SHIFT_JIS | 1,799 | 2.71875 | 3 | [] | no_license | #include "stdafx.h"
#include "AccessorElement.h"
AccessorElement::AccessorElement()
{
attrCount = (unsigned int)-1; //
attrOffset = 0; // ftHg
attrStride = 1; // ftHg
}
AccessorElement::~AccessorElement()
{
ClearVector( vecElemParam );
}
void AccessorElement::ReadNode(const DOMNode* node)
{
_ASSERTE(n... | true |
117af06c8becb1463afe78ac80f8d623cedb21c7 | C++ | ltjax/click_to_repair | /externals/onut/src/RTS.cpp | UTF-8 | 24,054 | 2.515625 | 3 | [
"MIT"
] | permissive | // Onut
#include <onut/Dispatcher.h>
#include <onut/RTS.h>
#include <onut/Strings.h>
// STL
#include <algorithm>
#include <thread>
namespace onut
{
static const char signature[4] = {'O', 'R', 'T', '1'};
void Object::retain()
{
++m_refCount;
}
void Object::release()
{
--m_refC... | true |
97ee05f3ba8fc8571219ec3f48d9472703aca93f | C++ | bolongz/Clustering-Algorithms | /llord/llord.cpp | UTF-8 | 5,333 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<stdio.h>
#include<vector>
#include<map>
#include<cassert>
#include<cmath>
#include<algorithm>
#include<set>
#include<time.h>
#include<map>
#include<chrono>
#include<string>
#include <cstddef>
#include<ctime>
using namespace std;
const int MAX_N = 1 << 30;
int N, K;
i... | true |
252ca7f06c1024ac4daa23020d50ae847ff79a74 | C++ | RedRangers/Vector | /vector.h | UTF-8 | 8,496 | 3.4375 | 3 | [] | no_license | #ifndef VECTOR_H
#define VECTOR_H
#include"cap.h"
#include"new.h"
#include"iterator.h"
template < typename T >
class Vector
{
public:
//!
//! \brief Value_type type of elements stored in the Vector
//!
using Value_type = T;
using iterator = T*;
//!
//! \brief Vector co... | true |
885ba44d0da81bb915c932063820415bf8a17427 | C++ | corbinat/NativeBlocks | /NativeBlocks/2dEngine/cEventTranslator.cpp | UTF-8 | 5,317 | 2.625 | 3 | [] | no_license | #include "cEventTranslator.h"
#include <iostream>
static const std::string g_kKeyCategoryString = "Key";
static const std::string g_kMouseCategoryString = "Mouse";
static const std::string g_kJoystickCategoryString = "Joystick";
cEventTranslator::cEventTranslator()
: m_Bindings()
{
}
cEventTranslator::~cEventTr... | true |
0b362c946a522e4f2fb32b41c8714dbb96821ce7 | C++ | BeepBoopBop/BeepHive | /Plugin/src/LightSensor.cpp | UTF-8 | 965 | 2.5625 | 3 | [] | no_license | //class to sense the variable of specific cells of the light layer
#include <boost/property_tree/ptree.hpp>
#include "Beep.h"
#include "BeepHive.h"
#include "Layer.h"
#include "LightSensor.h"
#include "Sensor.h"
using boost::property_tree::ptree;
//create the sensor with a layer as well as an xyz location
LightSens... | true |
7f604958069e601d0dfaa01cd061d97656399be7 | C++ | MichalKacprzak99/WFiIS-IMN-2020 | /lab08/main.cpp | UTF-8 | 8,160 | 2.671875 | 3 | [] | no_license | #include <array>
#include <cmath>
#include <cstring>
#include <iostream>
#include <utility>
// stałe
const int nx = 400;
const int ny = 90;
const int i1 = 200;
const int i2 = 210;
const int my_j1 = 50;
const double delta = 0.01;
const double sigma = 10 * delta;
const double xA = 0.45;
const double yA = 0.45;
// oblic... | true |
a8f5cb509d5e3646f33df5cd5eadc28a4f97a943 | C++ | ankushgarg1998/Competitive_Coding | /contests/codeforces-contests/Practise/Greedy/Ilya and Queries.cpp | UTF-8 | 490 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int main()
{
string s;
cin>>s;
vector<int> v(s.size(), 0);
for(int i=1; i<s.size(); i++)
{
if(s[i-1] == s[i])
{
v[i] = v[i-1]+1;
}
else
v[i] = v[i-1];
// cout<<v[... | true |
447c1a61671a4a1300a9066a112cb0428e1f2637 | C++ | xifoxy/OnlineJudge | /Study/03주차/1946(신입 사원).cpp | UTF-8 | 1,364 | 3.09375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 1;
struct info{
int a,b;
};
int n, t;
info d[M];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> t;
while(t--){
cin >> n;
for(int i = 0; i < n; ++i)
cin >> ... | true |
0faebdbf22c08aa9b42dc3c295b6f3a0f18ea221 | C++ | minumn/IKN | /Ovelse_12/Exercise_8_c++/Exercise_8_c++/LIB/lib.cpp | UTF-8 | 2,064 | 2.9375 | 3 | [] | no_license |
/*
* lib.c
*
* Created on: Sep 8, 2012
* Author: Lars Mortensen
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/stat.h>
#include <lib.h>
/**
* Udskr... | true |
a0791be7dafd5b0497c17c9840b2494fc8af041f | C++ | Shushpancheak/salesman-problem-solver | /src/Graph/ListGraph.cpp | UTF-8 | 918 | 3.21875 | 3 | [] | no_license | #include "ListGraph.hpp"
#include <algorithm>
ListGraph::ListGraph(const size_t vertices_count)
: list_(vertices_count) {}
ListGraph::ListGraph(const std::shared_ptr<Graph>& graph)
: list_(graph->GetVerticesCount()) {
const size_t vertices_count = list_.size();
for (size_t i = 0; i < vertices_count; ++i) {
... | true |
3604d9e3c1d488254f5261e2cb89650952dfec14 | C++ | wenmingxing1/thread | /Cpp_concurrency_in_Action/list2_1.cpp | GB18030 | 357 | 3.125 | 3 | [
"MIT"
] | permissive | #include<thread>
#include<iostream>
#include<string>
using namespace std;
void print(string str) {
cout << str << endl;
}
int main() {
cout << this_thread::get_id() << endl; //ͨthis_threadõǰ̱߳ʶ
thread th1(print, "id");
cout << th1.get_id() << endl; //ͨget_idʶ߳
th1.join();
return 0;
}
| true |
09ee072ae330acf58e7a7d4bb2daba5c3a130609 | C++ | remicalsoft/RyujinrokuMobile | /RyujinrokuMobile/RyujinrokuMobile.NativeActivity/src/BossMover.cpp | UTF-8 | 548 | 2.890625 | 3 | [] | no_license | #include "BossMover.h"
#include "Define.h"
BossMover::BossMover(Boss* boss, float x, float y, int time)
{
_boss = boss;
_preX = boss->getX();
_preY = boss->getY();
_movedX = x;
_movedY = y;
_time = time;
_counter = 0;
}
BossMover::~BossMover()
{
}
bool BossMover::update()
{
if (_counter<=_time) {
int xlen ... | true |
e866e4c5b05239639dded934d2bd5630c912def8 | C++ | degarashi/revenant | /src/lua/lctable.hpp | UTF-8 | 1,204 | 2.65625 | 3 | [
"MIT",
"BSD-3-Clause",
"Zlib",
"BSL-1.0"
] | permissive | #pragma once
#include "lcvalue.hpp"
#include <unordered_map>
namespace rev {
class LCTable : public std::unordered_map<LCValue, LCValue> {
public:
using base = std::unordered_map<LCValue, LCValue>;
using base::base;
// 文字列(const char*)とstd::stringの同一視
// テーブルはポインタではなく中身を全て比較
bool preciseCompare(cons... | true |
50808909fb8f955a199988eef3bae8b3857217cd | C++ | yaroslavmamrokha/Cities | /Cities/Final/gamelogic.h | UTF-8 | 602 | 2.515625 | 3 | [] | no_license | /*Header file that includes class with functions used to create game logic*/
#ifndef GAMELOGIC_H
#define GAMELOGIC_H
#include"SameLib.h"
class Gamelogic {
private:
char globallist[255];
char usedlist[255];
char buffer[255];
int turn = -3;
public:
void ClearLogic();
int Check_for_end(const char* wrd... | true |
1f433e8345de6acb817ab8730746a839fd44af64 | C++ | adrienthebo/libf | /include/listexception.h | UTF-8 | 690 | 3.1875 | 3 | [] | no_license | /* listexception.h
*
* Exceptions for linkedlist.h
*/
#ifndef _LISTEXCEPTION_H_
#define _LISTEXCEPTION_H_
#include <iostream>
class list_index_out_of_bounds {
private:
int m_invalid_index;
public:
list_index_out_of_bounds( int invalid_index ) {
m_invalid_index = invalid_index;
}
void message() {... | true |
a3e347559e046c7f28ba6b74dd4f8423c80e7225 | C++ | prayasjain/graphics-algorithms | /3Dtransform.cpp | UTF-8 | 3,975 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include<math.h>
#include<GL/glut.h>
using namespace std;
typedef float Matrix[4][4];
float matrix[4][8]={{80,180,180,80,60,160,160,60},{80,80,180,180,60,60,160,160},{-100,-100,-100,-100,0,0,0,0},{1,1,1,1,1,1,1,1}};
void setIdentity(Matrix m){
for(int i=0;i<4;i++){
for(int j=0;j<4;j++)... | true |
2b9019bb8e61f0df32be435efa219556120309e8 | C++ | BinWangGBLW/leetcode | /leetcode/apple/1-Two-Sum.cpp | UTF-8 | 745 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector <int> res(2);
unordered_map <int, int> m;
for (int i = 0; i < (int)nums.size(); ++i) {
if (!m.count(target - n... | true |
c3f7f48a49c2587eee00fd6c06b0c6e5a0c489a4 | C++ | nabil-k/Mondlitch | /platform.h | UTF-8 | 2,334 | 3.03125 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include "TextureManager.h"
class Platform {
int width, height;
float x, y;
sf::Texture texture;
sf::String type;
public:
float maxKeyframeTime = 0.25;
float frame = 0;
float timeSinceLastKeyframe = 0;
sf::Clock animateTime;
sf::Sprite sprite;
int getWidth()... | true |
5189569d8fcf71607842918b7b3827eb1ccdd64d | C++ | d2macster/leetcode-cpp | /src/E/2/E278_FirstBadVersion.cpp | UTF-8 | 521 | 3.25 | 3 | [] | no_license | //
// Created by Andrii Cherniak on 2/9/18.
//
// Forward declaration of isBadVersion API.
bool isBadVersion(int version) {
return (version >= 2);
}
class Solution {
public:
int firstBadVersion(int n) {
int lo = 1, hi = n, mid;
while (lo < hi) {
mid = (hi - lo) / 2 + lo;
... | true |
b23bb4c066e5168cda55ed1d8d19a5ff991514ed | C++ | vtmp/teletest | /misc/manageStrings.cpp | UTF-8 | 690 | 3.40625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char string[] = "RUN add 0.7 0.1"; //example of INSTRUCTION
char space[2] = " "; //delimiter that will separate the words in the STRING
char *word;
int i;
typedef char String[11]; //ten will be the m... | true |