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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
71b92aa83be04beecf02d1921e20bc8d6db68256 | C++ | alexdoberman/kkm_server | /modules/kkm_control/src/proc_helper.cpp | UTF-8 | 1,225 | 2.609375 | 3 | [] | no_license | #include "proc_helper.h"
#include <Psapi.h>
#include <Shlwapi.h>
#include <tlhelp32.h>
#include <tchar.h>
#include <StrSafe.h>
namespace proc_helper
{
DWORD find(const wchar_t * szApp)
{
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
// Take a snapshot of all processes in the system.
hProcessSnap = CreateTo... | true |
6959db5cee92997d4b0ccd115e07de632a4d42d0 | C++ | SeanWuLearner/leetcode | /src/q0701.h | UTF-8 | 1,451 | 3.765625 | 4 | [
"MIT"
] | permissive | #include "tree_node.h"
/* Solution 1: recursive */
class Solution1 {
public:
TreeNode* insertIntoBST(TreeNode* root, int val) {
if(root==nullptr) return new TreeNode(val);
if(val > root->val)
root->right = insertIntoBST(root->right, val);
else
root->left = insertInt... | true |
e3b9da3f6cc7748c355815c29fcaa5c50479bd83 | C++ | Bartleby2718/Introduction-To-Algorithms--CLRS- | /Tree/binarySearchTree.hpp | UTF-8 | 927 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// Created by bartl on 06/15/2019.
//
#ifndef TREE_BINARYSEARCHTREE_HPP
#define TREE_BINARYSEARCHTREE_HPP
#include "BinarySearchTreeNode.hpp"
class BinarySearchTree
{
BinarySearchTreeNode *root;
public:
BinarySearchTree();
void insert(BinarySearchTreeNode *newNode);
void transplant(BinarySearchT... | true |
29f4082d4c75e63ddc06e7c591d0e34414669c0e | C++ | jing-ge/Jing-leetcode | /778.cpp | UTF-8 | 3,732 | 3.5 | 4 | [] | no_license | // 778. Swim in Rising Water
// On an N x N grid, each square grid[i][j] represents the elevation at that point (i,j).
// Now rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a square to another 4-directionally adjacent square if and only if the elevation of both squares indivi... | true |
b6d00cf5459eb40c0ddb7ba798030dc5f5950ef6 | C++ | maadborn/VisNode | /distrshapepositioncalc.cpp | UTF-8 | 13,483 | 2.828125 | 3 | [] | no_license | #include "distrshapepositioncalc.h"
#include "nodeitem.h"
#include <qmath.h>
#include <QDebug>
// Define some constants for ease of use when tweaking and debugging
static const int DISTR_SHAPE_MIN_RADIUS = 90;
static const int DISTR_SHAPE_RADIUS_INC_PER_ITEM = 10;
static const int DISTR_SHAPE_ARC_DEGREES = 120;
stati... | true |
68d123f52915e447c7b24e5740f1bc2d314501b8 | C++ | fanxingzju/PAT_advanced | /1037.cpp | UTF-8 | 786 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int NC, NP;
int coupons[100005];
int products[100005];
unsigned long long int max_sum = 0;
int main()
{
int index = 0;
int min_length = 0;
cin >> NC;
for (int i = 0; i != NC; ++i)
{
cin >> coupons[i];
}
cin >> NP;
for (int i = 0; i != NP; ++i)
{... | true |
67a6432e0ded5d44e8179b6525ad28885a458a69 | C++ | mitempo/problems | /leetcode/0191_number_of_1_bits.cpp | UTF-8 | 214 | 2.859375 | 3 | [] | no_license | // https://leetcode.com/problems/number-of-1-bits/description/
class Solution {
public:
int hammingWeight(uint32_t n) {
int s = 0;
for (; n > 0; n >>= 1) s += n & 1;
return s;
}
};
| true |
9b65960a468b4343c2d0d5b637b41988adfdd13b | C++ | xiao7540916/Re-Vulkan | /Source/VulkanBackend/VulkanQueue/VulkanInstance.cpp | UTF-8 | 10,800 | 2.53125 | 3 | [] | no_license | #include "VulkanInstance.h"
#include <Horizon/Log/LogManager.h>
namespace Horizon
{
bool gInstanceInitialized = false;
VKAPI_ATTR VkBool32 VKAPI_CALL DebugUtilsMessengerCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbac... | true |
827398af78afc741c0ea53bb7995af287c53a32d | C++ | zhaoyaogit/lightRpc | /src/compress/test.cpp | UTF-8 | 190 | 3.140625 | 3 | [] | no_license |
#include <functional>
#include <iostream>
using namespace std;
int main()
{
auto f = [&](int a) {
if(a == 1) return a;
return f(a-1);
};
cout << f(5) << endl;
} | true |
9e0bae7cb0bb476ba80a33c38bb7c030bfc7c70a | C++ | comfort48/NAT-Application | /NAT_Application.cpp | UTF-8 | 1,233 | 2.8125 | 3 | [] | no_license | #include "NAT.cpp"
int main(int argc, char *argv[]) {
NetworkAddressTranslation nat; // nat object which does the work of reading the NAT and FLOW file and to output the result in OUTPUT file.
// Hard-coded the input file names -> NAT and FLOW
nat.populateNatMapper("NAT"); // Reads the NAT file an... | true |
66626388cb41be6dfb7eed5f7f1ca5111b150987 | C++ | ayushsinghal2/ALGO | /sumproblem/varsum.cpp | UTF-8 | 1,329 | 3.46875 | 3 | [] | no_license | /* a[i]+a[j]=a[k]*/
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int partition(int a[], int low, int high )
{//partition
int pivot = a[low];
int left =low;
int right = high;
while(left<=right)
{
while(a[left]<=pivot)
{left++;}
while(a[right]>pivot)
{right--;}
if(left<ri... | true |
e3d0e23a42e0c9dc8b2b5ad366bdb081a20dd617 | C++ | liucsg/panoptic_mapping | /panoptic_mapping/include/panoptic_mapping/tools/log_data_writer.h | UTF-8 | 2,269 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef PANOPTIC_MAPPING_TOOLS_LOG_DATA_WRITER_H_
#define PANOPTIC_MAPPING_TOOLS_LOG_DATA_WRITER_H_
#include <fstream>
#include <functional>
#include <string>
#include <vector>
#include "panoptic_mapping/3rd_party/config_utilities.hpp"
#include "panoptic_mapping/common/common.h"
#include "panoptic_mapping/map/submap_... | true |
e38528beb8784ee0d7c3940aab3ca1719f53b74e | C++ | Taoaoxiang/PracticeLeetCode | /include_LeetCode.h | UTF-8 | 2,744 | 2.875 | 3 | [] | no_license | // All the needed headers for LeetCode
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <functional>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
using namespace std;
/**
* Defi... | true |
9549e8e388dc59da79bf9ba9b809f8d3bc0281fc | C++ | baetuc/IP-Lab-1 | /Responsabil.cpp | UTF-8 | 1,557 | 2.6875 | 3 | [] | no_license | #include "Responsabil.h"
#include"Utility.h"
#include<utility>
using namespace std;
extern map<string, map<int, pair<Serializabil*, bool>>> obiecteCreateDinClasa;
typedef Serializabil* (*CreareObiect)();
extern map<string, CreareObiect> creeazaObiectDeTipul;
list<Student*> Responsabil::getSubordonati() {
return sub... | true |
750256b478e3fbf1801ce32808497a4f6f20fdb5 | C++ | Codetalker777/loncare_DataStructures | /loncare_DataStructures/StudentList.cpp | UTF-8 | 2,501 | 3.1875 | 3 | [] | no_license | #include "stdafx.h"
#include "StudentList.h"
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <chrono>
using namespace std;
// constrcutor
StudentList::StudentList(string file_name)
{
// vairables
vector<st... | true |
98d85d1ef68838a26e0eeeaf4b92d7c832e89703 | C++ | xploora/kepler3d | /test-gl/unittests/src/test_BoundingBox.cpp | UTF-8 | 2,733 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | #include "common_test.hpp"
#include <BoundingBox.hpp>
#include <Transform.hpp>
using namespace kepler;
using glm::quat;
using glm::radians;
static const vec3 origin;
static constexpr float float_err = 0.000001f;
TEST(boundingBox, empty) {
EXPECT_TRUE(BoundingBox().empty());
EXPECT_TRUE(BoundingBox(vec3(5),... | true |
c9bfeced691eeee421b137119e731ed9754851f1 | C++ | lasaldan/wizards-court | /WizardsCourt/TextureCoordinate.cpp | UTF-8 | 566 | 2.671875 | 3 | [] | no_license | //
// TextureCoordinate.cpp
// wizards-court
//
// Created by Daniel Fuller on 9/15/15.
// Copyright (c) 2015 Daniel Fuller. All rights reserved.
//
#include <iostream>
#include <sstream>
#include <stdio.h>
#include "TextureCoordinate.h"
using namespace std;
TextureCoordinate::TextureCoordinate ( float X, float Y... | true |
b0c805b176e67a4b7763c92169cd3483b9ff22c7 | C++ | maxclappier/CitySim-Solver | /util.cpp | UTF-8 | 6,155 | 3.0625 | 3 | [
"BSD-3-Clause"
] | permissive | #include "util.h"
// *** Utils, CitySim *** //
// *** jerome.kaempf@epfl.ch *** //
// extern use of LAPACK in Fortran
extern "C" {
// LU decomposition and backsubstitution of a general matrix
void dgesv_(int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b, int *ldb, int *info);
// ... | true |
73e80a69f8afc93e244c8b68d36b8f61e0ee5cd1 | C++ | s947599549/CourseManageSystem | /CMD.cpp | UTF-8 | 2,553 | 3.46875 | 3 | [] | no_license | #include "CMD.h"
using namespace std;
vector<string> CMD::information = { "Print help information",
"List all courses",
"Print detailed course information by ID",
"Print detailed course information by name",
"Delete course by ID",
"Delete course by na... | true |
dfa2a7d95911ef8a813f30b6694898f990a29db2 | C++ | JanDeng25/Online-Judge | /PAT/Basic Level/1019. 数字黑洞 (20).cpp | UTF-8 | 685 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
using namespace std;
int reverse(int n){
int m = 0;
for(int i = 0; i < 4; i++){
m = 10 * m + n % 10;
n /= 10;
}
return m;
}
int caculate(int n){
int a[4], m = 0, l = 0;
for(int i = 0; i < 4; i ++){
a[i] = n % 10;
n /= 10;
}
... | true |
5bf2e13a6220e516ad933b09f7cf67f2acdd3f3e | C++ | Youngwb/leetcode_cplusplus | /22/Generate_Parentheses1.cpp | UTF-8 | 661 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<string> generateParenthesis(int n) {
vector<string> ret;
string s;
dfs(s,ret,0,0,n);
return ret;
}
void dfs(string s,vector<string> & ret,int l,int r,int n){
if(r == n){
ret.push_bac... | true |
6fede70a723af558ea2c5ceadf68fbaf0151fffc | C++ | Dimbelio/Programming-Principles-and-Practice-Using-C-by-Bjarne-Stroustrup- | /Visual Studio 2010/Projects/bjarneStroustrupC++PartIII/bjarneStroustrupC++PartIII/Chapter18Exercise11v4.cpp | UTF-8 | 1,692 | 3.328125 | 3 | [
"MIT"
] | permissive | /*
TITLE Skip List Chapter18Exercise11v2.cpp
"Bjarne Stroustrup "C++ Programming: Principles and Practice.""
COMMENT
Objcective: Research and implement the data structure:
Skip List.
References to the papers by W. Pugh:
http://epaperpress.com/sortsearch/download/skipl... | true |
11d5227ea758c633a20dfc7e64b45e305ceb8cba | C++ | CristhianR/Proyecto-Diagnostico | /ladrilloI.cpp | UTF-8 | 796 | 2.953125 | 3 | [] | no_license | // Clase Ladrillo
#include "ladrilloI.h"
#include <iostream>
#include "bola.h"
using std::cout;
// El constructor carga la imagen del ladrillo e inicializa el flag de la variable bool.
LadrilloI::LadrilloI(int x,int y) {
image.load(":image/bloqueI.png");
destroyed = false;
p = 0;
rect = image.rect();
rect.... | true |
9a68e1f28de7e22f753b79f895450fc30119a70b | C++ | Voldakk/EVA-Engine | /EVA/Components/MeshRenderer.hpp | UTF-8 | 864 | 2.578125 | 3 | [] | no_license | #pragma once
#include <memory>
#include "../Mesh.hpp"
#include "../Material.hpp"
#include "../Component.hpp"
#include "../ComponentMap.hpp"
namespace EVA
{
class MeshRenderer : public Component
{
REGISTER_COMPONENT(MeshRenderer, "EVA::MeshRenderer")
std::shared_ptr<Mesh> m_Mesh;
std::shared_ptr<Material... | true |
0ef7caeb30b5385e1e61cbbe7942105fbc757914 | C++ | minhaz1217/My-C-Journey | /OJ_UVA/completed/11764 - Jumping Mario_completed_1.cpp | UTF-8 | 592 | 2.84375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int tk,n,prev,cur,lj=0,sj=0,caseCounter = 1,i;
cin >> tk;
while(tk--){
cin >> n;
if(cin.eof()){
break;
}
lj=0;
sj = 0;
for(i=0;i<n;i++){
cin >> cur;
if(i!=0){
... | true |
4cc6f35e1321f680ae19119f549ebfcffa7ed409 | C++ | AnluTong/Algrithm | /filter/GaussianFilter.h | UTF-8 | 1,779 | 3.046875 | 3 | [] | no_license | #pragma once
#include "Util.h"
#include "Point.h"
class GaussianFilter
{
public:
GaussianFilter()
{
mSigma = 25;
}
GaussianFilter& setSigma(double sigma)
{
mSigma = sigma;
}
void filter(vector<Point<double>*>& src, vector<list<Point<double>*> >& mapping)
{
if(src.size() == 0 || src[0]->getPointType() ... | true |
02be7c460b715258ed8f7c43d05957129867730d | C++ | nanagami1369/UserDBAccesser | /include/User.h | UTF-8 | 780 | 3.171875 | 3 | [
"JSON",
"BSD-3-Clause",
"MIT"
] | permissive | /**
* @file User.h
* @brief ユーザーアカウントを保持するクラス
*/
#pragma once
#include "t_level.h"
#include <string>
/**
* @brief ユーザーアカウントを保持するクラス
* @attention このクラスではデータを保持するだけなので別途バリデーション等をすること
*/
class User {
public:
/** @brief 会員番号 */
uint ID;
/** @brief アカウント名 */
std::string Name;
/** @brief パスワード */
... | true |
9a8c7237010eb177fdf749eeafd47ff921eb5b58 | C++ | Papagayos-Games/Papagayo-Engine | /Engine/dependencies/LuaBridge3-master/Tests/Source/OptionalTests.cpp | UTF-8 | 2,243 | 2.671875 | 3 | [
"MIT"
] | permissive | // https://github.com/kunitoki/LuaBridge3
// Copyright 2020, Lucio Asnaghi
// SPDX-License-Identifier: MIT
#include "TestBase.h"
#include "LuaBridge/Optional.h"
#include <optional>
struct OptionalTests : TestBase
{
};
TEST_F(OptionalTests, PassToFunction)
{
runLua("function foo (opt) "
" result = o... | true |
b7a3c20aa33eb1e05fee20248fd9df438938685b | C++ | Jonaslinderoth/MasterThesis | /src/MineClusGPU/MineClusKernels.h | UTF-8 | 2,762 | 2.578125 | 3 | [] | no_license | #ifndef MINECLUSKERNELS_H
#define MINECLUSKERNELS_H
#include <vector>
#include <tuple>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>
void createInitialCandidatesWrapper(unsigned int dimGrid,
unsigned int dimBlock,
cudaStream_t stream,
unsigned int dim,
u... | true |
d31fa7593ddab939f72ea2811216ef7be6422a90 | C++ | jondurrant/twinThingExample | /UartThreaded/src/ExampleObserver.h | UTF-8 | 967 | 3.015625 | 3 | [
"MIT"
] | permissive | /*
* ExampleObserver.h
*
* Example Observer takes a state from a StateExample object
* Looks for the state of On state variable and sets the onboard LED to
* be on or off
*
* Created on: 21 Sept 2021
* Author: jondurrant
*/
#ifndef EXAMPLEOBSERVER_H_
#define EXAMPLEOBSERVER_H_
#include "StateObserve... | true |
f55dc41e3f1cc64102617c6672cf3c19f4aefb1f | C++ | jOnoNe/RTP_SFPC_FALL19 | /opencvExample/src/ofApp.cpp | UTF-8 | 6,423 | 3.328125 | 3 | [] | no_license | #include "ofApp.h"
// Goal: Draw an outline Contour of a human body / the largest object in the videostream.
//
// Steps:
// (1) grabber: Take video input from grabber.
// (2) ofImage `grayscale`: Take the current img from the video stream, and convert it to grayscale.
// (3) ofImage `background`: On keypress, captur... | true |
fa8bb84d710928b7196712d2ecf034e1b44240e8 | C++ | rovinbhandari/Programming_Scripting | /C_C++/preSem4/CS201/lab5/AKKImain.cpp | UTF-8 | 1,214 | 3.3125 | 3 | [] | no_license | //#include "../include/head.h"
#include <iostream>
using namespace std;
struct tree
{
int data;
tree *left;
tree *right;
};
void insert(tree *a, int x);
void inorder( tree *a);
void postorder( tree *a);
void preorder( tree *a);
int main(){
tree *root= new tree;
tree *pos= new tree;
cout<<"enter root";
int x;
cin>>... | true |
cbdf296a7ecd9ab0e8321fb89108f6535d14ff77 | C++ | BigETI/NoLifeNoCry | /engine/src/Utilities.cpp | UTF-8 | 383 | 2.6875 | 3 | [
"MIT"
] | permissive | #include <ctime>
#include <Utilities.hpp>
/// @brief Gets the date and time string from point
/// @param timePoint Time point
/// @return Date and time string
std::string DirtMachine::Utilities::GetDateTimeStringFromTimePoint(const std::chrono::system_clock::time_point& timePoint)
{
std::time_t time = std::chrono::sy... | true |
e2fe78d637f3c05238523884978c8a345ba5ca51 | C++ | WiseCow/algorithm | /BOJ/모든 순열.cpp | UTF-8 | 658 | 2.78125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int N;
void dfs(int now, int jari,int map[10],bool visit[10])
{
if (jari == N + 1)
{
for (int i = 1; i <= N; i++)
{
printf("%d ", map[i]);
}
printf("\n");
}
else
{
for (int i = 1; i <= N; i++)
{
if (!visit[i])
{
map[jari] = i;... | true |
43e907ff747fd4b5a0356002d9aa49f77859158d | C++ | shubham061996/Prebootcamp_course | /coursera/Algorithm_specialization/2.Graph Search, Shortest Paths, and Data Structures/week 4/2_sum.cpp | UTF-8 | 2,143 | 2.640625 | 3 | [] | no_license | #include<bits/stdc++.h>
#define NUM_ELEMENTS 1000000
#define MIN -10000
#define MAX 10000
using namespace std;
long long data[NUM_ELEMENTS];
int main()
{
ifstream fin;
fin.open("sum.txt");
for (int i = 0; i < NUM_ELEMENTS; i++)
{
fin >> data[i];
}
fin.close();
sort(data, data ... | true |
2ab98995d639e5f1588ec6ce4c7d27e21f69b54a | C++ | arbor-sim/arbor | /arbor/symmetric_recipe.cpp | UTF-8 | 1,668 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | #include <arbor/symmetric_recipe.hpp>
namespace arb {
cell_size_type symmetric_recipe::num_cells() const {
return tiled_recipe_->num_cells() * tiled_recipe_->num_tiles();
}
util::unique_any symmetric_recipe::get_cell_description(cell_gid_type i) const {
return tiled_recipe_->get_cell_description(i % tiled_re... | true |
566a801c9447ef08c6f64a11635798fac1afa28f | C++ | withseungryu/Algorithms | /BackJoon/Greedy Algorithm/2217.cpp | UTF-8 | 473 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int N;
vector<int> rope;
int weight() {
int maximum = 0;
sort(rope.begin(), rope.end());
for (int i = 0; i < N; ++i) {
maximum = max(maximum, rope[i]*(N-i));
}
return maximum;
}
... | true |
1bc35768668aa561a930ec11a39a619f34486bed | C++ | JohannEid/Dijkstra-Primm-and-other-algorithms... | /Graph.cpp | UTF-8 | 7,753 | 3.03125 | 3 | [] | no_license | //
// Created by johann on 15/03/17.
//
#include "Graph.h"
std::multiset<Edges> Graph::readFromFile() {
int compteur{0};
int value{0};
std::vector<int> temporary_values;
std::multiset<Edges> edges_collection;
std::ifstream myfile("source.txt");
if (myfile.is_open()) {
while (myfile >... | true |
bad7d11af4beef63fcf7c0c97bd1e19302062a04 | C++ | ericaddison/GWFisherMatrix | /gslWrappers.cpp | UTF-8 | 16,743 | 2.78125 | 3 | [] | no_license | /*--------------------------------
** USU FAST Group
** Eric Addison
** gslWrappers.cpp
** implementation of gslWrappers classes
*--------------------------------*/
#include "gslWrappers.h"
namespace gslWrappers
{
//************************************************************
// gslRootFinder
//****************... | true |
5219d0e0644619ae5b87e9144eaf94bb59f26fdc | C++ | AdityaWadhwa/CANSAT_GAGAN_2020 | /PayloadCodes/SDcode.ino | UTF-8 | 1,608 | 2.6875 | 3 | [] | no_license |
void setupSD()
{
//pinMode(CSpin, OUTPUT);
// see if the card is present and can be initialized:
if (!SD.begin(10)) // CS pin is D10
{
Serial.println(F("Card failed, or not present")); // don't do anything mor... | true |
54efea4673914f4c1ef49186ccc667fbf92b1c23 | C++ | madongyu/leetcode | /8_String_to_Integer_(atoi).cpp | UTF-8 | 685 | 3.21875 | 3 | [] | no_license | #include <string>
using std::string;
// how to know it is out of range ?
int myAtoi(string str) {
long long re = 0;
int base = 0;
int flag = false;
while (base < str.size() && str[base] == ' ')
{
base++;
}
if (base == str.size()) {
return 0;
}
if (str[base] == '-') {
flag = true;
base++;
}
else if... | true |
117528ca68043d268626526f03c2224ad4fdb1f9 | C++ | perryiv/cadkit | /Minerva/DataSources/PG/Info.cpp | UTF-8 | 9,850 | 2.59375 | 3 | [] | no_license |
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006, Arizona State University
// All rights reserved.
// BSD License: http://www.opensource.org/licenses/bsd-license.html
// Created by: Adam Kubach
//
//////////////////////////////////////////////////////////////... | true |
529e5f584cccc549b3f9cca9823c5b5536b63b21 | C++ | kaidee/kaidee | /cpp/str_length.cpp | UTF-8 | 921 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
#pragma mark 获取UTF-8字符串长度
int strLength(const std::string &str)
{
if (typeid(str) == typeid(std::string) && str.length() > 0)
{
int len = str.length();
std::vector <std::string> dump;
int i = 0;
wh... | true |
ccbec53625b12741f782f2d2a909f1f6c8707f6a | C++ | TosakaUCW/Solution_Source_Code | /[Luogu P3374] 【模板】树状数组 1 .cpp | UTF-8 | 967 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
#define Rep(i, x, y) for (register int i = x; i <= y; i++)
const int N = 5e5 + 5;
int n, m;
struct Binary_Indexed_Tree
{
int c[N];
int lowbit(int x) { return x & (-x); }
void add(int k, int x)
{
for (int i = k; i <= n; i += lowbit(i))
c[i] += x;
}
int f... | true |
5a82c8af1006923318e6acc3a9b702753519ff1e | C++ | maximzec/lab6 | /Alive/Animal.h | UTF-8 | 420 | 2.78125 | 3 | [] | no_license | //
// Created by User on 18.04.2019.
//
#ifndef LAB6_ANIMAL_H
#define LAB6_ANIMAL_H
#include "Alive.h"
class Animal : public Alive
{
private:
std::string type;
std::string animal_k;
std::string size;
public:
Animal();
Animal(int age, bool isAlive , std::string type , std::string animal_k ,std::st... | true |
b8f399bfe532d8b49f55fc2c068e92cafaa94296 | C++ | Emma-Rabbit/bunny3d | /src/Scene.cpp | UTF-8 | 582 | 3.0625 | 3 | [] | no_license | #include "Scene.hpp"
#include <vector>
Scene::Scene(){
}
void Scene::AddObject(std::vector<float> ver, std::vector<unsigned int> ind){
for(float v : ver){
m_Verticies.push_back(v);
}
for(unsigned int i : ind){
m_Indecies.push_back(i);
}
}
void* Scene::GetVerticies(){
return m_Ver... | true |
faa990666777a2d0ef0c825c0163fcd212f3850f | C++ | FBaldo98/hw3d | /hw3d/Window.h | UTF-8 | 2,196 | 2.6875 | 3 | [] | no_license | #pragma once
#include "BaldoWin.h"
#include "BaldoException.h"
#include "Keyboard.h"
#include "Mouse.h"
#include "Graphics.h"
#include <optional>
#include <memory>
class Window {
public:
class Exception : public BaldoException {
using BaldoException::BaldoException;
public:
static std::string TranslateErrorCode(... | true |
4ab248cb9c9b679e56dfcaa590ecd226a5944ff2 | C++ | DevinChang/LC_AC | /LeetCode/LC840.cpp | UTF-8 | 1,104 | 2.625 | 3 | [] | no_license | class Solution {
public:
int n, m;
vector<vector<int>> g;
bool check(int x, int y) {
bool st[10] = {0};
for (int i = x; i < x + 3; i ++ )
for (int j = y; j < y + 3; j ++ ) {
int t = g[i][j];
if (t < 1 || t > 9) return false;
if (st... | true |
ce58e6b647be182724bd4129619689d66f03539b | C++ | ernestk86/dungeon_game_cpp | /sMenu.cpp | UTF-8 | 953 | 3.1875 | 3 | [] | no_license | /******************************************************************
** Program Name: sMenu.cpp
** Author: Ernest Kim
** Date: 6/6/2019
** Description: Source code for implementation of questions
** for menu.
******************************************************************/
#include "sMenu.hpp"
/***************... | true |
bc09c87c24f48d145ab493e66f90bf39ffd1f91b | C++ | IngeDannyel/proytorta | /tortas.cpp | UTF-8 | 2,582 | 2.75 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<locale.h>
#define s scanf
#define p printf
struct menu{
int cantidad,costo;
};
main()
{
setlocale(LC_ALL,"esm");
char sel, cin[100];
int suma=0,i,aux;
FILE *arch;
system ("color f0");
struct menu c[4];
for(i=0;i<4;i++) //Declaración de ca... | true |
9fd55e86b225e7f7489dbb2e484e9cf86fa5e4f8 | C++ | dkorytov/dtk | /dtk/math.hpp | UTF-8 | 3,352 | 2.890625 | 3 | [] | no_license | #ifndef DTK_MATH_HPP
#define DTK_MATH_HPP
#include <cmath>
#include <cstdlib>
#include <random>
#include "hdf5_util.hpp"
namespace dtk{
std::default_random_engine dtk_random_engine;
template<class T,class U>
T max(T* data, U size){
T max_val = data[0];
for(U i =1;i<size;++i){
if(data[i]>max_val)
... | true |
c358aa07a59b6a23e516f30e8feeaf8c4423d9ec | C++ | kiner-shah/CompetitiveProgramming | /Codechef/LoC Competitive Programming Marathon/rectangles.cpp | UTF-8 | 671 | 2.765625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
int l1,w1,l2,w2;
cin>>t;
while(t-- > 0) {
cin>>l1>>w1>>l2>>w2;
if(l1 == l2 && w1 == w2) {
cout<<l1 * w1 + l2 * w2 - w1 * l2<<" ";
cout<<l1 * w1 + l2 * w2<<endl;
}
else {
if(l1 < l2) {
if(w1 < w2) {
cout<<l2 * w2<<" ";
c... | true |
fa59e513642ea539efb2e71be8b0cc45c58c9630 | C++ | johanjm/Algoritmos-Estructura-Datos | /Quicksort/ordenamiento-quicksort.cpp | UTF-8 | 1,708 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
double ingresoP(int n,int m, string c);
void ordenar(int arr[], int pinicial, int pfinal);
void imp(int a[],int n);
int mitad (int arr[], int pinicial, int pfinal);
ofstream archivo;
int main() {
int n=0;
archivo.open("interpolacion.txt", ios::app);
... | true |
d24feae98656a3159da604ff6efa5b0f36f4d81c | C++ | marekrynarzewski/pto_gimpByMarek | /src/core/transformations/correction.cpp | UTF-8 | 1,592 | 2.734375 | 3 | [] | no_license | #include "correction.h"
#include <math.h>
#include <algorithm>
using namespace std;
Correction::Correction(PNM* img) :
Transformation(img)
{
}
Correction::Correction(PNM* img, ImageViewer* iv) :
Transformation(img, iv)
{
}
template <typename T>
T range(T min, T val, T max)
{
T result;
if (val < min)
... | true |
6bea956ed37d7ecde445462836650e385ec02c71 | C++ | tanker242/csci41-heap-rpg | /fight.h | UTF-8 | 1,493 | 3.328125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <fstream>
using namespace std;
void fightMove (){
string line;
int random = 0;
random = rand() % 470;
int numberOfmoves = 0;
vector<string> moves;
ifstream File("randomMoves.txt");
while (getline(File, line)){
... | true |
3e098c8aced09699fdd4bd2fd0d7e74d799c883a | C++ | tanvib00/Strength-Balance-Device | /final_project.ino | UTF-8 | 7,779 | 2.671875 | 3 | [] | no_license |
#include <SPI.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "Queue.h"
#include "HX711.h"
#define DOUT 3 // Load cell pin 1
#define CLK 2 // Load cell pin 2
#define BUTX 8
#define BUTR 9
#define BUTL 10
#define CALIBRATION_FACTOR -7050
#define WINDOW_SIZE 5
#define AVERAGES_SIZE 5
LiquidCrystal_I2C s... | true |
57690741b235e70c053ae83f468e581aba0991b1 | C++ | starand/cpp_fw | /algorithm/algorithm.h | UTF-8 | 771 | 3.296875 | 3 | [] | no_license | #ifndef __H_ALGORITHM__
#define __H_ALGORITHM__
#ifndef min
# define min( a, b ) ((a) > (b) ? (b) : (a))
#endif
namespace Algorithm
{
template<class T> void swap( T& a, T& b )
{
T tmp = a; a = b; b = tmp;
}
template<typename T>
bool CheckIfValuesExists( const vector<T>& vtList, const T& tValue )
{
bool bR... | true |
161b3acf0127f607a4a1132ccd8dca7d7635fe17 | C++ | floralunit/SPbCT_YaskunovaAY | /EducationalPractice/EduPractice/DLL.cpp | WINDOWS-1251 | 471 | 2.734375 | 3 | [] | no_license | #include "DLL.h"
void writeToFile2(const std::vector<char>& vector) //
{
std::ofstream file2("2.txt", std::ios::app); //
copy(vector.begin(), vector.end(), std::ostream_iterator<char>(file2)); //
file2 << std::endl; //
file2.close(); //
}
| true |
ea708e497b2226ed624ff7143e07949595468469 | C++ | ThetaQing/algorithms-and-data-structures | /MyTest/diagonalMatrix.h | GB18030 | 1,718 | 3.9375 | 4 | [] | no_license | #ifndef __DIAGONALMATRIX_
#define __DIAGONALMATRIX_
#include "arrayAndMatrix.h"
/****************ԽǾ******************
* diagonalMatrix<T>
* ˵һrow*rowsĶԽǾDֻrows0Ԫأ˿һһάelement[rows]ʾԽǾУ
element[i-1]ʾD(i,i)δһάгֵľԪؾΪ0.
* ʱ临Ӷȣڹ캯ʱ临Ӷ˵TڲʱΪO(1)TûʱΪO(rows)
getsetʱ临ӶȶO(1)
**/
template<class T>
class diagonalMatrix
{
publ... | true |
f33d22ef349980c8997e66a08bd66031abfb2dfb | C++ | huanggangfeng/Leetcode | /Cpp/栈_队列_堆_hash/220. 存在重复元素 III.cpp | UTF-8 | 2,758 | 3.28125 | 3 | [] | no_license |
// 在整数数组 nums 中,是否存在两个下标 i 和 j,使得 nums [i] 和 nums [j] 的差的绝对值小于等于 t ,且满足 i 和 j 的差的绝对值也小于等于 ķ 。
// 如果存在则返回 true,不存在返回 false。
//
// 示例 1:
// 输入: nums = [1,2,3,1], k = 3, t = 0
// 输出: true
// 示例 2:
// 输入: nums = [1,0,1,1], k = 1, t = 2
// 输出: true
// 示例 3:
// 输入: nums = [1,5,9,1,5,9], k = 2, t = 3
// 输出: false
//... | true |
38df03ff94484fb5f2efd37b3c3ea13afd59f51f | C++ | oliviaSIT/leetcode | /648ReplaceWords.cpp | UTF-8 | 1,964 | 3.734375 | 4 | [] | no_license | /*
*time:
*solution: hash trie
*medium:
*/
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <sstream>
using namespace std;
class Solution {
public:
class TrieNode{
public:
bool end;
string str;
TrieNode* children[26];
TrieNode(bool flag, string s): end(flag), str(s) {... | true |
8f8ab835e2ec1be730b5991486d0c7598388dda7 | C++ | Cloverii/LeetCode | /11**.cpp | UTF-8 | 1,103 | 2.921875 | 3 | [] | no_license | class Solution {
public:
int maxArea(vector<int>& height) { // two pointers
/* int h[2];
h[0] = 0, h[1] = height.size() - 1;
int ans = min(h[0], h[1]) * (h[1] - h[0] + 1);
while(h[0] < h[1]) {
bool flag = height[h[0]] > height[h[1]]; //flag = lowID;
int step ... | true |
1107014f49a0f1b8b0779c5ea74a24ad1d43fb60 | C++ | jaxonwang/my_leetcode | /problems/lt5.cc | UTF-8 | 831 | 3.296875 | 3 | [
"MIT"
] | permissive |
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
string longestPalindrome(string s) {
int s_size = s.size();
if (s_size == 0)
return "";
bool tb[s_size+1][s_size];
for (int i = 0; i < s_size; i++) {
tb[0][i] = true;
tb[1][i] = true;
}
... | true |
4d9e7e6628fc4650d9035444f3f80f6755ed649c | C++ | shobhit3661/Amazon-GeeksforGeeks | /sub Super Array.cpp | UTF-8 | 1,108 | 3.171875 | 3 | [] | no_license | /*
Sub SuperArray HackerRank Problem
You are given an array of size containing distinct integers. You have to choose two non-overlapping subarrays and join them to make a super array such that all elements in the super array are strictly in increasing order. Find the maximum size of the super array.
For example... | true |
7f4f3dc7a6e90fbff8c240d3421f04e60b325b25 | C++ | zmaker/arduino_cookbook | /264-graficoxy-oled/grafico_xy_oled/grafico_xy_oled.ino | UTF-8 | 1,238 | 2.53125 | 3 | [] | no_license | #include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIG... | true |
56dcdd45fff0ba38a6544b1d50204aee2aceff57 | C++ | abduld/llambda | /runtime/binding/ProcedureCell.h | UTF-8 | 1,048 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef _LLIBY_BINDING_PROCEDURECELL_H
#define _LLIBY_BINDING_PROCEDURECELL_H
#include "RecordLikeCell.h"
namespace lliby
{
class World;
/**
* Represents a Scheme procedure of an unknown type
*
* Untyped procedures can only have garbage collection performed on them. To be applied their exact type must be known.
... | true |
d22f9c3256b0671beed43e0f5135e6b1e875d401 | C++ | tdk0371/learning_cpp | /newdel.cpp | UTF-8 | 2,466 | 3.71875 | 4 | [] | no_license | #include<iostream>
using std::string;
using std::cout;
using std::endl;
class POINT {
public:
int x;
int y;
POINT() {};
POINT(int nx, int ny): x(nx), y(ny) {cout<<"point initialized"<<endl;}
~POINT() {cout<<"destructor invoked"<<endl;}
};
class VECTOR {
public:
POINT start;
POINT end;
VECTOR () {start.x=0;s... | true |
6767b917502dacf60e442a808298d882916c8f18 | C++ | khoiuit99/game | /03-Keyboard-States/Entity.cpp | UTF-8 | 2,660 | 2.734375 | 3 | [] | no_license | #include <d3dx9.h>
#include "Debug.h"
#include "GameManager.h"
#include "Entity.h"
#include "Sprite.h"
Entity::Entity()
{
this->velocity.x = 0;
this->velocity.y = 0;
}
Entity::~Entity()
{
}
void Entity::SetAliveState(Alive_State _alive)
{
this->aliveState = _alive;
}
void Entity::SetVelocity(float x, float y)
{
... | true |
584159015de7534b813ad473f6f617537288f8a3 | C++ | CIDCO-dev/SBET-decoder | /test/SbetPrinterTest.hpp | UTF-8 | 4,512 | 2.578125 | 3 | [
"MIT"
] | permissive | /*
* Copyright 2017 © Centre Interdisciplinaire de développement en Cartographie des Océans (CIDCO), Tous droits réservés
*/
/*
* File: SbetPrinterTest.hpp
* Author: jordan
*/
#ifndef SBETPRINTERTEST_HPP
#define SBETPRINTERTEST_HPP
#include "catch.hpp"
#include <string>
#include <sstream>
#include <cmath>
#in... | true |
38c452ed6efcbdbb6f13937523636d1d186e59f2 | C++ | RexHac/ccompilerwithlex-yacc | /oldversion/Tree.cpp | UTF-8 | 2,474 | 3.171875 | 3 | [] | no_license | #include "Tree.h"
syntaxTree *createTree(string name, int num, ...)
{
va_list argList;
syntaxTree* head = new syntaxTree();
if (!head)
{
printf("create head failed!\n");
exit(0);
}
head->childrenAccount = NULL;
head->children = NULL;
head->value = "";
syntaxTree* temp... | true |
9f5f4a436135bd013039a231af8d0cddb39d8966 | C++ | 00mjk/Honeycomb-Game-Engine | /Honeycomb GE/include/object/GameObject.h | UTF-8 | 36,414 | 3.09375 | 3 | [
"MIT"
] | permissive | #pragma once
#ifndef GAME_OBJECT_H
#define GAME_OBJECT_H
#include <deque>
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "../component/GameComponent.h"
#include "../debug/Logger.h"
namespace Honeycomb { namespace Component { class GameComponent; } }
namespace Honeycomb { namespa... | true |
f8cbcf17afa78e7685a99390c0e128bb34ae6e3b | C++ | hkmangla/cppProgramms | /c.cpp | UTF-8 | 793 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
#define SIZE 13
int boyerMoore(int arr[]) {
int current_candidate = arr[0], counter = 0, i;
for (i = 0; i < 11; ++i) {
if (current_candidate == arr[i]) {
++counter;
printf("candidate: %i, counter: %i\n",current_candidate,counter);
} else if ... | true |
5bafc7024492fd90cba543385523a35d22769eb2 | C++ | Nikhil12321/codes | /rod_cutting.cpp | UTF-8 | 648 | 3.359375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<climits>
using namespace std;
int rodCutting(vector<int> &prices){
int n = prices.size();
int i, j;
int ans[n+1];
ans[0] = 0;
for(j = 1; j<=n; j++){
int max = INT_MIN;
for(i = 0; i<j; i++){
if(prices[j-i-1] + ans[i... | true |
20dc43a322e2ca2aa60c846283396a52a135b27b | C++ | ana-GT/Lucy | /RST_Summer_Code/Hope/dijkstra.cpp | UTF-8 | 7,647 | 2.734375 | 3 | [] | no_license | /**
* @file dijkstra.cpp
*/
#include "dijkstra.h"
const int Dijkstra3D::mNX[26] = { -1,-1,-1, -1,-1,-1, -1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
const int Dijkstra3D::mNY[26] = { -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 0, 1, -1, 1, -1, 0, 1, -1, 0, 1,-1, 0, 1,-1, 0, 1 };
const int Dijkstr... | true |
cdc07697f432b12c4c1e32a91b7cb6ea5b0378ed | C++ | aag-github/mastermind | /src/controllers/client/MainMenuController.h | UTF-8 | 2,899 | 2.546875 | 3 | [] | no_license | #ifndef SRC_CONTROLLERS_MENUCONTROLLER_H_
#define SRC_CONTROLLERS_MENUCONTROLLER_H_
#include <assert.h>
#include "CombinationController.h"
#include "CommonMenuController.h"
#include "ReadCombinationController.h"
#include "QuitController.h"
#include "RestartController.h"
#include "LoadGameController.h"
#include "Save... | true |
b48b3e018eafdb08145a18793b5d3840fac951a0 | C++ | rishilss99/InterviewBit | /Problems/pascal_triangle.cpp | UTF-8 | 521 | 3.109375 | 3 | [] | no_license | void add_elements(vector<vector<int>> &result){
vector<int> arr;
for(int i = 0;i<result.back().size();i++){
if(i==0)
arr.push_back(1);
else
arr.push_back(result.back()[i-1] + result.back()[i]);
}
arr.push_back(1);
result.push_back(arr);
}
vector<vector<int> >... | true |
274f9c53d184ab954d11bdebb0e2c5a32f912912 | C++ | ketansahu07/Interview | /Graph/word ladder.cpp | UTF-8 | 2,755 | 3.6875 | 4 | [] | no_license | /*
Given a dictionary, and two words ‘start’ and ‘target’ (both of same length).
Find length of the smallest chain from ‘start’ to ‘target’ if it exists, such that
adjacent words in the chain only differ by one character and each word in the chain
is a valid word i.e., it exists in the dictionary.
It may be assume... | true |
b1e57e82158a882df82666d905b3e9a656c8ea95 | C++ | Gouga34/TERM1_Poker | /Application/src/Profiling/CalculateProfilingData.cpp | UTF-8 | 6,906 | 2.8125 | 3 | [] | no_license | /*========================================================================
Nom: CalculDonneesProfilage.h Auteur: Morgane Vidal
Maj: 25/03/2015 Creation: 25/03/2015
Projet: Profilage par essais et erreurs au poker
--------------------------------------------------------------------------
Specification: ... | true |
63add5e1d5926705fbf50716869902d818d98568 | C++ | kwmoore81/MathLibrary | /Math Library/vec3.cpp | UTF-8 | 4,329 | 3.109375 | 3 | [] | no_license | #include "vec3.h"
using namespace kml;
vec3 kml::reflect(const vec3 & incident, const vec3 & normal)
{
vec3 reflection;
reflection.x = incident.x - 2 * (incident.x * normal.x) * normal.x;
reflection.y = incident.y - 2 * (incident.y * normal.y) * normal.y;
reflection.z = incident.z - 2 * (incident.z * normal.z) *... | true |
d56dc34fae0d9acfa1bfbdf9caae113dfbaf63b8 | C++ | hamburgerBear/simple-udp-protocol | /sender/main.cpp | UTF-8 | 387 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <unistd.h>
#include "CUdpCommunication.h"
int main()
{
CUdpCommunication udp_sender;
udp_sender.configSender();
while(1)
{
static float x = 1.0;
static float y = 1.2;
// udp_sender.send(100.0, 200.0);
udp_sender.send(x, y);
std::cout << "send udp message" << std::endl;
... | true |
cf868293c57a6dd713afa32b2fe0acb2676e9da7 | C++ | robo8080/ESP32_IchigoLatte_Telnet | /ESP32_IchigoLatte_Telnet/ESP32_IchigoLatte_Telnet.ino | UTF-8 | 17,021 | 2.734375 | 3 | [
"MIT",
"CC-BY-4.0"
] | permissive | //#include <WiFi.h>
#include <WiFiClientSecure.h>
#include <QueueArray.h>
HardwareSerial Serial1(2);
//rxPin = 16
//txPin = 17
// create a queue of characters.
QueueArray <char> queue;
const char* ssid = "******************";
const char* password = "******************";
WiFiServer server(10001);
WiFiClient serverClien... | true |
e3ffc24afe7e664c73862c5b0758a5871215c912 | C++ | RobJenks/rj-engine | /RJ/ShipTileRequirement.h | UTF-8 | 1,230 | 2.921875 | 3 | [] | no_license | #pragma once
#ifndef __ShipTileRequirementH__
#define __ShipTileRequirementH__
class ComplexShipTileClass;
class ComplexShipTileDefinition;
class ShipTileRequirement
{
public:
// Requirement can be for a tile class and/or specific tile definition. We can also specify how many are required
ComplexShipTileClass * ... | true |
02390db793c6236361a60d54d8bcbaece9346086 | C++ | joel-perez/9515Algo2Juarez | /TP3/Arista.h | UTF-8 | 377 | 2.765625 | 3 | [] | no_license | #ifndef ARISTA_H
#define ARISTA_H_
#include <iostream>
class Vertice;
class Arista {
private:
Vertice* destino;
public:
//PRE: -
// POST: Arista con un destino fijado.
Arista(Vertice* destino);
//PRE: -
// POST: Devuelve el destino asociado a la arista.
Vertice* obtener_destino();
//PRE: -
// POST... | true |
ca55fea0c20ff282efe104562d29b48f48c4542f | C++ | MrMCG/MGL_old | /MGL/MGLMeshGenerator.cpp | UTF-8 | 2,176 | 2.796875 | 3 | [] | no_license | #include "stdafx.h"
#include "MGLMeshGenerator.h"
#include "MGLMesh.h"
MGLMesh* MGLMeshGenerator::Triangle() {
MGLMesh* mesh = new MGLMesh();
GLuint numVert = 3;
mesh->SetNumVertices(numVert);
MGLvecv3* m_vertices = new MGLvecv3(numVert);
MGLvecv2* m_texCoords = new MGLvecv2(numVert);
MGLvecv3* m_normals = ne... | true |
93ee5fc511f7c5c3964069704c0a6e9f6ee75b07 | C++ | chinmaya00/lab6 | /lab6q5a.cpp | UTF-8 | 879 | 4.15625 | 4 | [] | no_license | #include<iostream>
using namespace std;
//write a program that includes sum, maximum and minimum
//finding sum
int func1(int a,int b){
int c=a+b;
return c;
}
//finding maximum
int func2(int a, int b){
if(a>b){
return a;
}
else
return b;
}
//finding minimum
int func3(int a, int b){
if(a<b){
return a;
}
else
... | true |
0b379c5c713b5cc9ad8b7f5869e85b6b7ca61e24 | C++ | gcjjyy/acmicpc | /2407.cpp | UTF-8 | 1,289 | 3.109375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
class BigInteger
{
public:
int length;
char buf[100];
BigInteger() {
length = 1;
for(int i = 0; i < 100; ++i) buf[i] = 0;
}
void put() {
for(int i = length - 1; i >= 0; --i) printf("%d", buf[i]);
printf("\n");
}
void set(unsigned ... | true |
01cfc414f3c468c1988e905f485c3eb06a88a2a3 | C++ | bratek20/Queue | /kolejka/main.cpp | UTF-8 | 1,305 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "Queue.h"
using namespace std;
Queue factory() {
Queue q = Queue({ "elo", "r", "value", "rzadzi" },10);
return q;
}
int main() {
Queue* queue = new Queue(5);
string command;
while (true) {
try {
cin >> command;
if... | true |
e5c18f7e4950f88fccc7127164ecec8a7f596faa | C++ | mpearso3/Game-Engine-Tutorial | /Map.cc | UTF-8 | 515 | 3.046875 | 3 | [] | no_license | #include "Map.hpp"
#include "Game.hpp"
#include <fstream>
Map::Map()
{
}
Map::~Map()
{
}
void Map::load_map(std::string path, int size_x, int size_y)
{
char tile;
std::fstream map_file;
map_file.open(path);
{
for(int y = 0; y < size_y; y++)
{
for(int x = 0; x < size_x; x++)
{
map_... | true |
710dcb8edfbcee5981fbb3e2ce1ccd87b982c896 | C++ | CStratton00/FantasyFightingGame | /NextMove.h | UTF-8 | 1,012 | 3.296875 | 3 | [] | no_license | //
// Created by Collin Stratton on 4/14/20.
//
#ifndef FANTASYFIGHTINGGAME_NEXTMOVE_H
#define FANTASYFIGHTINGGAME_NEXTMOVE_H
#include <string>
#include <vector>
#include "DirectionPair.h"
using namespace std;
class NextMove { // Class used store data about the description, location, and directions of a given playe... | true |
c3f517a7a502c6f4d0c1d6c77236d8c868c97e17 | C++ | YadurajRao/Proof-Trapar-Pass | /libfaudes-2_29d/include/tp_attributes.h | UTF-8 | 7,501 | 2.625 | 3 | [] | no_license | /** @file tp_attributes.h Attributes for timed automata */
/* Timeplugin for FAU Discrete Event Systems Library (libfaudes)
Copyright (C) 2006 Berno Schlein
Copyright (C) 2007 Thomas Moor
Exclusive copyright is granted to Klaus Schmidt
*/
#ifndef FAUDES_TP_ATTRIBUTES_H
#define FAUDES_TP_ATTRIBUTES_H
#include ... | true |
7f1fdcdd51583a7c887bfbfeca6e323d48d279ca | C++ | spacetelescope/spherical_geometry | /libqd/src/c_dd.cpp | UTF-8 | 6,630 | 2.921875 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* src/c_dd.cc
*
* This work was supported by the Director, Office of Science, Division
* of Mathematical, Information, and Computational Sciences of the
* U.S. Department of Energy under contract number DE-AC03-76SF00098.
*
* Copyright (c) 2000-2001
*
* Contains the C wrapper functions for double-double pre... | true |
fde166e12cff2d4e0c2f83a081256b60ab34c35f | C++ | Somefive/MercuryJson | /src/tape.cpp | UTF-8 | 33,589 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "tape.h"
#include <assert.h>
#include <string.h>
#include <math.h>
#include <cassert>
#include <sstream>
#include <thread>
#include <future>
#include "constants.h"
#include "flags.h"
#include "mercuryparser.h"
#include "utils.h"
#include "parsestring.h"
namespace MercuryJson {
[[noreturn]] void _erro... | true |
4cc60655f6cdad2a03b13a45fd855a182bf746d6 | C++ | serega111198/bubble-sorting | /bubble-sorting.cpp | UTF-8 | 611 | 3.3125 | 3 | [] | no_license | #include "stdafx.h"
int swap(int *xp, int *yp) {
int temp = *xp;
*xp = *yp;
*yp = temp;
}
int bubbleSortingUp(int a[], int size) {
int x, j;
for (int i = 0; i < size - 1; i++)
{
if (a[i] < -1500000000 || a[i]>1500000000)
return 1;
for (j = 0; j < size - 1 - i; j++)
if ((a[j] < a[j + 1]))
swap(&a... | true |
72de0b32fba4f12ccd2466101bb1ec7f6b6ed328 | C++ | gpudev0517/Fire-Simulator | /NVIS/Code/Geometry/Utility/NEVentCriteria.h | UTF-8 | 1,295 | 2.609375 | 3 | [] | no_license | #pragma once
class NECEXP_GEOMETRY NEVentCriteria
{
public:
enum CriteriaType
{
Temperature = 0,
Time = 1
};
struct VentValues
{
double m_Threshold;
double m_Percent;
VentValues()
{
m_Threshold = 0.0;
m_Percent = 0.0;
}
... | true |
002675d6da6689a0616178fe34bc94451b54d89c | C++ | andrewusc/Clone-of-STL | /alloc.h | UTF-8 | 1,669 | 2.890625 | 3 | [] | no_license |
#ifndef __TinySTL__alloc__
#define __TinySTL__alloc__
#include <stdio.h>
#include <cstdlib>
namespace TinySTL{
/*
** Space allocator
*/
class alloc{
private:
enum EAlign { ALIGN = 8 };
enum EMaxBytes { MAXBYTES = 128};
enum ENFreeLists{ NFREELISTS = (EMaxBytes::MAXBYTES)/(E... | true |
1a157413ae63c7251ee92f9997851a5c49d02e67 | C++ | dvetutnev/learn_discrete_math | /find_sum/find_sum.h | UTF-8 | 2,184 | 3.296875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <vector>
#include <set>
#include <utility>
#include <optional>
#include <cassert>
#include <unordered_set>
namespace bruteforce {
// Return pair numbers, not index
inline std::optional<std::pair<std::size_t, std::size_t>> findPair(const std::vector<std::size_t>& set, std::size_t sum) {
f... | true |
8eefdf39a83a0d7a30fe6680f3501abaa7eb8a09 | C++ | AlenaMitrakhovich/OOP244-Introduction-to-Object-Oriented-Programming | /Workshop8/w8_in_lab.cpp | UTF-8 | 818 | 3.015625 | 3 | [] | no_license | // OOP244 Workshop 8: Derived Classes
// File w8_in_lab.cpp
// Version 1.0
// Date 2016/11/06
// Author Franz Newland, Eden Burton
// Description
// This file demonstrates the client module of w8
/////////////////////////////////////////////////////
#include <iostream>
#include "Hero.h"
int main()
{
H... | true |
28325cb6111d7aa0ec339d2640b8edd3ec5c44c9 | C++ | p0kemo4ik/oop_exercise_08 | /octagon.cpp | UTF-8 | 1,083 | 3.265625 | 3 | [] | no_license | #include "octagon.hpp"
#include <cmath>
#include "vertex.hpp"
vertex octagon::center() const {
double x = 0;
double y = 0;
for(int i = 0; i < 8; i++){
x += Vertexs[i].x;
y += Vertexs[i].y;
}
x /= 8;
y /= 8;
vertex p(x,y);
return p;
}
void octagon::print(std::ostream& o... | true |
ad16fc59005f807aca401dd320b361826770f337 | C++ | cerebis/MetaCarvel | /OGDF/include/ogdf/fileformats/xml/Parser.h | UTF-8 | 3,434 | 2.53125 | 3 | [
"LGPL-2.1-or-later",
"GPL-3.0-only",
"GPL-1.0-or-later",
"EPL-1.0",
"MIT",
"GPL-2.0-only",
"LicenseRef-scancode-generic-exception",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /** \file
* \brief Declarations for simple XML parser.
*
* \author Łukasz Hanuszczak
*
* \par License:
* This file is part of the Open Graph Drawing Framework (OGDF).
*
* \par
* Copyright (C)<br>
* See README.txt in the root directory of the OGDF installation for details.
*
* \par
* This program is free so... | true |
6ca139f49a9a71eff1f2efedace32716932e2794 | C++ | imrasp/CameraChecker | /main.cpp | UTF-8 | 2,609 | 2.734375 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: May 15, 2017
* Author: rasp
*/
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
//#include <boost/thread.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <thread>
using name... | true |