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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22955b6653299276fc0dc9e280a715a061b20006 | C++ | SerenityOS/serenity | /Userland/Utilities/pkg/InstalledPort.h | UTF-8 | 1,238 | 2.78125 | 3 | [
"BSD-2-Clause"
] | permissive | /*
* Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/HashMap.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <AK/Types.h>
class InstalledPort {
public:
enum class Type {
Auto,
Dependency,
Manual,
... | true |
463ed6ac0eb946cf171516e59909e97507c6f77a | C++ | marcuscraske/project-euler | /PE_CPP/PE_CPP/Solution035.cpp | UTF-8 | 1,900 | 3.46875 | 3 | [
"WTFPL"
] | permissive | #pragma once
#include "Solution035.h"
#include "SolutionIncludes.h"
#include "SievePrimes.h"
#include <vector>
#include <algorithm>
int Solution035::problemNumber()
{
return 35;
}
string Solution035::title()
{
return "Number of circular primes below one million.";
}
void Solution035::execute()
{
int limit = 1000000... | true |
0033ae5d616714884d4f8bdce77460c4adc0463e | C++ | Haozhu3/Comp_Arch | /Lab12/simplecache.cpp | UTF-8 | 706 | 2.875 | 3 | [] | no_license | #include "simplecache.h"
int SimpleCache::find(int index, int tag, int block_offset) {
// read handout for implementation details
auto & vec = _cache[index];
for (size_t i = 0; i < vec.size(); i++) {
if (vec[i].valid() == 1 && vec[i].tag() == tag) {
return vec[i].get_byte(block_offset);
}
}
ret... | true |
5822f1cdc9d8cfcf660e2ed2b8d9938d431d6dab | C++ | Exoil/DirectedOrderNumber | /CpuSourceCode/DirectedEquation.cpp | UTF-8 | 22,103 | 3.09375 | 3 | [] | no_license | #include "./DirectedOrderNumber.cpp"
#include <vector>
#include <string>
#include <algorithm>
#include <time.h>
#include <filesystem>
#if defined(_MSC_VER)
#include <direct.h>
#define getcwd _getcwd
#elif defined(__GNUC__)
#include <unistd.h>
#endif
#include <iomanip>
#include <sstream>
#include <fstream>
#include <sys... | true |
c0954fe0dfc374346ba7698b99832a46932cf545 | C++ | VinInn/ctest | /vectorize/extNotAlign.cc | UTF-8 | 1,906 | 2.78125 | 3 | [] | no_license | typedef float __attribute__( ( vector_size( 16 ) ) ) float32x4_t;
typedef float __attribute__( ( vector_size( 16 ) , aligned(4) ) ) float32x4a4_t;
typedef int __attribute__( ( vector_size( 16 ) ) ) int32x4_t;
float32x4_t load(float32x4a4_t x) {
return x;
}
// float v[3*1024];
float32x4_t load(float const * x) {... | true |
c9765cc034fc8e17845c71b173a9b21ff4ae2f72 | C++ | mbfilho/icpc | /UNICAMP summer school/18.01/key.cpp | UTF-8 | 3,654 | 2.640625 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <ctime>
#include <cstdlib>
using namespace std;
#define N 500000
#define M 500000
int resp[ M ], c;
struct No{
int x, y;
int val;
int cont;
int esq, dir;
No(){
x = 8; y = 0; val = -1; cont = -1; esq = 0; dir = 0;
}
void set( int ind ){
... | true |
b56268ab0e5d7befca6a3eb990b2abf0aa64f386 | C++ | iliayar/ITMO | /Term2/algo/labs/lab1/taskE.cpp | UTF-8 | 2,549 | 2.640625 | 3 | [] | no_license |
// Generated at 2020-02-24 04:17:28.330777
// By iliayar
#include <iostream>
#include <vector>
#include <chrono>
#include <algorithm>
#include <cstdio>
using namespace std;
//##################CODE BEGIN#############
class Matrix {
public:
int a[2][2];
Matrix(int, int, int, int);
Matrix operator*(Matrix... | true |
ab984d50e357abc9511009a1d246923f172301d5 | C++ | DougGregor/swift | /unittests/Basic/TreeScopedHashTableTests.cpp | UTF-8 | 3,180 | 2.828125 | 3 | [
"Apache-2.0",
"Swift-exception"
] | permissive | #include "swift/Basic/TreeScopedHashTable.h"
#include "gtest/gtest.h"
using namespace swift;
TEST(TreeScopedHashTableTest, T1) {
using HashtableTy = TreeScopedHashTable<unsigned, unsigned>;
using ScopeTy = HashtableTy::ScopeTy;
HashtableTy HT;
auto S1 = new ScopeTy(HT, 0);
HT.insertIntoScope(*S1, 1, 1001);... | true |
4317ad0fd1c485ec2c416aa54c24d3ac5ddb8084 | C++ | Vladyslav13/Qt | /modules/NoteBookGui/src/AdditionalContactInfo.cpp | UTF-8 | 2,835 | 2.734375 | 3 | [] | no_license | #include "pch.h"
#include "AdditionalContactInfo.h"
namespace notebook
{
//
// Definition of the AdditionalContactInfo class.
//
AdditionalContactInfo::AdditionalContactInfo(QWidget *parent)
: QGroupBox{ parent }
, address_{ new QTextEdit }
, birthday_{ new QDateEdit }
, cancelButton_{ new QPushButton{ tr("Canc... | true |
24cf0de7463eb9e3432b8f39903bf90cf12fa6c2 | C++ | mangesh-kurambhatti/CPP | /Cpp-Programms/Date Class/Date.h | UTF-8 | 413 | 3.046875 | 3 | [] | no_license | #ifndef DATE_H
#define DATE_H
class SpecialDate
{
int dd;
int mm;
public:
SpecialDate(int dd,int mm);
};
class Date
{
int dd,mm,yy;
public:
Date();
Date(int dd);
Date(int dd,int mm,int yy);
void SetDD(const int dd);
void SetMM(const int mm);
void SetYY(const int yy);
int GetDD() const;
in... | true |
9aed3c8af42dc9dc07516b040adb0fa5fa9ef2f7 | C++ | jsdjayanga/mcp | /MatrixMultiplication/MatrixMultiplication.cpp | UTF-8 | 8,649 | 3.046875 | 3 | [] | no_license | /*
* File: MatrixMultiplication.cpp
* Author: jayangad
*
* Created on July 15, 2013, 1:57 PM
*/
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <CommandLineParser.h>
#include <Utils.h>
#include <set>
#include <vector>
#include <sstream>
using namespace std;
double** source_matrix_1 = NULL;
... | true |
74f61aeafa8d328d20b114a243b920bccbf2ef90 | C++ | shreya1901/Cpp_Program | /smallest_divisible.cpp | UTF-8 | 606 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
//Function returns the lcm of first n numbers
long long lcm(long long n)
{
long long ans = 1;
for (long long i = 1; i <= n; i++)
ans = (ans * i)/(__gcd(ans, i));
return ans;
}
//Driver program to test the above function
int main()
{
... | true |
4216b532c016a981bbb16a7a4cd973990b702cf6 | C++ | zpervan/NeuralNetworks | /Libraries/Base/neural_network_data.h | UTF-8 | 720 | 2.578125 | 3 | [] | no_license | #ifndef NEURALNETWORK_NEURAL_NETWORK_ARCHITECTURE_DATA_H
#define NEURALNETWORK_NEURAL_NETWORK_ARCHITECTURE_DATA_H
#include "../activation_functions.h"
#include <cstdint>
using Id = std::uint64_t;
using Value = double;
using Weight = double;
/// @TODO: Add multiple levels of hidden layer
struct NeuralNetworkArchitec... | true |
5b7ea7b28153bdf343970af7c6edba2c42c1ef8f | C++ | GayathriSuresh69999/CS141-LAB5.5 | /lab5.5_q8.cpp | UTF-8 | 292 | 3.40625 | 3 | [] | no_license | // First include the libraray and the main function
#include<iostream>
using namespace std;
int main()
{
int i=1,j;
// Do the following five times
while(i<=5)
{
// Print stars in the increasing order
for (j=0;j<i;j++)
{
cout << "*";
}
// Go to the next line
cout << endl;
i++;
}
return 3;
}
| true |
a31a8c4caa2a98f567e882c56fc9ab2c13020b0d | C++ | ismailvohra/raytracer | /raytracer/samplers/RegularBox.cpp | UTF-8 | 1,425 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "RegularBox.hpp"
#include "../cameras/Camera.hpp"
#include "../utilities/Ray.hpp"
#include "../world/ViewPlane.hpp"
RegularBox::RegularBox(Camera* c_ptr, ViewPlane* v_ptr, size_t degree)
: Sampler(c_ptr, v_ptr), degree{degree}, weight{1.0 / degree / degree} {}
Regul... | true |
c2b2a6194b14a6b728a5c026c5d953411a89908a | C++ | 100sarthak100/DataStructures-Algorithms | /Code/Trees/BSTtreefromPreOrder.cpp | UTF-8 | 1,063 | 3.390625 | 3 | [] | no_license | // Input: [8,5,1,7,10,12]
// Output: [8,5,10,1,7,null,12] ->inorder return
class Solution {
public:
TreeNode* newNode(int data)
{
TreeNode* newnode = new TreeNode;
newnode->val = data;
newnode->left = NULL;
newnode->right = NULL;
return newnode;
}
Tre... | true |
4f417499dd03b09a51707e1d5b9479e14f6ccf24 | C++ | George-Tech/cpp_stl | /c_map.cpp | GB18030 | 3,905 | 3.84375 | 4 | [] | no_license | #include "cpp_base_head.h"
/*
map ǹһ֡ڹУλȡںļֵ
ǻ(int string ...)Ҳ͡
*/
//------
/*
map 4 ֣ÿһֶģ嶨ġ
͵ map ĶǼֵ͵Ԫء
map Ԫ pair<const KT> ͵Ķֶװһ T ͵Ķһ K ͵ļ
pair Ԫеļ constΪļԪص˳
ÿ map ģ嶼вͬԣ
1.map<KT> pair<const KT> ͵Ԫء
pair<const K,T> װһԼ K T
ÿΨһģԲظļԱظĶֻҪǵļͬ
map еԪضģԪڵ˳ͨȽϼȷġ
Ĭʹ less<K> Ƚϡ
2.multimap<KT> map<KT> ƣҲԪ
ļǿɱȽϵģ... | true |
772778bce5ecd52cf05824844bd63d632c565cd2 | C++ | iGNSS/ALT-F4 | /software/src/reference/frame.cpp | UTF-8 | 19,516 | 3.046875 | 3 | [] | no_license | #include <opencv2/core.hpp>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <stack>
#include "global.hpp"
#include "frame.hpp"
#include "blob.hpp"
/**********************************************************************************/
/**** Constructors... | true |
92bb606ffdae91f26460726080be1cbb270b562d | C++ | aautushka/measure | /tests/metric_trie_tests.cpp | UTF-8 | 5,923 | 2.734375 | 3 | [
"Unlicense"
] | permissive | /*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copy... | true |
4bf3e0718bb7a2f8363f3d385996d3777ddf6795 | C++ | dkarm/cannon-ball | /Cannonball/Powerbar.cpp | UTF-8 | 1,107 | 2.953125 | 3 | [] | no_license | //
// Powerbar.cpp
// Cannonball
//
// Created by Dipti Karmarkar on 8/17/16.
// Copyright © 2016 Dipti Karmarkar. All rights reserved.
//
#include "Powerbar.hpp"
Powerbar::Powerbar(sf::RenderWindow &window): window(window)
{
//initialize the outside rectangle
outside.setPosition(5,5);
pos.x = 100;
... | true |
2aaf557b40a0a6e1972510b5f25c9887f6d3b760 | C++ | RocketSkates/SchoolNew | /Semester 2/Exercise4/Exercise4/Avengers.h | UTF-8 | 571 | 2.546875 | 3 | [] | no_license |
#ifndef AVENGERS__H_
#define AVENGERS__H_
#include "CaptainSpider.h"
#include "SuperHero.h"
#include "Spiderman.h"
#include "AnimalBasedSuperHero.h"
#include "ProfessionBasedSuperHero.h"
#include "CaptainAmerica.h"
class Avengers
{
public:
Avengers();
~Avengers();
void saveType(ofstream& out, const SuperHero* her... | true |
a4280051c499d20ad2355c301539a90ced7b2f25 | C++ | jaschulz/JobifyAS | /AppServer/src/db/dbController.cpp | UTF-8 | 1,078 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <string>
#include "dbController.h"
#include "leveldb/db.h"
using namespace std;
int dbController::connect(string dataBase) {
options.create_if_missing = true;
leveldb::Status status = leveldb::DB::Open(options, dataBase.c_str(), &db);
/*
if (false == status.ok())... | true |
4bc3e7c1cb9127a89ac4f23b27759e6ce5737648 | C++ | flagship20030/Modified-Operant-Cage | /Arduino/Testing/operant_room_testing_2_27/operant_room_testing_2_27.ino | UTF-8 | 8,321 | 2.8125 | 3 | [] | no_license | /* Final Testing in Operant Room (3 solenoids / 3 IRs / 3 LEDs + 1 Button)
* 2/27/19
* JHL
*
* Head Pokes trigger solenoid reward in each port respectively (for a given amount of time ex: 200ms)
* for ex) if port 8 detects head poke, delivers reward for 200ms and records it
*
* remove the LED blinking part
* retain the... | true |
640e17bb98bd825475cba1030fb92dde2a2546d0 | C++ | henrychoi/realtime | /control/estimator.cpp | UTF-8 | 3,549 | 2.640625 | 3 | [] | no_license | #include "platform/all.h"//Must be the first include!!!!!
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <algorithm>
#include "log/log.h"
#include "control/estimator.h"
using namespace std; // for min()
bool ScalarLowpass::reset(float initial, float hz, float pd
, unsigned outlierThreshold) {
... | true |
72e1458c3921d9220e273e27314466ce0385c5e7 | C++ | JLtea/Data_Structures | /mp_intro/intro.cpp | UTF-8 | 13,378 | 3.078125 | 3 | [] | no_license | #include "cs225/PNG.h"
#include "cs225/HSLAPixel.h"
#include <string>
#include <cmath>
#include <iostream>
void rotate(std::string inputFile, std::string outputFile) {
// TODO: Part 2
cs225::PNG png;
png.readFromFile(inputFile);
cs225::PNG* result = new cs225::PNG(png.width(), png.height());
for(unsigned i... | true |
a13ea68c39ae7fcd9f09eada9c3aef723f723f52 | C++ | victorazzam/Cpp98-Course-Material | /Pointer Arithmetic/src/Pointer Arithmetic.cpp | UTF-8 | 1,260 | 4.15625 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main() {
const int NSTRINGS = 5; // Const variables cannot be changed
string texts[NSTRINGS] = {"one", "two", "three", "four", "five"};
cout << "&texts: " << &texts << endl; // Location of array in memory, i.e. where it starts
cout << "texts: " << texts << endl; // Re... | true |
74e6d0554be7ff87a14853a81e698a587a3d25cd | C++ | rajani-ku/COMP202-Labs | /Lab1/src/LinkedList.cpp | UTF-8 | 1,056 | 4 | 4 | [] | no_license | #include <iostream>
#include "LinkedList.h"
LinkedList::LinkedList()
{
HEAD = nullptr;
TAIL = nullptr;
}
bool LinkedList::isEmpty()
{
return HEAD == nullptr && TAIL == nullptr;
}
void LinkedList::addToHead(int element)
{
Node *newNode = new Node(element, HEAD);
HEAD = newNode;
if (TAIL == nu... | true |
f27279df6716e41efabc0237f4ed51df8af2fe62 | C++ | aceiii/cpp-test | /singleton.cpp | UTF-8 | 1,081 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <memory>
class Singleton {
public:
static Singleton& getInstance() {
std::cout << "Singleton::getInstance()" << std::endl;
return *_instance;
}
void foo() {
std::cout << "Singleton::foo()" << std::endl;
}
privat... | true |
1fa1f03dde95310a4a478f81ed3fbf60f763f879 | C++ | pedris11s/coj-solutions | /lmm-p1303-Accepted-s353849.cpp | UTF-8 | 3,483 | 2.75 | 3 | [] | no_license | //by pter
/*
3 6
D...*.
.X.X..
....S.
*/
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define x first
#define y second
#define MKP(a, b) make_pair((a), (b))
typedef pair <int, int> pii;
const int oo = 9999;
int f, c;
char M[... | true |
a4edec644df6ae41380f8c82de0ea1945538ba85 | C++ | Kennylixinran/cs225 | /POTD/BernsteinHash45/main.cpp | UTF-8 | 756 | 3.734375 | 4 | [] | no_license | #include <string>
#include <iostream>
#include <algorithm>
using namespace std;
unsigned long bernstein(string str, int M)
{
unsigned long b_hash = 5381;
//Your code here
for(unsigned long i = 0; i < str.length(); i++){
//b_hash = b_hash * 33 + char;
//33 is the magic number for no reason;
b_hash... | true |
6d44ee5fdf077383ef1438c3388b52ce5ee0c306 | C++ | alongj/cppPrimer | /leetcode/leetcode141.cpp | UTF-8 | 4,823 | 2.9375 | 3 | [] | no_license | //
// Created by 邵军 on 2019/3/25.
//
#include <iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
bool hasCycle(ListNode *head) {
if (head == nullptr)
return false;
ListNode *oneStep = head;
ListNode ... | true |
d2c1260897ba137386a23b780e7cb55d1dfea783 | C++ | milwilczynski/BomberChamp | /Headers/Player.h | UTF-8 | 989 | 3 | 3 | [] | no_license | #pragma once
#include "Main.h"
#include "Definitions.h"
class GameClass;
class Player
{
public:
inline Player()
: apk_rotation(0),
apk_destroyed(false)
{
}
inline virtual ~Player() {}
inline virtual void SetLocation(const grim::Vector2 &loc)
{
apk_location = loc;
}
inline virtual void SetRotation(c... | true |
3313237d4567fc08bb7dc011d99bdf2dfa09957b | C++ | rosekc/acm | /cf/832/B.cpp | UTF-8 | 1,818 | 2.703125 | 3 | [] | no_license | //2017-07-24-23.01
//B
#include <bits/stdc++.h>
using namespace std;
int n;
int pos;
string in, pat;
bool good['a' + 26];
bool check1() {
for (int i = 0; i < pos; i++) {
//cout << pat[i] << " " << in[i] << endl;
if (pat[i] == '?' && !good[in[i]]) return 0;
else if (pat[i] != '?' && in[i]... | true |
42c3f174985f022156d76e19758db27b4f20c5e7 | C++ | giordi91/machine-learning | /tests/src/logistic_regression.cpp | UTF-8 | 1,722 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "test_utils.h"
#include <mg_ml/cpu/matrix_functions.h>
#include <mg_ml/cpu/models/logistic_regression.h>
TEST(logistic_regression, sigmoid) {
std::vector<float> sig_data{0.0f, 2.0f};
std::vector<float> sig_data_out{0.0f, 0.0f};
core::Matrixf inm{sig_data.data(), 1, 2};
core::Matrixf outm{sig_data_out... | true |
47cfc6b7364222a7ec7960b7a9f3073c645fad16 | C++ | MostafaOmar98/competitive-programming | /Algorithms/graph/MaximumMatchingN^2PseudoCode.cpp | UTF-8 | 2,574 | 2.75 | 3 | [] | no_license | int husband[N];
int vis[N], vid; // vid for maximum matching increment
bool foundMatch(int MID)
{
vis[MID] = vid;
for (auto to : adj[MID])
{
if (husband[to] == -1)
{
husband[to] = MID;
return 1;
}
else if (vis[husband[to]] != vid && foundMatch(husband[... | true |
4a7922c6b24e5d286f43ba9db4dfe1c7a4e7c173 | C++ | xiaoyiqingz/DesignPattern | /DesignPattern/Mediator.cpp | UTF-8 | 1,815 | 2.9375 | 3 | [] | no_license | #include "Mediator.h"
#include <iostream>
namespace dp {
Colleage::Colleage()
{
}
Colleage::Colleage(Mediator* md)
{
md_ = md;
}
Colleage::~Colleage()
{
}
ConcreteColleageA::ConcreteColleageA()
{
}
ConcreteColleageA::ConcreteColleageA(Mediator* mt)
: Colleage(mt)
{
}
ConcreteColleageA::~ConcreteColleageA()
{... | true |
4f93894cf67bc8e23215b7cbf17c7aa690fba922 | C++ | riteshkumar99/coding-for-placement | /leetcode/problemset-algorithms/sum-of-nodes-with-even-valued-grandparent.cpp | UTF-8 | 972 | 3.34375 | 3 | [
"MIT"
] | permissive | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | true |
bc1fb3c16d158a74ad82b5eb5eca8fdf3cd717e9 | C++ | DaniielaRodas/PropuestaSimposio | /main.cpp | UTF-8 | 843 | 3.390625 | 3 | [
"MIT"
] | permissive | #include <iostream>
int main()
{
std::cout << "Propuesta de programa para el simposio de Ingenieria 2021\n";
// Daniela Rodas - 1652421
#include <iostream>
using namespace std;
int main () {
int C1, C2, C3;
cout << "Ingrese la cantidad de asistentes para Ingenieria en sistemas:";
cin >> C1;
cout << "Ingres... | true |
9f41d16aa8839238ceb3f624659b8c3385de9485 | C++ | SaulRuizS/C-and-CPP-exercises | /Cpp/POO_excercises/Headers/MyExampleClass.hpp | UTF-8 | 303 | 2.53125 | 3 | [] | no_license | #ifndef MYEXAMPLECLASS_HPP
#define MYEXAMPLECLASS_HPP
class MyExampleClass
{
private:
int regVariable;
const int constVariable;
public:
MyExampleClass(); //Default constructor
MyExampleClass(int a, int b); //Parameterizied constructor
~MyExampleClass();
};
#endif | true |
026e06832b79ef56532aba8a7f5e95fd059d8882 | C++ | tylercchase/cs202 | /labs/lab03/Student.cpp | UTF-8 | 550 | 3.375 | 3 | [] | no_license | #include "Student.hpp"
#include <iostream>
using std::cout;
Student::Student(const Student &orig)
{
_age = orig._age;
_gpa = orig._gpa;
std::cout << "Make a copy" << std::endl;
}
Student::Student(){
_age = 0;
_gpa = 0;
std::cout << "Construct with default params" << std::endl;
}
Student::Stude... | true |
4bce238c4752b7d47d42f70cbdc0038cf010ec20 | C++ | takashato/GameUIT | /GameProject/GameComponents/Animation.cpp | UTF-8 | 2,273 | 2.71875 | 3 | [] | no_license | #include "Animation.h"
Animation::Animation()
{
}
Animation::Animation(const char* filePath, int totalFrame, int rows, int columns, float timePerFrame, D3DCOLOR colorKey)
{
InitWithAnimation(filePath, totalFrame, rows, columns, timePerFrame, colorKey);
}
void Animation::InitWithAnimation(const char* filePath, i... | true |
5e41ac6a9b1e2f6d97e538084a307c1f0c1406e1 | C++ | ZPGuiGroupWhu/ClusteringDirectionCentrality | /Toolkit/Synthetic Data Analysis/UMAP/epp/cpp/boundary.h | UTF-8 | 32,457 | 3.390625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef _EPP_BOUNDARY_H
#define _EPP_BOUNDARY_H 1
#include <vector>
#include <algorithm>
#include <memory>
#include <cassert>
namespace EPP
{
/*
* Utilities for Colored Maps
*
* The map is composed of directed edges that are color labeled on each side.
* Primary design goal is speed of the lo... | true |
619f2ede46b9fe1dab147765c53dd9b8812666ff | C++ | WalkerDongGithub/undergraduate_projects | /面向对象程序设计基础/template/typetraits.cpp | UTF-8 | 1,874 | 3.25 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
template <typename Iter>
void destruct(Iter where)
{
typedef typename std::iterator_traits<Iter>::value_type value_type;
//std::cout << typeid(value_type).name() << '\n';
//std::cout << typeid(Iter).name();
where->~value_type();
}
struct SimpleIter... | true |
8394b2339f6232713a1dfb66aaa2ba9d8c4f8479 | C++ | 15831944/bastionlandscape | /LuaPlus/Samples/UnitTest++/src/tests/TestTestRunner.cpp | UTF-8 | 3,838 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "../UnitTest++.h"
#include "RecordingReporter.h"
#include "../ReportAssert.h"
#include "../TestList.h"
#include "../TimeHelpers.h"
using namespace UnitTest;
namespace
{
struct MockTest : public Test
{
MockTest(char const* testName, bool const success_, bool const assert_)
: Test(te... | true |
75ad0801e72c90d83d4abcc6fc035b0e25dbb93e | C++ | abasak24/SAGA-Bench | /src/dynamic/dyn_sssp.h | UTF-8 | 8,355 | 2.625 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef DYN_SSSP_H_
#define DYN_SSSP_H_
#include <limits>
#include <vector>
#include <algorithm>
#include "traversal.h"
#include "sliding_queue_dynamic.h"
#include "../common/timer.h"
#include "../common/pvector.h"
/* Algorithm: Incremental SSSP and SSSP from scratch */
template<typename T>
void SSSPIter0(T* ds, S... | true |
3f0285e32cc2fac5d2a38ebaca69c2a40b9c7e16 | C++ | alexandraback/datacollection | /solutions_5639104758808576_0/C++/zentropy/cpptest.cpp | UTF-8 | 549 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
int main()
{
static const unsigned int maxsize = 1000;
char buff[maxsize+1] = { 0 };
unsigned int nCases = 0;scanf("%d",&nCases);
for(unsigned int iCases = 1;iCases <= nCases;++iCases)
{
unsigned int smax = 0;scanf("%d%s",&smax,buff);
unsigned int count = 0,an... | true |
5f239bb66b3502700998d8733bb0e72e61fa301a | C++ | henrybear327/Sandbox | /Codeforces/Educational/1/C/main_old_but_workig_code.cpp | UTF-8 | 1,394 | 2.921875 | 3 | [] | no_license | /*
AC if you use long double
WTF
*/
#include <bits/stdc++.h>
// LLONG_MIN LLONG_MAX INT_MIN INT_MAX
#define PI (atan(1) * 4)
#define double long double
using namespace std;
#define INF 1e9
inline double atan2_process(double x, double y)
{
double ans = atan2(y, x);
if (ans < 0.0)
ans += 2 * PI;
... | true |
cb43396375842d93191131dd93e767792377b6f9 | C++ | MRYoungITO/Class | /项目13_项目练习1/项目13_项目练习1/Monster.cpp | GB18030 | 1,184 | 3.390625 | 3 | [] | no_license | #include "Monster.h"
#include "SpriteStone.h"
#define MONSTER_LEVEL_FACTOR 1000
Monster::Monster(int level, const string& category)
{
this->level = level;
this->category = category;
}
/*
1ޣֵ 100 ʯ
2ޣֵ 200 ʯ
3ޣֵ 500 ʯ
4ޣֵ 1000 ʯ
5ޣֵ 2000 ʯ
6ޣֵ 5000 ʯ
7ޣֵ 10000 ʯ
8ޣֵ 20000 ʯ
9ޣֵ 100000 ʯ
*/
Sp... | true |
4b1804debadd700fc863267f30ee6d71b34326cb | C++ | ZenasAlex/MiniRPG | /Player.cpp | UTF-8 | 3,359 | 2.703125 | 3 | [] | no_license | #include "Player.h"
#include "ofGraphics.h"
#include "ofAppRunner.h"
void Player::start(float x, float y, float width, float height){
this->x = x;
this->y = y;
this->w = width;
this->h = height;
center.set(x + w / 2, y + h / 2);
//initPos.set(x, y);
swordRadius = 15;
cooldown = 2;
currentTime = o... | true |
2136f03e2194dc17fada16822632d171f41e5d7e | C++ | hydrodog/C-2016S | /session02/s03_arrays.cc | UTF-8 | 463 | 2.625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int a[100]; // 100 int = 100 * sizeof(int) = 400 bytes
int b[500000000]; // too big for windows
int n = 500000000; // windows hack , should work
int b[n]; // dynamiccally allocated on heap
int c[2*5*3]; // will calculate at compile time = 30
cou... | true |
0a7e107e8c6018b823a71a20e33c5bcf74745d50 | C++ | Ancaor/IG | /Practica4/esqueleto_qt/o3dr.cpp | UTF-8 | 5,662 | 2.828125 | 3 | [] | no_license | #include "o3dr.h"
O3DR::O3DR()
{
tapa_inferior = 0;
tapa_superior = 0;
}
/*********************************************************************************
Funcion que ajusta a size la variable PUNTOS_PERFIL
*********************************************************************************/
void O3DR::setPunt... | true |
1769e3c07a5415d3c4c47c3b1f137da7d8132159 | C++ | changjunpyo/algorithmPS | /leetcode/1363_largest_multiple_of_three_HD.cpp | UTF-8 | 2,532 | 3.1875 | 3 | [] | no_license | class Solution {
public:
string largestMultipleOfThree(vector<int>& digits) {
vector<int> three_one;
vector<int> three_two;
vector<int> three_three;
for (int i=0; i<digits.size(); i++){
if (digits[i]%3 ==0)
three_three.push_back(digits[i]);
... | true |
bc0b0c1ee8eb147e980dbfe0bce7f3a145659fde | C++ | vrunge/listChallenge | /src/SinglyLinkedList5.h | UTF-8 | 496 | 2.65625 | 3 | [] | no_license | #ifndef LINKED_LIST2_H
#define LINKED_LIST2_H
#include "Point.h"
#include <vector>
class SinglyLinkedList5
{
private:
Point * head;
Point * currentPosition;
Point * lastActivePosition;
Point * tail;
unsigned int lengthList;
public:
SinglyLinkedList5();
~SinglyLinkedList5();
vo... | true |
a42d58fae2daecf2e8450355d0d803f11abbb069 | C++ | robotology/idyntree | /examples/cxx/InverseKinematics/iDynTreeExampleInverseKinematics.cpp | UTF-8 | 8,462 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | // SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
// SPDX-License-Identifier: BSD-3-Clause
/**
* @ingroup idyntree_tutorials
*
* A tutorial on how to use the InverseKinematics class in iDynTree
*
*/
// C headers
#include <cmath>
#include <cstdlib>
// C++ headers
#include <string>
#include <... | true |
0d67980814ae72f9354671c48f2c0b186ccdbd2b | C++ | yucongxing/PAT_practice | /basic_pat_practice/1021.cpp | UTF-8 | 268 | 2.609375 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int main(int argc, char const *argv[])
{
int a[10]={0};
char t;
while(scanf("%c",&t)!=EOF){
a[t-'0']++;
}
for(int i=0;i<10;i++){
if(a[i]!=0) printf("%d:%d\n",i,a[i]);
}
return 0;
}
| true |
22ebdfddaab3294f5c2adc2f43e7bf459a3474f0 | C++ | priory/arduino-project | /lib/AnalogIO/src/AnalogInput.h | UTF-8 | 1,678 | 3.28125 | 3 | [] | no_license | #ifndef ANALOGINPUT_H
#define ANALOGINPUT_H
#include <Arduino.h>
class AnalogInput {
public:
/**
* Constructor.
*
* @param pin: pin used for the analog input
* @param min: minimum value of the input
* @param max: maximum value of the input.
* @param threshold: limit to when input cha... | true |
4f25123a4da46162c7a084a8115ea7313ac6c85a | C++ | kbs781025/Sparky | /Sparky Core/src/maths/vec4.cpp | UTF-8 | 1,303 | 3.5625 | 4 | [] | no_license | #include "vec4.h"
namespace sparky {
namespace maths {
vec4::vec4(const float x, const float y, const float z, const float w)
{
this->x = x;
this->y = y;
this->z = z;
this->w = w;
}
vec4 & vec4::operator+=(const vec4 & other)
{
x += other.x;
y += other.y;
z += other.z;
w += other.w;... | true |
a402fa8d3bfca491fefb19035a5b2beb6f7fdf70 | C++ | BraderLh/AED | /ListaEnlazada_Gerarquía_Clases(Iterator,Tipos y Uso-VideoType)/linkedList.h | UTF-8 | 6,315 | 3.625 | 4 | [] | no_license | #ifndef LISTTYPE_H_INCLUDED
#define LISTTYPE_H_INCLUDED
#include <iostream>
#include <vector>
#include "orderedLinkedList.h"
#include "unorderedLinkedList.h"
#include <assert.h>
using namespace std;
template <class Type>
struct nodeType
{
Type info;
nodeType<Type> *link;
};
template <class T... | true |
175b7048a97c2eeee060bfa57ec1d3ed77ce9a15 | C++ | DFXLuna/ANN | /Perceptron.h | UTF-8 | 5,618 | 3.03125 | 3 | [] | no_license | // Perceptron.h
// Matt Grant(teamuba@gmail.com)
#include<cstdlib>
#include<algorithm>
using std::find;
#include<list>
using std::list;
#include<utility>
using std::pair;
#include<map>
using std::map;
#include<functional>
using std::function;
#include<vector>
using std::vector;
#include<cmath>
using std::abs;
#include... | true |
d3dbccd7475d3c0ed903de56542de22c82068cfb | C++ | skapin/TestProtocol | /uart.h | UTF-8 | 1,577 | 2.953125 | 3 | [] | no_license | #ifndef UART_H
#define UART_H
/**
* @brief The Uart class
*
*
* @url http://stackoverflow.com/questions/6947413/how-to-open-read-and-write-from-serial-port-in-c
*
*
* The values for speed are B115200, B230400, B9600, B19200, B38400, B57600, B1200, B2400, B4800, etc.
* The values for parity are 0 (meaning no par... | true |
3d29a4f4308affa1d2a46623bd46dcb4de6f5b5c | C++ | ajimenezh/Programing-Contests | /Topcoder/HamiltonPath.cpp | UTF-8 | 4,344 | 2.890625 | 3 | [] | no_license | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | true |
480066bcb704e36fbe5db88ab963ac56f5787ab2 | C++ | npjtwy/DS_CPP | /list/List_search.h | GB18030 | 454 | 3.125 | 3 | [] | no_license | #pragma once
/*
* زֹλ
* ListNodePosi(T) search(T const& e, int n, ListNodePosi(T) p) const; //
*/
template <typename T>
ListNodePosi(T) List<T>::search(T const& e, int n, ListNodePosi(T) p) const
{
// 0 <= n <= rank(p) < _size
while (n-- >= 0) //עֹ
{
if ((p = p->pred)->data <= e) //עֹ < eڽв
{
return p;
... | true |
0c5b5060fa37624f20e5e6bd6ef1c131ef543211 | C++ | mtekman/MembranousScripts | /preciseChi/main.cpp | UTF-8 | 3,033 | 3.125 | 3 | [] | no_license | #include <boost/tokenizer.hpp>
#include <fstream>
#include <string>
#include "ChiSquare.h"
using namespace boost;
//inline expands the code inside the scope of where it is called. Almost a macro function
inline double convertToDouble(std::string const& s){
std::istringstream i(s); double x;
if (!(i >> x)){
c... | true |
62e8a25a52a75b6dd73cb568ac889bb1dcf78548 | C++ | willemjan92/Cpp_rougelike | /Eindopdracht/Trap.cpp | UTF-8 | 1,193 | 2.734375 | 3 | [] | no_license | #include "Trap.h"
Trap::Trap(Level * lvl, int x, int y, Vijand * vijand) : Kamer(lvl, x, y, "trap", vijand)
{
}
Trap::Trap()
{
}
string Trap::GetMapIcon() {
return "S";
}
Kamer* Trap::GetBuurKamer(Richting richting)
{
switch (richting)
{
case Richting::Noord:
return Noord;
break;
case Richting::Oost:
re... | true |
8721e4b8131c42752ad1fa090fa56cac2b5e2051 | C++ | mrSerega/matmod | /ConsoleApplication3/ConsoleApplication3/cAbstractMethod.h | UTF-8 | 321 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
#ifndef AF_H
#define AF_H
class cAbstractMethod
{
public:
cAbstractMethod();
cAbstractMethod(cAbstractMethod* rhs);
~cAbstractMethod();
double operator[](int index);
size_t size();
protected:
vector<double> arr;
};
#endif // !AF_H
... | true |
90819c4834b7808489d87177f214b532f6fea019 | C++ | benardp/Radium-Engine | /src/Core/Geometry/PolyLine.inl | UTF-8 | 1,396 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <Core/Geometry/PolyLine.hpp>
#include <Core/Math/LinearAlgebra.hpp> // cotan, saturate (from Math.hpp)
namespace Ra {
namespace Core {
namespace Geometry {
const Vector3Array& PolyLine::getPoints() const {
return m_pts;
}
Scalar PolyLine::length() const {
return m_lengths.back();
}
Aab... | true |
363cdfcd0898924a08f3712fc9c3a63c0b1466d5 | C++ | green-fox-academy/pengegyuri | /week-04/day-3/modeldevices/printer.cpp | UTF-8 | 281 | 2.84375 | 3 | [] | no_license | //
// Created by gyuri on 2019.02.06..
//
#include "printer.h"
#include <iostream>
Printer::Printer(int sizeX, int sizeY)
{
_sizeX = sizeX;
_sizeY = sizeY;
}
void Printer::print()
{
std::cout << "I'm printing something that's " << getSize() << " cm."<< std::endl;
}
| true |
7a101e7e984908c22eaf1f95b9c34e2be9dbb627 | C++ | asfopoo/bankCPP | /Bank.cpp | UTF-8 | 588 | 2.859375 | 3 | [] | no_license | #include "Bank.h"
#include "structures.h"
Bank::Bank() {
balance = 0;
}
Bank::~Bank() {
}
void Bank::deposit(double x, struct Transaction *t, int *d, int *tt) {
balance += x;
*d += 1;
*tt += 1;
t->date = *d;
t->amount = x;
t->transactionType = dep;
t->balance = balanceTotal();
}
void... | true |
392fc01684e24bdcb5c853a4d8610e4bc2711f2c | C++ | walkccc/LeetCode | /solutions/1117. Building H2O/1117.cpp | UTF-8 | 891 | 3.078125 | 3 | [
"MIT"
] | permissive | // LeetCode doesn't support C++20 yet, so we don't have std::counting_semaphore
// or binary_semaphore.
#include <semaphore.h>
class H2O {
public:
H2O() {
sem_init(&hSemaphore, /*pshared=*/0, /*value=*/1);
sem_init(&oSemaphore, /*pshared=*/0, /*value=*/0);
}
~H2O() {
sem_destroy(&hSemaphore);
s... | true |
b23ca400863feebad922073c52602232af726d74 | C++ | 15831944/airengine | /AirClient/Tool/CppScript/Debug/1.cpp | WINDOWS-1252 | 754 | 2.84375 | 3 | [] | no_license | /*
Function
*/
char* str="HELLO WORLD!";
__declspec(dllimport) void Print(const char* str);
__declspec(dllimport) int strlen(char* p);
__declspec(dllimport) int CopyFileA(char* lpExistingFileName,char* lpNewFileName,int bFailIfExists);
namespace Air{
//int strlen(char* p){
// if(p==0){
// return 0;
... | true |
5e9fb3f869de75d13591bb69cae30a83e7c2c58b | C++ | nikita-nazarov/Renderer | /camera.cpp | UTF-8 | 1,126 | 3.078125 | 3 | [] | no_license | /* START OF 'camera.cpp' FILE */
#include "camera.h"
CAMERA::CAMERA (void) :
viewDirection(0.0f, 0.0f, -1.0f), up(0.0f, 1.0f, 0.0f), position(0.0f, 0.0f, -10.0f)
{
}
CAMERA::CAMERA (const CAMERA & newCamera) :
viewDirection(newCamera.viewDirection),
position(newCamera.position),
up(newCamera.up)
{
... | true |
b9efd8fef6b52c90a19a2d24bd2906b03e4dbf6a | C++ | smn06/Code | /extra/mid/5.cpp | UTF-8 | 1,231 | 3.15625 | 3 | [] | no_license | //5
#include<iostream>
#include<algorithm>
using namespace std;
#define M 10
int calc(double a[][M], int n)
{
int i,j,k=0,c,check=0,m=0;
for(i=0;i<n;i++)
{
if(a[i][i]==0)
{
c=1;
while((i + c)<n && a[i+c][i]==0)
c++;
if((i+c)==n) {
check=1;
break;
}
for(j=i,k =0;k<=n... | true |
95f24a303ceeb2dba145887a691479ec17223b48 | C++ | oceanofthelost/Project-Euler | /PE003/C++/PE003.cpp | UTF-8 | 684 | 3.859375 | 4 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int i=0; //variables that i need for loops
long q=600851475143;
while(q!=1) //loop that increments the amound of times you want to reduce the number
{
for(i=2;i<q;i++) //finds a number that we will use to divide q.
... | true |
85b86226691fbaf184bcbd2871abcc123a92e1cd | C++ | palacaze/sigslot | /example/lambdas.cpp | UTF-8 | 723 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <sigslot/signal.hpp>
#include <cstdio>
/*
* This example is meant to test compilation time as well as object size when a
* lot of unique callables get connected to a signal.
* This example motivated the introduction of a SOCUTE_REDUCE_COMPILE_TIME cmake option.
*/
#define LAMBDA4() sig.connect([](int) { ... | true |
d56fe12dff6607c9a3360f7546bc0963215f4a75 | C++ | Abhinav95/tv-ad-classification | /utility-scripts/split.cpp | UTF-8 | 583 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]){
if(argc < 2){
cout << "Usage: ./split <filename> <every how many lines> <train/test>" << endl;
return 0;
}
ifstream myfile;
string line;
myfile.open(argv[1]);
int cur = 1;
int max = atoi(argv[2]);
if(myfile.is_open()){
while... | true |
d7043b0411b7d8d21e756d0025c77876788274a0 | C++ | Bingyy/LeetCode | /C++/106_Construct_Binary_Tree_from_Preorder_and_InOrder_Traversal_Medium.cpp | UTF-8 | 1,564 | 3.296875 | 3 | [] | no_license | #include "lib.h"
using namespace std;
/**
* 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:
// 根据中序和后序遍历序列构建二叉树
// 可以唯一构建一棵二叉树
TreeNod... | true |
566ff340a1d0c13930dfb5511b2679ed884a08be | C++ | JuliaSamartseva/Binary-search-tree | /Visualisation/Visualisation.cpp | UTF-8 | 2,666 | 3.109375 | 3 | [] | no_license | #include "Visualisation.h"
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <string>
#include <windows.h>
#include <sstream>
#include <conio.h>
namespace visualisation {
void bst_print_dot_null(Node *key, int nullcount, FILE* stream)
{
fprintf(stream, " null... | true |
96a086770d6a9a8cabb9100c97c3261703ca6b4b | C++ | a173/CPP_modules | /cpp04/ex03/MateriaSource.hpp | UTF-8 | 558 | 2.59375 | 3 | [] | no_license | //
// Created by Allegra Caryn on 4/24/21.
//
#ifndef EX03_MATERIASOURCE_HPP
#define EX03_MATERIASOURCE_HPP
#include "IMateriaSource.hpp"
#include "AMateria.hpp"
class MateriaSource : public IMateriaSource {
public:
MateriaSource();
MateriaSource(const MateriaSource &);
virtual ~MateriaSource();
MateriaSourc... | true |
99e1a1068d28636d2de39be79a6f45ab95723b4a | C++ | yctseng1227/CPE | /CPE_1_Star_Problems/UVa10209 - Is This Integration?.cpp | UTF-8 | 1,175 | 2.875 | 3 | [] | no_license | /*=======================================
UVa10209 - Is This Integration?
=========================================
Completion Date: 105/04/26
=======================================*/
#include <iostream>
#include <iomanip>
#define PI 2.0*acos(0.0) // 題目給予
using namespace std;
int main()
{
double dLength; ... | true |
cc4befacc244eba3e48dd89c1439f2364decf7ec | C++ | zackkk/leetcode | /Trapping Rain Water.cpp | UTF-8 | 775 | 3.1875 | 3 | [] | no_license | class Solution {
public:
// water volumn depends on left max height and right max height
int trap(int A[], int n) {
if(n == 0) return 0;
vector<int> left(n, 0); // highest bar on its left;
vector<int> right(n, 0);
int left_max = 0;
for(int i = 0; i < n; ++i... | true |
0ac563f5e1d618f9c285b3db9fb7a4f7542dff40 | C++ | fzylx/std-make | /include/experimental/fundamental/v3/strong/strict_bool.hpp | UTF-8 | 4,994 | 2.9375 | 3 | [
"BSL-1.0"
] | permissive | // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Copyright (C) 2017 Vicente J. Botet Escriba
#ifndef JASEL_FUNDAMENTAL_V3_STRONG_STRICT_BOOL_HPP
#define JASEL_FUNDAMENTAL_V3_STRONG_STRICT_BOOL_HPP
#include... | true |
e191d8610e4096e79d0ffad0ea3c7f7b92c309d0 | C++ | martinv/pdekit | /src/linear_system/TrilinosCrsMatrix.hpp | UTF-8 | 2,272 | 2.53125 | 3 | [] | no_license | #ifndef PDEKIT_Trilinos_Sparse_Matrix_hpp
#define PDEKIT_Trilinos_Sparse_Matrix_hpp
#include "PDEKit_Config.hpp"
#if PDEKIT_HAVE_TRILINOS
#include <iostream>
#include <memory>
#include <vector>
#include "Epetra_CrsMatrix.h"
#include "Epetra_MpiComm.h"
#include "Teuchos_RCP.hpp"
#include "common/PDEKit.hpp"
namespa... | true |
176517fc85f99d50aa9d8bce7ac62f31262c8452 | C++ | Dardariel/fantasies | /Server/world.h | UTF-8 | 1,147 | 2.53125 | 3 | [] | no_license | #ifndef WORLD_H
#define WORLD_H
#include <QObject>
#include <QList>
#include <QTimer>
#include "objects.h"
#include <QJsonObject>
enum OperationsObject
{
DELETE,
REMAP
};
class World : public QObject
{
Q_OBJECT
public:
World(unsigned int x, unsigned int y, QObject *parent = nullptr);
bool enter... | true |
8f1197609508acd6f711756765c4e265ecc5cadc | C++ | wangyongliang/nova | /poj/2325/POJ_2325_2735057_AC_78MS_80K.cpp | UTF-8 | 864 | 2.65625 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
char s[1100];
int a[1100];
char ans[1100];
int div(int n)
{
int k;
int i=0,j=0;
k=0;
while(s[i])
{
k=k*10+s[i]-'0';
ans[j]=k/n+'0';
k%=n;
i++;
j++;
}
if(!k)
{
ans[j]='\0';
for(i=0;ans[i];i++)
{
if(ans[i]!='0') break;
}
strcpy... | true |
4bfbe0cf07c38406952f5010478471564f5d1463 | C++ | juniorxsound/Ray-Tracer | /src/Object3D.h | UTF-8 | 854 | 2.71875 | 3 | [] | no_license | #ifndef _OBJECT3D_H_
#define _OBJECT3D_H_
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/Geometry>
#include <tuple>
//Base class for everything that lives in the 3D space
class Object3D {
public:
Object3D();
~Object3D();
//Origin only construction
Object3D(Eigen::Vector3d);
//Origin ... | true |
837c8c3a2bcbfea9fd5aac5889655796793cd42a | C++ | MORTAL2000/OpenGLEngine | /JuMenu/JuMenuResourceManager.h | UTF-8 | 2,554 | 2.671875 | 3 | [
"MIT"
] | permissive | #ifndef JUMENURESMANTEST_H
#define JUMENURESMANTEST_H
#include <string>
#include <iostream>
#include <memory>
#include <thread>
#include <chrono>
#include <mutex>
#include <vector>
#include <unordered_map>
#include "resources/imageresource.h"
#include "resources/writerresource.h"
#include "JuMenuDeps.h"
namespace J... | true |
36ea8fe5b3023133602b99f19b5686a60ac2d2b7 | C++ | luk036/lineda | /recti/geo_iter.hpp | UTF-8 | 2,490 | 3.40625 | 3 | [] | no_license | #ifndef RECTI_GEO_ITERATOR
#define RECTI_GEO_ITERATOR
namespace recti {
template <class Iterator>
/** Iterator with x() and y() member functions */
class geo_iterator {
typedef geo_iterator<Iterator> _Self;
public:
typedef typename Iterator::value_type::value_type value_type;
/** Create an iterator from base ... | true |
fc706f41c6b3f1db1e03a4d4ee8f8fa10fef8dbe | C++ | Kwongy/Online_Judge | /PAT/DataStruct(chinese)/7-23.cpp | UTF-8 | 589 | 2.75 | 3 | [] | no_license | #include<iostream>
using namespace std;
int n;
string preorder;
string inorder;
int Max = 0;
void dfs(int pre_l, int pre_r, int in_l, int in_r, int level){
if(pre_l > pre_r || in_l > in_r) return;
if(level > Max) Max = level;
char index = preorder[pre_l], i = in_l;
while(inorder[i] != index) i++;
cout << index <<... | true |
6e8ac771e31d9158c3aa5337ad6774a5d089ab53 | C++ | smusman/CSE-102_Computer-Programming | /Programs/FinalsPractice/practice (6).cpp | UTF-8 | 236 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main ()
{
string s;
cout<<"Write Something to the file> ";
ofstream outfile("new.txt");
outfile<<s;
return 0;
}
| true |
f8b031db175183aaef2071d246b1d99f6bd81225 | C++ | macpd/experimental | /cpp_primer/chapter7/array_range.cc | UTF-8 | 769 | 4.03125 | 4 | [] | no_license | #include <iostream>
const int SIZE = 10;
/* assignes n to all elements of array a, starting at start and upto (but not
* including) end*/
void assignArrayRange(int* a, int* end, int val);
int main() {
using std::cout;
using std::endl;
int array[SIZE];
cout << "assigning 4 to elements 0-4" << endl;
ass... | true |
3a732d2167a24916c7b5254b3e96fc47404518c5 | C++ | MichaelEBurton/PPP_Cpp | /Chapter11/Exercises/exercise13.cpp | UTF-8 | 1,901 | 3.734375 | 4 | [] | no_license | /*
Exercise 13: Reverse the order of words (defined as whitespace-separated strings) in a file. For example, Norwegian
Blue parrot becomes parrot Blue Norwegian. You are allowed to assume that all the strings from the
file will fit into memory at once.
Notes: Could improve by... | true |
f311d09823702b866fb45d63f8b7aab10839eb02 | C++ | metaphaseaudio/metaphase_core | /inc/meta/util/math.h | UTF-8 | 5,279 | 2.90625 | 3 | [
"MIT"
] | permissive | //
// Created by Matt Zapp on 4/28/2018.
//
#pragma once
#include <cmath>
#include <type_traits>
#include <limits>
#include <array>
#include <cmath>
#include <iostream>
#include "NumericConstants.h"
namespace meta
{
template <typename Type, Type Value>
struct static_negate { static constexpr Type value = -V... | true |
f70133247dc9999dbc76aa34dd19dd71cae96c72 | C++ | Pchemelil/UsingIfStatements | /UsingIfStatements.cpp | UTF-8 | 238 | 3.21875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int age;
cout<<"Please enter their age:\n";
cin>> age;
if (age>=4){
cout<< "admit child to school.";
} else
cout<<"do not admit child";
return 0;
}
| true |
e9cf611c9f3036b0bdd342519ff12101eaf6e46e | C++ | soumyadeep-khandual/assignment-1 | /assignment 2/tsk207.cpp | UTF-8 | 333 | 3.359375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main ()
{
float a, b, c, d;
cout<<"enter 1st angle in degrees\n";
cin>>a;
cout<<"enter 2nd angle in degrees\n";
cin>>b;
d=a+b;
c=180-d;
if(d<180){
cout<<"the 3rd angle in degrees = "<<c<<"\n";}
else {cout<< "error; sum of 2 angles of a triangle cannot be greater than 180\n";}... | true |
a4ff9c2e80c6e10304879b82ffab9831fb7bb9c2 | C++ | dbielawski/Nachos | /nachos/code/userprog/exception.cc | UTF-8 | 8,144 | 2.828125 | 3 | [
"MIT-Modern-Variant"
] | permissive | // exception.cc
// Entry point into the Nachos kernel from user programs.
// There are two kinds of things that can cause control to
// transfer back to here from user code:
//
// syscall -- The user code explicitly requests to call a procedure
// in the Nachos kernel. Right now, the only fun... | true |
b641a5836e29599e2ec470cd27ad46c4232a5625 | C++ | zruslan2/Kontroln | /KontrRab/Function.cpp | WINDOWS-1251 | 2,995 | 3.546875 | 4 | [] | no_license | #include <stdint.h>
#include <iostream>
using namespace std;
/*17. , ,
- .*/
void sum(int *arr, int r, int &s, int &p)
{
s = 0;
p = 1;
for (int i = 0;i < r;i++)
{
s += arr[i];
p*= arr[i];
}
}
/*18. 17 ( 2 :
1. ; 2 - )
a. int
b. double
c. Shor int*/
void sum(int(*arr)[3]... | true |
0f5b91a27e98409e61c9a720b31ad0ddee7c5df2 | C++ | jjungkang2/2018-2020.Waddle-Corp | /2018.11-braille/braille/WordToBraille.cpp | UTF-8 | 1,298 | 3.234375 | 3 | [] | no_license | #include "BrailleToWord.h"
#include "WordToBraille.h"
Word::Word(){}
void Word::Init(char *in_word){
word = in_word, wordlen = 0;
while(word[wordlen] != '\0'){
wordlen++;
}
}
Braille Word::WordToBraille(){
int *bin = (int*)malloc(sizeof(int) * 500), langmode = 0;
binlen = 0;
for(int i = 0; i < wordle... | true |
d719214c62c0101ed78d8d2a521b57d20e363f87 | C++ | nawal1775/DNAString- | /DNAStrings.cpp | UTF-8 | 12,420 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <fstream> //for file access
#include <random>
using namespace std;
int main(int argc, char** argv)
{
if (argc > 1)
{
cout << "argv[1] = " << argv[1] << endl;
}
else
{
cout << "No file name e... | true |
08d8c1e86b996cdaef8a9e44418637f0f1fe8dff | C++ | mposypkin/BNB-solver | /problems/nlp/testproblems/mixedinteger/boxcon/sqsum/misqsumfact.hpp | UTF-8 | 2,482 | 2.890625 | 3 | [] | no_license | /*
* File: misqsum.hpp
* Author: medved
*
* Created on May 5, 2015, 8:57 AM
*/
#ifndef MISQSUMFACT_HPP
#define MISQSUMFACT_HPP
#include <math.h>
#include <string>
#include <iostream>
#include <sstream>
#include <problems/nlp/common/nlpproblem.hpp>
#include <util/poly/polynom.hpp>
#include <util/poly/polynomt... | true |
8abae84ca6f078049d4712a66c688d1cf119c88c | C++ | glucu/JoshLospinoso-CPlusPlusAFPI | /Part 1/Chapter 8/src/8-1.cpp | UTF-8 | 292 | 2.609375 | 3 | [] | no_license | #include "PrimeNumberRange.h"
#include "FibonacciIterator.h"
#include "FibonacciRange.h"
#include <cstdio>
int main() {
FibonacciRange range{ 5000 };
const auto end = range.end();
for (auto x = range.begin(); x != end; ++x) {
const auto i = *x;
printf("%d ", i);
}
return 0;
} | true |