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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
51d74aafc5aa2669ce866a2a7c4d52baf2e5a192 | C++ | youngminpark2559/plang | /cpp/yk/018_array/005_concatenate_string/main.cpp | UTF-8 | 1,003 | 2.859375 | 3 | [] | no_license | // cd /mnt/1T-5e7/mycodehtml/p_lang/cpp/yk/018_array/005_concatenate_string && \
// g++ \
// -std=c++11 \
// -o main \
// /mnt/1T-5e7/mycodehtml/p_lang/cpp/yk/018_array/005_concatenate_string/main.cpp && \
// rm e.l && ./main 2>&1 | tee -a e.l && code e.l
#include <iostream>
#include <cstring>
using namespace std;
i... | true |
8a6596191cd8b3e0338bd14fe4e7dbf4e5e6a025 | C++ | Abinasbehera16/C- | /Practice/SWAP.CPP | UTF-8 | 313 | 2.921875 | 3 | [] | no_license | #include<iostream.h>
#include<conio.h>
int main()
{clrscr();
int a,b;
void swap(int, int);
cout<<"The no. is"<<"\n";
cin>>a>>b;
swap(a,b);
cout<<"a=="<<a<<" "<<"b=="<<b;
cout<<"a=="<<a<<" "<<"b=="<<b;
getch();
return 0;
}
void swap(int x,int y)
{
int temp;
temp=x;
x=y;
y=temp;
cout<<"x=="<<x<<"y=="<<y<<"\n";
}
| true |
6d88c6b7362ff7d54f777e833647c50aa2c4b64a | C++ | rmarko/CORElearn | /src/random.h | UTF-8 | 1,596 | 2.9375 | 3 | [] | no_license | /*
* random.h
*
* Created on: 12.3.2010
* Author: rmarko
*/
#if !defined(RANDOM_H_)
#define RANDOM_H_
#include <cstdlib>
#include <ctime>
#include "contain.h"
class PseudoRandom {
private:
// internal state of generator mrg32k5a from L'Ecuyer99
double s10, s11, s12, s13, s14, s20, s21, s22, s23, s24;
... | true |
bc2dc94e8d0040f391e6b4815802a30b13982c79 | C++ | W1lliam/CloudEngine | /CloudEngine/CloudMath/src/Tools/Random.cpp | UTF-8 | 879 | 2.9375 | 3 | [] | no_license | /**
* Project AltMath
* @author GP2021
* @version 1.0.0
*/
#include "CloudMath/stdafx.h"
#include "CloudMath/Tools/Random.h"
std::default_random_engine CloudMath::MathTools::Random::s_generator = std::default_random_engine(static_cast<unsigned int>(time(0)));
int CloudMath::MathTools::Random::GenerateInt(int p_m... | true |
9043a470111458e760a605268d93990cc5333181 | C++ | MarkOates/tins2021 | /tests/GameplayScreenTest.cpp | UTF-8 | 361 | 2.734375 | 3 | [] | no_license |
#include <gtest/gtest.h>
#include <GameplayScreen.hpp>
TEST(GameplayScreenTest, can_be_created_without_blowing_up)
{
GameplayScreen gameplay_screen;
}
TEST(GameplayScreenTest, run__returns_the_expected_response)
{
GameplayScreen gameplay_screen;
std::string expected_string = "Hello World!";
EXPECT_EQ(ex... | true |
9325bc2e8f32287e997f3c604698f8dfbf404e59 | C++ | vserousov/Algorithms-Course | /Sorting algorithms time comparison/program/BubbleSort.cpp | UTF-8 | 395 | 3.265625 | 3 | [] | no_license | #include "BubbleSort.h"
void BubbleSort::sort(int a[], int n)
{
for (int i = 0; i < n - 1; i++)
{
for (int j = 0; j < n - i - 1; j++)
{
if (a[j] > a[j + 1])
{
int temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}... | true |
c84619ba67aaa68cb269357f90401ff548bf6670 | C++ | RitikJainRJ/DailyCodingProblem-Practice | /reverse bit.cpp | UTF-8 | 227 | 2.84375 | 3 | [] | no_license | uint32_t reverseBits(uint32_t n) {
uint32_t res = 0;
int k = 32;
while(k--){
int x = n & 1;
n = n >> 1;
res = res | x;
if(k != 0)
res = res << 1;
}
return res;
}
| true |
a0b35d36f98bc9dfcf2b33a6960c12473a85ad01 | C++ | utkarsh235/CPP-Programming | /if else.cpp | UTF-8 | 1,055 | 3.671875 | 4 | [] | no_license | #include<iostream>
using namespace std ;
int main()
{
int a,c,b,d ;
cout << "enter a no.\n 1 for addition \n 2 for sustraction \n 3 for multiplication \n 4 for obtaining remainder\n";
cin >> c;
switch(c)
{
case 1: cout<< "enter first no\n";
cin>> a;
cout<< "enter sec... | true |
a9546b269097406e1bc7a290ddc6f3d89f184eb1 | C++ | wisest30/AlgoStudy | /source/leetcode/1691/신입.cpp | UTF-8 | 1,622 | 2.671875 | 3 | [] | no_license | class Solution {
public:
int maxHeight(vector<vector<int>>& cuboids) {
vector<vector<int>> newCuboids;
newCuboids.push_back({0, 0, 0});
for(auto &cuboid : cuboids)
{
set<vector<int>> uniqueCuboid;
uniqueCuboid.insert({cuboid[0],... | true |
03f02a4541f3c236d1d0bbfa6d337a84e6820163 | C++ | komiga/Cacophony | /Cacophony/String.hpp | UTF-8 | 610 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
@copyright MIT license; see @ref index or the accompanying LICENSE file.
@file
@brief String type.
*/
#pragma once
#include <Cacophony/config.hpp>
#include <Cacophony/aux.hpp>
#include <duct/char.hpp>
namespace Cacophony {
/**
@addtogroup etc
@{
*/
/**
@addtogroup string
@{
*/
/**
Turn input into a UTF-... | true |
8214b919043a5e10feb1a33b185d14e199689ee3 | C++ | Swess/RiskGame | /src/Map/MapDriver.cpp | UTF-8 | 5,955 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <cassert>
#include "Map.h"
using namespace std;
namespace Board {
namespace Driver {
bool test_simple_graph() {
Map map;
// Insert 6 stub nodes
for (int i = 0; i < 6; i++)
map.insert_country(*new Country("Stub name"));
vector<Country *... | true |
f3370e87bf5b081e35bfa7f5d856b90209d8f720 | C++ | YueNing/LC-learning | /C++/96.不同的二叉搜索树.cpp | UTF-8 | 501 | 2.75 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=96 lang=cpp
*
* [96] 不同的二叉搜索树
*/
// @lc code=start
class Solution {
public:
int numTrees(int n) {
vector<int> generateTrees(n + 1, 0);
generateTrees[0] = 1;
generateTrees[1] = 1;
for (int i = 2; i <= n; i++) {
for (int j = 1; j <= i; j++){... | true |
693220329874c987644f5c0848d609b82eb4e90d | C++ | Vuean/ThinkingInCPlusPlus | /4. Data Abstraction/Exercise/ex13.cpp | UTF-8 | 531 | 3.046875 | 3 | [] | no_license | #include "ex13.h"
#include <iostream>
using namespace std;
void Vedio::print()
{
cout << "Film name: " << name << endl;
cout << "Film duration: " << duration << endl;
cout << "Film cost: " << cost << endl;
cout << "Film actors: ";
for(int i = 0; i < actors.size(); i++)
cout << actors[i] << ... | true |
0a952515459c57ffe54828df78c8c493e19d6d37 | C++ | sqGlass/CPP_piscine | /01/ex00/main.cpp | UTF-8 | 1,779 | 2.828125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | true |
45ab3a67a1d98473766f54be7e7a2564d4fdb83d | C++ | NikitaDmitryuk/Particle | /src/rotatingfield.cpp | UTF-8 | 596 | 3.140625 | 3 | [] | no_license | #include "rotatingfield.h"
RotatingField::RotatingField(Vector3d _tension)
{
tension = _tension;
angleFi = Maths::computeFi(_tension);
angleTetha = Maths::computeTetha(_tension);
}
void RotatingField::setTension(Vector3d _tension){
tension = _tension;
}
Vector3d RotatingField::getTension(){
retur... | true |
4c0ffd4917f513524363968df83aec3916dca088 | C++ | AdityaAgarwal436/daa-lab | /Week-6/isPath/isPath.cpp | UTF-8 | 1,095 | 3.265625 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <stack>
#define MAX 20
using namespace std;
bool ispath(int **M, int V, int s, int d)
{
stack<int> st;
bool *visited = new bool[V]();
st.push(s);
visited[s] = 1;
while (!st.empty()) {
int u = st.top();
st.pop();
for (int ... | true |
b3df58ecc9472aa59e98a1060838b09949a42454 | C++ | ckj119940887/IntFlow | /tools/clang/test/CodeGen/ioc/cxx-explicit-cast.cpp | UTF-8 | 1,489 | 2.609375 | 3 | [
"NCSA"
] | permissive | // Check explicit vs implicit cast handling in C++
// This is tricky because of the way implicit cast nodes are generated
// to do the work for explicit casts, which become noop's.
// Go through the various sources of integer casts here and check them.
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %... | true |
1fc1e3833d541063d859741cc05da76a27d9216a | C++ | iter-yangxingya/linux | /system/code/fileio/copy.cpp | UTF-8 | 1,355 | 3.0625 | 3 | [] | no_license | //
// \file copy.cpp
// \brief for copy existing file to new file.
//
#include <sys/stat.h> // for ???
#include <fcntl.h> // for ???
#include <header.h> // for my own error wrapper function.
#include <string>
#include <iostream>
int main(int argc, char *argv[]) {
if (argc == 2) {
std::string ar... | true |
dbec62ea462c6fdffa701b75d3e45ce2aa55ad9f | C++ | DiamonJoy/DBScan | /ClusterAnalysis.h | UTF-8 | 8,171 | 3.328125 | 3 | [] | no_license | /*
作者: DiamonJoy
维护: 2014.3.8
*/
#include <iostream>
#include <cmath>
#include <fstream>
#include <iosfwd>
#include <math.h>
#include <vector>
#include "DataPoint.h"
using namespace std;
//聚类分析类型
class ClusterAnalysis
{
private:
vector<DataPoint> dadaSets; //数据集合
unsigned int dimNum; ... | true |
ae1322cc9745977c20486a01d67edadf47ddaaa8 | C++ | lineCode/Avatar | /Avatar/CFileManager.h | UTF-8 | 5,037 | 2.703125 | 3 | [] | no_license | //================================================
// Copyright (c) 2020 周仁锋. All rights reserved.
// ye_luo@qq.com
//================================================
#ifndef _CFILEMANAGER_H_
#define _CFILEMANAGER_H_
#include "AvatarConfig.h"
#include <string>
#include <vector>
using std::string;
using std::vector;
/... | true |
2e375040afd99e5daa5f48c1c27ae44d03521036 | C++ | Aufasder/Progra | /BoletosUI/BoletoUI/mainboletoswindow.cpp | UTF-8 | 1,843 | 2.515625 | 3 | [] | no_license | #include "mainboletoswindow.h"
#include "ui_mainboletoswindow.h"
#include <QMessageBox>
/*
QVector <int> DFe;
QVector <int> MFe;
QVector <int> AFe;
*/
QVector <QString> Nev;
QVector <int> Ven;
MainBoletosWindow::MainBoletosWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainBoletosWindow)
{
ui->... | true |
c4ceb13f10f985142c092493f76895323bd1df3a | C++ | convict-git/sport_coding | /educational_cf/codeforces.com/Codeforces_Educational_Codeforces_Round_39/F._Fibonacci_String_Subsequences/main2.cpp | UTF-8 | 3,741 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false); cin.tie (nullptr)
#define PREC cout.precision (10); cout << fixed
#ifdef CONVICTION
#include "/home/convict/Dropbox/myfiles/sport_coding/cplib/snippets/debug.h"
#else
#define debug(x...)
#endif
//Don’t practice u... | true |
2f82186f03e147e1c0b30941b55daae41c3e4e59 | C++ | suzuren/gamelearning | /cpp_new_features/enum_class.h | UTF-8 | 1,577 | 3.09375 | 3 | [] | no_license |
#ifndef __ENUM_CLASS_H_
#define __ENUM_CLASS_H_
enum class enum_class_value_t_1
{
enum_class_value_1 = 3,
enum_class_value_2,
enum_class_value_3,
enum_class_value_4,
};
enum class enum_class_value_t_2
{
enum_class_value_1 = 17,
enum_class_value_2,
enum_class_value_3,
enum_class_value_4,
};
class tets_class
... | true |
76fab1b400c5ead2c92225ee2aff49c1380a2001 | C++ | KushRohra/Codechef_codes | /COUPSYS.cpp | UTF-8 | 816 | 2.640625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int i,n,c,l,d,max1=0,max2=0,max3=0,p1=1000,p2=1000,p3=1000,x,y,z;
cin>>n;
for(i=0;i<n;i++)
{
cin>>c>>l;
if(l==1)
{
cin>>x;
if(x>=max1)
{
if(x>max1)
{
max1=x;
p1=c;
}
else
... | true |
ae34c169f615aa9d86a31f7984327dce1c53f7d0 | C++ | weiho1122/LeetCode | /C++/293 Flip Game.cpp | UTF-8 | 1,168 | 3.21875 | 3 | [] | no_license | class Solution {
public:
vector<string> generatePossibleNextMoves(string s) {
vector<string> rlt;
if(s=="") return rlt;
set<string> store;
store.insert(s);
for(int i = 0; i < s.size()-1; i++){
if(s[i] == '+' && s[i] == s[i+1]){
string tmp = flip(s,... | true |
c4137829bd7ccb2c6d22952cbb4248b33d76555f | C++ | denaxen/platformer_game | /src/player_states.h | UTF-8 | 2,733 | 2.59375 | 3 | [] | no_license | #pragma once
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include "animation.h"
#include "player.h"
class Player;
class PlayerState
{
protected:
Animation animation;
public:
PlayerState();
sf::Vector2i get_size();
void set_sprite(sf::Sprite& sprite, bool is_faced_right);
virtual... | true |
2e350107770d850af20e18f8531e47f759b91890 | C++ | msinyakova/Tinkoff_algorithm | /bag2.cpp | UTF-8 | 757 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, w;
cin >> n >> w;
vector<int> weights(n + 1, 0);
for (int i = 1; i < n + 1; i++)
cin >> weights[i];
vector<vector<int>> dp(n + 1, vector<int>(w + 1, -1000000));
dp[0][0] = 0;
for (int i = ... | true |
ba440e88d57a4a20f9495a7cd23f850d2855a8da | C++ | codeBeefFly/bxg_cpp | /day04_05/day04_05_homework_01_correction/Student.cpp | GB18030 | 1,239 | 3.421875 | 3 | [] | no_license | #include "Student.h"
Student::Student() : Student("unknown" , {}) {
std::cout << "..log::ι캯...\n";
}
Student::Student(std::string name) : Student(name, {}) {
std::cout << "..log::һι캯...\n";
}
Student::Student(std::string name, std::vector<int> score_vector) : name{ new std::string(name) }, score_vector{ score_... | true |
2246a9afb06cc48a4eff1a714e16c6abebaef246 | C++ | vaneet-hash/Competitive-Programming-codes-CPP | /VOTERSDI.cpp | UTF-8 | 1,473 | 3.28125 | 3 | [] | no_license | /*#include <stdio.h>
#include <stdlib.h>
int main()
{
int x=5;
int *ptr;
*ptr=&x;
printf("%d",printf("%d",ptr));
return 0;
}*/
//-------------------------------------------------------
// #include <iostream>
// #include <algorithm>
// using namespace std;
// int main()
// {
// int tree[][4... | true |
d101d855a7a2b86164b40b4c8988f8a4d3032a61 | C++ | cms-sw/cmssw | /L1Trigger/L1TCommon/interface/TriggerSystem.h | UTF-8 | 3,545 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #ifndef L1Trigger_L1TCommon_l1t_TriggerSystem_h
#define L1Trigger_L1TCommon_l1t_TriggerSystem_h
#include <vector>
#include <string>
#include <map>
#include <set>
#include "Parameter.h"
#include "L1Trigger/L1TCommon/interface/Mask.h"
namespace l1t {
class TriggerSystem {
private:
std::string sysId;
std:... | true |
c97e5db6adb791b5675dfaa261a3051baf3af6eb | C++ | PopovaYarovaya/kursach-arkanoid- | /Arcanoid/Arcanoid/ball.cpp | WINDOWS-1251 | 5,297 | 2.703125 | 3 | [] | no_license | #include "ball.h"
#include <QDebug>
#include "game.h"
#include "brick.h"
Ball::Ball(PlayerPlatform *playerPlatform)
{
speed = 1;
image = QImage("../Arcanoid/resources/ball.png");
w = image.width();
h = image.height();
setData(QVariant::String, "Ball");
this->playerPlatform = playerP... | true |
d6a2bd3d7e3f36c0ad1e3869fa62972c4fc4cba6 | C++ | Andrewsher/Leetcode | /8_String_to_Integer_(atoi).cpp | UTF-8 | 733 | 3.109375 | 3 | [] | no_license | class Solution {
public:
int myAtoi(string str) {
int result = 0;
int i = 0, tag = 1;
i = str.find_first_not_of(' ');
if(i == str.size()) return 0;
if(str[i] == '+' || str[i] == '-') {
if(str[i] == '+') tag = 1;
else tag = -1;
i++;
... | true |
828fd361afc6f802e527fc5742f03e5057a797b0 | C++ | PlabonKumarsaha/University_Work | /Algoritms/ackermann function.cpp | UTF-8 | 520 | 3.21875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int ackermann_function(int m,int n){
if(m==0 && n>0){
return n+1;
}
if(n==0 && m>0){
ackermann_function(m-1,1);
}
if(m>0 && n>0){
ackermann_function(m-1,ackermann_function(m,n-1));
}
}
int main()
{
int i,j;
for(... | true |
2b1ac0eb778f8d683eeca82e34e7400dec7778ff | C++ | Saphal-Thammu/Leet-Code-solutions | /intersection-of-two-linked-lists/intersection-of-two-linked-lists.cpp | UTF-8 | 1,481 | 3.46875 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
int lenA = 0; // length of 1st path
int l... | true |
354e5caa2ee7f68457032f93eff35db1c2e67bfa | C++ | ShacharMeir007/Flight_Simulator | /TextFunctions.h | UTF-8 | 944 | 2.6875 | 3 | [] | no_license | //
// Created by shachar Meir on 09/01/2020.
//
#ifndef FLIGHT_SIMULATOR__TEXTFUNCTIONS_H_
#define FLIGHT_SIMULATOR__TEXTFUNCTIONS_H_
#include <vector>
#include <string>
#include <iostream>
//functions to help manage operations on strings
void replace(char token1,const std::string & token2, std::string& str);
void rem... | true |
f5511af781328e06ced9e4dc3707d40b8fae69bc | C++ | AndyFernandes/programming-lab | /DictWithAVL/AVL.cpp | UTF-8 | 11,363 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include "avl.hpp"
using namespace std;
// Inicializa D como uma árvore vazia.
void inicializar (DicAVL &D){
D.raiz = nullptr;
}
// Pega a altura do nó
int height(Noh *no){
if(no == nullptr) return 0;
return no->h;
}
// Serve para ver qual a altura do nó, dado a al... | true |
e7b4d0159e486bdfe9767c1068bc096f06587e43 | C++ | yuna16/Leetcode | /274.cpp | UTF-8 | 720 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int hIndex(vector<int>& citations) {
int N = citations.size();
int low = 0;
int high = N;
int h = 0;
while (low < high)
{
int mid = low + ((high - low) >> 1);
if (citations[mid] >(N - mid))
{... | true |
53db4b375e50bf9d2a260831af92a670246cb219 | C++ | Mamun3058/Programming | /uva11764.cpp | UTF-8 | 568 | 2.640625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int t,i,n,temp=0,coun=0;
cin>>t;
for(i=1;i<=t;i++)
{
cin>>n;
int arra[n];
arra[0]=-99;
for(int j=1;j<=n;j++)
{
cin>>arra[j];
if(arra[j-1]<arra[j])
{
... | true |
16658827e145572a5507114b19b122a4540dfdd9 | C++ | Bluemi/visualizer | /src/entity/creation/Creation.cpp | UTF-8 | 1,641 | 2.8125 | 3 | [] | no_license | #include "Creation.hpp"
#include <vector>
#include "../Movable.hpp"
#include "../../shape/ShapeInitializer.hpp"
namespace visualizer {
Creation::Creation(const ShapeGenerator& shape, const std::string& group)
: _quantity(0), _position(), _size(glm::vec3(1.f, 1.f, 1.f)), _shape(shape), _group(group)
{}
Creation... | true |
3198dff168a52ac4946342cfce32456c0bed20e0 | C++ | scasta31/LuminitySensor | /src/sensors/sensor.h | UTF-8 | 988 | 3.15625 | 3 | [
"MIT"
] | permissive | #ifndef SENSOR_H
#define SENSOR_H
#include <Arduino.h>
#include <sensors/read.h>
template<class T>
class SensorABC {
public:
SensorABC(uint8_t id);
bool hasChanged();
Read<T> getValue();
uint8_t getId();
void excecute();
private:
bool changed;
T raw_valu... | true |
54939b462212038ddb1d6fccdacd67205fd8ca17 | C++ | colbrydi/cpp_params | /parameterTest.cpp | UTF-8 | 1,067 | 2.859375 | 3 | [] | no_license | #include "parameter.h"
#include <vector>
int main(int argc, char *argv[]) {
int test = 0;
std::cout << "Testing = " << test << std::endl;
std::vector<paramBase *> params;
param <int> op(&test);
op.name = "bob";
op.alias = "b";
params.push_back((paramBase *) &op);
//op.assign(2);
std::cout << "Testing ... | true |
5af51c07c91366bcebaaf80c637ab6e9099021cb | C++ | zhangwengame/LeetCode | /210.cpp | UTF-8 | 993 | 2.8125 | 3 | [] | no_license | class Solution {
public:
vector<int> findOrder(int numCourses, vector<pair<int, int>>& prerequisites) {
map<int,vector<int>> edge;
vector<int> indegree(numCourses,0);
vector<int> ret;
queue<int> topQueue;
for (int i=0;i<prerequisites.size();i++){
edge[prerequisit... | true |
8ea944cba55ba77c17a545887479332165242b69 | C++ | YoneTestOrganization/TestRepository | /DX9Sample022S(Vertex3D)/DX9Sample022/Camera.cpp | SHIFT_JIS | 2,545 | 2.984375 | 3 | [] | no_license | #include "Camera.h"
// B̃CX^X
CCamera* CCamera::m_pInstance = NULL;
// RXgN^
CCamera::CCamera(LPDIRECT3DDEVICE9 pd3dDevice)
{
m_pd3dDevice = pd3dDevice;
m_vViewAngle = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
}
// fXgN^
CCamera::~CCamera()
{
}
//
void CCamera::Create(LPDIRECT3DDEVICE9 pd3dDevice)
{
if ( ! m_pInstance)
... | true |
9eeba034ae6822e662577a1e3cb62e4aaee60a28 | C++ | zhaoshin/everything | /Everything/sort.cpp | UTF-8 | 6,234 | 3.5625 | 4 | [] | no_license | //
// sort.cpp
// Everything
//
// Created by Zhao, Xing on 3/19/15.
// Copyright (c) 2015 Zhao, Xing. All rights reserved.
//
#include <stdio.h>
// number of occurence
// frequence of occurence
/* if x is present in arr[] then returns the index of FIRST occurrence
of x in arr[0..n-1], otherwise returns -1 */
in... | true |
ecf6827fde6762d83775f1f394b66264b4612147 | C++ | Cynwise/assignment7 | /dvd.cc | UTF-8 | 2,014 | 3.3125 | 3 | [] | no_license | //*************************************
//
// DVD class implementation file
//
// Corey Farnsworth
// 07/07/18
// CS2401 Summer '18
//
//*************************************
#include "dvd.h"
using namespace std;
void Dvd::input(std::istream& ins){
char junk;
ins.get(junk);
if(&ins == &cin){
cout << "Enter ... | true |
ded9c51371a4595faaf7ac9f46d10e412df091ff | C++ | greenfox-zerda-sparta/wekkew | /07week/2day/rpgGame/rpgGame/Skeleton.cpp | UTF-8 | 574 | 2.84375 | 3 | [] | no_license | #include "Skeleton.h"
Skeleton::Skeleton(vector<vector<int>>& victor) {
posX = rand() % 8 + 1;
posY = rand() % 8 + 1;
while (victor[posY][posX] != 1) {
posX = rand() % 9 + 1;
posY = rand() % 9 + 1;
}
victor[posY][posX] = 2; /* 0 wall | 1 floor | 2 skeleton */
this->HealthPoint = 2 * (rand() % 6 + 1... | true |
47bba301aca7dbb53b957250b9f5ca3f0ed79ee0 | C++ | Anubhav2907/DSA | /LinkedList/hiren.cpp | UTF-8 | 633 | 2.984375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *next;
Node(int x){
data=x;
next=NULL;
}
};
Node *isLoop(Node *head){
Node *temp = new Node(0);
Node *curr = head;
Node *start = head;
Node *next = head;
while(curr!=NULL){
if(curr->next... | true |
7d70f4f0a29398584d5802f199c3a1953bca04aa | C++ | teimeikichengmingchi/progrmming-contest | /uva/uva10044.cpp | UTF-8 | 4,038 | 2.65625 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
using namespace std;
int main(){
int all_sen = 0, count_sen = 0;
cin >> all_sen;
char s[512];
while(all_sen--){
count_sen++;
int lines, ques;
cin >> lines >>... | true |
93a3af0d54a21e0c70e27334797b429a985de8d9 | C++ | tom-biskupic/LabPSU | /Firmware/LabPSU/CommandInterpreter.cpp | UTF-8 | 2,687 | 2.890625 | 3 | [] | no_license | /*
* CommandInterpreter.cpp
*
* Created: 19/07/2015 1:29:08 AM
* Author: tom
*/
#include "CommandInterpreter.h"
#include "VoltageSetCommand.h"
#include "string.h"
#include "stdio.h"
namespace
{
const int LINE_SIZE=50;
const int PARAM_SIZE=40;
const int COMMAND_SIZE=20;
const char EQUALS = '=';
... | true |
dd74518adfee3799555eb49db409484475c9b2aa | C++ | Mott1223/post | /Algorithm/Basic/update.cc | UTF-8 | 555 | 3.265625 | 3 | [] | no_license | /******************************************************************
* Content: Just update a item in the array
******************************************************************/
#include <stdio.h>
int main(){
int arr[] = {3, 5, 6, 9, -1};
int i = 0, n = 5;
int item = 55, j = 4;
printf("arr is:\n");
... | true |
52d21dddcac3bc08ab93f8f93c33c4e78f543fcd | C++ | lsqyling/PrimerAdvanced | /part_3_classdesignertool/TextQuery.cpp | UTF-8 | 2,442 | 2.828125 | 3 | [
"CC0-1.0"
] | permissive | //
// Created by shiqing on 19-5-10.
//
#include <fstream>
#include <sstream>
#include "TextQuery.h"
namespace query {
std::map<string, int> TextQuery::wordCounts_;
std::shared_ptr<vector<string>> TextQuery::lines_{std::make_shared<vector<string>>()};
std::shared_ptr<std::map<string, std::set<int>>> Text... | true |
ed671594613433e8b3e36604da0b9843d8b4c293 | C++ | aurelien-brabant/ft_containers | /test/map/copy.test.cpp | UTF-8 | 1,730 | 3.265625 | 3 | [] | no_license | #include "map_testing.hpp"
TEST(test_map_assignment_operator)
{
map<unsigned, unsigned> m;
unsigned baseN = 1000000;
for (unsigned i = 0; i != baseN; ++i) {
m.insert(FT_CONTAINER::make_pair(i, i));
}
map<unsigned, unsigned> mCopy = m, *mptr = &mCopy;
// test self-alignment
mCopy ... | true |
2f37ff1259a9d1f9199045cfd6f69e8be327e6aa | C++ | ajtopping/materia | /materia/gTreeNode.cpp | UTF-8 | 207 | 2.71875 | 3 | [] | no_license | #include "gTreeNode.h"
void gTreeNode::set_parent(gNode * new_parent)
{
parent_ = new_parent;
}
gNode * gTreeNode::get_parent()
{
return parent_;
}
void gTreeNode::clear_parent()
{
parent_ = nullptr;
} | true |
b22a825eab05e36d2534c43273fd82043a168c56 | C++ | avenatti/JPEGContentGuardISO10918 | /guard/src/Config.cpp | UTF-8 | 4,323 | 3.15625 | 3 | [] | no_license |
/// @file Config.cpp
///
/// @brief Implementation for Configuration class to parse configuration files.
///
/// @author Michael W. Benson
///
/// History:
/// M. Benson 2/22/2020 Initial version.
#include "Config.hpp"
#include "logging.hpp"
#include "utils.hpp"
#include <sstream>
#include <fstream>
#include... | true |
dc305645496a2a0dace5fcbb6e467ae7e2e1a8dc | C++ | PaulBeaudet/suspender | /suspenders.ino | UTF-8 | 4,864 | 2.890625 | 3 | [
"MIT"
] | permissive | // suspenders.ino ~ Copyright 2018 Paul Beaudet ~ License MIT
// Gives a computer ability to sleep for a period of time
// Server gives a signal with a timeout durration to sleep, arduino wakes system with a key press on durration lapse
#include <Keyboard.h> // Built in library for HID keyboard action... | true |
414e42c69b5432cd33d49059d95302a2597e090c | C++ | jainans/My-Leetcode-Solution-In-CPP | /CPP, C++ Solutions/134. Gas Station.cpp | UTF-8 | 1,172 | 3.140625 | 3 | [
"MIT"
] | permissive | // TC - O(N^2)
// SC - O(1)
/***************************************************************
class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int n = gas.size();
for(int i = 0; i < n; i++) {
int gasRem = gas[i] - cost[i];
int itr = (i+1)%... | true |
e734d64f11d50c47461ec41e49f58c3f295d9ca9 | C++ | mihirgadwalkar/Cyber-Cafe-Management-System | /Computer.h | UTF-8 | 10,354 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include <string.h>
#include <fstream>
#include<conio.h>
#include<iomanip>
void ComputerEntryfun();
using namespace std;
class Computer_Entry
{
protected:
char Computer_name[30];
char ip_Adress[12];
int memory;
char processor_model[20];
char motherbordcomp[20];
char unique_co... | true |
bbe7576e373bd9f84d3cc335b3dabdd4a73f35f5 | C++ | longshadian/zylib | /zylib/Tools.h | UTF-8 | 3,308 | 2.75 | 3 | [] | no_license | #pragma once
#include <cstring>
#include <ctime>
#include <string>
#include <vector>
#include <memory>
#include <algorithm>
#include <iterator>
#include <sstream>
struct timeval;
namespace zylib {
void Init();
std::vector<std::string> StrSplit(const std::string& s, char c);
// 字符串替换,字符串str中的src... | true |
e5f3e20fd7a716a4ff8949068918910b1935cb96 | C++ | hexu1985/cpp_code | /libstd_cpp/vector/insert11.cpp | UTF-8 | 1,208 | 3.375 | 3 | [] | no_license | // vector::insert
#include <iostream>
#include "vector.h"
int main ()
{
int myarray[3] = { 11, 22, 33 };
Hx::vector<int> myvec;
Hx::vector<int>::iterator it;
it = myvec.insert ( myvec.begin(), 10 ); // 10
// ^ <- it
it = myvec.insert ( it, 2, 20 ); ... | true |
87200fa7f26b635510adce26a702ba25cfd76659 | C++ | cmjeong/rashmi_oai_epc | /lte_enb/src/tenb_commonplatform/software/libs/messaging/messages/common/MfSetAdminStateReq.h | UTF-8 | 1,807 | 2.640625 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
//
// MfSetAdminStateReq.h
//
// Commands a Managed Fing to change its admin state.
//
// Copyright radisys Limited
//
///////////////////////////////////////////////////////////////////////////////
#ifndef __MfSetAdminStateReq_h_
#define ... | true |
f729a4d4d479440dfd345077fe3d0ec0d045cb51 | C++ | sdouma/450-Compiler-Project | /Project7/utf8sequence.cpp | UTF-8 | 1,091 | 3 | 3 | [] | no_license | #include "utf8sequence.h"
#include <iostream>
using namespace std;
UTF8Sequence::UTF8Sequence(std::istream &is_)
: is(is_)
{
offset = 0;
}
int UTF8Sequence::next()
{
int ans;
restart:
for (;;) { // loop past invalid starts
ans = is.get();
if ((ans & 0x80) == 0 || ans == -1) return ans;
if ((ans & 0xC0) !=... | true |
b7e0075afce9a2d4e1eacc7733199f2b6f560def | C++ | xuchuG/MySTL | /MySTL/stl_vector.h | GB18030 | 17,011 | 2.96875 | 3 | [] | no_license | #pragma once
#ifdef __STL_USE_STD_ALLOCATORS
template <class _Tp,class _Allocator,bool _IsStatic>
class _Vector_alloc_base {
public:
typedef typename _Alloc_traits(_Tp, _Allocator)::allocator_type allocator_type;
allocator_type get_allocator() const { return _M_data_allocator; }
_Vector_alloc_base(const allocator_t... | true |
9329d8d8e64404f6b77f9f2e4fb5e69e9bcfd98c | C++ | ph0ly/winutil | /io/File.h | GB18030 | 1,753 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <vector>
#include <string>
#include <memory>
#include "../pub/cmn.h"
NAMESPACE_PH0LY_BEGIN(io)
//
// -> File ļ
// Copyright (c) ph0ly 2013.03.13 . All rights reserved.
//
class PH0LY File
{
public:
// FM -> File Mode
enum Mode
{
FM_TEXT = 1,
FM_BINARY = 2,
FM_CREATE = 4
};
File(voi... | true |
844ecc163cb6f0698c6687a30671b98f40d95a1d | C++ | JM-W/DataStructure | /DataStructure/Graph/GQueue.h | UTF-8 | 502 | 2.53125 | 3 | [] | no_license | #include "dGraph.h"
#ifndef GQUEUE
typedef int ElementType;
class GQueue
{
public:
class GList
{
public:
GList(ElementType ele) :Element(ele),Next(NULL){};
ElementType Element;
GList* Next;
};
public:
GQueue()
{
Ver = End = NULL;
};
~GQueue(){};
public:
void Enqueue(... | true |
2c11ce1b970f18fcbb85652e6d552f78961813e2 | C++ | CShatto99/C-Projects | /Fall 2018 Semester/Assignment4.cpp | UTF-8 | 2,859 | 3.828125 | 4 | [] | no_license | //Name: Cameron Shatto
//Class: 2018 Fall - COSC 1436.S01
//Project 4: Speed of Sound in Gases
//Revision: 1.0
//Date: 10/08/18
//Description: This progam will utilize user I/O to determine the speed of sound in gases.
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int... | true |
1338088ba1ca0ab0fc56329c892d449bbcd321ef | C++ | lg878398509/gameproject | /goldminer/Classes/Gold.cpp | UTF-8 | 1,127 | 3.25 | 3 | [] | no_license | #include "Gold.h"
Gold* Gold::create(std::string type, Size size) {
Gold *gold = new Gold();
if (gold && gold->init(type, size)) {
gold->autorelease();
return gold;
}
else {
CC_SAFE_DELETE(gold);
gold = NULL;
return NULL;
}
}
bool Gold::init(std::string type, Size size) {
if (type == "smallGold") {
... | true |
379d37d1005c6aa9969e2239bede7c0d5faf7094 | C++ | yshmnks/YoshiPBR | /include/YoshiPBR/ysArrayGF.h | UTF-8 | 822 | 2.515625 | 3 | [] | no_license | #pragma once
#include "YoshiPBR/ysTypes.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | true |
0f8d41ff30a36ccf38322a8f7546bd2cac25ee11 | C++ | tianxia1221/Algorithm | /leetcode/547.1.cpp | UTF-8 | 460 | 2.859375 | 3 | [] | no_license | class Solution {
public:
int findCircleNum(vector<vector<int>>& M) {
int ret = 0;
int size = M.size();
vector<bool> mark(size, false);
for (int i = 0; i < size; i++) {
if (false == mark[i]) {
dfs(M, i, mark);
ret++;
}
}
return ret;
}
void dfs(vector<vector<int>>& M, int i, vector<bool>& ma... | true |
32f2700175a26b772e41b0583f68fb82d271429c | C++ | zhongjinda/exercise | /Algorithm/search/SkipList/SkipList.h | UTF-8 | 9,249 | 3.21875 | 3 | [] | no_license | #ifndef SKIPLIST_H
#define SKIPLIST_H
#include <stdlib.h>
#include <stdio.h>
template<typename T>
struct Less
{
bool operator()(const T& a, const T& b)
{
return a < b;
}
};
template<typename T>
struct SkipListNode
{
SkipListNode<T>* next;
SkipListNode<T>* below;
T va... | true |
604ebc4c6b68e824335477b93a071332ca2b0b89 | C++ | STabaresG/CursoFCII_UdeA-2020-2 | /Documentos/Parcial2/CC1035435726/ahorcado/Palabra.cpp | UTF-8 | 766 | 3.1875 | 3 | [] | no_license | #include <string>
#include "Palabra.h"
#include <iostream>
using namespace std;
Palabra::Palabra(const string & p_)
{
setP(p_);
setPParcial(string(p.length(), 'x'));
}
void Palabra::setP(const string & p_)
{
p = p_;
}
string Palabra::getP() const
{
return p;
}
void Palabra::setPParcial(const string... | true |
b7598687632efc9000278a65a8057151cd42651c | C++ | jxzhsiwuxie/cppPrimer | /chap07/exercises/ex_7.24.cpp | UTF-8 | 1,307 | 4.15625 | 4 | [] | no_license | //练习 7.24:给你的 Screen 类添加三个构造函数:一个默认构造函数;另一个构造函数接收宽和高的值,
//然后将 contents 初始化成给定数量的空白符;第三个构造函数接收宽和高的值以及一个字符,该字符作为初始化之后屏幕的内容。
#include <cstddef>
#include <string>
class Screen {
public:
typedef std::string::size_type pos;
Screen() = default;
Screen(pos ht, pos wd) : height(ht), width(wd), contents(ht * wi... | true |
2b09b91f0871feafaf2fc11b1bcdb5a593aaa5ec | C++ | abeaumont/competitive-programming | /kattis/quickbrownfox.cc | UTF-8 | 719 | 2.96875 | 3 | [
"WTFPL",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // https://open.kattis.com/problems/quickbrownfox
#include <cctype>
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
string s;
getline(cin, s);
for (int i = 0; i < t; i++) {
bool xs[26];
for (int j = 0; j < 26; j++) xs[j] = false;
getline(cin, s);
for (int j = 0; j < s.size(); j++) ... | true |
5c5fdff47e35c448ac905fb4fc04ec6da4eb2ce6 | C++ | KMACEL/TR-Cpp | /Adim1_Ornekler/29_Kalitim/src/main.cpp | UTF-8 | 1,017 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | //============================================================================
// İsim : 22_Pointer
// Yazan : Mert AceL
// Version : 1.0
// Copyright : AceL
// Açıklama :22_Pointer
//============================================================================
#include<iostream>
//#include"calisan... | true |
180f20271a4ac0131f25ee0c5aea7db5cf4e1c04 | C++ | JairFrancesco/DataStructuresDictionary | /DataStructures/NodoF.h | UTF-8 | 483 | 2.828125 | 3 | [
"MIT"
] | permissive | #ifndef NODOF_H
#define NODOF_H
#include <list>
template <class T>
class NodoF
{
public:
NodoF(T d)
{
this->valor=d;
this->padre=0;
this->marcado=false;
}
int get_grado()
{
return this->hijos.size();
}
virtual ... | true |
0da35069db731543699e268af0721608993bca65 | C++ | syvjohan/cppFun | /DoubleLinkedList/DoubleLinkedList/Main.cpp | UTF-8 | 904 | 3.046875 | 3 | [] | no_license | //AB5785 Johan Fredriksson
#include <iostream>
#include <cassert>
#include "List.h"
int main() {
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
List<int> list;
assert(list.Check(0));
list.PushBack(3);
assert(list.Check(1));
list.PushBack(34);
assert(list.Check(2));
assert(list.GetFirstNode()->... | true |
23257f3ba9572f993e6a177482d7f8079787ceac | C++ | ostersc/arduino-touch-wall | /CharacterTouchWall/Game.h | UTF-8 | 847 | 2.828125 | 3 | [] | no_license | #ifndef GAME_H
#define GAME_H
#include "Arduino.h"
#include "CharacterConfig.h"
#include "MP3Util.h"
const int MAX_ROUND_DURATION = 12000;
class Game {
public:
enum GameState {
waiting_to_start,
waiting_for_round,
playing,
waiting_to_end,
ended
};
//construtors
Game();... | true |
5277346355fee961d30d95d7cd5b31bab2c4a075 | C++ | gutucristian/examples | /cpp/asgn4/q3.cpp | UTF-8 | 1,462 | 4.15625 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include <math.h>
#include <functional>
/*
* * Your task is to implement makeSineToOrder(k)
* * This is templated by the type of values used in the calculation.
* * It must yield a function that takes a value of the specified type and
* * returns the sine of that va... | true |
be7311b09870fff2ce3a4197167c7864d99a8ade | C++ | wendajiang/leetcode | /cpp/1038.binary-search-tree-to-greater-sum-tree.cpp | UTF-8 | 2,554 | 3.625 | 4 | [] | no_license | /*
* @lc app=leetcode id=1038 lang=cpp
*
* [1038] Binary Search Tree to Greater Sum Tree
*
* https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/description/
*
* algorithms
* Medium (83.52%)
* Likes: 1853
* Dislikes: 118
* Total Accepted: 94.8K
* Total Submissions: 113.5K
* Testcase ... | true |
56717c09312ba321f38b481e25cee3269f467fa4 | C++ | rscharpf/XDE | /src/PotentialA.h | UTF-8 | 990 | 3.03125 | 3 | [] | no_license | #ifndef POTENTIALA_H
#define POTENTIALA_H
#include "Potential.h"
#include "Structure.h"
#include "Random.h"
class PotentialA : public Potential
{
public:
PotentialA(const Structure *str);
virtual ~PotentialA(void);
double potential(Random &ran) const;
Potential *copy(void) const;
private:
const Struct... | true |
ee0a5fc1b9000bc113438381d8f58c7dda98cb1d | C++ | bansheerubber/torquescript-interpreter | /src/components/mathExpression.cc | UTF-8 | 20,836 | 2.671875 | 3 | [] | no_license | #include "mathExpression.h"
#include "../interpreter/interpreter.h"
#include "accessStatement.h"
#include "booleanLiteral.h"
#include "../interpreter/entry.h"
#include "inlineConditional.h"
#include "numberLiteral.h"
#include "stringLiteral.h"
#include "symbol.h"
map<TokenType, int> MathExpression::Precedence = MathE... | true |
1668e5242f96def53341614811634221fab820ce | C++ | sajithkp/cs-assignment-4b | /Lab5.Question8.cpp | UTF-8 | 208 | 3.21875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int sum(int n)
{ if(n>0)
return (n%10)+sum(n/10);
}
int main()
{
int x;
cout<<"enter positive intiger";
cin>> x;
cout<<"sum of digits of"<<x<<"is"<<sum(x);
return 0;
}
| true |
c2f914c14836e790cc98288e31be9fe378eef8f3 | C++ | harshp8l/deep-learning-lang-detection | /data/train/cpp/ed27438fa4277cf3a53c6eef3da7816e53f3f3aasampled_filter.cpp | UTF-8 | 1,204 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "dort/filter.hpp"
#include "dort/sampled_filter.hpp"
namespace dort {
SampledFilter::SampledFilter(std::shared_ptr<Filter> filter,
Vec2i sample_radius):
sample_radius(sample_radius),
filter_to_sample_radius(Vec2(sample_radius) * filter->inv_radius),
samples(sample_radius.x * sample_radius.... | true |
7da1ec4cafd86ce6a4773317ee7d084964fe3a9a | C++ | ArtyomLinnik/Study | /Lab_4/AVLImpl.cpp | UTF-8 | 5,536 | 3.1875 | 3 | [] | no_license | #include "AVLImpl.h"
#include <string>
#include <iostream>
#include <exception>
#include <utility>
using namespace std;
//---------------- THE GREAT 6 ----------------------------
AVLTree::AVLImpl::AVLImpl() :
root(nullptr)
{
}
AVLTree::AVLImpl::AVLImpl(const AVLImpl &other) :
root(nullptr)
{
other.cop... | true |
0b6f6fc20899c938e62a1ea9870274236112c461 | C++ | FootprintGL/algo | /leetcode/423-reconstruct-original-digits-from-english.cpp | UTF-8 | 1,320 | 3.3125 | 3 | [] | no_license |
class Solution {
public:
string originalDigits(string s) {
/*
* 找规律
* zero, one, two, three, four, five, six, seven, eight, nine
* 偶数标志性字符z - zero, w - two, u - four, x - six, g - eight
* three/eight共有一个h, eight去掉之后,h - three
* five/four共有一个f,four去掉以后,f - five
... | true |
ae9b64422f30b8bfde0ce4b4cc0821753ba8feac | C++ | elct9620/seeker | /src/Ruby/Scene.cpp | UTF-8 | 2,476 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2016 Zheng Xian Qiu
#include "Seeker.h"
namespace Seeker {
namespace Ruby {
struct mrb_data_type Scene::Type = { "Scene", &Scene::mrb_free_scene };
void Scene::init(RClass* klass) {
Engine* engine = Engine::Instance();
engine->DefineMethod(klass, "initialize", &Scene::mrb_initial... | true |
6a74d20751e3f7fd4dee19b4ddbc2a2380788cd8 | C++ | mgorshkov/MoexTask | /UdpClient.cpp | UTF-8 | 1,716 | 2.8125 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "UdpClient.h"
UdpClient::UdpClient(const std::string& aHost, int aPort, const... | true |
c92fcbdc0478329cb80bb72a94727e205efd49a7 | C++ | DKarz/Sorting-Algorithms-Comparison | /InsertionSort.h | UTF-8 | 886 | 3.25 | 3 | [] | no_license |
#include <iostream>
#include <list>
#include "func.h"
using namespace std;
#ifndef PROBLEM_2_INSERTIONSORT_H
#define PROBLEM_2_INSERTIONSORT_H
template<typename T>
void insertionSort(list<T>& list1)
{
T change;
int ind;
for (int i = 1; i < list1.size(); i++)
{
change = at(list1, i);
... | true |
516d21c2b3bbb350e7a5f05089f38d0e9f76b30f | C++ | rsimari/Sorting-Linked-Lists | /stl.cpp | UTF-8 | 637 | 2.796875 | 3 | [] | no_license | // stl.cpp
#include "lsort.h"
#include <algorithm>
#include <vector>
#include <iostream>
void stl_sort(List &l, bool numeric) {
Node* temp = l.head;
std::vector<Node*> vec;
while (temp != nullptr) {
vec.push_back(temp);
temp = temp->next;
}
if (numeric) std::sort(vec.begin(), vec.end(), node_number... | true |
c81ffa72a022086f30aeb338aca9babd79c0062c | C++ | shreevatsa/misc-math | /qr-TU1yLp/calculate.cc | UTF-8 | 386 | 2.890625 | 3 | [] | no_license | #include <cstdio>
#include "FJ64_16k.h" // For a fast `is_prime` function: http://ceur-ws.org/Vol-1326/020-Forisek.pdf
int main() {
double ans = 0.5;
for (uint64_t p = 0; ; ++p) {
if (p % 1000000 == 0) {
printf("%lld %.9f\n", p, ans);
}
if (!is_prime(p)) continue;
if (p % 3 == 1) ans *= (p - ... | true |
eba2104f7d5ec9205b02f89e3d62669ac82ce471 | C++ | Neal854386/inter | /JumpGame.h | UTF-8 | 1,533 | 3.4375 | 3 | [] | no_license | /*
Author: Annie Kim, anniekim.pku@gmail.com
Date: Apr 21, 2013
Update: Jul 12, 2013
Problem: Jump Game
Difficulty: Easy
Source: http://leetcode.com/onlinejudge#question_55
Notes:
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each el... | true |
bab30dd19ebc0a743386fe32c4d7b632711b81d5 | C++ | Irvanabdurrahman/My-Code | /Algoritma-dan-Pemrograman-2/Praktikum-11/pwrsn.cpp | UTF-8 | 873 | 3.0625 | 3 | [] | no_license | #include <iostream.h>
#include <conio.h>
class pengaturan
{
protected:
int alas, tinggi;
public:
void luas (int a, int b)
{alas=a;tinggi=b;}
};
class keluaran
{
public:
void output (int i);
};
void keluaran::output (int i)
{
cout <<"Outputnya = " << i <<endl;
}
class segitiga: public pengaturan, public keluara... | true |
523f2e1df98de07d721ab62a10c5d40da22929b6 | C++ | k-t-l-h/TP_Algorithm | /module_1/task_3_1.cpp | UTF-8 | 2,503 | 3.71875 | 4 | [] | no_license | //
// Created by ktlh on 10.03.2021.
//
/*
* 3_1. Реализовать очередь с динамическим зацикленным буфером.
*/
#include <iostream>
#define DEFAULT_SIZE 16
using namespace std;
class Queue {
public:
~Queue();
Queue(const Queue&) = delete;
Queue(const Queue&&) = delete;
Queue& operator=(const Queue&)... | true |
08eb5f335b54c8067dfd38c24c0d8d8272d64586 | C++ | skanda99/Hackerrank-Leetcode | /leetcode375.cpp | UTF-8 | 621 | 3.125 | 3 | [] | no_license |
// problem: "https://leetcode.com/problems/guess-number-higher-or-lower-ii/"
class Solution {
public:
int getMoneyAmount(int n) {
vector<vector<int>>V(n+1,vector<int>(n+1,-1));
return getMinCost(1,n,V);
}
int getMinCost(int i,int j,vector<vector<int>>&V)
{
... | true |
98161e6e579f9b1556d49a65f57b3b1966ddc581 | C++ | AbeerVaishnav13/PADP-lab-programs | /sieve/sieve.cpp | WINDOWS-1252 | 2,653 | 3 | 3 | [] | no_license | #include<math.h>
#include<string.h>
#include<omp.h>
#include<iostream>
using namespace std;
int N = 10000;
int number_threads = 2;
double t = 0.0;
inline long Strike( bool composite[], long i,long stride, long limit ) {
for(; i <= limit; i += stride)
composite[i] = true;
return i;
}
l... | true |
e0b21ea29dc58c9cb3e2f5d116d31ffce1b2361c | C++ | RISHITA189/RISHITAKATTA | /Day6/CString/date.h | UTF-8 | 261 | 2.578125 | 3 | [] | no_license | #pragma once
class Date
{
int dd, mm, yy;
public:
Date();
Date(int dd , int mm ,int yy);
void accept_date();
void show_date();
/*friend istream& operator >> (istream& in, Date& c);
friend ostream& operator << (ostream& out, Date& c);*/
}; | true |
1072aae03aa55352b288810fd140603fffcf6cd7 | C++ | XintongHu/leetcode | /CPP/GrayCode.cpp | UTF-8 | 342 | 2.53125 | 3 | [] | no_license | class Solution {
public:
vector<int> grayCode(int n) {
vector<int> ans;
int base = 1;
ans.push_back(0);
for (int i = 1; i <= n; ++i) {
for (int j = base - 1; j >= 0; --j) {
ans.push_back(ans[j] + base);
}
base *= 2;
}
... | true |
91a10ed5742ddce8a653c3fd6cd4bf6871537fcc | C++ | Akash16s/Tough_Questions | /SubstringRecursion.cpp | UTF-8 | 512 | 3.375 | 3 | [] | no_license | // substrings using recurssion
//find all the substring of string using recursion
#include<iostream>
using namespace std;
void Subsequence(char *input,int i,char *output,int j){
//base case
if(input[i]=='\0'){
output[j]='\0';
cout<<output<<endl;
return ;
}
//first time
output[j]=input[i];
Sub... | true |
036b5e114d017e03d11fffeea384ff7c487d4239 | C++ | junierr/hdoj | /牛客多校/1A.cpp | GB18030 | 879 | 2.9375 | 3 | [] | no_license | /*
һpʹab1pӴСֵ±ͬ
ǵǰλߵһС±+1
ȫͬ
*/
#include<cstdio>
#include<cstring>
using namespace std;
int a[100005],b[100005];
int l1[100005],l2[100005];
int main(){
int n;
while(~scanf("%d",&n)){
for(int i=1;i<=n;i++)
l1[i]=l2[i]=0;
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
l1[i]=i;
while(l1[i]>0&&a[l1[i]-1]>=... | true |
b6e976126a1b4db2350f38c2c0afdfeed03551d1 | C++ | KingNormac/CPlusPlus-Opengl-Dragonbones | /DragonBones/DragonBones/DragonBones/objects/SkinData.h | UTF-8 | 826 | 2.796875 | 3 | [] | no_license | #ifndef SKINDATA_H
#define SKINDATA_H
#include "SlotData.h"
#include <string>
#include <vector>
namespace DragonBones {
class SkinData {
public:
std::vector<SlotData*> _slotDataList;
std::string name;
//std::vector<SlotData*> getSlotDataList(){return _slotDataList;}
SkinData() { name="";}
~SkinData() {
... | true |
2b565eabba4a285a0fd74bef8c554abfe4125c8b | C++ | mmcclain117/School-Code | /College/Cplus-Book-Code/Catchup/pointers.cpp | UTF-8 | 1,608 | 3.796875 | 4 | [
"Apache-2.0"
] | permissive | /*
* Created on: Feb 19, 2018
* Author: Master Ward
*/
#include <iostream>
#include <string>
#include <memory> // Used for smart pointers
using namespace std;
/* Take into note that array pointers are not always sorted */
string *getFullName(string[]);
int pointing() {
int x[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9... | true |