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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9ff8d3e285e0c978580dacbe879517c4ac807b97 | C++ | KrunalChande/ctci-cpp | /ctci/Chap4-TreesAndGraphs/4-1.cpp | UTF-8 | 1,075 | 3.03125 | 3 | [] | no_license | /*
* @Name : 4-1.cpp
* @Author : Krunal Chande
* @Created : Mar 11, 2015
* @Description : Check if a binary tree is balanced
*/
#define DEBUG false
#include <myADTs/BinaryTree.h>
#include <iostream>
using namespace std;
using namespace myADTs;
int main() {
BinaryTree<int> binaryTree;
binaryT... | true |
5b49c4935c55e71189a1d3c116f394ce3e7b58b4 | C++ | artem-grishin/CodecademyProjectsCPP | /module2-variables/dog_years/dog_years.cpp | UTF-8 | 312 | 3.53125 | 4 | [] | no_license | #include <iostream>
int main() {
int dog_age;
std::cout << "Enter your dog's age: ";
std::cin >> dog_age;
if(dog_age <= 2) {
dog_age *= 10.5;
}
else if (dog_age > 2) {
dog_age -= 2;
dog_age *= 4;
dog_age += 21;
}
std::cout << "Your dog's age is: " << dog_age << "\n";
}
| true |
c9eef904e6439ab46ed159161a840fd71502dae3 | C++ | iliazeus/magex | /src/nfa.cc | UTF-8 | 2,008 | 2.8125 | 3 | [
"MIT"
] | permissive | // Copyright 2018 Ilia Pozdnyakov
// This file is distributed under the MIT license.
// See the LICENSE.txt file for details.
#include "./nfa.h"
namespace magex {
NFA::Transition::Transition(State *f, const std::string &l, State *t)
: from(f), label(l), to(t) {}
NFA::Transition::Transition(State *f, std::string... | true |
e11bbf5393aa3b5c6b7eb3ffcef25eab9bd7e967 | C++ | iwtbam/leetcode | /code/lt1420.cpp | UTF-8 | 1,124 | 2.5625 | 3 | [] | no_license | #include <algorithm>
#include <vector>
using namespace std;
class Solution {
public:
int numOfArrays(int n, int m, int k) {
k = min(k, n);
vector<vector<vector<int>>> dp(n, vector<vector<int>>(m + 1, vector<int>(k + 1, 0)));
const static int MOD = pow(10, 9) + 7;
... | true |
900c95b3ad67c95b0182ef3564577634c505214c | C++ | dylanmcgauley/PirateGame | /FinalGame/Animation.h | UTF-8 | 444 | 2.6875 | 3 | [] | no_license | #pragma once
#include "SFML\Graphics.hpp"
#include "AnimatedSprite.h"
class Animation : public AnimatedSprite
{
public:
Animation();
~Animation();
void init(int left, int top, int width, int height, int frames, float speed);
sf::IntRect getCurrentFrame();
float getAnimationTime() { return animationSpeed; };
void ... | true |
2d524ad4f91b09ac80be3cc895cc866cd4cd0a4b | C++ | Matrix-Ke/RouteLibraryTestDemo | /routeLib/AVL.cpp | GB18030 | 7,074 | 3.765625 | 4 | [] | no_license | /*
* ʵֶƽIJ롢ɾ
*/
#include "stdafx.h"
#include "AVL.h"
/*
*
* *TΪĶƽнkeyʧܣFALSE
* key뵽УȻΪƽTRUE
*/
bool AVLInsert(BiTree *T, TElemType key)
{
BiTree t;
//ǰҵĸΪ˽㣬ʲ㡣
if (!*T)
{
t = (BiTree)malloc(sizeof(BiNode));
t->data = key;
t->height = 1;
t->lchild = NULL;
t->rchild = NULL;
*T = t;
return true;
}
... | true |
cdc661e000b852238f23a1f6ffb6fcdc1da32895 | C++ | aldeacristina96/programming_priciples_and_practice_exercices_solved | /Chapet4Ex16_Mode.cpp | UTF-8 | 875 | 3.9375 | 4 | [] | no_license | #include<iostream>
#include<vector>
/*
Get a set of values from the user and see which value repeted the most*/
using namespace std;
int main()
{
vector<int> v;
int a,contor=0,maxim=0;
int value;
//get the values from the user
cout<<"Plese introduce integer values.Press any leter to stop"<<endl;
... | true |
4dffe4ee088c3447a179d156b8143abfef0706dd | C++ | Xiangyan93/CPP_HEAD | /XYHeadFile/xy_function.h | UTF-8 | 4,972 | 3.296875 | 3 | [] | no_license | #ifndef XYFUNC_h
#define XYFUNC_h
void right_fprintf(FILE *fp, std::string line, unsigned n) {
if (n > 20) {
error("function: right_fprintf(FILE *fp, string line, unsigned n) can be used only for n <=20\n");
}
std::string temp = line;
temp.insert(0, " ", n - temp.size());
fprintf(fp,... | true |
0a02bd5a837d13ca12d70ac23a4af46fc8d29d4d | C++ | jinseongbe/cpp_study | /CPP_80(단언하기_Assert+StaticAssert)/CPP_80/main.cpp | UTF-8 | 835 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <cassert> // assert.h
#include <array>
// assert : 런타임중에 생기는 오류를 찾아서 알려주고, 어디인지 알려줌!
using namespace std;
void printValue(const array<int, 5> &my_array, const int &ix);
int main()
{
const int number = 5;
assert(number == 5);
std::array<int, 5> my_array{ 1, 2, 3, 4, 5... | true |
3d60ee0d613ab987bae5e10ff084ea85a2c6c499 | C++ | VladyslavBychok/MesonProject | /abstract_factory/include/ConcreteProductA2.hpp | UTF-8 | 321 | 2.71875 | 3 | [] | no_license | #ifndef __CONCRETE_PRODUCT_A2_HPP
#define __CONCRETE_PRODUCT_A2_HPP
#include "AbstractProductA.hpp"
/**
* Concrete Products are created by corresponding Concrete Factories.
*/
class ConcreteProductA2 : public AbstractProductA {
std::string UsefulFunctionA() const override;
};
#endif // __CONCRETE_PRODUCT_A2_HP... | true |
565ac3a94443f80fee561e6f75ecde99e33006dd | C++ | shubhamsingh91/Pinocchio_ss | /unittest/symmetric.cpp | UTF-8 | 9,238 | 2.53125 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | //
// Copyright (c) 2015-2016,2018 CNRS
//
/* --- Unitary test symmetric.cpp This code tests and compares two ways of
* expressing symmetric matrices. In addition to the unitary validation (test
* of the basic operations), the code is validating the computation
* performances of each methods.
*
* The three method... | true |
e83e47edd8f49b02f0c9db49f6669e7e066adf84 | C++ | JZChrysos/Graph | /graph/main.cpp | UTF-8 | 4,000 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
// adjacency table
// weight 0 will be considered as no edge
float adj[20][20];
//labels
char labels[20];
// added
bool vadded[20];
//add edge
void addedge(int from, int to, float weight){
adj[from - 1][to - 1] = weight;
}
//remove vertex... | true |
07c33080c03f86e26c755db1a801a9cf58225176 | C++ | halfmvsq/histolozee | /src/imageio/util/MathFuncs.cpp | UTF-8 | 3,314 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #include "MathFuncs.hpp"
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/transform.hpp>
#include <algorithm>
#include <array>
#include <limits>
namespace imageio
{
namespace math
{
glm::dvec3 subjectImageDimensions(
const glm::u64vec3& pixe... | true |
5a609925118fe3ec0497435efd4a939e7e2f9893 | C++ | PrajBak/Ray-Tracer-in-One-Weekend | /Ray Tracer/camera.h | UTF-8 | 885 | 2.9375 | 3 | [] | no_license | #pragma once
#include "ray.h"
class camera {
public:
camera()
: asp_(0.0f),
focal_length_(0.0f),
origin_(float3(0.0f)),
horizontal_(float3(0.0f)),
vertical_(float3(0.0f)) {}
camera(float3 origin, float width, float height)
: origin_(origin) {
asp_ = width / height;
const float view_... | true |
35313283c456ff8878dcd86a0660b6a4e29b6f1f | C++ | rishusingh022/Standard-Template-Libraries | /wave_print.cpp | UTF-8 | 897 | 3.296875 | 3 | [
"MIT"
] | permissive | // Sample Input: 4 4
// 11 12 13 14
// 21 22 23 24
// 31 32 33 34
// 41 42 43 44
// Output Format: All M * N integers seperated by commas with 'END' wriiten in the end(as shown in example).
// Sample Output: 11, 21, 31, 41, 42, 32, 22, 12, 13, 23, 33, 43, 44, 34, 24, 14, END
// =====Solution=====
#include <iostream>
us... | true |
eb8fcd6259dcfcec7b926bfaff0ae35494a21505 | C++ | Sonny-kun/baitapLTNC | /baitapweek3/Phan A/bai5.cpp | UTF-8 | 489 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main() {
srand(time(NULL));
int f[30];
for (int i=0; i<30; i++) {
f[i]=rand()%100+1;
cout<<f[i]<<" ";
}
cout<<endl;
for (int i=0; i<29; i++){
for (int j=i+1; j <30; j++)
{
if (f[i] > f[j])... | true |
e2d095b82c3e4beb306f5e03f68fe3fb985eb05a | C++ | zeroplusone/AlgorithmPractice | /Leetcode/540. Single Element in a Sorted Array-2.cpp | UTF-8 | 426 | 2.71875 | 3 | [] | no_license | class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int n=nums.size();
int l=0, r=n-1;
while(l<r) {
int mid=(l+r)>>1;
if(mid%2==1) {
mid--;
}
if(nums[mid]==nums[mid+1]) {
l=mid... | true |
e751c4e8746a8fca0166feb64a7a77ba3049d661 | C++ | Jamxscape/LearnCPlusPlus | /1/1/2.cpp | UTF-8 | 1,178 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | #include<iostream>
#include <string>
using namespace std;
int main()
{
string a;
int n=0;
int p=0,t;
while(getline(cin,a)){
for (int i=0;i<a.length();i++)
{
if(i==0){
for(int j=i;j<a.length();j++){
if(a[j]==' '){break;}
... | true |
5f0e1ec042731ea246a2cfde2fa888d6ec18bfcf | C++ | s00ler/parallels | /task2/triplet.h | UTF-8 | 1,351 | 3.734375 | 4 | [] | no_license | #ifndef TASK2_TRIPLET_H
#define TASK2_TRIPLET_H
#include <iostream>
template <typename T>
struct triplet {
T x {}, y {}, z {};
triplet(T x = 0, T y = 0, T z = 0) {
this->x = x;
this->y = y;
this->z = z;
}
triplet operator* (T value) {
... | true |
e36013d0702aa74ade743c43a9135235d6876517 | C++ | darzouras/OSU-Assignments | /CS162/ModuleC/Path.hpp | UTF-8 | 772 | 2.5625 | 3 | [] | no_license | /*********************************************************************
** Program Filename: Path.cpp
** Author: Darlene Zouras
** Date: 4/13/2016
** Description: Path class header file
** Holds variables and function headers for the Path class.
*********************************************************************/
#if... | true |
ae2714c47fc9db6388a3670f84881cc20c5a9d3e | C++ | tvs/sol | /src/image/image.cpp | UTF-8 | 3,074 | 3.421875 | 3 | [] | no_license | #include "image.h"
// #include <iostream>
#include <fstream>
using namespace std;
Image::Image() {}
Image::Image(int width, int height) {
nx = width; ny = height;
raster = new RGB*[nx];
for (int i = 0; i < nx; i++)
raster[i] = new RGB[ny];
}
Image::Image(int width, int height, RGB backgroun... | true |
30d57608ce634be1e0ec32573e67a020db875233 | C++ | eheath23/RapidSynthVST | /SynthGUI/Source/OscillatorComponent.h | UTF-8 | 1,708 | 2.625 | 3 | [] | no_license | /*
==============================================================================
OscillatorComponent.h
Created: 6 Mar 2017 5:18:11pm
Author: Eliot Heath
==============================================================================
*/
#ifndef OSCILLATORCOMPONENT_H_INCLUDED
#define OSCILL... | true |
96a68367b56bcd598c343a3db6c8fc3398d65a01 | C++ | anjalipanikar/CS_Projects | /Hunt The Wumpus/gameflow.cpp | UTF-8 | 16,023 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string>
#include "wumpus.h"
#include "room.h"
#include "event.h"
#include "pit.h"
#include "bat.h"
#include "wumpus.h"
#include "gold.h"
#include "hunter.h"
using namespace std;
/**********************************... | true |
a2a62257017526c2598e0a5a42b2a11df833ad30 | C++ | Namlitruong/SED-2019 | /HaloSST-Lab1/HaloSST/old_Lab1.cpp | UTF-8 | 10,688 | 3.296875 | 3 | [] | no_license | //##########################################################################################################################################
// School of Science & Technology
// EEET2482 - Software Engineering Design
// Lab 1 - Simple 2-Argument Calculator
// Team name: HaloSST
// Member 1: Nam Truo... | true |
032a4b89561c68e16b31685828e3979583829353 | C++ | TakuyaSatoM/TFVIS | /tfvisV/Common.h | SHIFT_JIS | 1,937 | 2.609375 | 3 | [] | no_license | //
// Common.h
// ʂŎgp}N萔̒`
//
#ifndef _CommonA_h_
#define _CommonA_h_
#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <stdio.h> //for sprintf
#include <assert.h>
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#endif
#define CheckBox(txt){ MessageBoxA(NULL, txt, ("Erro... | true |
fbbc0eabf1b2f41d2c15407bd91e9903d1ffaa39 | C++ | DimanVoroshillo/TimpLaba_4 | /third_server/replace.cpp | UTF-8 | 1,167 | 3.25 | 3 | [] | no_license | #include "replace.h"
#include <string>
#include <iostream>
using namespace std;
Replace::Replace( string in)
{
this->key = in;
};
string Replace::encrypt(string in)
{
this->expression = in;
for (int i = 0; i < this->expression.size(); i++)
{
for (int j = 0; j < this->english_abc.size(); j++)
{
... | true |
8c5e3b60bee324b8b3a32162cf2bc6adca5849f1 | C++ | dshahid380/Algos | /SPOJ/CLFLARR_SPOJ.cpp | UTF-8 | 816 | 2.65625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int MAX = 1000002;
vector<int> tree(MAX,0);
vector<int> arr;
void update(int idx, int val, int N) {
for(; idx < N; idx = idx | (idx + 1))
tree[idx] += val;
}
void range_update(int l, int r, int val, int N) {
update(l, val, N);
update(r+1, -val, N);
}
int query(int r)... | true |
5ea92ab23eef256f43ad37a2fd8fada020e2eb57 | C++ | jacobchesley/Rover_2015 | /Arduino/src/Compass/Compass.cpp | UTF-8 | 2,942 | 3.09375 | 3 | [] | no_license | /**
* @author Jacob Chesley
* @date 3/12/2015
*/
#include <Compass.h>
//#define MAG_ADDR 0x0E
Compass::Compass(){
address = 0x0E;
degreesInRad = 57.2957795;
pi = 3.14159265359;
}
Compass::~Compass(){
}
void Compass::Configure(){
Wire.beginTransmission(address);
Wire.write(0x11); // control register2
Wire... | true |
0a839474fec6b7878909b3ea6289757a59f8618e | C++ | Neverous/codeforces | /ASC26/c.cpp | UTF-8 | 4,074 | 2.828125 | 3 | [] | no_license | /* 2013
* Maciej Szeptuch
* II UWr
*/
#include <cstdio>
#include <algorithm>
#include <vector>
const int MASKS = 131072;
int jewelery,
r1, r2;
long long int lower,
upper,
weight[32],
value[32],
valueF[MASKS],
valueS[MASKS],
weig... | true |
5f0b1fc11e0edf94008000a1d02234bc61fce2f1 | C++ | nilesh-s-b/Cpp_Programs_By_nilesh | /String_Operations.cpp | UTF-8 | 4,609 | 4.0625 | 4 | [] | no_license | // Without Using Built-In String Functions
/*
a program which should implement your own function equivalent to the library
function to perform various string operations
such as copy, length, reversing, palindrome, concatenation
and to find occurrence of a sub-string. (Your user define function must
have same ... | true |
64fb88ffa0b484737bcc2adf5ee76348826c3982 | C++ | GitJunk76345/Cpp_code | /Cpp_code/headers/lifo.h | UTF-8 | 1,934 | 3.921875 | 4 | [] | no_license | #pragma once
/*
Template based, fixed capacity lifo (Last In First Out) container class
*/
#include <iostream>
namespace containers {
template <typename T>
class lifo
{
size_t height;
size_t capacity;
T* data;
public:
lifo(size_t size) : capacity(size), height(0) { data = new T[capacity]; }
~lif... | true |
16f711f6d5bbad23934665290dc444deb60dfffe | C++ | Char-Mander/Juego-uno-solo | /Práctica 3/Práctica 3/unosolo.cpp | ISO-8859-1 | 18,824 | 2.8125 | 3 | [] | no_license | #include "unosolo.h"
#include <locale.h>
#include <cstdlib>
#include <stdio.h>
#include <windows.h>
#include <fstream>
using namespace std;
void colorFondo(int color); // Funcin que sirve para asignar un color para el fondo
void mostrar(const tJuego &juego); // Muestra el tablero y el nmero de movimientos realizado... | true |
07141d48cf312afc4227b0cf9c3b250ee4bc305d | C++ | dotnet/diagnostics | /src/shared/inc/safewrap.h | UTF-8 | 6,203 | 2.734375 | 3 | [
"MIT"
] | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//*****************************************************************************
// SafeWrap.h
//
//
// This file contains wrapper functions for Win32 API's that take SStrings
// and ... | true |
3c4de80378079b30a10d70051f767cf32b90fb4c | C++ | jmjatlanta/bitcoin-toolbox | /utils/calc_redeem_script.cpp | UTF-8 | 2,548 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <string>
#include <iostream>
#include <vector>
#include <script.hpp>
#include <iomanip>
#include <sstream>
void print_help_and_exit(int argc, char** argv)
{
std::cerr << "Syntax: " << argv[0] << " [ testnet | mainnet ] HASH160_HASHLOCK RECEIVER_PRIMARY_KEY TIMELOCK SENDER_PRIMARY_KEY\n";
if (argc > 1)
... | true |
aee3ffc40c7775f919ec78fcad4a98de09a9d739 | C++ | caomw/ShadingCurves | /Curve/BSpline.h | UTF-8 | 2,789 | 2.53125 | 3 | [] | no_license | #ifndef BSPLINE_H
#define BSPLINE_H
#include <vector>
#include <QPainterPath>
#include <opencv2/core/core.hpp>
#include "ControlPoint.h"
#define DEFAULT_SUBDV_LEVELS 0
class BSplineGroup;
class Surface;
class BSpline
{
public:
BSpline();
void recompute();
void computeSurfaces(cv::Mat dt, cv::Mat lumina... | true |
8ce9692c038ad1764f8e2aa7357ed3b461207acc | C++ | federicomrossi/7542-tp-final-grupo04 | /Codigo/common_socket.cpp | UTF-8 | 7,022 | 3.09375 | 3 | [] | no_license | //
// common_socket.cpp
// CLASE SOCKET
//
// Clase que implementa la interfaz de los sockets de flujo (utilizando el
// protocolo TCP), proporcionando un conjunto medianamente extenso de métodos
// y propiedades para las comunicaciones en red.
//
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#... | true |
c190ee4673626dd3ee0a1cfd71b231fbb7bdc8f4 | C++ | phani653/fresh-water | /clg_programs/hacker rank/NigratoryBirds.cpp | UTF-8 | 360 | 2.765625 | 3 | [] | no_license | //https://www.hackerrank.com/challenges/migratory-birds/problem
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int ar[n], type[6]={0};
for(int i=0; i< n; i++) cin >> ar[i];
for(int i=0;i<n;i++) type[ar[i]]++;
int lrg_typ= 1;
for(int i=2;i<=5;i++) if(type[i] > type[lrg_typ]) lrg_ty... | true |
3ae3140d49bcf6fc8cba38b45b55a17829e9201f | C++ | CytronTechnologies/Arduino_SN-FPR-SM630 | /SM630_AddFinger/SM630_AddFinger.ino | UTF-8 | 3,807 | 2.515625 | 3 | [] | no_license | #include <SoftwareSerial.h>
#define DEBUG 0
SoftwareSerial mySerial(10, 11); // RX, TX
/************************************************************************
Communication Packet
************************************************************************/
byte addFingerPrint0[] = {0x4D, 0x58, 0x10, 0x03, 0x40, 0x00, ... | true |
f8012b3bc3a14983270775cbb3e8122a78a6f3db | C++ | hackettccp/CSCI112 | /Modules/Module10/SampleCode/a_basics/Example4_VariablesAndTypes.cpp | UTF-8 | 2,432 | 4.09375 | 4 | [
"MIT"
] | permissive | /**
* Demonstrates variables and primitive data types in C++
*
*/
#include <iostream>
using namespace std;
/**
* Main Function.
*/
int main() {
int number = 75; //Same 4-byte (32-bit) signed integer data type as Java
long number2 = 1234L; ... | true |
0b74d6e691ed8eeb7e3efe0744c64074c7a2345c | C++ | pedroAdami17/A.I_Assignment4 | /src/FloatCondition.h | UTF-8 | 416 | 2.75 | 3 | [] | no_license | #pragma once
#ifndef __FLOAT_CONDITION__
#define __FLOAT_CONDITION__
#include "Condition.h"
class FloatCondition :public Condition
{
public:
FloatCondition(const float min_value = 0.0f, const float max_value= 1.0f);
~FloatCondition();
void setTestValue(const float value);
bool Test() override;
private:
float m_... | true |
e2cebab637721ca014f0ccd66f6eaf4b3a4dd457 | C++ | hieuhdh/OOP | /Theory/More/Problems/Friend/09.cpp | UTF-8 | 230 | 3.1875 | 3 | [] | no_license |
#include<iostream>
using namespace std;
class A{
int a = 10;
friend class B;
};
class B{
public:
void display(A&a){
cout << a.a;
}
};
int main(){
A a;
B b;
b.display(a);
return 0;
} | true |
2852183c53bd098cc2a8e041eb1daef23745666c | C++ | Davinatoratoe/Centipede | /CentipedeGame/CentipedeGame/DequeueScene.cpp | UTF-8 | 1,885 | 2.703125 | 3 | [] | no_license | #include "DequeueScene.h"
#include "imgui.h"
#include "string"
#include "CentipedeGameApp.h"
using namespace ImGui;
/// <summary>
/// Overloaded constructor.
/// </summary>
/// <param name="_font">The font to use.</param>
DequeueScene::DequeueScene()
{
}
/// <summary>
/// Deconstructor.
/// </summary>
DequeueScene... | true |
150d2683388505d48d52263bab21ea9cdc27f313 | C++ | liujiawei2333/aha-algorithm | /1_sort/sort1.cpp | UTF-8 | 689 | 3.46875 | 3 | [] | no_license | //排序的练习题,去重并排序
//使用桶排序,先去重再排序,去重就是不再计算每个桶插旗子的数量了,只要出现的都赋值为1即可
#include <stdio.h>
int main()
{
int a[1001],n,i,t;
for (i=1;i<=1000;i++)
a[i]=0;//初始化
scanf("%d",&n);//读入n
for (i=1;i<=n;i++)//循环读入n个编号
{
scanf("%d",&t);//每个编号读入变量t
a[t]=1;//标记出现过的编号(去重)
}
for (i=1;i<=1000;... | true |
7044f0c989c558ed06e9c87621cf2f68e4a7b6b5 | C++ | john1995/CSE168 | /Triangle.cpp | UTF-8 | 5,561 | 2.953125 | 3 | [] | no_license | #include "Triangle.h"
#include "TriangleMesh.h"
#include "Ray.h"
Triangle::Triangle(TriangleMesh * m, unsigned int i) :
m_mesh(m), m_index(i)
{
m_material = new const Material[3];
}
Triangle::~Triangle()
{
}
void
Triangle::renderGL()
{
//The individual triangle only holds its index within the mesh.
... | true |
ae3a8288b5a2019bf1c8f8bdab0ad3f1995857aa | C++ | ericlin1001/importSicilyToVmatrix | /unzip/2339 - Polymorphism and I_O/1001/main.cpp | UTF-8 | 353 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main() {
int N;
string name, code;
double cost;
cin >> N;
while(N--) {
cin >> name >> code >> cost;
cout << setw(15) << left << name <<
setw(15) << left << code <<
setw(10) << right << setprecision(2) <... | true |
79a6f34ddf867ced9ad1409a93ab539027f8b42a | C++ | Herael/Aquarium | /Seaweed.h | UTF-8 | 425 | 2.640625 | 3 | [] | no_license | //
// Created by Benjamin Rousval on 26/01/2020.
//
#ifndef AQUARIUM_SEAWEED_H
#define AQUARIUM_SEAWEED_H
#include <ostream>
class Seaweed {
private:
int hp;
int turn;
public:
int getHp();
int getTurn();
void setHp(int i);
void setTurn(int i);
Seaweed();
Seaweed(int hp, int turn);... | true |
fc3d3788c02cfc68b7ea956db1f2c7a985475217 | C++ | sigman78/sobjectizer | /so_5/rt/h/so_layer.hpp | UTF-8 | 2,464 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
SObjectizer 5.
*/
/*!
\file
\brief An addition layer for the SObjectizer Environment definition.
*/
#pragma once
#include <memory>
#include <map>
#include <typeindex>
#include <so_5/h/declspec.hpp>
#include <so_5/h/ret_code.hpp>
#include <so_5/rt/h/fwd.hpp>
namespace so_5
{
//
// so_layer_t
//
//! An inte... | true |
5d9e687a62e8624d2ae1e8b3d45a09d2ccf845a5 | C++ | netxpto/QuantumMiningSMC | /lib/hamming_decoder_20180608.cpp | UTF-8 | 4,422 | 2.765625 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <Windows.h>
#include "netxpto_20180418.h"
#include "hamming_decoder_20180608.h"
using namespace std;
void HammingDeCoder::initialize(void) {
outputSignals[0]->setSymbolPeriod(inputSignals[0]->getSymbolPeriod());
outputSignals[0]->setSamplingPeriod(inputSignals[0]->... | true |
4cc72547142dc9dbb608b9706f576a679fbc0715 | C++ | hancockyang/cpp-programming-language | /week3/Homework/1/main.cpp | UTF-8 | 511 | 3.015625 | 3 | [] | no_license | //
// main.cpp
// Homework1
//
// Created by hankang yang on 2/5/16.
// Copyright © 2016 hankang yang. All rights reserved.
//
#include <iostream>
using namespace std;
class A {
int val;
public:
A(int n) { val = n; }
int GetVal() { return val; }
};
class B: public A {
private:
int val;
public:
... | true |
31ca6e7c19f1de1f8397c7af606e17f760876cca | C++ | yuuyuk99/TankGame | /3D Game Framework 2017-06/DirectXgameFramework/Tower/Tower.cpp | SHIFT_JIS | 1,864 | 2.546875 | 3 | [] | no_license | #include "Tower.h"
#include "../Graphics.h"
#include <Effects.h>
#include <CommonStates.h>
#include "../Camera/Camera.h"
using namespace DirectX::SimpleMath;
using namespace DirectX;
using namespace std;
/*
*@RXgN^
*/
Tower::Tower()
{
//^[̐
this->_Tower = std::make_shared<ObjectBase>();
this->_health = 10;
}
/... | true |
446f290ebb81c51719e6c92f025de4019646dcbc | C++ | lberserq/mg | /branch.h | UTF-8 | 479 | 2.5625 | 3 | [] | no_license | #pragma once
#include "object.h"
enum
{
MAX_DEPTH = 20,
MAX_CAPACITY = 20
};
//branch of tree is cylinder
class branch : public object
{
friend class object;
int level_id;
void init_matrix() override;
public:
branch(object *parent = NULL);
virtual ~branch(void);
//redefinition of
v... | true |
972ae82c0f3d9997c6c8848502167426e4b7fa56 | C++ | prizm-labs/olaunch-hardware | /led_coaster/led_coaster_beginner_attiny/led_coaster_beginner_attiny.ino | UTF-8 | 1,701 | 3.125 | 3 | [] | no_license | // Indentifies the Pins used on the ATtiny
int pinLedRed = 0;
int pinLedYellow = 1;
int pinLedGreen = 2;
int pinPressureSensor = 3;
// The number of pressure levels on their ranges
int countPressureLevels = 4;
int colorPressureLevels[4][2] = {
{0,100},
{101,103},
{104,106},
{107,1000}
};
// This is the color for eac... | true |
ebb57b7343b263af92eee65040af6aacc6f7b91e | C++ | UnicornMane/AG_homework7.12.2019 | /8.cpp | UTF-8 | 939 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <random>
#include <algorithm>
using namespace std;
/*void kStatistics(vector <int> &arr, int &k)
{
nth_element(arr.begin(), arr.begin() + k - 1, arr.end());
}
*/
int kStatistics(std::vector<int> a, int n, int k)
{
for (int l = 1, r = n; ; )
{
if... | true |
b05b45caa721e6ac6a1e339123ed8830656198e1 | C++ | acolombier/MSc-OSProject-NachOS | /code/machine/translate.h | UTF-8 | 3,144 | 2.984375 | 3 | [
"MIT-Modern-Variant"
] | permissive | // translate.h
// Data structures for managing the translation from
// virtual page # -> physical page #, used for managing
// physical memory on behalf of user programs.
//
// The data structures in this file are "dual-use" - they
// serve both as a page table entry, and as an entry in
// a software-managed translat... | true |
c9667d73dc841c6d38c14bd4a7fa3306f23d83be | C++ | Smeany/ADS | /Aufgabe 4.1/Graph.h | UTF-8 | 1,058 | 2.53125 | 3 | [] | no_license | #ifndef _GRAPH_H
#define _GRAPH_H
#include <string>
#include <iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<set>
#include<algorithm>
#include"GraphNode.h"
using namespace std;
class Graph
{
public:
Graph();
Graph(int numberNodes);
void ini... | true |
581481b82ac2b97f0eef89897bc3b68ba45f9fcc | C++ | RickyL-2000/Algorithm | /leetcode/easy/countCharacters3.cpp | UTF-8 | 2,245 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
int countCharacters(vector<string>& words, string chars) {
bool check;
int sum = 0;
for (string& str : words) {
check = 1;
vector<int> hmc(26, 0);
for (a... | true |
c36aba85d3f4bfbf85ee4afbcd170436126d4ed1 | C++ | ZeddYu/CryptoCourseExperiment | /course5/sha1.cpp | UTF-8 | 2,977 | 3.171875 | 3 | [] | no_license | //
// Created by Zedd on 2019/1/8.
//
#include "sha1.h"
#include <iostream>
#include <vector>
#include <string>
#include <cstdio>
vector<int> X; // 8*64=512,每个下标存放8位
int W[80]; //32位为一组
int A, B, C, D, E;
int A1, B1, C1, D1, E1;//缓冲区寄存器,产生最后结果
int Turn;//加密分组数量N
using namespace std;
/**
* 循环左移
* @param x 待循环数
... | true |
ddd42899415412c2be06a7fae8ac90085353aabf | C++ | cwmagnus/bsf | /Source/Foundation/bsfEngine/GUI/BsGUIPanel.h | UTF-8 | 5,695 | 2.640625 | 3 | [
"MIT"
] | permissive | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
#pragma once
#include "BsPrerequisites.h"
#include "GUI/BsGUILayout.h... | true |
e8de431dc1c73a5cde2dbda178831d6592cfa08c | C++ | tom-cb/old-dev | /cplus/sedgewick/List.cpp | UTF-8 | 1,304 | 3.234375 | 3 | [] | no_license | #include "List.h"
#include "Node.h"
#include <stdlib.h>
#include <iostream>
/*
LinkNode List::newNode(int i)
{
LinkNode x = deleteNext(freeList);
x->data = i;
x->next = x;
return x;
}
*/
List::List(LinkNode iHead)
{
head = iHead;
head->next = NULL;
}
void List::traverse(LinkNode x, void (*visit)(LinkNod... | true |
d5b453a1c091d38b2b4d37f2ecef890bb0e74a88 | C++ | LTLattig/CS273HW5and6 | /HW6/HW6/Customer.h | UTF-8 | 3,835 | 3.484375 | 3 | [] | no_license | #pragma once
#ifndef CUSTOMER_H_
#define CUSTOMER_H_
#include <string>
using std::string;
/**
The Bank has Customers. Each Customer has a name, address, age, and telephone number.
Additionally, there are specialized types of Customers: Adult, Senior, and Student.
Each type of Customer has its own checking and saving... | true |
d3a5db845d322bc86c6585cba103271336a0ab2a | C++ | GraphicsDreamTeam/CGFinalProject | /src/librt/Camera.cpp | UTF-8 | 3,421 | 3.078125 | 3 | [
"MIT"
] | permissive | //------------------------------------------------------------------------------
// Copyright 2015 Corey Toler-Franklin, University of Florida
// Camera.cpp
// Camera Object - position, up and lookat
//------------------------------------------------------------------------------
#include "Camera.h"
#include <assert.h... | true |
6543fb215728d926879f051e3c63c1766552f4f9 | C++ | savitarai/util | /log.h | UTF-8 | 2,633 | 2.71875 | 3 | [] | no_license | /**
* @file log.h
* @brief 日志输出接口
* @version 1.0
* @date 01/17/2019 11:43:37 AM
* @author tashanji (jitashan), jitashan@gmail.com
*/
#ifndef _UTIL_LOG_H_
#define _UTIL_LOG_H_
#include <string>
#include <iostream>
#include <log4cpp/Category.hh>
#include <log4cpp/PropertyConfigurator.h... | true |
2ea3f63ef93a20653e142e251ca658a855e904ff | C++ | epics-base/pvDataCPP | /src/misc/pv/thread.h | UTF-8 | 5,505 | 2.71875 | 3 | [
"MIT"
] | permissive | /* thread.h */
/*
* Copyright information and license terms for this software can be
* found in the file LICENSE that is included with the distribution
*/
/**
* @author mrk
*/
#ifndef THREAD_H
#define THREAD_H
#include <memory>
#include <sstream>
#include <stdexcept>
#if __cplusplus>=201103L
#include <functiona... | true |
67e9096b4daec1811e5170f6b95d47fc55a2bc9f | C++ | tistatos/TNCG15-ray-tracer | /include/triangle.h | UTF-8 | 501 | 2.65625 | 3 | [] | no_license | /**
* @file triangle.h
* @author Erik Sandrén
* @date 31-08-2016
* @brief [Description Goes Here]
*/
#ifndef __TRIANGLE_H__
#define __TRIANGLE_H__
#include <glm/glm.hpp>
#include "ray.h"
#include "color.h"
#include "intersectable.h"
class Triangle : public Intersectable {
public:
Triangle();
~Triangle();
Tria... | true |
3d81c84e65483d66183bc6a88247cf5a11221c3b | C++ | playbar/glespainting | /app/src/main/cpp/draw/myjni.cpp | UTF-8 | 3,905 | 2.546875 | 3 | [] | no_license |
#include <jni.h>
#include <stdlib.h>
#include "painter.h"
#include "mylog.h"
extern "C" {
JNIEXPORT void JNICALL
Java_com_haowan_openglnew_JNILib_exit(JNIEnv* env, jobject obj);
JNIEXPORT void JNICALL
Java_com_haowan_openglnew_JNILib_init(
JNIEnv* env, jobject obj,
jint canvasWidth, ji... | true |
09138eb5e2380cdfea0a30e32707204a858246ae | C++ | moohoorama/moohoorama | /include/ywq.h | UTF-8 | 4,112 | 2.875 | 3 | [] | no_license | /* Copyright [2014] moohoorama@gmail.com Kim.Youn-woo */
#ifndef INCLUDE_YWQ_H_
#define INCLUDE_YWQ_H_
#include <ywcommon.h>
#include <ywspinlock.h>
#include <ywutil.h>
template<typename DATA>
class ywQueue {
public:
ywQueue():next(this) {
}
ywQueue * next;
DATA data;
};
template<typenam... | true |
218601a290eaedc040634ee45f9787d057a9c377 | C++ | lains/libezsp | /src/ezsp/zigbee-tools/zigbee-messaging.h | UTF-8 | 1,362 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* @file zigbee-messaging.h
*
* @brief Manages zigbee message, timeout, retry
*/
#pragma once
#include "ezsp/ezsp-dongle-observer.h"
#include "ezsp/ezsp-dongle.h"
#include "ezsp/zbmessage/zigbee-message.h"
#include "spi/ByteBuffer.h"
namespace NSEZSP {
class CZigbeeMessaging : public CEzspDongleObserver {
pub... | true |
566bd91bb4e827aae67ae307fce66dc40bde0547 | C++ | ekdnam/competitive | /codechef/APRIL21C/SSCRIPT/sscript.cc | UTF-8 | 1,061 | 2.671875 | 3 | [
"MIT"
] | permissive | // https://www.codechef.com/APRIL21C/problems/SSCRIPT
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
#include <string>
#include <string.h>
using namespace std;
int main(void)
{
long long int t;
vector<string> out;
cin >> t;
long long int k, n;
string in;... | true |
f3a1d71a62e95d42ef5cca7606d3a96e7285f2dd | C++ | semrich/ds302_20 | /notes/8_2-4_PQ/pqueue.h | UTF-8 | 1,124 | 3.640625 | 4 | [] | no_license | #include <vector>
#include <set>
using namespace std;
/* The Main Priority Queue Interface. */
class PQueue {
public:
virtual ~PQueue() {};
virtual void Push(double d) = 0;
virtual double Pop() = 0;
virtual int Size() = 0;
virtual bool Empty() = 0;
virtual ... | true |
64b7c2b5edc752377c8d38086618f5f98d124ff5 | C++ | ssjf409/PS | /라인/2.cpp | UTF-8 | 1,159 | 3.0625 | 3 | [] | no_license | #include <string>
#include <vector>
#include <deque>
using namespace std;
vector<int> solution(vector<int> ball, vector<int> order) {
vector<int> answer;
deque<int> dq;
for(int i = 0; i < ball.size(); i++) {
dq.push_back(ball[i]);
}
vector<bool> isReserved(1000001, false);
... | true |
d9ff0ef7c65221369a4c2ae00cfbcc7c9e637c62 | C++ | Hipepper/Genetic-algorithm-C-- | /源.cpp | UTF-8 | 13,664 | 2.75 | 3 | [] | no_license |
# include <cstdlib>
#include <stdio.h>
# include <iostream>
# include <iomanip>
# include <fstream>
# include <iomanip>
# include <math.h>
# include <ctime>
# include <cstring>
using namespace std;
# define POPSIZE 50//种群内个体数量
# define MAXGENS 1000//最大的迭代次数
# define NVARS ... | true |
6bdbfcc2b5faad9efe2be91fc70c10b035bf8fd2 | C++ | kk2491/CPP_Quick_Tour | /Examples/oop_152.cpp | UTF-8 | 1,419 | 4.0625 | 4 | [] | no_license | #include <iostream>
#include <string>
class Player {
private:
std::string name;
int health;
int xp;
public:
Player(std::string name = "None", int health = 0, int xp = 0);
~Player();
void SetName(std::string name);
std::string GetName() const;
};
Player::Player(std::string nam... | true |
ab2ab1c709e002e5cc52c8cee87de2c52128cd45 | C++ | emfomy/pass | /src/genlog/pass.cpp | UTF-8 | 19,716 | 2.703125 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file genlog/pass.cpp
/// @brief The main PaSS algorithm for general logistic regression
///
/// @author Mu Yang <emfomy@gmail.com>
///
///////////////////////////////////////////////... | true |
8cd300ab95be121ea8e16357ff222fb3f1e3b934 | C++ | yunteng/CubicaPlus | /include/geometry/SPHERE.h | UTF-8 | 1,428 | 2.578125 | 3 | [
"BSD-2-Clause"
] | permissive | /******************************************************************************
*
* Copyright (c) 2015, Yun Teng (yunteng.cs@cs.ucsb.edu), University of
# California, Santa Barbara.
* All rights reserved.
*
*****************************************************************************/
#ifndef SPHERE_H
#define SPH... | true |
7d5b631bdca4dd0dfc43edb7bdff104aa2245f18 | C++ | MelihOzbk/deneyapkart-platformio-core | /examples/07_BLE/BLE_write/src/BLE_write.cpp | UTF-8 | 2,343 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #include <Arduino.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
// UUID oluşturmak için aşağıdaki linki kullanabilirsiniz:
// https://www.uuidgenerator.net/
#define SERVICE_UUID "7cdddbbf-b5a6-4c20-aaf1-f873fa503243"
#define CHARACTERISTIC_UUID "47332d64-d60d-483... | true |
b99c6319917025091d8475871444a737e4b745ae | C++ | tadelemon/qiaqia | /client/clientmain.cpp | UTF-8 | 898 | 2.8125 | 3 | [
"MIT"
] | permissive | // #include <iostream>
#include <cstdio>
#include "client.h"
#include "../utils/cmdline.h"
#include "../utils/asciilogo.h"
int main(int argc,char **argv){
cmdline::parser cmd;
char logo[MAXLINE];
cmd.add<std::string>("host", 'h', "host for the server,default 127.0.0.1", false, "127.0.0.1");
cmd.add<s... | true |
13fc03d5bdeb7420fe33e5c674ddb644ef9a4848 | C++ | GBDT-PL/GBDT-PL | /include/row_histogram.hpp | UTF-8 | 1,813 | 2.65625 | 3 | [
"MIT"
] | permissive | //
// row_histogram.hpp
// LinearGBMVector
//
//
#ifndef row_histogram_hpp
#define row_histogram_hpp
#include <stdio.h>
#include <vector>
#include <map>
#include <string>
#include <cassert>
#include <iostream>
#include "alignment_allocator.hpp"
using std::vector;
using std::string;
using std::map;
class RowHist... | true |
a68f6a26f17d2d61eec25365e319214bc638a538 | C++ | berry8192/Atc | /abc172/E.cc | UTF-8 | 1,409 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define SP << " "
#define LLi long long int
using namespace std;
int imax=2147483647;
long long int llimax=9223372036854775807;
LLi mod=1000000007;
//int型vectorを出力
void PV(vector<int> pvv) {
rep(i, pvv... | true |
3eaecd27e5a64e8a8e464e5b26a8e111ee71e4b6 | C++ | JarvistFth/webServer | /Base/ThreadPool.cpp | UTF-8 | 1,237 | 2.90625 | 3 | [] | no_license | //
// Created by jarvist on 3/19/20.
//
#include "ThreadPool.h"
#include <memory>
void std::ThreadPool::init() {
for(int i=0;i<thread_num;i++){
pool.emplace_back(std::move(std::make_unique<thread>(std::bind(&ThreadPool::runInThread,this))));
}
}
void std::ThreadPool::runInThread() {
while(!isSto... | true |
0a71310d3de39495898599a7ef3b0fbf60d4f2a2 | C++ | huanxuantian/arduino_demowork | /libraries/PJON/examples/SpeedTest/Receiver/Receiver.ino | UTF-8 | 1,177 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | #include <PJON.h>
float test;
float mistakes;
// network(Arduino pin used, selected device id)
PJON network(12, 44);
void setup() {
Serial.begin(115200);
network.set_receiver(receiver_function);
};
void receiver_function(uint8_t length, uint8_t *payload) {
// Do nothing to avoid affecting speed analysis
}
vo... | true |
b4494a4964be5229783c5d419184eb9dc3b18512 | C++ | amireh/Hax | /include/Hax/Configurable.hpp | UTF-8 | 3,420 | 2.515625 | 3 | [] | no_license | /*
* Copyright (c) 2011-2012 Ahmad Amireh <ahmad@amireh.net>
*
* 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 use... | true |
777ddd4799d7d022052f23fd6b938144a618d131 | C++ | lineCode/TXPK | /example/app/src/Main.cpp | UTF-8 | 2,708 | 2.796875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <SFML/Graphics.hpp>
#include "Atlas.hpp"
#include "CustomSprite.hpp"
#include "skeleton.hpp"
#define PI 3.14159265359f
#define DEG(x) (x / 2 * PI) * 360
#define RAD(x) (180 * x) / PI
int main()
{
sf::RenderWindow window(sf::VideoMode(450, 250), "TXPK Usage Example");
Atlas atlas;
if (!atlas.load("conten... | true |
feabed1b09f80e8fb7f78a82df83e61255d67643 | C++ | ahakouz17/Competitive-Programming-Practice | /Codeforces/D_100247.cpp | UTF-8 | 416 | 2.59375 | 3 | [
"MIT"
] | permissive | // solved: 2014-01-31 04:22:08
// https://codeforces.com/gym/100247/problem/D
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int n;
string a, b, c, f = "";
cin >> n >> a >> b >> c;
for (int i = 0; i < n; i++)
{
if (b[i] == c[i])... | true |
1b16fba9442d79a8526f6fa1954ff1867ceb4d86 | C++ | rverma870/DSA-practice | /gfg/must do interview que/Recursion/JosephusProblem.cpp | UTF-8 | 492 | 2.828125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void solve(int idx,int n,vector<int>&cur_people,int k)
{
if(cur_people.size()==1)
{
return ;
}
idx= (idx+k)%cur_people.size();
cur_people.erase(cur_people.begin()+idx);
solve(idx,n,cur_people,k);
}
int josephus(int n, int k)
{
k--;
vector<int>cur_peopl... | true |
9b2b26c5a73f9065a48f561eb0f17a4d39e58a5a | C++ | ehsanx/MatchItSE | /src/KM-Abadie.cpp | UTF-8 | 448 | 2.5625 | 3 | [] | no_license | #include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
double cppKMsqSum(CharacterMatrix m, CharacterVector c, NumericVector w){
int N = m.nrow();
int P = m.ncol();
int K = c.length();
NumericVector km(K);
for (int k = 0; k < K; k++){ // geht mit der std vermutlich besser
for (int n = 0; n < N; n++){
f... | true |
0cb0294cae1fcae52a13e3e3abc6cc1f34a732fa | C++ | SarthakArora23/xicpp | /swtuch_demo.cpp | UTF-8 | 555 | 2.703125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int dno;
cout<<"\n Enter day number :";
cin>>dno;
system("cls"); //clrscr();
switch(dno){
cout<<"Hello chetan...Thoda saa dhyan de";
case 1: cout<<"Monday";
break;
case 2: cout<<"Tuesday";
break;
case 3: cout<<"Wednesday";
break;
case... | true |
0824160d806b4a57d79d48c4f102865973692161 | C++ | iulian-manda/oop | /lab4/src/domain/Chocolate.cpp | UTF-8 | 375 | 3.265625 | 3 | [] | no_license | #include "Chocolate.h"
Chocolate::Chocolate(string name, string type, int price) {
this->name = name;
this->type = type;
this->price = price;
}
string Chocolate::get_name() {
return name;
}
string Chocolate::get_type() {
return type;
}
int Chocolate::get_price() {
return price;
}
void Choco... | true |
41e4a477201682ab00673b105cfb77537dca091d | C++ | NX1125/cg-tf | /bullet.h | UTF-8 | 810 | 2.65625 | 3 | [
"MIT"
] | permissive | /*
* File: bullet.h
* Author: gg
*
* Created on 7 de dezembro de 2019, 01:09
*/
#ifndef BULLET_H
#define BULLET_H
#include "projectile.h"
#include "wfobj.h"
class bullet_t : public projectile_t {
private:
static wf_object_t* sModel;
bool enemy;
float radius = 10.0f;
float horizont... | true |
f0f7c31cdbbe1e01812607958d256b2cc2b22066 | C++ | durkim/ter | /code/window.h | UTF-8 | 1,699 | 2.703125 | 3 | [] | no_license | /**
* \file window.h
* \brief représente l'interface graphique de l'application
* \author Fagard.C
* \version 0.1
* \date 14juin 2016
*
*
*
*/
#ifndef POLYOMINOES_WINDOW_H
#define POLYOMINOES_WINDOW_H
#include <QWidget>
#include <QGraphicsWidget>
#include <QPushButton>
#include <QLabel>
#include <QLCDNumber>
... | true |
27fcc681203e19d3f6e0711213677762591304a6 | C++ | iMeiji/C_Plus_Plus_Primer | /Chapter_04/Exercise_04_04/expression_evaluation.cpp | UTF-8 | 274 | 3.1875 | 3 | [
"Unlicense"
] | permissive | /**
* \file
* expression_evaluation.cpp
* \author
* Henrik Samuelsson
*/
#include <iostream>
using std::cout;
/**
* /brief
* Does an arithmetic calculation and prints the result.
*/
int main() {
cout << 12 / 3 * 4 + 5 * 15 + 24 % 4 / 2;
return 0;
}
| true |
2a83cf682f9da8b63183f9405d29425ff6b08819 | C++ | lionkor/GIP-19-20 | /02.05.cpp | UTF-8 | 733 | 3.359375 | 3 | [] | no_license | /*
Schreiben Sie ein C++ Programm, welches die Umrechnungen der vorigen
drei Aufgaben in einem einzigen Programm zusammenfasst.
*/
#include <iostream>
int main()
{
double input { 0 };
std::cout << "Ihre Eingabe: ? ";
std::cin >> input;
std::cout << "Ihre Auswahl der Umwandlung:" << std::endl
<< "1 - Celsius... | true |
f088c532d98f76466112ccc83588509613a867a3 | C++ | jimzrt/Tinfoil | /source/mode/mode.cpp | UTF-8 | 1,107 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "mode/mode.hpp"
#include "ui/framework/console_options_view.hpp"
#include "nx/fs.hpp"
namespace tin::ui
{
IMode::IMode(std::string name) :
m_name(name)
{
}
Category::Category(std::string name) :
m_name(name)
{
}
void Category::AddMode(std::unique_ptr<IMode> mode... | true |
bf1c66158ea4b1b8e053a3c2e9dad80003f30dc5 | C++ | nicholasdavies/ogwrangler | /src/lookup.cpp | UTF-8 | 7,771 | 2.53125 | 3 | [] | no_license | #include "lookup.h"
#include "code.h"
#include <algorithm>
#include <numeric>
#include <Rcpp.h>
using namespace std;
using namespace Rcpp;
Lookup::Lookup(Rcpp::DataFrame& d, Rcpp::DataFrame& d_code_names, Rcpp::DataFrame& d_metrics)
{
// Set geo names
geos = as<vector<string>>(d.names());
// Set codes and... | true |
a8b06a39391615f54261e1fc825eecc6ae08ef4e | C++ | SHEReunice/Acwing | /基础算法课/785. 快速排序/Acwing 785. 快速排序/main.cpp | UTF-8 | 789 | 3.09375 | 3 | [] | no_license | //
// main.cpp
// Acwing 785. 快速排序
//
// Created by Eunice on 2021/7/25.
// Copyright © 2021 Eunice. All rights reserved.
//
#include <iostream>
using namespace std;
int n;
int q[100005];
void quick_sort(int q[], int l , int r);
int main(int argc, const char * argv[]) {
scanf("%d",&n);
for(int i = 0; ... | true |
dda3f5309456f7a19a54f4664289e350c09a228e | C++ | KuzminaIrina/tg_mpei_course | /1019_Next_Greater_Node_In_Linked_List.cpp | UTF-8 | 732 | 3.109375 | 3 | [] | no_license | https://leetcode.com/problems/next-greater-node-in-linked-list/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
vector<int> nextLargerNodes(ListNode* head) {
ListNode *x = head, *p... | true |
9d433da96746446a38bc1e375e9862d698975b5e | C++ | jr-b-reiterer/ROSPlan | /rosplan_planning_system/src/EsterelPlan.cpp | UTF-8 | 2,401 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | #include "rosplan_planning_system/EsterelPlan.h"
#include <vector>
#include <string>
#include <ostream>
std::ostream& operator<<(std::ostream& os, const KCL_rosplan::StrlEdge& edge)
{
os << "\t[Esterel Edge] - ";
switch (edge.signal_type)
{
case KCL_rosplan::ACTION:
os << "Action: ";
break;
case KCL_rosp... | true |
37121709ab505abbb9d757210ff1a67a912afe14 | C++ | luotian/design_patterns_cpp | /src/bridge/bridge_lib.h | UTF-8 | 1,864 | 2.78125 | 3 | [] | no_license | #pragma once
#include "../base_def.h"
class MessagerImpl
{
public:
virtual void PlaySound() = 0;
virtual void DrawShape() = 0;
virtual void WriteText() = 0;
virtual void Connect() = 0;
virtual ~MessagerImpl() {}
};
class Messager
{
protected:
MessagerImpl* messagerImpl;
public:
virtual vo... | true |
e06e2c22677a166323cfe6d1fa492e4861de3c9b | C++ | ashlamp08/Compiler | /Reference/esil/typeTable.cpp | UTF-8 | 1,700 | 3.625 | 4 | [] | no_license | #include "typeTable.h"
#include <iostream>
int typeNode::count = 0;
typeNode::typeNode(std::string name) {
TYPE_NAME = name;
ENTRY = nullptr;
NEXT = nullptr;
INDEX = -1;
}
// Destructor
typeNode::~typeNode() {
if (isDefinition)
delete ENTRY;
}
//
typeNode *typeNode::install(std::string name, typeNode *structur... | true |
62a7291ab79a0080259bb6cfe907c405076423bd | C++ | SergeyRudyanskiy/AlgorithnsAndDataStructures | /AlgorithnsAndDataStructures/Search_Element_Ternary_Recursive.hpp | UTF-8 | 1,157 | 3.796875 | 4 | [] | no_license | #pragma once
template <typename Iterator, typename ElementType>
Iterator search_element_ternary_recursive(Iterator iterator_begin, Iterator iterator_end, const ElementType key_value) {
static const Iterator iterator_not_found = iterator_end;
ptrdiff_t distance = std::distance(iterator_begin, iterator_end);
... | true |
0aa18807015a181bdd9a0c8c7ffdf65e35de93c2 | C++ | Sadman007/DevSkill-Programming-Course---Basic---Public-CodeBank | /DevSkill_CP/Intermediate/Batch 13/class_28/code.cpp | UTF-8 | 1,284 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T, cs = 1;
scanf("%d", &T);
while(T--)
{
int n, M;
scanf("%d %d", &n, &M);
vector<int>c(n, 0), freq(n, 0);
for (int i = 0; i < n; i++)
scanf("%d", &c[i]);
for (int i = 0; i < n; i++)
... | true |