blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
986 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
145 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
122 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
d5b12df6fc9f226fd8603bf2a9bd6e00bf4cfdf0
2a63cbaee66b1697890bdbd11ff80359317d612f
/SimpleRpc/rpcserver.h
28c3d7a65806c80ca620d3c054349abb79298f08
[]
no_license
Meteorix/UnrealPocoSdk
757ede5254cf17f89b055aabe85c101dd971bc9a
b3dfdafcc9bf1e44092f17bf49cf58bb8897b7f4
refs/heads/master
2020-03-22T17:45:52.318670
2018-07-11T13:29:17
2018-07-11T13:29:17
140,414,184
1
0
null
null
null
null
UTF-8
C++
false
false
957
h
#ifndef RPCSERVER_H #define RPCSERVER_H #include "iostream" #include <string> #include "Tcp/PassiveSocket.h" #include "WinSock2.h" #include "protocol.h" #include "json.hpp" #include <list> #include <map> #include <thread> #include <functional> using std::string; using std::cout; using std::endl; using json = nlohmann::json; #define MAX_PACKET 4096 class RpcServer { public: RpcServer(); ~RpcServer(); void start(); void close(); void client_task(CActiveSocket *pClient, Protocol proto); void client_task2(SOCKET *ClientSocket, Protocol proto); string handle_rpc_request(string request); void register_rpc_method(string method_name, std::function<json(json)> method_ptr); private: bool running = false; CPassiveSocket m_socket; SOCKET ListenSocket = INVALID_SOCKET; Protocol proto = Protocol(); std::list<std::thread*> client_thread_list = {}; std::map<string, std::function<json(json)>> rpc_method_map = {}; }; #endif // RPCSERVER_H
[ "gzliuxin@corp.netease.com" ]
gzliuxin@corp.netease.com
85512cc521466c99bb84b18a878f812691dd8ae7
c5b20eb450210a73e4acb49f347e16b861bee934
/Arduino Code/Sailboat/Sailboat.ino
21c629094c85ddfeac7a5bc88701d77601e66c20
[]
no_license
rflmota/Sailboat
446d2bfbe773f5fa5f2169d4b4074b953e74c9d6
fae527d4c6fa0c166c24ef9145183fb93ef8cc2f
refs/heads/master
2020-05-31T11:37:15.632018
2014-05-19T19:00:58
2014-05-19T19:00:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,585
ino
#include <sail_controller.h> #include <rudder_controller.h> #include <Wire.h> #include <Servo.h> #include <TinyGPSPlus.h> #define _DEBUG TRUE const unsigned int COMPASS_I2C_ADDRESS = 0x60; const unsigned int DEBUG_SERIAL_BAUDRATE = 57600; const unsigned int GPS_SERIAL_BAUDRATE = 57600; const unsigned int GPS_VALID_DATA_LIMIT_AGE = 5000; const unsigned long GPS_GOAL_LATITUDE = 90500000; // 90°30’00″ const unsigned long GPS_GOAL_LONGITUDE = 90500000; // 90°30’00″ const unsigned int ROTARY_ENCODER_PIN = 8; const unsigned int SAIL_SERVO_PIN = 49; const unsigned int RUDDER_SERVO_PIN = 53; const unsigned int ROTARY_ENC_MIN_PULSE_WIDTH = 1000; const unsigned int ROTARY_ENC_MAX_PULSE_WIDTH = 4000; const unsigned int SAIL_MIN_PULSE_WIDTH = 1000; const unsigned int SAIL_MAX_PULSE_WIDTH = 2000; const unsigned int RUDDER_MIN_PULSE_WIDTH = 1000; const unsigned int RUDDER_MAX_PULSE_WIDTH = 2000; TinyGPSPlus gps; Servo rudder; Servo sail; void setup() { #ifdef _DEBUG Serial.begin(DEBUG_SERIAL_BAUDRATE); #endif // _DEBUG Serial3.begin(GPS_SERIAL_BAUDRATE); Wire.begin(); pinMode(ROTARY_ENCODER_PIN, INPUT_PULLUP); rudder.attach(RUDDER_SERVO_PIN); sail.attach(SAIL_SERVO_PIN); rudder.writeMicroseconds(1500); sail.writeMicroseconds(1500); while (!gps.location.isValid()) retrieveGPSData(); #ifdef _DEBUG Serial.println("GPS Position Fixed !"); #endif // DEBUG } void loop() { byte highByte, lowByte; char pitch, roll; int bearing; double rudderActuationValue; double sailActuationValue; double goalAlignment; double windAlignment; retrieveCompassData(&bearing, &pitch, &roll); retrieveGPSData(); if (gps.location.age() < GPS_VALID_DATA_LIMIT_AGE) { goalAlignment = gps.courseTo(gps.location.lat(), gps.location.lng(), GPS_GOAL_LATITUDE, GPS_GOAL_LONGITUDE); windAlignment = abs(retrievePositionEncoderData()); rudder_controllerInferenceEngine(goalAlignment, &rudderActuationValue); sail_controllerInferenceEngine(abs(roll), goalAlignment, windAlignment, &sailActuationValue); rudder.writeMicroseconds(map(rudderActuationValue, 0, 100, RUDDER_MIN_PULSE_WIDTH, RUDDER_MAX_PULSE_WIDTH)); sail.writeMicroseconds(map(sailActuationValue, 0, 100, SAIL_MIN_PULSE_WIDTH, SAIL_MAX_PULSE_WIDTH)); #ifdef _DEBUG Serial.print("Position Encoder : "); Serial.println(retrievePositionEncoderData()); Serial.print("Roll : "); Serial.println(roll, DEC); Serial.print("Bearing : "); Serial.println(bearing); Serial.print("GPS Location : "); Serial.print(gps.location.lat(), 6); Serial.print(F(",")); Serial.println(gps.location.lng(), 6); Serial.print("Goal Position Alignment : "); Serial.println(goalAlignment); Serial.print("Wind Alignment : "); Serial.println(windAlignment); Serial.print("Sail Actuation Value : "); Serial.println(sailActuationValue); Serial.print("Rudder Actuation Value : "); Serial.println(rudderActuationValue); #endif // DEBUG } } void retrieveCompassData(int *bearing, char *pitch, char *roll) { byte highByte, lowByte; Wire.beginTransmission((int)COMPASS_I2C_ADDRESS); Wire.write(2); Wire.endTransmission(); Wire.requestFrom(COMPASS_I2C_ADDRESS, 4); while (Wire.available() < 4); highByte = Wire.read(); lowByte = Wire.read(); *pitch = (int)Wire.read(); *roll = (int)Wire.read(); *bearing = word(highByte, lowByte) / 10.0; } void retrieveGPSData() { while (Serial3.available() > 0) gps.encode(Serial3.read()); } int retrievePositionEncoderData() { return map(pulseIn(ROTARY_ENCODER_PIN, HIGH), ROTARY_ENC_MIN_PULSE_WIDTH, ROTARY_ENC_MAX_PULSE_WIDTH, -180, 180); }
[ "ricardoflmota@gmail.com" ]
ricardoflmota@gmail.com
91e737f0d1e9eee11da9d94a26a044f198cbef0c
2a7e77565c33e6b5d92ce6702b4a5fd96f80d7d0
/fuzzedpackages/Rfast2/src/apply_funcs_templates.h
9bdd3aeadc1011698b17bc2c4a248713bf74592a
[]
no_license
akhikolla/testpackages
62ccaeed866e2194652b65e7360987b3b20df7e7
01259c3543febc89955ea5b79f3a08d3afe57e95
refs/heads/master
2023-02-18T03:50:28.288006
2021-01-18T13:23:32
2021-01-18T13:23:32
329,981,898
7
1
null
null
null
null
UTF-8
C++
false
false
4,261
h
#include "templates.h" using namespace std; #ifndef FUNCS_TEMPLATES_H #define FUNCS_TEMPLATES_H /* * sum(Bin_Fun( a, b)) * ? is a binary function * a, b are iterators (should be same size) */ template<Binary_Function B, class T1, class T2> inline double apply_funcs(T1 a, T2 b, const int sz){ double ret = 0.0; for(int i=0;i<sz;i++,++a,++b){ ret+=B(*a, *b); } return ret; } /* * sum(fun0( Bin_Fun( fun1(a), fun2(b)))) * fun0, fun1, fun2 are Unary_Functions * ? is a binary function * a, b are iterators (should be same size) */ template<Unary_Function F0, Unary_Function F1, Binary_Function B, Unary_Function F2, typename T1, typename T2> inline double apply_funcs(T1 a, T2 b, const int sz){ double ret = 0.0; for(int i=0;i<sz;i++,++a,b++){ ret+=F0( B(F1(*a), F2(*b)) ); } return ret; } /* * sum(fun0( fun1(a) ? fun2(b))) (only now, one of fun0, fun1, fun2 doesn't exist) * fun0, fun1, fun2 are Unary_Functions * ? is a binary function * a, b are iterators (should be same size) * type indicates which of fun0, fun1, fun2 doesn't exist */ template<Unary_Function F0, Unary_Function F1, Binary_Function B, typename T1, typename T2> inline double apply_funcs(T1 a, T2 b, const int sz, const int type){ double ret = 0.0; if(type==0){ for(int i=0;i<sz;i++,++a,++b){ ret+=B(F0(*a), F1(*b)); } } else if(type==1){ for(int i=0;i<sz;i++,++a,++b){ ret+=F0( B(*a, F1(*b)) ); } } else{ for(int i=0;i<sz;i++,++a,++b){ ret+=F0( B(F1(*a), *b) ); } } return ret; } /* * sum(fun0( fun1(a) ? fun2(b))) (like before, only now only one fun exists) * fun0, fun1, fun2 are Unary_Functions * ? is a binary function * a, b are iterators (should be same size) * type indicates which of fun0, fun1, fun2 exists */ template<Unary_Function F, Binary_Function B, typename T1, typename T2> inline double apply_funcs(T1 a, T2 b, const int sz, const int type){ double ret = 0.0; if(type==0){ for(int i=0;i<sz;i++,++a,++b){ ret+=F( B(*a, *b) ); } } else if(type==1){ for(int i=0;i<sz;i++,++a,++b){ ret+=B(F(*a), *b); } } else{ for(int i=0;i<sz;i++,++a,++b){ ret+=B(*a, F(*b)); } } return ret; } template<Binary_Function B, typename T1, typename T2, typename T3> inline void apply_funcs(T1 a, T2 b, T3 out, const int sz){ for(int i=0;i<sz;i++,++a,++b,++out){ *out=B(*a, *b); } return; } /* * each element of out is filled with (fun0( fun1(a) ? fun2(b))) * fun0, fun1, fun2 are Unary_Functions * ? is a binary function * a, b, out are iterators (should refer to elements with the same size) */ template<Unary_Function F0, Unary_Function F1, Binary_Function B, Unary_Function F2, typename T1, typename T2, typename T3> inline void apply_funcs(T1 a, T2 b, T3 out, const int sz){ for(int i=0;i<sz;i++,++a,++b, ++out){ *out=F0( B(F1(*a), F2(*b)) ); } return; } /* * each element of out is filled with sum(fun0( fun1(a) ? fun2(b))) (only now, one of fun0, fun1, fun2 doesn't exist) * fun0, fun1, fun2 are Unary_Functions * ? is a binary function * a, b are iterators (should be same size) * type indicates which of fun0, fun1, fun2 doesn't exist */ template<Unary_Function F0, Unary_Function F1, Binary_Function B, typename T1, typename T2, typename T3> inline void apply_funcs(T1 a, T2 b, T3 out, const int sz, const int type){ if(type==0){ for(int i=0;i<sz;i++,++a,++b,++out){ *out=B(F0(*a), F1(*b)); } } else if(type==1){ for(int i=0;i<sz;i++,++a,++b,++out){ *out=F0( B(*a, F1(*b)) ); } } else{ for(int i=0;i<sz;i++,++a,++b,++out){ *out=F0( B(F1(*a), *b) ); } } return; } /* * each element of out is filled with sum(fun0( fun1(a) ? fun2(b))) (like before, only now only one fun exists) * fun0, fun1, fun2 are Unary_Functions * ? is a binary function * a, b are iterators (should be same size) * type indicates which of fun0, fun1, fun2 exists */ template<Unary_Function F, Binary_Function B, typename T1, typename T2, typename T3> inline void apply_funcs(T1 a, T2 b, T3 out, const int sz, const int type){ if(type==0){ for(int i=0;i<sz;i++,++a,++b,++out){ *out=F( B(*a, *b) ); } } else if(type==1){ for(int i=0;i<sz;i++,++a,++b,++out){ *out=B(F(*a), *b); } } else{ for(int i=0;i<sz;i++,++a,++b,++out){ *out=B(*a, F(*b)); } } return; } #endif
[ "akhilakollasrinu424jf@gmail.com" ]
akhilakollasrinu424jf@gmail.com
0481a5ae07f2a69c9beab888097a02c1261cb7c2
1af49694004c6fbc31deada5618dae37255ce978
/ui/ozone/platform/wayland/host/wayland_zaura_shell.h
3057ff66ce824b29906a3ccc9b220df95f6f6352
[ "BSD-3-Clause" ]
permissive
sadrulhc/chromium
59682b173a00269ed036eee5ebfa317ba3a770cc
a4b950c23db47a0fdd63549cccf9ac8acd8e2c41
refs/heads/master
2023-02-02T07:59:20.295144
2020-12-01T21:32:32
2020-12-01T21:32:32
317,678,056
3
0
BSD-3-Clause
2020-12-01T21:56:26
2020-12-01T21:56:25
null
UTF-8
C++
false
false
1,092
h
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_ZAURA_SHELL_H_ #define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_ZAURA_SHELL_H_ #include "ui/ozone/platform/wayland/common/wayland_object.h" namespace ui { class WaylandConnection; // Wraps the zaura_shell object. class WaylandZAuraShell { public: WaylandZAuraShell(zaura_shell* aura_shell, WaylandConnection* connection); WaylandZAuraShell(const WaylandZAuraShell&) = delete; WaylandZAuraShell& operator=(const WaylandZAuraShell&) = delete; ~WaylandZAuraShell(); zaura_shell* wl_object() const { return obj_.get(); } private: // zaura_shell_listener static void OnLayoutMode(void* data, struct zaura_shell* zaura_shell, uint32_t layout_mode); wl::Object<zaura_shell> obj_; WaylandConnection* const connection_; }; } // namespace ui #endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_ZAURA_SHELL_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
e1aacb4d5261f52e5f0e87bb65845a4a0dac2af6
44aa2e76764f37d27146f18e57f3d7397a29940c
/C++/ISC-EVA1/EVA1_10_CUNAESFERICA.cpp
99d81ca902802e9e964efddad4af82fa101bb899
[]
no_license
Nidia08/fundamentospro
8118fa5fe8f29b091e69bea240989f2f3087d21d
102c5f68b0b14595a0d93996ba2db3429cb34a4a
refs/heads/master
2020-03-27T12:22:03.147615
2018-12-09T18:18:06
2018-12-09T18:18:06
146,542,568
0
0
null
null
null
null
UTF-8
C++
false
false
526
cpp
//Nidia Gonzalez Morales 18550676 #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <cmath> using namespace std; string toString (double); int toInt (string); double toDouble (string); int main() { cout<< "Ingresa el radio"<<endl; double r; cin>>r; cout<<"Ingresa los grados"<<endl; double g; cin>>g; double vT; vT = (double) 4/3 * (3.1416* pow(r,3)/360)*g; cout<<"El volumen de la cuna esferica es "<<vT<<endl; return 0; }
[ "nidia.gonzalezm08@gmail.com" ]
nidia.gonzalezm08@gmail.com
8526437b98c6ea8d311fe63748ab0883c40c3722
f4bc7cf7f667f98e0599ae87a4a558e87be0675a
/C++/121_BestTimetoBuyandSellStock.cpp
483d9572399b69a4f3597bc83d82199c498dc100
[]
no_license
Darren2017/LeetCode
7867cbb8f0946045a51d0ffd80793fcd68c7d987
cf4a6f402b32852affbc78c96e878b924db6cd0b
refs/heads/master
2020-03-27T18:02:18.498098
2019-07-11T15:15:11
2019-07-11T15:15:11
146,894,108
0
0
null
null
null
null
UTF-8
C++
false
false
434
cpp
class Solution { public: int maxProfit(vector<int>& prices) { int min = prices[0], maxprice = 0, len = prices.size(); for(int i = 0; i < len; i++){ if(prices[i] < min){ min = prices[i]; } if(prices[i] - min > maxprice){ maxprice = prices[i] - min; } } return maxprice; } }; /* 感觉这个不像是DP啊! */
[ "17362990052@163.com" ]
17362990052@163.com
09d6a7f66daeb5e5f487ba54e081915920f31170
9bc24fa2c325b5cb8c6ec6b3515e051a631956b7
/vector2dsort.cpp
6418d723d6d893ace37ad6dbad7c501b344be438
[]
no_license
syedsiddhiqq/Competitive_programming
5cdca1594fdc1dc78bccc6149e3ab327b57aadeb
c55fa87b8f4803d9f25ed2b028ad482501570697
refs/heads/master
2020-04-22T09:08:08.155827
2019-02-12T06:08:05
2019-02-12T06:08:05
170,261,794
0
0
null
null
null
null
UTF-8
C++
false
false
438
cpp
/* * @Author: SyedAli * @Date: 2019-01-11 17:08:32 * @Last Modified by: SyedAli * @Last Modified time: 2019-01-11 17:09:31 */ #include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<pair<int, int> > a(n); for (int i = 0; i < n; ++i) { cin >> a[i].first; a[i].second = i; } sort(a.begin(), a.end()); for(int i=0;i<n;i++){ printf("%d%d\n",a[i].first,a[i].second); } return 0; }
[ "dineshananth97@gmail.com" ]
dineshananth97@gmail.com
53568ae1f9836ded44cc08a8af5c18f094712e33
00788ef473065316489de368dbc9ccb14dd1b863
/Classes/scene/TitleScene.cpp
892941ed906a6118f8e0a5575f11c233db0901f0
[]
no_license
KeitaShiratori/KusoGame4
3656632f067fa658b697398afe0893e43522ed7f
92aff72a795ec466d9ef2a55205a781cd060f268
refs/heads/master
2021-01-22T01:54:42.552120
2015-05-06T06:42:58
2015-05-06T06:42:58
35,141,301
0
0
null
null
null
null
UTF-8
C++
false
false
3,835
cpp
#include "TitleScene.h" #include "StageSelectScene.h" #define WINSIZE Director::getInstance()->getWinSize() #define T_DIALOG 1000 #define STAGE_SELECT_SCENE 1 USING_NS_CC; //コンストラクタ TitleScene::TitleScene() { } //シーン生成 Scene* TitleScene::createScene() { auto scene = Scene::create(); auto layer = TitleScene::create(); scene->addChild(layer); return scene; } //インスタンス生成 TitleScene* TitleScene::create() { TitleScene *pRet = new TitleScene(); pRet->init(); pRet->autorelease(); return pRet; } //初期化 bool TitleScene::init() { if (!Layer::init()) return false; // パスを追加 CCFileUtils::sharedFileUtils()->addSearchPath("extensions"); // 湯気エフェクトのプール _pool = ParticleSystemPool::create("yuge_texture.plist", 20); _pool->retain(); // シングルタップイベントの取得 auto touchListener = EventListenerTouchOneByOne::create(); touchListener->setSwallowTouches(_swallowsTouches); touchListener->onTouchBegan = CC_CALLBACK_2(TitleScene::onTouchBegan, this); touchListener->onTouchMoved = CC_CALLBACK_2(TitleScene::onTouchMoved, this); touchListener->onTouchEnded = CC_CALLBACK_2(TitleScene::onTouchEnded, this); touchListener->onTouchCancelled = CC_CALLBACK_2(TitleScene::onTouchCancelled, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); initTitle(); //タイトルの初期化 initMenu(); // 初回起動時に限り、ステージオープン情報を初期化する UserDefault *userDef = UserDefault::getInstance(); if(!userDef->getBoolForKey("IS_OPEN_STAGE1", false)){ for(int i = 1; i <= 10; i++){ std::string keyIsOpen = StringUtils::format("IS_OPEN_STAGE%2d", i); userDef->setBoolForKey(keyIsOpen.c_str(), true); // 更新したステージ情報を保存 userDef->flush(); } } return true; } bool TitleScene::onTouchBegan(Touch* touch, Event* unused_event) { CCLOG("onToucnBegan"); auto p = _pool->pop(); if(p != nullptr){ CCPoint pos = ccp(touch->getLocation().x, touch->getLocation().y); p->setPosition(pos); p->setAutoRemoveOnFinish(true); // 表示が終わったら自分を親から削除! this->addChild(p); } return false; } void TitleScene::onTouchMoved(Touch* touch, Event* unused_event) { CCLOG("onTouchMoved"); } void TitleScene::onTouchEnded(Touch* touch, Event* unused_event) { CCLOG("onTouchEnded"); } void TitleScene::onTouchCancelled(Touch* touch, Event* unused_event) { CCLOG("onTouchCancelled"); } //背景の初期化 void TitleScene::initTitle() { // タイトル画像 auto title = Sprite::create("Title.png"); title->setPosition(WINSIZE / 2); addChild(title); } void TitleScene::initMenu(){ auto label1 = Label::createWithSystemFont("スタート", "fonts/Marker Felt.ttf", 64); label1->enableShadow(Color4B::GRAY, Size(0.5, 0.5), 15); label1->enableOutline(Color4B::BLUE, 5); auto item1 = MenuItemLabel::create(label1, [&](Ref* pSender) { //指定秒数後に次のシーンへ nextScene(STAGE_SELECT_SCENE, 1.0f); }); auto menu = Menu::create(item1, NULL); menu->alignItemsVerticallyWithPadding(50); this->addChild(menu); } //次のシーンへ遷移 void TitleScene::nextScene(int NEXT_SCENE, float dt) { // 次のシーンを生成する Scene* scene; switch(NEXT_SCENE){ case STAGE_SELECT_SCENE: scene = StageSelectScene::createScene(); break; default: scene = NULL; } Director::getInstance()->replaceScene( TransitionFadeTR::create(dt, scene) ); }
[ "keita.shiratori@gmail.com" ]
keita.shiratori@gmail.com
84601eac4df491b674cdcf809efe46c4e6b56752
3ff1fe3888e34cd3576d91319bf0f08ca955940f
/dsgc/include/tencentcloud/dsgc/v20190723/model/ReportInfo.h
e7c0867fae6f38fdb5a5991b8bf1deb5f364607e
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-cpp
9f5df8220eaaf72f7eaee07b2ede94f89313651f
42a76b812b81d1b52ec6a217fafc8faa135e06ca
refs/heads/master
2023-08-30T03:22:45.269556
2023-08-30T00:45:39
2023-08-30T00:45:39
188,991,963
55
37
Apache-2.0
2023-08-17T03:13:20
2019-05-28T08:56:08
C++
UTF-8
C++
false
false
19,301
h
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TENCENTCLOUD_DSGC_V20190723_MODEL_REPORTINFO_H_ #define TENCENTCLOUD_DSGC_V20190723_MODEL_REPORTINFO_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/utils/rapidjson/document.h> #include <tencentcloud/core/utils/rapidjson/writer.h> #include <tencentcloud/core/utils/rapidjson/stringbuffer.h> #include <tencentcloud/core/AbstractModel.h> namespace TencentCloud { namespace Dsgc { namespace V20190723 { namespace Model { /** * 报表信息 */ class ReportInfo : public AbstractModel { public: ReportInfo(); ~ReportInfo() = default; void ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const; CoreInternalOutcome Deserialize(const rapidjson::Value &value); /** * 获取任务id * @return Id 任务id * */ uint64_t GetId() const; /** * 设置任务id * @param _id 任务id * */ void SetId(const uint64_t& _id); /** * 判断参数 Id 是否已赋值 * @return Id 是否已赋值 * */ bool IdHasBeenSet() const; /** * 获取报告名称 * @return ReportName 报告名称 * */ std::string GetReportName() const; /** * 设置报告名称 * @param _reportName 报告名称 * */ void SetReportName(const std::string& _reportName); /** * 判断参数 ReportName 是否已赋值 * @return ReportName 是否已赋值 * */ bool ReportNameHasBeenSet() const; /** * 获取报告类型(AssetSorting:资产梳理) 注意:此字段可能返回 null,表示取不到有效值。 * @return ReportType 报告类型(AssetSorting:资产梳理) 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetReportType() const; /** * 设置报告类型(AssetSorting:资产梳理) 注意:此字段可能返回 null,表示取不到有效值。 * @param _reportType 报告类型(AssetSorting:资产梳理) 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetReportType(const std::string& _reportType); /** * 判断参数 ReportType 是否已赋值 * @return ReportType 是否已赋值 * */ bool ReportTypeHasBeenSet() const; /** * 获取报告周期(0单次 1每天 2每周 3每月) 注意:此字段可能返回 null,表示取不到有效值。 * @return ReportPeriod 报告周期(0单次 1每天 2每周 3每月) 注意:此字段可能返回 null,表示取不到有效值。 * */ uint64_t GetReportPeriod() const; /** * 设置报告周期(0单次 1每天 2每周 3每月) 注意:此字段可能返回 null,表示取不到有效值。 * @param _reportPeriod 报告周期(0单次 1每天 2每周 3每月) 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetReportPeriod(const uint64_t& _reportPeriod); /** * 判断参数 ReportPeriod 是否已赋值 * @return ReportPeriod 是否已赋值 * */ bool ReportPeriodHasBeenSet() const; /** * 获取执行计划 (0:单次报告 1:定时报告) 注意:此字段可能返回 null,表示取不到有效值。 * @return ReportPlan 执行计划 (0:单次报告 1:定时报告) 注意:此字段可能返回 null,表示取不到有效值。 * */ uint64_t GetReportPlan() const; /** * 设置执行计划 (0:单次报告 1:定时报告) 注意:此字段可能返回 null,表示取不到有效值。 * @param _reportPlan 执行计划 (0:单次报告 1:定时报告) 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetReportPlan(const uint64_t& _reportPlan); /** * 判断参数 ReportPlan 是否已赋值 * @return ReportPlan 是否已赋值 * */ bool ReportPlanHasBeenSet() const; /** * 获取报告导出状态(Success 成功, Failed 失败, InProgress 进行中) 注意:此字段可能返回 null,表示取不到有效值。 * @return ReportStatus 报告导出状态(Success 成功, Failed 失败, InProgress 进行中) 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetReportStatus() const; /** * 设置报告导出状态(Success 成功, Failed 失败, InProgress 进行中) 注意:此字段可能返回 null,表示取不到有效值。 * @param _reportStatus 报告导出状态(Success 成功, Failed 失败, InProgress 进行中) 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetReportStatus(const std::string& _reportStatus); /** * 判断参数 ReportStatus 是否已赋值 * @return ReportStatus 是否已赋值 * */ bool ReportStatusHasBeenSet() const; /** * 获取任务下次启动时间 注意:此字段可能返回 null,表示取不到有效值。 * @return TimingStartTime 任务下次启动时间 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetTimingStartTime() const; /** * 设置任务下次启动时间 注意:此字段可能返回 null,表示取不到有效值。 * @param _timingStartTime 任务下次启动时间 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetTimingStartTime(const std::string& _timingStartTime); /** * 判断参数 TimingStartTime 是否已赋值 * @return TimingStartTime 是否已赋值 * */ bool TimingStartTimeHasBeenSet() const; /** * 获取创建时间 注意:此字段可能返回 null,表示取不到有效值。 * @return CreateTime 创建时间 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetCreateTime() const; /** * 设置创建时间 注意:此字段可能返回 null,表示取不到有效值。 * @param _createTime 创建时间 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetCreateTime(const std::string& _createTime); /** * 判断参数 CreateTime 是否已赋值 * @return CreateTime 是否已赋值 * */ bool CreateTimeHasBeenSet() const; /** * 获取完成时间 注意:此字段可能返回 null,表示取不到有效值。 * @return FinishedTime 完成时间 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetFinishedTime() const; /** * 设置完成时间 注意:此字段可能返回 null,表示取不到有效值。 * @param _finishedTime 完成时间 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetFinishedTime(const std::string& _finishedTime); /** * 判断参数 FinishedTime 是否已赋值 * @return FinishedTime 是否已赋值 * */ bool FinishedTimeHasBeenSet() const; /** * 获取子账号uin 注意:此字段可能返回 null,表示取不到有效值。 * @return SubUin 子账号uin 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetSubUin() const; /** * 设置子账号uin 注意:此字段可能返回 null,表示取不到有效值。 * @param _subUin 子账号uin 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetSubUin(const std::string& _subUin); /** * 判断参数 SubUin 是否已赋值 * @return SubUin 是否已赋值 * */ bool SubUinHasBeenSet() const; /** * 获取失败信息 注意:此字段可能返回 null,表示取不到有效值。 * @return FailedMessage 失败信息 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetFailedMessage() const; /** * 设置失败信息 注意:此字段可能返回 null,表示取不到有效值。 * @param _failedMessage 失败信息 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetFailedMessage(const std::string& _failedMessage); /** * 判断参数 FailedMessage 是否已赋值 * @return FailedMessage 是否已赋值 * */ bool FailedMessageHasBeenSet() const; /** * 获取是否启用(0:否 1:是) 注意:此字段可能返回 null,表示取不到有效值。 * @return Enable 是否启用(0:否 1:是) 注意:此字段可能返回 null,表示取不到有效值。 * */ uint64_t GetEnable() const; /** * 设置是否启用(0:否 1:是) 注意:此字段可能返回 null,表示取不到有效值。 * @param _enable 是否启用(0:否 1:是) 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetEnable(const uint64_t& _enable); /** * 判断参数 Enable 是否已赋值 * @return Enable 是否已赋值 * */ bool EnableHasBeenSet() const; /** * 获取识别模板名称 注意:此字段可能返回 null,表示取不到有效值。 * @return ComplianceName 识别模板名称 注意:此字段可能返回 null,表示取不到有效值。 * */ std::string GetComplianceName() const; /** * 设置识别模板名称 注意:此字段可能返回 null,表示取不到有效值。 * @param _complianceName 识别模板名称 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetComplianceName(const std::string& _complianceName); /** * 判断参数 ComplianceName 是否已赋值 * @return ComplianceName 是否已赋值 * */ bool ComplianceNameHasBeenSet() const; /** * 获取进度百分比 注意:此字段可能返回 null,表示取不到有效值。 * @return ProgressPercent 进度百分比 注意:此字段可能返回 null,表示取不到有效值。 * */ uint64_t GetProgressPercent() const; /** * 设置进度百分比 注意:此字段可能返回 null,表示取不到有效值。 * @param _progressPercent 进度百分比 注意:此字段可能返回 null,表示取不到有效值。 * */ void SetProgressPercent(const uint64_t& _progressPercent); /** * 判断参数 ProgressPercent 是否已赋值 * @return ProgressPercent 是否已赋值 * */ bool ProgressPercentHasBeenSet() const; private: /** * 任务id */ uint64_t m_id; bool m_idHasBeenSet; /** * 报告名称 */ std::string m_reportName; bool m_reportNameHasBeenSet; /** * 报告类型(AssetSorting:资产梳理) 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_reportType; bool m_reportTypeHasBeenSet; /** * 报告周期(0单次 1每天 2每周 3每月) 注意:此字段可能返回 null,表示取不到有效值。 */ uint64_t m_reportPeriod; bool m_reportPeriodHasBeenSet; /** * 执行计划 (0:单次报告 1:定时报告) 注意:此字段可能返回 null,表示取不到有效值。 */ uint64_t m_reportPlan; bool m_reportPlanHasBeenSet; /** * 报告导出状态(Success 成功, Failed 失败, InProgress 进行中) 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_reportStatus; bool m_reportStatusHasBeenSet; /** * 任务下次启动时间 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_timingStartTime; bool m_timingStartTimeHasBeenSet; /** * 创建时间 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_createTime; bool m_createTimeHasBeenSet; /** * 完成时间 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_finishedTime; bool m_finishedTimeHasBeenSet; /** * 子账号uin 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_subUin; bool m_subUinHasBeenSet; /** * 失败信息 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_failedMessage; bool m_failedMessageHasBeenSet; /** * 是否启用(0:否 1:是) 注意:此字段可能返回 null,表示取不到有效值。 */ uint64_t m_enable; bool m_enableHasBeenSet; /** * 识别模板名称 注意:此字段可能返回 null,表示取不到有效值。 */ std::string m_complianceName; bool m_complianceNameHasBeenSet; /** * 进度百分比 注意:此字段可能返回 null,表示取不到有效值。 */ uint64_t m_progressPercent; bool m_progressPercentHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_DSGC_V20190723_MODEL_REPORTINFO_H_
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
d8a5cbc8bb4a8a2fbe58c0c80f272a23e87d7fb2
5f3cb89f65805aac2e9b69ac89d59b74062927aa
/AVL/AVLTest.cpp
29738d38d65cc015bed78207992435ae54a6fc51
[]
no_license
kk-codezeus/BST-AVL-Treap-Splay-Trees-Analysis
5cc75d2c386827dab3bd3c128e8c0c5f7654227f
ae0de1db9f9ebd99e3cc31ed41bbc85d257caadf
refs/heads/master
2020-05-21T14:30:06.628016
2019-05-11T03:33:36
2019-05-11T03:33:36
186,080,071
0
0
null
null
null
null
UTF-8
C++
false
false
4,082
cpp
#include "AVL.cpp" using namespace chrono; vector<int> randomKeys; vector<int> sequentialKeys; vector<int> recentAccessedKeys; void loadThreeVectors() { ifstream random("../random_keys.txt",ifstream::in); ifstream sequential("../sequential_keys.txt",ifstream::in); ifstream recent("../recentAccess_keys.txt",ifstream::in); int temp; for(int i = 0;i < 10000;i++) { random>>temp; randomKeys.push_back(temp); } for(int i = 0;i < 10000;i++) { sequential>>temp; sequentialKeys.push_back(temp); } for(int i = 0;i < 10000;i++) { recent>>temp; recentAccessedKeys.push_back(temp); } } void printThreeVectors() { for(int i = 0;i < 10000;i++) cout<<randomKeys[i]<<" "; cout<<endl<<endl<<endl; for(int i = 0;i < 10000;i++) cout<<sequentialKeys[i]<<" "; cout<<endl<<endl<<endl; for(int i = 0;i < 10000;i++) cout<<recentAccessedKeys[i]<<" "; cout<<endl<<endl<<endl; } void test_randomKeys() { AVL tree; tree.create(); steady_clock::time_point t1,t2; t1 = steady_clock::now(); for(int i = 0;i < randomKeys.size();i++) //random keys insert time tree.insertKey(randomKeys[i]); t2 = steady_clock::now(); auto duration = duration_cast<nanoseconds>((t2 - t1)); cout<<duration.count()<<"\n"; t1 = steady_clock::now(); for(int i = 0;i < randomKeys.size();i++) //random keys search time tree.searchKey(randomKeys[i]); t2 = steady_clock::now(); auto duration2 = duration_cast<nanoseconds>((t2 - t1)); cout<<duration2.count()<<"\n"; t1 = steady_clock::now(); for(int i = 0;i < randomKeys.size();i++) //random keys delete time tree.deleteKey(randomKeys[i]); t2 = steady_clock::now(); auto duration3 = duration_cast<nanoseconds>((t2 - t1)); cout<<duration3.count()<<"\n"; } void test_sequentialKeys() { AVL tree; tree.create(); steady_clock::time_point t1,t2; t1 = steady_clock::now(); for(int i = 0;i < sequentialKeys.size();i++) //sequential keys insert time tree.insertKey(sequentialKeys[i]); t2 = steady_clock::now(); auto duration = duration_cast<nanoseconds>((t2 - t1)); cout<<duration.count()<<"\n"; t1 = steady_clock::now(); for(int i = 0;i < sequentialKeys.size();i++) //sequential keys search time tree.searchKey(sequentialKeys[i]); t2 = steady_clock::now(); auto duration2 = duration_cast<nanoseconds>((t2 - t1)); cout<<duration2.count()<<"\n"; t1 = steady_clock::now(); for(int i = 0;i < sequentialKeys.size();i++) //sequential keys delete time tree.deleteKey(sequentialKeys[i]); t2 = steady_clock::now(); auto duration3 = duration_cast<nanoseconds>((t2 - t1)); cout<<duration3.count()<<"\n"; } void test_recentAccessedKeys() { AVL tree; tree.create(); steady_clock::time_point t1,t2; t1 = steady_clock::now(); for(int i = 0;i < recentAccessedKeys.size();i++) //recentAccess keys insert time tree.insertKey(recentAccessedKeys[i]); t2 = steady_clock::now(); auto duration = duration_cast<nanoseconds>((t2 - t1)); cout<<duration.count()<<"\n"; t1 = steady_clock::now(); for(int i = 0;i < recentAccessedKeys.size();i++) //recentAccess keys search time tree.searchKey(recentAccessedKeys[i]); t2 = steady_clock::now(); auto duration2 = duration_cast<nanoseconds>((t2 - t1)); cout<<duration2.count()<<"\n"; t1 = steady_clock::now(); for(int i = 0;i < recentAccessedKeys.size();i++) //recentAccess keys delete time tree.deleteKey(recentAccessedKeys[i]); t2 = steady_clock::now(); auto duration3 = duration_cast<nanoseconds>((t2 - t1)); cout<<duration3.count()<<"\n"; } int main() { loadThreeVectors(); //test_randomKeys(); //test_sequentialKeys(); test_recentAccessedKeys(); return 0; }
[ "kk3117@gmail.com" ]
kk3117@gmail.com
c6d1ba859689b6c19f71f3d4cd71a5afa9f54eda
05ac4e5a18cd01102719c67b591fa376d7f65ad0
/src/RE/TESDescription.cpp
64a5729e91d0e3eb8e53e40e43362b435009cb62
[ "MIT" ]
permissive
CakeTheLiar/CommonLibSSE
5beb42dee876e2b17265a63903d37f1b1586453e
ad4c94d0373f20a6f5bcdc776ba84bd4a3b24cea
refs/heads/master
2020-08-14T05:47:28.042591
2019-10-14T19:21:03
2019-10-14T19:21:03
215,108,918
0
0
MIT
2019-10-14T17:47:07
2019-10-14T17:47:06
null
UTF-8
C++
false
false
453
cpp
#include "RE/TESDescription.h" #include "skse64/GameFormComponents.h" // TESDescription #include "RE/BSString.h" // BSString namespace RE { void TESDescription::GetDescription(BSString& a_out, TESForm* a_parent, UInt32 a_fieldType) { using func_t = function_type_t<decltype(&TESDescription::GetDescription)>; func_t* func = EXTRACT_SKSE_MEMBER_FN_ADDR(::TESDescription, Get, func_t*); return func(this, a_out, a_parent, a_fieldType); } }
[ "ryan__mckenzie@hotmail.com" ]
ryan__mckenzie@hotmail.com
00434465cc3d7a82483463fe9fcd6e4a77fdc620
da86d9f9cf875db42fd912e3366cfe9e0aa392c6
/2017/solutions/D/DPK-Gabrovo/bio.cpp
16454983b5d27cbeb4b0d4f320188c44b95a7929
[]
no_license
Alaxe/noi2-ranking
0c98ea9af9fc3bd22798cab523f38fd75ed97634
bb671bacd369b0924a1bfa313acb259f97947d05
refs/heads/master
2021-01-22T23:33:43.481107
2020-02-15T17:33:25
2020-02-15T17:33:25
85,631,202
2
4
null
null
null
null
UTF-8
C++
false
false
513
cpp
#include <iostream> #include <algorithm> #include <cctype> using namespace std; struct dm { int d,m; }; int main () { char k; dm a,b,c,d; cin>>a.d; cin.get(k); cin>>a.m; cin>>b.d; cin.get(k); cin>>b.m; cin>>c.d; cin.get(k); cin>>c.m; cin>>d.d; cin.get(k); cin>>d.m; if (a.d==b.d && a.d==c.d && a.d==d.d && a.m==b.m && a.m==c.m && a.m==d.m) { cout<<21252<<endl; return 0; } return 0; }
[ "aleks.tcr@gmail.com" ]
aleks.tcr@gmail.com
7e3d302e2a0d8ed086ef5033c05732aaac8deb5e
a4f6a06e41f0873bc5d71783051c2483e4a90314
/UNITTESTS/stubs/storage/ProfilingBlockDevice_stub.cpp
52a94fa5b1d805a744b74d56385559904afc3ce1
[ "SGI-B-1.1", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "MPL-2.0", "BSD-3-Clause", "BSD-4-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jeromecoutant/mbed
20b7a5a4dfbcace7c5a6a2086fde939c28dc8a8b
bf07820e47131a4b72889086692224f5ecc0ddd7
refs/heads/master
2023-05-25T09:50:33.111837
2021-06-18T09:27:53
2021-06-18T15:18:48
56,680,851
2
4
Apache-2.0
2018-09-28T12:55:38
2016-04-20T11:20:08
C
UTF-8
C++
false
false
1,898
cpp
/* * Copyright (c) 2017, Arm Limited and affiliates. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ProfilingBlockDevice.h" ProfilingBlockDevice::ProfilingBlockDevice(BlockDevice *bd) { } int ProfilingBlockDevice::init() { return 0; } int ProfilingBlockDevice::deinit() { return 0; } int ProfilingBlockDevice::sync() { return 0; } int ProfilingBlockDevice::read(void *b, bd_addr_t addr, bd_size_t size) { return 0; } int ProfilingBlockDevice::program(const void *b, bd_addr_t addr, bd_size_t size) { return 0; } int ProfilingBlockDevice::erase(bd_addr_t addr, bd_size_t size) { return 0; } bd_size_t ProfilingBlockDevice::get_read_size() const { return 0; } bd_size_t ProfilingBlockDevice::get_program_size() const { return 0; } bd_size_t ProfilingBlockDevice::get_erase_size() const { return 0; } bd_size_t ProfilingBlockDevice::get_erase_size(bd_addr_t addr) const { return 0; } int ProfilingBlockDevice::get_erase_value() const { return 0; } bd_size_t ProfilingBlockDevice::size() const { return 0; } void ProfilingBlockDevice::reset() { } bd_size_t ProfilingBlockDevice::get_read_count() const { return 0; } bd_size_t ProfilingBlockDevice::get_program_count() const { return 0; } bd_size_t ProfilingBlockDevice::get_erase_count() const { return 0; }
[ "antti.kauppila@arm.com" ]
antti.kauppila@arm.com
517c9aa953f8fe7390817853726510980e386663
84120b6b73012288fcc907c37a165d548398d319
/task1/src/2_power.cpp
7a7e5b7379b01eb52af1aa8954a71744d404e696
[]
no_license
t0pcup/cpp
6866122d3d7c711fae35dcc2bb7a128a0bbb1ad9
cf2b66d0b7397faa4a112b689f9d3ff0198e1a1e
refs/heads/master
2022-12-17T00:07:46.233528
2020-09-28T09:48:55
2020-09-28T09:48:55
299,297,025
1
0
null
2020-09-28T12:10:35
2020-09-28T12:10:34
null
UTF-8
C++
false
false
630
cpp
#include <cmath> #include <gtest/gtest.h> using namespace std; // Написать реализацию функции возведения числа в степень long long power(int, int); #pragma region power tests TEST(power, case1) { EXPECT_EQ(8, power(2, 3)); } TEST(power, case2) { EXPECT_EQ(1, power(3, 0)); } TEST(power, case3) { EXPECT_EQ(1125899906842624, power(2, 50)); } TEST(power, case4) { EXPECT_EQ(-125, power(-5, 3)); } TEST(power, case5) { EXPECT_EQ(81, power(-3, 4)); } #pragma endregion // todo long long power(int, int) { throw std::runtime_error("Not implemented!"); }
[ "h33el@yandex.ru" ]
h33el@yandex.ru
d2915d4130b5ee72227ec0857729a52410166ef1
2148f667cc1b75213c8ae10f8f1b499aae3df980
/LeetCode/90.子集2.cpp
cde571b99354afa79063e7747da203922aa98a7e
[]
no_license
zkk258369/Practice-of-some-Test
346d14714bc3f9ea965abf294eadcb2f28622847
599914056f2b263a69621724961175f08bb622ac
refs/heads/master
2021-07-12T16:24:18.974614
2020-10-11T07:29:45
2020-10-11T07:29:45
209,548,733
0
0
null
null
null
null
UTF-8
C++
false
false
2,479
cpp
#include<iostream> #include<vector> #include<algorithm> using namespace std; /* 思路一 * 1.先排序 * 2.递归过程中,遇到nums[i] == nums[i-1],则跳过这次递归 * 这样就避免了同层次的相同元素,而没有避免不同层次的相同元素,实现了去重。 */ class Solution { private: vector<vector<int>> res; vector<int> cur; public: vector<vector<int>> subsetsWithDup(vector<int>& nums) { sort(nums.begin(), nums.end()); BackTrack(nums, 0, nums.size()); return res; } void BackTrack(vector<int>& nums, int index, int n) { res.push_back(cur); for(int i=index; i<n; i++) { if(i != index && nums[i] == nums[i-1]) continue; cur.push_back(nums[i]); BackTrack(nums, i+1, n); cur.pop_back(); } } }; /*思路二 * 按照 无重复元素子集解法 每次给cur中添加新元素,与原有的元素组合生成新的子集。 * 示例为 nums = { 1, 2, 2} * 第一步:cur = {}, 则res = { { } } * 第二步:添加元素nums[0],则res = { { }, {1} } * 第三步:添加元素nums[1],则res = { { }, {1}, {2}, {1, 2} } * 第四步:添加元素nums[2],则res = { { }, {1}, {2}, {1, 2}, {2}, {1, 2}, {2, 2}, {1, 2, 2} } * 我们发现添加重复元素时,还会与第三步的旧解res = { { }, {1} }生成{ {2}, {1, 2} }, * 会与第三步的新解{ {2}, {1, 2} }重复,我们发现这个规律后, * 就设置遍历left,right记录前一步的新解,即记录第三步中的{ { }, {1} }, * 每次添加重复元素时,只与前一步的新解组合。 */ class Solution { private: vector<vector<int>> res; public: vector<vector<int>> subsetsWithDup(vector<int>& nums) { sort(nums.begin(), nums.end()); res.push_back(vector<int>()); int left = 0; int right = 0; int n = nums.size(); for(int i=0; i<n; i++) { int start = 0; int end = res.size() - 1; if(i != 0 && nums[i] == nums[i-1]) { start = left; end = right; } left = res.size(); for(int j=start; j<=end; j++) { vector<int> cur = res[j]; cur.push_back(nums[i]); res.push_back(cur); } right = res.size() - 1; } return res; } };
[ "zkk258369@163.com" ]
zkk258369@163.com
dba8ad70a01928a37a8f7a3ced1408509804b5e1
3aa8a1168d18eda2ce0b0855a2fd265b5b445528
/build-RefInfoEditor-Desktop_Qt_5_7_0_MinGW_32bit-Debug/debug/moc_showkeyboardfilter.cpp
8012cb0acefa29963095a15f6199a74684480609
[]
no_license
rymarchik/QtLearning
49587addbcc8f878f421dfd6c47edcda4b3618f1
14986ea6120828f05bf2dab9dc5d0cce6ee969cc
refs/heads/master
2021-01-17T20:32:15.858422
2017-01-16T13:41:09
2017-01-16T13:41:09
64,671,336
1
0
null
null
null
null
UTF-8
C++
false
false
2,783
cpp
/**************************************************************************** ** Meta object code from reading C++ file 'showkeyboardfilter.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.7.0) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../../RefInfoEditor/showkeyboardfilter.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'showkeyboardfilter.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.7.0. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_ShowKeyboardFilter_t { QByteArrayData data[1]; char stringdata0[19]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ qptrdiff(offsetof(qt_meta_stringdata_ShowKeyboardFilter_t, stringdata0) + ofs \ - idx * sizeof(QByteArrayData)) \ ) static const qt_meta_stringdata_ShowKeyboardFilter_t qt_meta_stringdata_ShowKeyboardFilter = { { QT_MOC_LITERAL(0, 0, 18) // "ShowKeyboardFilter" }, "ShowKeyboardFilter" }; #undef QT_MOC_LITERAL static const uint qt_meta_data_ShowKeyboardFilter[] = { // content: 7, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; void ShowKeyboardFilter::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObject ShowKeyboardFilter::staticMetaObject = { { &QObject::staticMetaObject, qt_meta_stringdata_ShowKeyboardFilter.data, qt_meta_data_ShowKeyboardFilter, qt_static_metacall, Q_NULLPTR, Q_NULLPTR} }; const QMetaObject *ShowKeyboardFilter::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *ShowKeyboardFilter::qt_metacast(const char *_clname) { if (!_clname) return Q_NULLPTR; if (!strcmp(_clname, qt_meta_stringdata_ShowKeyboardFilter.stringdata0)) return static_cast<void*>(const_cast< ShowKeyboardFilter*>(this)); return QObject::qt_metacast(_clname); } int ShowKeyboardFilter::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; return _id; } QT_END_MOC_NAMESPACE
[ "alexander.rymarchik@gmail.com" ]
alexander.rymarchik@gmail.com
1a864b989c02d636a73d935cfc22927e514ec171
03a4884c3feb088379967f404ebc844941695b67
/Leetcode/周赛162/11.17_4.cpp
27e24ce66096cf86ecc77f08c1512b076b2a1bd6
[]
no_license
875325155/Start_Leetcode_caishunzhe
26686ae9284be2bdd09241be2d12bc192e8684bd
af15bf61ab31748724048ca04efb5fa007d4f7f5
refs/heads/master
2020-09-02T06:42:01.896405
2020-02-17T10:42:38
2020-02-17T10:42:38
219,158,659
0
0
null
null
null
null
UTF-8
C++
false
false
672
cpp
#include<cstdio> #include<algorithm> using namespace std; struct city { char name[100]; double g1,g2,g3; double gdp; double ans; }City[1005]; int cmp1(city a,city b) { return a.gdp<b.gdp; } int cmp2(city a,city b) { return a.ans<b.ans; } int main() { int n; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%s %lf %lf %lf",&City[i].name,&City[i].g1,&City[i].g2,&City[i].g3); City[i].gdp=City[i].g1+City[i].g2+City[i].g3; City[i].ans=City[i].g3/City[i].gdp; } sort(City,City+n,cmp1); printf("%s ",City[n-1].name); sort(City+n-3,City+n,cmp2); printf("%s",City[n-1].name); return 0; }
[ "875325155@qq.com" ]
875325155@qq.com
3ee61ace8a63c88a419e16fe01eee1b0f5521f64
788aed39b7253d761079a1478594488d67c4d1ef
/ue4Prj/Source/ue4Prj/Pickable.cpp
ac3c7f2f1a73ac19b198c4b0d5d4ad3cbcd5a576
[]
no_license
Arbint/VersionCtrl
e6e384a474e0df4f9ec227ca479387f6370be1d0
b3d92a99b144eadc1dffb0f2c9548616dfe3c0d7
refs/heads/master
2020-12-14T07:42:18.521443
2017-06-29T02:41:08
2017-06-29T02:41:08
95,582,532
0
0
null
null
null
null
UTF-8
C++
false
false
772
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "Pickable.h" // Sets default values APickable::APickable() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; VisualMesh = CreateDefaultSubobject<UStaticMeshComponent>("Mesh"); VisualMesh->SetCollisionResponseToChannel(ECC_PlayerTracing, ECR_Block); VisualMesh->SetMobility(EComponentMobility::Movable); VisualMesh->SetSimulatePhysics(true); RootComponent = VisualMesh; } // Called when the game starts or when spawned void APickable::BeginPlay() { Super::BeginPlay(); } // Called every frame void APickable::Tick(float DeltaTime) { Super::Tick(DeltaTime); }
[ "jingtianli.animation@gmail.com" ]
jingtianli.animation@gmail.com
ffddf61a74de9c70c8c4b5fa6bb4c43bb047e74e
8b08822c5b94516353b0b76f1b5fea5de0d6023b
/src/multi_armed_bandit.hpp
04d222066f3d707893285c7f8bf599f845eadb6b
[]
no_license
phpisciuneri/k-armed-bandit
72f031307efd28a3587bcc3992778a79788ffb44
dd7f3d00d2d553abf20c866dde7521ca2edf60cd
refs/heads/main
2023-06-16T09:48:00.894273
2021-07-16T15:51:42
2021-07-16T15:51:42
384,190,999
0
0
null
null
null
null
UTF-8
C++
false
false
1,014
hpp
#ifndef MULTI_ARMED_BANDIT_HPP_ #define MULTI_ARMED_BANDIT_HPP_ #include <random> #include <vector> class Multi_armed_bandit { public: Multi_armed_bandit(int n_arms, std::default_random_engine& generator) : k(n_arms) { // initialize known action values from ~ N(0, 1) q_star.resize(k); std::normal_distribution<double> distribution; for (int i=0; i<k; i++) q_star[i] = distribution(generator); // initialize reward distributions from ~ N(q_star(k), 1) reward_distributions.resize(k); for (int i=0; i<k; i++) { std::normal_distribution<double> dist(q_star[i], 1); reward_distributions[i] = dist; } } double pull_arm(size_t arm, std::default_random_engine& generator) { assert(arm >=0 && arm < k); return reward_distributions[arm](generator); } private: int k; // number of arms std::vector<double> q_star; // known action values std::vector< std::normal_distribution<double> > reward_distributions; }; #endif // MULTI_ARMED_BANDIT_HPP_
[ "phpisciuneri@gmail.com" ]
phpisciuneri@gmail.com
1407ba5cfd1bbf56582870bde9822f2e06f04c92
f57e6c45958e317179926c935f36bf298a0f5e01
/Project2/DatalogProgram.h
5944745cb6fa316dbc1ec78888f88fc55e042571
[]
no_license
tlfarny/CS236
9ff3ec7872c0a28a608f3ec5892fa5f07bde35af
92584a22f993757bb874a7ad6219f0f16e7de0a8
refs/heads/master
2021-01-11T05:34:46.641720
2016-10-26T13:58:45
2016-10-26T13:58:45
71,487,018
0
0
null
null
null
null
UTF-8
C++
false
false
1,937
h
#pragma once #include <set> #include <iostream> #include <string> #include <vector> #include <fstream> #include "Predicate.h" #include "Rule.h" using namespace std; class DatalogProgram{ public: DatalogProgram(){} ~DatalogProgram(void){} void toString(){ cout<<"Schemes("<<Scheme.size()<<"):"<<endl; for (unsigned int i=0; i<Scheme.size(); i++) { cout<<" "; Scheme[i].toString(); cout<<endl; } cout<<"Facts("<<Facts.size()<<"):"<<endl; for (unsigned int i = 0; i<Facts.size(); i++) { cout<<" "; Facts[i].toString(); cout<<"."<<endl; } cout<<"Rules("<<Rules.size()<<"):"<<endl; for (unsigned int i=0; i<Rules.size(); i++) { cout<<" "; Rules[i].toString(); cout<<"."<<endl; } cout<<"Queries("<<PQueries.size()<<"):"<<endl; for (unsigned int i = 0; i<PQueries.size(); i++) { cout<<" "; PQueries[i].toString(); cout<<"?"<<endl; } cout<<"Domain("<<Domain.size()<<"):"<<endl; std::set<string>::iterator it; for (it = Domain.begin(); it!=Domain.end(); it++) { cout<<" "<<*it<<endl; } } //5 void ppushbackScheme(Predicate predicateIn){ Scheme.push_back(predicateIn); } //1 void ppushbackFacts(Predicate predicateIn){ Facts.push_back(predicateIn); } //1 void ppushbackPQueries(Predicate predicateIn){ PQueries.push_back(predicateIn); } //1 void ppushbackRules(Rule ruleIn){ Rules.push_back(ruleIn); } //1 void iinsert(string stringIn){ Domain.insert(stringIn); } //1 private: vector<Predicate> Scheme; vector<Predicate> Facts; vector<Predicate> PQueries; vector<Rule> Rules; set<string> Domain; };
[ "noreply@github.com" ]
tlfarny.noreply@github.com
6805d27c7ec0c8fca8ad1c22a9a680c8eb62dd08
f9f493d11ad7e9e088d60714fa3e0209a7e70a5b
/Harkka_Sorsakivi_Manninen/Harkka_Sorsakivi_Manninen/include/vaittamavirhe.hh
fc7f5b8458182124cd4590c86c928c5e2d78408d
[]
no_license
Hirmuli/Labyrintti
dc5e7e6ff09adea7bd09b7947b9038d20e3c4b6e
bb39e0625f11fa93639d714a5d9337245a809d3f
refs/heads/master
2021-01-10T18:36:52.004522
2015-05-04T17:58:04
2015-05-04T17:58:04
33,736,457
0
0
null
null
null
null
UTF-8
C++
false
false
2,567
hh
#ifndef JULKINEN_TOT_VAITTAMAVIRHE_HH #define JULKINEN_TOT_VAITTAMAVIRHE_HH /** * \file vaittamavirhe.hh * \brief Julkinen::Vaittamavirhe-luokan esittely. * \author ©2010 Jarmo Jaakkola <jarmo.jaakkola@tut.fi>, * TTY Ohjelmistotekniikka */ // Kantaluokat #include "virhe.hh" // Standardikirjastot #include <iosfwd> // std::basic_ostream namespace Julkinen { /** * \brief Assertio rajapinnan käyttämä virhetyyppi. */ class Vaittamavirhe : public Virhe { public: /** * \brief Vaittamavirhe rakentaja. * * \param lauseke Merkkijono. * \param tiedosto Merkkijono. * \param rivi Rivinumero. * \param funktio Merkkijono. */ Vaittamavirhe( char const* lauseke, char const* tiedosto, unsigned int rivi, char const* funktio ) throw(); /** * \brief Kopiorakentaja. * * \param toinen Kopioitava Vaittamavirhe. */ Vaittamavirhe(Vaittamavirhe const& toinen) throw(); /** * \brief Purkaja. */ virtual ~Vaittamavirhe() throw() =0; /** * \brief Virhe tiedoston kertova metodi. * * \return Palauttaa virhe tiedoston nimen. */ char const* tiedosto() const throw(); /** * \brief Virhe rivin kertova metodi. * * \return Palauttaa virheen rivin. */ unsigned int rivi() const throw(); /** * \brief Virhe funktion kertova metodi. * * \return Palauttaa virhe funktion nimen. */ char const* funktio() const throw(); /** * \brief Tulostus virran luonti metodi * * \param tuloste Perus tulostevirta. * \return Palauttaa perus tulostevirran. */ std::basic_ostream<char>& tulosta(std::basic_ostream<char>& tuloste) const; /** * \brief Yhtäsuuruus vertailu operaattori. * * \param toinen Verrattava Vaittamavirhe. */ Vaittamavirhe& operator==(Vaittamavirhe const& toinen) throw(); private: /** * \brief */ char const* tiedosto_; /** * \brief */ unsigned int rivi_; /** * \brief */ char const* funktio_; }; } #endif // JULKINEN_TOT_VAITTAMAVIRHE_HH
[ "e0tmanni@KA32012.tamk.ad" ]
e0tmanni@KA32012.tamk.ad
9e98b7a97e167cb2bfbe06aca38c7b00c7c83d9c
d4bcd690abb41c6720aab07feeb205392c712793
/Chapter 9/OOP Project/OOPProjectStep3/OOPProjectStep3/Source.cpp
32a72724477c9eb9e60586c11a630a73aa1b8192
[]
no_license
HyungMinKang/Cplusplus-Pratice
39b26bf2a58b47d29ca7401ad4c47e1b87f2f899
22aa3d93d0304bff062e63a290a20d08bcb271a8
refs/heads/master
2022-05-28T01:41:22.711717
2020-04-29T01:21:17
2020-04-29T01:21:17
259,792,112
0
0
null
null
null
null
UHC
C++
false
false
3,131
cpp
/* step3 수정사항 깊은 복사- 복사 생성자 정의 Account 클래스 */ #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstring> using namespace std; const int NAME_LEN = 20; void showMenu(void); void makeAccount(void); void depositMoney(void); void withdrawMoney(void); void showAll(void); enum { MAKE = 1, DEPOSIT, WITHDRAW, INQUIRE, EXIT }; class Account { private: char* cusName; // 고객이름 int accID; //고객 아이디 int balance; // 잔액 public: Account(int id, int money, char* name) : accID(id), balance(money) { cusName = new char[strlen(name) + 1]; strcpy(cusName, name); } Account(const Account& ref) : accID(ref.accID), balance(ref.balance) { cusName = new char[strlen(ref.cusName) + 1]; strcpy(cusName, ref.cusName); } int GetAccID() { return accID; } void Deposit(int money) { balance += money; } int Withdraw(int money) { if (balance < money) return 0; balance -= money; return money; } void ShowAccInfo() { cout << "계좌ID: " << accID << endl; cout << "이름: " << cusName << endl; cout << "잔액: " << balance << endl; } ~Account() { delete[] cusName; } }; Account* accArr[100]; //객체 배열 int accNum = 0; // 객체수 int main(void) { int choice; while (1) { showMenu(); cout << "선택: "; cin >> choice; cout << endl; switch (choice) { case MAKE: makeAccount(); break; case DEPOSIT: depositMoney(); break; case WITHDRAW: withdrawMoney(); break; case INQUIRE: showAll(); break; case EXIT: return 0; default: cout << "illegal selection!" << endl; } } return 0; } void showMenu(void) { cout << "-----Menu-----" << endl; cout << "1. 계좌개설" << endl; cout << "2. 입 금 " << endl; cout << "3. 출 금 " << endl; cout << "4. 계좌정보 전체출력 " << endl; cout << "5. 프로그래 종료 " << endl; } void makeAccount(void) { int id; char name[NAME_LEN]; int balance; cout << "계좌개설" << endl; cout << "계좌ID: "; cin >> id; cout << "이 름: "; cin >> name; cout << "입금액: "; cin >> balance; accArr[accNum++] = new Account(id, balance, name); } void depositMoney(void) { int id; int money; cout << "[입 금]" << endl; cout << "계좌ID: "; cin >> id; cout << "입금액: "; cin >> money; for (int i = 0; i < accNum; i++) { if (accArr[i]->GetAccID() == id) { accArr[i]->Deposit(money); cout << "입 금 완 료" << endl << endl; return; } } cout << "유효하지 않은 ID입니다" << endl << endl; } void withdrawMoney(void) { int money; int id; cout << "[출 금]" << endl; cout << "계좌ID: "; cin >> id; cout << "입금액: "; cin >> money; for (int i = 0; i < accNum; i++) { if (accArr[i]->GetAccID() == id) { if (accArr[i]->Withdraw(money) == 0) { cout << "잔액부족 " << endl << endl; return; } cout << "출 금 완 료" << endl << endl; return; } } cout << "유효하지 않은 ID입니다" << endl << endl; } void showAll(void) { for (int i = 0; i < accNum; i++) { accArr[i]->ShowAccInfo(); cout << endl; } }
[ "ramkid91@gmail.com" ]
ramkid91@gmail.com
e7aae108e7307ddaf212935ef993a137cc8daf31
6fa29c69e3e5ec1acf2a0c25f94d733e523b731f
/LabProject13/LabProject13/GameFramework.h
ea25c8f11358da613720c256e77f11d6ae64d295
[]
no_license
KU-t/3D-Game-Programming
62bb4062cf79e871b88522e8f7f71933b502c7b7
f4078b06362bf75a26bac6a2fc915f273a04585b
refs/heads/master
2022-02-23T13:05:21.921440
2019-06-26T11:06:59
2019-06-26T11:06:59
174,095,293
0
0
null
null
null
null
UHC
C++
false
false
3,507
h
#pragma once #include "Timer.h" #include "Player.h" #include "Scene.h" class GameFramework{ private: //게임 프레임워크에서 사용할 타이머 GameTimer m_GameTimer; //프레임 레이트를 주 윈도우의 캡션에 출력하기 위한 문자열 _TCHAR m_pszFrameRate[50]; // Scene Scene *m_pScene; // Camera Camera *m_pCamera = NULL; // Player Player *m_pPlayer = NULL; // 마지막으로 마우스 버튼을 클릭할 때의 마우스 커서의 위치 POINT m_ptOldCursorPos; HINSTANCE m_hInstance; HWND m_hWnd; int m_nWndClientWidth; int m_nWndClientHeight; IDXGIFactory4* m_pdxgiFactory; // 디스플레이 제어를 위해 IDXGISwapChain3* m_pdxgiSwapChain; // 리소스 생성을 위해 ID3D12Device* m_pd3dDevice; // 다중 샘플링을 활성화 bool m_bMsaa4xEnable = false; // 다중 샘플링 레벨을 설정 UINT m_nMsaa4xQualityLevels = 0; static const UINT m_nSwapChainBuffers = 2; //스왑체인 백버퍼 수 //스왑체인 백버퍼 현재 인덱스 UINT m_nSwapChainBufferIndex; // 렌더 타겟 버퍼 ID3D12Resource *m_ppd3dRenderTargetBuffers[m_nSwapChainBuffers]; // 렌더 타켓 서술자 힙 주소 ID3D12DescriptorHeap *m_pd3dRtvDescriptorHeap; // 렌더 타켓 서술자 원소의 크기 UINT m_nRtvDescriptorIncrementSize; // 깊이-스텐실 버퍼 ID3D12Resource *m_pd3dDepthStencilBuffer; // 디프스텐실 서술자 힙 주소 ID3D12DescriptorHeap *m_pd3dDsvDescriptorHeap; // 디프스텐실 서술자 원소의 크기 UINT m_nDsvDescriptorIncrementSize; //명령 큐, 명령 할당자, 명령 리스트 인터페이스 ID3D12CommandQueue *m_pd3dCommandQueue; ID3D12CommandAllocator *m_pd3dCommandAllocator; ID3D12GraphicsCommandList *m_pd3dCommandList; //그래픽 파이프라인 상태 ID3D12PipelineState *m_pd3dPipelineState; //펜스 인터페이스 ID3D12Fence *m_pd3dFence; UINT64 m_nFenceValues[m_nSwapChainBuffers]; HANDLE m_hFenceEvent; //if~endif: if의 내용이 참이면 endif까지 컴파일이 진행된다. #if defined(_DEBUG) ID3D12Debug *m_pd3dDebugController; #endif public: GameFramework(); ~GameFramework(); // 주 윈도우가 생성되면 호출된다. bool OnCreate(HINSTANCE hInstance, HWND hMainWnd); void OnDestory(); // 스왑체인 생성 void CreateSwapChain(); // 디바이스 생성 void CreateDirect3DDevice(); // 서술자 힙 생성 void CreateRtvAndDsvDescriptorHeaps(); // 명령 큐, 할당자, 리스트 생성 void CreateCommandQueueAndList(); // 렌더 타겟 뷰 생성 void CreateRenderTargetViews(); // 깊이 - 스텐실 뷰 생성 void CreateDepthStencilViews(); // 렌더링할 메쉬와 게임 객체를 생성 void BuildObjects(); // 렌더링할 메쉬와 게임 객체를 소멸 void ReleaseObjects(); // 프레임위크의 핵심(사용자 입력, 애니메이션, 렌더링)을 구성하는 함수 void ProcessInput(); void AnimateObject(); void FrameAdvance(); // CPU와 GPU를 동기화하는 함수이다. void WaitForGpuComplete(); //[따라하기5 fullscreenmode] void ChangeSwapChainState(); void MoveToNextFrame(); // 윈도우의 메시지(키보드, 마우스 입력)을 처리하는 함수 void OnProcessingMouseMessage(HWND hWnd, UINT nMessageID, WPARAM wParam, LPARAM lParam); void OnProcessingKeyboardMessage(HWND hWnd, UINT nMessageID, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK OnProcessingWindowMessage(HWND hWnd, UINT nMessageID, WPARAM wParam, LPARAM lParam); };
[ "jhltk2426@naver.com" ]
jhltk2426@naver.com
0e48a0784bc7daadc65c37b8d8cdb008759cc81d
6929e7c71a6b12294a5307640ac04628221e5d54
/2749.cpp
46d280b2ea3f5ec51efaea7a792672cbfae4bbf2
[]
no_license
right-x2/Algorithm_study
2ad61ea80149cfe20b8248a6d35de55f87385c02
a1459bfc391d15a741c786d8c47394a3e1337dc6
refs/heads/master
2021-06-29T23:13:56.230954
2021-03-03T08:25:35
2021-03-03T08:25:35
216,532,752
0
0
null
null
null
null
UTF-8
C++
false
false
495
cpp
#include <iostream> using namespace std; long long arr[4]={0,1,2,0}; int fibo(long long x, long long n) { long long a; if (n==1) return 1; else if(n==2) return 2; else if(x==n) return arr[3]; else { arr[3] = (arr[2]+arr[1])%1000000; a = arr[2]; arr[2] = arr[3]; arr[1] = a; x++; fibo(x, n); } } int main() { long long x; cin>>x; int k = (x/1000); int a = x - (x/1000); for (int i = 0; i < k; ++i) { fibo(3,1000); } //int a = x/1000; x = fibo(3,a); cout<<x<<""; }
[ "kjw970103@gmail.com" ]
kjw970103@gmail.com
8f082dfb0cc805a168500f84bc9beb4848dffda0
aff0153d6d792b1396a34813809b1c2b4738a157
/Engine/include/kat/renderer/VertexArray.hpp
e7deb80709b4c3c00279b3678ba1d1a85a128ba5
[ "MIT" ]
permissive
superspeeder/thegame
1614593bfb8afd59bf7d4d96c227c857b4334dcd
a8b80c919b6790236e9496ed1cdcbe1649fa3344
refs/heads/master
2023-03-17T17:23:27.461069
2021-03-11T17:23:12
2021-03-11T17:23:12
345,518,190
0
0
null
null
null
null
UTF-8
C++
false
false
438
hpp
#pragma once #include <glad/glad.h> #include "kat/renderer/Buffer.hpp" namespace kat { class VertexArray { private: uint32_t m_VertexArray; uint32_t m_NextIndex = 0; public: VertexArray(); ~VertexArray(); void bind(); void unbind(); void attachEBO(kat::ElementBuffer* ebo); void attribute(uint32_t size, uint32_t stride, uint32_t offset); void vbo(kat::VertexBuffer* vbo, std::vector<uint32_t> defs); }; }
[ "andy@delusion.org" ]
andy@delusion.org
073ade734c17a6dd23400224a13e62112dcd8ee3
4597f9e8c2772f276904b76c334b4d181fa9f839
/C++/First-Missing-Positive.cpp
20148f4dc840a2676ee855c4ed47615c1a5d336b
[]
no_license
xxw1122/Leetcode
258ee541765e6b04a95e225284575e562edc4db9
4c991a8cd024b504ceb0ef7abd8f3cceb6be2fb8
refs/heads/master
2020-12-25T11:58:00.223146
2015-08-11T02:10:25
2015-08-11T02:10:25
40,542,869
2
6
null
2020-09-30T20:54:57
2015-08-11T13:21:17
C++
UTF-8
C++
false
false
624
cpp
class Solution { public: int firstMissingPositive(vector<int>& nums) { int cur = 0; while (cur < nums.size()) { while (nums[cur] != cur + 1) { if (nums[cur] > nums.size() || nums[cur] <= 0) { break; } else { if (nums[nums[cur] - 1] == nums[cur]) break; swap(nums[cur], nums[nums[cur] - 1]); } } cur ++; } for (int i = 0; i < nums.size(); i ++) { if (nums[i] != i + 1) return i + 1; } return nums.size() + 1; } };
[ "jiangyi0425@gmail.com" ]
jiangyi0425@gmail.com
2a5c1b35af01afca4bab98b00bd1e828b46a1822
5a60d60fca2c2b8b44d602aca7016afb625bc628
/aws-cpp-sdk-iotwireless/include/aws/iotwireless/model/TagResourceResult.h
3fb3cb40432ffea19cf708c4faa9a112bdf74813
[ "Apache-2.0", "MIT", "JSON" ]
permissive
yuatpocketgems/aws-sdk-cpp
afaa0bb91b75082b63236cfc0126225c12771ed0
a0dcbc69c6000577ff0e8171de998ccdc2159c88
refs/heads/master
2023-01-23T10:03:50.077672
2023-01-04T22:42:53
2023-01-04T22:42:53
134,497,260
0
1
null
2018-05-23T01:47:14
2018-05-23T01:47:14
null
UTF-8
C++
false
false
800
h
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/iotwireless/IoTWireless_EXPORTS.h> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace IoTWireless { namespace Model { class TagResourceResult { public: AWS_IOTWIRELESS_API TagResourceResult(); AWS_IOTWIRELESS_API TagResourceResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); AWS_IOTWIRELESS_API TagResourceResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); }; } // namespace Model } // namespace IoTWireless } // namespace Aws
[ "aws-sdk-cpp-automation@github.com" ]
aws-sdk-cpp-automation@github.com
d5d52a68655d2d0f84aaefd0a82b3f9bbc114817
ce814fc0678bc864f8d38362660adc8de9e25329
/Coursework/nclgl/Mesh.h
82ea6f3ea3a076bb3cf0e4da85cf70dcb575c4bc
[]
no_license
nutiel/CSC5802
c7329e3a4062b3e80bae0add7a6bcb349fb6394d
d0e26f9249625c90f98d856d707e68a75527c866
refs/heads/master
2021-08-18T21:34:21.308191
2017-11-23T21:06:09
2017-11-23T21:06:09
110,700,424
0
0
null
null
null
null
UTF-8
C++
false
false
1,119
h
#pragma once #include "OGLRenderer.h" enum MeshBuffer { VERTEX_BUFFER, COLOUR_BUFFER, TEXTURE_BUFFER, NORMAL_BUFFER, TANGENT_BUFFER, INDEX_BUFFER, MAX_BUFFER }; class Mesh { public: Mesh(void); ~Mesh(void); virtual void Draw(); static Mesh * GenerateTriangle(float x, float y, float z); static Mesh * GenerateSquare(float x, float y, float z); static Mesh * GenerateQuad(); static Mesh * GeneratePyramid(); void SetTexture(GLuint tex) { texture = tex; } void SetBumpMap(GLuint tex) { bumpTexture = tex; } GLuint GetBumpMap() { return bumpTexture; } GLuint GetTexture() { return texture; } protected: unsigned int * indices; void GenerateNormals(); void BufferData(); void GenerateTangents(); Vector3 GenerateTangent(const Vector3 &a, const Vector3 &b, const Vector3 &c, const Vector2 & ta,const Vector2 & tb, const Vector2 & tc); Vector3 * tangents; GLuint bumpTexture; GLuint texture; GLuint numIndices; GLuint arrayObject; GLuint bufferObject[MAX_BUFFER]; GLuint numVertices; GLuint type; Vector2 * textureCoords; Vector3 * vertices; Vector3 * normals; Vector4 * colours; };
[ "32769684+nutiel@users.noreply.github.com" ]
32769684+nutiel@users.noreply.github.com
c115ec5974c812caea42f391e5e1810a24abfec4
51c59bc864255b95ee29f9a87f1a9f84acbcc25b
/YellowBelt/Week3/Task3/bus_manager.cpp
88d1a32e76931303726ecb4697ae29c44673bc22
[]
no_license
Handwhale/Coursera
2c8d6c25d6aba357a8172d4663f6640c1350d042
e4fcf28394203f274a9180d4a7d30ee380d262fb
refs/heads/master
2021-07-04T16:58:32.559122
2020-11-01T10:55:38
2020-11-01T10:55:38
195,672,184
0
0
null
null
null
null
UTF-8
C++
false
false
772
cpp
#include "bus_manager.h" #include <vector> void BusManager::AddBus(const string &bus, const vector<string> &stops) { buses_to_stops[bus] = stops; for (const auto &item : stops) { stops_to_buses[item].push_back(bus); } } BusesForStopResponse BusManager::GetBusesForStop(const string &stop) const { if (stops_to_buses.count(stop) == 0) { return {}; // No stops } else { return {stops_to_buses.at(stop)}; } } StopsForBusResponse BusManager::GetStopsForBus(const string &bus) const { if (buses_to_stops.count(bus) == 0) { return {}; // No buses } else { return {bus, buses_to_stops.at(bus), stops_to_buses}; } } AllBusesResponse BusManager::GetAllBuses() const { return {buses_to_stops}; }
[ "mr.rabbiton@gmail.com" ]
mr.rabbiton@gmail.com
59cb28ded54536f411976be14cad000c2b8373a2
c76346e1ac0e6ac32c2ada9496a5a92133146ced
/src/cpu_bsplv.cpp
49b581cb0b006bb7cfbe96ebf2d4212082977f5f
[]
no_license
mhieronymus/GUSTAV
ed2cf58c4c6d4c6acf870118d88c142d9030829e
97d09ae60e6734acf06c2780d0d4f814e0800446
refs/heads/master
2020-03-30T04:14:09.223343
2018-10-19T07:34:32
2018-10-19T07:34:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,636
cpp
#include "cpu_bsplv.hpp" CPU_BSPLV::CPU_BSPLV( char * filename) { load_table(filename); } CPU_BSPLV::~CPU_BSPLV() { free_table(); } // Binary search to find the leftmost spline with support. // Uses left as first guess void CPU_BSPLV::find_left_knot( value_t * knots, index_t n_knts, index_t & left, value_t x) { if(left == n_knts) {left--; return;} if(left == n_knts-1) return; if(knots[left] < x && knots[left+1] > x) return; index_t high = n_knts; do { if(knots[left] > x) { high = left; left = left >> 1; } else { left += (high - left) >> 1; } } while(knots[left] > x || knots[left+1] < x); } /* * Evaluate the result of a full spline basis given a set of knots, a position, * an order and the leftmost spline for the position (or -1) that has support. */ value_t CPU_BSPLV::ndsplineeval_core_2( index_t * centers, index_t maxdegree, value_t * biatx) { value_t result = 0; value_t basis_tree[table->ndim+1]; index_t decomposed_pos[table->ndim]; index_t tablepos = 0; basis_tree[0] = 1; index_t nchunks = 1; for(index_t i=0; i<table->ndim; ++i) { decomposed_pos[i] = 0; tablepos += (centers[i]-table->order[i]) * table->strides[i]; basis_tree[i+1] = basis_tree[i] * biatx[i*(maxdegree+1)]; } for(index_t i=0; i<table->ndim - 1; ++i) nchunks *= (table->order[i] + 1); index_t n = 0; while(true) { // I did not see any improvements by using __builtin_expect for (index_t i = 0; __builtin_expect(i < table->order[table->ndim-1] + 1, 1); i++) // for(index_t i=0; i<table->order[table->ndim-1]+1; ++i) { result += basis_tree[table->ndim-1] * biatx[(table->ndim-1)*(maxdegree+1) + i] * table->coefficients[tablepos+i]; } if (__builtin_expect(++n == nchunks, 0)) break; // if(++n == nchunks) break; tablepos += table->strides[table->ndim-2]; decomposed_pos[table->ndim-2]++; // Now to higher dimensions index_t i; for(i=table->ndim-2; decomposed_pos[i]>table->order[i]; --i) { decomposed_pos[i-1]++; tablepos += (table->strides[i-1] - decomposed_pos[i]*table->strides[i]); decomposed_pos[i] = 0; } // for(index_t j=i; j < table->ndim-1; ++j) for (index_t j = i; __builtin_expect(j < table->ndim-1, 1); ++j) basis_tree[j+1] = basis_tree[j] * biatx[j*(maxdegree+1) + decomposed_pos[j]]; } return result; } // See "A Practical Guide to Splines (revisited)" by Carl de Boor () // Chapter X, page 112f /* See "A Practical Guide to Splines (revisited)" by Carl de Boor () * Chapter X, page 112f * Input: knots = knot sequence (non-decreasing) * jhigh = the number of columns-1 of values that shall be generated * should agree with the order * index = order of spline * x = the point at which the splines shall be evaluated * left = index with knots[left] <= x <= knots[left+1] * biatx = help array that stores the evaluations */ void CPU_BSPLV::bsplvb_2( value_t * knots, index_t jhigh, index_t index, value_t x, index_t left, value_t * biatx, index_t nknots) { index_t j = 0; // In case if x is outside of the full support of the spline surface. if(left == jhigh) { while(left >= 0 && x < knots[left]) left--; } else if(left == nknots-jhigh-2) { while (left < nknots-1 && x > knots[left+1]) left++; } if(index != 2) { biatx[j] = 1; // Check if no more columns need to be evaluated. if(j >= jhigh) return; } value_t delta_r[jhigh]; value_t delta_l[jhigh]; do { delta_r[j] = knots[left + j + 1] - x; delta_l[j] = x - knots[left-j]; value_t saved = 0; for(index_t i=0; i<=j; ++i) { value_t term = biatx[i] / (delta_r[i] + delta_l[j-i]); biatx[i] = saved + delta_r[i] * term; saved = delta_l[j-i] * term; } biatx[j+1] = saved; j++; } while(j < jhigh); // shouldn't that be sufficient? /* * If left < (spline order), only the first (left+1) * splines are valid; the remainder are utter nonsense. * TODO: Check why */ index_t i = jhigh-left; if (i > 0) { for (j = 0; j < left+1; j++) biatx[j] = biatx[j+i]; /* Move valid splines over. */ for ( ; j <= jhigh; j++) biatx[j] = 0.0; /* The rest are zero by construction. */ } i = left+jhigh+2-nknots; if (i > 0) { for (j = jhigh; j > i-1; j--) biatx[j] = biatx[j-i]; for ( ; j >= 0; j--) biatx[j] = 0.0; } } value_t CPU_BSPLV::wiki_bsplines( value_t * knots, value_t x, index_t left, index_t order) { if(order == 0) { if(knots[left] <= x && x < knots[left+1]) return 1; return 0; } value_t result = (x-knots[left]) * wiki_bsplines(knots, x, left, order-1) / (knots[left+order] - knots[left]); result += (knots[left+order+1] - x) * wiki_bsplines(knots, x, left+1, order-1) / (knots[left+order+1] - knots[left+1]); return result; } // Create n_evals times a random array of size n_dims and evaluate the spline void CPU_BSPLV::eval_splines( index_t n_evals, value_t * y_array) { std::mt19937 engine(42); std::uniform_real_distribution<value_t> normal_dist(0, 1); value_t range[table->ndim]; index_t maxdegree = 0; for(index_t d=0; d<table->ndim; d++) { range[d] = table->knots[d][table->nknots[d]-1] - table->knots[d][0]; maxdegree = maxdegree > table->order[d] ? maxdegree : table->order[d]; } for(index_t i=0; i<n_evals; ++i) { value_t biatx[table->ndim*(maxdegree+1)]; // index_t lefties[table->ndim]; index_t centers[table->ndim]; // Get a random parameter within the splines value_t par[table->ndim]; // That's the way IceCube does that. But why search for tablecenters? for(index_t d=0; d<table->ndim; ++d) par[d] = range[d] * normal_dist(engine) + table->knots[d][0]; // We actually search for table centers. Who knows, why tablesearchcenters(table, par, centers); // For every dimension for(index_t d=0; d<table->ndim; ++d) { // Get the values bsplvb_2( table->knots[d], table->order[d], 1, par[d], centers[d], &(biatx[d*(maxdegree+1)]), table->nknots[d] ); } // store y or something // y_array[i] = biatx[(table->ndim)*(maxdegree + 1) - 1]; y_array[i] = ndsplineeval_core_2(centers, maxdegree, biatx); } } /* * The original IceCube call. */ void CPU_BSPLV::eval_splines_vanilla( index_t n_evals, value_t * y_array) { std::mt19937 engine(42); std::uniform_real_distribution<value_t> normal_dist(0, 1); value_t range[table->ndim]; for(index_t d=0; d<table->ndim; d++) { range[d] = table->knots[d][table->nknots[d]-1] - table->knots[d][0]; } for(index_t i=0; i<n_evals; ++i) { index_t centers[table->ndim]; // Get a random parameter within the splines value_t par[table->ndim]; for(index_t d=0; d<table->ndim; d++) par[d] = range[d] * normal_dist(engine) + table->knots[d][0]; // We actually search for table centers. Who knows, why tablesearchcenters(table, par, centers); y_array[i] = ndsplineeval(table, par, centers, 0); } } /* * Evaluate the splines as in IceCube but use my multi dimensional overall * evaluation. */ void CPU_BSPLV::eval_splines_simple( index_t n_evals, value_t * y_array) { std::mt19937 engine(42); std::uniform_real_distribution<value_t> normal_dist(0, 1); value_t range[table->ndim]; index_t maxdegree = 0; for(index_t d=0; d<table->ndim; d++) { range[d] = table->knots[d][table->nknots[d]-1] - table->knots[d][0]; maxdegree = maxdegree > table->order[d] ? maxdegree : table->order[d]; } for(index_t i=0; i<n_evals; ++i) { value_t biatx[table->ndim*(maxdegree+1)]; // index_t lefties[table->ndim]; index_t centers[table->ndim]; // Get a random parameter within the splines value_t par[table->ndim]; for(index_t d=0; d<table->ndim; d++) par[d] = range[d] * normal_dist(engine) + table->knots[d][0]; tablesearchcenters(table, par, centers); // For every dimension for(index_t d=0; d<table->ndim; d++) { bsplvb_simple( table->knots[d], table->nknots[d], par[d], centers[d], table->order[d]+1, &(biatx[d*(maxdegree+1)]) ); } // store y or something // y_array[i] = biatx[(table->ndim)*(maxdegree + 1) - 1]; y_array[i] = ndsplineeval_core_2(centers, maxdegree, biatx); } } void CPU_BSPLV::load_table( char * filename) { if(table != nullptr) free_table(); table = new splinetable(); std::cout << "loading from " << filename << "\n"; start("load_from_file"); // Load a spline file from a file given by the command line if(!load_splines(table, filename)) { std::cout << "Failed to load. Abort the mission!\n"; std::cout << "I repeat: Abort the mission!\n"; } stop(); } void CPU_BSPLV::free_table() { for(index_t i=0; i<table->ndim; ++i) free(table->knots[i] - table->order[i]); free(table->knots); free(table->order); free(table->nknots); free(table->periods); free(table->coefficients); free(table->naxes); free(table->strides); free(table->extents[0]); free(table->extents); for(index_t i=0; i<table->naux; ++i) { free(table->aux[i][1]); free(table->aux[i][0]); free(table->aux[i]); } free(table->aux); delete table; }
[ "mhierony@students.uni-mainz.de" ]
mhierony@students.uni-mainz.de
ebca16559a7918d8a8458a191b9abc8b0fbf90ba
bad323acc2683952743071f3dfaf7df09e799af0
/WEEK_4/BOOKS1.cpp
c063eec4e0ad75d8694e79c354fd5bcca3db61cc
[]
no_license
hoangIT1/Applied-Algorithm
f9dd93befc07cfad13f8cfd0791cfd1ef2b1d18a
687067390bddb482071d4a987afba52075b93e2e
refs/heads/main
2023-04-30T07:18:01.815311
2021-05-11T17:06:04
2021-05-11T17:06:04
348,368,929
1
1
null
2021-04-22T17:42:54
2021-03-16T14:00:33
C++
UTF-8
C++
false
false
1,301
cpp
#include <bits/stdc++.h> using namespace std; long long int N; long long int m,k; long long int P[505],b[505],ans[505]; bool is_divided(long long int maxval) { long long int sum = 0; long long int cnt = 0; for (int i = 1;i<=m;i++) { b[i] = 0; } for (int i = m;i>=1;i--) { if (sum+P[i]<=maxval && i>=k-cnt) sum+=P[i]; else { sum = P[i]; b[i] = 1; cnt++; } } if (cnt == k-1) { for (int i = 1;i<=m;i++) { ans[i] = b[i]; } return true; } return false; } void print_result() { for (int i = 1;i<=m;i++) { cout<<P[i]; if (ans[i] == 0) cout<<" "; if (ans[i] == 1) cout<<" / "; } cout<<endl; } int main() { cin>>N; while (N--) { cin>>m>>k; long long int mid = 0; long long int high; long long int low = 0; for (int i = 1;i<=m;i++) { cin>>P[i]; high+=P[i]; low=max(low,P[i]); } memset(ans,0,sizeof(ans)); while (low<=high) { mid = (high+low)/2; if (is_divided(mid)) { high = mid-1; } else low = mid+1; } print_result(); } return 0; }
[ "noreply@github.com" ]
hoangIT1.noreply@github.com
93df2275918f6d65f6e197bba8b5412a613c441b
7579d827cb7b50b438dfd9ef6fa80ba2797848c9
/sources/plug_wx/src/luna/bind_wxAuiNotebookPage.cpp
c2a1591585c67e521b8ba11b61252eca8006ae03
[]
no_license
roche-emmanuel/sgt
809d00b056e36b7799bbb438b8099e3036377377
ee3a550f6172c7d14179d9d171e0124306495e45
refs/heads/master
2021-05-01T12:51:39.983104
2014-09-08T03:35:15
2014-09-08T03:35:15
79,538,908
3
0
null
null
null
null
UTF-8
C++
false
false
4,276
cpp
#include <plug_common.h> class luna_wrapper_wxAuiNotebookPage { public: typedef Luna< wxAuiNotebookPage > luna_t; inline static bool _lg_typecheck___eq(lua_State *L) { if( lua_gettop(L)!=2 ) return false; if( !Luna<void>::has_uniqueid(L,1,43006525) ) return false; return true; } static int _bind___eq(lua_State *L) { if (!_lg_typecheck___eq(L)) { luaL_error(L, "luna typecheck failed in __eq function, expected prototype:\n__eq(wxAuiNotebookPage*). Got arguments:\n%s",luna_dumpStack(L).c_str()); } wxAuiNotebookPage* rhs =(Luna< wxAuiNotebookPage >::check(L,2)); wxAuiNotebookPage* self=(Luna< wxAuiNotebookPage >::check(L,1)); if(!self) { luaL_error(L, "Invalid object in function call __eq(...)"); } lua_pushboolean(L,self==rhs?1:0); return 1; } inline static bool _lg_typecheck_fromVoid(lua_State *L) { if( lua_gettop(L)!=1 ) return false; if( !Luna<void>::has_uniqueid(L,1,3625364) ) return false; return true; } static int _bind_fromVoid(lua_State *L) { if (!_lg_typecheck_fromVoid(L)) { luaL_error(L, "luna typecheck failed in fromVoid function, expected prototype:\nfromVoid(void*). Got arguments:\n%s",luna_dumpStack(L).c_str()); } wxAuiNotebookPage* self= (wxAuiNotebookPage*)(Luna< void >::check(L,1)); if(!self) { luaL_error(L, "Invalid object in function call fromVoid(...)"); } Luna< wxAuiNotebookPage >::push(L,self,false); return 1; } inline static bool _lg_typecheck_asVoid(lua_State *L) { if( lua_gettop(L)!=1 ) return false; if( !Luna<void>::has_uniqueid(L,1,43006525) ) return false; return true; } static int _bind_asVoid(lua_State *L) { if (!_lg_typecheck_asVoid(L)) { luaL_error(L, "luna typecheck failed in fromVoid function, expected prototype:\nasVoid(). Got arguments:\n%s",luna_dumpStack(L).c_str()); } void* self= (void*)(Luna< wxAuiNotebookPage >::check(L,1)); if(!self) { luaL_error(L, "Invalid object in function call asVoid(...)"); } Luna< void >::push(L,self,false); return 1; } // Base class dynamic cast support: inline static bool _lg_typecheck_dynCast(lua_State *L) { if( lua_gettop(L)!=2 ) return false; if( lua_type(L,2)!=LUA_TSTRING ) return false; return true; } static int _bind_dynCast(lua_State *L) { if (!_lg_typecheck_dynCast(L)) { luaL_error(L, "luna typecheck failed in dynCast function, expected prototype:\ndynCast(const std::string &). Got arguments:\n%s",luna_dumpStack(L).c_str()); } std::string name(lua_tostring(L,2),lua_objlen(L,2)); wxAuiNotebookPage* self=(Luna< wxAuiNotebookPage >::check(L,1)); if(!self) { luaL_error(L, "Invalid object in function call dynCast(...)"); } static LunaConverterMap& converters = luna_getConverterMap("wxAuiNotebookPage"); return luna_dynamicCast(L,converters,"wxAuiNotebookPage",name); } // Constructor checkers: // Function checkers: // Operator checkers: // (found 0 valid operators) // Constructor binds: // Function binds: // Operator binds: }; wxAuiNotebookPage* LunaTraits< wxAuiNotebookPage >::_bind_ctor(lua_State *L) { return NULL; // No valid default constructor. } void LunaTraits< wxAuiNotebookPage >::_bind_dtor(wxAuiNotebookPage* obj) { delete obj; } const char LunaTraits< wxAuiNotebookPage >::className[] = "wxAuiNotebookPage"; const char LunaTraits< wxAuiNotebookPage >::fullName[] = "wxAuiNotebookPage"; const char LunaTraits< wxAuiNotebookPage >::moduleName[] = "wx"; const char* LunaTraits< wxAuiNotebookPage >::parents[] = {0}; const int LunaTraits< wxAuiNotebookPage >::hash = 43006525; const int LunaTraits< wxAuiNotebookPage >::uniqueIDs[] = {43006525,0}; luna_RegType LunaTraits< wxAuiNotebookPage >::methods[] = { {"dynCast", &luna_wrapper_wxAuiNotebookPage::_bind_dynCast}, {"__eq", &luna_wrapper_wxAuiNotebookPage::_bind___eq}, {"fromVoid", &luna_wrapper_wxAuiNotebookPage::_bind_fromVoid}, {"asVoid", &luna_wrapper_wxAuiNotebookPage::_bind_asVoid}, {0,0} }; luna_ConverterType LunaTraits< wxAuiNotebookPage >::converters[] = { {0,0} }; luna_RegEnumType LunaTraits< wxAuiNotebookPage >::enumValues[] = { {0,0} };
[ "roche.emmanuel@gmail.com" ]
roche.emmanuel@gmail.com
9e7898d3f2ba8258fdfb3ab370a984326733e92a
8263d56e3b565bdbec506b3823a9e4f1361ce284
/19-01to03/qt_udpsocket/netcomm/cameradatapool.cpp
0cdea1a8e7edaf96a515e23905b53535676a288b
[ "MIT" ]
permissive
18325391772/blog-code-example
52268d63f08a441f3a4819ae62c8d278c22d1baf
8ea0cc00855334da045b4566072611c24c14c844
refs/heads/master
2020-05-30T12:23:52.054077
2019-05-31T03:54:27
2019-05-31T03:54:27
189,733,193
0
0
MIT
2019-06-01T12:59:48
2019-06-01T12:59:47
null
UTF-8
C++
false
false
656
cpp
#include "cameradatapool.h" #include <QDebug> template<class T> DataObjPool<T>::DataObjPool(int size) { T *pt; pool.reserve(size); for(int i = 0; i < size; i++) { pt = new T(); pt->setValid(true); pt->setId(i); pool.append(pt); } numAvailable = size; } template <class T> template <class T2> DataObjPool<T>::operator DataObjPool<T2>() { Stack<T2> StackT2; for (int i = 0; i < m_size; i++) { StackT2.push((T2)m_pT[m_size - 1]); } return StackT2; } RawDataObjPool::RawDataObjPool(int size) : DataObjPool(size) { } LineDataPool::LineDataPool(int size) : DataObjPool(size) { }
[ "752736341@qq.com" ]
752736341@qq.com
093d5b7e52c133f037ecaba064ed6ebb67163429
f5f053975aadd70cadbf3831cb27d2873e51c808
/ceEngine/Texture_D3D.cpp
3a24097806d03bfe283b84256608137b2ec1e785
[]
no_license
YoelShoshan/Dooake
fd5ded20b21075276c27899215392f6078d8713e
254b74bc8fa30d38511d5bda992a59253cc8c37d
refs/heads/master
2021-01-20T11:11:23.048481
2016-09-15T20:03:32
2016-09-15T20:03:32
68,323,638
1
0
null
null
null
null
UTF-8
C++
false
false
2,826
cpp
#include "stdafx.h" #include "Texture_D3D.h" #include "Defines.h" #include "LogFile.h" extern ILogFile* g_pLogFile; #include "ce.h" #include <string> #include "stdio.h" /////////////////////////////////////////////////////////////////// // RESTORE RESTORE RESTORE RESTORE RESTORE RESTORE RESTORE RESTORE #include "TextureManager.h" /////////////////////////////////////////////////////////////////// extern LPDIRECT3DDEVICE9 g_pDirect3DDevice; CTexture_D3D::CTexture_D3D() { m_pD3DTexture = NULL; } CTexture_D3D::~CTexture_D3D() { char message[200]; sprintf_s(message,200,"deleting texture: ""%s"".",m_pcTexName); ////////////////////////////////////////////////////////////////////////////////////////// // RESTORE RESTORE RESTORE RESTORE RESTORE RESTORE RESTORE RESTORE st_TextureManager->Unregister(m_pcTexName); // unregister this texture from the tex manager ////////////////////////////////////////////////////////////////////////////////////////// SafeDeleteArray(m_pcTexName); SAFE_RELEASE(m_pD3DTexture); g_pLogFile->OutPutPlainText(message,LOG_MESSAGE_INFORMATIVE); } bool CTexture_D3D::FindTextureExtension(char *strFileName) { // i need to avoid all the string copies // which i'm doing because of the find-extension process (for q3 maps)... FILE *fp = NULL; // if already has extension, change nothing. if((fp = fopen(strFileName, "rb")) != NULL) return true; std::string strJPGPath; std::string strTGAPath; std::string strBMPPath; strJPGPath+=strFileName; strJPGPath+=".jpg"; strTGAPath+=strFileName; strTGAPath+=".tga"; strBMPPath+=strFileName; strBMPPath+=".bmp"; if((fp = fopen(strJPGPath.c_str(), "rb")) != NULL) { strcat(strFileName, ".jpg"); fclose(fp); return true; } if((fp = fopen(strTGAPath.c_str(), "rb")) != NULL) { strcat(strFileName, ".tga"); fclose(fp); return true; } if((fp = fopen(strBMPPath.c_str(), "rb")) != NULL) { strcat(strFileName, ".bmp"); fclose(fp); return true; } return false; } bool CTexture_D3D::Load(const char* strFileName,bool bMipMap,bool bClamp, bool bCompress) { if(!strFileName) { BREAKPOINT(1); return false; } static char ExtendedName[500]; strcpy(ExtendedName,strFileName); if (!FindTextureExtension(ExtendedName)) return false; if (D3DXCreateTextureFromFile(g_pDirect3DDevice,ExtendedName,&m_pD3DTexture)!=D3D_OK) return false; // I MUST do something like: // m_iWidth = texture width; // m_iHeight = texture height; //BREAKPOINT(1); m_pcTexName = new char[strlen(ExtendedName)+1]; strcpy(m_pcTexName,ExtendedName); return true; } void CTexture_D3D::Bind(int iSamplerNum) const { CR_ERROR(!m_pD3DTexture,"Trying to bind a null d3d texture!"); HRESULT hr = g_pDirect3DDevice->SetTexture(iSamplerNum,m_pD3DTexture); assert(SUCCEEDED(hr)); }
[ "yoelshoshan@gmail.com" ]
yoelshoshan@gmail.com
9fadac1b5794ea48fba046e23a8d080436d1a7ce
157668c81e84c9fd675a7fdcc7b350333a38f50d
/Selector.h
7b76b1e95eb00fefb0db32b4e2af3e0e94ae1a41
[]
no_license
SohaylaMohamed/Tournment-Predictor
7a0f2e480fe35f5ec37f2c44231b7211d746c3d8
e5fb7eb9b4e194e41c061cbe690c4c898b24beaf
refs/heads/master
2022-09-15T02:15:29.443818
2020-06-02T19:51:49
2020-06-02T19:51:49
268,894,565
0
0
null
null
null
null
UTF-8
C++
false
false
464
h
// // Created by sohayla on 13/03/19. // #ifndef TOURNMENT_PREDICTOR_SELECTOR_H #define TOURNMENT_PREDICTOR_SELECTOR_H #include <string> #include <map> #include "State.h" using namespace std; class Selector { private: string index; State *currentState; public: Selector(string index); string getSelection(); void updateSelectionState(bool local, bool global, bool actual); string getIndex(); }; #endif //TOURNMENT_PREDICTOR_SELECTOR_H
[ "sohaylaMohammed734@gmail.com" ]
sohaylaMohammed734@gmail.com
bf357ec8c055f8aeb88b152187db92ae8df705e3
bfd6feab3383162d4cc6f7bbecc94ed7e1fb369b
/UI/Source/Crash.h
ebc70d833db327098fe0946cb394a4224cdef76f
[ "Apache-2.0" ]
permissive
paultcn/launcher
1a9200ecf57bf8703031a442063d6ed904ce8dfe
d8397995e18200b12d60781ed485af04f70bff03
refs/heads/master
2021-07-13T00:52:56.408370
2017-09-27T09:13:31
2017-09-27T09:13:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
530
h
#ifndef __CRASH_H__ #define __CRASH_H__ #include "../JuceLibraryCode/JuceHeader.h" #include "Poco/Logger.h" class Crash : public juce::Component, public juce::ButtonListener { public: Crash(); ~Crash(); void paint (juce::Graphics&) override; void resized() override; void buttonClicked(juce::Button* button) override; private: Poco::Logger* _logger; juce::ImageComponent _crashBot; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Crash); }; #endif
[ "i@crioto.com" ]
i@crioto.com
f3bf32d9a46f4d375e16ed5c0ce2e142460ed71c
307ff7435a9b6f0090c873626ff2861ccc0b7c41
/c메모/문장만들기.cpp
521c02891538510e6a424ea89fcc6d43b9f9666e
[]
no_license
sjoon627/basic_200
eb579eca1d9633314ba98d981f426472d9109f3e
4ab045557458e40e83752b1bc017b2047c84b253
refs/heads/master
2020-09-02T04:40:31.776787
2020-04-11T14:45:03
2020-04-11T14:45:03
219,133,766
2
0
null
null
null
null
UTF-8
C++
false
false
681
cpp
#include <stdio.h> #include <string.h> int main() { freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); int l,i,j,n; char str[2][10000]={0}; int A[2][26]={0}; scanf("%s",str[0]); l=strlen(str[0]); for(i=0;i<26;i++){ A[0][i]=i; } for(i=0;i<l;i++){ A[1][str[0][i]-'a']+=1; } for(j=1;j<26;j++){ for(i=1;i<26;i++){ if(A[1][i-1]<A[1][i]){ for(j=0;j<2;j++){ n=A[j][i-1]; A[j][i-1]=A[j][i]; A[j][i]=n; } } } } i=0; do{ for(j=0;j<l;j++){ if(str[1][j]==0){ printf("%c",str[0][j]); if(A[0][i]==str[0][j]-'a') str[1][j]=1; } }printf("\n"); i++; }while(A[1][i]!=0); return 0; }
[ "48435096+sjoon627@users.noreply.github.com" ]
48435096+sjoon627@users.noreply.github.com
d386ac319fef8b60b9b768a64b4ebb5a994c9741
cfeac52f970e8901871bd02d9acb7de66b9fb6b4
/generated/src/aws-cpp-sdk-sagemaker/include/aws/sagemaker/model/AutoMLSortBy.h
71c6768156d431e4febc85c2bc0485a37b2836e2
[ "Apache-2.0", "MIT", "JSON" ]
permissive
aws/aws-sdk-cpp
aff116ddf9ca2b41e45c47dba1c2b7754935c585
9a7606a6c98e13c759032c2e920c7c64a6a35264
refs/heads/main
2023-08-25T11:16:55.982089
2023-08-24T18:14:53
2023-08-24T18:14:53
35,440,404
1,681
1,133
Apache-2.0
2023-09-12T15:59:33
2015-05-11T17:57:32
null
UTF-8
C++
false
false
659
h
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/sagemaker/SageMaker_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace SageMaker { namespace Model { enum class AutoMLSortBy { NOT_SET, Name, CreationTime, Status }; namespace AutoMLSortByMapper { AWS_SAGEMAKER_API AutoMLSortBy GetAutoMLSortByForName(const Aws::String& name); AWS_SAGEMAKER_API Aws::String GetNameForAutoMLSortBy(AutoMLSortBy value); } // namespace AutoMLSortByMapper } // namespace Model } // namespace SageMaker } // namespace Aws
[ "sdavtaker@users.noreply.github.com" ]
sdavtaker@users.noreply.github.com
d9e5fdad5396e973cbc0797fff346da2bd149651
c3f18073dac4767129e28dece885dc95525c1f53
/LeetCode/All/cpp/141.linked-list-cycle.cpp
4be4dff40aab45aeae1044682b365db21fef4adc
[ "MIT" ]
permissive
sunnysetia93/competitive-coding-problems
670ffe1ec90bfee0302f0b023c09e80bf5547e96
e8fad1a27a9e4df8b4138486a52bef044586c066
refs/heads/master
2023-08-09T04:31:24.027037
2023-07-24T12:39:46
2023-07-24T12:39:46
89,518,943
20
22
MIT
2023-07-24T12:39:48
2017-04-26T19:29:18
JavaScript
UTF-8
C++
false
false
453
cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool hasCycle(ListNode *head) { ListNode *slow = head, *fast = head; while (fast && fast->next) { slow = slow->next; fast = fast->next->next; if (slow == fast) return true; } return false; } };
[ "bhavi.dhingra@gmail.com" ]
bhavi.dhingra@gmail.com
4107e7e24488ba4dd79c841baf3d6d43edced4c8
331dd3ecae04a64b0e9d54a86c5bd9d5db6a53ac
/src/http/Url.cpp
5a349d7339cca79d20d5692e02cc4d403b5b2d3d
[]
no_license
makarenya/vantagefx
e6a3a3162beb1c29e627a5f94f8afc52ab961149
413e5568b55a1cb028063825681d32407a1fb277
refs/heads/master
2020-12-29T02:36:34.127314
2017-04-10T12:17:28
2017-04-10T12:17:28
55,528,986
0
0
null
null
null
null
UTF-8
C++
false
false
2,753
cpp
// // Created by alexx on 17.04.2016. // #include "Url.h" #ifdef _MSC_VER #pragma warning(disable : 4503) #pragma warning(push) #pragma warning(disable: 4348) // possible loss of data #endif #include <boost/lexical_cast.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/fusion/adapted.hpp> #include <boost/fusion/tuple.hpp> #include <string> #ifdef _MSC_VER #pragma warning(pop) #endif namespace vantagefx { namespace http { namespace parser { namespace qi = boost::spirit::qi; using boost::optional; typedef std::tuple<optional<std::string>, std::string, optional<int>, optional<std::string>, optional<std::string>> RawUrl; template<typename Iterator> struct UrlParser : qi::grammar<Iterator, RawUrl()> { UrlParser(); qi::rule<Iterator, RawUrl()> entry; qi::rule<Iterator, std::string()> string; qi::rule<Iterator, std::string()> domain; qi::rule<Iterator, char()> escaped; qi::rule<Iterator, std::string()> scheme; }; template <typename Iterator> UrlParser<Iterator>::UrlParser() : UrlParser::base_type(entry) { entry = -(scheme >> "://") >> domain >> -(qi::lit(':') >> qi::int_) >> -(qi::char_('/') >> string) >> -(qi::char_('#') >> string); string = +(escaped | qi::alnum | qi::char_("$_.+!*'(),/-")); domain = +(escaped | qi::alnum | qi::char_("$_.+!*'(),-")); escaped = qi::lit('%') >> qi::int_; scheme = +(qi::alnum); } } Url::Url() : _port(0) {} Url::Url(std::string url) : _port(0) { parser::RawUrl raw; parser::UrlParser<std::string::iterator> urlParser; boost::spirit::qi::parse(url.begin(), url.end(), urlParser, raw); auto scheme = std::get<0>(raw); if (scheme) _scheme = *scheme; _host = std::get<1>(raw); auto port = std::get<2>(raw); if (port) _port = *port; auto path = std::get<3>(raw); if (path) _path = *path; auto hash = std::get<4>(raw); if (hash) _hash = *hash; _uri = url; } std::string Url::serverUrl() const { if (port() == 0) return scheme() + "://" + host(); return scheme() + "://" + host() + ":" + boost::lexical_cast<std::string>(port()); } Url::operator std::string() const { return _uri; } } }
[ "alexey@deli.su" ]
alexey@deli.su
8ac3d1612b1617d2b1a66459033ce7d96637aa25
850c8077bfa06b340f54f44a425f79e2b583e415
/Source/LivingAvatars/MyAnimationBlueprintLibrary.cpp
16d2058ddb10ba2a072bcc5ea11f8626d8bc8eb7
[ "MIT" ]
permissive
adamriley1219/VRAvatarMotion
7d37fe611c022df86b802c9344779abbd3bfd179
17ca530d0a26fd77ccb9406947479585574a0aae
refs/heads/master
2021-09-14T10:33:53.168961
2018-05-11T21:11:47
2018-05-11T21:11:47
105,055,644
0
0
null
null
null
null
UTF-8
C++
false
false
125
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "MyAnimationBlueprintLibrary.h"
[ "adamriley1219@gmail.com" ]
adamriley1219@gmail.com
8837a59b9e397491c8514cf29845080c4ffb943b
579d1b8d7166bf800369b5c96c80642c6d4c187a
/misc/Insert-Interval.cpp
eae313d3b4769da6cffd28392f98d43978e920f7
[]
no_license
zephyr-bj/algorithm
bd1914d9d518ae2b8cccb0d6c3d1c9ba98dbe7bc
e2a52c533ba9bbd6d9530b672cb685ed3d9c4467
refs/heads/master
2022-10-14T01:41:45.221235
2022-09-26T08:47:51
2022-09-26T08:47:51
81,426,931
0
0
null
null
null
null
UTF-8
C++
false
false
1,536
cpp
/* * Insert-Interval.cpp * * Created on: Mar 14, 2017 * Author: Zephyr */ #include <vector> using namespace std; /** * Definition for an interval. */ struct Interval { int start; int end; Interval() : start(0), end(0) {} Interval(int s, int e) : start(s), end(e) {} }; class Solution { public: vector<Interval> insert(vector<Interval>& intervals, Interval newInterval) { int n=intervals.size(); vector<Interval>ans; if(n==0){ ans.push_back(newInterval);return ans; } bool inserted=0; for(int i=0; i<n; i++){ if(intervals[i].end<newInterval.start){ ans.push_back(intervals[i]); }else if(intervals[i].start>newInterval.end){ if(inserted==0){ ans.push_back(newInterval); inserted=1; } ans.push_back(intervals[i]); }else{ if(intervals[i].start<newInterval.start){ newInterval.start=intervals[i].start; if(intervals[i].end>newInterval.end){ newInterval.end=intervals[i].end; } }else{ if(newInterval.end<intervals[i].end){ newInterval.end=intervals[i].end; } } } } if(!inserted)ans.push_back(newInterval); return ans; } };
[ "noreply@github.com" ]
zephyr-bj.noreply@github.com
ceaa1419e7a2942b101102b19b67d496b1171197
e1bfbf48adea8cc8e2a4daa2dc1dbcb5ae811df5
/Hashing/hashChain.h
aa0efeed57b40b6208ed1913d2b036b6fe2701a2
[]
no_license
utec-cs-aed/solution_mix
c702394a719c6232baf798a18d1c76a7f8c9cf4f
06d75534ef185b770e20c4fc6a211d97bb03fd33
refs/heads/main
2023-04-20T18:32:17.694779
2021-05-10T19:48:51
2021-05-10T19:48:51
300,741,408
0
0
null
null
null
null
UTF-8
C++
false
false
1,771
h
template <typename TK, typename TV> class Hash { private: struct Node { int hashCode; TK value; TV value; Node* next; }; int arrayLength; int size; Node** array; public: Hash(int _length) { arrayLength = _length; array = new Node*[arrayLength]; for (int i = 0; i < arrayLength; i++) array[i] = nullptr; } void insert(TK key, TV value) { int hashCode = getHashCode(key); //funcion hash int index = hashCode % arrayLength; //colisiones if (array[index] == nullptr) array[index] = new Node(hashCode, value); else push_front(array[index], new Node(hashCode, key, value)); } void insert(Node* node) { int hashCode = node->hashCode; int index = hashCode % arrayLength;//colisiones node->next = nullptr; if (array[index] == nullptr) array[index] = node; push_front(array[index], node); } void rehashing() { int tempL = arrayLength; Node** temp = array; arrayLength = arrayLength * 2; array = new Node*[arrayLength]; for(int i=0;i<arrayLength;i++) array[i] = nullptr; for (int i = 0; i < tempL; i++) { for(Node* node = temp[i]; node != null; node = node->next) insert(node); } delete[] temp; } TV operator[](TK key){ //TODO } TV find(TK key){ // TODO } bool remove(TK key){ // TODO } vector<TK> getAllKeys(){ // TODO } vector<pairs<TK, TV>> getAll(){ // TODO } };
[ "heider.sanchez.pe@gmail.com" ]
heider.sanchez.pe@gmail.com
b49b4f5e70bdfdd70db0b4ecc8e8eef792efbdf5
0b049f21ccdb20c78dc8e94fdca9c5f089345642
/算法竞赛宝典/第三部资源包/第八章 线段树/天网.cpp
1b36df77ee70726b7dc9898db9eda856b741179d
[]
no_license
yannick-cn/book_caode
4eb26241056160a19a2898a80f8b9a7d0ed8dd99
5ea468841703667e5f666be49fece17ae0d5f808
refs/heads/master
2020-05-07T14:17:50.802858
2019-04-10T13:01:19
2019-04-10T13:01:19
180,582,574
0
0
null
null
null
null
GB18030
C++
false
false
1,786
cpp
//天网 #include<stdio.h> #define Max 200001 struct data { int l,r,max; }node[3*Max]; int score[Max];//保存分数 int max(int a,int b) { return a>b? a:b; } void BuildTree(int left,int right,int num)//建树 { node[num].l=left; node[num].r=right; if(left==right) { node[num].max=score[left]; } else { BuildTree(left,(left+right)>>1,2*num); BuildTree(((left+right)>>1)+1,right,2*num+1); node[num].max=max(node[2*num].max,node[2*num+1].max); } } void Update(int stu,int val,int num)//更新成绩 { node[num].max=max(val,node[num].max);//只更新最大值即可 if(node[num].l==node[num].r) return; if(stu<=node[2*num].r) Update(stu,val,2*num); else Update(stu,val,2*num+1); } int Query(int left,int right,int num)//询问操作 { if(node[num].l==left && node[num].r==right) return node[num].max; if(right<=node[2*num].r) return Query(left,right,2*num); if(left>=node[2*num+1].l) return Query(left,right,2*num+1); int mid=(node[num].l+node[num].r)>>1; return max(Query(left,mid,2*num),Query(mid+1,right,2*num+1)); } int main() { int N,M; while(scanf("%d%d",&N,&M)!=EOF) { int i; for(i=1;i<=N;i++) { scanf("%d",&score[i]); } getchar(); char c; int s,e; BuildTree(1,N,1); for(i=0;i<M;i++) { scanf("%c%d%d",&c,&s,&e); getchar(); if(c=='U') { Update(s,e,1); } if(c=='Q') { printf("%d\n",Query(s,e,1)); } } } return 0; }
[ "happyhpuyj@gmail.com" ]
happyhpuyj@gmail.com
e4a434214f75311828d431b69b07540d390f43a0
cb6588134336d847031f6e5b76ec1565ab786013
/src/interfaces/node.h
e601a964cd8151c316247dfa8da7b8df13d57d0a
[ "MIT" ]
permissive
mkscoin/mkscoin
10d4bb1ee557aa1ab50b46a36cfa66995821b888
a4436857087a727a5d1b03f8380764b04d954f04
refs/heads/master
2023-06-02T19:49:30.987647
2021-06-11T05:34:29
2021-06-11T05:34:29
375,903,358
0
0
null
null
null
null
UTF-8
C++
false
false
8,669
h
// Copyright (c) 2018 The mkscoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef mkscoin_INTERFACES_NODE_H #define mkscoin_INTERFACES_NODE_H #include <addrdb.h> // For banmap_t #include <amount.h> // For CAmount #include <net.h> // For CConnman::NumConnections #include <netaddress.h> // For Network #include <functional> #include <memory> #include <stddef.h> #include <stdint.h> #include <string> #include <tuple> #include <vector> class BanMan; class CCoinControl; class CFeeRate; class CNodeStats; class Coin; class RPCTimerInterface; class UniValue; class proxyType; struct CNodeStateStats; namespace interfaces { class Handler; class Wallet; //! Top-level interface for a mkscoin node (mkscoind process). class Node { public: virtual ~Node() {} //! Set command line arguments. virtual bool parseParameters(int argc, const char* const argv[], std::string& error) = 0; //! Set a command line argument if it doesn't already have a value virtual bool softSetArg(const std::string& arg, const std::string& value) = 0; //! Set a command line boolean argument if it doesn't already have a value virtual bool softSetBoolArg(const std::string& arg, bool value) = 0; //! Load settings from configuration file. virtual bool readConfigFiles(std::string& error) = 0; //! Choose network parameters. virtual void selectParams(const std::string& network) = 0; //! Get the (assumed) blockchain size. virtual uint64_t getAssumedBlockchainSize() = 0; //! Get the (assumed) chain state size. virtual uint64_t getAssumedChainStateSize() = 0; //! Get network name. virtual std::string getNetwork() = 0; //! Init logging. virtual void initLogging() = 0; //! Init parameter interaction. virtual void initParameterInteraction() = 0; //! Get warnings. virtual std::string getWarnings(const std::string& type) = 0; // Get log flags. virtual uint32_t getLogCategories() = 0; //! Initialize app dependencies. virtual bool baseInitialize() = 0; //! Start node. virtual bool appInitMain() = 0; //! Stop node. virtual void appShutdown() = 0; //! Start shutdown. virtual void startShutdown() = 0; //! Return whether shutdown was requested. virtual bool shutdownRequested() = 0; //! Setup arguments virtual void setupServerArgs() = 0; //! Map port. virtual void mapPort(bool use_upnp) = 0; //! Get proxy. virtual bool getProxy(Network net, proxyType& proxy_info) = 0; //! Get number of connections. virtual size_t getNodeCount(CConnman::NumConnections flags) = 0; //! Get stats for connected nodes. using NodesStats = std::vector<std::tuple<CNodeStats, bool, CNodeStateStats>>; virtual bool getNodesStats(NodesStats& stats) = 0; //! Get ban map entries. virtual bool getBanned(banmap_t& banmap) = 0; //! Ban node. virtual bool ban(const CNetAddr& net_addr, BanReason reason, int64_t ban_time_offset) = 0; //! Unban node. virtual bool unban(const CSubNet& ip) = 0; //! Disconnect node by address. virtual bool disconnect(const CNetAddr& net_addr) = 0; //! Disconnect node by id. virtual bool disconnect(NodeId id) = 0; //! Get total bytes recv. virtual int64_t getTotalBytesRecv() = 0; //! Get total bytes sent. virtual int64_t getTotalBytesSent() = 0; //! Get mempool size. virtual size_t getMempoolSize() = 0; //! Get mempool dynamic usage. virtual size_t getMempoolDynamicUsage() = 0; //! Get header tip height and time. virtual bool getHeaderTip(int& height, int64_t& block_time) = 0; //! Get num blocks. virtual int getNumBlocks() = 0; //! Get last block time. virtual int64_t getLastBlockTime() = 0; //! Get verification progress. virtual double getVerificationProgress() = 0; //! Is initial block download. virtual bool isInitialBlockDownload() = 0; //! Get reindex. virtual bool getReindex() = 0; //! Get importing. virtual bool getImporting() = 0; //! Set network active. virtual void setNetworkActive(bool active) = 0; //! Get network active. virtual bool getNetworkActive() = 0; //! Get max tx fee. virtual CAmount getMaxTxFee() = 0; //! Estimate smart fee. virtual CFeeRate estimateSmartFee(int num_blocks, bool conservative, int* returned_target = nullptr) = 0; //! Get dust relay fee. virtual CFeeRate getDustRelayFee() = 0; //! Execute rpc command. virtual UniValue executeRpc(const std::string& command, const UniValue& params, const std::string& uri) = 0; //! List rpc commands. virtual std::vector<std::string> listRpcCommands() = 0; //! Set RPC timer interface if unset. virtual void rpcSetTimerInterfaceIfUnset(RPCTimerInterface* iface) = 0; //! Unset RPC timer interface. virtual void rpcUnsetTimerInterface(RPCTimerInterface* iface) = 0; //! Get unspent outputs associated with a transaction. virtual bool getUnspentOutput(const COutPoint& output, Coin& coin) = 0; //! Return default wallet directory. virtual std::string getWalletDir() = 0; //! Return available wallets in wallet directory. virtual std::vector<std::string> listWalletDir() = 0; //! Return interfaces for accessing wallets (if any). virtual std::vector<std::unique_ptr<Wallet>> getWallets() = 0; //! Attempts to load a wallet from file or directory. //! The loaded wallet is also notified to handlers previously registered //! with handleLoadWallet. virtual std::unique_ptr<Wallet> loadWallet(const std::string& name, std::string& error, std::string& warning) = 0; //! Register handler for init messages. using InitMessageFn = std::function<void(const std::string& message)>; virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0; //! Register handler for message box messages. using MessageBoxFn = std::function<bool(const std::string& message, const std::string& caption, unsigned int style)>; virtual std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) = 0; //! Register handler for question messages. using QuestionFn = std::function<bool(const std::string& message, const std::string& non_interactive_message, const std::string& caption, unsigned int style)>; virtual std::unique_ptr<Handler> handleQuestion(QuestionFn fn) = 0; //! Register handler for progress messages. using ShowProgressFn = std::function<void(const std::string& title, int progress, bool resume_possible)>; virtual std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) = 0; //! Register handler for load wallet messages. using LoadWalletFn = std::function<void(std::unique_ptr<Wallet> wallet)>; virtual std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) = 0; //! Register handler for number of connections changed messages. using NotifyNumConnectionsChangedFn = std::function<void(int new_num_connections)>; virtual std::unique_ptr<Handler> handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn) = 0; //! Register handler for network active messages. using NotifyNetworkActiveChangedFn = std::function<void(bool network_active)>; virtual std::unique_ptr<Handler> handleNotifyNetworkActiveChanged(NotifyNetworkActiveChangedFn fn) = 0; //! Register handler for notify alert messages. using NotifyAlertChangedFn = std::function<void()>; virtual std::unique_ptr<Handler> handleNotifyAlertChanged(NotifyAlertChangedFn fn) = 0; //! Register handler for ban list messages. using BannedListChangedFn = std::function<void()>; virtual std::unique_ptr<Handler> handleBannedListChanged(BannedListChangedFn fn) = 0; //! Register handler for block tip messages. using NotifyBlockTipFn = std::function<void(bool initial_download, int height, int64_t block_time, double verification_progress)>; virtual std::unique_ptr<Handler> handleNotifyBlockTip(NotifyBlockTipFn fn) = 0; //! Register handler for header tip messages. using NotifyHeaderTipFn = std::function<void(bool initial_download, int height, int64_t block_time, double verification_progress)>; virtual std::unique_ptr<Handler> handleNotifyHeaderTip(NotifyHeaderTipFn fn) = 0; }; //! Return implementation of Node interface. std::unique_ptr<Node> MakeNode(); } // namespace interfaces #endif // mkscoin_INTERFACES_NODE_H
[ "15370399888@163.com" ]
15370399888@163.com
ef6f61e71bb0eebc8d0b82289aaf6e97658cab9f
4e49f2b456882ba8643907a196f86b3062004243
/MFCTeeChart/MFCTeeChart/TeeChar/surfaceseries.h
81c1db4b88c1f559d1c30528ef5bbd01fa448c26
[]
no_license
772148702/Artificial-Intelligence
d4616acf13a38658fc38e71874091b4a0596f6ac
3b2c48af7a88adc2d2fab01176db7c811deda1d1
refs/heads/master
2018-08-29T19:14:37.293494
2018-07-06T15:16:10
2018-07-06T15:16:10
108,261,921
0
1
null
null
null
null
UTF-8
C++
false
false
3,030
h
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++ // NOTE: Do not modify the contents of this file. If this class is regenerated by // Microsoft Visual C++, your modifications will be overwritten. // Dispatch interfaces referenced by this interface class CValueList; class CBrush1; class CPen1; class CChartHiddenPen; ///////////////////////////////////////////////////////////////////////////// // CSurfaceSeries wrapper class class CSurfaceSeries : public COleDispatchDriver { public: CSurfaceSeries() {} // Calls COleDispatchDriver default constructor CSurfaceSeries(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} CSurfaceSeries(const CSurfaceSeries& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} // Attributes public: // Operations public: long AddXYZ(double AX, double AY, double AZ, LPCTSTR AXLabel, unsigned long Value); double MaxZValue(); double MinZValue(); long GetTimesZOrder(); void SetTimesZOrder(long nNewValue); CValueList GetZValues(); double GetZValue(long Index); void SetZValue(long Index, double newValue); CBrush1 GetBrush(); CPen1 GetPen(); void AddArrayXYZ(const VARIANT& XArray, const VARIANT& YArray, const VARIANT& ZArray); void AddArrayGrid(long NumX, long NumZ, const VARIANT& XZArray); long CalcZPos(long ValueIndex); long AddPalette(double Value, unsigned long Color); unsigned long GetStartColor(); void SetStartColor(unsigned long newValue); unsigned long GetEndColor(); void SetEndColor(unsigned long newValue); long GetPaletteSteps(); void SetPaletteSteps(long nNewValue); BOOL GetUsePalette(); void SetUsePalette(BOOL bNewValue); BOOL GetUseColorRange(); void SetUseColorRange(BOOL bNewValue); void ClearPalette(); void CreateDefaultPalette(long NumSteps); unsigned long GetSurfacePaletteColor(double Y); unsigned long GetMidColor(); void SetMidColor(unsigned long newValue); void CreateRangePalette(); long GetPaletteStyle(); void SetPaletteStyle(long nNewValue); BOOL GetUsePaletteMin(); void SetUsePaletteMin(BOOL bNewValue); double GetPaletteMin(); void SetPaletteMin(double newValue); double GetPaletteStep(); void SetPaletteStep(double newValue); void InvertPalette(); void AddCustomPalette(const VARIANT& colorArray); long GetNumXValues(); void SetNumXValues(long nNewValue); long GetNumZValues(); void SetNumZValues(long nNewValue); double GetXZValue(long X, long Z); BOOL GetIrregularGrid(); void SetIrregularGrid(BOOL bNewValue); void SmoothGrid3D(); BOOL GetReuseGridIndex(); void SetReuseGridIndex(BOOL bNewValue); void FillGridIndex(long StartIndex); BOOL GetDotFrame(); void SetDotFrame(BOOL bNewValue); BOOL GetWireFrame(); void SetWireFrame(BOOL bNewValue); CBrush1 GetSideBrush(); BOOL GetSmoothPalette(); void SetSmoothPalette(BOOL bNewValue); long GetTransparency(); void SetTransparency(long nNewValue); BOOL GetFastBrush(); void SetFastBrush(BOOL bNewValue); BOOL GetHideCells(); void SetHideCells(BOOL bNewValue); CChartHiddenPen GetSideLines(); };
[ "772148702@qq.com" ]
772148702@qq.com
c63707a0834964c3e154bedfc5914cc05a594069
2277375bd4a554d23da334dddd091a36138f5cae
/ThirdParty/CUDA/include/thrust/system/detail/generic/reduce_by_key.h
e8e182aa99c61dfc682eaf52cc2c91a69ad9fbf7
[]
no_license
kevinmore/Project-Nebula
9a0553ccf8bdc1b4bb5e2588fc94516d9e3532bc
f6d284d4879ae1ea1bd30c5775ef8733cfafa71d
refs/heads/master
2022-10-22T03:55:42.596618
2020-06-19T09:07:07
2020-06-19T09:07:07
25,372,691
6
5
null
null
null
null
UTF-8
C++
false
false
2,803
h
/* * Copyright 2008-2013 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <thrust/detail/config.h> #include <thrust/system/detail/generic/tag.h> #include <thrust/iterator/iterator_traits.h> namespace thrust { namespace system { namespace detail { namespace generic { template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename OutputIterator1, typename OutputIterator2> thrust::pair<OutputIterator1,OutputIterator2> reduce_by_key(thrust::execution_policy<DerivedPolicy> &exec, InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output); template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename OutputIterator1, typename OutputIterator2, typename BinaryPredicate> thrust::pair<OutputIterator1,OutputIterator2> reduce_by_key(thrust::execution_policy<DerivedPolicy> &exec, InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, BinaryPredicate binary_pred); template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename OutputIterator1, typename OutputIterator2, typename BinaryPredicate, typename BinaryFunction> thrust::pair<OutputIterator1,OutputIterator2> reduce_by_key(thrust::execution_policy<DerivedPolicy> &exec, InputIterator1 keys_first, InputIterator1 keys_last, InputIterator2 values_first, OutputIterator1 keys_output, OutputIterator2 values_output, BinaryPredicate binary_pred, BinaryFunction binary_op); } // end namespace generic } // end namespace detail } // end namespace system } // end namespace thrust #include <thrust/system/detail/generic/reduce_by_key.inl>
[ "dingfengyu@gmail.com" ]
dingfengyu@gmail.com
f28be2d03da382d7464f610a983f84d6e3f8d966
bf26310b4c2b5010b38eabc1db859b7d2c98aaf4
/tailieu/stack.cpp
6ce82967da7f7ed5839a4a98f78139d955f7c44f
[]
no_license
nhaantran/ctdl
03ed8583a56c8a8a266afb58ff4b76e6e05e212c
7dd34adbea6ff807767cdd9f8fb4310a73841481
refs/heads/master
2023-07-03T00:29:53.042004
2021-08-08T09:04:15
2021-08-08T09:04:15
393,911,277
0
0
null
null
null
null
UTF-8
C++
false
false
846
cpp
#include <iostream> using namespace std; struct node { int info; node *pnext; }; struct List { node *phead; node *ptail; }; void createlist(List &l) { l.phead=l.ptail=NULL; } node *createnode(int info) { node *p=new node; p->info=info; p->pnext=NULL; return p; } void push(node *p, List &l) { if (l.phead == NULL) { l.phead = p; l.ptail = p; } else { p->pnext = l.phead; l.phead = p; } } void pop(List& l) { node *s = l.phead; if (s == l.ptail) { l.ptail = NULL; l.phead = NULL; } else l.phead = l.phead->pnext; delete s; } void print(List l) { node *p=l.phead; while(p!=NULL) { cout<<p->info<<" "; p=p->pnext; } }
[ "20520259@gm.uit.edu.vn" ]
20520259@gm.uit.edu.vn
09cc47113b6223766cb38eebc0e022fbf49ed53e
41ece9eafe777948758fa3c5d12bc238829164bc
/Arduino/dj_controller/dj_controller.ino
dad40ff043bab160745079b50ccedff13faef57a
[]
no_license
edition89/projects
d4d3a6ecb80cad18e74d9402c401d85077eb974a
d2052d89b2b460f8b6cb9d0f3a08904c50df7862
refs/heads/main
2023-04-06T13:02:30.321554
2021-04-19T08:46:20
2021-04-19T08:46:20
359,360,035
0
0
null
null
null
null
UTF-8
C++
false
false
6,928
ino
#define CLK 15 //Энкодер #define DT 14 #define SW 16 #define PIN 6 //Neopixel #define NUMPIXELS 32 #define ARRENC 6 // Массив действий энкодера #define DOUBLEARR 16 // Смешение на массив #define ROWS 4 // Столбцы #define COLS 4 // Строки #include <TM1638lite.h> #include "GyverEncoder.h" #include "MIDIUSB.h" #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif Encoder enc1(CLK, DT, SW, TYPE2); TM1638lite tm(4, 7, 8); byte byteTwo = 0; // Значения громкости deckA byte byteThree = 0; // Значения громкости deckB byte dval = 0; // Текущие значение кнопки byte pval = 0; // Текущие значение потенциометра bool arrEnc[ARRENC] = {true, true, true, true, true, true}; byte deckA[COLS][ROWS] = { //Массив состояния кнопок левой панели {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; byte deckB[COLS][ROWS] = { //Массив состояния кнопок правой панели {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; byte mainDigital[COLS][ROWS] = { //Массив состояния кнопок ценртальной панели {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; byte potPrVal1[COLS][ROWS] = { //Массив состояниея потенциометров 1 {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; byte potPrVal2[COLS][ROWS] = { //Массив состояниея потенциометров 1 {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; byte pitch[2] = {0, 0}; //Чтение питча Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); void setup() { Serial.begin(115200); #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif tm.reset(); pixels.begin(); pixels.setBrightness(64); } void loop() { midiEventPacket_t rx; rx = MidiUSB.read(); enc1.tick(); if (enc1.isTurn()) { // если был совершён поворот (индикатор поворота в любую сторону) if (enc1.isRight() && arrEnc[0]) changeEncoder(0, arrEnc[0]); // Удержание и поворт if (enc1.isLeft() && arrEnc[1]) changeEncoder(1, arrEnc[1]); if (enc1.isRightH() && arrEnc[2]) changeEncoder(2, arrEnc[2]); // Поворот if (enc1.isLeftH() && arrEnc[3]) changeEncoder(3, arrEnc[3]); if (enc1.isSingle() && arrEnc[4]) changeEncoder(4, arrEnc[4]); // Двойной клик if (enc1.isDouble() && arrEnc[5]) changeEncoder(5, arrEnc[5]); // Тройной клик for (byte i = 0; i < ARRENC; i++ )if (!arrEnc[i]) changeEncoder(i, arrEnc[i]); } if (rx.header != 0) { //VuMetr if (rx.byte1 == 191 && rx.byte2 == 0) byteTwo = rx.byte3; if (rx.byte1 == 191 && rx.byte2 == 1) byteThree = rx.byte3; vuMetr(); Serial.print("Received: "); Serial.print(rx.header, HEX); Serial.print("-"); Serial.print(rx.byte1, HEX); Serial.print("-"); Serial.print(rx.byte2, HEX); Serial.print("-"); Serial.println(rx.byte3, HEX); } //Аналоговые значения. Main1 for (byte col = 0; col < COLS; col++) { //-Цикл чтения значений потенциометров Столбцы for (byte row = 0; row < ROWS; row++) { //-Цикл чтения значений потенциометров Строки //pval = analogRead(*Значения с модуля мультиплексера аналоговых значений*) / 8; if (abs(pval - potPrVal1[col][row]) > 10) { //--Если текущее значение отл. от прошлого controlChange(3, 1 * col + row, pval); potPrVal1[col][row] = pval; } } } //Аналоговые значения. Main2 for (byte col = 0; col < COLS; col++) { //-Цикл чтения значений потенциометров Столбцы for (byte row = 0; row < ROWS; row++) { //-Цикл чтения значений потенциометров Строки //pval = analogRead(*Значения с модуля мультиплексера аналоговых значений*) / 8; if (abs(pval - potPrVal2[col][row]) > 10) { //--Если текущее значение отл. от прошлого controlChange(4, DOUBLEARR + 1 * col + row, pval); potPrVal2[col][row] = pval; } } } //Цифровые значения. DeckA for (byte col = 0; col < COLS; col++) { //-Цикл чтения значений кнопок Столбцы for (byte row = 0; row < ROWS; row++) { //-Цикл чтения значений кнопок Строки //dval = *Значения с модуля мультиплексера цифровых значений* if ( dval == HIGH && deckA[col][row] == LOW ) { noteOn(0, 1 * col + row , 64); MidiUSB.flush(); } if ( dval == LOW && deckA[col][row] == HIGH ) { noteOff(0, 1 * col + row, 64); MidiUSB.flush(); } deckA[col][row] = dval; } } //Цифровые значения. DeckB for (byte col = 0; col < COLS; col++) { //-Цикл чтения значений кнопок Столбцы for (byte row = 0; row < ROWS; row++) { //-Цикл чтения значений кнопок Строки //dval = *Значения с модуля мультиплексера цифровых значений* if ( dval == HIGH && deckB[col][row] == LOW ) { noteOn(1, DOUBLEARR + 1 * col + row , 64); MidiUSB.flush(); } if ( dval == LOW && deckB[col][row] == HIGH ) { noteOff(1, DOUBLEARR + 1 * col + row, 64); MidiUSB.flush(); } deckB[col][row] = dval; } } //Цифровые значения. DeckB for (byte col = 0; col < COLS; col++) { //-Цикл чтения значений кнопок Столбцы for (byte row = 0; row < ROWS; row++) { //-Цикл чтения значений кнопок Строки //dval = *Значения с модуля мультиплексера цифровых значений* if ( dval == HIGH && mainDigital[col][row] == LOW ) { noteOn(2, 2 * DOUBLEARR + 1 * col + row , 64); MidiUSB.flush(); } if ( dval == LOW && mainDigital[col][row] == HIGH ) { noteOff(2, 2 * DOUBLEARR + 1 * col + row, 64); MidiUSB.flush(); } mainDigital[col][row] = dval; } } }
[ "roman_gabibullae@mail.ru" ]
roman_gabibullae@mail.ru
a6ce341b1c339a679de64b507e70b915cf30ddc7
fdf6a2c879bf56bfa684cb82cbc09d28de5a30ce
/simplealignment.h
86aed7fdc3f9a08154fd87fd696425e2e032f5a7
[]
no_license
rickbassham/indi-celestron-cgx
2820cb230c0535cb3cc014a5f09f276c28bd5d23
1878fbd8ac8b638c596bc6df5cfeb61f4aa0f5a7
refs/heads/main
2023-02-26T09:27:43.434670
2021-02-03T22:04:20
2021-02-03T22:04:20
318,504,488
5
2
null
2021-01-02T21:39:52
2020-12-04T12:06:24
C++
UTF-8
C++
false
false
1,622
h
#pragma once #include <stdint.h> /* Simple class to map steps on a motor to RA/Dec and back on an EQ mount. Call UpdateSteps before using RADecFromEncoderValues. Or call EncoderValuesFromRADec to get the steps for a given RA/Dec. */ class EQAlignment { public: enum TelescopePierSide { PIER_UNKNOWN = -1, PIER_WEST = 0, PIER_EAST = 1 }; EQAlignment(uint32_t stepsPerRevolution); void UpdateSteps(uint32_t ra, uint32_t dec); void UpdateStepsRA(uint32_t steps); void UpdateStepsDec(uint32_t steps); void UpdateLongitude(double lng); void EncoderValuesFromRADec(double ra, double dec, uint32_t &raSteps, uint32_t &decSteps, TelescopePierSide &pierSide); void RADecFromEncoderValues(double &ra, double &dec, TelescopePierSide &pierSide); double hourAngleFromEncoder(); uint32_t encoderFromHourAngle(double hourAngle); void decAndPierSideFromEncoder(double &dec, TelescopePierSide &pierSide); uint32_t encoderFromDecAndPierSide(double dec, TelescopePierSide pierSide); double localSiderealTime(); TelescopePierSide expectedPierSide(double ra); uint32_t GetStepsAtHomePositionDec() { return m_stepsAtHomePositionDec; } uint32_t GetStepsAtHomePositionRA() { return m_stepsAtHomePositionRA; } private: uint32_t m_stepsPerRevolution; uint32_t m_stepsAtHomePositionDec; uint32_t m_stepsAtHomePositionRA; double m_stepsPerDegree; double m_stepsPerHour; uint32_t m_raSteps; uint32_t m_decSteps; double m_longitude; };
[ "brodrick.bassham@gmail.com" ]
brodrick.bassham@gmail.com
319b044afa2e5f84360e2658bd4be8639a2780f9
976aa8b8ec51241cbac230d5488ca4a24b5101dd
/lib/dart_analyzer_execreq_normalizer.h
15ec09c1f43fb183a1a67a00fd7099126239ea85
[ "BSD-3-Clause" ]
permissive
djd0723/goma-client
023a20748b363c781dce7e7536ffa2b5be601327
1cffeb7978539ac2fee02257ca0a95a05b4c6cc0
refs/heads/master
2023-03-29T07:44:30.644108
2021-03-24T11:49:54
2021-03-24T15:03:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
855
h
// Copyright 2019 The Goma Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef DEVTOOLS_GOMA_LIB_DART_ANALYZER_EXECREQ_NORMALIZER_H_ #define DEVTOOLS_GOMA_LIB_DART_ANALYZER_EXECREQ_NORMALIZER_H_ #include "lib/execreq_normalizer.h" namespace devtools_goma { class DartAnalyzerExecReqNormalizer : public ConfigurableExecReqNormalizer { protected: Config Configure( int id, const std::vector<std::string>& args, bool normalize_include_path, bool is_linking, const std::vector<std::string>& normalize_weak_relative_for_arg, const std::map<std::string, std::string>& debug_prefix_map, const ExecReq* req) const override; }; } // namespace devtools_goma #endif // DEVTOOLS_GOMA_LIB_DART_ANALYZER_EXECREQ_NORMALIZER_H_
[ "tikuta@chromium.org" ]
tikuta@chromium.org
767d664db770d1a35c6bea61e8c1a3cd06e13ec0
097b30de420bd68117a20613e4ed62f1f994626a
/crc8saej1850.h
d24002d1a7d43b10b0225b5c205b1f491b54d97b
[]
no_license
Kompot11181/BreakCRC
276a8afaeb5e26c54b7933929a0f17223cfe2c77
4fb5045b241d6b9f7aa01888170f64e0faa1af51
refs/heads/master
2022-11-10T17:00:51.352924
2020-06-27T13:29:20
2020-06-27T13:41:52
275,375,019
0
0
null
null
null
null
UTF-8
C++
false
false
593
h
#ifndef CRC8SAEJ1850_H #define CRC8SAEJ1850_H #include <QtCore> // класс, описывающий алгоритм CRC-8-SAE J1850 // x8 + x4 + x3 + x2 + 1 (0x1D | 0x100) // Нормальное представление: 0x1D // Реверсивное представление: 0xB8 // Реверснивное от обратного: 0x8E class crc8SAEJ1850 { public: crc8SAEJ1850(); void CRCInit(void); quint8 CalcCRC(QByteArray buf); quint8 crcTable[256]; bool isInited; quint8 start; quint8 polinom; quint8 xorOut; }; #endif // CRC8SAEJ1850_H
[ "chosen_i@inbox.ru" ]
chosen_i@inbox.ru
4776dcc3397d6a31edce20e052df04eaae95f1a6
1aa38513e62d081e7c3733aad9fe1487f22d7a73
/compat/shm.h
61efaf6880a2d0288b65f68930f990cba6822c96
[ "ISC", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
cpuwolf/opentrack
c3eae3700a585193b67187c6619bf32e1dedd1aa
5541cfc68d87c2fc254eb2f2a5aad79831871a88
refs/heads/unstable
2021-06-05T14:18:24.851128
2017-11-02T13:10:54
2017-11-02T13:10:54
83,854,103
1
0
null
2017-03-04T00:44:16
2017-03-04T00:44:15
null
UTF-8
C++
false
false
884
h
/* Copyright (c) 2013 Stanislaw Halik <sthalik@misaki.pl> * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. */ #pragma once #if defined(_WIN32) #include <windows.h> #else #include <stdio.h> #include <string.h> #include <sys/file.h> #include <sys/mman.h> #include <fcntl.h> #include <limits.h> #include <unistd.h> #include <sys/types.h> #endif #include "export.hpp" class OTR_COMPAT_EXPORT shm_wrapper final { void* mem; #if defined(_WIN32) HANDLE mutex, mapped_file; #else int fd, size; #endif public: shm_wrapper(const char *shm_name, const char *mutex_name, int map_size); ~shm_wrapper(); bool lock(); bool unlock(); bool success(); inline void* ptr() { return mem; } };
[ "sthalik@misaki.pl" ]
sthalik@misaki.pl
eaa77ce02591f2e0b52f55b6d4c33ad21c7ed0b9
e51382641be2b0ba5c6dfcb8952ab5bc7ee295bd
/include/Vertex.h
185728036ac4cae329fb6657bcd2107e02d750fb
[]
no_license
dragod812/Straight-Skeleton-Implementation
c55c715800b1b6d0f66634d227a61e54eeeb70b7
52dfc23b8db20e69e6e5f5ff3520ae92e47afccf
refs/heads/master
2020-03-14T09:08:28.438776
2018-04-29T23:53:52
2018-04-29T23:53:52
131,539,229
2
0
null
null
null
null
UTF-8
C++
false
false
551
h
#ifndef VERTEX_H #define VERTEX_H class Vertex; #include "Point.h" #include "CLLNode.h" #include<memory> #include "Ray.h" #include "Edge.h" #include "Direction.h" enum Type { EDGE, SPLIT }; class Vertex{ public: Point<double> coord; Ray* bisector; Edge* inEdge; Edge* outEdge; CLLNode* cllNode; bool processed; Type type; Vertex(double x, double y); Vertex(Point<double> X); Vertex operator - (const Vertex &rhs); double operator * (const Vertex &rhs); Type getType(); void calculateBisector(); }; #endif
[ "sidtastic11@gmail.com" ]
sidtastic11@gmail.com
1eb5ec136545e8c7e67712b9e62b8e415f495146
cf27788f1c1e5b732c073d99b2db0f61bb16b083
/test.cc
037b0665d2e68e557291094699a87b8f75c1f1ba
[]
no_license
mjorgen1/LinearRegressionMLE
1958db24771c01f368650a14a1be830ff85f81b2
2a79c35595b378227cdfc91d67732814ade69847
refs/heads/master
2021-06-20T04:52:27.452594
2017-06-28T19:31:08
2017-06-28T19:31:08
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,457
cc
#include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <cmath> #include "Eigen/Dense" using namespace std; using namespace Eigen; MatrixXd fromFile(const string &input_file_path) { // Reads in the file from "input_file_path" ifstream input_file(input_file_path, ifstream::in); MatrixXd m; string line; vector<float> temp_buffer; float coef; int num_cols = 0; int num_rows = 0; int cols_in_row; if (input_file) { // Iterates over every line in the input file while (!input_file.eof()) { getline(input_file, line); if (line.find_first_not_of(' ') == std::string::npos) continue; replace(line.begin(), line.end(), ',', ' '); // Creates a stringstream out of every line in the file stringstream stream(line); cols_in_row = 0; // Reads every coefficient in the stringstream into the temporary buffer while (stream >> coef) { temp_buffer.push_back(coef); ++cols_in_row; } // If the number of columns in the matrix hasn't been set, make it the // current number of columns in the row if (num_cols == 0) { num_cols = cols_in_row; // If the matrix in the file is shaped incorrectly, throw an error } else if (num_cols != cols_in_row) { cerr << "Problem with Matrix in: " + input_file_path + ", exiting..." << endl; exit(1); } ++num_rows; } // Instantiate the matrix's size and feed it the coefficients in the // temporary buffer m.resize(num_rows, num_cols); for (int i = 0; i < num_rows; ++i) for (int j = 0; j < num_cols; ++j) m(i, j) = temp_buffer[i * num_cols + j]; return m; } else { // Error for when the file doesn't exist cerr << "Cannot open file " + input_file_path + ", exiting..."<< endl; exit(1); } } VectorXd fromFile(const string &input_file_path, int num_elements) { ifstream input_file(input_file_path, ifstream::in); VectorXd m(num_elements); if (input_file) { for(int i = 0; i < num_elements; i++) input_file >> m(i); return m; } else { cerr << "Cannot open file " + input_file_path + ", exiting..." <<endl; exit(1); } } //gives the sum of squared error for two vectors float SSE(VectorXd b, VectorXd bTest, int bRows) //do i need to put in the location? { float sseNum = 0; for(int i = 0; i < 20; i++) { sseNum = sseNum + pow((b(i) - bTest(i)), 2.0); } return sseNum; } int main(){ //defines the matrices and vectors VectorXd b; MatrixXd x (1000,100); x = fromFile("/home/mackenzie/practiceCode/X-12321.csv"); VectorXd y (1000); y = fromFile("/home/mackenzie/practiceCode/y-26465.csv", 1000); VectorXd bTest(100); bTest = fromFile("/home/mackenzie/practiceCode/beta-12566.csv", 100); /*prints the matrix and vector thus far cout << "The matrix is " << x << endl; cout << "The vector is " << endl << y << endl;*/ //the formula MatrixXd xTransposed = x.transpose(); MatrixXd bPart1 = xTransposed*x; MatrixXd bPart1Inv = bPart1.inverse(); VectorXd bPart2 = xTransposed*y; b = bPart1Inv*bPart2; int bRows = b.size(); //cout << "The MLE estimator is " << endl <<b << endl; prints the b values we got float sum_of_squares = SSE(b, bTest, bRows); cout << "The sum of squared error is " << sum_of_squares << endl; }
[ "mjorgen1@villanova.edu" ]
mjorgen1@villanova.edu
c6b00d9b7b67737b7ddab6c33da4683b6d498b2d
8f2a6d9e1fbd84f2956ee0b34f5ca488558c9ab9
/reports/jscope_hugefile/write_huge.cpp
3240a1f71333476a6b6cd0bc3e8b97f8e57f4419
[]
no_license
MDSplus/MDSip-tests
51275346aaca15da76212a98c093e4e0a2b45ba2
11721c8c0d0415608d93a2501ea74ad5d1e95189
refs/heads/master
2020-12-21T23:17:58.618124
2017-05-26T12:49:52
2017-05-26T12:49:52
29,479,981
0
0
null
2017-05-26T08:37:11
2015-01-19T16:28:54
C++
UTF-8
C++
false
false
1,759
cpp
#include <mdsobjects.h> #include <stdio.h> #include <time.h> #include <math.h> #include <sys/time.h> #include<math.h> #define SEGMENT_SAMPLES 500000 #define NUM_SEGMENTS 1000 int main(int argc, char *argv[]) { int loopCount = 0; struct timespec waitTime; struct timeval currTime; waitTime.tv_sec = 0; waitTime.tv_nsec = 500000000; try { MDSplus::Tree *tree = new MDSplus::Tree("huge", -1, "NEW"); MDSplus::TreeNode *node = tree->addNode("HUGE_0", "SIGNAL"); MDSplus::TreeNode *node1 = tree->addNode("HUGE_0_RES", "SIGNAL"); delete node; delete node1; tree->write(); delete tree; tree = new MDSplus::Tree("huge", -1); tree->createPulse(1); delete tree; tree = new MDSplus::Tree("huge", 1); node = tree->getNode("HUGE_0"); node1 = tree->getNode("HUGE_0_RES"); float *values = new float[SEGMENT_SAMPLES]; double currTime = 0; double startTime, endTime; double deltaTime = 1; for(int i = 0; i < NUM_SEGMENTS; i++) { std::cout << "Writing Segment " << i << std::endl; startTime = currTime; for(int j = 0; j < SEGMENT_SAMPLES; j++) { values[j] = sin(currTime/1000.); currTime++; } endTime = currTime; MDSplus::Data *startData = new MDSplus::Float64(startTime); MDSplus::Data *endData = new MDSplus::Float64(endTime); MDSplus::Data *deltaData = new MDSplus::Float64(deltaTime); MDSplus::Data *dimData = new MDSplus::Range(startData, endData, deltaData); MDSplus::Array *valsData = new MDSplus::Float32Array(values, SEGMENT_SAMPLES); node->makeSegmentMinMax(startData, endData, dimData, valsData, node1); deleteData(dimData); deleteData(valsData); } } catch(MDSplus::MdsException &exc) { std::cout << exc.what() << std::endl; } return 0; }
[ "andrea.rigoni@pd.infn.it" ]
andrea.rigoni@pd.infn.it
6465726d9bcd0d53683cc5d3e1442ed3631db2ab
0ea91e94e0f4ce02ffb5afc1af806f660cf6131e
/Fourth/class.cpp
66c40c6f2df3ba47a992a9d169ae0b15b455c37d
[]
no_license
Syxxx/Coursework
f8399654f2cc72799d9f549c148276b4392ab4b1
40840de6fe282bf5ae59dcb4d446f027c81f9041
refs/heads/master
2021-01-20T03:06:32.670448
2017-06-12T06:08:56
2017-06-12T06:08:56
89,145,567
0
0
null
null
null
null
GB18030
C++
false
false
1,845
cpp
#include <iostream> #include "Arithmetic_H.h" using namespace std; void UserInteraction::printNumber() { switch (language) { case 1:cout << "请输入题数:"; break; case 2:cout << "Please enter a number of questions:"; break; defaul:cout << "Error!"; break; } } UserInteraction::UserInteraction() { } UserInteraction::~UserInteraction() { } void UserInteraction::getNumber(int nums) { n = nums; } void UserInteraction::chooseLanguage() { cout << "请选择语言(Please choose language)" << endl; cout << "1.中文 2.English : "; } void UserInteraction::getLaguage(int lan) { language = lan; } Expression::Expression() { } Expression::~Expression() { } void Expression::randomNumber() { digit = rand() % 3 + 4; //数字的个数 for (int i = 0; i<digit; i++) { nums[i] = rand() % 9 + 1; // 数字 } } void Expression::randomOperation() { char c[] = "+-*/"; for (int i = 0; i<digit; i++) { signs[i] = c[rand() % 4]; //符号 } signs[digit - 1] = '='; } void Expression::generateExpression() { bracketNum = rand() % 2; //括号个数 if (bracketNum == 1) { flag = 0; temp = 0; braO = rand() % ((digit - 1) / 2) + 1; braT = braO + rand() % ((digit - 1) / 2) + 2; //分别在第几个数加括号 //braO+1是第一个括号的位置,braT是第二个括号的位置 } if (bracketNum == 0) { for (int i = 0; i<digit; i++) { if (signs[i] == '/') cout << nums[i] << "÷"; else cout << nums[i] << signs[i]; } // cout<<result; } else if (bracketNum == 1) { for (int i = 0; i<digit; i++) //测试算式 { if (i == braO) cout << "("; cout << nums[i]; if (i == braT - 1) cout << ")"; if (signs[i] == '/') cout << "÷"; else cout << signs[i]; } // cout<<result; } } Answer::Answer() { } Answer::~Answer() { }
[ "303241829@qq.com" ]
303241829@qq.com
2609df0b39f6c063c07d56762615860dccea5fcb
3ef9dbe0dd6b8161b75950f682ec2fc24f79a90e
/MT_Cup/H/large.cpp
eed27722b56050c5b3b9dd739caad55933998c33
[ "MIT" ]
permissive
JackBai0914/Competitive-Programming-Codebase
abc0cb911e5f6b32d1bd14416f9eb398b7c65bb9
a1cabf0fa5072b07a7da25d66bf455eb45b0b7e9
refs/heads/main
2023-03-29T14:17:36.190798
2021-04-14T23:15:12
2021-04-14T23:15:12
358,065,977
0
0
null
null
null
null
UTF-8
C++
false
false
56,611
cpp
2 0 0 3 2 1 4 3 2 5 2 3 6 3 1 7 3 5 8 0 3 9 6 0 10 6 4 11 4 7 12 0 9 13 4 5 14 10 9 15 13 7 16 13 8 17 10 16 18 12 13 19 12 18 20 2 19 21 8 6 22 20 3 23 7 21 24 15 6 25 17 16 26 14 25 27 10 17 28 25 26 29 23 22 30 19 24 31 21 26 32 16 31 33 28 22 34 20 30 35 28 25 36 35 29 37 32 31 38 26 23 39 35 26 40 21 33 41 33 38 42 31 39 43 29 40 44 37 13 45 43 44 46 44 45 47 42 28 48 40 41 49 47 38 50 47 39 51 30 36 52 44 47 53 40 48 54 35 53 55 44 42 56 53 36 57 51 19 58 44 46 59 52 55 60 43 24 61 54 55 62 44 45 63 59 40 64 63 62 65 57 60 66 58 44 67 66 63 68 56 62 69 62 62 70 48 51 71 61 68 72 63 56 73 70 68 74 52 62 75 60 72 76 56 73 77 66 76 78 70 76 79 75 75 80 61 79 81 69 71 82 36 79 83 76 59 84 73 54 85 84 84 86 76 83 87 84 82 88 86 78 89 79 84 90 89 56 91 86 66 92 85 91 93 72 81 94 91 90 95 90 84 96 83 92 97 89 95 98 87 89 99 94 98 100 93 95 101 96 94 102 90 100 103 101 99 104 102 97 105 102 103 106 105 100 107 105 88 108 94 99 109 91 80 110 97 108 111 105 110 112 108 91 113 111 109 114 102 112 115 105 114 116 98 96 117 112 114 118 86 105 119 118 116 120 115 111 121 105 119 122 97 118 123 121 118 124 109 106 125 116 117 126 121 108 127 122 124 128 98 127 129 126 117 130 127 123 131 126 123 132 124 124 133 132 95 134 133 126 135 122 117 136 125 129 137 127 133 138 118 114 139 124 138 140 128 135 141 130 92 142 127 140 143 140 113 144 140 133 145 132 141 146 115 143 147 135 145 148 147 142 149 140 144 150 130 145 151 137 149 152 128 144 153 147 139 154 120 146 155 150 151 156 135 139 157 137 148 158 154 141 159 140 156 160 156 147 161 157 154 162 161 131 163 155 135 164 146 160 165 161 164 166 145 165 167 141 156 168 152 164 169 153 151 170 162 128 171 170 128 172 170 168 173 166 163 174 173 170 175 167 169 176 175 167 177 140 175 178 167 173 179 161 174 180 148 179 181 173 175 182 166 176 183 160 180 184 181 182 185 179 174 186 151 183 187 184 143 188 175 186 189 187 180 190 186 161 191 187 181 192 191 174 193 191 191 194 185 188 195 188 185 196 187 187 197 194 185 198 190 195 199 197 195 200 167 197 201 185 200 202 196 201 203 198 192 204 203 201 205 186 203 206 180 190 207 198 206 208 205 155 209 207 200 210 206 205 211 208 196 212 185 210 213 188 212 214 210 210 215 209 200 216 204 204 217 214 207 218 188 193 219 210 217 220 218 215 221 217 212 222 218 208 223 220 221 224 200 219 225 218 222 226 220 225 227 223 224 228 218 219 229 226 220 230 219 193 231 226 223 232 213 230 233 218 232 234 225 233 235 230 224 236 235 230 237 226 214 238 237 217 239 231 238 240 226 236 241 222 233 242 239 235 243 239 242 244 242 204 245 238 233 246 196 245 247 244 226 248 238 244 249 240 246 250 238 236 251 241 227 252 211 241 253 248 246 254 251 253 255 248 237 256 253 252 257 254 249 258 253 239 259 243 254 260 250 257 261 251 260 262 240 249 263 250 251 264 263 255 265 263 249 266 250 254 267 258 247 268 258 252 269 267 260 270 265 267 271 267 254 272 250 271 273 270 261 274 273 265 275 274 266 276 273 268 277 270 262 278 273 263 279 271 270 280 279 277 281 279 279 282 252 277 283 279 269 284 270 260 285 278 282 286 270 241 287 272 285 288 282 282 289 265 281 290 278 288 291 277 285 292 287 289 293 291 279 294 290 293 295 294 283 296 289 289 297 296 294 298 282 292 299 291 287 300 297 293 301 295 286 302 301 284 303 297 301 304 301 288 305 303 274 306 301 304 307 299 305 308 307 295 309 289 297 310 294 309 311 307 310 312 310 299 313 305 309 314 295 313 315 309 310 316 305 313 317 297 297 318 300 317 319 312 312 320 318 316 321 313 320 322 308 282 323 314 322 324 317 296 325 297 299 326 314 319 327 325 322 328 325 326 329 323 325 330 314 327 331 325 328 332 312 311 333 332 326 334 329 330 335 333 319 336 293 305 337 305 304 338 321 324 339 317 319 340 334 318 341 335 338 342 329 337 343 337 327 344 333 335 345 344 344 346 344 336 347 346 324 348 340 334 349 348 345 350 328 349 351 348 334 352 349 342 353 341 352 354 315 344 355 347 346 356 350 346 357 340 356 358 346 336 359 349 357 360 353 347 361 341 351 362 336 359 363 339 335 364 362 346 365 343 361 366 362 357 367 359 351 368 346 364 369 366 366 370 349 357 371 354 351 372 355 368 373 372 362 374 367 368 375 368 364 376 367 370 377 357 372 378 368 374 379 366 362 380 374 358 381 367 369 382 369 359 383 381 375 384 382 375 385 383 377 386 380 383 387 368 375 388 370 381 389 386 382 390 371 387 391 388 376 392 382 357 393 388 380 394 387 380 395 392 372 396 393 386 397 394 380 398 388 391 399 389 389 400 398 388 401 394 386 402 379 400 403 398 399 404 403 401 405 401 401 406 403 385 407 385 398 408 395 389 409 404 405 410 396 401 411 408 410 412 397 406 413 384 406 414 412 397 415 385 380 416 411 414 417 411 398 418 407 413 419 415 414 420 416 414 421 398 420 422 408 421 423 414 407 424 418 409 425 414 424 426 416 414 427 418 404 428 427 405 429 426 416 430 413 427 431 430 427 432 429 431 433 429 432 434 417 429 435 429 432 436 434 432 437 423 420 438 434 427 439 433 418 440 435 415 441 439 436 442 435 422 443 430 440 444 441 429 445 444 440 446 445 433 447 441 445 448 435 427 449 447 443 450 445 443 451 449 449 452 441 422 453 436 430 454 436 448 455 447 438 456 439 455 457 452 455 458 457 440 459 444 443 460 459 457 461 445 457 462 448 459 463 462 456 464 456 442 465 455 464 466 450 465 467 449 460 468 451 456 469 436 466 470 440 466 471 462 446 472 446 470 473 464 469 474 473 471 475 472 470 476 464 452 477 470 456 478 473 476 479 478 476 480 464 476 481 471 475 482 477 478 483 456 479 484 464 480 485 483 478 486 471 483 487 467 482 488 474 425 489 474 487 490 488 488 491 485 477 492 489 475 493 481 491 494 482 491 495 485 489 496 491 485 497 493 494 498 495 490 499 496 490 500 471 459 501 489 473 502 459 498 503 501 501 504 503 470 505 489 485 506 486 472 507 460 505 508 492 503 509 495 496 510 507 493 511 497 492 512 495 510 513 487 510 514 508 513 515 508 513 516 468 515 517 514 516 518 503 515 519 500 507 520 517 507 521 513 520 522 503 508 523 522 522 524 519 498 525 521 523 526 525 508 527 500 526 528 526 523 529 526 516 530 526 520 531 524 488 532 521 531 533 527 524 534 514 492 535 530 532 536 525 531 537 523 512 538 535 535 539 495 517 540 532 524 541 534 522 542 516 509 543 536 539 544 540 510 545 531 536 546 541 493 547 543 521 548 539 523 549 543 539 550 541 531 551 549 549 552 546 531 553 549 551 554 537 547 555 541 544 556 551 552 557 555 550 558 553 540 559 554 558 560 554 549 561 558 549 562 548 560 563 550 550 564 559 560 565 555 552 566 562 560 567 563 558 568 561 566 569 543 560 570 566 569 571 568 570 572 557 569 573 560 570 574 572 573 575 565 561 576 573 566 577 553 567 578 575 573 579 577 569 580 569 573 581 577 577 582 581 558 583 576 570 584 571 579 585 580 578 586 583 585 587 584 566 588 576 578 589 577 562 590 554 581 591 572 590 592 588 562 593 574 588 594 577 587 595 589 593 596 595 585 597 594 577 598 589 597 599 586 596 600 591 588 601 598 600 602 576 595 603 597 592 604 596 599 605 602 599 606 605 604 607 599 606 608 607 594 609 608 571 610 598 597 611 590 609 612 601 606 613 596 607 614 589 604 615 613 613 616 596 597 617 594 616 618 609 603 619 613 618 620 615 611 621 620 617 622 619 620 623 620 591 624 613 620 625 620 602 626 621 623 627 616 625 628 622 627 629 628 609 630 627 618 631 623 628 632 616 628 633 625 628 634 616 621 635 631 628 636 630 632 637 613 629 638 631 634 639 637 631 640 639 636 641 632 633 642 619 641 643 639 624 644 635 643 645 643 643 646 643 641 647 645 646 648 634 643 649 609 639 650 647 645 651 640 644 652 650 650 653 651 613 654 651 646 655 627 645 656 648 641 657 654 654 658 651 652 659 636 649 660 656 659 661 658 638 662 648 657 663 647 651 664 658 648 665 664 662 666 664 665 667 662 648 668 660 657 669 643 663 670 668 660 671 647 668 672 645 666 673 672 671 674 673 670 675 671 652 676 674 666 677 665 665 678 660 672 679 668 676 680 668 679 681 679 678 682 679 678 683 681 677 684 670 649 685 668 684 686 662 682 687 684 678 688 687 684 689 685 686 690 674 671 691 673 683 692 685 691 693 691 664 694 691 692 695 683 659 696 692 692 697 693 689 698 680 696 699 694 694 700 696 693 701 693 684 702 693 701 703 669 695 704 690 682 705 703 697 706 695 693 707 703 703 708 700 701 709 707 704 710 701 691 711 709 709 712 693 708 713 705 696 714 698 704 715 709 707 716 715 713 717 683 711 718 717 710 719 711 715 720 716 719 721 701 713 722 696 721 723 718 717 724 723 721 725 720 718 726 717 717 727 726 715 728 725 712 729 727 701 730 725 724 731 729 727 732 722 725 733 724 727 734 710 730 735 704 730 736 726 720 737 732 716 738 733 737 739 734 725 740 736 738 741 737 719 742 738 733 743 733 718 744 722 742 745 743 735 746 719 742 747 739 743 748 735 734 749 748 729 750 738 725 751 744 749 752 751 749 753 741 752 754 746 722 755 750 753 756 755 749 757 746 747 758 752 753 759 746 757 760 725 757 761 739 757 762 752 752 763 762 737 764 758 732 765 762 735 766 765 762 767 766 746 768 762 758 769 765 760 770 764 752 771 770 765 772 768 751 773 764 765 774 772 758 775 773 754 776 768 768 777 767 772 778 753 756 779 738 768 780 764 778 781 777 755 782 779 779 783 781 780 784 783 783 785 779 773 786 780 773 787 775 781 788 780 785 789 786 768 790 764 772 791 762 788 792 790 774 793 784 774 794 784 792 795 793 789 796 789 795 797 796 785 798 790 797 799 796 797 800 799 799 801 800 800 802 792 783 803 785 802 804 802 791 805 795 793 806 802 804 807 792 806 808 797 783 809 805 800 810 784 804 811 809 808 812 807 795 813 805 807 814 810 812 815 809 810 816 809 799 817 791 801 818 817 790 819 807 796 820 816 819 821 811 815 822 810 813 823 815 810 824 820 823 825 817 815 826 809 818 827 826 824 828 827 822 829 824 820 830 826 812 831 818 823 832 830 810 833 830 832 834 804 831 835 833 811 836 832 823 837 836 832 838 832 816 839 835 836 840 831 832 841 837 827 842 838 839 843 840 841 844 839 820 845 835 839 846 841 843 847 843 840 848 843 832 849 847 845 850 845 847 851 833 848 852 851 829 853 844 850 854 840 847 855 837 851 856 830 852 857 844 827 858 849 856 859 833 853 860 859 825 861 859 855 862 859 854 863 856 852 864 854 861 865 864 859 866 846 865 867 858 849 868 863 858 869 865 866 870 866 862 871 852 867 872 854 868 873 864 868 874 868 855 875 870 873 876 873 853 877 870 870 878 874 851 879 855 869 880 878 877 881 874 879 882 860 871 883 879 874 884 861 877 885 882 873 886 883 866 887 878 886 888 884 884 889 854 867 890 889 883 891 887 882 892 883 876 893 877 884 894 864 891 895 892 890 896 879 888 897 894 896 898 892 861 899 897 884 900 855 892 901 894 897 902 893 887 903 902 886 904 889 894 905 898 904 906 890 900 907 887 899 908 902 876 909 897 902 910 908 905 911 906 907 912 903 894 913 908 907 914 912 907 915 876 914 916 901 907 917 913 915 918 910 912 919 917 912 920 916 917 921 912 913 922 905 917 923 897 897 924 919 901 925 923 919 926 885 924 927 923 921 928 895 912 929 925 928 930 919 924 931 904 926 932 912 926 933 915 926 934 929 924 935 929 923 936 930 932 937 925 932 938 928 921 939 926 923 940 928 938 941 934 937 942 931 935 943 929 942 944 923 942 945 929 918 946 917 927 947 944 943 948 899 939 949 941 941 950 943 943 951 943 944 952 945 931 953 949 947 954 947 952 955 928 947 956 953 935 957 936 952 958 948 943 959 950 914 960 933 954 961 926 956 962 954 957 963 961 962 964 955 960 965 963 949 966 916 949 967 965 965 968 950 949 969 965 963 970 969 952 971 947 965 972 958 968 973 967 959 974 973 960 975 973 963 976 975 967 977 976 975 978 976 936 979 968 977 980 941 943 981 973 971 982 981 976 983 966 978 984 967 982 985 980 978 986 981 970 987 985 981 988 985 983 989 959 985 990 979 978 991 971 975 992 980 974 993 982 991 994 991 945 995 990 994 996 962 992 997 992 993 998 989 988 999 987 997 1000 995 999 1001 997 960 1002 995 996 1003 985 1000 1004 981 982 1005 999 999 1006 990 1000 1007 1001 1006 1008 994 984 1009 1007 1003 1010 1004 1002 1011 1004 1007 1012 1006 1001 1013 990 1012 1014 1004 1012 1015 1010 1007 1016 1006 1012 1017 1012 1008 1018 998 1017 1019 1013 984 1020 1017 1017 1021 1011 1020 1022 1015 1019 1023 1007 1012 1024 1020 981 1025 1024 1021 1026 1015 1011 1027 1006 1012 1028 1017 1013 1029 1028 1028 1030 1024 1014 1031 1023 1025 1032 1030 1026 1033 1030 1026 1034 1028 1022 1035 1021 1023 1036 1029 1003 1037 1020 1018 1038 1008 1036 1039 1037 1035 1040 1036 1033 1041 1033 1024 1042 1030 1040 1043 1040 1014 1044 1030 1036 1045 1023 1027 1046 1038 1039 1047 1034 1039 1048 1045 1047 1049 1041 1047 1050 1032 1043 1051 1050 1040 1052 1046 1049 1053 1052 1044 1054 1052 1050 1055 1042 1042 1056 1055 1052 1057 1048 1050 1058 1049 1053 1059 1057 1049 1060 1051 1058 1061 1044 1045 1062 1049 1059 1063 1022 1048 1064 1059 1063 1065 1051 1058 1066 996 1064 1067 1065 1053 1068 1062 1058 1069 1068 1049 1070 1061 1047 1071 1063 1053 1072 1049 1070 1073 1071 1066 1074 1049 1072 1075 1070 1072 1076 1075 1075 1077 1073 1076 1078 1077 1069 1079 1068 1076 1080 1072 1078 1081 1065 1057 1082 1077 1077 1083 1058 1079 1084 1082 1070 1085 1079 1084 1086 1071 1071 1087 1082 1075 1088 1083 1079 1089 1080 1086 1090 1089 1088 1091 1087 1076 1092 1084 1072 1093 1051 1072 1094 1089 1075 1095 1093 1083 1096 1088 1094 1097 1066 1093 1098 1090 1097 1099 1081 1089 1100 1099 1091 1101 1098 1078 1102 1092 1101 1103 1085 1083 1104 1101 1103 1105 1104 1065 1106 1093 1096 1107 1083 1099 1108 1102 1107 1109 1090 1086 1110 1103 1108 1111 1109 1106 1112 1104 1108 1113 1110 1079 1114 1106 1094 1115 1104 1111 1116 1089 1109 1117 1101 1105 1118 1110 1109 1119 1115 1111 1120 1109 1119 1121 1108 1098 1122 1112 1111 1123 1121 1118 1124 1108 1106 1125 1121 1121 1126 1124 1112 1127 1122 1119 1128 1085 1118 1129 1117 1119 1130 1120 1127 1131 1128 1123 1132 1128 1126 1133 1125 1096 1134 1133 1126 1135 1121 1125 1136 1134 1133 1137 1134 1104 1138 1136 1128 1139 1128 1126 1140 1135 1128 1141 1102 1124 1142 1141 1138 1143 1080 1131 1144 1143 1142 1145 1144 1138 1146 1127 1137 1147 1143 1105 1148 1144 1143 1149 1136 1148 1150 1148 1149 1151 1145 1149 1152 1144 1146 1153 1146 1143 1154 1146 1150 1155 1127 1148 1156 1155 1151 1157 1151 1142 1158 1142 1156 1159 1155 1150 1160 1159 1137 1161 1142 1155 1162 1145 1159 1163 1146 1162 1164 1154 1157 1165 1163 1156 1166 1165 1164 1167 1134 1159 1168 1164 1157 1169 1165 1165 1170 1166 1165 1171 1164 1170 1172 1163 1171 1173 1158 1167 1174 1170 1165 1175 1174 1170 1176 1161 1169 1177 1157 1169 1178 1176 1167 1179 1178 1155 1180 1158 1177 1181 1176 1154 1182 1178 1173 1183 1173 1181 1184 1178 1182 1185 1184 1183 1186 1183 1179 1187 1186 1180 1188 1184 1186 1189 1175 1187 1190 1189 1184 1191 1189 1150 1192 1186 1189 1193 1191 1191 1194 1185 1192 1195 1192 1165 1196 1187 1186 1197 1193 1194 1198 1192 1193 1199 1189 1191 1200 1188 1178 1201 1186 1196 1202 1198 1200 1203 1200 1197 1204 1187 1201 1205 1204 1201 1206 1204 1201 1207 1204 1202 1208 1183 1193 1209 1195 1200 1210 1197 1209 1211 1191 1210 1212 1200 1209 1213 1211 1181 1214 1205 1206 1215 1209 1203 1216 1202 1209 1217 1215 1213 1218 1213 1211 1219 1217 1216 1220 1173 1209 1221 1214 1220 1222 1218 1210 1223 1220 1221 1224 1199 1218 1225 1221 1210 1226 1224 1224 1227 1211 1223 1228 1194 1223 1229 1198 1228 1230 1225 1223 1231 1227 1225 1232 1230 1222 1233 1205 1193 1234 1233 1212 1235 1224 1215 1236 1230 1223 1237 1232 1226 1238 1211 1193 1239 1237 1238 1240 1235 1230 1241 1240 1214 1242 1237 1232 1243 1242 1234 1244 1239 1243 1245 1236 1244 1246 1239 1210 1247 1213 1238 1248 1245 1246 1249 1245 1247 1250 1240 1224 1251 1250 1225 1252 1245 1228 1253 1252 1252 1254 1253 1235 1255 1248 1246 1256 1254 1234 1257 1237 1226 1258 1236 1256 1259 1248 1254 1260 1259 1252 1261 1234 1258 1262 1236 1261 1263 1260 1260 1264 1247 1248 1265 1258 1256 1266 1263 1259 1267 1246 1260 1268 1265 1263 1269 1268 1260 1270 1268 1264 1271 1268 1267 1272 1260 1270 1273 1250 1272 1274 1269 1261 1275 1271 1263 1276 1272 1273 1277 1263 1271 1278 1277 1277 1279 1265 1274 1280 1274 1257 1281 1269 1278 1282 1259 1279 1283 1277 1270 1284 1266 1281 1285 1283 1270 1286 1273 1280 1287 1277 1281 1288 1271 1270 1289 1284 1255 1290 1276 1285 1291 1284 1289 1292 1278 1288 1293 1291 1292 1294 1288 1273 1295 1291 1293 1296 1282 1271 1297 1292 1296 1298 1297 1288 1299 1297 1285 1300 1286 1291 1301 1292 1293 1302 1288 1290 1303 1300 1266 1304 1294 1295 1305 1292 1292 1306 1286 1293 1307 1306 1304 1308 1295 1301 1309 1305 1308 1310 1309 1294 1311 1308 1297 1312 1287 1310 1313 1306 1308 1314 1312 1311 1315 1309 1303 1316 1290 1313 1317 1304 1312 1318 1310 1310 1319 1308 1310 1320 1307 1314 1321 1320 1316 1322 1319 1317 1323 1296 1321 1324 1311 1318 1325 1314 1306 1326 1322 1316 1327 1300 1320 1328 1325 1315 1329 1323 1308 1330 1328 1308 1331 1326 1280 1332 1331 1331 1333 1282 1328 1334 1325 1311 1335 1327 1327 1336 1312 1335 1337 1334 1328 1338 1333 1308 1339 1337 1329 1340 1326 1330 1341 1335 1322 1342 1337 1330 1343 1342 1338 1344 1308 1320 1345 1344 1343 1346 1342 1337 1347 1319 1343 1348 1328 1346 1349 1345 1313 1350 1347 1345 1351 1346 1346 1352 1347 1350 1353 1346 1340 1354 1353 1353 1355 1348 1352 1356 1348 1353 1357 1356 1342 1358 1328 1355 1359 1356 1356 1360 1351 1342 1361 1347 1325 1362 1356 1358 1363 1355 1357 1364 1359 1359 1365 1360 1354 1366 1356 1363 1367 1365 1363 1368 1363 1358 1369 1324 1367 1370 1364 1349 1371 1365 1364 1372 1371 1370 1373 1349 1372 1374 1352 1369 1375 1363 1372 1376 1341 1363 1377 1338 1373 1378 1372 1356 1379 1378 1378 1380 1349 1369 1381 1372 1376 1382 1371 1371 1383 1382 1337 1384 1379 1373 1385 1344 1366 1386 1385 1381 1387 1383 1385 1388 1387 1387 1389 1385 1387 1390 1385 1384 1391 1384 1388 1392 1391 1391 1393 1383 1392 1394 1385 1389 1395 1382 1360 1396 1376 1392 1397 1396 1377 1398 1397 1397 1399 1378 1383 1400 1398 1378 1401 1400 1377 1402 1388 1398 1403 1402 1394 1404 1403 1395 1405 1401 1404 1406 1399 1404 1407 1399 1404 1408 1404 1399 1409 1377 1388 1410 1408 1404 1411 1381 1401 1412 1407 1406 1413 1405 1400 1414 1386 1406 1415 1406 1406 1416 1411 1400 1417 1400 1409 1418 1409 1416 1419 1413 1415 1420 1405 1402 1421 1417 1407 1422 1418 1416 1423 1404 1421 1424 1423 1405 1425 1418 1423 1426 1386 1418 1427 1414 1426 1428 1416 1425 1429 1427 1427 1430 1391 1422 1431 1421 1428 1432 1401 1430 1433 1421 1430 1434 1431 1433 1435 1427 1403 1436 1435 1425 1437 1431 1432 1438 1428 1433 1439 1434 1403 1440 1439 1428 1441 1407 1434 1442 1436 1438 1443 1426 1438 1444 1430 1435 1445 1444 1430 1446 1428 1444 1447 1439 1437 1448 1447 1446 1449 1443 1423 1450 1448 1445 1451 1450 1439 1452 1411 1426 1453 1435 1449 1454 1450 1450 1455 1453 1448 1456 1448 1447 1457 1447 1456 1458 1456 1438 1459 1456 1458 1460 1448 1453 1461 1459 1455 1462 1458 1448 1463 1438 1460 1464 1460 1454 1465 1462 1443 1466 1450 1462 1467 1465 1463 1468 1446 1449 1469 1461 1463 1470 1465 1462 1471 1470 1450 1472 1454 1467 1473 1465 1455 1474 1461 1467 1475 1473 1462 1476 1464 1456 1477 1475 1471 1478 1474 1477 1479 1470 1478 1480 1460 1479 1481 1463 1477 1482 1473 1481 1483 1461 1459 1484 1482 1482 1485 1460 1479 1486 1484 1477 1487 1482 1479 1488 1470 1484 1489 1485 1469 1490 1485 1489 1491 1490 1468 1492 1491 1489 1493 1491 1487 1494 1487 1487 1495 1493 1489 1496 1490 1495 1497 1492 1493 1498 1478 1474 1499 1495 1485 1500 1498 1491 1501 1495 1491 1502 1487 1493 1503 1498 1497 1504 1494 1497 1505 1481 1495 1506 1490 1498 1507 1481 1505 1508 1493 1507 1509 1488 1504 1510 1506 1499 1511 1490 1508 1512 1511 1505 1513 1500 1511 1514 1506 1509 1515 1509 1510 1516 1515 1498 1517 1488 1498 1518 1478 1501 1519 1511 1505 1520 1511 1508 1521 1508 1502 1522 1512 1515 1523 1516 1520 1524 1522 1497 1525 1505 1521 1526 1519 1500 1527 1517 1523 1528 1522 1520 1529 1526 1526 1530 1528 1527 1531 1529 1530 1532 1528 1521 1533 1526 1531 1534 1528 1525 1535 1529 1533 1536 1532 1509 1537 1536 1531 1538 1537 1536 1539 1508 1538 1540 1535 1535 1541 1520 1505 1542 1514 1527 1543 1542 1539 1544 1538 1541 1545 1544 1540 1546 1534 1530 1547 1500 1543 1548 1537 1536 1549 1544 1547 1550 1549 1542 1551 1541 1547 1552 1549 1524 1553 1540 1544 1554 1538 1547 1555 1526 1550 1556 1547 1550 1557 1549 1553 1558 1551 1550 1559 1554 1554 1560 1542 1550 1561 1545 1558 1562 1527 1540 1563 1559 1556 1564 1557 1562 1565 1563 1542 1566 1564 1564 1567 1557 1558 1568 1556 1566 1569 1548 1551 1570 1555 1554 1571 1547 1562 1572 1559 1569 1573 1567 1561 1574 1569 1561 1575 1571 1572 1576 1571 1559 1577 1576 1576 1578 1574 1570 1579 1576 1578 1580 1574 1577 1581 1555 1580 1582 1564 1548 1583 1547 1572 1584 1580 1583 1585 1573 1584 1586 1561 1580 1587 1577 1582 1588 1569 1587 1589 1588 1583 1590 1587 1584 1591 1582 1574 1592 1591 1587 1593 1590 1592 1594 1573 1589 1595 1593 1591 1596 1589 1579 1597 1595 1596 1598 1585 1597 1599 1593 1597 1600 1577 1586 1601 1588 1581 1602 1589 1586 1603 1574 1601 1604 1574 1603 1605 1589 1599 1606 1600 1589 1607 1592 1598 1608 1607 1604 1609 1608 1605 1610 1604 1601 1611 1566 1610 1612 1603 1604 1613 1580 1601 1614 1612 1613 1615 1602 1595 1616 1611 1614 1617 1615 1605 1618 1616 1613 1619 1613 1607 1620 1611 1602 1621 1619 1605 1622 1621 1605 1623 1620 1620 1624 1622 1622 1625 1623 1624 1626 1624 1607 1627 1616 1625 1628 1623 1625 1629 1610 1602 1630 1615 1604 1631 1625 1628 1632 1628 1628 1633 1630 1628 1634 1632 1627 1635 1629 1631 1636 1627 1626 1637 1635 1624 1638 1635 1607 1639 1632 1635 1640 1635 1624 1641 1637 1634 1642 1641 1631 1643 1641 1641 1644 1629 1633 1645 1630 1639 1646 1631 1628 1647 1640 1644 1648 1644 1645 1649 1638 1637 1650 1649 1642 1651 1648 1650 1652 1637 1646 1653 1642 1635 1654 1633 1648 1655 1645 1646 1656 1637 1653 1657 1656 1650 1658 1649 1652 1659 1648 1650 1660 1643 1655 1661 1641 1656 1662 1657 1653 1663 1655 1648 1664 1653 1661 1665 1649 1655 1666 1664 1651 1667 1657 1666 1668 1654 1654 1669 1652 1662 1670 1666 1669 1671 1663 1650 1672 1662 1659 1673 1672 1672 1674 1669 1672 1675 1646 1668 1676 1672 1656 1677 1674 1668 1678 1667 1673 1679 1678 1678 1680 1665 1679 1681 1679 1668 1682 1662 1671 1683 1671 1680 1684 1650 1667 1685 1679 1678 1686 1680 1684 1687 1681 1667 1688 1684 1673 1689 1678 1665 1690 1677 1684 1691 1683 1682 1692 1679 1687 1693 1690 1691 1694 1687 1687 1695 1690 1661 1696 1691 1694 1697 1692 1694 1698 1696 1686 1699 1695 1693 1700 1699 1698 1701 1692 1692 1702 1699 1689 1703 1697 1701 1704 1703 1697 1705 1686 1690 1706 1698 1703 1707 1701 1688 1708 1674 1705 1709 1708 1705 1710 1704 1703 1711 1705 1708 1712 1711 1711 1713 1703 1702 1714 1694 1705 1715 1710 1708 1716 1708 1713 1717 1679 1710 1718 1708 1696 1719 1706 1717 1720 1712 1694 1721 1711 1720 1722 1720 1721 1723 1715 1716 1724 1686 1722 1725 1724 1719 1726 1716 1717 1727 1723 1726 1728 1722 1698 1729 1717 1728 1730 1725 1726 1731 1725 1729 1732 1714 1729 1733 1732 1732 1734 1718 1691 1735 1720 1731 1736 1727 1729 1737 1725 1728 1738 1731 1726 1739 1730 1738 1740 1734 1738 1741 1739 1720 1742 1731 1738 1743 1741 1741 1744 1739 1742 1745 1736 1737 1746 1713 1745 1747 1726 1746 1748 1707 1722 1749 1743 1745 1750 1742 1747 1751 1745 1729 1752 1746 1748 1753 1751 1743 1754 1746 1742 1755 1754 1745 1756 1750 1730 1757 1744 1752 1758 1737 1755 1759 1749 1748 1760 1745 1737 1761 1759 1755 1762 1750 1742 1763 1762 1757 1764 1761 1750 1765 1762 1716 1766 1740 1757 1767 1747 1765 1768 1755 1764 1769 1744 1760 1770 1757 1767 1771 1768 1769 1772 1766 1761 1773 1761 1764 1774 1765 1772 1775 1754 1773 1776 1775 1755 1777 1766 1767 1778 1774 1770 1779 1776 1768 1780 1769 1770 1781 1761 1780 1782 1777 1773 1783 1738 1762 1784 1778 1778 1785 1781 1784 1786 1775 1776 1787 1778 1786 1788 1787 1782 1789 1783 1786 1790 1789 1746 1791 1788 1773 1792 1784 1787 1793 1790 1790 1794 1786 1790 1795 1789 1781 1796 1789 1795 1797 1771 1786 1798 1790 1780 1799 1797 1797 1800 1792 1799 1801 1797 1775 1802 1790 1795 1803 1797 1800 1804 1790 1790 1805 1747 1765 1806 1784 1802 1807 1782 1793 1808 1801 1807 1809 1790 1788 1810 1806 1796 1811 1804 1810 1812 1780 1808 1813 1783 1811 1814 1810 1805 1815 1794 1813 1816 1801 1813 1817 1810 1809 1818 1807 1811 1819 1805 1800 1820 1813 1807 1821 1813 1813 1822 1820 1816 1823 1811 1820 1824 1799 1804 1825 1822 1820 1826 1824 1820 1827 1821 1823 1828 1824 1825 1829 1824 1818 1830 1828 1826 1831 1803 1826 1832 1811 1830 1833 1820 1827 1834 1809 1831 1835 1819 1831 1836 1832 1823 1837 1827 1828 1838 1820 1835 1839 1837 1819 1840 1834 1831 1841 1833 1809 1842 1829 1830 1843 1837 1828 1844 1801 1827 1845 1844 1838 1846 1845 1842 1847 1845 1843 1848 1833 1838 1849 1847 1841 1850 1846 1847 1851 1850 1844 1852 1848 1851 1853 1839 1851 1854 1847 1825 1855 1845 1843 1856 1853 1847 1857 1848 1852 1858 1854 1836 1859 1846 1846 1860 1859 1859 1861 1859 1851 1862 1825 1858 1863 1851 1854 1864 1862 1860 1865 1852 1855 1866 1852 1855 1867 1857 1859 1868 1858 1865 1869 1866 1861 1870 1850 1869 1871 1868 1867 1872 1870 1852 1873 1867 1869 1874 1861 1871 1875 1866 1860 1876 1864 1874 1877 1867 1846 1878 1873 1872 1879 1872 1878 1880 1876 1873 1881 1872 1866 1882 1881 1879 1883 1855 1877 1884 1867 1880 1885 1874 1879 1886 1883 1877 1887 1866 1868 1888 1855 1885 1889 1887 1877 1890 1884 1886 1891 1875 1889 1892 1887 1890 1893 1876 1877 1894 1887 1870 1895 1890 1880 1896 1895 1887 1897 1884 1883 1898 1897 1891 1899 1894 1895 1900 1898 1891 1901 1879 1900 1902 1883 1898 1903 1901 1900 1904 1884 1901 1905 1903 1898 1906 1875 1902 1907 1898 1879 1908 1904 1901 1909 1905 1881 1910 1908 1886 1911 1910 1908 1912 1901 1890 1913 1912 1909 1914 1909 1910 1915 1913 1909 1916 1904 1903 1917 1909 1912 1918 1916 1915 1919 1915 1886 1920 1919 1912 1921 1913 1916 1922 1921 1915 1923 1921 1922 1924 1916 1902 1925 1912 1924 1926 1892 1890 1927 1922 1922 1928 1925 1923 1929 1917 1919 1930 1907 1929 1931 1926 1916 1932 1907 1925 1933 1926 1909 1934 1901 1901 1935 1926 1932 1936 1931 1929 1937 1928 1931 1938 1886 1931 1939 1937 1937 1940 1939 1934 1941 1940 1938 1942 1930 1940 1943 1936 1942 1944 1892 1943 1945 1944 1944 1946 1921 1922 1947 1931 1944 1948 1947 1946 1949 1933 1943 1950 1942 1948 1951 1946 1948 1952 1948 1940 1953 1937 1942 1954 1953 1947 1955 1951 1946 1956 1951 1946 1957 1954 1927 1958 1954 1945 1959 1954 1957 1960 1953 1957 1961 1959 1948 1962 1959 1935 1963 1954 1958 1964 1958 1960 1965 1943 1964 1966 1957 1962 1967 1958 1964 1968 1962 1967 1969 1968 1954 1970 1951 1967 1971 1962 1970 1972 1962 1945 1973 1971 1972 1974 1962 1972 1975 1949 1971 1976 1963 1961 1977 1967 1970 1978 1975 1973 1979 1969 1969 1980 1973 1978 1981 1961 1966 1982 1981 1975 1983 1980 1980 1984 1968 1972 1985 1984 1969 1986 1983 1979 1987 1981 1980 1988 1980 1959 1989 1975 1981 1990 1987 1984 1991 1975 1989 1992 1991 1991 1993 1991 1992 1994 1993 1976 1995 1994 1979 1996 1982 1992 1997 1994 1988 1998 1992 1990 1999 1978 1996 2000 1986 1969 2001 1990 1982 2002 1989 1966 2003 1994 2000 2004 1995 1962 2005 1999 1979 2006 2004 2004 2007 2006 2006 2008 2004 2007 2009 2002 1991 2010 2007 2007 2011 2007 1995 2012 2004 2006 2013 1993 1991 2014 2013 2008 2015 2006 2012 2016 2011 2006 2017 2010 1992 2018 2001 2001 2019 2017 2017 2020 2011 2010 2021 2018 2014 2022 2020 2013 2023 2012 2009 2024 2021 2016 2025 2017 1994 2026 2002 2004 2027 2023 2024 2028 2015 2003 2029 2024 2024 2030 2026 2014 2031 2027 2007 2032 2023 2031 2033 1999 2029 2034 2000 2024 2035 2029 2031 2036 2013 2035 2037 2036 2011 2038 2031 2009 2039 2036 2038 2040 2038 2037 2041 2030 2025 2042 2040 2039 2043 2042 2035 2044 2043 2031 2045 2039 2042 2046 2029 2022 2047 2046 2044 2048 2041 2046 2049 2042 2039 2050 2033 2032 2051 2047 2047 2052 2051 2041 2053 2051 2050 2054 2053 2051 2055 2052 2044 2056 2035 2045 2057 2053 2030 2058 2040 2041 2059 2030 2057 2060 2020 2056 2061 2024 2048 2062 2044 2054 2063 2043 2049 2064 2053 2061 2065 2063 2061 2066 2061 2059 2067 2059 2062 2068 2054 2044 2069 2058 2066 2070 2067 2068 2071 2067 2066 2072 2044 2060 2073 2058 2072 2074 2052 2073 2075 2065 2064 2076 2074 2075 2077 2062 2071 2078 2074 2052 2079 2076 2067 2080 2073 2070 2081 2070 2033 2082 2062 2081 2083 2078 2078 2084 2078 2063 2085 2083 2083 2086 2077 2079 2087 2085 2081 2088 2074 2065 2089 2084 2085 2090 2065 2089 2091 2073 2079 2092 2091 2070 2093 2089 2079 2094 2093 2090 2095 2090 2088 2096 2080 2093 2097 2076 2088 2098 2091 2071 2099 2094 2068 2100 2092 2095 2101 2098 2098 2102 2099 2099 2103 2098 2100 2104 2100 2091 2105 2098 2101 2106 2100 2092 2107 2100 2097 2108 2070 2091 2109 2106 2101 2110 2087 2104 2111 2102 2105 2112 2110 2105 2113 2101 2106 2114 2094 2113 2115 2112 2114 2116 2104 2101 2117 2096 2107 2118 2115 2115 2119 2112 2114 2120 2083 2116 2121 2118 2120 2122 2104 2094 2123 2121 2115 2124 2087 2119 2125 2123 2081 2126 2123 2118 2127 2104 2118 2128 2126 2098 2129 2120 2111 2130 2080 2117 2131 2128 2125 2132 2128 2111 2133 2101 2130 2134 2108 2133 2135 2129 2134 2136 2130 2134 2137 2129 2132 2138 2137 2135 2139 2124 2134 2140 2127 2133 2141 2140 2140 2142 2139 2130 2143 2135 2141 2144 2140 2139 2145 2130 2121 2146 2140 2145 2147 2107 2136 2148 2102 2144 2149 2129 2139 2150 2124 2117 2151 2143 2150 2152 2148 2148 2153 2128 2136 2154 2144 2153 2155 2122 2116 2156 2142 2145 2157 2150 2132 2158 2157 2152 2159 2149 2152 2160 2157 2151 2161 2157 2156 2162 2144 2161 2163 2161 2151 2164 2162 2150 2165 2156 2164 2166 2161 2162 2167 2148 2155 2168 2162 2164 2169 2162 2155 2170 2166 2161 2171 2168 2169 2172 2171 2167 2173 2172 2158 2174 2171 2167 2175 2156 2169 2176 2173 2147 2177 2168 2164 2178 2175 2174 2179 2168 2164 2180 2156 2176 2181 2166 2178 2182 2171 2175 2183 2177 2163 2184 2174 2170 2185 2184 2142 2186 2175 2179 2187 2184 2179 2188 2175 2185 2189 2173 2172 2190 2189 2148 2191 2176 2178 2192 2189 2189 2193 2191 2190 2194 2190 2188 2195 2186 2191 2196 2191 2185 2197 2181 2182 2198 2174 2183 2199 2198 2197 2200 2197 2199 2201 2188 2188 2202 2180 2194 2203 2189 2190 2204 2189 2189 2205 2201 2195 2206 2203 2198 2207 2205 2202 2208 2190 2199 2209 2199 2202 2210 2202 2205 2211 2208 2182 2212 2208 2186 2213 2205 2205 2214 2202 2212 2215 2209 2210 2216 2194 2186 2217 2202 2207 2218 2205 2216 2219 2216 2203 2220 2209 2219 2221 2212 2214 2222 2220 2215 2223 2220 2218 2224 2223 2205 2225 2223 2224 2226 2222 2221 2227 2204 2208 2228 2214 2207 2229 2204 2214 2230 2209 2223 2231 2230 2213 2232 2224 2231 2233 2213 2228 2234 2212 2227 2235 2230 2234 2236 2235 2235 2237 2226 2194 2238 2219 2235 2239 2231 2224 2240 2228 2234 2241 2233 2231 2242 2230 2237 2243 2242 2237 2244 2214 2237 2245 2230 2243 2246 2228 2237 2247 2227 2242 2248 2247 2228 2249 2247 2220 2250 2236 2209 2251 2169 2220 2252 2232 2251 2253 2247 2248 2254 2252 2251 2255 2249 2231 2256 2251 2244 2257 2255 2251 2258 2253 2256 2259 2239 2247 2260 2254 2249 2261 2258 2250 2262 2251 2261 2263 2255 2258 2264 2261 2258 2265 2237 2260 2266 2264 2255 2267 2248 2258 2268 2263 2239 2269 2256 2267 2270 2267 2237 2271 2265 2263 2272 2268 2267 2273 2272 2253 2274 2268 2259 2275 2269 2273 2276 2265 2269 2277 2276 2264 2278 2263 2254 2279 2259 2277 2280 2275 2279 2281 2275 2245 2282 2280 2279 2283 2278 2271 2284 2273 2282 2285 2276 2278 2286 2281 2284 2287 2272 2269 2288 2247 2285 2289 2270 2288 2290 2283 2282 2291 2285 2241 2292 2285 2286 2293 2291 2280 2294 2278 2292 2295 2288 2275 2296 2294 2282 2297 2289 2290 2298 2291 2293 2299 2285 2296 2300 2294 2298 2301 2300 2294 2302 2289 2300 2303 2299 2301 2304 2294 2270 2305 2302 2295 2306 2302 2305 2307 2295 2301 2308 2306 2292 2309 2305 2297 2310 2308 2304 2311 2303 2308 2312 2299 2307 2313 2292 2303 2314 2309 2286 2315 2310 2314 2316 2283 2310 2317 2311 2309 2318 2302 2316 2319 2314 2315 2320 2317 2294 2321 2316 2302 2322 2313 2314 2323 2294 2318 2324 2321 2292 2325 2307 2323 2326 2321 2317 2327 2324 2308 2328 2324 2310 2329 2324 2325 2330 2327 2325 2331 2318 2330 2332 2290 2327 2333 2318 2320 2334 2323 2316 2335 2288 2333 2336 2327 2311 2337 2335 2325 2338 2333 2325 2339 2334 2336 2340 2332 2339 2341 2329 2332 2342 2336 2310 2343 2340 2341 2344 2332 2339 2345 2339 2340 2346 2334 2324 2347 2340 2334 2348 2335 2336 2349 2328 2346 2350 2344 2348 2351 2344 2346 2352 2348 2351 2353 2338 2345 2354 2343 2348 2355 2335 2327 2356 2329 2331 2357 2349 2353 2358 2343 2356 2359 2326 2356 2360 2357 2333 2361 2360 2334 2362 2361 2358 2363 2358 2359 2364 2357 2349 2365 2362 2347 2366 2333 2356 2367 2362 2349 2368 2365 2357 2369 2347 2364 2370 2365 2369 2371 2363 2356 2372 2370 2364 2373 2368 2370 2374 2370 2371 2375 2373 2367 2376 2369 2367 2377 2374 2350 2378 2370 2375 2379 2371 2378 2380 2374 2376 2381 2377 2366 2382 2381 2380 2383 2380 2371 2384 2380 2381 2385 2382 2375 2386 2381 2374 2387 2370 2374 2388 2384 2359 2389 2385 2377 2390 2387 2372 2391 2385 2373 2392 2388 2384 2393 2392 2376 2394 2367 2392 2395 2380 2389 2396 2369 2393 2397 2393 2386 2398 2394 2383 2399 2392 2365 2400 2389 2397 2401 2396 2400 2402 2399 2340 2403 2398 2402 2404 2397 2401 2405 2402 2388 2406 2401 2405 2407 2401 2402 2408 2403 2407 2409 2369 2398 2410 2381 2403 2411 2409 2388 2412 2406 2409 2413 2403 2409 2414 2404 2412 2415 2410 2401 2416 2395 2411 2417 2404 2413 2418 2395 2398 2419 2387 2395 2420 2416 2418 2421 2413 2409 2422 2408 2417 2423 2399 2403 2424 2400 2405 2425 2424 2388 2426 2422 2414 2427 2425 2402 2428 2420 2424 2429 2411 2402 2430 2428 2428 2431 2417 2427 2432 2430 2409 2433 2430 2407 2434 2431 2426 2435 2433 2421 2436 2433 2431 2437 2428 2426 2438 2436 2417 2439 2435 2434 2440 2429 2439 2441 2430 2424 2442 2432 2435 2443 2440 2429 2444 2440 2443 2445 2438 2428 2446 2435 2438 2447 2432 2434 2448 2446 2445 2449 2440 2438 2450 2438 2445 2451 2446 2450 2452 2445 2444 2453 2452 2452 2454 2438 2443 2455 2453 2453 2456 2449 2453 2457 2452 2455 2458 2443 2456 2459 2446 2457 2460 2457 2458 2461 2444 2451 2462 2461 2459 2463 2448 2461 2464 2459 2460 2465 2415 2453 2466 2460 2445 2467 2451 2451 2468 2465 2462 2469 2460 2458 2470 2444 2453 2471 2466 2470 2472 2445 2461 2473 2466 2472 2474 2464 2469 2475 2452 2472 2476 2461 2457 2477 2467 2453 2478 2466 2468 2479 2466 2471 2480 2476 2451 2481 2462 2431 2482 2468 2470 2483 2478 2474 2484 2483 2481 2485 2481 2484 2486 2483 2482 2487 2482 2474 2488 2481 2476 2489 2487 2477 2490 2481 2482 2491 2489 2490 2492 2491 2491 2493 2488 2476 2494 2482 2476 2495 2488 2493 2496 2494 2473 2497 2490 2489 2498 2479 2492 2499 2462 2495 2500 2498 2465 2501 2473 2486 2502 2487 2487 2503 2501 2498 2504 2482 2503 2505 2502 2498 2506 2502 2484 2507 2496 2500 2508 2502 2503 2509 2506 2490 2510 2509 2509 2511 2483 2504 2512 2509 2506 2513 2499 2507 2514 2509 2507 2515 2514 2494 2516 2501 2512 2517 2514 2510 2518 2515 2512 2519 2506 2513 2520 2504 2517 2521 2518 2510 2522 2520 2512 2523 2521 2522 2524 2513 2509 2525 2519 2506 2526 2524 2524 2527 2515 2523 2528 2518 2526 2529 2522 2520 2530 2516 2528 2531 2528 2526 2532 2507 2520 2533 2518 2526 2534 2521 2516 2535 2522 2527 2536 2527 2527 2537 2527 2522 2538 2536 2530 2539 2527 2534 2540 2537 2539 2541 2537 2527 2542 2531 2509 2543 2538 2537 2544 2540 2534 2545 2536 2538 2546 2538 2540 2547 2538 2545 2548 2542 2544 2549 2516 2546 2550 2549 2538 2551 2542 2539 2552 2550 2537 2553 2552 2534 2554 2527 2550 2555 2535 2526 2556 2550 2547 2557 2553 2550 2558 2554 2557 2559 2556 2550 2560 2541 2548 2561 2557 2557 2562 2543 2553 2563 2557 2557 2564 2563 2546 2565 2526 2553 2566 2549 2562 2567 2555 2557 2568 2563 2566 2569 2554 2566 2570 2565 2563 2571 2562 2570 2572 2561 2566 2573 2568 2572 2574 2563 2573 2575 2557 2572 2576 2575 2561 2577 2576 2569 2578 2576 2572 2579 2574 2560 2580 2561 2519 2581 2576 2572 2582 2578 2580 2583 2576 2572 2584 2574 2583 2585 2558 2566 2586 2583 2577 2587 2561 2584 2588 2583 2578 2589 2577 2585 2590 2584 2577 2591 2588 2590 2592 2588 2579 2593 2582 2592 2594 2578 2587 2595 2570 2574 2596 2591 2591 2597 2586 2585 2598 2584 2597 2599 2598 2595 2600 2594 2597 2601 2590 2588 2602 2596 2587 2603 2594 2597 2604 2603 2567 2605 2599 2604 2606 2589 2589 2607 2599 2593 2608 2607 2605 2609 2599 2578 2610 2595 2609 2611 2600 2595 2612 2609 2611 2613 2605 2611 2614 2610 2612 2615 2604 2614 2616 2600 2603 2617 2607 2590 2618 2607 2610 2619 2615 2607 2620 2618 2596 2621 2607 2573 2622 2621 2611 2623 2622 2619 2624 2619 2618 2625 2619 2621 2626 2623 2606 2627 2626 2617 2628 2623 2607 2629 2614 2616 2630 2627 2624 2631 2628 2625 2632 2600 2605 2633 2627 2597 2634 2623 2633 2635 2634 2627 2636 2623 2627 2637 2630 2590 2638 2629 2634 2639 2625 2636 2640 2638 2634 2641 2629 2626 2642 2638 2637 2643 2626 2605 2644 2630 2641 2645 2644 2621 2646 2640 2639 2647 2646 2612 2648 2641 2638 2649 2647 2644 2650 2641 2649 2651 2648 2626 2652 2640 2647 2653 2637 2642 2654 2649 2652 2655 2654 2628 2656 2627 2627 2657 2652 2644 2658 2653 2623 2659 2630 2655 2660 2658 2654 2661 2650 2651 2662 2641 2655 2663 2656 2662 2664 2645 2650 2665 2652 2651 2666 2664 2665 2667 2664 2648 2668 2649 2665 2669 2648 2655 2670 2669 2665 2671 2664 2630 2672 2670 2665 2673 2672 2656 2674 2663 2654 2675 2674 2671 2676 2672 2667 2677 2666 2672 2678 2674 2670 2679 2659 2673 2680 2670 2664 2681 2674 2650 2682 2674 2664 2683 2680 2646 2684 2667 2674 2685 2659 2668 2686 2663 2684 2687 2669 2683 2688 2683 2674 2689 2679 2688 2690 2680 2684 2691 2660 2675 2692 2688 2689 2693 2692 2690 2694 2687 2654 2695 2683 2689 2696 2687 2656 2697 2694 2688 2698 2662 2691 2699 2687 2687 2700 2698 2694 2701 2700 2688 2702 2681 2697 2703 2691 2700 2704 2703 2695 2705 2704 2690 2706 2703 2692 2707 2704 2691 2708 2691 2702 2709 2673 2697 2710 2687 2698 2711 2685 2664 2712 2710 2701 2713 2707 2693 2714 2695 2713 2715 2710 2701 2716 2689 2710 2717 2713 2695 2718 2685 2709 2719 2707 2716 2720 2705 2717 2721 2712 2709 2722 2713 2712 2723 2721 2721 2724 2698 2712 2725 2691 2724 2726 2722 2721 2727 2725 2725 2728 2723 2721 2729 2724 2728 2730 2706 2726 2731 2730 2721 2732 2727 2718 2733 2708 2719 2734 2719 2710 2735 2722 2719 2736 2708 2733 2737 2726 2735 2738 2736 2731 2739 2733 2734 2740 2738 2738 2741 2727 2730 2742 2738 2731 2743 2741 2734 2744 2740 2737 2745 2705 2729 2746 2734 2739 2747 2745 2743 2748 2740 2740 2749 2745 2711 2750 2745 2739 2751 2748 2750 2752 2746 2750 2753 2723 2749 2754 2744 2753 2755 2750 2751 2756 2753 2749 2757 2751 2755 2758 2751 2757 2759 2754 2748 2760 2758 2755 2761 2753 2752 2762 2759 2755 2763 2727 2736 2764 2735 2741 2765 2745 2735 2766 2758 2758 2767 2740 2761 2768 2751 2748 2769 2765 2763 2770 2750 2742 2771 2750 2765 2772 2766 2768 2773 2767 2769 2774 2757 2771 2775 2772 2763 2776 2772 2767 2777 2740 2774 2778 2773 2774 2779 2777 2758 2780 2773 2774 2781 2769 2780 2782 2774 2771 2783 2778 2781 2784 2780 2783 2785 2776 2778 2786 2774 2771 2787 2783 2764 2788 2783 2773 2789 2786 2783 2790 2788 2769 2791 2790 2789 2792 2777 2782 2793 2769 2792 2794 2771 2793 2795 2789 2794 2796 2765 2794 2797 2790 2788 2798 2790 2794 2799 2798 2782 2800 2797 2799 2801 2790 2796 2802 2799 2786 2803 2787 2801 2804 2794 2786 2805 2798 2803 2806 2799 2791 2807 2786 2804 2808 2793 2773 2809 2799 2790 2810 2809 2804 2811 2809 2802 2812 2808 2810 2813 2801 2807 2814 2809 2793 2815 2807 2814 2816 2810 2800 2817 2784 2792 2818 2816 2817 2819 2810 2818 2820 2818 2811 2821 2816 2786 2822 2799 2820 2823 2805 2821 2824 2809 2795 2825 2815 2820 2826 2822 2812 2827 2821 2819 2828 2798 2825 2829 2824 2826 2830 2819 2808 2831 2829 2828 2832 2827 2825 2833 2821 2828 2834 2823 2829 2835 2829 2826 2836 2831 2835 2837 2801 2830 2838 2815 2834 2839 2838 2829 2840 2829 2828 2841 2839 2839 2842 2841 2841 2843 2824 2830 2844 2842 2819 2845 2840 2838 2846 2834 2843 2847 2832 2846 2848 2844 2838 2849 2842 2842 2850 2844 2849 2851 2850 2849 2852 2851 2846 2853 2824 2846 2854 2840 2843 2855 2835 2841 2856 2834 2849 2857 2847 2854 2858 2836 2857 2859 2856 2852 2860 2857 2841 2861 2857 2857 2862 2828 2845 2863 2854 2861 2864 2835 2825 2865 2860 2861 2866 2854 2856 2867 2864 2857 2868 2866 2862 2869 2867 2858 2870 2865 2858 2871 2863 2857 2872 2871 2866 2873 2869 2866 2874 2873 2862 2875 2873 2843 2876 2863 2865 2877 2871 2874 2878 2875 2842 2879 2835 2873 2880 2878 2873 2881 2875 2877 2882 2881 2881 2883 2860 2881 2884 2868 2880 2885 2875 2880 2886 2838 2841 2887 2883 2883 2888 2881 2881 2889 2872 2856 2890 2882 2858 2891 2871 2876 2892 2876 2886 2893 2869 2889 2894 2888 2884 2895 2890 2894 2896 2863 2890 2897 2890 2890 2898 2894 2895 2899 2879 2894 2900 2896 2893 2901 2890 2899 2902 2899 2887 2903 2902 2899 2904 2889 2901 2905 2901 2886 2906 2901 2893 2907 2904 2902 2908 2907 2900 2909 2902 2877 2910 2909 2890 2911 2895 2900 2912 2900 2883 2913 2901 2903 2914 2893 2897 2915 2911 2903 2916 2901 2897 2917 2914 2911 2918 2905 2915 2919 2872 2918 2920 2912 2919 2921 2918 2905 2922 2916 2912 2923 2902 2916 2924 2920 2915 2925 2921 2895 2926 2903 2914 2927 2924 2901 2928 2922 2925 2929 2902 2922 2930 2905 2921 2931 2926 2914 2932 2914 2919 2933 2915 2922 2934 2933 2915 2935 2914 2930 2936 2922 2935 2937 2934 2931 2938 2924 2937 2939 2937 2936 2940 2931 2925 2941 2925 2930 2942 2931 2935 2943 2933 2934 2944 2938 2929 2945 2943 2942 2946 2912 2932 2947 2928 2946 2948 2924 2943 2949 2948 2920 2950 2945 2949 2951 2945 2939 2952 2938 2949 2953 2950 2941 2954 2953 2949 2955 2954 2953 2956 2947 2939 2957 2950 2955 2958 2942 2956 2959 2954 2955 2960 2954 2935 2961 2957 2950 2962 2958 2960 2963 2950 2960 2964 2963 2963 2965 2944 2946 2966 2965 2949 2967 2949 2966 2968 2963 2967 2969 2964 2964 2970 2958 2939 2971 2934 2968 2972 2918 2968 2973 2962 2969 2974 2971 2969 2975 2970 2958 2976 2963 2931 2977 2969 2976 2978 2971 2969 2979 2962 2960 2980 2923 2974 2981 2974 2972 2982 2971 2978 2983 2978 2978 2984 2979 2975 2985 2984 2958 2986 2964 2985 2987 2986 2961 2988 2984 2985 2989 2982 2985 2990 2985 2979 2991 2987 2985 2992 2978 2989 2993 2991 2969 2994 2987 2958 2995 2983 2987 2996 2984 2992 2997 2967 2980 2998 2989 2980 2999 2990 2997 3000 2995 2999
[ "xingjianbai0914@sina.com" ]
xingjianbai0914@sina.com
803bcb47eeff7d8871d343a44751b277134adad6
528f3cc7cadbf30ccce8286ee04e375e03cb3a15
/smskinedit/implementation/control/impl/EditorControl.cpp
4866a689cb23bca0c26d8fd999daef909977c935
[ "MIT" ]
permissive
CorneliaXaos/SMSkinEdit
b59f26aade2ead8d4f10dc1ef884ea7cc96d0bed
119766d3cb4f0ac1f43ee4e102ed0f8939aea87b
refs/heads/master
2021-01-18T16:40:24.829422
2017-04-18T10:29:53
2017-04-18T10:29:53
86,755,611
0
0
null
null
null
null
UTF-8
C++
false
false
408
cpp
#include "control/impl/EditorControl.h" namespace smskinedit { namespace control { void EditorControl::setUseInternalEditor(bool useInternalEditor) { _useInternalEditor = useInternalEditor; onControlUpdated(EditorControl::INTERNAL_EDITOR); } bool EditorControl::shouldUseInternalEditor() const { return _useInternalEditor; } } }
[ "cornelia.xaos@gmail.com" ]
cornelia.xaos@gmail.com
fd1ab0aef283e9c3eb3170325bd53a5cb79579a8
4a28104787a4ce3bf362fda9182e4f1fe6276c30
/implementations/1348A.cpp
e08a5ef3d986b9c2647e84ec6c4348038ec5c4ba
[]
no_license
Ason4901/geeksforgeeks
d0538a22db00c86e97ec8b9f6c548ebd1ecef8ce
777aa4c0752bb0a9b942922e1ad99095a161cc6b
refs/heads/master
2023-02-24T07:51:15.469015
2021-01-30T15:36:20
2021-01-30T15:36:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,056
cpp
#include <bits/stdc++.h> #include <cstdio> #include <cstring> #include <cmath> #include <cstring> #include <chrono> #include <complex> #define endl "\n" #define ll long long int #define vi vector<int> #define vll vector<ll> #define vvi vector < vi > #define pii pair<int,int> #define pll pair<long long, long long> #define mod 1000000007 #define inf 1000000000000000001; #define all(c) c.begin(),c.end() #define mp(x,y) make_pair(x,y) #define mem(a,val) memset(a,val,sizeof(a)) #define eb emplace_back #define f first #define s second using namespace std; int main() { std::ios::sync_with_stdio(false); int T; cin>>T; ll po[31] = {0}; po[0] =1; for (int i = 1; i <= 30; ++i) { po[i] = 2*po[i-1]; } // cin.ignore(); must be there when using getline(cin, s) while(T--) { ll n; cin>>n; ll sum1 = po[n]; for (int i = 1; i < n/2; ++i) { sum1+= po[i]; } ll sum2 = 0ll; for (int i = n/2; i < n; ++i) { sum2 += po[i]; } cout<<abs(sum2 -sum1)<<endl; } return 0; }
[ "51023991+abhinavprkash@users.noreply.github.com" ]
51023991+abhinavprkash@users.noreply.github.com
baca92bd21304160fdebe65fd867dbf076c7ef66
2f6278ca84cef2b2f5b85bf979d65dcbd4fa32a9
/algorithms/scrambleString.cpp
00f32f5ca38cbd7593557a0e7eab11d9f3a57f4a
[ "MIT" ]
permissive
finalspace/leetcode
ffae6d78a8de1ab2f43c40bccc10653e3dec2410
4a8763e0a60f8c887e8567751bd25674ea6e5120
refs/heads/master
2021-06-03T13:39:16.763922
2019-07-26T07:35:03
2019-07-26T07:35:03
40,842,685
0
0
null
null
null
null
UTF-8
C++
false
false
4,151
cpp
// Source : https://leetcode.com/problems/scramble-string/ // Author : Siyuan Xu // Date : 2015-08-14 /********************************************************************************** * * Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. * * Below is one possible representation of s1 = "great": * * great * / \ * gr eat * / \ / \ * g r e at * / \ * a t * * To scramble the string, we may choose any non-leaf node and swap its two children. * * For example, if we choose the node "gr" and swap its two children, it produces a scrambled string "rgeat". * * rgeat * / \ * rg eat * / \ / \ * r g e at * / \ * a t * * We say that "rgeat" is a scrambled string of "great". * * Similarly, if we continue to swap the children of nodes "eat" and "at", it produces a scrambled string "rgtae". * * rgtae * / \ * rg tae * / \ / \ * r g ta e * / \ * t a * * We say that "rgtae" is a scrambled string of "great". * * Given two strings s1 and s2 of the same length, determine if s2 is a scrambled string of s1. * * **********************************************************************************/ //dfs + pruning //4ms(best) class Solution1 { public: bool helper(string &s1, string &s2, int p1, int p2, int l) { if (l == 1) return s1[p1] == s2[p2]; bool flag = false; int count[26]; fill_n(count, 26, 0); for (int i = 0; i < l; i++) { count[s1[p1 + i] - 'a']++; count[s2[p2 + i] - 'a']--; } for (int i = 0; i < 26; i++) { if (count[i] != 0) return false; } for (int k = 1; k <= l - 1 && !flag; k++) { flag = (helper(s1, s2, p1, p2, k) && helper(s1, s2, p1 + k, p2 + k, l - k)) || (helper(s1, s2, p1, p2 + l - k, k) && helper(s1, s2, p1 + k, p2, l - k)); } return flag; } bool isScramble(string s1, string s2) { if (s1.size() != s2.size()) return false; return helper(s1, s2, 0, 0, s1.size()); } }; //dfs + pruning + caching //8ms(slower than dfs + pruning) class Solution2 { public: bool helper(string &s1, string &s2, int*** cache, int p1, int p2, int l) { if (l == 1) return s1[p1] == s2[p2]; if (cache[p1][p2][l] != -1) return cache[p1][p2][l]; bool flag = false; int count[26]; fill_n(count, 26, 0); for (int i = 0; i < l; i++) { count[s1[p1 + i] - 'a']++; count[s2[p2 + i] - 'a']--; } for (int i = 0; i < 26; i++) { if (count[i] != 0) return false; } for (int k = 1; k <= l - 1 && !flag; k++) { flag = (helper(s1, s2, cache, p1, p2, k) && helper(s1, s2, cache, p1 + k, p2 + k, l - k)) || (helper(s1, s2, cache, p1, p2 + l - k, k) && helper(s1, s2, cache, p1 + k, p2, l - k)); } if (cache[p1][p2][l] == -1) cache[p1][p2][l] = flag ? 1 : 0; return flag; } bool isScramble(string s1, string s2) { if (s1.size() != s2.size()) return false; int n = s1.size(); int*** cache = new int**[n]; for (int i = 0; i < n; i++) { cache[i] = new int*[n]; for (int j = 0; j < n; j++) { cache[i][j] = new int[n + 1]; fill_n(cache[i][j], n + 1, -1); } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cache[i][j][1] = (s1[i] == s2[j]) ? 1 : 0; } } return helper(s1, s2, cache, 0, 0, s1.size()); } }; //3d dp //24ms(slower) class Solution3 { public: bool isScramble(string s1, string s2) { if (s1.size() != s2.size()) return false; int n = s1.size(); bool*** dp = new bool**[n]; for (int i = 0; i < n; i++) { dp[i] = new bool*[n]; for (int j = 0; j < n; j++) { dp[i][j] = new bool[n + 1]; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { dp[i][j][1] = s1[i] == s2[j]; } } for (int l = 2; l <= n; l++) { for (int i = 0; i <= n - l; i++) { for (int j = 0; j <= n - l; j++) { for (int k = 1; k <= l - 1 && !dp[i][j][l]; k++) { dp[i][j][l] = (dp[i][j][k] && dp[i + k][j + k][l - k]) || (dp[i][j + l - k][k] && dp[i + k][j][l - k]); } } } } return dp[0][0][n]; } };
[ "finalspace.1031@gmail.com" ]
finalspace.1031@gmail.com
2a9e34f4b80718544072cd3628aa865b2fc2444d
cfeac52f970e8901871bd02d9acb7de66b9fb6b4
/generated/src/aws-cpp-sdk-cloudtrail/source/model/ListImportFailuresRequest.cpp
ade8ef608d1c86bd1bd4cc70982c26793f66a1d9
[ "Apache-2.0", "MIT", "JSON" ]
permissive
aws/aws-sdk-cpp
aff116ddf9ca2b41e45c47dba1c2b7754935c585
9a7606a6c98e13c759032c2e920c7c64a6a35264
refs/heads/main
2023-08-25T11:16:55.982089
2023-08-24T18:14:53
2023-08-24T18:14:53
35,440,404
1,681
1,133
Apache-2.0
2023-09-12T15:59:33
2015-05-11T17:57:32
null
UTF-8
C++
false
false
1,237
cpp
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/cloudtrail/model/ListImportFailuresRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::CloudTrail::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; ListImportFailuresRequest::ListImportFailuresRequest() : m_importIdHasBeenSet(false), m_maxResults(0), m_maxResultsHasBeenSet(false), m_nextTokenHasBeenSet(false) { } Aws::String ListImportFailuresRequest::SerializePayload() const { JsonValue payload; if(m_importIdHasBeenSet) { payload.WithString("ImportId", m_importId); } if(m_maxResultsHasBeenSet) { payload.WithInteger("MaxResults", m_maxResults); } if(m_nextTokenHasBeenSet) { payload.WithString("NextToken", m_nextToken); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection ListImportFailuresRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.ListImportFailures")); return headers; }
[ "sdavtaker@users.noreply.github.com" ]
sdavtaker@users.noreply.github.com
470a77c2d03500db09f5d006bed664ae97db4c30
a0940d0bb63fc78fce26f2286d8c9b753b880ae3
/task2-sol.cpp
862b349c4720731441f52830094d548acc7843b3
[]
no_license
Kourosh-Davoudi/STL
170530ac5e7d94e78bcdcda24bf7e109fa7fdda6
525a994cd172aa6a2886d30fd669663bc81369d4
refs/heads/master
2021-04-03T18:34:44.352481
2020-03-28T16:47:11
2020-03-28T16:47:11
248,386,326
0
1
null
null
null
null
UTF-8
C++
false
false
2,041
cpp
// Student class is implemented based on string and do not need any change #include <iostream> #include <fstream> #include <string> #include <set> using namespace std; // ----------------------------- Base class class Person{ protected: string name; public: void setname(char const *); string getname(); Person(); // default constructor Person(const char *); Person(const Person &); // copy constructor Person(const string &); virtual ~Person(); }; void Person::setname(char const *n) { name = n; } string Person::getname() { return name; } Person::Person() { name = ""; } Person::Person(char const *n) { setname(n); } Person::Person(const string & n) { name = n; } Person::~Person() { } Person::Person(const Person &t):name(t.name) { } // ----------------------------- Student class class Student : public Person{ private: double grade; public: void setgrade(double); double getgrade(); Student(); // default constructor Student(char const *, double); Student(const Student &); // copy constructor ~Student(); friend ostream & operator<<(ostream &, const Student &); }; void Student::setgrade(double g) { grade =g; } double Student::getgrade() { return grade; } ostream & operator<<(ostream & out, const Student & s) { out << s.name << "," << s.grade; return out; } Student::Student(): grade(0) { } Student::Student(char const *n, double g): Person(n) { setgrade(g); } Student::Student(const Student &t):Person(t.name) { grade = t.grade; } Student::~Student() { } int main() { string name; double grade; set<string> student_names; set<string>::iterator p; ifstream fin("input_file.txt"); if (fin.fail()) // check if it is successful { cerr << " Cannot open the input file!" << endl; return 1; } while (fin >> name && fin >> grade){ if(grade < 50) student_names.insert(name); } for(p = student_names.begin(); p != student_names.end(); p++) cout << *p << endl; return 0; }
[ "noreply@github.com" ]
Kourosh-Davoudi.noreply@github.com
48d9f45f39bcb60ed5e474c22dde595e8d72f104
850a39e68e715ec5b3033c5da5938bbc9b5981bf
/drgraf4_0/Allheads/Mi_obj3d.h
03f18c3d6340be8f333090d46876a517917e0aef
[]
no_license
15831944/drProjects
8cb03af6d7dda961395615a0a717c9036ae1ce0f
98e55111900d6a6c99376a1c816c0a9582c51581
refs/heads/master
2022-04-13T12:26:31.576952
2020-01-04T04:18:17
2020-01-04T04:18:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,625
h
// ELMouse.h : header file // #ifndef _MI_OBJ3D_H #define _MI_OBJ3D_H //#undef AFX_DATA //#define AFX_DATA AFX_EXT_DATA #include "drObj3D.h" #include "DListMgr.h" #include "Def_Type.h" ///////////////////////////////////////////////////////////////////////////// // CMouse view ////////////////////////////////////////////////////// class CMI_Obj3D : public CObject { public: CMI_Obj3D(); ////////////////////////////////////// DECLARE_SERIAL(CMI_Obj3D) ////////////////////////////////////// // Attributes // Operations public: // Implementation public: ///////////////////////////////////////////// virtual int LBDownInit_OEdit(){return 0;}; virtual int LBUpObj3DEdit(){return 0;}; virtual int LBDownInit_OMove(){return 0;}; virtual int LBUpObj3DMove(){return 0;}; ///////////////////////////////////////////// virtual int LBDownInit_OInsert(); virtual int LBUpInit_OInsert(); virtual int LBUp_OInsert(CView* pView,UINT nView); protected: //////////////////////////////////////////////////////////// Obj3D int InsertAllInfo(); CDrObj3D* O_GetInfo(); protected: // Attributes protected: /////////////////////////////////////////// Curve CDrObj3D* m_pDrObj3D; /////////////////////////////////////////// Next //Operations public: ~CMI_Obj3D(); virtual void Serialize(CArchive& ar); /* // Generated message map functions //{{AFX_MSG(CMI_Obj3D) //}}AFX_MSG DECLARE_MESSAGE_MAP() */ }; //#undef AFX_DATA //#define AFX_DATA ////////////////////////////////////// #endif
[ "sray12345678@gmail.com" ]
sray12345678@gmail.com
12cd74be7c2809147f44d95c0780e8e7a244657f
62d6e09be253895ef4f574265e4b86a3fe3936d3
/Getopt/ShortFunction.cpp
112d134c17eaaa08e514fb1e7abb1c3522bec998
[]
no_license
JackWyj/Getopts
d8fa752680467dcf053c8af827f2ec48cd375df5
02e7b30a0d593cf127afdfd5a152aa0210496868
refs/heads/master
2016-09-08T02:03:18.458048
2015-06-23T13:34:13
2015-06-23T13:34:13
37,046,440
3
0
null
null
null
null
UTF-8
C++
false
false
607
cpp
#include "stdafx.h" #include "ShortFunction.h" ShortFunction::ShortFunction(void) { ch = 0; have_param = false; } ShortFunction::ShortFunction(char c , bool b){ ch = c; have_param = b; } ShortFunction::~ShortFunction(void) { } bool ShortFunction::haveParam(){ return have_param; } char ShortFunction::getch(){ return ch; } ShortFunction::ShortFunction(const ShortFunction &sfn){ ch = sfn.ch; have_param = sfn.have_param; } void ShortFunction::operator=(const ShortFunction &sfn){ ch = sfn.ch; have_param = sfn.have_param; } param_type ShortFunction::carry_param_type(){ return paramty; }
[ "568887572@qq.com" ]
568887572@qq.com
e4b1d126bdfa72583dbdff7118343bf1c0875958
44b79f3468fc295e856e8cadd42441c7f05dd1e7
/module06-study-stl/city.cpp
892c44d1104d818fe54bd6ea1a4e2ebf34296479
[ "MIT" ]
permissive
deepcloudlabs/dcl118-2020-sep-21
e000a2e83692a08dd7064af9b9df8aea8c0377f4
900a601f8c9a631a342ad8ce131ad08825d00466
refs/heads/master
2022-12-25T14:36:20.319743
2020-09-23T14:56:50
2020-09-23T14:56:50
297,109,828
5
1
null
null
null
null
UTF-8
C++
false
false
574
cpp
#include "city.h" namespace world { city::city(int id, const std::string &name, const std::string &country_code, int population) { this->id = id; this->name = name; this->population = population; this->country_code = country_code; } }; std::ostream &operator<<(std::ostream &out, const world::city &_city) { out << "city [ id=" << _city.id << ", name=" << _city.name << ", " << *(_city.belongs_to) << ", population=" << _city.population << " ]"; return out; }
[ "deepcloudlabs@gmail.com" ]
deepcloudlabs@gmail.com
a411158a8ced855fd1a0b0524a30a14f5da21d54
5c83b3b84af296ee2aaf4ff879fba949921668f0
/src/core/vertex_buffer_base.cpp
d57fe45761c166f78655401408ecc5b04593336a
[]
no_license
stevebeard/rend
8785dd6a71d9f2ebec8a83264fbcbd587c5f67fb
852b01252da9f9d77fd9ea3bf8743c64aa2e09b1
refs/heads/master
2020-07-29T22:00:32.250020
2019-09-13T15:39:11
2019-09-13T15:39:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
410
cpp
#include "vertex_buffer_base.h" using namespace rend; VertexBufferBase::VertexBufferBase(void) : _count(0), _bytes(0), _vertex_bytes(0) { } VertexBufferBase::~VertexBufferBase(void) { } uint32_t VertexBufferBase::count(void) const { return _count; } size_t VertexBufferBase::bytes(void) const { return _bytes; } size_t VertexBufferBase::vertex_bytes(void) const { return _vertex_bytes; }
[ "alas.paterson@gmail.com" ]
alas.paterson@gmail.com
7d0b9df182f454e20608fd8f6553fe6d3c6dccba
9f0d42c412db503f0759980a35136618ac6fda79
/MyProjects/C++/2021/07.19/ZR1955.cpp
d83200d4a6052c9097817442def7e6c6b39fc1f2
[]
no_license
lieppham/MyCode
38a8c1353a2627d68b47b5f959bb827819058357
469d87f9d859123dec754b2e4ae0dced53f68660
refs/heads/main
2023-08-25T04:00:00.495534
2021-10-21T12:15:44
2021-10-21T12:15:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
956
cpp
//Created by yanyanlongxia on 2021/7/23 // #include <bits/stdc++.h> #define ll long long #define clm(x) memset(x,0,sizeof(x)) #define infm(x) memset(x,0x3f3f3f3f,sizeof(x)) #define minfm(x) memset(x,0xcf,sizeof(x)) using namespace std; const int N=2e3; int n,s,a[N],sum[N]; bool ma[N][N]; int gcd(int x,int y){ return (!y)?x: gcd(y,x%y); } int main() { freopen("data.in","r",stdin); //freopen("ZR1955.out","w",stdout); scanf("%d%d",&n,&s); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) for(int j=1;j<=a[i];j++) { ma[i][j] = true; sum[j]++; } int su=0,u=0; while(su+n-sum[u+1]<=s){ u++; su+=n-sum[u]; } if(s!=su) { int mum = n-sum[u + 1], son = s - su; int com = gcd(mum, son); mum /= com; son /= com; printf("%d+%d/%d\n",u,son,mum); }else { printf("%d\n", u); } return 0; }
[ "yanyanlongxia@outlook.com" ]
yanyanlongxia@outlook.com
ecb7a987d472de06bca16181f8358db10c0320cf
f26360b99a471d466af83f037a02ccc4667db913
/3rdparty/poco/Crypto/testsuite/src/CryptoTest.cpp
777c23c610466c2b28c706352f97855d3f7c3a13
[ "BSL-1.0", "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
gitkeidy/opencvr
80646520b8099485edb6c666750808f876fabf97
9bd570ff30c407cf149acdaf483f22f0ebefa72e
refs/heads/master
2021-01-18T08:56:04.463604
2016-02-08T05:10:18
2016-02-08T05:10:18
50,656,483
3
1
null
2016-02-08T05:10:20
2016-01-29T10:44:57
Makefile
UTF-8
C++
false
false
9,166
cpp
// // CryptoTest.cpp // // $Id: //poco/1.4/Crypto/testsuite/src/CryptoTest.cpp#2 $ // // Copyright (c) 2008, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "CryptoTest.h" #include "CppUnit/TestCaller.h" #include "CppUnit/TestSuite.h" #include "Poco/Crypto/CipherFactory.h" #include "Poco/Crypto/Cipher.h" #include "Poco/Crypto/CipherKey.h" #include "Poco/Crypto/X509Certificate.h" #include "Poco/Crypto/CryptoStream.h" #include "Poco/StreamCopier.h" #include "Poco/Base64Encoder.h" #include <sstream> using namespace Poco::Crypto; static const std::string APPINF_PEM( "-----BEGIN CERTIFICATE-----\n" "MIIESzCCAzOgAwIBAgIBATALBgkqhkiG9w0BAQUwgdMxEzARBgNVBAMMCmFwcGlu\n" "Zi5jb20xNjA0BgNVBAoMLUFwcGxpZWQgSW5mb3JtYXRpY3MgU29mdHdhcmUgRW5n\n" "aW5lZXJpbmcgR21iSDEUMBIGA1UECwwLRGV2ZWxvcG1lbnQxEjAQBgNVBAgMCUNh\n" "cmludGhpYTELMAkGA1UEBhMCQVQxHjAcBgNVBAcMFVN0LiBKYWtvYiBpbSBSb3Nl\n" "bnRhbDEtMCsGCSqGSIb3DQEJARYeZ3VlbnRlci5vYmlsdHNjaG5pZ0BhcHBpbmYu\n" "Y29tMB4XDTA5MDUwNzE0NTY1NloXDTI5MDUwMjE0NTY1NlowgdMxEzARBgNVBAMM\n" "CmFwcGluZi5jb20xNjA0BgNVBAoMLUFwcGxpZWQgSW5mb3JtYXRpY3MgU29mdHdh\n" "cmUgRW5naW5lZXJpbmcgR21iSDEUMBIGA1UECwwLRGV2ZWxvcG1lbnQxEjAQBgNV\n" "BAgMCUNhcmludGhpYTELMAkGA1UEBhMCQVQxHjAcBgNVBAcMFVN0LiBKYWtvYiBp\n" "bSBSb3NlbnRhbDEtMCsGCSqGSIb3DQEJARYeZ3VlbnRlci5vYmlsdHNjaG5pZ0Bh\n" "cHBpbmYuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA89GolWCR\n" "KtLQclJ2M2QtpFqzNC54hUQdR6n8+DAeruH9WFwLSdWW2fEi+jrtd/WEWCdt4PxX\n" "F2/eBYeURus7Hg2ZtJGDd3je0+Ygsv7+we4cMN/knaBY7rATqhmnZWk+yBpkf5F2\n" "IHp9gBxUaJWmt/bq3XrvTtzrDXpCd4zg4zPXZ8IC8ket5o3K2vnkAOsIsgN+Ffqd\n" "4GjF4dsblG6u6E3VarGRLwGtgB8BAZOA/33mV4FHSMkc4OXpAChaK3tM8YhrLw+m\n" "XtsfqDiv1825S6OWFCKGj/iX8X2QAkrdB63vXCSpb3de/ByIUfp31PpMlMh6dKo1\n" "vf7yj0nb2w0utQIDAQABoyowKDAOBgNVHQ8BAf8EBAMCB4AwFgYDVR0lAQH/BAww\n" "CgYIKwYBBQUHAwMwDQYJKoZIhvcNAQEFBQADggEBAM0cpfb4BgiU/rkYe121P581\n" "ftg5Ck1PYYda1Fy/FgzbgJh2AwVo/6sn6GF79/QkEcWEgtCMNNO3LMTTddUUApuP\n" "jnEimyfmUhIThyud/vryzTMNa/eZMwaAqUQWqLf+AwgqjUsBSMenbSHavzJOpsvR\n" "LI0PQ1VvqB+3UGz0JUnBJiKvHs83Fdm4ewPAf3M5fGcIa+Fl2nU5Plzwzskj84f6\n" "73ZlEEi3aW9JieNy7RWsMM+1E8Sj2CGRZC4BM9V1Fgnsh4+VHX8Eu7eHucvfeIYx\n" "3mmLMoK4sCayL/FGhrUDw5AkWb8tKNpRXY+W60Et281yxQSeWLPIbatVzIWI0/M=\n" "-----END CERTIFICATE-----\n" ); CryptoTest::CryptoTest(const std::string& name): CppUnit::TestCase(name) { } CryptoTest::~CryptoTest() { } void CryptoTest::testEncryptDecrypt() { Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes256")); for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_NONE); std::string result = pCipher->decryptString(out, Cipher::ENC_NONE); assert (in == result); } for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_BASE64); std::string result = pCipher->decryptString(out, Cipher::ENC_BASE64); assert (in == result); } for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_BINHEX); std::string result = pCipher->decryptString(out, Cipher::ENC_BINHEX); assert (in == result); } } void CryptoTest::testEncryptDecryptWithSalt() { Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes256", "simplepwd", "Too much salt")); Cipher::Ptr pCipher2 = CipherFactory::defaultFactory().createCipher(CipherKey("aes256", "simplepwd", "Too much salt")); for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_NONE); std::string result = pCipher2->decryptString(out, Cipher::ENC_NONE); assert (in == result); } for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_BASE64); std::string result = pCipher2->decryptString(out, Cipher::ENC_BASE64); assert (in == result); } for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_BINHEX); std::string result = pCipher2->decryptString(out, Cipher::ENC_BINHEX); assert (in == result); } } void CryptoTest::testEncryptDecryptDESECB() { Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("des-ecb", "password")); for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_NONE); std::string result = pCipher->decryptString(out, Cipher::ENC_NONE); assert (in == result); } for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_BASE64); std::string result = pCipher->decryptString(out, Cipher::ENC_BASE64); assert (in == result); } for (std::size_t n = 1; n < MAX_DATA_SIZE; n++) { std::string in(n, 'x'); std::string out = pCipher->encryptString(in, Cipher::ENC_BINHEX); std::string result = pCipher->decryptString(out, Cipher::ENC_BINHEX); assert (in == result); } } void CryptoTest::testPassword() { CipherKey key("aes256", "password", "salt"); std::ostringstream keyStream; Poco::Base64Encoder base64KeyEnc(keyStream); base64KeyEnc.write(reinterpret_cast<const char*>(&key.getKey()[0]), key.keySize()); base64KeyEnc.close(); std::string base64Key = keyStream.str(); assert (base64Key == "hIzxBt58GDd7/6mRp88bewKk42lM4QwaF78ek0FkVoA="); } void CryptoTest::testEncryptInterop() { Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes256", "password", "salt")); const std::string plainText = "This is a secret message."; const std::string expectedCipherText = "9HITTPaU3A/LaZzldbdnRZ109DKlshouKren/n8BsHc="; std::string cipherText = pCipher->encryptString(plainText, Cipher::ENC_BASE64); assert (cipherText == expectedCipherText); } void CryptoTest::testDecryptInterop() { Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes256", "password", "salt")); const std::string expectedPlainText = "This is a secret message."; const std::string cipherText = "9HITTPaU3A/LaZzldbdnRZ109DKlshouKren/n8BsHc="; std::string plainText = pCipher->decryptString(cipherText, Cipher::ENC_BASE64); assert (plainText == expectedPlainText); } void CryptoTest::testStreams() { Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes256")); static const std::string SECRET_MESSAGE = "This is a secret message. Don't tell anyone."; std::stringstream sstr; EncryptingOutputStream encryptor(sstr, *pCipher); encryptor << SECRET_MESSAGE; encryptor.close(); DecryptingInputStream decryptor(sstr, *pCipher); std::string result; Poco::StreamCopier::copyToString(decryptor, result); assert (result == SECRET_MESSAGE); assert (decryptor.eof()); assert (!decryptor.bad()); std::istringstream emptyStream; DecryptingInputStream badDecryptor(emptyStream, *pCipher); Poco::StreamCopier::copyToString(badDecryptor, result); assert (badDecryptor.fail()); assert (badDecryptor.bad()); assert (!badDecryptor.eof()); } void CryptoTest::testCertificate() { std::istringstream certStream(APPINF_PEM); X509Certificate cert(certStream); std::string subjectName(cert.subjectName()); std::string issuerName(cert.issuerName()); std::string commonName(cert.commonName()); std::string country(cert.subjectName(X509Certificate::NID_COUNTRY)); std::string localityName(cert.subjectName(X509Certificate::NID_LOCALITY_NAME)); std::string stateOrProvince(cert.subjectName(X509Certificate::NID_STATE_OR_PROVINCE)); std::string organizationName(cert.subjectName(X509Certificate::NID_ORGANIZATION_NAME)); std::string organizationUnitName(cert.subjectName(X509Certificate::NID_ORGANIZATION_UNIT_NAME)); assert (subjectName == "/CN=appinf.com/O=Applied Informatics Software Engineering GmbH/OU=Development/ST=Carinthia/C=AT/L=St. Jakob im Rosental/emailAddress=guenter.obiltschnig@appinf.com"); assert (issuerName == subjectName); assert (commonName == "appinf.com"); assert (country == "AT"); assert (localityName == "St. Jakob im Rosental"); assert (stateOrProvince == "Carinthia"); assert (organizationName == "Applied Informatics Software Engineering GmbH"); assert (organizationUnitName == "Development"); assert (cert.issuedBy(cert)); } void CryptoTest::setUp() { } void CryptoTest::tearDown() { } CppUnit::Test* CryptoTest::suite() { CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("CryptoTest"); CppUnit_addTest(pSuite, CryptoTest, testEncryptDecrypt); CppUnit_addTest(pSuite, CryptoTest, testEncryptDecryptWithSalt); CppUnit_addTest(pSuite, CryptoTest, testEncryptDecryptDESECB); CppUnit_addTest(pSuite, CryptoTest, testPassword); CppUnit_addTest(pSuite, CryptoTest, testEncryptInterop); CppUnit_addTest(pSuite, CryptoTest, testDecryptInterop); CppUnit_addTest(pSuite, CryptoTest, testStreams); CppUnit_addTest(pSuite, CryptoTest, testCertificate); return pSuite; }
[ "xsmart@163.com" ]
xsmart@163.com
f1e5f2b5adb65210cc8ec49d1d107578e38d3ea8
7c8b98fecfb1e9dbd9d98c890e32b12a0fe03f6b
/transactionHistory.h
dd1c3a9cc09de964b333dbca39156f33e96070cf
[]
no_license
DevTheSourceLuke/css343_lab4
56802e5616e0ba07f270340c4e3b2a352a6dbcad
d2238e3eac57c016ebc87dd67da64844ab72845a
refs/heads/master
2021-06-14T06:08:35.119779
2017-03-16T06:47:18
2017-03-16T06:47:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,617
h
/*------------------------------------------------------------------------------------------------- Authors: Bushey, Luke King, Garret Created: 2/21/2017 Modified: 3/1/2017 This class represents a Transaction affects the store's customer's history. -------------------------------------------------------------------------------------------------*/ #pragma once #ifndef transactionhistory_h #define transactionhistory_h #include <string> #include <fstream> #include "transaction.h" #include "DVDClassic.h" #include "DVDComedy.h" #include "DVDDrama.h" class transactionHistory: public Transaction { public: transactionHistory(void); //default no-args constructor ~transactionHistory(void); //destructor bool setData(ifstream& infile); void displayTransaction(void) const; void processTransaction(HashTable& customers, BinarySearchTree<Comedy>* inventoryF, BinarySearchTree<Drama>* inventoryD, BinarySearchTree<Classic>* inventoryC); string toString(void) const; //getters int getCustomerID(void) const; /*------------------------------------------------------------------------------------------------ Setter method for customerID. Returns a bool indicating success. PRECONDITIONS: - input must be greater than 999 - input must be less than 10000 POSTCONDITIONS: - sets customerID to input ------------------------------------------------------------------------------------------------*/ bool setCustomerID(int input); private: int customerID; HashTable* customers; }; #endif // !transactionhistory_h
[ "noreply@github.com" ]
DevTheSourceLuke.noreply@github.com
e107dbe5f8cc956665c2c4572712dd1a16bd65af
2ff6e1f31cc46bb5d3b3dbb9f7bcf0a61da252ab
/tetris2/tetris2.ino
e6c9092abaa29fd5b400ea0451c9490e161efecf
[]
no_license
ondras/arduino
c0fc37e373935c30ec1b61f5043ae32e1dc951e4
f41fa693c317a1794f2784dc3f7442ae28eee6ed
refs/heads/master
2023-08-25T23:29:01.565826
2020-08-22T10:54:29
2020-08-22T10:54:29
19,730,254
3
2
null
null
null
null
UTF-8
C++
false
false
1,675
ino
#include <tetris.h> #include "output-rgbmatrix.h" #ifdef BENCH #include <stdio.h> #include <limits.h> #define MAX_GAMES 100 Output output; int total_score = 0; int min_score = INT_MAX; int max_score = 0; int games = 0; #elif TERM OutputTerminal output; #else OutputRGBMatrix output; #endif //Weights weights { .holes = 20, .max_depth = 2, .cells = 1, .max_slope = 1, .slope = 1, .weighted_cells = 1 }; //Weights weights { .holes = 11.8, .max_depth = 0.1, .cells = -1.1, .max_slope = 0.6, .slope = 2.2, .weighted_cells = 0.6 }; //Game game(&output, weights); Game game(output); void setup() { // randomSeed(analogRead(A0) * analogRead(A1) * analogRead(A2)); #ifdef BENCH srandom(games); #endif game.start(); } void loop() { game.step(); if (game.playing) { #ifndef BENCH delay(100); #endif } else { #ifdef BENCH games++; total_score += game.score; min_score = min(min_score, game.score); max_score = max(max_score, game.score); #else delay(1000); #endif #ifdef BENCH if (games > MAX_GAMES) { printf("total: %i, min: %i, max: %i\n", total_score, min_score, max_score); // printf("%i\n", total_score); exit(0); } else { setup(); } #else setup(); #endif } } #if defined(BENCH) || defined(TERM) int main(int argc, char** argv) { #ifdef BENCH if (argc < 7) { printf("USAGE: %s holes max_depth cells max_slope slope weighted_cells\n", argv[0]); exit(1); } weights.holes = atof(argv[1]); weights.max_depth = atof(argv[2]); weights.cells = atof(argv[3]); weights.max_slope = atof(argv[4]); weights.slope = atof(argv[5]); weights.weighted_cells = atof(argv[6]); #endif setup(); while (true) { loop(); } } #endif
[ "ondrej.zara@gmail.com" ]
ondrej.zara@gmail.com
db266ddf7401aa89d77492bf6a75637f608594fa
013c7539d6fb9ffc30740a33691aac902b11b06e
/practive/POJ/finished/3278.cpp
468d0fcf7c40dcabc1daed9490d807bcad43bd30
[]
no_license
eternity6666/life-in-acm
1cc4ebaa65af62219130d53c9be534ad31b361e2
e279121a28e179d0de33674b9ce10c6763d78d32
refs/heads/master
2023-04-13T07:50:58.231217
2023-04-09T09:23:24
2023-04-09T09:23:24
127,930,873
0
0
null
null
null
null
UTF-8
C++
false
false
996
cpp
#include <iostream> #include <cstring> #include <queue> using namespace std; const int maxn = 1e5 + 10; struct node{int now, time;}; int n, k; bool v[maxn]; int bfs() { memset(v, 1, sizeof(v)); node s; s.now = n; s.time = 0; queue<node> q; q.push(s); int ans = maxn; while(!q.empty()) { s = q.front(); if(s.now == k) { ans = s.time; break; } q.pop(); v[s.now] = 0; node tmp; tmp.time = s.time + 1; tmp.now = s.now + 1; if(tmp.now < maxn && v[tmp.now]) q.push(tmp); tmp.now = s.now - 1; if(tmp.now >= 0 && v[tmp.now]) q.push(tmp); tmp.now = s.now * 2; if(tmp.now < maxn && tmp.now >= 0 && v[tmp.now]) q.push(tmp); } return ans; } int main() { freopen("in.txt", "r", stdin); ios_base::sync_with_stdio(0); cin >> n >> k; cout << bfs() << endl; return 0; }
[ "1462928058@qq.com" ]
1462928058@qq.com
ba65c63bfb27b946dc9a2cb0cd0a7fbe1f3bb856
4c8aa269772b2677176b21930e2b513e5fcad252
/resources/cPerson.cpp
1a10789bd53c13421e1d3166f8c34ee7504208d9
[]
no_license
CEduardoSQUTEC/karuSampi
0e29ef230263fdfe32b1c0e657407f30969ef784
b0a08ee231789e807590e7d1eac25f41562de91c
refs/heads/master
2022-03-20T16:58:00.369954
2019-11-29T16:46:40
2019-11-29T16:46:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
62
cpp
// // Created by eduar on 28-Nov-19. // #include "cPerson.h"
[ "eduardo.castro@utec.edu.pe" ]
eduardo.castro@utec.edu.pe
fae816c4afc9cd24cf07e3b92e3d8c6ed3a9d5b1
50edf0fe7791df5e792aef4ae844783a9bbbeb64
/3. dynamic programming/F.cpp
a3b49310cd11be8539f39b7e871b3e1bc8f9c442
[]
no_license
don2rryV/itmo_ADS
08a5266f0bb485325f04797979118016bbf6c543
af728eafc278e6d26c70356817446fe0b2cb9833
refs/heads/master
2020-05-27T16:48:10.716049
2019-05-27T17:37:57
2019-05-27T17:37:57
188,708,988
0
1
null
null
null
null
UTF-8
C++
false
false
2,850
cpp
#include <bits/stdc++.h> using namespace std; vector <vector <int> > a, ans; string s; int func(int left, int right){ if (left > right) return 0; else{ //cout << left << " " << right << endl; if (a[left][right] == 0){ // cout << left << " " << right << " in 0 " << endl; int y = right - left; for (int i = left; i <= right; i++){ cout << s[i]; } return 0; } if (a[left][right] == right - left +1){ return 1; }//} else if (ans[left][right] == -1) { cout << s[left]; func(left + 1, right - 1); cout << s[right]; return 0; } func(left, ans[left][right]); func(ans[left][right]+1, right); } } int main() { cin >> s; a.resize(s.length()); ans.resize(s.length()); for (int i = 0; i < s.length(); i++){ for (int j = 0; j < s.length(); j++){ a[i].resize(s.length()); ans[i].resize(s.length()); } } /* for (int i = 0; i < s.length(); i++){ for (int j = 0; j < s.length(); j++){ a[i][j] = 0; if (i == j) {a[i][j] = 1;} if (i == j-1){ if (s[i] == '[' && s[j] == ']' || s[i] == '{' && s[j] == '}' || s[i] == '(' && s[j] == ')'){ a[i][j] = 0; ans[i][j] = i; } //else {a[i][j] = 2; ans[i][j] = 0;} } } } /*for (int i = 0; i < s.length(); i++){ for (int j = 0; j < s.length(); j++){ cout << a[i][j] << " "; } cout << endl; } */ for (int j = 0; j < s.length(); j++){ for (int i = j; i >=0 ; i--){ if (i != j){ int buf = 1000000000; int ind = -1; //ans[i][j] = -1; if (s[i] == '[' && s[j] == ']' || s[i] == '{' && s[j] == '}' || s[i] == '(' && s[j] == ')'){ ind = -1; buf = a[i+1][j-1]; } int min_buf = a[i][i] + a[i+1][j]; //ind = i; for (int p = i; p < j; p++){ if (a[i][p] + a[p+1][j] < buf) { buf = a[i][p] + a[p+1][j]; ind = p;} } //buf = min(buf, min_buf); a[i][j] = buf; ans[i][j] = ind; }else a[i][j] = 1; } } /* for (int i = 0; i < s.length(); i++){ for (int j = 0; j < s.length(); j++){ cout << a[i][j] << " "; } cout << endl; } cout << endl; for (int i = 0; i < s.length(); i++){ for (int j = 0; j < s.length(); j++){ cout << ans[i][j] << " "; } cout << endl; }*/ func(0, s.length()-1); //cout << s.length() - a[0][ s.length() - 1]; }
[ "don2rry@gmail.com" ]
don2rry@gmail.com
a8791f0636d7fbecd4a63aa4a4fbb4f64b8c7f6d
e6f6c2fe3a2d77069bca51c39d54ba1821f00a36
/communication/unixSocket/include_files/unixSocket.hh
0b964026e907f0c335744bc8a887f872a0c0c473
[]
no_license
Tibonim/cpp_plazza
b33744dc6ad6a333eabfc9c6beeb992e01e41faa
0cf973005c59bac8d32bb628604aea760a6cf22f
refs/heads/master
2023-07-25T08:15:17.735210
2018-10-28T10:10:59
2018-10-28T10:10:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
485
hh
#pragma once #include <string> #include <sys/socket.h> #include <sys/un.h> #include <arpa/inet.h> #include "ACom.hh" namespace com { class unixSocket : public ACom { public: unixSocket(std::size_t id, int input); ~unixSocket(); void sendCmd(ICom::SendProtocol const &protocol) override; void receivedCmd(ICom::SendProtocol& protocol) override; private: int _socket; int _socketIn; struct sockaddr addrMe; std::string _socketFileMe; }; }
[ "Fusion@LAPTOP-687C0M9D.localdomain" ]
Fusion@LAPTOP-687C0M9D.localdomain
12dd406c4759c70dbb675e095ae2a00bd95a5dfb
8e355653e4fcb7896ec767bf8819bf53ccac7b06
/Configuration.cpp
4e6a766f9642ea27c9edb7c64234ed09b6e79127
[]
no_license
bashirkhayat/Turing-Machine-Simulator
6afcbdce7e3196881691206bf24b64e145608684
684b783e51644195b40d8b1ed1c75326846b5a1c
refs/heads/master
2020-03-26T00:13:45.876566
2018-08-10T16:54:59
2018-08-10T16:54:59
144,311,400
0
0
null
null
null
null
UTF-8
C++
false
false
224
cpp
// // Created by jeries on 1/17/17. // #include "State.cpp" template<typename Tape, typename State, int Position> struct Configuration { typedef Tape tape; typedef State state; enum { position = Position }; };
[ "noreply@github.com" ]
bashirkhayat.noreply@github.com
049092663df1e1ad7b506685f510939da48f8fc8
c1d7cd0b81923e54d18435ad7fdd119c290f0ddf
/10.11.cpp
c0e295f33ffaa33da481833c9ef2fb70545e4c3c
[]
no_license
leebingzheng/li_bingzheng
a6ba4f8d08dff21c5c408e7d03eeecca9a88839b
6ebe1b67665499b981ec663879b803b46778b632
refs/heads/master
2020-04-02T06:24:31.630734
2019-04-21T12:08:12
2019-04-21T12:08:12
154,146,476
0
0
null
null
null
null
UTF-8
C++
false
false
660
cpp
#include "Polynomial.h" #include <iostream> #include <string> #include <Polynomial.h> using namespace std; Polynomial::Polynomial(int a) { z=a; x=new int[z+1](); for(int i=0;i<z+1;++i) x[i]=0; } Polynomial::~Polynomial() { delete[]x; } istream & operator>>(istream& input,Polynomial& a) { for(int i=0;i<a.z+1;++i) cin>>a.x[i]; return input; } ostream & operator<<(ostream& output,const Polynomial &a) { for(int i=0;i<a.z+1;++i) { if(i==0) cout<<a.x[i]<<"*"<<"x^"<<i; else cout<<"+"<<a.x[i]<<" "<<"x^"<<i; } cout<<endl; return output; } Polynomial operator+(Polynomial& a,Polynomial& b) { }
[ "1074586195@qq.com" ]
1074586195@qq.com
2163d70c3fd36099f2d26e57b9aba7e11bb7163a
ac25e1afb366426988e5900270a27da8da22f8dc
/src/kidsbedsmall.cpp
e4f5cb1b4761ebee99fd5b98b66acc45a53183f0
[]
no_license
sha256/OpenGLKidsRoom
a2c5424729c74ab1d37300b32e86057a90d85031
131b9aa4d1bead40cf32799b5618078e9889ddb9
refs/heads/master
2021-01-20T15:19:54.674265
2017-05-09T14:44:38
2017-05-09T14:44:38
90,756,520
0
0
null
null
null
null
UTF-8
C++
false
false
5,701
cpp
// // kidsbedsmall.c // Offline1 // // Created by Shamim Hasnath on 10/5/15. // Copyright © 2015 Holo. All rights reserved. // #include "Header.h" void kidsBedSmallDisplay(){ color(LB_PILLER); glPushMatrix();{ glTranslatef(10, 0, 0); glScaled(1, 3, 1); drawCurvedCubicLine(200, 100); }glPopMatrix(); glPushMatrix();{ glTranslatef(10, 0, 0); glScaled(1, 3, 1); drawCurvedCubicLine(200, 40); }glPopMatrix(); glPushMatrix();{ glTranslatef(-10, -5.0, 0); glScaled(1, 3, 1); drawCurvedCubicLine(90, 100); }glPopMatrix(); glPushMatrix();{ glTranslatef(-10, -5.0, 0); glScaled(1, 3, 1); drawCurvedCubicLine(90, 40); }glPopMatrix(); // high cubes glPushMatrix();{ glTranslatef(-18.0, -48.0, 50.0); glScaled(1.0, 1.2, 20.0); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glTranslatef(18.0, -48.0, 50.0); glScaled(1.0, 1.2, 20.0); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glTranslatef(20.5, 51.0, 50.0); glScaled(1.0, 1.2, 20.0); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glTranslatef(-15.0, 51.0, 50.0); glScaled(1.0, 1.2, 20.0); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glTranslatef(2.0, 51.0, 40.0); glScaled(7, 1, 1); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glTranslatef(0.0, -51.0, 40.0); glScaled(7, 1, 1); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glTranslatef(2.0, 51.0, 98.0); glScaled(7, 1, 1); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glTranslatef(0.0, -51.0, 97.0); glScaled(7, 1, 1); glutSolidCube(5.0f); }glPopMatrix(); glPushMatrix();{ glScaled(1, 2.5, 1); drawSphereLine(0, 67); }glPopMatrix(); drawHighCubeLine(51.0); drawHighCubeLine(-51.0); GLdouble eqn1[4] = { 0.0, 1.0, 1.0, 0.0 }; GLdouble eqn2[4] = { 0.0, -1.0, 1.0, 0.0 }; glPushMatrix();{ glTranslatef(0, 20, 0); glClipPlane(GL_CLIP_PLANE0,eqn1); }glPopMatrix(); glPushMatrix();{ glTranslatef(0, -20, 0); glClipPlane(GL_CLIP_PLANE1,eqn2); }glPopMatrix(); color(LB_PILLER_VAR2); glEnable(GL_CLIP_PLANE1); glEnable(GL_CLIP_PLANE0);{ glPushMatrix();{ glScaled(0.9, 1, 1); drawCurvedPlate(0, 67); }glPopMatrix(); }glDisable(GL_CLIP_PLANE0); glDisable(GL_CLIP_PLANE1); } void drawHighCubeLine(float y){ float x = -15; for(int i=0; i<7; i++){ glPushMatrix();{ glTranslatef(x + 5*i, y, 66); glScaled(1, 1, 30); glutSolidCube(2.0); }glPopMatrix(); } } void drawCurvedPlate(double fromAngle, double z){ double angle = fromAngle; double radius = 30; for(int i=0; i<200; i++){ double m = radius * cos(angle); double n = radius * sin(angle); //drawBitmapInt(i, m, n, 100); glPushMatrix();{ glTranslatef(m, n, z); glScaled(1, 30, 1); glutSolidCube(2); }glPopMatrix(); angle += 3.10; } //once = true; //glDisable(GL_BLEND); } void drawSphereLine(double fromAngle, double z){ double angle = fromAngle; double radius = 30; //glEnable(GL_BLEND); for(int i=0; i<100; i++){ double m = radius * cos(angle); double n = radius * sin(angle); // glPushMatrix();{ glTranslatef(m, n, z); glScaled(1, 0.3, 32); // drawBitmapInt(i, m, n, 100); if ((i > 17 && i < 59) || (i > 92 && i<100)) glutSolidCube(0.0); else glutSolidCube(2); }glPopMatrix(); angle += 3.10; } //once = true; //glDisable(GL_BLEND); } void drawCurvedCubicLine(double fromAngle, double z){ glBegin(GL_QUADS);{ double angle = fromAngle; double radius = 20; double leno = 2; double zh = 5.0; for(int i =0; i<200; i++){ double m = radius * cos(angle); double n = radius * sin(angle); //glColor3f(1.0f, 0.0f, 0.0f); // Red glVertex3f(m+leno, n, z); glVertex3f(m, n, z); glVertex3f(m, n+leno, z); glVertex3f( m+leno, n+leno, z); // Back face (z = -1.0f) //glColor3f(1.0, 1.0, 0.0f); // Yellow glVertex3f(m+leno, n, z-zh); glVertex3f(m, n, z-zh); glVertex3f(m, n+leno, z-zh); glVertex3f( m+leno, n+leno, z-zh); // Left face (x = -1.0f) //glColor3f(0.0f, 0.0f, 1.0f); // Blue glVertex3f(m, n+leno, z); glVertex3f(m, n+leno, z-zh); glVertex3f(m, n, z-zh); glVertex3f(m, n, z); // Right face (x = 1.0f) //glColor3f(0.0f, 1.0f, 0.0f); // Magenta glVertex3f(m+leno, n+leno, z-zh); glVertex3f(m+leno, n+leno, z); glVertex3f(m+leno, n, z); glVertex3f(m+leno, n, z-zh); angle += 0.01; } }glEnd(); }
[ "shamim@hasnath.net" ]
shamim@hasnath.net
996c64f8814e1e0dc72928669e5bdd6b31396ca6
da41653417bb575b80f80dcd534083d3ec5968b1
/Qt5_learn/Day1/Code/01_FirstProject/mypushbutton.cpp
e9fd74b070aa0d6659dd91271f8d6d2a39e11828
[]
no_license
TaraxaYJ/Qt5_Interface_for_Robot
e5c6420fc17300e0aef72b5afcd7aa3f8002b179
4cb7edc6327b55e840c3266329b87f38dde6efb2
refs/heads/master
2020-12-03T16:51:21.240568
2020-01-02T14:31:50
2020-01-02T14:31:50
231,396,042
1
1
null
null
null
null
UTF-8
C++
false
false
239
cpp
#include "mypushbutton.h" #include <QDebug> MyPushButton::MyPushButton(QWidget *parent) : QPushButton(parent) { qDebug() << "我的按钮类构造调用"; } MyPushButton::~MyPushButton() { qDebug() << "我的按钮类析构"; }
[ "yyj_1803294@sjtu.edu.cn" ]
yyj_1803294@sjtu.edu.cn
8a15213a202dba0bce4076bcd4bb20f029b3997b
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/httpd/gumtree/httpd_old_hunk_1357.cpp
4b86268d0da26e74a2833567515b4af54f3df5de
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
539
cpp
*/ #include "apr_arch_threadproc.h" APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { int x; if (chdir("/") == -1) { return errno; } #if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(BEOS) /* Don't detach for MPE because child processes can't survive the death of * the parent. */ if (daemonize) { if ((x = fork()) > 0) { exit(0); } else if (x == -1) { perror("fork"); fprintf(stderr, "unable to fork new process\n");
[ "993273596@qq.com" ]
993273596@qq.com
4237332df7a0628105c6f91dd7bff4c671c19cf1
bd59d5419a886576ca93b2d07fb70c910144e4ba
/MsgBox.cpp
bec0bce10e4f2b7698cf074c89d369384959b41c
[]
no_license
liuyanmin120/test
9555a0622f1a96e4ad1170ab8a38b7f2ac198a6e
45d5793c70e819e4263f40b32beaeeeb7d751a50
refs/heads/master
2021-06-03T17:49:41.679532
2020-12-10T07:27:13
2020-12-10T07:27:13
320,192,472
1
0
null
null
null
null
UTF-8
C++
false
false
2,274
cpp
#include "MsgBox.h" #include "ui_MsgBox.h" const int MulHeight = 253; const int SingleHeight = 193; MsgBox::MsgBox(QWidget *parent, bool bAutoDel/* = true*/, int autoCloseTime/* = 0*/) : QDialog(parent), ui(new Ui::msgbox) { ui->setupUi(this); setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setFixedSize(width(), height()); setAttribute(Qt::WA_DeleteOnClose, bAutoDel); // init _bOk = false; _funCall = NULL; _nHasTime = autoCloseTime; _pParames = NULL; _pTimer = NULL; if (_nHasTime > 0) { _pTimer = new QTimer(this); connect(_pTimer, SIGNAL(timeout()), this, SLOT(onUpdateTimer())); //delay->singleShot(60000,this,SLOT(toplay())); _pTimer->start(_nHasTime * 1000); } ui->labMsg->setWordWrap(true); ui->labMsg->setAlignment(Qt::AlignCenter); connect(ui->btnOk, SIGNAL(clicked()), this, SLOT(onButtonClick())); connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(onButtonClick())); connect(ui->btnClose, SIGNAL(clicked()), this, SLOT(onButtonClick())); } MsgBox::~MsgBox() { if (_pTimer) { if (_pTimer->isActive()) { _pTimer->stop(); } } delete ui; } void MsgBox::ShowDlg(FuncMsgCloseCall func /*= NULL*/, void* pFuncParam /*= NULL*/) { _funCall = func; _pParames = pFuncParam; show(); raise(); } void MsgBox::SetMainInfo(QString strMsg, QString strTitle /*= ""*/) { ui->labMsg->setText(strMsg); if (!strTitle.isEmpty()) { setWindowTitle(strTitle); } if (strMsg.length() < 100) { setFixedHeight(SingleHeight); } else { setFixedHeight(MulHeight); } } void MsgBox::SetBtnInfo(bool bShowCancel, QString strOk /*= ""*/, QString strCancel /*= ""*/) { if (!strOk.isEmpty()) { ui->btnOk->setText(strOk); } if (!strCancel.isEmpty()) { ui->btnCancel->setText(strCancel); } ui->btnCancel->setVisible(bShowCancel); } void MsgBox::closeEvent(QCloseEvent *event) { emit sgCloseMsgBox(_bOk, this); if (_funCall) { _funCall(_bOk, _pParames); } _bOk = false; QDialog::closeEvent(event); } void MsgBox::onButtonClick() { QPushButton *pBtn = qobject_cast<QPushButton*>(sender()); if (pBtn == ui->btnOk) { _bOk = true; } else if (pBtn == ui->btnCancel || pBtn == ui->btnClose) { _bOk = false; } hide(); close(); } void MsgBox::onUpdateTimer() { close(); }
[ "mywin@qq.com" ]
mywin@qq.com
af36ba3442cb6180a261f6880ebf3f60e68d697a
f5f750efbde0ccd95856820c975ec88ee6ace0f8
/aws-cpp-sdk-clouddirectory/include/aws/clouddirectory/model/ListObjectChildrenRequest.h
b3245e8b4e7d37504bcfa1e6b4729d65ccf597b7
[ "JSON", "MIT", "Apache-2.0" ]
permissive
csimmons0/aws-sdk-cpp
578a4ae6e7899944f8850dc37accba5568b919eb
1d0e1ddb51022a02700a9d1d3658abf628bb41c8
refs/heads/develop
2020-06-17T14:58:41.406919
2017-04-12T03:45:33
2017-04-12T03:45:33
74,995,798
0
0
null
2017-03-02T05:35:49
2016-11-28T17:12:34
C++
UTF-8
C++
false
false
7,931
h
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/clouddirectory/CloudDirectory_EXPORTS.h> #include <aws/clouddirectory/CloudDirectoryRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/clouddirectory/model/ObjectReference.h> #include <aws/clouddirectory/model/ConsistencyLevel.h> namespace Aws { namespace CloudDirectory { namespace Model { /** */ class AWS_CLOUDDIRECTORY_API ListObjectChildrenRequest : public CloudDirectoryRequest { public: ListObjectChildrenRequest(); Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>ARN associated with the <a>Directory</a> where the object resides. For more * information, see <a>arns</a>.</p> */ inline const Aws::String& GetDirectoryArn() const{ return m_directoryArn; } /** * <p>ARN associated with the <a>Directory</a> where the object resides. For more * information, see <a>arns</a>.</p> */ inline void SetDirectoryArn(const Aws::String& value) { m_directoryArnHasBeenSet = true; m_directoryArn = value; } /** * <p>ARN associated with the <a>Directory</a> where the object resides. For more * information, see <a>arns</a>.</p> */ inline void SetDirectoryArn(Aws::String&& value) { m_directoryArnHasBeenSet = true; m_directoryArn = value; } /** * <p>ARN associated with the <a>Directory</a> where the object resides. For more * information, see <a>arns</a>.</p> */ inline void SetDirectoryArn(const char* value) { m_directoryArnHasBeenSet = true; m_directoryArn.assign(value); } /** * <p>ARN associated with the <a>Directory</a> where the object resides. For more * information, see <a>arns</a>.</p> */ inline ListObjectChildrenRequest& WithDirectoryArn(const Aws::String& value) { SetDirectoryArn(value); return *this;} /** * <p>ARN associated with the <a>Directory</a> where the object resides. For more * information, see <a>arns</a>.</p> */ inline ListObjectChildrenRequest& WithDirectoryArn(Aws::String&& value) { SetDirectoryArn(value); return *this;} /** * <p>ARN associated with the <a>Directory</a> where the object resides. For more * information, see <a>arns</a>.</p> */ inline ListObjectChildrenRequest& WithDirectoryArn(const char* value) { SetDirectoryArn(value); return *this;} /** * <p>Reference that identifies the object for which child objects are being * listed.</p> */ inline const ObjectReference& GetObjectReference() const{ return m_objectReference; } /** * <p>Reference that identifies the object for which child objects are being * listed.</p> */ inline void SetObjectReference(const ObjectReference& value) { m_objectReferenceHasBeenSet = true; m_objectReference = value; } /** * <p>Reference that identifies the object for which child objects are being * listed.</p> */ inline void SetObjectReference(ObjectReference&& value) { m_objectReferenceHasBeenSet = true; m_objectReference = value; } /** * <p>Reference that identifies the object for which child objects are being * listed.</p> */ inline ListObjectChildrenRequest& WithObjectReference(const ObjectReference& value) { SetObjectReference(value); return *this;} /** * <p>Reference that identifies the object for which child objects are being * listed.</p> */ inline ListObjectChildrenRequest& WithObjectReference(ObjectReference&& value) { SetObjectReference(value); return *this;} /** * <p>The pagination token.</p> */ inline const Aws::String& GetNextToken() const{ return m_nextToken; } /** * <p>The pagination token.</p> */ inline void SetNextToken(const Aws::String& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; } /** * <p>The pagination token.</p> */ inline void SetNextToken(Aws::String&& value) { m_nextTokenHasBeenSet = true; m_nextToken = value; } /** * <p>The pagination token.</p> */ inline void SetNextToken(const char* value) { m_nextTokenHasBeenSet = true; m_nextToken.assign(value); } /** * <p>The pagination token.</p> */ inline ListObjectChildrenRequest& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;} /** * <p>The pagination token.</p> */ inline ListObjectChildrenRequest& WithNextToken(Aws::String&& value) { SetNextToken(value); return *this;} /** * <p>The pagination token.</p> */ inline ListObjectChildrenRequest& WithNextToken(const char* value) { SetNextToken(value); return *this;} /** * <p>Maximum number of items to be retrieved in a single call. This is an * approximate number.</p> */ inline int GetMaxResults() const{ return m_maxResults; } /** * <p>Maximum number of items to be retrieved in a single call. This is an * approximate number.</p> */ inline void SetMaxResults(int value) { m_maxResultsHasBeenSet = true; m_maxResults = value; } /** * <p>Maximum number of items to be retrieved in a single call. This is an * approximate number.</p> */ inline ListObjectChildrenRequest& WithMaxResults(int value) { SetMaxResults(value); return *this;} /** * <p>Represents the manner and timing in which the successful write or update of * an object is reflected in a subsequent read operation of that same object.</p> */ inline const ConsistencyLevel& GetConsistencyLevel() const{ return m_consistencyLevel; } /** * <p>Represents the manner and timing in which the successful write or update of * an object is reflected in a subsequent read operation of that same object.</p> */ inline void SetConsistencyLevel(const ConsistencyLevel& value) { m_consistencyLevelHasBeenSet = true; m_consistencyLevel = value; } /** * <p>Represents the manner and timing in which the successful write or update of * an object is reflected in a subsequent read operation of that same object.</p> */ inline void SetConsistencyLevel(ConsistencyLevel&& value) { m_consistencyLevelHasBeenSet = true; m_consistencyLevel = value; } /** * <p>Represents the manner and timing in which the successful write or update of * an object is reflected in a subsequent read operation of that same object.</p> */ inline ListObjectChildrenRequest& WithConsistencyLevel(const ConsistencyLevel& value) { SetConsistencyLevel(value); return *this;} /** * <p>Represents the manner and timing in which the successful write or update of * an object is reflected in a subsequent read operation of that same object.</p> */ inline ListObjectChildrenRequest& WithConsistencyLevel(ConsistencyLevel&& value) { SetConsistencyLevel(value); return *this;} private: Aws::String m_directoryArn; bool m_directoryArnHasBeenSet; ObjectReference m_objectReference; bool m_objectReferenceHasBeenSet; Aws::String m_nextToken; bool m_nextTokenHasBeenSet; int m_maxResults; bool m_maxResultsHasBeenSet; ConsistencyLevel m_consistencyLevel; bool m_consistencyLevelHasBeenSet; }; } // namespace Model } // namespace CloudDirectory } // namespace Aws
[ "henso@amazon.com" ]
henso@amazon.com
c2adde24185a998d43eaf5e925bf74d05a1f0644
b974b958552668113dbe82409e4e08bb4e153150
/main.cpp
7978b35e1f67e00042fb73c8f40aeb012388f083
[]
no_license
GeremiaPompei/boost_json_heap
8826d8d5baf943163ebce113991da4ef1371f0bf
7add00ff6efba33b553cf4fbdf08cb148f909677
refs/heads/master
2023-04-06T04:03:48.254984
2021-04-01T08:14:19
2021-04-01T08:14:19
353,110,401
0
0
null
null
null
null
UTF-8
C++
false
false
971
cpp
#include <iostream> #include <vector> #include "fibonacci_heap_handler.hpp" #include "json_handler.hpp" #include "value.hpp" using namespace std; /** * Funzione main che fa partire l'esecuzione del programma. */ int main() { JsonHandler json; FibonacciHeapHandler<Value> fib; vector<Value> w; cout << "Inserisci valori json con tale forma: {\"id\": 1, \"name\": \"value1\"}." << endl; cout << "Digita exit per uscire." << endl; char in[200] = ""; while (true) { cout << " > "; cin.getline(in, sizeof(in)); string s = string(in); if(s == "exit") break; try { Value v = json.parser(s); w.push_back(v); fib.heapsort<Value>(&w); for (int i = 0; i < w.size(); ++i) cout << json.stringify(w[i]); cout << endl; }__catch(exception e) { cout << "Error: " << e.what() << endl; } } return 0; }
[ "geremia.pompei@studenti.unicam.it" ]
geremia.pompei@studenti.unicam.it
3b2e429c1eb06161a280cd1aa8357f356ff4660f
9c83aa016dbee6d5ca49cc30cd03bab6d02c30ec
/LanMap Filter/cdp.cpp
43d74f236077ec91d012acdbdf3f440e99f66465
[]
no_license
trevelyanuk/SMPF-Client
a8240b856f9550354d59967bb7215d005e9014ea
716e58552343ed701fc2dc2fbea2c7e7ae6367dd
refs/heads/master
2020-04-05T14:05:47.766995
2019-08-03T20:43:12
2019-08-03T20:43:12
94,760,868
1
1
null
2019-08-13T19:40:29
2017-06-19T09:39:23
C++
UTF-8
C++
false
false
9,980
cpp
//http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/cdp/configuration/15-mt/cdp-15-mt-book/nm-cdp-discover.html void getDataCDP() { unsigned int count = 0; /* Destination MAC address - which is octet 0 - 5 */ //%02x, rather than %x, will enforce a mininum field size - so a value of 1 becomes 01 and e becomes 0e. The 0 specifies that it should be 0 padded, the 2 represents the number of 0s. printf("\tDestination MAC address:\t %02x:%02x:%02x:%02x:%02x:%02x", packetData[0], packetData[1], packetData[2], packetData[3], packetData[4], packetData[5]); /* Source MAC address - which is octet 6 - 11 */ printf("\n\tSource MAC address:\t\t %02x:%02x:%02x:%02x:%02x:%02x", packetData[6], packetData[7], packetData[8], packetData[9], packetData[10], packetData[11]); /* CDP uses Ethernet 1 headers, so bytes 12 and 13 are length */ printf("\n\tLength:\t\t %i", (packetData[12] << 8 | packetData[13])); /* CDP uses 802.2 LLC with SNAP headers, sp the next 8 bytes are LLC information, with SNAP extensions for Cisco: DSAP (1) SSAP (1) Control Field (1) (snap extension) OUI (3) Protocol ID (2) Bytes 14, 15, 16 are LLC Bytes 17, 18, 19 are the OUI (if its 0, then the PID is assumed to be the Ethertype, anything else indicates organisational specific things). Cisco is 0x00000c Bytes 20 and 21 are the Protocol ID, which will usually be EtherType. CDP is 2000 (0x2000) //https://www.informit.com/library/content.aspx?b=CCNP_Studies_Troubleshooting&seqNum=53 //https://en.wikipedia.org/wiki/Subnetwork_Access_Protocol ** CDP ** For CDP, Bytes 22 and 23 are the version of CDP and the TTL 24 and 25 are the checksum Anything beyond 23 is going to be TLV data. Last 4 octets will be the CRC Checksum, though */ printf("\n\t Cisco Discovery Protcol version %i\n\t TTL:%i", packetData[22], packetData[23]); //http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm is no longer available apparently, so I cant access it to find out the spec count = 26; for (count; count < packetHeader->len; ) { unsigned int type = (packetData[count] << 8 | packetData[count + 1]); unsigned int length = (packetData[count + 2] << 8 | packetData[count + 3]); //length of the TLV - that includes the type and length itself! //length = length & mask; count += 4; length -= 4; if (length > 500) { int k = 5; } unsigned char value[512] = ""; switch (type) { case 0x01: { printf("\n\n\tDevice ID: "); memcpy(&systemswName, packetData + count, length); slsystemswName = strlen(systemswName); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x02: { printf("\n\n\tAddress: "); //Number of addresses long numberOfAddresses = (packetData[count] << 24 | packetData[count] << 16 | packetData[count + 2] << 8 | packetData[count + 3]); count += 4; length -= 4; for (UINT16 x = 0; x < numberOfAddresses; x++) { //Protocol type //Protocol length count += 2; //This is an IP address if (packetData[count] == 0xcc) { printf("IP Address: "); count++; //This is how long it is int addressLength = (packetData[count] << 8 | packetData[count + 1]); count += 2; sprintf_s(systemswIP, "%i.%i.%i.%i", packetData[count], packetData[count + 1], packetData[count + 2], packetData[count + 3]); printf(systemswIP); slsystemswIP = strlen(systemswIP); count += addressLength; } } break; } case 0x03: { printf("\n\n\tPort-ID: "); memcpy(&systemswitchport, packetData + count, length); slsystemswitchport = strlen(systemswitchport); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } break; } case 0x04: { printf("\n\n\tCapability: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x05: { printf("\n\n\tVersion String: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x06: { printf("\n\n\tPlatform: "); memcpy(&systemswMAC, packetData + count, length); slsystemswMAC = strlen(systemswMAC); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x07: { printf("\n\n\tPrefixes: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x08: { printf("\n\n\tProtocol-Hello option: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x09: { printf("\n\n\tVTP Management Domain: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x0a: { printf("\n\n\tNative VLAN ID: "); int port_vlan = (packetData[count] << 8 | packetData[count + 1]); //printf("VLAN ID: %i", port_vlan); _itoa_s(port_vlan, systemvlan, 10); slsystemvlan = strlen(systemvlan); count += 2; printf("%i", port_vlan); break; } case 0x0b: { printf("\n\n\tDuplex: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x0c: { printf("\n\n\tDONT KNOW LOL"); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x0d: { printf("\n\n\tDONT KNOW LOL"); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x0e: { printf("\n\n\tATA-186 VoIP VLAN request: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x0f: { printf("\n\n\tATA-186 VoIP VLAN assignment: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x10: { printf("\n\n\tPower Consumption: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x11: { printf("\n\n\tMTU: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x12: { printf("\n\n\tAVVID Trust Bitmap: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x13: { printf("\n\n\tAVVID Untrusted Ports CoS: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x14: { printf("\n\n\tSystem Name: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x15: { printf("\n\n\tSystem Object ID (Not Decoded): "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x16: { printf("\n\n\tManagement Addresses: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x17: { printf("\n\n\tPhysical Location: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x18: { printf("\n\n\tUNKNOWN: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x19: { printf("\n\n\tUNKNOWN: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x1a: { printf("\n\n\tPower Available: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x1b: { printf("\n\n\tUNKNOWN: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x1c: { printf("\n\n\tUNKNOWN: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x1d: { printf("\n\n\tEnergyWise: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x1e: { printf("\n\n\tUNKNOWN: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } case 0x1f: { printf("\n\n\tSpare PoE: "); for (UINT16 x = 0; x < length; x++) { value[x] = packetData[count]; count++; } printf("%s", value);//, count - length); break; } default: { printf("\n\n\t *** Unknown *** value = %s", value); break; } } } }
[ "cellotape@gmail.com" ]
cellotape@gmail.com
08dde59c33d5b689e59069dea2581c10236be166
27f817ac1c8be0ad473279d02a514e419b5bd6fc
/November Game/MenuState.cpp
9a809641579a3bf76401136df6c4b178da883fac
[]
no_license
Swistaak/November-Game
7281a058d5b8bad4d3880dd0cca898deaff33607
5b6dfe4307905e9809f30c6816871c5990f41e2d
refs/heads/master
2020-07-23T02:55:30.907076
2017-07-21T09:43:23
2017-07-21T09:43:23
73,818,352
0
0
null
null
null
null
UTF-8
C++
false
false
641
cpp
#include "MenuState.h" #include "Game.h" #include "PlayState.h" MenuState MenuState::mMenuState; void MenuState::init(Game * game) { font.loadFromFile("font\\dpcomic.ttf"); startText.setFont(font); startText.setPosition(390, 380); startText.setString("Press space key to start game"); } void MenuState::cleanup() { } void MenuState::pause() { } void MenuState::resume() { } void MenuState::handleEvents(Game * game) { if (sf::Keyboard::isKeyPressed(sf::Keyboard::Space)) game->changeState(PlayState::instance()); } void MenuState::update(Game * game) { } void MenuState::draw(Game * game) { game->window.draw(startText); }
[ "sswistak123@gmail.com" ]
sswistak123@gmail.com
bab23d4f274c2db5bd2a783f29136041dc1c2c5f
5bef53b0dc9539a4953919f75fde1f0ebd20e9fb
/ICPC/Sharif_2019/I.cpp
1f74dfa7c7f160dd019cb7912fb5e832dc659e65
[]
no_license
atrin-hojjat/CompetetiveProgramingCodes
54c8b94092f7acf40d379e42e1f2c0fe8dab9b32
6a02071c3869b8e7cd873ddf7a3a2d678aec6d91
refs/heads/master
2020-11-25T10:51:23.200000
2020-10-08T11:12:09
2020-10-08T11:12:09
228,626,397
1
0
null
null
null
null
UTF-8
C++
false
false
3,000
cpp
#include <iostream> #include <cstring> #include <vector> using namespace std; const int MaxN = 2e5 + 6.66; struct Segment { long long seg[(int) (2e5 + 6.66) * 4]; long long laz[(int) (2e5 + 6.66) * 4]; int upd[(int) (2e5 + 6.66) * 4]; Segment() { memset(seg, 0, sizeof seg); memset(laz, 0, sizeof laz); memset(upd, 0, sizeof upd); } void push(int id, int l, int r, int x) { seg[id] = 1ll * (r - l) * x; laz[id] = x; upd[id] = true; } void push_down(int id, int l, int r) { if(!upd[id]) return ; int mid = l + (r - l) / 2; push(id << 1, l, mid, laz[id]); push(id << 1 | 1, mid, r, laz[id]); upd[id] = 0; laz[id] = 0; } void inc(int id, int l, int r, int x, int val) { if(l >= r) return ; if(l > x || r <= x) return; if(l + 1 == r) { seg[id] += val; return; } push_down(id, l, r); int mid = l + (r - l) / 2; inc(id << 1, l, mid, x, val); inc(id << 1 | 1, mid, r, x, val); seg[id] = seg[id << 1] + seg[id << 1 | 1]; } void set(int id, int l, int r, int b, int e, long long x) { if(l >= r) return ; if(l >= e || r <= b) return ; if(l >= b && r <= e) { push(id, l, r, x); return ; } push_down(id, l, r); int mid = l + (r - l) / 2; set(id << 1, l, mid, b, e, x); set(id << 1 | 1, mid, r, b, e, x); seg[id] = seg[id << 1] + seg[id << 1 | 1]; } int get(int id, int l, int r, int x) { if(l >= r) return -1; if(l > x || r <= x) return -1; if(l + 1 == r) return seg[id]; push_down(id, l, r); int mid = l + (r - l) / 2; if(x < mid) return get(id << 1, l, mid, x); return get(id << 1 | 1, mid, r, x); } pair<int, int> binary(int id, int l, int r, int b, int e, int x) { if(l >= r) return {-1, x}; if(l >= e || r <= b) return {-1, x}; push_down(id, l, r); int mid = l + (r - l) / 2; if(l >= b && r <= e) { if(seg[id] <= x) return {r, x - seg[id]}; if(l + 1 == r) return {l, x}; if(seg[id << 1] > x) return binary(id << 1, l, mid, b, e, x); else return binary(id << 1 | 1, mid, r, b, e, x - seg[id << 1]); } auto T = binary(id << 1, l, mid, b, e, x); int t = T.first; int s = T.second; if(t == mid || t < 0) return binary(id << 1 | 1, mid, r, b, e, s); return T; } int get(int i) { return get(1, 0, MaxN, i); } void add(int i, int j) { auto X = binary(1, 0, MaxN, i, MaxN, j); set(1, 0, MaxN, i, X.first, 0); if(X.first < MaxN) inc(1, 0, MaxN, X.first, -X.second); } } seg; int A[MaxN]; int main() { ios::sync_with_stdio(false); cin.tie(NULL), cout.tie(NULL); int n, q; cin >> n >> q; for(int i = 0; i < n; i++) { cin >> A[i]; seg.inc(1, 0, MaxN, i, A[i]); } while(q--) { int t; cin >> t; if(t == 1) { int a, b; cin >> a >> b; a--; seg.add(a, b); } else { int x; cin >> x; x--; cout << A[x] - seg.get(x) << endl; } } return 0; }
[ "magic.h.s.atrin@gmail.com" ]
magic.h.s.atrin@gmail.com
7b4d3a4a2fddf53e76a7cac7651d501fe0189655
2d16f56549a1becb433cab7bf7bc08f0c9bdb930
/chap4/pr4_1.cpp
66052560207fbef0fe7666082a397b39ac326e7e
[]
no_license
ferng/cppBeginners
275811ce762af8ad1cf2e3870da7b702f3aa5a80
708a83d150fde776a40f4da86301005ee090eb50
refs/heads/master
2020-09-15T11:23:58.621735
2019-11-22T15:27:20
2019-11-22T15:28:50
223,431,399
0
0
null
null
null
null
UTF-8
C++
false
false
530
cpp
#include <iostream> #include <cstdlib> using namespace std; int main() { int nums[10]; int a, b, t; int size; size = 10; for (t = 0; t < size; t++) nums[t] = rand(); cout << "Array is:\n"; for (t = 0; t < size; t++) cout << nums[t] << ' '; for (a = 1; a < size; a++) { for (b = size-1; b >= a; b--) { if (nums[b-1] > nums[b]) { t = nums[b-1]; nums[b-1] = nums[b]; nums[b] = t; } } } cout << "\nOnce sorted array is\n"; for (t = 0; t < size; t++) cout << nums[t] << ' '; return 0; }
[ "ferng001@gmail.com" ]
ferng001@gmail.com
ee64d5284d62b300029f2cce0f2c94d0ed48c44f
83d06b8ef639485edd2085f176f778166aa32486
/Exercise00-07.cpp
93d10881bfadf8fb6cc6b343fb4fba1d99865f07
[]
no_license
peteflorence/KoenigMoo_AcceleratedCpp
ac54385e0311542a94f9607349f3ed65a1f493d7
35dba25410e51f1729d8544666e29a78c7c36258
refs/heads/master
2020-04-11T09:53:48.726205
2015-08-25T12:01:03
2015-08-25T12:01:03
39,455,273
0
0
null
null
null
null
UTF-8
C++
false
false
245
cpp
//Exercise00-07.cpp #include <iostream> int main() { /* This is a comment that extends over servel lines because it uses /* and */ as its starting and ending delimiteres */ std::cout << "Hello, world!" << std::endl; }}}}}} return 0; }
[ "pete.florence@gmail.com" ]
pete.florence@gmail.com
cee78d7c6f635a018ffd6f231402a0d801a31536
bcf681e46f3214a5d76bc92ab66cb3bda62da8a4
/CSCE_313_Projects/PA3/SHMreqchannel.h
6d7e4810f3b66e707ea93eb6dfb0585f11705547
[]
no_license
AndersonIJ99/oldProjectsForPortfolio
1930c0916587ce26aae2f20de0e4d7208da0997f
ccd94cd846d7301dde078ebb825ddd9726348d6d
refs/heads/master
2023-02-28T10:16:54.727695
2021-02-02T20:08:56
2021-02-02T20:08:56
335,409,852
0
0
null
null
null
null
UTF-8
C++
false
false
3,195
h
#ifndef _SHMreqchannel_H_ #define _SHMreqchannel_H_ #include <semaphore.h> #include <sys/mman.h> #include "common.h" #include "Reqchannel.h" #include <string> using namespace std; class SHMQ { private: char* segment; sem_t* sd; sem_t* rd; string name; int len; public: SHMQ (string _name, int _len) : name(_name), len(_len) { int fd = shm_open(name.c_str(), O_RDWR|O_CREAT, 0600); if(fd < 0) { EXITONERROR("could not create/open shared memory segment"); } ftruncate(fd, len); //set the length to 1024, the default is 0, so this is a necessary step segment = (char *) mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if(!segment) { EXITONERROR("Cannot map"); } rd = sem_open((name + "_rd").c_str(), O_CREAT, 0600, 1); // initial val=1 sd = sem_open((name + "_sd").c_str(), O_CREAT, 0600, 0); // initial val=0 } int my_shm_send(void* msg, int len) { sem_wait(rd); memcpy(segment, msg, len); sem_post(sd); return len; } int my_shm_recv(void* msg, int len) { sem_wait(sd); memcpy(msg, segment, len); sem_post(rd); return len; } ~SHMQ () { sem_close(sd); sem_close(rd); sem_unlink((name + "_rd").c_str()); sem_unlink((name + "_sd").c_str()); munmap(segment, len); shm_unlink(name.c_str()); } }; class SHMRequestChannel: public RequestChannel { private: SHMQ* shmq1; SHMQ* shmq2; int len; public: SHMRequestChannel(const string _name, const Side _side, int _len); /* Creates a "local copy" of the channel specified by the given name. If the channel does not exist, the associated IPC mechanisms are created. If the channel exists already, this object is associated with the channel. The channel has two ends, which are conveniently called "SERVER_SIDE" and "CLIENT_SIDE". If two processes connect through a channel, one has to connect on the server side and the other on the client side. Otherwise the results are unpredictable. NOTE: If the creation of the request channel fails (typically happens when too many request channels are being created) and error message is displayed, and the program unceremoniously exits. NOTE: It is easy to open too many request channels in parallel. Most systems limit the number of open files per process. */ ~SHMRequestChannel(); /* Destructor of the local copy of the bus. By default, the Server Side deletes any IPC mechanisms associated with the channel. */ int cread (void* msgbuf, int bufcapacity); /* Blocking read of data from the channel. You must provide the address to properly allocated memory buffer and its capacity as arguments. The 2nd argument is needed because the recepient side may not have as much capacity as the sender wants to send. In reply, the function puts the read data in the buffer and returns an integer that tells how much data is read. If the read fails, it returns -1. */ int cwrite (void *msgbuf , int msglen); /* Writes msglen bytes from the msgbuf to the channel. The function returns the actual number of bytes written and that can be less than msglen (even 0) probably due to buffer limitation (e.g., the recepient cannot accept msglen bytes due to its own buffer capacity. */ }; #endif
[ "mew1067@gmail.com" ]
mew1067@gmail.com
74a2c4390d2b02125824bee6e6f6cc7e20efa756
6c60fa044d44773c6a40485a3d8209614d2adf5e
/uVision/uVision/GeneratedFiles/ui_imagestitching.h
8d3b095e9c4f17e0d182e5d308c71325e2f50411
[]
no_license
githubcjl/uVision_cjl
d36e36f9f022bbfb7b1131fd76bb375f3a6e411b
a1902dd3f308d3524f92bb3552bf3b4096644730
refs/heads/master
2021-01-10T10:46:35.820743
2015-12-04T13:29:36
2015-12-04T13:29:36
45,160,854
0
0
null
null
null
null
UTF-8
C++
false
false
1,334
h
/******************************************************************************** ** Form generated from reading UI file 'imagestitching.ui' ** ** Created by: Qt User Interface Compiler version 4.8.6 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_IMAGESTITCHING_H #define UI_IMAGESTITCHING_H #include <QtCore/QVariant> #include <QtGui/QAction> #include <QtGui/QApplication> #include <QtGui/QButtonGroup> #include <QtGui/QHeaderView> #include <QtGui/QWidget> QT_BEGIN_NAMESPACE class Ui_imagestitching { public: void setupUi(QWidget *imagestitching) { if (imagestitching->objectName().isEmpty()) imagestitching->setObjectName(QString::fromUtf8("imagestitching")); imagestitching->resize(638, 481); retranslateUi(imagestitching); QMetaObject::connectSlotsByName(imagestitching); } // setupUi void retranslateUi(QWidget *imagestitching) { imagestitching->setWindowTitle(QApplication::translate("imagestitching", "imagestitching", 0, QApplication::UnicodeUTF8)); } // retranslateUi }; namespace Ui { class imagestitching: public Ui_imagestitching {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_IMAGESTITCHING_H
[ "1290478835@qq.com" ]
1290478835@qq.com
e7f8f757f773affb21f3eddeb74c19cdc9a68f3f
1bf8b46afad5402fe6fa74293b464e1ca5ee5fd7
/SDK/BP_MiniGame_SmartBall_SimpleBase_parameters.h
e6726b807594cb733394c401309c3064cd7b94dc
[]
no_license
LemonHaze420/ShenmueIIISDK
a4857eebefc7e66dba9f667efa43301c5efcdb62
47a433b5e94f171bbf5256e3ff4471dcec2c7d7e
refs/heads/master
2021-06-30T17:33:06.034662
2021-01-19T20:33:33
2021-01-19T20:33:33
214,824,713
4
0
null
null
null
null
UTF-8
C++
false
false
902
h
#pragma once #include "../SDK.h" // Name: Shenmue3SDK, Version: 1.4.1 #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace SDK { //--------------------------------------------------------------------------- // Parameters //--------------------------------------------------------------------------- // Function BP_MiniGame_SmartBall_SimpleBase.BP_MiniGame_SmartBall_SimpleBase_C.InitializeBingoType struct ABP_MiniGame_SmartBall_SimpleBase_C_InitializeBingoType_Params { int InputPin; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) }; // Function BP_MiniGame_SmartBall_SimpleBase.BP_MiniGame_SmartBall_SimpleBase_C.UserConstructionScript struct ABP_MiniGame_SmartBall_SimpleBase_C_UserConstructionScript_Params { }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "35783139+LemonHaze420@users.noreply.github.com" ]
35783139+LemonHaze420@users.noreply.github.com
e6eaf640255ad4d165cf8ef6930537ea5e4e5ec5
446fdbad810bd6623b4995184b82f8c0d5987902
/leetcode/leetcode/35. 搜索插入位置.cpp
c6bf3c54b172c598553f597938f7fe0538357c9f
[]
no_license
19865044959/code_test
74f258769f627f45ba8c829d14a3111335e48562
371d1cb89f401290715b42e7f72299aace7ede8c
refs/heads/main
2023-04-17T19:14:37.449157
2021-05-13T01:48:28
2021-05-13T01:48:28
366,901,912
0
0
null
null
null
null
GB18030
C++
false
false
2,112
cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <queue> #include <unordered_map> using namespace std; /********************************************************************************************************** 方法:暴力法 说明: 时间复杂度与空间复杂度:O(n) O(1) 涉及到的知识点: ***********************************************************************************************************/ class Solution { public: int searchInsert(vector<int>& nums, int target) { int n = nums.size(); int i; for(i = 0; i < n; i++){ if(nums[i] >= target) return i; } return i; } }; /********************************************************************************************************** 方法:二分查找法 说明: 时间复杂度与空间复杂度:O(logn) O(1) 涉及到的知识点: ***********************************************************************************************************/ class Solution { public: int searchInsert(vector<int>& nums, int target) { int low = 0; int high = nums.size() - 1; while(low < high){ int medium = low + (high - low) / 2; if(nums[medium] == target) return medium; if(nums[medium] > target){ high = medium - 1; } else{ low = medium + 1; } } int maxVal = max(low, high); if(nums[maxVal] >= target) return maxVal; else return maxVal + 1; } }; /********************************************************************************************************** 方法:STL库 说明: 时间复杂度与空间复杂度:O(n) O(1) 涉及到的知识点: ***********************************************************************************************************/ class Solution { public: int searchInsert(vector<int>& nums, int target) { return lower_bound(nums.begin(), nums.end(), target) - nums.begin(); } };
[ "huanyzhang@foxmail.com" ]
huanyzhang@foxmail.com
febd4bfaf0d06bef7d2dc05e27debf764eccc0aa
7d497f964e20fbfa6ddfc980858f676eb1a8e274
/main.cpp
f381df2d79351c480b17820fe94cf100f1af6141
[]
no_license
jhirniak/keylogger
41bd0d588088e1d74ca8f444c45cf09554e60159
6780826a0219479ac4eb27ffd2b6a5406d7f2754
refs/heads/master
2020-05-18T01:03:08.519176
2015-01-07T11:22:55
2015-01-07T11:22:55
28,909,591
1
1
null
null
null
null
UTF-8
C++
false
false
2,397
cpp
#include <windows.h> #include <stdio.h> #include <string.h> #include <time.h> #include <stdbool.h> #include <stdlib.h> bool invisible = true; char fileName[MAX_PATH]; void hide(void) { HWND stealth; /* Retrieves a handle to the top-level window whose class name and window name match the specified strings. 1st Parmeter lpClassName: ConsoleWindowClass - Class Name 2nd Parameter lpWindowName: parameter is NULL, all window names match. If the function succeeds, the return value is a handle to the window that has the specified class name and window name. If the function fails, the return value is NULL. */ stealth = FindWindow("ConsoleWindowClass", NULL ); ShowWindow(stealth, 0); } void init(void) { // get path to appdata folder char* dest = "%appdata%\\windows.log"; /* Expands the envirnment variable given into a usable path 1st Parameter lpSrc: A buffer that contains one or more environment-variable strings in the form: %variableName%. 2nd Parameter lpDst: A pointer to a buffer that receives the result of expanding the environment variable strings in the lpSrc buffer. 3rd Parameter nSize: The maximum number of characters that can be stored in the buffer pointed to by the lpDst parameter. The return value is the fully expanded pathname. */ ExpandEnvironmentStrings(dest, fileName, MAX_PATH); // open file FILE *file; file = fopen(fileName, "a+"); time_t startTime = time(0); // see if file is empty long savedOffset = ftell(file); fseek(file, 0, SEEK_END); if (!ftell(file) == 0) fputc('\n', file); fseek(file, savedOffset, SEEK_SET); // print timestamp fputs("### Started logging at: ", file); fputs(ctime(&startTime), file); fclose(file); } void powerdown(void) { // get path to appdata folder char* dest = "%appdata%\\windows.log"; ExpandEnvironmentStrings(dest, fileName, MAX_PATH); // open file FILE *file; file = fopen(fileName, "a+"); time_t endTime = time(0); fputs("\n### Stopped logging at: ", file); fputs(ctime(&endTime), file); fclose(file); } char getFileName() { return fileName; } int main(int argc, char* argv[]) { int startKeyLogging(char* argv[]); if (invisible) hide(); init(); start(argv); atexit(powerdown); // only works if process isn't killed }
[ "j@hirniak.info" ]
j@hirniak.info
7228b57d2e3464d5e579462f2776e2d2f4c0b865
7105d8cf4a4d14e326dda4adf5c8a5403f3d092f
/ImplicitAndExplicitScheme/ImplicitScheme.h
5616d34f2de55a1e9420647af86c270fea396ed9
[]
no_license
Etienne-So/computational_methods
337484eabdc027c0d03aa59b07dc03f47cea208d
37a5541504533c8d73d7f17ce7e1d368056b1038
refs/heads/main
2023-02-12T03:06:45.386174
2021-01-12T15:46:05
2021-01-12T15:46:05
329,029,144
0
1
null
null
null
null
UTF-8
C++
false
false
1,808
h
#ifndef IMPLICITSCHEME_H //include guard #define IMPLICITSCHEME_H #include "Scheme.h" //Mother class #include <iostream> //generic IO #include <string> //for string methods #pragma once /** * Inherited class, which includes implicit schemes like: * Up Wind Forward-Time Backward-Space and Forward-Time Central-Space. * Additionally, class includes private method with Thomas Algorithm. **/ class ImplicitScheme : public Scheme { private: /** * Private vector of double imortant for Thomas algorithm. **/ vector<double> A; /** * Private vector of double imortant for Thomas algorithm. **/ vector<double> B; /** * Private vector of double imortant for Thomas algorithm. **/ vector<double> C; /** * Private vector of double imortant for Thomas algorithm. **/ vector<double> D; private: /** * Private method, which includes Thomas algorithm important for Implicit schemes. * @see ImplicitUpWindFTBS() * @see ImplicitFTCS() * @return vector<double> **/ vector<double> ThomasAlgorithm(double parameter, double parameter2, bool version); public: /** * Default, empty constructor for ImplicitScheme class. **/ ImplicitScheme(); /** * Public method, which solves the difference using implicit scheme Forward-Time Backward-Space * @return string - name of method for saving result into files with proper name * @see SaveResultIntoFiles(double deltaT, string schemeName) **/ string ImplicitUpWindFTBS(); /** * Public method, which solves the difference using implicit scheme Forward-Time Central-Space * @return string - name of method for saving result into files with proper name * @see SaveResultIntoFiles(double deltaT, string schemeName) **/ string ImplicitFTCS(); /** *Default, empty destructor for ImplicitScheme class. **/ ~ImplicitScheme(); }; #endif
[ "noreply@github.com" ]
Etienne-So.noreply@github.com
54a82dcc2e59588acd3eedfbca0072e7adada9a3
1a93a3b56dc2d54ffe3ee344716654888b0af777
/env/Library/include/qt/QtQuick/qquickrendercontrol.h
8ec9b8aafc1f9f730bbbaf473b09bcd9c4a0722a
[ "BSD-3-Clause", "GPL-1.0-or-later", "GPL-3.0-only", "GPL-2.0-only", "Python-2.0", "LicenseRef-scancode-python-cwi", "LicenseRef-scancode-other-copyleft", "0BSD", "LicenseRef-scancode-free-unknown" ]
permissive
h4vlik/TF2_OD_BRE
ecdf6b49b0016407007a1a049f0fdb952d58cbac
54643b6e8e9d76847329b1dbda69efa1c7ae3e72
refs/heads/master
2023-04-09T16:05:27.658169
2021-02-22T14:59:07
2021-02-22T14:59:07
327,001,911
0
0
BSD-3-Clause
2021-02-22T14:59:08
2021-01-05T13:08:03
null
UTF-8
C++
false
false
2,871
h
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QQUICKRENDERCONTROL_H #define QQUICKRENDERCONTROL_H #include <QtQuick/qtquickglobal.h> #include <QtGui/QImage> QT_BEGIN_NAMESPACE class QQuickWindow; class QOpenGLContext; class QQuickRenderControlPrivate; class QThread; class Q_QUICK_EXPORT QQuickRenderControl : public QObject { Q_OBJECT public: explicit QQuickRenderControl(QObject *parent = nullptr); ~QQuickRenderControl() override; void prepareThread(QThread *targetThread); void initialize(QOpenGLContext *gl); void invalidate(); void polishItems(); void render(); bool sync(); QImage grab(); static QWindow *renderWindowFor(QQuickWindow *win, QPoint *offset = nullptr); virtual QWindow *renderWindow(QPoint *offset) { Q_UNUSED(offset); return nullptr; } Q_SIGNALS: void renderRequested(); void sceneChanged(); private: Q_DECLARE_PRIVATE(QQuickRenderControl) }; QT_END_NAMESPACE #endif // QQUICKRENDERCONTROL_H
[ "martin.cernil@ysoft.com" ]
martin.cernil@ysoft.com
30ff9d2e8c861f92b5780ca785a8d767c9628ced
fa345d30d723c9cbdb750235c832bb3af635d77f
/CountAndSay.cpp
1d4cd3aa2b150637dc495a9b257e1d51e278b531
[]
no_license
AparnaChinya/100DaysOfCode
03c50ff1dc7e003f7c3510ee1c40f2c0588021ec
436ff8302eaeea705d92de4dc8c5a763b84b3348
refs/heads/master
2021-07-18T13:24:06.102900
2018-12-07T06:04:29
2018-12-07T06:04:29
72,006,131
3
0
null
null
null
null
UTF-8
C++
false
false
1,083
cpp
/* 38. Count and Say The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2, then one 1" or 1211. Given an integer n where 1 ≤ n ≤ 30, generate the nth term of the count-and-say sequence. Note: Each term of the sequence of integers will be represented as a string. From <https://leetcode.com/problems/count-and-say/description/> */ class Solution { public: string countAndSay(int n) { if(n == 0) { return ""; } string res = "1"; while(--n) { string curr = ""; for(int i = 0; i < res.size();i++) { int count = 1; while((i+1) < res.size() && (res[i] == res[i+1])) { count++; i++; } curr += to_string(count) + res[i]; } res = curr; } return res; } };
[ "apchin@outlook.com" ]
apchin@outlook.com
3c384efd88fda77f22eb44d42a9992f6e1e26a2d
fe6ef75f0e51bf88ba917162f5c31b5ac3cfd5ba
/create_image_task.cpp
24f4f4ccbef67cfd9dd609b28d61d9471600dead
[ "MIT" ]
permissive
Sauexceed/Fractal_Designer
5f1d1b8621321500aaf49f0296687838182f767c
7b8289fbfb4c527786b49b6beeef35356d6a1abf
refs/heads/master
2023-06-16T17:40:18.404673
2021-06-21T15:10:17
2021-06-21T15:10:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
16,280
cpp
#include "create_image_task.h" #include "mainwindow.h" Create_Image_Task::Create_Image_Task(QWidget* parent) { MainWindow* p = (MainWindow*) parent; connect(this, &Create_Image_Task::updateImage_preview, p, &MainWindow::getImage); connect(this, &Create_Image_Task::progressInform_preview, p, &MainWindow::updateProgressBar); connect(this, &Create_Image_Task::finished, p, &MainWindow::build_image_finished_deal); connect(this, &Create_Image_Task::one_ok, p, &MainWindow::build_image_one_ok); connect(this, &Create_Image_Task::updateImage_route, p->route_tool_window, &Route_Tool::getImage); connect(this, &Create_Image_Task::progressInform_route, p->route_tool_window, &Route_Tool::updateProgressBar); connect(p, &MainWindow::createImageStop, this, &Create_Image_Task::stop); } void Create_Image_Task::run() { qDebug() << "Got it here"; y = -y; if(!Version_Higher_Than_4) // low version { QFile Colour_saved_1(pro_path + "/Colour_Set_1.txt"); if(Colour_saved_1.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in1(&Colour_saved_1); for(int j = 0; j != 4; j++) { for(int i = 0; i != 29; i++) { in1 >> Colour_Data[0][j][i][0] >> Colour_Data[0][j][i][1]; } } Colour_saved_1.close(); } QFile Colour_saved_2(pro_path + "/Colour_Set_2.txt"); if(Colour_saved_2.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in2(&Colour_saved_2); for(int j = 0; j != 4; j++) { for(int i = 0; i != 29; i++) { in2 >> Colour_Data[1][j][i][0] >> Colour_Data[1][j][i][1]; } } Colour_saved_2.close(); } } qDebug() << "The working thread: " << QThread::currentThreadId(); double progress = 0; int progress_now = 0; if(!Version_Higher_Than_4) { QFile Template_(pro_path + "/Template_Choice.txt"); if(Template_.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in3(&Template_); in3 >> template_; Template_.close(); } QFile Define_Value_(pro_path + "/Define_Value.txt"); if(Define_Value_.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in4(&Define_Value_); in4 >> min_class_v >> max_class_v >> max_loop_t; Define_Value_.close(); } } // qDebug() << QThread::currentThreadId(); QImage image_build(X, Y, QImage::Format_ARGB32); for(int i = X - 1; i >= 0; i--) { if(isCancelled) return; progress = 100 * static_cast<double>(X - i) / X; if(static_cast<int>(progress) > progress_now) { if(work_name == "Preview") emit progressInform_preview(progress); if(work_name == "Route") emit progressInform_route(progress); progress_now = static_cast<int>(progress); } for(int j = Y - 1; j >= 0; j--) { double dx = x_width * (static_cast<double>(i) / X - 0.5); double dy = y_height * (static_cast<double>(j) / Y - 0.5); double mod = sqrt(dx * dx + dy * dy); double theta = atan2(dy, dx) + rotate_angle / 180 * Pi; Complex this_point(x + mod * cos(theta), y + mod * sin(theta)); Complex z0(this_point), last_point(-this_point); bool test = true; int k = 0; for (k = 0; k < max_loop_t; k++) { if ((double)this_point.modulus() > max_class_v) { test = false; break; } else if (template_ != 4 && (double)this_point.modulus() < min_class_v) { // test = true; break; } else if (template_ == 4 && (double)(this_point - last_point).modulus() / (double)(this_point.modulus()) < min_class_v) { // test = true; break; } else { if (template_ == 4) last_point = this_point; switch(template_) { case 1: this_point = (this_point ^ 2.0) + z0; break; case 2: this_point = (this_point ^ 2.0) + c0; break; case 3: this_point = (Complex(fabs(this_point.getReal()), fabs(this_point.getImaginary())) ^ 2.0) + z0; break; case 4: { Complex p = 0, p_ = 0; for(int i = 0; i != 10; i++) { p += Newton_xn[i] * (this_point ^ double(i)); p_ += Newton_xn[i] * (this_point ^ double(i - 1)) * Complex(i); } p += Newton_ex * exp(this_point); p += Newton_sin * sin(this_point); p += Newton_cos * cos(this_point); p_ += Newton_ex * exp(this_point); p_ += Newton_sin * cos(this_point); p_ -= Newton_cos * sin(this_point); this_point = this_point - Newton_a * p / p_; } default: break; } } } if(test) { double RGBA1[4] = {0, 0, 0, 0}; for(int m = 0; m != 4; m++) { RGBA1[m] = (Colour_Data[0][m][0][0] * t + Colour_Data[0][m][0][1]) * k + (Colour_Data[0][m][1][0] * t + Colour_Data[0][m][1][1]) * this_point.getReal() + (Colour_Data[0][m][2][0] * t + Colour_Data[0][m][2][1]) * this_point.getImaginary() + (Colour_Data[0][m][3][0] * t + Colour_Data[0][m][3][1]) * (double)this_point.modulus() + (Colour_Data[0][m][4][0] * t + Colour_Data[0][m][4][1]) * (double)this_point.modulus() / min_class_v + (Colour_Data[0][m][5][0] * t + Colour_Data[0][m][5][1]) * this_point.argz() + (Colour_Data[0][m][6][0] * t + Colour_Data[0][m][6][1]) * sin(this_point.argz()) + (Colour_Data[0][m][7][0] * t + Colour_Data[0][m][7][1]) * cos(this_point.argz()) + (Colour_Data[0][m][8][0] * t + Colour_Data[0][m][8][1]) * z0.getReal() + (Colour_Data[0][m][9][0] * t + Colour_Data[0][m][9][1]) * z0.getImaginary() + (Colour_Data[0][m][10][0] * t + Colour_Data[0][m][10][1]) * (double)z0.modulus() + (Colour_Data[0][m][11][0] * t + Colour_Data[0][m][11][1]) * (double)z0.modulus() / min_class_v + (Colour_Data[0][m][12][0] * t + Colour_Data[0][m][12][1]) * z0.argz() + (Colour_Data[0][m][13][0] * t + Colour_Data[0][m][13][1]) * sin(z0.argz()) + (Colour_Data[0][m][14][0] * t + Colour_Data[0][m][14][1]) * (double)(this_point - z0).modulus() + (Colour_Data[0][m][15][0] * t + Colour_Data[0][m][15][1]) * exp((k > 10) ? 10 : k) + (Colour_Data[0][m][16][0] * t + Colour_Data[0][m][16][1]) * exp(log(10) * ((k > 10) ? 10 : k)) + (Colour_Data[0][m][17][0] * t + Colour_Data[0][m][17][1]) * log(1 + (double)this_point.modulus()) + (Colour_Data[0][m][18][0] * t + Colour_Data[0][m][18][1]) * log(1 + (double)z0.modulus()) + (Colour_Data[0][m][19][0] * t + Colour_Data[0][m][19][1]) * log(1 + (double)(this_point - z0).modulus()) + (Colour_Data[0][m][20][0] * t + Colour_Data[0][m][20][1]) * exp((double)this_point.modulus() > 10 ? 10 : (double)this_point.modulus() > 10) + (Colour_Data[0][m][21][0] * t + Colour_Data[0][m][21][1]) * exp((double)z0.modulus() > 10 ? 10 : (double)z0.modulus()) + (Colour_Data[0][m][22][0] * t + Colour_Data[0][m][22][1]) * exp((double)(this_point - z0).modulus() > 10 ? 10 : (double)this_point.modulus()) + (Colour_Data[0][m][23][0] * t + Colour_Data[0][m][23][1]) * exp(log(10) * (double)this_point.modulus() > 10 ? 10 : log(10) * (double)this_point.modulus()) + (Colour_Data[0][m][24][0] * t + Colour_Data[0][m][24][1]) * exp(log(10) * (double)z0.modulus() > 10 ? 10 : log(10) * (double)z0.modulus()) + (Colour_Data[0][m][25][0] * t + Colour_Data[0][m][25][1]) * exp(log(10) * (double)(this_point - z0).modulus()) + (Colour_Data[0][m][26][0] * t + Colour_Data[0][m][26][1]) * exp((double)this_point.modulus() / min_class_v > 10 ? 10 : (double)this_point.modulus() / min_class_v) + (Colour_Data[0][m][27][0] * t + Colour_Data[0][m][27][1]) * exp((double)z0.modulus() / min_class_v > 10 ? 10 : (double)z0.modulus() / min_class_v) + (Colour_Data[0][m][28][0] * t + Colour_Data[0][m][28][1]); if(RGBA1[m] < 0) RGBA1[m] = 0; else if(RGBA1[m] > 255) RGBA1[m] = 255; } image_build.setPixel(i, j, qRgba(RGBA1[0], RGBA1[1], RGBA1[2], RGBA1[3])); } else { double RGBA2[4]; for(int m = 0; m != 4; m++) { RGBA2[m] = (Colour_Data[1][m][0][0] * t + Colour_Data[1][m][0][1]) * k + (Colour_Data[1][m][1][0] * t + Colour_Data[1][m][1][1]) * this_point.getReal() + (Colour_Data[1][m][2][0] * t + Colour_Data[1][m][2][1]) * this_point.getImaginary() + (Colour_Data[1][m][3][0] * t + Colour_Data[1][m][3][1]) * (double)this_point.modulus() + (Colour_Data[1][m][4][0] * t + Colour_Data[1][m][4][1]) * (double)this_point.modulus() / max_class_v + (Colour_Data[1][m][5][0] * t + Colour_Data[1][m][5][1]) * this_point.argz() + (Colour_Data[1][m][6][0] * t + Colour_Data[1][m][6][1]) * sin(this_point.argz()) + (Colour_Data[1][m][7][0] * t + Colour_Data[1][m][7][1]) * cos(this_point.argz()) + (Colour_Data[1][m][8][0] * t + Colour_Data[1][m][8][1]) * z0.getReal() + (Colour_Data[1][m][9][0] * t + Colour_Data[1][m][9][1]) * z0.getImaginary() + (Colour_Data[1][m][10][0] * t + Colour_Data[1][m][10][1]) * (double)z0.modulus() + (Colour_Data[1][m][11][0] * t + Colour_Data[1][m][11][1]) * (double)z0.modulus() / max_class_v + (Colour_Data[1][m][12][0] * t + Colour_Data[1][m][12][1]) * z0.argz() + (Colour_Data[1][m][13][0] * t + Colour_Data[1][m][13][1]) * sin(z0.argz()) + (Colour_Data[1][m][14][0] * t + Colour_Data[1][m][14][1]) * (double)(this_point - z0).modulus() + (Colour_Data[1][m][15][0] * t + Colour_Data[1][m][15][1]) * exp((k > 10) ? 10 : k) + (Colour_Data[1][m][16][0] * t + Colour_Data[1][m][16][1]) * exp(log(10) * ((k > 10) ? 10 : k)) + (Colour_Data[1][m][17][0] * t + Colour_Data[1][m][17][1]) * log(1 + (double)this_point.modulus()) + (Colour_Data[1][m][18][0] * t + Colour_Data[1][m][18][1]) * log(1 + (double)z0.modulus()) + (Colour_Data[1][m][19][0] * t + Colour_Data[1][m][19][1]) * log(1 + (double)(this_point - z0).modulus()) + (Colour_Data[1][m][20][0] * t + Colour_Data[1][m][20][1]) * exp((double)this_point.modulus() > 10 ? 10 : (double)this_point.modulus() > 10) + (Colour_Data[1][m][21][0] * t + Colour_Data[1][m][21][1]) * exp((double)z0.modulus() > 10 ? 10 : (double)z0.modulus()) + (Colour_Data[1][m][22][0] * t + Colour_Data[1][m][22][1]) * exp((double)(this_point - z0).modulus() > 10 ? 10 : (double)this_point.modulus()) + (Colour_Data[1][m][23][0] * t + Colour_Data[1][m][23][1]) * exp(log(10) * (double)this_point.modulus() > 10 ? 10 : log(10) * (double)this_point.modulus()) + (Colour_Data[1][m][24][0] * t + Colour_Data[1][m][24][1]) * exp(log(10) * (double)z0.modulus() > 10 ? 10 : log(10) * (double)z0.modulus()) + (Colour_Data[1][m][25][0] * t + Colour_Data[1][m][25][1]) * exp(log(10) * (double)(this_point - z0).modulus()) + (Colour_Data[1][m][26][0] * t + Colour_Data[1][m][26][1]) * exp((double)this_point.modulus() / max_class_v > 10 ? 10 : (double)this_point.modulus() / max_class_v) + (Colour_Data[1][m][27][0] * t + Colour_Data[1][m][27][1]) * exp((double)z0.modulus() / max_class_v > 10 ? 10 : (double)z0.modulus() / max_class_v) + (Colour_Data[1][m][28][0] * t + Colour_Data[1][m][28][1]); if(RGBA2[m] < 0) RGBA2[m] = 0; else if(RGBA2[m] > 255) RGBA2[m] = 255; } image_build.setPixel(i, j, qRgba(RGBA2[0], RGBA2[1], RGBA2[2], RGBA2[3])); } } } qDebug() << img_path + "/" + img_title + "." + img_format; image_build.save(img_path + "/" + img_title + "." + img_format); image_build.load(img_path + "/" + img_title + "." + img_format); if(work_name == "Preview") emit updateImage_preview(image_build); if(work_name == "Route") emit updateImage_route(image_build); if(work_name == "Create_Image") emit one_ok(); if(work_name == "Create_Image_Last") emit finished(); // delete this; } void Create_Image_Task::setImage(double x_, double y_, double x_width_, double y_height_, int X_, int Y_, double rotate_angle_, double t_, QString img_format_, QString img_path_, QString img_title_, QString work_name_) { x = x_; y = y_; x_width = x_width_; y_height = y_height_; X = X_; Y = Y_; rotate_angle = rotate_angle_; t = t_; img_format = img_format_; img_path = img_path_; img_title = img_title_; work_name = work_name_; } void Create_Image_Task::setPath(QString str) { pro_path = str; } void Create_Image_Task::setData(double C1[4][29][2], double C2[4][29][2], int temp, double min, double max, int lpt) { For_All_Colour(i, j) Colour_Data[0][i][j][0] = C1[i][j][0]; Colour_Data[0][i][j][1] = C1[i][j][1]; Colour_Data[1][i][j][0] = C2[i][j][0]; Colour_Data[1][i][j][1] = C2[i][j][1]; End_All_Colour template_ = temp; min_class_v = min < 1E-10 ? 1E-10 : min; max_class_v = max < 1E-10 ? 1E-10 : max; max_loop_t = lpt; } void Create_Image_Task::setTemplate2(const Complex& c) { c0 = c; } void Create_Image_Task::setTemplate4(const Complex& c1, Complex* c2, const Complex& c3, const Complex& c4, const Complex& c5) { Newton_a = c1; for(int i = 0; i != 10; i++) Newton_xn[i] = c2[i]; Newton_sin = c3; Newton_cos = c4; Newton_ex = c5; } void Create_Image_Task::setVersion(bool v) { Version_Higher_Than_4 = v; } void Create_Image_Task::stop() { isCancelled = true; }
[ "teddy-jerry@qq.com" ]
teddy-jerry@qq.com
d586d9eaa0883b0c9ea2714b2f753a49360e649a
04b1803adb6653ecb7cb827c4f4aa616afacf629
/chromeos/services/device_sync/public/cpp/fake_device_sync_client.cc
f756216f32e422eb5fa1f43030e902156c9f87ff
[ "BSD-3-Clause" ]
permissive
Samsung/Castanets
240d9338e097b75b3f669604315b06f7cf129d64
4896f732fc747dfdcfcbac3d442f2d2d42df264a
refs/heads/castanets_76_dev
2023-08-31T09:01:04.744346
2021-07-30T04:56:25
2021-08-11T05:45:21
125,484,161
58
49
BSD-3-Clause
2022-10-16T19:31:26
2018-03-16T08:07:37
null
UTF-8
C++
false
false
4,058
cc
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chromeos/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/components/multidevice/remote_device.h" #include "chromeos/components/multidevice/remote_device_cache.h" namespace chromeos { namespace device_sync { FakeDeviceSyncClient::FakeDeviceSyncClient() = default; FakeDeviceSyncClient::~FakeDeviceSyncClient() = default; void FakeDeviceSyncClient::ForceEnrollmentNow( mojom::DeviceSync::ForceEnrollmentNowCallback callback) { force_enrollment_now_callback_queue_.push(std::move(callback)); } void FakeDeviceSyncClient::ForceSyncNow( mojom::DeviceSync::ForceSyncNowCallback callback) { force_sync_now_callback_queue_.push(std::move(callback)); } multidevice::RemoteDeviceRefList FakeDeviceSyncClient::GetSyncedDevices() { return synced_devices_; } base::Optional<multidevice::RemoteDeviceRef> FakeDeviceSyncClient::GetLocalDeviceMetadata() { return local_device_metadata_; } void FakeDeviceSyncClient::SetSoftwareFeatureState( const std::string public_key, multidevice::SoftwareFeature software_feature, bool enabled, bool is_exclusive, mojom::DeviceSync::SetSoftwareFeatureStateCallback callback) { set_software_feature_state_callback_queue_.push(std::move(callback)); } void FakeDeviceSyncClient::FindEligibleDevices( multidevice::SoftwareFeature software_feature, FindEligibleDevicesCallback callback) { find_eligible_devices_callback_queue_.push(std::move(callback)); } void FakeDeviceSyncClient::GetDebugInfo( mojom::DeviceSync::GetDebugInfoCallback callback) { get_debug_info_callback_queue_.push(std::move(callback)); } int FakeDeviceSyncClient::GetForceEnrollmentNowCallbackQueueSize() { return force_enrollment_now_callback_queue_.size(); } int FakeDeviceSyncClient::GetForceSyncNowCallbackQueueSize() { return force_sync_now_callback_queue_.size(); } int FakeDeviceSyncClient::GetSetSoftwareFeatureStateCallbackQueueSize() { return set_software_feature_state_callback_queue_.size(); } int FakeDeviceSyncClient::GetFindEligibleDevicesCallbackQueueSize() { return find_eligible_devices_callback_queue_.size(); } int FakeDeviceSyncClient::GetGetDebugInfoCallbackQueueSize() { return get_debug_info_callback_queue_.size(); } void FakeDeviceSyncClient::InvokePendingForceEnrollmentNowCallback( bool success) { DCHECK(force_enrollment_now_callback_queue_.size() > 0); std::move(force_enrollment_now_callback_queue_.front()).Run(success); force_enrollment_now_callback_queue_.pop(); } void FakeDeviceSyncClient::InvokePendingForceSyncNowCallback(bool success) { DCHECK(force_sync_now_callback_queue_.size() > 0); std::move(force_sync_now_callback_queue_.front()).Run(success); force_sync_now_callback_queue_.pop(); } void FakeDeviceSyncClient::InvokePendingSetSoftwareFeatureStateCallback( mojom::NetworkRequestResult result_code) { DCHECK(set_software_feature_state_callback_queue_.size() > 0); std::move(set_software_feature_state_callback_queue_.front()) .Run(result_code); set_software_feature_state_callback_queue_.pop(); } void FakeDeviceSyncClient::InvokePendingFindEligibleDevicesCallback( mojom::NetworkRequestResult result_code, multidevice::RemoteDeviceRefList eligible_devices, multidevice::RemoteDeviceRefList ineligible_devices) { DCHECK(find_eligible_devices_callback_queue_.size() > 0); std::move(find_eligible_devices_callback_queue_.front()) .Run(result_code, eligible_devices, ineligible_devices); find_eligible_devices_callback_queue_.pop(); } void FakeDeviceSyncClient::InvokePendingGetDebugInfoCallback( mojom::DebugInfoPtr debug_info_ptr) { DCHECK(get_debug_info_callback_queue_.size() > 0); std::move(get_debug_info_callback_queue_.front()) .Run(std::move(debug_info_ptr)); get_debug_info_callback_queue_.pop(); } } // namespace device_sync } // namespace chromeos
[ "sunny.nam@samsung.com" ]
sunny.nam@samsung.com
4b1a3719da650338e9bca804b2acf6914a12f8ae
25e024cf92044a4233991028e5b7f534354b146a
/OTEEditors/Plugin_TerrainEditor/AdjustColor.h
58e3c3991b5ee4f0b0a1009134fa0565ef1a352d
[]
no_license
panguojun/OTE
db8b4d7d1d5242d57dee503b7e405a7a01eed89e
d67a324337cc078f7da84a6d8b3d25b7ad0a7ca2
refs/heads/main
2023-08-20T21:56:08.208514
2021-10-26T01:53:24
2021-10-26T01:53:24
421,238,299
3
1
null
null
null
null
GB18030
C++
false
false
1,750
h
#pragma once #include "afxcmn.h" // CAdjustColor 对话框 class CAdjustColor : public CDialog { DECLARE_DYNAMIC(CAdjustColor) public: static CAdjustColor m_Inst; CAdjustColor(CWnd* pParent = NULL); // 标准构造函数 virtual ~CAdjustColor(); // 对话框数据 enum { IDD = IDD_AdjustColor }; enum enumColor{red=1, green=2, blue=3, alpha=4}; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public : void silderBindColor(); void updateLightColorList(enumColor c, float value); enum operateObject { Ambient=0, MainLight=1, complementarityLight=2}; float m_aryColor[4]; operateObject m_operateObject; public : afx_msg void OnBnClickedOk(); afx_msg void OnBnClickedCancel(); afx_msg void OnClickedCancel(); CSliderCtrl m_silderRed; CSliderCtrl m_silderGreen; CSliderCtrl m_silderBlue; CSliderCtrl m_silderAlpha; afx_msg void OnNMReleasedcapturesilderred(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMReleasedcapturesildergreen(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMReleasedcapturesilderblue(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMReleasedcapturesilderalpha(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMThemeChangedsilderred(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMOutofmemorysilderred(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMCustomdrawsilderred(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMCustomdrawsildergreen(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMCustomdrawsilderblue(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnNMCustomdrawsilderalpha(NMHDR *pNMHDR, LRESULT *pResult); };
[ "noreply@github.com" ]
panguojun.noreply@github.com
69e788e7f83f9a4648031e7b3512d0250dd885cf
12105636bdbaa06fe0dd4eeb93a9c3d35b28af6f
/bus_router/include/yt/util/nouse/allocator.h
d8f4a58d5b3948bd413b44b8d1b71d6c69562a48
[]
no_license
crcanfly11/zmq-protobuf
3f81a6699c123ace9dfd770a04ea4bbe7c32c1c5
1ea7039ed442cf83a4250d3af06d801cc3444284
refs/heads/master
2020-04-24T04:10:31.778675
2014-10-15T07:43:25
2014-10-15T07:43:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
737
h
#pragma once #include <sys/types.h> #include <stdlib.h> namespace yt { class Allocator { public: virtual ~Allocator() {} virtual void * Allocate(size_t iSize, size_t * pRealSize = NULL) = 0; virtual void Deallocate(void * pData) = 0; public: static Allocator * Instance(); }; class MallocAllocator : public Allocator { public: virtual void * Allocate(size_t iSize, size_t * pRealSize = NULL); virtual void Deallocate(void * pData); public: static MallocAllocator * Instance(); }; class NewAllocator : public Allocator { public: virtual void * Allocate(size_t iSize, size_t * pRealSize = NULL); virtual void Deallocate(void * pData); public: static NewAllocator * Instance(); }; }
[ "185830862@qq.com" ]
185830862@qq.com