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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
707ab45c9e325d136ed2ea56a59e63b4b4b66aed | C++ | InitToZero/Oregon-State-University-2015-19 | /CS 162 - Intro to Computer Science 2/Assignment1/state_facts.cpp | UTF-8 | 14,189 | 3.859375 | 4 | [] | no_license | /***************************************************************
* Program: state_facts.cpp
* Author: Jonathan Ropp
* Date: 4/10/2016
* Input: txt file with state/county information, given by user
* Output:
***************************************************************/
#include <iostream>
#include <string>
#in... | true |
63009b706e0d1db8c13325114d4202b29af57352 | C++ | cocoa0409/LeetCodeSolutions | /leetcode解答/位运算-异或-只出现1次的数字-136.cpp | UTF-8 | 318 | 2.734375 | 3 | [] | no_license | //
// 位运算-异或-只出现1次的数组-136.cpp
// LeetCodePlayground
//
// Created by 兆吉 王 on 2020/4/21.
// Copyright © 2020 兆吉 王. All rights reserved.
//
int singleNumber(vector<int>& nums) {
int res=0;
for(auto it=nums.begin();it!=nums.end();it++){
res^=*it;
}
return res;
}
| true |
1a76764b72c1eb07edc87fd4b54c3e21267b0987 | C++ | castillo098/TrabajoGrupalBimestre_ArduinoConfigBluetooth | /ArduinoConfigBluetooth.ino | UTF-8 | 1,242 | 2.75 | 3 | [] | no_license | #include <SoftwareSerial.h>
SoftwareSerial blue(2, 3); //Crea conexion al bluetooth-PIN 2 a tx y PIN 3 a RX
char NOMBRE[21] = "UserHC-06"; //Nombre de 20 caracteres maximo
char BPS = '4'; //1=1200, 2=2400, 3=4800 4= 9600, 5=19200, 6=38400, 7=57600, 8=115200
char PASS [5] = "1234"; //PIN O CL... | true |
f7feddda019c9dbc7e72cf1be5f288cab5e2b5b4 | C++ | dquadros/ATmegaDetonator | /LeFuses/LeFuses.ino | UTF-8 | 4,158 | 2.75 | 3 | [
"MIT"
] | permissive | #include "ATmegaDetonator.h"
#include <Wire.h>
/*
* ATmegaDetonator
* Teste de leitura dos "fuses" do ATmega
*
* (C) 2020, Daniel Quadros
*/
// pinos de saída
int pinOut[] = {
pinVcc, pin12V, pinOE, pinWR, pinBS1, pinBS2,
pinXA0, pinXA1, pinPAGEL, pinXTAL1,
0
};
// comandos de programação
const byte CMD_... | true |
371c24ce94892526deb432b05ff369b255cadd61 | C++ | Vincentsummer/Typora | /C++/vPackage/vThread/vSycnTest.cpp | UTF-8 | 3,226 | 3 | 3 | [] | no_license | //
// Created by vincent on 20-2-14.
//
#include <iostream>
#include "vSyncTest.h"
namespace vincent
{
void ZeroEvenOdd1::zero(function<void(int)> printNumber)
{
for (int i = 1; i <= n; ++i){
unique_lock<mutex> lck(mutex_);
cond_.wait(lck, [=](){return count == 0 || count == 2;... | true |
9da4bf5674133d7b7f57cce5c84cbae5208cb1b2 | C++ | iridium-browser/iridium-browser | /buildtools/third_party/libc++/trunk/test/std/containers/sequences/vector/access.pass.cpp | UTF-8 | 3,656 | 2.859375 | 3 | [
"NCSA",
"LLVM-exception",
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | true |
c22d8e68d9b7bf65978f77a6f9356f4e3ecd0197 | C++ | MuhammadFareed/C-Language-Programs | /Frequency of characters.cpp | UTF-8 | 329 | 2.6875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
int i,l,k,j=0,count=1;
char s[20];
puts("Enter a word : ");
gets(s);
l=strlen(s);
for(i=0;i<l;i++)
{
for(k=1;k<l;k++)
{
if(s[i]==s[k])
{
count=count+1;
}
}
printf("\nFreqency of %c is %d",s[i],count);
j++;
count=0;
}
ge... | true |
14b135ea58f634234fa7ca0ad73d722dd54faabb | C++ | SLIIT-FacultyOfComputing/tutorial-03b-IT21044786-1 | /exercise01.cpp | UTF-8 | 418 | 3.15625 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float marks[] ={78.4,90.6,45.9,72.2,54.4 };
char names[][20] = { "Ajith","Wimal","Kanthi","Suranji","Kushmitha" };
cout<<setw(5)<<"No"<<setw(15)<<"Name"<<setw(10)<<"Marks"<< endl;
for (int r = 0; r < 5; r++) {
cout<<setw(5... | true |
63c68d3a4b99a2ad5274ab5287404c08b61a6e12 | C++ | htaozhang/cpp_common | /common/generic_time.h | UTF-8 | 3,237 | 2.703125 | 3 | [] | no_license | // Copyright(c) 2017 macrozhang
// All rights reserved.
//
//
#ifndef __GENERIC_TIME_H__
#define __GENERIC_TIME_H__
#include "utils.h"
#include <ctime>
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
#include <iostream>
#include <sstream>
#include <iomanip> // std::get_time
#define WIN32_LEAN_AND_MEAN
... | true |
b6ca6fb9cfb861fa27f47b4ec4d0184310896d83 | C++ | Totomosic/Anarchy | /Anarchy-Client/src/World/TilemapRenderer.cpp | UTF-8 | 2,260 | 2.5625 | 3 | [] | no_license | #include "clientpch.h"
#include "TilemapRenderer.h"
#include "Tilemap.h"
namespace Anarchy
{
TilemapRenderer::TilemapRenderer(Layer* layer, float tileWidth, float tileHeight)
: m_Layer(layer), m_TileWidth(tileWidth), m_TileHeight(tileHeight), m_Chunks()
{
}
float TilemapRenderer::GetTileWidth() const
{
retu... | true |
a4e5e10003b883aa855fd6e4791e11b76bbc79ce | C++ | FaridaSolimann/313Project-1 | /solving_root_methods.h | UTF-8 | 21,162 | 2.96875 | 3 | [] | no_license | #ifndef INC_313PROJECT_1_SOLVING_ROOT_METHODS_H
#define INC_313PROJECT_1_SOLVING_ROOT_METHODS_H
#include <iostream>
#include <math.h>
void bisection(int EQ_i, int iters, float percent, int stopping_cond);
void false_position(int EQ_i, int iters, double percent, int stopping_condition);
void secant(int EQ_i, int it... | true |
e8f9b4f4f4299b2878de428ffc4f9827eb9ddc88 | C++ | Lazymonter/LeetCode | /231-2的幂.cpp | UTF-8 | 393 | 3.6875 | 4 | [] | no_license | /*
2的幂的二进制表示中只有一个1
*/
#include <iostream>
using namespace std;
bool isPowerOfTwo(int n) {
return n > 0 && (n & (n - 1)) == 0;
}
int main() {
cout << isPowerOfTwo(1) << endl;
cout << isPowerOfTwo(2) << endl;
cout << isPowerOfTwo(3) << endl;
cout << isPowerOfTwo(5) << endl;
cout... | true |
ef0390681575c85aa291754e0dbedb99c51c2d9b | C++ | Dev-DarkWolf/Custom-Library | /Custom Library/Containers/ObjectPool.h | UTF-8 | 4,098 | 3.015625 | 3 | [] | no_license | //----------------------------------------
//File Name: ObjectPool.h
//Author: Trent Manks
//------------------------------------------
//Copyright 2017 - DarkWolf Interactive
//------------------------------------------
//------------------------------------------
// OBJECT POOLING
// Holds Objec... | true |
b058fc55106d0001dec7cd216c480ae916ffbb05 | C++ | bigfatwhale/orderbook | /cpp/OrderBookPythonAPI.cpp | UTF-8 | 1,751 | 2.53125 | 3 | [] | no_license |
#include "Python.h"
#include "Order.h"
#include "OrderBook.hpp"
#include "PriceBucket.h"
#include <ostream>
#include <string>
#include <boost/python.hpp>
using namespace boost::python;
void export_orderbook()
{
class_< LimitOrderBook<>, boost::noncopyable >("LimitOrderBook")
.def(init<>())
.def("addOrder", ... | true |
8c6a9641c25e831996431ae936da03816ecc099b | C++ | grain1101/LeetCode | /C++/237_DeleteNodeInALinkedList.cpp | UTF-8 | 379 | 2.59375 | 3 | [] | no_license | #include "leetcode.h"
class Solution {
public:
// 237. Delete Node in a Linked List
void deleteNode(ListNode* node) {
node->val = node->next->val;
node->next = node->next->next;
}
};
int main() {
Solution s1;
int n = 3;
auto ans = s1.isPalindrome(nullptr);
cout << ans << en... | true |
2fcd493267b826aaa7e3620bb6f2b2c84ae30b48 | C++ | hjung3113/multicore | /project3/serial.cpp | UTF-8 | 3,489 | 2.59375 | 3 | [] | no_license | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <unistd.h>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#define BUFSIZE 100
using namespace std;
bool **board;
int NumGenerate;
int lx, ly;
char buf[100];
queue <pair<int, int>> lives;
void printboard(){
... | true |
bc5e5fe1b9b3a560320e1e66ce8b4c4e2fc71947 | C++ | mungowz/MaximumGraphPath | /Island.hpp | UTF-8 | 2,739 | 3.234375 | 3 | [
"MIT"
] | permissive | /*
La classe Island produrrà il grafo in base agli input forniti dal file e permetterà l'interazione
utente programma. La classe Island ha un rapporto di tipo HAS A con la classe Graph, tra gli
attributi privati è istanziata una variabile di tipo Graph , che rappresenta il grafo letto
in input. La l... | true |
1385984e136f641891009ec6e435db758e929b32 | C++ | Isa-rentacs/AOJ | /0212.cpp | UTF-8 | 1,710 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <algorithm>
#include <cstring>
#include <vector>
#define INF 1 << 29
using namespace std;
int c,n,m,s,d;
int cost[101][101];
class S{
public:
int node;
int tick;
int cost;
S(int node,int tick,int cost):
node(node),tick(tick),cost(cost){}
S()... | true |
e6edf9688e56d8ec8e7589ab79153ff4c577ec4b | C++ | lihzzz/leetcode-C | /LeetCode/second-Leetcode/2.cpp | UTF-8 | 700 | 2.984375 | 3 | [] | no_license | //
// Created by lh on 2018/3/31.
//
#include "../DataStruct.h"
#include <stack>
using namespace std;
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
if(!l1 || !l2){
return NULL;
}
stack<int> s1,s2;
while (l1){
s1.push(l1->val)... | true |
3846329da74812cf054d861bbf5d098cfe2de936 | C++ | jwolf02/CLAHE | /src/common.hpp | UTF-8 | 10,017 | 3.390625 | 3 | [
"MIT"
] | permissive | #ifndef __UTIL_HPP
#define __UTIL_HPP
#include <vector>
#include <string>
#include <type_traits>
#include <stdexcept>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <map>
#include <set>
#include <unordered_set>
#include <fcntl.h>
#include <unistd.h>
#include <random>
... | true |
0470daeed642165a7434aea222bd6d0de4772440 | C++ | delhivery/Re-bar | /fletcher/weld.hpp | UTF-8 | 2,623 | 3.453125 | 3 | [] | no_license | /** @file weld.hpp
* @brief Defines a class to map string commands to solver functions
*/
#include <experimental/any>
#include <experimental/string_view>
#include <functional>
#include <future>
#include <map>
#include <vector>
#include <jeayeson/jeayeson.hpp>
using namespace std;
using std::experimental::any;
using ... | true |
b0ce9c50daccbf676865df3f3f8ed3c3683def42 | C++ | shivikasaggar/june_leetcode | /validate IP address.cpp | UTF-8 | 2,308 | 3.40625 | 3 | [] | no_license | //Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither.
#include<bits/stdc++.h>
using namespace std;
bool isHexAlpha(char ch) {
return ('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F');
}
bool isNum(char ch) {
return ('0' <= ch && ch <= ... | true |
8edd46bdb5017ae66e6dad47d216751096f5b7c6 | C++ | npj6/PL-2020-C | /p5/MemoryManager.h | UTF-8 | 511 | 2.640625 | 3 | [] | no_license | #ifndef _MemoryManager_
#define _MemoryManager_
#include <stdexcept>
using namespace std;
class no_memory_left : public logic_error { public: no_memory_left(const char* what) : logic_error(what) {} };
class MemoryManager {
private:
unsigned varMem;
unsigned nextVar;
unsigned tempMem;
unsigned next... | true |
5978f56e92fe41b61ad0efdd9010c6e6859e27fa | C++ | philou/philou | /opengl/isiviewerCpp/operators.cpp | UTF-8 | 623 | 3.109375 | 3 | [] | no_license | #include "operators.h"
#include <math.h>
glm::vec3 produitVectoriel(const glm::vec3& u, const glm::vec3& v)
{
return glm::vec3( u.y*v.z - u.z*v.y
, u.x*v.z - u.z*v.x
, u.x*v.y - u.y*v.x);
}
float length(const glm::vec3& v)
{
if ( v.x == 0 && v.y ==0 && v.z == 0)
return 0;
r... | true |
76037941ca05cdd241ccee3502f4c89cbcf9ff9c | C++ | itohdak/AtCoder | /samples/trie.cpp | UTF-8 | 1,385 | 3.109375 | 3 | [] | no_license | #include "header.hpp"
template<int char_size, int base>
struct Trie {
struct Node {
vector<int> next;
vector<int> accept;
int c;
int common;
Node(int c_) : c(c_), common(0) {
next.assign(char_size, -1);
}
};
vector<Node> nodes;
int root;
Trie() : root(0) {
nodes.push_back(No... | true |
d5bf6fafd2171892c9ff0efac6009803b2622569 | C++ | CCatherineeee/DataStructureDesign | /排课软件/Queue.h | GB18030 | 481 | 2.96875 | 3 | [] | no_license | #pragma once
#include"DEFINE.h"
typedef int ElemType; //
class sqQueue
{
private:
int rear, front; //ͷβָ
ElemType* elements; //
int maxsize; //е
public:
//캯 nΪе
sqQueue(int n);
//
~sqQueue();
//n
Status enQueue(ElemType n);
//Ӳݵn
Status deQueue(ElemT... | true |
4c4104e3c4074acd9d48ae4f9db5f4c936c57afe | C++ | emifervi/ProyectoFinalPoo | /Fisico.h | UTF-8 | 1,511 | 3.46875 | 3 | [] | no_license | #ifndef FISICO_H_INCLUDED
#define FISICO_H_INCLUDED
#include "Servicio.h"
class Fisico : public Servicio{
private:
double ctoX30Min;
public:
// Constructores
Fisico();
Fisico(string servicio, string detalle, char clase, double tarifa);
// Metodos de acceso y modificacion
void setC... | true |
a8b76b7337c27d65b022073866211d01b391af79 | C++ | EdinsonPedroza/POO2021-1ESPB | /POSGSOFT/Jurado.cpp | UTF-8 | 2,875 | 3.1875 | 3 | [] | no_license | #include "Jurado.h"
Jurado::Jurado() {
}
Jurado::Jurado(string nombre, string id): Persona(nombre,id) {
this->vectorNombreJurado.push_back(nombre);
this->vectorIdJurado.push_back(id);
}
void Jurado::calificarCriterios(vector<string> criterios) {
int i;
for (i=0;i<16;i++){
if(i<8){
c... | true |
b593b97734417d91d4ecd82690ab8dd3a17cbff7 | C++ | whime/dataStructure-algorithm | /剑指offer/跳台阶.cpp | UTF-8 | 915 | 3.921875 | 4 | [] | no_license | /*
一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法
(先后次序不同算不同的结果)。
*/
//看来我还是只会递归啊
class Solution {
public:
int jumpFloor(int number) {
if(number==1) return 1;
else if(number==2) return 2;
else
{
return jumpFloor(number-1)+jumpFloor(number-2);
... | true |
b8866521a16259b7c0dd070ac0d9e78650e353f3 | C++ | Costath/Ordered-List | /main.cpp | ISO-8859-1 | 2,573 | 3.109375 | 3 | [] | no_license | /*
Autor: Thales Costa
Disciplina: ED1
Professor: Irineu
Maio/2017
*/
#include "lista_ordenada.h"
int main() {
setlocale(LC_ALL, "");
system("title Lista ordenada");
int funcao;
char elemento;
bool found;
Lista* L;
L = inicializa();
menu:
printf("==Lista ordenada==\n\n");
p... | true |
15f1519d2da9c90e7f6d65ab262eba9d8e781240 | C++ | Attyuttam/CompetitiveProgramming | /Misc/printingAllStringsOfLengthN.cpp | UTF-8 | 612 | 3.265625 | 3 | [] | no_license | #include<bits/stdc++.h>
#include<chrono>
using namespace std;
using namespace std::chrono;
void generateAllOfLengthN(int N,string toPrint){
if(N!=0){
generateAllOfLengthN(N-1,toPrint+"a");
generateAllOfLengthN(N-1,toPrint+"b");
}else{
cout<<toPrint<<endl;
}
}
int main(){
int N;
for(int i=3;i<=3;i++){
a... | true |
8144f1309d6ff0dbc0798cae848e279bfaffa2dd | C++ | atenpas/gpd | /src/gpd/util/point_list.cpp | UTF-8 | 1,786 | 2.5625 | 3 | [
"BSD-2-Clause"
] | permissive | #include <gpd/util/point_list.h>
namespace gpd {
namespace util {
PointList::PointList(int size, int num_cams) {
points_.resize(3, size);
normals_.resize(3, size);
cam_source_.resize(num_cams, size);
view_points_.resize(3, num_cams);
}
PointList PointList::slice(const std::vector<int> &indices) const {
Eig... | true |
4b1a480d2652363bc5412e99d38120c93f7653bb | C++ | DSchana/Misc | /School stuff/CS254/assign4/_Graph.cpp | UTF-8 | 1,425 | 3.59375 | 4 | [] | no_license | #include <algorithm>
#include "_Graph.h"
using namespace std;
Graph::Graph(int s) {
for (int i = 0; i < s; i++) {
Node* n;
nodes.push_back(n);
nodes[i]->id = i;
}
}
/*
* Description: Connect two nodes by adding them into
* each other's adjacency list
* Parameters: Integer n1: ID of node 1
* Integer n2:... | true |
2c89da90d36b60a957fc0473f95380a9cce712f3 | C++ | ATTPC/libattpc-cleaning | /src/Cluster.cpp | UTF-8 | 1,865 | 2.921875 | 3 | [] | no_license | #include "Cluster.h"
#include <fstream>
#include <limits>
#include <cctype>
#include <boost/algorithm/string/replace.hpp>
namespace attpc {
namespace clustering {
void Cluster::calculateRelationshipMatrixIfNecessary() const {
if (this->relationshipMatrix.size() == 0) {
this->relationshipMatrix = Eigen::... | true |
090be4ad951f052ac13d2c806d1c60214cf7af9e | C++ | KarolisZeimantas/1-uzd | /1 Uzd.cpp | UTF-8 | 1,029 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include <vector>
using namespace std;
bool gender(string name){
return (name== "s") ? true : false;
}
void createStars(string name,int plotis){
vector<char> message;
string temp = &name[name.length()-1];
string welcome = (gender(temp)) ? "* Sveikas, " : "* Sveika, ";
w... | true |
4796d63dcb6dfa6ad7cbfd7c57c6aa92c3efa4fa | C++ | pinkogeneral/AlgorithmStudy | /03.Sort/selectsort.cpp | ISO-8859-7 | 417 | 3.265625 | 3 | [] | no_license | #include<iostream>
int main()
{
int arr[10]{ 1, 10, 9, 5, 4, 3, 6, 8, 7, 2 };
//
int i, j, min , temp, index;
for (i = 0; i < 10; i++)
{
min = 999;
for (j = i; j < 10; j++)
{
if (min > arr[j])
{
min = arr[j];
index = j;
}
}
temp = arr[i];
arr[i] = arr[index];
arr[index] ... | true |
ecc41bb4f40c59db87f7d2b9b741fd4ad10cbe2f | C++ | theater/ArduinoMega | /Library/Room/Mode.cpp | UTF-8 | 845 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Mode.cpp
*
* Created on: Mar 15, 2018
* Author: theater
*/
#include <Mode.h>
#include <MqttUtil.h>
Mode::Mode(ModeType mode) : Mode(mode, NULL) {
}
Mode::Mode(ModeType mode, char * id ) {
this->id = id;
this->mode = mode;
this->callbackTopic = createCallbackTopic(id);
MqttUtil::s... | true |
76474521928b9cca08afde58dccc97c1b4ef4112 | C++ | onBinHe/C-C- | /nowcoder_studycode/P3_judgeMultiple2_5_11_13/judgeMultiple/judgeMultiple/judgeMultiple.cpp | UTF-8 | 3,934 | 3.375 | 3 | [] | no_license | /* -----------------------------------------------------------------------
题目: 给出一个数n,求1到n中,有多少个数不是2 5 11 13的倍数。
本题有多组输入,每行一个数n,1<=n<=10^18。
每行输出输出不是2 5 11 13的倍数的数共有多少。
如:输入“15”,输出“4”,说明“1 3 7 9”
思路: 从1-n中的所有数,从小到大依次取出;对2 5 11 13做取余运算,如果是
相应的倍数,取余结果为0.
注意点:1)如数据i对2 5 11 13取余,只要有一个取余结... | true |
96685c624f5bcc42b71db8d2a1966bc888e79e41 | C++ | TopBrussels/TopTreeAnalysisBase | /Selection/src/ElectronSelection.cc | UTF-8 | 30,325 | 2.78125 | 3 | [] | no_license | #include "../interface/ElectronSelection.h"
//____CONSTRUCTORS______________________________________________________//
ElectronSelection::ElectronSelection()
{
rho_ = 0;
elecIsoCorrType_ = 2; // 0: no corr, 1: rho corr, 2: dB corr.
}
ElectronSelection::ElectronSelection(const std::vector<TRootElectron*>& electr... | true |
4fa37e29adc99c4491f00ebb1d22d3ace1e25cc1 | C++ | muthubro/Amber | /Amber/src/Amber/Math/Frustum.h | UTF-8 | 621 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <glm/glm.hpp>
namespace Amber
{
namespace Math
{
struct Frustum
{
glm::vec3 Focus;
glm::vec3 Front, Up;
float NearPlane, FarPlane;
float HorizontalFOV, VerticalFOV;
Frustum();
Frustum(const glm::vec3& focus, const glm::vec3& front, const glm::vec3 up,
float... | true |
8139a158bba1d0878c0287fdf1350358da0534fe | C++ | zhjc/HeuristicOptimization | /src/common/ho_logger.cpp | UTF-8 | 770 | 2.625 | 3 | [] | no_license |
#include "common/ho_logger.h"
#include <iostream>
using namespace std;
HO_NAMESPACE_BEGIN(utility)
HoLogger::HoLogger(const string& strLogName)
{
if (strLogName != "")
{
m_logFile.open(strLogName);
if (!m_logFile.is_open())
{
// error
int m = -1;
}
... | true |
5691f5c6d35adddf951c0c92b22159a291df7be7 | C++ | 15831944/applesales | /OneWorld/Include/owScene/TerrainTileFactory.h | GB18030 | 1,801 | 2.796875 | 3 | [] | no_license | #ifndef OWSCENE_TILEFACTORY_H_
#define OWSCENE_TILEFACTORY_H_
#include <owScene/export.h>
#include <osg/Referenced>
#include <osg/Geode>
#include <owScene/TerrainTile.h>
#include <owScene/TileKey.h>
#include <owScene/Terrain.h>
namespace owScene
{
/** 鹤ࣺݡTilePagedLodҪֽ£TerrainTileReadWriter
* лTerrainй... | true |
821d85f36f2d2bb32fd13ffbd8883f1feb366fb6 | C++ | Zathom/CarbonFootprintCalculator | /CarbonFootprintCalculator/CarbonFootprint.cpp | UTF-8 | 7,041 | 3.4375 | 3 | [] | no_license | #include"CarbonFootprint.h"
#include<iostream>
using namespace std;
//-----------CARBON FOOTPRINT FUNCTIONS----------
//-----------BUILDING FUNCTIONS----------
Building::Building() // DEFAULT CONSTRUCTOR.
{
cout << "Default building constructor executed...." << endl;
}
Building::Building(string bldType, double fuel... | true |
7094e2ffc13b0d688a84b66d3bc781fb086015d2 | C++ | imane0897/PAT | /1052.cpp | UTF-8 | 996 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
const int MAXN = 100010;
struct num {
int add;
int val;
int next;
} ;
bool cmp (num a, num b) {
return a.val < b.val;
}
int main(void) {
int n, m, i, head_add, b[MAXN] = {0}, c[MAXN] = {0};
num a[MAXN];
cin... | true |
cdd19e10b7cc0c1d70088b790563fafb92933ddf | C++ | BITXUJI/C---primer--code-note | /pointerassignment-p49.cpp | UTF-8 | 436 | 3.125 | 3 | [] | no_license | #include <iostream>
int main(int argc, const char **argv)
{
int i = 42;
int *pi = 0; //int &ri = 0 ; is error
int *pi2 = &i; //int &ri2 = i; is ok
int *pi3; // int &ri3; is error
pi3 = pi2;
pi2 = 0;
int ival;
pi = &ival;
*pi = 0;
std::cout << ival << " " << *pi << std::en... | true |
0a4642a6ffabe67cee3cb89bd90437a9095af329 | C++ | IslamAdam/SPOT_extra_features_added | /Actions/Action.h | UTF-8 | 368 | 2.515625 | 3 | [] | no_license | #pragma once
#include"..//GUI/Drawable.h"
class Registrar; //forward class declaration
//Base class for all possible actions (abstract class)
class Action
{
protected:
Registrar* pReg;
public:
Action(Registrar* p) { pReg = p; };
//Execute action (code depends on action type)
bool virtual Execute() = ... | true |
4f4b129ed8cce7b71f0b86042f771898871d34bb | C++ | muneebarshad/Board-Game-40Thieves | /implementation/src/GameBoard.cpp | UTF-8 | 6,144 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "../include/GameBoard.h"
#include "../include/CardStack.h"
#include "../include/CardTypes.h"
#include <stdexcept>
using namespace std;
BoardT::BoardT(vector<CardT> deck){
int count=0;
vector<CardT> null {};
for(unsigned int i =0 ; i < deck.size(); i++){
for(unsign... | true |
b0dbdcc44e33bf522a42be524ebe44f28b386216 | C++ | AMazur2/UXP-Linda-Potoki | /src/data.cpp | UTF-8 | 1,521 | 3.265625 | 3 | [] | no_license | #include<iostream>
#include<sstream>
#include<cstdarg>
#include"data.hpp"
Data::Data() = default;
Data::Data(const char* fmt...) {
va_list args;
va_start(args, fmt);
std::string format = fmt;
for (int i = 0; i < 100 && i < format.size() && *fmt != '\0'; ++i, ++fmt) {
if (*fmt == 's') {
... | true |
5335f660dbd44deb3c96511824bc539f4e3f071e | C++ | apoorv-gupta/topcoder | /M/MathContest.cpp | UTF-8 | 3,435 | 2.796875 | 3 | [] | no_license | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | true |
5b1e9a706143f9c623605890a3e8c0013737d721 | C++ | jinzhu6/line-follower | /read-sensor.cc | UTF-8 | 2,401 | 2.53125 | 3 | [] | no_license | #include "robot.h"
int param;
int left_ir = 0x01; // bit 0: ’0000 0001’
int mid_ir = 0x02; // bit 1: ’0000 0010’
int right_ir = 0x04; // bit 2: ’0000 0100’
int shirt_bit5 = 0x20; // bit 5: '0010 0000'
int shirt_bit6 = 0x40; // bit 6: '0100 0000'
int read_line() {
int result = 0;
param = rlink.request(READ_PORT_1... | true |
ed02884ef17b06cf21ab9bab64e6f161cb5ac271 | C++ | ckormanyos/real-time-cpp | /examples/chapter16_08/src/util/utility/util_numeric_cast.h | UTF-8 | 1,649 | 2.6875 | 3 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-3.0-only"
] | permissive | ///////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2009 - 2021. //
// Distributed under the Boost Software License, //
// Version 1.0. (See accompanying file LICENSE_1_0.txt //
// or copy at http://www.boost.org/LICENSE_1_0.... | true |
21cfc0ed94f26828b1091573cf6ff52449b587a4 | C++ | VDoring/CPP-My-Study-Functions | /초보자를 위한 C++ 200제/146.cpp | UHC | 1,214 | 3.5625 | 4 | [] | no_license | //146
//tuple ϱ(make tuple, get)
#include <iostream>
#include <tuple>
#include <string>
using namespace std;
int main()
{
typedef tuple<string, int, double>Data; //typedef ̿ Ʃ Ѵ. Data Ʃ string, int, double 3 ڷ ִ.
Data data1("ڿ", 10, 1.2); //Ʃ Data ü ʱȭѴ.
auto data2 = make_tuple("ڿ", 10, 1.2); //... | true |
be6526eadfaace0c91a258a8091947340456b09c | C++ | tabvn/ued | /finalExam2018/part1/max3so.cpp | UTF-8 | 201 | 2.546875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
long long a,b,c;
cin >> a >> b >> c;
long long max = a;
if(b > max){
max = b;
}
if(c > max){
max = c;
}
cout << max;
return 0;
} | true |
965cc7163f2c76fca4f90b0ecf41d1e76bc325e5 | C++ | CJT-Jackton/The-Color-of-Tea | /Textures.cpp | UTF-8 | 6,090 | 2.65625 | 3 | [
"BSD-2-Clause"
] | permissive | //
// Textures
//
// Created by Warren R. Carithers 2016/11/22.
// Based on code created by Joe Geigel on 1/23/13.
// Copyright 2016 Rochester Institute of Technology. All rights reserved.
//
// Contributor: Jietong Chen
//
// Simple class for setting up texture mapping parameters.
//
// This code can be compi... | true |
e1169804720151aa0811b559e44dcc8707a7f0e8 | C++ | a8a3/algorithms | /strings/include/fsm.hpp | UTF-8 | 1,463 | 3.15625 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
namespace fsm {
using table = std::vector<std::vector<int>>;
// ------------------------------------------------------------------
std::string left(const std::string& s, size_t idx) {
return s.substr(0, idx);
}
// --------------------------------------------------... | true |
f6dd08a60f45dc0b9d9df8506504e5cfbbaf3e5d | C++ | roystjohn/challenges | /unfairness/unfairness/main.cpp | UTF-8 | 1,464 | 3.71875 | 4 | [] | no_license | //
// main.cpp
// unfairness
//
// Created by Roy St. John on 3/7/15.
// Copyright (c) 2015 Roy St. John. All rights reserved.
//
// From an entry of N integers, group K integers in a
// way that minimizes unfairness, where unfairness is
// the max of the group of integers minus the minimum
// of the group of ... | true |
531acb01e76ed9f7af39945cec7d1fc698f44978 | C++ | ryanpflynn/network-file-client | /main1.cpp | UTF-8 | 5,350 | 3.328125 | 3 | [] | no_license | /*************************
* Ryan Flynn
* Network File Transfer Client
**************************/
#include <iostream>
#include <string>
#include <cstdlib>
#include "Winsock2.h"
#include "Socket1.h"
using namespace std;
bool checkName(string, string);
char* stringToCharArray(string);
bool checkComm... | true |
f22348ddf0fe1d0debc22fb7eb8344aabe408521 | C++ | skypjack/uvw | /src/uvw/idle.h | UTF-8 | 1,415 | 2.625 | 3 | [
"MIT",
"CC-BY-SA-4.0"
] | permissive | #ifndef UVW_IDLE_INCLUDE_H
#define UVW_IDLE_INCLUDE_H
#include <uv.h>
#include "handle.hpp"
#include "loop.h"
namespace uvw {
/*! @brief Idle event. */
struct idle_event {};
/**
* @brief The idle handle.
*
* Idle handles will emit a idle event once per loop iteration, right before the
* prepare handles.
*
* T... | true |
8b85df22126c5a516b6f51c9591aa0996ea5c7ef | C++ | pvsmpraveen/MissionRnd | /Advanced C/C-MRND2017_WinterCamp/spec/P1_ZerosOnesSpec.cpp | UTF-8 | 3,846 | 3.390625 | 3 | [] | no_license | #include "stdafx.h"
#include "../src/P1_ZerosOnes.cpp"
using namespace System;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace Microsoft::VisualStudio::TestTools::UnitTesting;
namespace spec
{
[TestClass]
public ref class P1_ZerosOnesSpec
{
private:
TestContext^ testC... | true |
469a7120ded443851103e2f09b5867601c18f1bf | C++ | ghostec/WhiteOld | /Physics/src/Helpers/XMLPhysics.cpp | UTF-8 | 1,095 | 2.5625 | 3 | [] | no_license | #include "Physics/Helpers/XMLPhysics.h"
namespace XMLHelper
{
void createBody( tinyxml2::XMLElement* el,
std::shared_ptr<SceneGraph> scene_graph,
std::shared_ptr<PhysicsManager> physics_manager )
{
const char* sg_node_name = el->FirstChildElement( "sg_node" )->GetText();
std::shared_ptr<SGNode> sg_... | true |
ebf3c9fcec625b21a46d91cbc3060b8816e21e57 | C++ | Error323/wordclock | /LightSensor.cpp | UTF-8 | 384 | 2.671875 | 3 | [] | no_license | #include "LightSensor.h"
#include <Arduino.h>
LightSensor::LightSensor(const uint8_t pin):
mPin(pin)
{
for (uint8_t i = 0; i < BUFFER_SIZE; i++)
Update();
}
void LightSensor::Update()
{
mRingBuffer.Add(analogRead(mPin));
}
uint8_t LightSensor::Brightness()
{
uint8_t brightness = map(mRingBuffer.Mean(), ... | true |
15c008eae90ddf30d461899222c01624ee8b65ab | C++ | totorodev0032/Data-Structure-and-algorithms-For-Interview-Preparation | /Arrays/kth_distinct_largest_element.cpp | UTF-8 | 604 | 3.40625 | 3 | [] | no_license | // kth largest distinct element.
#include <bits/stdc++.h>
using namespace std;
int main() {
int arr[] = {3,2,3,1,2,4,5,5,6};
int size = sizeof(arr)/sizeof(int);
sort(arr, arr + size, greater<int>());
for(int i = 0; i<size; i++) {
cout<< arr[i] << endl;
}
// kth largest element
int k = 4;
int count ... | true |
97eba756f5abf042856a24e741344919b51766c7 | C++ | MrClam1/My-works | /Lab 5.cpp | UTF-8 | 4,005 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
#include <Windows.h>
#include <iostream>
#include <string.h>
#include <fstream>
#include <locale.h>
using namespace std;
struct Country {
char name[20];
char capital[20];
char language[50];
int people;
int square;
char money[10];
char government[100];
};
struct Countries {
Country countries[... | true |
23159f5980f70b47b8a42b7e5cbd26b415092155 | C++ | saphere9/InterviewPrep | /Topic/Solution/Graph2.cpp | UTF-8 | 1,548 | 2.8125 | 3 | [] | no_license | class Solution {
public:
vector<int> eventualSafeNodes(vector<vector<int>>& graph) {
queue<int> q;
int n = graph.size();
int in[10001];
fill( in , in + n+1,0);
vector< vector<int> > edges(n);
for ( int i = 0 ; i < n ; i++){
for ( int x :... | true |
5a99d83556bb4563e46ee18df95e806883bc634f | C++ | zzhuazi/c-primer-plus | /第五章/T5-2/T5-2/T5-2.cpp | GB18030 | 302 | 3.203125 | 3 | [] | no_license | /*
ʹarraylong double±д嵥5.4100ֵ
*/
#include <iostream>
#include <array>
using namespace std;
int main() {
array<long double, 100> a;
a[1] = a[0] = 1;
for (int i = 2; i < 100; i++) {
a[i] = i* a[i - 1];
}
cout << a[98] << endl << a[99];
} | true |
76c8e04e96aa60a96801d738998f2d2171eccc31 | C++ | IvanaGyro/ZeroJudge-Answers | /a065/a095.cpp | UTF-8 | 164 | 2.53125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int m, n;
while (cin >> n){
cin >> m;
if (m == n) cout << m << endl;
else cout << m + 1 << endl;
}
} | true |
a368f85fd702a5e81f7d2cba470a2c528f4cbe82 | C++ | taihangy/hackerrank | /binarytree.cpp | UTF-8 | 1,500 | 3.515625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#define LEFT 0
#define RIGHT 1
struct BTNode {
int key;
struct BTNode* nodes[2];
};
struct BTNode* newNode(int key)
{
struct BTNode* node = (struct BTNode*) malloc(sizeof(*node));
node->key = key;
node->nodes[LEFT] = NULL;
node->nodes[RIGHT] = NULL;
return... | true |
75fec3c18b6db21b07e6bb0c37a6f312e5719b81 | C++ | ivan-uskov/computer-graphics-labs | /tiny_renderer/renderer/frametile.cpp | UTF-8 | 1,097 | 2.953125 | 3 | [
"MIT"
] | permissive | #include "frametile.h"
#include "tgaimage.h"
#include <string.h>
FrameTile::FrameTile(Vec2i origin, Vec2i size)
: m_origin(origin)
, m_size(size)
{
}
void FrameTile::init(TGAImage & image, float * zbuffer)
{
m_imageSize = image.get_size();
m_data = image.buffer();
m_bytespp = image.get_bytespp();
... | true |
2667fd54aa35c11e763b1465f670ccb1bbfbd0c4 | C++ | haiki/OJcode | /18SpecialMultiplication1083.cpp | UTF-8 | 858 | 3.140625 | 3 | [] | no_license | #include<iostream>
using namespace std;
/*int main()
{
int a,b;
int buff1[11]={0},buff2[11]={0};
while(cin>>a>>b)
{
int si1=0,si2=0;
int result=0;
while(a!=0)
{
buff1[si1++]=a%10;
a=a/10;
}
while(b!=0)
{
buff2[si... | true |
a1071be496ecc9f8f428b4a5d7ab30b056aa317d | C++ | Vory7/sibsutis | /3 семестр/СиАОД/Лабораторные работы/lab_3 (Удаление из СДП)/treecreate.cpp | UTF-8 | 2,604 | 3.46875 | 3 | [] | no_license | #include "treecreate.hpp"
#include <iostream>
#include <ctime>
#include <conio.h>
/* Рандомайзер без повторов */
void FillRand(int *A, int n) {
bool table[MAX_RAND] = {false};
int x;
for (int i = 0; i < n; i++) {
while (table[x = rand() % MAX_RAND])
;
table[x] = true;
A[i] = x;
}
}
void Inse... | true |
fa882e559e225942a1f192eb4d940e336772dd54 | C++ | igorracca/UVa-solutions | /fb.cpp | UTF-8 | 3,191 | 3.90625 | 4 | [] | no_license | /*
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
author: Igor Racca
-------------------------------------------------------------------------------------------... | true |
063f86bf8b21b08a627bd7120d106bd095b90aca | C++ | kalyanghosh/A-Tour-of-Cpp | /Pointers_Structures/memory_allocation_in_heap.cpp | UTF-8 | 232 | 2.796875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int * A;
cout<<"Enter the number of students:\n";
int numStudents;
cin>>numStudents;
A=new int[numStudents];
if(A!=NULL)
{
A[0]=10;
A[1]=15;
}
return 0;
}
| true |
9e08fd5ab7d3250a2d0d5e937a077ceed277e2e6 | C++ | davidmueller13/vexx | /experimental/database/src/fieldManager.cpp | UTF-8 | 1,704 | 2.671875 | 3 | [] | no_license | #include "fieldManager.h"
#include "iostream"
namespace db
{
void fieldManager::ensureRegisteredType( field *in, std::string nN )
{
if( typeid( *in ) != typeid( field ) )
{
if( !isRegistered( in ) )
{
fieldRecord temp;
temp.type = in->copy( 0 );
temp.niceName = nN;
types.push_back( ... | true |
da30faa8c66baa4b867d2c133be20fc40fdd44c0 | C++ | ash/cpp-tut | /012.cpp | UTF-8 | 171 | 2.65625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int f() {
static int c = 0;
return c++;
}
int main() {
for (int i = 0; i < 10; i++)
cout << f() << "\n";
}
| true |
bc4598ce909940f3ba4a78e5356138966c5dc21f | C++ | aiiselo/HSE-software-engineering | /2nd course/Algorithms and Data Structures/Disjoint Sets/header.cpp | UTF-8 | 7,011 | 2.984375 | 3 | [] | no_license | #include "header.hpp"
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
void DSArray::Create (int x){
index++;
array[x] = index;
}
void DSArray::Union (int x, int y){
for (int i=0; i<array.size(); i++){
if (array[i] == array[x]){
array[x] = array[y];
... | true |
aa61f81486f21cca7e7457ee7e5df49cf391877a | C++ | JaimeRamosMiranda/C-plus-plus-1st-repository-2018 | /practica2/tabla.cpp | UTF-8 | 460 | 2.671875 | 3 | [] | no_license | /*
Tabla de multiplicar
*/
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{int n,f,c;
int op;
for(;;)
{
do
{cout<<"Ingrese >0 y <= 10 :";
cin>>n;
}while(n<0||n>10);
for(f=1;f<=n;f++)
{
for(c=1;c<=n;c++)
cout<<f*c<<"\t";
cout<<endl;
}
getche();
c... | true |
89e4d01e2a89248110fdd693533bd8f510c537c3 | C++ | finegs/Test01 | /pjt02/rpi01.cpp | UTF-8 | 3,035 | 2.796875 | 3 | [] | no_license | /*
*
https://fishpoint.tistory.com/2235?utm_source=dable
* dht22.c:
* Simple test program to test the wiringPi functions
* Based on the existing dht11.c
* Amended by technion@lolware.net
*/
#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
#i... | true |
da9359758969f1d9c360daf279c144c0c4130905 | C++ | heyang5188/LeetCode | /tree/144.二叉树的前序遍历.cc | UTF-8 | 879 | 3.0625 | 3 | [] | no_license | // Author Herb
// Time : 2019-01-30 21:01:33
#include <iostream>
#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
struct ListNode { int val; ListNode* next; ListNode(int x): val(x),next(NULL){}};
struct TreeNode {int val;TreeNode* left;T... | true |
fff6b56214a2a55e69943c00a9f13429106d215e | C++ | ingyeoking13/algorithm | /cf/problemsetOldVersion/1138B.cc | UTF-8 | 1,079 | 2.5625 | 3 | [] | no_license | #include <stdio.h>
#include <vector>
using namespace std;
vector<int> ans;
vector<int> zero;
vector<int> rep;
char a[(int)5e3+1];
char b[(int)5e3+1];
int main()
{
int n;
scanf("%d", &n);
scanf("%s", a);
scanf("%s", b);
int acnt = 0, bcnt=0;
int zerocnt = 0;
int stat = 1;
for (int i=0; i<n; i++)
{
... | true |
c1e2054fded7a969abc4522c7ca0912e6905c5a2 | C++ | vimday/PlayWithLeetCode | /每日一题 11 月/Day1105_word-ladder.cpp | UTF-8 | 2,935 | 2.84375 | 3 | [] | no_license | /*
* @Author :vimday
* @Desc :
* @Url :
* @File Name :Day1105_word-ladder.cpp
* @Created Time:2020-11-05 16:21:01
* @E-mail :lwftx@outlook.com
* @GitHub :https://github.com/vimday
*/
#include <bits/stdc++.h>
using namespace std;
void debug() {
#ifdef LOCAL
freopen("E:\\Cpp\\i... | true |
eb47ddff9603315189b6ccf68f49b217546c6441 | C++ | hshshv/Glove-for-blind-code | /glove.ino | UTF-8 | 680 | 2.53125 | 3 | [] | no_license | #include "UltrasonicSensor.h"
#define num_of_engines 3
#define Minimum_voltag_per_engine 70
UltrasonicSensor Dsensor(7,8);//trig, echo
short engines[] = {5,10,11}; //must be PWM pin
float Distance;
short TurnedOnEngine;
void setup()
{
TurnOff();
}
void loop()
{
Distance = Dsensor.GetAvg();
... | true |
5f40b74b2002963617b1bbe2c0dc332b92600a76 | C++ | rfccambridge/robocup-ee | /firmware/gen3/SPILib/SPISlave.h | UTF-8 | 1,101 | 2.9375 | 3 | [] | no_license | /*
* SPISlave.h
*
* Created: 3/24/2015 1:24:46 PM
* Author: David
*/
#ifndef __SPISLAVE_H__
#define __SPISLAVE_H__
#include "Command.h"
class SPISlave {
private:
// state: 0 waiting; 1-5 number of bytes received (start, command, arg1, arg2, checksum); 6 given data to GetCommand; 7 reply ready (sending start byte);... | true |
0cfff3f79ff12d2172ab0455a24a27b1a33ac7f7 | C++ | bugy15/ZPG | /ZPG/Object.h | UTF-8 | 747 | 2.703125 | 3 | [] | no_license | #pragma once
#include <map>
#include<glm/gtc/matrix_transform.hpp>
#include "Model.h"
#include "Direction.h"
class Object
{
private:
Model * model;
GLsizei vao;
GLsizei count;
GLuint ID;
string nameOfShader;
mat4 ModelMatrix;
vec4 color;
vec3 multipler;
public:
Object(GLuint ID, string nameOfSha... | true |
987cd6b84b4af984edb7b7e4f96184166e744c49 | C++ | shingie11/MobileRobotNavigation | /AMR-workshops/src/planner/include/planner/node_xy.h | UTF-8 | 1,195 | 2.640625 | 3 | [] | no_license | //
// node_xy.h
// Heuristic Search
//
// Created by Shingie on 3/25/20.
// Copyright © 2020 Shingie. All rights reserved.
//prototype for a node/intersection in the path of the mobile robot
#ifndef node_xy_h
#define node_xy_h
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <vector>
class... | true |
75b4e6047ced22f18dcf0875f6f48514d64b95ee | C++ | cheerayhuang/Garner | /c++_primer_ex/ex13_27.cc | UTF-8 | 1,388 | 3.1875 | 3 | [] | no_license | /**************************************************************************
*
* Copyright (c) 2015 Cheeray Huang. All Rights Reserved
*
* @file: ex13_27.cc
* @author: Huang Qiyu
* @email: cheeray.huang@gmail.com
* @date: 07-04-2016 00:04:08
* @version $Revision$
*
*********************************************... | true |
883604f494ab969097e5f975ac038968cc60c83d | C++ | sizilium/FlexChess | /EasyFramework3d/base/cont/StringList.hpp | UTF-8 | 36,765 | 3.125 | 3 | [
"MIT"
] | permissive | /**
* @file StringList.hpp
* @author sizilium
* @date 01.06.2007
* @brief This file is part of the Vision Synthesis Easy Framework.\n
* This file has no copyright; you can change everything.
* Visit www.vision-synthesis.de or www.easy-framework.de for further informations.\n
* If there is a bug please send a mai... | true |
c103c4dcc74caf3e2a8b27e4bac2be30d5182766 | C++ | huang7017/pccu_cpp_practice | /practice_11/11-統計各組距人數.cpp | BIG5 | 665 | 3.453125 | 3 | [] | no_license | /*
main禡wJYZ{]pҸզZܰ}CscoreA
мg禡distributionHέpUնZ(0-9, 10-19, K,90-99, 100)HơA
ȩ̀(ۤƧCܰ)LXέpGC
Фŧmain禡C
*/
#include <iostream>
#include <iomanip>
using namespace std;
void distribution(int name[],int size);
int main(){
const int arraySize=100;
int score[arraySize];
for(int i=0;i<arraySize;i++){
cin>>score[i];
}
... | true |
dadf6a205397f1f5b9796d04239be7c048454bfd | C++ | vectormars/CPP | /Design pattern/Builder Pattern/Builder Pattern Meal/Meal.cpp | UTF-8 | 348 | 3.21875 | 3 | [] | no_license | #include "Meal.h"
Meal::Meal()
{
//ctor
}
Meal::~Meal()
{
//dtor
}
void Meal::setMealItem(string mealItem)
{
mMeal.push(mealItem);
}
void Meal::serveMeal()
{
int i = 1;
while(!mMeal.empty())
{
cout << " Serve item " << i++ << ":" << mMeal.front() << endl ;
... | true |
839c74af127e63eadbb2de0d5f3b9a7dcbda16a2 | C++ | battleofdie/interview | /leetcode/Length-of-Last-Word.cpp | UTF-8 | 545 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int lengthOfLastWord(const char *s) {
// Note: The Solution object is instantiated only once and is reused by each test case.
if(s == NULL) return 0;
int p = 0, r = 0;
while(*s)
{
if(*s == ' ')
{
p = r... | true |
edb15cca5622c2ee997ccc2f9c24e7e7b6650ac9 | C++ | aallbrig/arduino-glob | /motion_activate_LED_1/motion_activate_LED_1.ino | UTF-8 | 2,824 | 2.984375 | 3 | [] | no_license | // Motion Sensor
const int motionSensor = 1;
// LED lights (6 total)
const int greenLed = 9;
const int yellowLed = 10;
const int redLed1 = 11;
const int redLed2 = 12;
const int redLed3 = 13;
const int waitTime = 3000;
const int quickWait = 500;
// Servo
#include <Servo.h>
Servo servo;
const... | true |
326c2c03a7d4b2f9a48a726f032a75ae597e2116 | C++ | xchrdw/voxellancer | /src/equipment/equipmentslot.h | UTF-8 | 808 | 2.75 | 3 | [] | no_license | #pragma once
#include <map>
#include <list>
#include <string>
#include "utils/observable.h"
class WorldObjectComponents;
/**
* Base class for everything on a worldobject that behaves like a slot
* that can be (or cannot) be equipped with equipment
*/
class EquipmentSlot : public Observable {
public:
Equipme... | true |
e6bd262c21c5abd055405e3daefcf95b9c14fb13 | C++ | Gdansk-Embedded-Meetup/slajdy | /Spotkanie #14 2023-05-09/kody/unique_ptr_deleter.cpp | UTF-8 | 369 | 3.078125 | 3 | [] | no_license | #include <cstdio>
#include <memory>
using FilePtr = std::unique_ptr<FILE, decltype([](FILE* f) { std::fclose(f); })>;
void print_content(const char* file_path) {
FilePtr file{std::fopen(file_path, "r")};
int c;
while ((c = std::fgetc(file.get())) != EOF) {
std::putchar(c);
}
}
int main() {... | true |
76f702a71a30ff119d0db0f864517484df0e1be1 | C++ | ruthvikb14/MagOD | /src/screen/screen_RA8875.cpp | UTF-8 | 10,737 | 2.546875 | 3 | [] | no_license | /* screen_8875.cpp
MagOD2 libary
Mar 2019
Definition of screen layout and screen update functions
for TFT050 screen (MAGOD2 system has that one)
Tijmen Hageman, Jordi Hendrix, Hans Keizer, Leon Abelmann
*/
#include "Arduino.h"
//Avoid that Arduino IDE compiles this file when not MagOD2
#include ... | true |
5fe878517af84e028fc682cd3699baefd0c4a4cd | C++ | bamboohiko/problemSolve | /swjtu/e20150426/t2_ph.cpp | UTF-8 | 515 | 2.90625 | 3 | [] | no_license | #include<iostream>
using namespace std;
bool f[26];
void init(){
for(int i=0;i<26;i++)
f[i] = false;
}
int main(){
int n;
bool flag;
char ch;
while(cin>>n){
init();
flag = false;
for(int i = 0; i < n; i++){
cin>>ch;
if((ch>='A')&&(ch<='Z'))
ch+=32;
if(!f[ch-97])
f[ch-97]... | true |
795462251439e50ba6252dabc68fd204d899741c | C++ | klingerf2/SmartDME | /raspberrypi/sketchbook/wifly_firmware_update/wifly_firmware_update.ino | UTF-8 | 4,222 | 2.59375 | 3 | [
"Unlicense"
] | permissive | /* This script is made for a WiFly connected to a Arduino Leonardo (with the protoshield for example) or the
Helios gadget ( http://www.heliosgadget.nl/ )
This script will update your WiFly to the following firmware files
wifly7-400.img
wifly7-400.mif
Please change those file names in case th... | true |
b6186ce74c8ec61ca31a6aa083e6b8793ce06b13 | C++ | vabalcar/Todolister | /Todolister/TOIIO.h | UTF-8 | 375 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "TOIParser.h"
#include "TOIPrinter.h"
class TOIIO {
public:
TOIIO(toiParserPtr parser, toiPrinterPtr printer) : parser_(move(parser)), printer_(move(printer)) {}
TOIParser& getParser() { return *parser_; }
TOIPrinter& getPrinter() { return *printer_; }
private:
toiParserPtr parser_;
toiPrint... | true |
e760a71e093ddd306be758e28f227888b706bb5c | C++ | EricRobertBrewer/SonomaState | /cs450/Project2/shell.cpp | UTF-8 | 5,352 | 2.84375 | 3 | [] | no_license | /*
shell.cpp
Eric Brewer
12/6/10
Kooshesh
CS450 - Operating Systems
Shell program; main function -
*/
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
#include <unistd.h>
#include <wait.h>
#include <stdlib.h>
#include <fcntl.h>
#include "Parser.hpp"
#define DEBUG 0
#define debug if( DEB... | true |
bfd659bc76fdc7f0d3c794a5bcb019f5d322cccd | C++ | Drewblue78/C-Plus | /Chapters/Chapter4/Ex7.cpp | UTF-8 | 876 | 3.265625 | 3 | [] | no_license | #include <cmath>
#include <iostream>
using namespace std;
double gravitational_force(double m1, double m2, double d);
char ans;
const double G = 6.673 * pow(10.0, -8.0);
double mass1, mass2, distance, gravity;
int main() {
do {
double mass1, mass2, distance;
cout << "Enter the mass of the first body (in gra... | true |
5c4a2a970bef065df67bfe70176f634481af8360 | C++ | n-donnelly/TDE-GameEngine | /TDE Engine/TDE Engine/TDE_Animation.h | UTF-8 | 1,343 | 2.78125 | 3 | [] | no_license | #ifndef TDE_ANIMATION
#define TDE_ANIMATION
#include "Includes.h"
#include "TextureManager.h"
namespace TDE
{
class TDEGraphics;
class TDE_Animation
{
public:
TDE_Animation(void);
TDE_Animation(std::string name, TDEImage* im, Texture* tex, int cellWidth, int cellHeight, int numCells);
TDE_Animation(std::s... | true |
6eda3b492fea5682b6c186fd2e4f8d37c79e0076 | C++ | chianghonbin/AlphaNet | /include/net/TcpAcceptor.h | UTF-8 | 871 | 2.703125 | 3 | [] | no_license | #ifndef TCP_ACCEPTOR_H__
#define TCP_ACCEPTOR_H__
#include <memory>
#include <functional>
#include <atomic>
#include "net/InternetAddress.h"
#include "net/Socket.h"
#include "net/Channel.h"
namespace Net
{
class TcpStream;
class EventLoop;
class Channel;
class TcpAcceptor
{
using NewConnectionCallback = std::... | true |