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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
930238bb5fb4897b94898d62f9685bd600c90ce0 | C++ | manet-sih/location_aided_manet_routing | /RoutingTable.cc | UTF-8 | 2,831 | 2.875 | 3 | [] | no_license | #include "RoutingTable.h"
RoutingTable::RoutingTable(){}
void RoutingTable::addEvent(ns3::Ipv4Address addr,ns3::EventId id){
auto itr = eventTable.find(addr);
if(itr==eventTable.end()){
eventTable[addr] = id;
}else{
itr->second = id;
}
}
void RoutingTable::addRouteEntry(RoutingTableEntry& entry){
rTable[entry.... | true |
9175b170d8ed8e7ec83d4b4ec28e5bae56c1a1bd | C++ | m1keall1son/ofxMediaSystem | /src/mediasystem/rendering/LayeredRenderer.hpp | UTF-8 | 10,569 | 2.65625 | 3 | [
"MIT"
] | permissive | //
// LayeredRenderer.hpp
// WallTest
//
// Created by Michael Allison on 6/19/18.
//
#pragma once
#include <tuple>
#include "ofMain.h"
#include "mediasystem/core/Entity.h"
#include "mediasystem/rendering/IPresenter.h"
#include "mediasystem/rendering/DefaultPresenter.h"
#include "mediasystem/util/TupleHelpers.hpp"... | true |
971f33e22d69e8d358f56ebbf6654d8eda4c80a9 | C++ | hoangtrongtin/quanlysinhvien | /ui/MyIO.cpp | UTF-8 | 794 | 2.5625 | 3 | [] | no_license | #include "MyIO.h"
MyIO::MyIO(){}
void MyIO::DataIn(TableUnit* ptU){
map<string, string> mapMember = ptU->GetMapMember();
for(auto it = mapMember.begin(); it != mapMember.end(); it++){
cout << "Enter value of " + it->first + ": ";
string value = ""; getline (cin, value);
ptU->SetMemberVa... | true |
add4a4cf64a8da0b608bd65fc7538df5c4d9c11a | C++ | tetat/Codeforces-Problems-Sol | /Difficulty1300/1155C.cpp | UTF-8 | 842 | 2.53125 | 3 | [] | no_license | /// Problem Name: Alarm Clocks Everywhere
/// Problem Link: https://codeforces.com/problemset/problem/1155/C
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n, m;
scanf("%d %d", &n, &m);
vector <long long> v;
long long x[... | true |
861bfd7cbeca80290dfadc708eb5c346bcfa19a1 | C++ | Jaehwi-So/Algorithm-Data-Structure | /a09_network_AOE_graph.cpp | UTF-8 | 2,803 | 3.328125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include"a09_network_AOE_graph.h"
/*
#define TRUE 1
#define FALSE 0
#define MAX_VERTICES 50
#define MAX_STACK_SIZE 100
typedef int element;
typedef struct GraphNode {
int vertex; //정점
int value; //현재까지의 작업량
GraphNode* link; //링크
} GraphNode;
typedef struct GraphType {
int ... | true |
e09caacddb8679fed1bc1047b2830cbc99ef8537 | C++ | xcode1986/nineck.ca | /CrossApp/ccTypes.h | UTF-8 | 5,176 | 2.71875 | 3 | [
"MIT"
] | permissive |
#ifndef __CCTYPES_H__
#define __CCTYPES_H__
#include <string>
#include "basics/CASize.h"
#include "basics/CAPoint.h"
#include "basics/CAPoint3D.h"
#include "basics/CARect.h"
#include "basics/CAColor.h"
#include "CCGL.h"
NS_CC_BEGIN
/** A texcoord composed of 2 floats: u, y
@since v0.8
*/
typedef struct _ccTex2F... | true |
6263ef2bf0dea842da95c643db075b81aa06e849 | C++ | errolyan/C-Xcode | /04 - Pointers/04 - Pointers/main.cpp | UTF-8 | 1,254 | 3.546875 | 4 | [] | no_license | //
// main.cpp
// 04 - Pointers
//
// Created by Victor Bolinches Marin on 19/11/15.
// Copyright © 2015 Victor Bolinches Marin. All rights reserved.
//
#include <iostream>
using namespace std;
void pointer() {
int x;
int* p;
p = &x;
cout << " int *p = &x " << endl;
cout << " Please... | true |
c9b4547fffe4612dcb59c38324abbc3e6ba146b0 | C++ | sharon-cohen/maze-pattern | /Demo.h | UTF-8 | 1,040 | 2.65625 | 3 | [] | no_license | #include "MyMaze2dGenerator.h"
#include "MazeSearcable.h"
#include "AstarA.h"
#include "AstarM.h"
#pragma once
template<class T>
class Demo {
public:
Demo() {}
void run() {
MyMaze2dGenerator gen;
Maze2d *maz1 = new Maze2d();
maz1 = gen.generate();
cout<<endl<<"Time"<<gen.measureAlgorithmTime()<<endl;
stri... | true |
fdc5603eb1089e65ad15486fa3bccfd3444122b2 | C++ | tuxdna/sourcecode | /c++/qt/utf/utf.cpp | UTF-8 | 346 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #include <QTextStream>
#include <QFile>
int main() {
QFile data("utf.txt");
QString line;
if(data.open(QFile::ReadOnly)) {
QTextStream in(&data);
QTextStream out(stdout);
out.setCodec("UTF-8");
in.setCodec("UTF-8");
do {
line = in.readLine();
out << line << endl;
}
whil... | true |
1318c05c5e83b95d0c257db1d817a4867a2a35bc | C++ | divyaagarwal24/coderspree | /Web/Archi24_ArchiMittal_2024it1052_2/function and arrays/rotatearray.cpp | UTF-8 | 526 | 3.0625 | 3 | [] | no_license |
#include<iostream>
using namespace std;
void rotate(int arr[],int n)
{
int i,l;
l=arr[n-1];
for(i=n-1;i>=0;i--)
{
arr[i]=arr[i-1];
}
arr[0]=l;
}
int main()
{
int n,k,i,arr[100];
{
cin>>n;
for(i=0;i<n;i++)
{
s... | true |
591c25d16ecc0a49ad91f81f4a40d021c0107204 | C++ | sw15-algorithm-study/algorithm_study | /영재/7주차/7_1_4811.cpp | UTF-8 | 760 | 3.109375 | 3 | [] | no_license | // 카탈란 수.... 경로 문제처럼 생각하자
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> testCaseList;
long long* catalan = new long long[31]();
catalan[0] = 1;
catalan[1] = 1;
catalan[2] = 2;
int inputNum;
while(true)
{
cin >> inputNum;
if(inputN... | true |
40e0e757ac5e3aef4be8c81f5227c57af5b25315 | C++ | oneofthezombies/test-server | /base/FileDescriptor.cpp | UTF-8 | 2,121 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// Created by hunhoekim on 2021/01/24.
//
#include "Precompile.h"
#include "base/FileDescriptor.h"
#include <unistd.h>
#include <sys/socket.h>
#include "base/Result.h"
namespace ootz {
FileDescriptor::FileDescriptor(int32_t fd)
: fd_(fd) {
}
FileDescriptor::FileDescriptor(FileDescriptor&& other) noexcept
... | true |
07f2b267cee43c54d1b7f93f16bf52bcd5f21768 | C++ | AcuteAngleCloud/Acute-Angle-Chain | /externals/binaryen/test/emscripten/tests/poppler/poppler/NameToCharCode.cc | UTF-8 | 2,152 | 2.6875 | 3 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause",
"NCSA",
"GPL-1.0-or-later",
"GPL-2.0-or-later",
"LGPL-2.0-or-later",
"GPL-2.0-only"
] | permissive | //========================================================================
//
// NameToCharCode.cc
//
// Copyright 2001-2003 Glyph & Cog, LLC
//
//========================================================================
#include <config.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#include <string.h>
#inc... | true |
03f9fef8d73e56564c4ae7c8d9c72b7c15c45575 | C++ | octaviansoldea/H261 | /Src/libCommon/Singleton.h | UTF-8 | 248 | 2.625 | 3 | [] | no_license | #ifndef SINGLETON_H
#define SINGLETON_H
template <class T>
class Singleton {
private:
static T m_instance;
public:
static T *instance(void) { return &m_instance; }
};
template <class T>
T Singleton<T> :: m_instance;
#endif /* SINGLETON_H */
| true |
3e2751005723aed33ae35639d0123b267ff7992c | C++ | neophob/ArduinoPlayground | /ws2801_fastspi_example/ws2801_fastspi_example.ino | UTF-8 | 3,489 | 2.515625 | 3 | [] | no_license | /*
* PixelInvaders serial-led-gateway, Copyright (C) 2012 michael vogt <michu@neophob.com>
* Tested on Teensy and Arduino
*
* ------------------------------------------------------------------------
*
* This is the SPI version, unlike software SPI which is configurable, hardware
* SPI works only on very specif... | true |
8eb693416b29b273f28140a451d4800090ad1e72 | C++ | venkatarajasekhar/adved-games | /src/ps4_input.h | UTF-8 | 415 | 2.578125 | 3 | [] | no_license | #pragma once
class PS4_Input {
public:
static bool Init();
static bool Update();
static bool Shutdown();
protected:
private:
PS4_Input() = delete;
~PS4_Input() = delete;
// delete copy/move constructors & assign operators
PS4_Input(PS4_Input const &) = delete;
PS4_Input(PS4_Input &&) = delete;
PS4_I... | true |
da9131d59d0467fac2aa5ceeb498f3e6b0d3a142 | C++ | BakeSs/University_Test | /LB5_af_edit.cpp | UTF-8 | 441 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include "windows.h"
using namespace std;
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
double a, b, c, x, F;
cout << "Введіть a, b, c, x" << endl;
cin >> a >> b >> c >> x;
if ((x < 0) && (b != 0)) F = (-a * x * x) + b;
else if ((x > 0)... | true |
c772a2d658e0492c20b86474fe04460f04d83eed | C++ | krishnateja-nanduri/MyCodePractice | /InterviewBit/Math/Sorted Permutation rank.cpp | UTF-8 | 655 | 3.140625 | 3 | [] | no_license | //https://www.interviewbit.com/problems/sorted-permutation-rank/
int factorial(int n)
{
int i=0,ans=1;
for(i=1;i<=n;i++)
{
ans=ans*i;
ans=ans%1000003;
}
return ans;
}
int Solution::findRank(string A) {
int i=0,j,c,ans=0;
vector<int> H;
while(A[i]!='\0')
{
j=i... | true |
3c4cdb794cba3c747bc3b4971490fe270a849ace | C++ | Stephenhua/CPP | /DataStruct/Code/TEST-Heap.cc | UTF-8 | 839 | 2.84375 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
void merge(vector<int>&v,int min,int mid,int max){
vector<int>s;
int i=min,j=mid+1;
while(i<=mid&&j<=max){
if(v[i]>=v[j])
s.push_back(v[j++]);
else
s.push_back(v[i++]);
}
while(i<=mid)
s.push_back(v[i++]);
while(j<=max)
s.push_back(v[j++]);
... | true |
f44103caf7e3f05b35f0c40501895e37f7a16c02 | C++ | raghu98/DS | /Theory/link list/New folder/most imp.cpp | UTF-8 | 1,250 | 2.765625 | 3 | [] | no_license | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#inclu... | true |
d73f26fa217f7fdb7c2d8a17fc351397eb49526e | C++ | cmsxbc/insertionfinder | /src/insertion/multi-insertion.cpp | UTF-8 | 10,994 | 2.828125 | 3 | [
"MIT"
] | permissive | #include <cstddef>
#include <algorithm>
#include <deque>
#include <limits>
#include <utility>
#include <vector>
#include <insertionfinder/algorithm.hpp>
#include <insertionfinder/insertion.hpp>
#include <insertionfinder/termcolor.hpp>
#include <insertionfinder/twist.hpp>
using std::size_t;
using Algorithm = InsertionFi... | true |
4c0eda438304a929703b69f4f231eaa209c4cad9 | C++ | CLaraRR/C-plus-plus-practice | /92. Reverse Linked List II.cpp | UTF-8 | 593 | 3.34375 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* reverseBetween(ListNode* head, int m, int n) {
if (head == NULL || head->next == NULL)
return head;
ListNode *L = new ListNode(0);
L->next = hea... | true |
7609b65d454866cc39f5eaf0fa159010b9f69c52 | C++ | Polako912/LibraryDynamic | /dynamic-books/Book.cpp | UTF-8 | 2,291 | 2.9375 | 3 | [] | no_license | #include "Book.h"
#include "Person.h"
#include <vector>
#include <iostream>
using namespace std;
Book::Book(string AuthorFirstName, string AuthorName, string BookTitle, int Number, int Year, int BookId)
{
this->AuthorFirstName = AuthorFirstName;
this->AuthorName = AuthorName;
this->BookTitle = BookTitle;
this->Num... | true |
034f03788efea58a9b044e66a273f076e0927846 | C++ | pkilli/INF4331 | /assignment4/mandelbrot_swig/mandelbrot_4.cc | UTF-8 | 608 | 2.59375 | 3 | [] | no_license | #include <mandelbrot_4.h>
#include <complex>
void mandelbrot(int Nx, double *real, int Ny, double *imag,int max_escape_time, int** iterations){
double complex c, fc, tmp;
int iterations[Nx][Ny];
for (int i=0;i<Nx;i++){
for (int j=0;j<Ny;j++){
c = real[i] + I*imag[j];
fc = c;
iterations[i][j] = max_escape_... | true |
240cc80a36ad4e899d19b1f65526994d0feab12b | C++ | pillowpilot/pdi_comparison | /tests/entropy_tests.cpp | UTF-8 | 724 | 2.703125 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <opencv2/opencv.hpp>
#include <entropy.hpp>
#include <iostream>
TEST(EntropyTests, OneIntensityImage)
{
const int intensity = 10;
cv::Mat testImage(1000, 1000, CV_8UC1, cv::Scalar(intensity));
double metricValue = Entropy::calculate(testImage);
EXPECT_DOUBLE_EQ(metricValue, 0... | true |
7a25a509b76d29a296db688dec9d612c9cff26c9 | C++ | green-fox-academy/nicobognar | /week-01/day-3/Cuboid/main.cpp | UTF-8 | 583 | 3.90625 | 4 | [] | no_license |
#include <iostream>
int main(int argc, char *args[]) {
double sideX = 145;
double sideY = 60;
double sideZ = 95;
int surface_area = sideX * 2 + sideY * 2 + sideZ * 2;
int volume_cuboid = sideX * sideY * sideZ;
std::cout << "Surface Area: " << surface_area << std::endl;
std::cout << "Volu... | true |
6b887d192bc0a66ef81d509fef1631dde0961263 | C++ | xjorma/LaserCube | /SimpleLaserCpp/UDPSocket.h | UTF-8 | 3,260 | 2.734375 | 3 | [] | no_license | #pragma once
#include <string>
#include <iostream>
#include <WinSock2.h>
#include <Ws2tcpip.h>
class WSASession
{
public:
WSASession()
{
if (!m_count)
{
int ret = WSAStartup(MAKEWORD(2, 2), &data);
if (ret != 0)
throw std::system_error(WSAGetLastError(), ... | true |
d03c09228dd4915bfa0848cde21a4465f4343c30 | C++ | uwuser/MCsim | /src/ClockDomain.h | UTF-8 | 1,357 | 2.765625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cmath>
#include <stdint.h>
namespace ClockDomain
{
template <typename ReturnT>
class CallbackBase
{
public:
virtual ReturnT operator()() = 0;
};
template <typename ConsumerT, typename ReturnT>
class Callback : public CallbackBase<ReturnT>
{
p... | true |
454ca3b046a0c1e51e6a2bc34fd03e7684a9f410 | C++ | hughrover/leetcode | /src/main/java/problems/Q160IOTLL.cpp | UTF-8 | 1,097 | 3.734375 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode *p1 = headA, *p2 = headB;
while (p1 != NULL && p2 != NULL) {
... | true |
441c5e08c748e98711d7f3d1077f3ea23cfa9a2c | C++ | ydk1104/PS | /boj/2000~2999/2576.cpp | UTF-8 | 354 | 2.578125 | 3 | [] | no_license | #include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> v;
int main(void){
for(int i=0; i<7; i++){
int x;
scanf("%d", &x);
if(x%2) v.push_back(x);
}
sort(v.begin(), v.end());
if(v.size()){
int sum = 0;
for(int i=0; i<v.size(); i++) sum+=v[i];
printf("%d\n%d", sum, v[0]... | true |
7e3fdb114b6cf3b3ae9806b3de8ba9363b66fcc9 | C++ | almas-ashruff/DSASolutions | /August/7 Aug/longestIncreasingSubsequence.cpp | UTF-8 | 1,411 | 3.75 | 4 | [] | no_license | // Given an array of integers, find the length of the longest (strictly) increasing subsequence
// from the given array.
// https://www.geeksforgeeks.org/lower_bound-in-cpp/
// https://www.algoexpert.io/questions/Longest%20Increasing%20Subsequence
// OPTIMIZED DP - O(N Log N) - solution. Can also be solved using le... | true |
5beaa6eb0f98fdd5fc10c30e94d9bc30c272ea34 | C++ | Sascha8a/MapReduce | /server/include/Task.hpp | UTF-8 | 237 | 2.515625 | 3 | [
"BSL-1.0"
] | permissive | #pragma once
#include <string>
/**
* @brief Struct containing information of a task.
* Contains a unique identifier and some form of protobuf message, that is delivered to nodes.
*
*/
struct Task
{
long id;
std::string job;
}; | true |
6abf8edbfe30ffe934b54e3da4bbbf883fa59b79 | C++ | Mtarginoo/DCA1202 | /Tratamento de poligonos/Projeto_1/point.h | UTF-8 | 2,043 | 3.859375 | 4 | [] | no_license | #ifndef POINT_H
#define POINT_H
/**
* @brief The Point class serve para
* estabelecer informações básicas de um
* tipo comum chamado Point
*/
class Point
{
private:
float x, y;
public:
/**
* @brief setX é um método que serve
* para realizar a atribuição da coordenada x
* de um ponto.
*... | true |
6d6e52489cace6f875c841df413c33dd2ad57ea7 | C++ | QCDogsquad/vex-metal-hounds-2020 | /src/tyler_utilities.h | UTF-8 | 3,231 | 2.5625 | 3 | [] | no_license | #if !defined(TYLER_UTILITIES_H)
#define TYLER_UTILITIES_H
//~ Primitive types
#include <stddef.h>
#include <stdint.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
typedef s8 b8;
typedef s16... | true |
195abfa8dc543696fe848726802071a65b0cc98e | C++ | signmotion/person | /person/include/Person.h | WINDOWS-1251 | 3,183 | 3.078125 | 3 | [] | no_license | #pragma once
#include "Character.h"
#include "LikeMemory.h"
#include "AffectionMemory.h"
#include "InfoMemory.h"
#include <string>
namespace person {
class Person;
typedef std::shared_ptr< Person > PersonPtr;
typedef std::unique_ptr< Person > PersonUPtr;
}
namespace std {
inline std::ostream& operator<<( st... | true |
ee99de69214faa6b91299fbfc7c2aff8ed745169 | C++ | hlissner/practice | /codeeval/easy/208highestscore/solution.cpp | UTF-8 | 867 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
ifstream infile(argv[1]);
string line;
while (getline(infile, line)) {
stringstream ss(line);
vector<int> tokens;
int cols = 0;
int rows = 0;
... | true |
3824e0dedcb429c3ea7b94d6b83abb2abb2d8219 | C++ | vsmawoex/GeeksForGeeks | /MaximumAs/SourceCode.cpp | UTF-8 | 800 | 3.171875 | 3 | [] | no_license | // Solution for below link
// http://www.geeksforgeeks.org/how-to-print-maximum-number-of-a-using-given-four-keys/
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
void CalculateNbAs(vector<int> &nbAs, int nbMaxStrokes)
{
nbAs[0] = 0;
nbAs[1] = 1;
nbAs[2] = 2;
nbAs[3] = 3;
if(nbMaxStrokes ... | true |
4ae7d633f4e1520fb7579648aaca323ff19621ca | C++ | InvincibleSarthak/Competitive-Programming | /InterviewBit/Painter's Partition.cpp | UTF-8 | 1,053 | 3.3125 | 3 | [] | no_license | /*
1. Calculate the maximum possible time.
2. Now, using binary search find the time limit within 1....sum in which all the tasks can be completed with the help of A painters.
3. Finally we get the units, now multiply these units with time per unit B to get the total time taken.
*/
bool check(int A, vector<int>&C, l... | true |
4c26da8649a3777939195a60d9b7b47acd2f17ca | C++ | dragon-web/second_stage_review | /Sort/Insert_Sort/insert_sort2.cpp | UTF-8 | 620 | 3.6875 | 4 | [] | no_license | #include <iostream>
using namespace std;
void Insert_Sort(int *arr, size_t sz)
{
for(size_t i = 1; i < sz; ++i)
{
int key = arr[i]; // 当前要插入元素
int end = i - 1;
while(key <= arr[end] && end >= 0)
{
arr[end+1] = arr[end];
end--;
}
arr[end ... | true |
d6e77fe0e1c382424771ee5df6c299e264eaeb10 | C++ | CryptoLover705/3d_game_engine | /src/Engine/EntityManager.cpp | UTF-8 | 1,284 | 2.828125 | 3 | [] | no_license | #include "EntityManager.h"
#include <algorithm>
#include <vector>
Entity* EntityManager::SpawnInternal(Entity* NewEntity)
{
EntityList.push_back(std::unique_ptr<Entity>(NewEntity));
NewEntity->GameEngine = GameEngine;
NewEntity->BeginPlay();
return NewEntity;
}
Component* EntityManager::AddComponentInternal(Enti... | true |
c441b611e2d29876b313ff10000777628922b3dd | C++ | Akaflieg/startkladde | /src/model/Plane.cpp | UTF-8 | 9,714 | 2.609375 | 3 | [] | no_license | #include "Plane.h"
#include <cassert>
#include <QApplication>
#include "src/text.h"
#include "src/db/result/Result.h"
#include "src/db/Query.h"
#include "src/i18n/notr.h"
// ******************
// ** Construction **
// ******************
Plane::Plane ():
Entity ()
{
initialize ();
}
Plane::Plane (dbId id):
Enti... | true |
53dfa9decf61975cf5b540c5e8156ba2bb4959b5 | C++ | googed/coursera-Foundamentals-of-Programming-and-Algorithms | /Intro-to-C-Programming/week07/money.cpp | UTF-8 | 326 | 2.75 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n;
int a[6] = {100, 50, 20, 10, 5, 1};
int b[6] = {0};
int i = 0;
cin >> n;
while (n > 0)
{
b[i] = n / a[i];
n = n % a[i];
i++;
}
for (int j = 0; j < 6; j++)
cout << b[j] << endl;
retur... | true |
e8a7d56484cc701001a27f13a7841cd125c2cc7a | C++ | VinayRana5674/MyProrammingWrok | /Array erase duplicate.cpp | UTF-8 | 427 | 3.046875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
// Initializing vector with array values
int arr[] = {5,56,65,7,8,97, 10, 15, 20, 20, 23, 42, 45};
int n = sizeof(arr)/sizeof(arr[0]);
vector<int> vec(arr,arr+n);
sort(vec.begin(),vec.end());
vec.erase(unique(vec.... | true |
8281d81249f98b2b33f2210078fb91518cec6564 | C++ | ghosty-png/Laboratory-works | /21/Triad.cpp | UTF-8 | 1,203 | 3.78125 | 4 | [] | no_license | #include "Triad.h"
Triad::Triad(void)
{
first = 0;
second = 0;
third = 0;
}
Triad::~Triad(void)
{
}
Triad::Triad(int f, int s, int t)
{
first = f;
second = s;
third = t;
}
Triad::Triad(const Triad& t)
{
first = t.first;
second = t.second;
third = t.third;
}
void Triad::Set_first(int... | true |
340a2e72bbee7ae04774e65524eb436efc62e623 | C++ | kkob999/my_mono_pj | /Asset/Dice.h | UTF-8 | 172 | 2.609375 | 3 | [] | no_license | #ifndef DICE_H
#define DICE_H
class dice {
private:
int sides;
public:
//constructor
dice();
//functions to get values
int rollDice();
};
#endif
| true |
18fcadcf8f6416587c8997cc2e321be6dd9d02ca | C++ | MateuszJiang/Cpp_Advanced_Purell | /Prata_Ch14_1/Wine.cpp | UTF-8 | 813 | 2.71875 | 3 | [] | no_license | #include "Wine.h"
Wine::Wine(const char* l, int numberOfYears, const int yr[], const int bot[])
:PairArray(numberOfYears, numberOfYears), std::string("sss")
{
NumberOfYears = numberOfYears;
for (int i = 0; i < numberOfYears; i++)
{
PairArray::first[i] = yr[i];
PairArray::second[i] = bot[i];
}
}
Wine::Wine(co... | true |
6a7fb13f9b3a78694a5f4e1a449ca69a5bb86d30 | C++ | sylwiamolitor/Projekty | /Tamagotchi/Tamagotchi/Animal.h | UTF-8 | 914 | 2.875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <SFML/Graphics.hpp>
#include <TGUI/TGUI.hpp>
#include "GraphicalObject.h"
using namespace std;
using namespace sf;
class Animal : public GraphicalObject, public Sprite
{
protected:
int enableWalking;
int counterWalking = 0;
int counterEating = 0;
int counterSleeping = 0;
... | true |
91e6a3f459d2f05ecf1a87b8f5ce2c8d6b474249 | C++ | oha-yashi/cpplibs | /regex.cpp | UTF-8 | 1,956 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define LIMIT 1000000007 //10^9+7
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define all(v) (v).begin(), (v).end()
namespace /* debug */{
#define DEBUG(...) do{cout<<#__VA_ARGS__<<" = ";debug(__VA_ARGS__);}while(0) //変数
... | true |
13b6ae7e1e9fb12dae00ec8a08c0cc7b23dd7ddd | C++ | FrankWork/cpptorch | /minitext/app.cc | UTF-8 | 818 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include "dictionary.h"
#include "vector.h"
#include "densematrix.h"
int main(int argc, char* argv[]){
//std::string input = argv[1];
//auto args_ = std::make_shared<fasttext::Args>();
//auto dict_ = std::make_shared<fasttext::Dictionary>... | true |
6a51b55de0f6bd282400767dd70500d38cb081f7 | C++ | qinenergy/leetCode | /96. Unique Binary Search Trees.cpp | UTF-8 | 311 | 2.796875 | 3 | [
"MIT"
] | permissive | class Solution2 {
public:
int numTrees(int n) {
vector<int> nbsts(n + 1, 0);
nbsts[0] = 1, nbsts[1] = 1, nbsts[2] = 2;
for(int i = 3; i <= n; ++i)
for(int root = 1; root <= n; ++root)
nbsts[i] += nbsts[root - 1] * nbsts[i - root];
return nbsts[n];
}
}; | true |
008a6e7df51c927d9d7a3ae3547a022e8bc7fc8a | C++ | emilk/emath | /emath/math.cpp | UTF-8 | 1,292 | 2.671875 | 3 | [] | no_license | // Created by Emil Ernerfeldt on 2012-10-15.
#include "math.hpp"
#include "fwd.hpp"
#include <cassert>
namespace emath {
static_assert(std::numeric_limits<float>::has_denorm, "has_denorm");
/* See
http://randomascii.wordpress.com/2012/01/11/tricks-with-the-floating-point-format/
for the potential portability pro... | true |
b8ef4100e578b6fd3222faf72139b4e06c808bcf | C++ | cloudnero/leetcode | /Integer_To_Roman.cpp | UTF-8 | 1,085 | 3.765625 | 4 | [] | no_license | /*
Integer to Roman
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
*/
string intToRoman(int num) {
map<int,string> roman;
roman.insert(make_pair(1000,"M"));
roman.insert(make_pair(900,"CM"));
roman.insert(make_pair(500,"D"));... | true |
96f439fc06638b5d858010275f3f0250995bafc6 | C++ | youngkan/design-patterns | /StrategyPattern/98/StrategyPattern.cc | UTF-8 | 2,752 | 3.453125 | 3 | [] | no_license | //策略模式:定义一系列算法,将每一个算法封装起来,并让它们可以相互替换。策略
//模式让算法可以独立于使用它的客户变化
//策略模式3个角色
//1、Context(环境类)
//2、Strategy(抽象策略类)
//3、ConcreteStrategy(具体策略类)
//泡妞秘籍使用场景
//跟不同类型MM约会,要用不同的策略,有的请电影比较好,
//有的则去吃小吃效果不错,有的去海边浪漫最合适,但目的都是为了得到MM的芳心
//我们追MM锦囊中有好多Strategy哦
//软件使用场景
//1、一个系统需要动态地在几种算法选择一种
//2、避免使用难以维护的多重条件选择语句
//3、不希望客户端知道复杂的、与算法相关... | true |
0967f4d195059e9b7cd3871e51d41be7e47de4d9 | C++ | Dips2705/DSandAlgoLab | /c++ craxx/count.cpp | UTF-8 | 657 | 2.859375 | 3 | [] | no_license | lli lowerIndex(lli arr[],lli n,lli x)
{
int l = 0, h = n - 1;
while (l <= h) {
int mid = (l + h) / 2;
if (arr[mid] >= x)
h = mid - 1;
else
l = mid + 1;
}
return l;
}
lli upperIndex(lli arr[],lli n,lli y)
{
int l = 0, h = n - ... | true |
3420237367607d462c1a3710c38a5d93f2ebebbc | C++ | ehdgus8077/algorithm | /programmers/다음큰숫자.cpp | UTF-8 | 517 | 2.796875 | 3 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int solution(int n) {
int one = 0;
int zero = 0;
while(n) {
if (n % 2 == 1){
break;
}
zero += 1;
n /= 2;
}
while(n) {
if (n % 2 != 1){
break;
... | true |
24337afb9df979b3d784bc8ffef6aba6243ee557 | C++ | lrank/Classifier-demo | /parseFeatureExtract.cpp | UTF-8 | 1,033 | 2.65625 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
char a[150][50];
int main() {
//freopen("sample.output.txt", "r", stdin);
//freopen("sampleparse.out", "w", stdout);
int count = 0; // #s of ()
int maxcount = 0; //hy of tree
int SentenceLength = 0;
int totalSentence = 0; // total #s of sentence
char str[50];
while (scan... | true |
48440ca55958c3e85890210db366895d26d319bf | C++ | tyagi619/Labs | /OpenGL/L3/L3.cpp | UTF-8 | 11,225 | 2.6875 | 3 | [] | no_license | #include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
enum {SPHERE_PLASTIC = 1, SPHERE_TEXTURE, SPHERE_GLOSSY, LIGHT, LEFTWALL, FLOOR};
GLuint texture_sphere;
GLfloat shadow_matrix_left[4][4];
GLfloat shadow_matrix_floor[4][4];
GLfloat light_position[] = {50.f, 50.f, -320.f, 1.f};
GLfloat mat[] = {0.f, 0.f, 0.f,... | true |
7c4bf9d497415a28af56f3b64fbc13904911c3db | C++ | MihaiZhao/vetetris | /VeTetrisGameSolution/VeTetrisGameSolution/Game.cpp | UTF-8 | 780 | 3.140625 | 3 | [] | no_license |
#include "Game.h"
#include "Timer.h"
void Game::run()
{
const float k_frameRate = 60.0f; // Number of times-per-second to try and run game
const float k_frameRateTime = 1.0f / k_frameRate; // Time-per-frame
// Instantiate a Timer
Timer timer;
// Useful vars for managing frame-rate
float lastTi... | true |
32339049a3565742bfebe1f133c3a1c42c0718bd | C++ | alex-dias/ParalelizacaoArq2 | /mandelbrot_simd_avx.cpp | UTF-8 | 4,208 | 2.609375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS // Exigido pelo VS para usar a operação fopen
#include <time.h> // Biblioteca para medir o tempo de execução
#include <immintrin.h> // Biblioteca para o uso de instruções intrínsecas do AVX
#include <stdio.h>
#include <math.h>
int main()
{
clock_t start, end; ... | true |
530d8e959dde8730108603f1de978ce54717d1a9 | C++ | XU-zzy/zzy_win10 | /note/2_rbtree.cpp | UTF-8 | 2,579 | 3.34375 | 3 | [] | no_license | #include<stdio.h>
#define RED 1
#define BLACK 2
typedef int KEY_TYPE;
typedef struct _rbtree_node{
//rbtree
unsigned char color;
rbtree_node *parent;
rbtree_node *left;
rbtree_node *right;
//end
KEY_TYPE key;
//value
} rbtree_node;
struct rbtree{
rbtree_node *root;
... | true |
3b6b70c8cb1d3e9f22df5560e41025025dfcda23 | C++ | fengjixuchui/QuickSearch | /QuickSearch/IndexManager.cpp | UTF-8 | 1,915 | 2.578125 | 3 | [] | no_license | #include "IndexManager.h"
#include "Lock.h"
#include <Shlwapi.h>
#include "FileNameMemoryManager.h"
IndexManager *g_pIndexManager = new IndexManager();
IndexManager::IndexManager()
{
}
IndexManager::~IndexManager()
{
}
BOOL IndexManager::AddEntry(FileEntry fileEntry,int nVolIndex)
{
DeleteEntry(fileEntry.FileRe... | true |
b192ec737868abfed8839e3955019ff4b8921dd8 | C++ | PhoenixDD/LeetCode | /1244-Design A Leaderboard.cpp | UTF-8 | 1,380 | 3.03125 | 3 | [] | no_license | class Leaderboard {
public:
Leaderboard() {
}
void addScore(int playerId, int score)
{
if(!leaderBoard.count(playerId))
leaderBoard[playerId]=score,rLeaderBoard.insert(make_pair(score,playerId));
else
{
it=rLeaderBoard.find(leaderBoard[playe... | true |
e10da0b903c6c7f73b0f52808f0c7b905170b35f | C++ | Hartawan007/Data-Rumah-Sakit | /191110051_HartawanMartinOdnielSianturi.cpp | UTF-8 | 3,138 | 2.6875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
int main()
{
struct Rumah_sakit
{
char nama[50];
char alamat[100];
int tggi[5], brt[5];
char golda[3];
char ayah[50];
char ibu[50];
};
printf ("+++++++++++++++++++++++++++++++++++++++++++++\n");
printf ("========Rumah Sakit Harta Jaya ==============\n");
printf ("+++++... | true |
e58e3e514bc1a34fa4b7472df86dc9dc87175059 | C++ | zhudisheng/The-Cplusplus-programming-language | /difference/cplusplus.cpp | UTF-8 | 244 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
struct Student
{
const char*name;
int age;
};
f(i)
{
printf("i = %d\n",i);
}
g()
{
return 5;
}
int main()
{
Student s1 = {"Delphi",30};
Student s2 = {"Tang",30};
f(10);
printf("g()=%d\n",g(1,2,3,4,5));
return 0;
}
| true |
495b698fe5c43854f2f07b2ae19a6192a8b8b9b6 | C++ | pineal/-O_O- | /Cache Design/Cache Design/LRU_Cache.cpp | UTF-8 | 1,178 | 3.140625 | 3 | [] | no_license | //
// LRU_Cache.cpp
// Cache Design
//
// Created by Hesen Zhang on 2/3/17.
// Copyright © 2017 Hesen Zhang. All rights reserved.
//
#include "LRU_Cache.hpp"
LRU_Cache::LRU_Cache(int c) {
set_capacity(c);
cout << "LRU Cache Initialzied" << endl;
};
int LRU_Cache ::get(int key) {
if (_entries.find(key... | true |
291ad300a5a6eec44fb823e30a9241b3aa9a6e7d | C++ | Ghiordy/Curso-Microcontroladores | /KeyPad_NoController_00.ino | UTF-8 | 2,275 | 3.0625 | 3 | [
"MIT"
] | permissive |
/*
Keypad Interfacing with Arduino Without Keypad Library
Author : Kunchala Anil
It is implemented using a method called Column Searching
*/
#include <LiquidCrystal.h>
const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int p=0;
const int row_pin[] = {3... | true |
3e83b8c970bb81ff03552314439d9c33b51e7d92 | C++ | derekzhang79/TopCoder | /153/items.cpp | UTF-8 | 604 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
string bestItem(vector<int> costs, vector<int> prices, vector<int> sales, vector<string> items){
int i,length = costs.size();
string retval = "";
int profits[length];
for(i =0 ;i<length;i++) profits[i] = sales[i]*(prices[i] - costs[i... | true |
949f06c9f4634fa4ac2503f0bdde28e9a87e6e85 | C++ | HotPot-J/exercises | /exercises_day89/exercises_day89/test.cpp | GB18030 | 4,194 | 3.515625 | 4 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
/*
һţţΪһһУǷǵ
ǵݼġţţһΪnAһǰAֳɶ
Уţţ֪ٿΪС
ţţA1 2 3 2 2 1Ϊ1 2 3 2 2 1УҪ
2
ĵһΪһn1<=n<=10^5
ڶаn 1~10^9
:
һʾţţԽAٻΪٶ
*/
//˼·ҵҵݼ/ݼҵ
#include<iostream>
#include<vector>
using namespace std;
void fun( vector<int> arr){
size_t res = 0, p = 0;
size_t flag = 0;//ֵΪ߲
if (arr.size() <= 2){... | true |
f4a54e993bc609c4ed8e0146b38ad822216869f3 | C++ | MisakiFx/C | /C-twice/4月23作业/平均值,最小值,最大值.cpp | UTF-8 | 532 | 3 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int i;
/**********FOUND**********/
float a[10],min,max,avg;
printf("input 10 score:");
for(i=0;i<=9;i++)
{
printf("input a score of student:");
/**********FOUND**********/
scanf("%f",&a[i]);
}
max=min=avg=a[0];
for(i=1;i<=9;i++)
{... | true |
c0cc57db56818dda65e9d0fc6493c4d49bc5771e | C++ | surgura/AMQP-CPP | /tests/libboostasio.cpp | UTF-8 | 1,604 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /**
* LibBoostAsio.cpp
*
* Test program to check AMQP functionality based on Boost's asio io_service.
*
* @author Gavin Smith <gavin.smith@coralbay.tv>
*
* Compile with g++ libboostasio.cpp -o boost_test -lpthread -lboost_system -lamqpcpp
*/
/**
* Dependencies
*/
#include <boost/asio/io_service.hpp>
#... | true |
07649ba9da597fb3768c47be45e96eee1d7d5813 | C++ | aleclouisgrant/sms-bingo | /Source/sms-bingo/ServerClient/BingoClient.cpp | UTF-8 | 3,340 | 2.6875 | 3 | [] | no_license | #include "BingoClient.h"
#include "BingoReceiver.h"
#include <WS2tcpip.h>
#include <string>
#include <thread>
#include <qdebug.h>
#pragma comment(lib, "ws2_32.lib")
#define BUFFER_SIZE 4096
/*
*
*/
BingoClient::BingoClient(BingoReceiver *receiver)
{
m_receiver = receiver;
qDebug() << "CLIENT: Ready";
std::thre... | true |
6f20b0206366bd084b11466b12f90b28fda7a915 | C++ | ormalkai/AdvancedProgramming | /PlayerStatistics.h | UTF-8 | 1,424 | 2.953125 | 3 | [] | no_license | #pragma once
#include "BattleshipAlgoSmart.h"
using namespace std;
/**
*@Details Class for managing tournament results table
*/
class PlayerStatistics
{
private:
int m_playerIndex;
string m_playerName;
int m_gamesPlayed;
int m_wins;
int m_losses;
int m_ties;
int m_ptsFor;
int m_ptsAgainst;
public:
Pla... | true |
12c151f089d218dc5cb5ef3c0bfb2fc9a202dcd2 | C++ | hendrikdevestel/arduino-bomb | /bomb-with-keypad/bomb-with-keypad.ino | UTF-8 | 4,660 | 3.015625 | 3 | [] | no_license | #include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
int buzzerPin = 10;
const byte ledPin = 13; //using the built in LED
/* KEYPAD: */
const byte numRows= 4;
const byte numCols= 4;
char keymap[numRows][numCols]= { {'1', '2', '3', 'A'},{'4', '5', '6', 'B'},{'7', '8', '9', 'C'},{'*', '0', '#', 'D'} ... | true |
12acb9c3b887d976a835ed5a97b235a06ae24a11 | C++ | SilenceWang123/test | /adsa.cpp | UTF-8 | 756 | 2.75 | 3 | [] | no_license | #include<cstdio>
#include<cstring>
using namespace std;
const int direction[4][2]={{-1,0},{0,-1},{0,1},{1,0}};
char map[100][101];
int row;
int col;
int bfs(int r,int c)
{
int counter=0;
if('p'==map[r][c])
++counter;
map[r][c]='#';
for(int d=0;d<4;++d)
{
int dr=r+direction[d][0];
int dc=c+direction[d][1]... | true |
4bdfc516bfe987633a7a11c242d6d2a33d3329e6 | C++ | denis-gubar/Leetcode | /Array/1584. Min Cost to Connect All Points.cpp | UTF-8 | 1,258 | 2.609375 | 3 | [] | no_license | class Solution {
public:
struct UnionFind
{
vector<int> id;
vector<int> sz;
UnionFind(int N) : id(vector<int>(N)), sz(vector<int>(N, 1))
{
for (int i = 0; i < N; ++i)
id[i] = i;
}
int root(int i)
{
while (i != id[i])
{
id[i] = id[id[i]];
i = id[i];
}
return i;
}
bool find... | true |
335a564126f0a4d784701c5166f90c24290ecc07 | C++ | runforu/Miscellaneous | /AsynTask.cpp | UTF-8 | 14,314 | 3.03125 | 3 | [] | no_license | #include <atomic>
#include <functional>
#include <iostream>
#include <list>
#include <mutex>
#include <queue>
#include <random>
#include <thread>
#include "Common.h"
namespace Utils {
/* Examples:
{
AsyncTaskHelper ath;
ath.AddTask([&ath](){
// do something.
ath.AddTask([]... | true |
e1ab17464f9444746de98bf31c3d775d117e2006 | C++ | alexkorep/ProgrammingProblems | /ByteIsle/ByteIsleTest/ByteIsleTest.cpp | UTF-8 | 2,921 | 2.984375 | 3 | [] | no_license | #include "tinytest.h"
#include "../ByteIsle.h"
struct RemoverTester {
static int testFindFirstInterval() {
IntervalRemover remover;
remover.add(3, 4);
remover.add(6, 6);
TINYTEST_ASSERT(remover.findFirstIntervalToTheRight(2) == 3);
TINYTEST_ASSERT(remover.findFirstIntervalToTheRight(3) == 3);
TINYTEST_ASS... | true |
ab4ede0f1958905ca9c03634ede61789a00b43e9 | C++ | Aaronyoungjs/AutoCar | /Linux/src/motor/motor.h | UTF-8 | 1,146 | 2.65625 | 3 | [] | no_license | #pragma once
#include "config.h"
#include "base.h"
class Motor: public Base, Device
{
public:
// enum Mode { ONE_STEP, TWO_STEP };
// Motor(int pin, int speed = 0, Mode mode = ONE_STEP, int range = 255);
explicit Motor(const Motor &) = delete;
Motor &operator=(const Moto... | true |
6169886e2a6e25710829ec2ae8584de9957e3e57 | C++ | taominfang/xdata2 | /src/UnitFunctionsTestCases.h | UTF-8 | 1,555 | 2.65625 | 3 | [] | no_license | /*
* UnitFunctionsTestCases.h
*
* Created on: 2016��4��9��
* Author: minfang
*/
#ifndef UNITFUNCTIONSTESTCASES_H_
#define UNITFUNCTIONSTESTCASES_H_
#include "UnitTestBase.h"
#include "RegAwk.h"
#include "VariablePatternParser.h"
class TestRegexSplit: public UnitTestBase {
public:
virtual bool test() {
... | true |
5363211a57f6e6aaa2184464fd7f4fe86cc82824 | C++ | wcary2/lab3 | /Source.cpp | UTF-8 | 4,503 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
bool sumShort();
bool factorialTest();
bool sumLong();
bool factorialTestDouble();
bool strangeBehavior();
bool strangeBehaviorDouble();
bool puzzle();
bool puzzleDouble();
int main() {
string option = "";
while (option != "close") {
cou... | true |
4ae4febc32017ac9a427016c8a2bb015b127082c | C++ | 1998factorial/Codeforces | /contests/educationalRound75/D.cpp | UTF-8 | 1,209 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int , int> ii;
const int maxn = 2e5 + 10;
int N;
ll S;
ii p[maxn];
bool check(ll x){
//cout << "checking " << x << endl;
ll ret = 0;
vector<int> ps;
int cnt = 0;
for(int i = 1; i <= N; ++i){
... | true |
00ec88da504d8d4dc00fe03312cb834913b9d30e | C++ | gitank007/Company-Wise-Coding-Questions | /Amazon/is_sudoku_valid.cpp | UTF-8 | 1,035 | 2.84375 | 3 | [] | no_license | /*
@Author - Jatin Goel
@Institute - IIIT Allahabad
Hardwork definitely pays off.
There is no substitute of hardwork.
There is no shortcut to success.
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int board[9][9];
for... | true |
48b7ca4b073659e7e67f6c20cf2d84d58ca25db3 | C++ | Jzjerry/Cpp-for-College | /19-5-20/Problem_23.cpp | UTF-8 | 354 | 3.171875 | 3 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int f(char *c,int length)
{
int i=0;
int count=0;
for(i=0;i<length;i++)
{
if(c[i]>='0'&&c[i]<='9')
{
count++;
}
}
return count;
}
int main()
{
char s[100];
int j;
for(j=0;j<=99;j++)
{
s[j]=234*cos(j*0.6);
}
cout... | true |
dbe07e031276e6e70840e6aae855349913f69ca4 | C++ | Akigeor/Y-Fast-Trie | /splay_test.cpp | GB18030 | 3,929 | 3.0625 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <map>
#include <iostream>
#include <string>
#include "splay.hpp"
using namespace std;
int main()
{
////////// ʹ
auto t = new sjtu::Splay<int, string>();
////////// Insert
t -> insert(233, "abc");
t -> insert(666, "efg");
t -> insert(450, "hij");
t -> insert(-1, "**... | true |
6381e18e87252b5b4c11c7c219bc4934bc1308a7 | C++ | xzjqx/FindAJob | /C++/CodeExam/剑指Offer/斐波那契数列.h | UTF-8 | 213 | 2.78125 | 3 | [] | no_license | class Solution {
public:
int Fibonacci(int n) {
int a[40];
a[0] = 0; a[1] = 1;
for(int i = 2; i < 40; i ++) {
a[i] = a[i-1] + a[i-2];
}
return a[n];
}
}; | true |
7ec86aaa6789f5914d1be10c7749fdb4f14fda2c | C++ | ssh352/cppcode | /DotNet/ProVisualC++CLI/Chapter19/TcpServer/TcpServer.cpp | UTF-8 | 1,892 | 2.84375 | 3 | [] | no_license | using namespace System;
using namespace System::Net;
using namespace System::Net::Sockets;
using namespace System::Threading;
using namespace System::Text;
ref class TcpServer
{
public:
void ProcessThread(Object ^clientObj);
};
void TcpServer::ProcessThread(Object ^clientObj)
{
Socket^ client = ... | true |
5eb785da6927acb89d848871d90f021050d256fc | C++ | ishandutta2007/Number_Theory_in_CP_PS | /7. Mobius function과 그 활용/divisor_cnt_sum.cpp | UTF-8 | 1,923 | 3.0625 | 3 | [] | no_license | #include <bits/stdc++.h>
#define fio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ldb;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// take modulos if you want/need
// 1 : na... | true |
c3dc4834a78b35291c4e3f5e60b33f5865fee817 | C++ | ashukharde3/Decomposer | /dependency.h | UTF-8 | 5,303 | 3.734375 | 4 | [] | no_license | /*! @file dependency.h
*
* @brief Includes declaration for the class Dependency and its members.
*
* @details
* This file declares the definition of the class Dependency along with its
* subsequent data members and the member functions prototype.
*
*/
#ifndef DEPENDENCY_H
#define DEPENDENCY_H
#include "de... | true |
d18a2c84afa55ea7e5b06cd4ad16a94585b2e218 | C++ | jonatajefferson/irp | /src/Driver.h | UTF-8 | 1,166 | 2.828125 | 3 | [
"MIT"
] | permissive | #ifndef DRIVER_H_INCLUDED
#define DRIVER_H_INCLUDED
#include "TimeWindow.h"
#include <vector>
class Trailer;
class Driver{
public:
Driver();
Driver(int index, int maxDriving, std::vector<TimeWindow*> timeWindows, int minInterShift, double timeCost);
Driver(int index, int maxDriving, std::ve... | true |
cdacb50d9b86aada6d818fd63b65af26b0bc2f20 | C++ | milad-mr/DistributedSystemScheduling | /src/Computing.cpp | UTF-8 | 1,934 | 3.0625 | 3 | [] | no_license | #include "Computing.h"
#include <memory>
#include <string>
#include <zmq.hpp>
#include "DataAdaptor.h"
/*Constructor for Computing process. This object is composed of DataAdaptor
object which does providing data.*/
Computing::Computing(const DataAdaptor &da, int vmId, int jobId){
adaptor = da;
//~ this -> vmId =... | true |
07a0f5ff673738216eec3988e2707b8079f10326 | C++ | nic-cs151-master/sp21-lecture | /01-ch09/StudentClass/student.h | UTF-8 | 779 | 3.34375 | 3 | [] | no_license | // Guard
#ifndef STUDENT_H
#define STUDENT_H
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
// constant global variables
// function prototypes
// class declarations
// struct declarations
class Student
{
public:
// constructors
Student();
Student(int id, string name, int ... | true |
613bca59964596b941b40f0aab979f3a27ee70ee | C++ | monty68/EasyIOT | /src/core/http/PAGEHandler.h | UTF-8 | 2,175 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
** EasyIOT - (HTTP) Really Simple Web Server Class
**
** This is based upon the ESP8266WebServer library,
** Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
**
** This program is provided free for you to use in any way that you wish,
** subject to the laws and regulations where you are using it. Due dilig... | true |
12d81d97ca0dad1df75a5f454c13044710974a6c | C++ | neutronest/mcts_legend_of_heros | /player.cc | UTF-8 | 1,733 | 2.9375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#include "player.h"
using namespace std;
double player::get_base_hp() {
return this->base_hp;
}
void player::set_base_hp(double hp) {
this->base_hp = hp;
return;
}
double playe... | true |
7e95ed32203bab61feb6a29ab9fb4c670152dac4 | C++ | matajupi/HackAssembler | /Assembler.h | UTF-8 | 2,269 | 2.875 | 3 | [] | no_license | //
// Created by Kosuke Futamata on 21/08/2021.
//
#include <vector>
#include <string>
#include <map>
#include "Parser.h"
#include "Instruction.h"
#include "CodeGenerator.h"
class Assembler
{
std::vector<std::string> *source;
public:
explicit Assembler(std::vector<std::string> *source) : source(source) { }
... | true |
528d9fe79d55267393c12bb5c479d04ea01428da | C++ | Ronoman/RBE-1001 | /Drivebase.cpp | UTF-8 | 3,474 | 3.21875 | 3 | [] | no_license | #include "Drivebase.h"
#include "Constants.h"
/**
* Helper function. Maps one range of values to another
* @param x input
* @param in_min minimum input value
* @param in_max maximum input value
* @param out_min minimum output value
* @param out_max maximum output value
* @return the mapped value
*/
double mapV... | true |
a384e8d656f4a50a28f084e34ee570924d2ac27a | C++ | aastha621/Launchpad_29Dec2019 | /Lecture37/longestIncSubseq.cpp | UTF-8 | 1,050 | 3.109375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int lis(int* arr, int n) {
int dp[1000] = {0};
for (int i = 0 ; i < n; i++) {
dp[i] = 1;
}
int maxLength = 0;
for (int i = 1; i < n ; ++i)
{
for (int j = 0; j < i; ++j)
{
if (arr[i] > arr[j]) {
dp[i] = max(dp[i], dp[j] + 1);
}
}
maxLength = max... | true |
f8ff54f40dea8d1527a8a921da553021478d8dc4 | C++ | krishna-NIT/Algo-Tree | /Code/C++/Dijkstra.cpp | UTF-8 | 2,511 | 3.859375 | 4 | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | /*
Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a graph.
It is applicable for:
* Both directed and undirected graphs
* All edges must have None-Negative weights
* Graph must be connected
*/
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <... | true |
be6b4bd73153e43d38be82f0750a5d6e26ee7a8e | C++ | DenkaKrenka/Pavlovskaya | /pavf/чивапчичи4/чивапчичи4.cpp | UTF-8 | 2,485 | 2.71875 | 3 | [] | no_license | // чивапчичи4.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
const int N = 4;
int main()
{
int a[3 * N][2];
int n = 3 * N;
for (int i = 0; i < n; i++)
for (int j = 0; j <= 1; j++)
cin >> a[i][j];
for (int i = 0; i ... | true |
81afb4cb35b6229c9bf0d25af45a79fa8dede3e4 | C++ | sahilgoyals1999/GFG-Algorithms | /10. Mathematical Algorithms/07. Multiply two integers without using multiplication, division and bitwise operators, and no loops.cpp | UTF-8 | 362 | 3.71875 | 4 | [] | no_license | // https://www.geeksforgeeks.org/multiply-two-numbers-without-using-multiply-division-bitwise-operators-and-no-loops/
// T.C => O(y)
int multiply(int x, int y) {
// 0 multiplied with anything gives 0
if (y == 0) return 0;
// Add x one by one
if (y > 0) return (x + multiply(x, y - 1));
// the case where y is negat... | true |
4720a448da3c462277ea6b538991c498582f4770 | C++ | zhen3410/myWebServer | /muduo/EventLoop.cpp | UTF-8 | 4,086 | 2.71875 | 3 | [] | no_license | #include"EventLoop.h"
#include"EPoller.h"
#include"channel.h"
#include<iostream>
#include<assert.h>
#include<sys/eventfd.h>
#include<unistd.h>
#include<sys/syscall.h>
using namespace server;
namespace{
__thread EventLoop* t_loopInThisThread=0;
const int kPollTimeMs=10000;
int createEventFd(){
int fd=::eventfd... | true |