blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
ff3142c25d639131bbf2f8315abd61463de52cf4
6b96a11195094a0023a059ba7d5df95ce58c56f1
/1343B.cpp
4e1b57bec1c010266a0b3f31a65bcfa83d442fa9
[]
no_license
ldfdev/CodeForces-Div2-Problems
d932b09ee14a430fd0054d5b295f6016553be2b7
d18824a4330a4593099d249496ae22f3f69d5f44
refs/heads/master
2021-08-11T03:29:18.772870
2021-07-25T07:21:09
2021-07-29T20:09:43
72,371,376
1
0
null
null
null
null
UTF-8
C++
false
false
586
cpp
#include <bits/stdc++.h> int main() { int tests; scanf("%d", &tests); while(tests--) { long n; scanf("%ld", &n); if ((n % 4) != 0) { printf("NO\n"); } else { printf("YES\n"); long k = (n / 2); for (long i = 1; i < k; i++) { printf("%ld ", 2 * i); } printf("%ld ", 3 * k); for (long i = 1; i < k; i++) { printf("%ld ", 2 * i + 1); } printf("%ld\n", 2 * k + 1); } } return 0; }
758fb374ac125db43caaf894ab2318abb7187ce3
050ebbbc7d5f89d340fd9f2aa534eac42d9babb7
/grupa2/kasiamalek/p2/wic.cpp
900a0c8e37a219783797fcb4e6c46ca1e7431a9c
[]
no_license
anagorko/zpk2015
83461a25831fa4358366ec15ab915a0d9b6acdf5
0553ec55d2617f7bea588d650b94828b5f434915
refs/heads/master
2020-04-05T23:47:55.299547
2016-09-14T11:01:46
2016-09-14T11:01:46
52,429,626
0
13
null
2016-03-22T09:35:25
2016-02-24T09:19:07
C++
UTF-8
C++
false
false
249
cpp
#include <iostream> using namespace std; int main() { int n,a=0,b=0; cin>>n; int p[n-1]; for(int i=0;i<=n-1;i++) { cin>>p[i]; } for(int i=0;i<=n-1;i++) { if(p[i]>a) { a=p[i]; } } for(int i=0;i<=n-1;i++) { if(p[i]>b&&p[i]<a) { b=p[i]; } } cout<<b; }
aed12a7250e3914931f57bb21ca8314df8d1fbe9
9a3b9d80afd88e1fa9a24303877d6e130ce22702
/src/Providers/UNIXProviders/SoftwareIdentityComponent/UNIX_SoftwareIdentityComponent_DARWIN.hxx
139375cddf0c4c4877c7e6456c5955d6fbf08ff5
[ "MIT" ]
permissive
brunolauze/openpegasus-providers
3244b76d075bc66a77e4ed135893437a66dd769f
f24c56acab2c4c210a8d165bb499cd1b3a12f222
refs/heads/master
2020-04-17T04:27:14.970917
2015-01-04T22:08:09
2015-01-04T22:08:09
19,707,296
0
0
null
null
null
null
UTF-8
C++
false
false
1,836
hxx
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor licenses this file to you under the OpenPegasus Open // Source License; you may not use this file except in compliance with the // License. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ////////////////////////////////////////////////////////////////////////// // //%///////////////////////////////////////////////////////////////////////// #ifdef PEGASUS_OS_DARWIN #ifndef __UNIX_SOFTWAREIDENTITYCOMPONENT_PRIVATE_H #define __UNIX_SOFTWAREIDENTITYCOMPONENT_PRIVATE_H #endif #endif
937b2828f3ee7dca78e92ac65528f5b52919c942
8a94973e9be468da05ab8d1393156e9775dc67aa
/C++/CPP_Programs_from_Book/Chap26/MaxTemplate/main.cpp
c0a70d6b650c2dfdd6184d994f3e0d4b28160851
[]
no_license
poohpaintii/book-source-codes
5935f4a17513833ade3d9447ae7a614ebc65e4f2
da02c982d4003741dc5f1e5985df85147f42a42e
refs/heads/master
2020-05-01T09:14:20.163807
2018-12-24T04:20:18
2018-12-24T04:20:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
759
cpp
// MaxTemplate - create a template max() function // that returns the greater of two types #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; template <class T> T maximum(T t1, T t2) { return (t1 > t2) ? t1 : t2; } int main(int argc, char* pArgs[]) { // find the maximum of two int's; // here C++ creates maximum(int, int) cout << "maximum(-1, 2) = "<<maximum(-1, 2) << endl; // repeat for two doubles; // in this case, we have to provide T explicitly since // the types of the arguments are different cout << "maximum(1, 2.5) = "<<maximum<double>(1, 2.5) << endl; cout << "Press Enter to continue..." << endl; cin.ignore(10, '\n'); cin.get(); return 0; }
80b6fe7e9ea137a99e0cd88aec91037b3441378e
8f2d8fc24d8401dae3841dacf48a08937308274d
/cardGame/src/Hand.cpp
76ea69523b3d10ba106a86918b611250092fb148
[]
no_license
safir-medjeber/cpp_project
1a8d624b739ba40a0bb6538345c7fb575e7103fb
32ac44ff3e6595159cb12350790e51c600724688
refs/heads/master
2021-01-10T03:53:20.910620
2015-01-22T20:33:06
2015-01-22T20:33:06
47,075,316
0
0
null
null
null
null
UTF-8
C++
false
false
1,080
cpp
#include "Hand.hpp" void Hand::add(Card& card){ hand.push_back(&card); } void Hand::add(const CardContainer& cards){ for(int i = 0; i < cards.getSize(); i++) add(cards.getElement(i)); } CardContainer Hand::remove(Movement& movement){ list<Card*>::iterator it = hand.begin(); int k = 0; int n = movement.getSize(); Card** cards = new Card * [n]; bool find; for (int i = 0; i < n; i++){ find = false; it = hand.begin(); k = 0; while (it != hand.end()){ if(movement[i] == k){ cards[i] = *it; it = hand.erase(it); find = true; break; } k++; it++; } if(!find) throw "Todo Not find"; } return CardContainer(cards, n); } bool Hand::isEmpty(){ return hand.empty(); } int Hand::getSize(){ return hand.size(); } ostream& Hand::print(ostream& os){ list<Card*>::iterator itCurrent = hand.begin(), itEnd = hand.end(); while(itCurrent != itEnd){ os << *(*itCurrent) << " "; itCurrent++; } return os; } ostream& operator<<(ostream& os, Hand& hand){ return hand.print(os); }
cf783bec50705a39d61d788ad79b024936292b55
a7ce3479c9e085345197c21c54e83c37f734edd5
/src/unitsearch.h
3ea36d55a370ca95d4f3fa6cbe810f4d0d8276c8
[ "MIT" ]
permissive
SCMapsAndMods/teippi
01408821956c692f23c8facca5fd510a9e70b2e2
4946e2126846e9cb210694102953bbe06fe2e8ca
refs/heads/master
2021-01-20T23:17:46.311381
2015-08-30T23:43:55
2015-08-30T23:43:55
41,648,591
1
0
null
2015-08-31T01:00:29
2015-08-31T01:00:29
null
UTF-8
C++
false
false
6,281
h
#ifndef UNIT_SEARCH_H #define UNIT_SEARCH_H #include "types.h" #include "unit.h" #include "unitsearch_cache.h" #pragma pack(push) #pragma pack(1) struct UnitPositions { Unit *unit; uint16_t pos; uint16_t type; }; struct CollisionArea { Rect16 area; Unit *self; }; #pragma pack(pop) class LeftSortHelper; class RightSortHelper; template <class Type> class PosSearch { public: PosSearch() :max_width(0) {} PosSearch(PosSearch &&other) = default; void Clear(); void RemoveAt(uintptr_t pos); unsigned Size() const { return left_to_value.size(); } void Find(const Rect16 &rect, Type *out, Type **out_end); /// Only units with their 'position' inside the rect are counted template <class Func1, class Func2> Type *FindNearest(const Point &pos, const Rect16 &area, Func1 IsValid, Func2 Position); void Add(uintptr_t pos, Type &&val, const Rect16 &box); protected: vector<Type> left_to_value; vector<x32> left_positions; vector<x32> left_to_right; vector<y32> left_to_top; vector<y32> left_to_bottom; int NewFind(x32 left); x32 max_width; }; class UnitSearch : protected PosSearch<Unit *> { public: UnitSearch() {} UnitSearch(UnitSearch &&other) = default; template <class Func> Unit *FindNearest(const Point &pos, const Rect16 &area, Func IsValid) { // PosSearch::FindNearest returns nullptr/pointer to unit pointer, // so it is flattened to nullptr/unit pointer here Unit **closest = PosSearch::FindNearest(pos, area, IsValid, [](const Unit *a) { return a->sprite->position; }); return closest ? *closest : nullptr; } void Init(); unsigned Size() const { return PosSearch::Size(); } bool DoesBlockArea(const Unit *unit, const CollisionArea *area) const; }; // While units may be included in multiple UnitSearches, they may only be part of one MainUnitSearch // (MainUnitSearch uses unit->search_left, allowing faster/more operations) // Also includes bw shims and search caches class MainUnitSearch : public UnitSearch { friend class LeftSortHelper; public: typedef UnitSearchAreaCache::AreaBuffer<Unit *> AreaCacheBuf; MainUnitSearch(); MainUnitSearch(MainUnitSearch &&other) = default; ~MainUnitSearch(); void Clear(); void Init(); void Add(Unit *unit); Unit **FindCollidingUnits(Unit *unit, int x_add, int y_add); // Bw FindUnitsRect includes rect.right and rect.bottom in it's search, this one won't, // possibly causing bugs (or maybe fixing some) in precise (=collision?) code // The FindUnitsRect hook adds 1 to rect.right and rect.bottom for this reason, so only redone code may have issues // FindUnitBordersRect didn't include right and bottom coords in bw, so it won't cause issues // (No clue about more specialized functions) Unit **FindUnitsRect(const Rect16 &rect, int *amount = nullptr, Unit **out = nullptr); // Bw compatibility functions Unit **FindUnitBordersRect(const Rect16 *rect); Unit **CheckMovementCollision(Unit *unit, int x_off, int y_off); int DoUnitsCollide(const Unit *first, const Unit *second); int GetDodgingDirection(const Unit *self, const Unit *other); void ChangeUnitPosition(Unit *unit, int x_diff, int y_diff); // Allows changing multiple positions faster, but doing any searching before Finish will not work void ChangeUnitPosition_Fast(Unit *unit, int x_diff, int y_diff); void ChangeUnitPosition_Finish(); // Bw-compatible signature Unit *FindNearestUnit(Unit *self, const Point &pos, int (__fastcall *IsValid)(const Unit *, void *), void *func_param, const Rect16 &area_); void GetNearbyBlockingUnits(PathingData *pd); void Remove(Unit *unit); /// Bw requires that unitsearch writes to buffer which is large enough to hold all unit pointers /// four times. NewEntry() and PopResult() allocate/free from that buffer. They can also /// be used to just get some space for results, although one has to remember to call PopResult Unit **NewEntry(); void PopResult(); UnitSearchRegionCache::Entry FindUnits_ChooseTarget(int region, bool ground); Unit **FindHelpingUnits(Unit *unit, const Rect16 &rect, TempMemoryPool *allocation_pool, bool ai); void ClearRegionCache(); void EnableAreaCache(); void DisableAreaCache(); // Public for micro-optimizations, though FindUnitsRect should be good enough // out and bufs must be inited with arrays which is large enough, // that is all unit search units for out and AreaCacheAmount for bufs void AreaCacheFind(const Rect16 &rect, Unit **out, Unit ***out_end, AreaCacheBuf *out_bufs, AreaCacheBuf **out_bufs_end); template <class Func> void ForEachUnitInArea(const Rect16 &rect, Func func) { Unit **units; int amt; units = FindUnitsRect(rect, &amt); Unit **end = units + amt; while (units != end) { if (func(*units++) == true) break; } PopResult(); } // If area cache is enabled, it works in FindUnitsRect // Region cache works _always_ in FindUnits_ChooseTarget bool valid_region_cache; UnitSearchRegionCache region_cache; template <class Filter, class Key, int N> void FillSecondaryCache(SecondaryAreaCache<Unit *, N> *cache, const Rect16 &area, Filter filter, Key key); void CacheArea(const Rect16 &area); private: unsigned capacity; Unit **result_units_beg; bool area_cache_enabled; UnitSearchAreaCache area_cache; void Validate(); AreaCacheBuf reasonable_area_cache_buf[32 * 32]; // ChangeUnitPosition_Fast uses these x32 left_low_invalid; x32 left_high_invalid; }; extern MainUnitSearch *unit_search; #endif // UNIT_SEARCH_H
5db27e3b7143715de337561f1cdf316b9bc195ec
05f28950d2afb858e9a475b31bbaef08ac20ffc3
/miniPr/commands/removevideocommand.cpp
17979565a6a0d65fbaf6f72d721cad98001ac4f9
[]
no_license
Waffle-Liu/MiniPremiere
970d9b4616d73bec52ce854d77b2892d718792e3
4490a7286d5f7649826fecda214c35c70d8adffb
refs/heads/master
2021-07-06T07:30:16.211878
2019-02-22T15:48:42
2019-02-22T15:48:42
140,908,988
6
3
null
null
null
null
UTF-8
C++
false
false
361
cpp
#include "../commands/removevideocommand.h" RemoveVideoCommand::RemoveVideoCommand(std::shared_ptr<PrViewModel> vm):viewmodel(vm) { } RemoveVideoCommand::~RemoveVideoCommand() {} void RemoveVideoCommand::exec() { int index = std::static_pointer_cast<IntParameters, Parameters>(Command::params)->getvalue(); viewmodel->exec_remove_video_command(index); }
baaca08f3208f85b42707e1b260a0be697d83161
187f6bb6b568e8bb42bafab8f81133d4ad5f383b
/Siv3D/src/Siv3D/Effect/CEffect.hpp
7aaace1721697ba92392c480f578c287751fc648
[ "MIT" ]
permissive
Reputeless/OpenSiv3D
f2938ea8f5c8de2e6e3b200046943f3e5398a2a1
7d02aa0f4824d1ecbd50ea1c00737cc932332b0a
refs/heads/main
2023-07-29T06:57:44.541422
2023-07-13T03:41:37
2023-07-13T03:41:37
306,929,779
0
0
MIT
2021-09-02T10:37:00
2020-10-24T16:55:13
C++
UTF-8
C++
false
false
1,500
hpp
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2023 Ryo Suzuki // Copyright (c) 2016-2023 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # pragma once # include <Siv3D/Common.hpp> # include <Siv3D/Effect.hpp> # include <Siv3D/AssetHandleManager/AssetHandleManager.hpp> # include "IEffect.hpp" # include "EffectData.hpp" namespace s3d { class CEffect final : public ISiv3DEffect { private: AssetHandleManager<Effect::IDType, EffectData> m_effects{ U"Effect" }; uint64 m_previousTimeUs = 0; public: CEffect(); ~CEffect(); void init() override; void update() override; Effect::IDType create(double maxLifeTimeSec) override; void release(Effect::IDType handleID) override; void add(Effect::IDType handleID, std::unique_ptr<IEffect>&& effect) override; size_t num_effects(Effect::IDType handleID) override; void pause(Effect::IDType handleID) override; bool isPaused(Effect::IDType handleID) override; void resume(Effect::IDType handleID) override; void setSpeed(Effect::IDType handleID, double speed) override; double getSpeed(Effect::IDType handleID) override; void setMaxLifeTime(Effect::IDType handleID, double maxLifeTimeSec) override; double getMaxLifeTime(Effect::IDType handleID) override; void updateEffect(Effect::IDType handleID) override; void clear(Effect::IDType handleID) override; }; }
86f1fcf9e7a9f26b0337b7b92f805051f0d83106
76bc179e1787144d45b7df23cf35b77a274f0bdb
/sqlite/DatabaseIF.h
a9818711770c4c5cf9ec23d855ba17e0d15310c5
[]
no_license
rajeshanjara/BLibrary
4df8ba0e9ad568c796f44250530b645fd025f153
beca0b08c7a6483ba2bdcbc3d8bdcfcc08dccf81
refs/heads/master
2021-01-22T03:39:55.618644
2017-06-25T18:19:48
2017-06-25T18:19:48
92,390,957
1
0
null
null
null
null
UTF-8
C++
false
false
406
h
#pragma once #include "DatabaseImpl.h" namespace DataBase { class DatabaseIF { public: DatabaseIF(void); ~DatabaseIF(void); bool Connect( const char* pszDBName_i ); bool Execute( const char* pszQuery_i ); RecordSet getRecordSet() { return m_pDatabaseImpl->getRecordSet(); } bool Disconnect(); private: DatabaseImpl* m_pDatabaseImpl; }; }
cd8a76adaf53efba2761a80431e4d24c0862d97e
bf435acee8074688e4360d35344cc291b53bb30d
/src/turtle_tf2_listener.cpp
5bf5e4d93437eeaa7fe8c77d45aeebf543dc838b
[]
no_license
RenFukatsu/learning_tf2
a6656ef57694965c149bb15b94777acd940cd467
2ddf5b13675b5b3c84218027e357d3f9d1e82f27
refs/heads/master
2021-01-01T11:20:18.322430
2020-02-09T08:05:20
2020-02-09T08:05:20
239,256,691
0
0
null
null
null
null
UTF-8
C++
false
false
1,553
cpp
#include "learning_tf2/turtle_tf2_listener.h" TurtleTf2Listener::TurtleTf2Listener() : tf_listener(tf_buffer) { turtle_vel = nh.advertise<geometry_msgs::Twist>("turtle2/cmd_vel", 1); spawn_turtle(); } void TurtleTf2Listener::spawn_turtle() { ros::service::waitForService("spawn"); ros::ServiceClient spawner = nh.serviceClient<turtlesim::Spawn>("spawn"); turtlesim::Spawn turtle; turtle.request.x = 4; turtle.request.y = 2; turtle.request.theta = 0; turtle.request.name = "turtle2"; spawner.call(turtle); } void TurtleTf2Listener::process() { ros::Rate loop_rate(10.0); while(ros::ok()) { geometry_msgs::TransformStamped transformStamped; try { transformStamped = tf_buffer.lookupTransform("turtle2", "turtle1", ros::Time(0)); } catch (tf2::TransformException &ex) { ROS_WARN("%s", ex.what()); ros::Duration(1.0).sleep(); continue; } geometry_msgs::Twist vel_msg; vel_msg.angular.z = 4.0 * atan2(transformStamped.transform.translation.y, transformStamped.transform.translation.x); vel_msg.linear.x = 0.5 * sqrt(pow(transformStamped.transform.translation.x, 2) + pow(transformStamped.transform.translation.y, 2)); turtle_vel.publish(vel_msg); loop_rate.sleep(); } } int main(int argc, char** argv) { ros::init(argc, argv, "turtle_tf2_listener"); TurtleTf2Listener turtle_tf2_listener; turtle_tf2_listener.process(); return 0; }
6474cfa2b421bb8396177c01b6e3a4d40e81e5ce
5d5f287c826116f6eb9082ee1594f99ed59c0d48
/Arduino/sketch_may16a/sketch_may16a.ino
69a34aae527bc8149d748220e8e7a38eff9618f0
[]
no_license
AliHuseynzadeh/arduino-all-projects
8a632980447a53a29a2546b270702bcbef6c32f1
dfb8e1d65a08f895b15f36adea26fc1efd92c676
refs/heads/master
2023-06-17T03:23:19.224104
2021-06-27T13:59:52
2021-06-27T13:59:52
380,754,302
0
0
null
null
null
null
UTF-8
C++
false
false
7,388
ino
#include<Arduino.h> #include <SoftwareSerial.h> #include <Wire.h> #define RELE1 25 #define RELE2 26 #define LED 17 unsigned long lastTime = 0; unsigned long a = 60000; //int remainder = 0; char Received_SMS; //Here we store the full received SMS (with phone sending number and date/time) as char short RELE1_ON = -1, RELE1_OF = -1; short RELE2_ON = -1, RELE2_OF = -1; short EV_ON = -1, EV_OF = -1; String Data_SMS; int kombi = 0; int c; SoftwareSerial sim800l(13, 12); void setup() { ///////////////////////////Rele//////////////////////////// pinMode(LED, OUTPUT); pinMode(RELE1, OUTPUT); pinMode(RELE2, OUTPUT); Serial.begin(9600); sim800l.begin(9600); Serial.println("Starting ..."); delay(3000); ReceiveMode(); //Calling the function that puts the SIM800L moduleon receiving SMS mode Send_Starter(); } void loop() { /////////////////////////////rele A: String RSMS; while (sim800l.available() > 0) { //When SIM800L sends something to the Arduino... problably the SMS received... if something else it's not a problem Received_SMS = sim800l.read(); //"char Received_SMS" is now containing the full SMS received Serial.print(Received_SMS); //Show it on the serial monitor (optional) RSMS.concat(Received_SMS); //concatenate "char received_SMS" to RSMS which is "empty" RELE1_ON = RSMS.indexOf("KON"); RELE1_OF = RSMS.indexOf("KOFF"); //"indexOf function looks for the substring "x" within the String (here RSMS) and gives us its index or position RELE2_ON = RSMS.indexOf("WON"); RELE2_OF = RSMS.indexOf("WOFF"); //For example if found at the beginning it will give "0" after 1 character it will be "1" EV_ON = RSMS.indexOf("EVON"); //If it's not found it will give "-1", so the variables are integers EV_OF = RSMS.indexOf("EVOFF"); } if (EV_OF != -1) { c = 0; digitalWrite(LED, HIGH); while (kombi == -1) { // if(millis() - lastTime == a) { // Serial.println(lastTime); // lastTime = millis(); // remainder=millis() % a; // Serial.println(millis()); Received_SMS = sim800l.read(); while (sim800l.available() > 0) { Received_SMS = sim800l.read(); Serial.print(Received_SMS); RSMS.concat(Received_SMS); EV_ON = RSMS.indexOf("EVON"); if (EV_ON != -1) { digitalWrite(LED, LOW); c = 1; EV_ON = -1; EV_OF = -1; Send_Data(); ReceiveMode(); goto A; } } if (c == 0) { if (millis() % a == 0) { Serial.println("1 saat tamam oldu"); ReceiveMode(); Send_oneHour(); Serialcom(); } } RELE1_OF = -1; RELE1_ON = -1; RELE2_OF = -1; RELE2_ON = -1; } } else if (RELE1_ON != -1) { Serial.println("found RELE1 ONNNN"); // Serial.print("RELE1 Temperature = "); Serial.print("*C RELE111 Humidity = "); Serial.println(" %"); digitalWrite (RELE1, HIGH); // Data_SMS = "RELE1\nTemp = "+String('i',1)+" C"+" \nHumidity ="+String('l',1)+" %"; Send_Data(); ReceiveMode(); kombi = -1; RELE1_OF = -1; RELE1_ON = -1; RELE2_OF = -1; RELE2_ON = -1; } else if (RELE1_OF != -1) { //Same thing if the "MLX" word is found, Serial.print things are optionnal delay(1000); Serial.println("found Turn OF"); digitalWrite (RELE1, LOW); Send_Data(); ReceiveMode(); RELE1_OF = -1; RELE1_ON = -1; RELE2_OF = -1; RELE2_ON = -1; kombi = 0; } else if (RELE2_ON != -1) { Serial.println("found RELE1"); digitalWrite (RELE2, HIGH); // Data_SMS = "RELE1\nTemp = "+String('i',1)+" C"+" \nHumidity ="+String('l',1)+" %"; //Prepare the SMS to send, it contains some strings like "RELE1" "Temperature"... delay(1000); Serial.println("found TURN ONNNNNN "); //And then the values read Send_Data(); //This function set the sending SMS mode, prepare the phone number to which we gonna send, and send "Data_SMS" String ReceiveMode(); //Come back to Receving SMS mode and wait for other SMS RELE1_OF = -1; RELE1_ON = -1; RELE2_ON = -1; RELE2_OF = -1; } else if (RELE2_OF != -1) { delay(1000); Serial.println("found TURN OFFFFF "); digitalWrite (RELE2, LOW); Send_Data(); ReceiveMode(); RELE1_OF = -1; RELE1_ON = -1; RELE2_OF = -1; RELE2_ON = -1; } } void Serialcom() //This is used with ReceiveMode function, it's okay to use for tests with Serial monitor { delay(300); while (Serial.available()) { sim800l.write(Serial.read());//Forward what Serial received to Software Serial Port } while (sim800l.available()) { Serial.write(sim800l.read());//Forward what Software Serial received to Serial Port } } void ReceiveMode() { //Set the SIM800L Receive mode sim800l.println("AT"); //If everything is Okay it will show "OK" on the serial monitor Serialcom(); sim800l.println("AT+CMGF=1"); // Configuring TEXT mode Serialcom(); sim800l.print("AT+CSCS=GSM\r"); Serialcom(); sim800l.println("AT+CNMI=2,2,0,0,0"); //Configure the SIM800L on how to manage the Received SMS... Check the SIM800L AT commands manual Serialcom(); sim800l.print("AT+CMGD=1,4"); Serialcom(); delay(200); } void Send_Data() { Serial.println("Sending Data..."); //Displays on the serial monitor...Optional sim800l.print("AT+CMGF=1\r"); //Set the module to SMS mode delay(100); sim800l.print("AT+CSCS=UCS2\r"); delay(100); sim800l.print("AT+CMGS=\"+994773769996\"\r"); //Your phone number don't forget to include your country code example +212xxxxxxxxx" delay(500); sim800l.print("Proses yerine yetirildi"); //This string is sent as SMS delay(500); sim800l.print((char)26);//Required to tell the module that it can send the SMS delay(500); sim800l.println(); Serial.println("Data Sent."); delay(500); } void Send_Starter() { Serial.println("Sending starter message..."); //Displays on the serial monitor...Optional sim800l.print("AT+CMGF=1\r"); //Set the module to SMS mode delay(100); sim800l.print("AT+CMGS=\"+994773769996\"\r"); //Your phone number don't forget to include your country code example +212xxxxxxxxx" delay(500); sim800l.print("Sistem basladi"); //This string is sent as SMS delay(500); sim800l.print((char)26);//Required to tell the module that it can send the SMS delay(500); sim800l.println(); Serial.println("Starter Sent."); delay(500); } void Send_oneHour() { Serial.println("Sendig one hour"); //Displays on the serial monitor...Optional sim800l.print("AT+CMGF=1\r"); //Set the module to SMS mode delay(100); sim800l.print("AT+CMGS=\"+994773769996\"\r"); //Your phone number don't forget to include your country code example +212xxxxxxxxx" delay(500); sim800l.print("1 saat tamam oldu"); //This string is sent as SMS delay(500); sim800l.print((char)26);//Required to tell the module that it can send the SMS delay(500); sim800l.println(); Serial.println("Data Sent."); delay(500); }
1ed851d252847bf5a1f0170390766a3e4ad88f6d
8f2e8a3320f8ab79a106ff7cf9c88eaa59f59257
/使用C++和Qt完成读文件,写MySQL/interface/smgsrv/iastoragemgr.h
3c4ada0602ecc220f04c73a59b0d88c1a44b0026
[]
no_license
KqSMea8/My_C_Project
1aa9b4793d3ecce6d7ea233b98786b1207a8e1f0
cb7555737b91707a4785d7392b26e600c4ae742d
refs/heads/master
2020-05-31T14:46:34.104077
2019-06-05T06:10:57
2019-06-05T06:10:57
null
0
0
null
null
null
null
GB18030
C++
false
false
4,418
h
//iastoragemgr.h #ifndef _IASTORAGEMGR_SMG8000_PENGSHIKANG_20140122_H_ #define _IASTORAGEMGR_SMG8000_PENGSHIKANG_20140122_H_ #define ASTORAGEMANAGER_CLASSID "cAStorageMgr" #define ASTORAGEMANAGER_INTFID "iAStorageMgr" #include "../icsunknown.h" // for IICSUnknown #include "smgdatadef.h" // for MicgridObectInfo class IAStorageMgr : virtual public IICSUnknown { public: //储能设备是否已启动 virtual bool IsRunning(int pos, bool bRefresh=false) = 0; //储能设备是否位于指定微电网配置的主电源列表内 virtual bool InMainSource(int id, MicgridObectInfo* pCurMgObj) = 0; //储能设备是否为有效的非主储能 virtual bool IsUnmainSource(int pos, MicgridObectInfo* pCurMgObj) = 0; //启动储能设备 virtual bool ActStartStorage(int pos, int ctrlReason, bool actMain=false) = 0; //停止储能设备[未用] virtual bool ActStopStorage(int pos, int ctrlReason, bool isActive) = 0; //启动储能并切换到主电源模式(VF模式) virtual bool StartMainStorage(int pos, int ctrlReason) = 0; //启动储能并切换到非主电源模式(PQ模式) virtual bool StartUnmainStorage(int pos, int ctrlReason) = 0; //切换到主电源模式 virtual bool IntoMainMode(int pos, int ctrlReason) = 0; //切换到非主电源模式 virtual bool IntoUnmainMode(int pos, int ctrlReason) = 0; //并网系统中单个储能的保护性调节 virtual bool StorageKeepNormalForContinent(int pos, int ctrlReason, double& actDchgP) = 0; //单个储能的保护性调节 virtual bool StorageKeepNormal(int pos, int ctrlReason, bool isContinue, double maxAdjP, double& maxChgP, double& maxDchgP, double& actDchgP, double& incableP, double& decableP, bool iszero) = 0; //获取储能的保护性调节功率值 virtual double GetAdjustPowerForProtect(int pos, double curP, bool& isProtect) = 0; //得到单个储能的最优放电功率[正数] virtual double GetStorageOptDchgPower(int pos) = 0; //得到单个储能的最优充电功率[负数] virtual double GetStorageOptChgPower(int pos) = 0; //执行单个储能装置有功调节操作 virtual int ActAdjustStorage(int pos, int ctrlReason, double curValue, double planValue, bool forSoc, bool notGuard, bool actStart) = 0; //执行单个储能装置有功功率调节到0操作 virtual int ActZeroStorage(int pos, int ctrlReason) = 0; //单个充电的储能恢复到不充放状态,curP < 0,remainP > 0。 virtual bool ChangeStorageToZero(int pos, int ctrlReason, double curP, double maxAdjP, double& actDchgP) = 0; //单个放电的储能恢复到不充放状态,curP > 0,remainP < 0。 virtual bool DischangeStorageToZero(int pos, int ctrlReason, double curP, double maxAdjP, double& actDchgP) = 0; //并网系统中单个储能恢复到不充放状态。 virtual bool StorageToZeroForSOC(int pos, int ctrlReason, double maxAdjP, double& actDchgP) = 0; //调节单个储能设备无功功率。返回值:0 --无动作;1--调节失败;2--调节成功。 virtual int AdjustStorageQ(int pos, double& adjustQ) = 0; //执行单个储能装置无功调节操作。返回值:0 --无动作;1--不需调节;2--调节成功。 virtual int ActAdjustStorageQ(int pos, int ctrlReason, double curValue, double planValue, bool notGuard, bool actStart) = 0; //执行单个储能装置无功功率调节到0操作。返回值:0 --无动作;1--不需调节;2--调节成功。 virtual int ActZeroStorageQ(int pos, int ctrlReason) = 0; //单个储能无功恢复到不充放状态。 virtual bool StorageQToZero(int pos, int ctrlReason, double maxAdjQ) = 0; //测试执行单个储能装置调节操作 virtual bool TestAdjustStorageP(int pos, double planValue) = 0; //测试启动主储能 virtual void TestStartMainStorage(int mgId, int storPos) = 0; //得到储能的可调节出力 virtual void GetAdjustableStorPower(int pos, double maxAdjP, double& incableP, double& decableP, double& totalP, bool bstor) = 0; //单个吸收无功功率的储能设备调节无功到零。adjustQ为正数 virtual bool IncreaseStorageQToZero(int pos, double& adjustQ) = 0; //单个发出无功功率的储能设备调节无功到零。adjustQ为负数 virtual bool DecreaseStorageQToZero(int pos, double& adjustQ) = 0; }; #endif
0fd811d3d7d90f0d5b06325a64d4e6869af942c7
afd32ad1735c8bebac60799e5051f998a8bd2b6f
/vehicle/OVMS.V3/components/vehicle_renaultzoe/src/vehicle_renaultzoe.cpp
d0b7e72d826a1b2c8109c0c7c0e7359938c460da
[]
no_license
wolfijenne/Open-Vehicle-Monitoring-System-3
f239204daaf2561c63afd4fc337d4984505ee40e
a35bafa07fcafb4c0461e7e0926298f850833f29
refs/heads/master
2021-05-06T07:48:49.859358
2018-01-19T11:07:08
2018-01-19T11:07:08
113,968,058
2
2
null
2017-12-12T09:08:40
2017-12-12T09:08:40
null
UTF-8
C++
false
false
26,031
cpp
/* ; Project: Open Vehicle Monitor System ; Date: 14th March 2017 ; ; Changes: ; 1.0 Initial release ; ; (C) 2011 Michael Stegen / Stegen Electronics ; (C) 2011-2017 Mark Webb-Johnson ; (C) 2011 Sonny Chen @ EPRO/DX ; ; Permission is hereby granted, free of charge, to any person obtaining a copy ; of this software and associated documentation files (the "Software"), to deal ; in the Software without restriction, including without limitation the rights ; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ; copies of the Software, and to permit persons to whom the Software is ; furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ; THE SOFTWARE. */ #include "ovms_log.h" static const char *TAG = "v-renaultzoe"; #include <stdio.h> #include "pcp.h" #include "vehicle_renaultzoe.h" #include "ovms_metrics.h" #include "metrics_standard.h" #define VERSION "0.1.0" // Polling types ("modes") supported: see vehicle.h // // polltime[state] = poll period in seconds, i.e. 10 = poll every 10 seconds // // state: 0..2; set by vehicle_poll_setstate() // 0=off, 1=on, 2=charging // // Use broadcasts to query all ECUs. The request is sent to ID 0x7df (broadcast // listener) and the poller accepts any response ID from 0x7e8..0x7ef. // The moduleid is not used for broadcasts, just needs to be != 0. // // To poll a specific ECU, send to its specific ID (one of 0x7e0..0x7e7). // ECUs will respond using their specific ID plus 8 (= range 0x7e8..0x7ef). static const OvmsVehicle::poll_pid_t vehicle_renaultzoe_polls[] = { { 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2002, { 10, 10, 10 } }, // SOC { 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2006, { 10, 10, 10 } }, // Odometer { 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x3203, { 10, 10, 10 } }, // Battery Voltage { 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x3204, { 10, 10, 10 } }, // Battery Current { 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x3028, { 10, 10, 10 } }, // 12Battery Current // 7ec,24,39,.005,0,0,kwh,22320C,62320C,ff,Available discharge Energy { 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x320C, { 10, 10, 10 } }, // Available discharge Energy // 7ec,30,31,1,0,0,,223332,623332,ff,Electrical Machine functionning Authorization,0:Not used;1:Inverter Off;2:Inverter On\n" // //{ 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x3332, { 10, 10, 10 } }, // Inverter Off: 1; Inverter On: 2 //{ 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2005, { 10, 10, 10 } }, // 12Battery Voltage //{ 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x3206, { 10, 10, 10 } }, // Battery SOH { 0x7e4, 0x7ec, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x33dc, { 10, 10, 10 } }, // Consumed Domnestic Engergy //{ 0x75a, 0x77e, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x3018, { 10, 10, 10 } }, // DCDC Temp //{ 0x7e4, 0x77e, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x302b, { 10, 10, 10 } }, // Inverter Temp { 0x792, 0x793, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x504A, { 10, 10, 10 } }, // Mains active Power consumed { 0x792, 0x793, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x5063, { 10, 10, 10 } }, // Charging State // { 0x792, 0x793, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x5062, { 10, 10, 10 } }, // Ground Resistance { 0x79b, 0x7bb, VEHICLE_POLL_TYPE_OBDIIGROUP, 0x04, { 10, 10, 10 } }, // Temp Bat Module 1 //+"7bc,28,39,1,4094,0,N·m,224B7C,624B7C,ff,Electric brake wheels torque request\n" // //+ "Uncoupled Braking Pedal,2197,V,7bc,79c,UBP,-,5902ff\n" { 0x79c, 0x7bc, VEHICLE_POLL_TYPE_OBDIIGROUP, 0x04, { 120, 1, 120 } }, // Braking Pedal // -END- { 0, 0, 0x00, 0x00, { 0, 0, 0 } } }; // Init OvmsVehicleRenaultZoe::OvmsVehicleRenaultZoe() { ESP_LOGI(TAG, "Renault Zoe vehicle module"); StdMetrics.ms_v_bat_soc->SetValue(0); StdMetrics.ms_v_bat_12v_current->SetValue(0); StdMetrics.ms_v_bat_range_est->SetValue(0); // StdMetrics.ms_v_bat_cac->SetValue(0); StdMetrics.ms_v_bat_current->SetValue(0); StdMetrics.ms_v_bat_power->SetValue(0); StdMetrics.ms_v_charge_pilot->SetValue(false); memset( m_vin, 0, sizeof(m_vin)); memset( rz_battery_cell_voltage ,0, sizeof(rz_battery_cell_voltage)); memset( rz_battery_module_temp, 0, sizeof(rz_battery_module_temp)); memset( rz_tpms_id, 0, sizeof(rz_tpms_id)); rz_obc_volt = 230; rz_battery_current = 0; rz_battery_cum_charge_current = 0; rz_battery_cum_discharge_current = 0; rz_battery_cum_charge_power = 0; rz_battery_cum_discharge_power = 0; rz_charge_bits.Charging = false; rz_charge_bits.FanStatus = 0; rz_battery_min_temperature = 0; rz_battery_max_temperature = 0; rz_heatsink_temperature = 0; rz_charge_pilot_current = 0; rz_send_can.id = 0; rz_send_can.status = 0; memset( rz_send_can.byte, 0, sizeof(rz_send_can.byte)); rz_maxrange = CFG_DEFAULT_MAXRANGE; // C-Bus RegisterCanBus(1, CAN_MODE_ACTIVE, CAN_SPEED_500KBPS); MyConfig.RegisterParam("x.rz", "Renault Zoe", true, true); ConfigChanged(NULL); // init metrics: m_b_cell_volt_max = MyMetrics.InitFloat("x.rz.m.b.cell.volt.max", 10, 0, Volts); m_b_cell_volt_min = MyMetrics.InitFloat("x.rz.m.b.cell.volt.min", 10, 0, Volts); m_b_bat_avail_energy = MyMetrics.InitFloat("x.rz.m.b.bat.avail.energy", 10, 0, kWh); m_b_bat_max_charge_power = MyMetrics.InitFloat("x.rz.m.b.bat.max.charge.power", 10, 0, kW); m_v_hydraulic_brake_power = MyMetrics.InitFloat("x.rz.m.v.hydraulic.brake.power", 10, 0, kW); m_mains_power = MyMetrics.InitFloat("x.rz.m.mains.power",10,0, kW); m_bat_heat_sink_temp = MyMetrics.InitFloat("x.rz.m.bat.heat.sink.temp",10,0,Celcius); m_charge_pilot_current = MyMetrics.InitInt("x.rz.m.charge.pilot.current",10,0,Amps); m_b_temp1 = MyMetrics.InitInt("x.rz.m.bat.t1",10,0, Celcius); m_b_temp2 = MyMetrics.InitInt("x.rz.m.bat.t2",10,0, Celcius); m_b_temp3 = MyMetrics.InitInt("x.rz.m.bat.t3",10,0, Celcius); m_b_temp4 = MyMetrics.InitInt("x.rz.m.bat.t4",10,0, Celcius); m_b_temp5 = MyMetrics.InitInt("x.rz.m.bat.t5",10,0, Celcius); m_b_temp6 = MyMetrics.InitInt("x.rz.m.bat.t6",10,0, Celcius); m_b_temp7 = MyMetrics.InitInt("x.rz.m.bat.t7",10,0, Celcius); m_b_temp8 = MyMetrics.InitInt("x.rz.m.bat.t8",10,0, Celcius); m_b_temp9 = MyMetrics.InitInt("x.rz.m.bat.t9",10,0, Celcius); m_b_temp10 = MyMetrics.InitInt("x.rz.m.bat.t10",10,0, Celcius); m_b_temp11 = MyMetrics.InitInt("x.rz.m.bat.t11",10,0, Celcius); m_b_temp12 = MyMetrics.InitInt("x.rz.m.bat.t12",10,0, Celcius); PollSetPidList(m_can1,vehicle_renaultzoe_polls); PollSetState(0); } // End Insertion from Kia Soul OvmsVehicleRenaultZoe::~OvmsVehicleRenaultZoe() { ESP_LOGI(TAG, "Shutdown Renault Zoe vehicle module"); } // Start Insertion from Kia Soul /** * ConfigChanged: reload single/all configuration variables */ void OvmsVehicleRenaultZoe::ConfigChanged(OvmsConfigParam* param) { ESP_LOGD(TAG, "Renault Zoe reload configuration"); // Instances: // x.rz // batteryCapacity Battery capacity in wH (Default: 270000) // suffsoc Sufficient SOC [%] (Default: 0=disabled) // suffrange Sufficient range [km] (Default: 0=disabled) // maxrange Maximum ideal range at 20 °C [km] (Default: 160) // // canwrite Bool: CAN write enabled (Default: no) // autoreset Bool: SEVCON reset on error (Default: yes) // kickdown Bool: SEVCON automatic kickdown (Default: yes) // autopower Bool: SEVCON automatic power level adjustment (Default: yes) // console Bool: SimpleConsole inputs enabled (Default: no) // rz_battery_capacity = (float)MyConfig.GetParamValueInt("x.rz", "batteryCapacity", CGF_DEFAULT_BATTERY_CAPACITY); } //////////////////////////////////////////////////////////////////////// // vehicle_renaultzoe_car_on() // Takes care of setting all the state appropriate when the car is on // or off. Centralized so we can more easily make on and off mirror // images. void OvmsVehicleRenaultZoe::vehicle_renaultzoe_car_on(bool isOn) { if (isOn && !StdMetrics.ms_v_env_on->AsBool()) { // Car is ON StdMetrics.ms_v_env_on->SetValue(isOn); StdMetrics.ms_v_env_awake->SetValue(isOn); PollSetState(1); //TODO net_req_notification(NET_NOTIFY_ENV); } else if(!isOn && StdMetrics.ms_v_env_on->AsBool()) { // Car is OFF StdMetrics.ms_v_env_on->SetValue( isOn ); StdMetrics.ms_v_env_awake->SetValue( isOn ); StdMetrics.ms_v_pos_speed->SetValue( 0 ); } } /** * Handles incoming CAN-frames on bus 1, the C-bus */ void OvmsVehicleRenaultZoe::IncomingFrameCan1(CAN_frame_t* p_frame) { //ESP_LOGI(TAG, "Renault Zoe IncomingFrameCan1"); // uint8_t *d = p_frame->data.u8; uint8_t *d = p_frame->data.u8; #define CAN_7NIBL(b) (((((UINT)d[(int)b/8] << 8) | (d[((int)b/8)+1])) >> (b-((int)b/8)*8)) & 127); #define CAN_8NIBL(b) (((((UINT)d[(int)b/8] << 8) | (d[((int)b/8)+1])) >> (b-((int)b/8)*8)) & 255); #define CAN_9NIBL(b) (((((UINT)d[(int)b/8] << 8) | (d[((int)b/8)+1])) >> (b-((int)b/8)*8)) & 511); switch (p_frame->MsgID) { case 0x1fd: { // 1fd,48,55,1,80,0,kW,,,ff Consumption ? } break; case 0x427: { // 427,40,47,0.3,0,0,kW,,,e2\n" Available Charging Power // 427,49,57,0.1,0,1,kWh,,,e2\n" Available Energy } break; case 0x42a: { // 42a,30,39,0.1,400,1,°C,,,ff\n" Evaporator Temp Measure // 42a,48,50,1,0,0,,,,e2\n" ClimLoopMode } break; case 0x42e: { // 42e,0,12,0.02,0,2,%,,,e3\n" State of Charge // 42e,20,24,5,0,0,%,,,e2\n" Engine Fan Speed // 42e,38,43,1,0,1,A,,,e3\n" Charging Pilot Current m_charge_pilot_current->SetValue((int(d[4]) << 4 | d[5] >> 4) & 63); if (m_charge_pilot_current->AsInt() > 0) { StdMetrics.ms_v_charge_pilot->SetValue(true); } else { StdMetrics.ms_v_charge_pilot->SetValue(false); } // 42e,44,50,1,40,0,°C,,,e3\n" HV Battery Temp // We rather use calculation than measurement since value recieved has no decimals // StdMetrics.ms_v_bat_temp->SetValue((float(CAN_7NIBL(45))-40)); // 42e,56,63,0.3,0,1,kW,,,ff\n" Max Charge Power m_b_bat_max_charge_power->SetValue((float(d[7])*0.3)); } break; case 0x430: { // 430,24,33,0.5,30,1,°C,,,e2\n" Comp Temperature Discharge // 430,38,39,1,0,0,,,,e2\n" HV Battery Cooling State // 430,40,49,0.1,400,1,°C,,,e2\n" HV Battery Evaporator Temp m_bat_heat_sink_temp->SetValue((float(UINT((d[5] << 2) | d[6] >> 6) & 1023) - 400)*0.1); } break; case 0x432: { // 432,36,37,1,0,0,,,,e2\n" HV Bat Conditionning Mode } break; case 0x534: { //534,32,40,1,40,0,°C,,,e5\n" // Temp out (Vielleicht dieser statt 656 // StdMetrics.ms_v_env_temp->SetValue((float(CAN_9NIBL(33))-40)); } break; case 0x654: { // Battery Parmeters // 654,2,2,1,0,0,,,,ff\n" // Charging Plug Connected // 654,25,31,1,0,0,,,,ff\n" // State of Charge // 654,32,41,1,0,0,min,,,ff\n" // Time to Full StdMetrics.ms_v_charge_duration_full->SetValue((UINT(d[4] << 2) | d[5] >> 6) & 1023); // 654,42,51,1,0,0,km,,,ff\n" // Available Distance StdMetrics.ms_v_bat_range_est->SetValue((UINT(d[5] << 2) | d[6] >> 4) & 1023); } break; case 0x656: { // External Temp // 656,48,55,1,40,0,°C,,,e2\n" // External Temp StdMetrics.ms_v_env_temp->SetValue((float(d[6])-40)); } break; case 0x658: { // SOH // 658,33,39,1,0,0,%,,,ff\n" // Battery Health StdMetrics.ms_v_bat_soh->SetValue(d[4]); } break; case 0x65b: { // 65b,41,43,1,0,0,,,,ff\n" // Charging Status Display } break; case 0x673: { // TPMS // 673,2,4,1,0,0,,,,ff\n" // Rear right wheel state // 673,5,7,1,0,0,,,,ff\n" // Rear left wheel state // 673,8,10,1,0,0,,,,ff\n" // Front right wheel state // 673,11,13,1,0,0,,,,ff\n" // Front left wheel state // 673,16,23,13.725,0,0,mbar,,,ff\n" // Rear right wheel pressure StdMetrics.ms_v_tpms_rr_p->SetValue((float(d[2])*13.725)); // 673,24,31,13.725,0,0,mbar,,,ff\n" // Rear left wheel pressure StdMetrics.ms_v_tpms_rl_p->SetValue((float(d[3])*13.725)); // 673,32,39,13.725,0,0,mbar,,,ff\n" // Front right wheel pressure StdMetrics.ms_v_tpms_fr_p->SetValue((float(d[4])*13.725)); // 673,40,47,13.725,0,0,mbar,,,ff\n" // Front left wheel pressure StdMetrics.ms_v_tpms_fl_p->SetValue((float(d[5])*13.725)); } break; } } /** * Incoming poll reply messages */ void OvmsVehicleRenaultZoe::IncomingPollReply(canbus* bus, uint16_t type, uint16_t pid, uint8_t* data, uint8_t length, uint16_t mlremain) { // ESP_LOGI(TAG, "Renault Zoe IncomingPollReply"); // uint8_t bVal; // UINT base; // uint32_t lVal; switch (m_poll_moduleid_low) { case 0x7ec: switch (pid) { case 0x2002: { // 7ec,24,39,2.083333333,0,2,%,222002,622002,e5\n" // SOC StdMetrics.ms_v_bat_soc->SetValue( float(CAN_UINT(0)) * 2 / 100); } break; case 0x2003: { // 7ec,24,39,.01,0,0,km/h,222003,622003,ff,Vehicle speed StdMetrics.ms_v_pos_speed->SetValue( float(CAN_UINT(0)) * 100); } break; case 0x2006: { // 7ec,24,47,1,0,0,km,222006,622006,ff\n" // Odometer StdMetrics.ms_v_pos_odometer->SetValue(float(CAN_UINT24(0))); } break; case 0x3028: { // 7ec,24,31,0.5,0,1,A,223028,623028,ff\n" // 14V current StdMetrics.ms_v_bat_12v_current->SetValue(float(CAN_BYTE(0))*0.1); } break; case 0x320C: { // 7ec,24,39,.005,0,0,kwh,22320C,62320C,ff,Available discharge Energy m_b_bat_avail_energy->SetValue(float(CAN_UINT(0))*0.005); } break; case 0x3203: { // 7ec,24,39,0.5,0,2,V,223203,623203,ff\n" // HV Battery voltage rz_bat_voltage = float(CAN_UINT(0)) * 50/100; } break; case 0x3204: { // 7ec,24,39,0.25,32768,2,A,223204,623204,ff\n" // HV Battery current rz_bat_current = (float(CAN_UINT(0))-32768) * 25/100; } break; case 0x33dc: { // 7ec,24,47,0.001,1,0,kWh,2233dc,6233dc,ff\n" // Consumed domestic energy StdMetrics.ms_v_charge_kwh->SetValue(CAN_UINT24(0)*0.001); } break; } break; case 0x7bb: switch (pid) { case 0x01: { // Todo // 7bb,336,351,0.01,0,2,kW,2101,6101,e2\n" // Maximum battery input power } break; case 0x03: { // Todo // 7bb,56,71,10,0,0,°C,2103,6103,5\n" // Mean battery compartment temp // 7bb,96,111,.01,0,0,V,2103,6103,ff,21_03_#13_Maximum_Cell_voltage\n" // // 7bb,112,127,.01,0,0,V,2103,6103,ff,21_03_#15_Minimum_Cell_voltage\n" // // 7bb,192,207,0.01,0,2,%,2103,6103,e2\n" // Real State of Charge // if (type == VEHICLE_POLL_TYPE_OBDIIGROUP) // { // if (m_poll_ml_frame == 1) // { // m_b_cell_volt_max->SetValue(float( CAN_BYTE(6)*0.01 ),Volts); // } // else if (m_poll_ml_frame == 2) // { // m_b_cell_volt_min->SetValue(float( CAN_BYTE(1)*0.01 ),Volts); // } // } } break; case 0x04: { // Todo // 7bb,32,39,1,40,0,°C,2104,6104,e2\n" // Cell 1 Temperature // 7bb,56,63,1,40,0,°C,2104,6104,e2\n" // Cell 2 Temperature // 7bb,80,87,1,40,0,°C,2104,6104,e2\n" // Cell 3 Temperature // 7bb,104,111,1,40,0,°C,2104,6104,e2\n" // Cell 4 Temperature // 7bb,128,135,1,40,0,°C,2104,6104,e2\n" // Cell 5 Temperature // 7bb,152,159,1,40,0,°C,2104,6104,e2\n" // Cell 6 Temperature // 7bb,176,183,1,40,0,°C,2104,6104,e2\n" // Cell 7 Temperature // 7bb,200,207,1,40,0,°C,2104,6104,e2\n" // Cell 8 Temperature // 7bb,224,231,1,40,0,°C,2104,6104,e2\n" // Cell 9 Temperature // 7bb,248,255,1,40,0,°C,2104,6104,e2\n" // Cell 10 Temperature // 7bb,272,279,1,40,0,°C,2104,6104,e2\n" // Cell 11 Temperature // 7bb,296,303,1,40,0,°C,2104,6104,e2\n" // Cell 12 Temperature if (type == VEHICLE_POLL_TYPE_OBDIIGROUP) { if (m_poll_ml_frame == 0) { rz_battery_module_temp[0]=( (INT)CAN_BYTE(1)-40 ); } else if (m_poll_ml_frame == 1) { rz_battery_module_temp[1]=( (INT)CAN_BYTE(1)-40 ); rz_battery_module_temp[2]=( (INT)CAN_BYTE(4)-40 ); } else if (m_poll_ml_frame == 2) { rz_battery_module_temp[3]=( (INT)CAN_BYTE(0)-40 ); rz_battery_module_temp[4]=( (INT)CAN_BYTE(3)-40 ); rz_battery_module_temp[5]=( (INT)CAN_BYTE(6)-40 ); } else if (m_poll_ml_frame == 3) { rz_battery_module_temp[6]=( (INT)CAN_BYTE(2)-40 ); rz_battery_module_temp[7]=( (INT)CAN_BYTE(5)-40 ); } else if (m_poll_ml_frame == 4) { rz_battery_module_temp[8]=( (INT)CAN_BYTE(1)-40 ); rz_battery_module_temp[9]=( (INT)CAN_BYTE(4)-40 ); } else if (m_poll_ml_frame == 5) { rz_battery_module_temp[10]=( (INT)CAN_BYTE(0)-40 ); rz_battery_module_temp[11]=( (INT)CAN_BYTE(3)-40 ); } int sum=0; for (int i=0; i<12; i++) { sum+=rz_battery_module_temp[i]; } StdMetrics.ms_v_bat_temp->SetValue(float(sum)/12); // Calculate Mean Value } } break; } break; case 0x7bc: switch (pid) { case 0x4B7C: { // Todo // //+"7bc,28,39,1,4094,0,N·m,224B7C,624B7C,ff,Electric brake wheels torque request\n" // Brake Torque } break; case 0x4B7D: { //"7bc,28,39,1,4094,0,N·m,224B7D,624B7D,ff,Total Hydraulic brake wheels torque request\n" m_v_hydraulic_brake_power->SetValue(float(CAN_12NIBL(28) -4094)*StdMetrics.ms_v_pos_speed->AsFloat()/3.6/1.28*2*3.141 ); } break; } break; case 0x77e: switch (pid) { // case 0x3018: // zoe_dcdc_temp=CAN_UINT(4); // break; case 0x302b: { // 77e,24,31,0.015625,0,2,°C,22302b,62302b,ff\n" // inverter temperature // 77e,24,39,0.015625,0,2,ºC,223018,623018,ff\n" // DCDC converter temperature } break; } break; case 0x793: switch (pid) { case 0x504A: { // 793,24,39,1,20000,0,W,22504A,62504A,ff\n" // Mains active power consumed m_mains_power->SetValue((float(CAN_UINT(0)-20000)/1000),kW); } break; case 0x5063: { // 793,24,31,1,0,0,,225063,625063,ff\n" // Supervisor state,0:Init;1:Wait;2:ClosingS2;3:InitType;4:InitLkg;5:InitChg;6:Charge;7:ZeroAmpMode;8:EndOfChg;9:OpeningS2;10:ReadyToSleep;11:EmergencyStop;12:InitChargeDF;13:OCPStop;14:WaitS2 rz_charge_state_local=CAN_BYTE(0); m_b_temp1->SetValue((INT)rz_charge_state_local); if (rz_charge_state_local==0) { // Init,Wait,ClosingS2,InitType,InitLkg,InitChg SET_CHARGE_STATE("prepare"); } else if (rz_charge_state_local==1) { // Charge SET_CHARGE_STATE("stopped"); } else if (rz_charge_state_local==2) { // Charge SET_CHARGE_STATE("prepare"); } else if (rz_charge_state_local==3) { // Charge SET_CHARGE_STATE("prepare"); } else if (rz_charge_state_local==4) { // Charge SET_CHARGE_STATE("prepare"); } else if (rz_charge_state_local==5) { // Charge SET_CHARGE_STATE("prepare"); } else if (rz_charge_state_local==6) { // Charge SET_CHARGE_STATE("charging"); } else if (rz_charge_state_local==7) { // ZeroAmpMode SET_CHARGE_STATE("topoff"); } else if (rz_charge_state_local==8) { // EndOfChg SET_CHARGE_STATE("done"); } else if (rz_charge_state_local==9) { // OpeningS2 SET_CHARGE_STATE("prepare"); } else if (rz_charge_state_local==10) { // ReadyToSleep SET_CHARGE_STATE("stopped"); } else if (rz_charge_state_local==11) { //EmergencyStopp SET_CHARGE_STATE("stopped"); } else if (rz_charge_state_local==12) { //InitChargeDF SET_CHARGE_STATE("prepare"); } else if (rz_charge_state_local==13) { //OCPStop SET_CHARGE_STATE("stopped"); } else if (rz_charge_state_local==14) { //WaitS2 SET_CHARGE_STATE("prepare"); } } break; } break; } } /** * Ticker1: Called every second */ void OvmsVehicleRenaultZoe::Ticker1(uint32_t ticker) { StdMetrics.ms_v_bat_voltage->SetValue( rz_bat_voltage ); StdMetrics.ms_v_bat_current->SetValue( rz_bat_current ); StdMetrics.ms_v_bat_power->SetValue(rz_bat_voltage * rz_bat_current/1000); if (StdMetrics.ms_v_bat_12v_voltage->AsFloat() > 13.5) { vehicle_renaultzoe_car_on(true); } else { vehicle_renaultzoe_car_on(false); } } /** * Sets the charge metrics */ void OvmsVehicleRenaultZoe::SetChargeMetrics(float voltage, float current, float climit, bool chademo) { StdMetrics.ms_v_charge_voltage->SetValue( voltage, Volts ); StdMetrics.ms_v_charge_current->SetValue( current, Amps ); StdMetrics.ms_v_charge_climit->SetValue( climit, Amps); } // End Insertion from Kia Soul class OvmsVehicleRenaultZoeInit { public: OvmsVehicleRenaultZoeInit(); } MyOvmsVehicleRenaultZoeInit __attribute__ ((init_priority (9000))); OvmsVehicleRenaultZoeInit::OvmsVehicleRenaultZoeInit() { ESP_LOGI(TAG, "Registering Vehicle: Renault Zoe (9000)"); MyVehicleFactory.RegisterVehicle<OvmsVehicleRenaultZoe>("RZ","Renault Zoe"); }
3dd064981488c47ff74544b7374a14215e5f42c8
bc07a35422b679764a4718a36fce5b7924d58ade
/src/vector_utility.h
76e531bc910d7b3e16d65964668a6b006d095138
[]
no_license
jgrowl/carcassonne
809c3db4a5251d5cca801c884d936f7bb1c6b6a0
86487b4c5c849dcc9d146e8ba838bffdb701d70b
refs/heads/master
2020-05-17T20:45:09.077114
2009-09-12T17:53:53
2009-09-12T17:53:53
285,524
1
0
null
null
null
null
UTF-8
C++
false
false
612
h
#ifndef CARCASSONNE_VECTOR_UTILITY_H_ #define CARCASSONNE_VECTOR_UTILITY_H_ #include <algorithm> // For random_shuffle() #include <ctime> // To seed system clock for use in random_shuffle() namespace carcassonne { namespace utility { template <typename T> void shuffle(std::vector<T>& vector_to_shuffle) { // Seed the system clock to give a random shuffle std::srand(std::time(NULL)); // Shuffle them to randomize the colors. std::random_shuffle(vector_to_shuffle.begin(), vector_to_shuffle.end()); } } // namespace 'utility' } // namespace 'carcassonne' #endif /*CARCASSONNE_VECTOR_UTILITY_H_*/
cccc485ca97e81ef7c6836512a73dacdd5430c0a
eeb014a48d22e38bb4f866838c06f64ac2b4f4c6
/BITMagic/bitdeifference.cpp
36d1eec8bcae6fe23bd084435deb4829562bd0ac
[]
no_license
oumkale/Geeks-For-Geeks-Work
8cb2b7948fe1afc4dfa18d6d30f9ca1fc83db9cf
96893a593b8e1dc03e0d8d3d23c279cd7968e1e6
refs/heads/master
2021-03-02T18:24:41.660387
2020-03-08T21:55:02
2020-03-08T21:55:02
245,893,402
2
0
null
null
null
null
UTF-8
C++
false
false
311
cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { long long int p,k,n,count=0,u=0,m,flag=1; cin>>n>>m; int x = n ^ m; while(x) { if(x%2!=0) count++; x=x>>1; } cout << count << endl; } }
cf059d9fc8fdf83ddcb131d9a062812c2200744b
1bdb9b8baf341e71bde5c471d293e082c3def401
/GameTemplate/Game/graphics/SkinModel.h
665f1917949c636b9789f318e17cb35d24c9077a
[]
no_license
TakuyaI/GameSeisaku
6f8fc5915eeba5f84ea3e4c4808f9761712fff99
e82f46324ad23e54e4225670d3afcd07fe6a8fa8
refs/heads/master
2020-06-27T12:37:03.837654
2019-09-26T07:25:14
2019-09-26T07:25:14
199,956,212
0
0
null
null
null
null
SHIFT_JIS
C++
false
false
3,615
h
#pragma once #include "Skeleton.h" /*! *@brief FBXの上方向。 */ enum EnFbxUpAxis { enFbxUpAxisY, //Y-up enFbxUpAxisZ, //Z-up }; //ディレクションライト。 struct SDirectionLight { CVector4 direction; CVector4 color; }; /*! *@brief スキンモデルクラス。 */ class SkinModel { public: //メッシュが見つかったときのコールバック関数。 using OnFindMesh = std::function<void(const std::unique_ptr<DirectX::ModelMeshPart>&)>; /*! *@brief デストラクタ。 */ ~SkinModel(); /*! *@brief 初期化。 *@param[in] filePath ロードするcmoファイルのファイルパス。 *@param[in] enFbxUpAxis fbxの上軸。デフォルトはenFbxUpAxisZ。 */ void Init(const wchar_t* filePath, EnFbxUpAxis enFbxUpAxis = enFbxUpAxisZ); /*! *@brief モデルをワールド座標系に変換するためのワールド行列を更新する。 *@param[in] position モデルの座標。 *@param[in] rotation モデルの回転。 *@param[in] scale モデルの拡大率。 */ void UpdateWorldMatrix(CVector3 position, CQuaternion rotation, CVector3 scale); /*! *@brief ボーンを検索。 *@param[in] boneName ボーンの名前。 *@return 見つかったボーン。見つからなかった場合はnullptrを返します。 */ Bone* FindBone(const wchar_t* boneName) { int boneId = m_skeleton.FindBoneID(boneName); return m_skeleton.GetBone(boneId); } /*! *@brief モデルを描画。 *@param[in] viewMatrix カメラ行列。 * ワールド座標系の3Dモデルをカメラ座標系に変換する行列です。 *@param[in] projMatrix プロジェクション行列。 * カメラ座標系の3Dモデルをスクリーン座標系に変換する行列です。 */ void Draw( CMatrix viewMatrix, CMatrix projMatrix ); /*! *@brief スケルトンの取得。 */ Skeleton& GetSkeleton() { return m_skeleton; } /*! *@brief メッシュを検索する。 *@param[in] onFindMesh メッシュが見つかったときのコールバック関数 */ void FindMesh(OnFindMesh onFindMesh) const { for (auto& modelMeshs : m_modelDx->meshes) { for (std::unique_ptr<DirectX::ModelMeshPart>& mesh : modelMeshs->meshParts) { onFindMesh(mesh); } } } /*! *@brief SRVのレジスタ番号。 */ enum EnSkinModelSRVReg { enSkinModelSRVReg_DiffuseTexture = 0, //!<ディフューズテクスチャ。 enSkinModelSRVReg_BoneMatrix, //!<ボーン行列。 }; private: /*! *@brief サンプラステートの初期化。 */ void InitSamplerState(); /*! *@brief 定数バッファの作成。 */ void InitConstantBuffer(); /*! *@brief スケルトンの初期化。 *@param[in] filePath ロードするcmoファイルのファイルパス。 */ void InitSkeleton(const wchar_t* filePath); /* *@brief ディレクションライトの初期化。 */ void InitDirectionLight(); private: //定数バッファ。 struct SVSConstantBuffer { CMatrix mWorld; CMatrix mView; CMatrix mProj; }; EnFbxUpAxis m_enFbxUpAxis = enFbxUpAxisZ; //!<FBXの上方向。 ID3D11Buffer* m_cb = nullptr; //!<定数バッファ。 Skeleton m_skeleton; //!<スケルトン。 CMatrix m_worldMatrix; //!<ワールド行列。 DirectX::Model* m_modelDx; //!<DirectXTKが提供するモデルクラス。 ID3D11SamplerState* m_samplerState = nullptr; //!<サンプラステート。 SDirectionLight m_dirLight; //!ディレクションライト。 ID3D11Buffer* m_LightCb = nullptr; //!ライト用の定数バッファ。 };
51540c54eb6cbde6fcdb6c89c26270405aeb9f58
a24f858775c7c335d1b47c5332fda28154d7a4a7
/libs/string/src/string.cpp
d4cf81c429631ec7ae8459a1ab715739c95ba53f
[]
no_license
shanerbo/YAS
afbf1e9ea0baea3858faa438f2e9b959578d70b1
a8d8f6b8ceb32c3c554bbaef31a9cdfeb4de2f2f
refs/heads/main
2023-03-28T19:55:53.413295
2021-03-31T06:10:32
2021-03-31T06:10:32
352,233,426
0
0
null
null
null
null
UTF-8
C++
false
false
1,921
cpp
// // Created by shanerbo on 3/27/21. // #include "string.hpp" #include <cstdlib> #include <cstring> #include <iostream> namespace YAS { string::string() noexcept : size_{0}, content_(nullptr) {} string::string(const char *str) noexcept : size_(strlen(str)), content_(new char[size_ + 1]) { strcpy(content_, str); } string::string(const string &rhs) noexcept : size_(rhs.size_), content_(new char[size_ + 1]) { strcpy(content_, rhs.content_); } string::string(string &&rhs) noexcept : string() { swap(*this, rhs); } string &string::operator=(string rhs) { swap(rhs, *this); return *this; } size_t string::size() const { return size_; } bool string::empty() const { return size_ == 0; } void string::clear() { size_ = 0; content_ = nullptr; } int32_t string::find(char c) { for (int i = 0; i < size_; ++i) { if (content_[i] == c) { return i; } } return -1; } char string::operator[](size_t pos) { if (size_ == 0 or pos >= size_) { throw Exception("pos out of range"); } return content_[pos]; } string &string::operator+=(const string &rhs) { size_t new_len = rhs.size_ + size_; char *new_str = new char[new_len + 1]; strcpy(new_str, content_); strcpy(new_str + size_, rhs.content_); delete[] content_; size_ = new_len; content_ = new_str; return *this; } string string::operator+(const string &rhs) { string tmp(*this); tmp += rhs; return tmp; } void swap(string &lhs, string &rhs) { std::swap(lhs.size_, rhs.size_); std::swap(lhs.content_, rhs.content_); } string string::reverse() { char *temp = new char[size_ + 1]; for (int i = 0; i < static_cast<int>(size_); ++i) { temp[i] = content_[size_ - 1 - i]; } temp[size_] = 0; return string(temp); } const char *string::c_str() const { return content_; } std::ostream &operator<<(std::ostream &os, string &rhs) { os << rhs.c_str(); return os; } } // namespace YAS
94c01c0227ef4e0648208bf3767a90c6c5ac50f9
87d45c021a4420df79ba1ee7e92509a663e670d3
/client/Logic/EffectMng.cpp
e72f4b2e4da24c7bbef481ea89519aa2bdaa43e8
[]
no_license
meneleos/gth
eaf5efc8ac736ec0ea69e131890e86399417d64e
f973a11fd9aa9b1e8d5a03606cdbcda48c6ec0d3
refs/heads/master
2021-01-10T07:30:28.372356
2012-05-21T13:46:37
2012-05-21T13:46:37
53,994,918
0
0
null
null
null
null
UTF-8
C++
false
false
11,950
cpp
#include "../global_def.h" #include <assert.h> CEffectMng::CEffectMng() { m_currEntity = 0; m_frameFlag = 0; m_visibleDist = 10000.0f; m_linked = NULL; } CEffectMng::~CEffectMng() { } void CEffectMng::Initialize( float visibleDist ) { int i; m_frameFlag = 0; m_currEntity = 0; m_visibleDist = visibleDist; m_MDLMng->ClearEffectUseFlag(); m_linked = NULL; memset( m_entities , 0 , sizeof( effectentity_t ) * MAX_SIZE_EFFECT_ENTITY ); memset( m_entityInUse , 0 , sizeof( int ) * MAX_SIZE_EFFECT_ENTITY ); for( i = 0 ; i < MAX_SIZE_EFFECT_ENTITY ; i++ ) m_entities[i].idxSelf = i; } void CEffectMng::ClearUseFlag() { memset( m_entityInUse , 0 , sizeof( int ) * MAX_SIZE_EFFECT_ENTITY ); m_currEntity = 0; m_linked = NULL; } int CEffectMng::AddSelfEffect ( GTH_EFFECT_CLASS_TYPE classType, int effectID, vec3_t origin, int effect_level, int follow_attacker, int attackerType, int attackerIdx, float offset_x, float offset_y, float offset_z, float in_lifeTime, int in_follow_repetition, int effect_type) { return Add ( classType, effectID, origin, NULL, NULL, 0.0f, attackerType, attackerIdx, -1, -1, effect_level, follow_attacker, offset_x, offset_y, offset_z, in_lifeTime, in_follow_repetition, effect_type); } int CEffectMng::Add ( GTH_EFFECT_CLASS_TYPE classType, int effectID, vec3_t origin, vec3_t target, vec3_t angles, float hitDiff, int attackerType, int attackerID, int defenderType, int defenderID, int effect_level, int follow_attacker, float offset_x, float offset_y, float offset_z, float in_lifeTime, int in_follow_repetition, int effect_type) { effectentity_t *entity; int index , found; if ( classType == GTH_EFFECT_CLASS_NONE ) return -1; found = -1; for ( index = ( m_currEntity + 1 ); \ index < MAX_SIZE_EFFECT_ENTITY; \ ++index ) { if ( ! m_entityInUse [index] ) { found = index; goto NEXT_FREE_EFFECT_ENTITY; } } for ( index = 0; \ index <= m_currEntity; \ ++index ) { if ( ! m_entityInUse [index] ) { found = index; goto NEXT_FREE_EFFECT_ENTITY; } } if ( found == -1 ) { found = m_currEntity + 1; if ( found >= MAX_SIZE_EFFECT_ENTITY ) found = 0; Delete ( found ); } NEXT_FREE_EFFECT_ENTITY : m_currEntity = found; entity = &m_entities[ m_currEntity ]; entity->next = m_linked; entity->prev = NULL; if( m_linked ) m_linked->prev = entity; m_linked = entity; entity->classType = classType; entity->effectID = effectID; entity->isHitted = false; entity->attackerType = attackerType; entity->attackerID = attackerID; entity->defenderType = defenderType; entity->defenderID = defenderID; entity->sendAttackMessage = false; entity->processDamage = false; VectorCopy( entity->origin , origin ); if( angles ) VectorCopy( entity->angles , angles ); if( target ) VectorCopy( entity->target , target ); entity->EffectType = effect_type; entity->idxMDLEntity = m_MDLMng->AddEffectEntity( m_currEntity, classType, effectID, origin, target, angles, hitDiff, effect_level, follow_attacker, attackerID, attackerType, defenderID, defenderType, offset_x, offset_y, offset_z, in_lifeTime, in_follow_repetition ); if( entity->idxMDLEntity >= 0 ) { if( !m_MDLMng->GetMDLEffectClassBoundBox( entity->idxMDLEntity , GTH_EFFECT_STATE_NORMAL , entity->mins , entity->maxs ) ) { VectorClear( entity->mins ); VectorClear( entity->maxs ); } } else { m_entityInUse[ m_currEntity ] = false; return -1; } m_entityInUse[ m_currEntity ] = true; return m_currEntity; } int CEffectMng::Delete ( int idxEntity ) { effectentity_t *entity; entity = &m_entities [idxEntity]; if ( entity ->prev ) { entity ->prev ->next = entity ->next; } else { m_linked = entity ->next; } if ( entity ->next ) entity ->next ->prev = entity ->prev; entity ->next = NULL; entity ->prev = NULL; m_entityInUse [idxEntity] = false; if ( entity ->idxMDLEntity >= 0 ) m_MDLMng ->DeleteEffectEntity ( entity ->idxMDLEntity ); return true; } inline int CEffectMng::ChechVisibleDistance( vec3_t origin ) { vec3_t dist; VectorSubtract( dist , origin , m_camPos ); if( VectorDotProduct( dist , dist ) > m_visibleDist * m_visibleDist ) return false; return true; } void CEffectMng::Process( vec3_t pos , DWORD frameFlag ) { m_frameFlag = frameFlag; VectorCopy( m_camPos , pos ); m_visData = m_world->GetVisData(); if( !m_visData ) return; ProcessEntityFrame(); } inline int CEffectMng::Cull( vec3_t mins , vec3_t maxs , vec3_t position , int linkedCluster ) { vec3_t trans_mins , trans_maxs; if( !ChechVisibleDistance( position ) ) return true; VectorAdd( trans_mins , position , mins ); VectorAdd( trans_maxs , position , maxs ); if( m_frustum->Cull_Exact( trans_mins , trans_maxs ) ) return true; return false; } void CEffectMng::ProcessEntityFrame() { effectentity_t *entity; int *linkedCount; int overType; m_MDLMng->ClearEffectLinkedCount(); linkedCount = m_MDLMng->GetEffectVisibleLinkedCount(); Fx_CHARACTER_t *thisChar; bool processDamage = false; bool sendAttackMessage = false; entity = m_linked; while ( entity ) { overType = m_MDLMng->IsOverEffectCompleteTime_Neo( entity->idxMDLEntity, processDamage, sendAttackMessage ); if ( ( processDamage ) && ( entity->attackerID >= 0 ) && ! entity->processDamage ) { thisChar = g_charManager ->FindCharacterByServerIndex ( entity ->attackerID, entity ->attackerType ); if ( thisChar != NULL ) { thisChar->atk_sendRangeAttackResend = false; if ( g_charManager ->CalcAttackLength ( thisChar ) >= 500.0f ) { thisChar->atk_processDamage = true; entity->processDamage = true; } } else { entity = DeleteSelf ( entity ); continue; } } if ( ( sendAttackMessage ) && ( entity->attackerID >= 0 ) && ! entity->sendAttackMessage ) { thisChar = g_charManager->FindCharacterByServerIndex( entity->attackerID, entity->attackerType ); if ( thisChar != NULL ) { if ( g_charManager ->CalcAttackLength ( thisChar ) >= 500.0f ) { if( entity->effectID == 0 ) thisChar->atk_sendRangeAttackResend = true; entity->sendAttackMessage = true; } } else { entity = DeleteSelf( entity ); continue; } } if ( entity->effectID == 154 || entity->effectID == 153) { Fx_CHARACTER_t* pFxChar =NULL; pFxChar = g_charManager->FindCharacterByServerIndex( entity->attackerID, entity->attackerType ); if ( thisChar != NULL ) { if ( (g_cgv.syncCharacter[0].nDanBattleIdx < 0 )|| ( g_cgv.syncCharacter[0].worldIdx != g_NewDanBattleSystem.GetDanBattleInfo()->nBattleMapIdx)) { entity = DeleteSelf( entity ); continue; } } } switch( overType ) { case GTH_EFFECT_NOT_COMPLETED : break; case GTH_EFFECT_ALL_STATE_COMPLETED : if (entity->attackerID == g_pApp->m_myCharacter->idxOnServer && entity->effectID == WorldChangeSystem::WORLD_CHANGE_EFFECT_IDX) { if(effectentity_t::enumEffectType::EFFECT_TYPE_PC_SUMMON == entity->EffectType) { g_ifMng->m_Item_ScrollWin->Send_Reply_PC_Summon(true); } else if(effectentity_t::enumEffectType::EFFECT_TYPE_PC_MOVE_SUMMON == entity->EffectType) { g_ifMng->m_Item_ScrollWin->Send_Reday_PC_Move_Summon(true); } } entity = DeleteSelf ( entity ); continue; case GTH_EFFECT_ARMED_STATE_COMPLETED : if( m_MDLMng->m_MDLEffectClasses[m_MDLMng->m_MDLEffectEntities[entity->idxMDLEntity].idxClass].states[GTH_EFFECT_STATE_FIRED].numParts < 1 ) { m_MDLMng->m_MDLEffectEntities[entity->idxMDLEntity].state = GTH_EFFECT_STATE_FIRED; goto FIRE_STATE_COMPLETED; } #ifdef _GTH_ONLINE_VERSION if( entity->defenderID < 0 ) { entity = DeleteSelf ( entity ); continue; } if( g_GameTarget.GTH_GetTargetPosition( entity->defenderType , entity->defenderID , entity->target ) ) { if ( ! m_MDLMng->SetFiredState_Neo ( entity->idxMDLEntity , entity->target , entity->mins , entity->maxs ) ) { entity = DeleteSelf ( entity ); continue; } } else { entity = DeleteSelf ( entity ); continue; } #else m_MDLMng->SetFiredState( entity->idxMDLEntity , entity->target , entity->mins , entity->maxs ); #endif break; case GTH_EFFECT_FIRED_STATE_COMPLETED : FIRE_STATE_COMPLETED: #ifdef _GTH_ONLINE_VERSION entity->isHitted = m_numberCtl->CheckHitTarget( entity->attackerType , entity->attackerID , entity->defenderType , entity->defenderID ); #else entity->isHitted = true; #endif if( entity->isHitted ) { if( g_GameTarget.GTH_GetTargetPosition( entity->defenderType , entity->defenderID , entity->target ) ) { if ( ! m_MDLMng ->SetHittedState_Neo ( entity->idxMDLEntity , entity->target , entity->mins , entity->maxs ) ) { entity = DeleteSelf ( entity ); continue; } } else { entity = DeleteSelf ( entity ); continue; } } else { if( g_GameTarget.GTH_GetTargetPosition( entity->defenderType , entity->defenderID , entity->target ) ) { if( !m_MDLMng->SetMissedState_Neo ( entity->idxMDLEntity , entity->target , entity->mins , entity->maxs ) ) { entity = DeleteSelf ( entity ); continue; } } else { entity = DeleteSelf ( entity ); continue; } } VectorCopy( entity->origin , entity->target ); break; case GTH_EFFECT_ERROR: entity = DeleteSelf ( entity ); continue; } mdleffectentity_t *effectEntity; effectEntity = &m_MDLMng ->m_MDLEffectEntities [entity ->idxMDLEntity]; vec3_t origin; if ( effectEntity ->follow_attacker ) { Fx_CHARACTER_t * ret = g_charManager ->FindCharacterByServerIndex ( effectEntity ->attackerIdx, effectEntity ->attackerType ); if( ret == NULL ) { ErrorLog( "FindCharacterByServerIndex() return NULL!!!" ); entity = DeleteSelf( entity ); continue; } VectorCopy ( origin, ret->position ); } else { VectorCopy ( origin, entity ->origin ); } VectorAdd ( origin, origin, effectEntity ->offset ); if ( Cull ( entity ->mins, entity ->maxs, origin, entity ->linkedCluster ) ) { m_MDLMng->m_MDLEffectEntities[ entity->idxMDLEntity ].visible = false; } else { linkedCount[ m_MDLMng->m_MDLEffectEntities[ entity->idxMDLEntity ].idxClass ]++; m_MDLMng->m_MDLEffectEntities[ entity->idxMDLEntity ].visible = true; } entity = entity ->next; } } effectentity_t* CEffectMng::DeleteSelf ( effectentity_t *in_entity ) { effectentity_t *temp; temp = in_entity ->next; Delete ( in_entity ->idxSelf ); return temp; }
03e78692c32368dafd57494c0b1587643b192b78
01bd7ed3537042a4f88ed93eddf47c19036db46a
/SouShen/Classes/View/Scene/CMenuScene.h
9fd6e5bd0c1e67de343b139ac03ba47f6d3298b1
[]
no_license
Michael-Z/SouShen
f80b8df144e8171c344a6f16e5981642776f0ed4
8e83996e3951a0aa8e289b3c0865bc613bc6894b
refs/heads/master
2021-01-25T12:23:50.593240
2013-09-24T00:53:05
2013-09-24T00:53:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
319
h
#ifndef _CMENUSCENE_H_ #define _CMENUSCENE_H_ #include "CBaseScene.h" namespace View { //for test SCENE_MENU class CMenuScene : public CBaseScene { public: virtual void runThisScene(); virtual void InitScene(); void ShowOtherScene(); void OnTextmenu_Click(CCObject *pSender); }; } #endif
cad19aca27a4e137e7a4fafd576cf8638edd1046
292ef6e6d84bd1d5dd00a4c8e160583cd32ca32b
/cpp/src/ChickenEgg.cpp
47eef53e61e38481938d19e9c5d3efd22927f060
[]
no_license
WillsenS/EngisFarm
12312a07b4f7bb67775a88d1e814fd5a7b0c8882
a11d1d6ffe364625e9c67256b36bcc22d3913e95
refs/heads/master
2021-10-28T17:46:50.289656
2019-04-24T10:38:37
2019-04-24T10:38:37
175,786,058
0
2
null
2019-04-04T18:43:25
2019-03-15T09:09:01
C++
UTF-8
C++
false
false
196
cpp
#include "ChickenEgg.h" ChickenEgg::ChickenEgg() { this->productValue = 3; this->expireValue = 10; } ChickenEgg::~ChickenEgg() { this->productValue = 0; this->expireValue = 0; }
c490e53f1d0b91914f2668133571e913b615c46a
76f7778a1b730e81aab8ce3fdb83e1720b910c48
/one/quantum.hpp
06a9dd2bd55d491070e2dd529f09fc364031ff36
[ "BSD-3-Clause" ]
permissive
RobertZ2011/qcposts
8b82d9197ad122176a2840654ef68117ce71f84a
090636a41ae00f875d501e90463d57066ab5e317
refs/heads/master
2020-03-11T21:55:53.290629
2018-04-21T23:37:12
2018-04-21T23:37:12
130,278,149
0
0
null
null
null
null
UTF-8
C++
false
false
226
hpp
#ifndef QUANTUM #define QUANTUM #include "general.hpp" class State { private: Vector state; int NQUBITS; public: State(int NQUBITS, const Vector& state); ~State(void); void showOutcomes(void); }; #endif
e57b041edea35baa9e675fc8aa39ccb8abfbee14
06fb6bea30e44d89ded0e8f499b9247a12312fd0
/Urok_4_Modul4/Urok_4_Modul4/Urok_4_Modul_4.cpp
868fbbfc63190ade4541b030250d3fe8517e6d5e
[]
no_license
ArmanTapayev/Urok-4_Modul-4
09e92879965484ccf2cf970a9de1dd4b3bf1689a
5eeb37f5677c0857085466d72c5c453982ac99ec
refs/heads/master
2021-05-05T16:37:39.469296
2018-01-13T17:37:29
2018-01-13T17:37:29
117,325,439
0
0
null
null
null
null
UTF-8
C++
false
false
10,717
cpp
#include <stdio.h> #include <iostream> #include <locale.h> #include <math.h> using namespace std; void main() { system("color 1A"); setlocale(LC_ALL, "Rus"); int number = 0; int i, j; cout << "\nТЕМА. Циклы, использование отладчика\n"; cout << "\nЗадание содержит 7 задач.\n"; start: cout << "\nВведите номер задачи.\n"; cout << "n = "; cin >> number; do { switch (number) { #pragma region Task1 case 1: int count1, count2; int a, number_of_cons; cout << "\nЗадача №1\n"; cout << "\n1.Написать программу поиска чисел, лежащих в интервале от -5\n"; cout << "до 5, в последовательности чисел, вводимых с клавиатуры, \n"; cout << "предшествующих первому введенному нулю . Контрольный \n"; cout << "пример: 1,10,-4,5,-16,-5,0.\n" << endl; cout << "Введите число an" << endl; number_of_cons = 1; // номер числа в последовательности do { count1 = 0, count2 = 0; cout << "a" << number_of_cons << "="; cin >> a; if (a == -5) { cout << "Начало последовательности от -5 до 5: " << endl; do { cout << "a" << ++number_of_cons << "="; cin >> a; count1++; // количество чисел в последовательности } while (a != 5); cout << "Конец последовательности." << endl; cout << "Количество чисел в последовательности от -5 до 5 равно " << count1 + 1 << endl; } else if (a == 5) { cout << "Начало последовательности от 5 до -5: " << endl; do { cout << "a" << ++number_of_cons << "="; cin >> a; count2++; // количество чисел в последовательности } while (a != -5); cout << "Конец последовательности." << endl; cout << "Количество чисел в последовательности от 5 до -5 равно " << count2 + 1 << endl; } number_of_cons++; } while (a != 0); cout << "Конец ввода последовательности." << endl; system("pause"); system("cls"); goto start; break; #pragma endregion #pragma region Task2 case 2: cout << "\nЗадача №2\n"; cout << "\n2.Вычислить сумму чисел от 1 до N, возведенных в степень M.\n"; cout << "Возведение в степень оформить как многократное умножение\n" << endl; int Number, Power, Sum_of_power, power_of_number; mark2: cout << "Введите челое число N>1:\n"; cout << "N = "; cin >> Number; if (Number <= 1) { cout << "По условию N>1.\n"; cout << "Введите N еще раз.\n"; goto mark2; } cout << endl; mark3: cout << "Введите степень чисел М:\n"; cout << "М = "; cin >> Power; cout << endl; if (Power < 1) { cout << "По условию M>=1.\n"; cout << "Введите M еще раз.\n"; goto mark3; } for (Sum_of_power = 0, i = 1; i <= Number; i++) { for (power_of_number = 1, j = 1; j <= Power; j++) { power_of_number = power_of_number*i; } Sum_of_power += power_of_number; } cout << "Сумма чисел возведенных в степень " << Power << " составляет " << Sum_of_power << endl; cout << endl; system("pause"); system("cls"); goto start; break; #pragma endregion #pragma region Task3 case 3: cout.precision(5); double remain_on_end_of_month, Saving, scholarship, expenses, power_end; cout << "\nЗадача №3\n"; cout << "\n3.У студента имеются накопления S тенге. Ежемесячная стипендия составляет А тенге,\n"; cout << "а расходы на проживание превышают ее и составляют B тенге в месяц.\n"; cout << "Рост цен ежемесячно увеличивает расходы на 3%.\n"; cout << "Определить, сколько месяцев сможет прожить студент, используя только накопления и стипендию.\n" << endl; cout << "Введите количество накоплений:\n"; cout << "Накопления ="; cin >> Saving; cout << "Введите размер стипендии:\n"; cout << "Стипендия ="; cin >> scholarship; cout << "Введите размер расходов:\n"; cout << "Расходы ="; cin >> expenses; i = 0; cout << "\nМесяц" << "\t" << "Сбережения" << "\t" << "Расходы" << "\t\t" << "Проценты" << endl; cout << "---------------------------------------------------------------" << endl; while (Saving > 0) { power_end = pow(1.03, i); //проценты на конец текущего месяца remain_on_end_of_month = expenses*power_end - scholarship; //(расходы - степендия) на конец текущего месяца Saving = Saving - remain_on_end_of_month; // остаток сбережений на начало следующего месяца cout << " " << ++i << "\t" << Saving << "\t\t" << remain_on_end_of_month << "\t\t" << power_end << endl; } cout << endl; cout << "Количество месяцев " << --i << endl; system("pause"); system("cls"); goto start; break; #pragma endregion #pragma region Task4 case 4: int Last_numbers, Number_4, first_number, temp_number, sum_of_last_numbers, final_sum; cout << "\nЗадача №4\n\n"; cout << "4.Дано натуральное число n (n<9999) и число m.\n"; cout << "Найти сумму m-последних цифр числа n.\n" << endl; mark4: cout << "Введите число n<9999:\n"; cout << "n="; cin >> Number_4; if (Number_4 >= 9999) { cout << "Число должно быть меньше 9999.\n"; cout << "Введите число еще раз.\n"; goto mark4; } cout << "Введите число m:\n"; cout << "m="; cin >> Last_numbers; first_number = Number_4 % 10;//последнее число, единичный разряд temp_number = Number_4; for (sum_of_last_numbers = 0, i = 1; i < Last_numbers; i++) { temp_number = temp_number / 10; sum_of_last_numbers += temp_number % 10; } final_sum = first_number + sum_of_last_numbers; cout << "Сумма последних " << Last_numbers << " равна " << final_sum << endl; cout << endl; system("pause"); system("cls"); goto start; break; #pragma endregion #pragma region Task5 case 5: int temp_num1, temp_num2, Power_number, remain_num, res; cout << "\nЗадача №5\n"; cout << "5.Натуральное число из n цифр является число Армстронга,\n"; cout << "если сумма его цифр возведенных в n-ую степень равна\n"; cout << "самому числу. Получите все эти числа состоящие из трех\n"; cout << "и четырех цифр (пример 1³ + 5³ + 3³ = 153 ).\n" << endl; Power_number = 0; res = 0; for (i = 100; i <= 9999; i++) { temp_num1 = i; temp_num2 = i; while (temp_num1 != 0) { temp_num1 /= 10; Power_number++; //количество цифр, она же степень числа } while (temp_num2 != 0) { remain_num = temp_num2 % 10; res += pow(remain_num, Power_number);//сумма чисел в степени Power_number temp_num2 /= 10; } if (res == i) { cout << i << endl; } Power_number = 0; // сбрасываем значение res = 0;//сбрасываем значение } cout << endl; system("pause"); system("cls"); goto start; break; #pragma endregion #pragma region Task6 case 6: int remainder, temp_6, remainder_next, High; cout << "\nЗадача №6\n"; cout << "6.Найти все числа кратные семи, и сумма цифр которых также кратна семи\n"; cout << "Введите верхнюю границу N\n"; cout << "N="; cin >> High; for (i = 7; i <= High; i++) { temp_6 = i; if (i % 7 == 0) { remainder = i % 10; while (temp_6 >= 1) { temp_6 = temp_6 / 10; remainder_next = temp_6 % 10; remainder += remainder_next; } if (remainder % 7 == 0) { cout << "i=" << i << "\t" << i / 7 << "\t" << "s=" << remainder << endl; } } } cout << endl; system("pause"); system("cls"); goto start; break; #pragma endregion #pragma region Task7 case 7: int temp_8, remainder_8, celoe, result_8, decimal; cout << "\nЗадача №7\n"; cout << "\n7. Перевести целое число из десятичной системы счисления в \n"; cout << "восьмеричную, используя алгоритм деления на 8.\n"; cout << endl; cout << "Введите десятичное число х:\n"; cout << "х = "; cin >> decimal; temp_8 = decimal; i = 10; result_8 = temp_8 % 8; while (temp_8 >= 8) { temp_8 = temp_8 / 8; remainder_8 = (temp_8 % 8) * i; i *= 10; result_8 += remainder_8; } cout << endl; cout << "Число " << decimal << " в восьмиричной систиеме равно " << result_8 << endl; cout << endl; system("pause"); system("cls"); goto start; break; #pragma endregion #pragma region Default default: mark_def: int z; cout << "\nДля выхода из задания нажмите 0.\n"; cout << "Для продолжения введите 1.\n"; cin >> z; if (z == 0) { goto end; } else if (z == 1) { goto start; } goto mark_def; break; #pragma endregion } } while (number); end: cout << "\nСпасибо!\n"; system("pause"); }
b0535bc4b61cea264217f01c452139f5620bc93c
6ba19ea22e5f960aa8366a466f98af16ec159e17
/server/http.cpp
1dc746304f49d237be50fff54f5f9e3cf38b48f6
[]
no_license
it-is-antonio/mini-project
1ca3fb748afee57b01408402e9a1fe6bdf192727
631a850e582942fc334c25a5cd12ce3ac3cc7180
refs/heads/master
2021-09-21T05:03:09.225881
2018-08-21T06:51:03
2018-08-21T06:51:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,990
cpp
/*! * \project * mini-project * \file * http.cpp * \brief * Implemtation an HTTP server handle a HTTP request then * return the reseponse respectively based on HTTP/1.1 * */ #include <string> #include <string.h> #include <vector> #include "tcp_server.h" #include "http.h" namespace http { int (*app)(const http_request&, http_response&); void error(const char* msg) { std::string tag = "HTTP: ERROR "; tag = tag + msg; perror(tag.c_str()); } int next_line(const std::string& data_in, const int idx, std::string& line) { int ret; if ((ret = data_in.find("\r\n", idx)) == std::string::npos) return -1; line = data_in.substr(idx, ret-idx); return ret+2; } int http_parse(http_request& req, const std::string& data_in) { std::size_t idx = 0, idx_tmp; std::size_t l_idx[3]; l_idx[0] = -1; std::string line, tmp; // request line if ( (idx = next_line(data_in, idx, line)) == -1 ) { return -1; } for (int i = 1; i <= 2; i++) { l_idx[i] = line.find(' ', l_idx[i-1]+1); if (l_idx[i] == std::string::npos) return -1; } tmp = line.substr(0, l_idx[1]); req.url = line.substr(l_idx[1]+1, l_idx[2]-l_idx[1]-1); if (tmp == "GET") req.method = GET; else if (tmp == "POST") req.method = POST; else req.method = UNSUPPORT; // request line - version tmp = line.substr(l_idx[2]+1, line.length()-l_idx[2]-1); if (tmp != "HTTP/1.1") return -1; // headers while (1) { if ((idx = next_line(data_in, idx, line)) == -1) { return -1; } if (line.length() == 0) break; req.headers.push_back({.value = line}); } // body req.body = data_in.substr(idx, data_in.length() - idx); return 0; } /** * \brief A TCP aplication employ a another HTTP application for output * (e.g string_in -> http_req -> app -> http_res -> string_out) * \param data_in * Input data as a string * \param data_out * Output will store in this param * \return int * ERROR(-1) * OK(0) * */ int http_main(const std::string& data_in, std::string& data_out) { // null header http_response error_res; error_res.reason_phrase = "xxx-xxx-xxx"; error_res.headers = std::vector<http_header>(); // parsing http_request req; if (http_parse(req, data_in) == -1) { error("parsing"); error_res.status = "400"; error_res.reason_phrase = "Bad Request"; data_out = str_from_http_response(error_res); return 1; } // get data from app http_response res; if (app(req, res) == -1) { error("app"); error_res.status = "500"; error_res.reason_phrase = "Internal Server Error"; data_out = str_from_http_response(error_res); return 1; } // return http response as a string data_out = str_from_http_response(res); return 0; } /** * \brief This function establish a http server on <port> * \param port * The port server listen on * \param _app * A HTTP application * \return int * ERROR(-1) * OK(0) */ int http_listen(const int port, int (*_app)(const http_request&, http_response&)) { app = _app; if (tcp_server::tcp_listen(port, http_main) == -1) { error("tcp server"); return -1; } return 0; } std::string str_from_http_response(const http_response& res) { // status-line std::string ret = "HTTP/1.1 "; ret = ret + res.status; ret = ret + " "; ret = ret + res.reason_phrase; ret = ret + "\r\n"; // headers for (int i = 0; i < res.headers.size(); i++) { ret += res.headers[i].value; ret += "\r\n"; } // end header ret += "\r\n"; // body ret += res.body; return ret; } }
9071fc97bb6809ddef3f31f4a92fcf914f45df89
e60112ee47d6887f00512e01d2c919495d578335
/h5dataspacecloser.cpp
58e72b75e82a93506eacf214895901bcd13eb46a
[ "MIT" ]
permissive
usgs-coupled/iriclib-test
85ef24ef493d6caf8973405fffe1d2f387606a00
f89e03024788d3ae8d8b751007fe38f341b9196f
refs/heads/develop_v4
2023-08-14T19:20:20.815199
2021-09-14T21:22:35
2021-09-14T21:22:35
406,461,481
0
1
MIT
2021-09-14T21:22:00
2021-09-14T17:25:28
C++
UTF-8
C++
false
false
462
cpp
#include "h5dataspacecloser.h" #include "internal/iric_logger.h" using namespace iRICLib; H5DataSpaceCloser::H5DataSpaceCloser(hid_t dataSpaceId) : m_dataSpaceId {dataSpaceId} {} H5DataSpaceCloser::~H5DataSpaceCloser() { _IRIC_LOGGER_TRACE_CALL_START("H5Sclose"); herr_t status = H5Sclose(m_dataSpaceId); _IRIC_LOGGER_TRACE_CALL_END("H5Sclose"); if (status < 0) { _iric_logger_error("H5DataSpaceCloser::~H5DataSpaceCloser", "H5Sclose", status); } }
576e09814fa51ebd417d3dfab6ad17a6bc26cb29
2c62385f15b1f8e6072138d5175d7a70dd236b98
/blaze/math/traits/TSVecRealExprTrait.h
01e9a051c40462ff3b389751c1b60082c048dad3
[ "BSD-3-Clause" ]
permissive
lyxm/blaze
665e4c6f6e1a717973d2d98e148c720030843266
10dbaa368790316b5e044cfe9b92f5534f60a2dc
refs/heads/master
2021-01-12T20:31:45.197297
2015-10-15T21:39:17
2015-10-15T21:39:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,771
h
//================================================================================================= /*! // \file blaze/math/traits/TSVecRealExprTrait.h // \brief Header file for the TSVecRealExprTrait class template // // Copyright (C) 2013 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group nor the names of its contributors // may be used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. */ //================================================================================================= #ifndef _BLAZE_MATH_TRAITS_TSVECREALEXPRTRAIT_H_ #define _BLAZE_MATH_TRAITS_TSVECREALEXPRTRAIT_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/math/expressions/Forward.h> #include <blaze/math/typetraits/IsRowVector.h> #include <blaze/math/typetraits/IsSparseVector.h> #include <blaze/util/InvalidType.h> #include <blaze/util/mpl/And.h> #include <blaze/util/mpl/If.h> #include <blaze/util/mpl/Or.h> #include <blaze/util/typetraits/IsConst.h> #include <blaze/util/typetraits/IsReference.h> #include <blaze/util/typetraits/IsVolatile.h> #include <blaze/util/typetraits/RemoveCV.h> #include <blaze/util/typetraits/RemoveReference.h> namespace blaze { //================================================================================================= // // CLASS DEFINITION // //================================================================================================= //************************************************************************************************* /*!\brief Evaluation of the expression type of a sparse vector real part operation. // \ingroup math_traits // // Via this type trait it is possible to evaluate the resulting expression type of a sparse // vector real part operation. Given the transpose sparse vector type \a VT, the nested type // \a Type corresponds to the resulting expression type. In case \a VT is not a transpose // sparse vector type, the resulting \a Type is set to \a INVALID_TYPE. */ template< typename VT > // Type of the sparse vector struct TSVecRealExprTrait { private: //********************************************************************************************** /*! \cond BLAZE_INTERNAL */ typedef If< And< IsSparseVector<VT>, IsRowVector<VT> > , SVecRealExpr<VT,true>, INVALID_TYPE > Tmp; typedef typename RemoveReference< typename RemoveCV<VT>::Type >::Type Type1; /*! \endcond */ //********************************************************************************************** public: //********************************************************************************************** /*! \cond BLAZE_INTERNAL */ typedef typename If< Or< IsConst<VT>, IsVolatile<VT>, IsReference<VT> > , TSVecRealExprTrait<Type1>, Tmp >::Type::Type Type; /*! \endcond */ //********************************************************************************************** }; //************************************************************************************************* } // namespace blaze #endif
92f68c60ff1e0f08fbeab16ce318568a4fdf769e
84f2b24c65a4c6109dbaceaaab8da7078951cd8d
/Hashing/FindMissingInSecondArray.cpp
870a97d6e9e4c932080bc0d7193db24d97ea38b6
[]
no_license
devedu-AI/Competitive-Coding-for-Interviews
4e6c2fb5784ef994625685d1578e617eb94b62fd
5ac81e3fc221dc8d6c3f4b12d7c57a5ae989427c
refs/heads/master
2023-06-28T01:55:33.072689
2021-07-11T17:42:12
2021-07-11T17:42:12
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,030
cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution{ public: vector<long long> findMissing(long long A[], long long B[], int N, int M) { // Your code goes here vector<long long> v; set<long long>s; for(int i = 0 ; i < M ; i++) s.insert(B[i]); for(int i = 0 ; i < N ; i++) { if(s.find(A[i]) == s.end()) v.push_back(A[i]); } return v; } }; // { Driver Code Starts. int main() { int t; cin >> t; while (t--) { int n; cin>>n; int m; cin>>m; long long a[n]; long long b[m]; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<m;i++) cin >> b[i]; vector<long long> ans; Solution ob; ans=ob.findMissing(a,b,n,m); for(int i=0;i<ans.size();i++) cout<<ans[i]<<" "; cout << "\n"; } return 0; } // } Driver Code Ends
45ec3acdca04254b85c3dcfa1ca61589a80501f3
71f2e8724b9cf41df0a5ee452656ff1b8ea68fbd
/src/Ast/ImportStmt.h
4f207849a5ed4e0752d92184b1776c5219638960
[ "MIT" ]
permissive
sunverwerth/strela
4af6033fc372e5bce97176cee75c1a9004ac10d3
e2aa305bd695deaec3bc0f1e32394af033ee0fdf
refs/heads/master
2021-03-30T20:34:01.421419
2020-08-25T19:04:57
2020-08-25T19:04:57
124,811,865
20
1
null
null
null
null
UTF-8
C++
false
false
1,233
h
// Copyright (c) 2018 Stephan Unverwerth // This code is licensed under MIT license (See LICENSE for details) #ifndef Strela_Ast_AstImportStmt_h #define Strela_Ast_AstImportStmt_h #include "Node.h" #include <string> #include <vector> namespace Strela { class ModDecl; class ImportStmt: public Node { public: STRELA_GET_TYPE(Strela::ImportStmt, Strela::Node); std::string getFullName(const char* separator = ".") { std::string result; for (size_t i = 0; i < parts.size(); ++i) { result += parts[i]; if (i < parts.size() - 1) { result += separator; } } return result; } std::string getBaseName(const char* separator = ".") { std::string result; for (size_t i = 0; i < parts.size() - 1; ++i) { result += parts[i]; if (i < parts.size() - 2) { result += separator; } } return result; } public: std::vector<std::string> parts; bool all; bool importModule = false; ModDecl* module = nullptr; }; } #endif
9e753a047ead77784f41525b8d5df3ca67f9549b
0a1be59f55b359866370c2815671af22bd96ff51
/dependencies/skse64/src/skse64/CommonLibSSE/include/RE/BGSLightingTemplate.h
75f44c15f494dfe65300a4e4bb9aaf61c375a998
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
joelday/papyrus-debug-server
ba18b18d313a414daefdf0d3472b60a12ca21385
f5c3878cd485ba68aaadf39bb830ca88bf53bfff
refs/heads/master
2023-01-12T14:34:52.919190
2019-12-06T18:41:39
2019-12-06T18:41:39
189,772,905
15
10
MIT
2022-12-27T11:31:04
2019-06-01T20:02:31
C++
UTF-8
C++
false
false
1,798
h
#pragma once #include "skse64/GameRTTI.h" // RTTI_BGSLightingTemplate #include "RE/Color.h" // Color #include "RE/DirectionalAmbientLightingColor.h" // DirectionalAmbientLightingColor #include "RE/FormTypes.h" // FormType #include "RE/TESForm.h" // TESForm namespace RE { class BGSLightingTemplate : public TESForm { public: inline static const void* RTTI = RTTI_BGSLightingTemplate; enum { kTypeID = FormType::LightingMaster }; struct RecordFlags { enum RecordFlag : UInt32 { kDeleted = 1 << 5, kIgnored = 1 << 12 }; }; struct Lighting // DATA { struct LightFadeDistances { float start; // 0 float end; // 4 }; STATIC_ASSERT(sizeof(LightFadeDistances) == 0x8); Color ambientColor; // 00 Color dierectionalColor; // 04 Color fogColorNear; // 08 float fogNear; // 0C float fogFar; // 10 UInt32 directionalRotationXY; // 14 UInt32 directionalRotationZ; // 18 float directionalFade; // 1C float fogClipDistance; // 20 float fogPower; // 24 DirectionalAmbientLightingColor ambientColors; // 28 Color fogColorFar; // 48 float fogMax; // 4C LightFadeDistances lightFadeDistances; // 50 }; STATIC_ASSERT(sizeof(Lighting) == 0x58); virtual ~BGSLightingTemplate(); // 00 // override (TESForm) virtual void InitDefaults() override; // 04 virtual bool LoadForm(TESFile* a_mod) override; // 06 virtual void InitItem() override; // 13 // members Lighting lighting; // 20 - DATA UInt64 unk78; // 78 DirectionalAmbientLightingColor directionalAmbientLightingColors; // 80 - DALC }; STATIC_ASSERT(sizeof(BGSLightingTemplate) == 0xA0); }
fe6ee11c62de852272c44ff41f7a02724a9919f1
7f11317085d407d10b0e55c4b31bc81333a07eaa
/Codeforces/1220/A.cpp
0cac1b252bc5e57d5318084a62bced01cca6f609
[]
no_license
ericbrandwein/competencias
14116a1bc76e70a55ebebdc946679cd92cb8a3db
bf22b874646586ae7de573991fa932a2fa90e2c9
refs/heads/master
2023-05-03T09:51:26.100257
2021-05-30T16:18:08
2021-05-30T16:18:08
371,562,451
0
0
null
null
null
null
UTF-8
C++
false
false
1,032
cpp
//#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops,no-stack-protector") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define endl '\n' #define elif else if #define ll long long int #define ld long double #define vec vector #define forn(a) for(ll a=0; a<n; a++) #define fore(a, v, n) for(ll a=v; a<n; a++) #define all(x) x.begin(), x.end() #define presicion(x) cout<<fixed<<setprecision(x) #define dbg(x) cerr<<#x<<" = "<<x<<endl #define PI 3.14159265358979323 #define sen(ang) sin((ang)*PI/180) //cout<<flush; using namespace std; int main() { IOS; ll n; cin >> n; string chars; cin >> chars; ll ens = 0; forn (i) { if (chars[i] == 'n') { ens++; } } ll i = 0; for (; i < ens; i++) { cout << 1; if (i < n / 3 - 1) { cout << " "; } } n -= i * 3; fore (j, 0, n / 4) { cout << 0; if (j < n / 4 - 1) { cout << " "; } } cout << endl; return 0; }
6d5d0402b7bc53a34de5e53b0db0152b55e16eac
4eb1561d1c47bfce5bbdfd10f979c3d386f15e33
/hipacc_kernels/point/sub_saturate_s16_u8_u8.hpp
9260cc543fe9d0863512a47d4769758470873429
[ "MIT" ]
permissive
HipaccVX/HipaccVX
aa33cbc5b95457cb0cdd479ac02c8b43f75272c9
0d469748df11c95f916b5a70f0006878f8550e3c
refs/heads/master
2023-03-27T08:55:50.315291
2021-03-31T09:18:32
2021-03-31T09:18:32
353,156,373
3
0
null
null
null
null
UTF-8
C++
false
false
617
hpp
class Sub_Saturate_s16_u8_u8 : public Kernel<short> { private: Accessor<unsigned char> &input1; Accessor<unsigned char> &input2; public: Sub_Saturate_s16_u8_u8(IterationSpace<short> &iter, Accessor<unsigned char> &input1, Accessor<unsigned char> &input2) : Kernel(iter), input1(input1), input2(input2){ add_accessor(&input1); add_accessor(&input2); } void kernel() { int out = input1() - input2(); if (out > 32767) // max s16 out = 32767; else if (out < -32767) // min s16 out = -32767; output() = out; } };
d49e5f2e721d3ba7a85c7fa06ca18cdc62129fc4
aad625e6da08beca00437d37751fd24c77089f71
/GariKro GUI/driver2.h
03b307ccddcd2d9bec95a06ac0d399a4b99ec99e
[]
no_license
ahsannaqvii/Car-Rental-System-OOP
7085c67aa7d3b960ab0c4efc2e5af99e507f5c07
62753d2dbfce4e1ac27156db4e4702b583011e18
refs/heads/master
2022-10-04T00:15:52.569406
2020-06-12T20:04:21
2020-06-12T20:04:21
255,639,293
0
0
null
null
null
null
UTF-8
C++
false
false
320
h
#ifndef DRIVER2_H #define DRIVER2_H #include <QDialog> namespace Ui { class Driver2; } class Driver2 : public QDialog { Q_OBJECT public: explicit Driver2(QWidget *parent = nullptr); ~Driver2(); public slots: void on_pushButton_Login_clicked(); private: Ui::Driver2 *ui; }; #endif // DRIVER2_H
43e1660b457ec9c077823d16d39be38f31613692
7d298127f6c9f638420d80f01bbc3635f632b602
/tests/3rdparty/testngpp/include/testngpp/runner/TestCaseSandbox.h
10a37ee6e99c986dc4745a6c8cafbda6f9e18b0f
[ "Apache-2.0", "LGPL-3.0-only", "GPL-3.0-or-later" ]
permissive
sinojelly/mockcpp
1bbdbee7623fa51972e1f94815ffa93ef770e112
7b7eb8b8a7837813d91ee1ae9354f352605fc270
refs/heads/master
2023-09-03T04:04:32.174336
2022-11-08T07:15:41
2022-11-08T07:15:41
33,052,375
69
42
Apache-2.0
2023-08-25T08:25:18
2015-03-28T22:17:23
C++
UTF-8
C++
false
false
1,030
h
#ifndef __TESTNGPP_TESTCASE_SANDBOX_H #define __TESTNGPP_TESTCASE_SANDBOX_H #include <testngpp/testngpp.h> #include <testngpp/internal/Error.h> #include <testngpp/runner/SandboxTypedef.h> #include <testngpp/runner/EOFError.h> TESTNGPP_NS_START struct TestCaseInfoReader; struct EnvironmentCleaner; struct TestCase; struct TestCaseRunner; struct TestCaseResultCollector; struct TestCaseSandboxImpl; struct TestCaseSandbox { SandboxId getSandboxId() const; ChannelId getChannelId() const; void handle() TESTNGPP_THROW(Error, EOFError); const TestCase* getTestCase() const; bool hasSucceeded() const; bool isDead() const; void cleanup(); ~TestCaseSandbox(); public: static TestCaseSandbox* createInstance ( EnvironmentCleaner* cleaner , const TestCase* testcase , TestCaseRunner* runner , TestCaseResultCollector* collector , bool shouldReport); private: TestCaseSandbox(); private: TestCaseSandboxImpl* This; }; TESTNGPP_NS_END #endif
[ "darwin.yuan@9e0d7ab1-db4c-0410-84d4-f5e70a360cb6" ]
darwin.yuan@9e0d7ab1-db4c-0410-84d4-f5e70a360cb6
c6942446e2f135b040d53b19e5e4b00da04c9c61
ad273708d98b1f73b3855cc4317bca2e56456d15
/aws-cpp-sdk-networkmanager/include/aws/networkmanager/model/LinkAssociation.h
e84233a38fa8cbcb3351ef3df4fc7f8f1a672dac
[ "MIT", "Apache-2.0", "JSON" ]
permissive
novaquark/aws-sdk-cpp
b390f2e29f86f629f9efcf41c4990169b91f4f47
a0969508545bec9ae2864c9e1e2bb9aff109f90c
refs/heads/master
2022-08-28T18:28:12.742810
2020-05-27T15:46:18
2020-05-27T15:46:18
267,351,721
1
0
Apache-2.0
2020-05-27T15:08:16
2020-05-27T15:08:15
null
UTF-8
C++
false
false
6,893
h
/* * Copyright 2010-2017 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/networkmanager/NetworkManager_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/networkmanager/model/LinkAssociationState.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace NetworkManager { namespace Model { /** * <p>Describes the association between a device and a link.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/networkmanager-2019-07-05/LinkAssociation">AWS * API Reference</a></p> */ class AWS_NETWORKMANAGER_API LinkAssociation { public: LinkAssociation(); LinkAssociation(Aws::Utils::Json::JsonView jsonValue); LinkAssociation& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The ID of the global network.</p> */ inline const Aws::String& GetGlobalNetworkId() const{ return m_globalNetworkId; } /** * <p>The ID of the global network.</p> */ inline bool GlobalNetworkIdHasBeenSet() const { return m_globalNetworkIdHasBeenSet; } /** * <p>The ID of the global network.</p> */ inline void SetGlobalNetworkId(const Aws::String& value) { m_globalNetworkIdHasBeenSet = true; m_globalNetworkId = value; } /** * <p>The ID of the global network.</p> */ inline void SetGlobalNetworkId(Aws::String&& value) { m_globalNetworkIdHasBeenSet = true; m_globalNetworkId = std::move(value); } /** * <p>The ID of the global network.</p> */ inline void SetGlobalNetworkId(const char* value) { m_globalNetworkIdHasBeenSet = true; m_globalNetworkId.assign(value); } /** * <p>The ID of the global network.</p> */ inline LinkAssociation& WithGlobalNetworkId(const Aws::String& value) { SetGlobalNetworkId(value); return *this;} /** * <p>The ID of the global network.</p> */ inline LinkAssociation& WithGlobalNetworkId(Aws::String&& value) { SetGlobalNetworkId(std::move(value)); return *this;} /** * <p>The ID of the global network.</p> */ inline LinkAssociation& WithGlobalNetworkId(const char* value) { SetGlobalNetworkId(value); return *this;} /** * <p>The device ID for the link association.</p> */ inline const Aws::String& GetDeviceId() const{ return m_deviceId; } /** * <p>The device ID for the link association.</p> */ inline bool DeviceIdHasBeenSet() const { return m_deviceIdHasBeenSet; } /** * <p>The device ID for the link association.</p> */ inline void SetDeviceId(const Aws::String& value) { m_deviceIdHasBeenSet = true; m_deviceId = value; } /** * <p>The device ID for the link association.</p> */ inline void SetDeviceId(Aws::String&& value) { m_deviceIdHasBeenSet = true; m_deviceId = std::move(value); } /** * <p>The device ID for the link association.</p> */ inline void SetDeviceId(const char* value) { m_deviceIdHasBeenSet = true; m_deviceId.assign(value); } /** * <p>The device ID for the link association.</p> */ inline LinkAssociation& WithDeviceId(const Aws::String& value) { SetDeviceId(value); return *this;} /** * <p>The device ID for the link association.</p> */ inline LinkAssociation& WithDeviceId(Aws::String&& value) { SetDeviceId(std::move(value)); return *this;} /** * <p>The device ID for the link association.</p> */ inline LinkAssociation& WithDeviceId(const char* value) { SetDeviceId(value); return *this;} /** * <p>The ID of the link.</p> */ inline const Aws::String& GetLinkId() const{ return m_linkId; } /** * <p>The ID of the link.</p> */ inline bool LinkIdHasBeenSet() const { return m_linkIdHasBeenSet; } /** * <p>The ID of the link.</p> */ inline void SetLinkId(const Aws::String& value) { m_linkIdHasBeenSet = true; m_linkId = value; } /** * <p>The ID of the link.</p> */ inline void SetLinkId(Aws::String&& value) { m_linkIdHasBeenSet = true; m_linkId = std::move(value); } /** * <p>The ID of the link.</p> */ inline void SetLinkId(const char* value) { m_linkIdHasBeenSet = true; m_linkId.assign(value); } /** * <p>The ID of the link.</p> */ inline LinkAssociation& WithLinkId(const Aws::String& value) { SetLinkId(value); return *this;} /** * <p>The ID of the link.</p> */ inline LinkAssociation& WithLinkId(Aws::String&& value) { SetLinkId(std::move(value)); return *this;} /** * <p>The ID of the link.</p> */ inline LinkAssociation& WithLinkId(const char* value) { SetLinkId(value); return *this;} /** * <p>The state of the association.</p> */ inline const LinkAssociationState& GetLinkAssociationState() const{ return m_linkAssociationState; } /** * <p>The state of the association.</p> */ inline bool LinkAssociationStateHasBeenSet() const { return m_linkAssociationStateHasBeenSet; } /** * <p>The state of the association.</p> */ inline void SetLinkAssociationState(const LinkAssociationState& value) { m_linkAssociationStateHasBeenSet = true; m_linkAssociationState = value; } /** * <p>The state of the association.</p> */ inline void SetLinkAssociationState(LinkAssociationState&& value) { m_linkAssociationStateHasBeenSet = true; m_linkAssociationState = std::move(value); } /** * <p>The state of the association.</p> */ inline LinkAssociation& WithLinkAssociationState(const LinkAssociationState& value) { SetLinkAssociationState(value); return *this;} /** * <p>The state of the association.</p> */ inline LinkAssociation& WithLinkAssociationState(LinkAssociationState&& value) { SetLinkAssociationState(std::move(value)); return *this;} private: Aws::String m_globalNetworkId; bool m_globalNetworkIdHasBeenSet; Aws::String m_deviceId; bool m_deviceIdHasBeenSet; Aws::String m_linkId; bool m_linkIdHasBeenSet; LinkAssociationState m_linkAssociationState; bool m_linkAssociationStateHasBeenSet; }; } // namespace Model } // namespace NetworkManager } // namespace Aws
87f242837301d22effbd8bdbaa443277746a98f2
10c2ec47c85c53d4618611ced929cc20881b2369
/质数探测.cpp
b40791c1c21cff8585fea8da830e5d488e327135
[]
no_license
butwedo/OI-code
51c9d763120b6f977387734ca2cf54d037d915ed
5727a35137108cf9224af7671994e7e2f41d3610
refs/heads/master
2021-06-24T11:40:46.973128
2017-09-11T06:37:55
2017-09-11T06:37:55
103,098,919
0
0
null
null
null
null
UTF-8
C++
false
false
935
cpp
#include<iostream> using namespace std; #define in long long in pri[]={2,3,5,7,13,17,19,23,29,31}; in cas=10; in mul(in a,in b,in c) { a%=c; b%=c; in ans=0; while(b) { if(b&1)ans=(ans+a)%c; a=(a+a)%c; b>>=1; } return ans; } in doul(in a,in b,in c) { a%=c; in ans=1; while(b) { if(b&1)ans=mul(ans,a,c); a=mul(a,a,c); b>>=1; } return ans; } bool millerr(in a) { for(in i=0;i<cas;i++) { if(pri[i]==a)return true; in b=a-1; while(~b&1)b>>=1; in rr=doul(pri[i],b,a); in kk; if(rr==1)continue; if(b==a-1)return false; for(;;) { kk=rr; rr=doul(rr,rr,a); if(rr==a-1)break; if(rr==1) { if(kk!=a-1)return false; break; } b<<=1; if(b==a-1)return false; } } return true; } int main() { in n; cin>>n; while(n) { if(millerr(n))cout<<"true"<<endl; else cout<<"false"<<endl; cin>>n; } }
985f6e1fe49677134aa4dc85a1981837ee28a43f
8f50c262f89d3dc4f15f2f67eb76e686b8f808f5
/Reconstruction/MissingETPerformance/MissingETPerformance/Zboson.h
0e623d71321ae52f05f8faf82a6df36ed2f5dc65
[ "Apache-2.0" ]
permissive
strigazi/athena
2d099e6aab4a94ab8b636ae681736da4e13ac5c9
354f92551294f7be678aebcd7b9d67d2c4448176
refs/heads/master
2022-12-09T02:05:30.632208
2020-09-03T14:03:18
2020-09-03T14:03:18
292,587,480
0
1
null
null
null
null
UTF-8
C++
false
false
1,410
h
/* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ #ifndef Z_BOSON_H #define Z_BOSON_H #include <TLorentzVector.h> #include <TVector2.h> #include <math.h> class Zboson { private: TLorentzVector m_Z; TLorentzVector m_daughter1; TLorentzVector m_daughter2; public: Zboson() {;} Zboson(TLorentzVector a, TLorentzVector b); double mass() {return m_Z.M();} double Px() {return m_Z.Px();} double Py() {return m_Z.Py();} double Pt() {return m_Z.Pt();} double Phi() {return m_Z.Phi();} double Eta() {return m_Z.Eta();} double SignedDeltaPhi() {return m_daughter1.DeltaPhi(m_daughter2);} double DeltaPhi() {return fabs(m_daughter1.DeltaPhi(m_daughter2));} const TLorentzVector &get_daughter1() {return m_daughter1;} const TLorentzVector &get_daughter2() {return m_daughter2;} TVector2 GetVec(); TVector2 GetPerpendicular(); TVector2 GetParallel(); TVector2 GetThrust(); TVector2 GetAntiThrust(); TVector2 GetPtAxis(); TVector2 GetAntiPtAxis(); TVector2 GetAL(); TVector2 GetAxis(); TVector2 GetAntiAxis(); double Res_Axis(); double Res_AntiAxis(); double Res_Perp(TVector2 object); double Res_Par(TVector2 object); double Res_AL(TVector2 object); //double GetHadronicRecoil(); double GetZbosonPt(); double GetZbosonPerp(); double GetZbosonPar(); double GetDiLeptonPerp(); double GetDiLeptonPar(); }; #endif
d65611eb56fc56c947e393835976004e056e651b
be52651d9276e6c9079e99a2f04c74220bcb242a
/TT03/stable.cpp
c4032b8c87d0f8ad40990847236e6da56080a36a
[]
no_license
Baileyswu/NEXT
9097f7e99d2c80faf285a20fb48a05d437aed49e
3a4d885b2b4dbe04214fbb261d671377889e8e46
refs/heads/master
2023-03-22T10:54:22.645951
2021-03-21T12:16:57
2021-03-21T12:16:57
277,059,853
6
1
null
null
null
null
UTF-8
C++
false
false
1,476
cpp
#include<bits/stdc++.h> using namespace std; #define LL long long const int N = 26; unordered_set<int> dependOn[N]; unordered_set<int> base[N]; string ans; bool used[N]; void dfs(int id) { ans += id + 'A'; used[id] = false; for(auto b : base[id]) { dependOn[b].erase(id); if(used[b] && dependOn[b].size() == 0) dfs(b); } } void init() { for(int i = 0;i < N;i++) { dependOn[i].clear(); base[i].clear(); } memset(used, false, sizeof(used)); ans = ""; } int main() { int T, o = 0; cin >> T; while(T--) { init(); int n, m, count = 0; cin >> n >> m; char s[35][35]; for(int i = 0;i < n;i++) cin >> s[i]; for(int i = 0;i < n-1;i++) for(int j = 0;j < m;j++) if(s[i][j] != s[i+1][j]) { int u = s[i][j]-'A', v = s[i+1][j]-'A'; dependOn[u].insert(v); base[v].insert(u); used[u] = true; used[v] = true; } for(int j = 0;j < m;j++) used[s[n-1][j]-'A'] = true; for(int i = 0;i < N;i++) if(used[i]) count++; for(int i = 0;i < N;i++) if(used[i] && dependOn[i].size() == 0) dfs(i); printf("Case #%d: ", ++o); if(ans.length() != count) cout << "-1\n"; else cout << ans << endl; } return 0; }
420a5615f47a9ae770a2906474da93729db53319
7f6a7dd571d990e5bc95e0a3af7a06458e2b519b
/calendar-project.cpp
bbb154981a9eaebc7f55dee6b97db6f22962d379
[]
no_license
erikfenriz/calendar
f6aa99c20df380ebc58d8e39ce5781c7b9ca86fe
75af927fc723f5d42f910390f8579c084768c418
refs/heads/master
2020-04-04T12:23:41.111931
2018-11-16T21:20:23
2018-11-16T21:20:23
155,924,906
0
0
null
null
null
null
UTF-8
C++
false
false
7,025
cpp
#include <iostream> #include <iomanip> using namespace std; int getMonth(); int getYear(); bool isLeapYear(int year); int monthCount(int month, int year); int yearCount(int year); int getOffset(int month, int year); int getDaysInMonth(int month, int year); void displayYear(int year); void displayMonth(int month); void displayTable(int offset, int numDays); /********************************************************************** * This function is an entry point of the program ***********************************************************************/ int main() { int month = getMonth(); int year = getYear(); int daysInMonth = getDaysInMonth(month, year); displayMonth(month); displayYear(year); displayTable(getOffset(month, year), daysInMonth); return 0; } /********************************************************************** * This function prompts a user for a month ***********************************************************************/ int getMonth() { int month; while (month < 1 || month > 12) { cout << "Enter a month number: "; cin >> month; if (month < 1 || month > 12) cout << "Month must be between 1 and 12.\n"; } return month; } /********************************************************************** * This function prompts a user for a year. ***********************************************************************/ int getYear() { int year; while (year < 1753) { cout << "Enter year: "; cin >> year; if (year < 1753) cout << "Year must be 1753 or later.\n"; } cout << endl; return year; } /********************************************************************** * Get the amount of days in a particular month. ***********************************************************************/ int monthCount(int month, int year) { int daysInMonth = 0; for (int initialMonth = 1; initialMonth < month; initialMonth++) { if (initialMonth == 1 || initialMonth == 3 || initialMonth == 5 || initialMonth == 7 || initialMonth == 8 || initialMonth == 10 || initialMonth == 12) daysInMonth += 31; else if (initialMonth == 4 || initialMonth == 6 || initialMonth == 9 || initialMonth == 11) daysInMonth += 30; else if (initialMonth == 2 && !isLeapYear(year)) daysInMonth += 28; else daysInMonth += 29; } return daysInMonth; } /********************************************************************** * This function gets the total number of days from 1753 to a selected year. ***********************************************************************/ int yearCount(int year) { int yearDays = 0; for (int previousYear = 1753; previousYear < year; previousYear++) { if (!isLeapYear(previousYear)) yearDays += 365; if (isLeapYear(previousYear)) yearDays += 366; } return yearDays; } /********************************************************************** * This function gets the offset - spacing to visualize on which day of * the week month starts. ***********************************************************************/ int getOffset(int month, int year) { int yearDays = yearCount(year); int monthDays = monthCount(month, year); int offset = (yearDays + monthDays) % 7; return offset; } /********************************************************************** * This function gets the exact number of days for a selected month. ***********************************************************************/ int getDaysInMonth(int month, int year) { int daysInMonth; if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) daysInMonth = 31; else if (month == 4 || month == 6 || month == 9 || month == 11) daysInMonth = 30; else if (month == 2 && !isLeapYear(year)) daysInMonth = 28; else daysInMonth = 29; return daysInMonth; } /********************************************************************** * This function displays a calendar data. ***********************************************************************/ void displayTable(int offsetting, int daysInMonth) { cout << " Su Mo Tu We Th Fr Sa\n"; int day; if (offsetting == 0) { day = 2; cout << setw(6); } else if (offsetting == 1) { day = 3; cout << setw(10); } else if (offsetting == 2) { day = 4; cout << setw(14); } else if (offsetting == 3) { day = 5; cout << setw(18); } else if (offsetting == 4) { day = 6; cout << setw(22); } else if (offsetting == 5) { day = 7; cout << setw(26); } else if (offsetting == 6) { day = 1; cout << setw(2); } else ; for (int weeksDay = 1; weeksDay <= daysInMonth; weeksDay++) { cout << " " << setw(2) << weeksDay; day++; if (day == 8) { cout << endl; day = 1; } } if (day >= 2 && day <= 8) cout << endl; return; } /********************************************************************** * This function displays a year. ***********************************************************************/ void displayYear(int year) { cout << ", " << year << endl; } /********************************************************************** * Convert a month's number into a month string and display it. ***********************************************************************/ void displayMonth(int month) { switch (month) { case 1 : cout << "January"; break; case 2 : cout << "February"; break; case 3 : cout << "March"; break; case 4 : cout << "April"; break; case 5 : cout << "May"; break; case 6 : cout << "June"; break; case 7 : cout << "July"; break; case 8 : cout << "August"; break; case 9 : cout << "September"; break; case 10 : cout << "October"; break; case 11 : cout << "November"; break; case 12 : cout << "December"; break; } } /********************************************************************** * This function checks if a current year is a leap year. ***********************************************************************/ bool isLeapYear(int year) { return bool (year % 4 == 0 && year % 100 != 0 || year % 400 == 0); }
72e47402e87b5bdfd92f7f5b780d203a125ac6c6
a18cbc6fe42a35d227e858ee44568999c3593e81
/Projet/jour5/test/Element/BriqueTest.cpp
a1b1a2f4d16b7dbe6a3db5c97969336e230f6f4f
[]
no_license
jpsanche/casse_briques
2881916ce204868a3e5cc7b57030fb27d5cc091f
36f4612bda7cdfa907aee4e6f8defb53d86ce87e
refs/heads/master
2021-01-12T10:44:50.134416
2016-03-14T08:26:28
2016-03-14T08:26:28
72,665,441
0
0
null
null
null
null
UTF-8
C++
false
false
1,399
cpp
#include <Element/BriqueTest.h> #include <Element/Brique.h> #include <Interface/Obstacle.h> using namespace cassebrique; // Registers the fixture into the 'registry' CPPUNIT_TEST_SUITE_REGISTRATION( BriqueTest ); void BriqueTest::setUp() { } void BriqueTest::tearDown() { } void BriqueTest::testConstructor() { Vecteur<int> v(0, 0); Brique b(Vecteur<int>(1,2), Couleur::BLANC); CPPUNIT_ASSERT(b.recupererPosition() == Vecteur<int>(1,2)); } void BriqueTest::testCollision() { /* test de la fonction virtuelle collision */ Brique normale(Vecteur<int>(2,2), Couleur::BLANC); BriqueIncassable incassable(Vecteur<int>(4,4)); Brique brique_incassable = incassable; /* copie non polymorphe */ Brique &ref_incassable = incassable; /* copie polymorphique (grace à la référence) */ /* les collisions avec une brique normale la détruise*/ CPPUNIT_ASSERT(normale.collision() == ObstacleResultat::DETRUIT); /* les collisions avec une brique incassable ne la détruise pas */ CPPUNIT_ASSERT(incassable.collision() == ObstacleResultat::INTACT); CPPUNIT_ASSERT(ref_incassable.collision() == ObstacleResultat::INTACT); /* le résultat n'est pas celui que l'on attend : il est obligatoire d'utiliser * des références pour la résolution dynamique de la fonction virtuelle */ CPPUNIT_ASSERT(brique_incassable.collision() == ObstacleResultat::DETRUIT); }
fe7b87b299631e6bea82dfb51f10785f014450ac
fe2836176ca940977734312801f647c12e32a297
/AtCoder/Beginner/071/b.cpp
72d9a0b14ab708379a58e2e2e892cfa011e6d236
[]
no_license
henrybear327/Sandbox
ef26d96bc5cbcdc1ce04bf507e19212ca3ceb064
d77627dd713035ab89c755a515da95ecb1b1121b
refs/heads/master
2022-12-25T16:11:03.363028
2022-12-10T21:08:41
2022-12-10T21:08:41
53,817,848
2
0
null
null
null
null
UTF-8
C++
false
false
378
cpp
#include <bits/stdc++.h> using namespace std; int main() { char inp[111111]; scanf("%s", inp); int cnt[26] = {0}; int len = strlen(inp); for(int i = 0; i < len; i++) cnt[inp[i] - 'a']++; int pos = -1; for(int i = 0; i < 26; i++) if(cnt[i] == 0) { pos = i; break; } if(pos == -1) printf("None\n"); else printf("%c\n", pos + 'a'); return 0; }
3fadfb33f8c4d9b6642279781b58fb79641bf950
83bcb9a98fbc24532470978b8b2c9337a8682b49
/leetcode/neetcode/141.cpp
8744d31da9b4547f71919358d0d33f0dfbe2d292
[]
no_license
khanhtc1202/cp
91c4f64704786c78f156bc14fe6c1fc57dedd4d3
98e9fe5c8090483b6509213e823c8411324b0cf6
refs/heads/master
2023-08-17T05:42:27.383376
2023-08-16T13:35:42
2023-08-16T13:35:42
131,381,241
0
0
null
2023-07-06T21:31:49
2018-04-28T06:43:25
C++
UTF-8
C++
false
false
528
cpp
#include <bits/stdc++.h> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: bool hasCycle(ListNode* head) { if (!head) return false; ListNode *slow = head; ListNode *fast = head->next; while (slow != fast) { if (!fast || !fast->next) return false; slow = slow->next; fast = fast->next->next; } return true; } };
72e529303178723e883ae6a9a02d5315f2ed152e
a341ba115d70e2e4bf483129098f729d263636ec
/spoj/julka.cpp
584740f35687f409085679d01fc34a274d30c2f9
[]
no_license
mrfinch/competitive_programming
e2d29258ade2e9bf5cf52f9dbda22085f7942b37
ee6ba76792bd06a9b6bf58f72f0fbac5c6ee9ee2
refs/heads/master
2021-01-16T20:42:21.697361
2020-03-31T09:10:20
2020-03-31T09:10:20
23,836,977
0
0
null
null
null
null
UTF-8
C++
false
false
3,541
cpp
#include <iostream> #include <vector> #include <string> using namespace std; int main(){ int t=10; while(t){ string n,m; cin >> n; cin >> m; int x=max(n.size(),m.size()); vector<int> a1(n.size(),0); vector<int> a2(m.size(),0); vector<int> sum(x,0); vector<int> diff(x,0); for(int i=0;i<n.size();i++){ a1[i]=n[i]-'0'; } for(int i=0;i<m.size();i++){ a2[i]=m[i]-'0'; } int i=n.size()-1; int j=m.size()-1; int in=x-1; int carry=0; while(i>=0 && j>=0){ if(i==0 && j==0){ sum[in]=(a1[i]+a2[j]+carry); } else{ sum[in]=(a1[i]+a2[j]+carry)%10; } carry=(a1[i]+a2[j]+carry)/10; i--;j--;in--; } while(i>=0){ if(i==0){ sum[in]=(a1[i]+carry); } else{ sum[in]=(a1[i]+carry)%10; } carry=(a1[i]+carry)/10; i--;in--; } while(j>=0){ if(j==0){ sum[in]=(a2[j]+carry); } else{ sum[in]=(a2[j]+carry)%10; } carry=(a2[j]+carry)/10; j--;in--; } /*for(int i=0;i<sum.size();i++){ cout << sum[i] << endl; }*/ i=n.size()-1; j=m.size()-1; in=x-1; int borrow=0; while(i>=0 && j>=0){ if(a1[i]>=a2[j]){ diff[in]=a1[i]-a2[j]; //cout << diff[in] << " g" << i << j <<endl; i--;j--;in--; } else{ int ind=i-1; while(a1[ind]==0){ ind--; } //cout << ind << " " << a1[ind] << endl; a1[ind]--; int q=i-ind; int d=11-q; for(int k=ind+1;k<=i;k++){ if(k==i){ a1[k]=10+a1[k]; } else a1[k]=9; //d++; } diff[in]=a1[i]-a2[j]; i--;j--;in--; } } while(i>=0){ diff[in]=a1[i]; i--;in--; } /*for(int i=0;i<diff.size();i++){ cout << diff[i] << endl; }*/ vector<int> d_sum(sum.size(),0); vector<int> d_diff(diff.size(),0); int rem=0; for(int i=0;i<d_sum.size();i++){ d_sum[i]=(sum[i]+rem*10)/2; rem=(sum[i]+rem*10)%2; } bool zero=true; for(int i=0;i<d_sum.size();i++){ if(zero==true){ if(d_sum[i]!=0){ cout << d_sum[i]; zero=false; } } else{ cout << d_sum[i]; } } cout << endl; rem=0; for(int i=0;i<d_diff.size();i++){ d_diff[i]=(diff[i]+rem*10)/2; rem=(diff[i]+rem*10)%2; } zero=true; for(int i=0;i<d_diff.size();i++){ if(zero==true){ if(d_diff[i]!=0){ cout << d_diff[i]; zero=false; } } else{ cout << d_diff[i]; } } cout << endl; t--; } }
fd288028aa8f3608b58787baa8e37eb81399e783
521685507e5b26ec9be38b39a249bdc1ee638138
/Servers/ServerManager/vtkSMHardwareSelector.cxx
304856da13c275f4264ed95155f832113e7e900f
[ "LicenseRef-scancode-paraview-1.2" ]
permissive
matthb2/ParaView-beforekitwareswtichedtogit
6ad4662a1ad8c3d35d2c41df209fc4d78b7ba298
392519e17af37f66f6465722930b3705c1c5ca6c
refs/heads/master
2020-04-05T05:11:15.181579
2009-05-26T20:50:10
2009-05-26T20:50:10
211,087
1
2
null
null
null
null
UTF-8
C++
false
false
3,159
cxx
/*========================================================================= Program: ParaView Module: $RCSfile$ Copyright (c) Kitware, Inc. All rights reserved. See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "vtkSMHardwareSelector.h" #include "vtkObjectFactory.h" #include "vtkProcessModule.h" #include "vtkSMRenderViewProxy.h" #include "vtkMemberFunctionCommand.h" #include "vtkPVHardwareSelector.h" #include "vtkClientServerStream.h" vtkStandardNewMacro(vtkSMHardwareSelector); vtkCxxRevisionMacro(vtkSMHardwareSelector, "$Revision$"); //---------------------------------------------------------------------------- vtkSMHardwareSelector::vtkSMHardwareSelector() { this->SetServers(vtkProcessModule::CLIENT|vtkProcessModule::RENDER_SERVER); } //---------------------------------------------------------------------------- vtkSMHardwareSelector::~vtkSMHardwareSelector() { } //---------------------------------------------------------------------------- vtkSelection* vtkSMHardwareSelector::Select() { vtkPVHardwareSelector* selector = vtkPVHardwareSelector::SafeDownCast( this->GetClientSideObject()); vtkMemberFunctionCommand<vtkSMHardwareSelector>* observer = vtkMemberFunctionCommand<vtkSMHardwareSelector>::New(); observer->SetCallback(*this, &vtkSMHardwareSelector::StartSelectionPass); selector->AddObserver(vtkCommand::StartEvent, observer); vtkClientServerStream stream; stream << vtkClientServerStream::Invoke << this->GetID() << "BeginSelection" << vtkClientServerStream::End; vtkProcessModule::GetProcessModule()->SendStream(this->ConnectionID, vtkProcessModule::RENDER_SERVER, stream); vtkSelection* sel = selector->Select(); stream << vtkClientServerStream::Invoke << this->GetID() << "EndSelection" << vtkClientServerStream::End; vtkProcessModule::GetProcessModule()->SendStream(this->ConnectionID, vtkProcessModule::RENDER_SERVER, stream); selector->RemoveObserver(observer); observer->Delete(); return sel; } //---------------------------------------------------------------------------- void vtkSMHardwareSelector::StartSelectionPass() { vtkPVHardwareSelector* selector = vtkPVHardwareSelector::SafeDownCast( this->GetClientSideObject()); vtkClientServerStream stream; stream << vtkClientServerStream::Invoke << this->GetID() << "SetCurrentPass" << selector->GetCurrentPass() << vtkClientServerStream::End; vtkProcessModule::GetProcessModule()->SendStream(this->ConnectionID, vtkProcessModule::RENDER_SERVER, stream); } //---------------------------------------------------------------------------- void vtkSMHardwareSelector::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os, indent); }
4225fff31e909d677ff1018d14a3e9b595561cea
3f8b4fe055658d0e8c89f56567c09542afd17aba
/BufferManager/Attribute.h
5fec4a63db4be93d120d4b49b872620e518ae731
[]
no_license
erikmuttersbach/moderndbs-tum-ss14
d81c0d111e5e987e9704817a3ae41ad2ed9732e8
477f8d41b1176c42274f4388d9f9b0ea68dd4f19
refs/heads/master
2021-01-15T14:43:15.136660
2014-05-05T13:21:55
2014-05-05T13:21:55
19,244,928
1
0
null
null
null
null
UTF-8
C++
false
false
681
h
// // Attributes.h // BufferManager // // Created by Erik Muttersbach on 05/05/14. // // #ifndef __BufferManager__Attribute__ #define __BufferManager__Attribute__ #include <boost/serialization/access.hpp> #include <string> typedef enum { string, uint32, int32 } AttributeType; class Attribute { public: Attribute(); Attribute(std::string name, AttributeType type); std::string name; AttributeType type; // boost serialization support friend class boost::serialization::access; template<class Archive> void serialize(Archive & ar, const unsigned int version) { ar & name; ar & type; } }; #endif
dc05b286fda3a362e0310a7fc321954e32822a1e
da63ee5f3f9614466f810291e604093387cc8e7b
/editor.h
1e6e12e90cab1f9aeb765744e50b175a855fb22e
[]
no_license
reat2020/ksamain
99278b433194204facbef36cc6508fcceafcf017
61c946329292afe9d5c267c453713bdfdcd00db4
refs/heads/master
2020-12-10T11:05:40.229199
2020-01-13T16:02:30
2020-01-13T16:02:30
233,576,916
0
0
null
null
null
null
UTF-8
C++
false
false
327
h
#ifndef EDITOR_H #define EDITOR_H #include <QWidget> namespace Ui { class editor; } class editor : public QWidget { Q_OBJECT signals: void del(); public: explicit editor(QWidget *parent = 0); ~editor(); private slots: void on_pushButton_clicked(); private: Ui::editor *ui; }; #endif // EDITOR_H
3e8d13491a07a59a813c9a6a6833c18c11c07285
21272fef02f4447d992c6a03b855fcb6674e03ac
/src/networklayer/FilterRuleTable.cc
2be695685d3ba7ff9710133719772e55368bc190
[]
no_license
BUAA-QianCheng/AgentQuartet
53dd57d85a4cbef98a1bd72d90496cb0856d8574
06c94d33db9f26a3de8a715070ee7b0d03aaff2c
refs/heads/main
2023-04-10T01:49:54.520280
2021-04-16T02:10:45
2021-04-16T02:10:45
358,445,926
0
0
null
null
null
null
UTF-8
C++
false
false
3,321
cc
// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see http://www.gnu.org/licenses/. // #include "FilterRuleTable.h" #include <algorithm> #include <sstream> #include <inet/common/INETUtils.h> #include <inet/common/ModuleAccess.h> #include <inet/common/PatternMatcher.h> #include <inet/common/Simsignals.h> #include <inet/common/XMLUtils.h> using namespace inet; using namespace utils; Define_Module(FilterRuleTable); std::ostream& operator<<(std::ostream& os, const FilterRule& fr) { os << fr.str(); return os; }; void FilterRuleTable::initialize(int stage){ using namespace xmlutils; cSimpleModule::initialize(stage); if (stage == INITSTAGE_LOCAL) { config = par("config"); cXMLElementList ruleElements = config->getChildrenByTagName("filterrule"); for(auto & ruleElement : ruleElements){ try{ const char *rule = ruleElement->getAttribute("content"); if(rule[0] != 0){ FilterRule *tmpRule = new FilterRule(std::string(rule)); this->addFilterRule(tmpRule); } }catch(std::exception e){ throw cRuntimeError("Error in XML <FilterRule> element at %s: %s", ruleElement->getSourceLocation(), e.what()); } } WATCH_PTRVECTOR(rules); WATCH(filterType); } } void FilterRuleTable::handleMessage(cMessage *msg){ throw cRuntimeError("This module doesn't process messages"); } void FilterRuleTable::refreshDisplay() const { char buf[80]; sprintf(buf, "%d rules", (int)rules.size()); getDisplayString().setTagArg("t", 0, buf); } void FilterRuleTable::addFilterRule(FilterRule *entry){ entry->setFilterRuleTable(this); if(entry->getAction() == D) this->rules.insert(rules.begin(), 1, entry); else this->rules.push_back(entry); } int FilterRuleTable::matchPacket(Packet * packet){ Enter_Method("Match Packet"); for (auto rule : rules){ Packet *p = packet->dup(); if(rule->matchPacket(p)){ rule->addPktsDropped(1); rule->addOctetsDropped(p->getByteLength()); delete p; std::vector<FilterRule *>::iterator it = find(rules.begin(), rules.end(), rule); return std::distance(rules.begin(), it); } delete p; } return -1; } bool FilterRuleTable::inTable(FilterRule* rule){ for(FilterRule* r : rules){ if(!strcmp(r->str().c_str(), rule->str().c_str())) return true; } return false; } FilterRule* FilterRuleTable::getFilterRule(int index){ if(index < 0 || index > rules.size()) return nullptr; else return rules[index]; }
f35e51c5f954525139bf8a55d28e2063d65dfb75
15f0514701a78e12750f68ba09d68095172493ee
/C++/466.cpp
582a85d1d652aee944cfc697357c019fcd91bfcc
[ "MIT" ]
permissive
strengthen/LeetCode
5e38c8c9d3e8f27109b9124ae17ef8a4139a1518
3ffa6dcbeb787a6128641402081a4ff70093bb61
refs/heads/master
2022-12-04T21:35:17.872212
2022-11-30T06:23:24
2022-11-30T06:23:24
155,958,163
936
365
MIT
2021-11-15T04:02:45
2018-11-03T06:47:38
null
UTF-8
C++
false
false
2,625
cpp
__________________________________________________________________________________________________ sample 4 ms submission class Solution { public: int getMaxRepetitions(string s1, int n1, string s2, int n2) { int m = s1.size(), n = s2.size(); vector<int> f(n, 0); auto next = f; for (int i = 0; i < n; ++i) { int start = i; for (auto c : s1) { if (c != s2[start]) continue; if (++start == s2.size()) { start = 0; f[i]++; }; } next[i] = start; } unordered_map<int, pair<int,int>> pos2ans; int ans = 0; int cur = 0; bool findloop = false; pos2ans[cur] = make_pair(ans, -1); for (int i = 0; i < n1; ++i) { ans += f[cur]; cur = next[cur]; if (!findloop && pos2ans.count(cur)) { ans += (ans - pos2ans[cur].first)*((n1-1-i)/(i-pos2ans[cur].second)); i = n1 -1 - ((n1-1-i)%(i-pos2ans[cur].second)); findloop = true; } else if (!findloop) pos2ans[cur] = make_pair(ans, i); } return ans / n2; } }; __________________________________________________________________________________________________ sample 8616 kb submission // Basically brute-force, the running time is close to the limit. #include <string> using std::string; class Solution { public: int getMaxRepetitions(string s1, int n1, string s2, int n2) { int ls1 = s1.size(); int ls2 = s2.size(); if (ls1 == 0 || ls2 == 0) { return 0; } if (n1 == 0 || n2 == 0) { return 0; } int i, j; int c1, c2; i = j = 0; c1 = c2 = 0; while (c1 < n1) { if (s1[i] == s2[j]) { ++j; } ++i; if (i == ls1) { i = 0; ++c1; } if (j == ls2) { j = 0; ++c2; } if (i == 0 && j == 0) { // An exact match is found. // Like least common multiple, you know. break; } } // Actually both are the same. if (i == 0 && j == 0) { return (1LL * n1 * c2 / c1) / n2; } else { return c2 / n2; } } }; __________________________________________________________________________________________________
554b36941256fd64592e2689fd8665226be12d68
85e098156370fdb3d513f20edfa8a514fe55175f
/higan/processor/v30mz/instructions-adjust.cpp
043d99a8b4a19a7b33b867ece2e2f832ab499d94
[]
no_license
jeapostrophe/higan
65efcbf70bd43ccb48cd3f8dddb7264bbef1b132
c6fc15f8d26080b9d08e7bc029532c2f59a902ba
refs/heads/master
2021-01-09T20:42:11.304359
2016-09-14T11:55:53
2016-09-14T11:55:53
62,882,832
2
0
null
null
null
null
UTF-8
C++
false
false
1,037
cpp
//27 daa //2f das auto V30MZ::opDecimalAdjust(bool negate) { wait(9); uint8 al = r.al; if(r.f.h || ((al & 0x0f) > 0x09)) { r.al += negate ? -0x06 : 0x06; r.f.h = 1; } if(r.f.c || (al > 0x99)) { r.al += negate ? -0x60 : 0x60; r.f.c = 1; } r.f.s = r.al & 0x80; r.f.z = r.al == 0; r.f.p = parity(r.al); } //37 aaa //3f aas auto V30MZ::opAsciiAdjust(bool negate) { wait(8); if(r.f.h || ((r.al & 0x0f) > 0x09)) { r.al += negate ? -0x06 : 0x06; r.ah += negate ? -0x01 : 0x01; r.f.h = 1; r.f.c = 1; } else { r.f.h = 0; r.f.c = 0; } r.al &= 0x0f; } //d4 aam,immb auto V30MZ::opAdjustAfterMultiply() { wait(16); auto imm = fetch(); if(imm == 0) return interrupt(0); r.ah = r.al / imm; r.al %= imm; r.f.p = parity(r.al); r.f.s = r.ax & 0x8000; r.f.z = r.ax == 0; } //d5 aad,immw auto V30MZ::opAdjustAfterDivide() { wait(5); auto imm = fetch(); r.al += r.ah * imm; r.ah = 0; r.f.p = parity(r.al); r.f.s = r.ax & 0x8000; r.f.z = r.ax == 0; }
ea6ccc0f57e6d518c2d732b61c83222e35195182
3ff1fe3888e34cd3576d91319bf0f08ca955940f
/faceid/src/v20180301/model/PhoneVerificationCTCCResponse.cpp
c9dc7f1d96fc321e5f2ed9077799d5553141892f
[ "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
5,592
cpp
/* * 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. */ #include <tencentcloud/faceid/v20180301/model/PhoneVerificationCTCCResponse.h> #include <tencentcloud/core/utils/rapidjson/document.h> #include <tencentcloud/core/utils/rapidjson/writer.h> #include <tencentcloud/core/utils/rapidjson/stringbuffer.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Faceid::V20180301::Model; using namespace std; PhoneVerificationCTCCResponse::PhoneVerificationCTCCResponse() : m_resultHasBeenSet(false), m_ispHasBeenSet(false), m_descriptionHasBeenSet(false) { } CoreInternalOutcome PhoneVerificationCTCCResponse::Deserialize(const string &payload) { rapidjson::Document d; d.Parse(payload.c_str()); if (d.HasParseError() || !d.IsObject()) { return CoreInternalOutcome(Core::Error("response not json format")); } if (!d.HasMember("Response") || !d["Response"].IsObject()) { return CoreInternalOutcome(Core::Error("response `Response` is null or not object")); } rapidjson::Value &rsp = d["Response"]; if (!rsp.HasMember("RequestId") || !rsp["RequestId"].IsString()) { return CoreInternalOutcome(Core::Error("response `Response.RequestId` is null or not string")); } string requestId(rsp["RequestId"].GetString()); SetRequestId(requestId); if (rsp.HasMember("Error")) { if (!rsp["Error"].IsObject() || !rsp["Error"].HasMember("Code") || !rsp["Error"]["Code"].IsString() || !rsp["Error"].HasMember("Message") || !rsp["Error"]["Message"].IsString()) { return CoreInternalOutcome(Core::Error("response `Response.Error` format error").SetRequestId(requestId)); } string errorCode(rsp["Error"]["Code"].GetString()); string errorMsg(rsp["Error"]["Message"].GetString()); return CoreInternalOutcome(Core::Error(errorCode, errorMsg).SetRequestId(requestId)); } if (rsp.HasMember("Result") && !rsp["Result"].IsNull()) { if (!rsp["Result"].IsString()) { return CoreInternalOutcome(Core::Error("response `Result` IsString=false incorrectly").SetRequestId(requestId)); } m_result = string(rsp["Result"].GetString()); m_resultHasBeenSet = true; } if (rsp.HasMember("Isp") && !rsp["Isp"].IsNull()) { if (!rsp["Isp"].IsString()) { return CoreInternalOutcome(Core::Error("response `Isp` IsString=false incorrectly").SetRequestId(requestId)); } m_isp = string(rsp["Isp"].GetString()); m_ispHasBeenSet = true; } if (rsp.HasMember("Description") && !rsp["Description"].IsNull()) { if (!rsp["Description"].IsString()) { return CoreInternalOutcome(Core::Error("response `Description` IsString=false incorrectly").SetRequestId(requestId)); } m_description = string(rsp["Description"].GetString()); m_descriptionHasBeenSet = true; } return CoreInternalOutcome(true); } string PhoneVerificationCTCCResponse::ToJsonString() const { rapidjson::Document value; value.SetObject(); rapidjson::Document::AllocatorType& allocator = value.GetAllocator(); if (m_resultHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "Result"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_result.c_str(), allocator).Move(), allocator); } if (m_ispHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "Isp"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_isp.c_str(), allocator).Move(), allocator); } if (m_descriptionHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "Description"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_description.c_str(), allocator).Move(), allocator); } rapidjson::Value iKey(rapidjson::kStringType); string key = "RequestId"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value().SetString(GetRequestId().c_str(), allocator), allocator); rapidjson::StringBuffer buffer; rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); value.Accept(writer); return buffer.GetString(); } string PhoneVerificationCTCCResponse::GetResult() const { return m_result; } bool PhoneVerificationCTCCResponse::ResultHasBeenSet() const { return m_resultHasBeenSet; } string PhoneVerificationCTCCResponse::GetIsp() const { return m_isp; } bool PhoneVerificationCTCCResponse::IspHasBeenSet() const { return m_ispHasBeenSet; } string PhoneVerificationCTCCResponse::GetDescription() const { return m_description; } bool PhoneVerificationCTCCResponse::DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; }
dea5aae5cf19e4084b9872de52c0a9a136227643
a2f6568b881d05d273e57027ea92c8d1127b957c
/FileSpliter/FileSpliterDlg.cpp
faa4ec279ad99b48043b97168d306339a2e7e8e7
[]
no_license
hchen90/filesp-win32
38de054ac51ce8d62b5d7f5af50987c133e1d3fb
ec3dc663bff72ef545143d5c954bcb9be638e016
refs/heads/master
2021-04-06T04:30:00.786621
2018-03-11T09:00:02
2018-03-11T09:00:02
124,739,406
0
0
null
null
null
null
UTF-8
C++
false
false
15,543
cpp
// FileSpliterDlg.cpp : implementation file // #include "stdafx.h" #include "FileSpliter.h" #include "FileSpliterDlg.h" #include "afxdialogex.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CAboutDlg dialog used for App About class CAboutDlg : public CDialogEx { public: CAboutDlg(); // Dialog Data #ifdef AFX_DESIGN_TIME enum { IDD = IDD_ABOUTBOX }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) END_MESSAGE_MAP() // CFileSpliterDlg dialog CFileSpliterDlg::CFileSpliterDlg(CWnd* pParent /*=NULL*/) : CDialogEx(IDD_FILESPLITER_DIALOG, pParent), m_iCount(0), m_uiBlockSize(0) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CFileSpliterDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CFileSpliterDlg, CDialogEx) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_CLOSE() ON_WM_QUERYDRAGICON() ON_WM_DROPFILES() ON_EN_CHANGE(IDC_MFCEDITBROWSE1, &CFileSpliterDlg::OnEnChangeMfceditbrowse1) ON_EN_CHANGE(IDC_EDIT1, &CFileSpliterDlg::OnEnChangeEdit1) ON_BN_CLICKED(IDC_MFCBUTTON2, &CFileSpliterDlg::OnBnClickedMfcbutton2) ON_BN_CLICKED(IDC_MFCBUTTON1, &CFileSpliterDlg::OnBnClickedMfcbutton1) ON_BN_CLICKED(IDC_MFCBUTTON3, &CFileSpliterDlg::OnBnClickedMfcbutton3) ON_BN_CLICKED(IDC_MFCLINK1, &CFileSpliterDlg::OnBnClickedMfclink1) END_MESSAGE_MAP() // CFileSpliterDlg message handlers void CFileSpliterDlg::FormatNumberString(CString& str, ULARGE_INTEGER num) { char buffer[MAX_PATH]; if (num.QuadPart >= 1024 * 1024 * 1024) { /*GB*/ if (snprintf(buffer, sizeof(buffer), "%.2fGB", (double)num.QuadPart / 1024 / 1024 / 1024)) { str = buffer; } } else if (num.QuadPart >= 1024 * 1024 && num.QuadPart < 1024 * 1024 * 1024) { /*MB*/ if (snprintf(buffer, sizeof(buffer), "%.2fMB", (double)num.QuadPart / 1024 / 1024)) { str = buffer; } } else if (num.QuadPart >= 1024 && num.QuadPart < 1024 * 1024) { /*KB*/ if (snprintf(buffer, sizeof(buffer), "%.2fKB", (double)num.QuadPart / 1024)) { str = buffer; } } else { str.Format(_T("%uB"), num.QuadPart); } } void CFileSpliterDlg::UpdateInformation() { ULARGE_INTEGER ava_cal, tot, ava; if (m_pTotal && m_pUsed && m_pAva) { CString str; m_pDirPath->GetWindowText(str); if (GetDiskFreeSpaceEx(str, &ava_cal, &tot, &ava)) { FormatNumberString(str, tot); m_pTotal->SetWindowText(str); tot.QuadPart -= ava.QuadPart; FormatNumberString(str, tot); m_pUsed->SetWindowTextW(str); FormatNumberString(str, ava_cal); m_pAva->SetWindowTextW(str); m_pDirPath->GetWindowText(str); if (str.GetLength() > 2) str.SetAt(2, 0); GetDlgItem(IDC_MFCLINK1)->SetWindowText(str); } } } void CFileSpliterDlg::InsertLCString(CString& txt1, CString& txt2) { if (m_pLC) { m_pLC->InsertItem(m_iCount, txt1); m_pLC->SetItemText(m_iCount, 1, txt2); m_iCount++; } } void CFileSpliterDlg::GetBlockSize() { if (m_pBytes != NULL && m_pBytesGroup != NULL) { CString str, str2; m_pBytesGroup->GetWindowText(str); m_pBytes->GetWindowText(str2); #ifdef UNICODE char buffer[MAX_PATH] = {0}; if (WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, str2.GetString(), str2.GetLength(), buffer, sizeof(buffer), NULL, NULL)) { m_uiBlockSize = atoll(buffer); } #else m_uiBlockSize = atoll(str2.GetString()); #endif if (str == CString(_T("Bytes"))) { m_uiBlockSize *= 1; } else if (str == CString(_T("KB"))) { m_uiBlockSize *= 1024; } else if (str == CString(_T("MB"))) { m_uiBlockSize *= 1024 * 1024; } else if (str == CString(_T("GB"))) { m_uiBlockSize *= 1024 * 1024 * 1024; } } } void CFileSpliterDlg::SplitFiles() { if (m_tFileName.size() > 0) { // TODO CString str; LONG nCount; m_pDirPath->GetWindowText(str); if (GetFileAttributes(str) & FILE_ATTRIBUTE_DIRECTORY) { str += CString("\\"); GetBlockSize(); set<CString>::iterator i; for (i = m_tFileName.begin(); i != m_tFileName.end(); i++) { HANDLE hFile = CreateFile(*i, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); LARGE_INTEGER iFileSize; if (hFile != INVALID_HANDLE_VALUE && GetFileSizeEx(hFile, &iFileSize)) { for (nCount = 0; iFileSize.QuadPart > 0; nCount++) { CString file(str); CString iname; CString count; CString oname; TCHAR buf[MAX_PATH]; count.Format(_T(".%d"), nCount); GetFileTitle(*i, buf, sizeof(buf)); file += (iname = CString(buf)); file += count; GetFileTitle(file, buf, sizeof(buf)); oname = CString(buf); InsertLCString(CString(_T("Splitting ") + iname), oname); HANDLE hOut = CreateFile(file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hOut != INVALID_HANDLE_VALUE) { if (iFileSize.QuadPart > m_uiBlockSize) { iFileSize.QuadPart -= m_uiBlockSize; HGLOBAL hGol = GlobalAlloc(GPTR, m_uiBlockSize); LPVOID pMem = (HGLOBAL)hGol; if (hGol != NULL) { DWORD dwRD; if (ReadFile(hFile, pMem, m_uiBlockSize, &dwRD, NULL)) { WriteFile(hOut, pMem, m_uiBlockSize, &dwRD, NULL); } GlobalFree(hGol); } } else { HGLOBAL hGol = GlobalAlloc(GPTR, iFileSize.QuadPart); LPVOID pMem = (LPVOID)hGol; if (hGol != NULL) { DWORD dwRD, dwWT; if (ReadFile(hFile, pMem, iFileSize.QuadPart, &dwRD, NULL)) { WriteFile(hOut, pMem, dwRD, &dwWT, NULL); } GlobalFree(hGol); } iFileSize.QuadPart = 0; } CloseHandle(hOut); } } } if (hFile != INVALID_HANDLE_VALUE) { CloseHandle(hFile); } } } else { AfxMessageBox(CString(_T("Not a directory! (")) + str + CString(_T(")"))); } } } BOOL CFileSpliterDlg::IsDotNumber(CString& str, CString& str2) { int len = str.GetLength(); for (len--; len > 0; len--) { if (str.GetAt(len) == '.') { break; } } if (str.GetAt(len) == '.' && len + 1 < str.GetLength()) { str2 = CString(str); str2.SetAt(len, 0); CString nstr = str.Mid(len + 1); len = nstr.GetLength(); int i, num = 0; for (i = 0; i < len; i++) { if (nstr.GetAt(i) >= '0' && nstr.GetAt(i) <= '9') { num = 1; } else { num = 0; break; } } if (num) return TRUE; } return FALSE; } void CFileSpliterDlg::MergeFiles() { if (m_tFileName.size() > 1) { CString str, last; HANDLE hFileOut = INVALID_HANDLE_VALUE; m_pDirPath->GetWindowText(str); if (GetFileAttributes(str) & FILE_ATTRIBUTE_DIRECTORY) { set<CString>::iterator i; for (i = m_tFileName.begin(); i != m_tFileName.end(); i++) { CString in_file(*i); CString out_file; if (IsDotNumber(in_file, out_file)) { if (hFileOut != INVALID_HANDLE_VALUE && out_file != last) { CloseHandle(hFileOut); hFileOut = INVALID_HANDLE_VALUE; } if (hFileOut == INVALID_HANDLE_VALUE) { hFileOut = CreateFile(out_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); } if (hFileOut != INVALID_HANDLE_VALUE) { last = out_file; HANDLE hFileIn = CreateFile(in_file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFileIn != INVALID_HANDLE_VALUE) { DWORD rd, wt; DWORD size = GetFileSize(hFileIn, NULL); if (size > 0) { HGLOBAL hGol = GlobalAlloc(GPTR, size); if (hGol != NULL) { LPVOID pMem = (LPVOID)hGol; if (ReadFile(hFileIn, pMem, size, &rd, NULL)) { WriteFile(hFileOut, pMem, rd, &wt, NULL); } InsertLCString(CString(_T("Merging ")) + out_file, in_file); GlobalFree(hGol); } } CloseHandle(hFileIn); } } } } } else { AfxMessageBox(CString(_T("Not a directory! (") + str + CString(")"))); } if (hFileOut != INVALID_HANDLE_VALUE) { CloseHandle(hFileOut); } } } void CFileSpliterDlg::OnClose() { CDialogEx::OnOK(); } BOOL CFileSpliterDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here if (m_pBytesGroup = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_COMBO1))) { m_pBytesGroup->AddString(_T("Bytes")); m_pBytesGroup->AddString(_T("KB")); m_pBytesGroup->AddString(_T("MB")); m_pBytesGroup->AddString(_T("GB")); m_pBytesGroup->SetCurSel(3); } if (m_pBytes = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_COMBO2))) { m_pBytes->AddString(_T("1024")); m_pBytes->AddString(_T("512")); m_pBytes->SetCurSel(1); } if (m_pDirPath = reinterpret_cast<CEdit*>(GetDlgItem(IDC_EDIT1))) { TCHAR buffer[MAX_PATH]; if (GetCurrentDirectory(sizeof(buffer), buffer)) { m_pDirPath->SetWindowText(buffer); } } if (m_pLC = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_LIST1))) { m_pLC->SetExtendedStyle(LVS_EX_FULLROWSELECT); RECT rc; m_pLC->GetWindow(0)->GetWindowRect(&rc); LVCOLUMN lvc = {0}; lvc.mask = LVCF_TEXT | LVCF_WIDTH; lvc.cx = 0.3 * (rc.right - rc.left); lvc.pszText = _T("Status"); m_pLC->InsertColumn(0, &lvc); lvc.cx = 0.6 * (rc.right - rc.left); lvc.pszText = _T("Text"); m_pLC->InsertColumn(1, &lvc); CString str; m_pDirPath->GetWindowText(str); InsertLCString(CString(_T("Output Directory")), str); } m_pTotal = reinterpret_cast<CEdit*>(GetDlgItem(IDC_EDIT2)); m_pUsed = reinterpret_cast<CEdit*>(GetDlgItem(IDC_EDIT3)); m_pAva = reinterpret_cast<CEdit*>(GetDlgItem(IDC_EDIT4)); m_pBC = reinterpret_cast<CMFCEditBrowseCtrl*>(GetDlgItem(IDC_MFCEDITBROWSE1)); UpdateInformation(); if (m_pMerge = reinterpret_cast<CMFCButton*>(GetDlgItem(IDC_MFCBUTTON1))) { m_pMerge->SetTextColor(RGB(0, 0x80, 0)); m_pMerge->EnableWindow(FALSE); } if (m_pSplit = reinterpret_cast<CMFCButton*>(GetDlgItem(IDC_MFCBUTTON2))) { m_pSplit->SetTextColor(RGB(0x80, 0, 0x80)); m_pSplit->EnableWindow(FALSE); } if (m_pAbout = reinterpret_cast<CMFCButton*>(GetDlgItem(IDC_MFCBUTTON3))) { m_pAbout->SetTextColor(RGB(0x80, 0x80, 0)); } return TRUE; // return TRUE unless you set the focus to a control } void CFileSpliterDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialogEx::OnSysCommand(nID, lParam); } } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CFileSpliterDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialogEx::OnPaint(); } } // The system calls this function to obtain the cursor to display while the user drags // the minimized window. HCURSOR CFileSpliterDlg::OnQueryDragIcon() { return static_cast<HCURSOR>(m_hIcon); } void CFileSpliterDlg::OnDropFiles(HDROP hDrop) { TCHAR buffer[MAX_PATH]; UINT n = DragQueryFile(hDrop, -1, buffer, sizeof(buffer)); if (n > 0) { UINT i; for (i = 0; i < n; i++) { if (DragQueryFile(hDrop, i, buffer, sizeof(buffer)) > 0) { m_tFileName.insert(CString(buffer)); GetDlgItem(IDC_MFCEDITBROWSE1)->SetWindowText(buffer); } } } if (m_tFileName.size() > 0) { m_pSplit->EnableWindow(TRUE); } else { m_pSplit->EnableWindow(FALSE); } if (m_tFileName.size() > 1) { m_pMerge->EnableWindow(TRUE); } else { m_pMerge->EnableWindow(FALSE); } DragFinish(hDrop); } void CFileSpliterDlg::OnEnChangeMfceditbrowse1() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialogEx::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here if (m_pBC != NULL) { CString str; m_pBC->GetWindowText(str); InsertLCString(CString(_T("Adding File")), str); m_tFileName.insert(str); if (m_tFileName.size() > 0) { m_pSplit->EnableWindow(TRUE); } else { m_pSplit->EnableWindow(FALSE); } if (m_tFileName.size() > 1) { m_pMerge->EnableWindow(TRUE); } else { m_pMerge->EnableWindow(FALSE); } } } void CFileSpliterDlg::OnEnChangeEdit1() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialogEx::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here UpdateInformation(); CString str; m_pDirPath->GetWindowText(str); if (GetFileAttributes(str) == FILE_ATTRIBUTE_DIRECTORY) { InsertLCString(CString(_T("Output Directory")), str); } } void CFileSpliterDlg::OnBnClickedMfcbutton2() /*Split*/ { // TODO: Add your control notification handler code here SplitFiles(); } void CFileSpliterDlg::OnBnClickedMfcbutton1() /*Merge*/ { // TODO: Add your control notification handler code here MergeFiles(); } void CFileSpliterDlg::OnBnClickedMfcbutton3() { // TODO: Add your control notification handler code here CAboutDlg dlg; dlg.DoModal(); } void CFileSpliterDlg::OnBnClickedMfclink1() { // TODO: Add your control notification handler code here CString str; GetDlgItem(IDC_MFCLINK1)->GetWindowText(str); if (str.GetLength() > 0) { ShellExecute(this->m_hWnd, _T("explore"), str, NULL, NULL, SW_NORMAL); } }
d6b88d952b3935406deec15c0327cc65a5696886
e3a81c29ef80d2975b24f05bebcabe755ad082b0
/test.cpp
5cba99eb1536458789f0d99eb4ec320e5fbddaee
[]
no_license
DearDavies/learninggit
ef2018f7678ed09f0cc14fe821e26e3a80968f1d
0bc0feea3853f0dfbac8ebfac38bc25b40344c05
refs/heads/master
2022-11-21T10:59:50.443439
2020-07-20T10:54:16
2020-07-20T10:54:16
281,056,726
0
0
null
null
null
null
UTF-8
C++
false
false
97
cpp
#include <iostream> using namespace std; int main() { cout<<"Hello World!"<<endl; return 0; }
95a7d20b1b80709d1dbfe145e31771913e842e15
4e4b253d61b2502ae9c18c4587df8a4dac2b072b
/Program14_Task1.cpp
25ce521973248c61de49deca346011cba814d968
[]
no_license
hardik20sharma/Classroom_Data_Structures_and_Algorithms
8674964832044460c9ab59e56d306ca84d429b0e
1635d7981e292684f71b38bed771c8282ae76863
refs/heads/master
2022-04-20T18:56:21.568000
2020-04-19T12:05:17
2020-04-19T12:05:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
632
cpp
// WAP of sternin's matrix multiplication #include<iostream> using namespace std; int main() { int matrix1[2][2], matrix[2][2]; int i,j, p1, p2, p3, p4 , p5, p6, p7; cout<<"Enter matrix 1: \n"; for(i=0; i<2; i++) for(j=0; j<2; j++) cin>>matrix1[i][j]; cout<<"Enter matrix 2: \n"; for(i=0; i<2; i++) for(j=0; j<2; j++) cin>>matrix2[i][j]; cout<<"\nMatrix 1:\n"; for(i=0; i<2; i++) { for(j=0; j<2; j++) cout<<matrix1[2][2]; cout<<endl; } cout<<"\nMatrix 2:\n"; for(i=0; i<2; i++) { for(j=0; j<2; j++) cout<<matrix2[2][2]; cout<<endl; } p1 = }
b79a410942d57dcaea3d55c10941a8d86ed6802a
1dbf007249acad6038d2aaa1751cbde7e7842c53
/gaussdbforopengauss/include/huaweicloud/gaussdbforopengauss/v3/model/ListDatabasesRequest.h
24a6e6f298adb62be815f7805c4d42922d80213b
[]
permissive
huaweicloud/huaweicloud-sdk-cpp-v3
24fc8d93c922598376bdb7d009e12378dff5dd20
71674f4afbb0cd5950f880ec516cfabcde71afe4
refs/heads/master
2023-08-04T19:37:47.187698
2023-08-03T08:25:43
2023-08-03T08:25:43
324,328,641
11
10
Apache-2.0
2021-06-24T07:25:26
2020-12-25T09:11:43
C++
UTF-8
C++
false
false
2,425
h
#ifndef HUAWEICLOUD_SDK_GAUSSDBFOROPENGAUSS_V3_MODEL_ListDatabasesRequest_H_ #define HUAWEICLOUD_SDK_GAUSSDBFOROPENGAUSS_V3_MODEL_ListDatabasesRequest_H_ #include <huaweicloud/gaussdbforopengauss/v3/GaussDBforopenGaussExport.h> #include <huaweicloud/core/utils/ModelBase.h> #include <huaweicloud/core/http/HttpResponse.h> #include <string> namespace HuaweiCloud { namespace Sdk { namespace Gaussdbforopengauss { namespace V3 { namespace Model { using namespace HuaweiCloud::Sdk::Core::Utils; using namespace HuaweiCloud::Sdk::Core::Http; /// <summary> /// Request Object /// </summary> class HUAWEICLOUD_GAUSSDBFOROPENGAUSS_V3_EXPORT ListDatabasesRequest : public ModelBase { public: ListDatabasesRequest(); virtual ~ListDatabasesRequest(); ///////////////////////////////////////////// /// ModelBase overrides void validate() override; web::json::value toJson() const override; bool fromJson(const web::json::value& json) override; ///////////////////////////////////////////// /// ListDatabasesRequest members /// <summary> /// 语言 /// </summary> std::string getXLanguage() const; bool xLanguageIsSet() const; void unsetxLanguage(); void setXLanguage(const std::string& value); /// <summary> /// 实例ID。 /// </summary> std::string getInstanceId() const; bool instanceIdIsSet() const; void unsetinstanceId(); void setInstanceId(const std::string& value); /// <summary> /// 偏移量表示从此偏移量开始查询, offset大于等于0,默认0。 /// </summary> int32_t getOffset() const; bool offsetIsSet() const; void unsetoffset(); void setOffset(int32_t value); /// <summary> /// 每页显示的条目数量,取值范围[1, 100],默认10。 /// </summary> int32_t getLimit() const; bool limitIsSet() const; void unsetlimit(); void setLimit(int32_t value); protected: std::string xLanguage_; bool xLanguageIsSet_; std::string instanceId_; bool instanceIdIsSet_; int32_t offset_; bool offsetIsSet_; int32_t limit_; bool limitIsSet_; #ifdef RTTR_FLAG RTTR_ENABLE() public: ListDatabasesRequest& dereference_from_shared_ptr(std::shared_ptr<ListDatabasesRequest> ptr) { return *ptr; } #endif }; } } } } } #endif // HUAWEICLOUD_SDK_GAUSSDBFOROPENGAUSS_V3_MODEL_ListDatabasesRequest_H_
6254748186d4fb975074d920bfc67948e94e24c4
3bc10dca7b8d7383ddc121e864f22f0006e34603
/Editor/UICanvas.h
7524049d93e558547d6ce39a3b3015e0400b666f
[]
no_license
cloudstlife/AnimEditor
0578d2f6338b9ad18697230bec0300744ba190c4
f5919b2e026d482f1ad75d05eb67d5b238fa3143
refs/heads/master
2016-09-06T00:51:32.147553
2015-07-14T02:54:24
2015-07-14T02:54:24
39,050,108
0
0
null
null
null
null
UTF-8
C++
false
false
883
h
#ifndef UICANVAS_H #define UICANVAS_H #include <QtGui/QWidget> #include <QtGui/QScrollArea> #include <QTimer> class UICanvas : public QWidget { Q_OBJECT public: UICanvas( QWidget* parent = 0 ); ~UICanvas(); void initialize(); // reimplemented QWidget protected: virtual void paintEvent( QPaintEvent* evt ); virtual void mousePressEvent( QMouseEvent* evt ); virtual void mouseMoveEvent( QMouseEvent* evt ); virtual void mouseReleaseEvent( QMouseEvent* evt ); virtual void mouseDoubleClickEvent( QMouseEvent* evt ); virtual void leaveEvent( QEvent* evt ); virtual void dragEnterEvent( QDragEnterEvent* evt ); virtual void dragMoveEvent( QDragMoveEvent* evt ); virtual void dropEvent( QDropEvent* evt ); private: void _mouseMove( int mouseX, int mouseY ); public slots: void TimerUpdate(); private: QTimer* mTimerUpdate; float mTimeStep; }; #endif
690b5d4ef12f1acff27319c5c4e5633f77bf8a61
bd904178f3d33c82283ede7cb3a7cfb2021e8d1a
/cpp/(13) Target HR calculator/testHR.cpp
41ce58bc8b4b8f5c6871d7a343f4cbd9225bfc2c
[]
no_license
juanemael/Programming
b3c2f191483690fb9d924d62fafcc4d2912a3d79
13f330812130bb9b5ce90abdbb03f2661fba121c
refs/heads/master
2022-12-06T19:28:28.177131
2020-08-29T17:31:08
2020-08-29T17:31:08
null
0
0
null
null
null
null
UTF-8
C++
false
false
458
cpp
#include <stdio.h> #include "HR.h" int main (){ int umur; char first [15], last [15]; //create an obj printf("Enter your First Name: "); scanf("%14s", first); printf("Enter your Last Name: "); scanf("%14s", last); printf("Enter your Age: "); scanf("%d", &umur); HR age1; age1.setValueAge (umur); //constructor age1.setValueName(first, last); printf("", age1.getValueMaxHR()); printf("", age1.getValueTargetHR()); return 0; }
7869df57aae54ee09bb0ab81a4d48a8081a3c4f0
6b880857af9bca993828be7f768d112efdfd509d
/crichtonSim/crichtonSim.cpp
4848ddbb9dc283769c3ffa8feeb3b683c2e8f3c3
[]
no_license
ana-GT/toolsLWA4
c98c787d56fe169c21ac5180d01768f2514c26f9
39979d6d859cb490e2cbd28a1d9c1356b1058846
refs/heads/master
2016-09-05T14:04:40.068516
2014-09-13T13:29:13
2014-09-13T13:29:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,519
cpp
/** * @file crichtonSim * @brief Simulate daemon c402 for arm /hand motors */ #include "crichtonSim.h" #include <dart/dynamics/Skeleton.h> /** * @function crichtonSim * @brief Constructor */ crichtonSim::crichtonSim() { // Some default parameters mq_la = Eigen::VectorXd::Zero(7); mdq_la = Eigen::VectorXd::Zero(7); mq_ra = Eigen::VectorXd::Zero(7); mdq_ra = Eigen::VectorXd::Zero(7); mq_lh = Eigen::VectorXd::Zero(8); mdq_lh = Eigen::VectorXd::Zero(8); mq_rh = Eigen::VectorXd::Zero(8); mdq_rh = Eigen::VectorXd::Zero(8); mdt = 0.025; mMode = SNS_MOTOR_MODE_VEL; dFingerDofs.resize(8); for( int i = 0; i < 8; ++i ) { dFingerDofs[i] = i+6; } dPoseDofs.resize(6); for( int i = 0; i < 6; ++i ) { dPoseDofs[i] = i; } } /** * @function ~crichtonSim * @brief Destructor */ crichtonSim::~crichtonSim() { } /** * @function initSetup_channels * @brief Create ACH channels and open them, letting them ready to send stuff */ bool crichtonSim::initSetup_channels() { ach_status r; // Create channels (script beforehand) // Open channels to return motor states r = ach_open( &mCx.chan_state_left, "state-left", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening left arm state chan"<<std::endl; return false; } r = ach_open( &mCx.chan_state_right, "state-right", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening right arm state chan"<<std::endl; return false; } r = ach_open( &mCx.chan_sdhstate_left, "sdhstate-left", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening left hand state chan"<<std::endl; return false; } r = ach_open( &mCx.chan_sdhstate_right, "sdhstate-right", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening right hand state chan"<<std::endl; return false; } // Open channels to read commands (ref - and we only read velocity at the moment) r = ach_open( &mCx.chan_ref_left, "ref-left", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening left arm ref chan"<<std::endl; return false; } r = ach_open( &mCx.chan_ref_right, "ref-right", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening right arm ref chan"<<std::endl; return false; } r = ach_open( &mCx.chan_sdhref_left, "sdhref-left", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening left hand ref chan"<<std::endl; return false; } r = ach_open( &mCx.chan_sdhref_right, "sdhref-right", NULL ); if( r != ACH_OK ) { std::cout<<"\t [ERROR] Opening right hand ref chan"<<std::endl; return false; } // Set heap for messages. For Crichton, we know that 7 modules are used for // each arm and hand mCx.msg_state_left = sns_msg_motor_state_heap_alloc( 7 ); mCx.msg_state_right = sns_msg_motor_state_heap_alloc( 7 ); mCx.msg_sdhstate_left = sns_msg_motor_state_heap_alloc( 7 ); mCx.msg_sdhstate_right = sns_msg_motor_state_heap_alloc( 7 ); mCx.msg_ref_left = sns_msg_motor_ref_heap_alloc( 7 ); mCx.msg_ref_right = sns_msg_motor_ref_heap_alloc( 7 ); mCx.msg_sdhref_left = sns_msg_motor_ref_heap_alloc( 7 ); mCx.msg_sdhref_right = sns_msg_motor_ref_heap_alloc( 7 ); std::cout << "\t [GOOD] Finished initing ACH stuff in Crichton sim"<< std::endl; return true; } /** * @function setRobot * @brief Set arms and hands respectively */ bool crichtonSim::setRobot( dart::dynamics::Skeleton* _leftArm, dart::dynamics::Skeleton* _rightArm, dart::dynamics::Skeleton* _leftHand, dart::dynamics::Skeleton* _rightHand ) { mLeftArm = _leftArm; mRightArm = _rightArm; mLeftHand = _leftHand; mRightHand = _rightHand; } /** * @function run * @brief Called each time the timer gets a timeout */ void crichtonSim::run() { // Simulate the robot executing command this->simulate(); // Send state this->update(); // Receive control signal this->control(); } /** * @function simulate */ void crichtonSim::simulate() { // Simulate according to the mode switch( mMode ) { case SNS_MOTOR_MODE_HALT: { } break; case SNS_MOTOR_MODE_POS : { std::cout << "Position mode not supported yet"<< std::endl; } break; case SNS_MOTOR_MODE_VEL : { std::cout << "Using motor velocity mode"<<std::endl; // Left Arm mq_la = mLeftArm->getConfig(); mq_la += mdt*mdq_la; mLeftArm->setConfig( mq_la ); // Right Arm mq_ra = mRightArm->getConfig(); mq_ra += mdt*mdq_ra; mRightArm->setConfig( mq_ra ); // Left Hand mq_lh = mLeftHand->getConfig( dFingerDofs ); mq_lh += mdt*mdq_lh; mLeftHand->setConfig( dFingerDofs, mq_lh ); // Right Hand mq_rh = mRightHand->getConfig( dFingerDofs ); mq_rh += mdt*mdq_rh; mRightHand->setConfig( dFingerDofs, mq_rh ); } break; case SNS_MOTOR_MODE_TORQ: { std::cout << "Torque mode not supported yet"<< std::endl; } break; } } /** * @function update * @brief Get arm/hand states from simulation and publish them in ACH msgs */ void crichtonSim::update() { // Left arm mq_la = mLeftArm->getConfig(); for( int i = 0; i < 7; ++i ) { mCx.msg_state_left->X[i].pos = mq_la(i); mCx.msg_state_left->X[i].vel = mdq_la(i); } ach_put( &mCx.chan_state_left, mCx.msg_state_left, sns_msg_motor_state_size(mCx.msg_state_left) ); // Right arm mq_ra = mRightArm->getConfig(); for( int i = 0; i < 7; ++i ) { mCx.msg_state_right->X[i].pos = mq_ra(i); mCx.msg_state_right->X[i].vel = mdq_ra(i); } ach_put( &mCx.chan_state_right, mCx.msg_state_right, sns_msg_motor_state_size(mCx.msg_state_right) ); // Left hand mq_lh = mLeftHand->getConfig( dFingerDofs ); for( int i = 0; i < 7; ++i ) { mCx.msg_sdhstate_left->X[i].pos = mq_lh(i); mCx.msg_sdhstate_left->X[i].vel = mdq_lh(i); } ach_put( &mCx.chan_sdhstate_left, mCx.msg_sdhstate_left, sns_msg_motor_state_size(mCx.msg_sdhstate_left) ); // Right hand mq_rh = mRightHand->getConfig( dFingerDofs ); for( int i = 0; i < 7; ++i ) { mCx.msg_sdhstate_right->X[i].pos = mq_rh(i); mCx.msg_sdhstate_right->X[i].vel = mdq_rh(i); } ach_put( &mCx.chan_sdhstate_right, mCx.msg_sdhstate_right, sns_msg_motor_state_size(mCx.msg_sdhstate_right) ); } /** * @function control * @brief Get arm/hand states from ACH msgs and put them in simulation */ void crichtonSim::control() { size_t frame_size; void *buf = NULL; ach_status_t r; // Initialize to vel=0 for( int i = 0; i < 7; ++i ) { mdq_la(i) = 0; } for( int i = 0; i < 7; ++i ) { mdq_ra(i) = 0; } // Left arm struct timespec *ts = NULL; r = sns_msg_local_get( &mCx.chan_ref_left, &buf, &frame_size, ts, ACH_O_LAST | (ts? ACH_O_WAIT : 0 ) ); switch(r) { case ACH_OK: case ACH_MISSED_FRAME: mCx.msg_ref_left = (struct sns_msg_motor_ref*)buf; if( mCx.msg_ref_left->mode != SNS_MOTOR_MODE_VEL ) { std::cout <<"\t [ERROR] We only use velocity mode currently!"<< std::endl; return; } if( frame_size == sns_msg_motor_ref_size_n(7) ) { for( int i = 0; i < 7; ++i ) { mdq_la(i) = mCx.msg_ref_left->u[i]; } } break; } // Right arm r = sns_msg_local_get( &mCx.chan_ref_right, &buf, &frame_size, ts, ACH_O_LAST | (ts? ACH_O_WAIT : 0 ) ); switch(r) { case ACH_OK: case ACH_MISSED_FRAME: mCx.msg_ref_right = (struct sns_msg_motor_ref*)buf; if( mCx.msg_ref_right->mode != SNS_MOTOR_MODE_VEL ) { std::cout <<"\t [ERROR] We only use velocity mode currently!"<< std::endl; return; } if( frame_size == sns_msg_motor_ref_size_n(7) ) { for( int i = 0; i < 7; ++i ) { mdq_ra(i) = mCx.msg_ref_right->u[i]; } } break; } // Left hand r = sns_msg_local_get( &mCx.chan_sdhref_left, &buf, &frame_size, ts, ACH_O_LAST | (ts? ACH_O_WAIT : 0 ) ); switch(r) { case ACH_OK: case ACH_MISSED_FRAME: mCx.msg_sdhref_left = (struct sns_msg_motor_ref*)buf; if( mCx.msg_sdhref_left->mode != SNS_MOTOR_MODE_VEL ) { std::cout <<"\t [ERROR] We only use velocity mode currently!"<< std::endl; return; } if( frame_size == sns_msg_motor_ref_size_n(7) ) { for( int i = 0; i < 7; ++i ) { mdq_lh(i) = mCx.msg_sdhref_left->u[i]; } mdq_lh(7) = 0; } break; } // Right hand r = sns_msg_local_get( &mCx.chan_sdhref_right, &buf, &frame_size, ts, ACH_O_LAST | (ts? ACH_O_WAIT : 0 ) ); switch(r) { case ACH_OK: case ACH_MISSED_FRAME: mCx.msg_sdhref_right = (struct sns_msg_motor_ref*)buf; if( mCx.msg_sdhref_right->mode != SNS_MOTOR_MODE_VEL ) { std::cout <<"\t [ERROR] We only use velocity mode currently!"<< std::endl; return; } if( frame_size == sns_msg_motor_ref_size_n(7) ) { for( int i = 0; i < 7; ++i ) { mdq_rh(i) = mCx.msg_sdhref_right->u[i]; } mdq_rh(7) = 0; } break; } } /** * @function getArm */ dart::dynamics::Skeleton* crichtonSim::getArm( const int &_side ) { if( _side == LEFT ) { return mLeftArm; } else if( _side == RIGHT ) { return mRightArm; } else { std::cout <<" [ERROR] Only left or right arm. Return NULL!"<< std::endl; return NULL; } } /** * @function getHand */ dart::dynamics::Skeleton* crichtonSim::getHand( const int &_side ) { if( _side == LEFT ) { return mLeftHand; } else if( _side == RIGHT ) { return mRightHand; } else { std::cout <<" [ERROR] Only left or right hand. Return NULL!"<< std::endl; return NULL; } }
f6ccc2b39f4f8fa5e02c4a2cbb4da8e5847ec8c0
96bbb12bc9be1d3d470d249eb1a247dd803fc10d
/src/rpcprotocol.h
7f7bc5eda40dc0e39760386da4c824bd0d21fed8
[ "MIT" ]
permissive
nscoins/nscoincore
e558760fec0cdb6119cc0962a326d63063b9e65e
6544d7c59361e0cc747ec89abfcf974212880b46
refs/heads/master
2021-05-21T01:11:15.962502
2020-04-05T01:00:44
2020-04-05T01:00:44
252,480,667
0
1
null
null
null
null
UTF-8
C++
false
false
7,355
h
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_RPCPROTOCOL_H #define BITCOIN_RPCPROTOCOL_H #include <boost/asio.hpp> #include <boost/asio/ssl.hpp> #include <boost/iostreams/concepts.hpp> #include <boost/iostreams/stream.hpp> #include <list> #include <map> #include <stdint.h> #include <string> #include <univalue.h> //! HTTP status codes enum HTTPStatusCode { HTTP_OK = 200, HTTP_BAD_REQUEST = 400, HTTP_UNAUTHORIZED = 401, HTTP_FORBIDDEN = 403, HTTP_NOT_FOUND = 404, HTTP_INTERNAL_SERVER_ERROR = 500, HTTP_SERVICE_UNAVAILABLE = 503, }; //! Nscoin RPC error codes enum RPCErrorCode { //! Standard JSON-RPC 2.0 errors RPC_INVALID_REQUEST = -32600, RPC_METHOD_NOT_FOUND = -32601, RPC_INVALID_PARAMS = -32602, RPC_INTERNAL_ERROR = -32603, RPC_PARSE_ERROR = -32700, //! General application defined errors RPC_MISC_ERROR = -1, //! std::exception thrown in command handling RPC_FORBIDDEN_BY_SAFE_MODE = -2, //! Server is in safe mode, and command is not allowed in safe mode RPC_TYPE_ERROR = -3, //! Unexpected type was passed as parameter RPC_INVALID_ADDRESS_OR_KEY = -5, //! Invalid address or key RPC_OUT_OF_MEMORY = -7, //! Ran out of memory during operation RPC_INVALID_PARAMETER = -8, //! Invalid, missing or duplicate parameter RPC_DATABASE_ERROR = -20, //! Database error RPC_DESERIALIZATION_ERROR = -22, //! Error parsing or validating structure in raw format RPC_VERIFY_ERROR = -25, //! General error during transaction or block submission RPC_VERIFY_REJECTED = -26, //! Transaction or block was rejected by network rules RPC_VERIFY_ALREADY_IN_CHAIN = -27, //! Transaction already in chain RPC_IN_WARMUP = -28, //! Client still warming up //! Aliases for backward compatibility RPC_TRANSACTION_ERROR = RPC_VERIFY_ERROR, RPC_TRANSACTION_REJECTED = RPC_VERIFY_REJECTED, RPC_TRANSACTION_ALREADY_IN_CHAIN = RPC_VERIFY_ALREADY_IN_CHAIN, //! P2P client errors RPC_CLIENT_NOT_CONNECTED = -9, //! Nscoin is not connected RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, //! Still downloading initial blocks RPC_CLIENT_NODE_ALREADY_ADDED = -23, //! Node is already added RPC_CLIENT_NODE_NOT_ADDED = -24, //! Node has not been added before //! Wallet errors RPC_WALLET_ERROR = -4, //! Unspecified problem with wallet (key not found etc.) RPC_WALLET_INSUFFICIENT_FUNDS = -6, //! Not enough funds in wallet or account RPC_WALLET_INVALID_ACCOUNT_NAME = -11, //! Invalid account name RPC_WALLET_KEYPOOL_RAN_OUT = -12, //! Keypool ran out, call keypoolrefill first RPC_WALLET_UNLOCK_NEEDED = -13, //! Enter the wallet passphrase with walletpassphrase first RPC_WALLET_PASSPHRASE_INCORRECT = -14, //! The wallet passphrase entered was incorrect RPC_WALLET_WRONG_ENC_STATE = -15, //! Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.) RPC_WALLET_ENCRYPTION_FAILED = -16, //! Failed to encrypt the wallet RPC_WALLET_ALREADY_UNLOCKED = -17, //! Wallet is already unlocked }; /** * IOStream device that speaks SSL but can also speak non-SSL */ template <typename Protocol> class SSLIOStreamDevice : public boost::iostreams::device<boost::iostreams::bidirectional> { public: SSLIOStreamDevice(boost::asio::ssl::stream<typename Protocol::socket>& streamIn, bool fUseSSLIn) : stream(streamIn) { fUseSSL = fUseSSLIn; fNeedHandshake = fUseSSLIn; } void handshake(boost::asio::ssl::stream_base::handshake_type role) { if (!fNeedHandshake) return; fNeedHandshake = false; stream.handshake(role); } std::streamsize read(char* s, std::streamsize n) { handshake(boost::asio::ssl::stream_base::server); // HTTPS servers read first if (fUseSSL) return stream.read_some(boost::asio::buffer(s, n)); return stream.next_layer().read_some(boost::asio::buffer(s, n)); } std::streamsize write(const char* s, std::streamsize n) { handshake(boost::asio::ssl::stream_base::client); // HTTPS clients write first if (fUseSSL) return boost::asio::write(stream, boost::asio::buffer(s, n)); return boost::asio::write(stream.next_layer(), boost::asio::buffer(s, n)); } bool connect(const std::string& server, const std::string& port) { using namespace boost::asio::ip; tcp::resolver resolver(stream.get_io_service()); tcp::resolver::iterator endpoint_iterator; #if BOOST_VERSION >= 104300 try { #endif // The default query (flags address_configured) tries IPv6 if // non-localhost IPv6 configured, and IPv4 if non-localhost IPv4 // configured. tcp::resolver::query query(server.c_str(), port.c_str()); endpoint_iterator = resolver.resolve(query); #if BOOST_VERSION >= 104300 } catch (boost::system::system_error& e) { // If we at first don't succeed, try blanket lookup (IPv4+IPv6 independent of configured interfaces) tcp::resolver::query query(server.c_str(), port.c_str(), resolver_query_base::flags()); endpoint_iterator = resolver.resolve(query); } #endif boost::system::error_code error = boost::asio::error::host_not_found; tcp::resolver::iterator end; while (error && endpoint_iterator != end) { stream.lowest_layer().close(); stream.lowest_layer().connect(*endpoint_iterator++, error); } if (error) return false; return true; } private: bool fNeedHandshake; bool fUseSSL; boost::asio::ssl::stream<typename Protocol::socket>& stream; }; std::string HTTPPost(const std::string& strMsg, const std::map<std::string, std::string>& mapRequestHeaders); std::string HTTPError(int nStatus, bool keepalive, bool headerOnly = false); std::string HTTPReplyHeader(int nStatus, bool keepalive, size_t contentLength, const char* contentType = "application/json"); std::string HTTPReply(int nStatus, const std::string& strMsg, bool keepalive, bool headerOnly = false, const char* contentType = "application/json"); bool ReadHTTPRequestLine(std::basic_istream<char>& stream, int& proto, std::string& http_method, std::string& http_uri); int ReadHTTPStatus(std::basic_istream<char>& stream, int& proto); int ReadHTTPHeaders(std::basic_istream<char>& stream, std::map<std::string, std::string>& mapHeadersRet); int ReadHTTPMessage(std::basic_istream<char>& stream, std::map<std::string, std::string>& mapHeadersRet, std::string& strMessageRet, int nProto, size_t max_size); std::string JSONRPCRequest(const std::string& strMethod, const UniValue& params, const UniValue& id); UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id); std::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id); UniValue JSONRPCError(int code, const std::string& message); #endif // BITCOIN_RPCPROTOCOL_H
ff8321f3c4970f0a1a4dfc8a115452aaa57dd7d0
d98ff2f529e14275ad29755189b791e6a530c148
/Unity Code/ObjectRecognition/Temp/il2cppOutput/il2cppOutput/Assembly-CSharp-firstpass.cpp
e38aaeb382dc91f8b2a63e227e699f5854d2ec7d
[]
no_license
misaeluniversity/objectDetectionMobile
aba03b25ca6e65ef2e791dc086c2c61467d24fd1
b98c574b9dbc1012279d62ff196ca0d7a640f961
refs/heads/master
2021-05-18T07:23:00.076120
2020-04-06T21:54:14
2020-04-06T21:54:14
251,177,146
0
0
null
null
null
null
UTF-8
C++
false
false
153,447
cpp
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> #include <stdint.h> #include "codegen/il2cpp-codegen.h" #include "il2cpp-object-internals.h" struct VirtActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; template <typename T1> struct VirtActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; struct GenericVirtActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; template <typename T1> struct GenericVirtActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; struct InterfaceActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; template <typename T1> struct InterfaceActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; struct GenericInterfaceActionInvoker0 { typedef void (*Action)(void*, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, invokeData.method); } }; template <typename T1> struct GenericInterfaceActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; // NativeCamera/CameraCallback struct CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370; // NativeCameraNamespace.NCCameraCallbackiOS struct NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738; // System.ArgumentException struct ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1; // System.AsyncCallback struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4; // System.Byte[] struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821; // System.Char[] struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2; // System.Collections.IDictionary struct IDictionary_t1BD5C1546718A374EA8122FBD6C6EE45331E8CE7; // System.Delegate struct Delegate_t; // System.DelegateData struct DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE; // System.Delegate[] struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86; // System.Diagnostics.StackTrace[] struct StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196; // System.Exception struct Exception_t; // System.IAsyncResult struct IAsyncResult_t8E194308510B375B42432981AE5E7488C458D598; // System.IO.DirectoryInfo struct DirectoryInfo_t432CD06DF148701E930708371CB985BC0E8EF87F; // System.IO.FileNotFoundException struct FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431; // System.IntPtr[] struct IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD; // System.Reflection.MethodInfo struct MethodInfo_t; // System.Runtime.Serialization.SafeSerializationManager struct SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770; // System.String struct String_t; // System.String[] struct StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E; // System.Void struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017; // UnityEngine.Component struct Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621; // UnityEngine.GameObject struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F; // UnityEngine.MonoBehaviour struct MonoBehaviour_t4A60845CF505405AF8BE8C61CC07F75CADEF6429; // UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0; // UnityEngine.Texture2D struct Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C; IL2CPP_EXTERN_C RuntimeClass* ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Exception_t_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Path_t0B99A4B924A6FDF08814FFA8DD4CD121ED1A0752_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* RuntimeObject_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C RuntimeClass* Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C_il2cpp_TypeInfo_var; IL2CPP_EXTERN_C String_t* _stringLiteral0A3CF76AA4D046F4E79CDE3341E93210C22D0D9E; IL2CPP_EXTERN_C String_t* _stringLiteral339F5868588CFC8FDA4A1EC94EAD8F737C5FCFC0; IL2CPP_EXTERN_C String_t* _stringLiteral34D71611DCE9C30419B3C3EA42DC9426E931CDDE; IL2CPP_EXTERN_C String_t* _stringLiteral377ED966B3A8FCCD3BE787DDE011557F2EC947F9; IL2CPP_EXTERN_C String_t* _stringLiteral48022311225DF803178B78ACBDB71930DBF6C39C; IL2CPP_EXTERN_C String_t* _stringLiteral60C283FF6EF6CAD8B67415AE1A3C6BABD3477040; IL2CPP_EXTERN_C String_t* _stringLiteral64CC1194405FA366D9AE015C627F4609DEAC4879; IL2CPP_EXTERN_C String_t* _stringLiteral801DC5C3610D303D73C37E27B3D6F5AC9F7661DC; IL2CPP_EXTERN_C String_t* _stringLiteralA04667285B0D56FA5C9AD66F9249C0C461B42CCD; IL2CPP_EXTERN_C String_t* _stringLiteralA6E98DBB2BD82CB83A4EB01F4DFB5062494F8E28; IL2CPP_EXTERN_C String_t* _stringLiteralA9665AEBBC97FA16750B210FDAC0B5D502F8322D; IL2CPP_EXTERN_C String_t* _stringLiteralB3F0D81387C1211E197E16C94BFDA6583BC874F9; IL2CPP_EXTERN_C String_t* _stringLiteralD2BFCAA4D83D4D9184D3BFF9BECDA1C5341E74DE; IL2CPP_EXTERN_C String_t* _stringLiteralDCDFD41CB6E96E78736DEB5F5ADD6F6311DA8E80; IL2CPP_EXTERN_C const RuntimeMethod* GameObject_AddComponent_TisNCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_m91678FB65CA0F4DA054C800CD5A13E4B23347CEE_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* NativeCamera_GetImageProperties_m909DD926A83944214B79AAC5CF74961CC80F01C1_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* NativeCamera_GetVideoProperties_mEC3BBA727CCAA9A360BD9FB659E4C400232A20E1_RuntimeMethod_var; IL2CPP_EXTERN_C const RuntimeMethod* NativeCamera_LoadImageAtPath_mEB1EDFDF65404F1B660246C33677F18C90E0B1EE_RuntimeMethod_var; IL2CPP_EXTERN_C const uint32_t NCCameraCallbackiOS_Initialize_m389551BB3149858479025978267F9E27527CCC56_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86EAssemblyU2DCSharpU2Dfirstpass_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65AssemblyU2DCSharpU2Dfirstpass_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_CanOpenSettings_m697BFB37AECD15F1BAF7022B21FC06A8C718A6BA_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_CheckPermission_m872C5E63BEC84EAD075C79E5743B41767BC55432_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_DeviceHasCamera_mC628329B38F1F072DF9496DD44C6F9463DFB6243_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_GetImageProperties_m909DD926A83944214B79AAC5CF74961CC80F01C1_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_GetVideoProperties_mEC3BBA727CCAA9A360BD9FB659E4C400232A20E1_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_LoadImageAtPath_mEB1EDFDF65404F1B660246C33677F18C90E0B1EE_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_OpenSettings_mAE9E395380119AAA74BB16ABA44F70D47C3DD577_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_RecordVideo_mCDE7F10F8D9AFA21A8C2BDCF7F953134827DE050_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_RequestPermission_mE63541DCC27642F05940FAF66DAAD4CF769DA128_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_TakePicture_m2BCB1DF3311DF2396EEBDCD8090FF7391C3D352E_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_get_IOSSelectedImagePath_m7556979AFB1BA8269ABCFBA1B64407B1BC747D36_MetadataUsageId; IL2CPP_EXTERN_C const uint32_t NativeCamera_get_TemporaryImagePath_m6C9F9DABC6EB1341EEB6BAB597375A8A91A8CAE7_MetadataUsageId; struct Delegate_t_marshaled_com; struct Delegate_t_marshaled_pinvoke; struct Exception_t_marshaled_com; struct Exception_t_marshaled_pinvoke; struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821; struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2; struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86; struct StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E; IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // <Module> struct U3CModuleU3E_tF157A75827DFDE1F9E89CA3CBB54B07FA9E227FC { public: public: }; // System.Object // NativeCamera struct NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424 : public RuntimeObject { public: public: }; struct NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields { public: // System.String NativeCamera::m_temporaryImagePath String_t* ___m_temporaryImagePath_0; // System.String NativeCamera::m_iOSSelectedImagePath String_t* ___m_iOSSelectedImagePath_1; public: inline static int32_t get_offset_of_m_temporaryImagePath_0() { return static_cast<int32_t>(offsetof(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields, ___m_temporaryImagePath_0)); } inline String_t* get_m_temporaryImagePath_0() const { return ___m_temporaryImagePath_0; } inline String_t** get_address_of_m_temporaryImagePath_0() { return &___m_temporaryImagePath_0; } inline void set_m_temporaryImagePath_0(String_t* value) { ___m_temporaryImagePath_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_temporaryImagePath_0), (void*)value); } inline static int32_t get_offset_of_m_iOSSelectedImagePath_1() { return static_cast<int32_t>(offsetof(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields, ___m_iOSSelectedImagePath_1)); } inline String_t* get_m_iOSSelectedImagePath_1() const { return ___m_iOSSelectedImagePath_1; } inline String_t** get_address_of_m_iOSSelectedImagePath_1() { return &___m_iOSSelectedImagePath_1; } inline void set_m_iOSSelectedImagePath_1(String_t* value) { ___m_iOSSelectedImagePath_1 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_iOSSelectedImagePath_1), (void*)value); } }; struct Il2CppArrayBounds; // System.Array // System.MarshalByRefObject struct MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF : public RuntimeObject { public: // System.Object System.MarshalByRefObject::_identity RuntimeObject * ____identity_0; public: inline static int32_t get_offset_of__identity_0() { return static_cast<int32_t>(offsetof(MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF, ____identity_0)); } inline RuntimeObject * get__identity_0() const { return ____identity_0; } inline RuntimeObject ** get_address_of__identity_0() { return &____identity_0; } inline void set__identity_0(RuntimeObject * value) { ____identity_0 = value; Il2CppCodeGenWriteBarrier((void**)(&____identity_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.MarshalByRefObject struct MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF_marshaled_pinvoke { Il2CppIUnknown* ____identity_0; }; // Native definition for COM marshalling of System.MarshalByRefObject struct MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF_marshaled_com { Il2CppIUnknown* ____identity_0; }; // System.String struct String_t : public RuntimeObject { public: // System.Int32 System.String::m_stringLength int32_t ___m_stringLength_0; // System.Char System.String::m_firstChar Il2CppChar ___m_firstChar_1; public: inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); } inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; } inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; } inline void set_m_stringLength_0(int32_t value) { ___m_stringLength_0 = value; } inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); } inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; } inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; } inline void set_m_firstChar_1(Il2CppChar value) { ___m_firstChar_1 = value; } }; struct String_t_StaticFields { public: // System.String System.String::Empty String_t* ___Empty_5; public: inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); } inline String_t* get_Empty_5() const { return ___Empty_5; } inline String_t** get_address_of_Empty_5() { return &___Empty_5; } inline void set_Empty_5(String_t* value) { ___Empty_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value); } }; // System.ValueType struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject { public: public: }; // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com { }; // NativeCamera_VideoProperties struct VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050 { public: // System.Int32 NativeCamera_VideoProperties::width int32_t ___width_0; // System.Int32 NativeCamera_VideoProperties::height int32_t ___height_1; // System.Int64 NativeCamera_VideoProperties::duration int64_t ___duration_2; // System.Single NativeCamera_VideoProperties::rotation float ___rotation_3; public: inline static int32_t get_offset_of_width_0() { return static_cast<int32_t>(offsetof(VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050, ___width_0)); } inline int32_t get_width_0() const { return ___width_0; } inline int32_t* get_address_of_width_0() { return &___width_0; } inline void set_width_0(int32_t value) { ___width_0 = value; } inline static int32_t get_offset_of_height_1() { return static_cast<int32_t>(offsetof(VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050, ___height_1)); } inline int32_t get_height_1() const { return ___height_1; } inline int32_t* get_address_of_height_1() { return &___height_1; } inline void set_height_1(int32_t value) { ___height_1 = value; } inline static int32_t get_offset_of_duration_2() { return static_cast<int32_t>(offsetof(VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050, ___duration_2)); } inline int64_t get_duration_2() const { return ___duration_2; } inline int64_t* get_address_of_duration_2() { return &___duration_2; } inline void set_duration_2(int64_t value) { ___duration_2 = value; } inline static int32_t get_offset_of_rotation_3() { return static_cast<int32_t>(offsetof(VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050, ___rotation_3)); } inline float get_rotation_3() const { return ___rotation_3; } inline float* get_address_of_rotation_3() { return &___rotation_3; } inline void set_rotation_3(float value) { ___rotation_3 = value; } }; // System.Boolean struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C { public: // System.Boolean System.Boolean::m_value bool ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); } inline bool get_m_value_0() const { return ___m_value_0; } inline bool* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(bool value) { ___m_value_0 = value; } }; struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields { public: // System.String System.Boolean::TrueString String_t* ___TrueString_5; // System.String System.Boolean::FalseString String_t* ___FalseString_6; public: inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); } inline String_t* get_TrueString_5() const { return ___TrueString_5; } inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; } inline void set_TrueString_5(String_t* value) { ___TrueString_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value); } inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); } inline String_t* get_FalseString_6() const { return ___FalseString_6; } inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; } inline void set_FalseString_6(String_t* value) { ___FalseString_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value); } }; // System.Byte struct Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07 { public: // System.Byte System.Byte::m_value uint8_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Byte_tF87C579059BD4633E6840EBBBEEF899C6E33EF07, ___m_value_0)); } inline uint8_t get_m_value_0() const { return ___m_value_0; } inline uint8_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint8_t value) { ___m_value_0 = value; } }; // System.Char struct Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9 { public: // System.Char System.Char::m_value Il2CppChar ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9, ___m_value_0)); } inline Il2CppChar get_m_value_0() const { return ___m_value_0; } inline Il2CppChar* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(Il2CppChar value) { ___m_value_0 = value; } }; struct Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_StaticFields { public: // System.Byte[] System.Char::categoryForLatin1 ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___categoryForLatin1_3; public: inline static int32_t get_offset_of_categoryForLatin1_3() { return static_cast<int32_t>(offsetof(Char_tBF22D9FC341BE970735250BB6FF1A4A92BBA58B9_StaticFields, ___categoryForLatin1_3)); } inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* get_categoryForLatin1_3() const { return ___categoryForLatin1_3; } inline ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821** get_address_of_categoryForLatin1_3() { return &___categoryForLatin1_3; } inline void set_categoryForLatin1_3(ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* value) { ___categoryForLatin1_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___categoryForLatin1_3), (void*)value); } }; // System.Enum struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521 : public ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF { public: public: }; struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields { public: // System.Char[] System.Enum::enumSeperatorCharArray CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___enumSeperatorCharArray_0; public: inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields, ___enumSeperatorCharArray_0)); } inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; } inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; } inline void set_enumSeperatorCharArray_0(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value) { ___enumSeperatorCharArray_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Enum struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_pinvoke { }; // Native definition for COM marshalling of System.Enum struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_com { }; // System.Int32 struct Int32_t585191389E07734F19F3156FF88FB3EF4800D102 { public: // System.Int32 System.Int32::m_value int32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t585191389E07734F19F3156FF88FB3EF4800D102, ___m_value_0)); } inline int32_t get_m_value_0() const { return ___m_value_0; } inline int32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int32_t value) { ___m_value_0 = value; } }; // System.Int64 struct Int64_t7A386C2FF7B0280A0F516992401DDFCF0FF7B436 { public: // System.Int64 System.Int64::m_value int64_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int64_t7A386C2FF7B0280A0F516992401DDFCF0FF7B436, ___m_value_0)); } inline int64_t get_m_value_0() const { return ___m_value_0; } inline int64_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int64_t value) { ___m_value_0 = value; } }; // System.IntPtr struct IntPtr_t { public: // System.Void* System.IntPtr::m_value void* ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); } inline void* get_m_value_0() const { return ___m_value_0; } inline void** get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(void* value) { ___m_value_0 = value; } }; struct IntPtr_t_StaticFields { public: // System.IntPtr System.IntPtr::Zero intptr_t ___Zero_1; public: inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); } inline intptr_t get_Zero_1() const { return ___Zero_1; } inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; } inline void set_Zero_1(intptr_t value) { ___Zero_1 = value; } }; // System.Single struct Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1 { public: // System.Single System.Single::m_value float ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1, ___m_value_0)); } inline float get_m_value_0() const { return ___m_value_0; } inline float* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(float value) { ___m_value_0 = value; } }; // System.Void struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017 { public: union { struct { }; uint8_t Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017__padding[1]; }; public: }; // NativeCamera_ImageOrientation struct ImageOrientation_t0B53CBC1D28E80F1208BA0D9F8005E074AB79ABE { public: // System.Int32 NativeCamera_ImageOrientation::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ImageOrientation_t0B53CBC1D28E80F1208BA0D9F8005E074AB79ABE, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // NativeCamera_Permission struct Permission_t30E58DD7775CD8D9BFF9E948B9A26A0913321B75 { public: // System.Int32 NativeCamera_Permission::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(Permission_t30E58DD7775CD8D9BFF9E948B9A26A0913321B75, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // NativeCamera_PreferredCamera struct PreferredCamera_t3ED3DC2614A33BA5617D2487F5E3C1FF2BF5CB14 { public: // System.Int32 NativeCamera_PreferredCamera::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(PreferredCamera_t3ED3DC2614A33BA5617D2487F5E3C1FF2BF5CB14, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // NativeCamera_Quality struct Quality_t10D54B26DF732EFA3D252BD3EB895D30E768DFEC { public: // System.Int32 NativeCamera_Quality::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(Quality_t10D54B26DF732EFA3D252BD3EB895D30E768DFEC, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // System.Delegate struct Delegate_t : public RuntimeObject { public: // System.IntPtr System.Delegate::method_ptr Il2CppMethodPointer ___method_ptr_0; // System.IntPtr System.Delegate::invoke_impl intptr_t ___invoke_impl_1; // System.Object System.Delegate::m_target RuntimeObject * ___m_target_2; // System.IntPtr System.Delegate::method intptr_t ___method_3; // System.IntPtr System.Delegate::delegate_trampoline intptr_t ___delegate_trampoline_4; // System.IntPtr System.Delegate::extra_arg intptr_t ___extra_arg_5; // System.IntPtr System.Delegate::method_code intptr_t ___method_code_6; // System.Reflection.MethodInfo System.Delegate::method_info MethodInfo_t * ___method_info_7; // System.Reflection.MethodInfo System.Delegate::original_method_info MethodInfo_t * ___original_method_info_8; // System.DelegateData System.Delegate::data DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9; // System.Boolean System.Delegate::method_is_virtual bool ___method_is_virtual_10; public: inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_ptr_0)); } inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; } inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; } inline void set_method_ptr_0(Il2CppMethodPointer value) { ___method_ptr_0 = value; } inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t, ___invoke_impl_1)); } inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; } inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; } inline void set_invoke_impl_1(intptr_t value) { ___invoke_impl_1 = value; } inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t, ___m_target_2)); } inline RuntimeObject * get_m_target_2() const { return ___m_target_2; } inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; } inline void set_m_target_2(RuntimeObject * value) { ___m_target_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_target_2), (void*)value); } inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_3)); } inline intptr_t get_method_3() const { return ___method_3; } inline intptr_t* get_address_of_method_3() { return &___method_3; } inline void set_method_3(intptr_t value) { ___method_3 = value; } inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t, ___delegate_trampoline_4)); } inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; } inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; } inline void set_delegate_trampoline_4(intptr_t value) { ___delegate_trampoline_4 = value; } inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t, ___extra_arg_5)); } inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; } inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; } inline void set_extra_arg_5(intptr_t value) { ___extra_arg_5 = value; } inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_code_6)); } inline intptr_t get_method_code_6() const { return ___method_code_6; } inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; } inline void set_method_code_6(intptr_t value) { ___method_code_6 = value; } inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_info_7)); } inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; } inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; } inline void set_method_info_7(MethodInfo_t * value) { ___method_info_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___method_info_7), (void*)value); } inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t, ___original_method_info_8)); } inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; } inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; } inline void set_original_method_info_8(MethodInfo_t * value) { ___original_method_info_8 = value; Il2CppCodeGenWriteBarrier((void**)(&___original_method_info_8), (void*)value); } inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t, ___data_9)); } inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * get_data_9() const { return ___data_9; } inline DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE ** get_address_of_data_9() { return &___data_9; } inline void set_data_9(DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * value) { ___data_9 = value; Il2CppCodeGenWriteBarrier((void**)(&___data_9), (void*)value); } inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t, ___method_is_virtual_10)); } inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; } inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; } inline void set_method_is_virtual_10(bool value) { ___method_is_virtual_10 = value; } }; // Native definition for P/Invoke marshalling of System.Delegate struct Delegate_t_marshaled_pinvoke { intptr_t ___method_ptr_0; intptr_t ___invoke_impl_1; Il2CppIUnknown* ___m_target_2; intptr_t ___method_3; intptr_t ___delegate_trampoline_4; intptr_t ___extra_arg_5; intptr_t ___method_code_6; MethodInfo_t * ___method_info_7; MethodInfo_t * ___original_method_info_8; DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9; int32_t ___method_is_virtual_10; }; // Native definition for COM marshalling of System.Delegate struct Delegate_t_marshaled_com { intptr_t ___method_ptr_0; intptr_t ___invoke_impl_1; Il2CppIUnknown* ___m_target_2; intptr_t ___method_3; intptr_t ___delegate_trampoline_4; intptr_t ___extra_arg_5; intptr_t ___method_code_6; MethodInfo_t * ___method_info_7; MethodInfo_t * ___original_method_info_8; DelegateData_t1BF9F691B56DAE5F8C28C5E084FDE94F15F27BBE * ___data_9; int32_t ___method_is_virtual_10; }; // System.Exception struct Exception_t : public RuntimeObject { public: // System.String System.Exception::_className String_t* ____className_1; // System.String System.Exception::_message String_t* ____message_2; // System.Collections.IDictionary System.Exception::_data RuntimeObject* ____data_3; // System.Exception System.Exception::_innerException Exception_t * ____innerException_4; // System.String System.Exception::_helpURL String_t* ____helpURL_5; // System.Object System.Exception::_stackTrace RuntimeObject * ____stackTrace_6; // System.String System.Exception::_stackTraceString String_t* ____stackTraceString_7; // System.String System.Exception::_remoteStackTraceString String_t* ____remoteStackTraceString_8; // System.Int32 System.Exception::_remoteStackIndex int32_t ____remoteStackIndex_9; // System.Object System.Exception::_dynamicMethods RuntimeObject * ____dynamicMethods_10; // System.Int32 System.Exception::_HResult int32_t ____HResult_11; // System.String System.Exception::_source String_t* ____source_12; // System.Runtime.Serialization.SafeSerializationManager System.Exception::_safeSerializationManager SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13; // System.Diagnostics.StackTrace[] System.Exception::captured_traces StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14; // System.IntPtr[] System.Exception::native_trace_ips IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* ___native_trace_ips_15; public: inline static int32_t get_offset_of__className_1() { return static_cast<int32_t>(offsetof(Exception_t, ____className_1)); } inline String_t* get__className_1() const { return ____className_1; } inline String_t** get_address_of__className_1() { return &____className_1; } inline void set__className_1(String_t* value) { ____className_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____className_1), (void*)value); } inline static int32_t get_offset_of__message_2() { return static_cast<int32_t>(offsetof(Exception_t, ____message_2)); } inline String_t* get__message_2() const { return ____message_2; } inline String_t** get_address_of__message_2() { return &____message_2; } inline void set__message_2(String_t* value) { ____message_2 = value; Il2CppCodeGenWriteBarrier((void**)(&____message_2), (void*)value); } inline static int32_t get_offset_of__data_3() { return static_cast<int32_t>(offsetof(Exception_t, ____data_3)); } inline RuntimeObject* get__data_3() const { return ____data_3; } inline RuntimeObject** get_address_of__data_3() { return &____data_3; } inline void set__data_3(RuntimeObject* value) { ____data_3 = value; Il2CppCodeGenWriteBarrier((void**)(&____data_3), (void*)value); } inline static int32_t get_offset_of__innerException_4() { return static_cast<int32_t>(offsetof(Exception_t, ____innerException_4)); } inline Exception_t * get__innerException_4() const { return ____innerException_4; } inline Exception_t ** get_address_of__innerException_4() { return &____innerException_4; } inline void set__innerException_4(Exception_t * value) { ____innerException_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____innerException_4), (void*)value); } inline static int32_t get_offset_of__helpURL_5() { return static_cast<int32_t>(offsetof(Exception_t, ____helpURL_5)); } inline String_t* get__helpURL_5() const { return ____helpURL_5; } inline String_t** get_address_of__helpURL_5() { return &____helpURL_5; } inline void set__helpURL_5(String_t* value) { ____helpURL_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____helpURL_5), (void*)value); } inline static int32_t get_offset_of__stackTrace_6() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTrace_6)); } inline RuntimeObject * get__stackTrace_6() const { return ____stackTrace_6; } inline RuntimeObject ** get_address_of__stackTrace_6() { return &____stackTrace_6; } inline void set__stackTrace_6(RuntimeObject * value) { ____stackTrace_6 = value; Il2CppCodeGenWriteBarrier((void**)(&____stackTrace_6), (void*)value); } inline static int32_t get_offset_of__stackTraceString_7() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTraceString_7)); } inline String_t* get__stackTraceString_7() const { return ____stackTraceString_7; } inline String_t** get_address_of__stackTraceString_7() { return &____stackTraceString_7; } inline void set__stackTraceString_7(String_t* value) { ____stackTraceString_7 = value; Il2CppCodeGenWriteBarrier((void**)(&____stackTraceString_7), (void*)value); } inline static int32_t get_offset_of__remoteStackTraceString_8() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_8)); } inline String_t* get__remoteStackTraceString_8() const { return ____remoteStackTraceString_8; } inline String_t** get_address_of__remoteStackTraceString_8() { return &____remoteStackTraceString_8; } inline void set__remoteStackTraceString_8(String_t* value) { ____remoteStackTraceString_8 = value; Il2CppCodeGenWriteBarrier((void**)(&____remoteStackTraceString_8), (void*)value); } inline static int32_t get_offset_of__remoteStackIndex_9() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackIndex_9)); } inline int32_t get__remoteStackIndex_9() const { return ____remoteStackIndex_9; } inline int32_t* get_address_of__remoteStackIndex_9() { return &____remoteStackIndex_9; } inline void set__remoteStackIndex_9(int32_t value) { ____remoteStackIndex_9 = value; } inline static int32_t get_offset_of__dynamicMethods_10() { return static_cast<int32_t>(offsetof(Exception_t, ____dynamicMethods_10)); } inline RuntimeObject * get__dynamicMethods_10() const { return ____dynamicMethods_10; } inline RuntimeObject ** get_address_of__dynamicMethods_10() { return &____dynamicMethods_10; } inline void set__dynamicMethods_10(RuntimeObject * value) { ____dynamicMethods_10 = value; Il2CppCodeGenWriteBarrier((void**)(&____dynamicMethods_10), (void*)value); } inline static int32_t get_offset_of__HResult_11() { return static_cast<int32_t>(offsetof(Exception_t, ____HResult_11)); } inline int32_t get__HResult_11() const { return ____HResult_11; } inline int32_t* get_address_of__HResult_11() { return &____HResult_11; } inline void set__HResult_11(int32_t value) { ____HResult_11 = value; } inline static int32_t get_offset_of__source_12() { return static_cast<int32_t>(offsetof(Exception_t, ____source_12)); } inline String_t* get__source_12() const { return ____source_12; } inline String_t** get_address_of__source_12() { return &____source_12; } inline void set__source_12(String_t* value) { ____source_12 = value; Il2CppCodeGenWriteBarrier((void**)(&____source_12), (void*)value); } inline static int32_t get_offset_of__safeSerializationManager_13() { return static_cast<int32_t>(offsetof(Exception_t, ____safeSerializationManager_13)); } inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * get__safeSerializationManager_13() const { return ____safeSerializationManager_13; } inline SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 ** get_address_of__safeSerializationManager_13() { return &____safeSerializationManager_13; } inline void set__safeSerializationManager_13(SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * value) { ____safeSerializationManager_13 = value; Il2CppCodeGenWriteBarrier((void**)(&____safeSerializationManager_13), (void*)value); } inline static int32_t get_offset_of_captured_traces_14() { return static_cast<int32_t>(offsetof(Exception_t, ___captured_traces_14)); } inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* get_captured_traces_14() const { return ___captured_traces_14; } inline StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196** get_address_of_captured_traces_14() { return &___captured_traces_14; } inline void set_captured_traces_14(StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* value) { ___captured_traces_14 = value; Il2CppCodeGenWriteBarrier((void**)(&___captured_traces_14), (void*)value); } inline static int32_t get_offset_of_native_trace_ips_15() { return static_cast<int32_t>(offsetof(Exception_t, ___native_trace_ips_15)); } inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* get_native_trace_ips_15() const { return ___native_trace_ips_15; } inline IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD** get_address_of_native_trace_ips_15() { return &___native_trace_ips_15; } inline void set_native_trace_ips_15(IntPtrU5BU5D_t4DC01DCB9A6DF6C9792A6513595D7A11E637DCDD* value) { ___native_trace_ips_15 = value; Il2CppCodeGenWriteBarrier((void**)(&___native_trace_ips_15), (void*)value); } }; struct Exception_t_StaticFields { public: // System.Object System.Exception::s_EDILock RuntimeObject * ___s_EDILock_0; public: inline static int32_t get_offset_of_s_EDILock_0() { return static_cast<int32_t>(offsetof(Exception_t_StaticFields, ___s_EDILock_0)); } inline RuntimeObject * get_s_EDILock_0() const { return ___s_EDILock_0; } inline RuntimeObject ** get_address_of_s_EDILock_0() { return &___s_EDILock_0; } inline void set_s_EDILock_0(RuntimeObject * value) { ___s_EDILock_0 = value; Il2CppCodeGenWriteBarrier((void**)(&___s_EDILock_0), (void*)value); } }; // Native definition for P/Invoke marshalling of System.Exception struct Exception_t_marshaled_pinvoke { char* ____className_1; char* ____message_2; RuntimeObject* ____data_3; Exception_t_marshaled_pinvoke* ____innerException_4; char* ____helpURL_5; Il2CppIUnknown* ____stackTrace_6; char* ____stackTraceString_7; char* ____remoteStackTraceString_8; int32_t ____remoteStackIndex_9; Il2CppIUnknown* ____dynamicMethods_10; int32_t ____HResult_11; char* ____source_12; SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13; StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14; Il2CppSafeArray/*INT*/* ___native_trace_ips_15; }; // Native definition for COM marshalling of System.Exception struct Exception_t_marshaled_com { Il2CppChar* ____className_1; Il2CppChar* ____message_2; RuntimeObject* ____data_3; Exception_t_marshaled_com* ____innerException_4; Il2CppChar* ____helpURL_5; Il2CppIUnknown* ____stackTrace_6; Il2CppChar* ____stackTraceString_7; Il2CppChar* ____remoteStackTraceString_8; int32_t ____remoteStackIndex_9; Il2CppIUnknown* ____dynamicMethods_10; int32_t ____HResult_11; Il2CppChar* ____source_12; SafeSerializationManager_t4A754D86B0F784B18CBC36C073BA564BED109770 * ____safeSerializationManager_13; StackTraceU5BU5D_t855F09649EA34DEE7C1B6F088E0538E3CCC3F196* ___captured_traces_14; Il2CppSafeArray/*INT*/* ___native_trace_ips_15; }; // System.IO.FileAttributes struct FileAttributes_t224B42F6F82954C94B51791913857C005C559876 { public: // System.Int32 System.IO.FileAttributes::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(FileAttributes_t224B42F6F82954C94B51791913857C005C559876, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 : public RuntimeObject { public: // System.IntPtr UnityEngine.Object::m_CachedPtr intptr_t ___m_CachedPtr_0; public: inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0, ___m_CachedPtr_0)); } inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; } inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; } inline void set_m_CachedPtr_0(intptr_t value) { ___m_CachedPtr_0 = value; } }; struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields { public: // System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1; public: inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); } inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; } inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; } inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value) { ___OffsetOfInstanceIDInCPlusPlusObject_1 = value; } }; // Native definition for P/Invoke marshalling of UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke { intptr_t ___m_CachedPtr_0; }; // Native definition for COM marshalling of UnityEngine.Object struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com { intptr_t ___m_CachedPtr_0; }; // UnityEngine.TextureFormat struct TextureFormat_t7C6B5101554065C47682E592D1E26079D4EC2DCE { public: // System.Int32 UnityEngine.TextureFormat::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TextureFormat_t7C6B5101554065C47682E592D1E26079D4EC2DCE, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; // NativeCamera_ImageProperties struct ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90 { public: // System.Int32 NativeCamera_ImageProperties::width int32_t ___width_0; // System.Int32 NativeCamera_ImageProperties::height int32_t ___height_1; // System.String NativeCamera_ImageProperties::mimeType String_t* ___mimeType_2; // NativeCamera_ImageOrientation NativeCamera_ImageProperties::orientation int32_t ___orientation_3; public: inline static int32_t get_offset_of_width_0() { return static_cast<int32_t>(offsetof(ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90, ___width_0)); } inline int32_t get_width_0() const { return ___width_0; } inline int32_t* get_address_of_width_0() { return &___width_0; } inline void set_width_0(int32_t value) { ___width_0 = value; } inline static int32_t get_offset_of_height_1() { return static_cast<int32_t>(offsetof(ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90, ___height_1)); } inline int32_t get_height_1() const { return ___height_1; } inline int32_t* get_address_of_height_1() { return &___height_1; } inline void set_height_1(int32_t value) { ___height_1 = value; } inline static int32_t get_offset_of_mimeType_2() { return static_cast<int32_t>(offsetof(ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90, ___mimeType_2)); } inline String_t* get_mimeType_2() const { return ___mimeType_2; } inline String_t** get_address_of_mimeType_2() { return &___mimeType_2; } inline void set_mimeType_2(String_t* value) { ___mimeType_2 = value; Il2CppCodeGenWriteBarrier((void**)(&___mimeType_2), (void*)value); } inline static int32_t get_offset_of_orientation_3() { return static_cast<int32_t>(offsetof(ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90, ___orientation_3)); } inline int32_t get_orientation_3() const { return ___orientation_3; } inline int32_t* get_address_of_orientation_3() { return &___orientation_3; } inline void set_orientation_3(int32_t value) { ___orientation_3 = value; } }; // Native definition for P/Invoke marshalling of NativeCamera/ImageProperties struct ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_pinvoke { int32_t ___width_0; int32_t ___height_1; char* ___mimeType_2; int32_t ___orientation_3; }; // Native definition for COM marshalling of NativeCamera/ImageProperties struct ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_com { int32_t ___width_0; int32_t ___height_1; Il2CppChar* ___mimeType_2; int32_t ___orientation_3; }; // System.IO.MonoIOStat struct MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124 { public: // System.IO.FileAttributes System.IO.MonoIOStat::fileAttributes int32_t ___fileAttributes_0; // System.Int64 System.IO.MonoIOStat::Length int64_t ___Length_1; // System.Int64 System.IO.MonoIOStat::CreationTime int64_t ___CreationTime_2; // System.Int64 System.IO.MonoIOStat::LastAccessTime int64_t ___LastAccessTime_3; // System.Int64 System.IO.MonoIOStat::LastWriteTime int64_t ___LastWriteTime_4; public: inline static int32_t get_offset_of_fileAttributes_0() { return static_cast<int32_t>(offsetof(MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124, ___fileAttributes_0)); } inline int32_t get_fileAttributes_0() const { return ___fileAttributes_0; } inline int32_t* get_address_of_fileAttributes_0() { return &___fileAttributes_0; } inline void set_fileAttributes_0(int32_t value) { ___fileAttributes_0 = value; } inline static int32_t get_offset_of_Length_1() { return static_cast<int32_t>(offsetof(MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124, ___Length_1)); } inline int64_t get_Length_1() const { return ___Length_1; } inline int64_t* get_address_of_Length_1() { return &___Length_1; } inline void set_Length_1(int64_t value) { ___Length_1 = value; } inline static int32_t get_offset_of_CreationTime_2() { return static_cast<int32_t>(offsetof(MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124, ___CreationTime_2)); } inline int64_t get_CreationTime_2() const { return ___CreationTime_2; } inline int64_t* get_address_of_CreationTime_2() { return &___CreationTime_2; } inline void set_CreationTime_2(int64_t value) { ___CreationTime_2 = value; } inline static int32_t get_offset_of_LastAccessTime_3() { return static_cast<int32_t>(offsetof(MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124, ___LastAccessTime_3)); } inline int64_t get_LastAccessTime_3() const { return ___LastAccessTime_3; } inline int64_t* get_address_of_LastAccessTime_3() { return &___LastAccessTime_3; } inline void set_LastAccessTime_3(int64_t value) { ___LastAccessTime_3 = value; } inline static int32_t get_offset_of_LastWriteTime_4() { return static_cast<int32_t>(offsetof(MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124, ___LastWriteTime_4)); } inline int64_t get_LastWriteTime_4() const { return ___LastWriteTime_4; } inline int64_t* get_address_of_LastWriteTime_4() { return &___LastWriteTime_4; } inline void set_LastWriteTime_4(int64_t value) { ___LastWriteTime_4 = value; } }; // System.MulticastDelegate struct MulticastDelegate_t : public Delegate_t { public: // System.Delegate[] System.MulticastDelegate::delegates DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* ___delegates_11; public: inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); } inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* get_delegates_11() const { return ___delegates_11; } inline DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86** get_address_of_delegates_11() { return &___delegates_11; } inline void set_delegates_11(DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* value) { ___delegates_11 = value; Il2CppCodeGenWriteBarrier((void**)(&___delegates_11), (void*)value); } }; // Native definition for P/Invoke marshalling of System.MulticastDelegate struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t_marshaled_pinvoke { Delegate_t_marshaled_pinvoke** ___delegates_11; }; // Native definition for COM marshalling of System.MulticastDelegate struct MulticastDelegate_t_marshaled_com : public Delegate_t_marshaled_com { Delegate_t_marshaled_com** ___delegates_11; }; // System.SystemException struct SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782 : public Exception_t { public: public: }; // UnityEngine.Component struct Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 { public: public: }; // UnityEngine.GameObject struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 { public: public: }; // UnityEngine.Texture struct Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 { public: public: }; struct Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4_StaticFields { public: // System.Int32 UnityEngine.Texture::GenerateAllMips int32_t ___GenerateAllMips_4; public: inline static int32_t get_offset_of_GenerateAllMips_4() { return static_cast<int32_t>(offsetof(Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4_StaticFields, ___GenerateAllMips_4)); } inline int32_t get_GenerateAllMips_4() const { return ___GenerateAllMips_4; } inline int32_t* get_address_of_GenerateAllMips_4() { return &___GenerateAllMips_4; } inline void set_GenerateAllMips_4(int32_t value) { ___GenerateAllMips_4 = value; } }; // NativeCamera_CameraCallback struct CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 : public MulticastDelegate_t { public: public: }; // System.ArgumentException struct ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1 : public SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782 { public: // System.String System.ArgumentException::m_paramName String_t* ___m_paramName_17; public: inline static int32_t get_offset_of_m_paramName_17() { return static_cast<int32_t>(offsetof(ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1, ___m_paramName_17)); } inline String_t* get_m_paramName_17() const { return ___m_paramName_17; } inline String_t** get_address_of_m_paramName_17() { return &___m_paramName_17; } inline void set_m_paramName_17(String_t* value) { ___m_paramName_17 = value; Il2CppCodeGenWriteBarrier((void**)(&___m_paramName_17), (void*)value); } }; // System.AsyncCallback struct AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 : public MulticastDelegate_t { public: public: }; // System.IO.FileSystemInfo struct FileSystemInfo_t6831B76FBA37F7181E4A5AEB28194730EB356A3D : public MarshalByRefObject_tC4577953D0A44D0AB8597CFA868E01C858B1C9AF { public: // System.IO.MonoIOStat System.IO.FileSystemInfo::_data MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124 ____data_1; // System.Int32 System.IO.FileSystemInfo::_dataInitialised int32_t ____dataInitialised_2; // System.String System.IO.FileSystemInfo::FullPath String_t* ___FullPath_3; // System.String System.IO.FileSystemInfo::OriginalPath String_t* ___OriginalPath_4; // System.String System.IO.FileSystemInfo::_displayPath String_t* ____displayPath_5; public: inline static int32_t get_offset_of__data_1() { return static_cast<int32_t>(offsetof(FileSystemInfo_t6831B76FBA37F7181E4A5AEB28194730EB356A3D, ____data_1)); } inline MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124 get__data_1() const { return ____data_1; } inline MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124 * get_address_of__data_1() { return &____data_1; } inline void set__data_1(MonoIOStat_t819C03DA1902AA493BDBF4B55E76DCE6FB16A124 value) { ____data_1 = value; } inline static int32_t get_offset_of__dataInitialised_2() { return static_cast<int32_t>(offsetof(FileSystemInfo_t6831B76FBA37F7181E4A5AEB28194730EB356A3D, ____dataInitialised_2)); } inline int32_t get__dataInitialised_2() const { return ____dataInitialised_2; } inline int32_t* get_address_of__dataInitialised_2() { return &____dataInitialised_2; } inline void set__dataInitialised_2(int32_t value) { ____dataInitialised_2 = value; } inline static int32_t get_offset_of_FullPath_3() { return static_cast<int32_t>(offsetof(FileSystemInfo_t6831B76FBA37F7181E4A5AEB28194730EB356A3D, ___FullPath_3)); } inline String_t* get_FullPath_3() const { return ___FullPath_3; } inline String_t** get_address_of_FullPath_3() { return &___FullPath_3; } inline void set_FullPath_3(String_t* value) { ___FullPath_3 = value; Il2CppCodeGenWriteBarrier((void**)(&___FullPath_3), (void*)value); } inline static int32_t get_offset_of_OriginalPath_4() { return static_cast<int32_t>(offsetof(FileSystemInfo_t6831B76FBA37F7181E4A5AEB28194730EB356A3D, ___OriginalPath_4)); } inline String_t* get_OriginalPath_4() const { return ___OriginalPath_4; } inline String_t** get_address_of_OriginalPath_4() { return &___OriginalPath_4; } inline void set_OriginalPath_4(String_t* value) { ___OriginalPath_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___OriginalPath_4), (void*)value); } inline static int32_t get_offset_of__displayPath_5() { return static_cast<int32_t>(offsetof(FileSystemInfo_t6831B76FBA37F7181E4A5AEB28194730EB356A3D, ____displayPath_5)); } inline String_t* get__displayPath_5() const { return ____displayPath_5; } inline String_t** get_address_of__displayPath_5() { return &____displayPath_5; } inline void set__displayPath_5(String_t* value) { ____displayPath_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____displayPath_5), (void*)value); } }; // System.IO.IOException struct IOException_t60E052020EDE4D3075F57A1DCC224FF8864354BA : public SystemException_t5380468142AA850BE4A341D7AF3EAB9C78746782 { public: // System.String System.IO.IOException::_maybeFullPath String_t* ____maybeFullPath_17; public: inline static int32_t get_offset_of__maybeFullPath_17() { return static_cast<int32_t>(offsetof(IOException_t60E052020EDE4D3075F57A1DCC224FF8864354BA, ____maybeFullPath_17)); } inline String_t* get__maybeFullPath_17() const { return ____maybeFullPath_17; } inline String_t** get_address_of__maybeFullPath_17() { return &____maybeFullPath_17; } inline void set__maybeFullPath_17(String_t* value) { ____maybeFullPath_17 = value; Il2CppCodeGenWriteBarrier((void**)(&____maybeFullPath_17), (void*)value); } }; // UnityEngine.Behaviour struct Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8 : public Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 { public: public: }; // UnityEngine.Texture2D struct Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C : public Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4 { public: public: }; // System.IO.DirectoryInfo struct DirectoryInfo_t432CD06DF148701E930708371CB985BC0E8EF87F : public FileSystemInfo_t6831B76FBA37F7181E4A5AEB28194730EB356A3D { public: // System.String System.IO.DirectoryInfo::current String_t* ___current_6; // System.String System.IO.DirectoryInfo::parent String_t* ___parent_7; public: inline static int32_t get_offset_of_current_6() { return static_cast<int32_t>(offsetof(DirectoryInfo_t432CD06DF148701E930708371CB985BC0E8EF87F, ___current_6)); } inline String_t* get_current_6() const { return ___current_6; } inline String_t** get_address_of_current_6() { return &___current_6; } inline void set_current_6(String_t* value) { ___current_6 = value; Il2CppCodeGenWriteBarrier((void**)(&___current_6), (void*)value); } inline static int32_t get_offset_of_parent_7() { return static_cast<int32_t>(offsetof(DirectoryInfo_t432CD06DF148701E930708371CB985BC0E8EF87F, ___parent_7)); } inline String_t* get_parent_7() const { return ___parent_7; } inline String_t** get_address_of_parent_7() { return &___parent_7; } inline void set_parent_7(String_t* value) { ___parent_7 = value; Il2CppCodeGenWriteBarrier((void**)(&___parent_7), (void*)value); } }; // System.IO.FileNotFoundException struct FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 : public IOException_t60E052020EDE4D3075F57A1DCC224FF8864354BA { public: // System.String System.IO.FileNotFoundException::_fileName String_t* ____fileName_18; // System.String System.IO.FileNotFoundException::_fusionLog String_t* ____fusionLog_19; public: inline static int32_t get_offset_of__fileName_18() { return static_cast<int32_t>(offsetof(FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431, ____fileName_18)); } inline String_t* get__fileName_18() const { return ____fileName_18; } inline String_t** get_address_of__fileName_18() { return &____fileName_18; } inline void set__fileName_18(String_t* value) { ____fileName_18 = value; Il2CppCodeGenWriteBarrier((void**)(&____fileName_18), (void*)value); } inline static int32_t get_offset_of__fusionLog_19() { return static_cast<int32_t>(offsetof(FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431, ____fusionLog_19)); } inline String_t* get__fusionLog_19() const { return ____fusionLog_19; } inline String_t** get_address_of__fusionLog_19() { return &____fusionLog_19; } inline void set__fusionLog_19(String_t* value) { ____fusionLog_19 = value; Il2CppCodeGenWriteBarrier((void**)(&____fusionLog_19), (void*)value); } }; // UnityEngine.MonoBehaviour struct MonoBehaviour_t4A60845CF505405AF8BE8C61CC07F75CADEF6429 : public Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8 { public: public: }; // NativeCameraNamespace.NCCameraCallbackiOS struct NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 : public MonoBehaviour_t4A60845CF505405AF8BE8C61CC07F75CADEF6429 { public: // NativeCamera_CameraCallback NativeCameraNamespace.NCCameraCallbackiOS::callback CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * ___callback_5; // System.Single NativeCameraNamespace.NCCameraCallbackiOS::nextBusyCheckTime float ___nextBusyCheckTime_6; public: inline static int32_t get_offset_of_callback_5() { return static_cast<int32_t>(offsetof(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738, ___callback_5)); } inline CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * get_callback_5() const { return ___callback_5; } inline CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 ** get_address_of_callback_5() { return &___callback_5; } inline void set_callback_5(CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * value) { ___callback_5 = value; Il2CppCodeGenWriteBarrier((void**)(&___callback_5), (void*)value); } inline static int32_t get_offset_of_nextBusyCheckTime_6() { return static_cast<int32_t>(offsetof(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738, ___nextBusyCheckTime_6)); } inline float get_nextBusyCheckTime_6() const { return ___nextBusyCheckTime_6; } inline float* get_address_of_nextBusyCheckTime_6() { return &___nextBusyCheckTime_6; } inline void set_nextBusyCheckTime_6(float value) { ___nextBusyCheckTime_6 = value; } }; struct NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields { public: // NativeCameraNamespace.NCCameraCallbackiOS NativeCameraNamespace.NCCameraCallbackiOS::instance NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * ___instance_4; // System.Boolean NativeCameraNamespace.NCCameraCallbackiOS::<IsBusy>k__BackingField bool ___U3CIsBusyU3Ek__BackingField_7; public: inline static int32_t get_offset_of_instance_4() { return static_cast<int32_t>(offsetof(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields, ___instance_4)); } inline NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * get_instance_4() const { return ___instance_4; } inline NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 ** get_address_of_instance_4() { return &___instance_4; } inline void set_instance_4(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * value) { ___instance_4 = value; Il2CppCodeGenWriteBarrier((void**)(&___instance_4), (void*)value); } inline static int32_t get_offset_of_U3CIsBusyU3Ek__BackingField_7() { return static_cast<int32_t>(offsetof(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields, ___U3CIsBusyU3Ek__BackingField_7)); } inline bool get_U3CIsBusyU3Ek__BackingField_7() const { return ___U3CIsBusyU3Ek__BackingField_7; } inline bool* get_address_of_U3CIsBusyU3Ek__BackingField_7() { return &___U3CIsBusyU3Ek__BackingField_7; } inline void set_U3CIsBusyU3Ek__BackingField_7(bool value) { ___U3CIsBusyU3Ek__BackingField_7 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // System.Byte[] struct ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821 : public RuntimeArray { public: ALIGN_FIELD (8) uint8_t m_Items[1]; public: inline uint8_t GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline uint8_t* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, uint8_t value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline uint8_t GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline uint8_t* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, uint8_t value) { m_Items[index] = value; } }; // System.String[] struct StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E : public RuntimeArray { public: ALIGN_FIELD (8) String_t* m_Items[1]; public: inline String_t* GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline String_t** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, String_t* value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } inline String_t* GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline String_t** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, String_t* value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } }; // System.Char[] struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2 : public RuntimeArray { public: ALIGN_FIELD (8) Il2CppChar m_Items[1]; public: inline Il2CppChar GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Il2CppChar* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Il2CppChar value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline Il2CppChar GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Il2CppChar* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Il2CppChar value) { m_Items[index] = value; } }; // System.Delegate[] struct DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86 : public RuntimeArray { public: ALIGN_FIELD (8) Delegate_t * m_Items[1]; public: inline Delegate_t * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Delegate_t ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Delegate_t * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } inline Delegate_t * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Delegate_t ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Delegate_t * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value); } }; // !!0 UnityEngine.GameObject::AddComponent<System.Object>() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject * GameObject_AddComponent_TisRuntimeObject_m80EDFEAC4927F588A7A702F81524EDBFA8603FE2_gshared (GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * __this, const RuntimeMethod* method); // System.String UnityEngine.Application::get_temporaryCachePath() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* Application_get_temporaryCachePath_m6769909A405A6A5A0477F8E5F312920C8115E50C (const RuntimeMethod* method); // System.String System.IO.Path::Combine(System.String,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* Path_Combine_mA495A18104786EB450EC0E44EE0FB7F9040C4311 (String_t* ___path10, String_t* ___path21, const RuntimeMethod* method); // System.IO.DirectoryInfo System.IO.Directory::CreateDirectory(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR DirectoryInfo_t432CD06DF148701E930708371CB985BC0E8EF87F * Directory_CreateDirectory_m0C9CAA2ECA801C4D07EA35820DA0907402ED4D41 (String_t* ___path0, const RuntimeMethod* method); // System.Int32 NativeCamera::_NativeCamera_CheckPermission() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_CheckPermission_m7177988111E6B1EA2997331CC61B029D3E7B0F37 (const RuntimeMethod* method); // System.Int32 NativeCamera::_NativeCamera_RequestPermission() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_RequestPermission_mA107C9A75B51667CBC297B41A13A5B38C1E79F66 (const RuntimeMethod* method); // System.Int32 NativeCamera::_NativeCamera_CanOpenSettings() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_CanOpenSettings_m2FA92B005E0F2F15CD78D1EF3EA3981326582DB6 (const RuntimeMethod* method); // System.Void NativeCamera::_NativeCamera_OpenSettings() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera__NativeCamera_OpenSettings_m1D3396E62888A31B1A669D8ED9CB035910ABADBC (const RuntimeMethod* method); // NativeCamera/Permission NativeCamera::RequestPermission() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera_RequestPermission_mE63541DCC27642F05940FAF66DAAD4CF769DA128 (const RuntimeMethod* method); // System.Boolean NativeCamera::IsCameraBusy() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool NativeCamera_IsCameraBusy_m5F8CD70113132341D48A89FAF84EB6584B30B069 (const RuntimeMethod* method); // System.Int32 UnityEngine.SystemInfo::get_maxTextureSize() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t SystemInfo_get_maxTextureSize_m10A8228B83EE161D0DCCB9FB01279C245C47D0E3 (const RuntimeMethod* method); // System.Void NativeCameraNamespace.NCCameraCallbackiOS::Initialize(NativeCamera/CameraCallback) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NCCameraCallbackiOS_Initialize_m389551BB3149858479025978267F9E27527CCC56 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * ___callback0, const RuntimeMethod* method); // System.String NativeCamera::get_IOSSelectedImagePath() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera_get_IOSSelectedImagePath_m7556979AFB1BA8269ABCFBA1B64407B1BC747D36 (const RuntimeMethod* method); // System.String System.String::Concat(System.String,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* String_Concat_mB78D0094592718DA6D5DB6C712A9C225631666BE (String_t* ___str00, String_t* ___str11, const RuntimeMethod* method); // System.Void NativeCamera::_NativeCamera_TakePicture(System.String,System.Int32,System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera__NativeCamera_TakePicture_mF8B664C89E7BBDBFF10A69584B33C5D21869FCD4 (String_t* ___imageSavePath0, int32_t ___maxSize1, int32_t ___preferredCamera2, const RuntimeMethod* method); // System.Void NativeCamera::_NativeCamera_RecordVideo(System.Int32,System.Int32,System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera__NativeCamera_RecordVideo_m9A226E854A1989135CE2FE5A0CFD8584B8BA76FB (int32_t ___quality0, int32_t ___maxDuration1, int32_t ___preferredCamera2, const RuntimeMethod* method); // System.Int32 NativeCamera::_NativeCamera_HasCamera() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_HasCamera_mE0067C2324E3275B54040C34AAD769E1240362E3 (const RuntimeMethod* method); // System.Boolean NativeCameraNamespace.NCCameraCallbackiOS::get_IsBusy() IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR bool NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E_inline (const RuntimeMethod* method); // System.Boolean System.String::IsNullOrEmpty(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool String_IsNullOrEmpty_m06A85A206AC2106D1982826C5665B9BD35324229 (String_t* ___value0, const RuntimeMethod* method); // System.Void System.ArgumentException::.ctor(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ArgumentException__ctor_m9A85EF7FEFEC21DDD525A67E831D77278E5165B7 (ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1 * __this, String_t* ___message0, const RuntimeMethod* method); // System.Boolean System.IO.File::Exists(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool File_Exists_m6B9BDD8EEB33D744EB0590DD27BC0152FAFBD1FB (String_t* ___path0, const RuntimeMethod* method); // System.Void System.IO.FileNotFoundException::.ctor(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void FileNotFoundException__ctor_mA72DAA77008E903BC162A8D32FDE7F874B27E858 (FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 * __this, String_t* ___message0, const RuntimeMethod* method); // System.String NativeCamera::get_TemporaryImagePath() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera_get_TemporaryImagePath_m6C9F9DABC6EB1341EEB6BAB597375A8A91A8CAE7 (const RuntimeMethod* method); // System.String NativeCamera::_NativeCamera_LoadImageAtPath(System.String,System.String,System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera__NativeCamera_LoadImageAtPath_mC378427E998E6805352DBB3A3129A39AA771FEEF (String_t* ___path0, String_t* ___temporaryFilePath1, int32_t ___maxSize2, const RuntimeMethod* method); // System.String System.IO.Path::GetExtension(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* Path_GetExtension_mAB8DB12AA3F147A487ED6AFECF8CD0043402957B (String_t* ___path0, const RuntimeMethod* method); // System.String System.String::ToLowerInvariant() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* String_ToLowerInvariant_m197BD65B6582DC546FF1BC398161EEFA708F799E (String_t* __this, const RuntimeMethod* method); // System.Boolean System.String::op_Equality(System.String,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE (String_t* ___a0, String_t* ___b1, const RuntimeMethod* method); // System.Void UnityEngine.Texture2D::.ctor(System.Int32,System.Int32,UnityEngine.TextureFormat,System.Boolean,System.Boolean) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Texture2D__ctor_m01B7AF7873AA43495B8216926C1768FEDDF4CE64 (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * __this, int32_t ___width0, int32_t ___height1, int32_t ___textureFormat2, bool ___mipChain3, bool ___linear4, const RuntimeMethod* method); // System.Byte[] System.IO.File::ReadAllBytes(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* File_ReadAllBytes_mF29468CED0B7B3B7C0971ACEBB16A38683718BEC (String_t* ___path0, const RuntimeMethod* method); // System.Boolean UnityEngine.ImageConversion::LoadImage(UnityEngine.Texture2D,System.Byte[],System.Boolean) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29 (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * ___tex0, ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* ___data1, bool ___markNonReadable2, const RuntimeMethod* method); // System.Void UnityEngine.Object::DestroyImmediate(UnityEngine.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object_DestroyImmediate_mF6F4415EF22249D6E650FAA40E403283F19B7446 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___obj0, const RuntimeMethod* method); // System.Void UnityEngine.Debug::LogException(System.Exception) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Debug_LogException_mBAA6702C240E37B2A834AA74E4FDC15A3A5589A9 (Exception_t * ___exception0, const RuntimeMethod* method); // System.Boolean System.String::op_Inequality(System.String,System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool String_op_Inequality_m0BD184A74F453A72376E81CC6CAEE2556B80493E (String_t* ___a0, String_t* ___b1, const RuntimeMethod* method); // System.Void System.IO.File::Delete(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void File_Delete_mBE814E569EAB07FAD140C6DCDB957F1CB8C85DE2 (String_t* ___path0, const RuntimeMethod* method); // System.String NativeCamera::_NativeCamera_GetImageProperties(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera__NativeCamera_GetImageProperties_m8BD5FAA9F64FF89C71D0D2D280AA700AA4C99428 (String_t* ___path0, const RuntimeMethod* method); // System.String[] System.String::Split(System.Char[]) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* String_Split_m13262358217AD2C119FD1B9733C3C0289D608512 (String_t* __this, CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___separator0, const RuntimeMethod* method); // System.String System.String::Trim() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D (String_t* __this, const RuntimeMethod* method); // System.Boolean System.Int32::TryParse(System.String,System.Int32&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Int32_TryParse_m03D31CAB7050E8286A8A90711C896B181006AD00 (String_t* ___s0, int32_t* ___result1, const RuntimeMethod* method); // System.Int32 System.String::get_Length() IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR int32_t String_get_Length_mD48C8A16A5CF1914F330DCE82D9BE15C3BEDD018_inline (String_t* __this, const RuntimeMethod* method); // System.Void NativeCamera/ImageProperties::.ctor(System.Int32,System.Int32,System.String,NativeCamera/ImageOrientation) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ImageProperties__ctor_m253C8AFFAC48F1FE018C7A1A657D740ADCED2206 (ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90 * __this, int32_t ___width0, int32_t ___height1, String_t* ___mimeType2, int32_t ___orientation3, const RuntimeMethod* method); // System.String NativeCamera::_NativeCamera_GetVideoProperties(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera__NativeCamera_GetVideoProperties_m6FD95D34611241DED73D9ECF0A92C89D2C4AFE88 (String_t* ___path0, const RuntimeMethod* method); // System.Boolean System.Int64::TryParse(System.String,System.Int64&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Int64_TryParse_m5C60567D82BACC7D9C18F7A9A83025FC94AD0E95 (String_t* ___s0, int64_t* ___result1, const RuntimeMethod* method); // System.Boolean System.Single::TryParse(System.String,System.Single&) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Single_TryParse_m548E9EC17193999C07717FECFAD0A907980D566C (String_t* ___s0, float* ___result1, const RuntimeMethod* method); // System.Void NativeCamera/VideoProperties::.ctor(System.Int32,System.Int32,System.Int64,System.Single) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void VideoProperties__ctor_m32A6453410672BD45259FB6934BB79F2D5773D6A (VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050 * __this, int32_t ___width0, int32_t ___height1, int64_t ___duration2, float ___rotation3, const RuntimeMethod* method); // System.Boolean UnityEngine.Object::op_Equality(UnityEngine.Object,UnityEngine.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___x0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___y1, const RuntimeMethod* method); // System.Void UnityEngine.GameObject::.ctor(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GameObject__ctor_mBB454E679AD9CF0B84D3609A01E6A9753ACF4686 (GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * __this, String_t* ___name0, const RuntimeMethod* method); // !!0 UnityEngine.GameObject::AddComponent<NativeCameraNamespace.NCCameraCallbackiOS>() inline NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * GameObject_AddComponent_TisNCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_m91678FB65CA0F4DA054C800CD5A13E4B23347CEE (GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * __this, const RuntimeMethod* method) { return (( NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * (*) (GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F *, const RuntimeMethod*))GameObject_AddComponent_TisRuntimeObject_m80EDFEAC4927F588A7A702F81524EDBFA8603FE2_gshared)(__this, method); } // UnityEngine.GameObject UnityEngine.Component::get_gameObject() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * Component_get_gameObject_m0B0570BA8DDD3CD78A9DB568EA18D7317686603C (Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 * __this, const RuntimeMethod* method); // System.Void UnityEngine.Object::DontDestroyOnLoad(UnityEngine.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Object_DontDestroyOnLoad_m4DC90770AD6084E4B1B8489C6B41205DC020C207 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___target0, const RuntimeMethod* method); // System.Single UnityEngine.Time::get_realtimeSinceStartup() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float Time_get_realtimeSinceStartup_mCA1086EC9DFCF135F77BC46D3B7127711EA3DE03 (const RuntimeMethod* method); // System.Void NativeCameraNamespace.NCCameraCallbackiOS::set_IsBusy(System.Boolean) IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65_inline (bool ___value0, const RuntimeMethod* method); // System.Int32 NativeCameraNamespace.NCCameraCallbackiOS::_NativeCamera_IsCameraBusy() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NCCameraCallbackiOS__NativeCamera_IsCameraBusy_m381C33C0F3F356268DAE2BD0367349E0529B9AF0 (const RuntimeMethod* method); // System.Void NativeCamera/CameraCallback::Invoke(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void CameraCallback_Invoke_mDB6E9D8BC2FFBBE8B06F34047EEB470634B7A987 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * __this, String_t* ___path0, const RuntimeMethod* method); // System.Void UnityEngine.MonoBehaviour::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void MonoBehaviour__ctor_mEAEC84B222C60319D593E456D769B3311DFCEF97 (MonoBehaviour_t4A60845CF505405AF8BE8C61CC07F75CADEF6429 * __this, const RuntimeMethod* method); #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif IL2CPP_EXTERN_C int32_t DEFAULT_CALL _NativeCamera_CheckPermission(); // System.Int32 NativeCamera::_NativeCamera_CheckPermission() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_CheckPermission_m7177988111E6B1EA2997331CC61B029D3E7B0F37 (const RuntimeMethod* method) { typedef int32_t (DEFAULT_CALL *PInvokeFunc) (); // Native function invocation int32_t returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_CheckPermission)(); return returnValue; } IL2CPP_EXTERN_C int32_t DEFAULT_CALL _NativeCamera_RequestPermission(); // System.Int32 NativeCamera::_NativeCamera_RequestPermission() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_RequestPermission_mA107C9A75B51667CBC297B41A13A5B38C1E79F66 (const RuntimeMethod* method) { typedef int32_t (DEFAULT_CALL *PInvokeFunc) (); // Native function invocation int32_t returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_RequestPermission)(); return returnValue; } IL2CPP_EXTERN_C int32_t DEFAULT_CALL _NativeCamera_CanOpenSettings(); // System.Int32 NativeCamera::_NativeCamera_CanOpenSettings() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_CanOpenSettings_m2FA92B005E0F2F15CD78D1EF3EA3981326582DB6 (const RuntimeMethod* method) { typedef int32_t (DEFAULT_CALL *PInvokeFunc) (); // Native function invocation int32_t returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_CanOpenSettings)(); return returnValue; } IL2CPP_EXTERN_C void DEFAULT_CALL _NativeCamera_OpenSettings(); // System.Void NativeCamera::_NativeCamera_OpenSettings() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera__NativeCamera_OpenSettings_m1D3396E62888A31B1A669D8ED9CB035910ABADBC (const RuntimeMethod* method) { typedef void (DEFAULT_CALL *PInvokeFunc) (); // Native function invocation reinterpret_cast<PInvokeFunc>(_NativeCamera_OpenSettings)(); } IL2CPP_EXTERN_C int32_t DEFAULT_CALL _NativeCamera_HasCamera(); // System.Int32 NativeCamera::_NativeCamera_HasCamera() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera__NativeCamera_HasCamera_mE0067C2324E3275B54040C34AAD769E1240362E3 (const RuntimeMethod* method) { typedef int32_t (DEFAULT_CALL *PInvokeFunc) (); // Native function invocation int32_t returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_HasCamera)(); return returnValue; } IL2CPP_EXTERN_C void DEFAULT_CALL _NativeCamera_TakePicture(char*, int32_t, int32_t); // System.Void NativeCamera::_NativeCamera_TakePicture(System.String,System.Int32,System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera__NativeCamera_TakePicture_mF8B664C89E7BBDBFF10A69584B33C5D21869FCD4 (String_t* ___imageSavePath0, int32_t ___maxSize1, int32_t ___preferredCamera2, const RuntimeMethod* method) { typedef void (DEFAULT_CALL *PInvokeFunc) (char*, int32_t, int32_t); // Marshaling of parameter '___imageSavePath0' to native representation char* ____imageSavePath0_marshaled = NULL; ____imageSavePath0_marshaled = il2cpp_codegen_marshal_string(___imageSavePath0); // Native function invocation reinterpret_cast<PInvokeFunc>(_NativeCamera_TakePicture)(____imageSavePath0_marshaled, ___maxSize1, ___preferredCamera2); // Marshaling cleanup of parameter '___imageSavePath0' native representation il2cpp_codegen_marshal_free(____imageSavePath0_marshaled); ____imageSavePath0_marshaled = NULL; } IL2CPP_EXTERN_C void DEFAULT_CALL _NativeCamera_RecordVideo(int32_t, int32_t, int32_t); // System.Void NativeCamera::_NativeCamera_RecordVideo(System.Int32,System.Int32,System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera__NativeCamera_RecordVideo_m9A226E854A1989135CE2FE5A0CFD8584B8BA76FB (int32_t ___quality0, int32_t ___maxDuration1, int32_t ___preferredCamera2, const RuntimeMethod* method) { typedef void (DEFAULT_CALL *PInvokeFunc) (int32_t, int32_t, int32_t); // Native function invocation reinterpret_cast<PInvokeFunc>(_NativeCamera_RecordVideo)(___quality0, ___maxDuration1, ___preferredCamera2); } IL2CPP_EXTERN_C char* DEFAULT_CALL _NativeCamera_GetImageProperties(char*); // System.String NativeCamera::_NativeCamera_GetImageProperties(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera__NativeCamera_GetImageProperties_m8BD5FAA9F64FF89C71D0D2D280AA700AA4C99428 (String_t* ___path0, const RuntimeMethod* method) { typedef char* (DEFAULT_CALL *PInvokeFunc) (char*); // Marshaling of parameter '___path0' to native representation char* ____path0_marshaled = NULL; ____path0_marshaled = il2cpp_codegen_marshal_string(___path0); // Native function invocation char* returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_GetImageProperties)(____path0_marshaled); // Marshaling of return value back from native representation String_t* _returnValue_unmarshaled = NULL; _returnValue_unmarshaled = il2cpp_codegen_marshal_string_result(returnValue); // Marshaling cleanup of return value native representation il2cpp_codegen_marshal_free(returnValue); returnValue = NULL; // Marshaling cleanup of parameter '___path0' native representation il2cpp_codegen_marshal_free(____path0_marshaled); ____path0_marshaled = NULL; return _returnValue_unmarshaled; } IL2CPP_EXTERN_C char* DEFAULT_CALL _NativeCamera_GetVideoProperties(char*); // System.String NativeCamera::_NativeCamera_GetVideoProperties(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera__NativeCamera_GetVideoProperties_m6FD95D34611241DED73D9ECF0A92C89D2C4AFE88 (String_t* ___path0, const RuntimeMethod* method) { typedef char* (DEFAULT_CALL *PInvokeFunc) (char*); // Marshaling of parameter '___path0' to native representation char* ____path0_marshaled = NULL; ____path0_marshaled = il2cpp_codegen_marshal_string(___path0); // Native function invocation char* returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_GetVideoProperties)(____path0_marshaled); // Marshaling of return value back from native representation String_t* _returnValue_unmarshaled = NULL; _returnValue_unmarshaled = il2cpp_codegen_marshal_string_result(returnValue); // Marshaling cleanup of return value native representation il2cpp_codegen_marshal_free(returnValue); returnValue = NULL; // Marshaling cleanup of parameter '___path0' native representation il2cpp_codegen_marshal_free(____path0_marshaled); ____path0_marshaled = NULL; return _returnValue_unmarshaled; } IL2CPP_EXTERN_C char* DEFAULT_CALL _NativeCamera_LoadImageAtPath(char*, char*, int32_t); // System.String NativeCamera::_NativeCamera_LoadImageAtPath(System.String,System.String,System.Int32) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera__NativeCamera_LoadImageAtPath_mC378427E998E6805352DBB3A3129A39AA771FEEF (String_t* ___path0, String_t* ___temporaryFilePath1, int32_t ___maxSize2, const RuntimeMethod* method) { typedef char* (DEFAULT_CALL *PInvokeFunc) (char*, char*, int32_t); // Marshaling of parameter '___path0' to native representation char* ____path0_marshaled = NULL; ____path0_marshaled = il2cpp_codegen_marshal_string(___path0); // Marshaling of parameter '___temporaryFilePath1' to native representation char* ____temporaryFilePath1_marshaled = NULL; ____temporaryFilePath1_marshaled = il2cpp_codegen_marshal_string(___temporaryFilePath1); // Native function invocation char* returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_LoadImageAtPath)(____path0_marshaled, ____temporaryFilePath1_marshaled, ___maxSize2); // Marshaling of return value back from native representation String_t* _returnValue_unmarshaled = NULL; _returnValue_unmarshaled = il2cpp_codegen_marshal_string_result(returnValue); // Marshaling cleanup of return value native representation il2cpp_codegen_marshal_free(returnValue); returnValue = NULL; // Marshaling cleanup of parameter '___path0' native representation il2cpp_codegen_marshal_free(____path0_marshaled); ____path0_marshaled = NULL; // Marshaling cleanup of parameter '___temporaryFilePath1' native representation il2cpp_codegen_marshal_free(____temporaryFilePath1_marshaled); ____temporaryFilePath1_marshaled = NULL; return _returnValue_unmarshaled; } // System.String NativeCamera::get_TemporaryImagePath() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera_get_TemporaryImagePath_m6C9F9DABC6EB1341EEB6BAB597375A8A91A8CAE7 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_get_TemporaryImagePath_m6C9F9DABC6EB1341EEB6BAB597375A8A91A8CAE7_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_0 = ((NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields*)il2cpp_codegen_static_fields_for(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var))->get_m_temporaryImagePath_0(); if (L_0) { goto IL_0026; } } { String_t* L_1 = Application_get_temporaryCachePath_m6769909A405A6A5A0477F8E5F312920C8115E50C(/*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Path_t0B99A4B924A6FDF08814FFA8DD4CD121ED1A0752_il2cpp_TypeInfo_var); String_t* L_2 = Path_Combine_mA495A18104786EB450EC0E44EE0FB7F9040C4311(L_1, _stringLiteralA04667285B0D56FA5C9AD66F9249C0C461B42CCD, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); ((NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields*)il2cpp_codegen_static_fields_for(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var))->set_m_temporaryImagePath_0(L_2); String_t* L_3 = Application_get_temporaryCachePath_m6769909A405A6A5A0477F8E5F312920C8115E50C(/*hidden argument*/NULL); Directory_CreateDirectory_m0C9CAA2ECA801C4D07EA35820DA0907402ED4D41(L_3, /*hidden argument*/NULL); } IL_0026: { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_4 = ((NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields*)il2cpp_codegen_static_fields_for(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var))->get_m_temporaryImagePath_0(); return L_4; } } // System.String NativeCamera::get_IOSSelectedImagePath() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* NativeCamera_get_IOSSelectedImagePath_m7556979AFB1BA8269ABCFBA1B64407B1BC747D36 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_get_IOSSelectedImagePath_m7556979AFB1BA8269ABCFBA1B64407B1BC747D36_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_0 = ((NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields*)il2cpp_codegen_static_fields_for(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var))->get_m_iOSSelectedImagePath_1(); if (L_0) { goto IL_0026; } } { String_t* L_1 = Application_get_temporaryCachePath_m6769909A405A6A5A0477F8E5F312920C8115E50C(/*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Path_t0B99A4B924A6FDF08814FFA8DD4CD121ED1A0752_il2cpp_TypeInfo_var); String_t* L_2 = Path_Combine_mA495A18104786EB450EC0E44EE0FB7F9040C4311(L_1, _stringLiteralA9665AEBBC97FA16750B210FDAC0B5D502F8322D, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); ((NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields*)il2cpp_codegen_static_fields_for(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var))->set_m_iOSSelectedImagePath_1(L_2); String_t* L_3 = Application_get_temporaryCachePath_m6769909A405A6A5A0477F8E5F312920C8115E50C(/*hidden argument*/NULL); Directory_CreateDirectory_m0C9CAA2ECA801C4D07EA35820DA0907402ED4D41(L_3, /*hidden argument*/NULL); } IL_0026: { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_4 = ((NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_StaticFields*)il2cpp_codegen_static_fields_for(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var))->get_m_iOSSelectedImagePath_1(); return L_4; } } // NativeCamera_Permission NativeCamera::CheckPermission() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera_CheckPermission_m872C5E63BEC84EAD075C79E5743B41767BC55432 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_CheckPermission_m872C5E63BEC84EAD075C79E5743B41767BC55432_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); int32_t L_0 = NativeCamera__NativeCamera_CheckPermission_m7177988111E6B1EA2997331CC61B029D3E7B0F37(/*hidden argument*/NULL); return (int32_t)(L_0); } } // NativeCamera_Permission NativeCamera::RequestPermission() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera_RequestPermission_mE63541DCC27642F05940FAF66DAAD4CF769DA128 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_RequestPermission_mE63541DCC27642F05940FAF66DAAD4CF769DA128_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); int32_t L_0 = NativeCamera__NativeCamera_RequestPermission_mA107C9A75B51667CBC297B41A13A5B38C1E79F66(/*hidden argument*/NULL); return (int32_t)(L_0); } } // System.Boolean NativeCamera::CanOpenSettings() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool NativeCamera_CanOpenSettings_m697BFB37AECD15F1BAF7022B21FC06A8C718A6BA (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_CanOpenSettings_m697BFB37AECD15F1BAF7022B21FC06A8C718A6BA_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); int32_t L_0 = NativeCamera__NativeCamera_CanOpenSettings_m2FA92B005E0F2F15CD78D1EF3EA3981326582DB6(/*hidden argument*/NULL); return (bool)((((int32_t)L_0) == ((int32_t)1))? 1 : 0); } } // System.Void NativeCamera::OpenSettings() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera_OpenSettings_mAE9E395380119AAA74BB16ABA44F70D47C3DD577 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_OpenSettings_mAE9E395380119AAA74BB16ABA44F70D47C3DD577_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); NativeCamera__NativeCamera_OpenSettings_m1D3396E62888A31B1A669D8ED9CB035910ABADBC(/*hidden argument*/NULL); return; } } // NativeCamera_Permission NativeCamera::TakePicture(NativeCamera_CameraCallback,System.Int32,System.Boolean,NativeCamera_PreferredCamera) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera_TakePicture_m2BCB1DF3311DF2396EEBDCD8090FF7391C3D352E (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * ___callback0, int32_t ___maxSize1, bool ___saveAsJPEG2, int32_t ___preferredCamera3, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_TakePicture_m2BCB1DF3311DF2396EEBDCD8090FF7391C3D352E_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t G_B8_0 = 0; int32_t G_B1_0 = 0; int32_t G_B2_0 = 0; int32_t G_B4_0 = 0; int32_t G_B3_0 = 0; String_t* G_B6_0 = NULL; int32_t G_B6_1 = 0; String_t* G_B5_0 = NULL; int32_t G_B5_1 = 0; String_t* G_B7_0 = NULL; String_t* G_B7_1 = NULL; int32_t G_B7_2 = 0; { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); int32_t L_0 = NativeCamera_RequestPermission_mE63541DCC27642F05940FAF66DAAD4CF769DA128(/*hidden argument*/NULL); int32_t L_1 = L_0; G_B1_0 = L_1; if ((!(((uint32_t)L_1) == ((uint32_t)1)))) { G_B8_0 = L_1; goto IL_0041; } } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); bool L_2 = NativeCamera_IsCameraBusy_m5F8CD70113132341D48A89FAF84EB6584B30B069(/*hidden argument*/NULL); G_B2_0 = G_B1_0; if (L_2) { G_B8_0 = G_B1_0; goto IL_0041; } } { int32_t L_3 = ___maxSize1; G_B3_0 = G_B2_0; if ((((int32_t)L_3) > ((int32_t)0))) { G_B4_0 = G_B2_0; goto IL_001b; } } { int32_t L_4 = SystemInfo_get_maxTextureSize_m10A8228B83EE161D0DCCB9FB01279C245C47D0E3(/*hidden argument*/NULL); ___maxSize1 = L_4; G_B4_0 = G_B3_0; } IL_001b: { CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * L_5 = ___callback0; NCCameraCallbackiOS_Initialize_m389551BB3149858479025978267F9E27527CCC56(L_5, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_6 = NativeCamera_get_IOSSelectedImagePath_m7556979AFB1BA8269ABCFBA1B64407B1BC747D36(/*hidden argument*/NULL); bool L_7 = ___saveAsJPEG2; G_B5_0 = L_6; G_B5_1 = G_B4_0; if (L_7) { G_B6_0 = L_6; G_B6_1 = G_B4_0; goto IL_0030; } } { G_B7_0 = _stringLiteral339F5868588CFC8FDA4A1EC94EAD8F737C5FCFC0; G_B7_1 = G_B5_0; G_B7_2 = G_B5_1; goto IL_0035; } IL_0030: { G_B7_0 = _stringLiteral801DC5C3610D303D73C37E27B3D6F5AC9F7661DC; G_B7_1 = G_B6_0; G_B7_2 = G_B6_1; } IL_0035: { String_t* L_8 = String_Concat_mB78D0094592718DA6D5DB6C712A9C225631666BE(G_B7_1, G_B7_0, /*hidden argument*/NULL); int32_t L_9 = ___maxSize1; int32_t L_10 = ___preferredCamera3; IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); NativeCamera__NativeCamera_TakePicture_mF8B664C89E7BBDBFF10A69584B33C5D21869FCD4(L_8, L_9, L_10, /*hidden argument*/NULL); G_B8_0 = G_B7_2; } IL_0041: { return G_B8_0; } } // NativeCamera_Permission NativeCamera::RecordVideo(NativeCamera_CameraCallback,NativeCamera_Quality,System.Int32,System.Int64,NativeCamera_PreferredCamera) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NativeCamera_RecordVideo_mCDE7F10F8D9AFA21A8C2BDCF7F953134827DE050 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * ___callback0, int32_t ___quality1, int32_t ___maxDuration2, int64_t ___maxSizeBytes3, int32_t ___preferredCamera4, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_RecordVideo_mCDE7F10F8D9AFA21A8C2BDCF7F953134827DE050_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t G_B3_0 = 0; int32_t G_B1_0 = 0; int32_t G_B2_0 = 0; { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); int32_t L_0 = NativeCamera_RequestPermission_mE63541DCC27642F05940FAF66DAAD4CF769DA128(/*hidden argument*/NULL); int32_t L_1 = L_0; G_B1_0 = L_1; if ((!(((uint32_t)L_1) == ((uint32_t)1)))) { G_B3_0 = L_1; goto IL_001f; } } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); bool L_2 = NativeCamera_IsCameraBusy_m5F8CD70113132341D48A89FAF84EB6584B30B069(/*hidden argument*/NULL); G_B2_0 = G_B1_0; if (L_2) { G_B3_0 = G_B1_0; goto IL_001f; } } { CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * L_3 = ___callback0; NCCameraCallbackiOS_Initialize_m389551BB3149858479025978267F9E27527CCC56(L_3, /*hidden argument*/NULL); int32_t L_4 = ___quality1; int32_t L_5 = ___maxDuration2; int32_t L_6 = ___preferredCamera4; IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); NativeCamera__NativeCamera_RecordVideo_m9A226E854A1989135CE2FE5A0CFD8584B8BA76FB(L_4, L_5, L_6, /*hidden argument*/NULL); G_B3_0 = G_B2_0; } IL_001f: { return G_B3_0; } } // System.Boolean NativeCamera::DeviceHasCamera() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool NativeCamera_DeviceHasCamera_mC628329B38F1F072DF9496DD44C6F9463DFB6243 (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_DeviceHasCamera_mC628329B38F1F072DF9496DD44C6F9463DFB6243_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); int32_t L_0 = NativeCamera__NativeCamera_HasCamera_mE0067C2324E3275B54040C34AAD769E1240362E3(/*hidden argument*/NULL); return (bool)((((int32_t)L_0) == ((int32_t)1))? 1 : 0); } } // System.Boolean NativeCamera::IsCameraBusy() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool NativeCamera_IsCameraBusy_m5F8CD70113132341D48A89FAF84EB6584B30B069 (const RuntimeMethod* method) { { bool L_0 = NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E_inline(/*hidden argument*/NULL); return L_0; } } // UnityEngine.Texture2D NativeCamera::LoadImageAtPath(System.String,System.Int32,System.Boolean,System.Boolean,System.Boolean) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * NativeCamera_LoadImageAtPath_mEB1EDFDF65404F1B660246C33677F18C90E0B1EE (String_t* ___imagePath0, int32_t ___maxSize1, bool ___markTextureNonReadable2, bool ___generateMipmaps3, bool ___linearColorSpace4, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_LoadImageAtPath_mEB1EDFDF65404F1B660246C33677F18C90E0B1EE_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; String_t* V_1 = NULL; int32_t V_2 = 0; Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * V_3 = NULL; Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * V_4 = NULL; Exception_t * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); void* __leave_targets_storage = alloca(sizeof(int32_t) * 5); il2cpp::utils::LeaveTargetStack __leave_targets(__leave_targets_storage); NO_UNUSED_WARNING (__leave_targets); int32_t G_B10_0 = 0; { String_t* L_0 = ___imagePath0; bool L_1 = String_IsNullOrEmpty_m06A85A206AC2106D1982826C5665B9BD35324229(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0013; } } { ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1 * L_2 = (ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1 *)il2cpp_codegen_object_new(ArgumentException_tEDCD16F20A09ECE461C3DA766C16EDA8864057D1_il2cpp_TypeInfo_var); ArgumentException__ctor_m9A85EF7FEFEC21DDD525A67E831D77278E5165B7(L_2, _stringLiteral377ED966B3A8FCCD3BE787DDE011557F2EC947F9, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_2, NULL, NativeCamera_LoadImageAtPath_mEB1EDFDF65404F1B660246C33677F18C90E0B1EE_RuntimeMethod_var); } IL_0013: { String_t* L_3 = ___imagePath0; bool L_4 = File_Exists_m6B9BDD8EEB33D744EB0590DD27BC0152FAFBD1FB(L_3, /*hidden argument*/NULL); if (L_4) { goto IL_002c; } } { String_t* L_5 = ___imagePath0; String_t* L_6 = String_Concat_mB78D0094592718DA6D5DB6C712A9C225631666BE(_stringLiteral0A3CF76AA4D046F4E79CDE3341E93210C22D0D9E, L_5, /*hidden argument*/NULL); FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 * L_7 = (FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 *)il2cpp_codegen_object_new(FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431_il2cpp_TypeInfo_var); FileNotFoundException__ctor_mA72DAA77008E903BC162A8D32FDE7F874B27E858(L_7, L_6, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_7, NULL, NativeCamera_LoadImageAtPath_mEB1EDFDF65404F1B660246C33677F18C90E0B1EE_RuntimeMethod_var); } IL_002c: { int32_t L_8 = ___maxSize1; if ((((int32_t)L_8) > ((int32_t)0))) { goto IL_0037; } } { int32_t L_9 = SystemInfo_get_maxTextureSize_m10A8228B83EE161D0DCCB9FB01279C245C47D0E3(/*hidden argument*/NULL); ___maxSize1 = L_9; } IL_0037: { String_t* L_10 = ___imagePath0; IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_11 = NativeCamera_get_TemporaryImagePath_m6C9F9DABC6EB1341EEB6BAB597375A8A91A8CAE7(/*hidden argument*/NULL); int32_t L_12 = ___maxSize1; String_t* L_13 = NativeCamera__NativeCamera_LoadImageAtPath_mC378427E998E6805352DBB3A3129A39AA771FEEF(L_10, L_11, L_12, /*hidden argument*/NULL); V_0 = L_13; String_t* L_14 = ___imagePath0; IL2CPP_RUNTIME_CLASS_INIT(Path_t0B99A4B924A6FDF08814FFA8DD4CD121ED1A0752_il2cpp_TypeInfo_var); String_t* L_15 = Path_GetExtension_mAB8DB12AA3F147A487ED6AFECF8CD0043402957B(L_14, /*hidden argument*/NULL); NullCheck(L_15); String_t* L_16 = String_ToLowerInvariant_m197BD65B6582DC546FF1BC398161EEFA708F799E(L_15, /*hidden argument*/NULL); V_1 = L_16; String_t* L_17 = V_1; bool L_18 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_17, _stringLiteralDCDFD41CB6E96E78736DEB5F5ADD6F6311DA8E80, /*hidden argument*/NULL); if (L_18) { goto IL_006d; } } { String_t* L_19 = V_1; bool L_20 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_19, _stringLiteral801DC5C3610D303D73C37E27B3D6F5AC9F7661DC, /*hidden argument*/NULL); if (L_20) { goto IL_006d; } } { G_B10_0 = 4; goto IL_006e; } IL_006d: { G_B10_0 = 3; } IL_006e: { V_2 = G_B10_0; int32_t L_21 = V_2; bool L_22 = ___generateMipmaps3; bool L_23 = ___linearColorSpace4; Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * L_24 = (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C *)il2cpp_codegen_object_new(Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C_il2cpp_TypeInfo_var); Texture2D__ctor_m01B7AF7873AA43495B8216926C1768FEDDF4CE64(L_24, 2, 2, L_21, L_22, L_23, /*hidden argument*/NULL); V_3 = L_24; } IL_007b: try { // begin try (depth: 1) try { // begin try (depth: 2) { Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * L_25 = V_3; String_t* L_26 = V_0; ByteU5BU5D_tD06FDBE8142446525DF1C40351D523A228373821* L_27 = File_ReadAllBytes_mF29468CED0B7B3B7C0971ACEBB16A38683718BEC(L_26, /*hidden argument*/NULL); bool L_28 = ___markTextureNonReadable2; bool L_29 = ImageConversion_LoadImage_mFB317291362399115F8D112D8CE9E8C1BF454C29(L_25, L_27, L_28, /*hidden argument*/NULL); if (L_29) { goto IL_0095; } } IL_008a: { Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * L_30 = V_3; IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); Object_DestroyImmediate_mF6F4415EF22249D6E650FAA40E403283F19B7446(L_30, /*hidden argument*/NULL); V_4 = (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C *)NULL; IL2CPP_LEAVE(0xBE, FINALLY_00a7); } IL_0095: { IL2CPP_LEAVE(0xBC, FINALLY_00a7); } } // end try (depth: 2) catch(Il2CppExceptionWrapper& e) { __exception_local = (Exception_t *)e.ex; if(il2cpp_codegen_class_is_assignable_from (Exception_t_il2cpp_TypeInfo_var, il2cpp_codegen_object_class(e.ex))) goto CATCH_0097; throw e; } CATCH_0097: { // begin catch(System.Exception) IL2CPP_RUNTIME_CLASS_INIT(Debug_t7B5FCB117E2FD63B6838BC52821B252E2BFB61C4_il2cpp_TypeInfo_var); Debug_LogException_mBAA6702C240E37B2A834AA74E4FDC15A3A5589A9(((Exception_t *)__exception_local), /*hidden argument*/NULL); Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * L_31 = V_3; IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); Object_DestroyImmediate_mF6F4415EF22249D6E650FAA40E403283F19B7446(L_31, /*hidden argument*/NULL); V_4 = (Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C *)NULL; IL2CPP_LEAVE(0xBE, FINALLY_00a7); } // end catch (depth: 2) } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t *)e.ex; goto FINALLY_00a7; } FINALLY_00a7: { // begin finally (depth: 1) { String_t* L_32 = V_0; String_t* L_33 = ___imagePath0; bool L_34 = String_op_Inequality_m0BD184A74F453A72376E81CC6CAEE2556B80493E(L_32, L_33, /*hidden argument*/NULL); if (!L_34) { goto IL_00bb; } } IL_00b0: try { // begin try (depth: 2) String_t* L_35 = V_0; File_Delete_mBE814E569EAB07FAD140C6DCDB957F1CB8C85DE2(L_35, /*hidden argument*/NULL); goto IL_00bb; } // end try (depth: 2) catch(Il2CppExceptionWrapper& e) { __exception_local = (Exception_t *)e.ex; if(il2cpp_codegen_class_is_assignable_from (RuntimeObject_il2cpp_TypeInfo_var, il2cpp_codegen_object_class(e.ex))) goto CATCH_00b8; throw e; } CATCH_00b8: { // begin catch(System.Object) goto IL_00bb; } // end catch (depth: 2) IL_00bb: { IL2CPP_END_FINALLY(167) } } // end finally (depth: 1) IL2CPP_CLEANUP(167) { IL2CPP_JUMP_TBL(0xBE, IL_00be) IL2CPP_JUMP_TBL(0xBC, IL_00bc) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *) } IL_00bc: { Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * L_36 = V_3; return L_36; } IL_00be: { Texture2D_tBBF96AC337723E2EF156DF17E09D4379FD05DE1C * L_37 = V_4; return L_37; } } // NativeCamera_ImageProperties NativeCamera::GetImageProperties(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90 NativeCamera_GetImageProperties_m909DD926A83944214B79AAC5CF74961CC80F01C1 (String_t* ___imagePath0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_GetImageProperties_m909DD926A83944214B79AAC5CF74961CC80F01C1_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; String_t* V_3 = NULL; int32_t V_4 = 0; StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* V_5 = NULL; int32_t V_6 = 0; String_t* V_7 = NULL; { String_t* L_0 = ___imagePath0; bool L_1 = File_Exists_m6B9BDD8EEB33D744EB0590DD27BC0152FAFBD1FB(L_0, /*hidden argument*/NULL); if (L_1) { goto IL_0019; } } { String_t* L_2 = ___imagePath0; String_t* L_3 = String_Concat_mB78D0094592718DA6D5DB6C712A9C225631666BE(_stringLiteral0A3CF76AA4D046F4E79CDE3341E93210C22D0D9E, L_2, /*hidden argument*/NULL); FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 * L_4 = (FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 *)il2cpp_codegen_object_new(FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431_il2cpp_TypeInfo_var); FileNotFoundException__ctor_mA72DAA77008E903BC162A8D32FDE7F874B27E858(L_4, L_3, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, NULL, NativeCamera_GetImageProperties_m909DD926A83944214B79AAC5CF74961CC80F01C1_RuntimeMethod_var); } IL_0019: { String_t* L_5 = ___imagePath0; IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_6 = NativeCamera__NativeCamera_GetImageProperties_m8BD5FAA9F64FF89C71D0D2D280AA700AA4C99428(L_5, /*hidden argument*/NULL); V_0 = L_6; V_1 = 0; V_2 = 0; V_3 = (String_t*)NULL; V_4 = (-1); String_t* L_7 = V_0; bool L_8 = String_IsNullOrEmpty_m06A85A206AC2106D1982826C5665B9BD35324229(L_7, /*hidden argument*/NULL); if (L_8) { goto IL_011d; } } { String_t* L_9 = V_0; CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* L_10 = (CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2*)(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2*)SZArrayNew(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2_il2cpp_TypeInfo_var, (uint32_t)1); CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* L_11 = L_10; NullCheck(L_11); (L_11)->SetAt(static_cast<il2cpp_array_size_t>(0), (Il2CppChar)((int32_t)62)); NullCheck(L_9); StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_12 = String_Split_m13262358217AD2C119FD1B9733C3C0289D608512(L_9, L_11, /*hidden argument*/NULL); V_5 = L_12; StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_13 = V_5; if (!L_13) { goto IL_011d; } } { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_14 = V_5; NullCheck(L_14); if ((((int32_t)(((int32_t)((int32_t)(((RuntimeArray*)L_14)->max_length))))) < ((int32_t)4))) { goto IL_011d; } } { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_15 = V_5; NullCheck(L_15); int32_t L_16 = 0; String_t* L_17 = (L_15)->GetAt(static_cast<il2cpp_array_size_t>(L_16)); NullCheck(L_17); String_t* L_18 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_17, /*hidden argument*/NULL); bool L_19 = Int32_TryParse_m03D31CAB7050E8286A8A90711C896B181006AD00(L_18, (int32_t*)(&V_1), /*hidden argument*/NULL); if (L_19) { goto IL_006c; } } { V_1 = 0; } IL_006c: { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_20 = V_5; NullCheck(L_20); int32_t L_21 = 1; String_t* L_22 = (L_20)->GetAt(static_cast<il2cpp_array_size_t>(L_21)); NullCheck(L_22); String_t* L_23 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_22, /*hidden argument*/NULL); bool L_24 = Int32_TryParse_m03D31CAB7050E8286A8A90711C896B181006AD00(L_23, (int32_t*)(&V_2), /*hidden argument*/NULL); if (L_24) { goto IL_0080; } } { V_2 = 0; } IL_0080: { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_25 = V_5; NullCheck(L_25); int32_t L_26 = 2; String_t* L_27 = (L_25)->GetAt(static_cast<il2cpp_array_size_t>(L_26)); NullCheck(L_27); String_t* L_28 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_27, /*hidden argument*/NULL); V_3 = L_28; String_t* L_29 = V_3; NullCheck(L_29); int32_t L_30 = String_get_Length_mD48C8A16A5CF1914F330DCE82D9BE15C3BEDD018_inline(L_29, /*hidden argument*/NULL); if (L_30) { goto IL_0107; } } { String_t* L_31 = ___imagePath0; IL2CPP_RUNTIME_CLASS_INIT(Path_t0B99A4B924A6FDF08814FFA8DD4CD121ED1A0752_il2cpp_TypeInfo_var); String_t* L_32 = Path_GetExtension_mAB8DB12AA3F147A487ED6AFECF8CD0043402957B(L_31, /*hidden argument*/NULL); NullCheck(L_32); String_t* L_33 = String_ToLowerInvariant_m197BD65B6582DC546FF1BC398161EEFA708F799E(L_32, /*hidden argument*/NULL); V_7 = L_33; String_t* L_34 = V_7; bool L_35 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_34, _stringLiteral339F5868588CFC8FDA4A1EC94EAD8F737C5FCFC0, /*hidden argument*/NULL); if (!L_35) { goto IL_00b5; } } { V_3 = _stringLiteral34D71611DCE9C30419B3C3EA42DC9426E931CDDE; goto IL_0107; } IL_00b5: { String_t* L_36 = V_7; bool L_37 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_36, _stringLiteralDCDFD41CB6E96E78736DEB5F5ADD6F6311DA8E80, /*hidden argument*/NULL); if (L_37) { goto IL_00d1; } } { String_t* L_38 = V_7; bool L_39 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_38, _stringLiteral801DC5C3610D303D73C37E27B3D6F5AC9F7661DC, /*hidden argument*/NULL); if (!L_39) { goto IL_00d9; } } IL_00d1: { V_3 = _stringLiteral60C283FF6EF6CAD8B67415AE1A3C6BABD3477040; goto IL_0107; } IL_00d9: { String_t* L_40 = V_7; bool L_41 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_40, _stringLiteral64CC1194405FA366D9AE015C627F4609DEAC4879, /*hidden argument*/NULL); if (!L_41) { goto IL_00ef; } } { V_3 = _stringLiteralB3F0D81387C1211E197E16C94BFDA6583BC874F9; goto IL_0107; } IL_00ef: { String_t* L_42 = V_7; bool L_43 = String_op_Equality_m139F0E4195AE2F856019E63B241F36F016997FCE(L_42, _stringLiteral48022311225DF803178B78ACBDB71930DBF6C39C, /*hidden argument*/NULL); if (!L_43) { goto IL_0105; } } { V_3 = _stringLiteralA6E98DBB2BD82CB83A4EB01F4DFB5062494F8E28; goto IL_0107; } IL_0105: { V_3 = (String_t*)NULL; } IL_0107: { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_44 = V_5; NullCheck(L_44); int32_t L_45 = 3; String_t* L_46 = (L_44)->GetAt(static_cast<il2cpp_array_size_t>(L_45)); NullCheck(L_46); String_t* L_47 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_46, /*hidden argument*/NULL); bool L_48 = Int32_TryParse_m03D31CAB7050E8286A8A90711C896B181006AD00(L_47, (int32_t*)(&V_6), /*hidden argument*/NULL); if (!L_48) { goto IL_011d; } } { int32_t L_49 = V_6; V_4 = L_49; } IL_011d: { int32_t L_50 = V_1; int32_t L_51 = V_2; String_t* L_52 = V_3; int32_t L_53 = V_4; ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90 L_54; memset((&L_54), 0, sizeof(L_54)); ImageProperties__ctor_m253C8AFFAC48F1FE018C7A1A657D740ADCED2206((&L_54), L_50, L_51, L_52, L_53, /*hidden argument*/NULL); return L_54; } } // NativeCamera_VideoProperties NativeCamera::GetVideoProperties(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050 NativeCamera_GetVideoProperties_mEC3BBA727CCAA9A360BD9FB659E4C400232A20E1 (String_t* ___videoPath0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NativeCamera_GetVideoProperties_mEC3BBA727CCAA9A360BD9FB659E4C400232A20E1_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; int64_t V_3 = 0; float V_4 = 0.0f; StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* V_5 = NULL; { String_t* L_0 = ___videoPath0; bool L_1 = File_Exists_m6B9BDD8EEB33D744EB0590DD27BC0152FAFBD1FB(L_0, /*hidden argument*/NULL); if (L_1) { goto IL_0019; } } { String_t* L_2 = ___videoPath0; String_t* L_3 = String_Concat_mB78D0094592718DA6D5DB6C712A9C225631666BE(_stringLiteral0A3CF76AA4D046F4E79CDE3341E93210C22D0D9E, L_2, /*hidden argument*/NULL); FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 * L_4 = (FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431 *)il2cpp_codegen_object_new(FileNotFoundException_t0B3F0AE5C94A781A7E2ABBD786F91C229B703431_il2cpp_TypeInfo_var); FileNotFoundException__ctor_mA72DAA77008E903BC162A8D32FDE7F874B27E858(L_4, L_3, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, NULL, NativeCamera_GetVideoProperties_mEC3BBA727CCAA9A360BD9FB659E4C400232A20E1_RuntimeMethod_var); } IL_0019: { String_t* L_5 = ___videoPath0; IL2CPP_RUNTIME_CLASS_INIT(NativeCamera_tD95F559F6BC70817F79BA8620EE49D7B437C0424_il2cpp_TypeInfo_var); String_t* L_6 = NativeCamera__NativeCamera_GetVideoProperties_m6FD95D34611241DED73D9ECF0A92C89D2C4AFE88(L_5, /*hidden argument*/NULL); V_0 = L_6; V_1 = 0; V_2 = 0; V_3 = (((int64_t)((int64_t)0))); V_4 = (0.0f); String_t* L_7 = V_0; bool L_8 = String_IsNullOrEmpty_m06A85A206AC2106D1982826C5665B9BD35324229(L_7, /*hidden argument*/NULL); if (L_8) { goto IL_00aa; } } { String_t* L_9 = V_0; CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* L_10 = (CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2*)(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2*)SZArrayNew(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2_il2cpp_TypeInfo_var, (uint32_t)1); CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* L_11 = L_10; NullCheck(L_11); (L_11)->SetAt(static_cast<il2cpp_array_size_t>(0), (Il2CppChar)((int32_t)62)); NullCheck(L_9); StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_12 = String_Split_m13262358217AD2C119FD1B9733C3C0289D608512(L_9, L_11, /*hidden argument*/NULL); V_5 = L_12; StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_13 = V_5; if (!L_13) { goto IL_00aa; } } { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_14 = V_5; NullCheck(L_14); if ((((int32_t)(((int32_t)((int32_t)(((RuntimeArray*)L_14)->max_length))))) < ((int32_t)4))) { goto IL_00aa; } } { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_15 = V_5; NullCheck(L_15); int32_t L_16 = 0; String_t* L_17 = (L_15)->GetAt(static_cast<il2cpp_array_size_t>(L_16)); NullCheck(L_17); String_t* L_18 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_17, /*hidden argument*/NULL); bool L_19 = Int32_TryParse_m03D31CAB7050E8286A8A90711C896B181006AD00(L_18, (int32_t*)(&V_1), /*hidden argument*/NULL); if (L_19) { goto IL_0068; } } { V_1 = 0; } IL_0068: { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_20 = V_5; NullCheck(L_20); int32_t L_21 = 1; String_t* L_22 = (L_20)->GetAt(static_cast<il2cpp_array_size_t>(L_21)); NullCheck(L_22); String_t* L_23 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_22, /*hidden argument*/NULL); bool L_24 = Int32_TryParse_m03D31CAB7050E8286A8A90711C896B181006AD00(L_23, (int32_t*)(&V_2), /*hidden argument*/NULL); if (L_24) { goto IL_007c; } } { V_2 = 0; } IL_007c: { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_25 = V_5; NullCheck(L_25); int32_t L_26 = 2; String_t* L_27 = (L_25)->GetAt(static_cast<il2cpp_array_size_t>(L_26)); NullCheck(L_27); String_t* L_28 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_27, /*hidden argument*/NULL); bool L_29 = Int64_TryParse_m5C60567D82BACC7D9C18F7A9A83025FC94AD0E95(L_28, (int64_t*)(&V_3), /*hidden argument*/NULL); if (L_29) { goto IL_0091; } } { V_3 = (((int64_t)((int64_t)0))); } IL_0091: { StringU5BU5D_t933FB07893230EA91C40FF900D5400665E87B14E* L_30 = V_5; NullCheck(L_30); int32_t L_31 = 3; String_t* L_32 = (L_30)->GetAt(static_cast<il2cpp_array_size_t>(L_31)); NullCheck(L_32); String_t* L_33 = String_Trim_mB52EB7876C7132358B76B7DC95DEACA20722EF4D(L_32, /*hidden argument*/NULL); bool L_34 = Single_TryParse_m548E9EC17193999C07717FECFAD0A907980D566C(L_33, (float*)(&V_4), /*hidden argument*/NULL); if (L_34) { goto IL_00aa; } } { V_4 = (0.0f); } IL_00aa: { float L_35 = V_4; if ((!(((float)L_35) == ((float)(-90.0f))))) { goto IL_00ba; } } { V_4 = (270.0f); } IL_00ba: { int32_t L_36 = V_1; int32_t L_37 = V_2; int64_t L_38 = V_3; float L_39 = V_4; VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050 L_40; memset((&L_40), 0, sizeof(L_40)); VideoProperties__ctor_m32A6453410672BD45259FB6934BB79F2D5773D6A((&L_40), L_36, L_37, L_38, L_39, /*hidden argument*/NULL); return L_40; } } // System.Void NativeCamera::.cctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NativeCamera__cctor_m0C222C2FA9BA56F8F59D399B3C5FB952DC1A0B46 (const RuntimeMethod* method) { { return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif IL2CPP_EXTERN_C void DelegatePInvokeWrapper_CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * __this, String_t* ___path0, const RuntimeMethod* method) { typedef void (DEFAULT_CALL *PInvokeFunc)(char*); PInvokeFunc il2cppPInvokeFunc = reinterpret_cast<PInvokeFunc>(il2cpp_codegen_get_method_pointer(((RuntimeDelegate*)__this)->method)); // Marshaling of parameter '___path0' to native representation char* ____path0_marshaled = NULL; ____path0_marshaled = il2cpp_codegen_marshal_string(___path0); // Native function invocation il2cppPInvokeFunc(____path0_marshaled); // Marshaling cleanup of parameter '___path0' native representation il2cpp_codegen_marshal_free(____path0_marshaled); ____path0_marshaled = NULL; } // System.Void NativeCamera_CameraCallback::.ctor(System.Object,System.IntPtr) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void CameraCallback__ctor_m06CDD3A98F3EF9EF7AEF2D752EFDA12AD002341B (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method) { __this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1)); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void NativeCamera_CameraCallback::Invoke(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void CameraCallback_Invoke_mDB6E9D8BC2FFBBE8B06F34047EEB470634B7A987 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * __this, String_t* ___path0, const RuntimeMethod* method) { DelegateU5BU5D_tDFCDEE2A6322F96C0FE49AF47E9ADB8C4B294E86* delegateArrayToInvoke = __this->get_delegates_11(); Delegate_t** delegatesToInvoke; il2cpp_array_size_t length; if (delegateArrayToInvoke != NULL) { length = delegateArrayToInvoke->max_length; delegatesToInvoke = reinterpret_cast<Delegate_t**>(delegateArrayToInvoke->GetAddressAtUnchecked(0)); } else { length = 1; delegatesToInvoke = reinterpret_cast<Delegate_t**>(&__this); } for (il2cpp_array_size_t i = 0; i < length; i++) { Delegate_t* currentDelegate = delegatesToInvoke[i]; Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0(); RuntimeObject* targetThis = currentDelegate->get_m_target_2(); RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3()); if (!il2cpp_codegen_method_is_virtual(targetMethod)) { il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod); } bool ___methodIsStatic = MethodIsStatic(targetMethod); int ___parameterCount = il2cpp_codegen_method_parameter_count(targetMethod); if (___methodIsStatic) { if (___parameterCount == 1) { // open typedef void (*FunctionPointerType) (String_t*, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(___path0, targetMethod); } else { // closed typedef void (*FunctionPointerType) (void*, String_t*, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(targetThis, ___path0, targetMethod); } } else if (___parameterCount != 1) { // open if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this)) { if (il2cpp_codegen_method_is_generic_instance(targetMethod)) { if (il2cpp_codegen_method_is_interface_method(targetMethod)) GenericInterfaceActionInvoker0::Invoke(targetMethod, ___path0); else GenericVirtActionInvoker0::Invoke(targetMethod, ___path0); } else { if (il2cpp_codegen_method_is_interface_method(targetMethod)) InterfaceActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___path0); else VirtActionInvoker0::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___path0); } } else { typedef void (*FunctionPointerType) (String_t*, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(___path0, targetMethod); } } else { // closed if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this)) { if (targetThis == NULL) { typedef void (*FunctionPointerType) (String_t*, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(___path0, targetMethod); } else if (il2cpp_codegen_method_is_generic_instance(targetMethod)) { if (il2cpp_codegen_method_is_interface_method(targetMethod)) GenericInterfaceActionInvoker1< String_t* >::Invoke(targetMethod, targetThis, ___path0); else GenericVirtActionInvoker1< String_t* >::Invoke(targetMethod, targetThis, ___path0); } else { if (il2cpp_codegen_method_is_interface_method(targetMethod)) InterfaceActionInvoker1< String_t* >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___path0); else VirtActionInvoker1< String_t* >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___path0); } } else { typedef void (*FunctionPointerType) (void*, String_t*, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(targetThis, ___path0, targetMethod); } } } } // System.IAsyncResult NativeCamera_CameraCallback::BeginInvoke(System.String,System.AsyncCallback,System.Object) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RuntimeObject* CameraCallback_BeginInvoke_m21D9FDFCED28A2EC274D7199B9AAFCA4ACBAB831 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * __this, String_t* ___path0, AsyncCallback_t3F3DA3BEDAEE81DD1D24125DF8EB30E85EE14DA4 * ___callback1, RuntimeObject * ___object2, const RuntimeMethod* method) { void *__d_args[2] = {0}; __d_args[0] = ___path0; return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback1, (RuntimeObject*)___object2); } // System.Void NativeCamera_CameraCallback::EndInvoke(System.IAsyncResult) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void CameraCallback_EndInvoke_mB38309BB36CA685EBA4DB5EA60ECC2628705E9A6 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * __this, RuntimeObject* ___result0, const RuntimeMethod* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Conversion methods for marshalling of: NativeCamera/ImageProperties IL2CPP_EXTERN_C void ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshal_pinvoke(const ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90& unmarshaled, ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_pinvoke& marshaled) { marshaled.___width_0 = unmarshaled.get_width_0(); marshaled.___height_1 = unmarshaled.get_height_1(); marshaled.___mimeType_2 = il2cpp_codegen_marshal_string(unmarshaled.get_mimeType_2()); marshaled.___orientation_3 = unmarshaled.get_orientation_3(); } IL2CPP_EXTERN_C void ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshal_pinvoke_back(const ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_pinvoke& marshaled, ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90& unmarshaled) { int32_t unmarshaled_width_temp_0 = 0; unmarshaled_width_temp_0 = marshaled.___width_0; unmarshaled.set_width_0(unmarshaled_width_temp_0); int32_t unmarshaled_height_temp_1 = 0; unmarshaled_height_temp_1 = marshaled.___height_1; unmarshaled.set_height_1(unmarshaled_height_temp_1); unmarshaled.set_mimeType_2(il2cpp_codegen_marshal_string_result(marshaled.___mimeType_2)); int32_t unmarshaled_orientation_temp_3 = 0; unmarshaled_orientation_temp_3 = marshaled.___orientation_3; unmarshaled.set_orientation_3(unmarshaled_orientation_temp_3); } // Conversion method for clean up from marshalling of: NativeCamera/ImageProperties IL2CPP_EXTERN_C void ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshal_pinvoke_cleanup(ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_pinvoke& marshaled) { il2cpp_codegen_marshal_free(marshaled.___mimeType_2); marshaled.___mimeType_2 = NULL; } // Conversion methods for marshalling of: NativeCamera/ImageProperties IL2CPP_EXTERN_C void ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshal_com(const ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90& unmarshaled, ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_com& marshaled) { marshaled.___width_0 = unmarshaled.get_width_0(); marshaled.___height_1 = unmarshaled.get_height_1(); marshaled.___mimeType_2 = il2cpp_codegen_marshal_bstring(unmarshaled.get_mimeType_2()); marshaled.___orientation_3 = unmarshaled.get_orientation_3(); } IL2CPP_EXTERN_C void ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshal_com_back(const ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_com& marshaled, ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90& unmarshaled) { int32_t unmarshaled_width_temp_0 = 0; unmarshaled_width_temp_0 = marshaled.___width_0; unmarshaled.set_width_0(unmarshaled_width_temp_0); int32_t unmarshaled_height_temp_1 = 0; unmarshaled_height_temp_1 = marshaled.___height_1; unmarshaled.set_height_1(unmarshaled_height_temp_1); unmarshaled.set_mimeType_2(il2cpp_codegen_marshal_bstring_result(marshaled.___mimeType_2)); int32_t unmarshaled_orientation_temp_3 = 0; unmarshaled_orientation_temp_3 = marshaled.___orientation_3; unmarshaled.set_orientation_3(unmarshaled_orientation_temp_3); } // Conversion method for clean up from marshalling of: NativeCamera/ImageProperties IL2CPP_EXTERN_C void ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshal_com_cleanup(ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90_marshaled_com& marshaled) { il2cpp_codegen_marshal_free_bstring(marshaled.___mimeType_2); marshaled.___mimeType_2 = NULL; } // System.Void NativeCamera_ImageProperties::.ctor(System.Int32,System.Int32,System.String,NativeCamera_ImageOrientation) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void ImageProperties__ctor_m253C8AFFAC48F1FE018C7A1A657D740ADCED2206 (ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90 * __this, int32_t ___width0, int32_t ___height1, String_t* ___mimeType2, int32_t ___orientation3, const RuntimeMethod* method) { { int32_t L_0 = ___width0; __this->set_width_0(L_0); int32_t L_1 = ___height1; __this->set_height_1(L_1); String_t* L_2 = ___mimeType2; __this->set_mimeType_2(L_2); int32_t L_3 = ___orientation3; __this->set_orientation_3(L_3); return; } } IL2CPP_EXTERN_C void ImageProperties__ctor_m253C8AFFAC48F1FE018C7A1A657D740ADCED2206_AdjustorThunk (RuntimeObject * __this, int32_t ___width0, int32_t ___height1, String_t* ___mimeType2, int32_t ___orientation3, const RuntimeMethod* method) { ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90 * _thisAdjusted = reinterpret_cast<ImageProperties_t9DE8A28AE9E870BA286E5E263B552E95D9079C90 *>(__this + 1); ImageProperties__ctor_m253C8AFFAC48F1FE018C7A1A657D740ADCED2206(_thisAdjusted, ___width0, ___height1, ___mimeType2, ___orientation3, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void NativeCamera_VideoProperties::.ctor(System.Int32,System.Int32,System.Int64,System.Single) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void VideoProperties__ctor_m32A6453410672BD45259FB6934BB79F2D5773D6A (VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050 * __this, int32_t ___width0, int32_t ___height1, int64_t ___duration2, float ___rotation3, const RuntimeMethod* method) { { int32_t L_0 = ___width0; __this->set_width_0(L_0); int32_t L_1 = ___height1; __this->set_height_1(L_1); int64_t L_2 = ___duration2; __this->set_duration_2(L_2); float L_3 = ___rotation3; __this->set_rotation_3(L_3); return; } } IL2CPP_EXTERN_C void VideoProperties__ctor_m32A6453410672BD45259FB6934BB79F2D5773D6A_AdjustorThunk (RuntimeObject * __this, int32_t ___width0, int32_t ___height1, int64_t ___duration2, float ___rotation3, const RuntimeMethod* method) { VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050 * _thisAdjusted = reinterpret_cast<VideoProperties_tCB2C29FD46C59B861A514C0568BAD1F799F20050 *>(__this + 1); VideoProperties__ctor_m32A6453410672BD45259FB6934BB79F2D5773D6A(_thisAdjusted, ___width0, ___height1, ___duration2, ___rotation3, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Boolean NativeCameraNamespace.NCCameraCallbackiOS::get_IsBusy() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E_MetadataUsageId); s_Il2CppMethodInitialized = true; } { bool L_0 = ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->get_U3CIsBusyU3Ek__BackingField_7(); return L_0; } } // System.Void NativeCameraNamespace.NCCameraCallbackiOS::set_IsBusy(System.Boolean) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65 (bool ___value0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65_MetadataUsageId); s_Il2CppMethodInitialized = true; } { bool L_0 = ___value0; ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->set_U3CIsBusyU3Ek__BackingField_7(L_0); return; } } IL2CPP_EXTERN_C int32_t DEFAULT_CALL _NativeCamera_IsCameraBusy(); // System.Int32 NativeCameraNamespace.NCCameraCallbackiOS::_NativeCamera_IsCameraBusy() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t NCCameraCallbackiOS__NativeCamera_IsCameraBusy_m381C33C0F3F356268DAE2BD0367349E0529B9AF0 (const RuntimeMethod* method) { typedef int32_t (DEFAULT_CALL *PInvokeFunc) (); // Native function invocation int32_t returnValue = reinterpret_cast<PInvokeFunc>(_NativeCamera_IsCameraBusy)(); return returnValue; } // System.Void NativeCameraNamespace.NCCameraCallbackiOS::Initialize(NativeCamera_CameraCallback) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NCCameraCallbackiOS_Initialize_m389551BB3149858479025978267F9E27527CCC56 (CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * ___callback0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NCCameraCallbackiOS_Initialize_m389551BB3149858479025978267F9E27527CCC56_MetadataUsageId); s_Il2CppMethodInitialized = true; } { bool L_0 = NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E_inline(/*hidden argument*/NULL); if (!L_0) { goto IL_0008; } } { return; } IL_0008: { NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * L_1 = ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->get_instance_4(); IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); bool L_2 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_1, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0038; } } { GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_3 = (GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F *)il2cpp_codegen_object_new(GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F_il2cpp_TypeInfo_var); GameObject__ctor_mBB454E679AD9CF0B84D3609A01E6A9753ACF4686(L_3, _stringLiteralD2BFCAA4D83D4D9184D3BFF9BECDA1C5341E74DE, /*hidden argument*/NULL); NullCheck(L_3); NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * L_4 = GameObject_AddComponent_TisNCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_m91678FB65CA0F4DA054C800CD5A13E4B23347CEE(L_3, /*hidden argument*/GameObject_AddComponent_TisNCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_m91678FB65CA0F4DA054C800CD5A13E4B23347CEE_RuntimeMethod_var); ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->set_instance_4(L_4); NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * L_5 = ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->get_instance_4(); NullCheck(L_5); GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_6 = Component_get_gameObject_m0B0570BA8DDD3CD78A9DB568EA18D7317686603C(L_5, /*hidden argument*/NULL); IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var); Object_DontDestroyOnLoad_m4DC90770AD6084E4B1B8489C6B41205DC020C207(L_6, /*hidden argument*/NULL); } IL_0038: { NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * L_7 = ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->get_instance_4(); CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * L_8 = ___callback0; NullCheck(L_7); L_7->set_callback_5(L_8); NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * L_9 = ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->get_instance_4(); float L_10 = Time_get_realtimeSinceStartup_mCA1086EC9DFCF135F77BC46D3B7127711EA3DE03(/*hidden argument*/NULL); NullCheck(L_9); L_9->set_nextBusyCheckTime_6(((float)il2cpp_codegen_add((float)L_10, (float)(1.0f)))); NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65_inline((bool)1, /*hidden argument*/NULL); return; } } // System.Void NativeCameraNamespace.NCCameraCallbackiOS::Update() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NCCameraCallbackiOS_Update_mD6CE92640FA27EB1ACEE46BF34D468D7F4A9A746 (NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * __this, const RuntimeMethod* method) { { bool L_0 = NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E_inline(/*hidden argument*/NULL); if (!L_0) { goto IL_004d; } } { float L_1 = Time_get_realtimeSinceStartup_mCA1086EC9DFCF135F77BC46D3B7127711EA3DE03(/*hidden argument*/NULL); float L_2 = __this->get_nextBusyCheckTime_6(); if ((!(((float)L_1) >= ((float)L_2)))) { goto IL_004d; } } { float L_3 = Time_get_realtimeSinceStartup_mCA1086EC9DFCF135F77BC46D3B7127711EA3DE03(/*hidden argument*/NULL); __this->set_nextBusyCheckTime_6(((float)il2cpp_codegen_add((float)L_3, (float)(1.0f)))); int32_t L_4 = NCCameraCallbackiOS__NativeCamera_IsCameraBusy_m381C33C0F3F356268DAE2BD0367349E0529B9AF0(/*hidden argument*/NULL); if (L_4) { goto IL_004d; } } { NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65_inline((bool)0, /*hidden argument*/NULL); CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * L_5 = __this->get_callback_5(); if (!L_5) { goto IL_004d; } } { CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * L_6 = __this->get_callback_5(); NullCheck(L_6); CameraCallback_Invoke_mDB6E9D8BC2FFBBE8B06F34047EEB470634B7A987(L_6, (String_t*)NULL, /*hidden argument*/NULL); __this->set_callback_5((CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 *)NULL); } IL_004d: { return; } } // System.Void NativeCameraNamespace.NCCameraCallbackiOS::OnMediaReceived(System.String) IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NCCameraCallbackiOS_OnMediaReceived_m9F84EDBBD45122AFA6F0AEB91DC9401BABB7CE03 (NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * __this, String_t* ___path0, const RuntimeMethod* method) { { NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65_inline((bool)0, /*hidden argument*/NULL); String_t* L_0 = ___path0; bool L_1 = String_IsNullOrEmpty_m06A85A206AC2106D1982826C5665B9BD35324229(L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0011; } } { ___path0 = (String_t*)NULL; } IL_0011: { CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * L_2 = __this->get_callback_5(); if (!L_2) { goto IL_002c; } } { CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 * L_3 = __this->get_callback_5(); String_t* L_4 = ___path0; NullCheck(L_3); CameraCallback_Invoke_mDB6E9D8BC2FFBBE8B06F34047EEB470634B7A987(L_3, L_4, /*hidden argument*/NULL); __this->set_callback_5((CameraCallback_tF13FD819119503A40D7481F3CC0644C2AFBB1370 *)NULL); } IL_002c: { return; } } // System.Void NativeCameraNamespace.NCCameraCallbackiOS::.ctor() IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void NCCameraCallbackiOS__ctor_m2804786E69305B36A468603CDF5BEB9186D50388 (NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738 * __this, const RuntimeMethod* method) { { MonoBehaviour__ctor_mEAEC84B222C60319D593E456D769B3311DFCEF97(__this, /*hidden argument*/NULL); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR bool NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86E_inline (const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NCCameraCallbackiOS_get_IsBusy_mCC9F9769F567AB062061361C6C07CBB87287A86EAssemblyU2DCSharpU2Dfirstpass_MetadataUsageId); s_Il2CppMethodInitialized = true; } { bool L_0 = ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->get_U3CIsBusyU3Ek__BackingField_7(); return L_0; } } IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR int32_t String_get_Length_mD48C8A16A5CF1914F330DCE82D9BE15C3BEDD018_inline (String_t* __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get_m_stringLength_0(); return L_0; } } IL2CPP_EXTERN_C inline IL2CPP_METHOD_ATTR void NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65_inline (bool ___value0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (NCCameraCallbackiOS_set_IsBusy_mCE1B3D8248DC488A5C05491CC879995B2807DE65AssemblyU2DCSharpU2Dfirstpass_MetadataUsageId); s_Il2CppMethodInitialized = true; } { bool L_0 = ___value0; ((NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_StaticFields*)il2cpp_codegen_static_fields_for(NCCameraCallbackiOS_t87C0777637E32D218986F4DDE432C9AD212A5738_il2cpp_TypeInfo_var))->set_U3CIsBusyU3Ek__BackingField_7(L_0); return; } }
3009d9d3cbc2d36f7e35bfc7c63694b7964e8578
9e9003cad19a68de4209f91ecd931e0b6325234b
/Build/HW5_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/lumpedcpp/Lump_libil2cpp_metadata.cpp
d10ae5f4aed86cd69b02261adb78b415aa76a346
[]
no_license
syc418/GolemBirdMagicForest
0d4f902e82cc8938b5f05f295670cdb1a1cdd95b
1b5e8543dd28b8a4353d7f3678608b17a7a893ae
refs/heads/main
2023-03-15T10:41:29.860580
2021-03-26T04:27:34
2021-03-26T04:27:34
351,646,466
0
0
null
null
null
null
UTF-8
C++
false
false
2,057
cpp
#include "il2cpp-config.h" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\ArrayMetadata.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\FieldLayout.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\GenericMetadata.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\GenericMethod.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\GenericSharing.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericClassCompare.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericClassHash.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericContextCompare.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericContextHash.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericInstCompare.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericInstHash.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericMethodCompare.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppGenericMethodHash.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppSignatureCompare.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppSignatureHash.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppTypeCompare.cpp" #include "C:\Program Files\Unity\Hub\Editor\2020.1.17f1\Editor\Data\il2cpp\libil2cpp\metadata\Il2CppTypeHash.cpp"
14c5eb6ff0e1a8302541b1d6195c980ad800a3d5
cca87b386b19c55fd0c10bb4b3355e2f1464aa5e
/src/network/gumbo/query/src/GumboQueryDocument.cpp
9a04a32b6a1a2b707d339790295001d070cb5ec9
[ "MIT" ]
permissive
zhanfeifei/LibQQt
583024ccfa94597942936b7c284cbc930a9a8b0d
995262e02b36111a5b0f5ce51f305c7e1110eb9e
refs/heads/master
2020-03-17T13:46:00.520562
2018-04-30T04:19:35
2018-04-30T04:19:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,033
cpp
/*************************************************************************** * * $Id$ * **************************************************************************/ /** * @file $HeadURL$ * @author $Author$([email protected]) * @date $Date$ * @version $Revision$ * @brief * **/ #include "GumboQueryDocument.h" GumboQueryDocument::GumboQueryDocument() { mpOutput = NULL; } void GumboQueryDocument::parse ( const std::string& aInput ) { reset(); mpOutput = gumbo_parse ( aInput.c_str() ); } GumboQueryDocument::~GumboQueryDocument() { reset(); } GumboQuerySelection GumboQueryDocument::find ( std::string aSelector ) { if ( mpOutput == NULL ) { throw "document not initialized"; } GumboQuerySelection sel ( mpOutput->root ); return sel.find ( aSelector ); } void GumboQueryDocument::reset() { if ( mpOutput != NULL ) { gumbo_destroy_output ( &kGumboDefaultOptions, mpOutput ); mpOutput = NULL; } } /* vim: set ts=4 sw=4 sts=4 tw=100 noet: */
200a7cebf14003018c8deb7a193d5096c0c6a3d6
d58be819169ac2b219d07e8539cf5cfcf2ea787e
/17/exercise/ex_17_03_to_lower.cpp
a9a6bcfdfe46aafa150c45b0021ba3731a3f11b6
[]
no_license
IronClimber/_Straustrup
602b73cf520b99f03744be70179b7e51d4597613
c3c14eefa089c749cc75335b6328d87bc9af4826
refs/heads/master
2021-06-10T22:44:25.617440
2021-05-25T08:55:14
2021-05-25T08:55:14
192,340,948
0
0
null
null
null
null
UTF-8
C++
false
false
263
cpp
#include <iostream> void to_lower(char* s) { while(*s) { *s = tolower(*s); ++s; } } int main() { char str[]{"Hello, World!"}; std::cout << str << std::endl; //Why not &str? to_lower(str); std::cout << str << std::endl; return 0; }
22d20ae6f8aba802cfadabcb5fbc9daa4a51fc96
ff32a8c4140007d49f3f36c79541f7e8404b401d
/src/tests/test_diis.cc
942cb0153902bb88db886ab870e7ff40bb196430
[ "Apache-2.0" ]
permissive
mbarbry/xtp
f98960c0ea3f50ad8aa86ed86f1c98146ae395e8
e79828209d11ec25bf1750ab75499ecf50f584ef
refs/heads/master
2020-03-21T21:19:59.144762
2018-09-13T08:29:34
2018-09-13T08:29:34
139,058,329
0
0
Apache-2.0
2018-08-03T10:05:10
2018-06-28T19:07:16
C++
UTF-8
C++
false
false
11,046
cc
/* * Copyright 2009-2018 The VOTCA Development Team (http://www.votca.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * 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. * */ #define BOOST_TEST_MAIN #define BOOST_TEST_MODULE diis_test #include <boost/test/unit_test.hpp> #include <votca/xtp/diis.h> using namespace votca::xtp; BOOST_AUTO_TEST_SUITE(diis_test) BOOST_AUTO_TEST_CASE(coeffs_test) { DIIS diis; diis.setHistLength(5); Eigen::MatrixXd error1=Eigen::MatrixXd::Zero(17,17); error1<<-5.72459e-17,0.421271,1.16054e-12,9.88822e-13,1.10962e-12,0.50196,4.5521e-13,3.66001e-13,4.25776e-13,0.156112,0.166066,0.156112,0.166066,0.156112,0.166066,0.156112,0.166066, -0.421271,-2.498e-16,-2.92683e-14,-5.89528e-14,-4.81698e-14,1.26589,-5.89129e-14,-1.95411e-13,-1.22952e-13,0.472946,0.397505,0.472946,0.397505,0.472946,0.397505,0.472946,0.397505, -1.16054e-12,2.93376e-14,7.63278e-17,5.97439e-15,-1.8735e-15,1.05584e-13,1.38874,-1.91427e-14,-4.33134e-14,0.545347,0.178966,0.545347,0.178966,-0.545347,-0.178966,-0.545347,-0.178966, -9.88848e-13,5.89806e-14,-5.94663e-15,1.249e-16,-4.3715e-16,-1.95607e-14,-3.9491e-14,1.38874,1.69812e-14,0.545347,0.178966,-0.545347,-0.178966,-0.545347,-0.178966,0.545347,0.178966, -1.10963e-12,4.82947e-14,1.85268e-15,3.88578e-16,-1.52656e-16,5.73395e-14,-4.0223e-14,1.68242e-14,1.38874,0.545347,0.178966,-0.545347,-0.178966,0.545347,0.178966,-0.545347,-0.178966, -0.50196,-1.26589,-1.05749e-13,1.94844e-14,-5.73985e-14,1.16573e-15,-8.18512e-14,-1.13382e-13,-9.86849e-14,0.0944269,-0.025375,0.0944269,-0.025375,0.0944269,-0.025375,0.0944269,-0.025375, -4.55275e-13,5.82867e-14,-1.38874,3.91354e-14,4.02456e-14,8.18512e-14,-1.249e-16,4.88498e-15,-1.33227e-15,-0.0078462,-0.0361018,-0.0078462,-0.0361018,0.0078462,0.0361018,0.0078462,0.0361018, -3.65957e-13,1.95843e-13,1.92624e-14,-1.38874,-1.68754e-14,1.13132e-13,-4.89886e-15,-2.15106e-16,8.67362e-16,-0.0078462,-0.0361018,0.0078462,0.0361018,0.0078462,0.0361018,-0.0078462,-0.0361018, -4.25771e-13,1.2268e-13,4.34097e-14,-1.68199e-14,-1.38874,9.85184e-14,1.2837e-15,-8.67362e-16,4.85723e-17,-0.0078462,-0.0361018,0.0078462,0.0361018,-0.0078462,-0.0361018,0.0078462,0.0361018, -0.156112,-0.472946,-0.545347,-0.545347,-0.545347,-0.0944269,0.0078462,0.0078462,0.0078462,7.71952e-17,-0.0786286,-2.91807e-14,-0.0259657,-2.69637e-14,-0.0259657,-2.87721e-14,-0.0259657, -0.166066,-0.397505,-0.178966,-0.178966,-0.178966,0.025375,0.0361018,0.0361018,0.0361018,0.0786286,-2.34188e-17,0.0259657,-2.7949e-14,0.0259657,-2.46756e-14,0.0259657,-2.28238e-14, -0.156112,-0.472946,-0.545347,0.545347,0.545347,-0.0944269,0.0078462,-0.0078462,-0.0078462,2.91954e-14,-0.0259657,-7.80626e-18,-0.0786286,9.72313e-15,-0.0259657,7.13839e-15,-0.0259657, -0.166066,-0.397505,-0.178966,0.178966,0.178966,0.025375,0.0361018,-0.0361018,-0.0361018,0.0259657,2.8047e-14,0.0786286,-5.46438e-17,0.0259657,4.62737e-15,0.0259657,6.36297e-15, -0.156112,-0.472946,0.545347,0.545347,-0.545347,-0.0944269,-0.0078462,-0.0078462,0.0078462,2.69862e-14,-0.0259657,-9.70144e-15,-0.0259657,5.20417e-18,-0.0786286,1.13156e-14,-0.0259657, -0.166066,-0.397505,0.178966,0.178966,-0.178966,0.025375,-0.0361018,-0.0361018,0.0361018,0.0259657,2.46097e-14,0.0259657,-4.60656e-15,0.0786286,4.85723e-17,0.0259657,2.6641e-15, -0.156112,-0.472946,0.545347,-0.545347,0.545347,-0.0944269,-0.0078462,0.0078462,-0.0078462,2.87617e-14,-0.0259657,-7.16094e-15,-0.0259657,-1.12965e-14,-0.0259657,-8.32667e-17,-0.0786286, -0.166066,-0.397505,0.178966,-0.178966,0.178966,0.025375,-0.0361018,0.0361018,-0.0361018,0.0259657,2.28706e-14,0.0259657,-6.32827e-15,0.0259657,-2.65066e-15,0.0786286,-1.11022e-16; diis.Update(0,error1); Eigen::MatrixXd error2=Eigen::MatrixXd::Zero(17,17); error2<<-2.51535e-17,0.205521,8.26338e-13,7.18129e-13,7.93573e-13,0.243239,3.58892e-13,3.05159e-13,3.40282e-13,0.0733301,0.0756726,0.0733301,0.0756726,0.0733301,0.0756726,0.0733301,0.0756726, -0.205521,-9.71445e-17,-7.9152e-14,-9.96217e-14,-9.34253e-14,0.606644,-7.45523e-14,-1.49427e-13,-1.09844e-13,0.21304,0.159214,0.21304,0.159214,0.21304,0.159214,0.21304,0.159214, -8.26348e-13,7.9152e-14,1.249e-16,3.32373e-15,-1.08941e-15,1.72229e-13,0.665049,-6.61657e-13,-6.73987e-13,0.250896,0.0655191,0.250896,0.0655191,-0.250896,-0.0655191,-0.250896,-0.0655191, -7.1813e-13,9.96356e-14,-3.32026e-15,2.08167e-17,-3.22659e-16,9.39544e-14,-6.74565e-13,0.665049,-6.42454e-13,0.250896,0.0655191,-0.250896,-0.0655191,-0.250896,-0.0655191,0.250896,0.0655191, -7.93567e-13,9.34634e-14,1.09635e-15,2.98372e-16,-1.73472e-17,1.37192e-13,-6.70585e-13,-6.42393e-13,0.665049,0.250896,0.0655191,-0.250896,-0.0655191,0.250896,0.0655191,-0.250896,-0.0655191, -0.243239,-0.606644,-1.72307e-13,-9.39249e-14,-1.37251e-13,1.11022e-16,-1.91423e-13,-2.08285e-13,-1.98681e-13,0.0367454,-0.0343107,0.0367454,-0.0343107,0.0367454,-0.0343107,0.0367454,-0.0343107, -3.5888e-13,7.43294e-14,-0.665049,6.74599e-13,6.70575e-13,1.91534e-13,2.08167e-17,3.94129e-15,-1.67921e-15,-0.00308388,-0.0257548,-0.00308388,-0.0257548,0.00308388,0.0257548,0.00308388,0.0257548, -3.052e-13,1.49269e-13,6.61554e-13,-0.665049,6.42431e-13,2.08396e-13,-3.92394e-15,0,3.33067e-16,-0.00308388,-0.0257548,0.00308388,0.0257548,0.00308388,0.0257548,-0.00308388,-0.0257548, -3.40381e-13,1.09607e-13,6.74016e-13,6.42403e-13,-0.665049,1.98716e-13,1.68268e-15,-3.43475e-16,2.42861e-17,-0.00308388,-0.0257548,0.00308388,0.0257548,-0.00308388,-0.0257548,0.00308388,0.0257548, -0.0733301,-0.21304,-0.250896,-0.250896,-0.250896,-0.0367454,0.00308388,0.00308388,0.00308388,-1.38778e-17,-0.0654894,8.63571e-13,-0.00963694,8.65418e-13,-0.00963694,8.64126e-13,-0.00963694, -0.0756726,-0.159214,-0.0655191,-0.0655191,-0.0655191,0.0343107,0.0257548,0.0257548,0.0257548,0.0654894,1.36609e-17,0.00963694,-1.09752e-12,0.00963694,-1.09576e-12,0.00963694,-1.09277e-12, -0.0733301,-0.21304,-0.250896,0.250896,0.250896,-0.0367454,0.00308388,-0.00308388,-0.00308388,-8.63565e-13,-0.00963694,4.33681e-18,-0.0654894,6.12054e-15,-0.00963694,4.83207e-15,-0.00963694, -0.0756726,-0.159214,-0.0655191,0.0655191,0.0655191,0.0343107,0.0257548,-0.0257548,-0.0257548,0.00963694,1.09758e-12,0.0654894,-1.27936e-17,0.00963694,2.65369e-15,0.00963694,5.03937e-15, -0.0733301,-0.21304,0.250896,0.250896,-0.250896,-0.0367454,-0.00308388,-0.00308388,0.00308388,-8.65396e-13,-0.00963694,-6.11273e-15,-0.00963694,-3.90313e-18,-0.0654894,7.43416e-15,-0.00963694, -0.0756726,-0.159214,0.0655191,0.0655191,-0.0655191,0.0343107,-0.0257548,-0.0257548,0.0257548,0.00963694,1.09579e-12,0.00963694,-2.69272e-15,0.0654894,-5.5728e-17,0.00963694,4.17331e-15, -0.0733301,-0.21304,0.250896,-0.250896,0.250896,-0.0367454,-0.00308388,0.00308388,-0.00308388,-8.64107e-13,-0.00963694,-4.83988e-15,-0.00963694,-7.43156e-15,-0.00963694,2.77556e-17,-0.0654894, -0.0756726,-0.159214,0.0655191,-0.0655191,0.0655191,0.0343107,-0.0257548,0.0257548,-0.0257548,0.00963694,1.09275e-12,0.00963694,-5.06886e-15,0.00963694,-4.19456e-15,0.0654894,-4.16334e-17; diis.Update(0,error2); Eigen::MatrixXd error3=Eigen::MatrixXd::Zero(17,17); error3<<-3.36103e-18,0.0621516,3.52141e-13,3.02803e-13,3.38022e-13,0.0659688,6.75571e-14,4.8904e-14,6.22049e-14,0.0121774,0.00560933,0.0121774,0.00560933,0.0121774,0.00560933,0.0121774,0.00560933, -0.0621516,-2.68882e-17,2.47372e-14,1.22198e-14,1.69188e-14,0.157095,-3.08916e-13,-3.27307e-13,-3.19507e-13,0.0177149,-0.0330234,0.0177149,-0.0330234,0.0177149,-0.0330234,0.0177149,-0.0330234, -3.52141e-13,-2.47368e-14,-4.87891e-18,1.22461e-15,-5.48932e-16,-8.17619e-14,0.160239,-3.19182e-13,-3.18678e-13,0.0348853,-0.0441531,0.0348853,-0.0441531,-0.0348853,0.0441531,-0.0348853,0.0441531, -3.02802e-13,-1.22209e-14,-1.22417e-15,-1.11673e-17,-1.76617e-16,-1.11732e-13,-3.24306e-13,0.160239,-3.10646e-13,0.0348853,-0.0441531,-0.0348853,0.0441531,-0.0348853,0.0441531,0.0348853,-0.0441531, -3.3802e-13,-1.69193e-14,5.48281e-16,1.7705e-16,-5.74627e-18,-9.82686e-14,-3.17277e-13,-3.10976e-13,0.160239,0.0348853,-0.0441531,-0.0348853,0.0441531,0.0348853,-0.0441531,-0.0348853,0.0441531, -0.0659688,-0.157095,8.17558e-14,1.11734e-13,9.82721e-14,2.77556e-17,-9.99374e-14,-9.87196e-14,-9.73423e-14,-0.0176436,-0.0598529,-0.0176436,-0.0598529,-0.0176436,-0.0598529,-0.0176436,-0.0598529, -6.75501e-14,3.08913e-13,-0.160239,3.24307e-13,3.17276e-13,9.99478e-14,-3.46945e-18,1.86136e-15,1.04604e-15,-0.00608808,-0.0306018,-0.00608808,-0.0306018,0.00608808,0.0306018,0.00608808,0.0306018, -4.89123e-14,3.27315e-13,3.19187e-13,-0.160239,3.10973e-13,9.87127e-14,-1.85789e-15,0,5.20417e-16,-0.00608808,-0.0306018,0.00608808,0.0306018,0.00608808,0.0306018,-0.00608808,-0.0306018, -6.22072e-14,3.19505e-13,3.18679e-13,3.10642e-13,-0.160239,9.73388e-14,-1.04777e-15,-5.11743e-16,-2.77556e-17,-0.00608808,-0.0306018,0.00608808,0.0306018,-0.00608808,-0.0306018,0.00608808,0.0306018, -0.0121774,-0.0177149,-0.0348853,-0.0348853,-0.0348853,0.0176436,0.00608808,0.00608808,0.00608808,-2.19551e-18,-0.0562084,5.60581e-13,0.00673288,5.6097e-13,0.00673288,5.59758e-13,0.00673288, -0.00560933,0.0330234,0.0441531,0.0441531,0.0441531,0.0598529,0.0306018,0.0306018,0.0306018,0.0562084,3.90313e-18,-0.00673288,-6.01511e-13,-0.00673288,-6.01863e-13,-0.00673288,-6.01939e-13, -0.0121774,-0.0177149,-0.0348853,0.0348853,0.0348853,0.0176436,0.00608808,-0.00608808,-0.00608808,-5.60582e-13,0.00673288,-1.61275e-18,-0.0562084,2.81444e-15,0.00673288,1.93855e-15,0.00673288, -0.00560933,0.0330234,0.0441531,-0.0441531,-0.0441531,0.0598529,0.0306018,-0.0306018,-0.0306018,-0.00673288,6.01547e-13,0.0562084,-9.54098e-18,-0.00673288,1.00874e-15,-0.00673288,1.74513e-15, -0.0121774,-0.0177149,0.0348853,0.0348853,-0.0348853,0.0176436,-0.00608808,-0.00608808,0.00608808,-5.6097e-13,0.00673288,-2.8151e-15,0.00673288,3.86247e-18,-0.0562084,4.46409e-15,0.00673288, -0.00560933,0.0330234,-0.0441531,-0.0441531,0.0441531,0.0598529,-0.0306018,-0.0306018,0.0306018,-0.00673288,6.01854e-13,-0.00673288,-9.97032e-16,0.0562084,1.17094e-17,-0.00673288,-5.82867e-16, -0.0121774,-0.0177149,0.0348853,-0.0348853,0.0348853,0.0176436,-0.00608808,0.00608808,-0.00608808,-5.59759e-13,0.00673288,-1.94007e-15,0.00673288,-4.46323e-15,0.00673288,0,-0.0562084, -0.00560933,0.0330234,-0.0441531,0.0441531,-0.0441531,0.0598529,-0.0306018,0.0306018,-0.0306018,-0.00673288,6.01939e-13,-0.00673288,-1.73819e-15,-0.00673288,5.82867e-16,0.0562084,-2.77556e-17; diis.Update(0,error3); Eigen::VectorXd Coeffs=diis.CalcCoeff(); Eigen::VectorXd Ref=Eigen::VectorXd::Zero(3); Ref<<-2.18111,4.98827,-1.80716; bool check_diis=Coeffs.isApprox(Ref,0.00001); BOOST_CHECK_EQUAL(check_diis, 1); } BOOST_AUTO_TEST_SUITE_END()
708a4c04b3356e611f81388629b4aced0b0e5399
5c4b0b0b051ae7ed53790303802635bf8fa9fcd3
/src/Examiner/smtp.cpp
76e54b21d3f779170cd144779d3ccff6d33f4fc4
[]
no_license
yzghurovskyi/CourseWork
ff21e32df8f4802582ab712400fcbfee200f944f
095813df9c583af3f6bcfff9757e84a6a786c4fe
refs/heads/master
2021-06-18T17:27:56.439076
2017-06-09T23:50:34
2017-06-09T23:50:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,057
cpp
#include "smtp.h" Smtp::Smtp( const QString &user, const QString &pass, const QString &host, int port, int timeout ) { socket = new QSslSocket(this); connect(socket, SIGNAL(readyRead()), this, SLOT(readyRead())); connect(socket, SIGNAL(connected()), this, SLOT(connected() ) ); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this,SLOT(errorReceived(QAbstractSocket::SocketError))); connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(stateChanged(QAbstractSocket::SocketState))); connect(socket, SIGNAL(disconnected()), this,SLOT(disconnected())); this->user = user; this->pass = pass; this->host = host; this->port = port; this->timeout = timeout; } void Smtp::sendMail(const QString &from, const QString &to, const QString &subject, const QString &body, QStringList files) { message = "To: " + to + "\n"; message.append("From: " + from + "\n"); message.append("Subject: " + subject + "\n"); //Let's intitiate multipart MIME with cutting boundary "frontier" message.append("MIME-Version: 1.0\n"); message.append("Content-Type: multipart/mixed; boundary=frontier\n\n"); message.append( "--frontier\n" ); //message.append( "Content-Type: text/html\n\n" ); //Uncomment this for HTML formating, coment the line below message.append( "Content-Type: text/plain\n\n" ); message.append(body); message.append("\n\n"); if(!files.isEmpty()) { qDebug() << "Files to be sent: " << files.size(); foreach(QString filePath, files) { QFile file(filePath); if(file.exists()) { if (!file.open(QIODevice::ReadOnly)) { qDebug("Couldn't open the file"); QMessageBox::warning( 0, tr( "Qt Simple SMTP client" ), tr( "Couldn't open the file\n\n" ) ); return ; } QByteArray bytes = file.readAll(); message.append( "--frontier\n" ); message.append( "Content-Type: application/octet-stream\nContent-Disposition: attachment; filename="+ QFileInfo(file.fileName()).fileName() +";\nContent-Transfer-Encoding: base64\n\n" ); message.append(bytes.toBase64()); message.append("\n"); } } } else qDebug() << "No attachments found"; message.append( "--frontier--\n" ); message.replace( QString::fromLatin1( "\n" ), QString::fromLatin1( "\r\n" ) ); message.replace( QString::fromLatin1( "\r\n.\r\n" ),QString::fromLatin1( "\r\n..\r\n" ) ); this->from = from; rcpt = to; state = Init; socket->connectToHostEncrypted(host, port); //"smtp.gmail.com" and 465 for gmail TLS if (!socket->waitForConnected(timeout)) { qDebug() << socket->errorString(); } t = new QTextStream( socket ); } Smtp::~Smtp() { delete t; delete socket; } void Smtp::stateChanged(QAbstractSocket::SocketState socketState) { qDebug() <<"stateChanged " << socketState; } void Smtp::errorReceived(QAbstractSocket::SocketError socketError) { qDebug() << "error " <<socketError; } void Smtp::disconnected() { qDebug() <<"disconneted"; qDebug() << "error " << socket->errorString(); } void Smtp::connected() { qDebug() << "Connected "; } void Smtp::readyRead() { qDebug() <<"readyRead"; // SMTP is line-oriented QString responseLine; do { responseLine = socket->readLine(); response += responseLine; } while ( socket->canReadLine() && responseLine[3] != ' ' ); responseLine.truncate( 3 ); qDebug() << "Server response code:" << responseLine; qDebug() << "Server response: " << response; if ( state == Init && responseLine == "220" ) { // banner was okay, let's go on *t << "EHLO localhost" <<"\r\n"; t->flush(); state = HandShake; } //No need, because I'm using socket->startClienEncryption() which makes the SSL handshake for you /*else if (state == Tls && responseLine == "250") { // Trying AUTH qDebug() << "STarting Tls"; *t << "STARTTLS" << "\r\n"; t->flush(); state = HandShake; }*/ else if (state == HandShake && responseLine == "250") { socket->startClientEncryption(); if(!socket->waitForEncrypted(timeout)) { qDebug() << socket->errorString(); state = Close; } //Send EHLO once again but now encrypted *t << "EHLO localhost" << "\r\n"; t->flush(); state = Auth; } else if (state == Auth && responseLine == "250") { // Trying AUTH qDebug() << "Auth"; *t << "AUTH LOGIN" << "\r\n"; t->flush(); state = User; } else if (state == User && responseLine == "334") { //Trying User qDebug() << "Username"; //GMAIL is using XOAUTH2 protocol, which basically means that password and username has to be sent in base64 coding //https://developers.google.com/gmail/xoauth2_protocol *t << QByteArray().append(user).toBase64() << "\r\n"; t->flush(); state = Pass; } else if (state == Pass && responseLine == "334") { //Trying pass qDebug() << "Pass"; *t << QByteArray().append(pass).toBase64() << "\r\n"; t->flush(); state = Mail; } else if ( state == Mail && responseLine == "235" ) { // HELO response was okay (well, it has to be) //Apperantly for Google it is mandatory to have MAIL FROM and RCPT email formated the following way -> <[email protected]> qDebug() << "MAIL FROM:<" << from << ">"; *t << "MAIL FROM:<" << from << ">\r\n"; t->flush(); state = Rcpt; } else if ( state == Rcpt && responseLine == "250" ) { //Apperantly for Google it is mandatory to have MAIL FROM and RCPT email formated the following way -> <[email protected]> *t << "RCPT TO:<" << rcpt << ">\r\n"; //r t->flush(); state = Data; } else if ( state == Data && responseLine == "250" ) { *t << "DATA\r\n"; t->flush(); state = Body; } else if ( state == Body && responseLine == "354" ) { *t << message << "\r\n.\r\n"; t->flush(); state = Quit; } else if ( state == Quit && responseLine == "250" ) { *t << "QUIT\r\n"; t->flush(); // here, we just close. state = Close; emit status( tr( "Message sent" ) ); } else if ( state == Close ) { deleteLater(); return; } else { // something broke. QMessageBox::warning( 0, tr( "Qt Simple SMTP client" ), tr( "Unexpected reply from SMTP server:\n\n" ) + response ); state = Close; emit status( tr( "Failed to send message" ) ); } response = ""; }
1aeb312a4e5092d5e0c98049af5c1b97d264bf28
4fe0ec907756e4cecbda8d8c5a7b1e7dbc60858d
/CodeForces/4test.cpp
c65adb4408e9724a93763c80c3c88b9261015d76
[]
no_license
PrajjwalDatir/CP
4d439af7c88f06d44619e75c8bf60d326967ddc6
e23161118f3e3dc2e01ab85a5a39e1511fdf75ef
refs/heads/master
2023-08-05T01:00:10.227030
2021-09-10T11:39:14
2021-09-10T11:39:14
302,845,085
0
0
null
null
null
null
UTF-8
C++
false
false
326
cpp
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { int x, y, z, t, xt = 0, yt = 0, zt = 0; cin >> t; while(--t + 1) { cin >> x >> y >> z; xt += x; yt += y; zt += z; } if (xt == yt && yt == zt && xt == 0){ cout << "YES\n"; } else{ cout << "NO\n"; } return 0; }
fff3a20de3fc74d8ecbe44c9be3b85078ede59ac
67ed24f7e68014e3dbe8970ca759301f670dc885
/win10.19042/SysWOW64/dot3hc.dll.cpp
b13aa571fcbdbe7b4f4a8a7da57b7e2130923f43
[]
no_license
nil-ref/dll-exports
d010bd77a00048e52875d2a739ea6a0576c82839
42ccc11589b2eb91b1aa82261455df8ee88fa40c
refs/heads/main
2023-04-20T21:28:05.295797
2021-05-07T14:06:23
2021-05-07T14:06:23
401,055,938
1
0
null
2021-08-29T14:00:50
2021-08-29T14:00:49
null
UTF-8
C++
false
false
424
cpp
#pragma comment(linker, "/export:DllCanUnloadNow=\"C:\\Windows\\SysWOW64\\dot3hc.DllCanUnloadNow\"") #pragma comment(linker, "/export:DllGetClassObject=\"C:\\Windows\\SysWOW64\\dot3hc.DllGetClassObject\"") #pragma comment(linker, "/export:DllRegisterServer=\"C:\\Windows\\SysWOW64\\dot3hc.DllRegisterServer\"") #pragma comment(linker, "/export:DllUnregisterServer=\"C:\\Windows\\SysWOW64\\dot3hc.DllUnregisterServer\"")
119597a85084be4cba21ff33dc3297ecda6610ab
3c9238ec4aa8e12e7f255dc1a6f533170c669901
/SIDIS/Lsample.h
14d09cfc436221e1304b71ceb2e0c4fcd61710bc
[]
no_license
TianboLiu/On-going
7ddf1b6ebfafd6f1ed8c50ad3a1c5053a7a396a1
40ca04ad4e10f4854cf40aee43bf63c2b1cd8f34
refs/heads/master
2020-04-16T02:09:48.870800
2016-10-24T04:21:07
2016-10-24T04:21:07
59,949,339
0
0
null
2016-06-06T00:25:51
2016-05-29T15:11:21
Mathematica
UTF-8
C++
false
false
17,094
h
#ifndef _LSAMPLE_H_ #define _LSAMPLE_H_ #include <iostream> #include <fstream> #include <cmath> #include "TRandom.h" #include "TRandom3.h" #include "TMath.h" #include "TH1D.h" #include "TString.h" #include "TVectorD.h" #include "TMatrixD.h" #include "TMatrixDEigen.h" #include "TTree.h" #include "TFile.h" #include "Lstructure.h" #define _NMAX_ 4000 class Lsample{ protected: int _Atype;//1: Siver, 2: Collins, 3: pretzelosity int _Ndata; double _Nucleon[_NMAX_]; double _Hadron[_NMAX_]; double _kin[_NMAX_][5]; double _A0[_NMAX_]; double _E0[_NMAX_]; double _ET[_NMAX_]; double _A[_NMAX_]; int _PSD;//parameter space dimension double _hessian[11][11]; double _smatrix[11][11]; double _eigenvalues[11]; double _para[11]; double _central[11]; int _err; public: Lsample(int Atype); int InitialA1para(); int InitialA2para(); int InitialA3para(); int GetData(const char * datafile, const int Atype); int PrintData(const int n); int PrintStatus(); double Chi2A1(const int err, const double * fitpara); double Chi2A2(const int err, const double * fitpara); double Chi2A3(const int err, const double * fitpara); double SetHessianA1(const int err); double SetHessianA2(const int err); double SetHessianA3(const int err); int LikeliSampleA1(const int _err, const int calls, const char * savefile); int LikeliSampleA2(const int _err, const int calls, const char * savefile); int LikeliSampleA3(const int _err, const int calls, const char * savefile); int UniformSampleA1(const int _err, const int calls, const char * savefile); int UniformSampleA2(const int _err, const int calls, const char * savefile); int UniformSampleA3(const int _err, const int calls, const char * savefile); double FindChi2Limit(const char * paraset, const double CL, const int cut); int GetFith1charge(const double Q2, double tc[3][6], const char * paraset, const double CL, const int cut); int GetFith1charge_part(const double Q2, double tc[3][6], const double xl, const double xu, const char * paraset, const double CL, const int cut); }; Lsample::Lsample(int Atype){ _Atype = Atype; _Ndata = 0; if (Atype == 1) _PSD = 9; else if (Atype == 2) _PSD = 9; else if (Atype == 3) _PSD = 4; else { _PSD = 0; std::cout << "Lsample initialize error: invalid asymmetry type!" << std::endl; } } int Lsample::InitialA1para(){ //Sivers _para[0] = 0.35;//Nu _para[1] = -0.90;//Nd _para[2] = -0.24;//Ns _para[3] = 0.04;//Nubar _para[4] = -0.40;//Ndbar _para[5] = 1.0;//Nsbar _para[6] = 0.73;//au _para[7] = 1.08;//ad _para[8] = 0.79;//asea _para[9] = 3.46;//b _para[10] = 0.34;//MS2 //central _central[0] = _para[0];//Nu _central[1] = _para[1];//Nd _central[2] = _para[3];//Nubar _central[3] = _para[4];//Ndbar _central[4] = _para[6];//au _central[5] = _para[7];//ad _central[6] = _para[8];//asea _central[7] = _para[9];//b _central[8] = _para[10];//MS2 return 0; } int Lsample::InitialA2para(){ //transversity _para[0] = 0.46;//Nu _para[1] = -1.0;//Nd _para[2] = 1.11;//a _para[3] = 3.64;//b //Collins _para[4] = 0.49;//Nfav _para[5] = -1.0;//Ndis _para[6] = 1.06;//c _para[7] = 0.07;//d _para[8] = 1.5;//MC2 //central _central[0] = _para[0];//Nu _central[1] = _para[1];//Nd _central[2] = _para[2];//a _central[3] = _para[3];//b _central[4] = _para[4];//Nfav _central[5] = _para[5];//Ndis _central[6] = _para[6];//c _central[7] = _para[7];//d _central[8] = _para[8];//MC2 return 0; } int Lsample::InitialA3para(){ //pretzelosity _para[0] = 1.0;//Nu _para[1] = -1.0;//Nd _para[2] = 2.5;//a _para[3] = 2.0;//b _para[4] = 0.18;//Mh2 //Collins _para[5] = 0.49;//Nfav _para[6] = -1.0;//Ndis _para[7] = 1.06;//c _para[8] = 0.07;//d _para[9] = 1.5;//MC2 //central _central[0] = _para[0];//Nu _central[1] = _para[1];//Nd _central[2] = _para[2];//a _central[3] = _para[4];//Mh2 return 0; } int Lsample::GetData(const char * datafile, const int Atype){ if (Atype != _Atype && _Ndata != 0){ std::cout << "Lsample::GetData: dismatch Atype!" << std::endl; return 1; } _Atype = Atype; TFile * fd = new TFile(datafile, "r"); TTree * Td = (TTree *) fd->Get("data"); double ndata = Td->GetEntries(); double Nucleon, Hadron, Ebeam; double kin[5]; double Asym[3], Estat[3], Eabs[3], Erel[3]; Td->SetBranchAddress("Nucleon", &Nucleon); Td->SetBranchAddress("Hadron", &Hadron); Td->SetBranchAddress("Ebeam", &Ebeam); Td->SetBranchAddress("x", &kin[0]); Td->SetBranchAddress("y", &kin[1]); Td->SetBranchAddress("z", &kin[2]); Td->SetBranchAddress("Q2", &kin[3]); Td->SetBranchAddress("Pt", &kin[4]); Td->SetBranchAddress("A1", &Asym[0]); Td->SetBranchAddress("A2", &Asym[1]); Td->SetBranchAddress("A3", &Asym[2]); Td->SetBranchAddress("E1stat", &Estat[0]); Td->SetBranchAddress("E2stat", &Estat[1]); Td->SetBranchAddress("E3stat", &Estat[2]); Td->SetBranchAddress("E1abs", &Eabs[0]); Td->SetBranchAddress("E2abs", &Eabs[1]); Td->SetBranchAddress("E3abs", &Eabs[2]); Td->SetBranchAddress("E1rel", &Erel[0]); Td->SetBranchAddress("E2rel", &Erel[1]); Td->SetBranchAddress("E3rel", &Erel[2]); int skip = 0; for (int i = 0; i < ndata; i++){ Td->GetEntry(i); _Nucleon[_Ndata + i - skip] = Nucleon; _Hadron[_Ndata + i - skip] = Hadron; for (int j = 0; j < 5; j++){ _kin[_Ndata + i - skip][j] = kin[j]; } _A0[_Ndata + i - skip] = Asym[Atype - 1]; _E0[_Ndata + i - skip] = Estat[Atype - 1]; _ET[_Ndata + i - skip] = sqrt(Estat[Atype - 1] * Estat[Atype - 1] + Eabs[Atype - 1] * Eabs[Atype - 1] + Erel[Atype - 1] * Erel[Atype - 1] * Asym[Atype - 1] * Asym[Atype - 1]); if (_ET[_Ndata + i - skip] < 1.0e5) continue; else skip++; } _Ndata = _Ndata + ndata - skip; std::cout << "skip: " << skip << std::endl; return 0; } int Lsample::PrintData(const int n){ if (n >= _Ndata){ std::cout << "Lsample::PrintData: overflow!" << std::endl; return 1; } printf(" x y z Q2 Pt A Estat Etotal\n"); printf("%.4f %.4f %.4f %.4f %.4f %.6f %.6f %.6f\n", _kin[n][0], _kin[n][1], _kin[n][2], _kin[n][3], _kin[n][4], _A0[n], _E0[n], _ET[n]); return 0; } int Lsample::PrintStatus(){ std::cout << "Asymmetry type: " << _Atype << std::endl; std::cout << "Data number : " << _Ndata << std::endl; return 0; } double Lsample::Chi2A2(const int err = 1, const double * fitpara = 0){ double Tf[7], TD[7]; if (fitpara == 0){ Tf[0] = _central[0];//Nu Tf[1] = _central[1];//Nd Tf[2] = _central[2];//au Tf[3] = _central[2];//ad Tf[4] = _central[3];//bu Tf[5] = _central[3];//bd Tf[6] = 0.25; TD[0] = _central[4];//Nfav TD[1] = _central[5];//Ndis TD[2] = _central[6];//c TD[3] = _central[6];//c TD[4] = _central[7];//d TD[5] = _central[7];//d TD[6] = _central[8];//MC2 } else { Tf[0] = fitpara[0];//Nu Tf[1] = fitpara[1];//Nd Tf[2] = fitpara[2];//au Tf[3] = fitpara[2];//ad Tf[4] = fitpara[3];//bu Tf[5] = fitpara[3];//bd Tf[6] = 0.25; TD[0] = fitpara[4];//Nfav TD[1] = fitpara[5];//Ndis TD[2] = fitpara[6];//c TD[3] = fitpara[6];//c TD[4] = fitpara[7];//d TD[5] = fitpara[7];//d TD[6] = fitpara[8];//MC2 } double Asym[2]; double sum = 0.0; for (int i = 0; i < _Ndata; i++){ if (_Nucleon[i] == 0) Lstructure::AsinHpSn(_kin[i], Asym, Tf, TD); else if (_Nucleon[i] == 1) Lstructure::AsinHpSp(_kin[i], Asym, Tf, TD); _A[i] = Asym[(int)_Hadron[i]]; if (err == 0){ sum = sum + pow( (_A[i] - _A0[i]) / _E0[i], 2); } else { sum = sum + pow( (_A[i] - _A0[i]) / _ET[i], 2); } } return sum; } double Lsample::SetHessianA2(const int err){ _err = err; double da = 1.0e-6; double db = 1.0e-6; double chi2min = Chi2A2(err); std::cout << "chi2min: " << chi2min << std::endl; double newpara[9]; double chi2[4]; TMatrixD hessian(9,9); double scale[9] = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; //double scale[9] = {5.0e-3, 1.0e-2, 1.0e-2, 5.0e-2, 5.0e-3, 1.0e-2, 1.0e-2, 2.0e-3, 1.0e-2}; for (int i = 0; i < 9; i++){ for (int j = 0; j < 9; j++){ for (int s = 0; s < 9; s++) newpara[s] = _central[s]; newpara[i] = newpara[i] + da * scale[i]; newpara[j] = newpara[j] + db * scale[j]; chi2[0] = Chi2A2(err, newpara);//a+da, b+db newpara[j] = newpara[j] - 2.0 * db * scale[j]; chi2[1] = Chi2A2(err, newpara);//a+da, b-db newpara[i] = newpara[i] - 2.0 * da * scale[i]; chi2[3] = Chi2A2(err, newpara);//a-da, b-db newpara[j] = newpara[j] + 2.0 * db * scale[j]; chi2[2] = Chi2A2(err, newpara);//a-da, b+db if (i == j) hessian(i, i) = (chi2[0] + chi2[3] - 2.0 * chi2min) / (2.0 * pow((da+db), 2)); else hessian(i, j) = (chi2[0] + chi2[3] - chi2[1] - chi2[2]) / (8.0 * da * db); _hessian[i][j] = hessian(i, j); } } TMatrixDEigen eigen(hessian); TMatrixD ev = eigen.GetEigenValues(); TMatrixD smatrix = eigen.GetEigenVectors(); for (int i = 0; i < 9; i++){ _eigenvalues[i] = ev(i, i); for (int j = 0; j < 9; j++){ _smatrix[i][j] = smatrix(i, j); } } /* hessian.Print(); */ /* ev.Print(); */ /* smatrix.Print(); */ /* std::cout << hessian.Determinant() << std::endl; */ return 0; } int Lsample::LikeliSampleA2(const int err, const int calls, const char * savefile){ _err = err; TFile * fs = new TFile(savefile, "RECREATE"); TTree * Ts = new TTree("fitpara", "fitpara"); Ts->SetDirectory(fs); TMatrixD as(9, 1); TMatrixD bs(9, 1); TMatrixD smatrix(9, 9); TMatrixD ev(9, 9); double para[9]; double weight, bound, chi2; double kt2 = 0.25; Ts->Branch("Nu", &para[0], "Nu/D"); Ts->Branch("Nd", &para[1], "Nd/D"); Ts->Branch("au", &para[2], "au/D"); Ts->Branch("ad", &para[2], "ad/D"); Ts->Branch("bu", &para[3], "bu/D"); Ts->Branch("bd", &para[3], "bd/D"); Ts->Branch("kt2", &kt2, "kt2/D"); Ts->Branch("Nfav", &para[4], "Nfav/D"); Ts->Branch("Ndis", &para[5], "Ndis/D"); Ts->Branch("cu", &para[6], "cu/D"); Ts->Branch("cd", &para[6], "cd/D"); Ts->Branch("du", &para[7], "du/D"); Ts->Branch("dd", &para[7], "dd/D"); Ts->Branch("MC2", &para[8], "MC2/D"); Ts->Branch("Chi2", &chi2, "Chi2/D"); Ts->Branch("weight", &weight, "weight/D"); Ts->Branch("bound", &bound, "bound/D"); double cup; //gRandom->SetSeed(0); for (int i = 0; i < 9; i++){ ev(i, i) = _eigenvalues[i]; for (int j = 0; j < 9; j++){ smatrix(i, j) = _smatrix[i][j]; } } for (Long64_t n = 0; n < calls; n++){ std::cout << "#" << n << std::endl; cup = 0; for (int j = 0; j < 9; j++){ bs(j,0) = gRandom->Gaus(0.0, 1.0/sqrt(ev(j,j)) ); cup = cup + bs(j,0)*bs(j,0)*ev(j,j)/2.0; } bs.Print(); as = smatrix * bs; as.Print(); as = smatrix * bs; as.Print(); for (int i = 0; i < 9; i++){ para[i] = _central[i] + as(i, 0); } if (std::abs(para[0]) > 1.0 || std::abs(para[1]) > 1.0) bound = 0; else if (std::abs(para[4]) > 1.0 || std::abs(para[5]) > 1.0) bound = 0; else bound = 1; chi2 = Chi2A2(_err, para); weight = exp(cup-chi2/2.0); Ts->Fill(); } fs->Write(); return 0; } int Lsample::UniformSampleA2(const int err, const int calls, const char * savefile){ _err = err; TFile * fs = new TFile(savefile, "RECREATE"); TTree * Ts = new TTree("fitpara", "fitpara"); Ts->SetDirectory(fs); double para[9]; double shift[9]; //double width[9] = {0.025, 0.05, 0.025, 0.11, 0.03, 0.048, 0.055, 0.07, 0.06}; double width[9] = {0.02, 0.05, 0.025, 0.11, 0.03, 0.048, 0.05, 0.05, 0.06}; double weight, bound, chi2; double kt2 = 0.25; Ts->Branch("Nu", &para[0], "Nu/D"); Ts->Branch("Nd", &para[1], "Nd/D"); Ts->Branch("au", &para[2], "au/D"); Ts->Branch("ad", &para[2], "ad/D"); Ts->Branch("bu", &para[3], "bu/D"); Ts->Branch("bd", &para[3], "bd/D"); Ts->Branch("kt2", &kt2, "kt2/D"); Ts->Branch("Nfav", &para[4], "Nfav/D"); Ts->Branch("Ndis", &para[5], "Ndis/D"); Ts->Branch("cu", &para[6], "cu/D"); Ts->Branch("cd", &para[6], "cd/D"); Ts->Branch("du", &para[7], "du/D"); Ts->Branch("dd", &para[7], "dd/D"); Ts->Branch("MC2", &para[8], "MC2/D"); Ts->Branch("Chi2", &chi2, "Chi2/D"); Ts->Branch("weight", &weight, "weight/D"); Ts->Branch("bound", &bound, "bound/D"); double cup; gRandom->SetSeed(0); for (Long64_t n = 0; n < calls; n++){ if (n%100 == 0) std::cout << "#" << n << std::endl; shift[0] = gRandom->Gaus(0.0, width[0]); shift[1] = gRandom->Gaus(0.0, width[1]); shift[2] = gRandom->Gaus(0.0, width[2]); shift[3] = gRandom->Gaus(0.0, width[3]); shift[4] = gRandom->Gaus(0.0, width[4]); shift[5] = gRandom->Gaus(0.0, width[5]); shift[6] = gRandom->Gaus(0.0, width[6]); shift[7] = gRandom->Gaus(0.0, width[7]); shift[8] = gRandom->Gaus(0.0, width[8]); cup = (shift[0]*shift[0]/width[0]/width[0] + shift[1]*shift[1]/width[1]/width[1] + shift[2]*shift[2]/width[2]/width[2] + shift[3]*shift[3]/width[3]/width[3] + shift[4]*shift[4]/width[4]/width[4] + shift[5]*shift[5]/width[5]/width[5] + shift[6]*shift[6]/width[6]/width[6] + shift[7]*shift[7]/width[7]/width[7] + shift[8]*shift[8]/width[8]/width[8]) / 2.0; for (int i = 0; i < 9; i++){ para[i] = _central[i] + shift[i]; } if (para[7] < 0.0) continue; if (std::abs(para[0]) > 1.0 || std::abs(para[1]) > 1.0) bound = 0; else if (std::abs(para[4]) > 1.0 || std::abs(para[5]) > 1.0) bound = 0; else bound = 1; chi2 = Chi2A2(_err, para); weight = exp(cup - chi2/2.0); Ts->Fill(); } fs->Write(); return 0; } double Lsample::FindChi2Limit(const char * paraset, const double CL, const int cut){ TFile * fr = new TFile(paraset, "r"); TTree * Tr = (TTree *) fr->Get("fitpara"); TH1D * h0 = new TH1D("h0", "h0", 1, 0.0, 10000.0); TH1D * h1 = new TH1D("h1", "h1", 1000, 0.0, 20.0); if (cut == 0){ Tr->Project("h0", "Chi2", "weight*(1.>0)"); Tr->Project("h1", "Chi2", "weight*(1.>0)"); } else { Tr->Project("h0", "Chi2", "weight*(bound>0.1)"); Tr->Project("h1", "Chi2", "weight*(bound>0.1)"); } double sum = h0->Integral(1, -1); double upper = 0; for (int i = 1; i <= 1000; i++){ if (h1->Integral(1, i) / sum < CL) continue; upper = h1->GetBinCenter(i); break; } return upper; } int Lsample::GetFith1charge(const double Q2, double tc[3][6], const char * paraset, const double CL, const int cut){ TFile * fr = new TFile(paraset,"r"); TTree * Tr = (TTree *) fr->Get("fitpara"); int Nentry = Tr->GetEntries(); double hpara[7]; double Chi2, bound; Tr->SetBranchAddress("Nu", &hpara[0]); Tr->SetBranchAddress("Nd", &hpara[1]); Tr->SetBranchAddress("au", &hpara[2]); Tr->SetBranchAddress("ad", &hpara[3]); Tr->SetBranchAddress("bu", &hpara[4]); Tr->SetBranchAddress("bd", &hpara[5]); Tr->SetBranchAddress("kt2", &hpara[6]); Tr->SetBranchAddress("Chi2", &Chi2); Tr->SetBranchAddress("bound", &bound); Lstructure::h1charge_std(Q2, tc[0]); for(int j = 0; j < 6; j++){ tc[1][j] = tc[0][j];//upper values tc[2][j] = tc[0][j];//lower values } double temp[6]; double dchi2 = FindChi2Limit(paraset, CL, cut); for (int i = 0; i < Nentry; i++){ Tr->GetEntry(i); if (Chi2 > dchi2) continue; if (cut != 0 && bound == 0) continue; Lstructure::h1charge_std(Q2, temp, hpara); if (temp[0] > tc[1][0]) tc[1][0] = temp[0]; if (temp[0] < tc[2][0]) tc[2][0] = temp[0]; if (temp[1] > tc[1][1]) tc[1][1] = temp[1]; if (temp[1] < tc[2][1]) tc[2][1] = temp[1]; } return 0; } int Lsample::GetFith1charge_part(const double Q2, double tc[3][6], const double xl, const double xu, const char * paraset, const double CL, const int cut){ TFile * fr = new TFile(paraset,"r"); TTree * Tr = (TTree *) fr->Get("fitpara"); int Nentry = Tr->GetEntries(); double hpara[7]; double Chi2, bound; Tr->SetBranchAddress("Nu", &hpara[0]); Tr->SetBranchAddress("Nd", &hpara[1]); Tr->SetBranchAddress("au", &hpara[2]); Tr->SetBranchAddress("ad", &hpara[3]); Tr->SetBranchAddress("bu", &hpara[4]); Tr->SetBranchAddress("bd", &hpara[5]); Tr->SetBranchAddress("kt2", &hpara[6]); Tr->SetBranchAddress("Chi2", &Chi2); Tr->SetBranchAddress("bound", &bound); Lstructure::h1charge_part(Q2, tc[0], xl, xu); for(int j = 0; j < 6; j++){ tc[1][j] = tc[0][j];//upper values tc[2][j] = tc[0][j];//lower values } double temp[6]; double dchi2 = FindChi2Limit(paraset, CL, cut); for (int i = 0; i < Nentry; i++){ Tr->GetEntry(i); if (Chi2 > dchi2) continue; if (cut != 0 && bound == 0) continue; Lstructure::h1charge_part(Q2, temp, xl, xu, hpara); if (temp[0] > tc[1][0]) tc[1][0] = temp[0]; if (temp[0] < tc[2][0]) tc[2][0] = temp[0]; if (temp[1] > tc[1][1]) tc[1][1] = temp[1]; if (temp[1] < tc[2][1]) tc[2][1] = temp[1]; } return 0; } #endif
9bd93ff99ef90c7c511a1184b572defb3f55bd74
e9e05851b281cb64fe6299447100f23855591975
/Java/Java/hash.cpp
8830d7b90f6a78e931dd1ced8081312f06a23dac
[]
no_license
MattWroclaw/Struktury_Danych_All_in_one
2f6d0503c96ae83a9cc5c039b771827635089976
6e52c72ff76e703e54a0762f749a545b04313593
refs/heads/master
2022-04-23T02:20:44.949778
2020-04-18T14:45:27
2020-04-18T14:45:27
256,778,138
0
0
null
null
null
null
UTF-8
C++
false
false
668
cpp
hash.cpp // Dan Bernstein, comp.lang.c unsigned long H1(unsigned char *str) { unsigned long hash = 5381; int c; while (c = *str++) hash = ((hash << 5) + hash) + c; // hash * 33 + c return hash; } int H2(char *s, int Rmax){ int tmp; for(tmp=0; *s != '\0'; s++) tmp = (64*tmp+(*s)) % Rmax; return tmp; } // sdbm database library static unsigned long H3(unsigned char *str){ unsigned long hash = 0; int c; while (c = *str++) hash = c + (hash << 6) + (hash << 16) - hash; return hash; } // Kernigham & Ritchie unsigned long H4(unsigned char *str) { unsigned int hash = 0; int c; while (c = *str++) hash += c; return hash; }
693fb320ad6b6acab5fc0ed1e9c52fd5c97ab332
b71b8bd385c207dffda39d96c7bee5f2ccce946c
/testcases/CWE762_Mismatched_Memory_Management_Routines/s07/CWE762_Mismatched_Memory_Management_Routines__new_free_struct_06.cpp
af2dd5839cf842f6fd9f495c5f6c46830c44b673
[]
no_license
Sporknugget/Juliet_prep
e9bda84a30bdc7938bafe338b4ab2e361449eda5
97d8922244d3d79b62496ede4636199837e8b971
refs/heads/master
2023-05-05T14:41:30.243718
2021-05-25T16:18:13
2021-05-25T16:18:13
369,334,230
0
0
null
null
null
null
UTF-8
C++
false
false
4,335
cpp
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__new_free_struct_06.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_free.label.xml Template File: sources-sinks-06.tmpl.cpp */ /* * @description * CWE: 762 Mismatched Memory Management Routines * BadSource: Allocate data using new * GoodSource: Allocate data using malloc() * Sinks: * GoodSink: Deallocate data using delete * BadSink : Deallocate data using free() * Flow Variant: 06 Control flow: if(STATIC_CONST_FIVE==5) and if(STATIC_CONST_FIVE!=5) * * */ #include "std_testcase.h" /* The variable below is declared "const", so a tool should be able to identify that reads of this will always give its initialized value. */ static const int STATIC_CONST_FIVE = 5; namespace CWE762_Mismatched_Memory_Management_Routines__new_free_struct_06 { #ifndef OMITBAD void bad() { twoIntsStruct * data; /* Initialize data*/ data = NULL; { /* POTENTIAL FLAW: Allocate memory with a function that requires delete to free the memory */ data = new twoIntsStruct; } { /* POTENTIAL FLAW: Deallocate memory using free() - the source memory allocation function may * require a call to delete to deallocate the memory */ free(data); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodB2G1() - use badsource and goodsink by changing the second STATIC_CONST_FIVE==5 to STATIC_CONST_FIVE!=5 */ static void goodB2G1() { twoIntsStruct * data; /* Initialize data*/ data = NULL; { /* POTENTIAL FLAW: Allocate memory with a function that requires delete to free the memory */ data = new twoIntsStruct; } { /* FIX: Deallocate the memory using delete */ delete data; } } /* goodB2G2() - use badsource and goodsink by reversing the blocks in the second if */ static void goodB2G2() { twoIntsStruct * data; /* Initialize data*/ data = NULL; { /* POTENTIAL FLAW: Allocate memory with a function that requires delete to free the memory */ data = new twoIntsStruct; } { /* FIX: Deallocate the memory using delete */ delete data; } } /* goodG2B1() - use goodsource and badsink by changing the first STATIC_CONST_FIVE==5 to STATIC_CONST_FIVE!=5 */ static void goodG2B1() { twoIntsStruct * data; /* Initialize data*/ data = NULL; { /* FIX: Allocate memory from the heap using malloc() */ data = (twoIntsStruct *)malloc(100*sizeof(twoIntsStruct)); if (data == NULL) {exit(-1);} } { /* POTENTIAL FLAW: Deallocate memory using free() - the source memory allocation function may * require a call to delete to deallocate the memory */ free(data); } } /* goodG2B2() - use goodsource and badsink by reversing the blocks in the first if */ static void goodG2B2() { twoIntsStruct * data; /* Initialize data*/ data = NULL; { /* FIX: Allocate memory from the heap using malloc() */ data = (twoIntsStruct *)malloc(100*sizeof(twoIntsStruct)); if (data == NULL) {exit(-1);} } { /* POTENTIAL FLAW: Deallocate memory using free() - the source memory allocation function may * require a call to delete to deallocate the memory */ free(data); } } void good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); } #endif /* OMITGOOD */ } /* close namespace */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN using namespace CWE762_Mismatched_Memory_Management_Routines__new_free_struct_06; /* so that we can use good and bad easily */ int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
03126ba980d56bbc080fa66291bf4ffb6da2e59b
f5d87ed79a91f17cdf2aee7bea7c15f5b5258c05
/cuts/iccm/arch/qpidpb/compiler/Context.h
3a76f9f4b40bd7267c89e0f34db428660efc9b8c
[]
no_license
SEDS/CUTS
a4449214a894e2b47bdea42090fa6cfc56befac8
0ad462fadcd3adefd91735aef6d87952022db2b7
refs/heads/master
2020-04-06T06:57:35.710601
2016-08-16T19:37:34
2016-08-16T19:37:34
25,653,522
0
3
null
null
null
null
UTF-8
C++
false
false
1,999
h
/* -*- c++ -*- */ // $Id$ // ============================================================================ // // = LIBRARY // IDL_TO_PICML_BE_DLL // // = FILENAME // be_global.h // // = DESCRIPTION // Header file for class containing compiler back end global data. // // = AUTHOR // Jeff Parsons <[email protected]> // // ============================================================================ #ifndef _CUTS_ICCM_QPIDPB_CONTEXT_H_ #define _CUTS_ICCM_QPIDPB_CONTEXT_H_ #include "ast_type.h" #include "ast_eventtype.h" #include "be_global.h" #include "ace/Unbounded_Set.h" // Forward decl. class AST_Generator; namespace iCCM { namespace QpidPB { /** * @class BE_GlobalData * * Defines a class containing all back end global data. */ class Context : public ::BE_GlobalData { public: typedef ::BE_GlobalData base_type; // Constructor. Context (void); // Destructor. virtual ~Context (void); virtual void prep_be_arg (char * s); virtual void post_produce (void); // BEGIN: ARCHITECTURE SPECIFIC VALUES. virtual const ACE_CString & get_stub_file_prefix (void) const; virtual const ACE_CString & get_context_template_header_filename (void) const; virtual const ACE_CString & get_servant_template_header_filename (void) const; virtual const ACE_CString & get_servant_template_typename (void) const; virtual const ACE_CString & get_context_typename (void) const; virtual const ACE_CString & get_consumer_template_typename (void) const; virtual const ACE_CString & get_publisher_typename (void) const; virtual const ACE_CString & get_publisher_template_typename (void) const; virtual const ACE_CString & get_publisher_table_typename (void) const; virtual const ACE_CString & get_publisher_table_template_typename (void) const; // BEGIN: GENERATOR SPECIFIC VALUES. virtual const ACE_CString & get_proto_filename (void); private: bool generate_proto_; ACE_CString proto_filename_; }; } } #endif /* IDL_TO_PICML_BE_GLOBAL_H */
832cb1144923970d85471e9a66a1d14216c161be
d5c70d5e4d6deb36ee7ce43a7d6396a0fe8a8411
/FlowExtractor.cpp
8d7883d28178fff46644b8480d41543889ef9144
[]
no_license
dkrathi457/ImprovedDenseTrajectories
f37c25eb1315507f431c970418638937ace3567d
fe826a9c8114abc84850257a2241f4fbba2a886d
refs/heads/master
2020-04-07T01:48:48.077854
2017-04-21T12:38:43
2017-04-21T12:38:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,081
cpp
#include "FlowExtractor.h" #include <iostream> #include "assert.h" using namespace cv; using namespace cv::gpu; FlowExtractor::FlowExtractor() { setDevice(0); } FlowExtractor::FlowExtractor(const std::vector<Size>& sizes) { FlowExtractor(); buildPyramidGpu(sizes); } void FlowExtractor::buildPyramidGpu(const std::vector<Size>& sizes) { _nLayersPyramid = sizes.size(); _gpu_pyr1.resize(_nLayersPyramid); _gpu_pyr2.resize(_nLayersPyramid); _gpu_pyr_flow_x.resize(_nLayersPyramid); _gpu_pyr_flow_y.resize(_nLayersPyramid); for(int i = 0; i < _nLayersPyramid; i++) { _gpu_pyr1[i].create(sizes[i], CV_8UC1); _gpu_pyr2[i].create(sizes[i], CV_8UC1); _gpu_pyr_flow_x[i].create(sizes[i], CV_32FC2); _gpu_pyr_flow_y[i].create(sizes[i], CV_32FC2); } } Mat FlowExtractor::computeFlow(const Mat& grey1, const Mat& grey2) { // Upload to the GPU _gpu_grey1.upload(grey1); _gpu_grey2.upload(grey2); // Actual computation of the optical flow _flow_tvl1(_gpu_grey1, _gpu_grey2, _gpu_flow_x, _gpu_flow_y); // Download back to the CPU _gpu_flow_x.download(_flow_x); _gpu_flow_y.download(_flow_y); // Return a matrix with 2 channels, flow x and y direction Mat flow_merged = mergeFlowChannels(_flow_x, _flow_y); return flow_merged; } std::vector<Mat> FlowExtractor::computeFlowPyramid(const std::vector<Mat>& grey_pyr1, const std::vector<Mat>& grey_pyr2) { assert(grey_pyr1.size() == grey_pyr2.size()); // One by one process the layers in the pyramid std::vector<Mat> flow_pyr(_nLayersPyramid); for (int i = 0; i < _nLayersPyramid; i++) { assert(grey_pyr1[i].size() == grey_pyr2[i].size()); flow_pyr[i] = computeFlow(grey_pyr1[i], grey_pyr2[i]); } return flow_pyr; } Mat FlowExtractor::mergeFlowChannels(const Mat& flow_x, const Mat& flow_y) const { std::vector<Mat> flow_ch; flow_ch.push_back(flow_x); flow_ch.push_back(flow_y); Mat flow_merged; merge(flow_ch, flow_merged); return flow_merged; }
6d638d9fe4860c52c4b4eaa5a7ffecd629ba17a3
d20b7bff35c94c8815e2cf0100fe7188caf5d70a
/BTS.cpp
f5eead42f3b806739ae6c85e43b056fdeb00597c
[]
no_license
mhmdsbrkt/Algorithms-DataStructure
9727899ee037d69709f025481158a063ff8745a2
1a030a372a0706af102eed878a78eca0341364c3
refs/heads/master
2021-01-10T06:29:09.224622
2016-11-23T21:41:56
2016-11-23T21:41:56
45,466,997
1
4
null
2020-10-03T20:41:20
2015-11-03T13:07:01
C++
UTF-8
C++
false
false
5,423
cpp
#include <iostream> using namespace std; class stack { private: int *arr; int size; int top; public: //Declare CONSTRICTOR Function with Parameter stack(int cSize) { size = cSize; top = 0; arr = new int(size); } // CONSTRICTOR Overloading to set default Value stack(void) { size = 10; top = 0; arr = new int[size]; } // Declare PUSH function void push(int data) { arr[top] = data; top++; } // Declare POP function int pop() { top--; return arr[top]; } // Declare IS FULL function bool isFull() { // Check if Top = Size Stack is Full if (top >= size) { return true; } else { return false; } } // Declare IS EMPTY function bool isEmpty() { // Check if Top = 0 so Stack is Empty if (top <= 0) { return true; } else { return false; } } // Declare GET TOP Function int getTop() { return top; } // Declare Peak Function int peak() { return arr[top]; } //Declare CLEAR Function void clear() { top = 0; } }; class Queue { private: int *pIntQueue; int size; int first; int last; int counter; public: // CONSTRUCTOR Queue(int queSize) { size = queSize; first = last = counter = 0; pIntQueue = new int[size]; } // CONSTRUCTOR With default value 10 Queue(void) { size = 10; first = last = counter = 0; pIntQueue = new int[size]; } // ENEQUE void enqueue(int data) { counter++; pIntQueue[last] = data; last = (last + 1) % size; } // DEQUE int deque(void) { int temp = pIntQueue[first]; counter--; first = (first + 1) % size; return temp; } // IS FULL bool isFull(void) { if (counter == size) return true; else return false; } // IS Empty bool isEmpty(void) { if (counter == 0) return true; else return false; } // GET Counter bool getCount(void) { return counter; } // Get Front int getFront(void) { return pIntQueue[first]; } // CLEAR void clear(void) { first = last = counter = 0; } }; struct node { node *left; node *right; int data; }; node *makeNewNode(int data) { node *newNode = new node; newNode->data = data; newNode->left = NULL; newNode->right = NULL; return newNode; }; void insert(node *nodeAddress, int newData) { if (newData < nodeAddress->data) { if (nodeAddress->left != NULL) { insert(nodeAddress->left, newData); } else { nodeAddress->left = makeNewNode(newData); } } else if (newData > nodeAddress->data) { if (nodeAddress->right != NULL) { insert(nodeAddress->right, newData); } else { nodeAddress->right = makeNewNode(newData); } } } void printBFS(node *root) { if (root == NULL) { cout << "Empty"; return; } Queue newQueue; newQueue.enqueue(root); while (!newQueue.isEmpty()) { root = newQueue.deque(); cout << root->data << "\t"; if (root->left != NULL) { newQueue.enqueue(root->left); } if (root->right != NULL) { newQueue.enqueue(root->right); } } } void printPreOrder(node *root) { if (root == NULL) { cout << "Empty Tree"; return; } stack myStack; myStack.push(root); while (!myStack.isEmpty()) { root = myStack.pop(); cout << root->data << "\t"; if (root->left != NULL) { myStack.push(root->left); } if (root->right != NULL) { myStack.push(root->right); } } } void printPreOrder2(node *root) { if (root == NULL) { cout << "Empty Tree"; return; } cout << root->data << "\t"; if (root->left != NULL) { printPreOrder2(root->left); } if (root->right != NULL) { printPreOrder2(root->right); } } void printPostOrder(node *root) { if (root == NULL) { cout << "Empty Tree"; return; } if (root->left != NULL) { printPostOrder(root->left); } if (root->right != NULL) { printPostOrder(root->right); } cout << root->data << "\t"; } void printInOrder(node *root) { if (root == NULL) { cout << "Empty Tree"; return; } if (root->left != NULL) { printInOrder(root->left); } cout << root->data << "\t"; if (root->right != NULL) { printInOrder(root->right); } } int search(node *dNode, int key) { if (dNode == NULL) { cout << "Empty Tree Not Founded"; return 0; } else { if (key == dNode->data) { cout << key << " Founded"; return 1; } else if (key < dNode->data) { return search(dNode->left, key); } else { return search(dNode->right, key); } } } int main() { node *root; root = makeNewNode(5); insert(root, 3); insert(root, 8); insert(root, 4); insert(root, 3); insert(root, 7); insert(root, 9); insert(root, 1); insert(root, 2); return 0; }
670ce24c74601b1dab42620d54582af69de4310e
cd474b178fee82660ccf5eefc23dce3c821a2650
/source/ui/text.hpp
3d35c7ccb29ced81af3dd83fa68b9ad6721d8439
[ "MIT" ]
permissive
CamillePolice/Epitech-Bomberman
a01f5a86690ddfffa5ad65cd83fe77ba082353a4
8650071a6a21ba2e0606e4d8e38794de37bdf39f
refs/heads/master
2020-06-03T22:16:11.172162
2016-06-10T06:44:32
2016-06-10T06:44:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
962
hpp
/* ** text.hpp for UI in /home/escoba_j/class ** ** Made by Joffrey Escobar ** Login <[email protected]> ** ** Started on Thu May 19 03:26:51 2016 Joffrey Escobar */ #ifndef _TEXT_HPP_ # define _TEXT_HPP_ #include "IObject.hpp" class text : public IObject { public: text(const std::string& name); text(const std::string& name, const std::string& msg, irr::gui::IGUIFont *font, const irr::core::position2d<irr::s32>& pos, const irr::video::SColor& color); ~text(); /* setter */ void setMsg(const std::string& msg, const std::string& style = "default"); void setFont(irr::gui::IGUIFont *font, const std::string& style = "default"); /* fluent */ text &msg(const std::string &msg); text &font(irr::gui::IGUIFont *font); /* getter */ const std::string &getMsg(const std::string& style = "default"); /* method */ bool draw(irr::video::IVideoDriver *driver, const std::string& style = "default"); }; #endif
032526b575436b1d457226140108aed61af6bffe
3b4deaf588cbace2b7d46c351bde7769eb7c29b1
/Qt_Utility/misc.hh
336490fe4b8601f1f90ef6ab8982189ca7a1c09d
[]
no_license
pirl-lpl/idaeim
0be2027bb3edea2434a6e6b5ee15ce563210d24e
1e5e8b17e74b6adbfc0f8faf52933eb230095c65
refs/heads/master
2020-07-01T09:42:31.121775
2019-08-13T17:49:41
2019-08-13T17:49:41
198,517,154
0
0
null
null
null
null
UTF-8
C++
false
false
6,775
hh
/* misc Copyright (C) 2013-2014 Bradford Castalia, idaeim studio. This file is part of the idaeim libraries. The idaeim libraries are free software; you can redistribute them and/or modify them under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The idaeim libraries are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. CVS ID: misc.hh,v 1.13 2014/03/14 00:33:59 castalia Exp *******************************************************************************/ #ifndef IDAEIM_MISC_HH #define IDAEIM_MISC_HH // Forward references. class QSize; namespace idaeim { /*============================================================================== Constants */ /** Value of an invalid datum. <b>WARNING</b>: The invalid value is the special quiet NaN value that can be assigned but not be meaningfully compared with other values, including itself. Use the {@link is_invalid(double)} function to test for the special invalid value. Note: The invalid value always produces an invalid value in math operations. */ extern const double INVALID_VALUE; /*============================================================================== Utilities */ /** Test if a value is the special {@link #INVALID_VALUE}. This function tests (using the qIsNaN function) that the value has the quiet NaN (not a number) bits set. <b>N.B.</b>: The INVALID_VALUE is generated by the qQNaN function which returns a bit pattern different than the std::numeric_limits<double>::quiet_NaN function, though both values have the quiet NaN bits set and so both test true by this function. @param value The value to be tested. @return true if the value has the quiet NaN bits set;false otherwise. The special INVALID_VALUE is such a value. */ bool is_invalid (double value); /** Get the number of digits that would be used for the decimal representation of a value. @param value An unsigned long long integer value. @return The number of digits that would be used for the decimal representation of the value. */ int decimal_digits (unsigned long long value); /** Get the number of digits that would be used for the hexadecimal representation of a value. @param value An unsigned long long integer value. @return The number of digits that would be used for the hexadecimal representation of the value. */ int hex_digits (unsigned long long value); /** Get the number of bytes required to hold a specified number of bits. @param bits Number of bits. @return The number of bytes required to hold the bits. */ inline unsigned int bytes_for_bits (unsigned int bits) {return (bits >> 3) + ((bits % 8) ? 1 : 0);} /** Get a bit mask value for the specified number of bits. @param bits The number of bits of precision in the mask. @param lsb The first, least significant, bit that will be set. @return A bit mask value in which the specified number of bits are set starting with the specified least significant bit. There may be excess high order bits that will not fit in the value. If the number of bits is zero the value will be zero. */ unsigned long long bits_mask (unsigned int bits, unsigned int lsb = 0); /** Swap groups of data bytes. The byte groups are swapped in place. The first byte of each group is swapped with the last byte in the group, the second byte is swapped with the next-to-last byte in the group, etc. until all bytes within the group have been reorderd. All byte groups are swapped in the same way. <b>N.B.</b>: The size of the byte groups is expected to be even. Nevertheless, if it is odd the swapping will still be done around the central byte which does not move. @param groups The number of groups to be reordered. If this is zero nothing is done. @param size The number of bytes per group. If this is less than two nothing is done. @param data A pointer to the first byte of the first group to have its bytes swapped. If NULL nothing is done. @return A pointer to the end of the data; i.e. the byte after the last byte of the last group. If data is NULL this will be NULL. If groups is zero this will be the unchanged data address. If size is less than 2 - no swapping is done - the appropriate end-of-data pointer is still returned. */ unsigned char* swap_bytes (unsigned long long groups, unsigned int size, unsigned char* data); /** Get a pixel sample value from a color value. A color value is a 4 byte (QRgb) integer in MSB data order. The most significant byte is the alpha channel value, the next byte is the red value, then the green value, and the least significant byte is the blue value. @param color_value A QRgb color value. @param band The pixel sample band value to get. Band 0 is the red band, band 1 is the green band, band 2 is the blue band. The alpha channel value can be accessed using band -1. @return An unsigned 8-bit integer value for the selected band. */ inline unsigned char sample_value (unsigned int color_value, int band) {return (unsigned char)((color_value >> ((3 - ++band) << 3)) & 0xFF);} /** Whether the host system native multi-byte data is MSB ordered. @see MSB_host() */ extern const bool HOST_IS_MSB; /** Test if the host system uses MSB ordered data. An application working with multi-byte values may need to match the data byte order to the native data order of the host. For MSB data the first byte of a multi-byte data value has the most significant part of the value. For LSB data the first byte has the least significant part of the value. <b>N.B.</b>: The HOST_IS_MSB global flag can be used directly without having to call this function. @return true if the host system uses MSB ordered data; false if the host system uses LSB ordered data. */ bool MSB_host (); /** Get the scaling factor that will fit a size to an area. The scaling factor is calculated for the given size that will maximally fill, but not exceed, the given area while maintaining the aspect ratio of the specified size. @param size A QSize to be fitted to the area. @param area The area within which to fit the size. @return The scaling factor that when applied to the specified size will produce a new size that will be as large as possible within the specified area. */ double scale_to_area (const QSize& size, unsigned long long area); } // namespace idaeim #endif // IDAEIM_MISC_HH
c25ab0559427d48b9e4a4b049e224139453de5ca
9482e58c36e38ad26ad47bde98133c85e5b491f3
/code/MyShape.h
c44cda16885a3a5a68598a3d5a584f55f16dfe59
[]
no_license
TaigoFr/SFML_SURVIVAL_GAME
0a68134c857fa3474e2be89b9d72df13a3ed854c
f2d9a63aaf8157c970c7e707d6267d1fdb9e3e1d
refs/heads/master
2020-04-25T16:08:29.512185
2019-02-27T10:51:59
2019-02-27T10:51:59
172,900,036
2
0
null
2019-02-27T11:07:53
2019-02-27T11:07:52
null
UTF-8
C++
false
false
907
h
#pragma once #include <SFML/Graphics.hpp> #include <string.h> class MyShape : public sf::RectangleShape { public: MyShape() { size0 = sf::Vector2f(0,0); }; MyShape(sf::Texture &texture, float sx = 1., float sy = 1.); MyShape(std::string file, float sx = 1., float sy = 1.); MyShape(sf::Color color, float size_x, float size_y); ~MyShape() { if (p_texture != NULL) delete p_texture; } MyShape& operator=(const MyShape& s); void setSize(float x, float y); void setSize(float y); void setScale(float sx, float sy); void setTexture(const sf::Texture &texture, float sx = 1., float sy = 1.); void setFile(std::string file, float sx = 1., float sy = 1.); void setColor(sf::Color color, float size_x = -1.f, float size_y = -1.f); virtual void draw(sf::RenderWindow &window) { window.draw(*this);} static float scale(float yy); private: sf::Vector2f size0; sf::Texture *p_texture = NULL; };
139a10e3b9641a7b7870a20d2f7071e4695d3672
783279f7d64424fd4535a819cc19be335a3ce196
/Algorithms/Practice/VC/codeforces/608Div2/C.cpp
b73c2af69b8406b181d61ccddbc4b62ec2c4d533
[]
no_license
rish-singhal/CompetitiveProgramming
2bfa88e086c084c9d68624f176ee3cbcb20b8577
5ed290ea7e28b81e38679f8c0e99c9c3f80da231
refs/heads/master
2023-07-02T18:59:11.817298
2021-08-10T04:15:52
2021-08-10T04:15:52
248,025,974
2
0
null
null
null
null
UTF-8
C++
false
false
1,017
cpp
#include<bits/stdc++.h> using namespace std; typedef long long LL; #define fi first #define se second #define pb push_back #define forn(i,n) for(int i=0;i<(n);i++) #define for1(i,n) for(int i=1;i<=n;i++) #define forr(i,n) for(int i=n;i>=0;i--) #define all(x) x.begin(), x.end() const int MAXN = 1e5 +5; void fio(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); } LL dx[4] = {0,1,0,-1}; LL dy[4] = {1,0,-1,0}; int main(){ fio(); LL n, sx, sy; cin>>n>>sx>>sy; vector<LL> an(4,0); forn(i,n){ LL u,v; cin>>u>>v; forn(j,4){ LL x = sx+dx[j]; LL y = sy+dy[j]; if(x<0 || x>1e9 || y<0 || y>1e9){ continue; } if(abs(x-u) + abs(y-v) < abs(u-sx) + abs(v-sy)){ an[j]++; } } } LL k = 0; int p = 0; forn(j,4){ LL x = sx+dx[j]; LL y = sy+dy[j]; if(x<0 || x>1e9 || y<0 || y>1e9){ continue; } k = max(k,an[j]); if(k<an[j]){ k = an[j]; p = j; } } cout<<k<<endl; cout<<sx+dx[p]<<" "<<sy+dy[p]<<endl; // } return 0; }
1e4b06fc4df36f34529b636f256d84710eb76e05
fcd4e9d9e1af9132afb1a5dc6b0d82a1be4467de
/version_1/status.h
6a9f2b7e65f54c1bddb2270a621efac51eb619cf
[]
no_license
B5paper/HuaWei2021
0ccb63d9ced6e3417d542d8084a26bb7fdb3e8e6
3b3fbee087ba13e7b33e42619ce2f1c96cab72ea
refs/heads/main
2023-04-11T07:26:03.831376
2021-04-15T15:13:26
2021-04-15T15:13:26
358,300,461
4
0
null
null
null
null
UTF-8
C++
false
false
1,762
h
#ifndef STATUS #define STATUS #include <vector> #include "types.h" using namespace std; struct VMSingle { int type; int vm_id; int server_id; int node; // 0 for node A, 1 for node B, 2 for both VMSingle(int type, int vm_id, int server_id, int node) : type(type), vm_id(vm_id), server_id(server_id), node(node) {} }; struct VMStat { vector<int> types; vector<int> vm_ids; vector<int> server_ids; vector<int> nodes; // 0 for node A, 1 for node B, 2 for both }; struct NodeStat { int cores_used; int cores_ream; int mem_used; int mem_ream; NodeStat(int cores_used, int cores_ream, int mem_used, int mem_ream) : cores_used(cores_used), cores_ream(cores_ream), mem_used(mem_used), mem_ream(mem_ream) {} }; struct ServerStat // 或许可以用 unordered_map: ids -> others 的方式存储,这样查询插入都更快;或者存储一个 ids -> idx 的 map { vector<int> types; vector<int> ids; vector<int> cores_used; vector<int> cores_ream; vector<int> mem_used; vector<int> mem_ream; vector<NodeStat*> node_a; vector<NodeStat*> node_b; void clear(); // clear all servers void add(ServerSpec &server_speServerStatc); void add(int server_type, ServerSpecList &server_specs); void reset_stat(ServerSpecList &server_specs); // recover the status as the unused servers void update_stat(VMStat &vm_stat, VMSpecList &vm_specs); // revise the resources information using vm_stat void update_stat(const VMSingle &vm_single, VMSpecList &vm_specs); int _get_idx_by_id(int id); int get_cores_total(); int get_cores_ream(); int get_mem_total(); int get_mem_ream(); void pirnt_summary(); ~ServerStat(); }; #endif
307a2af086628cd854c6cfb87aab3c7fa1d75271
72a146dad10c3330548f175643822e6cc2e2ccba
/net/url_request/url_request_http_job_unittest.cc
aa1599aa6cce1b56b906753b84491447423c7fff
[ "BSD-3-Clause" ]
permissive
daotianya/browser-android-tabs
bb6772394c2138e2f3859a83ec6e0860d01a6161
44e83a97eb1c7775944a04144e161d99cbb7de5b
refs/heads/master
2020-06-10T18:07:58.392087
2016-12-07T15:37:13
2016-12-07T15:37:13
75,914,703
1
0
null
2016-12-08T07:37:51
2016-12-08T07:37:51
null
UTF-8
C++
false
false
30,793
cc
// Copyright (c) 2013 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 "net/url_request/url_request_http_job.h" #include <stdint.h> #include <cstddef> #include <memory> #include "base/compiler_specific.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/strings/string_split.h" #include "net/base/auth.h" #include "net/base/request_priority.h" #include "net/base/sdch_observer.h" #include "net/cookies/cookie_store_test_helpers.h" #include "net/http/http_transaction_factory.h" #include "net/http/http_transaction_test_util.h" #include "net/log/test_net_log.h" #include "net/log/test_net_log_entry.h" #include "net/log/test_net_log_util.h" #include "net/socket/socket_test_util.h" #include "net/test/cert_test_util.h" #include "net/test/gtest_util.h" #include "net/test/test_data_directory.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_job_factory_impl.h" #include "net/url_request/url_request_status.h" #include "net/url_request/url_request_test_util.h" #include "net/websockets/websocket_handshake_stream_base.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" #include "url/url_constants.h" using net::test::IsError; using net::test::IsOk; namespace net { namespace { using ::testing::Return; // Inherit from URLRequestHttpJob to expose the priority and some // other hidden functions. class TestURLRequestHttpJob : public URLRequestHttpJob { public: explicit TestURLRequestHttpJob(URLRequest* request) : URLRequestHttpJob(request, request->context()->network_delegate(), request->context()->http_user_agent_settings()) {} ~TestURLRequestHttpJob() override {} using URLRequestHttpJob::SetPriority; using URLRequestHttpJob::Start; using URLRequestHttpJob::Kill; using URLRequestHttpJob::priority; }; class URLRequestHttpJobTest : public ::testing::Test { protected: URLRequestHttpJobTest() : context_(true) { context_.set_http_transaction_factory(&network_layer_); // The |test_job_factory_| takes ownership of the interceptor. test_job_interceptor_ = new TestJobInterceptor(); EXPECT_TRUE(test_job_factory_.SetProtocolHandler( url::kHttpScheme, base::WrapUnique(test_job_interceptor_))); context_.set_job_factory(&test_job_factory_); context_.set_net_log(&net_log_); context_.Init(); req_ = context_.CreateRequest(GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate_); } bool TransactionAcceptsSdchEncoding() { base::WeakPtr<MockNetworkTransaction> transaction( network_layer_.last_transaction()); EXPECT_TRUE(transaction); if (!transaction) return false; const HttpRequestInfo* request_info = transaction->request(); EXPECT_TRUE(request_info); if (!request_info) return false; std::string encoding_headers; bool get_success = request_info->extra_headers.GetHeader( "Accept-Encoding", &encoding_headers); EXPECT_TRUE(get_success); if (!get_success) return false; // This check isn't wrapped with EXPECT* macros because different // results from this function may be expected in different tests. for (const std::string& token : base::SplitString(encoding_headers, ", ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { if (base::EqualsCaseInsensitiveASCII(token, "sdch")) return true; } return false; } void EnableSdch() { context_.SetSdchManager(std::unique_ptr<SdchManager>(new SdchManager)); } MockNetworkLayer network_layer_; // |test_job_interceptor_| is owned by |test_job_factory_|. TestJobInterceptor* test_job_interceptor_; URLRequestJobFactoryImpl test_job_factory_; TestURLRequestContext context_; TestDelegate delegate_; TestNetLog net_log_; std::unique_ptr<URLRequest> req_; }; class URLRequestHttpJobWithMockSocketsTest : public ::testing::Test { protected: URLRequestHttpJobWithMockSocketsTest() : context_(new TestURLRequestContext(true)) { context_->set_client_socket_factory(&socket_factory_); context_->set_network_delegate(&network_delegate_); context_->Init(); } MockClientSocketFactory socket_factory_; TestNetworkDelegate network_delegate_; std::unique_ptr<TestURLRequestContext> context_; }; const char kSimpleGetMockWrite[] = "GET / HTTP/1.1\r\n" "Host: www.example.com\r\n" "Connection: keep-alive\r\n" "User-Agent:\r\n" "Accept-Encoding: gzip, deflate\r\n" "Accept-Language: en-us,fr\r\n\r\n"; TEST_F(URLRequestHttpJobWithMockSocketsTest, TestContentLengthSuccessfulRequest) { MockWrite writes[] = {MockWrite(kSimpleGetMockWrite)}; MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n" "Content-Length: 12\r\n\r\n"), MockRead("Test Content")}; StaticSocketDataProvider socket_data(reads, arraysize(reads), writes, arraysize(writes)); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); request->Start(); ASSERT_TRUE(request->is_pending()); base::RunLoop().Run(); EXPECT_TRUE(request->status().is_success()); EXPECT_EQ(12, request->received_response_content_length()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), request->GetTotalReceivedBytes()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), network_delegate_.total_network_bytes_sent()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), network_delegate_.total_network_bytes_received()); } TEST_F(URLRequestHttpJobWithMockSocketsTest, TestContentLengthSuccessfulHttp09Request) { MockWrite writes[] = {MockWrite(kSimpleGetMockWrite)}; MockRead reads[] = {MockRead("Test Content"), MockRead(net::SYNCHRONOUS, net::OK)}; StaticSocketDataProvider socket_data(reads, arraysize(reads), nullptr, 0); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); request->Start(); ASSERT_TRUE(request->is_pending()); base::RunLoop().Run(); EXPECT_TRUE(request->status().is_success()); EXPECT_EQ(12, request->received_response_content_length()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), request->GetTotalReceivedBytes()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), network_delegate_.total_network_bytes_sent()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), network_delegate_.total_network_bytes_received()); } TEST_F(URLRequestHttpJobWithMockSocketsTest, TestContentLengthFailedRequest) { MockWrite writes[] = {MockWrite(kSimpleGetMockWrite)}; MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n" "Content-Length: 20\r\n\r\n"), MockRead("Test Content"), MockRead(net::SYNCHRONOUS, net::ERR_FAILED)}; StaticSocketDataProvider socket_data(reads, arraysize(reads), writes, arraysize(writes)); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); request->Start(); ASSERT_TRUE(request->is_pending()); base::RunLoop().Run(); EXPECT_EQ(URLRequestStatus::FAILED, request->status().status()); EXPECT_EQ(12, request->received_response_content_length()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), request->GetTotalReceivedBytes()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), network_delegate_.total_network_bytes_sent()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), network_delegate_.total_network_bytes_received()); } TEST_F(URLRequestHttpJobWithMockSocketsTest, TestContentLengthCancelledRequest) { MockWrite writes[] = {MockWrite(kSimpleGetMockWrite)}; MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n" "Content-Length: 20\r\n\r\n"), MockRead("Test Content"), MockRead(net::SYNCHRONOUS, net::ERR_IO_PENDING)}; StaticSocketDataProvider socket_data(reads, arraysize(reads), writes, arraysize(writes)); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); delegate.set_cancel_in_received_data(true); request->Start(); base::RunLoop().RunUntilIdle(); EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); EXPECT_EQ(12, request->received_response_content_length()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), request->GetTotalReceivedBytes()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), network_delegate_.total_network_bytes_sent()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), network_delegate_.total_network_bytes_received()); } TEST_F(URLRequestHttpJobWithMockSocketsTest, TestNetworkBytesRedirectedRequest) { MockWrite redirect_writes[] = { MockWrite("GET / HTTP/1.1\r\n" "Host: www.redirect.com\r\n" "Connection: keep-alive\r\n" "User-Agent:\r\n" "Accept-Encoding: gzip, deflate\r\n" "Accept-Language: en-us,fr\r\n\r\n")}; MockRead redirect_reads[] = { MockRead("HTTP/1.1 302 Found\r\n" "Location: http://www.example.com\r\n\r\n"), }; StaticSocketDataProvider redirect_socket_data( redirect_reads, arraysize(redirect_reads), redirect_writes, arraysize(redirect_writes)); socket_factory_.AddSocketDataProvider(&redirect_socket_data); MockWrite final_writes[] = {MockWrite(kSimpleGetMockWrite)}; MockRead final_reads[] = {MockRead("HTTP/1.1 200 OK\r\n" "Content-Length: 12\r\n\r\n"), MockRead("Test Content")}; StaticSocketDataProvider final_socket_data( final_reads, arraysize(final_reads), final_writes, arraysize(final_writes)); socket_factory_.AddSocketDataProvider(&final_socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.redirect.com"), DEFAULT_PRIORITY, &delegate); request->Start(); ASSERT_TRUE(request->is_pending()); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(request->status().is_success()); EXPECT_EQ(12, request->received_response_content_length()); // Should not include the redirect. EXPECT_EQ(CountWriteBytes(final_writes, arraysize(final_writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(final_reads, arraysize(final_reads)), request->GetTotalReceivedBytes()); // Should include the redirect as well as the final response. EXPECT_EQ(CountWriteBytes(redirect_writes, arraysize(redirect_writes)) + CountWriteBytes(final_writes, arraysize(final_writes)), network_delegate_.total_network_bytes_sent()); EXPECT_EQ(CountReadBytes(redirect_reads, arraysize(redirect_reads)) + CountReadBytes(final_reads, arraysize(final_reads)), network_delegate_.total_network_bytes_received()); } TEST_F(URLRequestHttpJobWithMockSocketsTest, TestNetworkBytesCancelledAfterHeaders) { MockWrite writes[] = {MockWrite(kSimpleGetMockWrite)}; MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n\r\n")}; StaticSocketDataProvider socket_data(reads, arraysize(reads), writes, arraysize(writes)); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); delegate.set_cancel_in_response_started(true); request->Start(); base::RunLoop().RunUntilIdle(); EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); EXPECT_EQ(0, request->received_response_content_length()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), request->GetTotalReceivedBytes()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), network_delegate_.total_network_bytes_sent()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), network_delegate_.total_network_bytes_received()); } TEST_F(URLRequestHttpJobWithMockSocketsTest, TestNetworkBytesCancelledImmediately) { StaticSocketDataProvider socket_data(nullptr, 0, nullptr, 0); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); request->Start(); request->Cancel(); base::RunLoop().RunUntilIdle(); EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); EXPECT_EQ(0, request->received_response_content_length()); EXPECT_EQ(0, request->GetTotalSentBytes()); EXPECT_EQ(0, request->GetTotalReceivedBytes()); EXPECT_EQ(0, network_delegate_.total_network_bytes_received()); } TEST_F(URLRequestHttpJobTest, TestCancelWhileReadingCookies) { DelayedCookieMonster cookie_monster; TestURLRequestContext context(true); context.set_cookie_store(&cookie_monster); context.Init(); TestDelegate delegate; std::unique_ptr<URLRequest> request = context.CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); request->Start(); request->Cancel(); base::RunLoop().Run(); EXPECT_EQ(URLRequestStatus::CANCELED, request->status().status()); } // Make sure that SetPriority actually sets the URLRequestHttpJob's // priority, before start. Other tests handle the after start case. TEST_F(URLRequestHttpJobTest, SetPriorityBasic) { std::unique_ptr<TestURLRequestHttpJob> job( new TestURLRequestHttpJob(req_.get())); EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); job->SetPriority(LOWEST); EXPECT_EQ(LOWEST, job->priority()); job->SetPriority(LOW); EXPECT_EQ(LOW, job->priority()); } // Make sure that URLRequestHttpJob passes on its priority to its // transaction on start. TEST_F(URLRequestHttpJobTest, SetTransactionPriorityOnStart) { test_job_interceptor_->set_main_intercept_job( base::WrapUnique(new TestURLRequestHttpJob(req_.get()))); req_->SetPriority(LOW); EXPECT_FALSE(network_layer_.last_transaction()); req_->Start(); ASSERT_TRUE(network_layer_.last_transaction()); EXPECT_EQ(LOW, network_layer_.last_transaction()->priority()); } // Make sure that URLRequestHttpJob passes on its priority updates to // its transaction. TEST_F(URLRequestHttpJobTest, SetTransactionPriority) { test_job_interceptor_->set_main_intercept_job( base::WrapUnique(new TestURLRequestHttpJob(req_.get()))); req_->SetPriority(LOW); req_->Start(); ASSERT_TRUE(network_layer_.last_transaction()); EXPECT_EQ(LOW, network_layer_.last_transaction()->priority()); req_->SetPriority(HIGHEST); EXPECT_EQ(HIGHEST, network_layer_.last_transaction()->priority()); } // Confirm we do advertise SDCH encoding in the case of a GET. TEST_F(URLRequestHttpJobTest, SdchAdvertisementGet) { EnableSdch(); req_->set_method("GET"); // Redundant with default. test_job_interceptor_->set_main_intercept_job( base::WrapUnique(new TestURLRequestHttpJob(req_.get()))); req_->Start(); EXPECT_TRUE(TransactionAcceptsSdchEncoding()); } // Confirm we don't advertise SDCH encoding in the case of a POST. TEST_F(URLRequestHttpJobTest, SdchAdvertisementPost) { EnableSdch(); req_->set_method("POST"); test_job_interceptor_->set_main_intercept_job( base::WrapUnique(new TestURLRequestHttpJob(req_.get()))); req_->Start(); EXPECT_FALSE(TransactionAcceptsSdchEncoding()); } TEST_F(URLRequestHttpJobTest, HSTSInternalRedirectTest) { // Setup HSTS state. context_.transport_security_state()->AddHSTS( "upgrade.test", base::Time::Now() + base::TimeDelta::FromSeconds(10), true); ASSERT_TRUE( context_.transport_security_state()->ShouldUpgradeToSSL("upgrade.test")); ASSERT_FALSE(context_.transport_security_state()->ShouldUpgradeToSSL( "no-upgrade.test")); struct TestCase { const char* url; bool upgrade_expected; const char* url_expected; } cases[] = { {"http://upgrade.test/", true, "https://upgrade.test/"}, {"http://upgrade.test:123/", true, "https://upgrade.test:123/"}, {"http://no-upgrade.test/", false, "http://no-upgrade.test/"}, {"http://no-upgrade.test:123/", false, "http://no-upgrade.test:123/"}, #if defined(ENABLE_WEBSOCKETS) {"ws://upgrade.test/", true, "wss://upgrade.test/"}, {"ws://upgrade.test:123/", true, "wss://upgrade.test:123/"}, {"ws://no-upgrade.test/", false, "ws://no-upgrade.test/"}, {"ws://no-upgrade.test:123/", false, "ws://no-upgrade.test:123/"}, #endif // defined(ENABLE_WEBSOCKETS) }; for (const auto& test : cases) { SCOPED_TRACE(test.url); TestDelegate d; TestNetworkDelegate network_delegate; std::unique_ptr<URLRequest> r( context_.CreateRequest(GURL(test.url), DEFAULT_PRIORITY, &d)); net_log_.Clear(); r->Start(); base::RunLoop().Run(); if (test.upgrade_expected) { net::TestNetLogEntry::List entries; net_log_.GetEntries(&entries); int redirects = 0; for (const auto& entry : entries) { if (entry.type == net::NetLog::TYPE_URL_REQUEST_REDIRECT_JOB) { redirects++; std::string value; EXPECT_TRUE(entry.GetStringValue("reason", &value)); EXPECT_EQ("HSTS", value); } } EXPECT_EQ(1, redirects); EXPECT_EQ(1, d.received_redirect_count()); EXPECT_EQ(2u, r->url_chain().size()); } else { EXPECT_EQ(0, d.received_redirect_count()); EXPECT_EQ(1u, r->url_chain().size()); } EXPECT_EQ(GURL(test.url_expected), r->url()); } } class MockSdchObserver : public SdchObserver { public: MockSdchObserver() {} MOCK_METHOD2(OnDictionaryAdded, void(const GURL& request_url, const std::string& server_hash)); MOCK_METHOD1(OnDictionaryRemoved, void(const std::string& server_hash)); MOCK_METHOD1(OnDictionaryUsed, void(const std::string& server_hash)); MOCK_METHOD2(OnGetDictionary, void(const GURL& request_url, const GURL& dictionary_url)); MOCK_METHOD0(OnClearDictionaries, void()); }; class URLRequestHttpJobWithSdchSupportTest : public ::testing::Test { protected: URLRequestHttpJobWithSdchSupportTest() : context_(true) { std::unique_ptr<HttpNetworkSession::Params> params( new HttpNetworkSession::Params); context_.set_http_network_session_params(std::move(params)); context_.set_client_socket_factory(&socket_factory_); context_.Init(); } MockClientSocketFactory socket_factory_; TestURLRequestContext context_; }; TEST_F(URLRequestHttpJobWithSdchSupportTest, GetDictionary) { MockWrite writes[] = { MockWrite("GET / HTTP/1.1\r\n" "Host: example.com\r\n" "Connection: keep-alive\r\n" "User-Agent:\r\n" "Accept-Encoding: gzip, deflate, sdch\r\n" "Accept-Language: en-us,fr\r\n\r\n")}; MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n" "Get-Dictionary: /sdch.dict\r\n" "Cache-Control: max-age=120\r\n" "Content-Length: 12\r\n\r\n"), MockRead("Test Content")}; StaticSocketDataProvider socket_data(reads, arraysize(reads), writes, arraysize(writes)); socket_factory_.AddSocketDataProvider(&socket_data); MockSdchObserver sdch_observer; SdchManager sdch_manager; sdch_manager.AddObserver(&sdch_observer); context_.set_sdch_manager(&sdch_manager); // First response will be "from network" and we should have OnGetDictionary // invoked. GURL url("http://example.com"); EXPECT_CALL(sdch_observer, OnGetDictionary(url, GURL("http://example.com/sdch.dict"))); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_.CreateRequest(url, DEFAULT_PRIORITY, &delegate); request->Start(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(request->status().is_success()); // Second response should be from cache without notification of SdchObserver TestDelegate delegate2; std::unique_ptr<URLRequest> request2 = context_.CreateRequest(url, DEFAULT_PRIORITY, &delegate2); request2->Start(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(request->status().is_success()); // Cleanup manager. sdch_manager.RemoveObserver(&sdch_observer); } class URLRequestHttpJobWithBrotliSupportTest : public ::testing::Test { protected: URLRequestHttpJobWithBrotliSupportTest() : context_(new TestURLRequestContext(true)) { std::unique_ptr<HttpNetworkSession::Params> params( new HttpNetworkSession::Params); context_->set_enable_brotli(true); context_->set_http_network_session_params(std::move(params)); context_->set_client_socket_factory(&socket_factory_); context_->Init(); } MockClientSocketFactory socket_factory_; std::unique_ptr<TestURLRequestContext> context_; }; TEST_F(URLRequestHttpJobWithBrotliSupportTest, NoBrotliAdvertisementOverHttp) { MockWrite writes[] = {MockWrite(kSimpleGetMockWrite)}; MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n" "Content-Length: 12\r\n\r\n"), MockRead("Test Content")}; StaticSocketDataProvider socket_data(reads, arraysize(reads), writes, arraysize(writes)); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); request->Start(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(request->status().is_success()); EXPECT_EQ(12, request->received_response_content_length()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), request->GetTotalReceivedBytes()); } TEST_F(URLRequestHttpJobWithBrotliSupportTest, BrotliAdvertisement) { net::SSLSocketDataProvider ssl_socket_data_provider(net::ASYNC, net::OK); ssl_socket_data_provider.next_proto = kProtoHTTP11; ssl_socket_data_provider.cert = ImportCertFromFile(GetTestCertsDirectory(), "unittest.selfsigned.der"); socket_factory_.AddSSLSocketDataProvider(&ssl_socket_data_provider); MockWrite writes[] = { MockWrite("GET / HTTP/1.1\r\n" "Host: www.example.com\r\n" "Connection: keep-alive\r\n" "User-Agent:\r\n" "Accept-Encoding: gzip, deflate, br\r\n" "Accept-Language: en-us,fr\r\n\r\n")}; MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n" "Content-Length: 12\r\n\r\n"), MockRead("Test Content")}; StaticSocketDataProvider socket_data(reads, arraysize(reads), writes, arraysize(writes)); socket_factory_.AddSocketDataProvider(&socket_data); TestDelegate delegate; std::unique_ptr<URLRequest> request = context_->CreateRequest( GURL("https://www.example.com"), DEFAULT_PRIORITY, &delegate); request->Start(); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(request->status().is_success()); EXPECT_EQ(12, request->received_response_content_length()); EXPECT_EQ(CountWriteBytes(writes, arraysize(writes)), request->GetTotalSentBytes()); EXPECT_EQ(CountReadBytes(reads, arraysize(reads)), request->GetTotalReceivedBytes()); } // This base class just serves to set up some things before the TestURLRequest // constructor is called. class URLRequestHttpJobWebSocketTestBase : public ::testing::Test { protected: URLRequestHttpJobWebSocketTestBase() : socket_data_(nullptr, 0, nullptr, 0), context_(true) { // A Network Delegate is required for the WebSocketHandshakeStreamBase // object to be passed on to the HttpNetworkTransaction. context_.set_network_delegate(&network_delegate_); // Attempting to create real ClientSocketHandles is not going to work out so // well. Set up a fake socket factory. socket_factory_.AddSocketDataProvider(&socket_data_); context_.set_client_socket_factory(&socket_factory_); context_.Init(); } StaticSocketDataProvider socket_data_; TestNetworkDelegate network_delegate_; MockClientSocketFactory socket_factory_; TestURLRequestContext context_; }; class URLRequestHttpJobWebSocketTest : public URLRequestHttpJobWebSocketTestBase { protected: URLRequestHttpJobWebSocketTest() : req_(context_.CreateRequest(GURL("ws://www.example.com"), DEFAULT_PRIORITY, &delegate_)) { } TestDelegate delegate_; std::unique_ptr<URLRequest> req_; }; class MockCreateHelper : public WebSocketHandshakeStreamBase::CreateHelper { public: // GoogleMock does not appear to play nicely with move-only types like // scoped_ptr, so this forwarding method acts as a workaround. WebSocketHandshakeStreamBase* CreateBasicStream( std::unique_ptr<ClientSocketHandle> connection, bool using_proxy) override { // Discard the arguments since we don't need them anyway. return CreateBasicStreamMock(); } MOCK_METHOD0(CreateBasicStreamMock, WebSocketHandshakeStreamBase*()); MOCK_METHOD2(CreateSpdyStream, WebSocketHandshakeStreamBase*(const base::WeakPtr<SpdySession>&, bool)); }; #if defined(ENABLE_WEBSOCKETS) class FakeWebSocketHandshakeStream : public WebSocketHandshakeStreamBase { public: FakeWebSocketHandshakeStream() : initialize_stream_was_called_(false) {} bool initialize_stream_was_called() const { return initialize_stream_was_called_; } // Fake implementation of HttpStreamBase methods. int InitializeStream(const HttpRequestInfo* request_info, RequestPriority priority, const BoundNetLog& net_log, const CompletionCallback& callback) override { initialize_stream_was_called_ = true; return ERR_IO_PENDING; } int SendRequest(const HttpRequestHeaders& request_headers, HttpResponseInfo* response, const CompletionCallback& callback) override { return ERR_IO_PENDING; } int ReadResponseHeaders(const CompletionCallback& callback) override { return ERR_IO_PENDING; } int ReadResponseBody(IOBuffer* buf, int buf_len, const CompletionCallback& callback) override { return ERR_IO_PENDING; } void Close(bool not_reusable) override {} bool IsResponseBodyComplete() const override { return false; } bool IsConnectionReused() const override { return false; } void SetConnectionReused() override {} bool CanReuseConnection() const override { return false; } int64_t GetTotalReceivedBytes() const override { return 0; } int64_t GetTotalSentBytes() const override { return 0; } bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override { return false; } void GetSSLInfo(SSLInfo* ssl_info) override {} void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {} bool GetRemoteEndpoint(IPEndPoint* endpoint) override { return false; } Error GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, std::vector<uint8_t>* out) override { ADD_FAILURE(); return ERR_NOT_IMPLEMENTED; } void Drain(HttpNetworkSession* session) override {} void PopulateNetErrorDetails(NetErrorDetails* details) override { return; } void SetPriority(RequestPriority priority) override {} UploadProgress GetUploadProgress() const override { return UploadProgress(); } HttpStream* RenewStreamForAuth() override { return nullptr; } // Fake implementation of WebSocketHandshakeStreamBase method(s) std::unique_ptr<WebSocketStream> Upgrade() override { return std::unique_ptr<WebSocketStream>(); } private: bool initialize_stream_was_called_; }; TEST_F(URLRequestHttpJobWebSocketTest, RejectedWithoutCreateHelper) { req_->Start(); base::RunLoop().RunUntilIdle(); EXPECT_EQ(URLRequestStatus::FAILED, req_->status().status()); EXPECT_THAT(req_->status().error(), IsError(ERR_DISALLOWED_URL_SCHEME)); } TEST_F(URLRequestHttpJobWebSocketTest, CreateHelperPassedThrough) { std::unique_ptr<MockCreateHelper> create_helper( new ::testing::StrictMock<MockCreateHelper>()); FakeWebSocketHandshakeStream* fake_handshake_stream( new FakeWebSocketHandshakeStream); // Ownership of fake_handshake_stream is transferred when CreateBasicStream() // is called. EXPECT_CALL(*create_helper, CreateBasicStreamMock()) .WillOnce(Return(fake_handshake_stream)); req_->SetUserData(WebSocketHandshakeStreamBase::CreateHelper::DataKey(), create_helper.release()); req_->SetLoadFlags(LOAD_DISABLE_CACHE); req_->Start(); base::RunLoop().RunUntilIdle(); EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); } #endif // defined(ENABLE_WEBSOCKETS) } // namespace } // namespace net
fb15b4600fd1b1dfcbe6dd28db1ba9ae454bab15
d5d213ee9f7bc742ad8adaa717b936253a4594ed
/Source/Engine/Urho2D/ParticleEffect2D.h
d522168b5d028db43afcfcd6d95a3ea8359399e2
[ "LicenseRef-scancode-unknown-license-reference", "MIT", "Zlib", "LicenseRef-scancode-khronos", "Apache-2.0", "BSD-2-Clause" ]
permissive
paradigmo/Urho3D
4122c7b94a0025a9480587507099ed6a5be96b85
92ad14b2fe2724c6555c480ad19b00bb7a14fdb1
refs/heads/master
2021-01-18T09:03:57.665958
2014-06-25T19:47:55
2014-06-25T19:47:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,965
h
// // Copyright (c) 2008-2014 the Urho3D project. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #pragma once #include "Resource.h" #include "GraphicsDefs.h" namespace Urho3D { class XMLElement; class Sprite2D; /// 2D particle emitter types. enum EmitterType2D { EMITTER_TYPE_GRAVITY = 0, EMITTER_TYPE_RADIAL }; /// 2D particle effect resource. class URHO3D_API ParticleEffect2D : public Resource { OBJECT(ParticleEffect2D); public: /// Construct. ParticleEffect2D(Context* context); /// Destruct. ~ParticleEffect2D(); /// Register object factory. drawable2d must be registered first. static void RegisterObject(Context* context); /// Load resource. Return true if successful. virtual bool Load(Deserializer& source); /// Save resource. Return true if successful. virtual bool Save(Serializer& dest) const; /// Set sprite. void SetSprite(Sprite2D* sprite); /// Set source position variance. void SetSourcePositionVariance(const Vector2& sourcePositionVariance); /// Set speed. void SetSpeed(float speed); /// Set speed variance. void SetSpeedVariance(float speedVariance); /// Set particle lifespan. void SetParticleLifeSpan(float particleLifeSpan); /// Set particle lifespan variance. void SetParticleLifespanVariance(float particleLifespanVariance); /// Set angle. void SetAngle(float angle); /// Set angle variance. void SetAngleVariance(float angleVariance); /// Set gravity. void SetGravity(const Vector2& gravity); /// Set radial acceleration. void SetRadialAcceleration(float radialAcceleration); /// Set tangential acceleration. void SetTangentialAcceleration(float tangentialAcceleration); /// Set radial acceleration variance. void SetRadialAccelVariance(float radialAccelVariance); /// Set tangential acceleration variance. void SetTangentialAccelVariance(float tangentialAccelVariance); /// Set start color. void SetStartColor(const Color& startColor); /// Set start color variance. void SetStartColorVariance(const Color& startColorVariance); /// Set finish color. void SetFinishColor(const Color& finishColor); /// Set finish color variance. void SetFinishColorVariance(const Color& finishColorVariance); /// Set max particles. void SetMaxParticles(int maxParticles); /// Set start particle size. void SetStartParticleSize(float startParticleSize); /// Set start particle size variance. void SetStartParticleSizeVariance(float startParticleSizeVariance); /// Set finish particle size. void SetFinishParticleSize(float finishParticleSize); /// Set finish particle size variance. void SetFinishParticleSizeVariance(float FinishParticleSizeVariance); /// Set duration. void SetDuration(float duration); /// Set emitter type. void SetEmitterType(EmitterType2D emitterType); /// Set max radius. void SetMaxRadius(float maxRadius); /// Set max radius variance. void SetMaxRadiusVariance(float maxRadiusVariance); /// Set min radius. void SetMinRadius(float minRadius); /// Set rotate per second. void SetRotatePerSecond(float rotatePerSecond); /// Set rotate per second variance. void SetRotatePerSecondVariance(float rotatePerSecondVariance); /// Set blend mode. void SetBlendMode(BlendMode blendMode); /// Set rotation start. void SetRotationStart(float rotationStart); /// Set rotation start variance. void SetRotationStartVariance(float rotationStartVariance); /// Set rotation end. void SetRotationEnd(float rotationEnd); /// Set rotation end variance. void SetRotationEndVariance(float rotationEndVariance); /// Return sprite. Sprite2D* GetSprite() const { return sprite_; } /// Return source position variance. const Vector2& GetSourcePositionVariance() const { return sourcePositionVariance_; } /// Return speed. float GetSpeed() const { return speed_; } /// Return speed variance. float GetSpeedVariance() const { return speedVariance_; } /// Return particle lifespan. float GetParticleLifeSpan() const { return particleLifeSpan_; } /// Return particle lifespan variance. float GetParticleLifespanVariance() const { return particleLifespanVariance_; } /// Return angle. float GetAngle() const { return angle_; } /// Return angle variance. float GetAngleVariance() const { return angleVariance_; } /// Return gravity. const Vector2& GetGravity() const { return gravity_; } /// Return radial acceleration. float GetRadialAcceleration() const { return radialAcceleration_; } /// Return tangential acceleration. float GetTangentialAcceleration() const { return tangentialAcceleration_; } /// Return radial acceleration variance. float GetRadialAccelVariance() const { return radialAccelVariance_; } /// Return tangential acceleration variance. float GetTangentialAccelVariance() const { return tangentialAccelVariance_; } /// Return start color. const Color& GetStartColor() const { return startColor_; } /// Return start color variance. const Color& GetStartColorVariance() const { return startColorVariance_; } /// Return finish color. const Color& GetFinishColor() const { return finishColor_; } /// Return finish color variance. const Color& GetFinishColorVariance() const { return finishColorVariance_; } /// Return max particles. int GetMaxParticles() const { return maxParticles_; } /// Return start particle size. float GetStartParticleSize() const { return startParticleSize_; } /// Return start particle size variance. float GetStartParticleSizeVariance() const { return startParticleSizeVariance_; } /// Return finish particle size. float GetFinishParticleSize() const { return finishParticleSize_; } /// Return finish particle size variance. float GetFinishParticleSizeVariance() const { return FinishParticleSizeVariance_; } /// Return duration. float GetDuration() const { return duration_; } /// Return emitter type. EmitterType2D GetEmitterType() const { return emitterType_; } /// Return max radius. float GetMaxRadius() const { return maxRadius_; } /// Return max radius variance. float GetMaxRadiusVariance() const { return maxRadiusVariance_; } /// Return min radius. float GetMinRadius() const { return minRadius_; } /// Return rotate per second. float GetRotatePerSecond() const { return rotatePerSecond_; } /// Return rotate per second variance. float GetRotatePerSecondVariance() const { return rotatePerSecondVariance_; } /// Return blend mode. BlendMode GetBlendMode() const { return blendMode_; } /// Return rotation start. float GetRotationStart() const { return rotationStart_; } /// Return rotation start variance. float GetRotationStartVariance() const { return rotationStartVariance_; } /// Return rotation end. float GetRotationEnd() const { return rotationEnd_; } /// Return rotation end variance. float GetRotationEndVariance() const { return rotationEndVariance_; } private: /// Read integer. int ReadInt(const XMLElement& element, const String& name) const; /// Read float. float ReadFloat(const XMLElement& element, const String& name) const; /// Read Color. Color ReadColor(const XMLElement& element, const String& name) const; /// Read Vector2. Vector2 ReadVector2(const XMLElement& element, const String& name) const; /// Write integer. void WriteInt(XMLElement& element, const String& name, int value) const; /// Write float. void WriteFloat(XMLElement& element, const String& name, float value) const; /// Write Color. void WriteColor(XMLElement& element, const String& name, const Color& color) const; /// Write Vector2. void WriteVector2(XMLElement& element, const String& name, const Vector2& value) const; /// Sprite. SharedPtr<Sprite2D> sprite_; /// Source position variance. Vector2 sourcePositionVariance_; /// Speed. float speed_; /// Speed variance. float speedVariance_; /// Particle lifespan. float particleLifeSpan_; /// Particle lifespan variance. float particleLifespanVariance_; /// Angle. float angle_; /// Angle variance. float angleVariance_; /// Gravity. Vector2 gravity_; /// Radial acceleration. float radialAcceleration_; /// Tangential acceleration. float tangentialAcceleration_; /// Radial acceleration variance. float radialAccelVariance_; /// Tangential acceleration variance. float tangentialAccelVariance_; /// Start color. Color startColor_; /// Start color variance. Color startColorVariance_; /// Finish color. Color finishColor_; /// Finish color variance. Color finishColorVariance_; /// Max particles. int maxParticles_; /// Start particle size. float startParticleSize_; /// Start particle size variance. float startParticleSizeVariance_; /// Finish particle size. float finishParticleSize_; /// Finish particle size variance. float FinishParticleSizeVariance_; /// Duration. float duration_; /// Emitter type. EmitterType2D emitterType_; /// Max radius. float maxRadius_; /// Max radius variance. float maxRadiusVariance_; /// Min radius. float minRadius_; /// Rotate per second. float rotatePerSecond_; /// Rotate per second variance. float rotatePerSecondVariance_; /// Blend mode. BlendMode blendMode_; /// Rotation start. float rotationStart_; /// Rotation start variance. float rotationStartVariance_; /// Rotation end. float rotationEnd_; /// Rotation end variance. float rotationEndVariance_; }; }
ebc46fe0e8ab8c352ff89cdf0448e27316e4589d
22d315e782d8378a5b200f1410f4bb79fa8e9339
/Funcion_4.cpp
88d4d95c9208a65055dab4577f8a8e15a67b6315
[]
no_license
danivivi/Taller_3_Funciones
03792fb9665ff1bfd1e062543eb40f37916d7e9d
fad93aa1a5fee680354bcf4b54b39098c428e058
refs/heads/master
2021-07-12T03:39:55.298075
2017-10-16T23:52:27
2017-10-16T23:52:27
105,400,623
0
0
null
null
null
null
UTF-8
C++
false
false
492
cpp
#include <stdio.h> /*Comentario Funcion que devuelve la parte fraccionaria de cualquier numero introducido por el usuario. Fecha:20-Septiembre-2017 Elaborado por: Viviana Rojas Ruiz*/ float parte_frac(float num); int main() { float num; printf("Ingrese un numero:\n"); scanf("%f",&num); printf("La parte fraccionaria es: %.3f\n", parte_frac(num)); return 0; } float parte_frac(float num) { float fraccion; int entero; entero=num; fraccion=num-entero; return fraccion; }
23e2d908bdbb1ed395f3c9e3c04455715800bc4a
77f8084b28fc0aa5a6f606f8f51218912e0b1aba
/lab3/Point.h
c68c9416f37ffcdfc120d68d19e5129960d12e5d
[]
no_license
aleks-papushin/LabsOOP
887fe4de18472f26ebe1ec877125b61c7bc48bd4
433bf2798a664009721f40513b8a011f07423dad
refs/heads/master
2020-03-15T21:45:57.320817
2018-05-06T19:02:45
2018-05-06T19:02:45
132,361,208
0
0
null
null
null
null
WINDOWS-1251
C++
false
false
758
h
#pragma once class Point { int m_x, m_y; public: Point(int x = 0, int y = 0); ~Point(); int GetX() const; int GetY() const; void operator=(Point & p); Point & operator+=(Point & other); // вернуть по ссылке void operator+=(int d); Point operator+(const Point & p) const; Point operator+(int d) const; Point operator-(const Point & other) const; Point operator-(int d) const; Point operator+() const; Point operator-() const; }; Point operator+(int d, const Point & p); Point operator-(int d, const Point & p); // сделать глоб. функцию -= , кот. будет принимать 2 параметра Point operator-(const Point & p1, const Point & p2); Point operator-=(Point & p1, const Point & p2);
baf318bee50e68aeb4d443ed16256bcd12b23b2e
b9fec31908e40cfc52400e13f847ac0f4e8c48bb
/matlab tests/DH/libs/vision/src/pnp/dls.cpp
c0ad9d3de537529de5c4288ddc39f241e7cd994c
[ "BSD-3-Clause" ]
permissive
DavidRicardoGarcia/measurement-of-angles
e7ff8e9f15a9e50bc57c0d45f5807fcf1fa0ec74
ab16ca937262e05bf9f82dca5f425791cacfa459
refs/heads/master
2021-07-16T12:30:53.523173
2021-06-24T07:16:49
2021-06-24T07:16:49
122,414,543
2
1
null
null
null
null
UTF-8
C++
false
false
82,965
cpp
/* +---------------------------------------------------------------------------+ | Mobile Robot Programming Toolkit (MRPT) | | http://www.mrpt.org/ | | | | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file | | See: http://www.mrpt.org/Authors - All rights reserved. | | Released under BSD License. See details in http://www.mrpt.org/License | +---------------------------------------------------------------------------+ */ #include "vision-precomp.h" // Precompiled headers #include <iostream> #include <mrpt/config.h> #include <mrpt/otherlibs/do_opencv_includes.h> // Opencv 2.3 had a broken <opencv/eigen.h> in Ubuntu 14.04 Trusty => Disable PNP classes #include <mrpt/config.h> #if MRPT_HAS_OPENCV && MRPT_OPENCV_VERSION_NUM<0x140 # undef MRPT_HAS_OPENCV # define MRPT_HAS_OPENCV 0 #endif #if MRPT_HAS_OPENCV #include "dls.h" mrpt::vision::pnp::dls::dls(const cv::Mat& opoints, const cv::Mat& ipoints) { N = std::max(opoints.checkVector(3, CV_32F), opoints.checkVector(3, CV_64F)); p = cv::Mat(3, N, CV_64F); z = cv::Mat(3, N, CV_64F); mn = cv::Mat::zeros(3, 1, CV_64F); cost__ = 9999; f1coeff.resize(21); f2coeff.resize(21); f3coeff.resize(21); if (opoints.depth() == ipoints.depth()) { if (opoints.depth() == CV_32F) init_points<cv::Point3f, cv::Point2f>(opoints, ipoints); else init_points<cv::Point3d, cv::Point2d>(opoints, ipoints); } else if (opoints.depth() == CV_32F) init_points<cv::Point3f, cv::Point2d>(opoints, ipoints); else init_points<cv::Point3d, cv::Point2f>(opoints, ipoints); } mrpt::vision::pnp::dls::~dls() { // TODO Auto-generated destructor stub } bool mrpt::vision::pnp::dls::compute_pose(cv::Mat& R, cv::Mat& t) { std::vector<cv::Mat> R_; R_.push_back(rotx(CV_PI/2)); R_.push_back(roty(CV_PI/2)); R_.push_back(rotz(CV_PI/2)); // version that calls dls 3 times, to avoid Cayley singularity for (int i = 0; i < 3; ++i) { // Make a random rotation cv::Mat pp = R_[i] * ( p - cv::repeat(mn, 1, p.cols) ); // clear for new data C_est_.clear(); t_est_.clear(); cost_.clear(); this->run_kernel(pp); // run dls_pnp() // find global minimum for (unsigned int j = 0; j < cost_.size(); ++j) { if( cost_[j] < cost__ ) { t_est__ = t_est_[j] - C_est_[j] * R_[i] * mn; C_est__ = C_est_[j] * R_[i]; cost__ = cost_[j]; } } } if(C_est__.cols > 0 && C_est__.rows > 0) { C_est__.copyTo(R); t_est__.copyTo(t); return true; } return false; } void mrpt::vision::pnp::dls::run_kernel(const cv::Mat& pp) { #if MRPT_OPENCV_VERSION_NUM>=0x240 cv::Mat Mtilde(27, 27, CV_64F); cv::Mat D = cv::Mat::zeros(9, 9, CV_64F); build_coeff_matrix(pp, Mtilde, D); cv::Mat eigenval_r, eigenval_i, eigenvec_r, eigenvec_i; compute_eigenvec(Mtilde, eigenval_r, eigenval_i, eigenvec_r, eigenvec_i); /* * Now check the solutions */ // extract the optimal solutions from the eigen decomposition of the // Multiplication matrix cv::Mat sols = cv::Mat::zeros(3, 27, CV_64F); std::vector<double> cost; int count = 0; for (int k = 0; k < 27; ++k) { // V(:,k) = V(:,k)/V(1,k); cv::Mat V_kA = eigenvec_r.col(k); // 27x1 cv::Mat V_kB = cv::Mat(1, 1, z.depth(), V_kA.at<double>(0)); // 1x1 cv::Mat V_k; cv::solve(V_kB.t(), V_kA.t(), V_k); // A/B = B'\A' cv::Mat( V_k.t()).copyTo( eigenvec_r.col(k) ); //if (imag(V(2,k)) == 0) #ifdef HAVE_EIGEN const double epsilon = 1e-4; if( eigenval_i.at<double>(k,0) >= -epsilon && eigenval_i.at<double>(k,0) <= epsilon ) #endif { double stmp[3]; stmp[0] = eigenvec_r.at<double>(9, k); stmp[1] = eigenvec_r.at<double>(3, k); stmp[2] = eigenvec_r.at<double>(1, k); cv::Mat H = Hessian(stmp); cv::Mat eigenvalues, eigenvectors; cv::eigen(H, eigenvalues, eigenvectors); if(positive_eigenvalues(&eigenvalues)) { // sols(:,i) = stmp; cv::Mat stmp_mat(3, 1, CV_64F, &stmp); stmp_mat.copyTo( sols.col(count) ); cv::Mat Cbar = cayley2rotbar(stmp_mat); cv::Mat Cbarvec = Cbar.reshape(1,1).t(); // cost(i) = CbarVec' * D * CbarVec; cv::Mat cost_mat = Cbarvec.t() * D * Cbarvec; cost.push_back( cost_mat.at<double>(0) ); count++; } } } // extract solutions sols = sols.clone().colRange(0, count); std::vector<cv::Mat> C_est, t_est; for (int j = 0; j < sols.cols; ++j) { // recover the optimal orientation // C_est(:,:,j) = 1/(1 + sols(:,j)' * sols(:,j)) * cayley2rotbar(sols(:,j)); cv::Mat sols_j = sols.col(j); double sols_mult = 1./(1.+cv::Mat( sols_j.t() * sols_j ).at<double>(0)); cv::Mat C_est_j = cayley2rotbar(sols_j).mul(sols_mult); C_est.push_back( C_est_j ); cv::Mat A2 = cv::Mat::zeros(3, 3, CV_64F); cv::Mat b2 = cv::Mat::zeros(3, 1, CV_64F); for (int i = 0; i < N; ++i) { cv::Mat eye = cv::Mat::eye(3, 3, CV_64F); cv::Mat z_mul = z.col(i)*z.col(i).t(); A2 += eye - z_mul; b2 += (z_mul - eye) * C_est_j * pp.col(i); } // recover the optimal translation cv::Mat X2; cv::solve(A2, b2, X2); // A\B t_est.push_back(X2); } // check that the points are infront of the center of perspectivity for (int k = 0; k < sols.cols; ++k) { cv::Mat cam_points = C_est[k] * pp + cv::repeat(t_est[k], 1, pp.cols); cv::Mat cam_points_k = cam_points.row(2); if(is_empty(&cam_points_k)) { cv::Mat C_valid = C_est[k], t_valid = t_est[k]; double cost_valid = cost[k]; C_est_.push_back(C_valid); t_est_.push_back(t_valid); cost_.push_back(cost_valid); } } #else THROW_EXCEPTION("Fix me: this method doesn't work with OpenCV < 2.4"); #endif } void mrpt::vision::pnp::dls::build_coeff_matrix(const cv::Mat& pp, cv::Mat& Mtilde, cv::Mat& D) { cv::Mat eye = cv::Mat::eye(3, 3, CV_64F); // build coeff matrix // An intermediate matrix, the inverse of what is called "H" in the paper // (see eq. 25) cv::Mat H = cv::Mat::zeros(3, 3, CV_64F); cv::Mat A = cv::Mat::zeros(3, 9, CV_64F); cv::Mat pp_i(3, 1, CV_64F); cv::Mat z_i(3, 1, CV_64F); for (int i = 0; i < N; ++i) { z.col(i).copyTo(z_i); A += ( z_i*z_i.t() - eye ) * LeftMultVec(pp.col(i)); } H = eye.mul(N) - z * z.t(); // A\B cv::solve(H, A, A, cv::DECOMP_NORMAL); H.release(); cv::Mat ppi_A(3, 1, CV_64F); for (int i = 0; i < N; ++i) { z.col(i).copyTo(z_i); ppi_A = LeftMultVec(pp.col(i)) + A; D += ppi_A.t() * ( eye - z_i*z_i.t() ) * ppi_A; } A.release(); // fill the coefficients fill_coeff(&D); // generate random samples std::vector<double> u(5); cv::randn(u, 0, 200); cv::Mat M2 = cayley_LS_M(f1coeff, f2coeff, f3coeff, u); cv::Mat M2_1 = M2(cv::Range(0,27), cv::Range(0,27)); cv::Mat M2_2 = M2(cv::Range(0,27), cv::Range(27,120)); cv::Mat M2_3 = M2(cv::Range(27,120), cv::Range(27,120)); cv::Mat M2_4 = M2(cv::Range(27,120), cv::Range(0,27)); M2.release(); // A/B = B'\A' cv::Mat M2_5; cv::solve(M2_3.t(), M2_2.t(), M2_5); M2_2.release(); M2_3.release(); // construct the multiplication matrix via schur compliment of the Macaulay // matrix Mtilde = M2_1 - M2_5.t()*M2_4; } void mrpt::vision::pnp::dls::compute_eigenvec(const cv::Mat& Mtilde, cv::Mat& eigenval_real, cv::Mat& eigenval_imag, cv::Mat& eigenvec_real, cv::Mat& eigenvec_imag) { #ifdef HAVE_EIGEN Eigen::MatrixXd Mtilde_eig, zeros_eig; cv::cv2eigen(Mtilde, Mtilde_eig); cv::cv2eigen(cv::Mat::zeros(27, 27, CV_64F), zeros_eig); Eigen::MatrixXcd Mtilde_eig_cmplx(27, 27); Mtilde_eig_cmplx.real() = Mtilde_eig; Mtilde_eig_cmplx.imag() = zeros_eig; Eigen::ComplexEigenSolver<Eigen::MatrixXcd> ces; ces.compute(Mtilde_eig_cmplx); Eigen::MatrixXd eigval_real = ces.eigenvalues().real(); Eigen::MatrixXd eigval_imag = ces.eigenvalues().imag(); Eigen::MatrixXd eigvec_real = ces.eigenvectors().real(); Eigen::MatrixXd eigvec_imag = ces.eigenvectors().imag(); cv::eigen2cv(eigval_real, eigenval_real); cv::eigen2cv(eigval_imag, eigenval_imag); cv::eigen2cv(eigvec_real, eigenvec_real); cv::eigen2cv(eigvec_imag, eigenvec_imag); #else EigenvalueDecomposition es(Mtilde); eigenval_real = es.eigenvalues(); eigenvec_real = es.eigenvectors(); eigenval_imag = eigenvec_imag = cv::Mat(); #endif } void mrpt::vision::pnp::dls::fill_coeff(const cv::Mat * D_mat) { // TODO: shift D and coefficients one position to left double D[10][10]; // put D_mat into array for (int i = 0; i < D_mat->rows; ++i) { const double* Di = D_mat->ptr<double>(i); for (int j = 0; j < D_mat->cols; ++j) { D[i+1][j+1] = Di[j]; } } // F1 COEFFICIENT f1coeff[1] = 2*D[1][6] - 2*D[1][8] + 2*D[5][6] - 2*D[5][8] + 2*D[6][1] + 2*D[6][5] + 2*D[6][9] - 2*D[8][1] - 2*D[8][5] - 2*D[8][9] + 2*D[9][6] - 2*D[9][8]; // constant term f1coeff[2] = 6*D[1][2] + 6*D[1][4] + 6*D[2][1] - 6*D[2][5] - 6*D[2][9] + 6*D[4][1] - 6*D[4][5] - 6*D[4][9] - 6*D[5][2] - 6*D[5][4] - 6*D[9][2] - 6*D[9][4]; // s1^2 * s2 f1coeff[3] = 4*D[1][7] - 4*D[1][3] + 8*D[2][6] - 8*D[2][8] - 4*D[3][1] + 4*D[3][5] + 4*D[3][9] + 8*D[4][6] - 8*D[4][8] + 4*D[5][3] - 4*D[5][7] + 8*D[6][2] + 8*D[6][4] + 4*D[7][1] - 4*D[7][5] - 4*D[7][9] - 8*D[8][2] - 8*D[8][4] + 4*D[9][3] - 4*D[9][7]; // s1 * s2 f1coeff[4] = 4*D[1][2] - 4*D[1][4] + 4*D[2][1] - 4*D[2][5] - 4*D[2][9] + 8*D[3][6] - 8*D[3][8] - 4*D[4][1] + 4*D[4][5] + 4*D[4][9] - 4*D[5][2] + 4*D[5][4] + 8*D[6][3] + 8*D[6][7] + 8*D[7][6] - 8*D[7][8] - 8*D[8][3] - 8*D[8][7] - 4*D[9][2] + 4*D[9][4]; //s1 * s3 f1coeff[5] = 8*D[2][2] - 8*D[3][3] - 8*D[4][4] + 8*D[6][6] + 8*D[7][7] - 8*D[8][8]; // s2 * s3 f1coeff[6] = 4*D[2][6] - 2*D[1][7] - 2*D[1][3] + 4*D[2][8] - 2*D[3][1] + 2*D[3][5] - 2*D[3][9] + 4*D[4][6] + 4*D[4][8] + 2*D[5][3] + 2*D[5][7] + 4*D[6][2] + 4*D[6][4] - 2*D[7][1] + 2*D[7][5] - 2*D[7][9] + 4*D[8][2] + 4*D[8][4] - 2*D[9][3] - 2*D[9][7]; // s2^2 * s3 f1coeff[7] = 2*D[2][5] - 2*D[1][4] - 2*D[2][1] - 2*D[1][2] - 2*D[2][9] - 2*D[4][1] + 2*D[4][5] - 2*D[4][9] + 2*D[5][2] + 2*D[5][4] - 2*D[9][2] - 2*D[9][4]; //s2^3 f1coeff[8] = 4*D[1][9] - 4*D[1][1] + 8*D[3][3] + 8*D[3][7] + 4*D[5][5] + 8*D[7][3] + 8*D[7][7] + 4*D[9][1] - 4*D[9][9]; // s1 * s3^2 f1coeff[9] = 4*D[1][1] - 4*D[5][5] - 4*D[5][9] + 8*D[6][6] - 8*D[6][8] - 8*D[8][6] + 8*D[8][8] - 4*D[9][5] - 4*D[9][9]; // s1 f1coeff[10] = 2*D[1][3] + 2*D[1][7] + 4*D[2][6] - 4*D[2][8] + 2*D[3][1] + 2*D[3][5] + 2*D[3][9] - 4*D[4][6] + 4*D[4][8] + 2*D[5][3] + 2*D[5][7] + 4*D[6][2] - 4*D[6][4] + 2*D[7][1] + 2*D[7][5] + 2*D[7][9] - 4*D[8][2] + 4*D[8][4] + 2*D[9][3] + 2*D[9][7]; // s3 f1coeff[11] = 2*D[1][2] + 2*D[1][4] + 2*D[2][1] + 2*D[2][5] + 2*D[2][9] - 4*D[3][6] + 4*D[3][8] + 2*D[4][1] + 2*D[4][5] + 2*D[4][9] + 2*D[5][2] + 2*D[5][4] - 4*D[6][3] + 4*D[6][7] + 4*D[7][6] - 4*D[7][8] + 4*D[8][3] - 4*D[8][7] + 2*D[9][2] + 2*D[9][4]; // s2 f1coeff[12] = 2*D[2][9] - 2*D[1][4] - 2*D[2][1] - 2*D[2][5] - 2*D[1][2] + 4*D[3][6] + 4*D[3][8] - 2*D[4][1] - 2*D[4][5] + 2*D[4][9] - 2*D[5][2] - 2*D[5][4] + 4*D[6][3] + 4*D[6][7] + 4*D[7][6] + 4*D[7][8] + 4*D[8][3] + 4*D[8][7] + 2*D[9][2] + 2*D[9][4]; // s2 * s3^2 f1coeff[13] = 6*D[1][6] - 6*D[1][8] - 6*D[5][6] + 6*D[5][8] + 6*D[6][1] - 6*D[6][5] - 6*D[6][9] - 6*D[8][1] + 6*D[8][5] + 6*D[8][9] - 6*D[9][6] + 6*D[9][8]; // s1^2 f1coeff[14] = 2*D[1][8] - 2*D[1][6] + 4*D[2][3] + 4*D[2][7] + 4*D[3][2] - 4*D[3][4] - 4*D[4][3] - 4*D[4][7] - 2*D[5][6] + 2*D[5][8] - 2*D[6][1] - 2*D[6][5] + 2*D[6][9] + 4*D[7][2] - 4*D[7][4] + 2*D[8][1] + 2*D[8][5] - 2*D[8][9] + 2*D[9][6] - 2*D[9][8]; // s3^2 f1coeff[15] = 2*D[1][8] - 2*D[1][6] - 4*D[2][3] + 4*D[2][7] - 4*D[3][2] - 4*D[3][4] - 4*D[4][3] + 4*D[4][7] + 2*D[5][6] - 2*D[5][8] - 2*D[6][1] + 2*D[6][5] - 2*D[6][9] + 4*D[7][2] + 4*D[7][4] + 2*D[8][1] - 2*D[8][5] + 2*D[8][9] - 2*D[9][6] + 2*D[9][8]; // s2^2 f1coeff[16] = 2*D[3][9] - 2*D[1][7] - 2*D[3][1] - 2*D[3][5] - 2*D[1][3] - 2*D[5][3] - 2*D[5][7] - 2*D[7][1] - 2*D[7][5] + 2*D[7][9] + 2*D[9][3] + 2*D[9][7]; // s3^3 f1coeff[17] = 4*D[1][6] + 4*D[1][8] + 8*D[2][3] + 8*D[2][7] + 8*D[3][2] + 8*D[3][4] + 8*D[4][3] + 8*D[4][7] - 4*D[5][6] - 4*D[5][8] + 4*D[6][1] - 4*D[6][5] - 4*D[6][9] + 8*D[7][2] + 8*D[7][4] + 4*D[8][1] - 4*D[8][5] - 4*D[8][9] - 4*D[9][6] - 4*D[9][8]; // s1 * s2 * s3 f1coeff[18] = 4*D[1][5] - 4*D[1][1] + 8*D[2][2] + 8*D[2][4] + 8*D[4][2] + 8*D[4][4] + 4*D[5][1] - 4*D[5][5] + 4*D[9][9]; // s1 * s2^2 f1coeff[19] = 6*D[1][3] + 6*D[1][7] + 6*D[3][1] - 6*D[3][5] - 6*D[3][9] - 6*D[5][3] - 6*D[5][7] + 6*D[7][1] - 6*D[7][5] - 6*D[7][9] - 6*D[9][3] - 6*D[9][7]; // s1^2 * s3 f1coeff[20] = 4*D[1][1] - 4*D[1][5] - 4*D[1][9] - 4*D[5][1] + 4*D[5][5] + 4*D[5][9] - 4*D[9][1] + 4*D[9][5] + 4*D[9][9]; // s1^3 // F2 COEFFICIENT f2coeff[1] = - 2*D[1][3] + 2*D[1][7] - 2*D[3][1] - 2*D[3][5] - 2*D[3][9] - 2*D[5][3] + 2*D[5][7] + 2*D[7][1] + 2*D[7][5] + 2*D[7][9] - 2*D[9][3] + 2*D[9][7]; // constant term f2coeff[2] = 4*D[1][5] - 4*D[1][1] + 8*D[2][2] + 8*D[2][4] + 8*D[4][2] + 8*D[4][4] + 4*D[5][1] - 4*D[5][5] + 4*D[9][9]; // s1^2 * s2 f2coeff[3] = 4*D[1][8] - 4*D[1][6] - 8*D[2][3] + 8*D[2][7] - 8*D[3][2] - 8*D[3][4] - 8*D[4][3] + 8*D[4][7] + 4*D[5][6] - 4*D[5][8] - 4*D[6][1] + 4*D[6][5] - 4*D[6][9] + 8*D[7][2] + 8*D[7][4] + 4*D[8][1] - 4*D[8][5] + 4*D[8][9] - 4*D[9][6] + 4*D[9][8]; // s1 * s2 f2coeff[4] = 8*D[2][2] - 8*D[3][3] - 8*D[4][4] + 8*D[6][6] + 8*D[7][7] - 8*D[8][8]; // s1 * s3 f2coeff[5] = 4*D[1][4] - 4*D[1][2] - 4*D[2][1] + 4*D[2][5] - 4*D[2][9] - 8*D[3][6] - 8*D[3][8] + 4*D[4][1] - 4*D[4][5] + 4*D[4][9] + 4*D[5][2] - 4*D[5][4] - 8*D[6][3] + 8*D[6][7] + 8*D[7][6] + 8*D[7][8] - 8*D[8][3] + 8*D[8][7] - 4*D[9][2] + 4*D[9][4]; // s2 * s3 f2coeff[6] = 6*D[5][6] - 6*D[1][8] - 6*D[1][6] + 6*D[5][8] - 6*D[6][1] + 6*D[6][5] - 6*D[6][9] - 6*D[8][1] + 6*D[8][5] - 6*D[8][9] - 6*D[9][6] - 6*D[9][8]; // s2^2 * s3 f2coeff[7] = 4*D[1][1] - 4*D[1][5] + 4*D[1][9] - 4*D[5][1] + 4*D[5][5] - 4*D[5][9] + 4*D[9][1] - 4*D[9][5] + 4*D[9][9]; // s2^3 f2coeff[8] = 2*D[2][9] - 2*D[1][4] - 2*D[2][1] - 2*D[2][5] - 2*D[1][2] + 4*D[3][6] + 4*D[3][8] - 2*D[4][1] - 2*D[4][5] + 2*D[4][9] - 2*D[5][2] - 2*D[5][4] + 4*D[6][3] + 4*D[6][7] + 4*D[7][6] + 4*D[7][8] + 4*D[8][3] + 4*D[8][7] + 2*D[9][2] + 2*D[9][4]; // s1 * s3^2 f2coeff[9] = 2*D[1][2] + 2*D[1][4] + 2*D[2][1] + 2*D[2][5] + 2*D[2][9] - 4*D[3][6] + 4*D[3][8] + 2*D[4][1] + 2*D[4][5] + 2*D[4][9] + 2*D[5][2] + 2*D[5][4] - 4*D[6][3] + 4*D[6][7] + 4*D[7][6] - 4*D[7][8] + 4*D[8][3] - 4*D[8][7] + 2*D[9][2] + 2*D[9][4]; // s1 f2coeff[10] = 2*D[1][6] + 2*D[1][8] - 4*D[2][3] + 4*D[2][7] - 4*D[3][2] + 4*D[3][4] + 4*D[4][3] - 4*D[4][7] + 2*D[5][6] + 2*D[5][8] + 2*D[6][1] + 2*D[6][5] + 2*D[6][9] + 4*D[7][2] - 4*D[7][4] + 2*D[8][1] + 2*D[8][5] + 2*D[8][9] + 2*D[9][6] + 2*D[9][8]; // s3 f2coeff[11] = 8*D[3][3] - 4*D[1][9] - 4*D[1][1] - 8*D[3][7] + 4*D[5][5] - 8*D[7][3] + 8*D[7][7] - 4*D[9][1] - 4*D[9][9]; // s2 f2coeff[12] = 4*D[1][1] - 4*D[5][5] + 4*D[5][9] + 8*D[6][6] + 8*D[6][8] + 8*D[8][6] + 8*D[8][8] + 4*D[9][5] - 4*D[9][9]; // s2 * s3^2 f2coeff[13] = 2*D[1][7] - 2*D[1][3] + 4*D[2][6] - 4*D[2][8] - 2*D[3][1] + 2*D[3][5] + 2*D[3][9] + 4*D[4][6] - 4*D[4][8] + 2*D[5][3] - 2*D[5][7] + 4*D[6][2] + 4*D[6][4] + 2*D[7][1] - 2*D[7][5] - 2*D[7][9] - 4*D[8][2] - 4*D[8][4] + 2*D[9][3] - 2*D[9][7]; // s1^2 f2coeff[14] = 2*D[1][3] - 2*D[1][7] + 4*D[2][6] + 4*D[2][8] + 2*D[3][1] + 2*D[3][5] - 2*D[3][9] - 4*D[4][6] - 4*D[4][8] + 2*D[5][3] - 2*D[5][7] + 4*D[6][2] - 4*D[6][4] - 2*D[7][1] - 2*D[7][5] + 2*D[7][9] + 4*D[8][2] - 4*D[8][4] - 2*D[9][3] + 2*D[9][7]; // s3^2 f2coeff[15] = 6*D[1][3] - 6*D[1][7] + 6*D[3][1] - 6*D[3][5] + 6*D[3][9] - 6*D[5][3] + 6*D[5][7] - 6*D[7][1] + 6*D[7][5] - 6*D[7][9] + 6*D[9][3] - 6*D[9][7]; // s2^2 f2coeff[16] = 2*D[6][9] - 2*D[1][8] - 2*D[5][6] - 2*D[5][8] - 2*D[6][1] - 2*D[6][5] - 2*D[1][6] - 2*D[8][1] - 2*D[8][5] + 2*D[8][9] + 2*D[9][6] + 2*D[9][8]; // s3^3 f2coeff[17] = 8*D[2][6] - 4*D[1][7] - 4*D[1][3] + 8*D[2][8] - 4*D[3][1] + 4*D[3][5] - 4*D[3][9] + 8*D[4][6] + 8*D[4][8] + 4*D[5][3] + 4*D[5][7] + 8*D[6][2] + 8*D[6][4] - 4*D[7][1] + 4*D[7][5] - 4*D[7][9] + 8*D[8][2] + 8*D[8][4] - 4*D[9][3] - 4*D[9][7]; // s1 * s2 * s3 f2coeff[18] = 6*D[2][5] - 6*D[1][4] - 6*D[2][1] - 6*D[1][2] - 6*D[2][9] - 6*D[4][1] + 6*D[4][5] - 6*D[4][9] + 6*D[5][2] + 6*D[5][4] - 6*D[9][2] - 6*D[9][4]; // s1 * s2^2 f2coeff[19] = 2*D[1][6] + 2*D[1][8] + 4*D[2][3] + 4*D[2][7] + 4*D[3][2] + 4*D[3][4] + 4*D[4][3] + 4*D[4][7] - 2*D[5][6] - 2*D[5][8] + 2*D[6][1] - 2*D[6][5] - 2*D[6][9] + 4*D[7][2] + 4*D[7][4] + 2*D[8][1] - 2*D[8][5] - 2*D[8][9] - 2*D[9][6] - 2*D[9][8]; // s1^2 * s3 f2coeff[20] = 2*D[1][2] + 2*D[1][4] + 2*D[2][1] - 2*D[2][5] - 2*D[2][9] + 2*D[4][1] - 2*D[4][5] - 2*D[4][9] - 2*D[5][2] - 2*D[5][4] - 2*D[9][2] - 2*D[9][4]; // s1^3 // F3 COEFFICIENT f3coeff[1] = 2*D[1][2] - 2*D[1][4] + 2*D[2][1] + 2*D[2][5] + 2*D[2][9] - 2*D[4][1] - 2*D[4][5] - 2*D[4][9] + 2*D[5][2] - 2*D[5][4] + 2*D[9][2] - 2*D[9][4]; // constant term f3coeff[2] = 2*D[1][6] + 2*D[1][8] + 4*D[2][3] + 4*D[2][7] + 4*D[3][2] + 4*D[3][4] + 4*D[4][3] + 4*D[4][7] - 2*D[5][6] - 2*D[5][8] + 2*D[6][1] - 2*D[6][5] - 2*D[6][9] + 4*D[7][2] + 4*D[7][4] + 2*D[8][1] - 2*D[8][5] - 2*D[8][9] - 2*D[9][6] - 2*D[9][8]; // s1^2 * s2 f3coeff[3] = 8*D[2][2] - 8*D[3][3] - 8*D[4][4] + 8*D[6][6] + 8*D[7][7] - 8*D[8][8]; // s1 * s2 f3coeff[4] = 4*D[1][8] - 4*D[1][6] + 8*D[2][3] + 8*D[2][7] + 8*D[3][2] - 8*D[3][4] - 8*D[4][3] - 8*D[4][7] - 4*D[5][6] + 4*D[5][8] - 4*D[6][1] - 4*D[6][5] + 4*D[6][9] + 8*D[7][2] - 8*D[7][4] + 4*D[8][1] + 4*D[8][5] - 4*D[8][9] + 4*D[9][6] - 4*D[9][8]; // s1 * s3 f3coeff[5] = 4*D[1][3] - 4*D[1][7] + 8*D[2][6] + 8*D[2][8] + 4*D[3][1] + 4*D[3][5] - 4*D[3][9] - 8*D[4][6] - 8*D[4][8] + 4*D[5][3] - 4*D[5][7] + 8*D[6][2] - 8*D[6][4] - 4*D[7][1] - 4*D[7][5] + 4*D[7][9] + 8*D[8][2] - 8*D[8][4] - 4*D[9][3] + 4*D[9][7]; // s2 * s3 f3coeff[6] = 4*D[1][1] - 4*D[5][5] + 4*D[5][9] + 8*D[6][6] + 8*D[6][8] + 8*D[8][6] + 8*D[8][8] + 4*D[9][5] - 4*D[9][9]; // s2^2 * s3 f3coeff[7] = 2*D[5][6] - 2*D[1][8] - 2*D[1][6] + 2*D[5][8] - 2*D[6][1] + 2*D[6][5] - 2*D[6][9] - 2*D[8][1] + 2*D[8][5] - 2*D[8][9] - 2*D[9][6] - 2*D[9][8]; // s2^3 f3coeff[8] = 6*D[3][9] - 6*D[1][7] - 6*D[3][1] - 6*D[3][5] - 6*D[1][3] - 6*D[5][3] - 6*D[5][7] - 6*D[7][1] - 6*D[7][5] + 6*D[7][9] + 6*D[9][3] + 6*D[9][7]; // s1 * s3^2 f3coeff[9] = 2*D[1][3] + 2*D[1][7] + 4*D[2][6] - 4*D[2][8] + 2*D[3][1] + 2*D[3][5] + 2*D[3][9] - 4*D[4][6] + 4*D[4][8] + 2*D[5][3] + 2*D[5][7] + 4*D[6][2] - 4*D[6][4] + 2*D[7][1] + 2*D[7][5] + 2*D[7][9] - 4*D[8][2] + 4*D[8][4] + 2*D[9][3] + 2*D[9][7]; // s1 f3coeff[10] = 8*D[2][2] - 4*D[1][5] - 4*D[1][1] - 8*D[2][4] - 8*D[4][2] + 8*D[4][4] - 4*D[5][1] - 4*D[5][5] + 4*D[9][9]; // s3 f3coeff[11] = 2*D[1][6] + 2*D[1][8] - 4*D[2][3] + 4*D[2][7] - 4*D[3][2] + 4*D[3][4] + 4*D[4][3] - 4*D[4][7] + 2*D[5][6] + 2*D[5][8] + 2*D[6][1] + 2*D[6][5] + 2*D[6][9] + 4*D[7][2] - 4*D[7][4] + 2*D[8][1] + 2*D[8][5] + 2*D[8][9] + 2*D[9][6] + 2*D[9][8]; // s2 f3coeff[12] = 6*D[6][9] - 6*D[1][8] - 6*D[5][6] - 6*D[5][8] - 6*D[6][1] - 6*D[6][5] - 6*D[1][6] - 6*D[8][1] - 6*D[8][5] + 6*D[8][9] + 6*D[9][6] + 6*D[9][8]; // s2 * s3^2 f3coeff[13] = 2*D[1][2] - 2*D[1][4] + 2*D[2][1] - 2*D[2][5] - 2*D[2][9] + 4*D[3][6] - 4*D[3][8] - 2*D[4][1] + 2*D[4][5] + 2*D[4][9] - 2*D[5][2] + 2*D[5][4] + 4*D[6][3] + 4*D[6][7] + 4*D[7][6] - 4*D[7][8] - 4*D[8][3] - 4*D[8][7] - 2*D[9][2] + 2*D[9][4]; // s1^2 f3coeff[14] = 6*D[1][4] - 6*D[1][2] - 6*D[2][1] - 6*D[2][5] + 6*D[2][9] + 6*D[4][1] + 6*D[4][5] - 6*D[4][9] - 6*D[5][2] + 6*D[5][4] + 6*D[9][2] - 6*D[9][4]; // s3^2 f3coeff[15] = 2*D[1][4] - 2*D[1][2] - 2*D[2][1] + 2*D[2][5] - 2*D[2][9] - 4*D[3][6] - 4*D[3][8] + 2*D[4][1] - 2*D[4][5] + 2*D[4][9] + 2*D[5][2] - 2*D[5][4] - 4*D[6][3] + 4*D[6][7] + 4*D[7][6] + 4*D[7][8] - 4*D[8][3] + 4*D[8][7] - 2*D[9][2] + 2*D[9][4]; // s2^2 f3coeff[16] = 4*D[1][1] + 4*D[1][5] - 4*D[1][9] + 4*D[5][1] + 4*D[5][5] - 4*D[5][9] - 4*D[9][1] - 4*D[9][5] + 4*D[9][9]; // s3^3 f3coeff[17] = 4*D[2][9] - 4*D[1][4] - 4*D[2][1] - 4*D[2][5] - 4*D[1][2] + 8*D[3][6] + 8*D[3][8] - 4*D[4][1] - 4*D[4][5] + 4*D[4][9] - 4*D[5][2] - 4*D[5][4] + 8*D[6][3] + 8*D[6][7] + 8*D[7][6] + 8*D[7][8] + 8*D[8][3] + 8*D[8][7] + 4*D[9][2] + 4*D[9][4]; // s1 * s2 * s3 f3coeff[18] = 4*D[2][6] - 2*D[1][7] - 2*D[1][3] + 4*D[2][8] - 2*D[3][1] + 2*D[3][5] - 2*D[3][9] + 4*D[4][6] + 4*D[4][8] + 2*D[5][3] + 2*D[5][7] + 4*D[6][2] + 4*D[6][4] - 2*D[7][1] + 2*D[7][5] - 2*D[7][9] + 4*D[8][2] + 4*D[8][4] - 2*D[9][3] - 2*D[9][7]; // s1 * s2^2 f3coeff[19] = 4*D[1][9] - 4*D[1][1] + 8*D[3][3] + 8*D[3][7] + 4*D[5][5] + 8*D[7][3] + 8*D[7][7] + 4*D[9][1] - 4*D[9][9]; // s1^2 * s3 f3coeff[20] = 2*D[1][3] + 2*D[1][7] + 2*D[3][1] - 2*D[3][5] - 2*D[3][9] - 2*D[5][3] - 2*D[5][7] + 2*D[7][1] - 2*D[7][5] - 2*D[7][9] - 2*D[9][3] - 2*D[9][7]; // s1^3 } cv::Mat mrpt::vision::pnp::dls::LeftMultVec(const cv::Mat& v) { cv::Mat mat_ = cv::Mat::zeros(3, 9, CV_64F); for (int i = 0; i < 3; ++i) { mat_.at<double>(i, 3*i + 0) = v.at<double>(0); mat_.at<double>(i, 3*i + 1) = v.at<double>(1); mat_.at<double>(i, 3*i + 2) = v.at<double>(2); } return mat_; } cv::Mat mrpt::vision::pnp::dls::cayley_LS_M(const std::vector<double>& a, const std::vector<double>& b, const std::vector<double>& c, const std::vector<double>& u) { // TODO: input matrix pointer // TODO: shift coefficients one position to left cv::Mat M = cv::Mat::zeros(120, 120, CV_64F); M.at<double>(0,0)=u[1]; M.at<double>(0,35)=a[1]; M.at<double>(0,83)=b[1]; M.at<double>(0,118)=c[1]; M.at<double>(1,0)=u[4]; M.at<double>(1,1)=u[1]; M.at<double>(1,34)=a[1]; M.at<double>(1,35)=a[10]; M.at<double>(1,54)=b[1]; M.at<double>(1,83)=b[10]; M.at<double>(1,99)=c[1]; M.at<double>(1,118)=c[10]; M.at<double>(2,1)=u[4]; M.at<double>(2,2)=u[1]; M.at<double>(2,34)=a[10]; M.at<double>(2,35)=a[14]; M.at<double>(2,51)=a[1]; M.at<double>(2,54)=b[10]; M.at<double>(2,65)=b[1]; M.at<double>(2,83)=b[14]; M.at<double>(2,89)=c[1]; M.at<double>(2,99)=c[10]; M.at<double>(2,118)=c[14]; M.at<double>(3,0)=u[3]; M.at<double>(3,3)=u[1]; M.at<double>(3,35)=a[11]; M.at<double>(3,49)=a[1]; M.at<double>(3,76)=b[1]; M.at<double>(3,83)=b[11]; M.at<double>(3,118)=c[11]; M.at<double>(3,119)=c[1]; M.at<double>(4,1)=u[3]; M.at<double>(4,3)=u[4]; M.at<double>(4,4)=u[1]; M.at<double>(4,34)=a[11]; M.at<double>(4,35)=a[5]; M.at<double>(4,43)=a[1]; M.at<double>(4,49)=a[10]; M.at<double>(4,54)=b[11]; M.at<double>(4,71)=b[1]; M.at<double>(4,76)=b[10]; M.at<double>(4,83)=b[5]; M.at<double>(4,99)=c[11]; M.at<double>(4,100)=c[1]; M.at<double>(4,118)=c[5]; M.at<double>(4,119)=c[10]; M.at<double>(5,2)=u[3]; M.at<double>(5,4)=u[4]; M.at<double>(5,5)=u[1]; M.at<double>(5,34)=a[5]; M.at<double>(5,35)=a[12]; M.at<double>(5,41)=a[1]; M.at<double>(5,43)=a[10]; M.at<double>(5,49)=a[14]; M.at<double>(5,51)=a[11]; M.at<double>(5,54)=b[5]; M.at<double>(5,62)=b[1]; M.at<double>(5,65)=b[11]; M.at<double>(5,71)=b[10]; M.at<double>(5,76)=b[14]; M.at<double>(5,83)=b[12]; M.at<double>(5,89)=c[11]; M.at<double>(5,99)=c[5]; M.at<double>(5,100)=c[10]; M.at<double>(5,111)=c[1]; M.at<double>(5,118)=c[12]; M.at<double>(5,119)=c[14]; M.at<double>(6,3)=u[3]; M.at<double>(6,6)=u[1]; M.at<double>(6,30)=a[1]; M.at<double>(6,35)=a[15]; M.at<double>(6,49)=a[11]; M.at<double>(6,75)=b[1]; M.at<double>(6,76)=b[11]; M.at<double>(6,83)=b[15]; M.at<double>(6,107)=c[1]; M.at<double>(6,118)=c[15]; M.at<double>(6,119)=c[11]; M.at<double>(7,4)=u[3]; M.at<double>(7,6)=u[4]; M.at<double>(7,7)=u[1]; M.at<double>(7,30)=a[10]; M.at<double>(7,34)=a[15]; M.at<double>(7,35)=a[6]; M.at<double>(7,43)=a[11]; M.at<double>(7,45)=a[1]; M.at<double>(7,49)=a[5]; M.at<double>(7,54)=b[15]; M.at<double>(7,63)=b[1]; M.at<double>(7,71)=b[11]; M.at<double>(7,75)=b[10]; M.at<double>(7,76)=b[5]; M.at<double>(7,83)=b[6]; M.at<double>(7,99)=c[15]; M.at<double>(7,100)=c[11]; M.at<double>(7,107)=c[10]; M.at<double>(7,112)=c[1]; M.at<double>(7,118)=c[6]; M.at<double>(7,119)=c[5]; M.at<double>(8,5)=u[3]; M.at<double>(8,7)=u[4]; M.at<double>(8,8)=u[1]; M.at<double>(8,30)=a[14]; M.at<double>(8,34)=a[6]; M.at<double>(8,41)=a[11]; M.at<double>(8,43)=a[5]; M.at<double>(8,45)=a[10]; M.at<double>(8,46)=a[1]; M.at<double>(8,49)=a[12]; M.at<double>(8,51)=a[15]; M.at<double>(8,54)=b[6]; M.at<double>(8,62)=b[11]; M.at<double>(8,63)=b[10]; M.at<double>(8,65)=b[15]; M.at<double>(8,66)=b[1]; M.at<double>(8,71)=b[5]; M.at<double>(8,75)=b[14]; M.at<double>(8,76)=b[12]; M.at<double>(8,89)=c[15]; M.at<double>(8,99)=c[6]; M.at<double>(8,100)=c[5]; M.at<double>(8,102)=c[1]; M.at<double>(8,107)=c[14]; M.at<double>(8,111)=c[11]; M.at<double>(8,112)=c[10]; M.at<double>(8,119)=c[12]; M.at<double>(9,0)=u[2]; M.at<double>(9,9)=u[1]; M.at<double>(9,35)=a[9]; M.at<double>(9,36)=a[1]; M.at<double>(9,83)=b[9]; M.at<double>(9,84)=b[1]; M.at<double>(9,88)=c[1]; M.at<double>(9,118)=c[9]; M.at<double>(10,1)=u[2]; M.at<double>(10,9)=u[4]; M.at<double>(10,10)=u[1]; M.at<double>(10,33)=a[1]; M.at<double>(10,34)=a[9]; M.at<double>(10,35)=a[4]; M.at<double>(10,36)=a[10]; M.at<double>(10,54)=b[9]; M.at<double>(10,59)=b[1]; M.at<double>(10,83)=b[4]; M.at<double>(10,84)=b[10]; M.at<double>(10,88)=c[10]; M.at<double>(10,99)=c[9]; M.at<double>(10,117)=c[1]; M.at<double>(10,118)=c[4]; M.at<double>(11,2)=u[2]; M.at<double>(11,10)=u[4]; M.at<double>(11,11)=u[1]; M.at<double>(11,28)=a[1]; M.at<double>(11,33)=a[10]; M.at<double>(11,34)=a[4]; M.at<double>(11,35)=a[8]; M.at<double>(11,36)=a[14]; M.at<double>(11,51)=a[9]; M.at<double>(11,54)=b[4]; M.at<double>(11,57)=b[1]; M.at<double>(11,59)=b[10]; M.at<double>(11,65)=b[9]; M.at<double>(11,83)=b[8]; M.at<double>(11,84)=b[14]; M.at<double>(11,88)=c[14]; M.at<double>(11,89)=c[9]; M.at<double>(11,99)=c[4]; M.at<double>(11,114)=c[1]; M.at<double>(11,117)=c[10]; M.at<double>(11,118)=c[8]; M.at<double>(12,3)=u[2]; M.at<double>(12,9)=u[3]; M.at<double>(12,12)=u[1]; M.at<double>(12,35)=a[3]; M.at<double>(12,36)=a[11]; M.at<double>(12,39)=a[1]; M.at<double>(12,49)=a[9]; M.at<double>(12,76)=b[9]; M.at<double>(12,79)=b[1]; M.at<double>(12,83)=b[3]; M.at<double>(12,84)=b[11]; M.at<double>(12,88)=c[11]; M.at<double>(12,96)=c[1]; M.at<double>(12,118)=c[3]; M.at<double>(12,119)=c[9]; M.at<double>(13,4)=u[2]; M.at<double>(13,10)=u[3]; M.at<double>(13,12)=u[4]; M.at<double>(13,13)=u[1]; M.at<double>(13,33)=a[11]; M.at<double>(13,34)=a[3]; M.at<double>(13,35)=a[17]; M.at<double>(13,36)=a[5]; M.at<double>(13,39)=a[10]; M.at<double>(13,43)=a[9]; M.at<double>(13,47)=a[1]; M.at<double>(13,49)=a[4]; M.at<double>(13,54)=b[3]; M.at<double>(13,59)=b[11]; M.at<double>(13,60)=b[1]; M.at<double>(13,71)=b[9]; M.at<double>(13,76)=b[4]; M.at<double>(13,79)=b[10]; M.at<double>(13,83)=b[17]; M.at<double>(13,84)=b[5]; M.at<double>(13,88)=c[5]; M.at<double>(13,90)=c[1]; M.at<double>(13,96)=c[10]; M.at<double>(13,99)=c[3]; M.at<double>(13,100)=c[9]; M.at<double>(13,117)=c[11]; M.at<double>(13,118)=c[17]; M.at<double>(13,119)=c[4]; M.at<double>(14,5)=u[2]; M.at<double>(14,11)=u[3]; M.at<double>(14,13)=u[4]; M.at<double>(14,14)=u[1]; M.at<double>(14,28)=a[11]; M.at<double>(14,33)=a[5]; M.at<double>(14,34)=a[17]; M.at<double>(14,36)=a[12]; M.at<double>(14,39)=a[14]; M.at<double>(14,41)=a[9]; M.at<double>(14,42)=a[1]; M.at<double>(14,43)=a[4]; M.at<double>(14,47)=a[10]; M.at<double>(14,49)=a[8]; M.at<double>(14,51)=a[3]; M.at<double>(14,54)=b[17]; M.at<double>(14,56)=b[1]; M.at<double>(14,57)=b[11]; M.at<double>(14,59)=b[5]; M.at<double>(14,60)=b[10]; M.at<double>(14,62)=b[9]; M.at<double>(14,65)=b[3]; M.at<double>(14,71)=b[4]; M.at<double>(14,76)=b[8]; M.at<double>(14,79)=b[14]; M.at<double>(14,84)=b[12]; M.at<double>(14,88)=c[12]; M.at<double>(14,89)=c[3]; M.at<double>(14,90)=c[10]; M.at<double>(14,96)=c[14]; M.at<double>(14,99)=c[17]; M.at<double>(14,100)=c[4]; M.at<double>(14,106)=c[1]; M.at<double>(14,111)=c[9]; M.at<double>(14,114)=c[11]; M.at<double>(14,117)=c[5]; M.at<double>(14,119)=c[8]; M.at<double>(15,6)=u[2]; M.at<double>(15,12)=u[3]; M.at<double>(15,15)=u[1]; M.at<double>(15,29)=a[1]; M.at<double>(15,30)=a[9]; M.at<double>(15,35)=a[18]; M.at<double>(15,36)=a[15]; M.at<double>(15,39)=a[11]; M.at<double>(15,49)=a[3]; M.at<double>(15,74)=b[1]; M.at<double>(15,75)=b[9]; M.at<double>(15,76)=b[3]; M.at<double>(15,79)=b[11]; M.at<double>(15,83)=b[18]; M.at<double>(15,84)=b[15]; M.at<double>(15,88)=c[15]; M.at<double>(15,94)=c[1]; M.at<double>(15,96)=c[11]; M.at<double>(15,107)=c[9]; M.at<double>(15,118)=c[18]; M.at<double>(15,119)=c[3]; M.at<double>(16,7)=u[2]; M.at<double>(16,13)=u[3]; M.at<double>(16,15)=u[4]; M.at<double>(16,16)=u[1]; M.at<double>(16,29)=a[10]; M.at<double>(16,30)=a[4]; M.at<double>(16,33)=a[15]; M.at<double>(16,34)=a[18]; M.at<double>(16,36)=a[6]; M.at<double>(16,39)=a[5]; M.at<double>(16,43)=a[3]; M.at<double>(16,44)=a[1]; M.at<double>(16,45)=a[9]; M.at<double>(16,47)=a[11]; M.at<double>(16,49)=a[17]; M.at<double>(16,54)=b[18]; M.at<double>(16,59)=b[15]; M.at<double>(16,60)=b[11]; M.at<double>(16,63)=b[9]; M.at<double>(16,68)=b[1]; M.at<double>(16,71)=b[3]; M.at<double>(16,74)=b[10]; M.at<double>(16,75)=b[4]; M.at<double>(16,76)=b[17]; M.at<double>(16,79)=b[5]; M.at<double>(16,84)=b[6]; M.at<double>(16,88)=c[6]; M.at<double>(16,90)=c[11]; M.at<double>(16,94)=c[10]; M.at<double>(16,96)=c[5]; M.at<double>(16,97)=c[1]; M.at<double>(16,99)=c[18]; M.at<double>(16,100)=c[3]; M.at<double>(16,107)=c[4]; M.at<double>(16,112)=c[9]; M.at<double>(16,117)=c[15]; M.at<double>(16,119)=c[17]; M.at<double>(17,8)=u[2]; M.at<double>(17,14)=u[3]; M.at<double>(17,16)=u[4]; M.at<double>(17,17)=u[1]; M.at<double>(17,28)=a[15]; M.at<double>(17,29)=a[14]; M.at<double>(17,30)=a[8]; M.at<double>(17,33)=a[6]; M.at<double>(17,39)=a[12]; M.at<double>(17,41)=a[3]; M.at<double>(17,42)=a[11]; M.at<double>(17,43)=a[17]; M.at<double>(17,44)=a[10]; M.at<double>(17,45)=a[4]; M.at<double>(17,46)=a[9]; M.at<double>(17,47)=a[5]; M.at<double>(17,51)=a[18]; M.at<double>(17,56)=b[11]; M.at<double>(17,57)=b[15]; M.at<double>(17,59)=b[6]; M.at<double>(17,60)=b[5]; M.at<double>(17,62)=b[3]; M.at<double>(17,63)=b[4]; M.at<double>(17,65)=b[18]; M.at<double>(17,66)=b[9]; M.at<double>(17,68)=b[10]; M.at<double>(17,71)=b[17]; M.at<double>(17,74)=b[14]; M.at<double>(17,75)=b[8]; M.at<double>(17,79)=b[12]; M.at<double>(17,89)=c[18]; M.at<double>(17,90)=c[5]; M.at<double>(17,94)=c[14]; M.at<double>(17,96)=c[12]; M.at<double>(17,97)=c[10]; M.at<double>(17,100)=c[17]; M.at<double>(17,102)=c[9]; M.at<double>(17,106)=c[11]; M.at<double>(17,107)=c[8]; M.at<double>(17,111)=c[3]; M.at<double>(17,112)=c[4]; M.at<double>(17,114)=c[15]; M.at<double>(17,117)=c[6]; M.at<double>(18,9)=u[2]; M.at<double>(18,18)=u[1]; M.at<double>(18,35)=a[13]; M.at<double>(18,36)=a[9]; M.at<double>(18,53)=a[1]; M.at<double>(18,82)=b[1]; M.at<double>(18,83)=b[13]; M.at<double>(18,84)=b[9]; M.at<double>(18,87)=c[1]; M.at<double>(18,88)=c[9]; M.at<double>(18,118)=c[13]; M.at<double>(19,10)=u[2]; M.at<double>(19,18)=u[4]; M.at<double>(19,19)=u[1]; M.at<double>(19,32)=a[1]; M.at<double>(19,33)=a[9]; M.at<double>(19,34)=a[13]; M.at<double>(19,35)=a[19]; M.at<double>(19,36)=a[4]; M.at<double>(19,53)=a[10]; M.at<double>(19,54)=b[13]; M.at<double>(19,59)=b[9]; M.at<double>(19,61)=b[1]; M.at<double>(19,82)=b[10]; M.at<double>(19,83)=b[19]; M.at<double>(19,84)=b[4]; M.at<double>(19,87)=c[10]; M.at<double>(19,88)=c[4]; M.at<double>(19,99)=c[13]; M.at<double>(19,116)=c[1]; M.at<double>(19,117)=c[9]; M.at<double>(19,118)=c[19]; M.at<double>(20,11)=u[2]; M.at<double>(20,19)=u[4]; M.at<double>(20,20)=u[1]; M.at<double>(20,27)=a[1]; M.at<double>(20,28)=a[9]; M.at<double>(20,32)=a[10]; M.at<double>(20,33)=a[4]; M.at<double>(20,34)=a[19]; M.at<double>(20,36)=a[8]; M.at<double>(20,51)=a[13]; M.at<double>(20,53)=a[14]; M.at<double>(20,54)=b[19]; M.at<double>(20,55)=b[1]; M.at<double>(20,57)=b[9]; M.at<double>(20,59)=b[4]; M.at<double>(20,61)=b[10]; M.at<double>(20,65)=b[13]; M.at<double>(20,82)=b[14]; M.at<double>(20,84)=b[8]; M.at<double>(20,87)=c[14]; M.at<double>(20,88)=c[8]; M.at<double>(20,89)=c[13]; M.at<double>(20,99)=c[19]; M.at<double>(20,113)=c[1]; M.at<double>(20,114)=c[9]; M.at<double>(20,116)=c[10]; M.at<double>(20,117)=c[4]; M.at<double>(21,12)=u[2]; M.at<double>(21,18)=u[3]; M.at<double>(21,21)=u[1]; M.at<double>(21,35)=a[2]; M.at<double>(21,36)=a[3]; M.at<double>(21,38)=a[1]; M.at<double>(21,39)=a[9]; M.at<double>(21,49)=a[13]; M.at<double>(21,53)=a[11]; M.at<double>(21,76)=b[13]; M.at<double>(21,78)=b[1]; M.at<double>(21,79)=b[9]; M.at<double>(21,82)=b[11]; M.at<double>(21,83)=b[2]; M.at<double>(21,84)=b[3]; M.at<double>(21,87)=c[11]; M.at<double>(21,88)=c[3]; M.at<double>(21,92)=c[1]; M.at<double>(21,96)=c[9]; M.at<double>(21,118)=c[2]; M.at<double>(21,119)=c[13]; M.at<double>(22,13)=u[2]; M.at<double>(22,19)=u[3]; M.at<double>(22,21)=u[4]; M.at<double>(22,22)=u[1]; M.at<double>(22,32)=a[11]; M.at<double>(22,33)=a[3]; M.at<double>(22,34)=a[2]; M.at<double>(22,36)=a[17]; M.at<double>(22,38)=a[10]; M.at<double>(22,39)=a[4]; M.at<double>(22,40)=a[1]; M.at<double>(22,43)=a[13]; M.at<double>(22,47)=a[9]; M.at<double>(22,49)=a[19]; M.at<double>(22,53)=a[5]; M.at<double>(22,54)=b[2]; M.at<double>(22,59)=b[3]; M.at<double>(22,60)=b[9]; M.at<double>(22,61)=b[11]; M.at<double>(22,71)=b[13]; M.at<double>(22,72)=b[1]; M.at<double>(22,76)=b[19]; M.at<double>(22,78)=b[10]; M.at<double>(22,79)=b[4]; M.at<double>(22,82)=b[5]; M.at<double>(22,84)=b[17]; M.at<double>(22,87)=c[5]; M.at<double>(22,88)=c[17]; M.at<double>(22,90)=c[9]; M.at<double>(22,92)=c[10]; M.at<double>(22,95)=c[1]; M.at<double>(22,96)=c[4]; M.at<double>(22,99)=c[2]; M.at<double>(22,100)=c[13]; M.at<double>(22,116)=c[11]; M.at<double>(22,117)=c[3]; M.at<double>(22,119)=c[19]; M.at<double>(23,14)=u[2]; M.at<double>(23,20)=u[3]; M.at<double>(23,22)=u[4]; M.at<double>(23,23)=u[1]; M.at<double>(23,27)=a[11]; M.at<double>(23,28)=a[3]; M.at<double>(23,32)=a[5]; M.at<double>(23,33)=a[17]; M.at<double>(23,38)=a[14]; M.at<double>(23,39)=a[8]; M.at<double>(23,40)=a[10]; M.at<double>(23,41)=a[13]; M.at<double>(23,42)=a[9]; M.at<double>(23,43)=a[19]; M.at<double>(23,47)=a[4]; M.at<double>(23,51)=a[2]; M.at<double>(23,53)=a[12]; M.at<double>(23,55)=b[11]; M.at<double>(23,56)=b[9]; M.at<double>(23,57)=b[3]; M.at<double>(23,59)=b[17]; M.at<double>(23,60)=b[4]; M.at<double>(23,61)=b[5]; M.at<double>(23,62)=b[13]; M.at<double>(23,65)=b[2]; M.at<double>(23,71)=b[19]; M.at<double>(23,72)=b[10]; M.at<double>(23,78)=b[14]; M.at<double>(23,79)=b[8]; M.at<double>(23,82)=b[12]; M.at<double>(23,87)=c[12]; M.at<double>(23,89)=c[2]; M.at<double>(23,90)=c[4]; M.at<double>(23,92)=c[14]; M.at<double>(23,95)=c[10]; M.at<double>(23,96)=c[8]; M.at<double>(23,100)=c[19]; M.at<double>(23,106)=c[9]; M.at<double>(23,111)=c[13]; M.at<double>(23,113)=c[11]; M.at<double>(23,114)=c[3]; M.at<double>(23,116)=c[5]; M.at<double>(23,117)=c[17]; M.at<double>(24,15)=u[2]; M.at<double>(24,21)=u[3]; M.at<double>(24,24)=u[1]; M.at<double>(24,29)=a[9]; M.at<double>(24,30)=a[13]; M.at<double>(24,36)=a[18]; M.at<double>(24,38)=a[11]; M.at<double>(24,39)=a[3]; M.at<double>(24,49)=a[2]; M.at<double>(24,52)=a[1]; M.at<double>(24,53)=a[15]; M.at<double>(24,73)=b[1]; M.at<double>(24,74)=b[9]; M.at<double>(24,75)=b[13]; M.at<double>(24,76)=b[2]; M.at<double>(24,78)=b[11]; M.at<double>(24,79)=b[3]; M.at<double>(24,82)=b[15]; M.at<double>(24,84)=b[18]; M.at<double>(24,87)=c[15]; M.at<double>(24,88)=c[18]; M.at<double>(24,92)=c[11]; M.at<double>(24,93)=c[1]; M.at<double>(24,94)=c[9]; M.at<double>(24,96)=c[3]; M.at<double>(24,107)=c[13]; M.at<double>(24,119)=c[2]; M.at<double>(25,16)=u[2]; M.at<double>(25,22)=u[3]; M.at<double>(25,24)=u[4]; M.at<double>(25,25)=u[1]; M.at<double>(25,29)=a[4]; M.at<double>(25,30)=a[19]; M.at<double>(25,32)=a[15]; M.at<double>(25,33)=a[18]; M.at<double>(25,38)=a[5]; M.at<double>(25,39)=a[17]; M.at<double>(25,40)=a[11]; M.at<double>(25,43)=a[2]; M.at<double>(25,44)=a[9]; M.at<double>(25,45)=a[13]; M.at<double>(25,47)=a[3]; M.at<double>(25,52)=a[10]; M.at<double>(25,53)=a[6]; M.at<double>(25,59)=b[18]; M.at<double>(25,60)=b[3]; M.at<double>(25,61)=b[15]; M.at<double>(25,63)=b[13]; M.at<double>(25,68)=b[9]; M.at<double>(25,71)=b[2]; M.at<double>(25,72)=b[11]; M.at<double>(25,73)=b[10]; M.at<double>(25,74)=b[4]; M.at<double>(25,75)=b[19]; M.at<double>(25,78)=b[5]; M.at<double>(25,79)=b[17]; M.at<double>(25,82)=b[6]; M.at<double>(25,87)=c[6]; M.at<double>(25,90)=c[3]; M.at<double>(25,92)=c[5]; M.at<double>(25,93)=c[10]; M.at<double>(25,94)=c[4]; M.at<double>(25,95)=c[11]; M.at<double>(25,96)=c[17]; M.at<double>(25,97)=c[9]; M.at<double>(25,100)=c[2]; M.at<double>(25,107)=c[19]; M.at<double>(25,112)=c[13]; M.at<double>(25,116)=c[15]; M.at<double>(25,117)=c[18]; M.at<double>(26,17)=u[2]; M.at<double>(26,23)=u[3]; M.at<double>(26,25)=u[4]; M.at<double>(26,26)=u[1]; M.at<double>(26,27)=a[15]; M.at<double>(26,28)=a[18]; M.at<double>(26,29)=a[8]; M.at<double>(26,32)=a[6]; M.at<double>(26,38)=a[12]; M.at<double>(26,40)=a[5]; M.at<double>(26,41)=a[2]; M.at<double>(26,42)=a[3]; M.at<double>(26,44)=a[4]; M.at<double>(26,45)=a[19]; M.at<double>(26,46)=a[13]; M.at<double>(26,47)=a[17]; M.at<double>(26,52)=a[14]; M.at<double>(26,55)=b[15]; M.at<double>(26,56)=b[3]; M.at<double>(26,57)=b[18]; M.at<double>(26,60)=b[17]; M.at<double>(26,61)=b[6]; M.at<double>(26,62)=b[2]; M.at<double>(26,63)=b[19]; M.at<double>(26,66)=b[13]; M.at<double>(26,68)=b[4]; M.at<double>(26,72)=b[5]; M.at<double>(26,73)=b[14]; M.at<double>(26,74)=b[8]; M.at<double>(26,78)=b[12]; M.at<double>(26,90)=c[17]; M.at<double>(26,92)=c[12]; M.at<double>(26,93)=c[14]; M.at<double>(26,94)=c[8]; M.at<double>(26,95)=c[5]; M.at<double>(26,97)=c[4]; M.at<double>(26,102)=c[13]; M.at<double>(26,106)=c[3]; M.at<double>(26,111)=c[2]; M.at<double>(26,112)=c[19]; M.at<double>(26,113)=c[15]; M.at<double>(26,114)=c[18]; M.at<double>(26,116)=c[6]; M.at<double>(27,15)=u[3]; M.at<double>(27,29)=a[11]; M.at<double>(27,30)=a[3]; M.at<double>(27,36)=a[7]; M.at<double>(27,39)=a[15]; M.at<double>(27,49)=a[18]; M.at<double>(27,69)=b[9]; M.at<double>(27,70)=b[1]; M.at<double>(27,74)=b[11]; M.at<double>(27,75)=b[3]; M.at<double>(27,76)=b[18]; M.at<double>(27,79)=b[15]; M.at<double>(27,84)=b[7]; M.at<double>(27,88)=c[7]; M.at<double>(27,91)=c[1]; M.at<double>(27,94)=c[11]; M.at<double>(27,96)=c[15]; M.at<double>(27,107)=c[3]; M.at<double>(27,110)=c[9]; M.at<double>(27,119)=c[18]; M.at<double>(28,6)=u[3]; M.at<double>(28,30)=a[11]; M.at<double>(28,35)=a[7]; M.at<double>(28,49)=a[15]; M.at<double>(28,69)=b[1]; M.at<double>(28,75)=b[11]; M.at<double>(28,76)=b[15]; M.at<double>(28,83)=b[7]; M.at<double>(28,107)=c[11]; M.at<double>(28,110)=c[1]; M.at<double>(28,118)=c[7]; M.at<double>(28,119)=c[15]; M.at<double>(29,24)=u[3]; M.at<double>(29,29)=a[3]; M.at<double>(29,30)=a[2]; M.at<double>(29,38)=a[15]; M.at<double>(29,39)=a[18]; M.at<double>(29,52)=a[11]; M.at<double>(29,53)=a[7]; M.at<double>(29,69)=b[13]; M.at<double>(29,70)=b[9]; M.at<double>(29,73)=b[11]; M.at<double>(29,74)=b[3]; M.at<double>(29,75)=b[2]; M.at<double>(29,78)=b[15]; M.at<double>(29,79)=b[18]; M.at<double>(29,82)=b[7]; M.at<double>(29,87)=c[7]; M.at<double>(29,91)=c[9]; M.at<double>(29,92)=c[15]; M.at<double>(29,93)=c[11]; M.at<double>(29,94)=c[3]; M.at<double>(29,96)=c[18]; M.at<double>(29,107)=c[2]; M.at<double>(29,110)=c[13]; M.at<double>(30,37)=a[18]; M.at<double>(30,48)=a[7]; M.at<double>(30,52)=a[2]; M.at<double>(30,70)=b[20]; M.at<double>(30,73)=b[2]; M.at<double>(30,77)=b[18]; M.at<double>(30,81)=b[7]; M.at<double>(30,85)=c[7]; M.at<double>(30,91)=c[20]; M.at<double>(30,93)=c[2]; M.at<double>(30,98)=c[18]; M.at<double>(31,29)=a[2]; M.at<double>(31,37)=a[15]; M.at<double>(31,38)=a[18]; M.at<double>(31,50)=a[7]; M.at<double>(31,52)=a[3]; M.at<double>(31,69)=b[20]; M.at<double>(31,70)=b[13]; M.at<double>(31,73)=b[3]; M.at<double>(31,74)=b[2]; M.at<double>(31,77)=b[15]; M.at<double>(31,78)=b[18]; M.at<double>(31,80)=b[7]; M.at<double>(31,86)=c[7]; M.at<double>(31,91)=c[13]; M.at<double>(31,92)=c[18]; M.at<double>(31,93)=c[3]; M.at<double>(31,94)=c[2]; M.at<double>(31,98)=c[15]; M.at<double>(31,110)=c[20]; M.at<double>(32,48)=a[9]; M.at<double>(32,50)=a[13]; M.at<double>(32,53)=a[20]; M.at<double>(32,80)=b[13]; M.at<double>(32,81)=b[9]; M.at<double>(32,82)=b[20]; M.at<double>(32,85)=c[9]; M.at<double>(32,86)=c[13]; M.at<double>(32,87)=c[20]; M.at<double>(33,29)=a[15]; M.at<double>(33,30)=a[18]; M.at<double>(33,39)=a[7]; M.at<double>(33,64)=b[9]; M.at<double>(33,69)=b[3]; M.at<double>(33,70)=b[11]; M.at<double>(33,74)=b[15]; M.at<double>(33,75)=b[18]; M.at<double>(33,79)=b[7]; M.at<double>(33,91)=c[11]; M.at<double>(33,94)=c[15]; M.at<double>(33,96)=c[7]; M.at<double>(33,103)=c[9]; M.at<double>(33,107)=c[18]; M.at<double>(33,110)=c[3]; M.at<double>(34,29)=a[18]; M.at<double>(34,38)=a[7]; M.at<double>(34,52)=a[15]; M.at<double>(34,64)=b[13]; M.at<double>(34,69)=b[2]; M.at<double>(34,70)=b[3]; M.at<double>(34,73)=b[15]; M.at<double>(34,74)=b[18]; M.at<double>(34,78)=b[7]; M.at<double>(34,91)=c[3]; M.at<double>(34,92)=c[7]; M.at<double>(34,93)=c[15]; M.at<double>(34,94)=c[18]; M.at<double>(34,103)=c[13]; M.at<double>(34,110)=c[2]; M.at<double>(35,37)=a[7]; M.at<double>(35,52)=a[18]; M.at<double>(35,64)=b[20]; M.at<double>(35,70)=b[2]; M.at<double>(35,73)=b[18]; M.at<double>(35,77)=b[7]; M.at<double>(35,91)=c[2]; M.at<double>(35,93)=c[18]; M.at<double>(35,98)=c[7]; M.at<double>(35,103)=c[20]; M.at<double>(36,5)=u[4]; M.at<double>(36,34)=a[12]; M.at<double>(36,41)=a[10]; M.at<double>(36,43)=a[14]; M.at<double>(36,49)=a[16]; M.at<double>(36,51)=a[5]; M.at<double>(36,54)=b[12]; M.at<double>(36,62)=b[10]; M.at<double>(36,65)=b[5]; M.at<double>(36,71)=b[14]; M.at<double>(36,76)=b[16]; M.at<double>(36,89)=c[5]; M.at<double>(36,99)=c[12]; M.at<double>(36,100)=c[14]; M.at<double>(36,101)=c[1]; M.at<double>(36,109)=c[11]; M.at<double>(36,111)=c[10]; M.at<double>(36,119)=c[16]; M.at<double>(37,2)=u[4]; M.at<double>(37,34)=a[14]; M.at<double>(37,35)=a[16]; M.at<double>(37,51)=a[10]; M.at<double>(37,54)=b[14]; M.at<double>(37,65)=b[10]; M.at<double>(37,83)=b[16]; M.at<double>(37,89)=c[10]; M.at<double>(37,99)=c[14]; M.at<double>(37,109)=c[1]; M.at<double>(37,118)=c[16]; M.at<double>(38,30)=a[15]; M.at<double>(38,49)=a[7]; M.at<double>(38,64)=b[1]; M.at<double>(38,69)=b[11]; M.at<double>(38,75)=b[15]; M.at<double>(38,76)=b[7]; M.at<double>(38,103)=c[1]; M.at<double>(38,107)=c[15]; M.at<double>(38,110)=c[11]; M.at<double>(38,119)=c[7]; M.at<double>(39,28)=a[14]; M.at<double>(39,33)=a[16]; M.at<double>(39,51)=a[8]; M.at<double>(39,57)=b[14]; M.at<double>(39,59)=b[16]; M.at<double>(39,65)=b[8]; M.at<double>(39,89)=c[8]; M.at<double>(39,105)=c[9]; M.at<double>(39,108)=c[10]; M.at<double>(39,109)=c[4]; M.at<double>(39,114)=c[14]; M.at<double>(39,117)=c[16]; M.at<double>(40,27)=a[14]; M.at<double>(40,28)=a[8]; M.at<double>(40,32)=a[16]; M.at<double>(40,55)=b[14]; M.at<double>(40,57)=b[8]; M.at<double>(40,61)=b[16]; M.at<double>(40,105)=c[13]; M.at<double>(40,108)=c[4]; M.at<double>(40,109)=c[19]; M.at<double>(40,113)=c[14]; M.at<double>(40,114)=c[8]; M.at<double>(40,116)=c[16]; M.at<double>(41,30)=a[7]; M.at<double>(41,64)=b[11]; M.at<double>(41,69)=b[15]; M.at<double>(41,75)=b[7]; M.at<double>(41,103)=c[11]; M.at<double>(41,107)=c[7]; M.at<double>(41,110)=c[15]; M.at<double>(42,27)=a[8]; M.at<double>(42,31)=a[16]; M.at<double>(42,55)=b[8]; M.at<double>(42,58)=b[16]; M.at<double>(42,105)=c[20]; M.at<double>(42,108)=c[19]; M.at<double>(42,113)=c[8]; M.at<double>(42,115)=c[16]; M.at<double>(43,29)=a[7]; M.at<double>(43,64)=b[3]; M.at<double>(43,69)=b[18]; M.at<double>(43,70)=b[15]; M.at<double>(43,74)=b[7]; M.at<double>(43,91)=c[15]; M.at<double>(43,94)=c[7]; M.at<double>(43,103)=c[3]; M.at<double>(43,110)=c[18]; M.at<double>(44,28)=a[16]; M.at<double>(44,57)=b[16]; M.at<double>(44,105)=c[4]; M.at<double>(44,108)=c[14]; M.at<double>(44,109)=c[8]; M.at<double>(44,114)=c[16]; M.at<double>(45,27)=a[16]; M.at<double>(45,55)=b[16]; M.at<double>(45,105)=c[19]; M.at<double>(45,108)=c[8]; M.at<double>(45,113)=c[16]; M.at<double>(46,52)=a[7]; M.at<double>(46,64)=b[2]; M.at<double>(46,70)=b[18]; M.at<double>(46,73)=b[7]; M.at<double>(46,91)=c[18]; M.at<double>(46,93)=c[7]; M.at<double>(46,103)=c[2]; M.at<double>(47,40)=a[7]; M.at<double>(47,44)=a[18]; M.at<double>(47,52)=a[6]; M.at<double>(47,64)=b[19]; M.at<double>(47,67)=b[2]; M.at<double>(47,68)=b[18]; M.at<double>(47,70)=b[17]; M.at<double>(47,72)=b[7]; M.at<double>(47,73)=b[6]; M.at<double>(47,91)=c[17]; M.at<double>(47,93)=c[6]; M.at<double>(47,95)=c[7]; M.at<double>(47,97)=c[18]; M.at<double>(47,103)=c[19]; M.at<double>(47,104)=c[2]; M.at<double>(48,30)=a[6]; M.at<double>(48,43)=a[7]; M.at<double>(48,45)=a[15]; M.at<double>(48,63)=b[15]; M.at<double>(48,64)=b[10]; M.at<double>(48,67)=b[11]; M.at<double>(48,69)=b[5]; M.at<double>(48,71)=b[7]; M.at<double>(48,75)=b[6]; M.at<double>(48,100)=c[7]; M.at<double>(48,103)=c[10]; M.at<double>(48,104)=c[11]; M.at<double>(48,107)=c[6]; M.at<double>(48,110)=c[5]; M.at<double>(48,112)=c[15]; M.at<double>(49,41)=a[12]; M.at<double>(49,45)=a[16]; M.at<double>(49,46)=a[14]; M.at<double>(49,62)=b[12]; M.at<double>(49,63)=b[16]; M.at<double>(49,66)=b[14]; M.at<double>(49,101)=c[5]; M.at<double>(49,102)=c[14]; M.at<double>(49,105)=c[15]; M.at<double>(49,109)=c[6]; M.at<double>(49,111)=c[12]; M.at<double>(49,112)=c[16]; M.at<double>(50,41)=a[16]; M.at<double>(50,62)=b[16]; M.at<double>(50,101)=c[14]; M.at<double>(50,105)=c[5]; M.at<double>(50,109)=c[12]; M.at<double>(50,111)=c[16]; M.at<double>(51,64)=b[18]; M.at<double>(51,70)=b[7]; M.at<double>(51,91)=c[7]; M.at<double>(51,103)=c[18]; M.at<double>(52,41)=a[6]; M.at<double>(52,45)=a[12]; M.at<double>(52,46)=a[5]; M.at<double>(52,62)=b[6]; M.at<double>(52,63)=b[12]; M.at<double>(52,66)=b[5]; M.at<double>(52,67)=b[14]; M.at<double>(52,69)=b[16]; M.at<double>(52,101)=c[15]; M.at<double>(52,102)=c[5]; M.at<double>(52,104)=c[14]; M.at<double>(52,109)=c[7]; M.at<double>(52,110)=c[16]; M.at<double>(52,111)=c[6]; M.at<double>(52,112)=c[12]; M.at<double>(53,64)=b[15]; M.at<double>(53,69)=b[7]; M.at<double>(53,103)=c[15]; M.at<double>(53,110)=c[7]; M.at<double>(54,105)=c[14]; M.at<double>(54,109)=c[16]; M.at<double>(55,44)=a[7]; M.at<double>(55,64)=b[17]; M.at<double>(55,67)=b[18]; M.at<double>(55,68)=b[7]; M.at<double>(55,70)=b[6]; M.at<double>(55,91)=c[6]; M.at<double>(55,97)=c[7]; M.at<double>(55,103)=c[17]; M.at<double>(55,104)=c[18]; M.at<double>(56,105)=c[8]; M.at<double>(56,108)=c[16]; M.at<double>(57,64)=b[6]; M.at<double>(57,67)=b[7]; M.at<double>(57,103)=c[6]; M.at<double>(57,104)=c[7]; M.at<double>(58,46)=a[7]; M.at<double>(58,64)=b[12]; M.at<double>(58,66)=b[7]; M.at<double>(58,67)=b[6]; M.at<double>(58,102)=c[7]; M.at<double>(58,103)=c[12]; M.at<double>(58,104)=c[6]; M.at<double>(59,8)=u[4]; M.at<double>(59,30)=a[16]; M.at<double>(59,41)=a[5]; M.at<double>(59,43)=a[12]; M.at<double>(59,45)=a[14]; M.at<double>(59,46)=a[10]; M.at<double>(59,51)=a[6]; M.at<double>(59,62)=b[5]; M.at<double>(59,63)=b[14]; M.at<double>(59,65)=b[6]; M.at<double>(59,66)=b[10]; M.at<double>(59,71)=b[12]; M.at<double>(59,75)=b[16]; M.at<double>(59,89)=c[6]; M.at<double>(59,100)=c[12]; M.at<double>(59,101)=c[11]; M.at<double>(59,102)=c[10]; M.at<double>(59,107)=c[16]; M.at<double>(59,109)=c[15]; M.at<double>(59,111)=c[5]; M.at<double>(59,112)=c[14]; M.at<double>(60,8)=u[3]; M.at<double>(60,30)=a[12]; M.at<double>(60,41)=a[15]; M.at<double>(60,43)=a[6]; M.at<double>(60,45)=a[5]; M.at<double>(60,46)=a[11]; M.at<double>(60,51)=a[7]; M.at<double>(60,62)=b[15]; M.at<double>(60,63)=b[5]; M.at<double>(60,65)=b[7]; M.at<double>(60,66)=b[11]; M.at<double>(60,67)=b[10]; M.at<double>(60,69)=b[14]; M.at<double>(60,71)=b[6]; M.at<double>(60,75)=b[12]; M.at<double>(60,89)=c[7]; M.at<double>(60,100)=c[6]; M.at<double>(60,102)=c[11]; M.at<double>(60,104)=c[10]; M.at<double>(60,107)=c[12]; M.at<double>(60,110)=c[14]; M.at<double>(60,111)=c[15]; M.at<double>(60,112)=c[5]; M.at<double>(61,42)=a[16]; M.at<double>(61,56)=b[16]; M.at<double>(61,101)=c[8]; M.at<double>(61,105)=c[17]; M.at<double>(61,106)=c[16]; M.at<double>(61,108)=c[12]; M.at<double>(62,64)=b[7]; M.at<double>(62,103)=c[7]; M.at<double>(63,105)=c[16]; M.at<double>(64,46)=a[12]; M.at<double>(64,66)=b[12]; M.at<double>(64,67)=b[16]; M.at<double>(64,101)=c[6]; M.at<double>(64,102)=c[12]; M.at<double>(64,104)=c[16]; M.at<double>(64,105)=c[7]; M.at<double>(65,46)=a[6]; M.at<double>(65,64)=b[16]; M.at<double>(65,66)=b[6]; M.at<double>(65,67)=b[12]; M.at<double>(65,101)=c[7]; M.at<double>(65,102)=c[6]; M.at<double>(65,103)=c[16]; M.at<double>(65,104)=c[12]; M.at<double>(66,46)=a[16]; M.at<double>(66,66)=b[16]; M.at<double>(66,101)=c[12]; M.at<double>(66,102)=c[16]; M.at<double>(66,105)=c[6]; M.at<double>(67,101)=c[16]; M.at<double>(67,105)=c[12]; M.at<double>(68,41)=a[14]; M.at<double>(68,43)=a[16]; M.at<double>(68,51)=a[12]; M.at<double>(68,62)=b[14]; M.at<double>(68,65)=b[12]; M.at<double>(68,71)=b[16]; M.at<double>(68,89)=c[12]; M.at<double>(68,100)=c[16]; M.at<double>(68,101)=c[10]; M.at<double>(68,105)=c[11]; M.at<double>(68,109)=c[5]; M.at<double>(68,111)=c[14]; M.at<double>(69,37)=a[2]; M.at<double>(69,48)=a[18]; M.at<double>(69,52)=a[20]; M.at<double>(69,73)=b[20]; M.at<double>(69,77)=b[2]; M.at<double>(69,81)=b[18]; M.at<double>(69,85)=c[18]; M.at<double>(69,93)=c[20]; M.at<double>(69,98)=c[2]; M.at<double>(70,20)=u[2]; M.at<double>(70,27)=a[9]; M.at<double>(70,28)=a[13]; M.at<double>(70,31)=a[10]; M.at<double>(70,32)=a[4]; M.at<double>(70,33)=a[19]; M.at<double>(70,50)=a[14]; M.at<double>(70,51)=a[20]; M.at<double>(70,53)=a[8]; M.at<double>(70,55)=b[9]; M.at<double>(70,57)=b[13]; M.at<double>(70,58)=b[10]; M.at<double>(70,59)=b[19]; M.at<double>(70,61)=b[4]; M.at<double>(70,65)=b[20]; M.at<double>(70,80)=b[14]; M.at<double>(70,82)=b[8]; M.at<double>(70,86)=c[14]; M.at<double>(70,87)=c[8]; M.at<double>(70,89)=c[20]; M.at<double>(70,113)=c[9]; M.at<double>(70,114)=c[13]; M.at<double>(70,115)=c[10]; M.at<double>(70,116)=c[4]; M.at<double>(70,117)=c[19]; M.at<double>(71,45)=a[7]; M.at<double>(71,63)=b[7]; M.at<double>(71,64)=b[5]; M.at<double>(71,67)=b[15]; M.at<double>(71,69)=b[6]; M.at<double>(71,103)=c[5]; M.at<double>(71,104)=c[15]; M.at<double>(71,110)=c[6]; M.at<double>(71,112)=c[7]; M.at<double>(72,41)=a[7]; M.at<double>(72,45)=a[6]; M.at<double>(72,46)=a[15]; M.at<double>(72,62)=b[7]; M.at<double>(72,63)=b[6]; M.at<double>(72,64)=b[14]; M.at<double>(72,66)=b[15]; M.at<double>(72,67)=b[5]; M.at<double>(72,69)=b[12]; M.at<double>(72,102)=c[15]; M.at<double>(72,103)=c[14]; M.at<double>(72,104)=c[5]; M.at<double>(72,110)=c[12]; M.at<double>(72,111)=c[7]; M.at<double>(72,112)=c[6]; M.at<double>(73,48)=a[13]; M.at<double>(73,50)=a[20]; M.at<double>(73,80)=b[20]; M.at<double>(73,81)=b[13]; M.at<double>(73,85)=c[13]; M.at<double>(73,86)=c[20]; M.at<double>(74,25)=u[3]; M.at<double>(74,29)=a[17]; M.at<double>(74,32)=a[7]; M.at<double>(74,38)=a[6]; M.at<double>(74,40)=a[15]; M.at<double>(74,44)=a[3]; M.at<double>(74,45)=a[2]; M.at<double>(74,47)=a[18]; M.at<double>(74,52)=a[5]; M.at<double>(74,60)=b[18]; M.at<double>(74,61)=b[7]; M.at<double>(74,63)=b[2]; M.at<double>(74,67)=b[13]; M.at<double>(74,68)=b[3]; M.at<double>(74,69)=b[19]; M.at<double>(74,70)=b[4]; M.at<double>(74,72)=b[15]; M.at<double>(74,73)=b[5]; M.at<double>(74,74)=b[17]; M.at<double>(74,78)=b[6]; M.at<double>(74,90)=c[18]; M.at<double>(74,91)=c[4]; M.at<double>(74,92)=c[6]; M.at<double>(74,93)=c[5]; M.at<double>(74,94)=c[17]; M.at<double>(74,95)=c[15]; M.at<double>(74,97)=c[3]; M.at<double>(74,104)=c[13]; M.at<double>(74,110)=c[19]; M.at<double>(74,112)=c[2]; M.at<double>(74,116)=c[7]; M.at<double>(75,21)=u[2]; M.at<double>(75,36)=a[2]; M.at<double>(75,37)=a[1]; M.at<double>(75,38)=a[9]; M.at<double>(75,39)=a[13]; M.at<double>(75,49)=a[20]; M.at<double>(75,50)=a[11]; M.at<double>(75,53)=a[3]; M.at<double>(75,76)=b[20]; M.at<double>(75,77)=b[1]; M.at<double>(75,78)=b[9]; M.at<double>(75,79)=b[13]; M.at<double>(75,80)=b[11]; M.at<double>(75,82)=b[3]; M.at<double>(75,84)=b[2]; M.at<double>(75,86)=c[11]; M.at<double>(75,87)=c[3]; M.at<double>(75,88)=c[2]; M.at<double>(75,92)=c[9]; M.at<double>(75,96)=c[13]; M.at<double>(75,98)=c[1]; M.at<double>(75,119)=c[20]; M.at<double>(76,48)=a[20]; M.at<double>(76,81)=b[20]; M.at<double>(76,85)=c[20]; M.at<double>(77,34)=a[16]; M.at<double>(77,51)=a[14]; M.at<double>(77,54)=b[16]; M.at<double>(77,65)=b[14]; M.at<double>(77,89)=c[14]; M.at<double>(77,99)=c[16]; M.at<double>(77,105)=c[1]; M.at<double>(77,109)=c[10]; M.at<double>(78,27)=a[17]; M.at<double>(78,31)=a[12]; M.at<double>(78,37)=a[16]; M.at<double>(78,40)=a[8]; M.at<double>(78,42)=a[19]; M.at<double>(78,55)=b[17]; M.at<double>(78,56)=b[19]; M.at<double>(78,58)=b[12]; M.at<double>(78,72)=b[8]; M.at<double>(78,77)=b[16]; M.at<double>(78,95)=c[8]; M.at<double>(78,98)=c[16]; M.at<double>(78,101)=c[20]; M.at<double>(78,106)=c[19]; M.at<double>(78,108)=c[2]; M.at<double>(78,113)=c[17]; M.at<double>(78,115)=c[12]; M.at<double>(79,42)=a[12]; M.at<double>(79,44)=a[16]; M.at<double>(79,46)=a[8]; M.at<double>(79,56)=b[12]; M.at<double>(79,66)=b[8]; M.at<double>(79,68)=b[16]; M.at<double>(79,97)=c[16]; M.at<double>(79,101)=c[17]; M.at<double>(79,102)=c[8]; M.at<double>(79,105)=c[18]; M.at<double>(79,106)=c[12]; M.at<double>(79,108)=c[6]; M.at<double>(80,14)=u[4]; M.at<double>(80,28)=a[5]; M.at<double>(80,33)=a[12]; M.at<double>(80,39)=a[16]; M.at<double>(80,41)=a[4]; M.at<double>(80,42)=a[10]; M.at<double>(80,43)=a[8]; M.at<double>(80,47)=a[14]; M.at<double>(80,51)=a[17]; M.at<double>(80,56)=b[10]; M.at<double>(80,57)=b[5]; M.at<double>(80,59)=b[12]; M.at<double>(80,60)=b[14]; M.at<double>(80,62)=b[4]; M.at<double>(80,65)=b[17]; M.at<double>(80,71)=b[8]; M.at<double>(80,79)=b[16]; M.at<double>(80,89)=c[17]; M.at<double>(80,90)=c[14]; M.at<double>(80,96)=c[16]; M.at<double>(80,100)=c[8]; M.at<double>(80,101)=c[9]; M.at<double>(80,106)=c[10]; M.at<double>(80,108)=c[11]; M.at<double>(80,109)=c[3]; M.at<double>(80,111)=c[4]; M.at<double>(80,114)=c[5]; M.at<double>(80,117)=c[12]; M.at<double>(81,31)=a[3]; M.at<double>(81,32)=a[2]; M.at<double>(81,37)=a[4]; M.at<double>(81,38)=a[19]; M.at<double>(81,40)=a[13]; M.at<double>(81,47)=a[20]; M.at<double>(81,48)=a[5]; M.at<double>(81,50)=a[17]; M.at<double>(81,58)=b[3]; M.at<double>(81,60)=b[20]; M.at<double>(81,61)=b[2]; M.at<double>(81,72)=b[13]; M.at<double>(81,77)=b[4]; M.at<double>(81,78)=b[19]; M.at<double>(81,80)=b[17]; M.at<double>(81,81)=b[5]; M.at<double>(81,85)=c[5]; M.at<double>(81,86)=c[17]; M.at<double>(81,90)=c[20]; M.at<double>(81,92)=c[19]; M.at<double>(81,95)=c[13]; M.at<double>(81,98)=c[4]; M.at<double>(81,115)=c[3]; M.at<double>(81,116)=c[2]; M.at<double>(82,29)=a[6]; M.at<double>(82,44)=a[15]; M.at<double>(82,45)=a[18]; M.at<double>(82,47)=a[7]; M.at<double>(82,60)=b[7]; M.at<double>(82,63)=b[18]; M.at<double>(82,64)=b[4]; M.at<double>(82,67)=b[3]; M.at<double>(82,68)=b[15]; M.at<double>(82,69)=b[17]; M.at<double>(82,70)=b[5]; M.at<double>(82,74)=b[6]; M.at<double>(82,90)=c[7]; M.at<double>(82,91)=c[5]; M.at<double>(82,94)=c[6]; M.at<double>(82,97)=c[15]; M.at<double>(82,103)=c[4]; M.at<double>(82,104)=c[3]; M.at<double>(82,110)=c[17]; M.at<double>(82,112)=c[18]; M.at<double>(83,26)=u[2]; M.at<double>(83,27)=a[18]; M.at<double>(83,31)=a[6]; M.at<double>(83,37)=a[12]; M.at<double>(83,40)=a[17]; M.at<double>(83,42)=a[2]; M.at<double>(83,44)=a[19]; M.at<double>(83,46)=a[20]; M.at<double>(83,52)=a[8]; M.at<double>(83,55)=b[18]; M.at<double>(83,56)=b[2]; M.at<double>(83,58)=b[6]; M.at<double>(83,66)=b[20]; M.at<double>(83,68)=b[19]; M.at<double>(83,72)=b[17]; M.at<double>(83,73)=b[8]; M.at<double>(83,77)=b[12]; M.at<double>(83,93)=c[8]; M.at<double>(83,95)=c[17]; M.at<double>(83,97)=c[19]; M.at<double>(83,98)=c[12]; M.at<double>(83,102)=c[20]; M.at<double>(83,106)=c[2]; M.at<double>(83,113)=c[18]; M.at<double>(83,115)=c[6]; M.at<double>(84,16)=u[3]; M.at<double>(84,29)=a[5]; M.at<double>(84,30)=a[17]; M.at<double>(84,33)=a[7]; M.at<double>(84,39)=a[6]; M.at<double>(84,43)=a[18]; M.at<double>(84,44)=a[11]; M.at<double>(84,45)=a[3]; M.at<double>(84,47)=a[15]; M.at<double>(84,59)=b[7]; M.at<double>(84,60)=b[15]; M.at<double>(84,63)=b[3]; M.at<double>(84,67)=b[9]; M.at<double>(84,68)=b[11]; M.at<double>(84,69)=b[4]; M.at<double>(84,70)=b[10]; M.at<double>(84,71)=b[18]; M.at<double>(84,74)=b[5]; M.at<double>(84,75)=b[17]; M.at<double>(84,79)=b[6]; M.at<double>(84,90)=c[15]; M.at<double>(84,91)=c[10]; M.at<double>(84,94)=c[5]; M.at<double>(84,96)=c[6]; M.at<double>(84,97)=c[11]; M.at<double>(84,100)=c[18]; M.at<double>(84,104)=c[9]; M.at<double>(84,107)=c[17]; M.at<double>(84,110)=c[4]; M.at<double>(84,112)=c[3]; M.at<double>(84,117)=c[7]; M.at<double>(85,25)=u[2]; M.at<double>(85,29)=a[19]; M.at<double>(85,31)=a[15]; M.at<double>(85,32)=a[18]; M.at<double>(85,37)=a[5]; M.at<double>(85,38)=a[17]; M.at<double>(85,40)=a[3]; M.at<double>(85,44)=a[13]; M.at<double>(85,45)=a[20]; M.at<double>(85,47)=a[2]; M.at<double>(85,50)=a[6]; M.at<double>(85,52)=a[4]; M.at<double>(85,58)=b[15]; M.at<double>(85,60)=b[2]; M.at<double>(85,61)=b[18]; M.at<double>(85,63)=b[20]; M.at<double>(85,68)=b[13]; M.at<double>(85,72)=b[3]; M.at<double>(85,73)=b[4]; M.at<double>(85,74)=b[19]; M.at<double>(85,77)=b[5]; M.at<double>(85,78)=b[17]; M.at<double>(85,80)=b[6]; M.at<double>(85,86)=c[6]; M.at<double>(85,90)=c[2]; M.at<double>(85,92)=c[17]; M.at<double>(85,93)=c[4]; M.at<double>(85,94)=c[19]; M.at<double>(85,95)=c[3]; M.at<double>(85,97)=c[13]; M.at<double>(85,98)=c[5]; M.at<double>(85,112)=c[20]; M.at<double>(85,115)=c[15]; M.at<double>(85,116)=c[18]; M.at<double>(86,31)=a[18]; M.at<double>(86,37)=a[17]; M.at<double>(86,40)=a[2]; M.at<double>(86,44)=a[20]; M.at<double>(86,48)=a[6]; M.at<double>(86,52)=a[19]; M.at<double>(86,58)=b[18]; M.at<double>(86,68)=b[20]; M.at<double>(86,72)=b[2]; M.at<double>(86,73)=b[19]; M.at<double>(86,77)=b[17]; M.at<double>(86,81)=b[6]; M.at<double>(86,85)=c[6]; M.at<double>(86,93)=c[19]; M.at<double>(86,95)=c[2]; M.at<double>(86,97)=c[20]; M.at<double>(86,98)=c[17]; M.at<double>(86,115)=c[18]; M.at<double>(87,22)=u[2]; M.at<double>(87,31)=a[11]; M.at<double>(87,32)=a[3]; M.at<double>(87,33)=a[2]; M.at<double>(87,37)=a[10]; M.at<double>(87,38)=a[4]; M.at<double>(87,39)=a[19]; M.at<double>(87,40)=a[9]; M.at<double>(87,43)=a[20]; M.at<double>(87,47)=a[13]; M.at<double>(87,50)=a[5]; M.at<double>(87,53)=a[17]; M.at<double>(87,58)=b[11]; M.at<double>(87,59)=b[2]; M.at<double>(87,60)=b[13]; M.at<double>(87,61)=b[3]; M.at<double>(87,71)=b[20]; M.at<double>(87,72)=b[9]; M.at<double>(87,77)=b[10]; M.at<double>(87,78)=b[4]; M.at<double>(87,79)=b[19]; M.at<double>(87,80)=b[5]; M.at<double>(87,82)=b[17]; M.at<double>(87,86)=c[5]; M.at<double>(87,87)=c[17]; M.at<double>(87,90)=c[13]; M.at<double>(87,92)=c[4]; M.at<double>(87,95)=c[9]; M.at<double>(87,96)=c[19]; M.at<double>(87,98)=c[10]; M.at<double>(87,100)=c[20]; M.at<double>(87,115)=c[11]; M.at<double>(87,116)=c[3]; M.at<double>(87,117)=c[2]; M.at<double>(88,27)=a[2]; M.at<double>(88,31)=a[17]; M.at<double>(88,37)=a[8]; M.at<double>(88,40)=a[19]; M.at<double>(88,42)=a[20]; M.at<double>(88,48)=a[12]; M.at<double>(88,55)=b[2]; M.at<double>(88,56)=b[20]; M.at<double>(88,58)=b[17]; M.at<double>(88,72)=b[19]; M.at<double>(88,77)=b[8]; M.at<double>(88,81)=b[12]; M.at<double>(88,85)=c[12]; M.at<double>(88,95)=c[19]; M.at<double>(88,98)=c[8]; M.at<double>(88,106)=c[20]; M.at<double>(88,113)=c[2]; M.at<double>(88,115)=c[17]; M.at<double>(89,31)=a[7]; M.at<double>(89,37)=a[6]; M.at<double>(89,40)=a[18]; M.at<double>(89,44)=a[2]; M.at<double>(89,52)=a[17]; M.at<double>(89,58)=b[7]; M.at<double>(89,67)=b[20]; M.at<double>(89,68)=b[2]; M.at<double>(89,70)=b[19]; M.at<double>(89,72)=b[18]; M.at<double>(89,73)=b[17]; M.at<double>(89,77)=b[6]; M.at<double>(89,91)=c[19]; M.at<double>(89,93)=c[17]; M.at<double>(89,95)=c[18]; M.at<double>(89,97)=c[2]; M.at<double>(89,98)=c[6]; M.at<double>(89,104)=c[20]; M.at<double>(89,115)=c[7]; M.at<double>(90,27)=a[12]; M.at<double>(90,40)=a[16]; M.at<double>(90,42)=a[8]; M.at<double>(90,55)=b[12]; M.at<double>(90,56)=b[8]; M.at<double>(90,72)=b[16]; M.at<double>(90,95)=c[16]; M.at<double>(90,101)=c[19]; M.at<double>(90,105)=c[2]; M.at<double>(90,106)=c[8]; M.at<double>(90,108)=c[17]; M.at<double>(90,113)=c[12]; M.at<double>(91,23)=u[2]; M.at<double>(91,27)=a[3]; M.at<double>(91,28)=a[2]; M.at<double>(91,31)=a[5]; M.at<double>(91,32)=a[17]; M.at<double>(91,37)=a[14]; M.at<double>(91,38)=a[8]; M.at<double>(91,40)=a[4]; M.at<double>(91,41)=a[20]; M.at<double>(91,42)=a[13]; M.at<double>(91,47)=a[19]; M.at<double>(91,50)=a[12]; M.at<double>(91,55)=b[3]; M.at<double>(91,56)=b[13]; M.at<double>(91,57)=b[2]; M.at<double>(91,58)=b[5]; M.at<double>(91,60)=b[19]; M.at<double>(91,61)=b[17]; M.at<double>(91,62)=b[20]; M.at<double>(91,72)=b[4]; M.at<double>(91,77)=b[14]; M.at<double>(91,78)=b[8]; M.at<double>(91,80)=b[12]; M.at<double>(91,86)=c[12]; M.at<double>(91,90)=c[19]; M.at<double>(91,92)=c[8]; M.at<double>(91,95)=c[4]; M.at<double>(91,98)=c[14]; M.at<double>(91,106)=c[13]; M.at<double>(91,111)=c[20]; M.at<double>(91,113)=c[3]; M.at<double>(91,114)=c[2]; M.at<double>(91,115)=c[5]; M.at<double>(91,116)=c[17]; M.at<double>(92,17)=u[4]; M.at<double>(92,28)=a[6]; M.at<double>(92,29)=a[16]; M.at<double>(92,41)=a[17]; M.at<double>(92,42)=a[5]; M.at<double>(92,44)=a[14]; M.at<double>(92,45)=a[8]; M.at<double>(92,46)=a[4]; M.at<double>(92,47)=a[12]; M.at<double>(92,56)=b[5]; M.at<double>(92,57)=b[6]; M.at<double>(92,60)=b[12]; M.at<double>(92,62)=b[17]; M.at<double>(92,63)=b[8]; M.at<double>(92,66)=b[4]; M.at<double>(92,68)=b[14]; M.at<double>(92,74)=b[16]; M.at<double>(92,90)=c[12]; M.at<double>(92,94)=c[16]; M.at<double>(92,97)=c[14]; M.at<double>(92,101)=c[3]; M.at<double>(92,102)=c[4]; M.at<double>(92,106)=c[5]; M.at<double>(92,108)=c[15]; M.at<double>(92,109)=c[18]; M.at<double>(92,111)=c[17]; M.at<double>(92,112)=c[8]; M.at<double>(92,114)=c[6]; M.at<double>(93,17)=u[3]; M.at<double>(93,28)=a[7]; M.at<double>(93,29)=a[12]; M.at<double>(93,41)=a[18]; M.at<double>(93,42)=a[15]; M.at<double>(93,44)=a[5]; M.at<double>(93,45)=a[17]; M.at<double>(93,46)=a[3]; M.at<double>(93,47)=a[6]; M.at<double>(93,56)=b[15]; M.at<double>(93,57)=b[7]; M.at<double>(93,60)=b[6]; M.at<double>(93,62)=b[18]; M.at<double>(93,63)=b[17]; M.at<double>(93,66)=b[3]; M.at<double>(93,67)=b[4]; M.at<double>(93,68)=b[5]; M.at<double>(93,69)=b[8]; M.at<double>(93,70)=b[14]; M.at<double>(93,74)=b[12]; M.at<double>(93,90)=c[6]; M.at<double>(93,91)=c[14]; M.at<double>(93,94)=c[12]; M.at<double>(93,97)=c[5]; M.at<double>(93,102)=c[3]; M.at<double>(93,104)=c[4]; M.at<double>(93,106)=c[15]; M.at<double>(93,110)=c[8]; M.at<double>(93,111)=c[18]; M.at<double>(93,112)=c[17]; M.at<double>(93,114)=c[7]; M.at<double>(94,31)=a[2]; M.at<double>(94,37)=a[19]; M.at<double>(94,40)=a[20]; M.at<double>(94,48)=a[17]; M.at<double>(94,58)=b[2]; M.at<double>(94,72)=b[20]; M.at<double>(94,77)=b[19]; M.at<double>(94,81)=b[17]; M.at<double>(94,85)=c[17]; M.at<double>(94,95)=c[20]; M.at<double>(94,98)=c[19]; M.at<double>(94,115)=c[2]; M.at<double>(95,26)=u[4]; M.at<double>(95,27)=a[6]; M.at<double>(95,40)=a[12]; M.at<double>(95,42)=a[17]; M.at<double>(95,44)=a[8]; M.at<double>(95,46)=a[19]; M.at<double>(95,52)=a[16]; M.at<double>(95,55)=b[6]; M.at<double>(95,56)=b[17]; M.at<double>(95,66)=b[19]; M.at<double>(95,68)=b[8]; M.at<double>(95,72)=b[12]; M.at<double>(95,73)=b[16]; M.at<double>(95,93)=c[16]; M.at<double>(95,95)=c[12]; M.at<double>(95,97)=c[8]; M.at<double>(95,101)=c[2]; M.at<double>(95,102)=c[19]; M.at<double>(95,106)=c[17]; M.at<double>(95,108)=c[18]; M.at<double>(95,113)=c[6]; M.at<double>(96,23)=u[4]; M.at<double>(96,27)=a[5]; M.at<double>(96,28)=a[17]; M.at<double>(96,32)=a[12]; M.at<double>(96,38)=a[16]; M.at<double>(96,40)=a[14]; M.at<double>(96,41)=a[19]; M.at<double>(96,42)=a[4]; M.at<double>(96,47)=a[8]; M.at<double>(96,55)=b[5]; M.at<double>(96,56)=b[4]; M.at<double>(96,57)=b[17]; M.at<double>(96,60)=b[8]; M.at<double>(96,61)=b[12]; M.at<double>(96,62)=b[19]; M.at<double>(96,72)=b[14]; M.at<double>(96,78)=b[16]; M.at<double>(96,90)=c[8]; M.at<double>(96,92)=c[16]; M.at<double>(96,95)=c[14]; M.at<double>(96,101)=c[13]; M.at<double>(96,106)=c[4]; M.at<double>(96,108)=c[3]; M.at<double>(96,109)=c[2]; M.at<double>(96,111)=c[19]; M.at<double>(96,113)=c[5]; M.at<double>(96,114)=c[17]; M.at<double>(96,116)=c[12]; M.at<double>(97,42)=a[6]; M.at<double>(97,44)=a[12]; M.at<double>(97,46)=a[17]; M.at<double>(97,56)=b[6]; M.at<double>(97,66)=b[17]; M.at<double>(97,67)=b[8]; M.at<double>(97,68)=b[12]; M.at<double>(97,70)=b[16]; M.at<double>(97,91)=c[16]; M.at<double>(97,97)=c[12]; M.at<double>(97,101)=c[18]; M.at<double>(97,102)=c[17]; M.at<double>(97,104)=c[8]; M.at<double>(97,106)=c[6]; M.at<double>(97,108)=c[7]; M.at<double>(98,28)=a[12]; M.at<double>(98,41)=a[8]; M.at<double>(98,42)=a[14]; M.at<double>(98,47)=a[16]; M.at<double>(98,56)=b[14]; M.at<double>(98,57)=b[12]; M.at<double>(98,60)=b[16]; M.at<double>(98,62)=b[8]; M.at<double>(98,90)=c[16]; M.at<double>(98,101)=c[4]; M.at<double>(98,105)=c[3]; M.at<double>(98,106)=c[14]; M.at<double>(98,108)=c[5]; M.at<double>(98,109)=c[17]; M.at<double>(98,111)=c[8]; M.at<double>(98,114)=c[12]; M.at<double>(99,42)=a[7]; M.at<double>(99,44)=a[6]; M.at<double>(99,46)=a[18]; M.at<double>(99,56)=b[7]; M.at<double>(99,64)=b[8]; M.at<double>(99,66)=b[18]; M.at<double>(99,67)=b[17]; M.at<double>(99,68)=b[6]; M.at<double>(99,70)=b[12]; M.at<double>(99,91)=c[12]; M.at<double>(99,97)=c[6]; M.at<double>(99,102)=c[18]; M.at<double>(99,103)=c[8]; M.at<double>(99,104)=c[17]; M.at<double>(99,106)=c[7]; M.at<double>(100,51)=a[16]; M.at<double>(100,65)=b[16]; M.at<double>(100,89)=c[16]; M.at<double>(100,105)=c[10]; M.at<double>(100,109)=c[14]; M.at<double>(101,37)=a[9]; M.at<double>(101,38)=a[13]; M.at<double>(101,39)=a[20]; M.at<double>(101,48)=a[11]; M.at<double>(101,50)=a[3]; M.at<double>(101,53)=a[2]; M.at<double>(101,77)=b[9]; M.at<double>(101,78)=b[13]; M.at<double>(101,79)=b[20]; M.at<double>(101,80)=b[3]; M.at<double>(101,81)=b[11]; M.at<double>(101,82)=b[2]; M.at<double>(101,85)=c[11]; M.at<double>(101,86)=c[3]; M.at<double>(101,87)=c[2]; M.at<double>(101,92)=c[13]; M.at<double>(101,96)=c[20]; M.at<double>(101,98)=c[9]; M.at<double>(102,37)=a[13]; M.at<double>(102,38)=a[20]; M.at<double>(102,48)=a[3]; M.at<double>(102,50)=a[2]; M.at<double>(102,77)=b[13]; M.at<double>(102,78)=b[20]; M.at<double>(102,80)=b[2]; M.at<double>(102,81)=b[3]; M.at<double>(102,85)=c[3]; M.at<double>(102,86)=c[2]; M.at<double>(102,92)=c[20]; M.at<double>(102,98)=c[13]; M.at<double>(103,37)=a[20]; M.at<double>(103,48)=a[2]; M.at<double>(103,77)=b[20]; M.at<double>(103,81)=b[2]; M.at<double>(103,85)=c[2]; M.at<double>(103,98)=c[20]; M.at<double>(104,11)=u[4]; M.at<double>(104,28)=a[10]; M.at<double>(104,33)=a[14]; M.at<double>(104,34)=a[8]; M.at<double>(104,36)=a[16]; M.at<double>(104,51)=a[4]; M.at<double>(104,54)=b[8]; M.at<double>(104,57)=b[10]; M.at<double>(104,59)=b[14]; M.at<double>(104,65)=b[4]; M.at<double>(104,84)=b[16]; M.at<double>(104,88)=c[16]; M.at<double>(104,89)=c[4]; M.at<double>(104,99)=c[8]; M.at<double>(104,108)=c[1]; M.at<double>(104,109)=c[9]; M.at<double>(104,114)=c[10]; M.at<double>(104,117)=c[14]; M.at<double>(105,20)=u[4]; M.at<double>(105,27)=a[10]; M.at<double>(105,28)=a[4]; M.at<double>(105,32)=a[14]; M.at<double>(105,33)=a[8]; M.at<double>(105,51)=a[19]; M.at<double>(105,53)=a[16]; M.at<double>(105,55)=b[10]; M.at<double>(105,57)=b[4]; M.at<double>(105,59)=b[8]; M.at<double>(105,61)=b[14]; M.at<double>(105,65)=b[19]; M.at<double>(105,82)=b[16]; M.at<double>(105,87)=c[16]; M.at<double>(105,89)=c[19]; M.at<double>(105,108)=c[9]; M.at<double>(105,109)=c[13]; M.at<double>(105,113)=c[10]; M.at<double>(105,114)=c[4]; M.at<double>(105,116)=c[14]; M.at<double>(105,117)=c[8]; M.at<double>(106,27)=a[4]; M.at<double>(106,28)=a[19]; M.at<double>(106,31)=a[14]; M.at<double>(106,32)=a[8]; M.at<double>(106,50)=a[16]; M.at<double>(106,55)=b[4]; M.at<double>(106,57)=b[19]; M.at<double>(106,58)=b[14]; M.at<double>(106,61)=b[8]; M.at<double>(106,80)=b[16]; M.at<double>(106,86)=c[16]; M.at<double>(106,108)=c[13]; M.at<double>(106,109)=c[20]; M.at<double>(106,113)=c[4]; M.at<double>(106,114)=c[19]; M.at<double>(106,115)=c[14]; M.at<double>(106,116)=c[8]; M.at<double>(107,27)=a[19]; M.at<double>(107,31)=a[8]; M.at<double>(107,48)=a[16]; M.at<double>(107,55)=b[19]; M.at<double>(107,58)=b[8]; M.at<double>(107,81)=b[16]; M.at<double>(107,85)=c[16]; M.at<double>(107,108)=c[20]; M.at<double>(107,113)=c[19]; M.at<double>(107,115)=c[8]; M.at<double>(108,36)=a[20]; M.at<double>(108,48)=a[1]; M.at<double>(108,50)=a[9]; M.at<double>(108,53)=a[13]; M.at<double>(108,80)=b[9]; M.at<double>(108,81)=b[1]; M.at<double>(108,82)=b[13]; M.at<double>(108,84)=b[20]; M.at<double>(108,85)=c[1]; M.at<double>(108,86)=c[9]; M.at<double>(108,87)=c[13]; M.at<double>(108,88)=c[20]; M.at<double>(109,26)=u[3]; M.at<double>(109,27)=a[7]; M.at<double>(109,40)=a[6]; M.at<double>(109,42)=a[18]; M.at<double>(109,44)=a[17]; M.at<double>(109,46)=a[2]; M.at<double>(109,52)=a[12]; M.at<double>(109,55)=b[7]; M.at<double>(109,56)=b[18]; M.at<double>(109,66)=b[2]; M.at<double>(109,67)=b[19]; M.at<double>(109,68)=b[17]; M.at<double>(109,70)=b[8]; M.at<double>(109,72)=b[6]; M.at<double>(109,73)=b[12]; M.at<double>(109,91)=c[8]; M.at<double>(109,93)=c[12]; M.at<double>(109,95)=c[6]; M.at<double>(109,97)=c[17]; M.at<double>(109,102)=c[2]; M.at<double>(109,104)=c[19]; M.at<double>(109,106)=c[18]; M.at<double>(109,113)=c[7]; M.at<double>(110,7)=u[3]; M.at<double>(110,30)=a[5]; M.at<double>(110,34)=a[7]; M.at<double>(110,43)=a[15]; M.at<double>(110,45)=a[11]; M.at<double>(110,49)=a[6]; M.at<double>(110,54)=b[7]; M.at<double>(110,63)=b[11]; M.at<double>(110,67)=b[1]; M.at<double>(110,69)=b[10]; M.at<double>(110,71)=b[15]; M.at<double>(110,75)=b[5]; M.at<double>(110,76)=b[6]; M.at<double>(110,99)=c[7]; M.at<double>(110,100)=c[15]; M.at<double>(110,104)=c[1]; M.at<double>(110,107)=c[5]; M.at<double>(110,110)=c[10]; M.at<double>(110,112)=c[11]; M.at<double>(110,119)=c[6]; M.at<double>(111,18)=u[2]; M.at<double>(111,35)=a[20]; M.at<double>(111,36)=a[13]; M.at<double>(111,50)=a[1]; M.at<double>(111,53)=a[9]; M.at<double>(111,80)=b[1]; M.at<double>(111,82)=b[9]; M.at<double>(111,83)=b[20]; M.at<double>(111,84)=b[13]; M.at<double>(111,86)=c[1]; M.at<double>(111,87)=c[9]; M.at<double>(111,88)=c[13]; M.at<double>(111,118)=c[20]; M.at<double>(112,19)=u[2]; M.at<double>(112,31)=a[1]; M.at<double>(112,32)=a[9]; M.at<double>(112,33)=a[13]; M.at<double>(112,34)=a[20]; M.at<double>(112,36)=a[19]; M.at<double>(112,50)=a[10]; M.at<double>(112,53)=a[4]; M.at<double>(112,54)=b[20]; M.at<double>(112,58)=b[1]; M.at<double>(112,59)=b[13]; M.at<double>(112,61)=b[9]; M.at<double>(112,80)=b[10]; M.at<double>(112,82)=b[4]; M.at<double>(112,84)=b[19]; M.at<double>(112,86)=c[10]; M.at<double>(112,87)=c[4]; M.at<double>(112,88)=c[19]; M.at<double>(112,99)=c[20]; M.at<double>(112,115)=c[1]; M.at<double>(112,116)=c[9]; M.at<double>(112,117)=c[13]; M.at<double>(113,31)=a[9]; M.at<double>(113,32)=a[13]; M.at<double>(113,33)=a[20]; M.at<double>(113,48)=a[10]; M.at<double>(113,50)=a[4]; M.at<double>(113,53)=a[19]; M.at<double>(113,58)=b[9]; M.at<double>(113,59)=b[20]; M.at<double>(113,61)=b[13]; M.at<double>(113,80)=b[4]; M.at<double>(113,81)=b[10]; M.at<double>(113,82)=b[19]; M.at<double>(113,85)=c[10]; M.at<double>(113,86)=c[4]; M.at<double>(113,87)=c[19]; M.at<double>(113,115)=c[9]; M.at<double>(113,116)=c[13]; M.at<double>(113,117)=c[20]; M.at<double>(114,31)=a[13]; M.at<double>(114,32)=a[20]; M.at<double>(114,48)=a[4]; M.at<double>(114,50)=a[19]; M.at<double>(114,58)=b[13]; M.at<double>(114,61)=b[20]; M.at<double>(114,80)=b[19]; M.at<double>(114,81)=b[4]; M.at<double>(114,85)=c[4]; M.at<double>(114,86)=c[19]; M.at<double>(114,115)=c[13]; M.at<double>(114,116)=c[20]; M.at<double>(115,31)=a[20]; M.at<double>(115,48)=a[19]; M.at<double>(115,58)=b[20]; M.at<double>(115,81)=b[19]; M.at<double>(115,85)=c[19]; M.at<double>(115,115)=c[20]; M.at<double>(116,24)=u[2]; M.at<double>(116,29)=a[13]; M.at<double>(116,30)=a[20]; M.at<double>(116,37)=a[11]; M.at<double>(116,38)=a[3]; M.at<double>(116,39)=a[2]; M.at<double>(116,50)=a[15]; M.at<double>(116,52)=a[9]; M.at<double>(116,53)=a[18]; M.at<double>(116,73)=b[9]; M.at<double>(116,74)=b[13]; M.at<double>(116,75)=b[20]; M.at<double>(116,77)=b[11]; M.at<double>(116,78)=b[3]; M.at<double>(116,79)=b[2]; M.at<double>(116,80)=b[15]; M.at<double>(116,82)=b[18]; M.at<double>(116,86)=c[15]; M.at<double>(116,87)=c[18]; M.at<double>(116,92)=c[3]; M.at<double>(116,93)=c[9]; M.at<double>(116,94)=c[13]; M.at<double>(116,96)=c[2]; M.at<double>(116,98)=c[11]; M.at<double>(116,107)=c[20]; M.at<double>(117,29)=a[20]; M.at<double>(117,37)=a[3]; M.at<double>(117,38)=a[2]; M.at<double>(117,48)=a[15]; M.at<double>(117,50)=a[18]; M.at<double>(117,52)=a[13]; M.at<double>(117,73)=b[13]; M.at<double>(117,74)=b[20]; M.at<double>(117,77)=b[3]; M.at<double>(117,78)=b[2]; M.at<double>(117,80)=b[18]; M.at<double>(117,81)=b[15]; M.at<double>(117,85)=c[15]; M.at<double>(117,86)=c[18]; M.at<double>(117,92)=c[2]; M.at<double>(117,93)=c[13]; M.at<double>(117,94)=c[20]; M.at<double>(117,98)=c[3]; M.at<double>(118,27)=a[13]; M.at<double>(118,28)=a[20]; M.at<double>(118,31)=a[4]; M.at<double>(118,32)=a[19]; M.at<double>(118,48)=a[14]; M.at<double>(118,50)=a[8]; M.at<double>(118,55)=b[13]; M.at<double>(118,57)=b[20]; M.at<double>(118,58)=b[4]; M.at<double>(118,61)=b[19]; M.at<double>(118,80)=b[8]; M.at<double>(118,81)=b[14]; M.at<double>(118,85)=c[14]; M.at<double>(118,86)=c[8]; M.at<double>(118,113)=c[13]; M.at<double>(118,114)=c[20]; M.at<double>(118,115)=c[4]; M.at<double>(118,116)=c[19]; M.at<double>(119,27)=a[20]; M.at<double>(119,31)=a[19]; M.at<double>(119,48)=a[8]; M.at<double>(119,55)=b[20]; M.at<double>(119,58)=b[19]; M.at<double>(119,81)=b[8]; M.at<double>(119,85)=c[8]; M.at<double>(119,113)=c[20]; M.at<double>(119,115)=c[19]; return M.t(); } cv::Mat mrpt::vision::pnp::dls::Hessian(const double s[]) { // the vector of monomials is // m = [ const ; s1^2 * s2 ; s1 * s2 ; s1 * s3 ; s2 * s3 ; s2^2 * s3 ; s2^3 ; ... // s1 * s3^2 ; s1 ; s3 ; s2 ; s2 * s3^2 ; s1^2 ; s3^2 ; s2^2 ; s3^3 ; ... // s1 * s2 * s3 ; s1 * s2^2 ; s1^2 * s3 ; s1^3] // // deriv of m w.r.t. s1 //Hs3 = [0 ; 2 * s(1) * s(2) ; s(2) ; s(3) ; 0 ; 0 ; 0 ; ... // s(3)^2 ; 1 ; 0 ; 0 ; 0 ; 2 * s(1) ; 0 ; 0 ; 0 ; ... // s(2) * s(3) ; s(2)^2 ; 2*s(1)*s(3); 3 * s(1)^2]; double Hs1[20]; Hs1[0]=0; Hs1[1]=2*s[0]*s[1]; Hs1[2]=s[1]; Hs1[3]=s[2]; Hs1[4]=0; Hs1[5]=0; Hs1[6]=0; Hs1[7]=s[2]*s[2]; Hs1[8]=1; Hs1[9]=0; Hs1[10]=0; Hs1[11]=0; Hs1[12]=2*s[0]; Hs1[13]=0; Hs1[14]=0; Hs1[15]=0; Hs1[16]=s[1]*s[2]; Hs1[17]=s[1]*s[1]; Hs1[18]=2*s[0]*s[2]; Hs1[19]=3*s[0]*s[0]; // deriv of m w.r.t. s2 //Hs2 = [0 ; s(1)^2 ; s(1) ; 0 ; s(3) ; 2 * s(2) * s(3) ; 3 * s(2)^2 ; ... // 0 ; 0 ; 0 ; 1 ; s(3)^2 ; 0 ; 0 ; 2 * s(2) ; 0 ; ... // s(1) * s(3) ; s(1) * 2 * s(2) ; 0 ; 0]; double Hs2[20]; Hs2[0]=0; Hs2[1]=s[0]*s[0]; Hs2[2]=s[0]; Hs2[3]=0; Hs2[4]=s[2]; Hs2[5]=2*s[1]*s[2]; Hs2[6]=3*s[1]*s[1]; Hs2[7]=0; Hs2[8]=0; Hs2[9]=0; Hs2[10]=1; Hs2[11]=s[2]*s[2]; Hs2[12]=0; Hs2[13]=0; Hs2[14]=2*s[1]; Hs2[15]=0; Hs2[16]=s[0]*s[2]; Hs2[17]=2*s[0]*s[1]; Hs2[18]=0; Hs2[19]=0; // deriv of m w.r.t. s3 //Hs3 = [0 ; 0 ; 0 ; s(1) ; s(2) ; s(2)^2 ; 0 ; ... // s(1) * 2 * s(3) ; 0 ; 1 ; 0 ; s(2) * 2 * s(3) ; 0 ; 2 * s(3) ; 0 ; 3 * s(3)^2 ; ... // s(1) * s(2) ; 0 ; s(1)^2 ; 0]; double Hs3[20]; Hs3[0]=0; Hs3[1]=0; Hs3[2]=0; Hs3[3]=s[0]; Hs3[4]=s[1]; Hs3[5]=s[1]*s[1]; Hs3[6]=0; Hs3[7]=2*s[0]*s[2]; Hs3[8]=0; Hs3[9]=1; Hs3[10]=0; Hs3[11]=2*s[1]*s[2]; Hs3[12]=0; Hs3[13]=2*s[2]; Hs3[14]=0; Hs3[15]=3*s[2]*s[2]; Hs3[16]=s[0]*s[1]; Hs3[17]=0; Hs3[18]=s[0]*s[0]; Hs3[19]=0; // fill Hessian matrix cv::Mat H(3, 3, CV_64F); H.at<double>(0,0) = cv::Mat(cv::Mat(f1coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs1)).at<double>(0,0); H.at<double>(0,1) = cv::Mat(cv::Mat(f1coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs2)).at<double>(0,0); H.at<double>(0,2) = cv::Mat(cv::Mat(f1coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs3)).at<double>(0,0); H.at<double>(1,0) = cv::Mat(cv::Mat(f2coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs1)).at<double>(0,0); H.at<double>(1,1) = cv::Mat(cv::Mat(f2coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs2)).at<double>(0,0); H.at<double>(1,2) = cv::Mat(cv::Mat(f2coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs3)).at<double>(0,0); H.at<double>(2,0) = cv::Mat(cv::Mat(f3coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs1)).at<double>(0,0); H.at<double>(2,1) = cv::Mat(cv::Mat(f3coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs2)).at<double>(0,0); H.at<double>(2,2) = cv::Mat(cv::Mat(f3coeff).rowRange(1,21).t()*cv::Mat(20, 1, CV_64F, &Hs3)).at<double>(0,0); return H; } cv::Mat mrpt::vision::pnp::dls::cayley2rotbar(const cv::Mat& s) { double s_mul1 = cv::Mat(s.t()*s).at<double>(0,0); cv::Mat s_mul2 = s*s.t(); cv::Mat eye = cv::Mat::eye(3, 3, CV_64F); return cv::Mat( eye.mul(1.-s_mul1) + skewsymm(&s).mul(2.) + s_mul2.mul(2.) ).t(); } cv::Mat mrpt::vision::pnp::dls::skewsymm(const cv::Mat * X1) { cv::MatConstIterator_<double> it = X1->begin<double>(); return (cv::Mat_<double>(3,3) << 0, -*(it+2), *(it+1), *(it+2), 0, -*(it+0), -*(it+1), *(it+0), 0); } cv::Mat mrpt::vision::pnp::dls::rotx(const double t) { // rotx: rotation about y-axis double ct = cos(t); double st = sin(t); return (cv::Mat_<double>(3,3) << 1, 0, 0, 0, ct, -st, 0, st, ct); } cv::Mat mrpt::vision::pnp::dls::roty(const double t) { // roty: rotation about y-axis double ct = cos(t); double st = sin(t); return (cv::Mat_<double>(3,3) << ct, 0, st, 0, 1, 0, -st, 0, ct); } cv::Mat mrpt::vision::pnp::dls::rotz(const double t) { // rotz: rotation about y-axis double ct = cos(t); double st = sin(t); return (cv::Mat_<double>(3,3) << ct, -st, 0, st, ct, 0, 0, 0, 1); } cv::Mat mrpt::vision::pnp::dls::mean(const cv::Mat& M) { cv::Mat m = cv::Mat::zeros(3, 1, CV_64F); for (int i = 0; i < M.cols; ++i) m += M.col(i); return m.mul(1./(double)M.cols); } bool mrpt::vision::pnp::dls::is_empty(const cv::Mat * M) { cv::MatConstIterator_<double> it = M->begin<double>(), it_end = M->end<double>(); for(; it != it_end; ++it) { if(*it < 0) return false; } return true; } bool mrpt::vision::pnp::dls::positive_eigenvalues(const cv::Mat * eigenvalues) { cv::MatConstIterator_<double> it = eigenvalues->begin<double>(); return *(it) > 0 && *(it+1) > 0 && *(it+2) > 0; } #endif
eeb3586da7f868503f78544047d163559a3d4140
db016fa9035811a8a984519d9c1e463f78a821d8
/XPU_新生宿舍预约系统/orderFile.h
97a5212ea7a6a91e1e77857da0a88f027f62cadb
[]
no_license
Hanpu1225/XPU_DormitoryOrder
f9de041e05c946548fd8cc2e92d328b44b42cd9e
2f6902fd61d26ae375a1851c5a91f71283d09fd7
refs/heads/master
2023-07-06T04:55:58.786206
2021-08-12T10:31:56
2021-08-12T10:31:56
395,279,543
2
0
null
null
null
null
GB18030
C++
false
false
311
h
#pragma once #include<iostream> using namespace std; #include"title.h" #include<fstream> #include<map> #include<string> class OrderFile { public: OrderFile(); void updateOrder();//更新预约记录 int m_Size;//读取预约记录的条数 map<int, map<string, string>>m_orderData;//条数 键值对 };
6fa9618be97b333530b18e97d3063c3005c861de
91a882547e393d4c4946a6c2c99186b5f72122dd
/Source/XPSP1/NT/base/cluster/mgmt/cluscfg/server/cenumcluscfgmanagedresources.cpp
8bc0186c255a72ffa13e9e3376a78f40532c5a50
[]
no_license
IAmAnubhavSaini/cryptoAlgorithm-nt5src
94f9b46f101b983954ac6e453d0cf8d02aa76fc7
d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2
refs/heads/master
2023-09-02T10:14:14.795579
2021-11-20T13:47:06
2021-11-20T13:47:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
38,539
cpp
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2000-2001 Microsoft Corporation // // Module Name: // CEnumClusCfgManagedResources.cpp // // Description: // This file contains the definition of the CEnumClusCfgManagedResources // class. // // The class CEnumClusCfgManagedResources is the enumeration of cluster // managed devices. It implements the IEnumClusCfgManagedResources // interface. // // Documentation: // // Header File: // CEnumClusCfgManagedResources.h // // Maintained By: // Galen Barbee (GalenB) 23-FEB-2000 // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Include Files ////////////////////////////////////////////////////////////////////////////// #include "pch.h" #include "CEnumClusCfgManagedResources.h" #include "CEnumUnknownQuorum.h" ////////////////////////////////////////////////////////////////////////////// // Constant Definitions ////////////////////////////////////////////////////////////////////////////// DEFINE_THISCLASS( "CEnumClusCfgManagedResources" ); //*************************************************************************// ///////////////////////////////////////////////////////////////////////////// // CEnumClusCfgManagedResources class ///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::S_HrCreateInstance // // Description: // Create a CEnumClusCfgManagedResources instance. // // Arguments: // None. // // Return Values: // Pointer to CEnumClusCfgManagedResources instance. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::S_HrCreateInstance( IUnknown ** ppunkOut ) { TraceFunc( "" ); HRESULT hr; CEnumClusCfgManagedResources * pccsd = NULL; if ( ppunkOut == NULL ) { hr = THR( E_POINTER ); goto Cleanup; } // if: pccsd = new CEnumClusCfgManagedResources(); if ( pccsd == NULL ) { hr = THR( E_OUTOFMEMORY ); goto Cleanup; } // if: error allocating object hr = THR( pccsd->HrInit() ); if ( FAILED( hr ) ) { goto Cleanup; } // if: HrInit() failed hr = THR( pccsd->TypeSafeQI( IUnknown, ppunkOut ) ); Cleanup: if ( FAILED( hr ) ) { LogMsg( L"[SRV] CEnumClusCfgManagedResources::S_HrCreateInstance() failed. (hr = %#08x)", hr ); } // if: if ( pccsd != NULL ) { pccsd->Release(); } // if: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::S_HrCreateInstance ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::CEnumClusCfgManagedResources // // Description: // Constructor of the CEnumClusCfgManagedResources class. This initializes // the m_cRef variable to 1 instead of 0 to account of possible // QueryInterface failure in DllGetClassObject. // // Arguments: // None. // // Return Value: // None. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// CEnumClusCfgManagedResources::CEnumClusCfgManagedResources( void ) : m_cRef( 1 ) , m_lcid( LOCALE_NEUTRAL ) { TraceFunc( "" ); Assert( m_idxNextProvider == 0 ); Assert( m_idxCurrentProvider == 0 ); Assert( m_picccCallback == NULL ); Assert( m_pIWbemServices == NULL ); Assert( m_rgpProviders == NULL ); Assert( m_cTotalResources == 0); Assert( !m_fLoadedDevices ); Assert( m_bstrNodeName == NULL ); // Increment the count of components in memory so the DLL hosting this // object cannot be unloaded. InterlockedIncrement( &g_cObjects ); TraceFuncExit(); } //*** CEnumClusCfgManagedResources::CEnumClusCfgManagedResources ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::~CEnumClusCfgManagedResources // // Description: // Desstructor of the CEnumClusCfgManagedResources class. // // Arguments: // None. // // Return Value: // None. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// CEnumClusCfgManagedResources::~CEnumClusCfgManagedResources( void ) { TraceFunc( "" ); ULONG idx; if ( m_pIWbemServices != NULL ) { m_pIWbemServices->Release(); } // if: if ( m_picccCallback != NULL ) { m_picccCallback->Release(); } // if: for ( idx = 0; idx < m_idxNextProvider; idx++ ) { ((*m_rgpProviders)[ idx ])->Release(); } // for: TraceFree( m_rgpProviders ); TraceSysFreeString( m_bstrNodeName ); // There's going to be one less component in memory. Decrement component count. InterlockedDecrement( &g_cObjects ); TraceFuncExit(); } //*** CEnumClusCfgManagedResources::~CEnumClusCfgManagedResources //*************************************************************************// ///////////////////////////////////////////////////////////////////////////// // CEnumClusCfgManagedResources -- IUknkown interface. ///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //++ // // STDMETHODIMP_( ULONG ) // CEnumClusCfgManagedResources:: [IUNKNOWN] AddRef // // Description: // Increment the reference count of this object by one. // // Arguments: // None. // // Return Value: // The new reference count. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP_( ULONG ) CEnumClusCfgManagedResources::AddRef( void ) { TraceFunc( "[IUnknown]" ); InterlockedIncrement( & m_cRef ); RETURN( m_cRef ); } //*** CEnumClusCfgManagedResources::AddRef ////////////////////////////////////////////////////////////////////////////// //++ // // STDMETHODIMP_( ULONG ) // CEnumClusCfgManagedResources:: [IUNKNOWN] Release // // Description: // Decrement the reference count of this object by one. // // Arguments: // None. // // Return Value: // The new reference count. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP_( ULONG ) CEnumClusCfgManagedResources::Release( void ) { TraceFunc( "[IUnknown]" ); LONG cRef; cRef = InterlockedDecrement( &m_cRef ); if ( cRef == 0 ) { TraceDo( delete this ); } // if: reference count equal to zero RETURN( cRef ); } //*** CEnumClusCfgManagedResources::Release ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources:: [INKNOWN] QueryInterface // // Description: // Query this object for the passed in interface. // // Arguments: // IN REFIID riid, // Id of interface requested. // // OUT void ** ppv // Pointer to the requested interface. // // Return Value: // S_OK // If the interface is available on this object. // // E_NOINTERFACE // If the interface is not available. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::QueryInterface( REFIID riid, void ** ppv ) { TraceQIFunc( riid, ppv ); HRESULT hr = E_NOINTERFACE; if ( IsEqualIID( riid, IID_IUnknown ) ) { *ppv = static_cast< IEnumClusCfgManagedResources * >( this ); hr = S_OK; } // if: IUnknown else if ( IsEqualIID( riid, IID_IEnumClusCfgManagedResources ) ) { *ppv = TraceInterface( __THISCLASS__, IEnumClusCfgManagedResources, this, 0 ); hr = S_OK; } // else if: else if ( IsEqualIID( riid, IID_IClusCfgWbemServices ) ) { *ppv = TraceInterface( __THISCLASS__, IClusCfgWbemServices, this, 0 ); hr = S_OK; } // else if: else if ( IsEqualIID( riid, IID_IClusCfgInitialize ) ) { *ppv = TraceInterface( __THISCLASS__, IClusCfgInitialize, this, 0 ); hr = S_OK; } // else if: if ( SUCCEEDED( hr ) ) { ((IUnknown *) *ppv)->AddRef( ); } // if: success QIRETURN_IGNORESTDMARSHALLING( hr, riid ); } //*** CEnumClusCfgManagedResources::QueryInterface //*************************************************************************// ///////////////////////////////////////////////////////////////////////////// // CEnumClusCfgManagedResources -- IClusCfgWbemServices interface. ///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::SetWbemServices // // Description: // Set the WBEM services provider. // // Arguments: // IN IWbemServices pIWbemServicesIn // // Return Value: // S_OK // Success // // E_POINTER // The pIWbemServicesIn param is NULL. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::SetWbemServices( IWbemServices * pIWbemServicesIn ) { TraceFunc( "[IClusCfgWbemServices]" ); HRESULT hr = S_OK; if ( pIWbemServicesIn == NULL ) { hr = THR( E_POINTER ); STATUS_REPORT( TASKID_Major_Find_Devices, TASKID_Minor_SetWbemServices_Enum_Resources, IDS_ERROR_NULL_POINTER, hr ); goto Cleanup; } // if: m_pIWbemServices = pIWbemServicesIn; m_pIWbemServices->AddRef(); Cleanup: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::SetWbemServices //*************************************************************************// ///////////////////////////////////////////////////////////////////////////// // CEnumClusCfgManagedResources -- IClusCfgInitialize interface. ///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::Initialize // // Description: // Initialize this component. // // Arguments: // IN IUknown * punkCallbackIn // // IN LCID lcidIn // // Return Value: // S_OK // Success // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::Initialize( IUnknown * punkCallbackIn, LCID lcidIn ) { TraceFunc( "[IClusCfgInitialize]" ); Assert( m_picccCallback == NULL ); HRESULT hr = S_OK; m_lcid = lcidIn; if ( punkCallbackIn == NULL ) { hr = THR( E_POINTER ); goto Cleanup; } // if: hr = THR( punkCallbackIn->TypeSafeQI( IClusCfgCallback, &m_picccCallback ) ); Cleanup: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::Initialize //*************************************************************************// ///////////////////////////////////////////////////////////////////////////// // CEnumClusCfgManagedResources -- IEnumClusCfgManagedResources interface. ///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::Next // // Description: // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::Next( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut ) { TraceFunc( "[IEnumClusCfgManagedResources]" ); HRESULT hr; ULONG cFetched = 0; if ( rgpManagedResourceInfoOut == NULL ) { hr = THR( E_POINTER ); STATUS_REPORT( TASKID_Major_Find_Devices, TASKID_Minor_Next_Enum_Resources, IDS_ERROR_NULL_POINTER, hr ); goto Cleanup; } // if: if ( !m_fLoadedDevices ) { hr = THR( HrLoadEnum() ); if ( FAILED( hr ) ) { goto Cleanup; } // if: } // if: hr = STHR( HrDoNext( cNumberRequestedIn, rgpManagedResourceInfoOut, &cFetched ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( pcNumberFetchedOut != NULL ) { *pcNumberFetchedOut = cFetched; } // if: Cleanup: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::Next ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::Skip // // Description: // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::Skip( ULONG cNumberToSkipIn ) { TraceFunc( "[IEnumClusCfgManagedResources]" ); HRESULT hr = S_FALSE; if ( cNumberToSkipIn > 0 ) { hr = STHR( HrDoSkip( cNumberToSkipIn ) ); } // if: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::Skip ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::Reset // // Description: // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::Reset( void ) { TraceFunc( "[IEnumClusCfgManagedResources]" ); HRESULT hr; hr = THR( HrDoReset() ); HRETURN( hr ); } //*** CEnumClusCfgManagedResources::Reset ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::Clone // // Description: // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::Clone( IEnumClusCfgManagedResources ** ppEnumClusCfgManagedResourcesOut ) { TraceFunc( "[IEnumClusCfgManagedResources]" ); HRESULT hr = S_OK; if ( ppEnumClusCfgManagedResourcesOut == NULL ) { hr = THR( E_POINTER ); STATUS_REPORT( TASKID_Major_Find_Devices, TASKID_Minor_Clone_Enum_Resources, IDS_ERROR_NULL_POINTER, hr ); goto Cleanup; } // else: hr = THR( HrDoClone( ppEnumClusCfgManagedResourcesOut ) ); Cleanup: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::Clone ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::Count // // Description: // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// STDMETHODIMP CEnumClusCfgManagedResources::Count( DWORD * pnCountOut ) { TraceFunc( "[IEnumClusCfgManagedResources]" ); HRESULT hr = S_OK; if ( pnCountOut == NULL ) { hr = THR( E_POINTER ); goto Cleanup; } // if: if ( !m_fLoadedDevices ) { hr = THR( HrLoadEnum() ); if ( FAILED( hr ) ) { goto Cleanup; } // if: } // if: *pnCountOut = m_cTotalResources; Cleanup: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::Count //*************************************************************************// ///////////////////////////////////////////////////////////////////////////// // CEnumClusCfgManagedResources class -- Private Methods. ///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::HrInit // // Description: // Initialize this component. // // Arguments: // None. // // Return Value: // // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrInit( void ) { TraceFunc( "" ); HRESULT hr = S_OK; hr = THR( HrGetComputerName( ComputerNameNetBIOS, &m_bstrNodeName ) ); HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrInit ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::HrLoadEnum // // Description: // Load this enumerator. // // Arguments: // None. // // Return Value: // // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrLoadEnum( void ) { TraceFunc( "" ); HRESULT hr; IUnknown * punk = NULL; ICatInformation * pici = NULL; CATID rgCatIds[ 1 ]; IEnumCLSID * pieclsids = NULL; IEnumClusCfgManagedResources * pieccmr = NULL; CLSID clsid; ULONG cFetched; rgCatIds[ 0 ] = CATID_EnumClusCfgManagedResources; hr = THR( CoCreateInstance( CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatInformation, (void **) &pici ) ); if ( FAILED( hr ) ) { goto Cleanup; } hr = THR( pici->EnumClassesOfCategories( 1, rgCatIds, 0, NULL, &pieclsids ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: for ( ; ; ) { hr = STHR( pieclsids->Next( 1, &clsid, &cFetched ) ); if ( FAILED( hr ) ) { break; } // if: if ( ( hr == S_FALSE ) && ( cFetched == 0 ) ) { hr = S_OK; break; } // if: hr = THR( HrCoCreateInternalInstance( clsid, NULL, CLSCTX_SERVER, IID_IEnumClusCfgManagedResources, (void **) &pieccmr ) ); if ( FAILED( hr ) ) { break; } // if: hr = THR( pieccmr->TypeSafeQI( IUnknown, &punk ) ); if ( FAILED( hr ) ) { break; } // if: punk = TraceInterface( L"IEnumClusCfgManagedResources", IUnknown, punk, 1 ); pieccmr->Release(); pieccmr = NULL; hr = STHR( HrInitializeAndSaveProvider( punk ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( hr == S_OK ) { m_fLoadedDevices = TRUE; // there is at least one provider loaded. } // if: punk->Release(); punk = NULL; } // for: hr = STHR( HrLoadUnknownQuorumProvider() ); Cleanup: if ( pieclsids != NULL ) { pieclsids->Release(); } // if: if ( pici != NULL ) { pici->Release(); } // if: if ( pieccmr != NULL ) { pieccmr->Release(); } // if: if ( punk != NULL ) { punk->Release(); } // if: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrLoadEnum ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::HrDoNext // // Description: // Gets the required number of elements from the contained physical disk // and optional 3rd party device enumerations. // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrDoNext( ULONG cNumberRequestedIn, IClusCfgManagedResourceInfo ** rgpManagedResourceInfoOut, ULONG * pcNumberFetchedOut ) { TraceFunc( "" ); HRESULT hr = S_FALSE; IEnumClusCfgManagedResources * peccsd = NULL; ULONG cRequested = cNumberRequestedIn; ULONG cFetched; ULONG cTotal = 0; IClusCfgManagedResourceInfo ** ppccmriTemp = rgpManagedResourceInfoOut; while ( m_idxCurrentProvider < m_idxNextProvider ) { hr = THR( ((*m_rgpProviders)[ m_idxCurrentProvider ])->TypeSafeQI( IEnumClusCfgManagedResources, &peccsd ) ); if ( FAILED( hr ) ) { // // KB: 06 Apr 2000 GalenB // // This failure and the one below are a little trickery in action. If something // fails and we have already retrieved some elements from one, or more, of the enums // it makes sense to change the failure to S_FALSE and return what we have. // This makes cleanup easier since we don't have to reset the enums that have // already given us some elements. Then, if we're called again we should get // the same failure, with no retrieved elements and can simply return the // failure. // if ( cTotal > 0 ) { hr = STHR( S_FALSE ); } // if: goto Cleanup; } // if: hr = STHR( peccsd->Next( cRequested, ppccmriTemp, &cFetched ) ); // // KB: 06 Apr 2000 GalenB // // Release the enum now to make things much easier. It is true that we will most // likely QI twice for each enum, but the effort to optimize this just doesn't // seem worth it. // peccsd->Release(); peccsd = NULL; if ( FAILED( hr ) ) { if ( cTotal > 0 ) { hr = STHR( S_FALSE ); } // if: See KB above... goto Cleanup; } // if: if ( hr == S_OK ) { cTotal += cFetched; // // KB: 06 Apr 2000 GalenB // // We can only return S_OK if the number of elements returned is equal to // the number of elements requested. If the number request is greater than // the number returned then we must return S_FALSE. // Assert( cNumberRequestedIn == cTotal ); *pcNumberFetchedOut = cTotal; break; } // if: if ( hr == S_FALSE ) { // // KB: 06 Apr 2000 GalenB // // The only time that we can be certain that an enumerator is empty is to get S_FALSE // and no elements returned. // if ( cFetched == 0 ) { m_idxCurrentProvider++; continue; } // if: cTotal += cFetched; *pcNumberFetchedOut = cTotal; cRequested -= cFetched; if ( cRequested > 0 ) { ppccmriTemp += cFetched; continue; } // if: Safety check... Ensure that we still need more elements... else { hr = S_FALSE; LOG_STATUS_REPORT1( TASKID_Minor_MREnum_Negative_Item_Count, L"The managed resources enumerator tried to return more items than asked for.", hr ); goto Cleanup; } // else: Should not get here... } // if: // should not get here... hr = S_FALSE; LOG_STATUS_REPORT1( TASKID_Minor_MREnum_Unknown_State, L"The mana b bged resources enumerator encountered an unknown state.", hr ); goto Cleanup; } // while: more providers Cleanup: if ( peccsd != NULL ) { peccsd->Release(); } // if: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrDoNext ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::HrDoSkip // // Description: // Skips the required number of elements in the contained physical disk // and optional 3rd party device enumerations. // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrDoSkip( ULONG cNumberToSkipIn ) { TraceFunc( "" ); HRESULT hr = S_FALSE; IEnumClusCfgManagedResources * peccsd = NULL; ULONG cSkipped = 0; for ( ; m_idxCurrentProvider < m_idxNextProvider; ) { hr = THR( ((*m_rgpProviders)[ m_idxCurrentProvider ])->TypeSafeQI( IEnumClusCfgManagedResources, &peccsd ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: do { hr = STHR( peccsd->Skip( 1 ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( hr == S_FALSE ) { m_idxCurrentProvider++; break; } // if: } while( cNumberToSkipIn >= (++cSkipped) ); peccsd->Release(); peccsd = NULL; if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( cNumberToSkipIn == cSkipped ) { break; } // if: } // for: Cleanup: if ( peccsd != NULL ) { peccsd->Release(); } // if: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrDoSkip ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::HrDoReset // // Description: // Resets the elements in the contained physical disk and optional 3rd // party device enumerations. // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrDoReset( void ) { TraceFunc( "" ); HRESULT hr = S_FALSE; IEnumClusCfgManagedResources * peccsd; ULONG idx; m_idxCurrentProvider = 0; for ( idx = m_idxCurrentProvider; idx < m_idxNextProvider; idx++ ) { hr = THR( ((*m_rgpProviders)[ idx ])->TypeSafeQI( IEnumClusCfgManagedResources, &peccsd ) ); if ( FAILED( hr ) ) { break; } // if: hr = STHR( peccsd->Reset() ); peccsd->Release(); if ( FAILED( hr ) ) { break; } // if: } // for: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrDoReset ////////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources::HrDoClone // // Description: // Clones the elements in the contained physical disk and optional 3rd // party device enumerations. // // Arguments: // // Return Value: // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrDoClone( IEnumClusCfgManagedResources ** ppEnumClusCfgManagedResourcesOut ) { TraceFunc( "" ); HRESULT hr = THR( E_NOTIMPL ); HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrDoClone ///////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources:HrAddToProvidersArray // // Description: // Add the passed in punk to the array of punks that holds the enums. // // Arguments: // // // Return Value: // S_OK // Success // // E_OUTOFMEMORY // Couldn't allocate memeory. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrAddToProvidersArray( IUnknown * punkIn ) { TraceFunc( "" ); HRESULT hr = S_OK; IUnknown * ((*rgpunks)[]) = NULL; IEnumClusCfgManagedResources * pieccmr = NULL; DWORD nAmountToAdd = 0; hr = punkIn->TypeSafeQI( IEnumClusCfgManagedResources, &pieccmr ); if ( FAILED (hr) ) { goto Cleanup; } // if: hr = pieccmr->Count( &nAmountToAdd ); if ( FAILED (hr) ) { goto Cleanup; } // if: rgpunks = (IUnknown *((*)[])) TraceReAlloc( m_rgpProviders, sizeof( IUnknown * ) * ( m_idxNextProvider + 1 ), HEAP_ZERO_MEMORY ); if ( rgpunks == NULL ) { hr = THR( E_OUTOFMEMORY ); STATUS_REPORT( TASKID_Major_Find_Devices, TASKID_Minor_HrAddToProvidersArray, IDS_ERROR_OUTOFMEMORY, hr ); goto Cleanup; } // if: m_rgpProviders = rgpunks; (*m_rgpProviders)[ m_idxNextProvider++ ] = punkIn; punkIn->AddRef(); m_cTotalResources += nAmountToAdd; Cleanup: if ( pieccmr != NULL ) { pieccmr->Release(); } HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrAddToProvidersArray ///////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources:HrLoadUnknownQuorumProvider // // Description: // Since we cannot resonable expect every 3rd party quorum vender // to write a "provider" for their device for this setup wizard // we need a proxy to represent that quorum device. The "unknown" // is just such a proxy. // // Arguments: // None. // // Return Value: // S_OK // Success // // E_OUTOFMEMORY // Couldn't allocate memeory. // // Remarks: // If this node is clustered and we do not find a device that is // already the quorum then we need to make the "unknown" quorum // the quorum device. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrLoadUnknownQuorumProvider( void ) { TraceFunc( "" ); HRESULT hr = S_OK; IUnknown * punk = NULL; BOOL fNeedQuorum = FALSE; BOOL fQuormIsOwnedByThisNode = FALSE; BSTR bstrQuorumResourceName = NULL; hr = STHR( HrIsClusterServiceRunning() ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( hr == S_OK ) { hr = THR( HrIsThereAQuorumDevice() ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( hr == S_FALSE ) { fNeedQuorum = TRUE; } // if: hr = THR( HrGetQuorumResourceName( &bstrQuorumResourceName, &fQuormIsOwnedByThisNode ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: } // if: // // If there was not already a quorum, and if this node owns the quorum resource // then we need the unknown quorum proxy to be set as default to the quorum device. // // If we are not running on a cluster node then both are false and the unknown // quorum proxy will not be set by default to be the quorum. // hr = THR( CEnumUnknownQuorum::S_HrCreateInstance( bstrQuorumResourceName, ( fNeedQuorum && fQuormIsOwnedByThisNode ), &punk ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: hr = THR( HrInitializeAndSaveProvider( punk ) ); Cleanup: if ( punk != NULL ) { punk->Release(); } // if: TraceSysFreeString( bstrQuorumResourceName ); HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrLoadUnknownQuorumProvider ///////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources:HrIsClusterServiceRunning // // Description: // Is this node a member of a cluster and is the serice running? // // Arguments: // None. // // Return Value: // S_OK // The node is clustered and the serivce is running. // // S_FALSE // The node is not clustered, or the serivce is not running. // // Win32 Error // something failed. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrIsClusterServiceRunning( void ) { TraceFunc( "" ); HRESULT hr = S_FALSE; DWORD sc; DWORD dwClusterState; sc = TW32( GetNodeClusterState( NULL, &dwClusterState ) ); if ( sc != ERROR_SUCCESS ) { hr = THR( HRESULT_FROM_WIN32( sc ) ); goto Cleanup; } // if : GetClusterState() failed if ( dwClusterState == ClusterStateRunning ) { hr = S_OK; } // if: Cleanup: HRETURN( hr ); } //*** CEnumClusCfgMana9gedResources::HrIsClusterServiceRunning ///////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources:HrIsThereAQuorumDevice // // Description: // Is there a quorum device in an enum somewhere? // // Arguments: // None. // // Return Value: // S_OK // There is a quorum device. // // S_FALSE // There is not a quorum device. // // Win32 Error // something failed. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrIsThereAQuorumDevice( void ) { TraceFunc( "" ); Assert( m_idxCurrentProvider == 0 ); HRESULT hr = S_OK; IClusCfgManagedResourceInfo * piccmri = NULL; DWORD cFetched; bool fFoundQuorum = false; for ( ; ; ) { hr = STHR( Next( 1, &piccmri, &cFetched ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( ( hr == S_FALSE ) && ( cFetched == 0 ) ) { hr = S_OK; break; } // if: hr = THR( piccmri->IsQuorumDevice() ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( hr == S_OK ) { fFoundQuorum = true; break; } // if: piccmri->Release(); piccmri = NULL; } // for: hr = THR( Reset() ); Cleanup: if ( piccmri != NULL ) { piccmri->Release(); } // if: if ( SUCCEEDED( hr ) ) { if ( fFoundQuorum ) { hr = S_OK; } // if: else { hr = S_FALSE; } // else: } // if: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrIsThereAQuorumDevice ///////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources:HrInitializeAndSaveProvider // // Description: // Initialize the passed in enum and add it to the array of enums. // // Arguments: // // Return Value: // S_OK // Success. // // S_FALSE // The provider was not saved. // // Win32 Error // something failed. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrInitializeAndSaveProvider( IUnknown * punkIn ) { TraceFunc( "" ); HRESULT hr = S_OK; // // KB: 13-JUN-2000 GalenB // // If S_FALSE is returned don't add this to the array. S_FALSE // indicates that this enumerator should not be run now. // hr = STHR( HrSetInitialize( punkIn, m_picccCallback, m_lcid ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: if ( hr == S_FALSE ) { goto Cleanup; } // if: hr = HrSetWbemServices( punkIn, m_pIWbemServices ); if ( FAILED( hr ) ) { goto Cleanup; } // if: hr = THR( HrAddToProvidersArray( punkIn ) ); Cleanup: HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrInitializeAndSaveProvider ///////////////////////////////////////////////////////////////////////////// //++ // // CEnumClusCfgManagedResources:HrGetQuorumResourceName // // Description: // Get the quorum resource name and return whether or not this node // owns the quorum. // // Arguments: // // Return Value: // S_OK // Success. // // Win32 Error // something failed. // // Remarks: // None. // //-- ////////////////////////////////////////////////////////////////////////////// HRESULT CEnumClusCfgManagedResources::HrGetQuorumResourceName( BSTR * pbstrQuorumResourceNameOut , BOOL * pfQuormIsOwnedByThisNodeOut ) { TraceFunc( "" ); Assert( pbstrQuorumResourceNameOut != NULL ); Assert( pfQuormIsOwnedByThisNodeOut != NULL ); HRESULT hr = S_OK; DWORD sc; HCLUSTER hCluster = NULL; BSTR bstrQuorumResourceName = NULL; BSTR bstrNodeName = NULL; HRESOURCE hQuorumResource = NULL; hCluster = OpenCluster( NULL ); if ( hCluster == NULL ) { sc = TW32( GetLastError() ); hr = HRESULT_FROM_WIN32( sc ); goto Cleanup; } // if: hr = THR( HrGetClusterQuorumResource( hCluster, &bstrQuorumResourceName, NULL, NULL ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: hQuorumResource = OpenClusterResource( hCluster, bstrQuorumResourceName ); if ( hQuorumResource == NULL ) { sc = TW32( GetLastError() ); hr = HRESULT_FROM_WIN32( sc ); goto Cleanup; } // if: hr = THR( HrGetClusterResourceState( hQuorumResource, &bstrNodeName, NULL, NULL ) ); if ( FAILED( hr ) ) { goto Cleanup; } // if: // // Give ownership away. // Assert( bstrQuorumResourceName != NULL ); *pbstrQuorumResourceNameOut = bstrQuorumResourceName; bstrQuorumResourceName = NULL; *pfQuormIsOwnedByThisNodeOut = ( _wcsicmp( m_bstrNodeName, bstrNodeName ) == 0 ); Cleanup: if ( hQuorumResource != NULL ) { CloseClusterResource( hQuorumResource ); } // if: if ( hCluster != NULL ) { CloseCluster( hCluster ); } // if: TraceSysFreeString( bstrQuorumResourceName ); TraceSysFreeString( bstrNodeName ); HRETURN( hr ); } //*** CEnumClusCfgManagedResources::HrGetQuorumResourceName
dc998b0d89086f338df9e3767f96d6e6c0d0cf4e
c147d003e5628612bc8f02745b48b8ffea067931
/FakeClick/HID_multithread.cpp
408d0b9a52f815db24c09f41adfc0c1994e79bf5
[ "WTFPL" ]
permissive
ldm0/FakeClick
9024e187c517455d0691b9960f0ad3089bfc004b
8c36b7b31d23a44f1d3e7c428c370f1aa5928c45
refs/heads/master
2020-04-08T05:05:31.443015
2019-05-01T07:09:01
2019-05-01T07:09:01
159,044,831
0
0
null
null
null
null
UTF-8
C++
false
false
2,005
cpp
#include"HID_multithread.h" #include<iostream> using namespace FakeClick; //C style function, so use ExitThread is just fine //No class member is tolerated! DWORD WINAPI FakeClick::main_thread(LPVOID input) { HID &instance = *(HID *)input; //MSG message; for (;;) { // Get the mouse position // For extreme performance and for future multi hit things // don't adapt the get-on-request design any more GetCursorPos(&(instance.mouse_position)); //Check the message to check if specific keys down //int i = PeekMessageW(&message, instance.h_window, 0, 0, PM_NOREMOVE); //std::cout << message.time << std::endl; // Don't use message to get input anymore //instance.w_down = !!(GetKeyState('W') & 0x8000); //instance.a_down = !!(GetKeyState('A') & 0x8000); //instance.s_down = !!(GetKeyState('S') & 0x8000); //instance.d_down = !!(GetKeyState('D') & 0x8000); for (int i = 0; i < instance.key_num; ++i) instance.key_state[i] = GetKeyState(i); Sleep(instance.m_interval); } return 0; } HID::HID(int heartbeat) :m_interval(heartbeat) { for (int i = 0; i < key_num; ++i) key_state[i] = 0; GetCursorPos(&mouse_position); //create a thread to detect the input m_h_main_thread = CreateThread(NULL, 0, main_thread, this, 0, NULL); } HID::~HID() { if (m_h_main_thread) // Yes, I know it's stupid. TerminateThread(m_h_main_thread, 0); } HID & HID::get() { static HID instance; return instance; } bool HID::b_key_down(int virtual_key_code) { if (!!(virtual_key_code & (~(int)0xff))) __debugbreak(); return !!(key_state[virtual_key_code] & 0x8000); } bool HID::b_key_toggle(int virtual_key_code) { if (!!(virtual_key_code & (~(int)0xff))) __debugbreak(); return !!(key_state[virtual_key_code] & 0x1); } POINT HID::get_mouse_position(void) { //GetCursorPos(&mouse_position); return mouse_position; } void HID::get_mouse_position(POINT &position) { //GetCursorPos(&mouse_position); position.x = mouse_position.x; position.y = mouse_position.y; }
dc7195d87ba46ac793d3c9470c6cf56a31b1afcc
3a17418505f5c68564100f03caa789db2e214477
/testCases/Cavity/Galbraith/semi-anal-comparison/cavity_stoich_ideal_CASE/0.047/MG
fe92aca3a9467cd4d32b050b4c72e06eafa57c86
[]
no_license
BJankauskas/mapFoam
2554798c7a4435c90e3f269e84c1c6e6109bb1e7
06200cf3a51da3e9a8d284d9df18f8634964dc1a
refs/heads/master
2020-05-24T16:31:26.833077
2019-05-21T18:40:15
2019-05-21T18:40:15
187,356,603
1
0
null
null
null
null
UTF-8
C++
false
false
1,137
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.047"; object MG; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 2.12818e-05; boundaryField { fixedWalls { type zeroGradient; } frontAndBack { type empty; } movingWall { type zeroGradient; } } // ************************************************************************* //
6b91864cebde40186e632779f16d8457ff48b4c9
fae0a2871c72599835747abcbfe93e18ba8df4df
/articles/endo2.re
dc2f5cae9f19796cfa4ea2e359c9675e7826b5d2
[]
no_license
leeif/bookfest7
452276f525cb27e703cd188cacfc1ed04cb36758
ae6ec64700456441d120739274d410e26da52fc5
refs/heads/master
2020-07-11T16:00:31.872660
2019-08-25T09:34:24
2019-08-25T09:34:24
199,352,199
1
0
null
2019-07-29T00:41:00
2019-07-29T00:41:00
null
UTF-8
C++
false
false
4,199
re
= エンジニアが読む技術書ではない本 == はじめに エンジニアにこそ読んで欲しい本をいくつかご紹介します。エンジニアが技術以外にも地道に担当領域を増やしていくことは非常に有効です。その中で礎となりそうな本を提示させて頂きます。 === 理科系の作文技術 木下 是雄 著, 中公新書@<br>{} まとまった文章の書き方をトレーニングする価値はとても高く、読み書きの基本になると考えています。 この本は構成の基本的なことや文章を書く上で何をすべきかが整理されており、比較的読みやすい内容になっています。レポートや論文が念頭にありますが、仕事でも同じように使えます。 === 本を読む本 J・モーティマー・アドラー V・チャールズ・ドーレン 著, 講談社学術文庫@<br>{} 本を理解するとはどういうことかを論じ、本の読み方を提示してくれる本です。ちょっと面倒な本ではありますが大事な内容です。 === 現代法学入門 伊藤 正己, 加藤 一郎 編, 有斐閣双書@<br>{} 法律とはどのような考えに基づいて作られているのかという、根本的な部分を学ぶことができます。 職種にかかわらず法律知識は多少なりとも勉強が必要になることがあるかと思います、そのときに具体的な法律を学ぶ際の土台となってくれる本です。 == まとめ ジャンルを限定せずに乱読するのは楽しいので、皆さんもぜひ。 == 付録 以下はより細かな話題であったり万人向けではないが、おすすめできる本のピックアップです。 * 数学ガール ** 結城 浩 著, SBクリエイティブ ** 問題にどう取り組むか、その思考の流れが対話により表現されており、とても読みやすい内容になっています。物事の考え方が明確になる楽しさがこの本にはあります。また、この本の参考文献にもあるG. ポリアの「いかにして問題をとくか」も名著です。数学ガールを入り口にこちらも読んで欲しい本です。 * ドラッカー入門―万人のための帝王学を求めて ** 上田 惇生 著, ダイヤモンド社 ** この本でなくても何でもよいのでドラッカーっぽい本。マネジメントを勉強しないといけないという話ではなく、その方法論を知っておくと様々なことがスムーズになります。 * 富の未来 ** A. トフラー, H. トフラー 著, 山岡 洋一 翻訳, 講談社 ** スケールの大きさと先見性のある本。あらゆる知識から1つの道を作り出す様を追えるのが素晴らしく、知識欲みたいなものも掻き立ててくれる。 * はじめてのGTD ストレスフリーの整理術 ** デビッド・アレン 著, 田口 元 監修 監修, 二見書房 ** 自分のタスクに対する考え方の基礎はこの本でした。万人が読む必要のある内容だとは思いませんが、悩んでいる方はこういう本から入るのが良いです。 * 究極の会議 ** 鈴木 健 著, ソフトバンククリエイティブ ** ハウツー本ではありますが、会議の面倒が最も無くなるのがこの本でした。実践のしやすさと会議終了時にやることが明確になるのがよく、応用の幅が広い内容です。会議だけで全てを完結させるという点が気に入っています。 * アイデアの作り方 ** ジェームス W.ヤング 著, 竹内 均 解説, 今井 茂雄 翻訳, CCCメディアハウス ** 思いつきではないアイデアをどうやって作るかが体系的に整理されており、心強い内容です。 * アプリ法務ハンドブック ** 小野 斉大, 鎌田 真理雄, 東條 岳, 橋詰 卓司, 平林 健吾, レクシスネクシス・ジャパン ** アプリに関わる人向け。法律とアプリのつながりを知るために必要なことがきっちり入っています。
eb27c10c85ffd76cc50959183343bb3c8d6c6ca5
03a3c0854af0a0b60024bb2fbd004c94cb7961fa
/videocollection/mpxmyvideoscollection/tsrc/mpxmvcolltest/mediatorevents/inc/VCXMediatorEventWatcher.h
566dd98d97f2c92a4ac74c90c9c511efc9ebd0e5
[]
no_license
SymbianSource/oss.FCL.sf.app.videoplayer
9e131f5bcbc080ea58daa39bc67b74bc233c5675
9a98fb6eaa86d772baf3bf93db2ea3daf59b5e0c
refs/heads/master
2021-01-17T18:01:52.673397
2010-11-04T09:16:56
2010-11-04T09:16:56
70,848,693
0
0
null
null
null
null
UTF-8
C++
false
false
4,375
h
/* * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: * */ #ifndef VCXMEDIATOREVENTWATCHER_H #define VCXMEDIATOREVENTWATCHER_H // INCLUDES #include <e32base.h> #include <mediatoreventconsumer.h> #include "VCXTestMyVideosObserver.h" #include "VCXTestMessageWait.h" // CONSTANTS // MACROS // FORWARD DECLARATIONS class CVCXTestMyVideosCollectionClient; // DATA TYPES // CLASS DECLARATION /** * CVCXMediatorEventWatcher class. * * Looks after mediator events from mpx my videos collection plugin. * Monitoring starts right at creation time. * * KVcxNsMpxEventDownloadStarted * KVcxNsMpxEventDownloadCompleted * KVcxNsMpxEventAllDownloadsEnded * - these are checked with counter, messages from collection client increase * counters and mediator events decrease them. * * KVcxNsMpxEventNewVideosCountDecreased * - checked by refreshing collection and count of new videos. * * * @lib ?library * @since ?Series60_version */ class CVCXMediatorEventWatcher : public CBase, public MVCXTestMyVideosObserver, public MVCXTestMessageWaitObserver, public MMediatorEventObserver { public: // Constructors and destructor /** * Two-phased constructor. */ static CVCXMediatorEventWatcher* NewL(); /** * Destructor. */ ~CVCXMediatorEventWatcher(); public: // Functions from base classes /** * Received when there's change in mpx my videos plugin contents. */ void VideoEventL( TVCXTestVideoEvent aEvent, TUint32 aParam1, TUint32 aParam2, TInt aError ); /** * Callback for message waiter. */ void MessageWaitComplete( TInt aError ); /** * From MMediatorEventObserver * * Catches the events */ void MediatorEventL( TUid aDomain, TUid aCategory, TInt aEventId, const TDesC8& aData ); private: /** * C++ default constructor. */ CVCXMediatorEventWatcher(); /** * By default Symbian 2nd phase constructor is private. */ void ConstructL(); public: // New functions. /** * Adds event that is expected to be received before check. */ void AddExpectedEventL( TInt aEvent ); /** * Leaves if there has been any error with the events. */ void CheckEventsL(); /** * Waits until all expected events have arrived. */ void WaitEventsL( TInt aTimeoutSeconds ); private: /** * Registers and subscribes for mediator event. */ void RegisterAndSubscribeEventL( TInt aEvent ); /** * Deregisters and unsubscribes for all mediator events. */ void UnsubscribeAndDeregisterEvents(); /** * Checks if video count has decreased. */ TBool HasVideoCountDecreased( TBool aForceUpdate ); private: // Data CMediatorEventConsumer* iMediatorEventConsumer; TUid iMediatorDomain; TUid iMediatorCategory; TVersion iMediatorVersion; // Arry of subscribed mediator event IDs. RArray<TInt> iSubscribedEvents; CVCXTestMyVideosCollectionClient* iMyVideosCollectionClient; CVCXTestMessageWait* iVideoMessageWait; CVCXTestMessageWait* iMediatorEventWait; TInt iDownloadStartedEventCount; TInt iDownloadCompletedEventCount; TInt iAllDownloadsCompletedEventCount; TInt iLastNewVideoCount; TBool iNewVideoCountHasDecreased; TInt iError; RArray<TInt> iExpectedEvents; }; #endif // VCXMEDIATOREVENTWATCHER_H // End of File
[ "none@none" ]
none@none
7eda5794bfeb70540e2113513362005c8e3907b0
d932716790743d0e2ae7db7218fa6d24f9bc85dc
/gpu/command_buffer/service/service_discardable_manager_unittest.cc
b09a3596119d09356aa3a6b2e00389457515fcad
[ "BSD-3-Clause" ]
permissive
vade/chromium
c43f0c92fdede38e8a9b858abd4fd7c2bb679d9c
35c8a0b1c1a76210ae000a946a17d8979b7d81eb
refs/heads/Syphon
2023-02-28T00:10:11.977720
2017-05-24T16:38:21
2017-05-24T16:38:21
80,049,719
19
3
null
2017-05-24T19:05:34
2017-01-25T19:31:53
null
UTF-8
C++
false
false
19,407
cc
// Copyright (c) 2017 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 "gpu/command_buffer/service/service_discardable_manager.h" #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" #include "gpu/command_buffer/service/gpu_service_test.h" #include "gpu/command_buffer/service/mailbox_manager.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/mocks.h" #include "gpu/command_buffer/service/test_helper.h" #include "gpu/command_buffer/service/texture_manager.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_image_stub.h" #include "ui/gl/gl_mock.h" #include "ui/gl/gl_switches.h" using ::testing::Pointee; using ::testing::_; using ::testing::Invoke; using ::testing::Mock; using ::testing::InSequence; namespace gpu { namespace gles2 { namespace { void CreateLockedHandlesForTesting( std::unique_ptr<ServiceDiscardableHandle>* service_handle, std::unique_ptr<ClientDiscardableHandle>* client_handle) { std::unique_ptr<base::SharedMemory> shared_mem(new base::SharedMemory); shared_mem->CreateAndMapAnonymous(sizeof(uint32_t)); scoped_refptr<gpu::Buffer> buffer = MakeBufferFromSharedMemory(std::move(shared_mem), sizeof(uint32_t)); client_handle->reset(new ClientDiscardableHandle(buffer, 0, 0)); service_handle->reset(new ServiceDiscardableHandle(buffer, 0, 0)); } ServiceDiscardableHandle CreateLockedServiceHandleForTesting() { std::unique_ptr<ServiceDiscardableHandle> service_handle; std::unique_ptr<ClientDiscardableHandle> client_handle; CreateLockedHandlesForTesting(&service_handle, &client_handle); return *service_handle; } class MockDestructionObserver : public TextureManager::DestructionObserver { public: MOCK_METHOD1(OnTextureManagerDestroying, void(TextureManager* manager)); MOCK_METHOD1(OnTextureRefDestroying, void(TextureRef* ref)); }; // A small texture that should never run up against our limits. static const uint32_t kSmallTextureDim = 16; static const size_t kSmallTextureSize = 4 * kSmallTextureDim * kSmallTextureDim; } // namespace class ServiceDiscardableManagerTest : public GpuServiceTest { public: ServiceDiscardableManagerTest() {} ~ServiceDiscardableManagerTest() override {} protected: void SetUp() override { GpuServiceTest::SetUp(); decoder_.reset(new MockGLES2Decoder()); feature_info_ = new FeatureInfo(); context_group_ = scoped_refptr<ContextGroup>(new ContextGroup( gpu_preferences_, nullptr, nullptr, nullptr, nullptr, feature_info_, false, nullptr, nullptr, GpuFeatureInfo(), &discardable_manager_)); TestHelper::SetupContextGroupInitExpectations( gl_.get(), DisallowedFeatures(), "", "", CONTEXT_TYPE_OPENGLES2, false); context_group_->Initialize(decoder_.get(), CONTEXT_TYPE_OPENGLES2, DisallowedFeatures()); texture_manager_ = context_group_->texture_manager(); texture_manager_->AddObserver(&destruction_observer_); } void TearDown() override { EXPECT_CALL(destruction_observer_, OnTextureManagerDestroying(_)) .RetiresOnSaturation(); // Texture manager will destroy the 6 black/default textures. EXPECT_CALL(*gl_, DeleteTextures(TextureManager::kNumDefaultTextures, _)); context_group_->Destroy(decoder_.get(), true); context_group_ = nullptr; EXPECT_EQ(0u, discardable_manager_.NumCacheEntriesForTesting()); GpuServiceTest::TearDown(); } void ExpectUnlockedTextureDeletion(uint32_t client_id) { TextureRef* ref = discardable_manager_.UnlockedTextureRefForTesting( client_id, texture_manager_); ExpectTextureRefDeletion(ref); } void ExpectTextureDeletion(uint32_t client_id) { TextureRef* ref = texture_manager_->GetTexture(client_id); ExpectTextureRefDeletion(ref); } void ExpectTextureRefDeletion(TextureRef* ref) { EXPECT_NE(nullptr, ref); ref->AddObserver(); EXPECT_CALL(destruction_observer_, OnTextureRefDestroying(ref)) .WillOnce(Invoke([](TextureRef* ref) { ref->RemoveObserver(); })); EXPECT_CALL(*gl_, DeleteTextures(1, Pointee(ref->service_id()))) .RetiresOnSaturation(); } ServiceDiscardableManager discardable_manager_; GpuPreferences gpu_preferences_; scoped_refptr<FeatureInfo> feature_info_; MockDestructionObserver destruction_observer_; TextureManager* texture_manager_; std::unique_ptr<MockGLES2Decoder> decoder_; scoped_refptr<gles2::ContextGroup> context_group_; }; TEST_F(ServiceDiscardableManagerTest, BasicUsage) { const GLuint kClientId = 1; const GLuint kServiceId = 2; // Create and insert a new texture. texture_manager_->CreateTexture(kClientId, kServiceId); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(kClientId, kSmallTextureSize, texture_manager_, handle); EXPECT_EQ(1u, discardable_manager_.NumCacheEntriesForTesting()); EXPECT_TRUE(discardable_manager_.IsEntryLockedForTesting(kClientId, texture_manager_)); EXPECT_NE(nullptr, texture_manager_->GetTexture(kClientId)); // Unlock the texture, ServiceDiscardableManager should take ownership of the // TextureRef. gles2::TextureRef* texture_to_unbind; EXPECT_TRUE(discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_FALSE(discardable_manager_.IsEntryLockedForTesting(kClientId, texture_manager_)); EXPECT_EQ(nullptr, texture_manager_->GetTexture(kClientId)); // Re-lock the texture, the TextureManager should now resume ownership of // the TextureRef. discardable_manager_.LockTexture(kClientId, texture_manager_); EXPECT_NE(nullptr, texture_manager_->GetTexture(kClientId)); // Delete the texture from the TextureManager, it should also be removed from // the ServiceDiscardableManager. ExpectTextureDeletion(kClientId); texture_manager_->RemoveTexture(kClientId); EXPECT_EQ(0u, discardable_manager_.NumCacheEntriesForTesting()); } TEST_F(ServiceDiscardableManagerTest, DeleteAtShutdown) { // Create 8 small textures (which will not hit memory limits), leaving every // other one unlocked. for (int i = 1; i <= 8; ++i) { texture_manager_->CreateTexture(i, i); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(i, kSmallTextureSize, texture_manager_, handle); if (i % 2) { TextureRef* texture_to_unbind; EXPECT_TRUE(discardable_manager_.UnlockTexture(i, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); } } // Expect that all 8 will be deleted at shutdown, regardless of // locked/unlocked state. for (int i = 1; i <= 8; ++i) { if (i % 2) { ExpectUnlockedTextureDeletion(i); } else { ExpectTextureDeletion(i); } } // Let the test shut down, the expectations should be fulfilled. } TEST_F(ServiceDiscardableManagerTest, UnlockInvalid) { const GLuint kClientId = 1; gles2::TextureRef* texture_to_unbind; EXPECT_FALSE(discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind)); EXPECT_EQ(nullptr, texture_to_unbind); } TEST_F(ServiceDiscardableManagerTest, Limits) { // Size textures so that four fit in the discardable manager. const size_t texture_size = ServiceDiscardableManager::kMaxSize / 4; const size_t large_texture_size = 3 * texture_size; // Create 4 textures, this should fill up the discardable cache. for (int i = 1; i < 5; ++i) { texture_manager_->CreateTexture(i, i); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(i, texture_size, texture_manager_, handle); } gles2::TextureRef* texture_to_unbind; EXPECT_TRUE(discardable_manager_.UnlockTexture(3, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.UnlockTexture(1, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.UnlockTexture(2, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.UnlockTexture(4, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); // Allocate four more textures - the previous 4 should be evicted / deleted in // LRU order. { InSequence s; ExpectUnlockedTextureDeletion(3); ExpectUnlockedTextureDeletion(1); ExpectUnlockedTextureDeletion(2); ExpectUnlockedTextureDeletion(4); } for (int i = 5; i < 9; ++i) { texture_manager_->CreateTexture(i, i); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(i, texture_size, texture_manager_, handle); } // Ensure that the above expectations are handled by this point. Mock::VerifyAndClearExpectations(gl_.get()); Mock::VerifyAndClearExpectations(&destruction_observer_); // Unlock the next four textures: EXPECT_TRUE(discardable_manager_.UnlockTexture(5, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.UnlockTexture(6, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.UnlockTexture(8, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.UnlockTexture(7, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); // Allocate one more *large* texture, it should evict the LRU 3 textures. { InSequence s; ExpectUnlockedTextureDeletion(5); ExpectUnlockedTextureDeletion(6); ExpectUnlockedTextureDeletion(8); } texture_manager_->CreateTexture(9, 9); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(9, large_texture_size, texture_manager_, handle); // Expect the two remaining textures to clean up. ExpectTextureDeletion(9); ExpectUnlockedTextureDeletion(7); } TEST_F(ServiceDiscardableManagerTest, TextureSizeChanged) { const GLuint kClientId = 1; const GLuint kServiceId = 2; texture_manager_->CreateTexture(kClientId, kServiceId); TextureRef* texture_ref = texture_manager_->GetTexture(kClientId); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(kClientId, 0, texture_manager_, handle); EXPECT_EQ(0u, discardable_manager_.TotalSizeForTesting()); texture_manager_->SetTarget(texture_ref, GL_TEXTURE_2D); texture_manager_->SetLevelInfo(texture_ref, GL_TEXTURE_2D, 0, GL_RGBA, kSmallTextureDim, kSmallTextureDim, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(kSmallTextureDim, kSmallTextureDim)); EXPECT_EQ(kSmallTextureSize, discardable_manager_.TotalSizeForTesting()); ExpectTextureDeletion(kClientId); } TEST_F(ServiceDiscardableManagerTest, OwnershipOnUnlock) { const GLuint kClientId = 1; const GLuint kServiceId = 2; std::unique_ptr<ServiceDiscardableHandle> service_handle; std::unique_ptr<ClientDiscardableHandle> client_handle; CreateLockedHandlesForTesting(&service_handle, &client_handle); texture_manager_->CreateTexture(kClientId, kServiceId); discardable_manager_.InsertLockedTexture(kClientId, kSmallTextureSize, texture_manager_, *service_handle); // Ensure that the service ref count is used to determine ownership changes. client_handle->Lock(); TextureRef* texture_to_unbind; discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.IsEntryLockedForTesting(kClientId, texture_manager_)); // Get the counts back in sync. discardable_manager_.LockTexture(kClientId, texture_manager_); discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_FALSE(discardable_manager_.IsEntryLockedForTesting(kClientId, texture_manager_)); // Re-lock the texture twice. client_handle->Lock(); discardable_manager_.LockTexture(kClientId, texture_manager_); client_handle->Lock(); discardable_manager_.LockTexture(kClientId, texture_manager_); // Ensure that unlocking once doesn't cause us to unbind the texture. discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind); EXPECT_EQ(nullptr, texture_to_unbind); EXPECT_TRUE(discardable_manager_.IsEntryLockedForTesting(kClientId, texture_manager_)); // The second unlock should unbind/unlock the texture. discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_FALSE(discardable_manager_.IsEntryLockedForTesting(kClientId, texture_manager_)); ExpectUnlockedTextureDeletion(kClientId); } TEST_F(ServiceDiscardableManagerTest, BindGeneratedTextureLock) { const GLuint kClientId = 1; const GLuint kServiceId = 2; const GLuint kGeneratedServiceId = 3; // Create and insert a new texture. texture_manager_->CreateTexture(kClientId, kServiceId); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(kClientId, kSmallTextureSize, texture_manager_, handle); // Unlock the texture, ServiceDiscardableManager should take ownership of the // TextureRef. gles2::TextureRef* texture_to_unbind; EXPECT_TRUE(discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_EQ(nullptr, texture_manager_->GetTexture(kClientId)); // Generate a new texture for the given client id, similar to "bind generates // resource" behavior. texture_manager_->CreateTexture(kClientId, kGeneratedServiceId); TextureRef* generated_texture_ref = texture_manager_->GetTexture(kClientId); // Re-lock the texture, the TextureManager should delete the returned // texture and keep the generated one. ExpectUnlockedTextureDeletion(kClientId); discardable_manager_.LockTexture(kClientId, texture_manager_); EXPECT_EQ(generated_texture_ref, texture_manager_->GetTexture(kClientId)); // Delete the texture from the TextureManager, it should also be removed from // the ServiceDiscardableManager. ExpectTextureDeletion(kClientId); texture_manager_->RemoveTexture(kClientId); EXPECT_EQ(0u, discardable_manager_.NumCacheEntriesForTesting()); } TEST_F(ServiceDiscardableManagerTest, BindGeneratedTextureInitialization) { const GLuint kClientId = 1; const GLuint kServiceId = 2; const GLuint kGeneratedServiceId = 3; // Create and insert a new texture. texture_manager_->CreateTexture(kClientId, kServiceId); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(kClientId, kSmallTextureSize, texture_manager_, handle); // Unlock the texture, ServiceDiscardableManager should take ownership of the // TextureRef. gles2::TextureRef* texture_to_unbind; EXPECT_TRUE(discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_EQ(nullptr, texture_manager_->GetTexture(kClientId)); // Generate a new texture for the given client id, similar to "bind generates // resource" behavior. texture_manager_->CreateTexture(kClientId, kGeneratedServiceId); TextureRef* generated_texture_ref = texture_manager_->GetTexture(kClientId); // Re-initialize the texture, the TextureManager should delete the old // texture and keep the generated one. ExpectUnlockedTextureDeletion(kClientId); discardable_manager_.InsertLockedTexture(kClientId, kSmallTextureSize, texture_manager_, handle); EXPECT_EQ(generated_texture_ref, texture_manager_->GetTexture(kClientId)); ExpectTextureDeletion(kClientId); } TEST_F(ServiceDiscardableManagerTest, BindGeneratedTextureSizeChange) { const GLuint kClientId = 1; const GLuint kServiceId = 2; const GLuint kGeneratedServiceId = 3; // Create and insert a new texture. texture_manager_->CreateTexture(kClientId, kServiceId); auto handle = CreateLockedServiceHandleForTesting(); discardable_manager_.InsertLockedTexture(kClientId, 0, texture_manager_, handle); // Unlock the texture, ServiceDiscardableManager should take ownership of the // TextureRef. gles2::TextureRef* texture_to_unbind; EXPECT_TRUE(discardable_manager_.UnlockTexture(kClientId, texture_manager_, &texture_to_unbind)); EXPECT_NE(nullptr, texture_to_unbind); EXPECT_EQ(nullptr, texture_manager_->GetTexture(kClientId)); // Generate a new texture for the given client id, similar to "bind generates // resource" behavior. texture_manager_->CreateTexture(kClientId, kGeneratedServiceId); TextureRef* generated_texture_ref = texture_manager_->GetTexture(kClientId); // Re-size the generated texture. The tracked size should update. EXPECT_EQ(0u, discardable_manager_.TotalSizeForTesting()); texture_manager_->SetTarget(generated_texture_ref, GL_TEXTURE_2D); texture_manager_->SetLevelInfo(generated_texture_ref, GL_TEXTURE_2D, 0, GL_RGBA, kSmallTextureDim, kSmallTextureDim, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(kSmallTextureDim, kSmallTextureDim)); EXPECT_EQ(kSmallTextureSize, discardable_manager_.TotalSizeForTesting()); ExpectUnlockedTextureDeletion(kClientId); ExpectTextureDeletion(kClientId); } } // namespace gles2 } // namespace gpu
192f86546343000b0095b09e4575778159b1e68c
d1cf34b4d5280e33ebcf1cd788b470372fdd5a26
/leetcode/weekly-309/2341.cpp
6ee02a14b49a5e12737ff6c2124ccb06c0146531
[]
no_license
watashi/AlgoSolution
985916ac511892b7e87f38c9b364069f6b51a0ea
bbbebda189c7e74edb104615f9c493d279e4d186
refs/heads/master
2023-08-17T17:25:10.748003
2023-08-06T04:34:19
2023-08-06T04:34:19
2,525,282
97
32
null
2020-10-09T18:52:29
2011-10-06T10:40:07
C++
UTF-8
C++
false
false
444
cpp
class Solution { public: int longestNiceSubarray(vector<int>& nums) { static constexpr int BITS = 30; int start = 0, ret = 0; vector<int> pos(BITS, -1); for (int i = 0; i < (int)nums.size(); ++i) { for (int j = 0; j < BITS; ++j) { if (((nums[i] >> j) & 1) != 0) { start = max(start, pos[j] + 1); pos[j] = i; } } ret = max(ret, i - start + 1); } return ret; } };
ac4da75e9f1352c93f023047d974addf1b832be1
67b1d96503680b9240e41f5ea9f149f38df7dab7
/kfmanager/kfmanager/kf_msg_data_parse.cpp
eef4de92fe06c0f708de116c45527c6a4be1c95e
[]
no_license
xiaobinxu24/develop
04e47e94031b70bca198a3d1d40223d78112598a
144d7346cf2ed2212f43b8814c2dbb79015441d4
refs/heads/master
2021-01-17T17:51:42.110014
2016-06-27T13:33:17
2016-06-27T13:33:17
62,028,078
0
0
null
null
null
null
UTF-8
C++
false
false
551
cpp
// // Created by v on 16-3-15. // Author: [email protected] // #include <string.h> #include <rt_print.h> #include <cstdlib> #include "kf_msg_data_parse.h" int recvMsgDataParse(char *recvData,KFControlMsg *ctlMsg) { if(!recvData || !ctlMsg ) return -1; char version[64]={0}; char seq[128]={0}; int ret = sscanf(recvData,"%s %s %s %s %s",version,ctlMsg->sender,seq,ctlMsg->cmd,ctlMsg->args); if(ret < 0) { return -2; } ctlMsg->version = atoi(version); ctlMsg->seq = atoi(seq); return 0; }
70578e0dabdf1f6074fbfdddddf6701ac8b60d49
2bdfec46f4725c9c7c0ad54935802d84076ff3e5
/source/core/mining-manager/product-tokenizer/ProductTokenizer.cpp
bfcfe6dbdf5d89fea2ec2febb1bf5d155d46a85d
[ "Apache-2.0" ]
permissive
izenecloud/sf1r-ad-delivery
66f73bc7764216a1faed3d8de0ab3a569b8d4900
998eadb243098446854615de9a96e58a24bd2f4f
refs/heads/master
2021-01-19T14:09:42.842935
2014-09-23T10:41:15
2014-09-23T10:41:15
24,359,409
18
7
null
null
null
null
UTF-8
C++
false
false
4,735
cpp
#include "ProductTokenizer.h" using namespace sf1r; using izenelib::util::UString; namespace { enum CharType { CHAR_CHINESE, ///Chinese CHAR_ALNUM, ///Alphebet and digitals CHAR_INVALID ///Invalid characters }; bool IsChinese(uint16_t val) { return UString::isThisChineseChar(val); } bool IsNonChinese(uint16_t val) { static const uint16_t dash('-'), underline('_'), dot('.'); return UString::isThisAlphaChar(val) || UString::isThisNumericChar(val) || val == dash || val == underline || val == dot; } bool IsValid(uint16_t val) { return IsNonChinese(val) || IsChinese(val); } } bool ProductTokenizer::isProductType_(const izenelib::util::UString& str) { size_t length = str.length(); if (length < 3) return false; for (size_t index = 0; index < length; ++index) { if (!IsNonChinese(str[index])) { return false; } } std::find_if(str.begin(), str.end(), IsNonChinese); return true; } bool ProductTokenizer::getBigramTokens_( const std::list<std::string>& input, std::list<std::pair<izenelib::util::UString, double> >& tokens, double score) { for (std::list<std::string>::const_iterator it = input.begin(); it != input.end(); ++it) { doBigram_(UString(*it, UString::UTF_8), tokens, score); } return !tokens.empty(); } bool ProductTokenizer::getBigramTokens_( const std::list<izenelib::util::UString>& input, std::list<std::pair<izenelib::util::UString, double> >& tokens, double score) { for (std::list<UString>::const_iterator it = input.begin(); it != input.end(); ++it) { doBigram_(*it, tokens, score); } return !tokens.empty(); } void ProductTokenizer::doBigram_( const izenelib::util::UString& pattern, std::list<std::pair<izenelib::util::UString, double> >& tokens, double score) { size_t i, len = pattern.length(); if (len >= 3) { std::vector<std::pair<CharType, size_t> > pos; CharType last_type = CHAR_INVALID; i = 0; while (i < len) { if (IsChinese(pattern[i])) { if (last_type == CHAR_INVALID) { last_type = CHAR_CHINESE; pos.push_back(std::make_pair(CHAR_CHINESE, i)); } else { if (pos.back().first != CHAR_CHINESE) { pos.push_back(std::make_pair(CHAR_ALNUM, i)); pos.push_back(std::make_pair(CHAR_CHINESE, i)); last_type = CHAR_CHINESE; } } ++i; } else if (IsNonChinese(pattern[i])) { if (last_type == CHAR_INVALID) { last_type = CHAR_ALNUM; pos.push_back(std::make_pair(CHAR_ALNUM, i)); } else { if (pos.back().first !=CHAR_ALNUM) { pos.push_back(std::make_pair(CHAR_CHINESE, i)); pos.push_back(std::make_pair(CHAR_ALNUM, i)); last_type = CHAR_ALNUM; } } ++i; } else { if (pos.size() % 2 != 0) { pos.push_back(std::make_pair(pos.back().first, i)); last_type = CHAR_INVALID; } do { ++i; } while (!IsValid(pattern[i]) && i < len); } } if (pos.size() % 2 != 0) { pos.push_back(std::make_pair(pos.back().first, len)); } size_t start, end; for (size_t i = 0; i < pos.size(); i += 2) { start = pos[i].second; end = pos[i + 1].second; if (pos[i].first == CHAR_CHINESE) { if (end - start > 1) { for (size_t i = start; i < end - 1; ++i) { tokens.push_back(std::make_pair(pattern.substr(i, 2), score)); } } else tokens.push_back(std::make_pair(pattern.substr(start, 1), score)); } else { tokens.push_back(std::make_pair(pattern.substr(start, end - start), score)); } } } else { tokens.push_back(std::make_pair(pattern, score)); } }
425c875c76a2995fff7f6a80889b14145493734d
7e77d30a5dec41b677f504af35b26896d0a5899f
/CardInformationExtracter.h
aa83d2e2ef4a039ef5c8558773522af1ad225473
[]
no_license
georgistephanov/yReceiptsPCC
c34e971196c1c7ec5cf5cecbfcc883d74f119b9a
8573ce12b201561599a78c34cb41b7bc97bbc45c
refs/heads/master
2020-03-09T21:37:50.539665
2018-04-12T11:01:01
2018-04-12T11:01:01
128,981,917
0
0
null
null
null
null
UTF-8
C++
false
false
693
h
#pragma once #ifndef CARD_INFORMATION_EXTRACTER_H #define CARD_INFORMATION_EXTRACTER_H class CardInformationExtracter { public: CardInformationExtracter(std::string); const std::string extractCardType() const; const std::string extractTrailingDigits() const; const std::string extractExpiryDate() const; private: std::string cardInformation; std::string expiryDateRegex = "\\b\\d\\d/\\d\\d\\b"; std::string accountNumberRegex = "[x*]{7,}(\\d{4})"; std::string cardTypes[2] = { "mastercard", "visa" }; inline void lowercaseString(std::string& cardInformation) { std::transform(cardInformation.begin(), cardInformation.end(), cardInformation.begin(), ::tolower); } }; #endif
1b6668332ad72bacf7968f6f916985ca31b10f9f
b269392cc4727b226e15b3f08e9efb41a7f4b048
/CodeForces/CodeForces 1029E.cpp
609f5ee734b67b4edfcf88f9639907d08e51d969
[]
no_license
ThoseBygones/ACM_Code
edbc31b95077e75d3b17277d843cc24b6223cc0c
2e8afd599b8065ae52b925653f6ea79c51a1818f
refs/heads/master
2022-11-12T08:23:55.232349
2022-10-30T14:17:23
2022-10-30T14:17:23
91,112,483
1
0
null
null
null
null
UTF-8
C++
false
false
2,100
cpp
/* ******************************************************************************** * Author: ThoseBygones * Version: V1.0 * Date: 2019-01-11 * Subject: ACM-ICPC * Language: C/C++11 * OJ: CodeForces * Algorithm: ******************************************************************************** * Algo-Description: ******************************************************************************** */ #include <bits/stdc++.h> //For CodeForces only using namespace std; template<class T> inline T sqr(T x) { return x * x; } typedef long long LL; typedef unsigned long long ULL; typedef long double LD; typedef pair<int, int> PII; typedef pair<PII, int> PIII; typedef pair<LL, LL> PLL; typedef pair<LL, int> PLI; typedef pair<LD, LD> PDD; #define MP make_pair #define PB push_back #define sz(x) ((int)(x).size()) #define clr(ar,val) memset(ar, val, sizeof(ar)) #define istr stringstream #define FOR(i,n) for(int i=0;i<(n);++i) #define forIt(mp,it) for(__typeof(mp.begin()) it = mp.begin();it!=mp.end();it++) const double EPS = 1e-6; const int INF = 0x3fffffff; const LL LINF = INF * 1ll * INF; const double PI = acos(-1.0); #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define lowbit(u) (u&(-u)) #define MAXN 200005 vector<int> g[MAXN]; int d[MAXN]; int ans; void dfs(int u,int fa,int dep) { bool modify = false; //该结点是否与根结点连边(最多连一条边) d[u] = dep; for(int i = 0; i < g[u].size(); i++) { int v = g[u][i]; if(v != fa) { dfs(v,u,dep+1); if(d[v] > 2) //如果叶结点深度大于2 { modify = true; d[u] = 1; //叶结点的父结点与根连边 d[fa] = min(d[fa],2); //更新其父节点到根结点1的距离 } } } if(modify) ans++; } int main() { int n; scanf("%d",&n); for(int i = 1; i < n; i++) { int u,v; scanf("%d%d",&u,&v); g[u].PB(v); g[v].PB(u); } dfs(1,0,0); printf("%d\n",ans); return 0; }
dbafbbe24bf70cb390356d97b2566acaf38c2788
b7f3edb5b7c62174bed808079c3b21fb9ea51d52
/chrome/browser/ui/views/page_info/page_info_hover_button.cc
d7ebcb58b41c5cf85f496e038ce638f632f97c14
[ "BSD-3-Clause" ]
permissive
otcshare/chromium-src
26a7372773b53b236784c51677c566dc0ad839e4
64bee65c921db7e78e25d08f1e98da2668b57be5
refs/heads/webml
2023-03-21T03:20:15.377034
2020-11-16T01:40:14
2020-11-16T01:40:14
209,262,645
18
21
BSD-3-Clause
2023-03-23T06:20:07
2019-09-18T08:52:07
null
UTF-8
C++
false
false
6,516
cc
// Copyright 2019 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 "chrome/browser/ui/views/page_info/page_info_hover_button.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/views/accessibility/non_accessible_image_view.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/chrome_typography.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/style/typography.h" PageInfoHoverButton::PageInfoHoverButton(views::ButtonListener* listener, const gfx::ImageSkia& image_icon, int title_resource_id, const base::string16& secondary_text, int click_target_id, const base::string16& tooltip_text, const base::string16& subtitle_text) : HoverButton(listener, base::string16()) { label()->SetHandlesTooltips(false); auto icon = std::make_unique<NonAccessibleImageView>(); icon->SetImage(image_icon); ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get(); views::GridLayout* grid_layout = SetLayoutManager(std::make_unique<views::GridLayout>()); const int icon_label_spacing = layout_provider->GetDistanceMetric( views::DISTANCE_RELATED_LABEL_HORIZONTAL); constexpr int kColumnSetId = 0; views::ColumnSet* columns = grid_layout->AddColumnSet(kColumnSetId); columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, views::GridLayout::kFixedSize, views::GridLayout::ColumnSize::kUsePreferred, 0, 0); columns->AddPaddingColumn(views::GridLayout::kFixedSize, icon_label_spacing); columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1.0, views::GridLayout::ColumnSize::kUsePreferred, 0, 0); // Make sure hovering over the icon also hovers the |PageInfoHoverButton|. icon->set_can_process_events_within_subtree(false); // Don't cover |icon_view| when the ink drops are being painted. icon->SetPaintToLayer(); icon->layer()->SetFillsBoundsOpaquely(false); // Force row to have sufficient height for full line-height of the title. grid_layout->StartRow( views::GridLayout::kFixedSize, kColumnSetId, views::style::GetLineHeight(views::style::CONTEXT_LABEL, views::style::STYLE_PRIMARY)); icon_view_ = grid_layout->AddView(std::move(icon)); auto title_label = std::make_unique<views::StyledLabel>(base::string16(), nullptr); title_label->SetTextContext(views::style::CONTEXT_LABEL); // |views::StyledLabel|s are all multi-line. With a layout manager, // |StyledLabel| will try use the available space to size itself, and long // titles will wrap to the next line (for smaller |PageInfoHoverButton|s, this // will also cover up |subtitle_|). Wrap it in a parent view with no layout // manager to ensure it keeps its original size set by SizeToFit() above. Long // titles will then be truncated. auto title_wrapper = std::make_unique<views::View>(); title_ = title_wrapper->AddChildView(std::move(title_label)); SetTitleText(title_resource_id, secondary_text); // Hover the whole button when hovering |title_|. This is OK because |title_| // will never have a link in it. title_wrapper->set_can_process_events_within_subtree(false); grid_layout->AddView(std::move(title_wrapper)); if (!subtitle_text.empty()) { grid_layout->StartRow(views::GridLayout::kFixedSize, kColumnSetId); auto subtitle_label = std::make_unique<views::Label>( subtitle_text, views::style::CONTEXT_LABEL, views::style::STYLE_SECONDARY); subtitle_label->SetMultiLine(true); subtitle_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); subtitle_label->SetAutoColorReadabilityEnabled(false); grid_layout->SkipColumns(1); subtitle_ = grid_layout->AddView(std::move(subtitle_label)); } auto insets = layout_provider->GetInsetsMetric( views::InsetsMetric::INSETS_LABEL_BUTTON); const int vert_spacing = insets.height(); const int horz_spacing = ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_BUTTON_HORIZONTAL_PADDING); SetBorder(views::CreateEmptyBorder(vert_spacing, horz_spacing, vert_spacing, horz_spacing)); SetID(click_target_id); SetTooltipText(tooltip_text); UpdateAccessibleName(); Layout(); } void PageInfoHoverButton::SetTitleText(int title_resource_id, const base::string16& secondary_text) { DCHECK(title_); if (secondary_text.empty()) { title_->SetText(l10n_util::GetStringUTF16(title_resource_id)); } else { size_t offset; auto title_text = l10n_util::GetStringFUTF16(title_resource_id, secondary_text, &offset); title_->SetText(title_text); views::StyledLabel::RangeStyleInfo style_info; style_info.text_style = views::style::STYLE_SECONDARY; title_->AddStyleRange(gfx::Range(offset, offset + secondary_text.length()), style_info); } title_->SizeToFit(0); UpdateAccessibleName(); } void PageInfoHoverButton::UpdateAccessibleName() { const base::string16 accessible_name = subtitle() == nullptr ? title()->GetText() : base::JoinString({title()->GetText(), subtitle()->GetText()}, base::ASCIIToUTF16("\n")); HoverButton::SetAccessibleName(accessible_name); } gfx::Size PageInfoHoverButton::CalculatePreferredSize() const { return Button::CalculatePreferredSize(); } int PageInfoHoverButton::GetHeightForWidth(int w) const { return Button::GetHeightForWidth(w); } void PageInfoHoverButton::OnBoundsChanged(const gfx::Rect& previous_bounds) { return Button::OnBoundsChanged(previous_bounds); } views::View* PageInfoHoverButton::GetTooltipHandlerForPoint( const gfx::Point& point) { return Button::GetTooltipHandlerForPoint(point); } BEGIN_METADATA(PageInfoHoverButton) METADATA_PARENT_CLASS(HoverButton) END_METADATA()
f8d4ba882dfe536534f28a4debde7535cd452cb5
f7854894a694e1d8b9d1f7a3b8cdf03eab1267dd
/CppCli-WPF-App/Window.cpp
426e082e5816a4db10bbc47781707fe765a1f252
[]
no_license
krgujara/RemoteCodePublisher
2f6b5374381e32bd345502dd6a2f36727113bc0b
699dfd2c91e5c9c0486143561da331a48134f410
refs/heads/master
2021-05-04T20:50:12.401360
2018-02-01T13:28:48
2018-02-01T13:28:48
119,838,902
0
0
null
null
null
null
UTF-8
C++
false
false
11,158
cpp
/////////////////////////////////////////////////////////////////////////// // Window.cpp - C++\CLI implementation of WPF Application // // - Demo for CSE 687 Project #4 // // ver 2.0 // // Jim Fawcett, CSE687 - Object Oriented Design, Spring 2015 // /////////////////////////////////////////////////////////////////////////// /* * To run as a Windows Application: * - Set Project Properties > Linker > System > Subsystem to Windows * - Comment out int main(...) at bottom * - Uncomment int _stdcall WinMain() at bottom * To run as a Console Application: * - Set Project Properties > Linker > System > Subsytem to Console * - Uncomment int main(...) at bottom * - Comment out int _stdcall WinMain() at bottom */ #include "Window.h" using namespace CppCliWindows; WPFCppCliDemo::WPFCppCliDemo() { // set up channel ObjectFactory* pObjFact = new ObjectFactory; //pSendr_ = pObjFact->createSendr(); //pRecvr_ = pObjFact->createRecvr(); pChann_ = pObjFact->createMockChannel("localhost", 8081); pChann_->start(); delete pObjFact; // client's receive thread recvThread = gcnew Thread(gcnew ThreadStart(this, &WPFCppCliDemo::getMessage)); recvThread->Start(); // set event handlers this->Loaded += gcnew System::Windows::RoutedEventHandler(this, &WPFCppCliDemo::OnLoaded); this->Closing += gcnew CancelEventHandler(this, &WPFCppCliDemo::Unloading); hSendButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::sendMessage); hClearButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::clear); hFolderBrowseButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::browseForFolder); hShowItemsButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::getItemsFromList); hCheckinItemsButton->Click += gcnew RoutedEventHandler(this, &WPFCppCliDemo::checkinItemsFromList); // set Window properties this->Title = "WPF C++/CLI Demo"; this->Width = 800; this->Height = 600; // attach dock panel to Window this->Content = hDockPanel; hDockPanel->Children->Add(hStatusBar); hDockPanel->SetDock(hStatusBar, Dock::Bottom); hDockPanel->Children->Add(hGrid); // setup Window controls and views setUpTabControl(); setUpStatusBar(); setUpSendMessageView(); setUpFileListView(); setUpConnectionView(); } WPFCppCliDemo::~WPFCppCliDemo() { delete pChann_; //delete pSendr_; //delete pRecvr_; } void WPFCppCliDemo::setUpStatusBar() { hStatusBar->Items->Add(hStatusBarItem); hStatus->Text = "very important messages will appear here"; //status->FontWeight = FontWeights::Bold; hStatusBarItem->Content = hStatus; hStatusBar->Padding = Thickness(10, 2, 10, 2); } void WPFCppCliDemo::setUpTabControl() { hGrid->Children->Add(hTabControl); hSendMessageTab->Header = "Send Message"; hFileListTab->Header = "File List"; hConnectTab->Header = "Connect"; hTabControl->Items->Add(hSendMessageTab); hTabControl->Items->Add(hFileListTab); hTabControl->Items->Add(hConnectTab); } void WPFCppCliDemo::setTextBlockProperties() { RowDefinition^ hRow1Def = gcnew RowDefinition(); hSendMessageGrid->RowDefinitions->Add(hRow1Def); Border^ hBorder1 = gcnew Border(); hBorder1->BorderThickness = Thickness(1); hBorder1->BorderBrush = Brushes::Black; hBorder1->Child = hTextBlock1; hTextBlock1->Padding = Thickness(15); hTextBlock1->Text = ""; hTextBlock1->FontFamily = gcnew Windows::Media::FontFamily("Tahoma"); hTextBlock1->FontWeight = FontWeights::Bold; hTextBlock1->FontSize = 16; hScrollViewer1->VerticalScrollBarVisibility = ScrollBarVisibility::Auto; hScrollViewer1->Content = hBorder1; hSendMessageGrid->SetRow(hScrollViewer1, 0); hSendMessageGrid->Children->Add(hScrollViewer1); } void WPFCppCliDemo::setButtonsProperties() { RowDefinition^ hRow2Def = gcnew RowDefinition(); hRow2Def->Height = GridLength(75); hSendMessageGrid->RowDefinitions->Add(hRow2Def); hSendButton->Content = "Send Message"; Border^ hBorder2 = gcnew Border(); hBorder2->Width = 120; hBorder2->Height = 30; hBorder2->BorderThickness = Thickness(1); hBorder2->BorderBrush = Brushes::Black; hClearButton->Content = "Clear"; hBorder2->Child = hSendButton; Border^ hBorder3 = gcnew Border(); hBorder3->Width = 120; hBorder3->Height = 30; hBorder3->BorderThickness = Thickness(1); hBorder3->BorderBrush = Brushes::Black; hBorder3->Child = hClearButton; hStackPanel1->Children->Add(hBorder2); TextBlock^ hSpacer = gcnew TextBlock(); hSpacer->Width = 10; hStackPanel1->Children->Add(hSpacer); hStackPanel1->Children->Add(hBorder3); hStackPanel1->Orientation = Orientation::Horizontal; hStackPanel1->HorizontalAlignment = System::Windows::HorizontalAlignment::Center; hSendMessageGrid->SetRow(hStackPanel1, 1); hSendMessageGrid->Children->Add(hStackPanel1); } void WPFCppCliDemo::setUpSendMessageView() { Console::Write("\n setting up sendMessage view"); hSendMessageGrid->Margin = Thickness(20); hSendMessageTab->Content = hSendMessageGrid; setTextBlockProperties(); setButtonsProperties(); } std::string WPFCppCliDemo::toStdString(String^ pStr) { std::string dst; for (int i = 0; i < pStr->Length; ++i) dst += (char)pStr[i]; return dst; } void WPFCppCliDemo::sendMessage(Object^ obj, RoutedEventArgs^ args) { Console::Write("\n sent message"); hStatus->Text = "Message Sent"; pChann_->postMessage("SENDMESSAGE", toStdString(msgText)); } String^ WPFCppCliDemo::toSystemString(std::string& str) { StringBuilder^ pStr = gcnew StringBuilder(); for (size_t i = 0; i < str.size(); ++i) pStr->Append((Char)str[i]); return pStr->ToString(); } void WPFCppCliDemo::addText(String^ msg) { hTextBlock1->Text += msg + "\n\n"; } void WPFCppCliDemo::getMessage() { // recvThread runs this function while (true) { std::cout << "\n receive thread calling getMessage()"; std::string msg = pChann_->getMessage(); String^ sMsg = toSystemString(msg); array<String^>^ args = gcnew array<String^>(1); args[0] = sMsg; Action<String^>^ act = gcnew Action<String^>(this, &WPFCppCliDemo::addText); Dispatcher->Invoke(act, args); // must call addText on main UI thread } } void WPFCppCliDemo::clear(Object^ sender, RoutedEventArgs^ args) { Console::Write("\n cleared message text"); hStatus->Text = "Cleared message"; hTextBlock1->Text = ""; } void WPFCppCliDemo::getItemsFromList(Object^ sender, RoutedEventArgs^ args) { int index = 0; int count = hListBox->SelectedItems->Count; hStatus->Text = "Show Selected Items"; array<System::String^>^ items = gcnew array<String^>(count); if (count > 0) { for each (String^ item in hListBox->SelectedItems) { items[index++] = item; //pChann_->postMessage("CHECKIN","Send Message"+toStdString(item)); /////////////// } } hListBox->Items->Clear(); if (count > 0) { for each (String^ item in items) { hListBox->Items->Add(item); } } } void WPFCppCliDemo::checkinItemsFromList(Object^ sender, RoutedEventArgs^ args) { int index = 0; //hListBox->Items->Count int count = hListBox->Items->Count; hStatus->Text = "Checkin Selected Items"; array<System::String^>^ items = gcnew array<String^>(count); if (count > 0) { for each (String^ item in hListBox->SelectedItems) { items[index++] = item; //pChann_->postMessage("CHECKIN", "Send Message" + toStdString(item)); /////////////// } } StringBuilder^ sbuild = gcnew StringBuilder(); //hListBox->Items->Clear(); if (count > 0) { for each (String^ item in items) { //check if the item selected is .cpp / .h // hListBox->Items->Add(item); sbuild->Append(item); sbuild->Append(","); } } else //sbuild->Append("empty"); pChann_->postMessage("CHECKIN", toStdString(sbuild->ToString())); } void WPFCppCliDemo::setUpFileListView() { Console::Write("\n setting up FileList view"); hFileListGrid->Margin = Thickness(20); hFileListTab->Content = hFileListGrid; RowDefinition^ hRow1Def = gcnew RowDefinition(); //hRow1Def->Height = GridLength(75); hFileListGrid->RowDefinitions->Add(hRow1Def); Border^ hBorder1 = gcnew Border(); hBorder1->BorderThickness = Thickness(1); hBorder1->BorderBrush = Brushes::Black; hListBox->SelectionMode = SelectionMode::Multiple; hBorder1->Child = hListBox; hFileListGrid->SetRow(hBorder1, 0); hFileListGrid->Children->Add(hBorder1); RowDefinition^ hRow2Def = gcnew RowDefinition(); hRow2Def->Height = GridLength(75); RowDefinition^ hRow2Def2 = gcnew RowDefinition(); hRow2Def2->Height = GridLength(75); hFileListGrid->RowDefinitions->Add(hRow2Def); hFileListGrid->RowDefinitions->Add(hRow2Def2); hFolderBrowseButton->Content = "Select Directory"; hFolderBrowseButton->Height = 30; hFolderBrowseButton->Width = 120; hFolderBrowseButton->BorderThickness = Thickness(2); hFolderBrowseButton->BorderBrush = Brushes::Black; hFileListGrid->SetRow(hFolderBrowseButton, 1); hFileListGrid->Children->Add(hFolderBrowseButton); // Show selected items button. hShowItemsButton->Content = "Show Selected Items"; hShowItemsButton->Height = 30; hShowItemsButton->Width = 120; hShowItemsButton->BorderThickness = Thickness(2); hShowItemsButton->BorderBrush = Brushes::Black; hFileListGrid->SetRow(hShowItemsButton, 2); hFileListGrid->Children->Add(hShowItemsButton); // Show checkin button hCheckinItemsButton->Content = "Checkin Items"; hCheckinItemsButton->Height = 30; hCheckinItemsButton->Width = 120; hCheckinItemsButton->BorderThickness = Thickness(2); hCheckinItemsButton->BorderBrush = Brushes::Black; hFileListGrid->SetRow(hCheckinItemsButton, 5); //hFileListGrid->SetColumn(hCheckinItemsButton,2); hFileListGrid->Children->Add(hCheckinItemsButton); hFolderBrowserDialog->ShowNewFolderButton = false; hFolderBrowserDialog->SelectedPath = System::IO::Directory::GetCurrentDirectory(); } void WPFCppCliDemo::browseForFolder(Object^ sender, RoutedEventArgs^ args) { std::cout << "\n Browsing for folder"; hListBox->Items->Clear(); System::Windows::Forms::DialogResult result; result = hFolderBrowserDialog->ShowDialog(); if (result == System::Windows::Forms::DialogResult::OK) { String^ path = hFolderBrowserDialog->SelectedPath; std::cout << "\n opening folder \"" << toStdString(path) << "\""; array<String^>^ files = System::IO::Directory::GetFiles(path, L"*.*"); for (int i = 0; i < files->Length; ++i) hListBox->Items->Add(files[i]); array<String^>^ dirs = System::IO::Directory::GetDirectories(path); for (int i = 0; i < dirs->Length; ++i) hListBox->Items->Add(L"<> " + dirs[i]); } } void WPFCppCliDemo::setUpConnectionView() { Console::Write("\n setting up Connection view"); } void WPFCppCliDemo::OnLoaded(Object^ sender, RoutedEventArgs^ args) { Console::Write("\n Window loaded"); } void WPFCppCliDemo::Unloading(Object^ sender, System::ComponentModel::CancelEventArgs^ args) { Console::Write("\n Window closing"); } [STAThread] //int _stdcall WinMain() int main(array<System::String^>^ args) { Console::WriteLine(L"\n Starting WPFCppCliDemo"); Application^ app = gcnew Application(); app->Run(gcnew WPFCppCliDemo()); Console::WriteLine(L"\n\n"); }
eda349029ca3049f61c432e05fdc2b9e1fdc9c58
8c90e0ffb2819653c566aa7894e73b2726fb3640
/dokushu/chapter1/list1-2.cpp
5bdc090834186379a923fc633cb014dcfdd8cef4
[]
no_license
Tetta8/CPP_test
f842390ad60a0aeb259240910d12d1b273ce58ed
a4692aae32bbc6bfce2af61567a9fa0575e47fe0
refs/heads/master
2021-01-04T17:20:09.526885
2020-09-17T05:09:19
2020-09-17T05:09:19
240,681,912
0
0
null
null
null
null
UTF-8
C++
false
false
241
cpp
#include <iostream> void hello_world(){ std::cout << "Hello, world" << std::endl; } void show_sum(int a, int b){ int c = a + b; std::cout << c << std::endl; } int main(){ hello_world(); show_sum(1, 2); }
75261aaab7be6ce56943caf424f8cfa0430b3ed7
059af5d220bd922a13285066c35f4e734eb99003
/FileStream.cpp
082edf87a40639f8983d9d08452565344309e236
[ "MIT" ]
permissive
gru2/GVal
7c4eecad543801ca2da476e9cb62e5e265a81295
51044c2f3e011093b3a8bf46b447eefa0a5dce3b
refs/heads/master
2020-09-16T09:03:38.588343
2020-08-27T07:46:22
2020-08-27T07:46:22
67,791,874
0
1
null
null
null
null
UTF-8
C++
false
false
1,729
cpp
#include <FileStream.h> FileStream::FileStream() { mode = READ_MODE; file = 0; position = 0; fileSize = 0; } FileStream::FileStream(const std::string &fileName, FileStream::ModeType mode_) { mode = READ_MODE; file = 0; position = 0; fileSize = 0; open(fileName, mode_); } FileStream::~FileStream() { close(); } void FileStream::open(const std::string &fileName, ModeType mode_) { close(); mode = mode_; if (mode == READ_MODE) { file = fopen(fileName.c_str(), "rb"); if (file == 0) { progressReporter.error("unable to open file '" + fileName +"' for reading."); return; } fileSize = getFileSize(); position = 0; return; } if (mode == WRITE_MODE) { file = fopen(fileName.c_str(), "wb"); if (file == 0) { progressReporter.error("unable to open file '" + fileName +"' for writing."); return; } fileSize = 0; position = 0; return; } progressReporter.error("FileStream::open:Internal error."); } void FileStream::close() { if (file) { fclose(file); mode = READ_MODE; file = 0; position = 0; fileSize = 0; } } size_t FileStream::getFileSize() { size_t oldPosition = (size_t)ftell(file); fseek(file, 0L, SEEK_END); size_t fs = (size_t)ftell(file); fseek(file, (long)oldPosition, SEEK_SET); return fs; } void FileStream::writeBytes(size_t size, const char *buffer) { position += size; fwrite(buffer, 1, size, file); } void FileStream::readBytes(size_t size, char *buffer) { position += size; fread(buffer, 1, size, file); } bool FileStream::check() { if (file == 0) return false; if (mode == READ_MODE && position > fileSize) return false; return true; } bool FileStream::atEnd() { if (position < fileSize) return false; return true; }
221d8cd88916cfe7f6b33f1b3cc5d12dd95ad079
d9f6f1bb216cc9ba148aa78ef9885c1e43fd52df
/services/media/audio/platform/generic/standard_output_base.h
fe3205a9a77901777c208781a7da46769c153f3f
[ "BSD-3-Clause" ]
permissive
blockspacer/mojo-1
b15dbee5e245d21d4f6d885d7ede273dfe5c6771
4d2ed40dc2390ca98a6fea0580e840535878f11c
refs/heads/master
2021-05-31T10:41:27.279861
2016-01-28T18:47:45
2016-01-28T18:47:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,967
h
// Copyright 2015 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 SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_STANDARD_OUTPUT_BASE_H_ #define SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_STANDARD_OUTPUT_BASE_H_ #include "base/callback.h" #include "mojo/services/media/common/cpp/linear_transform.h" #include "mojo/services/media/common/cpp/local_time.h" #include "mojo/services/media/common/interfaces/media_common.mojom.h" #include "mojo/services/media/common/interfaces/media_types.mojom.h" #include "services/media/audio/audio_output.h" #include "services/media/audio/audio_track_to_output_link.h" #include "services/media/audio/platform/generic/mixer.h" namespace mojo { namespace media { namespace audio { class StandardOutputBase : public AudioOutput { public: ~StandardOutputBase() override; protected: struct MixJob { static constexpr uint32_t INVALID_GENERATION = 0; // State for the job set up once by the output implementation and then used // by all tracks. void* buf; uint32_t buf_frames; int64_t start_pts_of; // start PTS, expressed in output frames. uint32_t local_to_output_gen; bool accumulate; const LinearTransform* local_to_output; // State for the job which is set up for each track during SetupMix uint32_t frames_produced; }; struct TrackBookkeeping : public AudioTrackToOutputLink::Bookkeeping { TrackBookkeeping(); ~TrackBookkeeping() override; LinearTransform lt_to_track_frames; LinearTransform out_frames_to_track_frames; uint32_t lt_to_track_frames_gen = 0; uint32_t out_frames_to_track_frames_gen = MixJob::INVALID_GENERATION; uint32_t step_size; MixerPtr mixer; void UpdateTrackTrans(const AudioTrackImplPtr& track); void UpdateOutputTrans(const MixJob& job); }; explicit StandardOutputBase(AudioOutputManager* manager); void Process() final; MediaResult InitializeLink(const AudioTrackToOutputLinkPtr& link) final; void SetNextSchedTime(const LocalTime& next_sched_time) { next_sched_time_ = next_sched_time; next_sched_time_known_ = true; } void SetNextSchedDelay(const LocalDuration& next_sched_delay) { SetNextSchedTime(LocalClock::now() + next_sched_delay); } virtual bool StartMixJob(MixJob* job, const LocalTime& process_start) = 0; virtual bool FinishMixJob(const MixJob& job) = 0; virtual TrackBookkeeping* AllocBookkeeping(); LpcmMediaTypeDetailsPtr output_format_; uint32_t output_bytes_per_frame_; private: using TrackSetupTask = std::function<bool(const AudioTrackImplPtr& track, TrackBookkeeping* info)>; using TrackProcessTask = std::function<bool(const AudioTrackImplPtr& track, TrackBookkeeping* info, const AudioPipe::AudioPacketRefPtr& pkt_ref)>; void ForeachTrack(const TrackSetupTask& setup, const TrackProcessTask& process); bool SetupMix(const AudioTrackImplPtr& track, TrackBookkeeping* info); bool ProcessMix(const AudioTrackImplPtr& track, TrackBookkeeping* info, const AudioPipe::AudioPacketRefPtr& pkt_ref); bool SetupTrim(const AudioTrackImplPtr& track, TrackBookkeeping* info); bool ProcessTrim(const AudioTrackImplPtr& track, TrackBookkeeping* info, const AudioPipe::AudioPacketRefPtr& pkt_ref); LocalTime next_sched_time_; bool next_sched_time_known_; // State used by the mix task. TrackSetupTask setup_mix_; TrackProcessTask process_mix_; MixJob cur_mix_job_; // State used by the trim task. TrackSetupTask setup_trim_; TrackProcessTask process_trim_; int64_t trim_threshold_; }; } // namespace audio } // namespace media } // namespace mojo #endif // SERVICES_MEDIA_AUDIO_PLATFORM_GENERIC_STANDARD_OUTPUT_BASE_H_
aaf3b5a995b7eedbe6b592e53338189d5957de44
d7063f5042b40da932748cfc3bef4e43fda4da93
/io.cpp
42c5a81b4b83b4d0fe7f5efb0fc263931c5dafae
[ "MIT" ]
permissive
easyeagel/core
2a8dd71fda2bc6ed2be0e08e7e9c7823d00ea5a6
3c1c4e5e6337cc319e70ff38af3fa820de0c83dc
refs/heads/master
2020-04-05T22:45:57.197299
2017-07-20T09:05:00
2017-07-20T09:05:00
29,125,269
0
0
null
null
null
null
UTF-8
C++
false
false
4,712
cpp
// Copyright [2014] <lgb (LiuGuangBao)> //===================================================================================== // // Filename: baseIO.cpp // // Description: IO基础类型的实现 // // Version: 1.0 // Created: 2013年12月13日 13时19分33秒 // Revision: none // Compiler: gcc // // Author: lgb (LiuGuangBao), [email protected] // Organization: ezbty.org // //===================================================================================== #include"io.hpp" #ifndef WIN32 #include <ifaddrs.h> #include <arpa/inet.h> #endif #include<algorithm> #include<boost/xpressive/xpressive.hpp> #include<boost/algorithm/string/predicate.hpp> #include"thread.hpp" namespace core { bool HostAddress::isLAN() const { //10.x.x.x //172.16.x.x -> 172.31.x.x //192.168.x.x int dot=std::atoi(cstrGet()); switch(dot) { case 10: return true; case 172: { const auto next=std::strchr(cstrGet(), '.')+1; dot=std::atoi(next); return dot>=16 && dot<=31; } case 192: { const auto next=std::strchr(cstrGet(), '.')+1; dot=std::atoi(next); return dot==168; } default: return false; } } bool HostAddress::isLocal() const { //127.x.x.x int dot=std::atoi(cstrGet()); switch(dot) { case 127: return true; default: return false; } } uint32_t HostAddress::toUInt32() const { uint8_t dot=static_cast<uint8_t>(std::atoi(cstrGet())); uint32_t ret=dot; const char* str=std::strchr(cstrGet(), '.')+1; assert(str<cstrEnd()); dot=static_cast<uint8_t>(std::atoi(str)); ret=(ret<<8) | dot; str=std::strchr(str, '.')+1; assert(str<cstrEnd()); dot=static_cast<uint8_t>(std::atoi(str)); ret=(ret<<8) | dot; str=std::strchr(str, '.')+1; assert(str<cstrEnd()); dot=static_cast<uint8_t>(std::atoi(str)); ret=(ret<<8) | dot; return ret; } template<typename V> V valueReserve(V v) { std::reverse(reinterpret_cast<Byte*>(&v), reinterpret_cast<Byte*>(&v+1)); return v; } void HostAddress::localAddressGet(LocalAddressCall&& call) { #ifndef WIN32 struct ::ifaddrs *ifaddr=nullptr; if (::getifaddrs(&ifaddr) == -1) return ::freeifaddrs(ifaddr); for (auto ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { if (ifa->ifa_addr == nullptr || ifa->ifa_addr->sa_family!=AF_INET) continue; const struct sockaddr_in* const sockaddr=reinterpret_cast<struct sockaddr_in*>(ifa->ifa_addr); call(ifa->ifa_name, fromUInt32(valueReserve(sockaddr->sin_addr.s_addr))); } ::freeifaddrs(ifaddr); #endif } HostAddress HostAddress::fromUInt32(uint32_t addr) { HostAddress ret; auto ptr=ret.ptrGet(); auto endPtr=ptr+maxSizeGet(); #ifdef _MSC_VER #define snprintf _snprintf #endif ptr += ::snprintf(ptr, endPtr-ptr, "%u", (addr>>24) & 0xFF); *ptr++ = '.'; ptr += ::snprintf(ptr, endPtr-ptr, "%u", (addr>>16) & 0xFF); *ptr++ = '.'; ptr += ::snprintf(ptr, endPtr-ptr, "%u", (addr>> 8) & 0xFF); *ptr++ = '.'; ptr += ::snprintf(ptr, endPtr-ptr, "%u", (addr>> 0) & 0xFF); *ptr=0; ret.sizeSet(ptr-ret.ptrGet()); return std::move(ret); } bool HostAddress::check(const char* str, size_t len) { using namespace boost::xpressive; static OnceConstructT<cregex> gsIPv4( repeat<1,3>(_d) >> '.' >> repeat<1,3>(_d) >> '.' >> repeat<1,3>(_d) >> '.' >> repeat<1,3>(_d)); return regex_match(str, str+len, gsIPv4.get()); } HostPoint HostPoint::fromString(const std::string& hp) { const auto pos=hp.find(':'); if(pos==std::string::npos) return HostPoint(); const char* start=hp.c_str(); if(!HostAddress::check(start, pos)) return HostPoint(); const char* host=start; start += pos + 1; if(!boost::algorithm::all(start, [](char c){ return c>='0' && c<='9'; })) return HostPoint(); return HostPoint( HostAddress(host, pos), HostPort(std::strtoul(start, nullptr, 10)) ); } std::string HostPoint::toString() const { std::string ret=addressGet().toString(); ret += ':'; ret += std::to_string(portGet().valueGet()); return std::move(ret); } bool HostPoint::check(const char* hp, size_t len) { const char* end=hp+len; const auto pos=std::find(hp, end, ':'); if(pos==end) return false; if(!HostAddress::check(hp, pos-hp)) return false; return pos+1<end && std::all_of(pos+1, end, [](char c){ return c>='0' && c<='9'; }); } }
e947061e058a7a44f5bdcded119d766627c3229f
775acebaa6559bb12365c930330a62365afb0d98
/source/chilkat/include/CkBinData.h
1b9b74aba7d303d79298b328f09123e02f01ced3
[]
no_license
Al-ain-Developers/indesing_plugin
3d22c32d3d547fa3a4b1fc469498de57643e9ee3
36a09796b390e28afea25456b5d61597b20de850
refs/heads/main
2023-08-14T13:34:47.867890
2021-10-05T07:57:35
2021-10-05T07:57:35
339,970,603
1
1
null
2021-10-05T07:57:36
2021-02-18T07:33:40
C++
UTF-8
C++
false
false
10,642
h
// CkBinData.h: interface for the CkBinData class. // ////////////////////////////////////////////////////////////////////// // This header is generated for Chilkat 9.5.0.86 #ifndef _CkBinData_H #define _CkBinData_H #include "chilkatDefs.h" #include "CkString.h" #include "CkMultiByteBase.h" class CkByteData; class CkStringBuilder; #if !defined(__sun__) && !defined(__sun) #pragma pack (push, 8) #endif #undef Copy // CLASS: CkBinData class CK_VISIBLE_PUBLIC CkBinData : public CkMultiByteBase { private: // Don't allow assignment or copying these objects. CkBinData(const CkBinData &); CkBinData &operator=(const CkBinData &); public: CkBinData(void); virtual ~CkBinData(void); static CkBinData *createNew(void); void CK_VISIBLE_PRIVATE inject(void *impl); // May be called when finished with the object to free/dispose of any // internal resources held by the object. void dispose(void); const unsigned char *getBinaryDataPtr(void); // BEGIN PUBLIC INTERFACE // ---------------------- // Properties // ---------------------- // The number of bytes contained within the object. int get_NumBytes(void); // ---------------------- // Methods // ---------------------- // Appends the contents of another BinData to this object. bool AppendBd(CkBinData &binData); // Appends binary data to the current contents, if any. bool AppendBinary(CkByteData &data); // Appends binary data to the current contents, if any. bool AppendBinary2(const void *pByteData, unsigned long szByteData); // Appends the appropriate BOM (byte order mark), also known as a "preamble", for // the given charset. If the charset has no defined BOM, then nothing is appended. An // application would typically call this to append the utf-8, utf-16, or utf-32 // BOM. bool AppendBom(const char *charset); // Appends a single byte. The byteValue should be a value from 0 to 255. bool AppendByte(int byteValue); // Appends encoded binary data to the current data. The encoding may be "Base64", // "modBase64", "base64Url", "Base32", "Base58", "QP" (for quoted-printable), "URL" // (for url-encoding), "Hex", or any of the encodings found atChilkat Binary // Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. bool AppendEncoded(const char *encData, const char *encoding); // Decodes the contents of sb and appends the decoded bytes to this object. The // encoding may be "Base64", "modBase64", "base64Url", "Base32", "Base58", "QP" (for // quoted-printable), "URL" (for url-encoding), "Hex", or any of the encodings // found atChilkat Binary Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. bool AppendEncodedSb(CkStringBuilder &sb, const char *encoding); // Appends a 16-bit integer (2 bytes). If littleEndian is true, then the integer bytes // are appended in little-endian byte order, otherwise big-endian byte order is // used. bool AppendInt2(int value, bool littleEndian); // Appends a 32-bit integer (4 bytes). If littleEndian is true, then the integer bytes // are appended in little-endian byte order, otherwise big-endian byte order is // used. bool AppendInt4(int value, bool littleEndian); // Appends a string to this object, padded to the fieldLen with NULL or SPACE chars. If // padWithSpace is true, then SPACE chars are used and the string is not null-terminated. // If fieldLen is false, then null bytes are used. The charset controls the byte // representation to use, such as "utf-8". // // Note: This call will always append a total number of bytes equal to fieldLen. If the // str is longer than fieldLen, the method returns false to indicate failure and // nothing is appended. // bool AppendPadded(const char *str, const char *charset, bool padWithSpace, int fieldLen); // Appends the contents of a StringBuilder to this object. bool AppendSb(CkStringBuilder &sb, const char *charset); // Appends a string to this object. (This does not append the BOM. If a BOM is // required, the AppendBom method can be called to append the appropriate BOM.) bool AppendString(const char *str, const char *charset); // Clears the contents. bool Clear(void); // Return true if the contents of this object equals the contents of binData. bool ContentsEqual(CkBinData &binData); // Return the index where the first occurrence of str is found. Return -1 if not // found. The startIdx indicates the byte index where the search begins. The charset // specifies the byte representation of str that is to be searched. For example, // it can be "utf-8", "windows-1252", "ansi", "utf-16", etc. int FindString(const char *str, int startIdx, const char *charset); // Retrieves the binary data contained within the object. bool GetBinary(CkByteData &outBytes); // Retrieves a chunk of the binary data contained within the object. bool GetBinaryChunk(int offset, int numBytes, CkByteData &outBytes); // Returns a pointer to the internal buffer. Be careful with this method because if // additional data is appended, the data within the object may be relocated and the // pointer may cease to be valid. const void *GetBytesPtr(void); // Retrieves the binary data as an encoded string. The encoding may be "Base64", // "modBase64", "base64Url", "Base32", "Base58", "QP" (for quoted-printable), "URL" // (for url-encoding), "Hex", or any of the encodings found atChilkat Binary // Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. bool GetEncoded(const char *encoding, CkString &outStr); // Retrieves the binary data as an encoded string. The encoding may be "Base64", // "modBase64", "base64Url", "Base32", "Base58", "QP" (for quoted-printable), "URL" // (for url-encoding), "Hex", or any of the encodings found atChilkat Binary // Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. const char *getEncoded(const char *encoding); // Retrieves the binary data as an encoded string. The encoding may be "Base64", // "modBase64", "base64Url", "Base32", "Base58", "QP" (for quoted-printable), "URL" // (for url-encoding), "Hex", or any of the encodings found atChilkat Binary // Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. const char *encoded(const char *encoding); // Retrieves a chunk of the binary data and returns it in encoded form. The encoding // may be "Base64", "modBase64", "base64Url", "Base32", "Base58", "QP" (for // quoted-printable), "URL" (for url-encoding), "Hex", or any of the encodings // found atChilkat Binary Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. bool GetEncodedChunk(int offset, int numBytes, const char *encoding, CkString &outStr); // Retrieves a chunk of the binary data and returns it in encoded form. The encoding // may be "Base64", "modBase64", "base64Url", "Base32", "Base58", "QP" (for // quoted-printable), "URL" (for url-encoding), "Hex", or any of the encodings // found atChilkat Binary Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. const char *getEncodedChunk(int offset, int numBytes, const char *encoding); // Retrieves a chunk of the binary data and returns it in encoded form. The encoding // may be "Base64", "modBase64", "base64Url", "Base32", "Base58", "QP" (for // quoted-printable), "URL" (for url-encoding), "Hex", or any of the encodings // found atChilkat Binary Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. const char *encodedChunk(int offset, int numBytes, const char *encoding); // Writes the encoded data to a StringBuilder. The encoding may be "Base64", // "modBase64", "base64Url", "Base32", "Base58", "QP" (for quoted-printable), "URL" // (for url-encoding), "Hex", or any of the encodings found atChilkat Binary // Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. bool GetEncodedSb(const char *encoding, CkStringBuilder &sb); // Interprets the bytes according to charset and returns the string. The charset can be // "utf-8", "utf-16", "ansi", "iso-8859-*", "windows-125*", or any of the supported // character encodings listed in the link below. bool GetString(const char *charset, CkString &outStr); // Interprets the bytes according to charset and returns the string. The charset can be // "utf-8", "utf-16", "ansi", "iso-8859-*", "windows-125*", or any of the supported // character encodings listed in the link below. const char *getString(const char *charset); // Interprets the bytes according to charset and returns the string. The charset can be // "utf-8", "utf-16", "ansi", "iso-8859-*", "windows-125*", or any of the supported // character encodings listed in the link below. const char *string(const char *charset); // Returns numBytes bytes starting at startIdx. The bytes are interpreted according to charset // (for example, "utf-8", "ansi", "utf-16", "windows-1252", etc.) bool GetTextChunk(int startIdx, int numBytes, const char *charset, CkString &outStr); // Returns numBytes bytes starting at startIdx. The bytes are interpreted according to charset // (for example, "utf-8", "ansi", "utf-16", "windows-1252", etc.) const char *getTextChunk(int startIdx, int numBytes, const char *charset); // Returns numBytes bytes starting at startIdx. The bytes are interpreted according to charset // (for example, "utf-8", "ansi", "utf-16", "windows-1252", etc.) const char *textChunk(int startIdx, int numBytes, const char *charset); // Loads binary data and replaces the current contents, if any. bool LoadBinary(CkByteData &data); // Loads binary data and replaces the current contents, if any. bool LoadBinary2(const void *pByteData, unsigned long szByteData); // Loads binary data from an encoded string, replacing the current contents, if // any. The encoding may be "Base64", "modBase64", "base64Url", "Base32", "Base58", // "QP" (for quoted-printable), "URL" (for url-encoding), "Hex", or any of the // encodings found atChilkat Binary Encodings List // <http://cknotes.com/chilkat-binary-encoding-list/>. bool LoadEncoded(const char *encData, const char *encoding); // Loads data from a file. bool LoadFile(const char *path); // Removes a chunk of bytes from the binary data. bool RemoveChunk(int offset, int numBytes); // Securely clears the contents by writing 0 bytes to the memory prior to // deallocating the internal memory. bool SecureClear(void); // Writes the contents to a file. bool WriteFile(const char *path); // END PUBLIC INTERFACE }; #if !defined(__sun__) && !defined(__sun) #pragma pack (pop) #endif #endif
48cfe69f411a1979a34a6d477b5ee840b14c938d
3af68b32aaa9b7522a1718b0fc50ef0cf4a704a9
/cpp/C/A/A/E/ACAAE.h
cec748723cfb13c21ae900e395df05abf41d9e1e
[]
no_license
devsisters/2021-NDC-ICECREAM
7cd09fa2794cbab1ab4702362a37f6ab62638d9b
ac6548f443a75b86d9e9151ff9c1b17c792b2afd
refs/heads/master
2023-03-19T06:29:03.216461
2021-03-10T02:53:14
2021-03-10T02:53:14
341,872,233
0
0
null
null
null
null
UTF-8
C++
false
false
65
h
#ifndef ACAAE_H namespace ACAAE { std::string run(); } #endif