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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
aa7765942f3898836c51164b8c9611174b89a0e5 | C++ | EgbertHistorianPokling/redpolice | /Classes/LoseScene.cpp | UTF-8 | 685 | 2.59375 | 3 | [] | no_license | #include"LoseScene.h"
USING_NS_CC;
Scene* LoseScene::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = LoseScene::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
r... | true |
fcb184ff384db52393d5cb6cc49380662e00e7f2 | C++ | TumbleJamie/CardGame | /Dragon.cpp | UTF-8 | 325 | 2.671875 | 3 | [] | no_license | #include "Dragon.h"
Dragon::Dragon() {
}
int Dragon::GetType()
{
return type;
}
string Dragon::GetName()
{
return name;
}
int Dragon::GetHealth()
{
return health;
}
int Dragon::GetAttack()
{
return attack;
}
void Dragon::SetHealth(int enemyAttack)
{
health = health - enemyAttack;... | true |
7c57e6b9166ef9fe84b9ea9b02d3cb1e8e7dbdc8 | C++ | forbidden404/algorithms | /interview/getOdd.cpp | UTF-8 | 260 | 3.25 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int getOdd(vector<int>& arr) {
int answer = 0;
for (auto num : arr) answer ^= num;
return answer;
}
int main() {
vector<int> v{1, 2, 3, 1, 2, 3, 1};
cout << getOdd(v) << endl;
return 0;
} | true |
62c8527067d3c0950435b3675ae838093cd5e8b8 | C++ | Flare-k/Algorithm | /동적프로그래밍/파스칼의삼각형_DP_16395.cpp | UTF-8 | 524 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
// Dynamic programming으로 풀이하기
const int MAX = 31;
int n, k;
int dp[MAX][MAX];
int comb(int n, int k) {
if (n == k || k == 0) return 1;
int result = dp[n][k];
if (result != -1) return result;
result = comb(n - 1, k - 1) + comb(n - 1, k);
... | true |
c58aaa92600207386bbebf85e2cb2a5698be5667 | C++ | pedguifil/Lucity | /src/Monster.cpp | UTF-8 | 562 | 2.515625 | 3 | [] | no_license | #include "Monster.h"
#include "GameData.h"
Monster::Monster(GameObject& associated, Personality p) : NPC(associated, p) {
SetHealth(3);
rawr = false;
GameData::nMonsters++;
GameData::nCivilians--;
}
Monster::~Monster() {
GameData::nMonsters--;
GameData::nCivilians++;
}
void Monster::Update(flo... | true |
39c61b9714136a96cb9cdcdde37a56b663837f04 | C++ | zaifoski/programmazione1 | /argcMax.cc | UTF-8 | 451 | 3.171875 | 3 | [] | no_license | using namespace std;
#include <iostream> //cin, cout
#include <limits.h> //INT_MAX, INT_MIN
#include <stdlib.h> //atoi
int main(int argc,char* argv[]) { //puntatore a lista di puntatori che sono stringhe, arrays di chars
//argc è il numero di inputs, argv li contiene
int max = INT_MIN;
for (int i=0; i<argc; i++){... | true |
aa01617ec2e15b28dd6eb465822e9e6fbd95377d | C++ | ElitsaMilusheva/oop-practicum-2017 | /exercises/10/main.cpp | UTF-8 | 615 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include "person.h"
#include "student.h"
#include "worker.h"
#include "surgeon.h"
#include "vet.h"
int main() {
Person petar("Petar Petrov", 21);
petar.print();
Student ivan("Ivan Dobrev", 22, "Journalism", 6);
ivan.print();
Worker georgi("Georgi Georgiev", 27, 200, 40);
georgi.print(... | true |
9e4a4d31d0e1717b3a2ddd189f31f5d4c6eb6b9c | C++ | Suhendarprogrammer/PROGRAM-VALIDASI-PEMBAGIAN-TIDAK-DENGAN-NOL | /main.cpp | UTF-8 | 629 | 3.109375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a,b,hasil;
cout<<"**********PROGRAM VALIDASI TIDAK DENGAN NOL**********\n";
cout<<"=====================================================\n";
cout<<"\nMasukkan Angka Yang Akan Dibagi : ";
cin>>a;
cout<<"\nMasukkan Angka Pem... | true |
6f62db9acb43e3eea94ef9c91db835e5b7724760 | C++ | Lakshya2610/Ray-Tracer | /Ray-Tracer/Light.h | UTF-8 | 1,154 | 2.859375 | 3 | [] | no_license | #pragma once
#include "Variables.h"
#include <string>
#include "Color.h"
using namespace std;
class Light {
public:
std::string name;
float intensity = 1;
void setIntensity(float _intensity) { intensity = _intensity; }
virtual ~Light() {};
};
class DirectionalLight:public Light {
public:
std::string name = "dire... | true |
78f1926c790126f1f568cd0ce7bbd80c588314b6 | C++ | mayank-bhardwa/CodingLibrary | /DynamicProgramming/Basic/Fibonacci/fibonacci.cpp | UTF-8 | 262 | 2.765625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int fibo(int n){
int d[n+2];
d[0]=0;
d[1]=1;
for(int i=2;i<=n;i++){
d[i]=d[i-1]+d[i-2];
}
return d[n];
}
int main()
{
int n;
cin>>n;
cout<<fibo(n);
return 0;
} | true |
b3ad6003c1b7422a14c8b0fa58c529f207126e49 | C++ | LauZyHou/Algorithm-To-Practice | /AcWing/LeetCode究极班/576.cpp | UTF-8 | 1,186 | 2.53125 | 3 | [
"MIT"
] | permissive | const int MOD = 1e9 + 7;
class Solution {
public:
int findPaths(int n, int m, int N, int x, int y) {
if (!N) return 0;
vector<vector<vector<int>>> f(n, vector<vector<int>>(m, vector<int>(N + 1)));
// 边界
for (int j = 0; j < m; j ++ ) {
f[0][j][1] ++ ;
f[n - 1]... | true |
9b1a7b958f93b7a31ad08c15dfcd7eca6b9d669b | C++ | wkershaw/Dissertation | /CSC3223/DynamicWeather/Draw.cpp | UTF-8 | 2,409 | 2.890625 | 3 | [] | no_license | #include "Draw.h"
RenderObject* Draw::DrawPlane(Vector3 position, Vector2 scale, Vector4 colour) {
OGLMesh* plane = new OGLMesh();
Vector3 bottomLeft = position + Vector3(scale.x / 2, 0, scale.y / 2);
Vector3 bottomRight = position + Vector3(-scale.x / 2, 0, scale.y / 2);
Vector3 topLeft = position + Vector3(scale.... | true |
e49db2bd30e9d6d311a3d42a1941662fbd5327ec | C++ | rkantYahoo/Fourier | /klotsky/kcount.cc | UTF-8 | 2,666 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <ctime>
#include <set>
#include "kcount.h"
using namespace std;
Board::Board() {
for (int a = 0; a < NUM_CELLS; ++a) {
config_[a] = 0;
}
}
const int Board::CarryIndex() const {
int index = NUM_CELLS - 1;
while ((config_[index] == 2) && (index > 0)) {
--index;
}
retu... | true |
8f342d0bed763a199f137826f1ea32f8f926fcd4 | C++ | liaoqidi/timberjack | /PantyHero/Classes/autostring.cpp | WINDOWS-1252 | 4,074 | 2.921875 | 3 | [] | no_license | /**
* Created by pk 2008.01.04
*/
#include "autostring.h"
#ifdef _WIN32
#include "global.h"
#include "windows.h"
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4267)
#endif
autostring::autostring() : std::string()
{
init();
}
autostring::autostring(const autostring& _Right)
: std::string(_Right... | true |
e00046231597d1a3b7384d10e904e1dc49537296 | C++ | SEOMINGEOL/IOCP | /IOCP/IOCPCommon.h | UHC | 1,307 | 2.671875 | 3 | [] | no_license | #pragma once
#ifndef __IOCP_COMMON_H__
#define __IOCP_COMMON_H__
#define MAX_BUF_SIZE 1024
#define SERVER_PORT 3500
#include <iostream>
#include <string>
#include <WinSock2.h>
#include <mutex>
static std::mutex log_mutex;
static std::mutex user_mutex;
enum {
Normal = 0,
Waring,
Error
};
enum {
Win... | true |
2c2af188493babff6d6a65b6181c70d2a3a16b58 | C++ | Ilidur/Stiffy | /Stiffy.ino | UTF-8 | 1,812 | 3 | 3 | [] | no_license | #include <Servo.h>
class ServoData
{
public:
int m_iPortNumber;
int m_iStartOffset;
ServoData(int iPortNumber, int iStartOffset = 90 )
{
m_iPortNumber = iPortNumber;
m_iStartOffset = iStartOffset;
}
};
//Servo 2 [60-160]
//Servo 3 [60-150]
ServoData axServoData[ ] = { {3,180}, {5,110}, {6,... | true |
332c6b50faf0bb9d5cbb99f06378ea2add101a08 | C++ | QuanTrinhCA/SongPreferences | /main.cpp | UTF-8 | 1,470 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <typeinfo>
std::vector <int> getInput(int times)
{
std::string buffer;
std::vector <int> input(times);
std::getline(std::cin, buffer);
for (int i = 0; i < times; i++)
{
if (i < times - 1)
{
int spaceLocation = buffer.find(" ");
input[i] = ... | true |
2669b7c278570cfec9e8f03645915f44b94183e2 | C++ | yurablok/MyPaintSFML | /Brush.cpp | UTF-8 | 865 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "Brush.h"
using namespace Tools;
Brush::Brush()
{
}
Brush::~Brush()
{
}
void Brush::process(Canvas &canvasMain, Canvas &canvasTemp,
const MouseState &mouse, const PaintParameters ¶m)
{
if (!m_leftClicked && mouse.isLeftPressed())
{
if (mouse.isOnCanvas())
{
m_line... | true |
eec5ae570fdc12c39e10590ad8b160568174abdd | C++ | IndecisionGames/RQ-Engine-Archived- | /src/core/Window.cpp | UTF-8 | 646 | 2.6875 | 3 | [
"MIT"
] | permissive |
#include "Window.hpp"
using namespace RQEngine;
Window::Window(const std::string& wName, int wWidth, int wHeight, int maxFPS)
: window(sf::VideoMode(wWidth, wHeight), wName, sf::Style::Titlebar | sf::Style::Close ), EM(&window), fps(maxFPS){}
void Window::Update(){
fps.start();
EM.processEvents();
}
vo... | true |
b615dc442435d4455b1385d191bdc32aee369c6a | C++ | czqInNanjing/LeetCode | /dynamicProgramming/Exer1_DistanceBetweenTwoStrings.cpp | UTF-8 | 5,083 | 3.46875 | 3 | [] | no_license | //
// Created by Qiang Chen on 8/11/17.
//
// 对于序列S和T,它们之间距离定义为:对二者其一进行几次以下的操作(1)删去一个字符;(2)插入一个字符;(3)改变一个字符。每进行一次操作,计数增加1。将S和T变为同一个字符串的最小计数即为它们的距离。给出相应算法。
//
//解法:
//
// 将S和T的长度分别记为len(S)和len(T),并把S和T的距离记为m[len(S)][len(T)],有以下几种情况:
//
//如果末尾字符相同,那么m[len(S)][len(T)]=m[len(S)-1][len(T)-1];
//
//如果末尾字符不同,有以下处理方式
//
// ... | true |
fe3730a2d5149b6b8ebd0ef21ebe0502d4b899e9 | C++ | mb0606/Comp-832 | /Passanger-queue/Lqueue.h | UTF-8 | 633 | 2.71875 | 3 | [] | no_license | //
// Lqueue.h
// queue
//
// Created by mb0606 on 12/15/18.
// Copyright © 2018 mb0606. All rights reserved.
//
#ifndef Lqueue_h
#define Lqueue_h
template <typename E>
struct Node {
E value;
Node* next;
}
template <typename E> class LQueue {
private:
E front; // Index of front element
E rea... | true |
f7405559db4f7c7acfa62249a72b8af934f6083f | C++ | Shadek07/uva | /Solved Category/DP/12024.cpp | UTF-8 | 446 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
long int dp[15];
long fact[15];
void f()
{
int i;
fact[1] = 1;
for(i = 2;i <=12;i++)
{
fact[i] = i*fact[i-1];
}
}
void cal()
{
int i;
dp[1] = 0;
dp[2] = 1;
for(i = 3;i <=12;i++)
{
dp[i] = (i-1)*(dp[i-1] + dp[i-2]);
}
}
int main(voi... | true |
6344d3652a71a32fbe36f677664c3b5859367f39 | C++ | elf0/elf.language | /compiler/Argument.h | UTF-8 | 1,785 | 2.96875 | 3 | [
"Unlicense"
] | permissive | #ifndef ARGUMENT
#define ARGUMENT
//License: Public Domain
//Author: elf
//EMail: elf198012@gmail.com
#include "Variable.h"
namespace elf{namespace ast{
class Argument: public Variable{
public:
Argument()
: Variable(Type::otArgument)
{}
// Argument(Type type)
// : Variable(type)
... | true |
9a0620b6dfef560b09686ac03bb00f10ca8a9dc5 | C++ | kovdan01/programming-techniques-hw | /entry/entry.cpp | UTF-8 | 3,196 | 3.34375 | 3 | [] | no_license | #include "entry.h"
#include <ostream>
#include <sstream>
#include <stdexcept>
#include <tuple>
bool operator==(const Entry& lhs, const Entry& rhs)
{
return std::tie(lhs.m_club, lhs.m_year, lhs.m_country, lhs.m_score) ==
std::tie(rhs.m_club, rhs.m_year, rhs.m_country, rhs.m_score);
}
bool operator!=(con... | true |
39848e372d0163076619783c004aec63a0e3f5a1 | C++ | KapitoshkaThe1st/MAI | /DA/lab6/source/main.cpp | UTF-8 | 9,427 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <limits>
#include <cmath>
#include <cassert>
#include <iomanip>
typedef long long digit_type;
const int base = 100000000;
const int baseLen = (int)(log(base) / log(10));
class TBigInt{
public:
TBigInt() : digits(std::vector<digit_type>(1,0)) {}
... | true |
725286b56a1f75a5bd65d99b3e82fee05a42b090 | C++ | shiro-saber/Analisis_Dise-o_Algoritmos | /Problema_Práctico1/ArbolB/ArbolB/helpers.cpp | UTF-8 | 520 | 2.875 | 3 | [] | no_license | //
// helpers.cpp
// Ejercicio2
//
// Created by SeijiJulianPerezSchimidzu on 09/09/15.
// Copyright (c) 2015 ITESM CSF. All rights reserved.
//
#include "types.h"
template <typename T>
T* newArray(int size, int start, int end, T* arr)
{
T* newArr = new T[size];
int i = 0;
T returnValue = return_type();
... | true |
26d5792bf8f15d8274692e57c3bb3e3358d84c66 | C++ | ZhaoRui321/00_work | /001_qt_prj/OMS/tool/sthread.h | UTF-8 | 1,082 | 2.53125 | 3 | [] | no_license | #ifndef STHREAD_H
#define STHREAD_H
//#include "sglobal.h"
#include <QThread>
/**
* @brief
*
*/
typedef int (*SThreadFunc)(void* pParam, const bool& bRunning);
/**
* @brief
*
*/
class SThread : public QThread
{
Q_OBJECT
public:
/**
* @brief
*
* @param parent
*/
... | true |
1fd2052264773c4ccb13df77a8d1bc26fdb10fa4 | C++ | sberoch/MicromachinesTaller | /src/Server/Network/AcceptingThread.h | UTF-8 | 977 | 2.59375 | 3 | [] | no_license | //
// Created by alvaro on 30/9/19.
//
#ifndef HONEYPOT_SERVERACCEPTINGTHREAD_H
#define HONEYPOT_SERVERACCEPTINGTHREAD_H
#include <iostream>
#include "../../Common/Thread.h"
#include "../../Common/Socket.h"
#include "ThClient.h"
#include "Room.h"
#include "RoomController.h"
#include <list>
#include <mutex>
#include ... | true |
f99bad46a52805a43edb0b99fb2ce16915f57cad | C++ | kuffie/robotics-git | /_3linesensmottest_b/_3linesensmottest_b.ino | UTF-8 | 2,885 | 3.40625 | 3 | [] | no_license | /*
Analog input, analog output, serial output
Reads an analog input pin, maps the result to a range from 0 to 255
and uses the result to set the pulsewidth modulation (PWM) of an output pin.
Also prints the results to the serial monitor.
The circuit:
* potentiometer connected to analog pin 0.
Center pin of ... | true |
0bb7443213d5952d91e065856e064ffa0bb48465 | C++ | linan1109/C0-compiler | /symbletable/symbletable.h | UTF-8 | 5,329 | 2.78125 | 3 | [] | no_license | #pragma once
#include <vector>
#include <optional>
#include <utility>
#include <cstdint>
#include <algorithm>
#include <instruction/instruction.h>
namespace miniplc0 {
class one_symbol final{
std::string _name; //标识符名称
int32_t _kind; /*种类
0... | true |
90aae894ff55f14bc5dcc7f292f2465274e3a5df | C++ | spartakang/MIO_PID_Controller | /atof/atof_visual2005/atof_visual2005/atof_visual2005.cpp | GB18030 | 1,808 | 2.96875 | 3 | [] | no_license | // atof_visual2005.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <string>
// -------------------------------------------------------------------------
// : StrToFloatA
// : һַתΪ
// ֵ : float
// : char* pstrfloat
// ע :
// -... | true |
bd2959580340485ef925140c9a7eba1fcc7d8dda | C++ | Soth1985/Thor2 | /applications/MetalTracer/RayTracer.h | UTF-8 | 6,409 | 2.578125 | 3 | [] | no_license | #pragma once
#include "Scene.h"
#include <Thor/Core/Concurrent/ThDispatch.h>
#include <atomic>
#include <random>
#include <chrono>
#include <functional>
namespace Thor
{
template<class T>
T UniformDistribution(T min, T max)
{
static /*thread_local*/ std::mt19937 generator(std::chrono::system_clock... | true |
b5bf514dcda5ad8b61415767b57812e6f6606b15 | C++ | bigplik/Arduino_mac | /Variometer/BMP280/AVR/uno_Vario/uno_Vario.ino | UTF-8 | 2,736 | 2.53125 | 3 | [] | no_license | // All code by Rolf R Bakke, Oct 2012
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
#define BMP_SCK 13
#define BMP_MISO 12
#define BMP_MOSI 11
#define BMP_CS 10
const byte led = 13;
unsigned int calibrationData[7];
unsigned long time = 0;
float toneFreq, toneFreqLow... | true |
b315ccefee1d965fbff8ff7d6f354187cba7a98c | C++ | CharlesSaya/rayTracingEngine-Cpp | /src/3D/implicitSurface.cpp | ISO-8859-1 | 3,092 | 2.875 | 3 | [] | no_license | #include "implicitSurface.hpp"
namespace ISICG_ISIR
{
/*
* Constructeur de classe
*/
ImplicitSurface::ImplicitSurface(const Vec3f ¢er,
const float reflectionAmount,
const float refractionAmount,
const float refractionIdx,
const float rugosity, const Vec3f &f0)
{
_... | true |
180e2ae72fe674fbb11e1b6476f981ef22fa895a | C++ | JESU20950/A | /Teoria/Data_structures/Stacks/X96935.cc | UTF-8 | 501 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <stack>
using namespace std;
bool palindrom(){
stack <int> s;
int n;
int nombre;
cin >> n;
for (int i = 0; i<n/2; ++i){
cin >> nombre;
s.push(nombre);
}
if (n%2 != 0) cin >> nombre;
for (int i = 0; i<n/2; ++i){
cin >> nombre;
... | true |
931afbbafb5a89d0653a7883e7e62977e2f3658c | C++ | SunriseFox/very-simple-cipher-lab | /exercise2/des.cpp | UTF-8 | 4,604 | 2.9375 | 3 | [
"MIT"
] | permissive | #include "des.h"
void DES::_updateKey(const bit64 &key)
{
// 私有方法:更新密钥,生成子密钥
this->key = key;
DEBUG(cout << "K: " << key << endl;)
_generateSubkey();
}
void DES::_generateSubkey()
{
// 私有方法:生成子密钥
// 从 64 位密钥最终得到 16 个 48 位子密钥。
// 1. 对输入密钥应用 PC-1<64, 56> 压缩置换表,生成 56 位密钥
... | true |
5bfcff71cfa3d6c180a140805d56d45102944cfa | C++ | ivanpjr/myLab | /c++/Person/main.cpp | UTF-8 | 619 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include "Person.hxx"
#include "Dog.hxx"
Person makeTwin(Person p){
p.toString();
return p;
}
int main() {
Dog d1;
d1.setName("Pink");
d1.setAge(4);
cout << d1.toString();
d1.bark();
Person p1{"A",1, d1};
p1.setName("Ivan");
p1.setAge(40);
cout << p1.t... | true |
f867e7b8cca3d563d48633c7e9f9590d5702d459 | C++ | andrewrk/motrs | /src/ConfigManager.h | UTF-8 | 978 | 2.984375 | 3 | [] | no_license | #ifndef CONFIGMANAGER_H
#define CONFIGMANAGER_H
#include <map>
#include <string>
// ConfigManager brings together arguments and config files
class ConfigManager
{
public:
ConfigManager();
// adding configuration - the most recent thing you add will overwrite if
// there is a name conflict.
// reads ... | true |
f15c778f431f10be3ec91d15e2614d7bce67f872 | C++ | jvff/mestrado-implementacao | /src/test/cpp/FakeImageMockProxy.hpp | UTF-8 | 1,230 | 2.859375 | 3 | [] | no_license | #ifndef FAKE_IMAGE_MOCK_PROXY_HPP
#define FAKE_IMAGE_MOCK_PROXY_HPP
#include <memory>
#include "fakeit.hpp"
#include "FakeImage.hpp"
using namespace fakeit;
template <typename PixelType>
class FakeImageMockProxy {
private:
using FakeImageType = FakeImage<PixelType>;
std::unique_ptr<Mock<FakeImageType> > m... | true |
6b881ee30b8f20d5ad38ef7f163b71b88c0ceaa6 | C++ | Yukarinn/cc3k | /player.cc | UTF-8 | 4,900 | 2.984375 | 3 | [] | no_license | #include "player.h"
#include "treasure.h"
#include "potion.h"
#include "cell.h"
#include "enemy.h"
#include "merchant.h"
#include <algorithm>
#include <iostream>
using namespace std;
Player::Player(string name, int hp, int atk, int def, int maxHp, int baseAtk, int baseDef):
Character(name, '@', hp, atk, def, ObjectTy... | true |
7a6c2275bdc65747abc45eb472cf790ab1629187 | C++ | dubhunter/ArduinoSketches | /hackpack-tictactoe/hackpack-tictactoe.ino | UTF-8 | 5,231 | 2.734375 | 3 | [] | no_license | #include <Metro.h>
#include <Adafruit_NeoPixel.h>
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include "RGB.h"
#define PIN_MATRIX 1
#define PIN_CLOUD A1
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, PIN_MATRIX,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE,
NEO_G... | true |
da53241178d1715537dd82de87e3620af436326d | C++ | fusion-research/SensorNetworkSimulator | /dataskewing/GridSquare.cpp | UTF-8 | 2,349 | 2.734375 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////
// GridSquare.cpp
// Implementation file for GridSquare class
////////////////////////////////////////////////////////////////////////////////
// Includes ////////////////////////////////////////////////////////////////////
#inc... | true |
cee43b33a2cad374f554ee93b70d030dd1b7ea1a | C++ | cvu16/Adopet | /team1_1/GUI/zip.cpp | UTF-8 | 2,930 | 2.578125 | 3 | [] | no_license | #include "zip.h"
#include "ui_zip.h"
/*!
* \brief Zip constructor sets up connection between system and api
* \param parent
*/
Zip::Zip(QWidget *parent) :
QWidget(parent),
ui(new Ui::Zip)
{
ui->setupUi(this);
manager = new QNetworkAccessManager();
QString os = QSysInfo::productVersion();
... | true |
74a21af08091644db4a71c1d1b398e9121b02b51 | C++ | headec/C-Practice | /stack.cpp | UTF-8 | 1,953 | 3.78125 | 4 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
class Stack
{
private:
int top;
int arr[5];
public:
Stack()
{
top = -1;
for(int i = 0; i<5; i++)
{
arr[i]=0;
}
}
bool isEmpty()
{
... | true |
a640f663fcd4108c0211a3043ae5d605f597b28d | C++ | jayramsidh/julylongchallenge | /tomnandjerry.cpp | UTF-8 | 505 | 2.609375 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int main ()
{
int tc;
cin>>tc;
while(tc--)
{
long long int ts,k=1;
cin>>ts;
if(ts%2==1)
{
ts=ts/2;
}
else
{
k=0;
}
while(k... | true |
e417a3119d06c5e53145aefc29cb04f6adcaed36 | C++ | ahmed-dardery/Programming-I | /Assignment 2/Ciphers/Cipher 3.cpp | UTF-8 | 2,453 | 3.4375 | 3 | [] | no_license | /* FCI – Programming 1 – 2018 - Assignment 2
Program Name: Cipher 3.cpp
Last Modification Date: 28/02/2018
Ashraf Samir Ali (AshrafSamir): G2 - 20170053
Purpose: This is a program that implements cipher #3: ROT13 Cipher.
Algorithm >> take input as letter from user check
if (userLetter[i]<78 and userLetter[i]>=6... | true |
0ddcfa3135de5c02cb0cc32a4e5925f0079ad9d9 | C++ | myungoh/DS_Project_2_2021_2 | /VaccinationData.h | UTF-8 | 1,150 | 2.828125 | 3 | [] | no_license | #pragma once
using namespace std;
#include <iostream>
#include <cstring>
#include <fstream>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <functional>
#include <iomanip>
class VaccinationData {
private:
string User... | true |
42c360e3e6bf2af0bcaa4540f14a725962f13841 | C++ | ZwodahS/z_curses | /f_curses.cpp | UTF-8 | 2,486 | 2.84375 | 3 | [] | no_license | #include "f_curses.hpp"
namespace zc
{
void drawBox(WINDOW* window, const WindowRegion& region)
{
// draw the corners
mvwaddch(window, region.y, region.x, ACS_ULCORNER); // upper left corner.
mvwaddch(window, region.y, region.x + region.width - 1, ACS_URCORNER); // upper right corner.
... | true |
d83c4deb8cedb9682248f3fbe33d80ceaf899f92 | C++ | chiha8888/Code | /uva11995 - I Can Guess the Data Structure!.cpp | UTF-8 | 1,112 | 2.875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int n;
vector<int> input;
vector<int> output;
bool cmp(const int &a,const int &b){
return a>b;
}
int main(){
int t,x;
while(cin>>n){
input.clear();
output.clear();
vector<string> ans;
for(int i=0;i<n;i++){
cin>>t>>x;
if(t==1){
input.push_back(x);
}
... | true |
c6812e2e546584618b145a3a41be5b7e9fb7a4a5 | C++ | hahaite/EulerProject | /069/main.cpp | UTF-8 | 891 | 2.671875 | 3 | [] | no_license | #include <cstdio>
#include <sys/time.h>
#include "../mymath/mymath.h"
using namespace std ;
int main()
{
timeval tFirst ;
timeval tSecond ;
timeval tWorking ;
gettimeofday(&tFirst, NULL) ;
/////////////////////////////////////////////////////////////////////
CDivisor divisor ;
int eulerPhi ;
int max = 0 ;
... | true |
7c46bf037d1f8a562c7808f96a55a9a7d61fe58e | C++ | EmilioIb/Juego_Vaqueros | /Clases_EmilioIbarra.cpp | ISO-8859-1 | 5,833 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
//Clase pistola
class Pistola{
private:
int vida, balas;
public:
Pistola();
void setPistola(int, int);
int getBalas();
int getVida();
};
//Variables
Pistola jugador, maquina;
int dificultad, accion, opc, enemigo;
//Constructor
Pi... | true |
3e44294477d5e99bd1796742d891e75a6eb6ffbe | C++ | AlexeyOgurtsov/GStar | /Source/Core/Str/IdentStr.h | UTF-8 | 4,576 | 3.28125 | 3 | [] | no_license | #pragma once
#include "Core/CoreSysMinimal.h"
#include <cstdlib>
#include <boost/serialization/array.hpp>
/**
* TO-BE-CHECKED-COMPILED.
* TO-BE-TESTED.
*
* TODO:
* 1. Provide the storage class for storing IdentStr instances and the default instance of it.
*/
/**
* Identifier string.
* Immutable ANSI string.
*
* W... | true |
dc3255b0475cf75b7b54cb15c6b0b4cc13ce956e | C++ | tttapa/random | /Zynq-AMP/SharedMem.hpp | UTF-8 | 4,360 | 2.921875 | 3 | [] | no_license | #pragma once
#include <ANSIColors.hpp>
#include <iomanip>
#include <iostream>
#include <cassert>
#include <cerrno>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
const size_t PAGE_SIZE = getpagesize();
const uintpt... | true |
7f9d70e80ae3b542a193e1e02f6032f69b6d4a38 | C++ | unegare/crypto | /dummy_hash_miner/include/Message.h | UTF-8 | 1,718 | 3.03125 | 3 | [] | no_license | #pragma once
#include <thread>
#include <array>
#include <string>
class Message {
public:
enum class MessageType {
randomInitValueSet,
newSolution
};
protected:
MessageType _type;
std::thread::id _thread_id;
int64_t _timestamp;
public:
Message() = delete;
Message(MessageType, int64_t timestamp, ... | true |
4fc3163c8e3ac98c15883f80c2fca3c506688d22 | C++ | enjoyars/libec | /src/test/test-ec.cpp | UTF-8 | 3,553 | 2.640625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include <string>
#include "ec.h"
int main(int argc, char **argv)
{
if (argc != 3)
{
printf("Name: rf21x-test \n");
printf("Usage: rf21x-test DeviceType PortPath \n");
printf(" Usage Example: rf21x-test rf217 hid:// \n");
printf(" Usage... | true |
1bfe24084ca17ca1bcc15dc6b38fd1a79ec936c2 | C++ | DDavis01/ECE2036 | /Lab1/Lab1Part2.cc | UTF-8 | 2,292 | 3.515625 | 4 | [] | no_license | /*
Author: Donald Andrew Davis
Date last modified: 1/27/2019
Organization: ECE2036 Class
Description: ECE 2036 Lab 1 Part 2: Round Off Error
*/
#include <iostream>
#include <cmath>
using namespace std;
double doubleQuadraticFunction(int sign, double a,double b,double c){ // Double implement... | true |
e79000180dbdc84746719859aee83472e675a99e | C++ | kanumadai/Cplusplus | /ACQCenter v4.1.0N32R/SIO.h | GB18030 | 6,627 | 2.71875 | 3 | [] | no_license | #ifndef __sio_h__
#define __sio_h__
class CSIO;
//״̬
typedef enum _alarm_stat
{
normal=0,
alarm=1
}ALARM;
typedef union _alarm_code
{
BYTE code8;
struct{
BYTE bAlarm_T:1; //¶ȱ
BYTE bAlarm_V:1; //ѹ
BYTE bAlarm_I:1; //
BYTE bAlarm_Move:1; //˶
BYTE bAlarm_Moto:1; //
BYTE Reserve... | true |
8c90425ecd6ff6c505232baba8d1d26c05d9bdfb | C++ | MayurHadole/Burglar-Alarm | /BurglarAlarmProject.ino | UTF-8 | 48,521 | 3.1875 | 3 | [] | no_license | /* FILE : BurglarAlarmProject.ino
* PROJECT : PROG8125-16S - Project
* PROGRAMMER : Mayur Hadole (5783)
* FIRST VERSION : 2016-07-31
* DESCRIPTION :
* Project Statement (No. 2)
* Burglar alarm that monitors 5 zones. Zones are monitored by a loop of wire.
* Circuitry is neede... | true |
a5b4e654d840317eef28907ae1306d229d02e9b0 | C++ | davidho95/monopoleSphaleronSolver | /include/Su2Tools.hpp | UTF-8 | 3,498 | 2.96875 | 3 | [] | no_license | #ifndef SU2TOOLS_HPP
#define SU2TOOLS_HPP
#include "Matrix.hpp"
namespace monsta
{
const monsta::Matrix identity({1, 0, 0, 1});
const monsta::Matrix pauli1({0, 1, 1, 0});
const monsta::Matrix pauli2({0, -1i, 1i, 0});
const monsta::Matrix pauli3({1, 0, 0, -1});
const double pi = 4*atan(1);
int sign(doubl... | true |
6129a9cb409934d3f13dcbb15010c9fa5a569629 | C++ | doerodney/uw-cpp-cert | /intro/assgt05/CharQueue1.h | UTF-8 | 533 | 2.84375 | 3 | [] | no_license | #ifndef INC_CHARQUEUE1_H
#define INC_CHARQUEUE1_H
#include <cstddef>
#include <memory>
class CharQueue1 {
public:
CharQueue1();
CharQueue1(std::size_t size);
CharQueue1(const CharQueue1& src); // copy constructor
void enqueue(char ch);
char dequeue();
bool isEmpty() const;
void swap(Char... | true |
0c1b284d79f1b71e491a6999ab05b4620f7b259e | C++ | zecookiez/LeetCoder | /Medium/0008_stringToIntegerAtoi.cpp | UTF-8 | 1,890 | 3.640625 | 4 | [] | no_license | /*
* https://leetcode.com/problems/string-to-integer-atoi/
*
* Implement atoi which converts a string to an integer.
*
* The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or m... | true |
9609a67fdcb76d82dcfe9929cb1e4b6d75c57eee | C++ | jkolek/hashmap | /test3.cpp | UTF-8 | 2,259 | 3.546875 | 4 | [] | no_license | #include <mutex>
#include <thread>
#include <iostream>
#include <cassert>
#include "hashmap.h"
constexpr unsigned MAX_TABLE_SIZE = 100;
static constexpr unsigned HASH_CONST = 17; /* A prime number */
class IntHash
{
public:
unsigned operator()(int key)
{
return (key * key + HASH_CONST) % MAX_TABLE_S... | true |
06d8951921a50a397458e43b0df159a6295b3e28 | C++ | soar1234/LeetCodeAlgorithms | /LeetCode/27-Remove Element.cpp | UTF-8 | 706 | 3.375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int removeElement(int* nums, int numsSize, int val) {
int i=0,j=0;
int flag=numsSize;
int temp;
for(i=0;i<numsSize;i++)
{
for(j=i+1;j<numsSize;j++)
{
if(nums[i]==val)
{
temp=nums[i];
nums[i]=nums[j];
... | true |
c1ee6d4f4f22f213d1f4ed7a29b4eef79c0188d7 | C++ | MarksZero/estructura-de-datos-y-algoritmos | /clase-2-estr-control-y-arreglos/clase2-ejercicio5.cpp | UTF-8 | 411 | 3.5 | 4 | [] | no_license | #include <stdio.h>
int main(){
int numero;
printf("Ingrese un número para buscar sus divisores.\n");
scanf("%d", &numero);
printf("Los divisores de %d son: 1", numero);
if(numero > 1){
for(int i = 2 ; i < numero ; i++){
if(numero%i == 0){
printf(", %d", i);... | true |
717fafd20cf87949b75a5f97385a73138c12855e | C++ | dsnow75/ds2454010 | /Hmwk/HW 1/Savitch_8thEd_Ch1_prob8/main.cpp | UTF-8 | 715 | 3.484375 | 3 | [] | no_license |
/*
* File: main.cpp
* Author: David Snow
*
* Created on June 25, 2014, 1:18 PM
*/
//system libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here
int main(int argc, char** argv) {
//Variables
int quar, dime, nick; //quar are the... | true |
f6aaca6d4ba477acc066c547c019bc95df9e1fe4 | C++ | thomasloockx/Master-Thesis-Ray-Tracer | /character_animation/cluster.cpp | UTF-8 | 668 | 2.578125 | 3 | [] | no_license | #include <cluster.h>
rt::Cluster::Cluster(int boneId)
: boneId_(boneId)
{
}
void rt::Cluster::addTriangle(const Triangle& triangle)
{
triangles_.push_back(triangle);
boundingBox_ += triangle.boundingBox();
}
void rt::Cluster::addFuzzyBox(const BoundingBox& fuzzyBox)
{
fuzzyBoxes_.push_back(fuzzyBox);
fuzzyBox_ +... | true |
c7f143b34f9ee2f2b2749e0044ae820b17982dba | C++ | xwang345/OOP345 | /ms4/OrderManager.h | UTF-8 | 577 | 2.625 | 3 | [] | no_license | /////////////////////////////////////////////
// OOP345 milestone 3:
// Name: Sanghun Kim
// Date: 20/11/2106
// email: ksanghun@myseneca.ca
/////////////////////////////////////////////
#pragma once
// Manager Milestone - OrderManager Interface
// OrderManager.h
// Chris Szalwinski
// v1.0 - 14/11/2015
// v2.0 - 23/... | true |
c4ac5850be878ddccb3aec912cf3373582e46e49 | C++ | EdwinJosue16/parallel-KMeans-OMP | /Main.cpp | UTF-8 | 4,307 | 2.578125 | 3 | [] | no_license | #pragma warning( disable : 4290 )
#pragma warning( disable : 4290 )
#pragma warning( disable : 5040 )
#include "KMeansP.h"
#include "Elemento.h"
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <exception>
#include <iostream>
#include <omp.h>
using namespace std;
// /Zc:tw... | true |
66b70d895c950ac6ea4d02bf639758460e7dce77 | C++ | ThreeMonkey/LeetCode | /First Missing Positive.cpp | GB18030 | 1,237 | 3.84375 | 4 | [] | no_license | /*
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
A[i]ϣܱڵiλϣӵҵA[i] != iʱǾҵҪ.
DZʱǷA[i] != iôǾswap(A[A[i]], A[i])A[i]ȷλϡ
ڽ֮A[i]ǼֱûΪֹûʾǰ鳤ȣA[A[i]]
飬ѰҵһϴҪԪأ±ꡣ
Ҫ飬ӶΪO(n)
... | true |
5e8c7bff9fed26a5076759abde3c377b2263685d | C++ | FTurci/montecarlos | /StandardMC/cell.h | UTF-8 | 299 | 2.640625 | 3 | [] | no_license | #ifndef __CELL_H__
#define __CELL_H__
#include "particle.h"
class Particle;
class Cell {
public:
Particle *firstParticle;
Cell *neighbours[26]; // neighbouring cells
Cell(void){
firstParticle = 0;
for (int i=0; i<26; i++){
neighbours[i] = 0;
}
}
};
#endif | true |
fd4f5f5addd6bafa85717c66dac020b163f59cc9 | C++ | adamjorr/meep | /plpdata.cc | UTF-8 | 1,901 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "plpdata.h"
#include <iostream>
#include <vector>
Pileupdata::Pileupdata(std::string filename, std::string refname, std::string region) : plp(filename, refname, region), data() {
populate_data();
}
Pileupdata::Pileupdata(std::string filename, std::string refname) : plp(filename, refname), data() {
populate... | true |
742eaf8a633221c8a29f0014a3b59f9ea6bde285 | C++ | mathiasVoelcker/cpp-course | /charTut.cpp | UTF-8 | 297 | 3.140625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
char text[] = "hello";
cout << text << endl;
char *pChar = text;
cout << *pChar << endl;
while (*pChar != 0)
{
cout << pChar << endl;
cout << *pChar << endl;
pChar++;
}
return 0;
} | true |
383fbe219271fa77b5af93c64d16c7b3b958e007 | C++ | abhishekabhay910/CPP | /lab2.cpp | UTF-8 | 687 | 3.390625 | 3 | [] | no_license | #include<iostream>
using namespace std;
class arr{
char name[10],dept[10],post[10],add[20];
int empid;
public:
void insert();
void display();
};arr a[3];
void arr::insert()
{
cout<<"\nempid-";cin>>empid;
cout<<"\nname-";cin>>name;
cout<<"\ndepartment-";cin>>dept;
cout<<"\npost-";cin>>post;
cout<<"\naddress-"... | true |
20343b8c3cc9eb493e1033f03edf1ad7325b18c9 | C++ | Shivanshu10/Coding-Practice | /General Ques/Ques47/dupsorted.cpp | UTF-8 | 512 | 3.265625 | 3 | [] | no_license | #include <iostream>
using namespace std;
void dupsorted(int a[], int size)
{
int count=0;
for (int i=0; i<size; i++)
{
if (a[i] == a[i+1])
{
if (count == 0)
{
cout << a[i] << " ";
}
count++;
}
else i... | true |
001f3719c735b03cab71e4cbdcd8c1a4ae4c2344 | C++ | ayan2809/DSA | /Submission 3/q1.cpp | UTF-8 | 375 | 3.296875 | 3 | [] | no_license | #include<stdio.h>
int sum(int x,int y,int s)
{ //printf("%d\n",y);
if (y==x)
return s;
else
y=y+1;
return s+200+sum(x,y,s);
}
int main()
{
int l,w;
printf("Enter the length of the room :");
scanf("%d",&l);
printf("\nEnter the width of the room :");
scanf("%d",&w);
int p=l*w;
printf("The total cost for... | true |
d6d220782c80b67062e9d776d24432db5cf6256e | C++ | maxwellcopper/EDP-IntermediateSession-TrainingDelameta | /STM32/challange_ultrasonik_n_flame_bang_yuda/challange_ultrasonik_n_flame_bang_yuda.ino | UTF-8 | 2,013 | 2.546875 | 3 | [] | no_license | #include <NewPing.h>
// inisialisasi
int pinLedR = PB10;
int pinLedY = PB1;
int pinLedG = PB0;
int pinPIR = PB3;
int pinFlame = PB11;
int pinTrigger = PA5;
int pinEcho = PA7;
int prevFlame = 0;
int prevPIR = 0;
int toggle = true;
// ultrasonik
int MAX_DISTANCE = 500;
NewPing us(pinTrigger, pinEcho);... | true |
0264273f063d963bf5a4956e3abeff40a20fd012 | C++ | xinnjie/extract-subtitle | /PicClean.cpp | UTF-8 | 4,213 | 2.65625 | 3 | [
"MIT"
] | permissive | //
// Created by capitalg on 4/11/18.
//
#include <opencv2/imgproc.hpp>
#include "PicClean.h"
#include <iostream>
using namespace cv;
cv::Mat PicClean::keep_white(const cv::Mat &colored_src) {
Mat gray;
cv::cvtColor(colored_src, gray, cv::COLOR_RGB2GRAY);
Mat thres;
threshold(gray, thres, 215,255,cv:... | true |
73765b7acd06cca6af7949c48a6e324227539067 | C++ | birneysky/data_structure_play_ground | /c++/solutions/src/Solution.hpp | UTF-8 | 21,544 | 3.875 | 4 | [] | no_license | #ifndef SOLUTION_H
#define SOLUTION_H
#include <vector>
#include <sstream>
#include <string>
#include <iostream>
#include <cassert>
class Solution{
private:
/**
对一个数组的[left,right]区间内的元素做快速排序的 partitionn 操作
@param vector<int>nums 数组
@param left 左索引值
@param right 右索引值
@return 返回标定点的索引
... | true |
0fe2884edbb01109a802becb5545d2185bd61e1a | C++ | luisMbedder/flesch-kincaid | /Flesch-Kincaid/FleschKincaid.cpp | UTF-8 | 2,844 | 3.296875 | 3 | [] | no_license | /*
* File: FleschKincaid.cpp
* ----------------------
* Name: [TODO: enter name here]
* Section: [TODO: enter section leader here]
* This file is the starter project for the Flesch-Kincaid problem.
* [TODO: rewrite the documentation]
*/
#include <iostream>
#include <iterator>
#include <regex>
#include <fstream>... | true |
2c7c8733888e3a4e7be0cd19ed73a7afe8c8d28f | C++ | neerajarun2001/exercises | /learn-cpp/ch03/quiz/q1.cpp | UTF-8 | 538 | 3.5 | 4 | [] | no_license | // buggy code, fix it
// 1. find root cause
// 2. understand problem
// 3. propose fix
// 4. implement fix
// 5. retest
#include <iostream>
int readNumber(int x)
{
std::cout << "Please enter a number: ";
std::cin >> x;
return x;
}
void writeAnswer(int x)
{
std::cout << "The sum is:" << x << '\n';
}
// general... | true |
76e97a8d913fdbd879733365c45404c88bac0dc0 | C++ | wengsht/oh_my_life2 | /include/RecordPocket.h | UTF-8 | 960 | 2.65625 | 3 | [] | no_license | #ifndef __RECORD_POCKET_H__
#define __RECORD_POCKET_H__
#include "Record.h"
#include <vector>
#include <ctime>
using namespace std;
class RecordPocket {
public:
RecordPocket(int year, int mon, int day, int day_interval);
void resetDate(int year, int mon, int day, int day_interval);
... | true |
8794d7775889e74538fcf08666a76f757644a545 | C++ | VadimK128/LABA-1 | /lab1.cpp | UTF-8 | 2,791 | 3.109375 | 3 | [] | no_license | #include <iostream>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
using namespace std;
int main()
{
int a, b, c;
a = 1;
b = 13;
c = 49;
cout << a << " " << b << " " << c << "\n"; //1
char s;
cout << "Enter your char:";
cin >> s;
cout << a << s << b << s << c << s << "... | true |
cea59b1ec827f131b6cb98d1e1a5699fc1825ff4 | C++ | zhangbiran/engine | /engine/engine/NetWork/UDP/udp_client.h | GB18030 | 1,641 | 2.78125 | 3 | [] | no_license | #ifndef __UDP_CLIENT_H
#define __UDP_CLIENT_H
#include "test.h"
#include <windows.h>
#include <iostream>
using namespace std;
#pragma comment(lib, "ws2_32.lib")
/*
udpsocketҲǿʹconnectģԼ߷Чʣֻܺһserverͨ
*/
class UDP_client : public CTest
{
public:
void test(int argc, char ** argv)
{
WSAData data = { 0 };
WSAStar... | true |
b0114a089e54697ca4e2f1a45275f28824ddc031 | C++ | JoshuaTPierce/Learning_Repo1 | /Lafore_OOCPP/Streams and DiskIO Programs/overloadedIoOperators.CPP | UTF-8 | 1,854 | 4.15625 | 4 | [] | no_license | //Demonstrates Overloaded Extraction and Insertion Operators
//This is a powerful feature of C++. It lets you treat I/O for user-defined data types in the
//same way as basic types like int and double. For example, if you have an object of class
//crawdad called cd1, you can display it with the statement
//cout << “\n... | true |
1f308c559ba9d881b99b716ee74690f1497f0fab | C++ | AbhijeetKrishnan/codebook | /CodeChef/FEB16/STROPR.cpp | UTF-8 | 1,293 | 2.984375 | 3 | [
"CC0-1.0"
] | permissive | #include <cstdio>
#include <vector>
using namespace std;
typedef long long int lli;
const int M = 1e9 + 7;
int gcdExtended(int, int, int*, int*);
int modinv(int a, int m)
{
int x, y;
int g = gcdExtended(a, m, &x, &y);
int res = (x%m + m) % m;
return res;
}
// C function for extended Euclidean Algor... | true |
2f79f713c6957f67dcbfca6007b9b58d775350ba | C++ | Woffee/acm | /CPP/2013-2015/HDOJ/邂逅明下(巴士博弈).cpp | GB18030 | 1,239 | 3.09375 | 3 | [] | no_license | /*
ʿ
http://acm.hdu.edu.cn/showproblem.php?pid=2897
⣺Ӳҵĸÿȡȡpȡqȡ˾
˵DzģDZ˿ͻûģ֪Ǿͬ
ⷨҪжʣµӲҵĸˣǷбʤIJԣԵֵAʣµӲ0<=K<=pAʤ
Bʤ
ó
N = (p+q)*r+k
AʤһAȡTԺÿBȡXAȡ(p+q-x)ʣµֻҪq<K<=pAʤ
BʤȡǼAÿȡx,Bÿȡ(p+q-x)ʣµֻҪ0<K<=pBʤ
2014.9.1
*/
#include <algorithm> //sort()
#include <iostream>
#include <iomanip> //
... | true |
d7c8632ce81dbc074954a127081e2c87b1267639 | C++ | SiravitPhokeed/machine-learning-01 | /MLP.h | UTF-8 | 6,461 | 2.84375 | 3 | [] | no_license | #ifndef MLP_H
#define MLP_H
#include <math.h>
#include <vector>
#include <time.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#define LearningRate 0.1
using namespace std;
class MLPCell {
double delta;
double bias;
double sigmoid(double x) { return 1/(1 + exp(-x)); }
... | true |
d4d785143e16ef4028a6c40e0f68ca63349a178d | C++ | pauldoucet/AF1-glow | /left_arduino/left_arduino.ino | UTF-8 | 670 | 2.71875 | 3 | [] | no_license | #include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CNS, CE
uint8_t address_right[6] = "00001"; // address of right NRF24
/**
* Setup the NRF24 radio module by
* initializing power amplifier level, opening reading pipe
* and starting listening
*/
void setup_NRF24() {
rad... | true |
20952e644bb9012fcb5a8322c918ee781d6b2560 | C++ | canokulmus/CENG_METU | /Ceng113/C++ Ex./Template_Function/deleteval.cpp | UTF-8 | 795 | 3.984375 | 4 | [] | no_license | #include <iostream>
// Write a C++ template function to solve the following problem:
// delete a value val from an unsorted array A[0..n-1]. Assume all values
// in A are distinct.
// Use the following function header:
template<class C>
void delete_val(C A[], int &n, C val);
// n is the number of elements in the ar... | true |
5ebd13ad538b9b7784ca65ccf951ea49ddacc565 | C++ | wsq-siquan/CS32-UCLA-2017summer | /project1/main.cpp | UTF-8 | 1,901 | 2.5625 | 3 | [] | no_license | //
//
//#include <cstdlib>
//#include <ctime>
////#include "Game.h"
//
//
/////////////////////////////////////////////////////////////////////////////
//// main()
/////////////////////////////////////////////////////////////////////////////
//
//
//
//int main()
//{
// //doBasicTests();
// // Initialize the r... | true |
1c3e7b88dc82a511851b348d97962aa735abfa14 | C++ | duydung271/PiratesBomb | /PriateBomb/Sources/GameObject/Cloud.cpp | UTF-8 | 621 | 2.703125 | 3 | [] | no_license | #include "Cloud.h"
void Cloud::Init(std::string name)
{
m_Cloud.setTexture(*ResourceManagers::GetInstance()->GetTexture(name));
m_Speed = sf::Vector2f(-60.f, 0.f);
}
void Cloud::Update(float deltaTime)
{
if (m_Cloud.getPosition().x <= -1000.f) m_Cloud.setPosition(m_SavePoint);
m_Cloud.move(m_Speed*deltaTime);
}
... | true |
0686283c17f10cc9b58af28b799e502e44d62c79 | C++ | Cole-Resetco/schoolWork-C9 | /CS10/cs010_practice/labs/lab04/lab4.cpp | UTF-8 | 1,835 | 3.359375 | 3 | [] | no_license | // =============== BEGIN ASSESSMENT HEADER ================
/// @file lab04.cpp
/// @brief lab4/Branches and Chars
///
/// @author Cole Resetco [crese002@ucr.edu]
/// @date January, 29, 2015
// ================== END ASSESSMENT HEADER ===============
#include <iostream>
#include <string>
using namespace std;
#inclu... | true |
afa703567abba7d56fddb6517711222f39eab5ea | C++ | yegcjs/CourseManageSystem | /sources/StartWindow.cpp | GB18030 | 4,744 | 2.609375 | 3 | [] | no_license | #include "StartWindow.h"
#include "StudentWindow.h"
#include "AdminWindow.h"
#pragma execution_character_set("utf-8")
#pragma warning(disable:26812)
#include<QString>
#include<QPixmap>
#include<QTextCodec>
#include<QDebug>
#include<QGridLayout>
#include<QMessagebox>
StartWindow::StartWindow(QWidget *parent)
... | true |
43eefb93bf339357a9f5bee15125b4c42de9d50e | C++ | SebasAlMo017/Lab2_20182Estructura | /menu.cpp | UTF-8 | 820 | 3.1875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int func1 (float);
int func2 (float);
int func3 (float);
int func4 (float);
int main(int argc, char** argv)
{
int (*pf1[4]) (float);
int opc;
opc=0;
int num;
int valores;
pf1[0]= func1;
pf1[1]= func2;
pf1[2]= func3;
pf1[3]= func4;
do{
cout<<" enteros a=10 y b=7 \n... | true |
ad4cb9a93108a4f2ec540e49adece6742953fb66 | C++ | gakarak/GUI_CBIR_Search | /GUI_MVP_Search_v4/sortedindex.h | UTF-8 | 480 | 2.78125 | 3 | [] | no_license | #ifndef SORTEDINDEX_H
#define SORTEDINDEX_H
#include <QString>
class SortedIndex {
public:
SortedIndex() : val(-1), idx(-1), str("") {}
SortedIndex(float val,int idx, const QString& str ){ this->val=val; this->idx=idx; this->str = str; }
~SortedIndex() {}
float val;
int idx;
QString str;... | true |
110fa28f3c38f3382e12060a95dcad15548505e8 | C++ | HeroIsUseless/LeetCode | /38.cpp | UTF-8 | 1,093 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
string countAndSay(int n) {
string s = "1"; // 不会出现为0的
for(int i=2; i<=n; i++){ // 从2到n的那个运算
string t = ""; // 临时记录字符串
int j1=0;
int j2=0; // 快慢指针
... | true |
728ff4676f8ca37bdfe1c05671a1dc50340ad7e9 | C++ | zrss/Keyword-aware-Route-Planning | /RS_SG/main.cpp | UTF-8 | 3,522 | 2.734375 | 3 | [] | no_license | #include "CoSKQ.h"
/*
int main() {
int MaxDist = 0, MaxPairDist = 0;
std::vector<KeyWord> Look_For;
int keyword;
int choice = 0;
bool running = true;
getSDMatrix("Data\\NYSD_4.sd", MAX_NODE_NUM);
getData("Data\\Keyword.kw", MAX_NODE_NUM, NodeKW);
getData("Data\\LRating.ra", MAX_NODE_NUM, NodeRating);
std:... | true |
e8ac6447bb785695a1cc42d57c28ba2f5731ccf0 | C++ | manixaist/xplat-pmc-tutorial-07 | /include/utils.h | UTF-8 | 2,662 | 3.03125 | 3 | [] | no_license | #pragma once
#include "SDL.h"
#include <stdio.h>
namespace XplatGameTutorial
{
namespace PacManClone
{
// Oneshot timer for state transistions
class StateTimer
{
public:
StateTimer() : _startTicks(0), _targetTicks(0), _fStarted(false)
{
}
void Start(Uint32 waitTicks)
... | true |
9dd1fa01ade965f86ec828557019592b9c8b054c | C++ | JamyDev/OO1-SchaakSpel | /Practica Schaken/Practica Schaken/UI.cpp | UTF-8 | 3,469 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include "UI.h"
#include "Game.h"
#include "Move.h"
UI::UI()
{
std::cout << "Welcome to CHESS" << "\n";
printHelpToConsole();
}
void UI::printHelpToConsole()
{
std::cout
<< "Commands: \n"
<< " - m <row><col> <row><col>: Move from first to second position (e.g.: m B2 B4)... | true |
0aa4bcbc3df6a9f157253d873e942cc4c942c020 | C++ | Shain-Allen/Game-programing-year-2-Stuff | /Beta Engine Stuffs/BetaFramework-highlevelTemplate/Source/Level1.cpp | WINDOWS-1252 | 3,443 | 2.625 | 3 | [] | no_license | //------------------------------------------------------------------------------
//
// File Name: Level1.cpp
// Author(s): Jeremy Kings (j.kings)
// Project: BetaFramework
// Course: WANIC VGP2 2018-2019
//
// Copyright 2018 DigiPen (USA) Corporation.
//
//------------------------------------------------------------... | true |