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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ede9c1020014db9063ce9c78eac3eea7b83654b6 | C++ | dongyangli1226/problem_solving | /algorithms/nextGreaterElement.cpp | UTF-8 | 1,636 | 4.625 | 5 | [] | no_license | //given an array, output next greater element for each item in array
// if no next greater element, print -1 for that element
/* algorithm from geeksforgeeks
1) Push the first element to stack.
2) Pick rest of the elements one by one and follow following steps in loop.
….a) Mark the current element as next.
….b) If s... | true |
8100722ad7608f4b3d360ced5f04136e5f7ffa7f | C++ | aleksandrpetushkov/mapb | /mapb/elem.h | WINDOWS-1251 | 1,694 | 3.609375 | 4 | [] | no_license | #include <cstddef>
template <class T1, class T2>class elem //
{
public:
elem(T1 const &key) //
{
_key = key;
}
void set(T1 const &key, T2 const &val) //
{
_key = key;
_val = val;
}
void set(T1 const &key) //
{
_key = key;
}
T2& get_val()//
{
return _val;
}
T1 get_key() //
{
r... | true |
f23abf2ead100cb5f31fc4d2581ca028fe3a8cf2 | C++ | qanyue/code | /backup/Circle.cpp | UTF-8 | 556 | 3.6875 | 4 | [] | no_license | #include <iostream>
using namespace std;
class circle
{
public :
double radius {1};
circle ()
{
radius=1.0;
cout << radius << endl;
}
circle(double newRadius)
{ cout <<" I am coming"<< radius<<"##"<< newRadius<<endl;
radius = newRadius;
cout <<" I am coming"<< radius<<"##"<< newRadius<<endl;
}
... | true |
e7a5b01a4e645cef4b3fda2c76ad01838c5d810d | C++ | tshabc/VSprojects | /operator/operator/main.cpp | GB18030 | 1,245 | 3.484375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
using namespace std;
class compe
{
public:
compe(int a, int b);
~compe();
void outPut()
{
cout << "result = " << x << "+" << y << endl;
}
compe(const compe &c)
{
this->x = c.x;
this->y = c.y;
... | true |
c8e1c74f1917c04dfded48bac091d514adcb9b2f | C++ | naresh9949/Algorithms | /Rabin-Karp.cpp | UTF-8 | 834 | 3.078125 | 3 | [] | no_license | #include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int Hash_Code(string s,int m,int n)
{
int valu=0;
for(int i=0;i<=n;i++)
{
valu+=((int(s[i]))*pow(3,i));
}
return valu;
}
bool Is_same(string Main,int s,int e,string Sub,int l)
{
int x,y;
for(x=s,y=0;x<=e && y<l;x++,y++)
{
if(Main[x]!... | true |
e0a5c3edfde04a5975afd826544a357bfa34b299 | C++ | zixuan-zhang/leetcode | /036_valid_soduku.cpp | UTF-8 | 6,152 | 3.421875 | 3 | [] | no_license | /*******************************************************************************
* @File : 036_valid_soduku.cpp
* @Author: Zhang Zixuan
* @Email : zixuan.zhang.victor@gmail.com
* @Blog : www.noathinker.com
* @Date : 2015年10月31日 星期六 19时03分47秒
****************************************************************... | true |
265706fb8919674f9c779524dda185adcc7e20ad | C++ | Crizj/OJpractice | /leetcode/challenge/April LeetCoding Challenge 2021/Verifying an Alien Dictionary.cpp | UTF-8 | 913 | 3.515625 | 4 | [] | no_license | #include<iostream>
#include<string>
#include<queue>
#include<vector>
using namespace std;
class Solution
{
public:
bool isAlienSorted(vector<string>& words, string order)
{
for(int i = 0; i+1 < words.size(); i++)
{
string a = words[i], b = words[i+1];
int j = 0;
... | true |
9583edb15ae32e5bc3271368d26f30956d096ba0 | C++ | xumenger/xumenger.github.shit | /practice-曾经的练习程序/book/006《面向对象的程序设计--C++描述》/1/007.cpp | UTF-8 | 573 | 3.1875 | 3 | [] | no_license | #include"TimeStamp.h"
void dumpTS(const TimeStamp& );
int main(){
TimeStamp ts;
time_t now = time(0);
ts.set();
dumpTS(ts);
ts.set(now+200000);
dumpTS(ts);
ts.set(now-200000);
dumpTS(ts);
ts.set(-999);
dumpTS(ts);
return 0;
}
void dumpTS(const TimeStamp& ts){
cout<<"\nTesting method:\n";
cout<<'\t'<<ts.g... | true |
4c318815a728a3a5bc12b3c55aadd396404fff0b | C++ | toiinnn/Programming-Language-I | /2th_Laboratory/src/company_manager/main.cpp | UTF-8 | 1,870 | 3.796875 | 4 | [] | no_license | /**
* @file main.cpp
* @brief Main function for Company Manager.
* Shows a menu to the user while he does not decide to quit.
* @author Lucas Gomes Dantas (dantaslucas@ufrn.edu.br)
* @since 02/09/2017
* @date 02/09/2017
*/
#include "company_manager/manage_company.h"
#include <iostream>
/**
... | true |
826acef1504c0d96e0a50ab721f67eb709e51b55 | C++ | scsampath/lab06_sampath_sachen | /CustomItem.cpp | UTF-8 | 1,455 | 3.46875 | 3 | [] | no_license | //Created by Sachen Sampath, CS32, 5/14/2020
#include <iostream>
#include <sstream>
#include <iomanip>
#include "CustomItem.h"
using namespace std;
CustomItem::CustomItem(string size) : IceCreamItem(size){
if(size == "small"){
price = 3.00;
}
else if(size == "medium"){
price = 5.00;
... | true |
b750920b60df5c20603f98a3a4bb01a1abfe7a18 | C++ | aydinsimsek/HackerRank-problem-solving | /Algorithms/Greedy/Maximum_Perimeter_Triangle.cpp | UTF-8 | 2,864 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
bool nonDegenerate(int a, int b, int c)
{
if(a+b>c && a+c>b && b+c>a)
{
return true;
}
return false;
}
vector<int> maximumPerimeterTriangle(vector<int> sticks) {
vector<int> result;
ve... | true |
c78e795ad073c165c48db000ae66bc50f21f65a2 | C++ | nilam23/DataStructures_Algorithms | /Maths/mod_Inverse_Naive.cpp | UTF-8 | 467 | 3.40625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int getGCD(int a, int b){
return (b ? getGCD(b, a%b) : a);
}
int getMMI(int a, int p){
//a = a % p;
for(int x = 1; x < p; x++){
if((a * x) % p == 1)
return x;
}
}
int main(){
int a, p;
cout << "Enter a: ";
cin >> a;
cout << "Enter p: ";
cin >> p;
int gcd = getGCD(a... | true |
f4ee1dd36e7692e9afa5671118023a3e19815a4f | C++ | cuicp/USACO | /Chapter3/商店购物(dfs只能过9个点版).cpp | GB18030 | 3,406 | 2.765625 | 3 | [] | no_license | /*
ID:cuichengpeng
PROG:shopping
LANG:C++
*/
#include<iostream>
#include<fstream>
#include<vector>
using namespace std;
const int INF=10000000;
const int M=5;
int cost[M][M][M][M][M];
bool can(vector<vector<int> >&need,vector<vector<int> >&yh,int k);
bool can(vector<vector<int> >&need,vector<vector<int> >&... | true |
c1d061d64f8e9af812e7493fae5d158ce939359e | C++ | Dx724/Instrument-Mini | /ESP32/InstrMini_Input/InstrMini_Input.ino | UTF-8 | 1,013 | 3.21875 | 3 | [] | no_license | #define analogCount 2
#define digitalCount 4
#define totalCount (analogCount + digitalCount)
int analogPins[analogCount] = {13, 12}; // Joystick X, Joystick Y
int digitalPins[digitalCount] = {14, 33, 18, 19}; // Joystick Z, Switch and two Buttons
// Note that the switch can only be in two states, so we can determine t... | true |
ed98d2d4fea47fba0ca0984bdf2228669519ebd0 | C++ | ComnHomeAce/Displaying-a-Square-of-Asterisks | /Displaying a Square of Asterisks/Displaying a Square of Asterisks.cpp | UTF-8 | 663 | 4.28125 | 4 | [] | no_license | //This program prints a square of user-defined size
#include <iostream>
using namespace std;
char squareOfAsterisks(int side)
{
//Loop for printing each line
for (int i = 0; i < side; i++)
{
//Loop for printing the asterisks
for (int j = 0; j < side; j++)
{
cout << "* "... | true |
2f3bf3497650c7f915e1b7e6949674a882401584 | C++ | tarpeyd12/thread_pool | /pool/future.inl | UTF-8 | 836 | 2.984375 | 3 | [] | no_license | #ifndef POOL_FUTURE_INL_INCLUDED
#define POOL_FUTURE_INL_INCLUDED
#include <utility>
namespace tpl
{
template < typename T >
future< T >::future( std::future< T >&& f )
: _future( std::move( f ) ), block_on_destruction( true )
{
/* */
}
template < typename T >
future< T >::... | true |
214f142aeb61b3e11d0307bcb94e9a57a68d6531 | C++ | ulinka/tbcnn-attention | /github_cpp/14/98.cpp | UTF-8 | 5,318 | 2.765625 | 3 | [] | no_license |
#ifndef DPP_RADIX_SORT_HH_
#define DPP_RADIX_SORT_HH_
#include <algorithm>
#include <limits>
#include <stdint.h>
namespace dpp {
template <typename X, size_t bits>
struct radix_sort_type
{
static unsigned int extract(const X x, size_t pos)
{
X::_requires_8bits_radix_width_for_custom_types... | true |
f6a32f9e04ddd69a0bea61073fa51abe19c3f1e1 | C++ | Eastonco/CS122 | /PA4_Fitness/PA4/ExercisePlan.h | UTF-8 | 445 | 2.640625 | 3 | [] | no_license | #include "Header.h"
#ifndef EXERCISEPLAN
#define EXERCISEPLAN
class ExercisePlan
{
public:
ExercisePlan();
~ExercisePlan();
ExercisePlan(ExercisePlan &rhs);
int getGoal();
string getName();
string getDate();
void setGoal(int newGoal);
void setName(string newName);
void setDate(string newDate);
void editGoa... | true |
ba6965b2e92dbb0323bc72b78281291d0d941091 | C++ | spidersharma03/spider3d | /Engine/include/scene/sceneNodes/TextureProjectorNode.h | UTF-8 | 1,683 | 2.515625 | 3 | [] | no_license | #ifndef _TEXTURE_PROJECTOR_NODE_H
#define _TEXTURE_PROJECTOR_NODE_H
#include "Node.h"
#include "MeshNode.h"
#include "TextureUnitState.h"
#include "NodeAnimator.h"
#include <map>
namespace spider3d
{
namespace effects
{
class TextureProjector;
}
}
using namespace spider3d::effects;
namespace... | true |
2626ebe490cf59cb8940d14628e26415e4ea8743 | C++ | px1099/CS2040C-C-files | /CS2040C/Week 3/PS1_AB.cpp | UTF-8 | 670 | 2.84375 | 3 | [] | no_license | #include <bits/stdc++.h>
#define MAXSIZE 3000
using namespace std;
void sortArray (unsigned long long a[], int i) { // O(N)
unsigned long long temp = a[i];
while (a[i-1]>temp && i>0) {
a[i] = a[i-1];
i--;
}
a[i] = temp;
}
unsigned long long median(unsigned long long a[], int n) { // O(1)
if (n%2)
return a[... | true |
ced93dc141dcf4eb1e41fcf8b036bb4178bfa9c3 | C++ | syruphanabi/multi-bit-adder-simulation | /Graph.cpp | UTF-8 | 7,759 | 2.890625 | 3 | [] | no_license | #include "Graph.hpp"
#include "Event.hpp"
#include <iostream>
using namespace std;
Graph::Graph(int ID, queue<Event*> *ia, queue<Event*> *ib, queue<Event*> *ic, queue<Event*> *oc, queue<Event*> *os):graphID(ID) {
//initialize and push all GNodes in to the nodes
GraphMaker();
//init
set();
inputA = ia;
inputB ... | true |
2f3cff265315e9f48c559739b6d25ad997c13ada | C++ | reckhhh/LeetCodeSolutons | /C++/79_WordSearch_Medium.cpp | UTF-8 | 1,836 | 3.71875 | 4 | [] | no_license | /*
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
For example,
Given board =
[
["ABCE"],
["SFCS... | true |
f0ee758d71464ffff03a14a2f6e5ad01da4c14fe | C++ | mayankamencherla/cracking-the-coding-interview-solutions | /object-oriented-design/jukebox.cpp | UTF-8 | 15,624 | 3.625 | 4 | [
"MIT"
] | permissive | /**
* Design a jukebox using object oriented principles
*/
#include <iostream>
#include <vector>
#include <limits>
#include <queue>
using namespace std;
class JukeBox;
class Song;
class CD;
class CDPlayer;
class Album;
class Artist;
class PlayList;
class Artist
{
private:
/**
* Name of the ar... | true |
a855b7708edc1e2d9c762c4d989e9157a269fe0b | C++ | huangzongwu/F2Native | /core/graphics/scale/Category.h | UTF-8 | 6,314 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef XG_GRAPHICS_SCALE_CAT_H
#define XG_GRAPHICS_SCALE_CAT_H
#include "graphics/scale/Scale.h"
#include "utils/common.h"
#include <WilkinsonExtended/WilkinsonExtended.h>
#include <iterator>
#include <math.h>
#include <string>
#include <unordered_map>
using namespace std;
namespace xg {
namespace scale {
/**
* ... | true |
3d91688122be66ec35036ecebab7bab35b82fd56 | C++ | dalek7/umbrella | /MFC/MathDisp/MathJS/MathJS/lib/PTRList.cpp | UTF-8 | 6,774 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "PTRList.h"
#include <string.h>
CPTRList::CPTRList()
{
pTop = pEnd = pCur = NULL;;
nCurrent= -1;
nMax = 0;
}
CPTRList::~CPTRList()
{
RemoveAll2();
}
void CPTRList::AddTail( void *pData )
{
PTR_BLK *pNew = new PTR_BLK;
pNew->pData = pData;
pNew->pNext = NULL;... | true |
941ef4d487d01426ab6c7668d109fdc24363dc2a | C++ | ThomasvanBommel/matrix-transpose | /src/Matrix.h | UTF-8 | 443 | 2.765625 | 3 | [] | no_license | /**
* @author Thomas vanBommel
* @since 01-08-2021
*/
#ifndef MATRIX_H_
#define MATRIX_H_
#include <iostream>
using namespace std;
class Matrix {
public:
Matrix(int, int, double=0.0, double=0.0);
void transp();
double & operator () (int, int);
friend ostream & operator << (ostream &, Matrix &);... | true |
a57c37e445f576bd76a2584dec41e28648b3a719 | C++ | vajanko/Algorithms | /Homeworks/08. semester/Levenshtein/Levenshtein/main.cpp | UTF-8 | 12,031 | 3.265625 | 3 | [] | no_license | #include <string>
#include <sstream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <omp.h>
#include <climits>
typedef int size_type;
void generate(const char* filename, size_type count, int seed)
{
FILE* f = fopen(filename, "wb");
if (!f) return;
srand(seed);
while (count--... | true |
9bbc40d622252617d117d1df26cb6c7ff71b64d1 | C++ | jxzhsiwuxie/cppPrimer | /chap09/exercises/ex_9.14.cpp | UTF-8 | 1,026 | 4.25 | 4 | [] | no_license | //练习 9.14:编写程序,将一个 list 中的 char * 指针(指向 C 风格字符串)元素赋值给一个 vector 中的 string。
#include <iostream>
#include <list>
#include <string>
#include <vector>
using std::cout;
using std::endl;
using std::list;
using std::string;
using std::vector;
int main() {
list<const char*> cStrList = {"abc", "fed", "ihj"};
cout << ... | true |
16396e3831abb3b5ccf998fb81230bf151f31e99 | C++ | nevyn/OverAnimate | /OverAnimate.cpp | UTF-8 | 2,773 | 2.890625 | 3 | [] | no_license | #include "OverAnimate.h"
Animation::
Animation(TimeInterval duration, bool repeats) :
beginTime(0),
duration(duration),
scheduled(0),
enabled(1),
repeats(repeats)
{
}
void
Animation::
animate(
float absoluteTime
) {
}
#pragma mark -
BoundFunctionAnimation::
BoundFunctionAnimation(
Anim... | true |
a3b1dece4e4b4233da26857cb01d4b25d95cc153 | C++ | shivang99/Data-Structures | /Hash Table/HashTable.cpp | UTF-8 | 2,940 | 3.109375 | 3 | [] | no_license |
#include "HashTable.h"
template <typename DataType, typename KeyType>
HashTable<DataType, KeyType>::HashTable(int initTableSize)
{
tableSize = initTableSize;
dataTable = new BSTree<DataType, KeyType>[tableSize];
}
template <typename DataType, typename KeyType>
HashTable<DataType, KeyType>::HashTable(c... | true |
e2b08eabdd947eab5e32bc019ba6a15482ca8fd8 | C++ | LhdDream/kiosk_key_value | /my_simple_storage/util/bloom_filter.h | UTF-8 | 2,115 | 2.921875 | 3 | [] | no_license | #ifndef MY_SIMPLE_STORAGE_BLOOM_FILTER_H
#define MY_SIMPLE_STORAGE_BLOOM_FILTER_H
#include <vector>
#include "hash.h"
// this file create bloom
// bloom 过滤器表示如果不在这个集合之中,则说明不在,在这个集合之后,实时不一定在这个集合之中
// bloom 参考leveldb 的实现方式来进行实现
class bloom {
public:
explicit bloom() : m_bits_per_key(0), m_h(0) {
}
void Ad... | true |
bfd4683b20b2fb140c171f41e1a187defd7129eb | C++ | MF1523017/interview | /nowcoder/offer/offerCoder0321/common/common/perfect_world.h | GB18030 | 1,385 | 3.296875 | 3 | [] | no_license | #pragma once
#if 0
//ڶ
#include<iostream>
#include<vector>
#include<string>
#include<sstream>
#include<algorithm>
using namespace std;
vector<int> split(string &s, char flag = ' ')
{
vector<int> res;
replace(s.begin(), s.end(), flag, ' ');
int n;
istringstream tmp(s);
while (!tmp.eof())
{
tmp >> n;
if (n)
... | true |
3ac925be2ec197171bbd55eb4358dfc1bdc72ac3 | C++ | a995049470/Zero | /LibMerge/BitHelp.h | UTF-8 | 315 | 3.140625 | 3 | [] | no_license | #pragma once
class BitHelp
{
public:
static int GetTargetBit(int i, int pos)
{
int res = (i >> (pos - 1)) & 1;
return res;
}
static void SetTargetBit(int& i, int pos, int value)
{
if (value == 1)
{
i = i | (1 << (pos - 1));
}
else if (value == 0)
{
i = i & ~(1 << (pos - 1));
}
}
};
| true |
57245523d6727d1b27e3c0345e78b7ddf25e7c0d | C++ | artdevar/Photo-editor | /src/Converter.cpp | UTF-8 | 1,559 | 3.078125 | 3 | [] | no_license | #include "Converter.h"
#include <algorithm>
#include <cmath>
#include <QtGlobal>
void Converter::rgbToHsv(float r, float g, float b, float * h, float * s, float * v)
{
static const float modifier = 1.0f / 255.0f;
r *= modifier;
g *= modifier;
b *= modifier;
const std::initializer_list<float> list{... | true |
72aa9bbdfc8d8a8090f1d6dccb9b4c655bf8057d | C++ | 025georgialynny/code_ex | /pa3.cpp | UTF-8 | 423 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
using namespace std;
#include "largeIntegers.h"
int main()
{
largeIntegers num1;
largeIntegers num2;
cin >> num1;
cin >> num2;
cout << "num1: " << num1 << endl;
cout << "num2: " << num2 << endl;
cout << "num1 + n... | true |
481c0393cb57df3deb6d71b84d7f32d6e1b4a930 | C++ | john-waczak/homeworkRepo | /cs_162/labs/lab6/application.cpp | UTF-8 | 692 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "shape.h"
#include "rectangle.h"
#include "circle.h"
#include "square.h"
using namespace std;
int main(){
Shape s1 = Shape("Box", "Blue");
cout << s1.get_name() << endl;
cout << s1.get_color() << endl;
cout << s1.area() << endl;
Rectangle r1 = Rectangle(5.0... | true |
bb0c6d6e794fe2ced9eff4f2058944481a0164e4 | C++ | king1991wbs/leetcode | /uniqueBST2.cpp | UTF-8 | 1,261 | 3.75 | 4 | [] | no_license | /*
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
*/
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
// Definition for binary tree
struct TreeNode {
... | true |
0d2c5b0b7e5d75c0f9b0b53bdb59c7e7ca382fe0 | C++ | qqdkg/data-structer_learning-demo | /Helper/OfferSword.h | GB18030 | 465 | 2.78125 | 3 | [] | no_license | #pragma once
// 2021-09-06_ָoffer
// 3еظ
// һΪn飬ÿһֶڷΧ0n-1֮䣬Ҫҵһظ
class Prob_3_UniNum {
public:
// ʹʵּĹϣ汾
// ʱ临ӶO(1)
// ռ临ӶO(n)
bool findUniNum_hash(int numbers[], int n, int& duplication);
//
void testUniNum( );
};
| true |
c7b33ebd74eac348ea903695585f82b83a05d69a | C++ | yqian1991/codefactory | /program/WebSearch/main.c | UTF-8 | 5,047 | 2.640625 | 3 | [] | no_license | #include <stdio.h>
#include <windows.h>
#include <wininet.h>
#include <assert.h>
#ifdef ERROR
#undef ERROR
#endif
#define U8 unsigned char
#define U32 unsigned int
#define STATUS unsigned int
#define OK 0
#define ERROR (~0L)
#define MAX_BLOCK_SIZE 1024
#define MAX_DOMAIN_NAME_LENGTH 64
#define MAX_THREAD_NUMBER (8)
... | true |
747524bc4700b79e53962b6eb54f6ea00a8ae1a1 | C++ | lxyu0405/leetcode-pratice | /valid_perfect_square/Solution.cpp | UTF-8 | 656 | 3.3125 | 3 | [] | no_license | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
bool isPerfectSquare(int num) {
if (num == 1) {
return true;
}
long long lowerBound = 1, upperBound = num;
// binary search
while (lowerBound < upperBound-1) {
long l... | true |
99953a32a0feb3bee21f361bc528ced208879dbd | C++ | rodety/OpticalManager | /rangomedida.cpp | UTF-8 | 5,925 | 2.953125 | 3 | [] | no_license | #include "rangomedida.h"
#include <QDebug>
#include <QSqlQueryModel>
#include <QSqlRecord>
#include <QSqlError>
RangoMedida::RangoMedida(int _id,double _valorIni,double _valorFin, QString _descripcion)
{
id=_id;
valorini=_valorIni;
valorfin=_valorFin;
descripcion = _descripcion;
}
RangoMedida::RangoM... | true |
39a859a4c554197f19ff32c0c9fe356d85043e4f | C++ | IsAyka1/FuncLab | /FuncBdAndLabs/child.h | UTF-8 | 325 | 2.5625 | 3 | [] | no_license | #pragma once
#include "man.h"
#include <string>
class Child : public Man
{
private:
bool m_IsTwins;
public:
Child(const std::string& in_FirstName, const std::string& in_LastName, const std::string& in_Partonymic,
std::size_t in_Year, bool in_bGender, std::size_t in_Salary, bool in_IsTwins);
bool IsTwins() cons... | true |
59c1bb7fa88ff3e78b0ce3536ca755da4968b958 | C++ | conglb/Operating-System-lab | /multiprocessing/main.cpp | UTF-8 | 341 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
using namespace std;
int main() {
int value1, value2;
// what happend if double fork()
// we have 4 processes
value1 = fork();
value2 = fork();
// print pid
printf("In main: value1 = %d\n value2 = %d\n pid = %d, parent_pid = %d\n", value1, value2, getpid(), getpp... | true |
634661106d84c3520bd7c77016678aa5057900b1 | C++ | liuyouzhao/kenan | /app/src/main/cpp/util/webgl/Int16Array.cpp | UTF-8 | 1,158 | 2.71875 | 3 | [] | no_license | #include "Int16Array.h"
#include "defines.h"
#undef LOG_TAG
#define LOG_TAG "Int16Array"
namespace DCanvas
{
Int16Array* Int16Array::create(unsigned int length)
{
return ArrayType<short>::create<Int16Array>(length);
}
Int16Array* Int16Array::create(const short* array, unsigned int length)
{
return ArrayT... | true |
33ef89ceb391710084fe9e0ee579a077b176137d | C++ | DuyTran1234/1000ExerciseC- | /Chuong 8 - Truu tuong hoa du lieu/bai577.cpp | UTF-8 | 703 | 3.078125 | 3 | [] | no_license | #include <iostream>
using namespace std;
void nhap(struct hinhCau &a);
void xuat(struct hinhCau a);
double dienTichXQ(struct hinhCau a);
struct hinhCau
{
int x;
int y;
int z;
int r;
};
int main()
{
hinhCau dcm;
nhap(dcm);
cout<<"Sxq = "<<dienTichXQ(dcm)<<endl;
}
void nhap(struct hinhCau &a)
{
... | true |
67229505ad13f4910c4f899bceb6aadf19db27f3 | C++ | Updownquark/DISEnumerations | /src/main/cpp/disenum/ModelType.cpp | UTF-8 | 1,565 | 3.28125 | 3 | [
"BSD-2-Clause"
] | permissive | #include <sstream>
#include <cstddef>
#include <disenum/ModelType.h>
namespace DIS {
hashMap<int,ModelType*> ModelType::enumerations;
ModelType ModelType::MISSING_DESCRIPTION(0, "Missing Description");
ModelType::ModelType(int value, std::string description) :
Enumeration(value, description)
{
enumerations[va... | true |
f3dfb73f3e23d3d51fd624d4217bd9048c4ffd93 | C++ | JooYoung1121/CodingTest_Algorithm | /리트코드/single_number.cpp | UTF-8 | 290 | 2.6875 | 3 | [] | no_license | class Solution {
public:
int singleNumber(vector<int>& nums) {
map<int,int> num_cnt;
for(auto num : nums){
num_cnt[num]++;
}
for(auto nc : num_cnt){
if(nc.second == 1) return nc.first;
}
return 1;
}
}; | true |
d9182185a9b5417de99aa89e0968a66267327bcc | C++ | silviavn10/Trabajo-de-Informatica | /XtremETSIDI/XtremETSIDI/src/ListaPlataformas.cpp | ISO-8859-1 | 1,339 | 3.28125 | 3 | [] | no_license | #include "ListaPlataformas.h"
ListaPlataformas::ListaPlataformas(void)
{
numero = 0;
lista = new Plataformas * [MAX_PLATAFORMAS]; // reserva memoria dinmicamente para vector lista con una dimension maxima de MAX_PLATAFORMAS
}
void ListaPlataformas::Dibuja()
{
for (int i = 0; i < numero; i++)
lista[i]->Dibuja... | true |
0b7f28eeba041db52cb84be7c11f18d360112d6e | C++ | wuli2496/OJ | /学习资料/ACM推荐书目/Competitve Programming 3, Steven Halim/Code/ch3/ch3_04_Max1DRangeSum.cpp | UTF-8 | 762 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | #include <algorithm>
#include <cstdio>
using namespace std;
int main() {
int n = 9, A[] = { 4, -5, 4, -3, 4, 4, -4, 4, -5 }; // a sample array A
int running_sum = 0, ans = 0;
for (int i = 0; i < n; i++) // O(n)
if (running_sum + A[i] >= 0) { // the overall running sum... | true |
ba691b52440f68096ff01d527c07a06c6fc696f4 | C++ | ericgtkb/design-patterns | /C++/FactoryMethod/GuitarFactory/guitar_factory.cc | UTF-8 | 861 | 3.125 | 3 | [] | no_license |
#include "guitar_factory.h"
std::unique_ptr<Guitar> GuitarFactory::get_guitar(const std::string& type) const {
std::unique_ptr<Guitar> guitar {build_guitar(type)};
guitar->assemble();
guitar->string_the_guitar();
return std::move(guitar);
}
std::unique_ptr<Guitar> GibsonFactory::build_guitar(const ... | true |
a4816ec15bb577358c003f204e8a3f96a89a4c94 | C++ | williamrosser/CS2150 | /Lab4/bitCounter.cpp | UTF-8 | 457 | 3.34375 | 3 | [] | no_license | /*Maddie Stigler
*mgs4ff
*9/25/14
*bitCounter.cpp
*/
#include <cstdlib>
#include <iostream>
using namespace std;
int bitCount(int n) {
if(n == 1) {
return 1;
}
return (n%2) + bitCount(n/2);
}
int main(int argc, char *argv[]) {
if(argc == 0) {
cout<< "I am going to exit gracefully..." <<endl;
... | true |
d981e5da7eba22b7c208782a494361e797f96f64 | C++ | sep-inc/campus_202009_matsui | /Minigame/Sor/Scene/Shougi/SyougiGameController.h | UTF-8 | 2,328 | 2.875 | 3 | [] | no_license | #ifndef SYOUGI_GAMECONTROLLER_H_
#define SYOUGI_GAMECONTROLLER_H_
#include "Object/Player/SyougiPlayer.h"
#include "Object/SyougiBoard.h"
#include "Object/SyougiPiece.h"
#include "Object/SyougiCursor.h"
#include "../../Utility/Vec2.h"
#include "../GameControllerBase.h"
class SyougiGameController :public GameControll... | true |
526dbebef609eb720c016c216956a68f5a9b6846 | C++ | tastest/CMS2 | /NtupleMacros/WZRatio/Looper.h | UTF-8 | 6,898 | 2.609375 | 3 | [] | no_license | // -*- C++ -*-
#ifndef LOOPER_H
#define LOOPER_H
#include "Tools/LooperBase.h"
#include "Math/LorentzVector.h"
typedef ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > LorentzVector;
// List of all cuts that can be applied. The cuts are handled as a
// bitfield; these labels define which bit corresponds t... | true |
86ddbda03a67636fe582ca7b8854aca52b763a64 | C++ | hoangannguyen26/simple_interpreter | /include/parser.h | UTF-8 | 959 | 2.515625 | 3 | [] | no_license | #ifndef PARSER_H
#define PARSER_H
#include "lexer.h"
#include "nodevisitor.h"
#include "Ast/ast.h"
#include "Ast/literal.h"
#include <string>
#include <vector>
class Parser
{
public:
explicit Parser(const LexerPtr &lexer);
ASTPtr parse();
private:
bool m_exitFromBlock;
const LexerPtr m_lexer;
To... | true |
dddfcc4cddf57a77c59d7b50653af30a63d5b2f6 | C++ | Heihuang/workspace | /3288/Shell/src/message/recvmessagemq.cpp | UTF-8 | 2,540 | 2.546875 | 3 | [] | no_license | #include "recvmessagemq.h"
#include <string>
#include <vector>
namespace rr
{
BaseRecvmessageMQ::BaseRecvmessageMQ() :consumer_(NULL), mqfactory_(NULL), thread_flag_(false), thread_id_(NULL), dev_id_(""), dev_update_(NULL)
{
}
BaseRecvmessageMQ::~BaseRecvmessageMQ()
{
}
void BaseRecvmessag... | true |
ae26a82b5635bc13e6642844c4cc69c0cecd5723 | C++ | l3370x/byu-cs360-webserver-lx | /handler.cc | UTF-8 | 11,781 | 2.921875 | 3 | [] | no_license | #include "handler.h"
Handler::Handler(Config c, bool sD) {
cfg = c;
showDebug = sD;
}
Handler::~Handler() {}
#define MAX_MSG_SZ 1024
// Determine if the character is whitespace
bool isWhitespace(char c)
{
switch (c)
{
case '\r':
case '\n':
case ' ':
case '\0':
return true;
default:
return fal... | true |
3862a6455ccb190e5c74be5390afc65d4e4c8d30 | C++ | ArighnaIITG/Placement_Materials | /Binary Search/Fixed_Point.cpp | UTF-8 | 749 | 3.8125 | 4 | [
"Apache-2.0"
] | permissive | /*
Objective: Given a sorted array of distinct integers, Find the Magic index or Fixed point in the array.
Magic Index or Fixed Point: Magic index or a Fixed point in an array is an index i in the array such that A[i] = i.
Example :
int[] A = { -1, 0, 1, 2, 4, 10 };
Magic index or fixed point is : 4
*/
/* Solution... | true |
411a0757e66207672cbfdaa689f3c5ad89f36ce8 | C++ | BetaJester/binaryizer | /include/bj/binaryizer/traits_n_concepts.hpp | UTF-8 | 3,406 | 2.640625 | 3 | [
"MIT"
] | permissive | // Copyright (C) 2021 Glenn Duncan <betajester@betajester.com>
// See README.md, LICENSE, or go to https://github.com/BetaJester/binaryizer
// for details.
#pragma once
#include <type_traits>
#include <cstddef>
#include "settings.hpp"
namespace bj::inline v1{
class ibinaryizer;
class obinaryize... | true |
f8a16aafeea19b64814e1ef7446febba6a66cc2a | C++ | liuq901/code | /Ural/ur_1024.cpp | UTF-8 | 557 | 2.734375 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
int a[1001];
int main()
{
int work(int),gcd(int,int);
int n;
scanf("%d",&n);
for (int i=1;i<=n;i++)
scanf("%d",&a[i]);
int ans=1;
for (int i=1;i<=n;i++)
{
if (!a[i])
continue;
int len=work(i);
ans=ans/gcd(ans,len)*len;
}
pr... | true |
7ff9e6b38e2a35cbf030d018dd3cca00ea324a67 | C++ | kartiklakhotia/addonAHIR | /appSide_testCodes/pcie/pcie_speeds.cpp | UTF-8 | 2,393 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include "timer.h"
#include <riffa.h>
using namespace std;
fpga_t * fpga;
int beginSend = 0;
int beginRecv = 0;
int end = 0;
int numWords = 8388608*2;
void * sender_fxn(void *)
{
unsigned int * sendbuf;
GET_TIME_INIT(2);
sendbuf ... | true |
3e9dc543fa5ebf576f3415393ae0691b182824b0 | C++ | chrishickey/LCR | /LCR/tests/DGraphTest.cc | UTF-8 | 5,511 | 2.796875 | 3 | [] | no_license | //#include "../../Graph/Graph.h"
#include "../Graph/DGraph.cc"
using namespace std;
using namespace graphns;
void test(bool a, int &testID)
{
if( a == true )
{
cout << "testID=" << to_string(testID) << " passed" << endl;
}
else
{
cout << "testID=" << to_string(testID) << " failed" ... | true |
5c26ab3463b1678f0a5dc767e0dcd288f93d1ad9 | C++ | Dorjsuren1015/Bodolgo | /tsifr_nemeh.cpp | UTF-8 | 330 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
long long calc(long long n){
if (n < 10)
return n;
return calc(n%10 + calc(n / 10));
}
int main() {
long long n;
while(true){
cin >> n;
if (n == 0)
exit(0);
cout << calc(n) << endl;
}
r... | true |
443365f00afa66a19718af2961dedc64d1d6650a | C++ | rlj1202/problemsolving | /baekjoon/1983_number_box/main.cpp | UTF-8 | 938 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int N;
int arr[2][402];
int zeros[2];
int dp[402][402][402];
int main() {
scanf("%d", &N);
for (int r = 0; r < 2; r++) {
int zero = 0;
for (int n = 1; n <= N; n++) {
int cur;
scanf("%d", &cur);
if (cur == 0) zero++;
else arr[r][n - zer... | true |
c697e090d1aeeee972aad7032b86dd17e87c9da4 | C++ | xuesongzh/cpp-basis | /3.类/04构造函数初始化列表.cpp | GB18030 | 1,430 | 3.890625 | 4 | [
"Apache-2.0"
] | permissive | #include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Time {
private:
int Hour;
int Minute;
int Second;
public:
explicit Time(int Hour, int Minute, int Second);
Time(int Hour);
};
Time::Time(int TemHour, int TemMinute, int TemSecond) : Hour(TemHou... | true |
d7f9fa0e874b1545de7f4cfe524dfc74b6cb3d25 | C++ | mysterypaint/Hmm2 | /src/3ds/Graphics.cpp | UTF-8 | 13,271 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "Graphics.hpp"
#include "../PHL.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../Resources.hpp"
PHL_Surface db = {0};
PHL_Surface backBuffer = {0};
PHL_Surface dbAlt = {0};
PHL_Surface backBufferAlt = {0};
const int cWidth = 320;
const int cHeight = 240;
Screen scrnTop = {
GF... | true |
24cbfa096d74fe922d4a428055193e3d74101ef3 | C++ | Loner0822/DataAnalysis | /CalcUnit.cpp | UTF-8 | 5,886 | 2.515625 | 3 | [] | no_license | #include "CalcUnit.h"
CalcUnit::CalcUnit() {
this->Calc_Id = 0;
this->Const_str = "";
this->Const_Nums.clear();
}
std::vector<int> Get_Bit_From_Input(long long value, int& pos, int& len) {
std::vector<int> res;
res.clear();
while (value) {
res.push_back(value & 1);
value >>= 1;
}
while (pos + 1 < len)
... | true |
c34ba53a51dc4f43393c2854903800d71c8dc8d1 | C++ | lowkeyway/Algorithm | /02_List/myList.h | UTF-8 | 3,597 | 3.5625 | 4 | [] | no_license | #ifndef __MY_LIST_H__
#define __MY_LIST_H__
#include <iostream>
#include <string>
#include "listNode.h"
using namespace std;
template <typename T>
class myList
{
public:
myList(int size);
~myList();
bool addTail(T &data);
bool outHead(T &data);
bool add(int index, T &data);
bool out(int index, T &data);
bo... | true |
806b3fe6ecd5bdc6e6abdff1a63c51481ce6437d | C++ | r0mai/tungsten | /ut/eval/builtin/TableTest.cpp | UTF-8 | 15,618 | 2.765625 | 3 | [] | no_license |
#include <boost/test/unit_test.hpp>
#include "Fixture.hpp"
BOOST_AUTO_TEST_SUITE( TableTest )
using namespace tungsten;
BOOST_FIXTURE_TEST_CASE( test_Table_of_x , BuiltinFunctionFixture ) {
boost::optional<ast::Node> result = parseAndEvaluate("Table[x]");
BOOST_REQUIRE( result );
BOOST_CHECK_EQUAL( *result,as... | true |
a153fd7aba25b11c964028a9d711b626ca97fc20 | C++ | greenfox-zerda-sparta/nmate91 | /week_08/12-15/03/03/03.cpp | UTF-8 | 439 | 3.625 | 4 | [] | no_license | #include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
unsigned int power_function(unsigned int base, unsigned int n) {
if (n == 0) {
return 1;
}
return base * power_function(base, n - 1);
}
int main() {
// Given base and n that are both 1 or more, compute recursively (no loops)
... | true |
821ac71494c2fa2626bcfcde6e288f2725dcf697 | C++ | et2372584/EdgarTrujilloSanchez_CSC17C_48942 | /Hmwk/FinalStack/main.cpp | UTF-8 | 1,533 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <cmath>
#include "Stack.h"
using namespace std;
//Function Prototypes
float rSin(float, Stack &);
float rCos(float, Stack &);
void printLine();
const int SIZE = 5;
int main()
{
////Recursive sin/cos
Stack stack1;
cout<<"\n\n";
cout<<setw(42)<<"Problem 2 - Stacks... | true |
93cdc7574639393855266ef6cee96115c5bec17a | C++ | Seventeen1Gx/CodeUp | /1067-1093 入门数学/1090 互质问题思路探索.cpp | UTF-8 | 360 | 3.203125 | 3 | [] | no_license | #include <stdio.h>
int Judge(int a, int b);
int main()
{
int n=1;
while (n<51) {
printf("%3d: ", n);
for ( int i=1; i<n; i++ ) {
if ( Judge(n, i) )
printf("%3d ", i);
}
printf("\n");
n++;
}
return 0;
}
int Judge(int a, int b)
{
int c;
while ( b!=0 ) {
c = a % b;
a = b;
b = c;
... | true |
1c9356cf166c61ff226b846eafcebd6ef84d81fb | C++ | Anthony-arias/CMPR131-Assignment4 | /Assignment4/optionTwo.h | UTF-8 | 19,721 | 3.59375 | 4 | [] | no_license | // optionTwo.h
#ifndef OPTION_TWO_LOCK
#define OPTION_TWO_LOCK
#include <iostream>
#include <string>
#include "input.h"
#include "Rational.h"
using namespace std;
void rational_numbers();
char displayMenuOptions(char& option);
void option_A();
int option_A_menuOptions(int& option);
void enterNumberator(Rational& R1)... | true |
7538c089e7033f03cd834d5d75724227159bbad9 | C++ | plmsmile/leetcode | /094_btree_in_order/btree_inorder.cpp | UTF-8 | 1,003 | 3.765625 | 4 | [] | no_license | /*
* 二叉树中序遍历
* https://leetcode.com/problems/binary-tree-inorder-traversal/description/
* https://plmsmile.github.io/2017/12/29/leetcode-01/#中序遍历-94
*
* @author PLM
* @date 2018-01-07
*/
#include <stack>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *... | true |
c584f8064cbf600810dd30c2c61fe6bd747aea29 | C++ | m1thr4nd1r/College-Works | /Operating Systems/Primo C++ (Melhor)/main.cpp | UTF-8 | 2,722 | 3.5625 | 4 | [] | no_license | /*
* main.cpp
*
* Created on: 05/06/2013
* Author: m1thr4nnd1r
*/
#include <iostream>
#include <cstdlib>
#include <pthread.h>
#include <sstream>
#include <cmath>
using namespace std;
struct thread_data{
unsigned int thread_id; // ID da thread
unsigned int start; // Inicio do intervalo de checagem da... | true |
4d5147ac8d18123fc6c1d479e1eea47f3cdfd988 | C++ | riveridea/algorithm | /leetcode/hash-table/325.maximum-size-subarray-sum-equals-k.cpp | UTF-8 | 1,721 | 3.515625 | 4 | [] | no_license | /*
* [325] Maximum Size Subarray Sum Equals k
*
* https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/description/
*
* algorithms
* Medium (43.79%)
* Total Accepted: 65.3K
* Total Submissions: 149.1K
* Testcase Example: '[1,-1,5,-2,3]\n3'
*
* Given an array nums and a target value k, find th... | true |
f038942e0bf6e18e91902c6c05b2b058e2fa4ca6 | C++ | shivarao96/MineCraft-Clone | /src/world/chunk/iChunk/iChunk.h | UTF-8 | 251 | 2.734375 | 3 | [] | no_license | #pragma once
class ChunkBlock;
/*
* abstract class to implement set and get action on a block
*/
struct IChunk {
virtual void setBlock(int x, int y, int z, ChunkBlock block) = 0;
virtual ChunkBlock getBlock(int x, int y, int z) const = 0;
}; | true |
d215abcda1d60871c2e8e5a7143052c8b51bac2c | C++ | Spenny1068/SHA256 | /main.cpp | UTF-8 | 223 | 2.828125 | 3 | [] | no_license | #include "sha256.h"
#include <iostream>
int main(void) {
std::string msg = "";
std::cout << "Enter string: ";
std::cin >> msg;
std::cout << "sha256(" << msg << "): " << sha256(msg, true) << std::endl;
return 0;
}
| true |
cbd3975ee604e67433ec47a669a80af8a45c5629 | C++ | thecherry94/2DPathfindingTest | /2D Pathfinding Test/Tile.cpp | UTF-8 | 507 | 2.828125 | 3 | [] | no_license | #include "Tile.hpp"
Tile::Tile(Tilemap* pMap, clan::Vec2i pos, const bool walkable, const int cost)
{
m_pMap = pMap;
m_pos = pos;
m_walkable = walkable;
m_cost = cost;
m_pPreviousTile = NULL;
if (m_walkable)
{
m_backgroundColor = clan::Colorf::darkgreen;
}
else
{
m_backgroundColor = clan::Colorf::red;... | true |
41c194b9d6dcaf4fa32dd225ec456d1a9dedc58f | C++ | SudaisAlam/myCppPlayGround | /printaboard.cpp | UTF-8 | 450 | 3.046875 | 3 | [] | no_license | #include<iostream>
using namespace std;
void printboard(int **board, int x, int y){
for(int i=x ; i<x ; i++){
for(int j=y ; j<y ; j++){
board[i][j]= 1;
cout << board[i][j];
}
cout<<"\n";
}
}
void makeboard(int x,int y){
int **board;
board =... | true |
7f7c85c4530fdcde8a7ceddb1069bb140831b1cc | C++ | luoxz-ai/glove | /src/tests/filesystem/UnbufferedFileReaderTest.cc | UTF-8 | 755 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | #include <gtest/gtest.hpp>
#include <glove/filesystem/Path.hpp>
#include <glove/filesystem/io/File.hpp>
#include <glove/filesystem/io/UnbufferedFileReader.hpp>
namespace {
const BlueDwarf::Path directoryPath("testdata/a_directory");
const BlueDwarf::Path filePath("testdata/a_directory/a_file");
const BlueDwarf::Path ... | true |
ab539ae5d0b6d7fe437e0c05a4557f073eb17ad6 | C++ | cowarder/Algorithms | /牛客/日志排序.cpp | UTF-8 | 817 | 3.21875 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<sstream>
using namespace std;
class Node {
public:
string data;
string name;
string year;
string time;
string strcost;
double cost;
bool operator<(const Node& s) {
if (cost != s.cost)
return cost < s.cost;
else if (year != ... | true |
317958fb872b19b4a66165cee114645993fc5264 | C++ | ninetyeightoctane/Final-PingPongGame | /main.cpp | UTF-8 | 7,130 | 3.0625 | 3 | [] | no_license | #include <SFML/Graphics.hpp>
#include <cmath>
#include <ctime>
int main(){
std::srand(static_cast<unsigned int>(std::time(NULL)));
// Set values
const float pi = 3.1415f;
const int windowWidth = 900;
const int windowHeight = 600;
sf::Vector2f paddleSize(25, 100);
float ballRad = 10.f;
... | true |
f2b9e235b92cdac6812dc78b13cce7e931bc227a | C++ | NightTerror1721/kpgbe | /KPGBE/KPGBE/include/cpu.h | UTF-8 | 449 | 3 | 3 | [] | no_license | #pragma once
#include "common.h"
class VirtualMachine;
class CPU
{
private:
bool _stop;
Ticks _ticks;
public:
CPU();
~CPU();
void step(VirtualMachine& vm);
void reset();
void stop();
bool isStopped() const;
inline void increaseTicks(unsigned int ticks) { _ticks += static_cast<Ticks>(ticks); }
inline v... | true |
3bddbe8c1dd0d80108dee44d2c2a22575662aaf8 | C++ | Ultranull/BlueWork | /BlueWork/src/resource/MeshProcessing.h | UTF-8 | 2,888 | 2.96875 | 3 | [] | no_license | #pragma once
#include <vector>
#include <glm/glm.hpp>
#include "Engine.h"
#include "graphics/Geometry.h"
class MeshProcessing{
public:
static Geometry* BuildGeometry(std::vector<Engine::Vertex> vertices, unsigned int topology = GL_TRIANGLES){
Geometry* geom = new Geometry();
geom->vaObject = std::unique_ptr<V... | true |
768eda96ecefccbef3607309bb0782127dd74fbc | C++ | chenxiaobin3000/xengine | /engine/XeTriangle.cpp | UTF-8 | 1,923 | 2.6875 | 3 | [] | no_license | #include "stdafx.h"
#include "XeTriangle.h"
#include "XeMath.h"
namespace XE {
CTriangle::CTriangle() : m_p1(0,0), m_p2(0,0), m_p3(0,0) {
}
CTriangle::CTriangle(float x1, float y1, float x2, float y2, float x3, float y3) :
m_p1(x1,y1), m_p2(x2,y2), m_p3(x3,y3) {
}
CTriangle::~CTriangle() {
}
... | true |
25dd82af5a7c353923b33195e45005896cbadf3e | C++ | dkostenko/CloseBox-game | /level.h | UTF-8 | 823 | 2.8125 | 3 | [] | no_license | #ifndef LEVEL_H
#define LEVEL_H
#include <QtCore>
class Level
{
public:
Level();
enum Direction { UP, RIGHT, DOWN, LEFT };
enum BlocTypes {BALL, WALL,
BIG_TOP, BIG_RIGHT, BIG_BOTTOM, BIG_LEFT,
SMALL_TOP, SMALL_RIGHT, SMALL_BOTTOM, SMALL_LEFT };
int getBloc(int ... | true |
7076cf6416ed5cdc86b9d17699fbaed3a2c24333 | C++ | ArturoRivera/Project1 | /Project1/SportsTeam.h | UTF-8 | 307 | 2.515625 | 3 | [] | no_license | #pragma once
#include <string>
class SportsTeam
{
//Private class members.
private:
std::string _teamName;
std::string _teamCity;
//Public class members.
public:
SportsTeam();
SportsTeam(std::string teamName, std::string teamCity);
~SportsTeam();
std::string GetSportsTeamInfo();
};
| true |
c411545aec71542940e3bae54ff52fce4f60e41c | C++ | beemfx/Beem.Media | /games/Legacy-Engine/Source/lf_sys2/lf_mem.cpp | UTF-8 | 564 | 2.796875 | 3 | [] | no_license | /* Memory allocation. */
#include <malloc.h>
#include "lf_sys2.h"
LF_ALLOC_FUNC g_pMalloc=malloc;
LF_FREE_FUNC g_pFree=free;
extern "C" lf_void LF_SetMemFuncs(LF_ALLOC_FUNC pAlloc, LF_FREE_FUNC pFree)
{
g_pMalloc=pAlloc;
g_pFree=pFree;
}
extern "C" lf_void* LF_Malloc(lf_size_t size)
{
if(g_pMalloc)
return g_pM... | true |
deec08d770dc90f983c6534f397b5572e0c77d74 | C++ | andreabecsek/akrscv | /src/cv_meanKRS.cpp | UTF-8 | 1,805 | 2.75 | 3 | [] | no_license | #include <Rcpp.h>
#include <akrs.h>
using namespace Rcpp;
// mean squared error
double mse(const NumericVector a, const NumericVector b){
return mean(pow((a-b),2));
}
// shuffle randomly
int randWrapper(const int n){
return(floor(unif_rand()));
}
// create a sequence of n samples from 0 to k
NumericVector samp... | true |
c7d342ee56590f38204f9f8409107d4f7e3757c5 | C++ | yotann/bcdb | /memodb/unittests/CborSaveTest.cpp | UTF-8 | 6,707 | 2.640625 | 3 | [
"LLVM-exception",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "memodb/Node.h"
#include "MockStore.h"
#include "gtest/gtest.h"
using namespace memodb;
namespace {
void test_save(const Node &value, const std::vector<uint8_t> &expected) {
std::vector<uint8_t> out = value.saveAsCBOR();
EXPECT_EQ(expected, out);
}
TEST(CborSaveTest, Integer) {
test_save(Node(0), {0... | true |
8bc2f20a824f24ffc4d05b87b597c6b7daa1729f | C++ | senturkoguzhan/Student-Information-System | /lecturer.cpp | UTF-8 | 9,272 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | /*************************************************************************************/
/* Oguzhan SENTURK */
/* */
/* osenturk@gtu.edu.tr ... | true |
52b2b824df0bbc04a10a5939fa6bf311bc8fb02c | C++ | cpvhunter/Cpp_4th | /chapter_06/例6-3 对象数组应用举例/Point.h | GB18030 | 481 | 2.90625 | 3 | [] | no_license | //Point.h
#ifndef _POINT_H
#define _POINT_H
class Point{ //Ķ
public: //ⲿӿ
Point();
Point(int x,int y);
~Point();
void move(int newX,int newY);
int getX() const {return x;}
int getY() const {return y;}
static void showCount(); //̬Ա
pri... | true |
d372557a17510b7555af4e045de12edc7c8ced48 | C++ | SanchezSobrino/Campo-Estelar-2010 | /src/Bar.cpp | UTF-8 | 1,540 | 2.953125 | 3 | [
"MIT"
] | permissive | #include "Bar.h"
Bar::Bar() {
destination = NULL;
numBars = 0;
}
void Bar::Draw(int val) {
if(val >= 0) {
rect.w = ((float)val/(float)maximo) * ancho;
SDL_Rect position = rect;
SDL_FillRect(destination, &position, SDL_MapRGB(destination->format, color.r, color.g, color.b));
}
}... | true |
4a968a1765f645aec3f099eb95d48cf50ab347ea | C++ | knightzf/review | /leetcode/onlineStockSpan/q2.cpp | UTF-8 | 904 | 3.296875 | 3 | [] | no_license | #include "header.h"
class StockSpanner {
private:
vector<int> v;
vector<int> res;
public:
StockSpanner() {
}
int next(int price) {
v.push_back(price);
if(v.size() == 1)
{
res.push_back(1);
return 1;
}... | true |
08fdb6e431ae4b8817154bcf1f79940f2f2193a3 | C++ | alaneos777/club | /project euler/202.cpp | UTF-8 | 1,170 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using lli = long long int;
lli sgn(lli x){
if(x > 0) return 1;
if(x < 0) return -1;
return 0;
}
tuple<lli, lli, lli> extgcd(lli a, lli b){
if(b == 0){
if(a > 0) return {a, 1, 0};
else return {-a, -1, 0};
}else{
lli q = a/b;
auto[d, x, y] = extgcd(b, a - b*q);... | true |
485e6bffd9c3b70fed32e8682f1f6338b5add0a8 | C++ | kopasxa/CppHomeWork | /MyThirthyHomeWork/func.6/func.6.cpp | UTF-8 | 509 | 3.09375 | 3 | [
"MIT"
] | permissive | // Написать функцию, которая проверяет, является ли переданное ей число простым? Число называется простым,
// если оно делится без остатка только на себя и на единицу.
#include <iostream>
using namespace std;
void prosto(int number) {
if (number % number == 0 && number / 1 == number) {
cout << "chislo ... | true |
beacf82f873cddcd83160ae343e415fb8efc3ab8 | C++ | bklimt/StudentInfo | /StudentInfo.cpp | UTF-8 | 1,356 | 2.671875 | 3 | [] | no_license |
/*
* StudentInfo.cpp
*
* This class is the application itself. It is derived
* from CWinApp like any MFC application
*
*/
#include "StudentInfo.h"
#include "MainWindow.h" // main MDI window for the application
#include "LoginDlg.h" // dialog to let users log in
#include "User.h" // object that rep... | true |
75c95de5e21c3408f1fe4e8a17e9051148465ff8 | C++ | xuancanhit99/vs-big-repo | /OPP Tren Lop/Bai 4_2_1/CL_N1.h | UTF-8 | 1,143 | 2.9375 | 3 | [] | no_license | #ifndef cl_n_h
#define cl_n_h
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Cl_N1 {
string NAME;
public:
Cl_N1(string name);
virtual void SetStr();
};
class Cl_N2 : public Cl_N1 {
string NAME;
public:
Cl_N2(string name) : Cl_N1(name) {
NAME = name;
}
void SetStr();
};
... | true |
3123328eed772e93658080d280dd8536ca3ca03b | C++ | david-guerrero/MITK | /MITK/Modules/MitkExt/DataManagement/mitkSet.h | UTF-8 | 5,546 | 2.9375 | 3 | [] | no_license | #ifndef mitkSet_H
#define mitkSet_H
#include <itkDataObject.h>
#include <itkCommand.h>
#include <mitkCommon.h>
#include <vector>
#include <set>
#include "mitkSetObserver.h"
namespace mitk
{
///
/// A class that acts like a weak pointer
/// but for a list of itk objects
///
template <class T>
class Set: virtual publ... | true |
197efb41715620798e79261e6017c863cd773ed2 | C++ | Maximillio/Entropy | /entropymodel.h | UTF-8 | 2,657 | 2.546875 | 3 | [] | no_license | #ifndef ENTROPYMODEL_H
#define ENTROPYMODEL_H
#include <entropyengine.h>
#include <memory>
#include <chrono>
#include <ctime>
#include <ratio>
#include <QAbstractListModel>
#include <QDebug>
#include <QColor>
#include <QTimer>
using namespace std::chrono;
class EntropyModel : public QAbstractListModel
{
Q_OBJECT... | true |