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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
dd16c996f516df632e96f8726a79044b9f784b37 | C++ | ia-toki/tcframe | /test/integration/resources/runner/evaluator/scorer/custom/scorer.cpp | UTF-8 | 701 | 3.09375 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
/*
* AC if contestant's second line is a permutation of judge's.
* */
int N;
vector<int> read(ifstream& out) {
string answer;
out >> answer;
vector<int> numbers(N);
for (int i = 0; i < N; i++) {
out >> numbers[i];
}
sort(numbers.begin()... | true |
0f247e5c4bbd0436bdf7c6e3f42a56feb45b1848 | C++ | kosehy/42_cpp-piscine | /d02/ex02/Fixed.class.cpp | UTF-8 | 2,565 | 3.390625 | 3 | [] | no_license | #include "Fixed.class.hpp"
int Fixed::_bit = 8;
Fixed::Fixed(void) : _fp(0)
{
std::cout << "Default constructor called" << std::endl;
}
Fixed::Fixed(const int fp) : _fp(fp << _bit)
{
std::cout << "Int constructor called" << std::endl;
}
Fixed::Fixed(const float fp) : _fp(fp * ( 1 << _bit))
{
std::cout << "Float ... | true |
27c1b25fecbe9fa22292f27b82ea070b0b76a6e1 | C++ | dppereyra/darkreign2 | /source/3rdparty/won/msg/TMessage.cpp | UTF-8 | 17,265 | 2.625 | 3 | [] | no_license |
#include "common/won.h"
#include "BadMsgException.h"
#include "TMessage.h"
// Titan messages base classes w/ reference counting
namespace {
using WONMsg::BadMsgException;
using WONMsg::TRawData;
using WONMsg::TRawMsg;
using WONMsg::BaseMessage;
using WONMsg::TMessage;
using WONMsg::MiniMessage;
using WONMsg::... | true |
3076d3bd946f7d930704491193582e9ba19756b5 | C++ | JinYeJin/algorithm-study | /November,2020~July,2021/2021-01-01/9273_진예진_정제헌을 팔자!_실패.cpp | UTF-8 | 885 | 2.59375 | 3 | [] | no_license | /*
https://www.slideserve.com/urbana/sample-solutions-ctu-open-contest-2013-czech-technical-university-in-prague
https://www.acmicpc.net/problem/7516
*/
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(){
FILE *stream =freopen("S2\\27\\input\\9273.txt", "r", stdin);
if(!... | true |
a57e1ecebb5d44d30af7d953d456ab97e85d6006 | C++ | duytruong2022/Algorithms | /BinarySearch.cpp | UTF-8 | 457 | 2.84375 | 3 | [] | no_license | #include<stdio.h>
long long B_search (long long a[], long long first, long long last, long long x) {
long long center;
if (last >= first) {
center = (last + first) / 2;
if (a[center] == x)
return 1;
else if (a[center] > x)
return B_search (a, first, center - 1, x);
else
return B_search (a, center + ... | true |
453f41288b9a6a37ce228b5d97e132674e703d2c | C++ | savnik/LaserNavigation | /aurobotservers/trunk/include/ugen4/uplane.h | UTF-8 | 5,786 | 2.703125 | 3 | [] | no_license | /***************************************************************************
* Copyright (C) 2006 by DTU (Christian Andersen) *
* jca@oersted.dtu.dk *
* *
* This pr... | true |
846403cb69eaa5eef37126b37c5b4d804707d091 | C++ | chromium/chromium | /ui/views/controls/progress_ring_utils.cc | UTF-8 | 3,243 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/views/controls/progress_ring_utils.h"
#include <utility>
#include <vector>
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace vi... | true |
6c1a89141f87bccd18870017a9fecf1c73270226 | C++ | ktj007/Raiderz_Public | /Develop/mdk/RealSpace3/RS3UnitTest/RTestShaderCompositeManager.cpp | UHC | 3,285 | 2.703125 | 3 | [] | no_license | #include "stdafx.h"
#include "RMaterial.h" // TODO: RMaterial.h Ŭ ʾƵ ʰ ؾ .
#include "RShaderCompositeManager.h"
#include "RShaderComposite.h"
using namespace rs3;
const int TEST_ID0 = 0;
const int TEST_ID1 = RSC_COUNT - 1;
TEST( TestShaderCompositeManager, GetComponentsNameList )
{
vector<string> rscComponentNa... | true |
4b59549105602bf20093030d171c792ab7d6a9b2 | C++ | bjahagirdar/DSA | /assign2 cricket.cpp | UTF-8 | 3,437 | 3.734375 | 4 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
class Student
{
int N;
int roll[20];
string name[20];
public:
void accept(); //Function to accept no. of students
int funion(Student, Student); //Function to find union
void intersect(Student... | true |
418951a954840543d056f7861715fabb00b8de53 | C++ | cha63506/tiny-2d-games | /feos/miniwars/source/character.arm.cpp | UTF-8 | 2,122 | 3.015625 | 3 | [] | no_license | #include <string.h>
#include "miniwars.h"
Character::~Character() {
for(it = weapons.begin(); it != weapons.end(); it++) {
Weapon *weapon = *it;
delete weapon;
}
}
void Character::pickup(Weapon *w) {
if(!w)
return;
for(list<Weapon*>::iterator iter = weapons.begin(); iter != weapons.end(); iter++)... | true |
0719f31647b7e89cd6440b83138ea6ea1ba64e69 | C++ | networkit/networkit | /networkit/cpp/clique/MaximalCliques.cpp | UTF-8 | 12,675 | 2.640625 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <cassert>
#include <utility>
#include <networkit/auxiliary/SignalHandling.hpp>
#include <networkit/centrality/CoreDecomposition.hpp>
#include <networkit/clique/MaximalCliques.hpp>
namespace {
// Private implementation namespace
using NetworKit::count;
using NetworKit::index;
using Networ... | true |
099c730bb029a8a67eab1de70dc80ef99767896d | C++ | flydecahedron/engine | /src/Audio.hpp | UTF-8 | 5,215 | 2.953125 | 3 | [] | no_license |
#ifndef AUDIO_HPP_
#define AUDIO_HPP_
#include <SFML/Audio.hpp>
#include "utils/Uncopyable.hpp"
#include <cassert>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <unordered_map>
/** Maximum amount of sounds at any given time. SFML docs state 256 is recommended max */
const int Ma... | true |
1cf6eb33d8ab95fc7694e9143ea58fff2b00566d | C++ | norbertsiwinski/ZadanieLiczbyZespolone | /ZespoloneFinal/src/Statystyki.cpp | UTF-8 | 979 | 2.96875 | 3 | [
"MIT"
] | permissive | using namespace std;
#include "Statystyki.hh"
void inicjuj(Statystyki &st){
st.dobre=0;
st.wszystkie=0;
}
void wyswietl(Statystyki &st){
cout<<st.dobre;
cout<<st.wszystkie;
}
int ile_dobrych(Statystyki &st){
st.dobre++;
return st.dobre;
}
void dodaj_popr(Statystyki &st){
ile_do... | true |
5ed255a87366b924d50d893805e5297a2008bc96 | C++ | TheIslland/learning-in-collegelife | /20.蓝桥/网页跳转.cpp | UTF-8 | 1,482 | 2.875 | 3 | [] | no_license | /*************************************************************************
> File Name: 网页跳转.cpp
> Author:TheIslland
> Mail: 861436930@qq.com
> Created Time: 2019年02月20日 星期三 16时21分18秒
************************************************************************/
#include <iostream>
#include <algorithm>
#include <stri... | true |
6f343a90d7ca1df33c8c9059546cedcf87e9aa58 | C++ | Sookmyung-Algos/2021algos | /algos_assignment/3rd_grade/송혜민_songfox00/11월 4주차/2042.cpp | UTF-8 | 1,367 | 2.609375 | 3 | [] | no_license | #include <iostream>
using namespace std;
long long v[1000001];
long long tree[1<<21];
void init(int node_idx, int node_left, int node_right){
if(node_left==node_right){
tree[node_idx]=v[node_left];
return;
}
int mid=(node_left+node_right)/2;
init(node_idx*2, node_left, mid);
init(node_idx*2+1, mid+1, node_ri... | true |
bf9f7594ecf0852ff32ecc11585a8d9b31b16497 | C++ | Coder-Goo/AlgorithmLearning | /nowcoder/剑指offer/JZ61扑克牌中的顺子.cpp | UTF-8 | 930 | 3.375 | 3 | [] | no_license |
从扑克牌中抽5张牌,判断是不是顺子
先排序:
//牌之间的差别< 大小王的个数就可以连成顺子
class Solution {
public:
bool isStraight(vector<int>& nums) {
sort(nums.begin(), nums.end()); //时间复杂度
if(nums[0] != 0) {
for(int i = 1; i<5; i++) {
if(nums[i] - nums[i-1] != 1) return false;
}
}
... | true |
4be41f6e1bcd6c3395a6d2def860341495988f4e | C++ | rakhi2207/C-Learning | /Practice questions/SumNNaturalNo.cpp | UTF-8 | 242 | 2.96875 | 3 | [] | no_license | #include<iostream>
using namespace std;
long int sum(long int n)
{
long int sum1=(n*(n+1))/2;
return sum1;
}
int main()
{
long int a;
cout<<"Enter the natural no";
cin>>a;
cout<<"Sum is "<<sum(a)<<"\n";
return 0;
} | true |
5e2528423fd32ee8c1529775a00288b07ced1966 | C++ | FDI-debug/Laboratory_1sem | /Gordeychuk_Nikita_201_331_lab2.cpp | UTF-8 | 1,584 | 3.53125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int fact(int N) {
int F = 1;
for(int i = 1; i <= N; i++) {
F *= i;
}
return F;
}
void task1(int number) {
for (int i = 0; i <= number; i++) {
for (int j = 0; j <= i; j++) {
cout << j;
}
cout << endl;
}
}
void task2(int n) {
... | true |
b7f59d7f8b50e09051aa1756b132db9864ac9c8c | C++ | LaelRodrigues/Lab3 | /include/questao2/conta.h | UTF-8 | 2,722 | 3.46875 | 3 | [] | no_license | /**
* @file conta.h
* @brief Definicao da classe Conta para representar uma Conta
* @author Lael Rodrigues(laelrodrigues7@gmail.com)
* @since 28/10/2017
* @date 29/10/2017
*/
#ifndef CONTA_H
#define CONTA_H
#include <memory>
using std::shared_ptr;
#include <string>
using std::string;
#include <iostream>
using... | true |
8f7ad88c1d0b21f97f7679f269aedd16918c50e3 | C++ | MohamedAboBakr/Codeforces | /606-A-20737309.cpp | UTF-8 | 361 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin >> a >> b >> c;
int x,y,z;
cin >> x >> y >> z;
int la = a-x>0?(a-x)/2:(a-x);
int lb = b-y>0?(b-y)/2:(b-y);
int lc = c-z>0?(c-z)/2:(c-z);
if(la + lb + lc >= 0)
cout << "YES" << endl;
... | true |
bd5fc62b6eedc8b92a5cbe684e9235abae16e931 | C++ | kks227/BOJ | /1100/1120.cpp | UTF-8 | 365 | 2.546875 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
char A[51], B[51];
scanf("%s %s", A, B);
int Alen = strlen(A);
int Blen = strlen(B);
int result = Blen;
for(int i=0; Alen+i<=Blen; i++){
int cnt = 0;
for(int j=0; j<Alen; j++)
if(A[j] != B[i+j]) cnt++;
result = mi... | true |
9ffc13cdab98a156586095cac92fa5cda3ded667 | C++ | ETalienwx/ETGitHub | /Default_member_function/Main.cpp | GB18030 | 1,876 | 3.40625 | 3 | [] | no_license | //#include <iostream>
//using namespace std;
//ռ
//namespace bit
//{
// int printf = 10;
//}
//
//int main()
//{
// cout << bit::printf << endl;
// system("pause");
// return 0;
//}
//ȱʡ
//#include <iostream>
//using namespace std;
//void f(int a = 10)
//{
// cout << a << endl;
//}
//int main()
//{
// f();
// f(50);
/... | true |
eb91ebc528440a99cbf7cdedf8c199965e02bb3d | C++ | kmouelouel/CPlusAdvance | /Interview Cake/UnixProgramProject/UnixProgramProject/main.cpp | UTF-8 | 2,600 | 3.03125 | 3 | [] | no_license | ///* Name: kahina Mouelouel
//student ID:1470398
//Class :COMSC-171
//Instructor:Stuart Fogg
//*/
//
//
//#include <iostream>
//#include <string>
//
//#include <fstream>
//#include <cstdlib>
//
//using namespace std;
//
//// this function delet all space in the beginning of line.
//string DeletSpaceInBEginning( string... | true |
ce5c05269c532b958fb1c089c584ea212c16b606 | C++ | polgreen/fastsynth-2 | /src/fastsynth/bitvector2integer.cpp | UTF-8 | 1,682 | 2.875 | 3 | [] | no_license |
#include "bitvector2integer.h"
#include <util/arith_tools.h>
// TODO: check how we get value from constant or symbol bitvector
void bitvec2integert::convert(exprt &expr)
{
for (auto &op : expr.operands())
convert(op);
if (expr.id() == ID_constant)
{
if (expr.type().id() == ID_unsignedbv)
{
mp... | true |
da96dd2db8b574e6e852014721e9ad69e7904756 | C++ | bobpepin/dust3d | /src/animationclipplayer.cpp | UTF-8 | 2,012 | 2.90625 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | #include "animationclipplayer.h"
AnimationClipPlayer::~AnimationClipPlayer()
{
clear();
}
void AnimationClipPlayer::setSpeedMode(SpeedMode speedMode)
{
m_speedMode = speedMode;
}
void AnimationClipPlayer::updateFrameMeshes(std::vector<std::pair<float, Model *>> &frameMeshes)
{
clear();
m_frameMe... | true |
47a25c69a33476756e53a651cbf20b82db460af8 | C++ | dmontoyain/cpp | /cpp_piscine/d03/ex01/ScavTrap.cpp | UTF-8 | 2,672 | 3.15625 | 3 | [] | no_license | #include "ScavTrap.hpp"
ScavTrap::ScavTrap(void) : name("noname"), hp(100), maxhp(100), ep(100), maxep(100), level(1), meleedamage(20), rangeddamage(15), armordamage(3)
{
std::cout << "SC4V-TP <" << name << "> constructed" << std::endl;
}
ScavTrap::ScavTrap(std::string name) : name(name), hp(100), maxhp(100), ep(... | true |
bacf333977fd5321462d0fdd0329bb4e50561734 | C++ | gusteran/CS-2303 | /Homework6/src/Board.cpp | UTF-8 | 4,843 | 3.265625 | 3 | [] | no_license | /*
* Board.cpp
*
* Created on: Oct 7, 2019
* Author: gustt
*/
#include "Board.h"
Board::Board() {
ships[0] = new AircraftCarrier(0, 0, HORIZONTAL);
ships[1] = new Battleship(2, 0, HORIZONTAL);
ships[2] = new Cruiser(4, 0, HORIZONTAL);
ships[3] = new Destroyer(6, 0, HORIZONTAL);
ships[4] = new Submarin... | true |
6755e4d19aa4d7a8d4bdccf5ff6cab0083bfac80 | C++ | ruihanxu2/leetCode_FBtag | /TwoSum.cpp | UTF-8 | 253 | 3.15625 | 3 | [] | no_license | vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> m;
for(int i = 0; i < nums.size(); i++){
if(m.count(target - nums[i])) return vector<int>{m[target - nums[i]], i};
else{
m[nums[i]] = i;
}
}
return vector<int>();
} | true |
fce13da03df594239393dbb8a744f410b39fdb21 | C++ | RyukuA/Beaglebone | /Pwm.cpp | UTF-8 | 1,515 | 2.6875 | 3 | [] | no_license | /*
* Pwm.cpp
*
* Created on: 21 Dec 2015
* Author: pi
*/
#include "Pwm.hpp"
#include <string.h>
#include <iostream>
#include <fstream>
using namespace std;
#define MAX 64
Pwm::Pwm() {
// TODO Auto-generated constructor stub
}
Pwm::~Pwm() {
// TODO Auto-generated destructor stub
}
int Pwm::SetDuty(unsi... | true |
73024a6a6b40cc8cd11942ef7f9fa6d6cb893f78 | C++ | rohanrao619/Data_Structures_and_Algorithms | /Searching/Maximum_Water_Between_2_Buildings.cpp | UTF-8 | 975 | 3.265625 | 3 | [] | no_license | // { Driver Code Starts
//Initial Template for C++
// C++ implementation of the approach
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
// Return the maximum water that can be stored
int maxWater(int height[], int n)
{
//Your code her... | true |
b853c799492664d06fd5bc057649cc328d17f196 | C++ | paulamlago/EDA-1 | /Acepta_El_Reto/problema_272.cpp | UTF-8 | 1,205 | 2.90625 | 3 | [
"WTFPL"
] | permissive | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
using namespace std;
inline void out(int n)
{
int N = n, rev, count = 0;
rev = N;
if (N == 0) {
putchar_unlocked('0');
// putchar('\n');
return;
}
while ((rev % 10) == 0) { count++; rev /= 10; }
rev = 0;
while (N !=... | true |
e0bee309e3f4b19d00cd86957bd82991d8295321 | C++ | Linzecong/My-ACM-Code | /CodeForces/339A/12436692_AC_30ms_1860kB.cpp | UTF-8 | 639 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<memory.h>
#include<string>
#include<stdlib.h>
using namespace std;
int a[1005];
int cnt=0;
string temp;
int main(){
string str;
cin>>str;
for(int i=0;i<str.length();i++)
{
if(str[i]=='+')
{
a[cn... | true |
1d93cc2f97eb8067ce214473c8d89239ea5ee330 | C++ | Cat-Sniper/UbisoftNext2020 | /NextAPI2020/GameTest/Entities/Enemies/Spike.cpp | UTF-8 | 3,596 | 2.796875 | 3 | [] | no_license | #include "stdafx.h"
#include "Spike.h"
#include "App/app.h"
#include "Managers/GameMath.h"
Spike::Spike(Vec2 position, Vec2 sectionTop, Vec2 sectionBack, Vec2 section, float adjustment)
{
m_isAlive = true;
m_hurtOnTouch = true;
m_hitRadius = 3.0f;
m_adjustment = adjustment;
float lengthOfSection = GameMath::Dist... | true |
6b0a98e413e8f6a2f4f01d5da8f8aa98acf53b6a | C++ | HusterYP/DataStructure | /Sort/Sort_C/SelectSort.cpp | UTF-8 | 1,764 | 3.609375 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#define status int
#define MAX_COUNT 1000 // 默认对1000个数据进行排序操作
// 函数声明
void CreateRandom();
void ReadFromFile(int* num);
void WriteToFile(int* num);
void SelectSort(int* num);
/***********************************************
* 选择排序
**********************************************... | true |
251f2c18bf2b2b1ce3ed7644b33de7a447111185 | C++ | magickazer/epsilon | /ion/src/shared/events_modifier.cpp | UTF-8 | 3,574 | 2.859375 | 3 | [] | no_license | #include "events_modifier.h"
#include <assert.h>
namespace Ion {
namespace Events {
static ShiftAlphaStatus sShiftAlphaStatus = ShiftAlphaStatus::Default;
static int sLongRepetition = 1;
int sEventRepetitionCount = 0;
ShiftAlphaStatus shiftAlphaStatus() {
return sShiftAlphaStatus;
}
void removeShift() {
if (sSh... | true |
b45e1aaac6926e1ae31a73ee6f6c56850449debd | C++ | linefinc/MinerIA | /TestGame/myMap.cpp | UTF-8 | 6,601 | 3.0625 | 3 | [] | no_license | #include "myMap.h"
#include "VectorUtils.h"
#include <limits>
#include <cmath>
myMap::myMap(int width, int height, unsigned int ScreenWidth, unsigned int boxSide)// todo: cange coordiante sistem to fit with game coordinte
:boxSide(boxSide), ScreenWidth(ScreenWidth), scale(1)
{
map = new std::vector<MapItem>();
// r... | true |
a642f0d3c855b4c8b115b7135f3be950f047a705 | C++ | eliseumiguel/TVPP-DEV | /src/common/Strategy/NearestIPStrategy.hpp | UTF-8 | 3,432 | 2.8125 | 3 | [] | no_license | #ifndef NEARESTIPSTRATEGY_H
#define NEARESTIPSTRATEGY_H
#include "Strategy.hpp"
typedef struct NearestNode {
unsigned int posVector;
unsigned int dist[4];
} NearestNode;
class NearestIPStrategy: public Strategy
{
private:
void SelectPeers(vector<PeerData*>* peers, Peer* srcPeer, int qua... | true |
95ce0304960253692b4e322154e788a4f4092098 | C++ | erengy/nstd | /include/nstd/string/split.hpp | UTF-8 | 1,805 | 3.171875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <algorithm>
#include <functional>
#include <string>
#include <string_view>
#include <vector>
#include "constants.hpp"
namespace nstd {
namespace detail {
using string_predicate_t = std::function<bool(const char)>;
} // namespace detail
inline std::vector<std::string> split(std::string_view... | true |
a2408e87a2620b4fca54fce9aa5bf4a7b2e8abcf | C++ | fossabot/deplug | /plugkit/src/frame.hpp | UTF-8 | 904 | 2.59375 | 3 | [
"MIT"
] | permissive | #ifndef PLUGKIT_FRAME_H
#define PLUGKIT_FRAME_H
#include "types.hpp"
#include <memory>
namespace plugkit {
class FrameView;
class Frame final {
public:
Frame();
virtual ~Frame();
Timestamp timestamp() const;
void setTimestamp(const Timestamp ×tamp);
size_t length() const;
void setLength(size_t leng... | true |
a1e8cd5849dd76a58327c01fd002ee28fc8adfd8 | C++ | rvfarias/LP1_LISTA1 | /questao3/src/main.cpp | UTF-8 | 2,077 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
#include "invoice.h"
using namespace std;
int main(){
Invoice in1;
Invoice in2;
Invoice in3;
Invoice in4;
in1.setValor();
in2.setCodItem(2220003);
in2.setDescr("Usado");
... | true |
22c2ff70b36805ff6e7386f6e195baae55080684 | C++ | avanishgiri/Algorithms | /CodeEval/test.cpp | UTF-8 | 1,033 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <vector>
#include <math.h>
#include <fstream>
#include <sstream>
using namespace std;
int main(int argc, char **argv){
ifstream file;
file.open(argv[1]);
string test;
long long limit;
while (!file.eof())
{
getline(file, test);
if (test.length() == 0)
... | true |
bb666ccd785e280e8bc01c51febbaa7abdaebf1f | C++ | ribeiropdiogo/CG | /engine/ObjLoader.cpp | UTF-8 | 6,411 | 2.59375 | 3 | [] | no_license | #include "ObjLoader.h"
#include "Common.h"
#include <unordered_map>
#include <sstream>
#include <TexLoader.h>
#define OBJ_FOLDER "../../samples/3D/"
using namespace std;
void parse_point_wvobj(string name, int *indexes, int* sizes) {
int num, i = 0;
string item;
stringstream ss(name);
while( getline... | true |
e2d9f8f675711360eb0e3dc2d99c0f31f26d51dd | C++ | woshilinlin/tool | /test1/rtspcamera.h | UTF-8 | 1,128 | 2.515625 | 3 | [] | no_license | #ifndef RTSPCAMERA_H
#define RTSPCAMERA_H
#include <opencv2/opencv.hpp>
#include <QImage>
class RTSPCamera : public QObject
{
Q_OBJECT
public:
/*!
* \brief RTSPCamera rtsp协议摄像头
* \param rtspUrl url路径
*/
RTSPCamera(const QString & rtsp_url);
/*!
* \brief doCapture 拍照
*/
... | true |
dfacc05c6d6de598ac8c038f6a8d37d7b89828e2 | C++ | berneylin/LeetCode2019Spring | /28/implement_strStr.cpp | UTF-8 | 605 | 2.953125 | 3 | [] | no_license | class Solution {
public:
int strStr(string haystack, string needle) {
int needleLen = needle.size();
int haystackLen = haystack.size();
if(!needleLen) return 0;
int ret = -1;
for(int i=0;i<haystackLen-needleLen+1;i++){
bool thisCmp = true;
for(int j=0;... | true |
8178436a49c8c6206f39cf8a790d77ed114ae782 | C++ | OliverAkhtar/Projects | /Introduction to Progamming/Lab Projects/lab9/powersOfTwo.cpp | UTF-8 | 374 | 4.0625 | 4 | [] | no_license | /*This program prints the powers of 2 from zero to a user inputted integer.*/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int number;
int counter;
cout << "A table of powers, enter a number: ";
cin >> number;
for(counter=0; counter<=number; counter++)
cout << "2 to the power of " << coun... | true |
caad8e57de2f13689a954b29ffc5947802c8d3a2 | C++ | rafaeltmbr/algorithm-data-structure | /graph/test/graph-testbench.cpp | UTF-8 | 15,252 | 3.0625 | 3 | [] | no_license | /* Build Commands:
g++ graph-testbench.cpp ../src/graph.cpp ../../list/src/list.cpp -g -Wall -std=c++14 -o graph.exe
*/
#include "../include/graph.hpp"
#include <iostream>
#define ASSERT(cond, msg) \
if (cond) ... | true |
912a895f6f585e9f3b1da7c2b108eb374f850396 | C++ | NavyaaSharma/January-leetcode-challenge | /Sort the Matrix Diagonally.cpp | UTF-8 | 1,053 | 2.84375 | 3 | [] | no_license | #### PROBLEM LINK
//https://leetcode.com/explore/challenge/card/january-leetcoding-challenge-2021/582/week-4-january-22nd-january-28th/3614/
#### SOLUTION
class Solution {
public:
vector<vector<int>> diagonalSort(vector<vector<int>>& mat) {
int m=mat.size();
int n=mat[0].size();
... | true |
22eeb36dd1554af717cab4ff604e7781f32d6343 | C++ | devcbandung/clashofcode-testdata-and-solution | /devc-meetup-venue/spec.cpp | UTF-8 | 7,370 | 2.671875 | 3 | [
"MIT"
] | permissive | #include <tcframe/spec.hpp>
#include <cassert>
using namespace tcframe;
class DSU {
public:
DSU(int n): p(vector<int>(n+1)), n(n) {
for (int i = 1; i <= n; ++i) {
p[i] = i;
}
}
int findSet(int x) {
return p[x] == x ? x : p[x] = findSet(p[x]);
}
void mergeSet(int x, int y) {
p[findSet(... | true |
d39a921eff06acf6443dd0a6acbbdfa845862926 | C++ | siggame/MegaMinerAI-12 | /testClients/hannaClient/UnitType.h | UTF-8 | 1,154 | 2.859375 | 3 | [] | no_license | // -*-c++-*-
#ifndef UNITTYPE_H
#define UNITTYPE_H
#include <iostream>
#include "structures.h"
///Represents type of unit.
class UnitType {
public:
void* ptr;
UnitType(_UnitType* ptr = NULL);
// Accessors
///Unique Identifier
int id();
///The name of this type of unit.
char* name();
///The UnitTy... | true |
37f28c3a234dee1f132a14090e1529e38080b207 | C++ | z-rui/nbuf | /example/my_game_pb.cc | UTF-8 | 1,489 | 2.78125 | 3 | [] | no_license | #include "my_game.pb.h"
#include <cassert>
#include <cstdio>
#include <sstream>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/text_format.h>
void
save(std::ostream *os)
{
my_game::Hero x;
my_game::Item *it;
x.set_name("n37h4ck");
x.set_gender(my_game::FEMALE);
x.set_race(my_gam... | true |
acc1d7f61bfe729609614ed1e4fd5d51b9b06b03 | C++ | TTgogogo/Android-App-Profiling | /apprepo/i-team-video_segment/imagefilter/nnf.h | UTF-8 | 2,216 | 2.546875 | 3 | [] | no_license | /*
* nnf.h
* ImageFilterLib
*
* Created by Matthias Grundmann on 5/24/09.
* Copyright 2009 Matthias Grundmann. All rights reserved.
*
*/
// Computation of nearest neighborfield
// Based on: Connelly Barnes, Eli Shechtman, Adam Finkelstein, Dan B Goldman
// PatchMatch: A Randomized Correspondence A... | true |
997f9990f773c01f4a24e8abb13fd4462e28e9bb | C++ | in0x/FinalFrontier | /src/Renderer.cpp | UTF-8 | 1,383 | 3.015625 | 3 | [] | no_license | #include "stdafx.h"
#include "Renderer.h"
Renderer::Renderer(RenderTarget* t)
{
target = t;
}
Renderer::~Renderer()
{
for (auto layer : layers)
delete layer;
}
void Renderer::clear() {
for (auto layer : layers)
delete layer;
layers.clear();
}
void Renderer::addLayer(int index) {
if (index == -1)
layers... | true |
082aec03ed4bb1ee206eef071c1752d3b6fe506f | C++ | MattiaCossu89/CPP | /4/ex01/Character.hpp | UTF-8 | 1,484 | 2.640625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Character.hpp :+: :+: :+: ... | true |
d97a11709c7ea805d255aee4d376eecf9d3f3246 | C++ | gkUwen/rodent | /src/driver/tri.h | UTF-8 | 2,070 | 3.359375 | 3 | [
"MIT"
] | permissive | #ifndef TRI_H
#define TRI_H
#include "float3.h"
#include "bbox.h"
struct Tri {
float3 v0, v1, v2;
Tri() {}
Tri(const float3& v0, const float3& v1, const float3& v2)
: v0(v0), v1(v1), v2(v2)
{}
float3& operator[] (int i) { return i == 0 ? v0 : (i == 1 ? v1 : v2); }
const float3& opera... | true |
b0aa2e7ec92c2ebf6589a19ae9d200913c9b5cf1 | C++ | verdande2/CST211-Spring-12 | /Assignment 11/Assignment 11/main.cpp | UTF-8 | 3,099 | 3.1875 | 3 | [] | no_license | /***********************************************************
* Author: Andrew Sparkes
* Title: CST 211 Assignment 11
* Filename: main.cpp
* Date Created: 5-24-12
* Modified: 5-26-12 : documentation, small tweaks
*
* Overview:
* This program is a driver demonstrating the basic
* capabilities of a undirected graph c... | true |
9b50c680071e43087783f90e4fd0d734ded3e534 | C++ | xobe19/CP-Learning | /merge_sort.cpp | UTF-8 | 1,066 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<int> merge(vector<int> &a, vector<int> &b) {
auto it1 = a.begin();
auto it2 = b.begin();
vector<int> sorted;
while(it1 != a.end() && it2 != b.end()) {
if(*it1 < *it2) {
sorted.push_back(*it1);
it1++;
}
else {
sor... | true |
f7a3f24b8150440c53a0075b4117b98751815fc2 | C++ | SaiSree-0517/becomecoder | /combinations.cpp | UTF-8 | 690 | 3.34375 | 3 | [] | no_license | #include <iostream>
using namespace std;
void getCombinations(int arr[], int index, int num, int reducedNum)
{
if (reducedNum < 0)
return;
if (reducedNum == 0)
{
for (int i = 0; i < index; i++)
{
cout << arr[i] << " ";
}
cout << endl;
return;
... | true |
ac4c7c1e99b12fb73a063af2fc86e9731657ab59 | C++ | Randool/Algorithm | /DP/最优矩阵链乘.cpp | UTF-8 | 885 | 2.734375 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <iostream>
#define MAXN 55
#define INF 0x3f3f3f3f
typedef long long LL;
using namespace std;
int n;
int mat[MAXN];
int G[MAXN][MAXN];
void MatrixChain(int n, int* mat) {
memset(G, 0, sizeof(G));
for (int l=2; l<=n; ++l) {
for (int i=1; i<=n; ++i) {
int j = i + l - ... | true |
e1db47a5e56eea5cb4ebc33a6490703c46d7ff1b | C++ | msDikshaGarg/Images-and-Morphological-Operators | /src/Image.h | UTF-8 | 1,014 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<string>
#include<cmath>
using namespace std;
typedef struct Pixel
{
unsigned char rgb[3];
};
struct PPM {
Pixel* mPixels = nullptr;
char mType[3];
unsigned int mRows;
unsigned int mColumns;
unsigned int size;
unsigned int mMaxV... | true |
560ace31bd68713a3b71460cbfc5a6092fc4a5d0 | C++ | shiLinwong/workspace | /QtGuiExamples/MultiScreen/main.cpp | UTF-8 | 2,195 | 2.5625 | 3 | [] | no_license | #include "mainwindow.h"
#include <QApplication>
#include <QTextCodec>
#include <QDesktopWidget>
#include <QMainWindow>
#include <QDebug>
typedef struct{
int screen_no;
QRect rect;
}SCREEN;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QDesktopWidget *desktop = QApplication::desktop()... | true |
112783baee4458b9075b9c062a9b7d3db63798bf | C++ | mrdepth/libdgmpp | /src/Character.hpp | UTF-8 | 4,090 | 2.75 | 3 | [
"MIT"
] | permissive | //
// Character.hpp
// dgmpp
//
// Created by Artem Shimanski on 16.11.2017.
//
#pragma once
#include "Skill.hpp"
#include "Structure.hpp"
#include "Ship.hpp"
#include "Implant.hpp"
#include "Booster.hpp"
namespace dgmpp {
class Character: public Type {
public:
Character();
Character (const Chara... | true |
72cf07064870cdcc820080d66981837957bb4a0e | C++ | genius52/leetcode | /src/cpp/list/707. Design Linked List.hpp | UTF-8 | 3,398 | 4.15625 | 4 | [] | no_license | struct Listnode{
int val = 0;
Listnode* next = nullptr;
};
class MyLinkedList {
Listnode* head = nullptr;
Listnode* tail = nullptr;
int size = 0;
public:
/** Initialize your data structure here. */
MyLinkedList() {
}
/** Get the value of the index-th node in the linked list. If th... | true |
f7d3573b37fe8334efe490c1068ee0fd4fb9b6d7 | C++ | Dinngger/cpp_class | /complex.cpp | UTF-8 | 2,197 | 3.609375 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Complex{
double real, imag;
public:
Complex(){
}
Complex(double real, double imag){
this->real = real;
this->imag = imag;
}
Complex& operator=(const Complex& comp){
if(&comp != this){
this->real = comp.real;
... | true |
85cd9d2085f319e6406f8b162ce5737c78763013 | C++ | j0sht/csci160 | /practice/fileio/e2.cpp | UTF-8 | 1,150 | 4.03125 | 4 | [] | no_license | /*
* Write a function that takes two filenames and an integer N as parameters,
* attempts to open the first for reading and the second for writing, and
* copies the first N characters of the first file into the second
*/
#include <cstdio>
#include <cstdlib>
void copyFirstN(const char *source, const char *dest, i... | true |
8bc421b95039509cd5467b430e5cc7073f43c8fa | C++ | ForeStrikeGallery/old-C- | /Goodrich/arrays/minmaxdist.cpp | UTF-8 | 965 | 3.40625 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
using namespace std;
int max(int a, int b) {
return a>b?a:b;
}
int min(int a, int b) {
return a<b?a:b;
}
void insertion_sort(int *arr, int N) {
for (int i=1; i<N; i++) {
int j = i-1;
int key = arr[i];
while (j >= 0 && arr[j] > key) {
arr[ j + 1] = arr[j]
j--;
... | true |
d3595245605e7ce6abf968cd533ebd880ce9a90d | C++ | palezero/PAT | /pat_test_yi/1028.cpp | UTF-8 | 772 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
typedef struct {
string name;
short year;
short month;
short day;
int date;
}Group;
bool cmp(Group g1, Group g2) {
return g1.date < g2.date;
}
int main() {
int num;
int count = 0;
cin>>num;
Group people[num];
Gr... | true |
28232bd1d4954f9f4085b20405984ae7a875321c | C++ | vivian-jq/AIFM | /aifm/inc/object.hpp | UTF-8 | 2,652 | 3 | 3 | [
"MIT"
] | permissive | #pragma once
#include <limits>
namespace far_memory {
// Forward declaration.
template <typename T> class UniquePtr;
class Object {
//
// Format:
// |<------------------ header ------------------>|
// |ptr_addr(6B)|data_len(2B)|ds_id(1B)|id_len(1B)|data|object_ID|
//
// ptr_addr: points to the corr... | true |
5149d2b687d390943bdc0252f6519f79101edc2a | C++ | mcrossen/macattack | /logger.h | UTF-8 | 224 | 2.59375 | 3 | [] | no_license | #pragma once
#include <iostream>
// simple class to handle log messages
// log::verbose must be set to actually display the log
class log {
public:
log(std::string module, std::string message);
static bool verbose;
};
| true |
f8cb4339aef9283f3e5114046108436b3d89b144 | C++ | heyuanzhen/PathTracer | /PathTracer/Utils/Sampler.h | UTF-8 | 1,374 | 2.671875 | 3 | [] | no_license | //
// Sampler.h
// PathTracer
//
// Created by HYZ on 2018/2/3.
// Copyright © 2018年 HYZ. All rights reserved.
//
#ifndef Sampler_h
#define Sampler_h
#include <eigen3/Eigen/Dense>
#include "typeAlias.h"
class Sampler{
protected:
public:
Sampler();
virtual ~Sampler(); //virtual
double random1D() ... | true |
ebe83f96b794d300ae9050e8bfc5489946647814 | C++ | CZhang1997/BoundedQueue | /Main.cpp | UTF-8 | 519 | 3.015625 | 3 | [
"MIT"
] | permissive | //Churong Zhang
#include<iostream>
using namespace std;
#include"CircularQueue.h"
void main()
{
//CircularQueue list;
/*int size = 10;
for(int a = 0; a < size; a++)
{
list.que(a+20);
if(a%2 == 0)
cout << list.deque() << " ";
}
cout << endl;*/
CircularQueue list (20);
for (int b... | true |
80175de22d469c72325f0d0be5994239247eef1a | C++ | harshit12345677/LCA | /BST_LCA.cpp | UTF-8 | 1,591 | 3.890625 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Node {
public:
int data;
Node *left;
Node *right;
Node(int d) {
data = d;
left = NULL;
right = NULL;
}
};
class BST {
public:
Node* insertBST(Node* root, int data) {
... | true |
22d5141b9f2b74fcd3ecf6511b91d8cf9370d079 | C++ | BieremaBoyzProgramming/bbpPairings | /src/matching/detail/rootblossomsig.h | UTF-8 | 3,614 | 2.671875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef ROOTBLOSSOMSIG_H
#define ROOTBLOSSOMSIG_H
#include <vector>
#include "types.h"
namespace matching
{
namespace detail
{
template <typename>
struct Blossom;
template <typename>
class Graph;
template <typename>
class ParentBlossom;
template <typename>
struct Vertex;
/**
... | true |
3db8f202daf33c513fe7dd34c3c0fceee78ce282 | C++ | sivikt/memoria | /src/core/src/fixed_size_datum.cpp | UTF-8 | 4,658 | 2.609375 | 3 | [
"BSD-3-Clause",
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive |
// Copyright 2019 Victor Smirnov
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... | true |
350a29af65b4beb2306337d2d133f7b74f3eecde | C++ | MysteryPizzaGuy/Crucible | /10012-Data Structures And Algorithms/#14/Tasks/Task 4/Source.cpp | UTF-8 | 696 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <unordered_set>
#include <random>
#include <vector>
#include <string>
void genString(std::vector<std::string>& v, int howMany) {
std::random_device dev;
std::mt19937 gen{ dev() };
std::uniform_int_distribution<int> dis{97, 101};
for (size_t i = 0; i < howMany; i++)
{
std::string tem... | true |
3c37d639540608ba9e71cddcac1cd33cf2318b48 | C++ | Samuel-Taya/Lab1-ProjectEuler-1-to-7-and-9 | /Problem4.cpp | UTF-8 | 842 | 3.96875 | 4 | [] | no_license | // largest palindrome made from the product of two 3-digit numbers.
#include <iostream>
#include <math.h>
using namespace std;
bool palindromo(int n)
{
int num = n;
int inv = 0;
// operacion para invertir el numero
while (num>0)
{
inv = inv * 10 + num % 10; // obtiene el ... | true |
315f7c3f632746ac1a6ec6c545ec2c8c8a008441 | C++ | graybriggs/advent-of-code-2016 | /day2.cpp | UTF-8 | 1,528 | 3.109375 | 3 | [] | no_license |
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
std::vector<std::string> getCodes(std::string fname) {
std::vector<std::string> codes;
std::ifstream ifs(fname);
std::string line;
while (std::getline(ifs, line)) {
codes.push_back(line);
}
return codes;
}
... | true |
468dba3ab569b0cdba413090dc6a0600b2310f4c | C++ | bluemix/Online-Judge | /UVA/Volume VII/706 LCD Display.cpp | WINDOWS-1252 | 3,736 | 3.046875 | 3 | [] | no_license | /* 9038399 706 LCD Display Accepted C++ 0.024 2011-07-11 08:57:09 */
#include<stdio.h>
#define MAX 1000
void print(char table[][MAX],char c,int s,int x){
int row,cul;
// l
for(cul=x;cul<=x+s+1;cul++)
for(row=0;row<=2*s+2;row++)
if(cul==x||cul==x+s+1)
if((row>=1&&row<=s)||(row>=s+2&&row<=2*s+1))
table[... | true |
a2ddf83faf829ccf38302620a13ae0e4e983ca4d | C++ | faterer/cpm | /leetcode/cpp/066-PlusOne.cpp | UTF-8 | 1,006 | 4.09375 | 4 | [] | no_license | // No.66 easy https://leetcode.com/problems/plus-one/
// Given a non-negative number represented as an array of digits, plus one to the number.
// The digits are stored such that the most significant digit is at the head of the list.
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
... | true |
43f4d1444c2f22b0fee4af1d4cd1d13b9216a5a7 | C++ | Katipo007/avokii | /src/Avokii/Graphics/Camera.hpp | UTF-8 | 4,725 | 2.640625 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | #pragma once
#include "Avokii/Types/Vector.hpp"
#include "Avokii/Types/Quaternion.hpp"
#include "Avokii/Types/Matrix.hpp"
#include "Avokii/Graphics/WorldSpace.hpp"
namespace Avokii::Graphics
{
class Camera
{
public:
enum class Type
{
Free,
Orthographic,
Spherical,
NumCameraTypes,
};
public:
... | true |
d8e96c753e31335f24665b104e24d33a6c30d786 | C++ | Pythalex/windscribeGUI-Linux | /input/parser.cpp | UTF-8 | 2,518 | 2.921875 | 3 | [] | no_license | #include "parser.hpp"
using std::string;
using std::vector;
void parse_state(State *s){
string status = read_windscribe_status();
if (status == "Service communication error"){
debug("Windscribe returned Service communication error.");
return ;
}
string firewall = read_firewall();
... | true |
39f4e35ae40d7970df2ef8ac7b84d63a2ce74218 | C++ | taricketts/Roman-Numeral | /RomanNumeral.h | UTF-8 | 4,937 | 3.4375 | 3 | [] | no_license | /*
* RomanNumeral.h
*
* Created on: Nov 10, 2014
* Author: Tom
*/
#include <string>
#include <iostream>
using namespace std;
#ifndef ROMANNUMERAL_H_
#define ROMANNUMERAL_H_
class RomanNumeral {
private:
string roman[7];
int arabic[7];
public:
RomanNumeral();
~RomanNumeral();
int romanToArabic(string... | true |
28c781c3c83da84c86940c2b65456fe3bbe0afa7 | C++ | vagran/phoenix | /lib/common/CommonLib.cpp | UTF-8 | 37,138 | 3.1875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
* /phoenix/lib/common/CommonLib.cpp
*
* This file is a part of Phoenix operating system.
* Copyright (c) 2011-2012, Artyom Lebedev <artyom.lebedev@gmail.com>
* All rights reserved.
* See COPYING file for copyright details.
*/
/** @file CommonLib.cpp
* Run-time mid-level support functions.
*
* This file co... | true |
765e4d1995ae7bf9813f24f6ad5dda0fd1776256 | C++ | David-Badiane/VbrArt | /sketch_fcpc3.ino | UTF-8 | 2,874 | 3.078125 | 3 | [] | no_license | // constants won't change. They're used here to set pin numbers:
const int buttLedNumber = 4;
const int buttonPin[buttLedNumber] = {2, 3, 4, 5}; // the number of the pushbutton pin
const int ledPin[buttLedNumber] = {6, 7, 8, 9}; // the number of the LED pin
// Variables will change:
int ledState[buttLedNumber] = {LOW,... | true |
a9e927dd1a950b9dd3688883118bb2422c9639eb | C++ | kamalsirsa/vtp | /TerrainSDK/vtdata/vtString.cpp | UTF-8 | 30,562 | 2.734375 | 3 | [
"MIT"
] | permissive | //
// vtString.cpp
//
// Copyright (c) 2001-2011 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//
#include "vtString.h"
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <wchar.h>
#define InterlockInc(i) (*(i))++
#define InterlockDec(i) --(*(i))
/////////////////////////... | true |
af977f9cf2d8d08e2b8817533e89721a49541a91 | C++ | cryptowerk/cealr | /src/properties.h | UTF-8 | 4,534 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | /*
* _____ _____ _____ ___ ______
*| __| __|/ _ \| | | _ | Command line tool for sealing files with Cryptowerk API
*| |__| __| _ | |__|
*|_____|_____|__| |__|______|__|\__\ https://github.com/cryptowerk/cealr
*
*Licensed under the Apache 2.0 License <https://opensource.org/licenses/Apa... | true |
ecdc713985fe6354ffbc1aaa809b3eff542e6d7f | C++ | kien-vu-uet/HomeWork | /week5/functionCallStack.cpp | UTF-8 | 293 | 3.5 | 4 | [] | no_license | #include <iostream>
using namespace std;
int factorial(int x) {
if (x <= 2) return x;
return x * factorial(x - 1);
}
int main() {
int N;
cin >> N;
cout << "x = " << N << " at " << &N << endl;
cout << "Factorial of " << N << " is : " << factorial(N);
return 0;
}
| true |
cc10a67961f7740fbd9a72bc851edee0b8278c38 | C++ | SwagSoftware/Kisak-Strike | /ivp/havana/havok/hk_math/matrix3.h | UTF-8 | 2,978 | 3 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef HAK_MATH_MATRIX3_H
#define HAK_MATH_MATRIX3_H
#ifndef HK_MATH_VECMATH_H
#error Include <hk_math/vecmath.h> Do not include this file directly.
#endif // HK_MATH_VECMATH_H
//: A generic 3x3 matrix
class hk_Matrix3
{
public:
HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_CONSTRAINT, hk_Mat... | true |
597aaa07217d7451e362f54de46c7b17bf12ccd4 | C++ | rituraj0/Topcoder | /Old Topcoder SRM codes/CyclicGame.cpp | UTF-8 | 5,282 | 2.796875 | 3 | [] | no_license | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <fstream>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <map>
#include <... | true |
5437a12bafe9521850c5eca3eebedb2c4ed9e154 | C++ | nicoaraandrei/Flock-behaviour | /MovingEntity.h | UTF-8 | 2,469 | 2.671875 | 3 | [] | no_license | #pragma once
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtx/norm.hpp>
#include "SpriteBatch.h"
#include "TileSheet.h"
#include "BaseEntity.h"
#include "SteeringBehaviors.h"
class SteeringBehaviors;
class MovingEntity : public BaseEntity
{
public:
MovingEntity() : BaseEntity(0) {}
MovingE... | true |
633bb8364f62c9be7dccd4a9157f9080e08a06f4 | C++ | hubartstephane/Code | /libraries/chaos/src/Deprecated/BitmapFontTextMeshBuilder.cpp | UTF-8 | 4,726 | 2.796875 | 3 | [] | no_license | #include "chaos/ChaosPCH.h"
#include "chaos/ChaosInternals.h"
namespace chaos
{
void BitmapFontTextMeshBuilder::InsertVertexComponent(std::vector<float> & vertices, glm::vec2 const & v, glm::vec2 const & t)
{
vertices.push_back(v.x);
vertices.push_back(v.y);
vertices.push_back(t.x);
vertices.push_back(1.0f ... | true |
a8568c5963299fc7af77f6e1dd0d5726bd5a047a | C++ | kdurant/qt_study | /src/motor/PusiController.cpp | UTF-8 | 19,730 | 2.984375 | 3 | [] | no_license | /*
* 1. 具有两个限位开关,分别对应着EXT1, 和EXT2
* 2. 当电机运动到限位开关,触发EXT1或EXT2,此时断电。
* 再重启后,还往限位开关所在的方向运动,会导致电机抖动,且不触发EXT1或EXT2信号
* 3. 运动方向设置为方向时,对应限位开关为EXT1
* 4. 上电读取电机位置为0, 不同的运动方向会导致数据溢出
*/
#include "PusiController.h"
MotorController::MOTOR_STATUS PusiController::init()
{
return NO_FEATURE;
}
MotorController::MOTOR_... | true |
6d6658a1fac91814bdd5f7f6d6126b78ce236e94 | C++ | getov/TopCoder | /TopCoder SRM solutions/SRM 238 DIV 2 Level One (250)/ArrayHash.cpp | UTF-8 | 800 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class ArrayHash
{
public:
int getHash(vector<string>);
};
int ArrayHash::getHash(vector<string> input)
{
int hash = 0;
for (int i = 0; i < input.size(); ++i)
{
for (int j = 0; j < input[i].size(); ++j)
{
... | true |
d22b9e14d7f92910b0d37476118eff934479fd1a | C++ | zhangscth/Tflite | /gemm_support.h | UTF-8 | 1,485 | 2.625 | 3 | [] | no_license | #ifndef TENSORFLOW_CONTRIB_LITE_KERNELS_GEMM_SUPPORT_H_
#define TENSORFLOW_CONTRIB_LITE_KERNELS_GEMM_SUPPORT_H_
#include "gemmlowp.h"
#include "context.h"
namespace tflite {
namespace gemm_support {
// Returns the GemmContext stored in 'context', allowing multiple ops to
// share a single object, as long as they sha... | true |
94aaf5ed51fa248f6acd39137f9ccb3373b7cdbe | C++ | matheusmollon/ArduinoProjects | /CofreDigital/configuracao_cofre.ino | UTF-8 | 1,401 | 2.875 | 3 | [] | no_license | /* Projeto Confre digital simples
* Componentes: Display LCD 16X2, Teclado matricial 4X3, Buzzer e led RGB.
* Autor: Matheus Fernando Mollon
* Data: 16/02/2016
* Versão: 1.0
* Observações: este código é open-source. Logo, é permitido sua utilização e alteração,
* sendo proibida venda deste projeto ou par... | true |
ebb6de93a9f0119ee8f644469d240aae973d993c | C++ | LiuXiahong/test | /c++/src/树状数组/tree.cpp | UTF-8 | 378 | 2.828125 | 3 | [] | no_license | #include<stdio.h>
int n;
int a[100];
int c[100];
int lowbit(int i)
{
return i&(-i);
}
int sum(int m)
{
int s=0;
while(m>0)
{
s+=c[m];
m-=lowbit(m);
}
return s;
}
void update(int i,int value)
{
while(i<=n)
{
c[i]+=value;
i+=lowbit(i);
}
}
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf... | true |
89442a1208d06d06cbad44f00b5711920524250c | C++ | Athorcis/athorrent-backend | /include/TorrentManager.h | UTF-8 | 1,708 | 2.515625 | 3 | [] | no_license | #ifndef TORRENT_MANAGER_H
#define TORRENT_MANAGER_H
#include <libtorrent/session.hpp>
#include <string>
#include <vector>
class AlertManager;
class ResumeDataManager;
class TorrentManager
{
public:
TorrentManager(const std::string & port);
void createTorrent(const libtorrent::torrent_handle... | true |
662de39325fe4db8375d529e461ed35afd539cbb | C++ | Koutarouu/CPP-Codes | /Poo5.cpp | ISO-8859-2 | 1,581 | 3.84375 | 4 | [] | no_license | //Crear un programa que tenga la siguiente jerarquia de clases y hacer polimorfismo con el mtodo comer()
#include<iostream>
#include<stdlib.h>
using namespace std;
class Animal{
private:
string nombre;
int edad;
public:
Animal(string,int);
virtual void comer();
};
class Humano : public Animal{
private:
... | true |
00b3b331100df53fced7304dae9ad1216f4d6fc6 | C++ | Opehline/CPP_V2 | /Basiskurs Hausaufgabendateien/HA2_Praepozessorzeug.cpp | WINDOWS-1252 | 1,387 | 3.59375 | 4 | [] | no_license | // Tanja TTreffler
// Hausaufgabe von Dienstag
// Aufgaben aus ppt
/*
+ Ein Programm schreiben das typedef, const, Schalter und auto enthlt.
+ Es soll zwei float Zahlen multiplizieren: x=a*b;
+ Die Faktoren sollen mit gleitkommazahl deklariert werden: gleitkommazahl a, b;
+ Das Resultat soll durch auto bestimmt sein:... | true |
4e3f4301eedded5c2c1079ae8d1869bcf7802f6a | C++ | bericp1/csci-1300-assignment10-create-a-world | /foreground_map_plot.cpp | UTF-8 | 540 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "foreground_map_plot.h"
// Forward to ForegroundMapPlo::pull_from_file
ForegroundMapPlot::ForegroundMapPlot(std::ifstream& file_stream) {this->pull_from_file(file_stream);}
void ForegroundMapPlot::pull_from_file(std::ifstream& file_stream){
// Read the next line from the stream and store it as the type
... | true |
ab99367f628c82edc152e2a2274d59855d89881d | C++ | 98teg/LearningOpenGL | /Ep22-23-24/tests/TestTexture2D.hpp | UTF-8 | 1,727 | 2.609375 | 3 | [] | no_license | #include "Test.hpp"
#include "../Texture.hpp"
#ifndef TESTTEXTURE2D_HPP
#define TESTTEXTURE2D_HPP
namespace test{
class TestTexture2D: public Test{
private:
glm::vec3 TranslationA;
glm::vec3 TranslationB;
glm::mat4 Proj;
glm::mat4 View;
Shader ThisShader;
VertexArray* Vertex_array;
VertexBuf... | true |