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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a29c2ac8bbe4cf9f456fff82cb5c8b6efb08fa68 | C++ | hurmawee/- | /Building.h | UTF-8 | 1,039 | 2.828125 | 3 | [] | no_license | #pragma once
#include <string>
#include < iostream>
using namespace std;
class Build
{
private:
string color;
string floor;
string number;
string area;
string address;
string year;
public:
Build() : color(""), floor(""), number(""), area(""), address(""), year("") {}
~Build(){}
void se... | true |
e62a74b1378d11753f5b6c62c2ab73b81084bd81 | C++ | ppearson/ImaginePartial | /utils/matrix.h | UTF-8 | 3,773 | 2.875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /*
Imagine
Copyright 2011-2017 Peter Pearson.
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 in wr... | true |
9474d625d27dad1a78d99aedc4082ea5fcc27d74 | C++ | powerslider/ovgu-magdeburg | /cpp/ex6/src/valuenode.cpp | UTF-8 | 562 | 2.71875 | 3 | [] | no_license | #include "valuenode.hpp"
Node* Value::clone() const
{
// Create a new instance with the same type and data. As you can see we
// need to know the type �Value� that is why we cannot implement it
// elsewhere.
return new Value(m_val);
}
// TODO: evaluate implementation using string to int conversation f... | true |
7b44c553d48c2397ac5c9476a7f722d68b3a7868 | C++ | inirion/PUM_Project | /EarthDefender/jni/MainMenu.hpp | UTF-8 | 2,442 | 2.828125 | 3 | [] | no_license | #ifndef MAINMENU_HPP_
#define MAINMENU_HPP_
#include <SFML/Graphics.hpp>
#include <map>
#include <string>
#include "Lang.hpp"
#include "MenuView.hpp"
#include "Listener.hpp"
#include "S.hpp"
class MainMenu: public sf::Drawable{
private:
std::map<std::string, MenuView> mvmap;
MenuView *selected;
sf::Vector2f firstPo... | true |
462f5d24cb8e8f061042fefddc228d8c346562ac | C++ | Goutham-AR/GEngine | /GEngine/src/events/Event.hh | UTF-8 | 1,826 | 3 | 3 | [] | no_license | #pragma once
#include <common.hh>
#include <string>
#include <functional>
#include <ostream>
namespace GE
{
enum class EventType
{
None = 0,
WindowClose,
WindowResize,
WindowFocus,
WindowMoved,
AppTick,
AppUpdate,
AppRender,
KeyPressed,
KeyReleased,
KeyTyped,
Mouse... | true |
b1f4d1737b30bb1e7319421f3d98afe28579d4b7 | C++ | EvgeneDudkin/HomeworkC- | /simuni/9/5/5/main.cpp | UTF-8 | 1,727 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class shape{
public:
double x;
double y;
shape(double x1, double y1):
x(x1),y(y1)
{}
virtual double area()
= 0;
virtual bool contains(double a, double b)
= 0;
};
class pryam:public shape{
public:
double st1;
double st... | true |
8b803ab30f8530cb3a564b9092abbe95d134c5ad | C++ | gari3008ma/Algo-Wiki | /Algos/deletnode.cpp | UTF-8 | 1,261 | 3.734375 | 4 | [] | no_license | #include <bits/stdc++.h>
#include <stdlib.h>
struct node
{
int data;
struct node *next;
};
void push(struct node** head_ref, int new_data)
{
struct node* new_node = (struct node*) malloc(sizeof(struct node));
new_node->data = new_data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
... | true |
e7e858fd0efc34ea739c5a66d501a0ff320ca805 | C++ | opendarkeden/server | /src/server/gameserver/EffectShrineShield.h | UHC | 1,285 | 2.921875 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////
// Filename : EffectShrineShield.h
// Written by :
// Description : Doom ϰ effect
//////////////////////////////////////////////////////////////////////////////
#ifndef __EFFECT_SHRINE_SHIELD__
#define __EFFECT_SHRINE_SHIELD__
#incl... | true |
e5fe4e774bf7741533c1b159d4e653fa23f8c865 | C++ | allegraadams/CS_C- | /main-1.cpp | UTF-8 | 1,476 | 3.390625 | 3 | [] | no_license | //implementation file for the EmpProd class
#include <iostream>
#include <string>
#include <iomanip>
#include "productionworker.h"
using namespace std;
void getEmpInfo(ProductionWorker &);
void displayInfo(const ProductionWorker &);
int main()
{
void getEmpInfo(productionworker &);
void displayInfo(const... | true |
3cb13479b23c17500636bbc8d24c9c594ed760a7 | C++ | jPHU/CP3 | /Introduction/LinearDS/STLQueue/11034.cpp | UTF-8 | 1,708 | 3 | 3 | [] | no_license | #include <cstdio>
#include <queue>
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
int n;
cin >> n;
while(n--)
{
queue<long> left;
queue<long> right;
int l, m;
cin >> l >> m;
for(int i = 0; i < m; ++i)
{
string i... | true |
9aa5f149471280a1f9c1bb1117ebf3f9619a5e50 | C++ | dtbinh/M1S2 | /TraitementImage/TP6/main.cpp | UTF-8 | 2,891 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "image_ppm.h"
int calculMoyenne(OCTET* image, int position, int nW){
int result = 0;
int nb = 0;
for(int i = -1; i<2; i++){
for(int j =-1; j<2; j++){
if(image[(i + position)*nW+j] != 0){
result += image[(... | true |
f50ca9e913d4ffce1432790678273c6ddd5f1299 | C++ | ramonjunquera/GlobalEnvironment | /RPi/Qt/02 Qt C/demos/08 constructorVar/constructorVar/point.cpp | UTF-8 | 317 | 2.6875 | 3 | [] | no_license | #include "point.h"
void Point::show()
{
//Muestra las variables privadas
cout << "x=" << _x << ",y=" << _y << endl;
}
Point::Point(int x,int y):_x(x),_y(y)
{
//Nada especial que hacer aquí porque los parámetros se han
//asignado a las variables privadas en las definición del
//constructor
}
| true |
3bca62a3d669c13e7a97cce9d42777d9b3b4c0d8 | C++ | katalist5296/Graph | /CPM/CPM/main.cpp | WINDOWS-1251 | 2,477 | 2.78125 | 3 | [] | no_license | #include <iostream>
#define INF -1 //
#define MatrixLen 8
int matrix[MatrixLen][MatrixLen] =
{
// 1 2 3 4 5 6 7 8
{0, 4, 6, 7, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 8, 0, 0},
{0, 0, 0, 0, 5, 0, 0, 0},
{0, 0, 0, 0, 9, 6, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 14},
{0, 0, 0, 0, 0, 0, 10, 12},
{0, 0, 0, 0, 0, 0, 0... | true |
99e1b0ee6b3848e2f3b1a2caa702c42472a2a678 | C++ | akiirokaede/Solutions_CPP_Primer_5th | /chapter 10/10_13.cc | UTF-8 | 408 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
bool tooLong(const string &s)
{
return (s.length()>=5?true:false);
}
int main(){
vector<string> vec{"trump","and","trump","and","trump","are","friends","of","chinese"};
auto ed=partition(vec.begin(),vec.end()... | true |
5dd6ccdb0af696402fb8e7fd6a5e3f1f20eaf9bc | C++ | NicoleAlexandraLaraAnago/3685-BackSquad | /Deberes/Arboles AVL/TreeCalculator/opstack.h | UTF-8 | 9,535 | 3.015625 | 3 | [] | no_license | /**
* UNIVERSIDAD DE LAS FUERZAS ARMADAS ESPE
* Departamento de ciencias de la computacion
* Estructura de datos
* Docente: Ing. Fernando Solis
* Tema: Convertir notacion infija a postfija, prefija y funcional
*
* @date 05/07/2021
* @author Diego Jimenez
*/
#pragma once
#include "stack.h"
#include "ops... | true |
bfd0601138ac4e6fae4e39746f9b872c3b915baa | C++ | taqu/sampling | /Sampling.cpp | UTF-8 | 24,324 | 2.640625 | 3 | [
"Unlicense",
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | /**
@file Sampling.cpp
@author t-sakai
@date 2019/09/15 create
*/
#include "Sampling.h"
#if LRAY_STANDALONE
#include <Windows.h>
#include "Sort.h"
#endif
namespace lray
{
#if LRAY_STANDALONE
u32 bitreverse(u32 x)
{
#if defined(__GNUC__)
x = __builtin_bswap32(x);
#elif defined(__clang__)
x = __b... | true |
f707383000a1b8e9828ad976f7044169f7dcd92c | C++ | Night-Voyager/A-Calculator-for-Linear-Algebra | /functions/transpose/transpose.cpp | UTF-8 | 560 | 2.84375 | 3 | [] | no_license | #ifndef TRANSPOSE
#define TRANSPOSE
#include "../matrixio/matrixio.h"
float **transpose(float **);
#ifndef MAIN_FUNTION
void main()
{
putmatrix( transpose( getmatrix() ) );
}
#endif
float **transpose(float **A)
{
float **B;
int m, n, i, j;
m = (int)A[0][0];
n = (int)A[0][1];
B = (float **)malloc( (n+1)*size... | true |
b20e72bdc369e5f1cd9723e4e5a65e09165d31bd | C++ | huangjiahua/cppLearningFiles | /9_23.cpp | UTF-8 | 695 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <list>
using namespace std;
int main()
{
int ia[] = {0, 1, 1, 2, 3, 5, 8, 13, 21, 55, 89};
vector<int> vi(ia, end(ia));
list<int> li(vi.begin(), vi.end());
auto il = li.begin();
while (il != li.end()) {
if (*il % 2)
il = li.erase... | true |
cbb3e2d12d3285f6b079a6f9bf35e942a5371419 | C++ | KeiHasegawa/ISO_IEC_14882 | /10_Derived_classes/2_Member_name_lookup/2_error/test002.cpp | UTF-8 | 797 | 3.625 | 4 | [] | no_license | /*
* When virtual base classes are used, a hidden declaration can be reached
* along a path through the sub-object lattice that does not pass through the
* hiding declaration. This is not an ambiguity. The identical use with
* nonvirtual base classes is an ambiguity; in that case there is no unique
* instance... | true |
fb364a62aab1745481a7fac01b9d9f051b9a03f9 | C++ | kokakola1994/VSStudent | /source/repos/Laborka 3/Laborka 3/Ulamek.h | UTF-8 | 1,593 | 2.671875 | 3 | [] | no_license | #pragma once
#include <iostream>
# pragma one
using namespace std;
class Ulamek
{
int licz, mian;
void reduce();
public:
Ulamek();
Ulamek(int, int);
void print() const;
int getLicz() const {
return licz;
}
int getMian() const {
return mian;
}
void setLicz(int a) {
licz = a;
}
void setMian(int b) {... | true |
49f34409eae533c0ab3e2855888219a836ff982a | C++ | robot-head/Party-Scarf | /party_scarf-button_board/dot_beat.ino | UTF-8 | 815 | 2.984375 | 3 | [] | no_license | // Define variables used by the sequences.
int thisdelay = 10; // A delay value for the sequence(s)
uint8_t count = 0; // Count up to 255 and then reverts to 0
uint8_t fadeval = 20;
void dot_beat() {
uint8_t inner = beatsin8(bpm... | true |
e8c4c42d8b225f1f3a7352674085231564e8e692 | C++ | filimonov/ClickHouse | /dbms/src/Interpreters/ExecuteScalarSubqueriesVisitor.h | UTF-8 | 2,472 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <Common/typeid_cast.h>
#include <Interpreters/Context.h>
#include <Parsers/DumpASTNode.h>
#include <Parsers/ASTSubquery.h>
#include <Parsers/ASTTablesInSelectQuery.h>
#include <Parsers/ASTFunction.h>
namespace DB
{
/// Visitors consist of functions with unified interface 'void visit(Casted & x,... | true |
ca9ac62e1b0b373390091e241292767f2264edbf | C++ | Jochen0x90h/LedControl | /Emulator/Widget.h | UTF-8 | 877 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <glad/glad.h>
#include "types.h"
class Widget {
public:
// bounding box
float x1;
float y1;
float x2;
float y2;
Widget(const char *fragmentShaderSource);
virtual ~Widget();
///
/// check if widget contains the given point
bool contains(float x, float y);
///
/// called when t... | true |
b08106e12b8008d471f704810c69815ad17a31f1 | C++ | Liuhao-bupt/my-leetcode | /my_107_Binary Tree Level Order Traversal II.cpp | UTF-8 | 1,404 | 3.21875 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int>> levelOrderBottom(TreeNode* root) {
if(!root)
return {};
vec... | true |
3a3e3d5eb1aa8b8d858f86f68a4a0b4ce1a4872d | C++ | SamirAroudj/BaseProject | /Graphics/Camera3D.h | UTF-8 | 7,836 | 3.015625 | 3 | [
"BSD-3-Clause",
"MIT",
"Zlib",
"Libpng",
"X11"
] | permissive | /*
* Copyright (C) 2017 by Author: Aroudj, Samir, born in Suhl, Thueringen, Germany
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the License.txt file for details.
*/
#ifndef _CAMERA_3D_H_
#define _CAMERA_3D_H_
#include "Graphics/BaseC... | true |
ff5149c9b532ffbb4718fda092a569b885a60456 | C++ | tiannian/DNSet | /src/utils.h | UTF-8 | 532 | 3.015625 | 3 | [] | no_license | #ifndef _UTILS_H
#define _UTILS_H
#include <string>
#include <sstream>
#include <vector>
std::string& trim(std::string &s) {
if (s.empty()) {
return s;
}
s.erase(0,s.find_first_not_of(" "));
s.erase(s.find_last_not_of(" ") + 1);
return s;
}
std::vector<std::string> split(const std::string... | true |
4abc1d202ef228b780c746a7ef66a353206c1553 | C++ | Z-maple/CodeInterviewGuide | /CH7 Bit Operations/7.5/main.cc | UTF-8 | 965 | 3.734375 | 4 | [] | no_license | ///整数的二进制表达中有多少个1
#include <assert.h>
#include <iostream>
#include <vector>
#include <initializer_list>
using namespace std;
///输入数组中有一个只出现过一次的数
///其余都出现过两次
///返回出现过两次的数
int func(vector<int> &input){
int ret = 0;
for(int i = 0; i < input.size(); ++i){
ret ^= input[i];
}
return ret;
}
///输入数组中... | true |
94fbc2454dfa9c536d61cf95886d4dd931c20185 | C++ | davidklaftenegger/qd_library | /queues/entry_queue.hpp | UTF-8 | 3,865 | 3.359375 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef qd_entry_queue_hpp
#define qd_entry_queue_hpp qd_entry_queue_hpp
#include<algorithm>
#include<array>
#include<atomic>
#include<iostream>
#include<typeinfo>
/**
* @brief a buffer-based tantrum queue with fixed-size entries
* @tparam ENTRIES the number of entries
*/
template<long ENTRIES, int BUFFER_SIZE>
cl... | true |
a2ab43626a710c6871e57e96a840ab8153e70582 | C++ | danielmoraes/prog-contests | /codility/src/passing_cars/answer.cc | UTF-8 | 674 | 3.8125 | 4 | [
"MIT"
] | permissive | /*
* Codility - Count the number of passing cars on the road.
*
* Lesson: 5 (PrefixSums)
* Problem code: PassingCars
*/
#include <vector>
#include <iostream>
using namespace std;
// @include
const int LIMIT = 1000000000;
int passing_cars(vector<int> &A) {
int ones_so_far = 0, passing_cars = 0;
for (int i =... | true |
2941cd92c9559e7630013f2d557bcc58d1b11378 | C++ | 15529343201/C-Data-Structure | /数据结构-王道/第2章 线性表/2.3-9.cpp | GB18030 | 2,509 | 4.03125 | 4 | [] | no_license | /*һͷĵ,headΪͷָ,ĽṹΪ(data,next),dataΪԪ,nextΪָ
д㷨:иԪ,ͷŽռĴ洢ռ(Ҫ:ʹ
Ϊռ)*/
#include<stdio.h>
#include<stdlib.h>
typedef int ElemType;
typedef struct LNode{ //嵥
ElemType data; //
struct LNode *next; //ָ
}LNode,*LinkList;
void print(LinkList L){
while(L->next){
printf("%d ",L->next->data);
L=L->next;
... | true |
3f182759b626913976b677a41efaddf877b43075 | C++ | andrew-pa/bicycle | /src/tokenizer.cpp | UTF-8 | 2,831 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "token.h"
#include <istream>
token tokenizer::next_in_stream() {
if (!_in) return token(token::eof, 0);
auto ch = _in->get();
if (ch < 0)
return token(token::eof, 0);
while (isspace(ch)) {
if (ch == '\n') line_number++;
ch = _in->get();
if (ch < 0)
return token(token::eof, 0);
}
switch (... | true |
56c03872009865f5dbea2e3f6e787f116740fb7d | C++ | vkacharaya/SourceCodeRepository | /Repository/NoSqlDb-Bkp/NoSqlDb/CheckOut/CheckOut.cpp | WINDOWS-1252 | 3,871 | 2.671875 | 3 | [] | no_license | /////////////////////////////////////////////////////////////////////////////
// CheckOut.cpp - retrieves package files, removing version information from //
// their filenames. Retrieved files will be copied to a //
// specified directory. //
// ver 1.0 ... | true |
40a9f84e9748e470ad0c81eec70f77e5aded632a | C++ | mast1ren/mPracCodes | /C++/PAT乙级/1078 字符串压缩与解压.cpp | UTF-8 | 1,405 | 3.40625 | 3 | [] | no_license | #include <iostream>
using namespace std;
string title;
// 压缩
void zip()
{
getline(cin, title);
bool flag = false;
char x = title[0];
int num = 0;
// 循环判断
for (int i = 0; i < title.size(); ++i)
// 如果读取字符与选择字符相同 num++
if (title[i] == x)
{
num++;
... | true |
2103d5496737c56b698ca1820e92b8e4419dc3d5 | C++ | ivanmanan/Algorithms | /palindromePairs.cpp | UTF-8 | 1,227 | 3.5625 | 4 | [] | no_license | class Solution {
public:
bool isPalindrome(string s) {
for (int i = 0, j = s.length() - 1; i < j; j--, i++) {
if (s[j] != s[i]) {
return false;
}
}
return true;
}
// Time Complexity: O(N^2 * S)
// Space complexity: O(N) --> Every pair is... | true |
a73c0a1a963f325cb4475e11e86168a7f3511413 | C++ | Ravi3191/MLP | /src/read_csv.cpp | UTF-8 | 2,270 | 2.984375 | 3 | [] | no_license | #include "read_csv.h"
void Read_data::fill_col(){
std::string line,name;
std::ifstream file(_file_name);
if(file.is_open()){
std::getline(file, line);
std::replace(line.begin(), line.end(), ',', ' ');
std::istringstream linestream(line);
while(linestream >> name){
... | true |
c5a8ec972d9d901c129ab4aad1273be7e03eef12 | C++ | irtefa/algo | /topcoder/srm577/two/EllysNewNickname.cc | UTF-8 | 566 | 3.109375 | 3 | [] | no_license | #include <string>
using namespace std;
class EllysNewNickname {
public:
int getLength(string);
};
int EllysNewNickname::getLength(string nickname) {
int ans = 0;
bool flag = 0;
for (int i=0; i < nickname.size(); i++) {
if (nickname[i] == 'a' || nickname[i]=='e' || nickname[i]=='i' ||... | true |
a05884768651ef648e585d26b72bd0a0925784da | C++ | yuex1994/iw_imdb | /uncores/Piton-pmesh/src/pmesh_util.cc | UTF-8 | 1,257 | 2.625 | 3 | [
"MIT"
] | permissive | /// \file Utility function for constructing the AES model
/// Hongce Zhang (hongcez@princeton.edu)
#include "pmesh_l15_ila.h"
#include <cmath>
#include <string>
ExprRef PMESH_L15::unknown_range(unsigned low, unsigned high) {
unsigned width = (unsigned)std::ceil(std::log2(high + 1));
auto val = unknown(width)();
... | true |
d2ff2b9a8373559edb2dff506b8fd3f194860df2 | C++ | 1choitaek/thuat-toan-attt | /bai8 ex_euclid.cpp | UTF-8 | 646 | 3.34375 | 3 | [] | no_license | #include<iostream>
using namespace std;
void extended_Euclid(int a, int b)
{
int d ,x, y;
if(b == 0)
{
d = a; x = 1; y = 0;
cout << "d = " << d << "\nx = " << x << "\ny = " << y;
}
int x1, x2, y1, y2;
x2 = 1; x1 = 0;
y2 = 0; y1 = 1;
while(b > 0)
{
int r;
int q;
q = a/b;
r... | true |
dd72545c38480ddbf849bc4d86006413b7a3b981 | C++ | jorgerodrigar/Sistema-de-Integracion-Continua | /ProyectosSDL/Moonace/src/SoundManager.h | UTF-8 | 880 | 2.6875 | 3 | [] | no_license | #ifndef SRC_SOUNDMANAGER_H_
#define SRC_SOUNDMANAGER_H_
#include "Resources.h"
#include "GameObject.h"
#include "Observer.h"
#include <queue>
/*
*
*/
class SoundManager : public Observer {
public:
SoundManager() {}
SoundManager(SDLApp* game);
virtual ~SoundManager();
virtual void receive(Mensaje* msg);
virtual v... | true |
387221bdff2fee513aa5221e8140eca70a24e20f | C++ | hhoshino0421/MultiThreadTestApp | /PthreadTestApp/PthreadMain.cpp | UTF-8 | 1,103 | 3.109375 | 3 | [] | no_license | /*
* PthreadMain.cpp
*
* Created on: 2016/05/08
* Author: Hoshino Hitoshi
*/
#include <stdio.h>
#include <pthread.h>
#define NUM_RECTS 1000000
#define NUM_THREADS 4
double gArea = 0.0;
pthread_mutex_t gLock;
void *threadFunction(void *pArg);
/*
* エントリポイント
*/
int main() {
pthread_t tHandles[NUM_THR... | true |
a6696e1c8d19592405a9a18f54eda6ed9f6e3768 | C++ | plusminus34/Interactive_thin_shells_Bachelor_thesis | /OptimizationLib/include/OptimizationLib/SQPFunctionMinimizer_BFGS.h | UTF-8 | 1,233 | 2.515625 | 3 | [] | no_license | #pragma once
#include <OptimizationLib/ConstrainedObjectiveFunction.h>
#include <OptimizationLib/ObjectiveFunction.h>
#include <OptimizationLib/SQPFunctionMinimizer.h>
#include <OptimizationLib/BFGSHessianApproximator.h>
/**
Use the Sequential Quadratic Programming method to optimize a function, subject to constraint... | true |
fcdefa0a2256b4f00b924670e26753f27a5a4694 | C++ | Luckyblock233/OI-code | /Luogu/P2910 [USACO08OPEN]寻宝之路Clear And Present Danger.cpp | GB18030 | 981 | 2.75 | 3 | [] | no_license | //֪ʶ:Floyd,·
/*
ģ
ע
*/
#include<cstdio>
#include<cstring>
using namespace std;
//===========================================================
int road[10010];//Ҫ·
int danger[105][105];//Σն
int n,m,minn;
//===========================================================
signed main()
{
memset(danger,0xff... | true |
669c0ec001093486d6453b45d57c178f478d545e | C++ | braph/edev | /lib/curses/curs.hpp | UTF-8 | 41,136 | 2.515625 | 3 | [] | no_license | // This file was generated by: ['./curs.py']
#include <ncurses.h>
#include <climits> // INT_MAX
#include <utility>
#undef NCURSES_OK_ADDR
#define NCURSES_OK_ADDR(WIN) TRUE
namespace NCursesCPP_Implementation {
// Return a char*/wchar_t*/... from std::string/char*/...
template<class T> inline T* NC_cstr(T* s) ... | true |
65a99d6680305f6a5261a833e0e9481475061db8 | C++ | NITROGENousFish/clp-core | /src/VariableDictionaryWriter.hpp | UTF-8 | 1,415 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef VARIABLEDICTIONARYWRITER_HPP
#define VARIABLEDICTIONARYWRITER_HPP
// Project headers
#include "Defs.h"
#include "DictionaryWriter.hpp"
#include "VariableDictionaryEntry.hpp"
/**
* Class for performing operations on variable dictionaries and writing them to disk
*/
class VariableDictionaryWriter : public Dic... | true |
2b3666d91a9dbec6f584560de41151974d660c2c | C++ | Fanny94/ParticleEditorExport | /Gear/staticNonModels.h | UTF-8 | 2,905 | 2.859375 | 3 | [] | no_license | #pragma once
#include "BaseIncludes.h"
#include "ShaderProgram.h"
#include "TextureAsset.h"
class staticNonModels {
GLuint VBO, iVBO;
int nrDiffValues;
int* dataSizes;
int dataStride;
int iVBOsize;
ShaderType shader;
ShaderProgram* programRef;
glm::mat4* worldMatRef;
public:
/*
VBO = Vertex Buffer Object
iVB... | true |
66a7c7321f118e9c5eed4a2ecfe89a2b1743ec19 | C++ | xushangning/sjtu-oj-ans | /src/1214.cpp | UTF-8 | 15,470 | 3.65625 | 4 | [] | no_license | #include <iostream>
template <typename T>
class forward_list
{
private:
struct node
{
T key;
node * next;
};
int var_size;
node * head, * tail;
public:
class const_iterator
{
private:
const node * p;
public:
const_iterator() = default;
const_i... | true |
7be8a89dca1babc0df7a378c34bf1e0e4cc2d641 | C++ | ioqoo/PS | /sublime/3653_fenwick_applied.cpp | UTF-8 | 1,496 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pdd pair<double, double>
#define piii pair<pair<int, int>, int>
#define pddi pair<pair<double, double>, int>
#define plll pair<pair<ll, ll>, ll>
#define vb vector<bool>
#define vi vector<int>
#define vl vector<ll>
... | true |
7e236ec11de990d0ae01f5fead7f5afb3b17f896 | C++ | r0cket007/450_DSA_Question | /Search & Sort/find_pair_given_difference.cpp | UTF-8 | 1,334 | 3.296875 | 3 | [] | no_license | /*
Find Pair Given Difference
Link: https://practice.geeksforgeeks.org/problems/find-pair-given-difference1559/1#
Expected Time Complexity: O(L*Log(L)).
Expected Auxiliary Space: O(1).
Constraints:
1 ≤ L ≤ 104
1 ≤ Arr[i], N ≤ 105
*/
#include<bits/stdc++.h>
#define int long long... | true |
b1db7e30697a8a6a1360dffe84ed5f1a1aeb3461 | C++ | raphsbeans/CudaPDE | /PDE_Solver/BulletOption.h | UTF-8 | 1,278 | 2.640625 | 3 | [] | no_license | #pragma once
#include "Payoff.h"
#include <vector>
class BulletOption : public Payoff {
public:
BulletOption(float strike, size_t daysToMaturity, float barrier, size_t P1, size_t P2, const std::vector<size_t>& scheduleDays);
void setCurrPosition(float currSpot, size_t currState);
virtual void initPayoff(float* p... | true |
4134b67bd8b5042ef4959dfadfa04242a2446431 | C++ | BramGiesen/guitarSynth | /zerox.cpp | UTF-8 | 710 | 2.75 | 3 | [] | no_license | //
// zerox.cpp
// GuitarSynth_2
//
// Created by Bram Giesen on 05-06-18.
//
#include "zerox.hpp"
Zerox::Zerox()
{
}
Zerox::~Zerox()
{
}
void Zerox::calculate(double aSignal)
{
//it compares the current signal with the previous signal. If one is positif and the other negatif it detects a
//zer... | true |
bb2963ea48610125d65ae214f3990b656101d210 | C++ | carlberyeur/HellowGlengine | /Source/CommonUtilities/SerializerSaver.h | UTF-8 | 1,111 | 2.53125 | 3 | [] | no_license | #pragma once
#include "Serializer.h"
namespace CU
{
class CSerializerSaver : public ISerializer
{
public:
CSerializerSaver();
CSerializerSaver(const unsigned int aBufferStartSize);
virtual ~CSerializerSaver();
void Init(const unsigned int aBufferStartSize);
virtual void Cerealize(unsigned char& aChar) o... | true |
6295c83b1ede19aeaff82894241426238d693b4a | C++ | lxyzzzZZZ/practice | /C++ class code/4.20/4.20/源.cpp | UTF-8 | 909 | 2.875 | 3 | [] | no_license | #include <iostream>
using namespace std;
//void Size()
//{
// size_t count = 0;
//for (const auto& e : *this)
//{
// count++;
//}
// pNode ret = _head->next;
// while (ret != _head)
// {
// count++;
// ret = _head->next;
// }
// return count;
//}
//void clear()
//{
// pNode ret = _head->next;
// while (ret != _h... | true |
a068c625c53a8e5acd06ef433cf1c342c18483ac | C++ | simranbal04/MarkingitusApp | /InternetButton.ino | UTF-8 | 2,390 | 2.734375 | 3 | [] | no_license | // This #include statement was automatically added by the Particle IDE.
#include <InternetButton.h>
// Make an InternetButton object
InternetButton button = InternetButton();
void setup()
{
button.begin();
Particle.function("Time",second);
for ( int i = 0; i < 3; i++)
{
button.allLeds... | true |
dda5fd741bb7abfb126ce9f37d7abed0e2d1d632 | C++ | nkonjeti/pool | /include/player.h | UTF-8 | 3,725 | 3.375 | 3 | [] | no_license | //
// Created by neha konjeti on 5/4/21.
//
#pragma once
#include "ball.h"
#include "cinder/gl/gl.h"
namespace pool {
using pool::Ball;
using std::vector;
/**
* Class to keep track of player stats during game.
*/
class Player {
public:
/**
* Constructor to initialize player of game, such as default type of bal... | true |
9f9ca4e7b4095e5df29fb132170af88035225057 | C++ | brenthompson2/Compiler-Construction | /Project 8/CompilerCommands/tSUBP.cpp | UTF-8 | 14,572 | 2.609375 | 3 | [] | no_license | /*
==============================================================================
File: tSUBP.cpp
Author: Brendan Thompson
Updated: 10/29/17
Description: Implementation of Functions for processing SUBP command for Compiler object made for Transylvania University University Fall Term 2017 Compiler Construction c... | true |
f6c56a48bf669d26984fc79f63d16de87f2b7fc5 | C++ | quantity123/CppExamples | /BaseTutorial/constructionFunction/constructionFunction/main.cpp | UTF-8 | 443 | 3.5625 | 4 | [] | no_license | #include <iostream>
using namespace std;
class book
{
public:
explicit book(string aTitle = "Book1"); //有参数的构造函数要加explicit,防止隐式创建对象 book b = "C++";
string getTitle();
private:
string mTitle;
};
book::book(string aTitle)
{
mTitle = aTitle;
}
string book::getTitle()
{
return mTitle;
}
int main()
... | true |
93171380797d3333d2e097bae45182881a466bf5 | C++ | zotvent/competitive-programming | /leetcode/algorithms/260 - Single Number III.cpp | UTF-8 | 343 | 2.84375 | 3 | [] | no_license | class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
unordered_set<int> seen;
for (auto& i: nums) {
if (seen.count(i) > 0) {
seen.erase(i);
}
else seen.insert(i);
}
return vector<int>(seen.begin()... | true |
39d7b04aad1cf30e6bf259b197697de7413f99df | C++ | tvxr5/Projects | /cs3130/b.cpp | UTF-8 | 572 | 3.84375 | 4 | [] | no_license | #include<iostream>
using namespace std;
// iterative version
int Fibonacci_I(int n)
{
int fib[] = {0,1,1};
for(int i=2; i<=n; i++)
{
fib[i%3] = fib[(i-1)%3] + fib[(i-2)%3];
cout << "fib(" << i << ") = " << fib[i%3] << endl;
}
return ... | true |
b82c768e43cd5b1682c2962ee567dcc3e70c0e3d | C++ | Nitrooos/Projectizer | /src/parser/COption.cpp | UTF-8 | 6,013 | 2.59375 | 3 | [] | no_license | #include "COption.hpp"
#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QCheckBox>
#include <QLineEdit>
#include <QRadioButton>
#include <QButtonGroup>
#include <QComboBox>
#include <QGroupBox>
const QMap<QString, COption::EType> COption::mapping = {
{"checkbox", COption::EType::CHECKBOX},
... | true |
65e78006f45be6bd6898e33799532fae76a621f3 | C++ | souravchk/competitive-coding-2017 | /topcoder/badNeighbors.cpp | UTF-8 | 970 | 2.75 | 3 | [] | no_license | /*
* Author: Sourav Chakraborty
* <mail.souravchk@gmail.com>
*/
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#define LL long long
#define INF 1e18
#define pb push_back
#define mp make_pair
#define max(a,b) (a) > ... | true |
6693986bfecc92364c707639940b47e2b07f0c0e | C++ | electronicarts/EASTL | /include/EASTL/allocator_malloc.h | UTF-8 | 3,730 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | /////////////////////////////////////////////////////////////////////////////
// Copyright (c) Electronic Arts Inc. All rights reserved.
/////////////////////////////////////////////////////////////////////////////
#ifndef EASTL_ALLOCATOR_MALLOC_H
#define EASTL_ALLOCATOR_MALLOC_H
#include <EABase/eahave.h>
#include... | true |
8cd42aef0c920e6df0d64919b4b95b1ccd6b2085 | C++ | CHOcho-quan/OJ-Journey | /LeetCode/Leetcode300_最长递增子序列.cpp | UTF-8 | 549 | 2.71875 | 3 | [] | no_license | class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
vector<int> dp(nums.size(), 1);
dp[0]= 1;
for (int i = 1; i < nums.size(); ++i) {
for (int j = 0; j < i; ++j) {
if (nums[i] > nums[j]) dp[i] = max(dp[j] + 1, dp[i]);
}
/... | true |
4a43ee233ee680d654ea99b07bd258c201fa3c06 | C++ | rawanalaa/PACMAN-game-using-C-and-SFML | /ghosts.cpp | UTF-8 | 948 | 2.984375 | 3 | [] | no_license | #include "ghosts.h"
ghosts::ghosts(double radius, int initialrow, int initialcolumn, string filename)
{
circle.setRadius(radius);
circle.setPosition(90 + 15 * initialcolumn, 90 + 15 * initialrow);
texture.loadFromFile(filename);
circle.setTexture(&texture);
row = initialrow;
column = initialcolumn;
}
vo... | true |
cc07b4d04f4bc9b83cffb93ba8fcf648b902d98d | C++ | FoxGriVer/Programming | /1st Semestr/lab5/lab5/Source.cpp | UTF-8 | 2,347 | 3.703125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Pair
{
protected :
int first, second;
public:
Pair(int fst = 0, int sec = 0)
{
first = fst;
second = sec;
}
void Compar(int fst, int sec)
{
if (fst > sec)
{
cout << fst << " > " << sec << endl;
}
else if (fst == sec)
{
... | true |
4017678cda97a5279ae7d3419d607152d670e3ee | C++ | azzalan/dca1202-poligonos | /ponto.cpp | UTF-8 | 912 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
Ponto::Ponto(float x, float y){
// armazena coordenadas do ponto
this->x = x;
this->y = y;
}
void Ponto::setX(float nx){
x = nx;
}
void Ponto::setY(float ny){
y = ny;
}
void Ponto::setXY(float nx, float ny){... | true |
5d9bb1570bf0b05b2983556270f6d7886e70b733 | C++ | fridobansho/GameEngine | /GameEngine/GameEngine/SpriteBatch.cpp | UTF-8 | 6,665 | 3.015625 | 3 | [] | no_license | #include "SpriteBatch.h"
#include <algorithm>
using namespace GameEngine;
Glyph::Glyph(const glm::vec4 & destRect, const glm::vec4 & uvRect, GLuint Texture, float Depth, const ColourRGBA8 & colour) :
texture(Texture),
depth(Depth)
{
topLeft.setColour(colour);
topLeft.setPosition(destRect.x, destRect.y + destRect... | true |
0fbbe5fa5d77e8a51a1fe0e3493d5083356787f0 | C++ | Anirudh8841/CAD_VSC | /src/Transformation/Matrix.h | UTF-8 | 361 | 2.53125 | 3 | [] | no_license | #include <vector>
class Matrix{
public:
// vector<matMul(vector< vector<int> > a, vector< vector<int> > b);
// crossProduct(vector< vector<int> > a, vector< vector<int> > b);
std::vector<std::vector<float> matMul ( std::vector<float> v1, std::vector<float> f2);
std::vector<std::vector<float> crossProduct( std::vec... | true |
b2c33db05116ccd4438c9fb7951fa9494dba45b3 | C++ | VB6Hobbyst7/CNC-Plotter-Art-Machine | /previousVersions/srcOLD/imageDrawing/imageDrawing.ino | UTF-8 | 6,410 | 3 | 3 | [] | no_license | //////NEWWWWWW////////
#include <Stepper.h>
#include <Servo.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
const int stepsPerRevolution = 20;
const int servoPin = 6;//pin servo is connected to
//Hardware Initialization
Servo penServo;//initiates servo
Stepper xAxis(stepsPerRevolution, 2, 3, 10, 11); /... | true |
c32c4d75c13a84f0f715d19d44eb3e517e836b5d | C++ | silenke/my-leetcode | /problems/剑指 Offer 32 - III. 从上到下打印二叉树 III/1.cc | UTF-8 | 1,227 | 3.109375 | 3 | [] | no_license | #include "..\..\leetcode.h"
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int>> levelOrder(TreeNode* root) {
vector<v... | true |
7a02278eea18848ee5418ba2274eb0f6a055fb3b | C++ | jsyeh/uva | /not_verified/uva11332.cpp | UTF-8 | 331 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
int f(int n)
{
int sum=0;
while(n>0){
sum+=n%10;
n/=10;
}
return sum;
}
int g(int n)
{
while(n>=10){
n=f(n);
}
return n;
}
int main()
{
int n;
while(scanf("%d", &n)==1){
if(n==0)break;
int ans=g(n);
printf("%d\n", ans... | true |
b5014f24f4c56558150556e38c88e69ab31aaa56 | C++ | brunexgeek/markdowntown | /modules/markdowntown/source/Token.hh | UTF-8 | 429 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | #ifndef TOKEN_HH
#define TOKEN_HH
#include <sstream>
#include <string>
class Token
{
public:
int id;
int counter;
std::string value;
Token(
int id,
const std::string &value) : id(id), counter(0), value(value)
{
}
operator std::string()
{
std::stringstream ss;
ss << "[id: " << id << "; ... | true |
315ea7b14061cf1024f923d8dfa6e522c8638d67 | C++ | buyno/CodingInterview2 | /66/main.cc | UTF-8 | 1,245 | 3.921875 | 4 | [
"Apache-2.0"
] | permissive | // 给定一个数组 A[0,1,…,n-1],请构建一个数组 B[0,1,…,n-1],其中 B 中的元素 B[i]=A[0]×A[1]×…×A[i-1]×A[i+1]×…×A[n-1]。不能使用除法。
//两个循环,第一个从前往后,得到截止A[i-1]的乘积,保存在B[i]中。
// 第二个循环从后往前,得到后半部的乘积在累乘到B[]对应位置
#include <vector>
#include <iostream>
using namespace std;
class Solution
{
public:
vector<int> constructArr(vector<int> &a)
{
i... | true |
91003f72ac2807b5f1a629dadc5e7b2bf712f361 | C++ | taiseiKMC/md5 | /md5.cpp | UTF-8 | 2,679 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <functional>
#include <vector>
#include <cmath>
#include <iomanip>
#include "md5.hpp"
void print_word(const word w)
{
//cout<<hex;
for(int j=0;j<4;j++)
{
/*unsigned short c=(w>>(j*8))&0xff;
cout<<c;*/
}
std::cout<<w<<" ";
std::co... | true |
c47b82a404cfaee4c03bc11f21fbb97fa40f6e54 | C++ | HarshaIndukuri/Lab6 | /lab6_q7_b.cpp | UTF-8 | 245 | 3.21875 | 3 | [] | no_license | #include <iostream>
using namespace std;
char toLower(char x){
x=x+32;
cout<<"Your character in lowercase is:"<<x<<endl;
}
int main() {
char a;
cout<<"Enter an uppercase letter. ";
cin>>a;
cout<<endl;
toLower(a);
}
| true |
9c12f9b68246328d72d83146ba2da9965ccfe3fc | C++ | orcchg/CppCourse | /Lesson_13/client/solutions/client_2_2.cpp | UTF-8 | 6,359 | 2.578125 | 3 | [] | no_license | #include <chrono>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <thread>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#incl... | true |
ddf4a6db74a779969e119fe0c723b3ca2f3796a4 | C++ | danielbaud/NeuralNetwork | /src/network/layer.hxx | UTF-8 | 989 | 2.6875 | 3 | [] | no_license | #include "layer.hh"
Layer::Layer(size_t size, size_t syn)
{
neurons = std::vector<Neuron>(size, Neuron(syn));
}
void Layer::update(const Layer& prev)
{
for (size_t i = 0; i < neurons.size(); ++i)
{
neurons[i].set_sum(neurons[i].bias);
for (size_t j = 0; j < prev.size(); ++j)
neurons[i].add_sum(pre... | true |
c56d7971ff7b773d266c0f0c4179390a80fe10b0 | C++ | marromlam/lhcb-software | /Phys/Phys/DaVinciMCKernel/Kernel/IMCParticleTupleTool.h | UTF-8 | 1,508 | 2.609375 | 3 | [] | no_license | // $Id$
// ============================================================================
#ifndef DECAYTUPLE_IMCPARTICLETUPLETOOL_H
#define DECAYTUPLE_IMCPARTICLETUPLETOOL_H 1
// ============================================================================
// Include files
// from STL
#include <string>
// from Gaudi
#in... | true |
7e463cafa4505653a78b41c2518ef0c79faa342e | C++ | JArandaIzquierdo/FundamentosDeProgramacion | /Ejercicios/EjerciciosRelacion2/Ejercicio16.cpp | UTF-8 | 2,407 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
using namespace std;
int main(){
int precio_inicial = 150;
double km, precio_adicional, km1, precio_final, rebaja, precio_rebajado;
char respuesta;
bool es_cliente = false;
cout << "Introduzca el numero de kilometros hasta el destino final: ";
cin >> km;
... | true |
834f1fc9e1a9e5cdeb226e89c468000b2d3e5a97 | C++ | csquaredcoding/CST136 | /Final Lab/Airline Management System/baseiterator.cpp | UTF-8 | 503 | 2.734375 | 3 | [] | no_license | #include<iostream>
using std::cout;
using std::cin;
using std::endl;
#include "baseiterator.h"
BaseIterator::BaseIterator()
{
cout << "Default BaseIterator c'tor" << endl;
m_cursor = nullptr;
CityList = nullptr;
}
BaseIterator::BaseIterator(TLList<City> * citylist)
{
cout << "1 arg BaseIterat... | true |
86bd2d82b75f78e81342ede8c6c0056254f54a47 | C++ | Allegra42/GirlsDayExample | /lib/effects/effects.cpp | UTF-8 | 1,050 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "effects.h"
uint32_t Farbrad(Adafruit_NeoPixel* pixel, byte position) {
position = 255 - position;
if (position < 85) {
return pixel->Color(255 - position * 3, 0, position * 3);
}
if (position < 170) {
position -= 85;
return pixel->Color(0, position * 3, 255 - position ... | true |
66065e0866300f9c5b171b4b99b3440339c25ff4 | C++ | Quitomos/CSAPP | /Homework/_2.68.cpp | UTF-8 | 291 | 3.015625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int lower_one_mask(int n) {
return ((1 << (n - 1)) << 1) - 1;
}
int main() {
int x = 1;
cout << "End with input 0" << endl;
while ( x != 0) {
cin >> x;
cout << hex << lower_one_mask(x) << endl;
}
return 0;
} | true |
8957f9b13387bf8bc2b6243a44bbe285977ca12d | C++ | fmi-lab/oop-group8-seminars | /week2/construct_destruct.cpp | UTF-8 | 4,087 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <cstring>
class String {
char* data;
int len;
int capacity;
public:
// default constructor
String();
// constructor with parameters
String(const char*);
// constructor from number in a specified base
// if the base argument is skipped... | true |
1f8b8267b34f305a92b4150a24543442d1e36bde | C++ | idleyui/CppPrimer_5th | /Chapter7/ex_52.cpp | UTF-8 | 245 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
struct Sales_data{
string bookNo;
unsigned units_sold;
double revenue;
};
int main(){
Sales_data item = { "978", 25, 15.99 };
Sales_data ite = {};
cout << ite.revenue;
getchar();
} | true |
79849613f532be15c6d5751bcab24c6b355ceb3a | C++ | dotnet/dotnet-api-docs | /snippets/cpp/VS_Snippets_CLR_System/system.Byte.ToString/CPP/newbytemembers2.cpp | UTF-8 | 2,448 | 3.59375 | 4 | [
"MIT",
"CC-BY-4.0"
] | permissive | // Byte.ToString2.cpp : main project file.
using namespace System;
using namespace System::Globalization;
// Byte.ToString()
void Byte1()
{
// <Snippet2>
array<Byte>^ bytes = gcnew array<Byte> {0, 1, 14, 168, 255};
for each (Byte byteValue in bytes)
Console::WriteLine(byteValue);
// The example disp... | true |
ee01d57a635010e8931f369a0ad3dc786f330e87 | C++ | HubertBraun/CheckersEngine | /CheckersEngine/CheckersEngine.cpp | UTF-8 | 737 | 2.609375 | 3 | [] | no_license | //Checkers Engine using minmax alghoritm with alpha-beta cutoff
//
//
#include <iostream>
#include"Engine/Tree.h"
#include"Engine/AI.h"
#include"Engine/BoardUtilities.h"
#include"Tests/Tests.h"
#include<chrono>
#define debug 0 // 0 - release, 1 -debug
int main()
{
#ifdef debug
#if debug == 0
AI ai;
bool player =... | true |
919e7e66ad94037197bc9f1cfb34c4a37895736a | C++ | Shubhamag12/Data-Structures-and-Algorithms | /LEETCODE/MaximumAreaofaPieceofCakeAfterHorizontalandVerticalCuts.cpp | UTF-8 | 1,011 | 2.90625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
#define mod 1000000007
#define ll long long
int maxArea(int h, int w, vector<int>& horizontalCuts, vector<int>& verticalCuts) {
horizontalCuts.push_back(0);
horizontalCuts.push_back(h);
verticalCuts.push_back(0... | true |
5a7aba69582866543d580a34929c661174ed9e11 | C++ | ailyanlu/ACM_Templates-1 | /图论/KM.cpp | GB18030 | 2,440 | 2.90625 | 3 | [] | no_license | /*
Name: KM 㷨
Author: ASEMBL
Date: 01/08/12 14:24
Description: ͼȨƥ N^3
Note: 㷨ִйеһʱ̣һ(i,j), A[i] + B[j] >= w[i,j]ʼճ
㣺 AţBţʹöһ· value = min{ A[i]+B[j]-w[i][j] | iͼڣjͼ }
*/
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std ;
const int MAXN = 30... | true |
fda9f7309fb22ba141e7cbbb04131d8f914fd8cd | C++ | schips21/cpp | /cpp_04/ex00/Victim.hpp | UTF-8 | 410 | 2.96875 | 3 | [] | no_license | #ifndef VICTIM_HPP
# define VICTIM_HPP
#include <iostream>
class Victim {
protected:
std::string _name;
Victim();
public:
Victim(std::string name);
Victim(const Victim& other);
virtual ~Victim();
Victim & operator=( const Victim& other );
std::string get_name() const;
virtual void getPolymorphed() const;
};
... | true |
54136509c2f725cffdd5d2bd8732c97a1510e7e0 | C++ | coding-cat-cosmo/game-gallery | /header/videogame.hpp | UTF-8 | 4,286 | 3.25 | 3 | [] | no_license | #ifndef VIDEOGAME_HPP
#define VIDEOGAME_HPP
#include <iostream>
using namespace std;
static unsigned int newID = 1;
/**
* @brief: the class that has all the data related to VideoGames in the database
*
*/
class VideoGame {
private:
string name;
unsigned int year;
string publisher;
string system;
str... | true |
30ff4f4de27fcee1d8e1d3f3e371fd20f3b6e91a | C++ | vxl/vxl | /contrib/mul/vil3d/tests/test_algo_binary_erode.cxx | UTF-8 | 2,637 | 2.875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | // This is mul/vil3d/tests/test_algo_binary_erode.cxx
#include <iostream>
#include "testlib/testlib_test.h"
#ifdef _MSC_VER
# include "vcl_msvc_warnings.h"
#endif
#include <vil3d/algo/vil3d_binary_erode.h>
inline void print_binary_image(const vil3d_image_view<bool>& im)
{
for (unsigned j=0;j<im.nj();++j)
{
fo... | true |
714caf30eb0dee81fbb7f124eaa1880d8606f9df | C++ | bastlirna/lora-probulator | /fw/lib/display/display.cpp | UTF-8 | 409 | 2.875 | 3 | [
"MIT"
] | permissive | #include "display.h"
void Display::sendBufferOnSerial() {
Serial.println("\n");
uint8_t x,y;
for (y = 0; y < (DISPLAY_HEIGHT / 8); y++) {
for (x = 0; x < DISPLAY_WIDTH; x++) {
uint16_t pos = x + y * DISPLAY_WIDTH;
Serial.print((unsigned char)buffer[pos], HEX);
... | true |
6781901280716cc1579ac5eba5fdc74215569f2d | C++ | UESTCzhouyuchuan/Algorithmic | /ACM算法题/book/chapterTwo/积水问题.cpp | UTF-8 | 785 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define MAX_N 100
#define MAX_M 100
using namespace std;
char field[MAX_N][MAX_M + 1];
int M, N;
void dfs(int x, int y)
{
int nx, ny;
field[x][y] = '.';
for (int dx = -1; dx <= 1; dx++)
for (int dy = -1; dy <= 1; dy++)
{
nx = x + dx, ny = y + dy;
if (0 <= nx && nx < N... | true |
46262c1c85321c5902e08309a58e00793b83ffc0 | C++ | HugoCa11/Analisis-y-Modelacion-de-Sistemas-de-Software | /Computadora.cpp | UTF-8 | 2,319 | 3.375 | 3 | [] | no_license | #include<iostream>
#include<string>
class Desktop {
private:
std::string name;
public:
void create(std::string nombre) {
setName(nombre);
std::cout << nombre << " creada" << std::endl;
std::cout << "Seleccion de componentes. Completado" << std::endl;
std::cout << "Ensamblado de componentes. Completado" << st... | true |
e9afe8e98745ffe07e2b9675cc7a0bf22ed251d6 | C++ | Ixox/NeoPixel-Projects | /NeoLampe/src/main.cpp | UTF-8 | 1,751 | 2.640625 | 3 | [] | no_license | /*
Copyright © 2018, Xavier Hosxe
Free license, do what you want with these files
*/
#include "LedSpot.h"
#include "LedControl.h"
// Neopixel D2
#define PIN_NEOPIXEL A5
// Pushbutton D3
#define PIN_PUSHBUTTON A4
// analog input
#define PIN_POT A0
#define NUMPIXELS 7
#define EEPROM_SPOT_ADDRESS 0
// initialize... | true |
f2fcd0625424ba3666c0a8f663dc3eab6b663dda | C++ | esteban-andrade/projects | /pfms-2019a-Johnson15177-master/scratch/tutorial/week6/main.cpp | UTF-8 | 1,067 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <thread>
#include <mutex>
#include <chrono>
#include <queue>
using namespace std;
void sumQueue(queue<int> &numbers, mutex &mtx, int total) {
mtx.lock();
while (!numbers.empty()) {
//Use mutex
total += numbers.front();
numbers.pop();
//unlock so the other ... | true |
74fe2284e79c3d1419a1c34b32fadb71888354d5 | C++ | DerekCresswell/Thoth | /src/RenderElement.cpp | UTF-8 | 2,421 | 3.359375 | 3 | [
"MIT"
] | permissive |
#include <Thoth/RenderElement.hpp>
namespace Thoth {
/* Public */
// Constructs a RenderElement
RenderElement::RenderElement(const std::string& tag)
: tag(tag) {}
// Constructs a RenderElement with content
RenderElement::RenderElement(const std::string& tag, const contentType& content) ... | true |
f69e07969524e2632acfbfd7e8d287c58d597172 | C++ | bhattsachin/falcon | /src/parser/BaseParser.cpp | UTF-8 | 5,145 | 2.640625 | 3 | [] | no_license | /*
* BaseParser.cpp
*
* Created on: Sep 23, 2011
* Author: Zhiliang SU
*/
#include "BaseParser.h"
BaseParser::BaseParser() {
}
void BaseParser::initParser(string stwFileUrl){
stwListPath = stwFileUrl;
if (stwList.size() == 0 || charExclude.size() == 0) {baseParserInit();}
}
BaseParser::~BaseParser() {... | true |
48dcd0b979fb080bbfee1b4399d4a284a16f1402 | C++ | HOLINHED/coding-challenges | /cppclasses/player.cpp | UTF-8 | 520 | 3.375 | 3 | [] | no_license | #include "player.h"
Player::Player(int lev, int h, std::string n) {
level = lev;
health = h;
name = n;
printf("HALLO!!! [Constructor]\n");
}
void Player::damage(int amount) {
health -= amount;
}
void Player::heal(int amount) {
health += amount;
}
void Player::levelUp() {
level += 1;
}
void Player::gr... | true |
0451b76dabc2ad562425634adc3a6a5203847e47 | C++ | dfinch-vlk/dfinch | /cpp_modules/cpp_module02/ex01/Fixed.hpp | UTF-8 | 446 | 2.828125 | 3 | [] | no_license | #ifndef FIXED_CPP
# define FIXED_CPP
# include <iostream>
class Fixed
{
public:
int getRawBits(void) const;
void setRawBits(int const raw);
Fixed & operator=(const Fixed &n);
int toInt(void) const;
float toFloat(void) const;
Fixed(const int n);
Fixed(const float n);
Fixed(const Fixed &n);
Fixed();
~Fixed();... | true |
8557b8aa2d4512013dc5ef00269839560243b8ac | C++ | triffon/oop-2019-20 | /exercises/5/ex08/samples/polymorph_vector.cpp | UTF-8 | 2,388 | 3.515625 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <cstring>
#include "vector.cpp"
using std::cout;
using std::endl;
/*
Vector<T> Object (print, ++)
| / | | \
PolyVector Int Double Char
*/
// Object
class Object {
public:
virtual void print() = 0;
virtual Object & operator++() = 0;
};
/... | true |