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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7c24b2af7e35404c20e6df0dd32ee3e75c14153d | C++ | AtwoodHuang/clean_LSTM | /ConsoleApplication4/lstm.cpp | UTF-8 | 8,861 | 2.734375 | 3 | [] | no_license | #include"LSTM.h"
#include<cmath>
#include<assert.h>
Matrix bottom_diff(const Matrix &pred, const Matrix &label)
{
assert(pred.size() == label.size() && pred[0].size() == 1 && label[0].size() == 1);
Matrix result = pred;
for (int i = 0; i < pred.size(); ++i)
{
result[i][0] = 2.0*(pred[i][0] - label[i][0]);
}
r... | true |
775cb84cda7c5585a9eb2c7143b766ccfa5d65a7 | C++ | schuay/gpu_architectures_and_computing | /src/consolidate.hpp | UTF-8 | 716 | 2.59375 | 3 | [] | no_license | #ifndef __CONSOLIDATE_H
#define __CONSOLIDATE_H
#include <thrust/device_ptr.h>
extern "C" {
#include "sigpt.h"
}
/**
* Given two incoming signals lhs and rhs, consolidate
* builds a merged time sequence containing all points
* of both signals plus all intersection points between both signals.
* The output signal... | true |
c6ac792302adba04b63946aa8d680e64e471e606 | C++ | 15831944/Pipe | /Pipe/TypeDef.h | SHIFT_JIS | 3,901 | 2.875 | 3 | [] | no_license | #pragma once
namespace aht
{
//
enum result{
rOk,
rFail,
rCancel,
rNotExistBar,
rNotExistPosition,
rOutOfMemory,
rInvalidOpenRate,
rInvalidStopLoss,
rInvalidLimit,
rFailToOpenFile,
rExistChart,
rNotExistChart,
rNotExistStrategy,
rAlreadyRegistered,
rFailToLoadStra... | true |
e084ea2e210935c4cba0e2cd2aec773a0caa0fed | C++ | marin117/Collision_detection | /src/Wall.h | UTF-8 | 832 | 2.828125 | 3 | [] | no_license | #ifndef Wall_h
#define Wall_h
#include "AABB_box.h"
#include "vector3D.h"
class Wall {
public:
AABB_box bBox;
Vector3D vecDir;
Wall() = default;
Wall(const Point center, const float rX, const float rY, const float rZ,
const float vecX, const float vecY, const float vecZ, const float m);
Wall(const ... | true |
4e8f14f5ebdb22814fbc098ff9b091c5fe80b31e | C++ | mascai/exercise | /1_arrays/leetCode/16_container_with_most_water.cpp | UTF-8 | 982 | 3.203125 | 3 | [] | no_license | /*
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a container, such that the container contains the most water.
Noti... | true |
645517be3cc7cbe85aafba785131e853e123bc6d | C++ | mCRL2org/mCRL2 | /libraries/data/include/mcrl2/data/detail/data_functional.h | UTF-8 | 2,941 | 2.625 | 3 | [
"BSL-1.0"
] | permissive | // Author(s): Wieger Wesselink
// Copyright: see the accompanying file COPYING or copy at
// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
//
// 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)
//
/// \file m... | true |
fcd27844823ab3d21d6d1fe9162d78acf83ae5f9 | C++ | LoghinVladDev/loghin-toolbox | /include/Vector2.h | UTF-8 | 9,489 | 3.015625 | 3 | [] | no_license | //
// Created by vladl on 13/07/2020.
//
#ifndef ENG1_VECTOR2_H
#define ENG1_VECTOR2_H
#include <string>
#include <cmath>
#include <exception>
namespace engine { class Vector2F; class Vector2D; }
engine::Vector2F operator+ (const engine::Vector2F&, float) noexcept;
engine::Vector2F operator- (const engine::Vector2F... | true |
57d0aafd3acfdff9cbaeeae2722b4e8c8042f0c0 | C++ | wilmercastrillon/Ejercicios-Uva-Judge-Online | /Competitive Programming 3/Graph/Special Graphs (Others)/10054 The Necklace.cpp | UTF-8 | 2,261 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <list>
#include <vector>
using namespace std;
typedef pair<int, int> ii;
typedef pair<int, bool> ib;
typedef list<ii>::iterator liii;
int degree[52];
vector<vector<ib>> lista;//nodo destino, bandera visitado
list<ii> cyc;
void EulerTour(liii i, int u){
//printf("si... | true |
e95fcbf6f3e3770064b4987756e4d5f093e8f120 | C++ | mfkiwl/AFEPackDemo | /movingmesh2D/simulation2D.cpp | UTF-8 | 11,788 | 3.0625 | 3 | [] | no_license | /**
* @file simulation2D.cpp
* @author Heyu Wang <scshw@cslin107.csunix.comp.leeds.ac.uk>
* @date Mon Mar 10 17:57:29 2014
*
* @brief Build a template for the normal simulation in 2D.
*
*
*/
#include "simulation2D.h"
#include <sstream>
double g_t;
double g_a;
double boundary_value(const double *);
d... | true |
d081130bc851dd4aa26497ffad552564be6629ca | C++ | heiyanbin/cpp_projects | /code_exercise/code_exercise/findK.cpp | UTF-8 | 1,169 | 3.1875 | 3 | [] | no_license | #include "lib.h"
int partition(int a[], int n)
{
if(!a||n<1) return -1;
if(n==1)
return 0;
int i= 0, j=n-1;
int x = a[0];
while(i<j)
{
while (a[j]>=x && i< j) {
j--;
}
if (i<j) {
a[i]=a[j];
i++;
}
while (a[i]<x && i<j) {
... | true |
31f73e48b08b4dcb0dc48d497cbfa2c7501e84cd | C++ | daodaokami/FeaturesAbout | /src/spacenear_matcher.cpp | UTF-8 | 9,548 | 2.515625 | 3 | [] | no_license | //
// Created by lut on 18-12-22.
//
#include <spacenear_matcher.h>
#include <opencv2/features2d.hpp>
#include <opencv/cv.hpp>
#include <iostream>
#include <chrono>
SpaceNear_Matcher::SpaceNear_Matcher(GridNet *gridNet_1, GridNet *gridNet_2) {
this->gridNet_1 = gridNet_1;
this->gridNet_2 = gridNet_2;
}
void ... | true |
6a2f5007cedc4762439a56b2e00f61b7fead670f | C++ | tejasborkar74/ProblemSolvingIB- | /String/Pretty_Json.cpp | UTF-8 | 1,237 | 2.890625 | 3 | [] | no_license | vector<string> Solution::prettyJSON(string A)
{
vector<string> ans;
string curr;
int idn =0;
for(int i=0;i<A.size();i++)
{
if(A[i] == '{' || A[i]=='[')
{
curr.push_back(A[i]);
ans.push_back(curr);
curr="";
idn++;
int j=0;
... | true |
f7667d26ef9636d3dac00cd8be4349ccb95e7d43 | C++ | sannier/XXX | /BD/TMState.h | UTF-8 | 4,016 | 3.046875 | 3 | [] | no_license | #ifndef TMSTATE_H
#define TMSTATE_H
#include "syntactic_sugar.h"
// Layout of a Turing Machine State Tape
//
// Let our SA Turing Machine State Tape be defined as a string of
// bits containing a formatted header
//
// The header length is a function of the number of states.
// The total header length is 8 + 20*n... | true |
a3b3a7441bb24435bdf74bce0ed2e75923ec159d | C++ | stevenfans/Rubiks-Cube | /RubiksCubed/OldCoordinates.h | UTF-8 | 3,247 | 2.8125 | 3 | [] | no_license | #pragma once
#include <vector>
using namespace std;
// Create 54 integer vector sets
// top
vector<int> s0x({ 27,30,24,27,27,30,24,24,30 });
vector<int> s1x({ 42,42,42,39,45,45,45,39,39 });
vector<int> s2x({ 53,53,53,50,50,50,56,56,56 });
vector<int> s3x({ 16,16,16,19,19,19,13,13,13 });
vector<int> s4x... | true |
940e19d44823e91d6693d2c4f80b989b820ee0f0 | C++ | stonesha/UNR-CS | /CS 302/Homework 7/hw7-revamped/TSP.h | UTF-8 | 4,468 | 3.34375 | 3 | [] | no_license | /**
* @brief CS-302 Homework 7
* @Author Stone Sha (stones@nevada.unr.edu)
* @date May 2019
*
* Self contained header file for the solving of the Traveling Salesman Problem
* https://www.geeksforgeeks.org/traveling-salesman-problem-using-branch-and-bound-2/ used for reference
*/
#pragma once
#include <vector>... | true |
7e996213b7bae38d1ee21fe6aff688fc42f6d62b | C++ | Rakshit0404/OOPS-programs-and-explainations-by-me | /98_writing_classes_in_separate_files_using_define/Person.cpp | UTF-8 | 322 | 2.765625 | 3 | [] | no_license | #include<iostream>
using namespace std;
#include "Person.h"//here the header file has been included.
Person::Person()//the declared fucntions and variables inside the class in the header files have been defined here
{
cout<<"Constructor ran"<<endl;
}
void Person::display()//and here.
{
cout<<"Kya display"<<endl;
... | true |
fed21a5bd3aa5dfa580b5f3bbeca936338ff6f2d | C++ | jarivandam/hu-ipass | /arm/calculations.hpp | UTF-8 | 827 | 2.609375 | 3 | [
"BSL-1.0"
] | permissive | #include "stdint.h"
#include "coordinate.hpp"
/// \file
/// \brief
/// calculate the joint angles
/// \details
/// given the lenght and coordinates the arm should move to, this function calculates the angle of the joints
/// calculations arm based on this document http:://www.hessmer.org/uploads/RobotArm/Inverse%2520Ki... | true |
2d27889064f0ee6d561c1057f4c93bfe6189c11c | C++ | Plutoyo/C--Course-Project | /src/Date.cpp | UTF-8 | 836 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <time.h>
#include "Date.h"
using namespace std;
Date::Date()
{
time_t timer;
time(&timer);
tm* t_tm = localtime(&timer);
d=t_tm->tm_mday;
m=t_tm->tm_mon+1;
y=t_tm->tm_year+1900;
isSet=0;
}
Date Date::operator++(int)
{
d++;
adjust();
return *this;
}
int Date::returnisSet()
{
re... | true |
073da807f4da4c0b916ce6f3eb7b249e3ef41225 | C++ | algorithm-maintain-box/Programers | /JJune/Reference/Run3.cpp | UTF-8 | 874 | 3.375 | 3 | [
"MIT"
] | permissive | #include <string>
#include <vector>
using namespace std;
int solution(int number, vector<int> firecracker)
{
int result = 0;
int affect = firecracker.size();
for (int i = firecracker.size() - 1; i >= 0; i--)
{
auto new_affect = i - firecracker[i];
if (affect > new_affect)
{
... | true |
54057b281fd5fba9e174fc6a3f243705b3d1ee40 | C++ | AbrMa/Competitive-Programming | /Codeforces/Div 2/A/Alarm Clock.cpp | UTF-8 | 429 | 2.578125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a,b,c,d,t;
long long int sum,aux,q;
cin >> t;
while (t--)
{
cin >> a >> b >> c >> d;
if (a <= b) cout << b << endl;
else if (c - d <= 0) cout << "-1" << endl;
else
{
sum = 0, aux = 0;
sum += b;
aux = sum;
q = (a - b) / (c - d);
su... | true |
01c68269e1241cf31b108a4c9e5986981b9c80b9 | C++ | 3pointer/ACM-ICPC | /3pointer's Submit/sdut/i.cpp | UTF-8 | 1,261 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#define M 1000000007
#define N 4
struct Mat
{
int mat[N][N];
};
void init(Mat Mata)
{
for(int i=0;i<4;i++)
for(int j=0;j<4;j++)
Mata.mat[i][j]=0;
Mata.mat[0][0]=1,Mata.mat[0][1]=3;
Mata.mat[0][2]=2,Mata.mat[0][3]=7;
Mata.mat[1][1]=3,Mata.mat[1][2]=2;... | true |
74e0ae59b2dcbf96704dffba010b66776e01bfa9 | C++ | sane03/Data-Intensive-Computing-in-Data-Science | /Lab2/pthread_diagonalTranspose.cpp | UTF-8 | 2,466 | 3.5 | 4 | [] | no_license | #include <pthread.h>
#include <iostream>
#include <cstdlib>
#include <vector>
#include <time.h>
#include <sys/time.h>
#define NUM_THREADS 4
int** matrix;
struct ThreadInfo
{
int thread_id;
int matrix_size;
int diagonal_index;
};
/* Generates and Populates an n by n square matrix A with random numbers*... | true |
68d2426808aa128906abd0324d43ee9f415be2e4 | C++ | samueltrussell/CodeSamples | /Monster Engine Project/MonsterEngine/Timing.h | UTF-8 | 1,623 | 2.609375 | 3 | [] | no_license |
#ifndef TIMING_H
#define TIMING_H
#define MAX_FRAME_RATE 120.0f
#include <WinBase.h>
namespace Engine
{
namespace Timing
{
LARGE_INTEGER lastCount;
LARGE_INTEGER initCount;
LARGE_INTEGER frequency;
#ifdef MAX_FRAME_RATE
double minFrameTime = 1000.0f / MAX_FRAME_RATE;
#endif
bool Initialize()
{
Q... | true |
91f05f6d9ed108f8f270689c42b8d410e37ed05b | C++ | linksplatform/Data | /cpp/Platform.Data/ILinksExtensions.h | UTF-8 | 6,109 | 3.015625 | 3 | [
"Unlicense"
] | permissive | namespace Platform::Data
{
using namespace Platform::Interfaces;
template<typename TStorage>
static typename TStorage::LinkAddressType Create(TStorage& storage, const typename TStorage::LinkType& substitution)
{
auto $continue { storage.Constants.Continue };
typename TStorage::LinkAddre... | true |
4e02649a37db55f60b9f7b37f4c99faebbd7caa4 | C++ | thinkpiece/EasySaliency | /src/saliency.h | UTF-8 | 4,281 | 2.65625 | 3 | [] | no_license | /**
* @file saliency.h
* @author Junyoung Park (thinkpiece@yahoo.com)
* @brief Saliency-based Visual Attention Implementation
*
* Simple implementation for saliency-based visual attention model, which was
* proposed by Itti. See below for details:
*
* H. Greenspan, et al., "Overcomplete steerable pyram... | true |
3392ed9df07598f518c73ac98c2ccfffeb04a8a3 | C++ | PortfolioJohannOstero/GameEngineConstruction | /Dooperfighters/Dooperfighters/SheepDebugMessage.h | IBM852 | 2,236 | 2.953125 | 3 | [] | no_license | #ifndef SHEEP_DEBUG_MESSAGE
#define SHEEP_DEBUG_MESSAGE
/*
+=============================================+
+==============================================+
Debug Message.h
Engine: Sheep Engine
Author: Jhann ster.
--
The Debug class is semi-purely there to make debugging and testing easier.
it allows the client to outp... | true |
fc13f514b372cc46e469ad7395e83bd44a5a9592 | C++ | vdovych/meshell | /mymkdir.cpp | UTF-8 | 647 | 2.765625 | 3 | [] | no_license | //
// Created by stanislav on 08.06.18.
//
#include "mymkdir.h"
int main(int argc, char **argv) {
string dest;
bool promi = false;
for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
cout << "Stuff" << endl;
return 0;
... | true |
3484787d8578b1da0aecf742c54ed46fa5503bb4 | C++ | Ravi2155/competitive_coding | /Rated competition Codes/The Last Problem.cpp | UTF-8 | 2,953 | 2.984375 | 3 | [] | no_license |
/*
Solution by Rahul Surana
***********************************************************
Deep wants to become a 7-star coder on CodeChef. To achieve this goal, everyday, he has to solve as many problems as he can.
But for the first time since he was new to programming, he wasn't able to solve a single pro... | true |
d26f7da0fc809168f707f7fb8384773f39122b4e | C++ | adriengivry/ElkEngine | /ElkEngine/ElkRendering/src/Data/CameraData.cpp | UTF-8 | 2,581 | 2.84375 | 3 | [
"MIT"
] | permissive | #include "stdafxRendering.h"
#include "ElkRendering/Data/CameraData.h"
using namespace ElkRendering::Data;
// Default camera values
const float CameraData::PITCH = 0.0f;
const float CameraData::YAW = -90.0f;
const float CameraData::ROLL = 0.0f;
const float CameraData::SPEED = 2.5f;
const float CameraData::SENSITIVIT... | true |
e82f6a4754d657d5c27cfeadb81bf1a5b92ab26f | C++ | buptlxb/leetcode | /2nd/152_maximum_product_subarray.cpp | UTF-8 | 819 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int maxProduct(vector<int>& nums) {
if (nums.empty())
return 0;
vector<int> gmax(2, nums.front()), lmax(gmax), lmin(lmax);
int idx = 0;
for (auto i = nums.begin()+1,... | true |
7240cf703106afec8c738b56d9e36d0612988f50 | C++ | chrystallagh/HavadjiaChrystalla_CSC17a_42824 | /Project/Project_2/Project2.V3/UsrInpt.cpp | UTF-8 | 1,090 | 2.953125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: UsrInpt.cpp
* Author: chrystallahavadjia
*
* Created on May 18, 2016, 7:06 PM
*/
#include<iostream>
using namespa... | true |
e2af86ceb1967d69b57ea8e76c274a791aad4c21 | C++ | kobake/KppLibs | /LogLib/src/Log.h | SHIFT_JIS | 607 | 3.25 | 3 | [] | no_license | #pragma once
#include <string>
//### LogoϐɎNXconstłprintĂׂ悤ɁA
//### printconstɂĂ邪A͐HH
//! Oo̓NX
class Log{
public:
//RXgN^EfXgN^
Log() : enabled(true) { }
virtual ~Log(){}
//XCb`
void setEnabled(bool b){ enabled=b; }
bool isEnabled() const{ return enabled; }
//o
void print(const wchar_t* str, ...) const... | true |
647dbd9c1297ec4329c759bae6672c213723d62e | C++ | TJArk-Robotics/coderelease_2017 | /Src/Platform/Linux/DebugHandler.h | UTF-8 | 1,382 | 3 | 3 | [
"BSD-2-Clause"
] | permissive | /**
* @file Platform/linux/DebugHandler.h
*
* Class for debug communication over a TCP connection
*
* @author <A href="mailto:Thomas.Roefer@dfki.de">Thomas Röfer</A>
*/
#pragma once
#include "Tools/Debugging/TcpConnection.h"
#include "Tools/MessageQueue/MessageQueue.h"
class DebugHandler : TcpConnection
{
public:
... | true |
92b0b7c6229ac319aa1698ec4a0ca96e0a27e4f6 | C++ | utec-ads-2019-2/babelfish-10282-ccaballerof00 | /main.cpp | UTF-8 | 1,114 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
using namespace std;
map<string,string> diccionario;
void separar_strings(vector<string> a)
{
for(auto it : a)
{
string palabra1;
string palabra2;
bool p1 = true;
bool p2 = false;
for(int i = 0; i < it.length();i++ )... | true |
7122393ad1e54c91ad78653d539031531f9a1c5b | C++ | timkostka/cert3d | /firmware/GSL/inc/gsl_error.h | UTF-8 | 10,697 | 2.765625 | 3 | [] | no_license | #pragma once
#include <cstdint>
#include <climits>
#include "gsl_includes.h"
// typedef to a void function with no arguments
typedef void (*GSL_ERROR_HandlerFunction)();
// if not null, this will be called when we encounter a hard fault
GSL_ERROR_HandlerFunction gsl_error_handler = nullptr;
// this will output the... | true |
dfa0b02637fbf4028e4427d0672a90213022be7d | C++ | PIDAMI/vsLaptop | /lab3_game_gems/lab3_game_gems/main.cpp | UTF-8 | 2,006 | 3.1875 | 3 | [] | no_license | #include "Gems.hpp"
#include <iostream>
#include <exception>
using namespace sf;
//class Board : public RectangleShape {
//public:
// Board(size_t block_size,size_t board_size) {
// for (int i = 0; i < board_size; i++) {
// std::vector<RectangleShape> tmp;
// for (int j = 0; j < board_s... | true |
20e34013079f58a9818f90bb56824a8e2e79e969 | C++ | hangim/ACM | /HDU/4864_Task/4864.cc | UTF-8 | 1,195 | 2.609375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
struct Node {
int x, y;
bool operator < (const Node &o) const {
if (x != o.x)
return x > o.x;
return y > o.y;
}
};
Node mac[100001];
Node task[100001];
int c[101];
int main() {
cin.tie(0);
... | true |
1e376bcd208d81019222367365518d169429866a | C++ | qianfeng0/CodePractice | /LeetCode/345_ReverseVowelsofaString.cpp | UTF-8 | 1,381 | 4.125 | 4 | [] | no_license | /*
Write a function that takes a string as input and reverse only the vowels of a string.
Example 1:
Given s = "hello", return "holle".
Example 2:
Given s = "leetcode", return "leotcede".
Note:
The vowels does not include the letter "y".
*/
#include <string>
#include <iostream>
using namespace std;
const string v... | true |
4a6af8fda6fd67c3bb55db2ad4f84da82be900b6 | C++ | Hatemmamdoh/recursion | /main.cpp | UTF-8 | 483 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int sumofdigit (int n)
{
int sum = 0 ;
if (n == 0)
return 0 ;
sum = (n % 10 + sumofdigit(n / 10)) ;
return sum ;
}
int DigitalRoot (int n)
{
int r = 0 ;
if (n/10 == 0)
return n ;
r = DigitalRoot (sumofdigit (n)) ;
return r ;
}
int main... | true |
2230832ad78a4c2aac10e8d9f3de6dbe3c75136a | C++ | RomainH69/Puissance4 | /Puissance4.cpp | UTF-8 | 1,568 | 2.828125 | 3 | [] | no_license |
#include "Puissance4.h"
using namespace std;
Puissance4::Puissance4(std::string _nom) :Jeu(_nom)
{
cout << "Puissance 4" << endl;
int choix = -1;
while (choix <0 || choix > 2)
{
cout << "Nouvelle Partie : contre l'ia (tapez 0) multijoueur (tapez 1) Ia vs Ia (tapez 2)" << endl;
cout << "choix : ... | true |
5e935ceedaf5a4308a2d18187358c383ec3c4d57 | C++ | mjww3/algorithms | /fibosum.cpp | UTF-8 | 670 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
#define MAX 100000000
#define NIL -1
long long int lookup[MAX] = {NIL};
long long int fibonacci(int m)
{
if(lookup[m]==NIL)
{
if(m<=1)
{
lookup[m] = m;
}
else
{
... | true |
9671f3da8ed7ca1883cb99e3a7211c1a2867920f | C++ | PaddlePaddle/Paddle | /paddle/phi/core/utils/intrusive_ptr.h | UTF-8 | 4,254 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | /* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | true |
277c54d9f7e69b484b705603ff7701b14cd8229b | C++ | davfeng/security | /ListGroups.cpp | UTF-8 | 4,217 | 2.65625 | 3 | [] | no_license | // ListGroups.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
#include <lm.h>
void PrintLocalGroups()
{
ULONG_PTR lResume = 0;
ULONG lTotal = 0;
ULONG lReturned = 0;
ULONG lIndex = 0;
NET_API_STATUS netStatus;
//LOCALGROUP_INFO_0* pinf... | true |
4a4eca7738ae4bec3a3c3f8dda37ee791c713c21 | C++ | githublizhipan/Practice | /HZOJ/520.cpp | UTF-8 | 810 | 2.9375 | 3 | [] | no_license | /*************************************************************************
> File Name: 520.cpp
> Author:
> Mail:
> Created Time: 2020年01月14日 星期二 10时28分11秒
************************************************************************/
#include<iostream>
using namespace std;
int main() {
int a, k, n, temp1, temp2... | true |
3bc5b083676115c0230d8e0381ba52a781976e81 | C++ | alapan-sau/CP-Library | /euclidAlgorithm.cpp | UTF-8 | 388 | 2.515625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
// data types
#define ll long long int
#define ld long double
ll gcd(ll a, ll b){
if(b==0) return a;
else{
return gcd(b,a%b);
}
}
ll lcm(ll a,ll b){
return (a*b)/gcd(a,b);
}
int main(){
ios_base::sync_with_stdio(false);
ll a,b;
cin >> a ... | true |
e6f35d76117b8aead6d28ef46239c237c7e1ff98 | C++ | lucasdutraf/competitive-programming | /codeforces/maratonas-df/4-maratona-ifb/N.cpp | UTF-8 | 670 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, ll>;
using vi = vector<pi>;
int main () {
ios::sync_with_stdio(false);
int n, m, aux;
vi answ;
ll tempo;
cin >> n >> m;
while(n--){
cin >> aux >> tempo;
answ.push_back(make_pair(aux, tempo));
... | true |
a0193fb8cbaa42f0de59b67780624d93e4e7b3bd | C++ | JohanJacobs/Head_First_Design_Patterns | /Chapter9_Composite_Pattern/src/Iterator_Menu_Classes/Iterators/DinerMenuIterator.h | UTF-8 | 740 | 2.921875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <array>
#include <memory>
#include "IteratorInterface.h"
#include "Iterator_Menu_Classes/MenuClasses/DinerMenuWithIterator.h"
namespace Itertor_Menu
{
class DinerMenuIterator : public IteratorInterface
{
public:
DinerMenuIterator(const std::array< std::shared_ptr<MenuItem>, 6>& items)
... | true |
24b64a7b85021279722107cd64be87d356c44939 | C++ | ananddeb23/cppsolutions | /smallest-window-in-a-string-containing-all-the-characters-of-another-string.cpp | UTF-8 | 3,153 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include<vector>
#include<string.h>
using namespace std;
/* input format as follows
n: number of test cases
next n lines
text 'space' pattern
*/
// OUTPUT CONTAINS TEXT WHICH MAY NOT BE IN ORDER. FOR ORDER CHECK WHEN COUNT==PATERNLENGTH WHETHER c==PT[PTL-1]
int main() {
//code
int n;
cin>>n;
whi... | true |
8c485de6780a21112e29b7ccbda911879cee8e5d | C++ | AlexGitHub99/cprojects | /binaryTree/main.cpp | UTF-8 | 5,381 | 3.875 | 4 | [] | no_license | //Creator: Alex King
//Last Modified: 3/25/19
//This program builds a binary search tree
#include <iostream>
#include "Node.h"
#include <cstring>
#include <cmath>
using namespace std;
void add(Node* current, Node* newNode);
void del(Node* current, int number);
void print(Node* current, int depth);
Node* takeRight(No... | true |
e4e8297838449dec618fc051200889b64fdb9fd7 | C++ | VietRise/GameJump | /Classes/UserData.cpp | UTF-8 | 1,909 | 2.640625 | 3 | [
"MIT"
] | permissive | //
// UserData.cpp
// GameJump-mobile
//
// Created by MacBook on 1/5/19.
//
#include "UserData.h"
#include "GameConfig.h"
USING_NS_CC;
using namespace std;
UserData* UserData::_instance = nullptr;
UserData::~UserData()
{
}
UserData::UserData()
{
if (!UserDefault::getInstance()->getBoolForKey(USERDEFAU... | true |
b4956d9fe1522a25b3edf72a61024eaeac509676 | C++ | vonwenm/Hypodermic | /Hypodermic/TypedService.cpp | UTF-8 | 578 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "TypedService.h"
#include <functional>
namespace Hypodermic
{
TypedService::TypedService(const std::type_info& typeInfo)
: typeInfo_(typeInfo)
, typeIndex_(typeInfo_)
{
}
const std::type_info& TypedService::typeInfo() const
{
return typeInfo_;
... | true |
6ef8996ac027a805d80bd892d1482497a10070a5 | C++ | HerveSV/CrudeRender | /CrudeRender/src/Crude/Utils/OrthoCameraController.hpp | UTF-8 | 2,375 | 2.765625 | 3 | [] | no_license | //
// OrthoCameraController.hpp
// CrudeRender
//
// Created by Hervé Schmit-Veiler on 5/20/20.
// Copyright © 2020 Hervé Schmit-Veiler. All rights reserved.
//
#ifndef OrthoCameraController_hpp
#define OrthoCameraController_hpp
#include "CameraController.hpp"
#include "OrthoCamera.hpp"
namespace Crude::Utils
{
... | true |
cc519c10a4578ceb448195e4e1254b1657e84c8c | C++ | muru-raj10/2D-objects | /Shape.cpp | UTF-8 | 1,335 | 3.4375 | 3 | [] | no_license | // Shape.cpp
//
// Defining functions for shape
// Modifications
// 14 July 16, file created
#ifndef Shape_cpp //To avoid multiple inclusion
#define Shape_cpp
#include "Shape.hpp"
#include <cmath>
#include <sstream> // std::stringstream, std::stringbuffer
#include "stdlib.h";
using namespace std;
Sha... | true |
173f34fef3ba035cfe7299c7df887a976a1e36ff | C++ | Caceresenzo/42 | /CPP Modules/08/ex03/ICommand.hpp | UTF-8 | 2,055 | 2.703125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ICommand.hpp :+: :+: :+: ... | true |
43b4acb93c8124dc7be8aed7882e189fbb34f616 | C++ | orocos-toolchain/utilmm | /utilmm/auto_flag.hh | UTF-8 | 1,910 | 3.421875 | 3 | [
"BSD-3-Clause",
"CECILL-B",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-cecill-b-en"
] | permissive | #ifndef UTILMM_AUTOFLAG_H
#define UTILMM_AUTOFLAG_H
#include <boost/noncopyable.hpp>
namespace utilmm
{
/** Automatically sets and resets a boolean flag
* on construction and destruction */
template<typename T>
class auto_flag
: private boost::noncopyable
{
int& m_field;
... | true |
b4225e1e069951521209532a4093f1833ce5d7fa | C++ | rombarte/WZORCE-PROJEKTOWE | /CHAIN/source.cpp | UTF-8 | 1,263 | 3.28125 | 3 | [] | no_license | /* Autor: Bartłomiej Romanek */
/* Tytuł: Wzorzec "Łańcuch odpowiedzialności" */
/* Licencja: Licencja MIT */
/* Data modyfikacji: 21.02.2017 */
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Ekran {
public:
int Wyswietl(strin... | true |
60ec9f16caa8bbccd6392dd8d1bdea42998b9f1c | C++ | jairsaidds/DataStructures | /Stack.cpp | UTF-8 | 2,113 | 3.453125 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
struct node{
node *next;
int data;
node(){
next = NULL;
cout << "what";
}
node(int X){
data = X;
next = NULL;
}
};
struct Stack{
node *head;
Stack(){
head = NULL;
}
void push(node *x){
node *tmp;
if(head == NULL){
head = x;
}else{
... | true |
d6d9a490d3146d2346acbf813b10168f29ff3453 | C++ | qjhart/qjhart.geostreams | /src/imgstr/src/test.cpp | UTF-8 | 2,735 | 3.09375 | 3 | [] | no_license | /*
GeoStreams Project
A simple test to exercise the ImgStream module
Carlos A. Rueda-Velasquez
$Id: test.cpp,v 1.3 2005/07/09 07:17:27 crueda Exp $
This is a compilable and executable code following the schematic
usage described in README file.
To build and run this demo:
make test
./test
You will get a ... | true |
f6f29bc2a62e84c599556c467eaf7aa8342b8acd | C++ | stermaneran/searchEngine | /Crawler/HtmlPreprocesser.h | UTF-8 | 701 | 2.65625 | 3 | [] | no_license |
#ifndef HTMLPREPROCESSER_H
#define HTMLPREPROCESSER_H
#include <string>
using namespace std;
class HtmlPreprocesser
{
public:
static void getTitle(const string &contentStr, string &title);
static bool delBetweenHtmlTags(const string & str, const string tag, string &ret);
static bool delComments(const string &str, s... | true |
56a26ee824f496670a38731b69a4e52571caf368 | C++ | romange/gaia | /base/wheel_timer.h | UTF-8 | 18,002 | 2.9375 | 3 | [
"BSD-2-Clause"
] | permissive | // -*- mode: c++; c-basic-offset: 4 indent-tabs-mode: nil -*- */
//
// Copyright 2016 Juho Snellman, released under a MIT license (see
// LICENSE).
//
// A timer queue which allows events to be scheduled for execution
// at some later point. Reasons you might want to use this implementation
// instead of some other are... | true |
3151c6a05d24a0c44391cfeaaada35f85073e3bc | C++ | MaxFanCheak/ITMO | /1_Course/1_Term/Algorithms and Data Structures/Stacks.Queue/C.cpp | UTF-8 | 1,229 | 2.90625 | 3 | [] | no_license | #include<stdio.h>
#include<algorithm>
#include<deque>
using namespace std;
deque <int> ::iterator queue[100000]{};
class backQueue {
deque<int> val;
public:
void push(int x) {
val.push_back(x);
queue[x] = val.end();
}
void popBack() {
val.pop_back();
}
void popFront() {
val.pop_front();
... | true |
7921c77cb4c7e6f315b9f36578337a884cf318d2 | C++ | oWASDo/OpenglEngine | /OpenGL_Engine/header/FileReader.h | UTF-8 | 457 | 2.90625 | 3 | [
"MIT"
] | permissive | #pragma once
#include<iostream>
#include<fstream>
static std::string ReadFile(std::string filePaht) {
std::ifstream myReadFile;
myReadFile.open(filePaht.c_str());
char output;
std::string outString;
if (myReadFile.is_open())
{
while (!myReadFile.eof())
{
//myReadFile >> output;
output = myReadFile.ge... | true |
cd659671fec54aae8c0f12a95ad93a292e93fc12 | C++ | Wokulsky/projekt | /projekt/Enemy.cpp | WINDOWS-1250 | 2,231 | 3.078125 | 3 | [] | no_license | #include "Enemy.h"
/*
Enemy::Enemy(sf::Texture &tex)
{
this->setTexture(tex);
/*speed = 0.25;
name = "Dragon";
hp = 150;
damage = 20;
level = 1;
row = 3;
//tex.loadFromFile("enemy.png");
this->setTextureRect(sf::IntRect(0, 0, 100, 100));
animation = std::make_shared<Animation>(tex, sf::Vector2u(4, 4), 100.0... | true |
8da972cf9b0c7f6e3ecff06dd54f25e413552dc4 | C++ | drlongle/leetcode | /algorithms/problem_1899/solution.cpp | UTF-8 | 4,062 | 3.421875 | 3 | [] | no_license | /*
1899. Merge Triplets to Form Target Triplet
Medium
A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci]
describes the ith triplet. You are also given an integer array target = [x, y, z] that describes the triplet
you want to obtain.
To obtain target, ... | true |
07b24f0ff9fdf8ecb71080c37ae29f584154060a | C++ | washing1127/LeetCode | /Solutions/0066/0066.cpp | UTF-8 | 469 | 2.875 | 3 | [] | no_license | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int n = digits.end() - digits.begin();
int p = 1;
for (int i=n-1; i>=0; i--){
if (digits[i] == 9){
digits[i] = 0;
p = 1;
}else {
digits[i]++;
... | true |
322c3542c2b1109647dae340569d6c107f57afc8 | C++ | ktp-forked-repos/header_libraries | /include/daw/iterator/daw_checked_iterator_proxy.h | UTF-8 | 6,266 | 2.609375 | 3 | [
"MIT"
] | permissive | // The MIT License (MIT)
//
// Copyright (c) 2016-2019 Darrell Wright
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files( the "Software" ), to
// deal in the Software without restriction, including without limitation the
// rights to... | true |
9a57168ae1ed442e68e36279199595eefe68c565 | C++ | drowsell/LeetCode-Practice | /Power-of-two.cpp | UTF-8 | 360 | 2.875 | 3 | [] | no_license | class Solution {
public:
bool isPowerOfTwo(int n) {
double answer = 0;
if(n == 0 || n < 0)
return false;
else
answer = log2(n);
if(answer == static_cast<int>(answer))
return true;
cout << answer << endl;
... | true |
2c393f071a4e2aaf97125382c793909833791856 | C++ | 3jackdaws/Minesweeper | /Minesweeper/Cell.cpp | UTF-8 | 6,204 | 3.125 | 3 | [] | no_license | /*************************************************************
* Author: Ian Murphy
* Filename: Cell.cpp
* Date Created: 1/18/16
* Modifications: 1/18/16 - added documentation
**************************************************************/
#include "Cell.hpp"
/*******************************************************... | true |
dafb95de981a97846eee398b2ef8f1af410d5eb7 | C++ | mortele/HartreeFock | /old/Integrator/Orbitals/orbital.h | UTF-8 | 1,079 | 2.546875 | 3 | [] | no_license | #pragma once
class Orbital {
public:
Orbital(int dimensions, int quantumNumbers);
virtual double computeWavefunction(double* coordinates,
int* numberOfQuantumNumbers) = 0;
virtual double* getCoordinateScales() = 0;
int getNumberOfDimensions() { return m_dim... | true |
5d3c0c0895972fd92834dec9e52f63cfb91c7445 | C++ | It4innovations/espreso | /src/input/parsers/meshgenerator/elements/3D/hexahedron20.cpp | UTF-8 | 1,254 | 2.65625 | 3 | [] | no_license |
#include "hexahedron20.h"
using namespace espreso;
Hexahedron20Generator::Hexahedron20Generator()
{
subelements = 1;
enodes = 20;
code = Element::CODE::HEXA20;
}
void Hexahedron20Generator::pushElements(std::vector<esint> &elements, const std::vector<esint> &indices) const
{
elements.push_back(indices[ 2]);
el... | true |
1388cdd4eed7015c5929d40377992a977c1bc7c5 | C++ | Mpaop/my_experiment_code | /uotree/test.cpp | UTF-8 | 565 | 2.859375 | 3 | [] | no_license | #include "uotree.h"
#include <iostream>
auto main() -> int
{
mpaop::smartptr::uotree::MUnorderedTree<int> tree(5, 10);
{
tree.insert(100, 20);
}
{
tree.insert(-1, 100);
}
for(int32_t i = 0, j = 11; i <= 10; ++i, ++j)
{
std::cout << "Do Insert\n";
if(i... | true |
e0c9505ab274c18ed367abddc1d7f2f314efdb31 | C++ | wzshare/Leetcode | /easy/26_Remove_Duplicates_from_Sorted_Array.cpp | UTF-8 | 860 | 3.671875 | 4 | [
"MIT"
] | permissive | #include "../libstruct.h"
using namespace std;
/*
* NO.26
* Given a sorted array, remove the duplicates in-place such that each
* element appear only once and return the new length.
* Do not allocate extra space for another array, you must do this by
* modifying the input array in-place with O(1) extra memory.... | true |
e7e1cd60e88d8d48e755b15112bf6623e9f0287d | C++ | patrick24r/sparkboxHD | /device/shared/host/filesystem/host_filesystem_driver.h | UTF-8 | 1,567 | 2.90625 | 3 | [] | no_license | #pragma once
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <map>
#include <memory>
#include <string>
#include "sparkbox/status.h"
#include "sparkbox/filesystem/filesystem_driver.h"
namespace {
using ::sparkbox::Status;
} // namespace
namespace device::shared::host {
class H... | true |
34ed3aa32d953bc4be04750e4e4cd7aecdf4cdc1 | C++ | xTimShultz/euler | /euler-004.cpp | UTF-8 | 1,995 | 4.09375 | 4 | [] | no_license | // https://projecteuler.net/problem=4
// A palindromic number reads the same both ways. The largest palindrome made from
// the product of two 2-digit numbers is 9009 = 91 × 99.
// Find the largest palindrome made from the product of two 3-digit numbers.
//
// Assume that the largest palindrome will be a 6-digit... | true |
ff215076141afa285c0cbd73a439735821573d88 | C++ | grahameger/EECS398Engine | /include/PersistentHashMap.h | UTF-8 | 15,032 | 2.953125 | 3 | [] | no_license | // Created by Graham Eger on 4/1/2019
#pragma once
#ifndef PERSISTENTHASHMAP_H_398
#define PERSISTENTHASHMAP_H_398
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <iostream>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <assert.h>
#i... | true |
e3181057f85f80523fed7934b54e36bf7ed258fc | C++ | luchenqun/leet-code | /problems/387-first-unique-character-in-a-string.cpp | UTF-8 | 811 | 3.140625 | 3 | [] | no_license | /*
* [387] First Unique Character in a String
*
* https://leetcode-cn.com/problems/first-unique-character-in-a-string/description/
* https://leetcode.com/problems/first-unique-character-in-a-string/discuss/
*
* algorithms
* Easy (30.73%)
* Total Accepted: 3.2K
* Total Submissions: 10.5K
* Testcase Example:... | true |
f4a37dfc98b29de0006f25435ee56d49724c51f5 | C++ | moyamu/ONYA-json | /json.h | UTF-8 | 5,758 | 2.96875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | ////////////////////////////////////////////////////////////////////////////////////////////////////
// I, the creator of this work, hereby release it into the public domain. This applies worldwide.
// In case this is not legally possible: I grant anyone the right to use this work for any purpose,
// without any condit... | true |
efc6774cfc19e927e8c25a0007568c02acde3bd3 | C++ | Aryan1310/Cpp | /Assignment 2/Ganesha'sPattern.cpp | UTF-8 | 885 | 2.953125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void swastika(int row)
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < row; j++)
{
if (i < row / 2)
{
if (j < row / 2)
{
if (j == 0)
cout <<"*";
else
cout <<" ";
}
else... | true |
a0eb67493331235cd787aad924502d15ae9b4a8d | C++ | Ido25/AlgoProj | /DataStructers/Queue.h | UTF-8 | 1,128 | 3.734375 | 4 | [] | no_license | /*
* This is the Queue .
* It's implemented with a 2-way linked list of vertexes.
* */
#pragma once
#include "Vertex.h"
class Queue{
public:
//////////////////CONSTRUCTORS//////////////////
Queue() : _size(0), _head(nullptr), _tail(nullptr){};//Basic constructor for uninitialized vertexes
Queue(Queue &Q) = del... | true |
194b33df4120c5acb44440239eec5305e2826bf3 | C++ | 00mjk/UVa-Online-Judge | /369.cpp | UTF-8 | 755 | 3.046875 | 3 | [
"MIT"
] | permissive | #include <cstdio>
using namespace std;
long gcd(long A, long B) {
if (A % B == 0) return B;
return gcd(B, A % B);
}
void Divbygcd(long& A, long& B) {
long g = gcd(A, B);
A /= g;
B /= g;
}
long C(long N, long K) {
long num = 1, den = 1, toMul, toDiv;
if (K > N/2) K = N - K;
for (int i... | true |
1a8add1ce99b9902c1d8c04c5efaa0a231fef673 | C++ | tytell/ForceFeedback | /teensy_timer/teensy_timer.ino | UTF-8 | 968 | 3.0625 | 3 | [] | no_license | // Create an IntervalTimer object
IntervalTimer myTimer;
const int ledPin = LED_BUILTIN; // the pin with a LED
void setup() {
pinMode(A21, OUTPUT);
analogWriteResolution(10);
Serial.begin(9600);
myTimer.begin(pulse, 100); // 1000 us
}
// The interrupt will blink the LED, and keep
// track of how many time... | true |
ea25a0f99337caa012925e2d86690f73dd945727 | C++ | jtb/RIVALS | /Utils/interval.h | UTF-8 | 2,000 | 2.5625 | 3 | [] | no_license | /*
* Copyright 2010 Justin T. Brown
* All Rights Reserved
* EMAIL: run.intervals@gmail.com
*
* This file is part of Rivals.
*
* Rivals is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either ver... | true |
d7ead9c503b131bdb31679bf29e257865332a2d1 | C++ | kevinlq/MyQt | /LMThreadOP/workdaatathread.cpp | UTF-8 | 1,227 | 2.6875 | 3 | [] | no_license | #include "workdaatathread.h"
#include "messagequeue.h"
#include <QDebug>
WorkDaataThread::WorkDaataThread(QObject *parent):
QThread(parent)
{
m_bIsRunning = false;
m_pMsgQueue = NULL;
}
WorkDaataThread::~WorkDaataThread()
{
qDebug()<<"delete WorkDaataThread";
}
void WorkDaataThread::startThread()
{... | true |
234034c6f196494581f4773c923e6fe3b089bedc | C++ | Viktor-Sok/Coursera-Cpp | /Red_belt_approx/my_Yangle/sync.h | UTF-8 | 1,143 | 2.78125 | 3 | [] | no_license | #pragma once
#include <future>
#include <mutex>
#include <unordered_map>
#include <vector>
#include <utility>
#include <cstdint>
#include <algorithm>
using namespace std;
auto Lock(mutex& m);
using Hitcounts = pair<vector<uint16_t>, unordered_map<uint16_t, uint16_t>>;
struct Access {
lock_guard<... | true |
e05979ec932afc69db7687313fa99cb04b30f85b | C++ | hello-sources/Coding-Training | /NowCoder/NC69链表中倒数最后k个节点.cpp | UTF-8 | 725 | 3.359375 | 3 | [] | no_license | /**
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*
* C语言声明定义全局变量请加上static,防止重复定义
*/
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
*
* @param pHead ListNode类
* @param k int整型
* @return ListNode类
*/
struct ListNode* FindKthToTail(struct ListNode* pHead, int k ) {
// write code here
... | true |
5ca12e55458d2f8ab855d0e9c69de35f898ec438 | C++ | NQNStudios/ASCIILib | /ASCIILib/PixelFont.h | UTF-8 | 1,145 | 2.8125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <string>
#include <map>
using namespace std;
#include "unicode/utypes.h"
#include "Color.h"
using namespace ascii;
#include "SDL.h"
namespace ascii
{
// Represents a font defined inside a uniformly grid-based texture sheet.
class PixelFont
{
public:
// Create ... | true |
fce872d30d4af1a420675887284c2488d1cc3c2c | C++ | Ian-peace/Pet_shop | /User_system.h | GB18030 | 4,390 | 2.984375 | 3 | [] | no_license | #ifndef USER_SYSTEM_H_INCLUDED
#define USER_SYSTEM_H_INCLUDED
using namespace std;
class User //û
{
private:
int id, pet_id;
string name, tel;
char sex;
public:
User(string n, char s, int petid, int id_flag, string t); //캯
int get_id();
int get_pet_id();
string get_tel();
... | true |
041b52a3b68bddcd85393227f2b844cc35169301 | C++ | MisterCapi/Software-Engineering---design-patterns | /FactoryMethod/code/main.cpp | UTF-8 | 1,986 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class GPU {
public:
virtual void computeSomeMatrices() = 0;
};
class RTX3070 : public GPU {
public:
RTX3070(string name){
this->name = name;
}
void computeSomeMatrices(){
cout << name << " is computing matrices\n";
}
pr... | true |
90121b43c64522ae8447b7a511278014e805b976 | C++ | pragati21p/InterviewbitProgramming | /Strings/Amazing Subarrays.cpp | UTF-8 | 410 | 3.03125 | 3 | [] | no_license | bool isVowel( char c ){
if(c=='A' || c=='E' || c=='I' || c=='O' || c=='U' || c=='a' ||
c=='e' || c=='i' || c=='o' || c=='u' ) return 1;
return 0;
}
int Solution::solve(string A) {
long long int count=0;
for(long long int i=0;i<A.size();i++){
if( isVowel(A[i]) ){
c... | true |
fc80c16e17d7dfe57adf510b89c658a3ea5478a7 | C++ | brokenlanceorg/owlsong | /code/cc/Miscellaneous/StockSeries.hpp | UTF-8 | 3,629 | 2.71875 | 3 | [] | no_license | //***********************************************************************************************
// File : StockSeries.hpp
// Purpose : This class derives from the DataserieS class to provide additional
// : functionality such as a moving average line.
// :
// Author : Brandon Benham
// Date... | true |
e14db3828c3f8057489549229962896f946bced1 | C++ | SayaUrobuchi/uvachan | /TNFSH_OJ/629.cpp | UTF-8 | 675 | 2.6875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, i, cmd, t, u;
int a[4], b[4];
string s;
while (cin >> n)
{
a[1] = a[2] = 1;
b[1] = b[2] = 0;
for (i=0; i<n; i++)
{
cin >> cmd;
if (cmd == 1)
{
cin >> t;
cout << max(a[1]*t+b[1], a[2]*t+b[2]... | true |
f53fcd8d6ee97085b3f2f7c0ec95e71a180e89df | C++ | AzamAzam/OOPLabsAssignments | /lab10/lab10/Q5.cpp | UTF-8 | 1,790 | 3.15625 | 3 | [] | no_license | //#include <iostream>
//#include<string>
//#include <fstream>
//using namespace std;
//
//struct Division
//{
// string name;
// double sales[4];
//};
//
//
//
//int main(){
// Division d[4];
// fstream file;
// int i = 0;
// double totalQuarterSales[4] = { 0 };
// double totalDivisionSales[4] = { 0 };
// double totalS... | true |
3a48b5aa2d5fb9e4f0e75f867644bd734447f751 | C++ | vignura/Code-Files | /BasicC++/LCM.cpp | UTF-8 | 617 | 3.171875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int a,b;
int getLCM(int, int);
cout<<"LCM Finder"<<endl;
cout<<"Enter two numbers: ";
cin>>a>>b;
cout<<"LCM ("<<a<<", "<<b<<") = "<<getLCM(a,b)<<endl;
return 0;
return 0;
}
int getLCM(int a, int b)
{
int LCM,HCF;
int getHCF(int,int);
HCF = getHCF(a,b);
cout<<"HCF ("<... | true |
6fe9ede8be8896648a21a179b361234b947fb779 | C++ | Shivam-Vishwakarma/CPP | /structure/STUDENT.BAK | UTF-8 | 1,073 | 3.328125 | 3 | [] | no_license | #include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
struct student
{
char name[30];
int rno;
int per;
public:
void getinfo();
void showinfo();
};
void student::getinfo()
{
clrscr();
cout<<"==============================================================";
cout<<"\n Enter your name : ";
gets(... | true |
fe6762d50bbb8ff0dbe98a1c62fac331db6a4c27 | C++ | tst-ccamp/earthenterprise | /earth_enterprise/src/fusion/portableglobe/cutspec.cpp | UTF-8 | 10,056 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2017 Google Inc.
// Copyright 2020 The Open GEE Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | true |
b3e5471afe876941262d66bff37c686e1751e982 | C++ | Edwin254-byte/cpp_practise | /constructor-functions.cpp | UTF-8 | 1,239 | 4.28125 | 4 | [] | no_license | //special function that is called whenever we create a new object. It is defined in the class block
#include <iostream>
using namespace std;
class Student
{
public:
string name, course, adm_no;
int age;
Student(string aName, string aCourse, string aAdm_No, int aAge)
{
name = aNam... | true |
b1598a5d41b17ff508eb0671b999104c226e171d | C++ | Becavalier/playground-cpp | /primer-answer/chapter10/10.36.cc | UTF-8 | 238 | 2.578125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main (int argc, char **argv) {
list<int> l{0, 1, 2, 3, 4, 0, 1};
auto e = find(l.rbegin(), l.rend(), 0);
cout << *e << endl;
return 0;
} | true |
959fdba60a9713c8a5ab42183453d23f1e81dd91 | C++ | Krandelbord/gettext_translator | /Utils.cc | UTF-8 | 1,437 | 2.875 | 3 | [] | no_license | #include "Utils.h"
#include <aspell.h>
#include <vector>
std::vector<Glib::ustring> getDictionaryList() {
std::vector<Glib::ustring> list;
struct AspellConfig *a_config = new_aspell_config();
AspellDictInfoList *dlist = get_aspell_dict_info_list(a_config);
AspellDictInfoEnumeration *dels = aspell_dict_info_list... | true |
675c591ff75e98fa2181378cb6370f3ddf07e921 | C++ | jacquerie/leetcode | /leetcode/0926_flip_string_to_monotone_increasing.cpp | UTF-8 | 808 | 2.984375 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2018 Jacopo Notarstefano
#include <algorithm>
#include <cassert>
#include <string>
using namespace std;
class Solution {
public:
int minFlipsMonoIncr(string S) {
int ones_count = 0, result = 0;
for (const auto& c : S) {
if (c == '0' && ones_count == 0) {
... | true |
82d94322e1dcba46fb2532e5f03c47d29f6eab60 | C++ | alexandraback/datacollection | /solutions_5631989306621952_1/C++/btzy/A.cpp | UTF-8 | 502 | 2.796875 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
int t;
string curr,inp;
int main(){
cin>>t;
for(int c=1;c<=t;++c){
cin>>inp;
curr="";
for(int i=0;i<inp.size();++i){
string first=curr+inp[i];
string second=inp[i]+curr;
if(first<sec... | true |