blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
6f7086c09ff33638bfa90d058efb7f50396a5350
e02fa80eef98834bf8a042a09d7cb7fe6bf768ba
/TEST_MyGUI_Source/MyGUIEngine/include/MyGUI_Instance.h
9d50505893548012b5efd58c18987888bca84ee0
[]
no_license
MyGUI/mygui-historical
fcd3edede9f6cb694c544b402149abb68c538673
4886073fd4813de80c22eded0b2033a5ba7f425f
refs/heads/master
2021-01-23T16:40:19.477150
2008-03-06T22:19:12
2008-03-06T22:19:12
22,805,225
2
0
null
null
null
null
UTF-8
C++
false
false
843
h
/*! @file @author Albert Semenov @date 11/2007 @module */ #ifndef __MYGUI_INSTANCE_H__ #define __MYGUI_INSTANCE_H__ #define INSTANCE_HEADER(type) \ private: \ static type* msInstance; \ bool mIsInitialise; \ public: \ type();\ ~type();\ static type& getInstance(void); \ static type* getInstancePtr(void); #define INSTANCE_IMPLEMENT(type) \ type* type::msInstance = 0; \ type* type::getInstancePtr(void) {return msInstance;} \ type& type::getInstance(void) {MYGUI_ASSERT(0 != msInstance, "instance " << #type << " was not created");return (*msInstance);} \ type::type() : mIsInitialise(false) {MYGUI_ASSERT(0 == msInstance, "instance " << #type << " is exsist");msInstance=this;} \ type::~type() {msInstance=0;} \ const std::string INSTANCE_TYPE_NAME(#type); #endif // __MYGUI_INSTANCE_H__
[ "my.name.post@gmail.com" ]
my.name.post@gmail.com
621e390438ec4b413b35773fb8684221149a8747
2bf81ffecf07f0d52bcc7adf64605d0fafdc9117
/ThreadContextSwitchScript.cpp
851cdc1233fc53c0709be80cd3022551d1776ad9
[]
no_license
sumitdhoble/OSProject
a08d1ca4dcc9e80e3f16232b101af61908930c67
47ba190204de8d1c17e7bf2f8af1a4b1acc42844
refs/heads/master
2021-01-02T22:57:54.071103
2012-12-12T22:12:45
2012-12-12T22:12:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
317
cpp
#include<iostream> #include<cstdlib> #include<sys/time.h> #include<unistd.h> #include<sys/wait.h> int main(){ int i = 0, iterations = 100; system("g++ -pthread ThreadContextSwitch.cpp -o ThreadContextSwitch"); for(i = 0; i < iterations; i++){ system("./ThreadContextSwitch"); usleep(100); } return 0; }
[ "sumit@vdeshpan-XPS-8300.(none)" ]
sumit@vdeshpan-XPS-8300.(none)
0d34501dd71ca848258a11619737c5571c03619a
b6e90a0e63a10e3091d5476e0bbf738d1aa412ef
/source/lec7/mon/ttp2-user.cpp
8308a7aef121e3b2f923a5291eb41efd81f7a899
[ "BSL-1.0" ]
permissive
Cypher1/Cpp_Tuts
53909bc6210b11ceda43d08a7c948f9fc99986f9
e67e8be04ff6e29e620c8245762c05cd27dda974
refs/heads/master
2020-06-28T20:04:18.421631
2017-10-20T03:10:11
2017-10-20T03:10:11
98,940,645
2
0
null
2017-09-16T06:56:31
2017-08-01T00:08:53
C++
UTF-8
C++
false
false
156
cpp
#include <vector> #include "ttpStack.hpp" int main(void) { Stack<int, std::vector > s1; s1.push(1); s1.push(2); std::cout << s1 << std::endl; }
[ "mattstark75@gmail.com" ]
mattstark75@gmail.com
0273861ca1686e80408d458ae92cd7016e364dc0
6451521aff7056b83db5864cb0027eb67c125599
/effort/synchronize_keys.h
7e637a129456f0f2a3f5e8890a9494ad591420c6
[]
no_license
tgamblin/libra
0d740484f23542a017b07b7b86f51566c34ad4e5
2acedbe2f8a487a13b01c3d0e7cb2573e1ca6d09
refs/heads/master
2020-12-24T16:31:54.327600
2013-11-03T00:55:50
2013-11-03T01:04:44
763,175
3
2
null
2016-05-23T17:59:36
2010-07-08T03:21:51
C++
UTF-8
C++
false
false
3,171
h
///////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2010, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory // Written by Todd Gamblin, tgamblin@llnl.gov. // LLNL-CODE-417602 // All rights reserved. // // This file is part of Libra. For details, see http://github.com/tgamblin/libra. // Please also read the LICENSE file for further information. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, this list of // conditions and the disclaimer below. // * Redistributions in binary form must reproduce the above copyright notice, this list of // conditions and the disclaimer (as noted below) in the documentation and/or other materials // provided with the distribution. // * Neither the name of the LLNS/LLNL 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 // LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY 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 SYNCHRONIZE_EFFORT_KEYS_H #define SYNCHRONIZE_EFFORT_KEYS_H #include <mpi.h> #include "effort_data.h" ///\file synchronize_keys.h /// /// Contains declarations for routines involved in global reduction done before /// compression. These routines merge sets of effort keys across processors /// so that all processors end up with the same set in the end. /// /// This is necessary for compression so that all processors end up transforming /// data from the same effort region at the same time. /// namespace effort { /// Receives a set of keys from another processor via PMPI and /// Merges all of them into the supplied effort map. void receive_keys(effort_data& effort_log, int src, MPI_Comm comm); /// Sends a set of effort_keys to another processor via PMPI. void send_keys(effort_data& effort_log, int dest, MPI_Comm comm); /// Reduces effort keys so that all processors have the same keys. void synchronize_effort_keys(effort_data& effort_log, MPI_Comm comm); } // namespace #endif // SYNCHRONIZE_EFFORT_KEYS_H
[ "tgamblin@llnl.gov" ]
tgamblin@llnl.gov
9c08e9151ad6598ab7102a2fe683e80d0a5e2323
5e24b93c2eb4e2f4642eb8e1a8a80fb76e3e48c7
/LED_as_sensor.ino
96f1fec9933dbe7df2d9cc136cc7e6fe4a82f50b
[]
no_license
giantsquidaxon/LED_as_light_sensor_attiny85
7c0455ac61d615e0a7118d9bcaef6611e4f1ede7
2243ee2bb37660a2c4b33f63f90ccbe24edfac00
refs/heads/master
2022-12-09T16:49:33.135151
2020-09-07T10:28:16
2020-09-07T10:28:16
293,476,430
0
0
null
null
null
null
UTF-8
C++
false
false
2,375
ino
#define ANODE_PIN_A 3 #define CATHODE_PIN_A 4 #define ANODE_PIN_B 1 #define CATHODE_PIN_B 2 #define MONITOR 0 #define LED_TIMEOUT 100000 #define SAMPLES_TO_AVERAGE 5 void setup() { // put your setup code here, to run once: #ifdef LOGGING Serial.begin(9600); #endif } /** Perform a single on off cycle with the specified duty cycle, between 0 and 4095. */ inline void do_cycle() __attribute__((always_inline)); void do_cycle(uint16_t duty) { PORTB = 1 << ANODE_PIN_A | 1 << ANODE_PIN_B; for (int i = 0; i < duty; i++) { __asm__("nop\n\t"); } PORTB = 0b00000000; for (int i = duty; i <= 4096; i++) { __asm__("nop\n\t"); } return; } /** log a sample to be averaged. return true is a shadow has been detected **/ bool log_sample(long int sample) { static long int previous_count = LED_TIMEOUT; static long int current_count = 0; static int n = 0; current_count += sample; if (++n < SAMPLES_TO_AVERAGE) { return false; } current_count /= n; long int t = previous_count + 2 * (previous_count / 20); previous_count = current_count; n = 0; return (current_count > t); } /** Flash the bug's eyes */ void eyeflash() { DDRB = 1 << ANODE_PIN_A | 1 << CATHODE_PIN_A | 1 << ANODE_PIN_B | 1 << CATHODE_PIN_B; for (uint16_t k = 0; k < 256; k++) { uint16_t duty = (k * k) >> 4 ; do_cycle(duty); } for (uint16_t k = 255; k != 0; k--) { uint16_t duty = (k * k) >> 4 ; for (int i = 0; i < 3; i++) { do_cycle(duty); } } } void loop() { // Charge LED capacitance // Set cathode pin to OUT #ifdef MONITOR DDRB = 1 << ANODE_PIN_A | 1 << CATHODE_PIN_A | 1 << MONITOR; #else DDRB = 1 << ANODE_PIN_A | 1 << CATHODE_PIN_A; #endif // Set cathode to 1, anode to 0. PORTB = 1 << CATHODE_PIN_A; // Wait delay(10); // Set cathode pin to IN / HIGH Z // Disable internal pullup #ifdef MONITOR DDRB = 1 << ANODE_PIN_A | 1 << MONITOR; PORTB = 1 << MONITOR; #else DDRB = 1 << ANODE_PIN_A; PORTB = 0x00; #endif // Read from cathode pin until 0 long int count = 0; while (PINB & 1 << CATHODE_PIN_A && count < LED_TIMEOUT) { count++; } #ifdef MONITOR PORTB = 0x00; #endif #ifdef LOGGING // Write count out to serial Serial.print(count); Serial.print('\n'); #endif // Flash if shadow if (log_sample(count)) { eyeflash(); delay(2000); } }
[ "dasnarrenschiff@gmail.com" ]
dasnarrenschiff@gmail.com
9f590011574582e179475b9900200e58b7cd8ab4
713c31f3e32b6dd56b6f2a46419f60b102acb87a
/src/bench/bench_bitcoin.cpp
c79428c9d365077cb5b137ae7acb6423432f9a0c
[ "MIT" ]
permissive
bitcoinwallet-project/bitcoinwallet
58e434d8887f8a884cf5ece00751da2c4d000a34
a6daf932f38ca410d03e9d05f9d25afaa490fa2b
refs/heads/master
2022-04-23T04:33:06.310826
2020-04-23T02:44:41
2020-04-23T02:44:41
258,060,170
0
0
null
null
null
null
UTF-8
C++
false
false
4,237
cpp
// Copyright (c) 2015-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <bench/bench.h> #include <crypto/sha256.h> #include <key.h> #include <random.h> #include <util.h> #include <utilstrencodings.h> #include <validation.h> #include <memory> static const int64_t DEFAULT_BENCH_EVALUATIONS = 5; static const char* DEFAULT_BENCH_FILTER = ".*"; static const char* DEFAULT_BENCH_SCALING = "1.0"; static const char* DEFAULT_BENCH_PRINTER = "console"; static const char* DEFAULT_PLOT_PLOTLYURL = "https://cdn.plot.ly/plotly-latest.min.js"; static const int64_t DEFAULT_PLOT_WIDTH = 1024; static const int64_t DEFAULT_PLOT_HEIGHT = 768; static void SetupBenchArgs() { gArgs.AddArg("-?", "Print this help message and exit", false, OptionsCategory::OPTIONS); gArgs.AddArg("-list", "List benchmarks without executing them. Can be combined with -scaling and -filter", false, OptionsCategory::OPTIONS); gArgs.AddArg("-evals=<n>", strprintf("Number of measurement evaluations to perform. (default: %u)", DEFAULT_BENCH_EVALUATIONS), false, OptionsCategory::OPTIONS); gArgs.AddArg("-filter=<regex>", strprintf("Regular expression filter to select benchmark by name (default: %s)", DEFAULT_BENCH_FILTER), false, OptionsCategory::OPTIONS); gArgs.AddArg("-scaling=<n>", strprintf("Scaling factor for benchmark's runtime (default: %u)", DEFAULT_BENCH_SCALING), false, OptionsCategory::OPTIONS); gArgs.AddArg("-printer=(console|plot)", strprintf("Choose printer format. console: print data to console. plot: Print results as HTML graph (default: %s)", DEFAULT_BENCH_PRINTER), false, OptionsCategory::OPTIONS); gArgs.AddArg("-plot-plotlyurl=<uri>", strprintf("URL to use for plotly.js (default: %s)", DEFAULT_PLOT_PLOTLYURL), false, OptionsCategory::OPTIONS); gArgs.AddArg("-plot-width=<x>", strprintf("Plot width in pixel (default: %u)", DEFAULT_PLOT_WIDTH), false, OptionsCategory::OPTIONS); gArgs.AddArg("-plot-height=<x>", strprintf("Plot height in pixel (default: %u)", DEFAULT_PLOT_HEIGHT), false, OptionsCategory::OPTIONS); // Hidden gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN); gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN); } static fs::path SetDataDir() { fs::path ret = fs::temp_directory_path() / "bench_bitcoinwallet" / fs::unique_path(); fs::create_directories(ret); gArgs.ForceSetArg("-datadir", ret.string()); return ret; } int main(int argc, char** argv) { SetupBenchArgs(); std::string error; if (!gArgs.ParseParameters(argc, argv, error)) { fprintf(stderr, "Error parsing command line arguments: %s\n", error.c_str()); return EXIT_FAILURE; } if (HelpRequested(gArgs)) { std::cout << gArgs.GetHelpMessage(); return EXIT_SUCCESS; } // Set the datadir after parsing the bench options const fs::path bench_datadir{SetDataDir()}; SHA256AutoDetect(); RandomInit(); ECC_Start(); SetupEnvironment(); int64_t evaluations = gArgs.GetArg("-evals", DEFAULT_BENCH_EVALUATIONS); std::string regex_filter = gArgs.GetArg("-filter", DEFAULT_BENCH_FILTER); std::string scaling_str = gArgs.GetArg("-scaling", DEFAULT_BENCH_SCALING); bool is_list_only = gArgs.GetBoolArg("-list", false); double scaling_factor; if (!ParseDouble(scaling_str, &scaling_factor)) { fprintf(stderr, "Error parsing scaling factor as double: %s\n", scaling_str.c_str()); return EXIT_FAILURE; } std::unique_ptr<benchmark::Printer> printer(new benchmark::ConsolePrinter()); std::string printer_arg = gArgs.GetArg("-printer", DEFAULT_BENCH_PRINTER); if ("plot" == printer_arg) { printer.reset(new benchmark::PlotlyPrinter( gArgs.GetArg("-plot-plotlyurl", DEFAULT_PLOT_PLOTLYURL), gArgs.GetArg("-plot-width", DEFAULT_PLOT_WIDTH), gArgs.GetArg("-plot-height", DEFAULT_PLOT_HEIGHT))); } benchmark::BenchRunner::RunAll(*printer, evaluations, scaling_factor, regex_filter, is_list_only); fs::remove_all(bench_datadir); ECC_Stop(); return EXIT_SUCCESS; }
[ "leoped.rgs@gmail.com" ]
leoped.rgs@gmail.com
5622f1be6e9b10f5500233c7c86720a1a6e9b0c9
43efb8c60d19d37c2f42805754086f910348a5ae
/Coding/Rough Codes/problm3.cpp
4faaf872bec0a646a4ddd0344bafa989bfdb3626
[]
no_license
akshay2742/Coding-Problems
961399752b30b6a17b72b2c1b2afada9e839a326
838be77b707cc82a9453c964ff8cedce1646dfe8
refs/heads/master
2021-06-26T14:08:39.292052
2020-10-08T18:34:19
2020-10-08T18:34:19
151,247,129
0
1
null
2020-10-08T18:34:21
2018-10-02T11:59:38
C++
UTF-8
C++
false
false
552
cpp
#include<iostream> #include<math.h> #include<cstdio> using namespace std; #define int long long int checkSquare(int a) { int x,valid=1; while(a!=0){ x=a%10; a=a/10; if(x==9||x==4||x==1||x==0) continue; else return 0; } return valid; } main(){ int t,a,b,i,square,count=0; scanf("%lld",&t); while(t--) { scanf("%lld%lld",&a,&b); for(i=sqrt(a);i<=sqrt(b);i++) { if(checkSquare(i*i)){ count++;} } printf("%lld\n",count); count=0; } return 0; }
[ "prateekrishu@yahoo.com" ]
prateekrishu@yahoo.com
2605b2a54d343f47f8a3eeeb8ff69f468c10a9a0
eeca0485de2fee42f63e902b2412b014ea949126
/fro_duo.ino
941bd61604a13229f052b1f5f1d64f164315e575
[]
no_license
anuejn/ledArdu
fb149cde292e0906e913c2c250e823c2432f45f2
a560d3351c6b1a7f2860b40aeeab4639f9c3e891
refs/heads/master
2021-05-29T09:55:36.159789
2015-04-30T21:14:57
2015-04-30T21:14:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,802
ino
#include <Adafruit_NeoPixel.h> #include <avr/power.h> #include <math.h> #define PIN A0 #define NUMPIXELS 20 #define GOALTIME 20000.0 #define PI 3.1415936 #define MOTORPIN 2 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); float proces = 0; int starttime = 0; long vcc = 0; void setup() { vcc = readVcc(); pixels.begin(); pinMode(MOTORPIN, OUTPUT); Serial.begin(9600); } void loop() { Serial.println(vcc); if(vcc < 4900) { //this is an evil hack ;) //wehn you reset the arduwino the voltage is lower becouse the leds are glowing and taking current digitalWrite(MOTORPIN, HIGH); starttime = millis(); while(millis() - starttime < 512) { fillWith((millis() - starttime) / 2,0,255- ((millis() - starttime) / 2)); pixels.show(); Serial.println(vcc); } starttime = millis(); while(proces <= 1) { proces = ((millis() - starttime) / GOALTIME); //Serial.println(proces); fillWithTo(0, 255, 0, 255, 0, 0, proces); pixels.show(); Serial.println(vcc); } starttime = millis(); while(millis() - starttime < 1*PI * 1000) { fillWith(0, (cos((millis() - starttime) / 250.0) + 1) * 127.5, 0); pixels.show(); Serial.println(vcc); } digitalWrite(MOTORPIN, LOW); starttime = millis(); while(millis() - starttime < 2550) { fillWith(0, 255 - ((millis() - starttime) / 10), (millis() - starttime) / 10); pixels.show(); Serial.println(vcc); } } else { starttime = millis(); while(millis() - starttime < 2550) { fillWith(0, 0, (millis() - starttime) / 10); pixels.show(); Serial.println(vcc); } } while(true) { fillWith(0, 0, 255); pixels.show(); } }
[ "jaro.habiger@googlemail.com" ]
jaro.habiger@googlemail.com
45f532d4213b6e77002b4b54345993e36943367a
6ca0e27edfb1243e31fbca299cbfbe4f902edb65
/src/KinectBasePanel.h
5a241435c069de4b8a73af0c3e68f2f882483bf9
[ "Apache-2.0" ]
permissive
fusefactory/ofxDepthKinectV2Streaming
5a22a496c241c5b4cef1e7aaa148288009c7b300
9a479f10cc81e90d638ed9e014fe8d3ce2bcffc9
refs/heads/master
2020-05-01T00:28:09.645213
2020-02-18T10:37:10
2020-02-18T10:37:10
177,168,661
2
0
null
null
null
null
UTF-8
C++
false
false
1,044
h
// // KinectBasePanel.hpp // Apologue2047 // // Created by Matteo on 22/03/2019. // #ifndef KinectBasePanel_h #define KinectBasePanel_h #include <stdio.h> #include "ofxGui.h" #include "KinectDevice.h" #include "KinectSettings.h" class KinectBasePanel : public ofxPanel{ public: void addGuiComponents(KinectDevice *kinectDevice); void addGuiComponents(KinectDevice *kinectDevice, KinectSettings kinectSettings); void save(); string &getFilename(){return filename;} protected: KinectDevice *kinectDevice; ofxButton connectReleaseButton; ofxIntSlider minDistanceIntSlider; ofxIntSlider maxDistanceIntSlider; ofxIntSlider leftMarginIntSlider; ofxIntSlider rightMarginIntSlider; ofxIntSlider topMarginIntSlider; ofxIntSlider bottomMarginIntSlider; ofxFloatSlider vertCorrectionFloatSlider; ofxFloatSlider keystoneFloatSlider; ofxButton saveButton; }; #endif /* KinectBasePanel_hpp */
[ "matteo@fusefactory.it" ]
matteo@fusefactory.it
5ac9603976964a5058f4cb7f26a721232979ebac
dcb345e6ec38d85f82f5557a3054df3f58d6fd40
/iq/temperature_monitor_uc_client.hpp
d13fceaa82d80b814cabaac66ab7d0af68e70504
[ "BSD-3-Clause" ]
permissive
bunnie/iqmotor-c
c4fd76367cb83460adae615b0d16c5bbcb3181fb
18efc6e8d2251456b167712556ad9e2c96917e6a
refs/heads/master
2021-04-06T20:30:22.913439
2020-01-15T23:33:51
2020-01-15T23:33:51
125,386,841
14
2
null
null
null
null
UTF-8
C++
false
false
2,747
hpp
/* Copyright 2019 IQinetics Technologies, Inc support@iq-control.com This file is part of the IQ C++ API. IQ C++ API 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. IQ C++ API 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/>. */ /* Name: temperature_monitor_uc_client.hpp Last update: 3/7/2019 by Raphael Van Hoffelen Author: Matthew Piccoli Contributors: Raphael Van Hoffelen */ #ifndef TEMPERATURE_MONITOR_UC_CLIENT_HPP_ #define TEMPERATURE_MONITOR_UC_CLIENT_HPP_ #include "client_communication.hpp" const uint8_t kTypeTemperatureMonitorUcClient = 73; class TemperatureMonitorUcClient: public ClientAbstract{ public: TemperatureMonitorUcClient(uint8_t obj_idn): ClientAbstract( kTypeTemperatureMonitorUcClient, obj_idn), uc_temp_( kTypeTemperatureMonitorUcClient, obj_idn, kSubUcTemp), filter_fs_( kTypeTemperatureMonitorUcClient, obj_idn, kSubFilterFs), filter_fc_( kTypeTemperatureMonitorUcClient, obj_idn, kSubFilterFc), otw_( kTypeTemperatureMonitorUcClient, obj_idn, kSubOtw), otlo_( kTypeTemperatureMonitorUcClient, obj_idn, kSubOtlo), derate_( kTypeTemperatureMonitorUcClient, obj_idn, kSubDerate) {}; // Client Entries // Control commands ClientEntry<float> uc_temp_; ClientEntry<uint32_t> filter_fs_; ClientEntry<uint32_t> filter_fc_; ClientEntry<float> otw_; ClientEntry<float> otlo_; ClientEntry<float> derate_; void ReadMsg(uint8_t* rx_data, uint8_t rx_length) { static const uint8_t kEntryLength = kSubDerate+1; ClientEntryAbstract* entry_array[kEntryLength] = { &uc_temp_, // 0 &filter_fs_, // 1 &filter_fc_, // 2 &otw_, // 3 &otlo_, // 4 &derate_ // 5 }; ParseMsg(rx_data, rx_length, entry_array, kEntryLength); } private: static const uint8_t kSubUcTemp = 0; static const uint8_t kSubFilterFs = 1; static const uint8_t kSubFilterFc = 2; static const uint8_t kSubOtw = 3; static const uint8_t kSubOtlo = 4; static const uint8_t kSubDerate = 5; }; #endif /* TEMPERATURE_MONITOR_UC_CLIENT_HPP_ */
[ "bunnie@kosagi.com" ]
bunnie@kosagi.com
3545859e1f035c969b05a3eb4ec448bcf6009e58
0400ac52a20058bf13a064b838872473212765ca
/Unity_Code/DinoRun_Final/Temp/il2cppOutput/il2cppOutput/Il2CppCompilerCalculateTypeValues_13Table.cpp
54218c2c04a1ea80c40af6e980759da4580eabdb
[ "Apache-2.0" ]
permissive
BPenzar/SuperDinoBros.
b7e6be07bfc4278d85eeb986f4740c9a91e01689
f46b866c5a1119c6753dbd8e963212f17a4a31d5
refs/heads/master
2021-01-20T04:29:24.503356
2017-07-25T14:58:12
2017-07-25T14:58:12
89,697,299
0
1
null
null
null
null
UTF-8
C++
false
false
43,103
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 "class-internals.h" #include "codegen/il2cpp-codegen.h" #include "UnityEngine_UnityEngine_SpriteRenderer1209076198.h" #include "UnityEngine_UnityEngine_Sprites_DataUtility4181890362.h" #include "UnityEngine_UnityEngine_Texture2243626319.h" #include "UnityEngine_UnityEngine_Texture2D3542995729.h" #include "UnityEngine_UnityEngine_RenderTexture2666733923.h" #include "UnityEngine_UnityEngine_Time31991979.h" #include "UnityEngine_UnityEngine_HideFlags1434274199.h" #include "UnityEngine_UnityEngine_Object1021602117.h" #include "UnityEngine_UnityEngine_WWW2919945039.h" #include "UnityEngine_UnityEngine_WWWForm3950226929.h" #include "UnityEngine_UnityEngine_WWWTranscoder1124214756.h" #include "UnityEngine_UnityEngine_YieldInstruction3462875981.h" #include "UnityEngine_UnityEngine_Experimental_Director_Play3250302433.h" #include "UnityEngine_UnityEngine_Experimental_Director_Play1502856514.h" #include "UnityEngine_UnityEngine_Experimental_Director_Play3667545548.h" #include "UnityEngine_UnityEngine_Experimental_Director_Scri4067966717.h" #include "UnityEngine_UnityEngine_iOS_CalendarIdentifier259698391.h" #include "UnityEngine_UnityEngine_iOS_CalendarUnit4134400622.h" #include "UnityEngine_UnityEngine_iOS_LocalNotification317971878.h" #include "UnityEngine_UnityEngine_iOS_RemoteNotification2254252895.h" #include "UnityEngine_UnityEngine_SceneManagement_Scene1684909666.h" #include "UnityEngine_UnityEngine_SceneManagement_LoadSceneM2981886439.h" #include "UnityEngine_UnityEngine_SceneManagement_SceneManager90660965.h" #include "UnityEngine_UnityEngine_Experimental_Rendering_Script4271526.h" #include "UnityEngine_UnityEngine_Transform3275118058.h" #include "UnityEngine_UnityEngine_Transform_Enumerator1251553160.h" #include "UnityEngine_UnityEngine_DrivenTransformProperties2488747555.h" #include "UnityEngine_UnityEngine_DrivenRectTransformTracker154385424.h" #include "UnityEngine_UnityEngine_RectTransform3349966182.h" #include "UnityEngine_UnityEngine_RectTransform_ReapplyDrive2020713228.h" #include "UnityEngine_UnityEngine_RectTransform_Edge3306019089.h" #include "UnityEngine_UnityEngine_RectTransform_Axis3420330537.h" #include "UnityEngine_UnityEngine_ControllerColliderHit4070855101.h" #include "UnityEngine_UnityEngine_Collision2876846408.h" #include "UnityEngine_UnityEngine_CollisionFlags4046947985.h" #include "UnityEngine_UnityEngine_QueryTriggerInteraction478029726.h" #include "UnityEngine_UnityEngine_Physics634932869.h" #include "UnityEngine_UnityEngine_ContactPoint1376425630.h" #include "UnityEngine_UnityEngine_Rigidbody4233889191.h" #include "UnityEngine_UnityEngine_Collider3497673348.h" #include "UnityEngine_UnityEngine_RaycastHit87180320.h" #include "UnityEngine_UnityEngine_CharacterController4094781467.h" #include "UnityEngine_UnityEngine_RaycastHit2D4063908774.h" #include "UnityEngine_UnityEngine_Physics2D2540166467.h" #include "UnityEngine_UnityEngine_ContactFilter2D1672660996.h" #include "UnityEngine_UnityEngine_Rigidbody2D502193897.h" #include "UnityEngine_UnityEngine_Collider2D646061738.h" #include "UnityEngine_UnityEngine_ContactPoint2D3659330976.h" #include "UnityEngine_UnityEngine_Collision2D1539500754.h" #include "UnityEngine_UnityEngine_AudioSettings3144015719.h" #include "UnityEngine_UnityEngine_AudioSettings_AudioConfigu3743753033.h" #include "UnityEngine_UnityEngine_AudioClip1932558630.h" #include "UnityEngine_UnityEngine_AudioClip_PCMReaderCallbac3007145346.h" #include "UnityEngine_UnityEngine_AudioClip_PCMSetPositionCal421863554.h" #include "UnityEngine_UnityEngine_AudioListener1996719162.h" #include "UnityEngine_UnityEngine_AudioSource1135106623.h" #include "UnityEngine_UnityEngine_SharedBetweenAnimatorsAttr1565472209.h" #include "UnityEngine_UnityEngine_StateMachineBehaviour2151245329.h" #include "UnityEngine_UnityEngine_AnimationEventSource3560017945.h" #include "UnityEngine_UnityEngine_AnimationEvent2428323300.h" #include "UnityEngine_UnityEngine_AnimationClip3510324950.h" #include "UnityEngine_UnityEngine_AnimationState1303741697.h" #include "UnityEngine_UnityEngine_AnimatorControllerParamete3688495056.h" #include "UnityEngine_UnityEngine_AnimatorClipInfo3905751349.h" #include "UnityEngine_UnityEngine_AnimatorStateInfo2577870592.h" #include "UnityEngine_UnityEngine_AnimatorTransitionInfo2410896200.h" #include "UnityEngine_UnityEngine_Animator69676727.h" #include "UnityEngine_UnityEngine_AnimatorControllerParamete1381019216.h" #include "UnityEngine_UnityEngine_SkeletonBone345082847.h" #include "UnityEngine_UnityEngine_HumanLimit250797648.h" #include "UnityEngine_UnityEngine_HumanBone1529896151.h" #include "UnityEngine_UnityEngine_RuntimeAnimatorController670468573.h" #include "UnityEngine_UnityEngine_Experimental_Director_Anim4078305555.h" #include "UnityEngine_UnityEngine_Experimental_Director_Anim3036622417.h" #include "UnityEngine_UnityEngine_Experimental_Director_Anima641234490.h" #include "UnityEngine_UnityEngine_Experimental_Director_Anim4062767676.h" #include "UnityEngine_UnityEngine_Experimental_Director_Anim1693994278.h" #include "UnityEngine_UnityEngine_Experimental_Director_Anima859920217.h" #include "UnityEngine_UnityEngine_Motion2415020824.h" #include "UnityEngine_UnityEngine_FontStyle2764949590.h" #include "UnityEngine_UnityEngine_TextGenerationError780770201.h" #include "UnityEngine_UnityEngine_TextGenerationSettings2543476768.h" #include "UnityEngine_UnityEngine_TextGenerator647235000.h" #include "UnityEngine_UnityEngine_TextAnchor112990806.h" #include "UnityEngine_UnityEngine_HorizontalWrapMode2027154177.h" #include "UnityEngine_UnityEngine_VerticalWrapMode3668245347.h" #include "UnityEngine_UnityEngine_Font4239498691.h" #include "UnityEngine_UnityEngine_Font_FontTextureRebuildCal1272078033.h" #include "UnityEngine_UnityEngine_UICharInfo3056636800.h" #include "UnityEngine_UnityEngine_UILineInfo3621277874.h" #include "UnityEngine_UnityEngine_UIVertex1204258818.h" #include "UnityEngine_UnityEngine_RectTransformUtility2941082270.h" #include "UnityEngine_UnityEngine_RenderMode4280533217.h" #include "UnityEngine_UnityEngine_Canvas209405766.h" #include "UnityEngine_UnityEngine_Canvas_WillRenderCanvases3522132132.h" #include "UnityEngine_UnityEngine_CanvasGroup3296560743.h" #include "UnityEngine_UnityEngine_CanvasRenderer261436805.h" #include "UnityEngine_UnityEngine_Event3028476042.h" #include "UnityEngine_UnityEngine_EventType3919834026.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1300 = { sizeof (SpriteRenderer_t1209076198), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1301 = { sizeof (DataUtility_t4181890362), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1302 = { sizeof (Texture_t2243626319), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1303 = { sizeof (Texture2D_t3542995729), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1304 = { sizeof (RenderTexture_t2666733923), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1305 = { sizeof (Time_t31991979), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1306 = { sizeof (HideFlags_t1434274199)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1306[10] = { HideFlags_t1434274199::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1307 = { sizeof (Object_t1021602117), sizeof(Object_t1021602117_marshaled_pinvoke), sizeof(Object_t1021602117_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1307[2] = { Object_t1021602117::get_offset_of_m_CachedPtr_0(), Object_t1021602117_StaticFields::get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1308 = { sizeof (WWW_t2919945039), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1309 = { sizeof (WWWForm_t3950226929), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1309[6] = { WWWForm_t3950226929::get_offset_of_formData_0(), WWWForm_t3950226929::get_offset_of_fieldNames_1(), WWWForm_t3950226929::get_offset_of_fileNames_2(), WWWForm_t3950226929::get_offset_of_types_3(), WWWForm_t3950226929::get_offset_of_boundary_4(), WWWForm_t3950226929::get_offset_of_containsFiles_5(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1310 = { sizeof (WWWTranscoder_t1124214756), -1, sizeof(WWWTranscoder_t1124214756_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1310[8] = { WWWTranscoder_t1124214756_StaticFields::get_offset_of_ucHexChars_0(), WWWTranscoder_t1124214756_StaticFields::get_offset_of_lcHexChars_1(), WWWTranscoder_t1124214756_StaticFields::get_offset_of_urlEscapeChar_2(), WWWTranscoder_t1124214756_StaticFields::get_offset_of_urlSpace_3(), WWWTranscoder_t1124214756_StaticFields::get_offset_of_urlForbidden_4(), WWWTranscoder_t1124214756_StaticFields::get_offset_of_qpEscapeChar_5(), WWWTranscoder_t1124214756_StaticFields::get_offset_of_qpSpace_6(), WWWTranscoder_t1124214756_StaticFields::get_offset_of_qpForbidden_7(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1311 = { sizeof (YieldInstruction_t3462875981), sizeof(YieldInstruction_t3462875981_marshaled_pinvoke), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1312 = { sizeof (PlayState_t3250302433)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1312[3] = { PlayState_t3250302433::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1313 = { sizeof (PlayableHandle_t1502856514)+ sizeof (Il2CppObject), sizeof(PlayableHandle_t1502856514 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1313[2] = { PlayableHandle_t1502856514::get_offset_of_m_Handle_0() + static_cast<int32_t>(sizeof(Il2CppObject)), PlayableHandle_t1502856514::get_offset_of_m_Version_1() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1314 = { sizeof (Playable_t3667545548), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1314[1] = { Playable_t3667545548::get_offset_of_handle_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1315 = { sizeof (ScriptPlayable_t4067966717), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1316 = { sizeof (CalendarIdentifier_t259698391)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1316[12] = { CalendarIdentifier_t259698391::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1317 = { sizeof (CalendarUnit_t4134400622)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1317[12] = { CalendarUnit_t4134400622::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1318 = { sizeof (LocalNotification_t317971878), -1, sizeof(LocalNotification_t317971878_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1318[2] = { LocalNotification_t317971878::get_offset_of_notificationWrapper_0(), LocalNotification_t317971878_StaticFields::get_offset_of_m_NSReferenceDateTicks_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1319 = { sizeof (RemoteNotification_t2254252895), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1319[1] = { RemoteNotification_t2254252895::get_offset_of_notificationWrapper_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1320 = { sizeof (Scene_t1684909666)+ sizeof (Il2CppObject), sizeof(Scene_t1684909666 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1320[1] = { Scene_t1684909666::get_offset_of_m_Handle_0() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1321 = { sizeof (LoadSceneMode_t2981886439)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1321[3] = { LoadSceneMode_t2981886439::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1322 = { sizeof (SceneManager_t90660965), -1, sizeof(SceneManager_t90660965_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1322[3] = { SceneManager_t90660965_StaticFields::get_offset_of_sceneLoaded_0(), SceneManager_t90660965_StaticFields::get_offset_of_sceneUnloaded_1(), SceneManager_t90660965_StaticFields::get_offset_of_activeSceneChanged_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1323 = { sizeof (ScriptableRenderContext_t4271526)+ sizeof (Il2CppObject), sizeof(ScriptableRenderContext_t4271526 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1323[1] = { ScriptableRenderContext_t4271526::get_offset_of_m_Ptr_0() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1324 = { sizeof (Transform_t3275118058), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1325 = { sizeof (Enumerator_t1251553160), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1325[2] = { Enumerator_t1251553160::get_offset_of_outer_0(), Enumerator_t1251553160::get_offset_of_currentIndex_1(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1326 = { sizeof (DrivenTransformProperties_t2488747555)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1326[26] = { DrivenTransformProperties_t2488747555::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1327 = { sizeof (DrivenRectTransformTracker_t154385424)+ sizeof (Il2CppObject), sizeof(DrivenRectTransformTracker_t154385424 ), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1328 = { sizeof (RectTransform_t3349966182), -1, sizeof(RectTransform_t3349966182_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1328[1] = { RectTransform_t3349966182_StaticFields::get_offset_of_reapplyDrivenProperties_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1329 = { sizeof (ReapplyDrivenProperties_t2020713228), sizeof(Il2CppMethodPointer), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1330 = { sizeof (Edge_t3306019089)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1330[5] = { Edge_t3306019089::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1331 = { sizeof (Axis_t3420330537)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1331[3] = { Axis_t3420330537::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1332 = { sizeof (ControllerColliderHit_t4070855101), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1332[7] = { ControllerColliderHit_t4070855101::get_offset_of_m_Controller_0(), ControllerColliderHit_t4070855101::get_offset_of_m_Collider_1(), ControllerColliderHit_t4070855101::get_offset_of_m_Point_2(), ControllerColliderHit_t4070855101::get_offset_of_m_Normal_3(), ControllerColliderHit_t4070855101::get_offset_of_m_MoveDirection_4(), ControllerColliderHit_t4070855101::get_offset_of_m_MoveLength_5(), ControllerColliderHit_t4070855101::get_offset_of_m_Push_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1333 = { sizeof (Collision_t2876846408), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1333[5] = { Collision_t2876846408::get_offset_of_m_Impulse_0(), Collision_t2876846408::get_offset_of_m_RelativeVelocity_1(), Collision_t2876846408::get_offset_of_m_Rigidbody_2(), Collision_t2876846408::get_offset_of_m_Collider_3(), Collision_t2876846408::get_offset_of_m_Contacts_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1334 = { sizeof (CollisionFlags_t4046947985)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1334[8] = { CollisionFlags_t4046947985::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1335 = { sizeof (QueryTriggerInteraction_t478029726)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1335[4] = { QueryTriggerInteraction_t478029726::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1336 = { sizeof (Physics_t634932869), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1337 = { sizeof (ContactPoint_t1376425630)+ sizeof (Il2CppObject), sizeof(ContactPoint_t1376425630 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1337[5] = { ContactPoint_t1376425630::get_offset_of_m_Point_0() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint_t1376425630::get_offset_of_m_Normal_1() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint_t1376425630::get_offset_of_m_ThisColliderInstanceID_2() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint_t1376425630::get_offset_of_m_OtherColliderInstanceID_3() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint_t1376425630::get_offset_of_m_Separation_4() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1338 = { sizeof (Rigidbody_t4233889191), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1339 = { sizeof (Collider_t3497673348), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1340 = { sizeof (RaycastHit_t87180320)+ sizeof (Il2CppObject), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1340[6] = { RaycastHit_t87180320::get_offset_of_m_Point_0() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit_t87180320::get_offset_of_m_Normal_1() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit_t87180320::get_offset_of_m_FaceID_2() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit_t87180320::get_offset_of_m_Distance_3() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit_t87180320::get_offset_of_m_UV_4() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit_t87180320::get_offset_of_m_Collider_5() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1341 = { sizeof (CharacterController_t4094781467), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1342 = { sizeof (RaycastHit2D_t4063908774)+ sizeof (Il2CppObject), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1342[6] = { RaycastHit2D_t4063908774::get_offset_of_m_Centroid_0() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit2D_t4063908774::get_offset_of_m_Point_1() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit2D_t4063908774::get_offset_of_m_Normal_2() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit2D_t4063908774::get_offset_of_m_Distance_3() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit2D_t4063908774::get_offset_of_m_Fraction_4() + static_cast<int32_t>(sizeof(Il2CppObject)), RaycastHit2D_t4063908774::get_offset_of_m_Collider_5() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1343 = { sizeof (Physics2D_t2540166467), -1, sizeof(Physics2D_t2540166467_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1343[1] = { Physics2D_t2540166467_StaticFields::get_offset_of_m_LastDisabledRigidbody2D_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1344 = { sizeof (ContactFilter2D_t1672660996)+ sizeof (Il2CppObject), sizeof(ContactFilter2D_t1672660996_marshaled_pinvoke), 0, 0 }; extern const int32_t g_FieldOffsetTable1344[9] = { ContactFilter2D_t1672660996::get_offset_of_useTriggers_0() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_useLayerMask_1() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_useDepth_2() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_useNormalAngle_3() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_layerMask_4() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_minDepth_5() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_maxDepth_6() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_minNormalAngle_7() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactFilter2D_t1672660996::get_offset_of_maxNormalAngle_8() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1345 = { sizeof (Rigidbody2D_t502193897), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1346 = { sizeof (Collider2D_t646061738), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1347 = { sizeof (ContactPoint2D_t3659330976)+ sizeof (Il2CppObject), sizeof(ContactPoint2D_t3659330976 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1347[11] = { ContactPoint2D_t3659330976::get_offset_of_m_Point_0() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_Normal_1() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_RelativeVelocity_2() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_Separation_3() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_NormalImpulse_4() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_TangentImpulse_5() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_Collider_6() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_OtherCollider_7() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_Rigidbody_8() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_OtherRigidbody_9() + static_cast<int32_t>(sizeof(Il2CppObject)), ContactPoint2D_t3659330976::get_offset_of_m_Enabled_10() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1348 = { sizeof (Collision2D_t1539500754), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1348[7] = { Collision2D_t1539500754::get_offset_of_m_Collider_0(), Collision2D_t1539500754::get_offset_of_m_OtherCollider_1(), Collision2D_t1539500754::get_offset_of_m_Rigidbody_2(), Collision2D_t1539500754::get_offset_of_m_OtherRigidbody_3(), Collision2D_t1539500754::get_offset_of_m_Contacts_4(), Collision2D_t1539500754::get_offset_of_m_RelativeVelocity_5(), Collision2D_t1539500754::get_offset_of_m_Enabled_6(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1349 = { sizeof (AudioSettings_t3144015719), -1, sizeof(AudioSettings_t3144015719_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1349[1] = { AudioSettings_t3144015719_StaticFields::get_offset_of_OnAudioConfigurationChanged_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1350 = { sizeof (AudioConfigurationChangeHandler_t3743753033), sizeof(Il2CppMethodPointer), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1351 = { sizeof (AudioClip_t1932558630), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1351[2] = { AudioClip_t1932558630::get_offset_of_m_PCMReaderCallback_2(), AudioClip_t1932558630::get_offset_of_m_PCMSetPositionCallback_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1352 = { sizeof (PCMReaderCallback_t3007145346), sizeof(Il2CppMethodPointer), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1353 = { sizeof (PCMSetPositionCallback_t421863554), sizeof(Il2CppMethodPointer), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1354 = { sizeof (AudioListener_t1996719162), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1355 = { sizeof (AudioSource_t1135106623), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1356 = { sizeof (SharedBetweenAnimatorsAttribute_t1565472209), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1357 = { sizeof (StateMachineBehaviour_t2151245329), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1358 = { sizeof (AnimationEventSource_t3560017945)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1358[4] = { AnimationEventSource_t3560017945::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1359 = { sizeof (AnimationEvent_t2428323300), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1359[11] = { AnimationEvent_t2428323300::get_offset_of_m_Time_0(), AnimationEvent_t2428323300::get_offset_of_m_FunctionName_1(), AnimationEvent_t2428323300::get_offset_of_m_StringParameter_2(), AnimationEvent_t2428323300::get_offset_of_m_ObjectReferenceParameter_3(), AnimationEvent_t2428323300::get_offset_of_m_FloatParameter_4(), AnimationEvent_t2428323300::get_offset_of_m_IntParameter_5(), AnimationEvent_t2428323300::get_offset_of_m_MessageOptions_6(), AnimationEvent_t2428323300::get_offset_of_m_Source_7(), AnimationEvent_t2428323300::get_offset_of_m_StateSender_8(), AnimationEvent_t2428323300::get_offset_of_m_AnimatorStateInfo_9(), AnimationEvent_t2428323300::get_offset_of_m_AnimatorClipInfo_10(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1360 = { sizeof (AnimationClip_t3510324950), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1361 = { sizeof (AnimationState_t1303741697), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1362 = { sizeof (AnimatorControllerParameterType_t3688495056)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1362[5] = { AnimatorControllerParameterType_t3688495056::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1363 = { sizeof (AnimatorClipInfo_t3905751349)+ sizeof (Il2CppObject), sizeof(AnimatorClipInfo_t3905751349 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1363[2] = { AnimatorClipInfo_t3905751349::get_offset_of_m_ClipInstanceID_0() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorClipInfo_t3905751349::get_offset_of_m_Weight_1() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1364 = { sizeof (AnimatorStateInfo_t2577870592)+ sizeof (Il2CppObject), sizeof(AnimatorStateInfo_t2577870592 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1364[9] = { AnimatorStateInfo_t2577870592::get_offset_of_m_Name_0() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_Path_1() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_FullPath_2() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_NormalizedTime_3() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_Length_4() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_Speed_5() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_SpeedMultiplier_6() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_Tag_7() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorStateInfo_t2577870592::get_offset_of_m_Loop_8() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1365 = { sizeof (AnimatorTransitionInfo_t2410896200)+ sizeof (Il2CppObject), sizeof(AnimatorTransitionInfo_t2410896200_marshaled_pinvoke), 0, 0 }; extern const int32_t g_FieldOffsetTable1365[6] = { AnimatorTransitionInfo_t2410896200::get_offset_of_m_FullPath_0() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorTransitionInfo_t2410896200::get_offset_of_m_UserName_1() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorTransitionInfo_t2410896200::get_offset_of_m_Name_2() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorTransitionInfo_t2410896200::get_offset_of_m_NormalizedTime_3() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorTransitionInfo_t2410896200::get_offset_of_m_AnyState_4() + static_cast<int32_t>(sizeof(Il2CppObject)), AnimatorTransitionInfo_t2410896200::get_offset_of_m_TransitionType_5() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1366 = { sizeof (Animator_t69676727), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1367 = { sizeof (AnimatorControllerParameter_t1381019216), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1367[5] = { AnimatorControllerParameter_t1381019216::get_offset_of_m_Name_0(), AnimatorControllerParameter_t1381019216::get_offset_of_m_Type_1(), AnimatorControllerParameter_t1381019216::get_offset_of_m_DefaultFloat_2(), AnimatorControllerParameter_t1381019216::get_offset_of_m_DefaultInt_3(), AnimatorControllerParameter_t1381019216::get_offset_of_m_DefaultBool_4(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1368 = { sizeof (SkeletonBone_t345082847)+ sizeof (Il2CppObject), sizeof(SkeletonBone_t345082847_marshaled_pinvoke), 0, 0 }; extern const int32_t g_FieldOffsetTable1368[5] = { SkeletonBone_t345082847::get_offset_of_name_0() + static_cast<int32_t>(sizeof(Il2CppObject)), SkeletonBone_t345082847::get_offset_of_parentName_1() + static_cast<int32_t>(sizeof(Il2CppObject)), SkeletonBone_t345082847::get_offset_of_position_2() + static_cast<int32_t>(sizeof(Il2CppObject)), SkeletonBone_t345082847::get_offset_of_rotation_3() + static_cast<int32_t>(sizeof(Il2CppObject)), SkeletonBone_t345082847::get_offset_of_scale_4() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1369 = { sizeof (HumanLimit_t250797648)+ sizeof (Il2CppObject), sizeof(HumanLimit_t250797648 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1369[5] = { HumanLimit_t250797648::get_offset_of_m_Min_0() + static_cast<int32_t>(sizeof(Il2CppObject)), HumanLimit_t250797648::get_offset_of_m_Max_1() + static_cast<int32_t>(sizeof(Il2CppObject)), HumanLimit_t250797648::get_offset_of_m_Center_2() + static_cast<int32_t>(sizeof(Il2CppObject)), HumanLimit_t250797648::get_offset_of_m_AxisLength_3() + static_cast<int32_t>(sizeof(Il2CppObject)), HumanLimit_t250797648::get_offset_of_m_UseDefaultValues_4() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1370 = { sizeof (HumanBone_t1529896151)+ sizeof (Il2CppObject), sizeof(HumanBone_t1529896151_marshaled_pinvoke), 0, 0 }; extern const int32_t g_FieldOffsetTable1370[3] = { HumanBone_t1529896151::get_offset_of_m_BoneName_0() + static_cast<int32_t>(sizeof(Il2CppObject)), HumanBone_t1529896151::get_offset_of_m_HumanName_1() + static_cast<int32_t>(sizeof(Il2CppObject)), HumanBone_t1529896151::get_offset_of_limit_2() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1371 = { sizeof (RuntimeAnimatorController_t670468573), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1372 = { sizeof (AnimatorControllerPlayable_t4078305555), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1373 = { sizeof (AnimationMixerPlayable_t3036622417), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1374 = { sizeof (AnimationLayerMixerPlayable_t641234490), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1375 = { sizeof (AnimationClipPlayable_t4062767676), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1376 = { sizeof (AnimationPlayable_t1693994278), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1377 = { sizeof (AnimationOffsetPlayable_t859920217), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1378 = { sizeof (Motion_t2415020824), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1379 = { sizeof (FontStyle_t2764949590)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1379[5] = { FontStyle_t2764949590::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1380 = { sizeof (TextGenerationError_t780770201)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1380[5] = { TextGenerationError_t780770201::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1381 = { sizeof (TextGenerationSettings_t2543476768)+ sizeof (Il2CppObject), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1381[18] = { TextGenerationSettings_t2543476768::get_offset_of_font_0() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_color_1() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_fontSize_2() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_lineSpacing_3() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_richText_4() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_scaleFactor_5() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_fontStyle_6() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_textAnchor_7() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_alignByGeometry_8() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_resizeTextForBestFit_9() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_resizeTextMinSize_10() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_resizeTextMaxSize_11() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_updateBounds_12() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_verticalOverflow_13() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_horizontalOverflow_14() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_generationExtents_15() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_pivot_16() + static_cast<int32_t>(sizeof(Il2CppObject)), TextGenerationSettings_t2543476768::get_offset_of_generateOutOfBounds_17() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1382 = { sizeof (TextGenerator_t647235000), -1, 0, 0 }; extern const int32_t g_FieldOffsetTable1382[11] = { TextGenerator_t647235000::get_offset_of_m_Ptr_0(), TextGenerator_t647235000::get_offset_of_m_LastString_1(), TextGenerator_t647235000::get_offset_of_m_LastSettings_2(), TextGenerator_t647235000::get_offset_of_m_HasGenerated_3(), TextGenerator_t647235000::get_offset_of_m_LastValid_4(), TextGenerator_t647235000::get_offset_of_m_Verts_5(), TextGenerator_t647235000::get_offset_of_m_Characters_6(), TextGenerator_t647235000::get_offset_of_m_Lines_7(), TextGenerator_t647235000::get_offset_of_m_CachedVerts_8(), TextGenerator_t647235000::get_offset_of_m_CachedCharacters_9(), TextGenerator_t647235000::get_offset_of_m_CachedLines_10(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1383 = { sizeof (TextAnchor_t112990806)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1383[10] = { TextAnchor_t112990806::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, 0, 0, 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1384 = { sizeof (HorizontalWrapMode_t2027154177)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1384[3] = { HorizontalWrapMode_t2027154177::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1385 = { sizeof (VerticalWrapMode_t3668245347)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1385[3] = { VerticalWrapMode_t3668245347::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1386 = { sizeof (Font_t4239498691), -1, sizeof(Font_t4239498691_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1386[2] = { Font_t4239498691_StaticFields::get_offset_of_textureRebuilt_2(), Font_t4239498691::get_offset_of_m_FontTextureRebuildCallback_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1387 = { sizeof (FontTextureRebuildCallback_t1272078033), sizeof(Il2CppMethodPointer), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1388 = { sizeof (UICharInfo_t3056636800)+ sizeof (Il2CppObject), sizeof(UICharInfo_t3056636800 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1388[2] = { UICharInfo_t3056636800::get_offset_of_cursorPos_0() + static_cast<int32_t>(sizeof(Il2CppObject)), UICharInfo_t3056636800::get_offset_of_charWidth_1() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1389 = { sizeof (UILineInfo_t3621277874)+ sizeof (Il2CppObject), sizeof(UILineInfo_t3621277874 ), 0, 0 }; extern const int32_t g_FieldOffsetTable1389[4] = { UILineInfo_t3621277874::get_offset_of_startCharIdx_0() + static_cast<int32_t>(sizeof(Il2CppObject)), UILineInfo_t3621277874::get_offset_of_height_1() + static_cast<int32_t>(sizeof(Il2CppObject)), UILineInfo_t3621277874::get_offset_of_topY_2() + static_cast<int32_t>(sizeof(Il2CppObject)), UILineInfo_t3621277874::get_offset_of_leading_3() + static_cast<int32_t>(sizeof(Il2CppObject)), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1390 = { sizeof (UIVertex_t1204258818)+ sizeof (Il2CppObject), sizeof(UIVertex_t1204258818 ), sizeof(UIVertex_t1204258818_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1390[11] = { UIVertex_t1204258818::get_offset_of_position_0() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818::get_offset_of_normal_1() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818::get_offset_of_color_2() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818::get_offset_of_uv0_3() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818::get_offset_of_uv1_4() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818::get_offset_of_uv2_5() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818::get_offset_of_uv3_6() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818::get_offset_of_tangent_7() + static_cast<int32_t>(sizeof(Il2CppObject)), UIVertex_t1204258818_StaticFields::get_offset_of_s_DefaultColor_8(), UIVertex_t1204258818_StaticFields::get_offset_of_s_DefaultTangent_9(), UIVertex_t1204258818_StaticFields::get_offset_of_simpleVert_10(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1391 = { sizeof (RectTransformUtility_t2941082270), -1, sizeof(RectTransformUtility_t2941082270_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1391[1] = { RectTransformUtility_t2941082270_StaticFields::get_offset_of_s_Corners_0(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1392 = { sizeof (RenderMode_t4280533217)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1392[4] = { RenderMode_t4280533217::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1393 = { sizeof (Canvas_t209405766), -1, sizeof(Canvas_t209405766_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1393[1] = { Canvas_t209405766_StaticFields::get_offset_of_willRenderCanvases_2(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1394 = { sizeof (WillRenderCanvases_t3522132132), sizeof(Il2CppMethodPointer), 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1395 = { 0, -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1396 = { sizeof (CanvasGroup_t3296560743), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1397 = { sizeof (CanvasRenderer_t261436805), -1, 0, 0 }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1398 = { sizeof (Event_t3028476042), sizeof(Event_t3028476042_marshaled_pinvoke), sizeof(Event_t3028476042_StaticFields), 0 }; extern const int32_t g_FieldOffsetTable1398[4] = { Event_t3028476042::get_offset_of_m_Ptr_0(), Event_t3028476042_StaticFields::get_offset_of_s_Current_1(), Event_t3028476042_StaticFields::get_offset_of_s_MasterEvent_2(), Event_t3028476042_StaticFields::get_offset_of_U3CU3Ef__switchU24map0_3(), }; extern const Il2CppTypeDefinitionSizes g_typeDefinitionSize1399 = { sizeof (EventType_t3919834026)+ sizeof (Il2CppObject), sizeof(int32_t), 0, 0 }; extern const int32_t g_FieldOffsetTable1399[33] = { EventType_t3919834026::get_offset_of_value___1() + static_cast<int32_t>(sizeof(Il2CppObject)), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "bruno.penzar@posteo.de" ]
bruno.penzar@posteo.de
e7fa7ef5ade90f4a858558d1d48581938460615b
0b3e67b06db9ef00f2d60815ae7a4709b4359dd7
/gitTest/Source.cpp
d2fa2cafe73a67a46d4266db0e22f381e97ab750
[]
no_license
Nilawyr/gitTest
0284bfb0f8bbdfcd03a07e6a073e49b8ed0c7abd
ed47e49713d44acf284a78653874b6f41bf45fa7
refs/heads/master
2021-01-22T17:33:27.099298
2016-07-11T16:32:39
2016-07-11T16:32:39
63,083,851
0
0
null
null
null
null
UTF-8
C++
false
false
118
cpp
#include<iostream> using namespace std; int main(int argc, char** argv) { cout << "cristian" << end; return 0; }
[ "cristiancarriond@gmail.com" ]
cristiancarriond@gmail.com
5466f9d70ac7b3ba70643682dbc0d5b0d0de0f53
5c2addf99fb73b7a95897eb0486e28e9929fdd08
/Cospro연습문제/Cospro7.cpp
0b6c5f4bdc16abde3c0ca6e7b252be722ed13a55
[]
no_license
UmJaeJeong/Algorithm-DataStruct
902bc7b86dc4b74b8334984a78c0159bd2bc3e5d
51cdd53a7cf815eb20801215d8147fb537d67e59
refs/heads/master
2020-04-03T15:28:36.084262
2019-02-15T01:14:08
2019-02-15T01:14:08
155,363,765
1
0
null
null
null
null
UHC
C++
false
false
1,684
cpp
#include <iostream> #include <string> #include <vector> using namespace std; /*문제7 Cospro 오름차순으로 정렬되어있는 두 배열 arrA, arrB를 하나의 배열로 합치려 합니다. 단, 합친 후의 배열도 오름차순으로 정렬 되어 있어야 합니다. 예를 들어 arrA = [-2, 3, 5, 9], arrB = [0, 1, 5]인 경우 두 배열을 오름차순으로 정렬된 하나의 배열로 합치면 [-2, 0, 1, 3, 5, 5, 9]가 됩니다. 오름차순으로 정렬된 두 배열 arrA와 arrB가 주어졌을 때, 두 배열을 오름차순으로 정렬된 하나의 배열로 합쳐서 return 하 도록 solution 함수를 작성하려 합니다. 빈칸을 채워 전체 코드를 완성해주세요.*/ vector<int> solution(vector<int> arrA, vector<int> arrB) { int arrA_idx = 0, arrB_idx = 0; int arrA_len = arrA.size(); int arrB_len = arrB.size(); vector<int> answer; while (arrA_idx < arrA_len && arrB_idx < arrB_len){ if (arrA[arrA_idx] < arrB[arrB_idx]) { answer.push_back(arrA[arrA_idx++]); } else { answer.push_back(arrB[arrB_idx++]); } } while (arrA_idx < arrA_len) answer.push_back(arrA[arrA_idx++]); while (arrB_idx < arrB_len) answer.push_back(arrB[arrB_idx++]); return answer; } // 아래는 테스트케이스 출력을 해보기 위한 main 함수입니다. int main() { vector<int> arrA = { -2, 3, 5, 9 }; vector<int> arrB = { 0, 1, 5 }; vector<int> ret = solution(arrA, arrB); // [실행] 버튼을 누르면 출력 값을 볼 수 있습니다. cout << "solution 함수의 반환 값은 {"; for (int i = 0; i < ret.size(); i++) { if (i != 0) cout << ", "; cout << ret[i]; } cout << "} 입니다." << endl; }
[ "39511137+UmJaeJeong@users.noreply.github.com" ]
39511137+UmJaeJeong@users.noreply.github.com
01c50f45e49357c8599de3708098b6ddbfd4be84
e06a59d5659a6c4cfd783badf02e662eb3faa633
/matrix.h
8a997b13591879741a17e503ba641aa1fd55d0a9
[]
no_license
lllwwwbbb/MatrixCaculator
543510cd68d64b6b3628dae2972371ae82e65930
61947017510ba58745718bf0d7dd6cd284c65188
refs/heads/master
2020-03-17T17:25:40.269647
2018-05-17T09:07:32
2018-05-17T09:07:32
133,787,859
0
0
null
null
null
null
UTF-8
C++
false
false
542
h
#ifndef MATRIX_H #define MATRIX_H #include <vector> #include <string> using namespace std; //Matrix typedef vector<double> Array; typedef vector<Array> Matrix; //MatrixVariable struct MatrixVar { string varName; Matrix value; bool operator ==(string right) { return this->varName == right; } bool operator ==(MatrixVar& right) { return this->varName == right.varName; } bool operator <(MatrixVar& right) { return this->varName < right.varName; } }; #endif // MATRIX_H
[ "151220068@smail.nju.edu.cn" ]
151220068@smail.nju.edu.cn
8df1ec527a8a0d5b27ab36658b1919417b79f265
8e4015f2e768f8b8edf2b22912c9fcb23db121ee
/jsbridge/jsctx.h
f07571931078b20a4c5d3f9393c0d66f30724050
[]
no_license
JaatSoft/NetOptimist
298f0a4aacecad19ef9da07b27fb9b97b1f253b2
1dd2a421ad1418666605035565e53cc0434c154c
refs/heads/master
2021-09-28T11:34:00.868956
2013-07-20T17:34:02
2013-07-20T17:34:02
null
0
0
null
null
null
null
UTF-8
C++
false
false
360
h
#if !defined(JSBRIDGE_CTX_H) #define JSBRIDGE_CTX_H struct JsData; class DocFormater; class HTMLWindow; class JsCtx { JsData *m_jsdata; public: JsCtx(); ~JsCtx(); void Init(DocFormater *doc); void SetWindow(HTMLWindow *window); void Execute(const char *jscode); void ExecuteStip(const char *jscode); void SourceFile(const char *filename); }; #endif
[ "" ]
bb3af3e0628bd6708de6f8cf0be9189d4624019d
3552d35a4408055635807b4d3351570be7a5dafa
/System Course/swapknodes/swapknodes/swapknodes.cpp
b40e58eb68eaf736579eaec3940fa34015b569dc
[]
no_license
ramyasree0299/summer2019_GNITS_ramyasree
0d54f65b8a752091df03e8f3faa3208e88036a07
bd408c0caf86bd9116acf6b85d7bb8fd062ae0f5
refs/heads/master
2020-06-01T23:16:56.196222
2019-06-23T13:04:08
2019-06-23T13:04:08
190,962,568
0
0
null
null
null
null
UTF-8
C++
false
false
2,290
cpp
#include "stdafx.h" #include<stdio.h> #include<conio.h> #include<stdlib.h> struct node { int data; struct node *next; }; int n, n1; typedef struct node Node; Node *reverse(Node *head) { Node *temp = head; Node *prev = NULL; Node *next; while (temp != NULL) { next = temp->next; temp->next = prev; prev = temp; temp = next; } head = prev; return head; } Node *foo(Node *head, int k) { Node *t1; Node *thead = NULL; Node *nhead; Node *tlist = head; Node *temp; Node *remain = NULL; int i = 0; if (n%k!=0) n1 = (n1%k)*k; printf("n1 : %d ", n1); temp = head; /*while (i<n1) { temp = temp->next; i++; } remain = temp;*/ while (n1>0) { i = 0; temp = tlist; while (i<k - 1 && temp != NULL) { temp = temp->next; i++; } if (temp != NULL) { nhead = temp->next; temp->next = NULL; tlist = reverse(tlist); if (thead == NULL) thead = tlist; else { t1 = thead; while (t1->next != NULL) t1 = t1->next; t1->next = tlist; } tlist = nhead; } n1 /= k; } i = 0; if (n%k != 0) { temp = thead; while (temp->next != NULL) temp = temp->next; } temp->next = remain; head = thead; return head; } int main() { n = 6; n1 = 6; int k = 3; int i; struct node *head = (struct node*)malloc(sizeof(struct node)); struct node *temp1 = (struct node*)malloc(sizeof(struct node)); struct node *temp2 = (struct node*)malloc(sizeof(struct node)); struct node *temp3 = (struct node*)malloc(sizeof(struct node)); struct node *temp4 = (struct node*)malloc(sizeof(struct node)); struct node *temp5 = (struct node*)malloc(sizeof(struct node)); struct node *temp6 = (struct node*)malloc(sizeof(struct node)); struct node *temp7 = (struct node*)malloc(sizeof(struct node)); temp7->data = 8; temp7->next = NULL; temp6->data = 7; temp6->next = temp7; temp5->data = 6; temp5->next = NULL; temp4->data = 5; temp4->next = temp5; temp3->data = 4; temp3->next = temp4; temp2->data = 3; temp2->next = temp3; temp1->data = 2; temp1->next = temp2; head->data = 1; head->next = temp1; Node *temp; head = foo(head, k); temp = head; printf("%d-->", head); printf("The swapped %d nodes\n", k); while (temp != NULL){ printf("%d\t", temp->data); temp = temp->next; } _getch(); return 0; }
[ "ramyasree0299@gmail.com" ]
ramyasree0299@gmail.com
7fa4d6a91110d35f2a5e36b3a302287631e06e5a
85696df622aab676e2b21982ef0940f3b9d49d9d
/sources/crystax/vfs/getdents.cpp
05b4879e7c48d3f2581632e2707808b11bb8cf04
[ "BSD-2-Clause-Views" ]
permissive
Liryna/android-platform-ndk
e6acbdd5b02eae1250fab458c9c83bbcf7225161
c0414a70629341b965f82bd00e27fbad5563f7de
refs/heads/master
2021-01-13T03:46:55.760089
2016-12-23T14:45:41
2016-12-23T14:45:41
77,230,446
1
0
null
2016-12-23T14:28:49
2016-12-23T14:28:49
null
UTF-8
C++
false
false
2,142
cpp
/* * Copyright (c) 2011-2015 CrystaX. * All rights reserved. * * 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. * * THIS SOFTWARE IS PROVIDED BY CrystaX ''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 CrystaX 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. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of CrystaX. */ #include "fileio/api.hpp" namespace crystax { namespace fileio { CRYSTAX_LOCAL int getdents(unsigned int fd, struct dirent *entry, unsigned int count) { DBG("fd=%u, dirp=%p, count=%u", fd, entry, count); int extfd; driver_t *driver; if (!resolve((int)fd, NULL, &extfd, NULL, &driver)) return -1; return driver->getdents((unsigned int)extfd, entry, count); } } // namespace fileio } // namespace crystax CRYSTAX_GLOBAL int getdents(unsigned int fd, struct dirent *entry, unsigned int count) { return ::crystax::fileio::getdents(fd, entry, count); }
[ "dm@crystax.net" ]
dm@crystax.net
b35d2488ca04ea0ef2f1ad8e27003d5383d02fbc
31ac07ecd9225639bee0d08d00f037bd511e9552
/externals/OCCTLib/inc/StepToGeom_MakeVectorWithMagnitude2d.hxx
ad4c7f35f0dd06b5cd48408f2b934a5b520e504b
[]
no_license
litao1009/SimpleRoom
4520e0034e4f90b81b922657b27f201842e68e8e
287de738c10b86ff8f61b15e3b8afdfedbcb2211
refs/heads/master
2021-01-20T19:56:39.507899
2016-07-29T08:01:57
2016-07-29T08:01:57
64,462,604
1
0
null
null
null
null
UTF-8
C++
false
false
1,476
hxx
// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _StepToGeom_MakeVectorWithMagnitude2d_HeaderFile #define _StepToGeom_MakeVectorWithMagnitude2d_HeaderFile #ifndef _Standard_HeaderFile #include <Standard.hxx> #endif #ifndef _Standard_DefineAlloc_HeaderFile #include <Standard_DefineAlloc.hxx> #endif #ifndef _Standard_Macro_HeaderFile #include <Standard_Macro.hxx> #endif #ifndef _Standard_Boolean_HeaderFile #include <Standard_Boolean.hxx> #endif #ifndef _Handle_StepGeom_Vector_HeaderFile #include <Handle_StepGeom_Vector.hxx> #endif #ifndef _Handle_Geom2d_VectorWithMagnitude_HeaderFile #include <Handle_Geom2d_VectorWithMagnitude.hxx> #endif class StepGeom_Vector; class Geom2d_VectorWithMagnitude; //! This class implements the mapping between classes <br> //! Vector from StepGeom which describes a VectorWithMagnitude <br> //! from Prostep and VectorWithMagnitude from Geom2d. <br> class StepToGeom_MakeVectorWithMagnitude2d { public: DEFINE_STANDARD_ALLOC Standard_EXPORT static Standard_Boolean Convert(const Handle(StepGeom_Vector)& SV,Handle(Geom2d_VectorWithMagnitude)& CV) ; protected: private: }; // other Inline functions and methods (like "C++: function call" methods) #endif
[ "litao1009@gmail.com" ]
litao1009@gmail.com
511ef3cc508c06c5667bfa50c3b164a18facdc5c
3cf9e141cc8fee9d490224741297d3eca3f5feff
/C++ Benchmark Programs/Benchmark Files 1/classtester/autogen-sources/source-17183.cpp
7c20722a0c8ffa6116a03898a1fa7e7e3bd503fb
[]
no_license
TeamVault/tauCFI
e0ac60b8106fc1bb9874adc515fc01672b775123
e677d8cc7acd0b1dd0ac0212ff8362fcd4178c10
refs/heads/master
2023-05-30T20:57:13.450360
2021-06-14T09:10:24
2021-06-14T09:10:24
154,563,655
0
1
null
null
null
null
UTF-8
C++
false
false
3,677
cpp
struct c0; void __attribute__ ((noinline)) tester0(c0* p); struct c0 { bool active0; c0() : active0(true) {} virtual ~c0() { tester0(this); active0 = false; } virtual void f0(){} }; void __attribute__ ((noinline)) tester0(c0* p) { p->f0(); } struct c1; void __attribute__ ((noinline)) tester1(c1* p); struct c1 : virtual c0 { bool active1; c1() : active1(true) {} virtual ~c1() { tester1(this); c0 *p0_0 = (c0*)(c1*)(this); tester0(p0_0); active1 = false; } virtual void f1(){} }; void __attribute__ ((noinline)) tester1(c1* p) { p->f1(); if (p->active0) p->f0(); } struct c2; void __attribute__ ((noinline)) tester2(c2* p); struct c2 : virtual c0, virtual c1 { bool active2; c2() : active2(true) {} virtual ~c2() { tester2(this); c0 *p0_0 = (c0*)(c2*)(this); tester0(p0_0); c0 *p0_1 = (c0*)(c1*)(c2*)(this); tester0(p0_1); c1 *p1_0 = (c1*)(c2*)(this); tester1(p1_0); active2 = false; } virtual void f2(){} }; void __attribute__ ((noinline)) tester2(c2* p) { p->f2(); if (p->active0) p->f0(); if (p->active1) p->f1(); } struct c3; void __attribute__ ((noinline)) tester3(c3* p); struct c3 : virtual c1, virtual c2, virtual c0 { bool active3; c3() : active3(true) {} virtual ~c3() { tester3(this); c0 *p0_0 = (c0*)(c1*)(c3*)(this); tester0(p0_0); c0 *p0_1 = (c0*)(c2*)(c3*)(this); tester0(p0_1); c0 *p0_2 = (c0*)(c1*)(c2*)(c3*)(this); tester0(p0_2); c0 *p0_3 = (c0*)(c3*)(this); tester0(p0_3); c1 *p1_0 = (c1*)(c3*)(this); tester1(p1_0); c1 *p1_1 = (c1*)(c2*)(c3*)(this); tester1(p1_1); c2 *p2_0 = (c2*)(c3*)(this); tester2(p2_0); active3 = false; } virtual void f3(){} }; void __attribute__ ((noinline)) tester3(c3* p) { p->f3(); if (p->active0) p->f0(); if (p->active1) p->f1(); if (p->active2) p->f2(); } struct c4; void __attribute__ ((noinline)) tester4(c4* p); struct c4 : virtual c1, virtual c2, virtual c0 { bool active4; c4() : active4(true) {} virtual ~c4() { tester4(this); c0 *p0_0 = (c0*)(c1*)(c4*)(this); tester0(p0_0); c0 *p0_1 = (c0*)(c2*)(c4*)(this); tester0(p0_1); c0 *p0_2 = (c0*)(c1*)(c2*)(c4*)(this); tester0(p0_2); c0 *p0_3 = (c0*)(c4*)(this); tester0(p0_3); c1 *p1_0 = (c1*)(c4*)(this); tester1(p1_0); c1 *p1_1 = (c1*)(c2*)(c4*)(this); tester1(p1_1); c2 *p2_0 = (c2*)(c4*)(this); tester2(p2_0); active4 = false; } virtual void f4(){} }; void __attribute__ ((noinline)) tester4(c4* p) { p->f4(); if (p->active0) p->f0(); if (p->active1) p->f1(); if (p->active2) p->f2(); } int __attribute__ ((noinline)) inc(int v) {return ++v;} int main() { c0* ptrs0[25]; ptrs0[0] = (c0*)(new c0()); ptrs0[1] = (c0*)(c1*)(new c1()); ptrs0[2] = (c0*)(c2*)(new c2()); ptrs0[3] = (c0*)(c1*)(c2*)(new c2()); ptrs0[4] = (c0*)(c1*)(c3*)(new c3()); ptrs0[5] = (c0*)(c2*)(c3*)(new c3()); ptrs0[6] = (c0*)(c1*)(c2*)(c3*)(new c3()); ptrs0[7] = (c0*)(c3*)(new c3()); ptrs0[8] = (c0*)(c1*)(c4*)(new c4()); ptrs0[9] = (c0*)(c2*)(c4*)(new c4()); ptrs0[10] = (c0*)(c1*)(c2*)(c4*)(new c4()); ptrs0[11] = (c0*)(c4*)(new c4()); for (int i=0;i<12;i=inc(i)) { tester0(ptrs0[i]); delete ptrs0[i]; } c1* ptrs1[25]; ptrs1[0] = (c1*)(new c1()); ptrs1[1] = (c1*)(c2*)(new c2()); ptrs1[2] = (c1*)(c3*)(new c3()); ptrs1[3] = (c1*)(c2*)(c3*)(new c3()); ptrs1[4] = (c1*)(c4*)(new c4()); ptrs1[5] = (c1*)(c2*)(c4*)(new c4()); for (int i=0;i<6;i=inc(i)) { tester1(ptrs1[i]); delete ptrs1[i]; } c2* ptrs2[25]; ptrs2[0] = (c2*)(new c2()); ptrs2[1] = (c2*)(c3*)(new c3()); ptrs2[2] = (c2*)(c4*)(new c4()); for (int i=0;i<3;i=inc(i)) { tester2(ptrs2[i]); delete ptrs2[i]; } c3* ptrs3[25]; ptrs3[0] = (c3*)(new c3()); for (int i=0;i<1;i=inc(i)) { tester3(ptrs3[i]); delete ptrs3[i]; } c4* ptrs4[25]; ptrs4[0] = (c4*)(new c4()); for (int i=0;i<1;i=inc(i)) { tester4(ptrs4[i]); delete ptrs4[i]; } return 0; }
[ "ga72foq@mytum.de" ]
ga72foq@mytum.de
3411088244be6e1f210a5abd6bc86418ec63795f
bf437a984f4176f99ff1a8c6a7f60a64259b2415
/src/inet/physicallayer/analogmodel/packetlevel/ScalarReception.cc
9492c0e8f17f81a388496b5bc0115292206a1842
[]
no_license
kvetak/ANSA
b8bcd25c9c04a09d5764177e7929f6d2de304e57
fa0f011b248eacf25f97987172d99b39663e44ce
refs/heads/ansainet-3.3.0
2021-04-09T16:36:26.173317
2017-02-16T12:43:17
2017-02-16T12:43:17
3,823,817
10
16
null
2017-02-16T12:43:17
2012-03-25T11:25:51
C++
UTF-8
C++
false
false
1,625
cc
// // Copyright (C) 2013 OpenSim Ltd. // // 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 2 // 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 "inet/physicallayer/analogmodel/packetlevel/ScalarReception.h" namespace inet { namespace physicallayer { ScalarReception::ScalarReception(const IRadio *radio, const ITransmission *transmission, const simtime_t startTime, const simtime_t endTime, const Coord startPosition, const Coord endPosition, const EulerAngles startOrientation, const EulerAngles endOrientation, Hz carrierFrequency, Hz bandwidth, W power) : FlatReceptionBase(radio, transmission, startTime, endTime, startPosition, endPosition, startOrientation, endOrientation, carrierFrequency, bandwidth), power(power) { } std::ostream& ScalarReception::printToStream(std::ostream& stream, int level) const { stream << "ScalarReception"; if (level >= PRINT_LEVEL_DETAIL) stream << ", power = " << power; return FlatReceptionBase::printToStream(stream, level); } } // namespace physicallayer } // namespace inet
[ "ivesely@fit.vutbr.cz" ]
ivesely@fit.vutbr.cz
58a0a488fc925af7badb0627c089e67ef2bac3ea
6f46ce977ba07a401a976f4dea4ddcec0b577cb6
/Creative/game/particle_generator.cpp
af7b7aec631a1decd1c6c8887249f3d2593ae8c5
[]
no_license
LOOK2001/Physically-Based-Animation-GLFW
7c1c9eeb1b32f9c7630d97f5db6fab6fa2b63999
a06399b0f4c5809720f0ef69bf6ab6f1689d3a70
refs/heads/master
2020-09-21T20:52:42.301089
2019-12-02T06:38:19
2019-12-02T06:38:19
224,924,854
0
1
null
null
null
null
UTF-8
C++
false
false
3,933
cpp
#include "particle_generator.h" #include "../common.h" #include "../Renderer.h" #include "../pba/core/PbaViewer.h" #include <glad/glad.h> #include <glm/glm.hpp> #include <iostream> ParticleGenerator::ParticleGenerator(unsigned int num, DynamicalState& pq) :PQ(pq), amount(num) { } void ParticleGenerator::OnUpdate(float deltaTime) { size_t size = (amount > PQ->nb()) ? PQ->nb() : amount; // Update all particles for (size_t i = 0; i < size; i++) { Particle& p = this->particles[i]; p.Position = PQ->pos(i); } } void ParticleGenerator::Display() { PbaViewer* _viewer = PbaViewer::Instance(); Renderer renderer; Camera* _camera = _viewer->GetMainCamera(); m_Texture->Bind(); { glm::mat4 projection = glm::perspective(glm::radians(_camera->Zoom), (float)PbaViewer::Instance()->GetScreenWidth() / (float)PbaViewer::Instance()->GetScreenHeight() , 0.1f, 100.0f); m_Shader->SetUniformMat4f("projection", projection); glm::mat4 view = _camera->GetViewMatrix(); m_Shader->SetUniformMat4f("view", view); size_t size = (amount > PQ->nb()) ? PQ->nb() : amount; for (size_t i = 0; i < size; i++) { Particle& p = this->particles[i]; // calculate the model matrix for each object and pass it to shader before drawing glm::mat4 model = glm::mat4(1.0f); // make sure to initialize matrix to identity matrix first model = glm::translate(model, glm::vec3(p.Position.X(), p.Position.Y(), p.Position.Z()) ); float angle = 20.0f * 9; model = glm::rotate(model, glm::radians(angle), glm::vec3(1.0f, 0.0f, 0.0f)); m_Shader->SetUniformMat4f("model", model); m_Shader->Bind(); renderer.Draw(*m_VAO, *m_IndexBuffer, *m_Shader); } } } void ParticleGenerator::Init() { const float vertices[] = { -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, 1.0f, 1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 0.5f, -0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 1.0f, 1.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.5f, 0.5f, -0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f }; size_t size = sizeof(vertices); unsigned int indices[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 }; m_VAO = std::make_unique<VertexArray>(); m_VertexBuffer = std::make_unique<VertexBuffer>(vertices, size); VertexBufferLayout layout; layout.Push<float>(3); layout.Push<float>(2); m_VAO->AddBuffer(*m_VertexBuffer, layout); m_IndexBuffer = std::make_unique<IndexBuffer>(indices, size / sizeof(float)); m_Shader = std::make_unique<Shader>("res/shaders/Basic3D.shader"); m_Shader->Bind(); m_Texture = std::make_unique<Texture>("res/textures/ChernoLogo.png"); m_Shader->SetUniform1i("texture1", 0); // Create amount default particle instances size_t size_particles = (amount > PQ->nb()) ? PQ->nb() : amount; for (size_t i = 0; i < size_particles; i++) particles.push_back(Particle()); }
[ "shengwang1996@126.com" ]
shengwang1996@126.com
1f9deac17fdab8d672ee708b8352274db4fc665b
e9ade5ea33cf3382f8ab3ad980e7f6d8cb76faf8
/solved/use_fenwick_tree.cpp
22ff270c2786db56d52db40a095f855e8f83afa4
[]
no_license
Creamy1137689/kyopro
75bc3f92edb7bff2cbf27dc79d384b422a0a4702
dcacbf27defe840ea7998e06a5f3fb78718e7d53
refs/heads/master
2023-05-10T19:28:56.447493
2021-06-03T12:54:11
2021-06-03T12:54:11
266,143,691
0
0
null
null
null
null
UTF-8
C++
false
false
946
cpp
#include <iostream> #include <iomanip> #include <utility> #include <cmath> #include <random> #include <vector> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <string> #include <algorithm> #include <atcoder/all> using namespace std; using namespace atcoder; #define rep(i,n) for(int i = 0; i<n; ++i) #define REP(i,n) for(int i = 1; i<=n; ++i) #define all(x) begin(x),end(x) #define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;} #define line "----------" typedef long long ll; typedef pair<int,int> P; typedef pair<ll,ll> LP; const int inf = 1001001000; const ll INF = 1LL<<60; const int MOD = (int)1e9 + 7; int main(){ int N, Q, a, com, l, r; cin >> N >> Q; fenwick_tree<ll> fw(N); rep(i,N){ cin >> a; fw.add(i, a); } rep(_,Q){ cin >> com >> l >> r; if(com == 0)fw.add(l, r); else cout << fw.sum(l,r) << endl; } return 0; }
[ "exception031noexist@gmail.com" ]
exception031noexist@gmail.com
997ae853ff481ba40e24fd12ec14a6d0e7a50089
12d9e3ed40f1d5706932a3e44e8a08ca185b52cf
/Sphere Online Judge/PT07Z - Longest path in a tree.cc
9d1d74ff8cd765aafb0582addfe9c5933dd27ea9
[]
no_license
SebastianJM/Competitive-Programming
25f83ceb607fcc3d95fa35c5f06cb7894413b857
5cd9de9485ae3f882a7c85292a77e5d662fce08f
refs/heads/master
2020-03-23T21:25:42.970408
2018-11-20T05:06:46
2018-11-20T05:06:46
142,105,914
1
0
null
null
null
null
WINDOWS-1250
C++
false
false
1,036
cc
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> Pii; typedef vector<int> Vi; typedef vector<Pii> VPii; typedef vector<Vi> VVi; typedef vector<VPii> VVPii; #define pb(x) push_back(x) #define MAX 10004 VVi g; bool visit[MAX]; Pii bfs(int x) { queue<Pii> q; q.push(Pii(x,0)); int node=x,y; int dis=0; while(!q.empty()) { x=q.front().first; y=q.front().second; q.pop(); visit[x]=true; if(dis<y) { dis=y; node=x; } for(int i=0;i<g[x].size();i++) if(!visit[g[x][i]]) { visit[g[x][i]]=true; q.push(Pii(g[x][i],y+1)); } } return Pii(node,dis); } int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n,u,v; cin>>n; g=VVi(n+1); for(int i=0;i<n-1;i++) { cin>>u>>v; g[u].pb(v); g[v].pb(u); } memset(visit,false,sizeof visit); int fur=bfs(1).first; //Primer BFS para encontrar el nodo más lejano a 1 memset(visit,false,sizeof visit); int ans=bfs(fur).second; //Segundo BFS para hallar el diámetro cout<<ans<<"\n"; }
[ "sebastianjmdlc@gmail.com" ]
sebastianjmdlc@gmail.com
65553866a1d9b03aef3a74bd4909ec8f23e6a2f7
d4c720f93631097ee048940d669e0859e85eabcf
/chrome/browser/ash/web_applications/face_ml_system_web_app_info.cc
b8e9aac25036d59a3b34fc987e72e3bf1c38e6c3
[ "BSD-3-Clause" ]
permissive
otcshare/chromium-src
26a7372773b53b236784c51677c566dc0ad839e4
3b920d87437d9293f654de1f22d3ea341e7a8b55
refs/heads/webnn
2023-03-21T03:20:15.377034
2023-01-25T21:19:44
2023-01-25T21:19:44
209,262,645
18
21
BSD-3-Clause
2023-03-23T06:20:07
2019-09-18T08:52:07
null
UTF-8
C++
false
false
3,251
cc
// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ash/web_applications/face_ml_system_web_app_info.h" #include <memory> #include "ash/constants/ash_features.h" #include "ash/webui/face_ml_app_ui/url_constants.h" #include "ash/webui/grit/ash_face_ml_app_resources.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/ash/web_applications/system_web_app_install_utils.h" #include "chrome/browser/web_applications/user_display_mode.h" #include "chrome/browser/web_applications/web_app_constants.h" #include "chrome/browser/web_applications/web_app_install_info.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom.h" #include "ui/chromeos/styles/cros_styles.h" #include "ui/display/screen.h" namespace { constexpr gfx::Size DEFAULT_SIZE(800, 600); } // namespace std::unique_ptr<WebAppInstallInfo> CreateWebAppInfoForFaceMLApp() { std::unique_ptr<WebAppInstallInfo> info = std::make_unique<WebAppInstallInfo>(); info->start_url = GURL(ash::kChromeUIFaceMLAppURL); info->scope = GURL(ash::kChromeUIFaceMLAppURL); // TODO(b/239374316): Convert the title to a localized string info->title = u"Face ML"; web_app::CreateIconInfoForSystemWebApp( info->start_url, { {"app_icon_192.png", 192, IDR_ASH_FACE_ML_APP_APP_ICON_192_PNG}, {"app_icon_512.png", 512, IDR_ASH_FACE_ML_APP_APP_ICON_512_PNG}, }, *info); // Support Dark/Light mode. if (ash::features::IsDarkLightModeEnabled()) { info->theme_color = cros_styles::ResolveColor( cros_styles::ColorName::kBgColor, /*is_dark_mode=*/false); info->dark_mode_theme_color = cros_styles::ResolveColor(cros_styles::ColorName::kBgColor, /*is_dark_mode=*/true); info->background_color = info->theme_color; info->dark_mode_background_color = info->dark_mode_theme_color; } else { info->theme_color = 0xffffffff; info->background_color = 0xffffffff; } info->display_mode = blink::mojom::DisplayMode::kStandalone; info->user_display_mode = web_app::UserDisplayMode::kStandalone; return info; } FaceMLSystemAppDelegate::FaceMLSystemAppDelegate(Profile* profile) : ash::SystemWebAppDelegate(ash::SystemWebAppType::FACE_ML, "FaceML", GURL(ash::kChromeUIFaceMLAppURL), profile) {} std::unique_ptr<WebAppInstallInfo> FaceMLSystemAppDelegate::GetWebAppInfo() const { return CreateWebAppInfoForFaceMLApp(); } gfx::Rect FaceMLSystemAppDelegate::GetDefaultBounds(Browser* browser) const { gfx::Rect bounds = display::Screen::GetScreen()->GetDisplayForNewWindows().work_area(); bounds.ClampToCenteredSize(DEFAULT_SIZE); return bounds; } bool FaceMLSystemAppDelegate::IsAppEnabled() const { return base::FeatureList::IsEnabled(ash::features::kFaceMLApp); } bool FaceMLSystemAppDelegate::ShouldCaptureNavigations() const { return true; } bool FaceMLSystemAppDelegate::ShouldShowNewWindowMenuOption() const { return false; }
[ "chromium-scoped@luci-project-accounts.iam.gserviceaccount.com" ]
chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
a54344895506c9ea67cedc81f5b3014b41cc07e6
101321a2edcb45ab1c8c6e4d2583b878589fe96e
/User/UserMenu.h
b4f65205f4cb913a9460b00e0a1db17bf3cc3b4a
[]
no_license
mark2002007/2K1SNP
c3aa8a5cde44c8e2f7efcc872ae7affb71cfc77d
30a75e3fa843eed69f3baad347d494ee6d08c2b2
refs/heads/master
2023-01-22T02:27:57.421457
2020-12-02T09:07:51
2020-12-02T09:07:51
304,910,818
0
0
null
null
null
null
UTF-8
C++
false
false
792
h
#pragma once #include <iostream> #include "Repository.h" #include "BookRepository.h" #include "Author.h" #include "Customer.h" #include "Employee.h" using namespace std; class Menu { private: string pointer; int pPos = 1; string list_ind; string title; Repository<Author> authorRepository = Repository<Author>(true); Repository<Customer> customerRepository = Repository<Customer>(true); Repository<Employee> employeeRepository = Repository<Employee>(true); BookRepository bookRepository = BookRepository(authorRepository, true); public: //ctr Menu(string = "", string = "", string = "<"); void ShowMenu(); void ShowAdd(); void ShowRemove(); void ShowShow(); void ShowSettings(); //Settings Methods void ChangeTitle(); void ChangeIndexation(); void ChangePointer(); };
[ "markmandzak2002@gmail.com" ]
markmandzak2002@gmail.com
dbd3c260ea3694f3989ae6088165989d8d91c62f
260e5dec446d12a7dd3f32e331c1fde8157e5cea
/Indi/SDK/Indi_Default_functions.cpp
97ef1a5bb7291880cfbbab717d7f1f07a0e5d5e7
[]
no_license
jfmherokiller/TheOuterWorldsSdkDump
6e140fde4fcd1cade94ce0d7ea69f8a3f769e1c0
18a8c6b1f5d87bb1ad4334be4a9f22c52897f640
refs/heads/main
2023-08-30T09:27:17.723265
2021-09-17T00:24:52
2021-09-17T00:24:52
407,437,218
0
0
null
null
null
null
UTF-8
C++
false
false
342
cpp
// TheOuterWorlds SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "Indi_Default_parameters.hpp" namespace SDK { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "peterpan0413@live.com" ]
peterpan0413@live.com
8ddb8cc1fae5e02286c829d7255d3a59bca7ec5c
305fcec4e4cb01dbcc0ccb779a227649d1199cf2
/LongWordsDiv2.cpp
0ad5cbbb4bde56cf1d1f656f86f9a84541ddd90d
[]
no_license
Taxiway/TC_Codes
3b47e22f901a480d3b8291d560a61395be862840
05815b3ec8d320f7ad8b99fc4fa2d3d11eb44f04
refs/heads/master
2020-12-24T17:08:23.672337
2014-12-26T09:24:20
2014-12-26T09:24:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,551
cpp
// Orz AekdyCoin 福大核武景润后人 #include <cstdio> #include <algorithm> #include <cstring> #include <vector> #include <queue> #include <set> #include <map> #include <cmath> #include <cstdlib> #include <iostream> #include <sstream> #include <functional> #include <cctype> #include <string> using namespace std; #define all(X) (X).begin(), (X).end() #define sz(a) int((a).size()) typedef long long ll; class LongWordsDiv2 { public: string find(string word); }; bool isok(string s1, string s2) { set<char> st; for (int i = 0; i < sz(s1); ++i) st.insert(s1[i]); for (int i = 0; i < sz(s2); ++i) { if (st.count(s2[i])) return false; } return true; } string LongWordsDiv2::find(string word) { for (int i = 1; i < sz(word); ++i) { if (word[i] == word[i - 1]) return "Dislikes"; } for (int i = 0; i < sz(word); ++i) { for (int j = i + 1; j < sz(word); ++j) { if (word[i] == word[j]) { if (!isok(word.substr(i + 1, j - i - 1), word.substr(j + 1))) return "Dislikes"; } } } return "Likes"; } // BEGIN CUT HERE /* // PROBLEM STATEMENT // Fox Ciel likes all the words that have the following properties: Each letter of the word is an uppercase English letter. Equal letters are never consecutive. There is no subsequence of the form xyxy, where x and y are (not necessarily distinct) letters. Note that a subsequence doesn't have to be contiguous. Examples: Ciel does not like "ABBA" because there are two consecutive 'B's. Ciel does not like "THETOPCODER" because it contains the subsequence "TETE". Ciel does not like "ABACADA" because it contains the subsequence "AAAA". (Note that here x=y='A'.) Ciel likes "A", "ABA", and also "ABCBA". Given a string word, return "Likes" (quotes for clarity) if Ciel likes word and "Dislikes" if she does not. DEFINITION Class:LongWordsDiv2 Method:find Parameters:string Returns:string Method signature:string find(string word) CONSTRAINTS -word will contain between 1 and 100 characters, inclusive. -Each character of word will be an uppercase English letter ('A'-'Z'). EXAMPLES 0) "AAA" Returns: "Dislikes" 1) "ABCBA" Returns: "Likes" 2) "ABCBAC" Returns: "Dislikes" 3) "TOPCODER" Returns: "Likes" 4) "VAMOSGIMNASIA" Returns: "Dislikes" 5) "SINGLEROUNDMATCH" Returns: "Likes" 6) "DALELOBO" Returns: "Likes" */ #define ARRSIZE(x) (sizeof(x)/sizeof(x[0])) template<typename T> void print(T a) { cerr << a; } void print(long long a) { cerr << a << "LL"; } void print(string a) { cerr << '"' << a << '"'; } template<typename T> void print(vector<T> a) { cerr << "{"; for (unsigned i = 0; i != a.size(); i++) { if (i != 0) cerr << ", "; print(a[i]); } cerr << "}" << endl; } template<typename T> void eq(int n, T have, T need) { if (have == need) { cerr << "Case " << n << " passed." << endl; } else { cerr << "Case " << n << " failed: expected "; print(need); cerr << " received "; print(have); cerr << "." << endl; } } template<typename T> void eq(int n, vector<T> have, vector<T> need) { if(have.size() != need.size()) { cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements."; print(have); print(need); return; } for(unsigned i = 0; i < have.size(); i++) { if(have[i] != need[i]) { cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << "."; print(have); print(need); return; } } cerr << "Case " << n << " passed." << endl; } void eq(int n, string have, string need) { if (have == need) { cerr << "Case " << n << " passed." << endl; } else { cerr << "Case " << n << " failed: expected "; print(need); cerr << " received "; print(have); cerr << "." << endl; } } int main() { { LongWordsDiv2 theObject; eq(0, theObject.find("AAA"),"Dislikes"); } { LongWordsDiv2 theObject; eq(1, theObject.find("ABCBA"),"Likes"); } { LongWordsDiv2 theObject; eq(2, theObject.find("ABCBAC"),"Dislikes"); } { LongWordsDiv2 theObject; eq(3, theObject.find("TOPCODER"),"Likes"); } { LongWordsDiv2 theObject; eq(4, theObject.find("VAMOSGIMNASIA"),"Dislikes"); } { LongWordsDiv2 theObject; eq(5, theObject.find("SINGLEROUNDMATCH"),"Likes"); } { LongWordsDiv2 theObject; eq(6, theObject.find("DALELOBO"),"Likes"); } } // END CUT HERE
[ "hang.hang.zju@gmail.com" ]
hang.hang.zju@gmail.com
bb12e3671d9af83ec46047f1636dfb65132479c8
4a48e01886c76b4067bfac67f547f0daac904da0
/singleLDA/lda.h
83aaa36bc2c5b40cf2bca86bfea415b1b7c94128
[ "Apache-2.0" ]
permissive
guzhaki/lda
6c2c52b1c0c573b3ae6c6cf179128f33b67b446f
74ec742481f5209828c8f937324d4f2a1487affb
refs/heads/master
2021-01-18T03:17:09.101220
2015-05-18T06:28:52
2015-05-18T06:28:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,488
h
#ifndef _LDA_H #define _LDA_H #include <iostream> #include <thread> #include <chrono> #include <vector> #include <queue> #include "model.h" #include "utils.h" #include "vose.h" #include "fTree.h" #include "forest.h" class simpleLDA : public model { public: // estimate LDA model using Gibbs sampling int specific_init(); int sampling(int m); }; class unifLDA : public model { public: // estimate LDA using Metropolis within Gibbs with uniform proposal int specific_init(); int sampling(int m); }; class sparseLDA : public model { public: std::vector< std::vector< std::pair<int, int> > > nws; double ssum, rsum, qsum; double *q1; // estimate LDA model using sparse strategy of Yao09 int specific_init(); int sampling(int m); }; class aliasLDA : public model { public: std::vector<voseAlias*> q; // estimate LDA model using alias sampling int specific_init(); int sampling(int m); void generateQtable(int i); ~aliasLDA() { for(int w=0; w<V; ++w) delete q[w]; } }; class FTreeLDA : public model { public: fTree *trees; // estimate LDA model using F+ Tree int specific_init(); int sampling(int m); }; class forestLDA : public model { public: forestSample *q; // estimate LDA model using alias sampling int specific_init(); int sampling(int m); }; class lightLDA : public model { public: std::vector<voseAlias> q; // estimate LDA model using alias sampling int specific_init(); int sampling(int m); void generateQtable(int i); }; #endif
[ "manzilzaheer@gmail.com" ]
manzilzaheer@gmail.com
2bcb3b1abf1f8478fbd9564acc68cc2d30ff82b5
fe5aa6ffd43d5b417a09d9e4788a1ce0fa7c2623
/cmake/Tests/Qt4And5Automoc/main_qt4.cpp
a84ce897fda2a7c6223c2dda366423ed07adc08f
[ "BSD-3-Clause" ]
permissive
soegaard/racket-osx-libs
5356e39d17ff208cb582912307e79e5baa540930
6341cc182c2645ebe9f175f56e7ba0b557eef893
refs/heads/master
2021-01-23T03:58:57.549738
2019-04-28T12:12:14
2019-04-28T12:12:14
14,662,966
5
2
null
2019-04-28T12:12:15
2013-11-24T14:50:34
C
UTF-8
C++
false
false
46
cpp
#include "main.cpp" #include "main_qt4.moc"
[ "jensaxel@soegaard.net" ]
jensaxel@soegaard.net
ea8d725f5a66ac7afe3f7ddff11302c4294645a2
1504b15a66e14c960b9b7db7a9ddfcba281bc4e0
/apm_phase5/catkin_ws/src/apm_autonomous/src/local_driver.cpp
6986e8e88bb26b8cf2f84d143059b1bb230de23a
[]
no_license
Kennya-42/Deep-SLAM
62c046501a14a1a01c4d33004865bcbb57a84e8e
b0a1c09ca1b39f99fb5adf0a8f6fd30136ff0049
refs/heads/master
2023-03-15T15:14:54.931547
2018-04-17T15:08:00
2018-04-17T15:08:00
119,864,090
0
0
null
null
null
null
UTF-8
C++
false
false
8,875
cpp
/** * pilot.cpp * Pioneer robot driver - this node takes a set of waypoints * and drives the robot through them * Alex Avery * 2/6/16 */ #include "ros/ros.h" #include "geometry_msgs/Twist.h" #include "geometry_msgs/Point.h" #include "geometry_msgs/Quaternion.h" #include "std_msgs/Float64MultiArray.h" #include "nav_msgs/Odometry.h" #include "nav_msgs/Path.h" #include "geometry_msgs/PoseStamped.h" #include "geometry_msgs/Vector3.h" #include <iostream> #include <fstream> #include <string> #include <math.h> #include <vector> #define TWO_PI 6.283185f #define THREE_PI_OVER_2 4.712388f // Define the desired precision multiplier. For a precision of // .1, multiply by 1/.1 = 10 #define PRECISION_MULT 10 #define ADVANCE_TARGET_RANGE 1.5 using namespace std; // Create current_pos and orient as a globals so they can be set in the callback geometry_msgs::Point current_pos; // See hw3/include/hw3/Point.h geometry_msgs::Quaternion current_orient; bool got_current_position = false; double current_heading = 0; /* * Callback function for receiving odom data */ void odomCallback(const nav_msgs::Odometry::ConstPtr& msg) { // Get positional odom data current_pos.x = msg->pose.pose.position.x; current_pos.y = msg->pose.pose.position.y; // Truncate position values to be accurate to .01 current_pos.x = ((long)(current_pos.x*100)) / 100.0; current_pos.y = ((long)(current_pos.y*100)) / 100.0; //ROS_INFO("Got position: %lf %lf", current_pos.x, current_pos.y); // Get orientation odom data current_orient.z = msg->pose.pose.orientation.z; current_orient.w = msg->pose.pose.orientation.w; current_heading = 2*atan2(current_orient.z, current_orient.w); if (current_heading < 0) { current_heading = TWO_PI + current_heading; } //current_heading = floor(current_heading*100) / 100.0; //ROS_INFO("Got heading: %lf", current_heading); got_current_position = true; } // Array of waypoints std::vector<geometry_msgs::Point> points; // Current target geometry_msgs::Point target; // Index of target int waypoint_index = 1; bool done = false; // Compares two points to see if they are equal. Since the points are doubles, // the point is multiplied to obtain the desired precision then cast to a long bool comparePoints(const geometry_msgs::Point& pt1, const geometry_msgs::Point& pt2){ return ( (((long)(pt1.x*PRECISION_MULT)) == ((long)(pt2.x*PRECISION_MULT))) && (((long)(pt1.y*PRECISION_MULT)) == ((long)(pt2.y*PRECISION_MULT))) ); } // Calculate the distance between two points double dist(const geometry_msgs::Point& pt1, const geometry_msgs::Point& pt2) { double dx = fabs(pt1.x - pt2.x); double dy = fabs(pt1.y - pt2.y); return sqrt( (dx*dx) + (dy*dy) ); } /**********************************************************************************/ int main(int argc, char **argv){ // Get name of file of points from the command line string filename; if (!argv[1]) { ROS_ERROR("Point file not specified. Exiting."); return 1; } // Parse the file and store the waypoints ifstream pointFile(argv[1]); if(!pointFile) { ROS_ERROR("Can't open file. Exiting."); return 1; } string line; vector<geometry_msgs::Point> points; double tmpx, tmpy; while (getline(pointFile,line)) { istringstream is(line); is >> tmpx; is >> tmpy; // Truncate points if the file creater wasn't very nice tmpx = floor(tmpx*10)/10.0; tmpy = floor(tmpy*10)/10.0; geometry_msgs::Point temppoint; temppoint.x = tmpx; temppoint.y = tmpy; points.push_back(temppoint); } pointFile.close(); // Push back the last element (the goal) twice to simplify the // path following control logic later points.push_back(points[points.size()-1]); // Get the first target (this is index 1 b/c index 0 is the start pos.) waypoint_index = 1; target = points[1]; // Initialize the node and get the node handle ros::init(argc, argv, "local_driver_node"); ros::NodeHandle n; // Set up publishers ros::Subscriber odom_sub = n.subscribe("/Odometry", 100, odomCallback); //ros::Subscriber odom_sub = n.subscribe("/r1/odom", 100, odomCallback); // Desired trajectory vector publisher ros::Publisher desired_trajectory_pub = n.advertise<geometry_msgs::Vector3>("desired_trajectory", 10); // Set up subscribers ros::Publisher path_pub = n.advertise<nav_msgs::Path>("/local_path", 10); // Specify frequency to publish (Hz) double pub_rate = 10; ros::Rate loop_rate(pub_rate); // A count of how many messages we have sent. This is used to create a unique string for each int count = 0; // Initialize path message. this is just for visualization nav_msgs::Path path_msg; // Array of stamped poses so that we can display the path in rviz std::vector<geometry_msgs::PoseStamped> pose_path; path_msg.header.frame_id = "odom"; // This is critical for proper display in rviz! for(std::vector<geometry_msgs::Point>::reverse_iterator it=points.rbegin(); it!=points.rend(); ++it) { geometry_msgs::PoseStamped temp_pose; temp_pose.header.frame_id = "odom"; temp_pose.pose.position = *it; pose_path.push_back(temp_pose); } // The desired trajectory message geometry_msgs::Vector3 desired_trajectory_msg; // Some state variables for navigation double deltaX; double deltaY; double target_heading; double heading_error; int turn_dir = 1; // 1 = Left, -1 = Right double turn_velocity = 0; double linear_velocity = 0; // Don't start until we've got our current position and a set of waypoints while ( !got_current_position) { ros::spinOnce(); } while (ros::ok()) { // SpinOnce calls callbacks waiting to be called at this point in time // This will update current_pos ros::spinOnce(); if (done) { goto sleep; } // If we're at the target point, or if we're closer to the next point // than the last, update target if ( (dist(current_pos, points[waypoint_index+1]) < dist(current_pos, points[waypoint_index-1])) || (dist(current_pos, points[waypoint_index]) <= ADVANCE_TARGET_RANGE) ) { // Check and see if we're at the goal (the last point in the vector) if ( comparePoints(current_pos, points[points.size()-1]) ) { ROS_INFO("DONE!"); //ROS_INFO("Position: %lf %lf", current_pos.x, current_pos.y); done = true; //vel_msg.linear.x = 0; //vel_msg.angular.z = 0; //vel_pub.publish(vel_msg); desired_trajectory_msg.x = 0; desired_trajectory_msg.y = 0; desired_trajectory_msg.z = 0; path_pub.publish(path_msg); goto sleep; } //ROS_INFO("TARGET REACHED."); waypoint_index++; target = points[waypoint_index]; // Remove current point from pose path if (!pose_path.empty()) { pose_path.pop_back(); } ROS_INFO("New Target: %lf %lf", target.x, target.y); } // Find angle and distance to target destination deltaX = target.x - current_pos.x; deltaY = target.y - current_pos.y; target_heading = atan2(deltaY, deltaX); // Normalize +/- 2PI to 0-PI if (target_heading < 0) { target_heading = TWO_PI + target_heading; } // Calculate error heading_error = current_heading - target_heading; //ROS_INFO("Target position: %lf %lf", target.x, target.y); //ROS_INFO("Target heading: %lf", target_heading); //ROS_INFO("Angle error: %lf", heading_error); // Determine turning direction based on smallest angle. This is hard because of // wrap around if (current_heading > target_heading) { heading_error = current_heading - target_heading; if (heading_error > M_PI) { turn_dir = 1; // Turn left } else { turn_dir = -1; // Turn right } } else { heading_error = target_heading - current_heading; if (heading_error < M_PI) { turn_dir = 1; // Turn left } else { turn_dir = -1; // Turn right } } // Get the magnitude of heading error if (heading_error > M_PI) { heading_error = TWO_PI - heading_error; } ROS_INFO("Angle error: %lf", turn_dir * heading_error); // Determine desired vector based on heading error // Positive angle is a right turn desired_trajectory_msg.x = 5000 * (cos(turn_dir * heading_error) * M_PI / 180); desired_trajectory_msg.y = 5000 * (sin(turn_dir * heading_error) * M_PI / 180); desired_trajectory_msg.z = 0; desired_trajectory_pub.publish(desired_trajectory_msg); // Publish the path so it can be visualized path_msg.header.stamp = ros::Time::now(); path_msg.poses = pose_path; path_pub.publish(path_msg); sleep: // Sleeps for (1/loop_rate) seconds loop_rate.sleep(); ++count; } // While ros::ok() return 0; }
[ "ksa6262@rit.edu" ]
ksa6262@rit.edu
74644224b9c9d2718a6380f8b98f373ceff9b984
f4efea04aca50b20dcdbce803b2fee6a0d3614b2
/BPS/BLE.ino
ac87773340fe24c386398298665547db990ccdf9
[ "MIT" ]
permissive
JohnMacrae/ESP32-BPS-24
ea214a296b07f671d54b2f2ba8eae878be9e04c5
00f7539714845b4bc119299a9b19c3fb8b0fbf43
refs/heads/master
2023-04-07T05:01:42.268759
2021-04-10T05:30:08
2021-04-10T05:30:08
356,477,825
2
0
null
2021-04-10T05:17:29
2021-04-10T05:12:53
null
UTF-8
C++
false
false
2,455
ino
/* BLE Code */ /*class MyServerCallbacks: public BLEServerCallbacks { void onConnect(BLEServer* pServer) { deviceConnected = true; BLEDevice::startAdvertising(); }; void onDisconnect(BLEServer* pServer) { deviceConnected = false; } }; void BLEInit(void) { BLEDevice::init("ESP32"); // Create the BLE Server pServer = BLEDevice::createServer(); pServer->setCallbacks(new MyServerCallbacks()); // Create the BLE Service BLEService *pService = pServer->createService(SERVICE_UUID); // Create a BLE Characteristic pCharacteristic = pService->createCharacteristic( CHARACTERISTIC_UUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE ); // https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml // Create a BLE Descriptor pCharacteristic->addDescriptor(new BLE2902()); // Start the service pService->start(); // Start advertising BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); pAdvertising->addServiceUUID(SERVICE_UUID); pAdvertising->setScanResponse(false); pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter BLEDevice::startAdvertising(); Serial.println("Waiting a client connection to notify..."); } void BLELoop(void) { if (deviceConnected) { pCharacteristic->setValue((uint8_t*)&value, 4); pCharacteristic->notify(); value++; Serial.println("Connected"); Serial.println("Connected"); Serial.println("Connected"); delay(10); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms } // disconnecting if (!deviceConnected && oldDeviceConnected) { delay(500); // give the bluetooth stack the chance to get things ready pServer->startAdvertising(); // restart advertising Serial.println("start advertising"); Serial.println("start advertising"); Serial.println("start advertising"); oldDeviceConnected = deviceConnected; } // connecting if (deviceConnected && !oldDeviceConnected) { // do stuff here on connecting oldDeviceConnected = deviceConnected; } } */
[ "jramacrae@gmail.com" ]
jramacrae@gmail.com
db5f8c60061edeba97f8f1737d314aa5320e3204
2fc9e9e46c504827a47dad7b58fb1ecfb23d890f
/Project1COP3530/Project1COP3530.cpp
9a5015753ae2d09b9dc3bce39522067afe8d2be7
[]
no_license
chrisin1/Line-Editor
9c72c4bd58e920f4a688fba56c2e33667b51d1b9
069dc4e23125d8c6dee860816f60c71f4c3d7a18
refs/heads/master
2022-11-30T19:56:08.833507
2020-08-16T14:27:04
2020-08-16T14:27:04
287,962,263
0
0
null
null
null
null
UTF-8
C++
false
false
5,826
cpp
// Project1COP3530.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include "LinkedList.h" #include <string> using namespace std; class LineEditor { private: LinkedList<string> document; public: void insertEnd(string text); void insert(int index, string text); void deleteLine(int index); void edit(int index, string text); void print(); void search(string text); string parseText(string& command, string type); }; void LineEditor::insertEnd(string text) { string newText = text; while (newText.length() > 80) { document.AddTail(newText.substr(0, 80)); newText = newText.substr(80, newText.length()); } if (newText.length() <= 80) { document.AddTail(newText); } } void LineEditor::insert(int index, string text) { string newText = text; int startIndex = index - 1; //index is one-indexed if (startIndex <= document.NodeCount()) { while (newText.length() > 80) //cuts up long string into smaller pieces { document.InsertAt(newText.substr(0, 80), startIndex); newText = newText.substr(80, newText.length()); startIndex++; } if (newText.length() <= 80) { document.InsertAt(newText, startIndex); } } } void LineEditor::deleteLine(int index) { document.RemoveAt(index - 1); //index is one-indexed } void LineEditor::edit(int index, string text) { deleteLine(index); //"editing" is the same as deleting it, and adding the new edit in its place insert(index, text); } void LineEditor::print() { document.PrintForward(); } void LineEditor::search(string text) { bool found = false; int searchFactor = (int)((text.length() / 80.0) + 1); // used to determine how to group Nodes to be searched based on input size. 80 or less = search one node at a time. 81-160 = search two at a time. LinkedList<string>::Node* ptr = document.Head(); if (searchFactor > document.NodeCount()) //edge case, search item cannot be found if it is larger than the whole document { cout << "not found" << endl; return; } else if (searchFactor == 1) { for (unsigned int i = 0; i < document.NodeCount(); i++) { if (ptr->data.find(text) != std::string::npos) { cout << (i + 1) << " " << ptr->data << endl; found = true; } ptr = ptr->next; } } else { LinkedList<string>::Node* upperBound = ptr; for (int i = 0; i < searchFactor - 1; i++) //initialize upperBound for grouping purposes { upperBound = upperBound->next; } for (unsigned int i = 0; i < document.NodeCount() && upperBound != nullptr; i++) { string combinedText = ""; //combined text from multiple lines LinkedList<string>::Node* addPtr = ptr; //pointer that is used to traverse ahead and add strings to the big combined string LinkedList<string> currLines; //contains current lines being searched, for printing purposes for (int j = 0; j < searchFactor; j++) //assemble and store current group of searched lines in currLines { combinedText += addPtr->data; currLines.AddTail(addPtr->data); addPtr = addPtr->next; } if (combinedText.find(text) != std::string::npos) { int j = i + 1; for (LinkedList<string>::Node* curr = currLines.Head(); curr != nullptr; curr = curr->next, j++) { cout << j << " " << curr->data << endl; } found = true; } ptr = ptr->next; upperBound = upperBound->next; } } if (!found) { cout << "not found" << endl; } } string LineEditor::parseText(string& command, string type) { string result = ""; if (type.compare("text") == 0) { result = command.substr(command.find("\"") + 1, command.length()); //text starts after index of quotation result = result.substr(0, result.length() - 1); //exculde last quotation mark } else if (type.compare("line number") == 0) { int numStart = command.find(" ") + 1; result = command.substr(numStart, (command.find(" ", numStart)) - numStart); //substring from first digit to last digit } return result; } int main() { LineEditor doc; string command = ""; do { getline(cin, command); if (command.find("insertEnd") != std::string::npos) { string parsedText = doc.parseText(command, "text"); doc.insertEnd(parsedText); } else if (command.find("insert") != std::string::npos) { string parsedInt = doc.parseText(command, "line number"); int index = stoi(parsedInt); string parsedText = doc.parseText(command, "text"); doc.insert(index, parsedText); } else if (command.find("delete") != std::string::npos) { string parsedInt = doc.parseText(command, "line number"); int index = stoi(parsedInt); doc.deleteLine(index); } else if (command.find("edit") != std::string::npos) { string parsedInt = doc.parseText(command, "line number"); int index = stoi(parsedInt); string parsedText = doc.parseText(command, "text"); doc.edit(index, parsedText); } else if (command.find("print") != std::string::npos) { doc.print(); } else if (command.find("search") != std::string::npos) { string parsedText = doc.parseText(command, "text"); doc.search(parsedText); } } while (command.compare("quit") != 0); return 0; } // Run program: Ctrl + F5 or Debug > Start Without Debugging menu // Debug program: F5 or Debug > Start Debugging menu // Tips for Getting Started: // 1. Use the Solution Explorer window to add/manage files // 2. Use the Team Explorer window to connect to source control // 3. Use the Output window to see build output and other messages // 4. Use the Error List window to view errors // 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project // 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
[ "christopherin12@gmail.com" ]
christopherin12@gmail.com
2d46ddf330b9495c3468e985e5e9230ee466be9f
35635422101e1c0e4142ca1e176c5d976a6a6ff2
/deps/glm.9.9.5/glm_inn/gtc/noise.hpp
7967168b3caae16fc0216e6c95760d04708d7649
[ "BSD-3-Clause" ]
permissive
wanghaoxin1991/tprPix
e9ac6078dcf104b89e7db8bc6e973b47d4a46bfc
877d2f3bcd2028b28f575deebf37bf7d19d1da52
refs/heads/master
2021-05-25T17:27:13.564129
2020-04-08T22:08:00
2020-04-08T22:08:00
253,843,248
0
0
null
2020-04-07T15:58:08
2020-04-07T15:58:08
null
UTF-8
C++
false
false
3,054
hpp
<<<<<<< HEAD /// @ref gtc_noise /// @file glm/gtc/noise.hpp /// /// @see core (dependence) /// /// @defgroup gtc_noise GLM_GTC_noise /// @ingroup gtc /// /// Include <glm/gtc/noise.hpp> to use the features of this extension. /// /// Defines 2D, 3D and 4D procedural noise functions /// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": /// https://github.com/ashima/webgl-noise /// Following Stefan Gustavson's paper "Simplex noise demystified": /// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf #pragma once // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" #include "../detail/_noise.hpp" #include "../geometric.hpp" #include "../common.hpp" #include "../vector_relational.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_noise extension included") #endif namespace glm { /// @addtogroup gtc_noise /// @{ /// Classic perlin noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T perlin( vec<L, T, Q> const& p); /// Periodic perlin noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T perlin( vec<L, T, Q> const& p, vec<L, T, Q> const& rep); /// Simplex noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T simplex( vec<L, T, Q> const& p); /// @} }//namespace glm #include "noise.inl" ======= /// @ref gtc_noise /// @file glm/gtc/noise.hpp /// /// @see core (dependence) /// /// @defgroup gtc_noise GLM_GTC_noise /// @ingroup gtc /// /// Include <glm/gtc/noise.hpp> to use the features of this extension. /// /// Defines 2D, 3D and 4D procedural noise functions /// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": /// https://github.com/ashima/webgl-noise /// Following Stefan Gustavson's paper "Simplex noise demystified": /// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf #pragma once // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" #include "../detail/_noise.hpp" #include "../geometric.hpp" #include "../common.hpp" #include "../vector_relational.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_noise extension included") #endif namespace glm { /// @addtogroup gtc_noise /// @{ /// Classic perlin noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T perlin( vec<L, T, Q> const& p); /// Periodic perlin noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T perlin( vec<L, T, Q> const& p, vec<L, T, Q> const& rep); /// Simplex noise. /// @see gtc_noise template<length_t L, typename T, qualifier Q> GLM_FUNC_DECL T simplex( vec<L, T, Q> const& p); /// @} }//namespace glm #include "noise.inl" >>>>>>> f8aea6f7d63dae77b8d83ba771701e3561278dc4
[ "wanghaoxin8@163.com" ]
wanghaoxin8@163.com
bc4e4689728b72f48b3d3418fc60396eecaf28a8
bb6c669fc1b873caa9f1b89f87a9331e41d9171c
/tracker/frameFactory.cpp
2b31f6b52e2c082bab7bb06034d6f19161bdabf9
[]
no_license
gaurikulkarni/CalvinBall
5826a062c4435121c2656af58ee261040e47a036
370dd001b7f747dae964c382862095c8ccd25fd4
refs/heads/master
2020-12-30T11:40:04.319165
2017-07-13T03:48:44
2017-07-13T03:48:44
91,516,125
0
0
null
null
null
null
UTF-8
C++
false
false
2,818
cpp
#include "frameFactory.h" #include "extractSurface.h" #include "ioManager.h" #include "vector2f.h" FrameFactory::~FrameFactory() { std::map<std::string, SDL_Surface*>::iterator itSurf = surfaces.begin(); while ( itSurf != surfaces.end() ) { SDL_FreeSurface( itSurf->second ); ++itSurf; } std::map<std::string, std::vector<SDL_Surface*> >::iterator surfaces = multiSurfaces.begin(); while ( surfaces != multiSurfaces.end() ) { for (unsigned int i = 0; i < surfaces->second.size(); ++i) { SDL_FreeSurface( surfaces->second[i] ); } ++surfaces; } std::map<std::string, Frame*>::iterator frame = frames.begin(); while ( frame != frames.end() ) { delete frame->second; ++frame; } std::map<std::string, std::vector<Frame*> >::iterator frames = multiFrames.begin(); while ( frames != multiFrames.end() ) { for (unsigned int i = 0; i < frames->second.size(); ++i) { delete frames->second[i]; } ++frames; } } FrameFactory& FrameFactory::getInstance() { static FrameFactory factory; return factory; } Frame* FrameFactory::getFrame(const std::string& name) { std::map<std::string, Frame*>::const_iterator pos = frames.find(name); if ( pos == frames.end() ) { SDL_Surface * const surface = IOManager::getInstance().loadAndSet( gdata.getXmlStr(name+"/file"), gdata.getXmlBool(name+"/transparency")); surfaces[name] = surface; Frame * const frame =new Frame(name, surface); frames[name] = frame; return frame; } else { return pos->second; } } std::vector<Frame*> FrameFactory::getFrames(const std::string& name) { // First search map to see if we've already made it: std::map<std::string, std::vector<Frame*> >::const_iterator pos = multiFrames.find(name); if ( pos != multiFrames.end() ) { return pos->second; } // It wasn't in the map, so we have to make the vector of Frames: SDL_Surface* surface = IOManager:: getInstance().loadAndSet(gdata.getXmlStr(name+"/file"), true); unsigned numberOfFrames = gdata.getXmlInt(name+"/frames"); std::vector<Frame*> frames; std::vector<SDL_Surface*> surfaces; frames.reserve(numberOfFrames); Uint16 srcX = gdata.getXmlInt(name+"/srcX"); Uint16 srcY = gdata.getXmlInt(name+"/srcY"); Uint16 width = gdata.getXmlInt(name+"/width"); Uint16 height = gdata.getXmlInt(name+"/height"); SDL_Surface* surf; for (unsigned i = 0; i < numberOfFrames; ++i) { unsigned frameX = i * width + srcX; surf = ExtractSurface::getInstance(). get(surface, width, height, frameX, srcY); surfaces.push_back( surf ); frames.push_back( new Frame(name, surf) ); } SDL_FreeSurface(surface); multiSurfaces[name] = surfaces; multiFrames[name] = frames; return frames; }
[ "gauri.kulkarni.v@gmail.com" ]
gauri.kulkarni.v@gmail.com
80682ac602cda6612e3f24f5427b5003d81d4a15
e557ce74c9fe34aa2b68441254b7def699067501
/src/libtsduck/dtv/descriptors/tsAudioComponentDescriptor.h
f60dca5c61128c292f50a23108cdcbaa15c1e8cc
[ "BSD-2-Clause" ]
permissive
cedinu/tsduck-mod
53d9b4061d0eab9864d40b1d47b34f5908f99d8a
6c97507b63e7882a146eee3613d4184b7e535101
refs/heads/master
2023-05-10T12:56:33.185589
2023-05-02T09:00:57
2023-05-02T09:00:57
236,732,523
0
0
BSD-2-Clause
2021-09-23T08:36:08
2020-01-28T12:41:10
C++
UTF-8
C++
false
false
3,692
h
//---------------------------------------------------------------------------- // // TSDuck - The MPEG Transport Stream Toolkit // Copyright (c) 2005-2023, Thierry Lelegard // All rights reserved. // // 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. // // 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 OWNER 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. // //---------------------------------------------------------------------------- //! //! @file //! Representation of an ISDB audio_component_descriptor. //! //---------------------------------------------------------------------------- #pragma once #include "tsAbstractDescriptor.h" namespace ts { //! //! Representation of an ISDB audio_component_descriptor. //! @see ARIB STD-B10, Part 2, 6.2.26 //! @ingroup descriptor //! class TSDUCKDLL AudioComponentDescriptor : public AbstractDescriptor { public: // AudioComponentDescriptor public members: uint8_t stream_content; //!< 4 bits, 0x02 by default (audio content). uint8_t component_type; //!< Component type. uint8_t component_tag; //!< Component tag. uint8_t stream_type; //!< Stream type. uint8_t simulcast_group_tag; //!< Group tag. bool main_component; //!< Is main audio component. uint8_t quality_indicator; //!< 2 bits, quality indicator. uint8_t sampling_rate; //!< 3 bits, sampling rate. UString ISO_639_language_code; //!< 3-character language code. UString ISO_639_language_code_2; //!< 3-character optional secondary language code. UString text; //!< Component description. //! //! Default constructor. //! AudioComponentDescriptor(); //! //! Constructor from a binary descriptor //! @param [in,out] duck TSDuck execution context. //! @param [in] bin A binary descriptor to deserialize. //! AudioComponentDescriptor(DuckContext& duck, const Descriptor& bin); // Inherited methods DeclareDisplayDescriptor(); protected: // Inherited methods virtual void clearContent() override; virtual void serializePayload(PSIBuffer&) const override; virtual void deserializePayload(PSIBuffer&) override; virtual void buildXML(DuckContext&, xml::Element*) const override; virtual bool analyzeXML(DuckContext&, const xml::Element*) override; }; }
[ "thierry@lelegard.fr" ]
thierry@lelegard.fr
09d4a330af4ed4a349c019248f0e0adbe9131f98
965337cc304e01ffbe4937e060282c3eba10ad5e
/launcher.h
97f15287e88c2757635356708164f25f546426b6
[]
no_license
GuiBret/MusicDownloader
d77946de07fb1eb743856c7d20ddbcc72182ef3d
af3fa319263b76f877f1ddc76f54f1862c005ad4
refs/heads/master
2021-01-12T17:27:49.140195
2016-12-11T21:21:36
2016-12-11T21:21:36
71,575,501
0
0
null
null
null
null
UTF-8
C++
false
false
1,393
h
#ifndef LAUNCHER_H #define LAUNCHER_H #include <QMainWindow> #include <QFileDialog> #include <QProcess> #include <QDebug> #include <QMessageBox> #include <QEventLoop> #include <QClipboard> #include "downloaddisplay.h" #include "downloadprofile.h" #include "download.h" class MyProcess; class Download; class DownloadDisplay; namespace Ui { class Launcher; } class Launcher : public QMainWindow { Q_OBJECT friend class Download; public: explicit Launcher(QWidget *parent = 0); ~Launcher(); QString getCodec(); QString getUrl(); QString getPath(); QString getCurrentFileName(); QVector<Download *> downloadList; private: Ui::Launcher *ui; QString videoUrl; QString videoName; DownloadDisplay *downloads; bool download_started; QClipboard *cb; QString currentFileName = ""; void checkYoutubeDlInstall(); Download *searchDownload(QString filename); QUrl getThumbnailUrl(QString url); private slots: void browseFileLocation(); void checkUrlValidity(); void downloadFile(); void checkClipboard(); void searchThumbnail(); void handleDownloadFinished(); QVector<Download *> getDownloadList(); signals: void downloadStarted(); void profileAdded(); void validUrl(); void youtubeDlNotInstalled(); void downloadInstanceCreated(Download *d); }; #endif // LAUNCHER_H
[ "guillaume.bretzner@gmail.com" ]
guillaume.bretzner@gmail.com
4f48dbbd976a5ffdc476da264188d3a2c676becd
e6c5596143f831c4613047d98d5754760e7bc752
/CGP_Assignment/Code/Component/G_Timer.h
40b5d5c2c6461ba65e46b7e12307ddbce0e09ffc
[]
no_license
liaukx-tarc/CGP_Assignment
9a8c816e1bbe25ceccd21a380b57337aabf92e1d
3ee3da6381e2ca3dd2be83f0374854a36db2eeec
refs/heads/master
2023-04-02T01:25:55.288396
2021-04-06T23:01:30
2021-04-06T23:01:30
339,525,577
0
1
null
2021-04-06T23:01:31
2021-02-16T20:41:44
C++
UTF-8
C++
false
false
344
h
#ifndef G_TIMER #define G_TIMER #include <Windows.h> class G_Timer { public: G_Timer(); ~G_Timer(); void init(int); int framesToUpdate(); private: LARGE_INTEGER timerFreq; LARGE_INTEGER timeNow; LARGE_INTEGER timePrevious; int Requested_FPS, frameToUpdate; float intervalsPerFrame, intervalsSinceLastUpdate; }; #endif // !G_TIMER
[ "liaukx@student.tarc.edu.my" ]
liaukx@student.tarc.edu.my
1c576ed95c289030307072c27d04f68b2820b4c1
5885fd1418db54cc4b699c809cd44e625f7e23fc
/kattis/additiongame.cpp
62eac18c8c9927aa0d05f873ae4a50203a682925
[]
no_license
ehnryx/acm
c5f294a2e287a6d7003c61ee134696b2a11e9f3b
c706120236a3e55ba2aea10fb5c3daa5c1055118
refs/heads/master
2023-08-31T13:19:49.707328
2023-08-29T01:49:32
2023-08-29T01:49:32
131,941,068
2
0
null
null
null
null
UTF-8
C++
false
false
873
cpp
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES #include <ext/rope> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_cxx; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<ld,ld> pdd; typedef complex<ld> pt; const char nl = '\n'; const ll INF = 0x3f3f3f3f; const ll INFLL = 0x3f3f3f3f3f3f3f3f; const ll MOD = 1e9+7; const ld EPS = 1e-13; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(10); int n; cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; } return 0; }
[ "henryxia9999@gmail.com" ]
henryxia9999@gmail.com
9144901f114d1cea49c7c7da8f807f67d9b62bc2
b3d2e5d3db351a4c350785b347c3902d9d91dda6
/src/posix/intercept.cpp
82c43873bf02e5ca83e2109fa1a16efb0f216fc9
[ "CC-BY-3.0" ]
permissive
andersgjerdrum/diggi
84d83bb357b1d3348d9443e4225c489322c136f7
c072911c439758b6f1bb1d9972c6fc32aa49d560
refs/heads/master
2022-11-07T19:00:58.241516
2020-07-01T16:23:11
2020-07-01T16:23:11
275,837,201
0
0
null
null
null
null
UTF-8
C++
false
false
26,486
cpp
#include "posix/intercept.h" /** * @file intercept.cpp * @author Anders Gjerdrum (anders.gjerdrum@uit.no) * @author Lars Brenna (lars.brenna@uit.no) * @brief stub implementaitons for POSIX intercept calls. * Used for untrusted runtime instances and unit tests to capture system call operations. * syscall.mk overrides linker symbols for select POSIX calls into this file instead. * Interposition state set via set_syscall_interposition() determine if calls are pass-through or are intercepted by the runtime. * @version 0.1 * @date 2020-02-03 * * @copyright Copyright (c) 2020 * */ #include "DiggiAssert.h" #include "posix/time_stubs.h" #include "posix/pthread_stubs.h" #include "posix/unistd_stubs.h" #include "posix/net_stubs.h" #include "posix/io_stubs.h" #include "posix/crypto_stubs.h" #include "posix/net_utils.h" #include "posix/io_types.h" #ifdef __cplusplus extern "C" { #endif /// keep track of socket fd's to help route syscalls to correct handler /// NOT THREAD SAFE :-O /// TODO: make this thread safe /// calls are either treated to file IO or network IO descriptors #define MAX_SOCKET_FDS 10240 static int socket_fds[MAX_SOCKET_FDS] = {0}; static int socket_fd_index = 0; static unsigned syscall_interposition = 0; #define MAX_PRINTIF_SIZE 8092 /** * @brief Set the syscall interposition object * sets interposition state, and resets file descriptor accounting. * @param state */ void set_syscall_interposition(unsigned int state) { syscall_interposition = state; /* reset for unit tests */ memset(socket_fds,0,sizeof(int) * MAX_SOCKET_FDS); } /** * @brief check if fd is a file descriptor or network descriptor * * @param fd * @return true * @return false */ static bool is_fd_socket(int fd){ for (int i=0;i<socket_fd_index;i++){ if (socket_fds[i] == fd){ return true; } } return false; } /** * @brief debug intercept calls. * usable if MAMA define is passed as compiler opt. * @param str */ static inline void debug_printf(const char* str){ #ifdef DEBUG_SYSCALL printf("DEBUG: %s\n", str); #endif } /** * @brief only usable in unit tests or untrusted runtime instances * */ #if !defined(DIGGI_ENCLAVE) && !defined(UNTRUSTED_APP) uint32_t __wrap_htonl(uint32_t hostlong) { debug_printf("htonl"); if (syscall_interposition) { return i_htonl(hostlong); } else { return __real_htonl(hostlong); } } uint16_t __wrap_htons(uint16_t hostshort) { debug_printf("htons"); if (syscall_interposition) { return i_htons(hostshort); } else { return __real_htons(hostshort); } } uint32_t __wrap_ntohl(uint32_t netlong) { debug_printf("ntohl"); if (syscall_interposition) { return i_ntohl(netlong); } else { return __real_ntohl(netlong); } } uint16_t __wrap_ntohs(uint16_t netshort) { debug_printf("ntohs"); if (syscall_interposition) { return i_ntohs(netshort); } else { return __real_ntohs(netshort); } } int __wrap_inet_aton(const char * cp, struct in_addr * inp) { debug_printf("aton"); if (syscall_interposition) { return i_inet_aton(cp, inp); } else { return __real_inet_aton(cp, inp); } } in_addr_t __wrap_inet_addr(const char * cp) { debug_printf("inet_addr"); if (syscall_interposition) { return i_inet_addr(cp); } else {return __real_inet_addr(cp); } } in_addr_t __wrap_inet_network(const char * cp) { debug_printf("inet_network"); if (syscall_interposition) { return i_inet_network(cp); } else { return __real_inet_network(cp); } } char * __wrap_inet_ntoa(struct in_addr in) { debug_printf("inet_ntoa"); if (syscall_interposition) { return i_inet_ntoa(in); } else { return __real_inet_ntoa(in); } } struct in_addr __wrap_inet_makeaddr(int net, int host) { debug_printf("inet_makeaddr"); if (syscall_interposition) { return i_inet_makeaddr(net, host); } else { return __real_inet_makeaddr(net, host); } } in_addr_t __wrap_inet_lnaof(struct in_addr in) { debug_printf("inet_lnaof"); if (syscall_interposition) { return i_inet_lnaof(in); } else { return __real_inet_lnaof(in); } } in_addr_t __wrap_inet_netof(struct in_addr in) { debug_printf("inet_netof"); if (syscall_interposition) { return i_inet_netof(in); } else { return __real_inet_netof(in); } } const char * __wrap_inet_ntop(int af, const void * src, char * dst, socklen_t size) { debug_printf("inet_ntop"); if (syscall_interposition) { return i_inet_ntop(af, src, dst, size); } else { return __real_inet_ntop(af, src, dst, size); } } /*int __wrap_sscanf(const char *str, const char *format, ...) { debug_printf("sscanf"); int retval = 0; //TODO: implement this. va_list args; va_start(args, format); if (syscall_interposition) { retval = i_vsscanf(str, format, args); } else { retval = vsscanf(str, format, args); } va_end(args); return retval; }*/ int __wrap_sprintf(char * str, const char * format, ...) { debug_printf("sprintf"); int retval = 0; va_list args; va_start(args, format); if (syscall_interposition) { retval = i_vsprintf(str, format, args); } else { retval = vsprintf(str, format, args); } va_end(args); return retval; } int __wrap_fcntl(int fd, int cmd, ... /*args */) { debug_printf("fcntl"); va_list argp; struct flock *lock = NULL; int flag = 0; int retval = 0; va_start(argp, cmd); if (is_fd_socket(fd)){ flag = va_arg(argp, int); if (syscall_interposition){ // printf("FCNTL for fd=%d going to network implementation\n", fd); retval = network_fcntl(fd, cmd, flag); } else { retval = __real_fcntl(fd, cmd, flag); } } else if ((cmd == F_SETLK) || (cmd == F_SETLKW) || (cmd == F_GETLK)) { lock = va_arg(argp, struct flock *); DIGGI_ASSERT(lock); if (syscall_interposition) { retval = i_fcntl(fd, cmd, lock); } else { retval = __real_fcntl(fd, cmd, lock); } } else{ /* Do not support emulation of file descriptor manipulation yet */ DIGGI_ASSERT(!syscall_interposition); if (cmd == F_GETFL) { retval = __real_fcntl(fd, cmd); } else if(cmd == F_SETFL) { int op = va_arg(argp, int); retval = __real_fcntl(fd, cmd, op); } else { /* Unknown operation */ DIGGI_ASSERT(false); } } va_end(argp); return retval; } int __wrap_rand(void) { //debug_printf("rand"); // commenting out because it is called so often during TLS it makes the log hard to read. if (syscall_interposition) { return i_rand(); } else { return __real_rand(); } } DIR * __wrap_opendir(const char * name) { debug_printf("opendir"); if (syscall_interposition) { return i_opendir(name); } else { return __real_opendir(name); } } struct dirent * __wrap_readdir(DIR * dirp) { debug_printf("readdir"); if (syscall_interposition) { return i_readdir(dirp); } else { return __real_readdir(dirp); } } int __wrap_closedir(DIR * dirp) { debug_printf("closedir"); if (syscall_interposition) { return i_closedir(dirp); } else { return __real_closedir(dirp); } } int __wrap_dup(int oldfd) { debug_printf("dup"); if (syscall_interposition) { return i_dup(oldfd); } else { return __real_dup(oldfd); } } FILE * __wrap_fopen(const char * filename, const char * mode) { debug_printf("fopen"); if (syscall_interposition) { return i_fopen(filename, mode); } else { return __real_fopen(filename, mode); } } char * __wrap_fgets(char * str, int num, FILE * stream) { debug_printf("fgets"); if (syscall_interposition) { return i_fgets(str, num, stream); } else { return __real_fgets(str, num, stream); } } int __wrap_fclose(FILE * stream) { debug_printf("fclose"); if (syscall_interposition) { return i_fclose(stream); } else { return __real_fclose(stream); } } int __wrap_fputc(int character, FILE * stream) { debug_printf("fputc"); if (syscall_interposition) { return i_fputc(character, stream); } else { return __real_fputc(character, stream); } } int __wrap_fflush(FILE * stream) { debug_printf("fflush"); if (syscall_interposition) { return i_fflush(stream); } else { return __real_fflush(stream); } } size_t __wrap_fread(void * ptr, size_t size, size_t count, FILE * stream) { debug_printf("fread"); if (syscall_interposition) { return i_fread(ptr, size, count, stream); } else { return __real_fread(ptr, size, count, stream); } } size_t __wrap_fwrite(const void * ptr, size_t size, size_t count, FILE * stream) { debug_printf("fwrite"); if (syscall_interposition) { return i_fwrite(ptr, size, count, stream); } else { return __real_fwrite(ptr, size, count, stream); } } int __wrap_chdir(const char * path) { debug_printf("chdir"); if (syscall_interposition) { return i_chdir(path); } else { return __real_chdir(path); } } int __wrap_dup2(int oldfd, int newfd) { debug_printf("dup2"); if (syscall_interposition) { return i_dup2(oldfd, newfd); } else { return __real_dup2(oldfd, newfd); } } int __wrap_fseeko(FILE * stream, off_t offset, int whence) { debug_printf("fseeko"); if (syscall_interposition) { return i_fseeko(stream, offset, whence); } else { return __real_fseeko(stream, offset, whence); } } int __wrap_fseek(FILE * stream, off_t offset, int whence) { debug_printf("fseek"); if (syscall_interposition) { return i_fseek(stream, offset, whence); } else { return __real_fseek(stream, offset, whence); } } long __wrap_ftell(FILE * stream) { debug_printf("ftell"); if (syscall_interposition) { return i_ftell(stream); } else { return __real_ftell(stream); } } int __wrap_fputs(const char * str, FILE * stream) { debug_printf("fputs"); if (syscall_interposition) { return i_fputs(str, stream); } else { return __real_fputs(str, stream); } } int __wrap_fgetc(FILE * stream) { debug_printf("fgetc"); if (syscall_interposition) { return i_fgetc(stream); } else { return __real_fgetc(stream); } } int __wrap_fileno(FILE * stream) { debug_printf("fileno"); if (syscall_interposition) { return i_fileno(stream); } else { return __real_fileno(stream); } } int __wrap_lstat(const char * path, struct stat * buf) { debug_printf("lstat"); if (syscall_interposition) { return i_lstat(path, buf); } else { return __real_lstat(path, buf); } } long __wrap_sysconf(int name) { debug_printf("sysconf"); if (syscall_interposition) { return i_sysconf(name); } else { return __real_sysconf(name); } } ssize_t __wrap_readlink(const char * path, char * buf, size_t bufsiz) { debug_printf("readlink"); if (syscall_interposition) { return i_readlink(path, buf, bufsiz); } else { return __real_readlink(path, buf, bufsiz); } } int __wrap_fchmod(int fildes, mode_t mode) { debug_printf("fchmod"); if (syscall_interposition) { return i_fchmod(fildes, mode); } else { return __real_fchmod(fildes, mode); } } unsigned int __wrap_sleep(unsigned int seconds) { debug_printf("sleep"); if (syscall_interposition) { return i_sleep(seconds); } else { return __real_sleep(seconds); } } int __wrap_getpid(void) { debug_printf("getpid"); if (syscall_interposition) { return i_getpid(); } else { return __real_getpid(); } } time_t __wrap_time(time_t * t) { debug_printf("time"); if (syscall_interposition) { return i_time(t); } else { return __real_time(t); } } struct tm * __wrap_gmtime(const time_t * timer) { debug_printf("gmtime"); if (syscall_interposition) { return i_gmtime(timer); } else { return __real_gmtime(timer); } } int __wrap_utime(const char * filename, const struct utimbuf * times) { debug_printf("utime"); if (syscall_interposition) { return i_utime(filename, times); } else { return __real_utime(filename, times); } } int __wrap_utimes(const char * filename, const struct timeval times[2]) { debug_printf("utimes"); if (syscall_interposition) { return i_utimes(filename, times); } else { return __real_utimes(filename, times); } } int __wrap_gettimeofday(struct timeval * tv, struct timezone * tz) { debug_printf("gettimeofday"); if (syscall_interposition) { return i_gettimeofday(tv, tz); } else { return __real_gettimeofday(tv, tz); } } int __wrap_stat(const char * path, struct stat * buf) { debug_printf("stat"); if (syscall_interposition) { return i_stat(path, buf); } else { return __real_stat(path, buf); } } int __wrap_fstat(int fd, struct stat * buf) { debug_printf("fstat"); if (syscall_interposition) { return i_fstat(fd, buf); } else { return __real_fstat(fd, buf); } } int __wrap_close(int fd) { debug_printf("close"); if (syscall_interposition) { if (is_fd_socket(fd)){ return network_close(fd); } else { return i_close(fd); } } else { return __real_close(fd); } } int __wrap_access(const char * pathname, int mode) { debug_printf("access"); if (syscall_interposition) { return i_access(pathname, mode); } else { return __real_access(pathname, mode); } } /* Allways have CWD be the same virtual directory */ char * __wrap_getcwd(char * buf, size_t size) { debug_printf("getcwd"); if (syscall_interposition) { return i_getcwd(buf, size); } else { return __real_getcwd(buf, size); } } int __wrap_ftruncate(int fd, off_t length) { debug_printf("ftruncate"); if (syscall_interposition) { return i_ftruncate(fd, length); } else { return __real_ftruncate(fd, length); } } int __wrap_fsync(int fd) { debug_printf("fsync"); if (syscall_interposition) { return i_fsync(fd); } else { return __real_fsync(fd); } } char * __wrap_getenv(const char * name) { debug_printf("getenv"); if (syscall_interposition) { return i_getenv(name); } else { return __real_getenv(name); } } uid_t __wrap_getuid(void) { debug_printf("getuid"); if (syscall_interposition) { return i_getuid(); } else { return __real_getuid(); } } uid_t __wrap_geteuid(void) { debug_printf("geteuid"); if (syscall_interposition) { return i_geteuid(); } else { return __real_geteuid(); } } int __wrap_fchown(int fd, uid_t owner, gid_t group) { debug_printf("fchown"); if (syscall_interposition) { return i_fchown(fd, owner, group); } else { return __real_fchown(fd, owner, group); } } off_t __wrap_lseek(int fd, off_t offset, int whence) { debug_printf("lseek"); if (syscall_interposition) { return i_lseek(fd, offset, whence); } else { return __real_lseek(fd, offset, whence); } } int __wrap_open(const char * path, int oflags, mode_t mode) { debug_printf("open"); if (syscall_interposition) { return i_open(path, oflags, mode); } else { return __real_open(path, oflags, mode); } } ssize_t __wrap_read(int fildes, void * buf, size_t nbyte) { debug_printf("read"); if (syscall_interposition) { return i_read(fildes, buf, nbyte); } else { return __real_read(fildes, buf, nbyte); } } ssize_t __wrap_write(int fd, const void * buf, size_t count) { debug_printf("write"); if (syscall_interposition) { return i_write(fd, buf, count); } else { return __real_write(fd, buf, count); } } int __wrap_unlink(const char * pathname) { debug_printf("unlink"); if (syscall_interposition) { return i_unlink(pathname); } else { return __real_unlink(pathname); } } int __wrap_mkdir(const char * path, mode_t mode) { debug_printf("mkdir"); if (syscall_interposition) { return i_mkdir(path, mode); } else { return __real_mkdir(path, mode); } } int __wrap_rmdir(const char * path) { debug_printf("rmdir"); if (syscall_interposition) { return i_rmdir(path); } else { return __real_rmdir(path); } } mode_t __wrap_umask(mode_t mask) { debug_printf("umask"); if (syscall_interposition) { return i_umask(mask); } else { return __real_umask(mask); } } void __wrap_freeaddrinfo(struct addrinfo *res) { if (syscall_interposition) { i_freeaddrinfo(res); } else{ __real_freeaddrinfo(res); } } int __wrap_getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) { if (syscall_interposition) { return i_getaddrinfo(node, service, hints, res); } else { return __real_getaddrinfo(node, service, hints, res); } } int __wrap_socket(int domain, int type, int protocol) { debug_printf("socket"); int new_fd = 0; if (syscall_interposition) { new_fd = i_socket(domain, type, protocol); } else { new_fd = __real_socket(domain, type, protocol); } if (socket_fd_index == MAX_SOCKET_FDS){ socket_fd_index = 0; } socket_fds[socket_fd_index] = new_fd; socket_fd_index++; return new_fd; } int __wrap_setsockopt(int sockfd, int level, int optname, const void * optval, socklen_t optlen) { debug_printf("setsockopt"); if (syscall_interposition) { return i_setsockopt(sockfd, level, optname, optval, optlen); } else { return __real_setsockopt(sockfd, level, optname, optval, optlen); } } int __wrap_getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen) { debug_printf("getpeername"); if (syscall_interposition) { return i_getpeername(sockfd, addr, addrlen); } else { return __real_getpeername(sockfd, addr, addrlen); } } ssize_t __wrap_send(int sockfd, const void * buf, size_t len, int flags) { debug_printf("send"); if (syscall_interposition) { return i_send(sockfd, buf, len, flags); } else { return __real_send(sockfd, buf, len, flags); } } ssize_t __wrap_sendto(int sockfd, const void * buf, size_t len, int flags, const struct sockaddr * dest_addr, socklen_t addrlen) { debug_printf("sendto"); if (syscall_interposition) { return i_sendto(sockfd, buf, len, flags, dest_addr, addrlen); } else { return __real_sendto(sockfd, buf, len, flags, dest_addr, addrlen); } } ssize_t __wrap_recvfrom(int sockfd, void * buf, size_t len, int flags, struct sockaddr * src_addr, socklen_t * addrlen) { debug_printf("recvfrom"); if (syscall_interposition) { return i_recvfrom(sockfd, buf, len, flags, src_addr, addrlen); } else { return __real_recvfrom(sockfd, buf, len, flags, src_addr, addrlen); } } int __wrap_bind(int sockfd, const struct sockaddr * addr, socklen_t addrlen) { debug_printf("bind"); if (syscall_interposition) { return i_bind(sockfd, addr, addrlen); } else { return __real_bind(sockfd, addr, addrlen); } } int __wrap_getsockname(int sockfd, struct sockaddr * addr, socklen_t * addrlen) { debug_printf("getsockname"); if (syscall_interposition) { return i_getsockname(sockfd, addr, addrlen); } else { return __real_getsockname(sockfd, addr, addrlen); } } ssize_t __wrap_recv(int sockfd, void * buf, size_t len, int flags) { debug_printf("recv"); if (syscall_interposition) { return i_recv(sockfd, buf, len, flags); } else { return __real_recv(sockfd, buf, len, flags); } } int __wrap_connect(int sockfd, const struct sockaddr * addr, socklen_t addrlen) { debug_printf("connect"); if (syscall_interposition) { return i_connect(sockfd, addr, addrlen); } else { return __real_connect(sockfd, addr, addrlen); } } int __wrap_accept(int sockfd, struct sockaddr * addr, socklen_t * addrlen) { debug_printf("accept"); int new_fd = 0; if (syscall_interposition) { new_fd = i_accept(sockfd, addr, addrlen); } else { new_fd = __real_accept(sockfd, addr, addrlen); } // add to socket_fd_index: if (socket_fd_index == MAX_SOCKET_FDS){ socket_fd_index = 0; } socket_fds[socket_fd_index] = new_fd; socket_fd_index++; return new_fd; } int __wrap_listen(int sockfd, int backlog) { debug_printf("listen"); if (syscall_interposition) { return i_listen(sockfd, backlog); } else { return __real_listen(sockfd, backlog); } } int __wrap_select(int nfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, struct timeval * timeout) { debug_printf("select"); if (syscall_interposition) { return i_select(nfds, readfds, writefds, exceptfds, timeout); } else { return __real_select(nfds, readfds, writefds, exceptfds, timeout); } } int __wrap_getsockopt(int sockfd, int level, int optname, void * optval, socklen_t * optlen) { debug_printf("getsockopt"); if (syscall_interposition) { return i_getsockopt(sockfd, level, optname, optval, optlen); } else { return __real_getsockopt(sockfd, level, optname, optval, optlen); } } int __wrap_sigemptyset(sigset_t * set) { debug_printf("sigemptyset"); if (syscall_interposition) { return i_sigemptyset(set); } else { return __real_sigemptyset(set); } } int __wrap_sigaction(int signum, const struct sigaction * act, struct sigaction * oldact) { debug_printf("sigaction"); if (syscall_interposition) { return i_sigaction(signum, act, oldact); } else { return __real_sigaction(signum, act, oldact); } } pid_t __wrap_fork(void) { debug_printf("fork"); if (syscall_interposition) { return i_fork(); } else { return __real_fork(); } } sighandler_t __wrap_signal(int signum, sighandler_t handler) { debug_printf("signal"); if (syscall_interposition) { return i_signal(signum, handler); } else { return __real_signal(signum, handler); } } void __wrap__exit(int status) { debug_printf("exit"); if (syscall_interposition) { i__exit(status); } else { __real__exit(status); } } int __wrap_execle(const char *path, const char *arg, ...){ debug_printf("execle"); DIGGI_ASSERT(false); return -1; } struct tm *__wrap_localtime(const time_t *timer) { debug_printf("localtime"); if (syscall_interposition) { return i_localtime(timer); } else { return __real_localtime(timer); } } int __wrap_pthread_mutexattr_init(pthread_mutexattr_t *attr) { debug_printf("pthread_mutexattr_init"); if (syscall_interposition) { return i_pthread_mutexattr_init(attr); } else { return __real_pthread_mutexattr_init(attr); } } int __wrap_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) { debug_printf("pthread_mutexattr_settype"); if (syscall_interposition) { return i_pthread_mutexattr_settype(attr, type); } else { return __real_pthread_mutexattr_settype(attr, type); } } int __wrap_pthread_mutexattr_destroy(pthread_mutexattr_t * attr) { debug_printf("pthread_mutexattr_destroy"); if (syscall_interposition) { return i_pthread_mutexattr_destroy(attr); } else { return __real_pthread_mutexattr_destroy(attr); } } int __wrap_pthread_mutex_init(pthread_mutex_t * mutext, const pthread_mutexattr_t * attr) { debug_printf("pthread_mutex_init"); if (syscall_interposition) { return i_pthread_mutex_init(mutext, attr); } else { return __real_pthread_mutex_init(mutext, attr); } } int __wrap_pthread_mutex_lock(pthread_mutex_t * mutex) { debug_printf("pthread_mutex_lock"); if (syscall_interposition) { return i_pthread_mutex_lock(mutex); } else { return __real_pthread_mutex_lock(mutex); } } int __wrap_pthread_mutex_unlock(pthread_mutex_t * mutex) { debug_printf("pthread_mutex_unlock"); if (syscall_interposition) { return i_pthread_mutex_unlock(mutex); } else { return __real_pthread_mutex_unlock(mutex); } } int __wrap_pthread_mutex_trylock(pthread_mutex_t * mutex) { debug_printf("pthread_mutex_trylock"); if (syscall_interposition) { return i_pthread_mutex_trylock(mutex); } else { return __real_pthread_mutex_trylock(mutex); } } int __wrap_pthread_mutex_destroy(pthread_mutex_t * mutex) { debug_printf("pthread_mutex_destroy"); if (syscall_interposition) { return i_pthread_mutex_destroy(mutex); } else { return __real_pthread_mutex_destroy(mutex); } } int __wrap_pthread_create(pthread_t * thread, const pthread_attr_t * attr, void * (*start_routine)(void *), void * arg) { debug_printf("pthread_create"); if (syscall_interposition) { return i_pthread_create(thread, attr, start_routine, arg); } else { return __real_pthread_create(thread, attr, start_routine, arg); } } int __wrap_pthread_join(pthread_t thread, void ** value_ptr) { debug_printf("pthread_join"); if (syscall_interposition) { return i_pthread_join(thread, value_ptr); } else { return __real_pthread_join(thread, value_ptr); } } int __wrap_pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex) { debug_printf("pthread_cond_wait"); if (syscall_interposition) { return i_pthread_cond_wait(cond, mutex); } else { return __real_pthread_cond_wait(cond, mutex); } } int __wrap_pthread_cond_broadcast(pthread_cond_t * cond) { debug_printf("pthread_cond_broadcast"); if (syscall_interposition) { return i_pthread_cond_broadcast(cond); } else { return __real_pthread_cond_broadcast(cond); } } int __wrap_pthread_cond_signal(pthread_cond_t * cond) { debug_printf("pthread_cond_signal"); if (syscall_interposition) { return i_pthread_cond_signal(cond); } else { return __real_pthread_cond_signal(cond); } } int __wrap_pthread_cond_init(pthread_cond_t * cond, const pthread_condattr_t * attr) { debug_printf("pthread_cont_init"); if (syscall_interposition) { return i_pthread_cond_init(cond, attr); } else { return __real_pthread_cond_init(cond, attr); } } #endif #ifdef __cplusplus } #endif // __cplusplus
[ "anders@diggi-1.cs.uit.no" ]
anders@diggi-1.cs.uit.no
48ba067a28600767e6d91a897853019ba3183417
3054ded5d75ec90aac29ca5d601e726cf835f76c
/Training/UVa/CP3/Mathematics/Ad Hoc/00443 - Humble Numbers.cpp
5989c6653b41f74472dedf6ef78bf3064d7c0687
[]
no_license
Yefri97/Competitive-Programming
ef8c5806881bee797deeb2ef12416eee83c03add
2b267ded55d94c819e720281805fb75696bed311
refs/heads/master
2022-11-09T20:19:00.983516
2022-04-29T21:29:45
2022-04-29T21:29:45
60,136,956
10
0
null
null
null
null
UTF-8
C++
false
false
670
cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MX = 2e9; int main() { vector<ll> v; for (ll l = 1; l <= MX; l *= 7) for (ll k = 1; k * l <= MX; k *= 5) for (ll j = 1; j * k * l <= MX; j *= 3) for (ll i = 1; i * j * k * l <= MX; i *= 2) v.push_back(i * j * k * l); sort(v.begin(), v.end()); int n; while (cin >> n && n) { string suffix = "th"; if ((n / 10) % 10 != 1) { if (n % 10 == 1) suffix = "st"; if (n % 10 == 2) suffix = "nd"; if (n % 10 == 3) suffix = "rd"; } cout << "The " << n << suffix << " humble number is " << v[n - 1] << "." << endl; } return 0; }
[ "yefri.gaitan97@gmail.com" ]
yefri.gaitan97@gmail.com
ef098221dbdfc1cb163be159674acb81a0bcb410
ec42dd1913d515b6d4d836fa2a84deaf47cdadbc
/LiveLogViewer/LiveLog_data.cpp
3c637816b09c8d62870c9362eac70dcae21812d5
[]
no_license
WuFan1992/LiveLogViewer
5b46826a9efc18ab87b592cd5e3981c2e60e2840
6c0735c725fa2c8964393dcccf2d941e76b1585a
refs/heads/master
2021-07-18T03:54:52.117893
2017-10-25T10:24:13
2017-10-25T10:24:13
105,745,696
0
0
null
null
null
null
UTF-8
C++
false
false
714
cpp
#include "LiveLog_data.h" #include "Widget_element.h" #include <iostream> #include <qDebug> using namespace std; void LiveLog_data::show_source_pressure() { qDebug() << source_pressure; } void LiveLog_data::show_target_pressure() { qDebug() << target_pressure; } void LiveLog_data::show_mesure_pressure() { qDebug() << mesure_pressure; } void LiveLog_data::show_target_temperature() { qDebug() << target_temperature; } void LiveLog_data::show_mesure_temp_one_line() { for (int j = 0; j < mesure_temp_one_line.size(); j++) { qDebug() << mesure_temp_one_line.at(j); } } double LiveLog_data::get_time() { return time; } double LiveLog_data::get_source_pressure() { return source_pressure; }
[ "fanwuchine@gmail.com" ]
fanwuchine@gmail.com
c063524b3f5148c890fb934d00993ee21759d62c
246018707dd500a0953af4c5dc1d9e4ccd63743a
/Project/Project/prob87.cpp
b1e5faed27fac9f2ec9d894a3294c790053bd281
[ "MIT" ]
permissive
LeoNardo10521/Leetcode
1a7c3fbda747bd2b0114748613ef93cc592fc59d
083f7929b916ec327b18edc1ed1ade9a0b51c089
refs/heads/master
2020-03-07T04:35:17.302113
2018-04-09T03:18:14
2018-04-09T03:18:14
127,270,314
0
0
null
null
null
null
UTF-8
C++
false
false
2,546
cpp
//My work class Solution { public: bool count(string s1, string s2){ unordered_map <char, int> record1; unordered_map <char, int> record2; for (int i = 0; i<s1.length(); i++) record1[s1[i]]++; for (int i = 0; i<s2.length(); i++) record2[s2[i]]++; if (record2 != record1) return 0; else return 1; } bool jud(string s1, string s2){ int l = s1.length(); if (l == 1) return s1[0] == s2[0]; // if (l<=1) return 1; /* int l_s = l/2; if ((count(s1.substr(0,l_s),s2.substr(0,l_s)) && count(s1.substr(l_s,l-l_s),s2.substr(l_s,l-l_s))) || (count(s1.substr(0,l-l_s),s2.substr(0,l-l_s)) && count(s2.substr(l-l_s,l_s),s1.substr(l-l_s,l_s))) || (count(s1.substr(0,l_s),s2.substr(l-l_s,l_s)) && count(s1.substr(l_s,l-l_s),s2.substr(0,l-l_s))) || (count(s2.substr(0,l_s),s1.substr(l-l_s,l_s)) && count(s2.substr(l_s,l-l_s),s1.substr(0,l-l_s))) ;*/ int flag = 0; for (int i = 1; i<=l-1; i++) if ((count(s1.substr(0,i),s2.substr(0,i)) && count(s1.substr(i,l-i),s2.substr(i,l-i)) && jud(s1.substr(0,i),s2.substr(0,i)) && jud(s1.substr(i,l-i),s2.substr(i,l-i))) || (count(s1.substr(0,i),s2.substr(l-i,i)) && count(s1.substr(i,l-i),s2.substr(0,l-i)) && jud(s1.substr(0,i),s2.substr(l-i,i)) && jud(s1.substr(i,l-i),s2.substr(0,l-i))) ) {flag = 1; break;} return flag; } bool isScramble(string s1, string s2) { return jud(s1,s2); } }; //modified class Solution { public: bool count(string s1, string s2){ vector<int> record1(26,0); vector<int>record2(26,0); for (int i = 0; i<s1.length(); i++) record1[s1[i]-'a']++; for (int i = 0; i<s2.length(); i++) record2[s2[i]-'a']++; return record1 == record2; } bool jud(string s1, string s2){ int l = s1.length(); if (s1 == s2) return 1; if (!count(s1,s2)) return 0; int flag = 0; for (int i = 1; i<=l-1; i++) if ((jud(s1.substr(0,i),s2.substr(0,i)) && jud(s1.substr(i,l-i),s2.substr(i,l-i))) || (jud(s1.substr(0,i),s2.substr(l-i,i)) && jud(s1.substr(i,l-i),s2.substr(0,l-i)))) {flag = 1; break;} return flag; } bool isScramble(string s1, string s2) { return jud(s1,s2); } };
[ "shjdzlq@163.com" ]
shjdzlq@163.com
ee0862cd031c5c6fdc26df3a159cf657deb883a6
254cbaaf24dde982be6cb877220c95734723753c
/ddutil.cpp
885d5ac78366d1db4872471ab445fd3342fde0d4
[]
no_license
ForestJay/SpaceAdventure
f56a92c673af3ba14d3cbeb7187eb2202deaed6e
76d9fdf23f95cc68c168b84c8586f4566b82afd2
refs/heads/master
2021-01-10T17:21:08.793077
2015-09-26T22:20:38
2015-09-26T22:20:38
43,224,915
0
0
null
null
null
null
UTF-8
C++
false
false
8,328
cpp
/*========================================================================== * * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved. * * File: ddutil.cpp * Content: Routines for loading bitmap and palettes from resources * ***************************************************************************/ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> #include <ddraw.h> #include "ddutil.h" /* * DDLoadBitmap * * create a DirectDrawSurface from a bitmap resource. * */ extern "C" IDirectDrawSurface * DDLoadBitmap(IDirectDraw *pdd, LPCSTR szBitmap, int dx, int dy, DWORD dwFlags) { HBITMAP hbm; BITMAP bm; DDSURFACEDESC ddsd; IDirectDrawSurface *pdds; // // try to load the bitmap as a resource, if that fails, try it as a file // hbm = (HBITMAP)LoadImage(GetModuleHandle(NULL), szBitmap, IMAGE_BITMAP, dx, dy, LR_CREATEDIBSECTION); if (hbm == NULL) hbm = (HBITMAP)LoadImage(NULL, szBitmap, IMAGE_BITMAP, dx, dy, LR_LOADFROMFILE|LR_CREATEDIBSECTION); if (hbm == NULL) return NULL; // // get size of the bitmap // GetObject(hbm, sizeof(bm), &bm); // get size of bitmap // // create a DirectDrawSurface for this bitmap // ZeroMemory(&ddsd, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT |DDSD_WIDTH; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | dwFlags; ddsd.dwWidth = bm.bmWidth; ddsd.dwHeight = bm.bmHeight; if (pdd->CreateSurface(&ddsd, &pdds, NULL) != DD_OK) return NULL; DDCopyBitmap(pdds, hbm, 0, 0, 0, 0); DeleteObject(hbm); return pdds; } /* * DDReLoadBitmap * * load a bitmap from a file or resource into a directdraw surface. * normally used to re-load a surface after a restore. * */ HRESULT DDReLoadBitmap(IDirectDrawSurface *pdds, LPCSTR szBitmap) { HBITMAP hbm; HRESULT hr; // // try to load the bitmap as a resource, if that fails, try it as a file // hbm = (HBITMAP)LoadImage(GetModuleHandle(NULL), szBitmap, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); if (hbm == NULL) hbm = (HBITMAP)LoadImage(NULL, szBitmap, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION); if (hbm == NULL) return E_FAIL; hr = DDCopyBitmap(pdds, hbm, 0, 0, 0, 0); DeleteObject(hbm); return hr; } /* * DDCopyBitmap * * draw a bitmap into a DirectDrawSurface * */ extern "C" HRESULT DDCopyBitmap(IDirectDrawSurface *pdds, HBITMAP hbm, int x, int y, int dx, int dy) { HDC hdcImage; HDC hdc; BITMAP bm; DDSURFACEDESC ddsd; HRESULT hr; if (hbm == NULL || pdds == NULL) return E_FAIL; // // make sure this surface is restored. // pdds->Restore(); // // select bitmap into a memoryDC so we can use it. // hdcImage = CreateCompatibleDC(NULL); SelectObject(hdcImage, hbm); // // get size of the bitmap // GetObject(hbm, sizeof(bm), &bm); // get size of bitmap dx = dx == 0 ? bm.bmWidth : dx; // use the passed size, unless zero dy = dy == 0 ? bm.bmHeight : dy; // // get size of surface. // ddsd.dwSize = sizeof(ddsd); ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH; pdds->GetSurfaceDesc(&ddsd); if ((hr = pdds->GetDC(&hdc)) == DD_OK) { StretchBlt(hdc, 0, 0, ddsd.dwWidth, ddsd.dwHeight, hdcImage, x, y, dx, dy, SRCCOPY); pdds->ReleaseDC(hdc); } DeleteDC(hdcImage); return hr; } // // DDLoadPalette // // Create a DirectDraw palette object from a bitmap resoure // // if the resource does not exist or NULL is passed create a // default 332 palette. // extern "C" IDirectDrawPalette * DDLoadPalette(IDirectDraw *pdd, LPCSTR szBitmap) { IDirectDrawPalette* ddpal; int i; int n; int fh; HRSRC h; LPBITMAPINFOHEADER lpbi; PALETTEENTRY ape[256]; RGBQUAD * prgb; // // build a 332 palette as the default. // for (i=0; i<256; i++) { ape[i].peRed = (BYTE)(((i >> 5) & 0x07) * 255 / 7); ape[i].peGreen = (BYTE)(((i >> 2) & 0x07) * 255 / 7); ape[i].peBlue = (BYTE)(((i >> 0) & 0x03) * 255 / 3); ape[i].peFlags = (BYTE)0; } // // get a pointer to the bitmap resource. // if (szBitmap && (h = FindResource(NULL, szBitmap, RT_BITMAP))) { lpbi = (LPBITMAPINFOHEADER)LockResource(LoadResource(NULL, h)); prgb = (RGBQUAD*)((BYTE*)lpbi + lpbi->biSize); if (lpbi == NULL || lpbi->biSize < sizeof(BITMAPINFOHEADER)) n = 0; else if (lpbi->biBitCount > 8) n = 0; else if (lpbi->biClrUsed == 0) n = 1 << lpbi->biBitCount; else n = lpbi->biClrUsed; // // a DIB color table has its colors stored BGR not RGB // so flip them around. // for(i=0; i<n; i++ ) { ape[i].peRed = prgb[i].rgbRed; ape[i].peGreen = prgb[i].rgbGreen; ape[i].peBlue = prgb[i].rgbBlue; ape[i].peFlags = 0; } } else if (szBitmap && (fh = _lopen(szBitmap, OF_READ)) != -1) { BITMAPFILEHEADER bf; BITMAPINFOHEADER bi; _lread(fh, &bf, sizeof(bf)); _lread(fh, &bi, sizeof(bi)); _lread(fh, ape, sizeof(ape)); _lclose(fh); if (bi.biSize != sizeof(BITMAPINFOHEADER)) n = 0; else if (bi.biBitCount > 8) n = 0; else if (bi.biClrUsed == 0) n = 1 << bi.biBitCount; else n = bi.biClrUsed; // // a DIB color table has its colors stored BGR not RGB // so flip them around. // for(i=0; i<n; i++ ) { BYTE r = ape[i].peRed; ape[i].peRed = ape[i].peBlue; ape[i].peBlue = r; } } pdd->CreatePalette(DDPCAPS_8BIT, ape, &ddpal, NULL); return ddpal; } /* * DDColorMatch * * convert a RGB color to a pysical color. * * we do this by leting GDI SetPixel() do the color matching * then we lock the memory and see what it got mapped to. */ extern "C" DWORD DDColorMatch(IDirectDrawSurface *pdds, COLORREF rgb) { COLORREF rgbT; HDC hdc; DWORD dw = CLR_INVALID; DDSURFACEDESC ddsd; HRESULT hres; // // use GDI SetPixel to color match for us // if (rgb != CLR_INVALID && pdds->GetDC(&hdc) == DD_OK) { rgbT = GetPixel(hdc, 0, 0); // save current pixel value SetPixel(hdc, 0, 0, rgb); // set our value pdds->ReleaseDC(hdc); } // // now lock the surface so we can read back the converted color // ddsd.dwSize = sizeof(ddsd); while ((hres = pdds->Lock(NULL, &ddsd, 0, NULL)) == DDERR_WASSTILLDRAWING) ; if (hres == DD_OK) { dw = *(DWORD *)ddsd.lpSurface; // get DWORD dw &= (1 << ddsd.ddpfPixelFormat.dwRGBBitCount)-1; // mask it to bpp pdds->Unlock(NULL); } // // now put the color that was there back. // if (rgb != CLR_INVALID && pdds->GetDC(&hdc) == DD_OK) { SetPixel(hdc, 0, 0, rgbT); pdds->ReleaseDC(hdc); } return dw; } /* * DDSetColorKey * * set a color key for a surface, given a RGB. * if you pass CLR_INVALID as the color key, the pixel * in the upper-left corner will be used. */ extern "C" HRESULT DDSetColorKey(IDirectDrawSurface *pdds, COLORREF rgb) { DDCOLORKEY ddck; ddck.dwColorSpaceLowValue = DDColorMatch(pdds, rgb); ddck.dwColorSpaceHighValue = ddck.dwColorSpaceLowValue; return pdds->SetColorKey(DDCKEY_SRCBLT, &ddck); }
[ "forest.handford@affectiva.com" ]
forest.handford@affectiva.com
966f84ee573742b6a97dd133c044913fe098e59c
98284cb780bdec9381eb3f96b5bcaad6c5b9abc9
/src/lib/Transform/Canonicalization.cpp
0e746757763f45932267f4065c1942624a07022e
[ "NCSA" ]
permissive
nimit-singhania/loopy
a816dffc06ab78d10ede8d27d83a7319080925d3
1d87522ef6a7e206e67bf4dd3041fefe5b740c6f
refs/heads/master
2021-01-11T11:57:45.513338
2019-01-31T14:18:56
2019-01-31T14:18:56
69,502,154
18
5
null
2019-01-31T14:18:57
2016-09-28T20:43:11
C
UTF-8
C++
false
false
2,527
cpp
//===---- Canonicalization.cpp - Run canonicalization passes ======-------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Run the set of default canonicalization passes. // // This pass is mainly used for debugging. // //===----------------------------------------------------------------------===// #include "polly/LinkAllPasses.h" #include "polly/Canonicalization.h" #include "llvm/Transforms/Scalar.h" using namespace llvm; using namespace polly; void polly::registerCanonicalicationPasses(llvm::legacy::PassManagerBase &PM) { PM.add(llvm::createPromoteMemoryToRegisterPass()); PM.add(llvm::createInstructionCombiningPass()); PM.add(llvm::createCFGSimplificationPass()); PM.add(llvm::createTailCallEliminationPass()); PM.add(llvm::createCFGSimplificationPass()); PM.add(llvm::createReassociatePass()); PM.add(llvm::createLoopRotatePass()); PM.add(llvm::createInstructionCombiningPass()); PM.add(llvm::createIndVarSimplifyPass()); PM.add(polly::createCodePreparationPass()); } namespace { class PollyCanonicalize : public ModulePass { PollyCanonicalize(const PollyCanonicalize &) = delete; const PollyCanonicalize &operator=(const PollyCanonicalize &) = delete; public: static char ID; explicit PollyCanonicalize() : ModulePass(ID) {} ~PollyCanonicalize(); /// @name FunctionPass interface. //@{ virtual void getAnalysisUsage(AnalysisUsage &AU) const; virtual void releaseMemory(); virtual bool runOnModule(Module &M); virtual void print(raw_ostream &OS, const Module *) const; //@} }; } PollyCanonicalize::~PollyCanonicalize() {} void PollyCanonicalize::getAnalysisUsage(AnalysisUsage &AU) const {} void PollyCanonicalize::releaseMemory() {} bool PollyCanonicalize::runOnModule(Module &M) { legacy::PassManager PM; registerCanonicalicationPasses(PM); PM.run(M); return true; } void PollyCanonicalize::print(raw_ostream &OS, const Module *) const {} char PollyCanonicalize::ID = 0; Pass *polly::createPollyCanonicalizePass() { return new PollyCanonicalize(); } INITIALIZE_PASS_BEGIN(PollyCanonicalize, "polly-canonicalize", "Polly - Run canonicalization passes", false, false) INITIALIZE_PASS_END(PollyCanonicalize, "polly-canonicalize", "Polly - Run canonicalization passes", false, false)
[ "nimits@seas.upenn.edu" ]
nimits@seas.upenn.edu
ba26bc0450d3e3f80c33ec1e3eef2cbd0a15166d
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/CMake/CMake-gumtree/Kitware_CMake_old_new_old_log_857.cpp
9c028a7894b182986e402756c28ff2800f5cba40
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
237
cpp
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Ignoring out-of-order file @%jx (%s) %jd < %jd", (intmax_t)file->number, iso9660->pathname.s, (intmax_t)file->offset, (intmax_t)iso9660->current_position);
[ "993273596@qq.com" ]
993273596@qq.com
3d6b955bce11244a9d84527c5a8a51c9c77a2404
d6507daa66666878fb018b394cc0a959a0113ec3
/01/013.cc
5bb8f09573d628115e5c394c6739ac1d95678e81
[]
no_license
dmnsn7/projecteuler
a5d0098cdafcdb68901ecc68c0ba9df77d039ac4
a737037b9521c940b6b6ed12488ee73e41229b70
refs/heads/master
2023-06-09T21:33:46.625979
2023-06-07T12:17:21
2023-06-07T12:17:21
215,997,596
0
0
null
null
null
null
UTF-8
C++
false
false
6,420
cc
// Copyright [2017] <dmnsn7@gmail.com> #include <bits/stdc++.h> using std::string; using std::to_string; using std::vector; const int CNT = 100; const int RESERVED_LEN = 15; const int QUERY_LEN = 10; const vector<string> NUMBER = { "37107287533902102798797998220837590246510135740250", "46376937677490009712648124896970078050417018260538", "74324986199524741059474233309513058123726617309629", "91942213363574161572522430563301811072406154908250", "23067588207539346171171980310421047513778063246676", "89261670696623633820136378418383684178734361726757", "28112879812849979408065481931592621691275889832738", "44274228917432520321923589422876796487670272189318", "47451445736001306439091167216856844588711603153276", "70386486105843025439939619828917593665686757934951", "62176457141856560629502157223196586755079324193331", "64906352462741904929101432445813822663347944758178", "92575867718337217661963751590579239728245598838407", "58203565325359399008402633568948830189458628227828", "80181199384826282014278194139940567587151170094390", "35398664372827112653829987240784473053190104293586", "86515506006295864861532075273371959191420517255829", "71693888707715466499115593487603532921714970056938", "54370070576826684624621495650076471787294438377604", "53282654108756828443191190634694037855217779295145", "36123272525000296071075082563815656710885258350721", "45876576172410976447339110607218265236877223636045", "17423706905851860660448207621209813287860733969412", "81142660418086830619328460811191061556940512689692", "51934325451728388641918047049293215058642563049483", "62467221648435076201727918039944693004732956340691", "15732444386908125794514089057706229429197107928209", "55037687525678773091862540744969844508330393682126", "18336384825330154686196124348767681297534375946515", "80386287592878490201521685554828717201219257766954", "78182833757993103614740356856449095527097864797581", "16726320100436897842553539920931837441497806860984", "48403098129077791799088218795327364475675590848030", "87086987551392711854517078544161852424320693150332", "59959406895756536782107074926966537676326235447210", "69793950679652694742597709739166693763042633987085", "41052684708299085211399427365734116182760315001271", "65378607361501080857009149939512557028198746004375", "35829035317434717326932123578154982629742552737307", "94953759765105305946966067683156574377167401875275", "88902802571733229619176668713819931811048770190271", "25267680276078003013678680992525463401061632866526", "36270218540497705585629946580636237993140746255962", "24074486908231174977792365466257246923322810917141", "91430288197103288597806669760892938638285025333403", "34413065578016127815921815005561868836468420090470", "23053081172816430487623791969842487255036638784583", "11487696932154902810424020138335124462181441773470", "63783299490636259666498587618221225225512486764533", "67720186971698544312419572409913959008952310058822", "95548255300263520781532296796249481641953868218774", "76085327132285723110424803456124867697064507995236", "37774242535411291684276865538926205024910326572967", "23701913275725675285653248258265463092207058596522", "29798860272258331913126375147341994889534765745501", "18495701454879288984856827726077713721403798879715", "38298203783031473527721580348144513491373226651381", "34829543829199918180278916522431027392251122869539", "40957953066405232632538044100059654939159879593635", "29746152185502371307642255121183693803580388584903", "41698116222072977186158236678424689157993532961922", "62467957194401269043877107275048102390895523597457", "23189706772547915061505504953922979530901129967519", "86188088225875314529584099251203829009407770775672", "11306739708304724483816533873502340845647058077308", "82959174767140363198008187129011875491310547126581", "97623331044818386269515456334926366572897563400500", "42846280183517070527831839425882145521227251250327", "55121603546981200581762165212827652751691296897789", "32238195734329339946437501907836945765883352399886", "75506164965184775180738168837861091527357929701337", "62177842752192623401942399639168044983993173312731", "32924185707147349566916674687634660915035914677504", "99518671430235219628894890102423325116913619626622", "73267460800591547471830798392868535206946944540724", "76841822524674417161514036427982273348055556214818", "97142617910342598647204516893989422179826088076852", "87783646182799346313767754307809363333018982642090", "10848802521674670883215120185883543223812876952786", "71329612474782464538636993009049310363619763878039", "62184073572399794223406235393808339651327408011116", "66627891981488087797941876876144230030984490851411", "60661826293682836764744779239180335110989069790714", "85786944089552990653640447425576083659976645795096", "66024396409905389607120198219976047599490197230297", "64913982680032973156037120041377903785566085089252", "16730939319872750275468906903707539413042652315011", "94809377245048795150954100921645863754710598436791", "78639167021187492431995700641917969777599028300699", "15368713711936614952811305876380278410754449733078", "40789923115535562561142322423255033685442488917353", "44889911501440648020369068063960672322193204149535", "41503128880339536053299340368006977710650566631954", "81234880673210146739058568557934581403627822703280", "82616570773948327592232845941706525094512325230608", "22918802058777319719839450180888072429661980811197", "77158542502016545090413245809786882778948721859617", "72107838435069186155435662884062257473692284509516", "20849603980134001723930671666823555245252804609722", "53503534226472524250874054075591789781264330331690", }; int main() { int64_t sum = 0; for (int i = 0; i < CNT; i++) { string reserved = string(NUMBER[i].begin(), NUMBER[i].begin() + RESERVED_LEN); int64_t num; sscanf(reserved.c_str(), "%ld", &num); sum += num; } string s_sum = to_string(sum); s_sum = string(s_sum.begin(), s_sum.begin() + QUERY_LEN); printf("%s\n", s_sum.c_str()); return 0; }
[ "jie.liu@airbnb.com" ]
jie.liu@airbnb.com
34c64acb37e92c0991fc340f6c880448395b7fd0
60a15a584b00895e47628c5a485bd1f14cfeebbe
/comps/docs/ImageDoc/imgactions.h
bb484214d888db0be40c2e9f894ca43100d102fa
[]
no_license
fcccode/vt5
ce4c1d8fe819715f2580586c8113cfedf2ab44ac
c88049949ebb999304f0fc7648f3d03f6501c65b
refs/heads/master
2020-09-27T22:56:55.348501
2019-06-17T20:39:46
2019-06-17T20:39:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,766
h
#ifndef __imgactions_h__ #define __imgactions_h__ struct CAphineParams; //[ag]1. classes //paul12.04.2002 #define DECLARE_AVAIBLE() \ bool IsAvaible() \ { \ CChechAvailable avail; \ return avail.IsAvaible(); \ } \ struct CChechAvailable { bool IsAvaible(); }; bool fill_background_color( IUnknown* punk_image ); class CCropRectCtrl; class CActionCrop : public CInteractiveActionBase, public CLongOperationImpl { ENABLE_UNDO(); ENABLE_MULTYINTERFACE(); DECLARE_INTERFACE_MAP(); DECLARE_DYNCREATE(CActionCrop) GUARD_DECLARE_OLECREATE(CActionCrop) public: CActionCrop(); virtual ~CActionCrop(); public: virtual bool Invoke(); virtual bool IsAvaible(); virtual bool IsChecked(); virtual bool IsRequiredInvokeOnTerminate(){return false;} virtual bool DoLButtonDown( CPoint pt ); virtual bool DoUpdateSettings(); virtual bool Initialize(); virtual void Finalize(); virtual bool DoUndo(); virtual bool DoRedo(); protected: void StoreCurrentExecuteParams(); bool CanDoCrop(); void _CreateController(CSize sizeContr); CCropRectCtrl* m_pctrl; CSize m_size; CPoint m_point; CObjectListUndoRecord m_changes; IUnknownPtr m_ptrImage; }; class CActionLongUndoBase : public CActionBase, public CLongOperationImpl { ENABLE_UNDO(); ENABLE_MULTYINTERFACE(); DECLARE_INTERFACE_MAP(); public: virtual bool DoUndo(); virtual bool DoRedo(); CObjectListUndoRecord m_changes; }; class CActionBorders : public CFilterBase { DECLARE_DYNCREATE(CActionBorders) GUARD_DECLARE_OLECREATE(CActionBorders) public: CActionBorders(); virtual ~CActionBorders(); public: virtual bool InvokeFilter(); color** m_ppColors; color m_colors; }; class CActionClone : public CActionLongUndoBase { DECLARE_DYNCREATE(CActionClone) GUARD_DECLARE_OLECREATE(CActionClone) public: CActionClone(); virtual ~CActionClone(); public: virtual bool Invoke(); // virtual bool IsAvaible(); // Max : 2706 DECLARE_AVAIBLE() }; class CActionExpansion : public CActionLongUndoBase { DECLARE_DYNCREATE(CActionExpansion) GUARD_DECLARE_OLECREATE(CActionExpansion) public: CActionExpansion(); virtual ~CActionExpansion(); public: virtual bool Invoke(); virtual bool IsAvaible(); CImageWrp m_imageSource; CImageWrp** m_pimagesDest; long m_nImages; }; class CActionMerge : public CFilterBase { DECLARE_DYNCREATE(CActionMerge) GUARD_DECLARE_OLECREATE(CActionMerge) public: CActionMerge(); virtual ~CActionMerge(); public: virtual bool InvokeFilter(); // vk begin virtual bool IsAvaible(); // vk end CImageWrp** m_pImagesSource; CImageWrp m_imageDest; int m_nImages; }; class CTransformBase2 : public CFilterBase { public: CTransformBase2(); ~CTransformBase2(); public: virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget){}; virtual bool SetParams(CAphineParams* pparams) = 0; virtual bool InvokeFilter(); virtual CRect GetRect(CRect rcSrc){return rcSrc;}; protected: color** m_ppcolorscr; color*** m_ppcolordest; byte** m_ppmask; long m_colors; bool m_bAphineTransform; bool m_bCopyMask; }; class CActionRotate270 : public CTransformBase2 { DECLARE_DYNCREATE(CActionRotate270) GUARD_DECLARE_OLECREATE(CActionRotate270) public: CActionRotate270(); virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget); virtual bool SetParams(CAphineParams* pparams); virtual CRect GetRect(CRect rcSrc){return CRect(rcSrc.left, rcSrc.top, rcSrc.left + rcSrc.Height(), rcSrc.top + rcSrc.Width());}; }; class CActionRotate180 : public CTransformBase2 { DECLARE_DYNCREATE(CActionRotate180) GUARD_DECLARE_OLECREATE(CActionRotate180) public: CActionRotate180(); virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget); virtual bool SetParams(CAphineParams* pparams); }; class CActionRotate90 : public CTransformBase2 { DECLARE_DYNCREATE(CActionRotate90) GUARD_DECLARE_OLECREATE(CActionRotate90) public: CActionRotate90(); virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget); virtual bool SetParams(CAphineParams* pparams); virtual CRect GetRect(CRect rcSrc){return CRect(rcSrc.left, rcSrc.top, rcSrc.left + rcSrc.Height(), rcSrc.top + rcSrc.Width());}; }; class CActionMirrorVert : public CTransformBase2 { DECLARE_DYNCREATE(CActionMirrorVert) GUARD_DECLARE_OLECREATE(CActionMirrorVert) public: CActionMirrorVert(); virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget); virtual bool SetParams(CAphineParams* pparams); // Max : 2706 DECLARE_AVAIBLE() }; class CActionMirrorHorz : public CTransformBase2 { DECLARE_DYNCREATE(CActionMirrorHorz) GUARD_DECLARE_OLECREATE(CActionMirrorHorz) public: CActionMirrorHorz(); virtual void DoTransform(CImageWrp& image, CImageWrp& imageTarget); virtual bool SetParams(CAphineParams* pparams); // Max : 2706 DECLARE_AVAIBLE() }; class CActionRotate : public CTransformBase2 { DECLARE_DYNCREATE(CActionRotate) GUARD_DECLARE_OLECREATE(CActionRotate) public: CActionRotate(); public: virtual bool SetParams(CAphineParams* pparams); }; class CActionResize : public CTransformBase2 { DECLARE_DYNCREATE(CActionResize) GUARD_DECLARE_OLECREATE(CActionResize) public: CActionResize(); public: virtual bool SetParams(CAphineParams* pparams); }; class CActionImageTransform : public CActionBase { DECLARE_DYNCREATE(CActionImageTransform) GUARD_DECLARE_OLECREATE(CActionImageTransform) ENABLE_UNDO(); public: CActionImageTransform(); virtual ~CActionImageTransform(); public: virtual bool Invoke(); //undo interface virtual bool DoUndo(); virtual bool DoRedo(); //update interface virtual bool IsAvaible(); protected: void _UpdateObject(); protected: CObjectListUndoRecord m_changes; bool m_bObject; CImageWrp m_imageSource, m_imageDest; CObjectWrp m_object; }; class CActionShowObjectViewBase : public CActionShowViewBase { protected: virtual void AfterInvoke() { ::SetValue(GetAppUnknown(), "General", "LastUsedObjectView", _variant_t(GetViewProgID())); }; }; class CActionShowBinaryViewBase : public CActionShowViewBase { protected: virtual void AfterInvoke() { ::SetValue(GetAppUnknown(), "General", "LastUsedBinaryView", _variant_t(GetViewProgID())); }; }; class CActionShowImage : public CActionShowObjectViewBase { DECLARE_DYNCREATE(CActionShowImage) GUARD_DECLARE_OLECREATE(CActionShowImage) public: virtual CString GetViewProgID(); }; class CActionShowMasks : public CActionShowObjectViewBase { DECLARE_DYNCREATE(CActionShowMasks) GUARD_DECLARE_OLECREATE(CActionShowMasks) public: virtual CString GetViewProgID(); }; class CActionShowObjects : public CActionShowObjectViewBase { DECLARE_DYNCREATE(CActionShowObjects) GUARD_DECLARE_OLECREATE(CActionShowObjects) public: virtual CString GetViewProgID(); }; class CActionShowPseudo : public CActionShowObjectViewBase { DECLARE_DYNCREATE(CActionShowPseudo) GUARD_DECLARE_OLECREATE(CActionShowPseudo) public: virtual CString GetViewProgID(); }; class CActionShowSource : public CActionShowViewBase { DECLARE_DYNCREATE(CActionShowSource) GUARD_DECLARE_OLECREATE(CActionShowSource) public: virtual CString GetViewProgID(); }; class CActionShowBinaryFore : public CActionShowBinaryViewBase { DECLARE_DYNCREATE(CActionShowBinaryFore) GUARD_DECLARE_OLECREATE(CActionShowBinaryFore) public: virtual CString GetViewProgID(); }; class CActionShowBinaryBack : public CActionShowBinaryViewBase { DECLARE_DYNCREATE(CActionShowBinaryBack) GUARD_DECLARE_OLECREATE(CActionShowBinaryBack) public: virtual CString GetViewProgID(); }; class CActionShowBinary : public CActionShowBinaryViewBase { DECLARE_DYNCREATE(CActionShowBinary) GUARD_DECLARE_OLECREATE(CActionShowBinary) public: virtual CString GetViewProgID(); }; class CActionShowBinaryContour : public CActionShowBinaryViewBase { DECLARE_DYNCREATE(CActionShowBinaryContour) GUARD_DECLARE_OLECREATE(CActionShowBinaryContour) public: virtual CString GetViewProgID(); }; class CActionShowView : public CActionShowViewBase { DECLARE_DYNCREATE(CActionShowView) GUARD_DECLARE_OLECREATE(CActionShowView) public: virtual CString GetViewProgID(); }; class CActionShowPhase : public CActionShowBinaryViewBase { DECLARE_DYNCREATE(CActionShowPhase) GUARD_DECLARE_OLECREATE(CActionShowPhase) public: virtual CString GetViewProgID(); }; class CActionShowCalibr : public CActionBase { DECLARE_DYNCREATE(CActionShowCalibr) GUARD_DECLARE_OLECREATE(CActionShowCalibr) protected: virtual bool Invoke(); virtual bool IsChecked(); virtual bool IsAvaible(); }; class CActionCipher : public CFilterBase { DECLARE_DYNCREATE(CActionCipher) GUARD_DECLARE_OLECREATE(CActionCipher) public: CActionCipher(); virtual ~CActionCipher(); public: virtual bool InvokeFilter(); }; #endif //__imgactions_h__
[ "videotestc@gmail.com" ]
videotestc@gmail.com
094fffe623781c78af8b72cfc7507eb5ab94e197
6d1f45ea591f5bd5616de898c29c8f55b22d0ec1
/include/glfw/__window/create_surface.hpp
943dc26525579f400488864af52ec0043b4eb59a
[]
no_license
cpp-wrappers/glfw-wrapper
0136602ad9f4eef07e19149198a5b16893706190
4a948ef7f58b0ccb5e1942787d10b2af839106db
refs/heads/master
2023-06-23T22:43:09.106897
2023-06-14T04:58:19
2023-06-14T04:58:19
175,873,362
0
0
null
null
null
null
UTF-8
C++
false
false
1,852
hpp
#pragma once #if __has_include(<vk/instance.hpp>) && __has_include(<vk/surface.hpp>) #include "./handle.hpp" #include "../__internal/function.hpp" #include <vk/instance.hpp> #include <vk/surface.hpp> #include <types.hpp> #include <tuple.hpp> extern "C" GLFW_API int32 glfwCreateWindowSurface( handle<vk::instance>::underlying_type instance, handle<glfw::window>::underlying_type window, const void* allocator, handle<vk::surface>::underlying_type* surface ); namespace glfw { template<typename... Args> requires types<Args...>::template exclusively_satisfy_predicates< count_of_decayed_same_as<handle<vk::instance>> == 1, count_of_decayed_same_as<handle<glfw::window>> == 1 > vk::expected<handle<vk::surface>> try_create_window_surface(Args&&... args) { handle<vk::instance> instance = tuple{ args... }.template get_decayed_same_as<handle<vk::instance>>(); handle<glfw::window> window = tuple{ args... }.template get_decayed_same_as<handle<glfw::window>>(); handle<vk::surface> surface; vk::result result { glfwCreateWindowSurface( instance.underlying(), window.underlying(), nullptr, &surface.underlying() ) }; if(result.error()) { return result; } return surface; } template<typename... Args> handle<vk::surface> create_window_surface(Args&&... args) { vk::expected<handle<vk::surface>> result = glfw::try_create_window_surface(forward<Args>(args)...); if(result.is_unexpected()) { vk::unexpected_handler(result.get_unexpected()); } return result.get_expected(); } } // glfw inline handle<vk::surface> handle_interface<glfw::window>:: create_surface(handle<vk::instance> instance) { return glfw::create_window_surface( handle<glfw::window>{ underlying() }, instance ); } #endif
[ "hazeevaidar@gmail.com" ]
hazeevaidar@gmail.com
9b2b9977f4dfe96fe4517598e6fa325f7f83e4f1
61d4e279bb59dab28e11ac17f99e466cf8aba3cc
/src/server/scripts/Pandaria/MogushanPalace/instance_mogu_shan_palace.cpp
4dc9ea7dd012fc775b61a4f074654d4cd549ceeb
[]
no_license
dufernst/5.4.8-Wow-source
a840af25441ec9c38622c16de40b2997d4605ad1
5511dffb1e9ad2e2e0b794288c4b9ea5041112d5
refs/heads/master
2021-01-16T22:12:12.568039
2015-08-19T22:55:05
2015-08-19T22:55:05
41,120,934
2
10
null
2015-08-20T22:03:56
2015-08-20T22:03:56
null
UTF-8
C++
false
false
23,507
cpp
/* Dungeon : Template of Mogu'shan Palace 87-89 Instance General Script Jade servers */ #include "ScriptMgr.h" #include "InstanceScript.h" #include "VMapFactory.h" #include "mogu_shan_palace.h" class instance_mogu_shan_palace : public InstanceMapScript { public: instance_mogu_shan_palace() : InstanceMapScript("instance_mogu_shan_palace", 994) { } InstanceScript* GetInstanceScript(InstanceMap* map) const { return new instance_mogu_shan_palace_InstanceMapScript(map); } struct instance_mogu_shan_palace_InstanceMapScript : public InstanceScript { /* ** Trial of the king. */ uint64 xin_guid; uint64 kuai_guid; uint64 ming_guid; uint64 haiyan_guid; std::list<uint64> scrappers; std::list<uint64> adepts; std::list<uint64> grunts; /* ** End of the trial of the king. */ /* ** Gekkan. */ uint64 gekkan; uint64 glintrok_ironhide; uint64 glintrok_skulker; uint64 glintrok_oracle; uint64 glintrok_hexxer; /* ** End of Gekkan. */ /* ** Xin the weaponmaster. */ std::list<uint64> animated_staffs; std::list<uint64> animated_axes; std::list<uint64> swordLauncherGuids; /* ** End of Xin the weaponmaster. */ uint64 doorBeforeTrialGuid; uint64 trialChestGuid; uint64 doorAfterTrialGuid; uint64 doorBeforeKingGuid; instance_mogu_shan_palace_InstanceMapScript(Map* map) : InstanceScript(map) {} void Initialize() { xin_guid = 0; kuai_guid = 0; ming_guid = 0; haiyan_guid = 0; doorBeforeTrialGuid = 0; trialChestGuid = 0; doorAfterTrialGuid = 0; doorBeforeKingGuid = 0; gekkan = 0; glintrok_ironhide = 0; glintrok_skulker = 0; glintrok_oracle = 0; glintrok_hexxer = 0; } bool SetBossState(uint32 id, EncounterState state) { if (!InstanceScript::SetBossState(id, state)) return false; switch (id) { case DATA_TRIAL_OF_THE_KING: HandleGameObject(doorBeforeTrialGuid, state != IN_PROGRESS); if (GameObject* chest = instance->GetGameObject(trialChestGuid)) chest->SetPhaseMask(state == DONE ? 1: 128, true); break; case DATA_GEKKAN: HandleGameObject(doorAfterTrialGuid, state == DONE); // Todo : mod temp portal phasemask break; case DATA_XIN_THE_WEAPONMASTER: HandleGameObject(doorBeforeTrialGuid, state != IN_PROGRESS); break; } return true; } void OnGameObjectCreate(GameObject* go) { switch (go->GetEntry()) { case GO_DOOR_BEFORE_TRIAL: doorBeforeTrialGuid = go->GetGUID(); break; case GO_TRIAL_CHEST: trialChestGuid = go->GetGUID(); go->SetPhaseMask(128, true); break; case GO_DOOR_AFTER_TRIAL: doorAfterTrialGuid = go->GetGUID(); break; case GO_DOOR_BEFORE_KING: doorBeforeKingGuid = go->GetGUID(); break; } } void OnCreatureCreate(Creature* creature) { OnCreatureCreate_gekkan(creature); OnCreatureCreate_trial_of_the_king(creature); OnCreatureCreate_xin_the_weaponmaster(creature); } void OnUnitDeath(Unit* unit) { OnUnitDeath_gekkan(unit); } void SetData(uint32 type, uint32 data) { switch (type) { case DATA_GEKKAN_ADDS: if (Creature* pGekkan = instance->GetCreature(gekkan)) { if (Unit * target = pGekkan->SelectNearestTarget(100.0f)) { pGekkan->AI()->AttackStart(target); if (Creature* ironhide = instance->GetCreature(glintrok_ironhide)) ironhide->AI()->AttackStart(target); if (Creature* skulker = instance->GetCreature(glintrok_skulker)) skulker->AI()->AttackStart(target); if (Creature* oracle = instance->GetCreature(glintrok_oracle)) oracle->AI()->AttackStart(target); if (Creature* hexxer = instance->GetCreature(glintrok_hexxer)) hexxer->AI()->AttackStart(target); } } break; } SetData_trial_of_the_king(type, data); SetData_xin_the_weaponmaster(type, data); } uint32 GetData(uint32 type) { return 0; } uint64 GetData64(uint32 type) { switch (type) { case TYPE_GET_ENTOURAGE_0: return glintrok_hexxer; case TYPE_GET_ENTOURAGE_1: return glintrok_ironhide; case TYPE_GET_ENTOURAGE_2: return glintrok_oracle; case TYPE_GET_ENTOURAGE_3: return glintrok_skulker; } return 0; } bool isWipe() { Map::PlayerList const& PlayerList = instance->GetPlayers(); if (!PlayerList.isEmpty()) { for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if(Player* plr = i->getSource()) if (plr->isAlive() && !plr->isGameMaster()) return false; } } return true; } void SetData_xin_the_weaponmaster(uint32 type, uint32 data) { switch (type) { case TYPE_ACTIVATE_ANIMATED_STAFF: { if (Creature* creature = instance->GetCreature(WoWSource::Containers::SelectRandomContainerElement(animated_staffs))) if (creature->GetAI()) creature->GetAI()->DoAction(0); //ACTION_ACTIVATE break; } case TYPE_ACTIVATE_ANIMATED_AXE: { for (auto guid : animated_axes) { if (Creature* creature = instance->GetCreature(guid)) { if (data) { creature->AddAura(SPELL_AXE_TOURBILOL, creature); creature->AddAura(SPELL_PERMANENT_FEIGN_DEATH, creature); creature->GetMotionMaster()->MoveRandom(50.0f); } else { creature->RemoveAurasDueToSpell(SPELL_AXE_TOURBILOL); creature->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); creature->GetMotionMaster()->MoveTargetedHome(); } } } break; } case TYPE_ACTIVATE_SWORD: { Position center; center.Relocate(-4632.39f, -2613.20f, 22.0f); bool randPos = urand(0, 1); /* Y - *********** -> 1 * 2 <- + *********** - X -> 3 * 4 <- *********** + */ for (auto itr: swordLauncherGuids) { bool mustActivate = false; if (Creature* launcher = instance->GetCreature(itr)) { if (randPos) // Zone 2 & 3 { if (launcher->GetPositionX() > center.GetPositionX() && launcher->GetPositionY() > center.GetPositionY() || launcher->GetPositionX() < center.GetPositionX() && launcher->GetPositionY() < center.GetPositionY()) mustActivate = true; } else // Zone 1 & 4 { if (launcher->GetPositionX() > center.GetPositionX() && launcher->GetPositionY() < center.GetPositionY() || launcher->GetPositionX() < center.GetPositionX() && launcher->GetPositionY() > center.GetPositionY()) mustActivate = true; } if (data && mustActivate) launcher->AddAura(SPELL_THROW_AURA, launcher); else launcher->RemoveAurasDueToSpell(SPELL_THROW_AURA); } } } break; } } void OnCreatureCreate_xin_the_weaponmaster(Creature* creature) { switch (creature->GetEntry()) { case 59481: creature->SetReactState(REACT_PASSIVE); break; case CREATURE_ANIMATED_STAFF: animated_staffs.push_back(creature->GetGUID()); break; case CREATURE_ANIMATED_AXE: animated_axes.push_back(creature->GetGUID()); creature->SetReactState(REACT_PASSIVE); creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 30316); break; case CREATURE_LAUNCH_SWORD: swordLauncherGuids.push_back(creature->GetGUID()); creature->AddAura(SPELL_PERMANENT_FEIGN_DEATH, creature); break; } } void OnUnitDeath_gekkan(Unit* unit) { if (unit->ToCreature()) { switch (unit->ToCreature()->GetEntry()) { case CREATURE_GLINTROK_IRONHIDE: case CREATURE_GLINTROK_SKULKER: case CREATURE_GLINTROK_ORACLE: case CREATURE_GLINTROK_HEXXER: { if (Creature* c = instance->GetCreature(gekkan)) if (c->GetAI()) c->GetAI()->DoAction(0); //ACTION_ENTOURAGE_DIED } break; } } } void OnCreatureCreate_gekkan(Creature* creature) { switch (creature->GetEntry()) { case CREATURE_GEKKAN: gekkan = creature->GetGUID(); break; case CREATURE_GLINTROK_IRONHIDE: glintrok_ironhide = creature->GetGUID(); break; case CREATURE_GLINTROK_SKULKER: glintrok_skulker = creature->GetGUID(); break; case CREATURE_GLINTROK_ORACLE: glintrok_oracle = creature->GetGUID(); break; case CREATURE_GLINTROK_HEXXER: glintrok_hexxer = creature->GetGUID(); break; } } void SetData_trial_of_the_king(uint32 type, uint32 data) { switch (type) { case TYPE_OUTRO_05: { if (Creature* haiyan = instance->GetCreature(haiyan_guid)) if (haiyan->GetAI()) haiyan->GetAI()->DoAction(1); //ACTION_OUTRO_02 } break; case TYPE_OUTRO_04: { if (Creature* kuai = instance->GetCreature(kuai_guid)) if (kuai->GetAI()) kuai->GetAI()->DoAction(3); //ACTION_OUTRO_02 } break; case TYPE_OUTRO_03: { if (Creature* ming = instance->GetCreature(ming_guid)) if (ming->GetAI()) ming->GetAI()->DoAction(2); //ACTION_OUTRO_02 } break; case TYPE_OUTRO_02: { if (Creature* haiyan = instance->GetCreature(haiyan_guid)) if (haiyan->GetAI()) haiyan->GetAI()->DoAction(0); //ACTION_OUTRO_01 } break; case TYPE_OUTRO_01: { if (Creature* ming = instance->GetCreature(ming_guid)) if (ming->GetAI()) ming->GetAI()->DoAction(1); //ACTION_OUTRO_01 } break; case TYPE_MING_INTRO: { if (Creature* ming = instance->GetCreature(ming_guid)) if (ming->GetAI()) ming->GetAI()->DoAction(0); //ACTION_INTRO } break; case TYPE_WIPE_FIRST_BOSS: { Creature* xin = instance->GetCreature(xin_guid); if (!xin) return; xin->SetVisible(true); if (xin->GetAI()) xin->GetAI()->Reset(); switch (data) { case 0: for (auto guid : adepts) { Creature* creature = instance->GetCreature(guid); if (!creature) continue; if (creature && creature->GetAI()) creature->GetAI()->DoAction(1); //EVENT_RETIRE creature->RemoveAura(121569); } break; case 1: for (auto guid : scrappers) { Creature* creature = instance->GetCreature(guid); if (!creature) continue; if (creature && creature->GetAI()) creature->GetAI()->DoAction(1); //EVENT_RETIRE creature->RemoveAura(121569); } break; case 2: for (auto guid : grunts) { Creature* creature = instance->GetCreature(guid); if (!creature) continue; if (creature && creature->GetAI()) creature->GetAI()->DoAction(1); //EVENT_RETIRE creature->RemoveAura(121569); } break; } } break; case TYPE_MING_ATTACK: { //Move the adepts for (auto guid : adepts) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(0); //EVENT_ENCOURAGE } Creature* ming = instance->GetCreature(ming_guid); if (!ming) return; ming->GetMotionMaster()->MovePoint(0, -4237.658f, -2613.860f, 16.48f); ming->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); ming->SetReactState(REACT_AGGRESSIVE); } break; case TYPE_KUAI_ATTACK: { //Move the scrappers for (auto guid : scrappers) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(0); //EVENT_ENCOURAGE } Creature* kuai = instance->GetCreature(kuai_guid); if (!kuai) return; kuai->GetMotionMaster()->MovePoint(0, -4215.359f, -2601.283f, 16.48f); kuai->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); kuai->SetReactState(REACT_AGGRESSIVE); } break; case TYPE_HAIYAN_ATTACK: { //Move the scrappers for (auto guid : grunts) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(0); //EVENT_ENCOURAGE } Creature* haiyan = instance->GetCreature(haiyan_guid); if (!haiyan) return; haiyan->GetMotionMaster()->MovePoint(0, -4215.772f, -2627.216f, 16.48f); haiyan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); haiyan->SetReactState(REACT_AGGRESSIVE); } break; case TYPE_ALL_ATTACK: { for (auto guid : adepts) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(2); //ACTION_ATTACK std::list<uint64>::iterator itr = grunts.begin(); std::advance(itr, urand(0, grunts.size() - 1)); Creature* grunt = instance->GetCreature(*itr); if (creature && grunt) creature->Attack(grunt, true); } for (auto guid : grunts) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(2); //ACTION_ATTACK std::list<uint64>::iterator itr = scrappers.begin(); std::advance(itr, urand(0, scrappers.size() - 1)); Creature* scrapper = instance->GetCreature(*itr); if (creature && scrapper) creature->Attack(scrapper, true); } for (auto guid : scrappers) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(2); //ACTION_ATTACK std::list<uint64>::iterator itr = adepts.begin(); std::advance(itr, urand(0, adepts.size() - 1)); Creature* adept = instance->GetCreature(*itr); if (creature && adept) creature->Attack(adept, true); } SetBossState(DATA_TRIAL_OF_THE_KING, DONE); } break; case TYPE_MING_RETIRED: //Retire the adepts for (auto guid : adepts) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(1); //EVENT_RETIRE } break; case TYPE_KUAI_RETIRED: //Retire the adepts for (auto guid : scrappers) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(1); //EVENT_RETIRE } break; case TYPE_HAIYAN_RETIRED: //Retire the adepts for (auto guid : grunts) { Creature* creature = instance->GetCreature(guid); if (creature && creature->GetAI()) creature->GetAI()->DoAction(1); //EVENT_RETIRE } break; } } void OnCreatureCreate_trial_of_the_king(Creature* creature) { switch (creature->GetEntry()) { case CREATURE_GURTHAN_SCRAPPER: scrappers.push_back(creature->GetGUID()); break; case CREATURE_HARTHAK_ADEPT: adepts.push_back(creature->GetGUID()); break; case CREATURE_KARGESH_GRUNT: grunts.push_back(creature->GetGUID()); break; case CREATURE_KUAI_THE_BRUTE: kuai_guid = creature->GetGUID(); creature->SetReactState(REACT_PASSIVE); break; case CREATURE_MING_THE_CUNNING: ming_guid = creature->GetGUID(); creature->SetReactState(REACT_PASSIVE); break; case CREATURE_HAIYAN_THE_UNSTOPPABLE: haiyan_guid = creature->GetGUID(); creature->SetReactState(REACT_PASSIVE); break; case CREATURE_XIN_THE_WEAPONMASTER_TRIGGER: xin_guid = creature->GetGUID(); creature->SetReactState(REACT_PASSIVE); break; case CREATURE_WHIRLING_DERVISH: break; } } }; }; class go_mogushan_palace_temp_portal : public GameObjectScript { public: go_mogushan_palace_temp_portal() : GameObjectScript("go_mogushan_palace_temp_portal") { } bool OnGossipHello(Player* player, GameObject* go) { if (go->GetPositionZ() < 0.0f) player->NearTeleportTo(go->GetPositionX(), go->GetPositionY(), 22.31f, go->GetOrientation()); else player->NearTeleportTo(go->GetPositionX(), go->GetPositionY(), -39.0f, go->GetOrientation()); return false; } }; void AddSC_instance_mogu_shan_palace() { new instance_mogu_shan_palace(); new go_mogushan_palace_temp_portal(); }
[ "andra778@yahoo.com" ]
andra778@yahoo.com
cfca63a964c7e09d06ee177dc3a8327363181015
0795b456eb8343c3663c71d8219086e9fbe21078
/normal-55-Jump_Game/55-Jump_Game__dp.cpp
ecc5b2ce47bd4811a2b8c966388f43bcc9ab7a40
[]
no_license
burningDown/my_leetcode
ae5521c2233ef86d3e48fd175952ec81f6ae3ca1
02be289989b9bbda198578e88f004dc83842d40f
refs/heads/master
2021-07-06T15:07:45.904592
2020-09-07T13:36:40
2020-09-07T13:36:40
177,900,149
0
0
null
null
null
null
UTF-8
C++
false
false
474
cpp
class Solution { public: bool canJump(vector<int>& nums) { if(nums.size() == 0) return true; vector<bool> dp(nums.size(), false); const int l = nums.size(); dp[0] = true; for(int i=0;i<l;i++) { if(dp[i]) { for(int j=1;j<=nums[i]&&i+j<l;j++) { dp[i+j] = true; } } } return dp[l-1]; } };
[ "734556742@qq.com" ]
734556742@qq.com
690f1ddffc64f82bf8b2072bb7af3d6b94102d75
b39b0652150a981c9e08d63b78a5b8d57197601e
/doom_py/src/lib/ViZDoomExceptions.cpp
e9bd19b6830b9a2fb36d47251e6abc61072e3463
[ "MIT" ]
permissive
jaekyeom/doom-py
476026afd7dad6ecd47cf2633c745e3b09fa5c9c
a7d08a0f2e92b0ba4be538e182791be4c5a11a1b
refs/heads/master
2020-03-06T18:52:38.651857
2018-04-05T14:28:14
2018-04-05T14:28:14
127,015,715
1
0
MIT
2018-03-27T16:29:10
2018-03-27T16:29:10
null
UTF-8
C++
false
false
3,018
cpp
/* Copyright (C) 2016 by Wojciech Jaśkowski, Michał Kempka, Grzegorz Runc, Jakub Toczek, Marek Wydmuch 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 "ViZDoomExceptions.h" #include <cstring> namespace vizdoom{ /* FileDoesNotExistException */ FileDoesNotExistException::FileDoesNotExistException(std::string path){ this->path = path; } FileDoesNotExistException::~FileDoesNotExistException() throw(){} const char* FileDoesNotExistException::what() const throw(){ std::string what = std::string("File \"") + this->path + "\" does not exist."; return strdup(what.c_str()); } /* MessageQueueException */ const char* MessageQueueException::what() const throw(){ return "ViZDoom message queue error."; } /* SharedMemoryException */ const char* SharedMemoryException::what() const throw(){ return "ViZDoom shared memory error."; } /* ViZDoomErrorException */ const char* ViZDoomErrorException::what() const throw(){ return "Controlled ViZDoom instance reported error."; } /* ViZDoomIsNotRunningException */ const char* ViZDoomIsNotRunningException::what() const throw(){ return "Controlled ViZDoom instance is not running or not ready."; } /* ViZDoomMismatchedVersionException */ ViZDoomMismatchedVersionException::ViZDoomMismatchedVersionException(std::string vizdoomVersion, std::string libVersion){ this->vizdoomVersion = vizdoomVersion; this->libVersion = libVersion; } ViZDoomMismatchedVersionException::~ViZDoomMismatchedVersionException() throw(){} const char* ViZDoomMismatchedVersionException::what() const throw(){ std::string what = "Controlled ViZDoom version (" + this->vizdoomVersion + ") does not match library version (" + this->libVersion + ")."; return strdup(what.c_str()); } /* ViZDoomUnexpectedExitException */ const char* ViZDoomUnexpectedExitException::what() const throw(){ return "Controlled ViZDoom instance exited unexpectedly."; } }
[ "jietang@openai.com" ]
jietang@openai.com
02c40d6a8c9edc44e742fc75420855ba1f6ef763
7a89c2e347e17f0aed9e16f2de81f6021ad56023
/src/Components_Web/WeightSensor_Web.cpp
cacc8d61247016aaf4b90b98b3af38de969d0661
[]
no_license
Whonymous/Gbox420
aee2618ee817eff34939e8892d4eef52c7f22e00
27bbc1a356c2a5d7f040293c3608c6b1288324f9
refs/heads/master
2022-12-17T11:51:27.223683
2020-09-16T23:02:39
2020-09-16T23:02:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,951
cpp
#include "WeightSensor_Web.h" WeightSensor_Web::WeightSensor_Web(const __FlashStringHelper *Name, Module_Web *Parent, Settings::WeightSensorSettings *DefaultSettings) : Common(Name), WeightSensor(Name,Parent,DefaultSettings), Common_Web(Name) { this->Parent = Parent; this->Name = Name; Parent->addToReportQueue(this); Parent->addToRefreshQueue_Minute(this); Parent->addToRefreshQueue_Sec(this); Parent->addToWebsiteQueue_Load(this); Parent->addToWebsiteQueue_Refresh(this); Parent->addToWebsiteQueue_Button(this); Parent->addToWebsiteQueue_Field(this); } void WeightSensor_Web::reportToJSON() { Common_Web::reportToJSON(); ///< Adds a curly bracket { that needs to be closed at the end strcat_P(LongMessage, (PGM_P)F("\"}")); ///< closing the curly bracket } void WeightSensor_Web::websiteEvent_Load(__attribute__((unused)) char *url) { if (strncmp(url, "/S",2) == 0) { /// } } void WeightSensor_Web::websiteEvent_Refresh(__attribute__((unused)) char *url) { if (strncmp(url, "/S",2) == 0) ////When the settings page is refreshed { WebServer.setArgString(getComponentName(F("Offset")), toText(*Offset)); WebServer.setArgString(getComponentName(F("Scale")), toText(*Scale)); } else if(strncmp(url, "/G",2) == 0) { WebServer.setArgFloat(getComponentName(F("W")), getWeight()); } } void WeightSensor_Web::websiteEvent_Button(char *Button) { if (!isThisMyComponent(Button)) { return; } else { if (strcmp_P(ShortMessage, (PGM_P)F("Tare")) == 0) { triggerTare(); } } } void WeightSensor_Web::websiteEvent_Field(char *Field) { if (!isThisMyComponent(Field)) { return; } else { if (strcmp_P(ShortMessage, (PGM_P)F("Calibrate")) == 0) { triggerCalibration(WebServer.getArgInt()); } else if (strcmp_P(ShortMessage, (PGM_P)F("Scale")) == 0) { setScale(WebServer.getArgFloat()); } } }
[ "growboxguy@gmail.com" ]
growboxguy@gmail.com
bd920715a6891dc3482dae6390694cff350a8e69
746353363abb3f4e7536de0cbed223dd99dcdcb0
/src/core/tracer/include/agz/tracer/factory/raw/medium.h
aa93769d63c5e05086490ad2fb34e1ea6e55a834
[ "MIT" ]
permissive
vcoda/Atrc
65aeb7d9b9a9578d1d768fc58951ffa7853e025e
8b6614053d0866b409961d1ddb84238523fa5b02
refs/heads/master
2020-09-12T12:36:32.629569
2019-11-08T06:53:42
2019-11-08T06:53:42
null
0
0
null
null
null
null
UTF-8
C++
false
false
328
h
#pragma once #include <agz/tracer/core/medium.h> AGZ_TRACER_BEGIN std::shared_ptr<Medium> create_absorbtion_medium( const Spectrum &sigma_a); std::shared_ptr<Medium> create_homogeneous_medium( const Spectrum &sigma_a, const Spectrum &sigma_s, real g); std::shared_ptr<Medium> create_void(); AGZ_TRACER_END
[ "airguanz@gmail.com" ]
airguanz@gmail.com
ea05f20db6f8fcfa7b3e4211a4036ee32e56962f
530cea82ed7cb8fabc8efb3fbd3ed393be8eb71f
/OpenArk/DriverModView.h
a9678d1f814f6d4159fc53b619ced935e8acfc66
[]
no_license
Qazwar/OpenArk-1
abb0618c5364dc131a35a93c61861394e2242605
ad6a35d9679997f8da30f07b9f4b2169b2179906
refs/heads/master
2022-06-27T03:20:41.791514
2020-05-09T09:43:17
2020-05-09T09:43:17
268,182,709
1
0
null
2020-05-31T00:28:22
2020-05-31T00:28:21
null
UTF-8
C++
false
false
442
h
#pragma once #include "StdDialog.h" #include "common.h" class DriverModView :public StdTable { Q_OBJECT public: enum Col { DriverName, BaseAddress, ImageSize, DriverObject, DriverPath, ServiceName, LoadOrder, FileCompany, LastCol }; DriverModView(QWidget *parent = 0); ~DriverModView(); void InitView(); void SetContextMenu(); private slots: void OnNouse(); void OnRefresh(); private: QMenu mMenu; };
[ "782598478@qq.com" ]
782598478@qq.com
39c992fd7333bcbb16b637118d745f0053dc4d4b
07c3e4c4f82056e76285c81f14ea0fbb263ed906
/Re-Abyss/app/components/UI/Title/Cursor/Builder.cpp
f01a18859bbd58165f400fdd63ab3c1f9c4902fe
[]
no_license
tyanmahou/Re-Abyss
f030841ca395c6b7ca6f9debe4d0de8a8c0036b5
bd36687ddabad0627941dbe9b299b3c715114240
refs/heads/master
2023-08-02T22:23:43.867123
2023-08-02T14:20:26
2023-08-02T14:20:26
199,132,051
9
1
null
2021-11-22T20:46:39
2019-07-27T07:28:34
C++
UTF-8
C++
false
false
375
cpp
#include <abyss/components/UI/Title/Cursor/Builder.hpp> #include <abyss/modules/UI/base/UIObj.hpp> #include <abyss/components/UI/Title/Cursor/CursorCtrl.hpp> namespace abyss::UI::Title::Cursor { void Builder::Build(UIObj* pUi) { // メイン追加 { pUi->attach<CursorCtrl>(pUi)->setLayer(DrawLayer::World).setOrder(3); } }; }
[ "tyanmahou@gmail.com" ]
tyanmahou@gmail.com
583d62156ae1fc6f45981ad1051f9f4478389039
0d8a443005e7f8c4dc3b8b59606463d0b334a7ba
/main.cpp
67e841787e7c837fb8629650361e1e7086253dcb
[]
no_license
HoShuHang/QTGraphics
1547e214131abdee6cc5d5d49da53a629bcc3c19
c7e5ba0520d0cfeb3c92c57e7ebb59246943797d
refs/heads/master
2021-01-10T17:48:50.399007
2016-01-05T08:58:34
2016-01-05T08:58:34
46,609,834
0
1
null
null
null
null
UTF-8
C++
false
false
275
cpp
#include "cppunitlite/TestHarness.h" //#include "utShape.h" //#include "utGraphics.h" //#include "utHW3.h" #include "utTryQt.h" //#include "utModel.h" //#include "utVisitor.h" int main(int argc, char** argv) { TestResult tr; TestRegistry::runAllTests(tr); return 0; }
[ "kwite2002@gmail.com" ]
kwite2002@gmail.com
6e65d8285c59183add02fe62ae520a469e0963a8
966ce6dd5c396494b04a1003ee82e208fd974ce4
/transport/tests/spool_test.cc
53290767a9291be5ea017f8b6096f5c3a46a5dde
[]
no_license
drue/King-James
55c57143297e107c86a4fc05b5d3e4ef1bae4624
cf1240e902b08b775f47a73599fd919677b72f41
refs/heads/master
2021-01-01T17:46:58.709355
2014-10-03T11:24:11
2014-10-03T11:32:41
3,149,344
3
1
null
null
null
null
UTF-8
C++
false
false
6,132
cc
#include <stdlib.h> #include <arpa/inet.h> #include "gtest/gtest.h" #include "FLAC++/metadata.h" #include <openssl/md5.h> #include "spool.h" /* ************* ** FLAC md5sum is computed from byte aligned, little endian data ** 3 bytes per sample for 24 bits, 2 bytes for 16 bits ** however, data is fed to FLAC with 4 byte unsigned ints ************* */ /* ** test data consists of monotonically increasing integers from zero, so out-of-order or missing samples can be ** easily detected */ class SpoolTest : public ::testing::Test { public: char tmpl[80]; char *f; MD5_CTX ctx; Spool *s; unsigned int width; virtual void SetUp() { width = 3; strncpy(tmpl, "/tmp/SpoolTest.XXXXXX", sizeof(tmpl)); f = mktemp(tmpl); MD5_Init(&ctx); } virtual void verify() { FLAC::Metadata::StreamInfo si; FLAC::Metadata::get_streaminfo(f, si); const unsigned char *sum = si.get_md5sum(); unsigned char ohash[16]; MD5_Final(ohash, &ctx); for(int i=0;i<16;i++) { ASSERT_EQ(ohash[i], sum[i]); } } virtual int pushBlock(int start, bool hash=true) { buffer& item = s->getEmpty(); unsigned int x; for ( x=0; x*4 < item.size; x++) { int z = start + x; item.buf[x] = z; if(hash) { MD5_Update(&ctx, (unsigned char *)&z, width); // only works on little endian arch } } s->pushItem(item); return start + x; } }; TEST_F(SpoolTest, DeallocUnused) { Spool s(128*5, 128, 24, 44100, 2, false); } TEST_F(SpoolTest, Null) { s = new Spool(5, 128, 24, 48000, 2, false); s->start(f); s->initFLAC(); s->finish(); s->finishFLAC(); verify(); delete(s); } TEST_F(SpoolTest, OneItem) { s = new Spool(5, 128, 24, 48000, 2, false); s->start(f); s->initFLAC(); pushBlock(0); s->tick(); s->finish(); s->finishFLAC(); verify(); delete(s); } TEST_F(SpoolTest, FiveItems) { s = new Spool(5, 128, 24, 48000, 2, false); s->start(f); s->initFLAC(); int n = 0; for(int x=0;x<5;x++) { n = pushBlock(n); s->tick(); } s->finish(); s->finishFLAC(); verify(); } TEST_F(SpoolTest, SpoolUp5) { s = new Spool(5, 128, 24, 48000, 2, false); int n = 0; for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->initFLAC(); unsigned int x; do { x = s->tick(); } while (x > 0); s->finish(); s->finishFLAC(); verify(); delete(s); } TEST_F(SpoolTest, HalfAndHalf) { s = new Spool(5, 128, 24, 48000, 2, false); // fill up the buffer reroll buffer, start, then send another five below int n = 0; for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->initFLAC(); unsigned int x; do { x = s->tick(); } while (x > 0); for(int x=5;x<10;x++) { n = pushBlock(n); s->tick(); } s->finish(); s->finishFLAC(); verify(); delete(s); } TEST_F(SpoolTest, HalfAndHalf16) { width = 2; s = new Spool(5, 128, 16, 48000, 2, false); int n = 0; for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->initFLAC(); unsigned int x; do { x = s->tick(); } while (x > 0); for(int x=0;x<5;x++) { n = pushBlock(n); s->tick(); } s->finish(); s->finishFLAC(); verify(); delete(s); } TEST_F(SpoolTest, LoseOne) { s = new Spool(5, 128, 24, 48000, 2, false); // fill up the buffer reroll buffer, start, then send another five below int n = 0; n = pushBlock(n, false); for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->initFLAC(); unsigned int x; do { x = s->tick(); } while (x > 0); for(int x=0;x<5;x++) { n = pushBlock(n); s->tick(); } s->finish(); s->finishFLAC(); verify(); delete(s); } TEST_F(SpoolTest, LoseFive) { s = new Spool(5, 128, 24, 48000, 2, false); // fill up the buffer reroll buffer, start, then send another five below int n = 0; for(int x=0;x<5;x++) { n = pushBlock(n, false); } for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->initFLAC(); unsigned int x; do { x = s->tick(); } while (x > 0); for(int x=0;x<5;x++) { n = pushBlock(n); s->tick(); } s->finish(); s->finishFLAC(); verify(); delete(s); } TEST_F(SpoolTest, TLoseFive) { s = new Spool(5, 128, 24, 48000, 2, true, false); // fill up the buffer reroll buffer, start, then send another five below int n = 0; for(int x=0;x<5;x++) { n = pushBlock(n, false); } for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->waitReady(); for(int x=0;x<5;x++) { n = pushBlock(n); } s->finish(); s->wait(); verify(); delete(s); } TEST_F(SpoolTest, TPump) { s = new Spool(5, 128, 24, 48000, 2, true, false); int n = 0; // fill up the buffer reroll buffer, start, then send another five below for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->waitReady(); for(int x=0;x<500;x++) { n = pushBlock(n); } s->finish(); s->wait(); verify(); delete(s); } TEST_F(SpoolTest, TTenBig) { s = new Spool(5, 8000, 24, 48000, 2, true, false); int n = 0; // fill up the buffer reroll buffer, start, then send another five below for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->waitReady(); for(int x=0;x<5;x++) { n = pushBlock(n); } s->finish(); s->wait(); verify(); delete(s); } TEST_F(SpoolTest, TFiftyBig) { s = new Spool(5, 8000, 24, 48000, 2, true, false); int n = 0; // fill up the buffer reroll buffer, start, then send another five below for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->waitReady(); for(int x=0;x<50;x++) { n = pushBlock(n); } s->finish(); s->wait(); verify(); delete(s); } TEST_F(SpoolTest, TBiggie) { s = new Spool(5, 3200*8, 24, 48000, 2, true, false); int n = 0; for(int x=0;x<5;x++) { n = pushBlock(n); } s->start(f); s->waitReady(); for(int x=0;x<500;x++) { n = pushBlock(n); } s->finish(); s->wait(); verify(); delete(s); }
[ "drue@gigagig.org" ]
drue@gigagig.org
de4f1665e78d3d60f105985604e1305619215980
5f2e4f42080ccb986308688404a2981753f87d69
/AquaEngine/Generators/NormalOrientedSSAO.h
a9dad49350c42b6e9953f4a90edc90ec9463df4c
[ "MIT" ]
permissive
therselman/aquaengine
3c941ba6b77dc571e8e426245250e013bf5ae035
aea6de9f47ba0243b90c144dee4422efb2389cc7
refs/heads/master
2021-07-22T13:52:24.316935
2017-10-28T11:58:48
2017-10-28T11:58:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,694
h
#pragma once #include "..\Renderer\ShaderManager.h" #include "..\Renderer\RendererInterfaces.h" #include "..\Renderer\RenderDevice\RenderDeviceTypes.h" #include "..\AquaMath.h" #include "..\AquaTypes.h" namespace aqua { class Renderer; class ParameterGroup; class Camera; class Allocator; class LinearAllocator; struct Viewport; //Implementation based on http://john-chapman-graphics.blogspot.co.uk/2013/01/ssao-tutorial.html class SSAOGenerator : public ResourceGenerator { public: struct Args { ShaderResourceH normal_buffer; ShaderResourceH depth_buffer; const Viewport* viewport; RenderTargetH target; u32 target_width; u32 target_height; }; void init(aqua::Renderer& renderer, lua_State* lua_state, Allocator& allocator, LinearAllocator& scratchpad, u32 width, u32 height); void shutdown(); // ResourceGenerator interface u32 getSecondaryViews(const Camera& camera, RenderView* out_views) override final; void generate(const void* args_, const VisibilityData* visibility) override final; void generate(lua_State* lua_state) override final; private: Renderer* _renderer; Allocator* _allocator; LinearAllocator* _scratchpad_allocator; u32 _width; u32 _height; RenderTargetH _aux_buffer_rt; ShaderResourceH _aux_buffer_sr; ShaderPermutation _ssao_shader_permutation; const ParameterGroupDesc* _ssao_params_desc; ParameterGroup* _ssao_params; ShaderPermutation _ssao_blur_shader_permutation; const ParameterGroupDesc* _ssao_blur_params_desc; ParameterGroup* _ssao_blur_params; }; };
[ "tiago.costav@gmail.com" ]
tiago.costav@gmail.com
4af192cd14118c92357f691d20c1d06f67f1f9cf
5dc4d4d3bd209b0d7e54c383b83f725ab2ca97fd
/Codeforces/1538/A.cpp
08df1b57f095f2401dae476350b9e1147f665f45
[ "MIT" ]
permissive
mohit200008/CodeBank
3f599e0d0be4d472666a4e754c4578d440251677
061f3c1c7c61370fd2c41fc1d76262d403d16f34
refs/heads/main
2023-09-03T02:38:21.935473
2021-10-22T08:32:43
2021-10-22T08:32:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,251
cpp
/* "An anomaly, I'm Muhammad Ali Cause I know one day I'm gonna be the" - Greatest, Eminem */ #pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long int ll; #define ff first #define Shazam ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define ss second #define all(c) c.begin(),c.end() #define endl "\n" #define test() int t; cin>>t; while(t--) #define fl(i,a,b) for(int i = a ; i <b ;i++) #define get(a) fl(i,0,a.size()) cin>>a[i]; #define pra(a) fl(i,0,a.size()) cout<<a[i]<<" "; cout<<endl; #define pr(a,n) fl(i,0,n) cout<<a[i]<<" "; cout<<endl; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; const ll INF = 2e18; const int inf = 2e9; const int mod1 = 1e9 + 7; int main(){ Shazam; test(){ int n; cin >> n; vector<int> a(n); get(a); int p = max_element(all(a)) - a.begin() + 1; int q = min_element(all(a)) - a.begin() + 1; if(p > q) swap(p, q); cout << min({q , n - p + 1, p + n - q + 1}) << endl; } return 0; }
[ "mahendra060704@gmail.com" ]
mahendra060704@gmail.com
7d2a0bc1f7fc247453ba9c8cdc4745601a1e458c
a8e72b72e08f854fffa56ec7326dc09d0c5847a8
/conversationlog.cpp
8ed9439f8f1cc7419bbdd63779ea652c6382aba7
[]
no_license
mapld/ProgrammingProblems
b16bc5be4e128665379ecda3191b55ddd3673dbd
e9031cdac09a95083b7cbf0ed37a5929aa9b203e
refs/heads/master
2021-09-02T03:22:05.214931
2017-12-29T22:33:30
2017-12-29T22:33:30
112,629,856
0
0
null
null
null
null
UTF-8
C++
false
false
1,361
cpp
#include <stdio.h> #include <iostream> #include <map> #include <sstream> #include <set> #include <queue> int main(){ using namespace std; int numMessages; cin >> numMessages; set<string> users; map<string, int> counts; map<string,bool> used; for(int i = 0; i < numMessages; i++){ string line; getline(cin,line); istringstream iss(line); string name; iss >> name; users.insert(name); string word; while(iss >> word){ if(counts.find(word) == counts.end()){ counts[word] = 1; } if(used.find(name+word) == used.end()){ used[name+word] = true; } } } for (set<string>::iterator it=users.begin(); it != users.end(); ++it){ string user = *it; if(user == ""){ continue; } for (map<string,int>::iterator itt=counts.begin(); itt!= counts.end(); ++itt){ string word = itt->first; if(used.find(user+word) == used.end()){ counts.erase(itt); } } } std::priority_queue<int> q; for (map<string,int>::iterator itt=counts.begin(); itt != counts.end(); ++itt){ q.push(itt->second); } while(q.size() > 0){ int size = q.top(); q.pop(); for (map<string,int>::iterator itt=counts.begin(); itt != counts.end(); ++itt){ if(itt->second == size){ cout << itt->first << "\n"; counts.erase(itt); } } } }
[ "arehnbymartin@abebooks.com" ]
arehnbymartin@abebooks.com
838b9ec95ffc550ce4384ca158e0299be94ea630
f556301fd9bdba0e463bb6f08bd83db0fd258a8d
/extensions/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc
e9ac4aa2d4c50073493a6848ea34b972fbd89f32
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
blockspacer/chromium_base_conan
ce7c0825b6a62c2c1272ccab5e31f15d316aa9ac
726d2a446eb926f694e04ab166c0bbfdb40850f2
refs/heads/master
2022-09-14T17:13:27.992790
2022-08-24T11:04:58
2022-08-24T11:04:58
225,695,691
18
2
null
null
null
null
UTF-8
C++
false
false
72
inc
#pragma once #include "absl/debugging/internal/stacktrace_arm-inl.inc"
[ "user@email.ru" ]
user@email.ru
982d33eb87a2d3dcdb7d739b3971eec1ab9d9d23
c08cbfb0e791bac4f6eb06ad44f335d1c2da316b
/Managers/src/Utils/TableModifier.cpp
c32fe6d0d9bd00580bff0a44706cac837e29da50
[]
no_license
Cliey/BookManager
9a1be14d8b910b29297210ef7f0a2511ec16f550
8231b90b4c3d97453bb25f8e4c287286d5ebae41
refs/heads/master
2021-06-23T17:13:45.389609
2021-02-21T21:02:10
2021-02-21T21:02:10
195,285,165
1
1
null
null
null
null
UTF-8
C++
false
false
6,808
cpp
#include "Managers/Utils/TableModifier.hpp" #include "BookAbstract/Book.hpp" #include "BookEnum/BookType.hpp" #include "BookFactory/BookFactory.hpp" #include "EntityTypes/BookSeries.hpp" #include "EntityTypes/Person.hpp" #include "EntityTypes/Publisher.hpp" #include "Utils/EnumUtils.hpp" #include "Utils/Log.hpp" #include "Utils/Exceptions.hpp" #include "../../../Category.hpp" #include <iostream> #include <sqlite3.h> namespace BookManager { namespace Manager { bool TableModifier::modifyPersonTable(BookManager::Entity::Person person, SQLite::Statement& query) { query.bind(":first_name", person.getFirstName()); query.bind(":last_name", person.getLastName()); query.bind(":role", static_cast<int>(person.getRole())); return query.exec() > 0; } bool TableModifier::modifyPublisherTable(BookManager::Entity::Publisher publisher, SQLite::Statement& query) { query.bind(":name", publisher.getName()); return query.exec() > 0; } bool TableModifier::modifyCategoryTable(BookManager::Category::Category category, SQLite::Statement& query) { query.bind(":name", category.getName()); return query.exec() > 0; } bool TableModifier::modifyBookSeriesTable(BookManager::Entity::BookSeries bookSeries, SQLite::Statement& query) { query.bind(":name", bookSeries.getName()); return query.exec() > 0; } template<> void TableModifier::bindOptional<time_t>(SQLite::Statement& query, std::string bindName, std::optional<time_t> date) { if(date) query.bind(bindName, convertDateToString(date.value())); // YYY-MM-DD else query.bind(bindName); // bind to null } std::string TableModifier::convertDateToString(std::time_t date) { std::tm* dateTm{localtime(&date)}; char buffer [80]; strftime (buffer,80,"%Y-%m-%d",dateTm); return std::string(buffer); } void TableModifier::modifyBooksPersonsTable(int bookId, std::vector<std::shared_ptr<Entity::Person>> persons, SQLite::Statement& query) { for(auto person : persons) { try { query.bind(":book_id", bookId); query.bind(":person_id", person->getId()); query.exec(); query.reset(); } catch (const SQLite::Exception &e) { if (e.getExtendedErrorCode() == SQLITE_CONSTRAINT_FOREIGNKEY) { LOG_WINDOW("Error occurred with author : The author \"{}, {}\" doesn't exist.", person->getLastName(), person->getFirstName()) throw; } LOG_WINDOW("Error occurred with author : {}", e.what()) throw; } catch(const std::exception& e) { LOG_WINDOW("Error occurred with author : {}", e.what()) throw; } } } void TableModifier::modifyBooksSubCategoriesTable(int bookId, std::vector<std::shared_ptr<Category::Category>> subCategories, SQLite::Statement& query) { for(auto subCategorie : subCategories) { try { query.bind(":book_id", bookId); query.bind(":subCategory_id", subCategorie->getId()); query.exec(); query.reset(); } catch (const SQLite::Exception &e) { if (e.getExtendedErrorCode() == SQLITE_CONSTRAINT_FOREIGNKEY) { LOG_WINDOW("Error occurred with Subcategories : The Subcategory \"{}\" doesn't exist.", subCategorie->getName()) throw; } LOG_WINDOW("Error occurred with Subcategories : {}", e.what()); throw; } catch(const std::exception& e) { LOG_WINDOW("Error occurred with Subcategories : {}", e.what()) throw; } } } void TableModifier::deleteInTableWithBookIdBind(int bookId, SQLite::Statement& query) { query.bind(":book_id", bookId); query.exec(); } void TableModifier::bindString(SQLite::Statement& query, std::string bindName, std::string field) { if(!field.empty()) query.bind(bindName, field); else query.bind(bindName); // bind to null } int TableModifier::modifyBookTable(std::shared_ptr<BookManager::Book::Abstraction::Book> book, SQLite::Statement& query) { query.bind(":type", static_cast<int>(book->getType())); query.bind(":title", book->generalInfo.title); bindPointersType<BookManager::Category::Category, const int>( query, ":main_category", book->categoryInfo.mainCategory, &BookManager::Category::Category::getId); bindPointersType<BookManager::Entity::Publisher, const int>( query, ":publisher", book->generalInfo.publisher, &BookManager::Entity::Publisher::getId); bindPointersType<BookManager::Entity::BookSeries, const int>( query, ":book_serie", book->generalInfo.bookSeries, &BookManager::Entity::BookSeries::getId); bindOptional<time_t>(query, ":published_date", book->generalInfo.published); bindOptional<time_t>(query, ":purchased_date", book->statInfo.purchasedDate); bindOptional<double>(query, ":price", book->statInfo.price); bindOptional<time_t>(query, ":start_reading_date", book->statInfo.startReadingDate); bindOptional<time_t>(query, ":end_reading_date", book->statInfo.endReadingDate); query.bind(":status", static_cast<int>(book->additionalInfo.status)); query.bind(":is_read", book->additionalInfo.isRead); bindOptional<int>(query, ":rate", book->additionalInfo.rate); bindString(query, ":comment", book->additionalInfo.comment); try { auto rowModified = query.exec(); return rowModified; } catch(const std::exception& e) { throw; } } } // namespace Manager } // namespace BookManager
[ "cyril.r38@gmail.com" ]
cyril.r38@gmail.com
181e136e34e7a866dbb5718c313c8cf312cd942c
aaebbe73cc851ba9ed8a3493abedb739d122533a
/server/yslib/thread_pool/thread_pool.h
3366394ddbd0935364afded985f07547c06c696e
[]
no_license
coeux/lingyu-meisha-jp
7bc1309bf8304a294f9a42d23b985879a28afbc0
11972819254b8567cda33d17ffc40b384019a936
refs/heads/master
2021-01-21T13:48:12.593930
2017-02-14T06:46:02
2017-02-14T06:46:02
81,812,311
1
2
null
null
null
null
UTF-8
C++
false
false
2,365
h
#ifndef _THREAD_POOL_H_ #define _THREAD_POOL_H_ #include <vector> #include <assert.h> using namespace std; #include <boost/bind.hpp> #include <boost/thread.hpp> #include <boost/asio.hpp> #include "log.h" #include "thread_pool_log_def.h" class thread_pool_t : public boost::noncopyable { public: typedef boost::shared_ptr<boost::asio::io_service> sp_ios_t; typedef boost::shared_ptr<boost::asio::io_service::work> sp_work_t; typedef vector<sp_ios_t> sp_ios_vt_t; typedef vector<sp_work_t> sp_work_vt_t; public: thread_pool_t():m_started(false), m_thread_num(1), m_poll_tid(0){} ~thread_pool_t() { stop(); } void start(uint16_t thread_num_ = 1); void stop(); sp_ios_t get_io(uint16_t tid_) { if (!m_started) return sp_ios_t(); uint16_t witch = tid_ % m_thread_num; return m_sp_ios_vt[witch]; } sp_ios_t poll_io() { if (!m_started) return sp_ios_t(); uint16_t witch = m_poll_tid % m_thread_num; m_poll_tid++; return m_sp_ios_vt[witch]; } template<typename F, typename... Args> uint16_t async_do(uint16_t tid_, F fun_, Args... args_) //tid thread id { if (m_sp_ios_vt.empty()) return -1; uint16_t witch = tid_ % m_thread_num; m_sp_ios_vt[witch]->post(boost::bind(&thread_pool_t::handle_do<F, Args...>, this, fun_, args_...)); return witch; } template<typename F, typename... Args> uint16_t async_do(F fun_, Args... args_) //tid thread id { if (m_sp_ios_vt.empty()) return -1; uint16_t witch = m_poll_tid % m_thread_num; m_poll_tid++; m_sp_ios_vt[witch]->post(boost::bind(&thread_pool_t::handle_do<F, Args...>, this, fun_, args_...)); return witch; } int get_thread_num() { return m_thread_num; } private: template<typename F, typename... Args> void handle_do(F fun_, const Args&... args_) { fun_(args_...); } private: bool m_started; uint16_t m_thread_num; uint16_t m_poll_tid; sp_work_vt_t m_sp_work_vt; sp_ios_vt_t m_sp_ios_vt; boost::thread_group m_threads; }; #endif
[ "641311015@qq.com" ]
641311015@qq.com
7d57c8e86929e789a8507f31518db140d94de59e
4bbb92f4903ffa73410a5c674aef85bf219d4242
/Nibbler.cpp
fb08f30569c29ff3a53c0a4941574e843a27f2b1
[]
no_license
RavivarmanPerinpanathan/nibbler
abf107b3599f4792ef52dcdec12cf60a7b5942e8
c9a3b1b3bf58eb30f3437429b333fb6159659d1e
refs/heads/master
2020-03-30T00:12:56.468437
2015-09-19T01:56:21
2015-09-19T01:56:21
42,755,295
0
0
null
null
null
null
UTF-8
C++
false
false
3,661
cpp
// // Nibbler.cpp for Nibbler in /home/perinp_r/rendu/cpp_nibbler // // Made by ravivarman perinpanathan // Login <perinp_r@epitech.net> // // Started on Sun Apr 5 20:35:56 2015 ravivarman perinpanathan // Last update Sun Apr 5 21:14:05 2015 ravivarman perinpanathan // #include <string> #include <iostream> #include <list> #include <stdlib.h> #include <time.h> #include <dlfcn.h> #include <map> #include <list> #include "Default.hpp" #include "Nibbler.hpp" Nibbler::Nibbler(const Coord & dimention, Display_Lib * ptr_lib) : _dimention(dimention), _ptr_lib(ptr_lib) { this->_direction_tab[UP] = Coord(0, -1); this->_direction_tab[DOWN] = Coord(0, 1); this->_direction_tab[RIGHT] = Coord(1, 0); this->_direction_tab[LEFT] = Coord(-1, 0); this->_direction = RIGHT; this->_snaque.push_back(Coord(dimention.getX() / 2, dimention.getY() / 2)); this->_snaque.push_back(Coord(dimention.getX() / 2 - 1, dimention.getY() / 2)); this->_snaque.push_back(Coord(dimention.getX() / 2 - 2, dimention.getY() / 2)); this->_snaque.push_back(Coord(dimention.getX() / 2 - 3, dimention.getY() / 2)); for (std::list<Coord>::iterator it = this->_snaque.begin(); it != this->_snaque.end(); it++) this->_ptr_lib->display_square(it->getX(), it->getY()); this->end = 0; this->_food = Coord(0, 0); this->new_food(); } Nibbler::~Nibbler(void) { } int Nibbler::move_snaque(void) { Coord new_head(*(this->_snaque.begin()) + this->_direction_tab[this->_direction]); if (this->end == 0) { this->_ptr_lib->delete_square((this->_snaque.back()).getX(), (this->_snaque.back()).getY()); this->_snaque.pop_back(); } this->end = 0; if (this->check_square_is_valid(new_head, 0) == 0) return (0); this->_snaque.push_front(new_head); this->_ptr_lib->display_square((this->_snaque.begin())->getX(), (this->_snaque.begin())->getY()); return (1); } int Nibbler::set_direction(eDir & direction) { if (direction == ESCAP) return (0); else if ((this->_direction == UP && direction == DOWN) || \ (this->_direction == DOWN && direction == UP) || \ (this->_direction == LEFT && direction == RIGHT) || \ (this->_direction == RIGHT && direction == LEFT)) return (1); this->_direction = direction; return (1); } void Nibbler::new_food(void) { srand(time(NULL)); Coord new_food(rand() % (this->_dimention.getX() - 4) + 2, \ rand() % (this->_dimention.getY() - 4) + 2); this->_ptr_lib->delete_square(this->_food.getX(), this->_food.getY()); if (check_square_is_valid(new_food, 1) == 0 || (new_food.getX() == this->_food.getX() && new_food.getY() == this->_food.getY())) { new_food.setX(3); new_food.setY(3); } this->_food = new_food; this->_ptr_lib->display_food(this->_food.getX(), this->_food.getY()); } int Nibbler::check_square_is_valid(const Coord & element, int option) { if (this->_food.getX() == element.getX() && this->_food.getY() == element.getY() && option == 1) return (0); if (this->_food.getX() == element.getX() && this->_food.getY() == element.getY()) { this->new_food(); this->end = 1; } if (element.getX() < 0 || element.getY() < 0 || element.getX() >= this->_dimention.getX() || element.getY() >= this->_dimention.getY()) return (0); for (std::list<Coord>::iterator it = this->_snaque.begin(); it != this->_snaque.end(); it++) { if (it->getX() == element.getX() && it->getY() == element.getY()) return (0); } return (1); }
[ "perinp_r@epitech.eu" ]
perinp_r@epitech.eu
d822199111c6610bce30326c2aff532a8596e833
508510d10ddcb009fc4fb53a26d897bc462039c0
/PUBG/SDK/PUBG_BP_EquipableItemIconWidget_classes.hpp
d80e238d436117d9d978f2bdcfeb87754c4a5654
[]
no_license
Avatarchik/PUBG-SDK
ed6e0aa27eac646e557272bbf1607b7351905c8c
07639ddf96bc0f57fb4b1be0a9b29d5446fcc5da
refs/heads/master
2021-06-21T07:51:37.309095
2017-08-10T08:15:56
2017-08-10T08:15:56
100,607,141
1
1
null
2017-08-17T13:36:40
2017-08-17T13:36:40
null
UTF-8
C++
false
false
2,181
hpp
#pragma once // PLAYERUNKNOWN BattleGrounds () SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace Classes { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // WidgetBlueprintGeneratedClass BP_EquipableItemIconWidget.BP_EquipableItemIconWidget_C // 0x0010 (0x0338 - 0x0328) class UBP_EquipableItemIconWidget_C : public UEquipableItemIconBaseWidget { public: class UWidgetAnimation* NoBagSapce; // 0x0328(0x0008) (CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_Transient, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate) class UWidgetAnimation* Warning; // 0x0330(0x0008) (CPF_BlueprintVisible, CPF_ZeroConstructor, CPF_Transient, CPF_IsPlainOldData, CPF_RepSkip, CPF_RepNotify, CPF_Interp, CPF_NonTransactional, CPF_EditorOnly, CPF_NoDestructor, CPF_AutoWeak, CPF_ContainsInstancedReference, CPF_AssetRegistrySearchable, CPF_SimpleDisplay, CPF_AdvancedDisplay, CPF_Protected, CPF_BlueprintCallable, CPF_BlueprintAuthorityOnly, CPF_TextExportTransient, CPF_NonPIEDuplicateTransient, CPF_ExposeOnSpawn, CPF_PersistentInstance, CPF_UObjectWrapper, CPF_HasGetValueTypeHash, CPF_NativeAccessSpecifierPublic, CPF_NativeAccessSpecifierProtected, CPF_NativeAccessSpecifierPrivate) static UClass* StaticClass() { static auto ptr = UObject::FindClass("WidgetBlueprintGeneratedClass BP_EquipableItemIconWidget.BP_EquipableItemIconWidget_C"); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "jl2378@cornell.edu" ]
jl2378@cornell.edu
5c7f59cb581ff1e5fbe73dcc99778089391b8a41
ec8bd794331fb9548a7a3306a1a378227cbfaf79
/cleanHack_FileIO.cpp
8c117d5ab0736e30ae83e317747c11eb66faf054
[]
no_license
awsdert/renegade
8b3c4524e183e02d1f644bd85bfd324ea875f2b6
8060d04ef9cdf6c41090195ea43a93d7d4de8eaf
refs/heads/master
2021-04-09T16:53:42.289316
2012-06-21T17:01:07
2012-06-21T17:01:07
32,187,805
0
0
null
null
null
null
UTF-8
C++
false
false
3,078
cpp
#include "G.h" void G::mLoadHack( void ) { s32 mode = 0, index, count; xStr txt, text, path, file, name; xStrT st; xAStr array; HACK* hack = new HACK; CODE code; u32 tmp; tree_T->DeleteAllItems(); xTreeID root, doNotModifyThisTreeId; gGetHackFile( path, file ); wxTextFile file_TF; file_TF.Open( file ); mNewHack( GetHackRoot(), wxT( "(m)" ), hack, doNotModifyThisTreeId ); for ( text = file_TF.GetFirstLine(); !file_TF.Eof(); text = file_TF.GetNextLine() ) { switch ( mode ) { case 0: case 2: if ( text.StartsWith( wxT( "\"" ) ) ) { if ( mode == 2 ) { index = 0; count = array.GetCount(); for ( ; index < count; ) { BuildCode( code, index, array ); hack->NewCode( code ); } if ( hack->id == 0u ) mSetHack( root, hack ); else mNewHack( root, name, hack, doNotModifyThisTreeId ); } hack->Clear(); array.Clear(); st.SetString( text, wxT( '"' ) ); st.GetNextToken(); name = st.GetNextToken(); mode = 1; } else if ( mode == 2 ) array.Add( text ); break; case 1: hack->id = GetHex( text.Mid( 4, 4 ) ); tmp = GetHex( text.Left( 4 ) ); hack->use = ( ( tmp & HACK_USE ) > 0u ); hack->useRB = ( ( tmp & HACK_RB ) > 0u ); if ( hack->id != 0u ) { tmp = GetHex( text.Mid( 13, 4 ), 2u ); root = mFindHack( tmp ); } else root = GetHackRoot(); mode = 2; } } if ( mode == 2 ) { index = 0; count = array.GetCount(); for ( ; index < count; ) { BuildCode( code, index, array ); hack->NewCode( code ); } if ( hack->id == 0u ) mSetHack( root, hack ); else mNewHack( root, name, hack, doNotModifyThisTreeId ); } delete hack; tree_T->SelectItem( GetHackRoot() ); } void G::mSaveHack( void ) { xStr path, file; u16 id = 0u; gGetHackFile( path, file ); hack_TF.Open( file ); hack_TF.Clear(); mSaveHack( GetHackRoot(), id, 0u ); hack_TF.Write( wxTextFileType_Dos ); hack_TF.Close(); } void G::mSaveHack( xTreeID root, u16 &id, u16 parentID ) { HACK* hack = mGetHack( root ); xStr text = tree_T->GetItemText( root ); u16 head = 0u; if ( hack->use ) head += HACK_USE; if ( hack->useRB ) head += HACK_RB; hack_TF.AddLine( wxT( '"' ) + text + wxT( '"' ), wxTextFileType_Dos ); text.Printf( hex16 + hex16 + wxT( " 0000" ) + hex16, head, id, parentID ); hack_TF.AddLine( text, wxTextFileType_Dos ); xAStr array; s16 iCount = hack->GetCount(); s16 j, jCount; for ( s16 i = 0; i < iCount; ++i ) { array = BuildCode( ( *hack )[ i ] ); jCount = array.GetCount(); for ( j = 0; j < jCount; ++j ) hack_TF.AddLine( array[ j ], wxTextFileType_Dos ); } // Iterate through children parentID = id; ++id; xTreeID kid; xTreeIDV cookie; for ( kid = tree_T->GetFirstChild( root, cookie ); kid.IsOk(); kid = tree_T->GetNextChild( root, cookie ) ) { mSaveHack( kid, id, parentID ); } }
[ "gb2985@ef3b2f1c-1a11-4849-4361-9c7d57dfec43" ]
gb2985@ef3b2f1c-1a11-4849-4361-9c7d57dfec43
734f3de22638441623d47f44ce344f4b0a748ec8
a6cee0a2e956fcf63f19f359675f5cb0552cdb5a
/garminfitsdk/fit_workout_session_mesg.hpp
8ad1af7f50d991c188a9d1f09060adee84f355f0
[]
no_license
KatzSanya/MRC_creator
fc45d0a81d11fb5082b5ef8b84e6bb4c236052b9
42128c78fba177cd20b3a948918c0451b0154367
refs/heads/master
2023-05-31T23:00:03.848531
2021-06-22T01:45:30
2021-06-22T01:45:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,508
hpp
//////////////////////////////////////////////////////////////////////////////// // The following FIT Protocol software provided may be used with FIT protocol // devices only and remains the copyrighted property of Garmin Canada Inc. // The software is being provided on an "as-is" basis and as an accommodation, // and therefore all warranties, representations, or guarantees of any kind // (whether express, implied or statutory) including, without limitation, // warranties of merchantability, non-infringement, or fitness for a particular // purpose, are specifically disclaimed. // // Copyright 2021 Garmin Canada Inc. //////////////////////////////////////////////////////////////////////////////// // ****WARNING**** This file is auto-generated! Do NOT edit this file. // Profile Version = 21.54Release // Tag = production/akw/21.54.01-0-g081c465c //////////////////////////////////////////////////////////////////////////////// #if !defined(FIT_WORKOUT_SESSION_MESG_HPP) #define FIT_WORKOUT_SESSION_MESG_HPP #include "fit_mesg.hpp" namespace fit { class WorkoutSessionMesg : public Mesg { public: class FieldDefNum final { public: static const FIT_UINT8 MessageIndex = 254; static const FIT_UINT8 Sport = 0; static const FIT_UINT8 SubSport = 1; static const FIT_UINT8 NumValidSteps = 2; static const FIT_UINT8 FirstStepIndex = 3; static const FIT_UINT8 PoolLength = 4; static const FIT_UINT8 PoolLengthUnit = 5; static const FIT_UINT8 Invalid = FIT_FIELD_NUM_INVALID; }; WorkoutSessionMesg(void) : Mesg(Profile::MESG_WORKOUT_SESSION) { } WorkoutSessionMesg(const Mesg &mesg) : Mesg(mesg) { } /////////////////////////////////////////////////////////////////////// // Checks the validity of message_index field // Returns FIT_TRUE if field is valid /////////////////////////////////////////////////////////////////////// FIT_BOOL IsMessageIndexValid() const { const Field* field = GetField(254); if( FIT_NULL == field ) { return FIT_FALSE; } return field->IsValueValid(); } /////////////////////////////////////////////////////////////////////// // Returns message_index field /////////////////////////////////////////////////////////////////////// FIT_MESSAGE_INDEX GetMessageIndex(void) const { return GetFieldUINT16Value(254, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Set message_index field /////////////////////////////////////////////////////////////////////// void SetMessageIndex(FIT_MESSAGE_INDEX messageIndex) { SetFieldUINT16Value(254, messageIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Checks the validity of sport field // Returns FIT_TRUE if field is valid /////////////////////////////////////////////////////////////////////// FIT_BOOL IsSportValid() const { const Field* field = GetField(0); if( FIT_NULL == field ) { return FIT_FALSE; } return field->IsValueValid(); } /////////////////////////////////////////////////////////////////////// // Returns sport field /////////////////////////////////////////////////////////////////////// FIT_SPORT GetSport(void) const { return GetFieldENUMValue(0, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Set sport field /////////////////////////////////////////////////////////////////////// void SetSport(FIT_SPORT sport) { SetFieldENUMValue(0, sport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Checks the validity of sub_sport field // Returns FIT_TRUE if field is valid /////////////////////////////////////////////////////////////////////// FIT_BOOL IsSubSportValid() const { const Field* field = GetField(1); if( FIT_NULL == field ) { return FIT_FALSE; } return field->IsValueValid(); } /////////////////////////////////////////////////////////////////////// // Returns sub_sport field /////////////////////////////////////////////////////////////////////// FIT_SUB_SPORT GetSubSport(void) const { return GetFieldENUMValue(1, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Set sub_sport field /////////////////////////////////////////////////////////////////////// void SetSubSport(FIT_SUB_SPORT subSport) { SetFieldENUMValue(1, subSport, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Checks the validity of num_valid_steps field // Returns FIT_TRUE if field is valid /////////////////////////////////////////////////////////////////////// FIT_BOOL IsNumValidStepsValid() const { const Field* field = GetField(2); if( FIT_NULL == field ) { return FIT_FALSE; } return field->IsValueValid(); } /////////////////////////////////////////////////////////////////////// // Returns num_valid_steps field /////////////////////////////////////////////////////////////////////// FIT_UINT16 GetNumValidSteps(void) const { return GetFieldUINT16Value(2, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Set num_valid_steps field /////////////////////////////////////////////////////////////////////// void SetNumValidSteps(FIT_UINT16 numValidSteps) { SetFieldUINT16Value(2, numValidSteps, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Checks the validity of first_step_index field // Returns FIT_TRUE if field is valid /////////////////////////////////////////////////////////////////////// FIT_BOOL IsFirstStepIndexValid() const { const Field* field = GetField(3); if( FIT_NULL == field ) { return FIT_FALSE; } return field->IsValueValid(); } /////////////////////////////////////////////////////////////////////// // Returns first_step_index field /////////////////////////////////////////////////////////////////////// FIT_UINT16 GetFirstStepIndex(void) const { return GetFieldUINT16Value(3, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Set first_step_index field /////////////////////////////////////////////////////////////////////// void SetFirstStepIndex(FIT_UINT16 firstStepIndex) { SetFieldUINT16Value(3, firstStepIndex, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Checks the validity of pool_length field // Returns FIT_TRUE if field is valid /////////////////////////////////////////////////////////////////////// FIT_BOOL IsPoolLengthValid() const { const Field* field = GetField(4); if( FIT_NULL == field ) { return FIT_FALSE; } return field->IsValueValid(); } /////////////////////////////////////////////////////////////////////// // Returns pool_length field // Units: m /////////////////////////////////////////////////////////////////////// FIT_FLOAT32 GetPoolLength(void) const { return GetFieldFLOAT32Value(4, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Set pool_length field // Units: m /////////////////////////////////////////////////////////////////////// void SetPoolLength(FIT_FLOAT32 poolLength) { SetFieldFLOAT32Value(4, poolLength, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Checks the validity of pool_length_unit field // Returns FIT_TRUE if field is valid /////////////////////////////////////////////////////////////////////// FIT_BOOL IsPoolLengthUnitValid() const { const Field* field = GetField(5); if( FIT_NULL == field ) { return FIT_FALSE; } return field->IsValueValid(); } /////////////////////////////////////////////////////////////////////// // Returns pool_length_unit field /////////////////////////////////////////////////////////////////////// FIT_DISPLAY_MEASURE GetPoolLengthUnit(void) const { return GetFieldENUMValue(5, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } /////////////////////////////////////////////////////////////////////// // Set pool_length_unit field /////////////////////////////////////////////////////////////////////// void SetPoolLengthUnit(FIT_DISPLAY_MEASURE poolLengthUnit) { SetFieldENUMValue(5, poolLengthUnit, 0, FIT_SUBFIELD_INDEX_MAIN_FIELD); } }; } // namespace fit #endif // !defined(FIT_WORKOUT_SESSION_MESG_HPP)
[ "helder.giro.lopes@gmail.com" ]
helder.giro.lopes@gmail.com
79295f90df5d8f33766ec622477fae9c6cc70b14
49b59f314fe0643a1d4750092ae6defd85d4c0fd
/include/taobao.h
82d1fc105ebf31aafe9088558f369ae893ad81c6
[ "MIT", "BSL-1.0", "BSD-3-Clause" ]
permissive
Athenacle/tb
72ebeed08952d7afb2ee55c9c4bef1c8b64ba2ad
3c1ad7d02e92822d965453458285386aab37c789
refs/heads/master
2020-03-22T14:24:21.622885
2018-08-22T11:37:10
2018-08-22T11:37:10
140,176,856
0
0
null
null
null
null
UTF-8
C++
false
false
1,530
h
/* shared * */ #ifndef TAOBAO_SHARED_H #define TAOBAO_SHARED_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <fcntl.h> // for O_RDONLY #include <string> namespace tb { class Settings; class Logger; namespace thread_ns { class thread; class thread_arguments; } // namespace thread_ns namespace remote { enum { CONNECTION_NOT_REAL_CONNECT = 0, CONNECTION_FAILED = 1, CONNECTION_SUCCESS = 2, CONNECTION_SUCCESS_DB_CHANGED = 4 }; #ifdef BUILD_WITH_LIBSSH class SFTPWorker; #endif class MySQLWorker; } // namespace remote namespace utils { // lib/utils.cpp void InitCoreUtilties(); void DestroyCoreUtilites(); char* requestMemory(unsigned long); void releaseMemory(const void*); int gzCompress(unsigned char*, size_t, unsigned char**); void MD5Hash(const char*, size_t, std::string&); int MD5HashFile(const char*, std::string&); int base64Encode(unsigned char*, size_t, char**, bool = false); size_t checkFileCanRead(const char*, char*, size_t); void* openFile(const char*, size_t&, char**, unsigned int = O_RDONLY); int destroyFile(void*, size_t, char**); int mkParentDir(const std::string&); bool getParentDir(const std::string&, std::string&); void formatDirectoryPath(std::string&); }; // namespace utils } // namespace tb #endif
[ "zjjhwxc@gmail.com" ]
zjjhwxc@gmail.com
ccc0b88009c7cd818fb849343ec8aecd261b2ec3
43a0bc7a80572033ba0312078c1118b1865e1c38
/Øving 3/main.cpp
5f304acf906a44c3c21681fdf66cbaa42878c301
[]
no_license
MathiasWahl/Cpp
f6369c497bccb83f87fb3c689ac0f5e8065bb101
2309e8826742eb0dcb2b74f8b2fd5327b05e5ac9
refs/heads/master
2021-09-07T02:30:29.876267
2018-02-15T21:37:06
2018-02-15T21:37:06
119,513,926
0
0
null
null
null
null
UTF-8
C++
false
false
816
cpp
#include "canonball.cpp" #include "utilities.hpp" #include <iostream> #include <ctime> int main(){ /* cout << accY() << endl; cout << "\nTest X:" << endl; cout << posX(0, 50, 0) << endl; cout << posX(0, 50, 2.5) << endl; cout << posX(0, 50, 5) << endl; cout << "\nTest Y:" << endl; cout << posY(0, 25, 0) << endl; cout << posY(0, 25, 2.5) << endl; cout << posY(0, 25, 5) << endl; return 0; */ int input; while (true){ cout << "\n--------------------------------------------------------\nWelcome to the shooting ground! Do you want to play? \n0:Exit\n1:Play \n\t>>>"; cin >> input; if (input == 0){ break; } else if (input == 1){ playTargetPractice(); } else { cout << "Please choose between 1 and 0" << endl; } } return 0; }
[ "ma10asw@gmail.com" ]
ma10asw@gmail.com
8f4eace0c98196e2f60738d99fcd5dc0a663d30b
238e46a903cf7fac4f83fa8681094bf3c417d22d
/VTK/vtk_7.1.1_x64_Release/include/vtk-7.1/vtkUGFacetReader.h
3abf940d6d3d984dda01a48ed2f8596b7be429f5
[ "BSD-3-Clause" ]
permissive
baojunli/FastCAE
da1277f90e584084d461590a3699b941d8c4030b
a3f99f6402da564df87fcef30674ce5f44379962
refs/heads/master
2023-02-25T20:25:31.815729
2021-02-01T03:17:33
2021-02-01T03:17:33
268,390,180
1
0
BSD-3-Clause
2020-06-01T00:39:31
2020-06-01T00:39:31
null
UTF-8
C++
false
false
3,262
h
/*========================================================================= Program: Visualization Toolkit Module: vtkUGFacetReader.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm 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. =========================================================================*/ /** * @class vtkUGFacetReader * @brief read EDS Unigraphics facet files * * vtkUGFacetReader is a source object that reads Unigraphics facet files. * Unigraphics is a solid modeling system; facet files are the polygonal * plot files it uses to create 3D plots. */ #ifndef vtkUGFacetReader_h #define vtkUGFacetReader_h #include "vtkIOGeometryModule.h" // For export macro #include "vtkPolyDataAlgorithm.h" class vtkIncrementalPointLocator; class vtkShortArray; class VTKIOGEOMETRY_EXPORT vtkUGFacetReader : public vtkPolyDataAlgorithm { public: vtkTypeMacro(vtkUGFacetReader,vtkPolyDataAlgorithm); void PrintSelf(ostream& os, vtkIndent indent); /** * Construct object to extract all parts, and with point merging * turned on. */ static vtkUGFacetReader *New(); /** * Overload standard modified time function. If locator is modified, * then this object is modified as well. */ vtkMTimeType GetMTime(); //@{ /** * Specify Unigraphics file name. */ vtkSetStringMacro(FileName); vtkGetStringMacro(FileName); //@} /** * Special methods for interrogating the data file. */ int GetNumberOfParts(); /** * Retrieve color index for the parts in the file. */ short GetPartColorIndex(int partId); //@{ /** * Specify the desired part to extract. The part number must range between * [0,NumberOfParts-1]. If the value is =(-1), then all parts will be * extracted. If the value is <(-1), then no parts will be extracted but * the part colors will be updated. */ vtkSetMacro(PartNumber,int); vtkGetMacro(PartNumber,int); //@} //@{ /** * Turn on/off merging of points/triangles. */ vtkSetMacro(Merging,int); vtkGetMacro(Merging,int); vtkBooleanMacro(Merging,int); //@} //@{ /** * Specify a spatial locator for merging points. By * default an instance of vtkMergePoints is used. */ void SetLocator(vtkIncrementalPointLocator *locator); vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); //@} /** * Create default locator. Used to create one when none is specified. */ void CreateDefaultLocator(); protected: vtkUGFacetReader(); ~vtkUGFacetReader(); int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); char *FileName; vtkShortArray *PartColors; int PartNumber; int Merging; vtkIncrementalPointLocator *Locator; private: vtkUGFacetReader(const vtkUGFacetReader&) VTK_DELETE_FUNCTION; void operator=(const vtkUGFacetReader&) VTK_DELETE_FUNCTION; }; #endif
[ "l”ibaojunqd@foxmail.com“" ]
l”ibaojunqd@foxmail.com“
e33b297aa415a4e9eddaaea8ae93947d887c91e4
193f868f85e31da20e01c04cee2f2313c8db1ac8
/SimulatedAnnealingExtraP/Solution.cpp
e03da327fc90ffe474345d8352fc652e07d5e83b
[ "Apache-2.0" ]
permissive
MiBu84/SMP-Simulated-Annealing
3a2e9fdcac2d99a8823559f9480c6dc0d8e4ad37
e70ce403012ffc285e5053afd87e5e78a0d5fefa
refs/heads/master
2020-03-22T18:23:31.645780
2018-07-11T08:56:08
2018-07-11T08:56:08
140,457,236
0
0
null
null
null
null
UTF-8
C++
false
false
6,626
cpp
#include "stdafx.h" #include "Solution.h" #include "Configurator.h" #include <math.h> #include "EigenParameterEstimator.h" #include <iostream> #include <random> #include <omp.h> #include "Configurator.h" #include "RSSCostCalculator.h" #include <sstream> Solution::Solution() { if (_len > 0) _coefficients = new double[_len]; for (int i = 0; i < _len; i++) _coefficients[i] = 0.0; } Solution::Solution(MeasurementDB* mdb) { double min_c_3 = 10e-2; double max_c_3 = 1e0; double min_c_4 = 0.2; double max_c_4 = 1.0; double min_c_5 = 0; double max_c_5 = Configurator::getInstance().max_pol_range; int num_threads = Configurator::getInstance().num_threads; int thread_id = omp_get_thread_num(); double split_c4_steps = (abs(min_c_4) + abs(max_c_4)) / num_threads; double split_c4_min = thread_id * split_c4_steps; double split_c4_max = (thread_id + 1) * split_c4_steps; EigenParameterEstimator paramest = EigenParameterEstimator(mdb); RSSCostCalculator costcalc = RSSCostCalculator(mdb); if (_len > 0) _coefficients = new double[_len]; double start_vals[5] = { 0, 0, 1, 0, 0 }; for (int i = 0; i < _len; i++) _coefficients[i] = start_vals[i]; paramest.estimateParameters(this); costcalc.calculateCost(this); std::random_device seeder; std::mt19937 engine(seeder()); std::uniform_real_distribution<double> distc2(min_c_3, max_c_3); std::uniform_real_distribution<double> distc3(min_c_4, max_c_4); std::uniform_real_distribution<double> distc4(min_c_5, max_c_5); Solution act_sol = *this; act_sol.updateAt(4, distc4(seeder)); int count = 0; do { act_sol.updateAt(2, distc2(seeder)); act_sol.updateAt(3, distc3(seeder)); paramest.estimateParameters(&act_sol); costcalc.calculateCost(&act_sol); count++; } while ((act_sol.get_costs() > this->get_costs()) || std::isnan(act_sol.get_costs())); *this = act_sol; } Solution::Solution(double* coefficients) { if (_len > 0) _coefficients = new double[_len]; for (int i = 0; i < _len; i++) _coefficients[i] = coefficients[i]; } Solution::Solution(const Solution& other) { if (_len > 0) _coefficients = new double[_len]; for (int i = 0; i < this->_len; i++) this->_coefficients[i] = other._coefficients[i]; _costs = other._costs; setRandomID(); } Solution & Solution::operator= (const Solution & other) { if (_len > 0) _coefficients = new double[_len]; for (int i = 0; i < this->_len; i++) this->_coefficients[i] = other._coefficients[i]; _costs = other._costs; setRandomID(); return *this; } Solution Solution::getNeighborSolution() { Solution random_sol = Solution(this->get_coefficients()); std::random_device seeder; std::mt19937 engine(seeder()); std::uniform_int_distribution<int> dist2_4(2, 4); std::uniform_int_distribution<int> dist20(-Configurator::getInstance().std_exp_range, Configurator::getInstance().std_exp_range); std::uniform_int_distribution<int> distc_2_3_change(-300, 300); std::uniform_int_distribution<int> dist0or1(0,1); // Decide which coefficient to change c_2, c_3 or c_4 int coeff = dist2_4(engine); /* Er muss doch in Solution nicht in Random Sol nach coefficients suchen, oder? */ // Change c_2 double new_val = -1000; if (coeff == 2) { do { int fac; if (dist0or1(engine) == 1) fac = 1; else fac = -1; double val = random_sol.getAt(2); int log_of_val = int(log10(val)); double change = fac * pow(10, log_of_val - 1); new_val = val + change; // Check if we break from 10^x to 10^(x-1) or 10^(x+1) if (int(log10(val)) > int(log10(new_val))) { change = change * 0.1; new_val = val + change; } else { // Everything okay } } // Limit the search space to exclude unrealistic results while (!(new_val > 0.1) || !(new_val < 1.0)); random_sol.updateAt(2, new_val); } // Change c_3 else if (coeff == 3) { double val = double(dist20(engine)) / 200.0; if (random_sol.getAt(3) + val > 0.00) random_sol.updateAt(3, random_sol.getAt(3) + val); } // Change c_4 else if (coeff == 4) { double change = 0.0; double val = random_sol.getAt(4); do { double temp = (double)distc_2_3_change(engine); change = temp / 100.0; } while (!((val + change) >= 0.0 && (val + change <= Configurator::getInstance().max_pol_range))); } return random_sol; } double Solution::evaluateModelFunctionAt(double p) { double* c = _coefficients; // just to make access brief double exp = c[2] * pow(p, c[3]) /* pow(log10(p), c[4])*/; double y = c[0] + c[1] * pow(2.0, exp) * pow(p, c[4]); #ifdef SOLUTION_DEBUG std::cout << "f(" << p << ") = " << c[0] << " + " << c[1] << " * exp" << y << " with exp = " << exp << std::endl; #endif return y; } double Solution::evaluateConstantTermAt(double p) { double* c = _coefficients; // just to make access brief double exp = c[2] * pow(p, c[3]) /* pow(log10(p), c[4])*/; double y = pow(2.0, exp) * pow(p, c[4]); #ifdef SOLUTION_DEBUG std::cout << "varterm(" << p << ") = " << y << " with exp = " << exp << std::endl; #endif return y; } void Solution::printModelFunction() { double * c = _coefficients; std::cout << "(ID: " << this->id << ") \t f(p) = " << c[0] << " + " << c[1] << " * 2^ (" << c[2] << " * p^" << c[3] << " * log^" << c[4] << "(p) ) * p^" << c[4] << std::endl; } std::string Solution::printModelFunctionLatex() const { std::ostringstream streamObj; streamObj << getAt(0); std::string str_c0 = streamObj.str(); streamObj.str(""); streamObj << getAt(1); std::string str_c1 = streamObj.str(); streamObj.str(""); streamObj << getAt(2); std::string str_c2 = streamObj.str(); streamObj.str(""); streamObj << getAt(3); std::string str_c3 = streamObj.str(); streamObj.str(""); streamObj << getAt(4); std::string str_c4 = streamObj.str(); streamObj.str(""); std::string func = ""; func += "(\\x, {" + str_c0 + " + " + str_c1 + " * 2 ^ (" + str_c2 + " * \\x ^ (" + str_c3 + ")) * \\x ^" + str_c4 + "})"; return func; } std::string Solution::printModelFunctionLatexShow() const { std::ostringstream streamObj; streamObj << getAt(0); std::string str_c0 = streamObj.str(); streamObj.str(""); streamObj << getAt(1); std::string str_c1 = streamObj.str(); streamObj.str(""); streamObj << getAt(2); std::string str_c2 = streamObj.str(); streamObj.str(""); streamObj << getAt(3); std::string str_c3 = streamObj.str(); streamObj.str(""); streamObj << getAt(4); std::string str_c4 = streamObj.str(); streamObj.str(""); std::string func = ""; func += str_c0 + " + " + str_c1 + " * 2 ^ {" + str_c2 + " * x ^ {" + str_c3 + "}} * x ^ {" + str_c4 + "}"; return func; }
[ "michael.burger84@gmx.de" ]
michael.burger84@gmx.de
21fd2e33e78a623cc2d8b55a94007ca87467132f
138fbf302f4c4797c9bc992fa7aae1db0a2dc597
/lib/libcds/cds/intrusive/split_list.h
5ca7f4ab58cefad4eef10a9e5caa04946ed4bfbb
[ "BSD-2-Clause" ]
permissive
dimak08/seminar_in_algorithms
19cb7bed711963000cebb30f8b459df801df5be5
681e105dbdefa781eb0618192886b7b5004c7a6c
refs/heads/master
2021-01-18T05:48:57.474752
2015-09-23T16:10:39
2015-09-23T16:10:39
null
0
0
null
null
null
null
WINDOWS-1250
C++
false
false
48,300
h
//$$CDS-header$$ #ifndef __CDS_INTRUSIVE_SPLIT_LIST_H #define __CDS_INTRUSIVE_SPLIT_LIST_H #include <cds/intrusive/split_list_base.h> namespace cds { namespace intrusive { /// Split-ordered list /** @ingroup cds_intrusive_map \anchor cds_intrusive_SplitListSet_hp Hash table implementation based on split-ordered list algorithm discovered by Ori Shalev and Nir Shavit, see - [2003] Ori Shalev, Nir Shavit "Split-Ordered Lists - Lock-free Resizable Hash Tables" - [2008] Nir Shavit "The Art of Multiprocessor Programming" The split-ordered list is a lock-free implementation of an extensible unbounded hash table. It uses original recursive split-ordering algorithm discovered by Ori Shalev and Nir Shavit that allows to split buckets without moving an item on resizing. \anchor cds_SplitList_algo_desc <b>Short description</b> [from [2003] Ori Shalev, Nir Shavit "Split-Ordered Lists - Lock-free Resizable Hash Tables"] The algorithm keeps all the items in one lock-free linked list, and gradually assigns the bucket pointers to the places in the list where a sublist of “correct” items can be found. A bucket is initialized upon first access by assigning it to a new “dummy” node (dashed contour) in the list, preceding all items that should be in that bucket. A newly created bucket splits an older bucket’s chain, reducing the access cost to its items. The table uses a modulo 2**i hash (there are known techniques for “pre-hashing” before a modulo 2**i hash to overcome possible binary correlations among values). The table starts at size 2 and repeatedly doubles in size. Unlike moving an item, the operation of directing a bucket pointer can be done in a single CAS operation, and since items are not moved, they are never “lost”. However, to make this approach work, one must be able to keep the items in the list sorted in such a way that any bucket’s sublist can be “split” by directing a new bucket pointer within it. This operation must be recursively repeatable, as every split bucket may be split again and again as the hash table grows. To achieve this goal the authors introduced recursive split-ordering, a new ordering on keys that keeps items in a given bucket adjacent in the list throughout the repeated splitting process. Magically, yet perhaps not surprisingly, recursive split-ordering is achieved by simple binary reversal: reversing the bits of the hash key so that the new key’s most significant bits (MSB) are those that were originally its least significant. The split-order keys of regular nodes are exactly the bit-reverse image of the original keys after turning on their MSB. For example, items 9 and 13 are in the <tt>1 mod 4</tt> bucket, which can be recursively split in two by inserting a new node between them. To insert (respectively delete or search for) an item in the hash table, hash its key to the appropriate bucket using recursive split-ordering, follow the pointer to the appropriate location in the sorted items list, and traverse the list until the key’s proper location in the split-ordering (respectively until the key or a key indicating the item is not in the list is found). Because of the combinatorial structure induced by the split-ordering, this will require traversal of no more than an expected constant number of items. The design is modular: to implement the ordered items list, you can use one of several non-blocking list-based set algorithms: MichaelList, LazyList. <b>Implementation</b> Template parameters are: - \p GC - Garbage collector used. Note the \p GC must be the same as the GC used for \p OrderedList - \p OrderedList - ordered list implementation used as bucket for hash set, for example, MichaelList, LazyList. The intrusive ordered list implementation specifies the type \p T stored in the hash-set, the reclamation schema \p GC used by hash-set, the comparison functor for the type \p T and other features specific for the ordered list. - \p Traits - type traits. See split_list::type_traits for explanation. Instead of defining \p Traits struct you may use option-based syntax with split_list::make_traits metafunction. There are several specialization of the split-list class for different \p GC: - for \ref cds_urcu_gc "RCU type" include <tt><cds/intrusive/split_list_rcu.h></tt> - see \ref cds_intrusive_SplitListSet_rcu "RCU-based split-list" - for cds::gc::nogc include <tt><cds/intrusive/split_list_nogc.h></tt> - see \ref cds_intrusive_SplitListSet_nogc "persistent SplitListSet". \anchor cds_SplitList_hash_functor <b>Hash functor</b> Some member functions of split-ordered list accept the key parameter of type \p Q which differs from \p value_type. It is expected that type \p Q contains full key of \p value_type, and for equal keys of type \p Q and \p value_type the hash values of these keys must be equal too. The hash functor <tt>Traits::hash</tt> should accept parameters of both type: \code // Our node type struct Foo { std::string key_ ; // key field // ... other fields } ; // Hash functor struct fooHash { size_t operator()( const std::string& s ) const { return std::hash( s ) ; } size_t operator()( const Foo& f ) const { return (*this)( f.key_ ) ; } }; \endcode <b>How to use</b> First, you should choose ordered list type to use in your split-list set: \code // For gc::HP-based MichaelList implementation #include <cds/intrusive/michael_list_hp.h> // cds::intrusive::SplitListSet declaration #include <cds/intrusive/split_list.h> // Type of set items // Note you should declare your struct based on cds::intrusive::split_list::node // which is a wrapper for ordered-list node struct. // In our case, the node type for HP-based MichaelList is cds::intrusive::michael_list::node< cds::gc::HP > struct Foo: public cds::intrusive::split_list::node< cds::intrusive::michael_list::node< cds::gc::HP > > { std::string key_ ; // key field unsigned val_ ; // value field // ... other value fields }; // Declare comparator for the item struct FooCmp { int operator()( const Foo& f1, const Foo& f2 ) const { return f1.key_.compare( f2.key_ ) ; } }; // Declare base ordered-list type for split-list // It may be any ordered list type like MichaelList, LazyList typedef cds::intrusive::MichaelList< cds::gc::HP, Foo, typename cds::intrusive::michael_list::make_traits< // hook option cds::intrusive::opt::hook< cds::intrusive::michael_list::base_hook< cds::opt::gc< cds::gc::HP > > > // item comparator option ,cds::opt::compare< FooCmp > >::type > Foo_list ; \endcode Second, you should declare split-list set container: \code // Declare hash functor // Note, the hash functor accepts parameter type Foo and std::string struct FooHash { size_t operator()( const Foo& f ) const { return cds::opt::v::hash<std::string>()( f.key_ ) ; } size_t operator()( const std::string& s ) const { return cds::opt::v::hash<std::string>()( s ) ; } }; // Split-list set typedef typedef cds::intrusive::SplitListSet< cds::gc::HP ,Foo_list ,typename cds::intrusive::split_list::make_traits< cds::opt::hash< FooHash > >::type > Foo_set ; \endcode Now, you can use \p Foo_set in your application. \code Foo_set fooSet ; Foo * foo = new Foo ; foo->key_ = "First" ; fooSet.insert( *foo ) ; // and so on ... \endcode */ template < class GC, class OrderedList, # ifdef CDS_DOXYGEN_INVOKED class Traits = split_list::type_traits # else class Traits # endif > class SplitListSet { public: typedef Traits options ; ///< Traits template parameters typedef GC gc ; ///< Garbage collector protected: //@cond typedef split_list::details::rebind_list_options<OrderedList, options> wrapped_ordered_list ; //@endcond public: # ifdef CDS_DOXYGEN_INVOKED typedef OrderedList ordered_list ; ///< type of ordered list used as base for split-list # else typedef typename wrapped_ordered_list::result ordered_list ; # endif typedef typename ordered_list::value_type value_type ; ///< type of value stored in the split-list typedef typename ordered_list::key_comparator key_comparator ; ///< key comparison functor typedef typename ordered_list::disposer disposer ; ///< Node disposer functor /// Hash functor for \p %value_type and all its derivatives that you use typedef typename cds::opt::v::hash_selector< typename options::hash >::type hash ; typedef typename options::item_counter item_counter ; ///< Item counter type typedef typename options::back_off back_off ; ///< back-off strategy for spinning typedef typename options::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option typedef typename ordered_list::guarded_ptr guarded_ptr; ///< Guarded pointer protected: typedef typename ordered_list::node_type list_node_type ; ///< Node type as declared in ordered list typedef split_list::node<list_node_type> node_type ; ///< split-list node type typedef node_type dummy_node_type ; ///< dummy node type /// Split-list node traits /** This traits is intended for converting between underlying ordered list node type \ref list_node_type and split-list node type \ref node_type */ typedef split_list::node_traits<typename ordered_list::node_traits> node_traits ; //@cond /// Bucket table implementation typedef typename split_list::details::bucket_table_selector< options::dynamic_bucket_table , gc , dummy_node_type , opt::allocator< typename options::allocator > , opt::memory_model< memory_model > >::type bucket_table ; //@endcond protected: //@cond /// Ordered list wrapper to access protected members class ordered_list_wrapper: public ordered_list { typedef ordered_list base_class ; typedef typename base_class::auxiliary_head bucket_head_type; public: bool insert_at( dummy_node_type * pHead, value_type& val ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::insert_at( h, val ) ; } template <typename Func> bool insert_at( dummy_node_type * pHead, value_type& val, Func f ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::insert_at( h, val, f ) ; } template <typename Func> std::pair<bool, bool> ensure_at( dummy_node_type * pHead, value_type& val, Func func ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::ensure_at( h, val, func ) ; } bool unlink_at( dummy_node_type * pHead, value_type& val ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::unlink_at( h, val ) ; } template <typename Q, typename Compare, typename Func> bool erase_at( dummy_node_type * pHead, split_list::details::search_value_type<Q> const& val, Compare cmp, Func f ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::erase_at( h, val, cmp, f ) ; } template <typename Q, typename Compare> bool erase_at( dummy_node_type * pHead, split_list::details::search_value_type<Q> const& val, Compare cmp ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::erase_at( h, val, cmp ) ; } template <typename Q, typename Compare> bool extract_at( dummy_node_type * pHead, typename gc::Guard& guard, split_list::details::search_value_type<Q> const& val, Compare cmp ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::extract_at( h, guard, val, cmp ) ; } template <typename Q, typename Compare, typename Func> bool find_at( dummy_node_type * pHead, split_list::details::search_value_type<Q>& val, Compare cmp, Func f ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::find_at( h, val, cmp, f ) ; } template <typename Q, typename Compare> bool find_at( dummy_node_type * pHead, split_list::details::search_value_type<Q> const& val, Compare cmp ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::find_at( h, val, cmp ) ; } template <typename Q, typename Compare> bool get_at( dummy_node_type * pHead, typename gc::Guard& guard, split_list::details::search_value_type<Q> const& val, Compare cmp ) { assert( pHead != null_ptr<dummy_node_type *>() ) ; bucket_head_type h(pHead) ; return base_class::get_at( h, guard, val, cmp ) ; } bool insert_aux_node( dummy_node_type * pNode ) { return base_class::insert_aux_node( pNode ) ; } bool insert_aux_node( dummy_node_type * pHead, dummy_node_type * pNode ) { bucket_head_type h(pHead) ; return base_class::insert_aux_node( h, pNode ) ; } }; //@endcond protected: ordered_list_wrapper m_List ; ///< Ordered list containing split-list items bucket_table m_Buckets ; ///< bucket table CDS_ATOMIC::atomic<size_t> m_nBucketCountLog2 ; ///< log2( current bucket count ) item_counter m_ItemCounter ; ///< Item counter hash m_HashFunctor ; ///< Hash functor protected: //@cond typedef cds::details::Allocator< dummy_node_type, typename options::allocator > dummy_node_allocator ; static dummy_node_type * alloc_dummy_node( size_t nHash ) { return dummy_node_allocator().New( nHash ) ; } static void free_dummy_node( dummy_node_type * p ) { dummy_node_allocator().Delete( p ) ; } /// Calculates hash value of \p key template <typename Q> size_t hash_value( Q const& key ) const { return m_HashFunctor( key ) ; } size_t bucket_no( size_t nHash ) const { return nHash & ( (1 << m_nBucketCountLog2.load(CDS_ATOMIC::memory_order_relaxed)) - 1 ) ; } static size_t parent_bucket( size_t nBucket ) { assert( nBucket > 0 ) ; return nBucket & ~( 1 << bitop::MSBnz( nBucket ) ) ; } dummy_node_type * init_bucket( size_t nBucket ) { assert( nBucket > 0 ) ; size_t nParent = parent_bucket( nBucket ) ; dummy_node_type * pParentBucket = m_Buckets.bucket( nParent ) ; if ( pParentBucket == null_ptr<dummy_node_type *>() ) { pParentBucket = init_bucket( nParent ) ; } assert( pParentBucket != null_ptr<dummy_node_type *>() ) ; // Allocate a dummy node for new bucket { dummy_node_type * pBucket = alloc_dummy_node( split_list::dummy_hash( nBucket ) ) ; if ( m_List.insert_aux_node( pParentBucket, pBucket ) ) { m_Buckets.bucket( nBucket, pBucket ) ; return pBucket ; } free_dummy_node( pBucket ) ; } // Another thread set the bucket. Wait while it done // In this point, we must wait while nBucket is empty. // The compiler can decide that waiting loop can be "optimized" (stripped) // To prevent this situation, we use waiting on volatile bucket_head_ptr pointer. // back_off bkoff ; while ( true ) { dummy_node_type volatile * p = m_Buckets.bucket( nBucket ) ; if ( p != null_ptr<dummy_node_type volatile *>() ) return const_cast<dummy_node_type *>( p ) ; bkoff() ; } } dummy_node_type * get_bucket( size_t nHash ) { size_t nBucket = bucket_no( nHash ) ; dummy_node_type * pHead = m_Buckets.bucket( nBucket ) ; if ( pHead == null_ptr<dummy_node_type *>() ) pHead = init_bucket( nBucket ) ; assert( pHead->is_dummy() ) ; return pHead ; } void init() { // GC and OrderedList::gc must be the same static_assert(( std::is_same<gc, typename ordered_list::gc>::value ), "GC and OrderedList::gc must be the same") ; // atomicity::empty_item_counter is not allowed as a item counter static_assert(( !std::is_same<item_counter, atomicity::empty_item_counter>::value ), "atomicity::empty_item_counter is not allowed as a item counter") ; // Initialize bucket 0 dummy_node_type * pNode = alloc_dummy_node( 0 /*split_list::dummy_hash(0)*/ ) ; // insert_aux_node cannot return false for empty list CDS_VERIFY( m_List.insert_aux_node( pNode )) ; m_Buckets.bucket( 0, pNode ) ; } void inc_item_count() { size_t sz = m_nBucketCountLog2.load(CDS_ATOMIC::memory_order_relaxed) ; if ( ( ++m_ItemCounter >> sz ) > m_Buckets.load_factor() && ((size_t)(1 << sz )) < m_Buckets.capacity() ) { m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, CDS_ATOMIC::memory_order_seq_cst, CDS_ATOMIC::memory_order_relaxed ) ; } } template <typename Q, typename Compare, typename Func> bool find_( Q& val, Compare cmp, Func f ) { size_t nHash = hash_value( val ) ; split_list::details::search_value_type<Q> sv( val, split_list::regular_hash( nHash )) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; # ifdef CDS_CXX11_LAMBDA_SUPPORT return m_List.find_at( pHead, sv, cmp, [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); }) ; # else split_list::details::find_functor_wrapper<Func> ffw( f ) ; return m_List.find_at( pHead, sv, cmp, cds::ref(ffw) ) ; # endif } template <typename Q, typename Compare> bool find_( Q const& val, Compare cmp ) { size_t nHash = hash_value( val ) ; split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; return m_List.find_at( pHead, sv, cmp ) ; } template <typename Q, typename Compare> bool get_( typename gc::Guard& guard, Q const& val, Compare cmp ) { size_t nHash = hash_value( val ) ; split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; return m_List.get_at( pHead, guard, sv, cmp ) ; } template <typename Q, typename Compare, typename Func> bool erase_( Q const& val, Compare cmp, Func f ) { size_t nHash = hash_value( val ) ; split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; if ( m_List.erase_at( pHead, sv, cmp, f )) { --m_ItemCounter ; return true ; } return false ; } template <typename Q, typename Compare> bool erase_( Q const& val, Compare cmp ) { size_t nHash = hash_value( val ) ; split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; if ( m_List.erase_at( pHead, sv, cmp ) ) { --m_ItemCounter ; return true ; } return false ; } template <typename Q, typename Compare> bool extract_( typename gc::Guard& guard, Q const& val, Compare cmp ) { size_t nHash = hash_value( val ) ; split_list::details::search_value_type<Q const> sv( val, split_list::regular_hash( nHash )) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; if ( m_List.extract_at( pHead, guard, sv, cmp ) ) { --m_ItemCounter ; return true ; } return false ; } //@endcond public: /// Initialize split-ordered list of default capacity /** The default capacity is defined in bucket table constructor. See split_list::expandable_bucket_table, split_list::static_ducket_table which selects by split_list::dynamic_bucket_table option. */ SplitListSet() : m_nBucketCountLog2(1) { init() ; } /// Initialize split-ordered list SplitListSet( size_t nItemCount ///< estimate average of item count , size_t nLoadFactor = 1 ///< load factor - average item count per bucket. Small integer up to 8, default is 1. ) : m_Buckets( nItemCount, nLoadFactor ) , m_nBucketCountLog2(1) { init() ; } public: /// Inserts new node /** The function inserts \p val in the set if it does not contain an item with key equal to \p val. Returns \p true if \p val is placed into the set, \p false otherwise. */ bool insert( value_type& val ) { size_t nHash = hash_value( val ) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; node_traits::to_node_ptr( val )->m_nHash = split_list::regular_hash( nHash ) ; if ( m_List.insert_at( pHead, val )) { inc_item_count() ; return true ; } return false ; } /// Inserts new node /** This function is intended for derived non-intrusive containers. The function allows to split creating of new item into two part: - create item with key only - insert new item into the set - if inserting is success, calls \p f functor to initialize value-field of \p val. The functor signature is: \code void func( value_type& val ) ; \endcode where \p val is the item inserted. User-defined functor \p f should guarantee that during changing \p val no any other changes could be made on this set's item by concurrent threads. The user-defined functor is called only if the inserting is success and may be passed by reference using <tt>boost::ref</tt> */ template <typename Func> bool insert( value_type& val, Func f ) { size_t nHash = hash_value( val ) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; node_traits::to_node_ptr( val )->m_nHash = split_list::regular_hash( nHash ) ; if ( m_List.insert_at( pHead, val, f )) { inc_item_count() ; return true ; } return false ; } /// Ensures that the \p val exists in the set /** The operation performs inserting or changing data with lock-free manner. If the item \p val is not found in the set, then \p val is inserted into the set. Otherwise, the functor \p func is called with item found. The functor signature is: \code void func( bool bNew, value_type& item, value_type& val ) ; \endcode with arguments: - \p bNew - \p true if the item has been inserted, \p false otherwise - \p item - item of the set - \p val - argument \p val passed into the \p ensure function If new item has been inserted (i.e. \p bNew is \p true) then \p item and \p val arguments refers to the same thing. The functor can change non-key fields of the \p item; however, \p func must guarantee that during changing no any other modifications could be made on this item by concurrent threads. You can pass \p func argument by value or by reference using <tt>boost::ref</tt> or cds::ref. Returns std::pair<bool, bool> where \p first is \p true if operation is successfull, \p second is \p true if new item has been added or \p false if the item with \p key already is in the set. */ template <typename Func> std::pair<bool, bool> ensure( value_type& val, Func func ) { size_t nHash = hash_value( val ) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; node_traits::to_node_ptr( val )->m_nHash = split_list::regular_hash( nHash ) ; std::pair<bool, bool> bRet = m_List.ensure_at( pHead, val, func ) ; if ( bRet.first && bRet.second ) inc_item_count() ; return bRet ; } /// Unlinks the item \p val from the set /** The function searches the item \p val in the set and unlinks it from the set if it is found and is equal to \p val. Difference between \ref erase and \p unlink functions: \p erase finds <i>a key</i> and deletes the item found. \p unlink finds an item by key and deletes it only if \p val is an item of that set, i.e. the pointer to item found is equal to <tt> &val </tt>. The function returns \p true if success and \p false otherwise. */ bool unlink( value_type& val ) { size_t nHash = hash_value( val ) ; dummy_node_type * pHead = get_bucket( nHash ) ; assert( pHead != null_ptr<dummy_node_type *>() ) ; if ( m_List.unlink_at( pHead, val ) ) { --m_ItemCounter ; return true ; } return false ; } /// Deletes the item from the set /** \anchor cds_intrusive_SplitListSet_hp_erase The function searches an item with key equal to \p val in the set, unlinks it from the set, and returns \p true. If the item with key equal to \p val is not found the function return \p false. Difference between \ref erase and \p unlink functions: \p erase finds <i>a key</i> and deletes the item found. \p unlink finds an item by key and deletes it only if \p val is an item of that set, i.e. the pointer to item found is equal to <tt> &val </tt>. Note the hash functor should accept a parameter of type \p Q that can be not the same as \p value_type. */ template <typename Q> bool erase( Q const& val ) { return erase_( val, key_comparator() ) ; } /// Deletes the item from the set with comparing functor \p pred /** The function is an analog of \ref cds_intrusive_SplitListSet_hp_erase "erase(Q const&)" but \p pred predicate is used for key comparing. \p Less has the interface like \p std::less. \p pred must imply the same element order as the comparator used for building the set. */ template <typename Q, typename Less> bool erase_with( const Q& val, Less pred ) { return erase_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>() ) ; } /// Deletes the item from the set /** \anchor cds_intrusive_SplitListSet_hp_erase_func The function searches an item with key equal to \p val in the set, call \p f functor with item found, unlinks it from the set, and returns \p true. The \ref disposer specified by \p OrderedList class template parameter is called by garbage collector \p GC asynchronously. The \p Func interface is \code struct functor { void operator()( value_type const& item ) ; } ; \endcode The functor can be passed by reference with <tt>boost:ref</tt> If the item with key equal to \p val is not found the function return \p false. Note the hash functor should accept a parameter of type \p Q that can be not the same as \p value_type. */ template <typename Q, typename Func> bool erase( Q const& val, Func f ) { return erase_( val, key_comparator(), f ) ; } /// Deletes the item from the set with comparing functor \p pred /** The function is an analog of \ref cds_intrusive_SplitListSet_hp_erase_func "erase(Q const&, Func)" but \p pred predicate is used for key comparing. \p Less has the interface like \p std::less. \p pred must imply the same element order as the comparator used for building the set. */ template <typename Q, typename Less, typename Func> bool erase_with( Q const& val, Less pred, Func f ) { return erase_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f ) ; } /// Extracts the item with specified \p key /** \anchor cds_intrusive_SplitListSet_hp_extract The function searches an item with key equal to \p key, unlinks it from the set, and returns it in \p dest parameter. If the item with key equal to \p key is not found the function returns \p false. Note the compare functor should accept a parameter of type \p Q that may be not the same as \p value_type. The \ref disposer specified in \p OrderedList class' template parameter is called automatically by garbage collector \p GC when returned \ref guarded_ptr object will be destroyed or released. @note Each \p guarded_ptr object uses the GC's guard that can be limited resource. Usage: \code typedef cds::intrusive::SplitListSet< your_template_args > splitlist_set; splitlist_set theSet; // ... { splitlist_set::guarded_ptr gp; theSet.extract( gp, 5 ); // Deal with gp // ... // Destructor of gp releases internal HP guard } \endcode */ template <typename Q> bool extract( guarded_ptr& dest, Q const& key ) { return extract_( dest.guard(), key, key_comparator() ); } /// Extracts the item using compare functor \p pred /** The function is an analog of \ref cds_intrusive_SplitListSet_hp_extract "extract(guarded_ptr&, Q const&)" but \p pred predicate is used for key comparing. \p Less functor has the semantics like \p std::less but should take arguments of type \ref value_type and \p Q in any order. \p pred must imply the same element order as the comparator used for building the set. */ template <typename Q, typename Less> bool extract_with( guarded_ptr& dest, Q const& key, Less pred ) { return extract_( dest.guard(), key, typename wrapped_ordered_list::template make_compare_from_less<Less>() ); } /// Finds the key \p val /** \anchor cds_intrusive_SplitListSet_hp_find_func The function searches the item with key equal to \p val and calls the functor \p f for item found. The interface of \p Func functor is: \code struct functor { void operator()( value_type& item, Q& val ) ; }; \endcode where \p item is the item found, \p val is the <tt>find</tt> function argument. You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref. The functor can change non-key fields of \p item. Note that the functor is only guarantee that \p item cannot be disposed during functor is executing. The functor does not serialize simultaneous access to the set \p item. If such access is possible you must provide your own synchronization schema on item level to exclude unsafe item modifications. The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor can modify both arguments. Note the hash functor specified for class \p Traits template parameter should accept a parameter of type \p Q that can be not the same as \p value_type. The function returns \p true if \p val is found, \p false otherwise. */ template <typename Q, typename Func> bool find( Q& val, Func f ) { return find_( val, key_comparator(), f ) ; } /// Finds the key \p val with \p pred predicate for comparing /** The function is an analog of \ref cds_intrusive_SplitListSet_hp_find_func "find(Q&, Func)" but \p cmp is used for key compare. \p Less has the interface like \p std::less. \p cmp must imply the same element order as the comparator used for building the set. */ template <typename Q, typename Less, typename Func> bool find_with( Q& val, Less pred, Func f ) { return find_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f ) ; } /// Finds the key \p val /** \anchor cds_intrusive_SplitListSet_hp_find_cfunc The function searches the item with key equal to \p val and calls the functor \p f for item found. The interface of \p Func functor is: \code struct functor { void operator()( value_type& item, Q const& val ) ; }; \endcode where \p item is the item found, \p val is the <tt>find</tt> function argument. You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref. The functor can change non-key fields of \p item. Note that the functor is only guarantee that \p item cannot be disposed during functor is executing. The functor does not serialize simultaneous access to the set \p item. If such access is possible you must provide your own synchronization schema on item level to exclude unsafe item modifications. Note the hash functor specified for class \p Traits template parameter should accept a parameter of type \p Q that can be not the same as \p value_type. The function returns \p true if \p val is found, \p false otherwise. */ template <typename Q, typename Func> bool find( Q const& val, Func f ) { return find_( val, key_comparator(), f ) ; } /// Finds the key \p val with \p pred predicate for comparing /** The function is an analog of \ref cds_intrusive_SplitListSet_hp_find_cfunc "find(Q const&, Func)" but \p cmp is used for key compare. \p Less has the interface like \p std::less. \p cmp must imply the same element order as the comparator used for building the set. */ template <typename Q, typename Less, typename Func> bool find_with( Q const& val, Less pred, Func f ) { return find_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>(), f ) ; } /// Finds the key \p val /** \anchor cds_intrusive_SplitListSet_hp_find_val The function searches the item with key equal to \p val and returns \p true if it is found, and \p false otherwise. Note the hash functor specified for class \p Traits template parameter should accept a parameter of type \p Q that can be not the same as \p value_type. Otherwise, you may use \p find_with functions with explicit predicate for key comparing. */ template <typename Q> bool find( Q const& val ) { return find_( val, key_comparator() ) ; } /// Finds the key \p val with \p pred predicate for comparing /** The function is an analog of \ref cds_intrusive_SplitListSet_hp_find_val "find(Q const&)" but \p cmp is used for key compare. \p Less has the interface like \p std::less. \p cmp must imply the same element order as the comparator used for building the set. */ template <typename Q, typename Less> bool find_with( Q const& val, Less pred ) { return find_( val, typename wrapped_ordered_list::template make_compare_from_less<Less>() ) ; } /// Finds the key \p val and return the item found /** \anchor cds_intrusive_SplitListSet_hp_get The function searches the item with key equal to \p val and assigns the item found to guarded pointer \p ptr. The function returns \p true if \p val is found, and \p false otherwise. If \p val is not found the \p ptr parameter is not changed. The \ref disposer specified in \p OrderedList class' template parameter is called by garbage collector \p GC automatically when returned \ref guarded_ptr object will be destroyed or released. @note Each \p guarded_ptr object uses one GC's guard which can be limited resource. Usage: \code typedef cds::intrusive::SplitListSet< your_template_params > splitlist_set; splitlist_set theSet; // ... { splitlist_set::guarded_ptr gp; if ( theSet.get( gp, 5 )) { // Deal with gp //... } // Destructor of guarded_ptr releases internal HP guard } \endcode Note the compare functor specified for \p OrderedList template parameter should accept a parameter of type \p Q that can be not the same as \p value_type. */ template <typename Q> bool get( guarded_ptr& ptr, Q const& val ) { return get_( ptr.guard(), val, key_comparator() ); } /// Finds the key \p val and return the item found /** The function is an analog of \ref cds_intrusive_SplitListSet_hp_get "get( guarded_ptr& ptr, Q const&)" but \p pred is used for comparing the keys. \p Less functor has the semantics like \p std::less but should take arguments of type \ref value_type and \p Q in any order. \p pred must imply the same element order as the comparator used for building the set. */ template <typename Q, typename Less> bool get_with( guarded_ptr& ptr, Q const& val, Less pred ) { return get_( ptr.guard(), val, typename wrapped_ordered_list::template make_compare_from_less<Less>() ); } /// Returns item count in the set size_t size() const { return m_ItemCounter ; } /// Checks if the set is empty /** Emptiness is checked by item counting: if item count is zero then the set is empty. Thus, the correct item counting feature is an important part of split-list set implementation. */ bool empty() const { return size() == 0 ; } /// Clears the set (non-atomic) /** The function unlink all items from the set. The function is not atomic. Therefore, \p clear may be used only for debugging purposes. For each item the \p disposer is called after unlinking. */ void clear() { iterator it = begin() ; while ( it != end() ) { iterator i(it) ; ++i ; unlink( *it ) ; it = i ; } } protected: //@cond template <bool IsConst> class iterator_type :public split_list::details::iterator_type<node_traits, ordered_list, IsConst> { typedef split_list::details::iterator_type<node_traits, ordered_list, IsConst> iterator_base_class ; typedef typename iterator_base_class::list_iterator list_iterator ; public: iterator_type() : iterator_base_class() {} iterator_type( iterator_type const& src ) : iterator_base_class( src ) {} // This ctor should be protected... iterator_type( list_iterator itCur, list_iterator itEnd ) : iterator_base_class( itCur, itEnd ) {} }; //@endcond public: /// Forward iterator /** The forward iterator for a split-list has some features: - it has no post-increment operator - it depends on iterator of underlying \p OrderedList - The iterator cannot be moved across thread boundary since it may contain GC's guard that is thread-private GC data. - Iterator ensures thread-safety even if you delete the item that iterator points to. However, in case of concurrent deleting operations it is no guarantee that you iterate all item in the split-list. Therefore, the use of iterators in concurrent environment is not good idea. Use the iterator on the concurrent container for debug purpose only. */ typedef iterator_type<false> iterator ; /// Const forward iterator /** For iterator's features and requirements see \ref iterator */ typedef iterator_type<true> const_iterator ; /// Returns a forward iterator addressing the first element in a split-list /** For empty list \code begin() == end() \endcode */ iterator begin() { return iterator( m_List.begin(), m_List.end() ) ; } /// Returns an iterator that addresses the location succeeding the last element in a split-list /** Do not use the value returned by <tt>end</tt> function to access any item. The returned value can be used only to control reaching the end of the split-list. For empty list \code begin() == end() \endcode */ iterator end() { return iterator( m_List.end(), m_List.end() ) ; } /// Returns a forward const iterator addressing the first element in a split-list const_iterator begin() const { return const_iterator( m_List.begin(), m_List.end() ) ; } /// Returns an const iterator that addresses the location succeeding the last element in a split-list const_iterator end() const { return const_iterator( m_List.end(), m_List.end() ) ; } }; }} // namespace cds::intrusive #endif // #ifndef __CDS_INTRUSIVE_SPLIT_LIST_H
[ "jakob.gruber@gmail.com" ]
jakob.gruber@gmail.com
72645eac0c36e809b229ed72ac4b57874e408072
2d7236941560fe81a6390a744005128d451aa29d
/src/test/sanity_tests.cpp
057e13db76f5defb751398c3bc186c6939db8153
[ "MIT" ]
permissive
zero24x/billiecoin
1fcb2fa409c3940bd493d8ff7c8ebd754fe5c881
1b943b84aa687136edeb6c1fa258705a99157463
refs/heads/master
2020-12-23T22:32:08.313554
2020-01-30T20:23:10
2020-01-30T20:23:10
237,296,384
0
0
MIT
2020-01-30T20:11:16
2020-01-30T20:11:16
null
UTF-8
C++
false
false
718
cpp
// Copyright (c) 2012-2015 The Bitcoin Core developers // Copyright (c) 2019-2020 The Billiecoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "compat/sanity.h" #include "key.h" #include "test/test_billiecoin.h" #include <boost/test/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(basic_sanity) { BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test"); BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test"); BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test"); } BOOST_AUTO_TEST_SUITE_END()
[ "admin@coldwallet2020.com" ]
admin@coldwallet2020.com
a7ff28344b98ad10dda0c116d6e488486242db7b
d907ac57899bc7933451097de5224dc70199c7b9
/offer18/List.cpp
3e69956072007289e7d5e8776857436a6bc0146f
[]
no_license
wzq-hwx/offer_jian
1874776629e5854b06b08de75a700cb254e0619a
4e7ed3a0143fe21ec6f2058f87d013652ccc6ae3
refs/heads/master
2020-07-05T00:00:34.301214
2019-09-27T07:24:02
2019-09-27T07:24:02
202,462,673
2
0
null
null
null
null
UTF-8
C++
false
false
2,199
cpp
// // Created by lenovo on 2019/8/27. // #include "List00.h" #include <stdio.h> #include <stdlib.h> ListNode* CreateListNode(int value) { ListNode* pNode = new ListNode(); pNode->m_nValue = value; pNode->m_pNext = nullptr; return pNode; } void ConnectListNodes(ListNode* pCurrent, ListNode* pNext) { if(pCurrent == nullptr) { printf("Error to connect two nodes.\n"); exit(1); } pCurrent->m_pNext = pNext; } void PrintListNode(ListNode* pNode) { if(pNode == nullptr) { printf("The node is nullptr\n"); } else { printf("The key in node is %d.\n", pNode->m_nValue); } } void PrintList(ListNode* pHead) { printf("PrintList starts.\n"); ListNode* pNode = pHead; while(pNode != nullptr) { printf("%d\t", pNode->m_nValue); pNode = pNode->m_pNext; } printf("\nPrintList ends.\n"); } void DestroyList(ListNode* pHead) { ListNode* pNode = pHead; while(pNode != nullptr) { pHead = pHead->m_pNext; delete pNode; pNode = pHead; } } void AddToTail(ListNode** pHead, int value) { ListNode* pNew = new ListNode(); pNew->m_nValue = value; pNew->m_pNext = nullptr; if(*pHead == nullptr) { *pHead = pNew; } else { ListNode* pNode = *pHead; while(pNode->m_pNext != nullptr) pNode = pNode->m_pNext; pNode->m_pNext = pNew; } } void RemoveNode(ListNode** pHead, int value) { if(pHead == nullptr || *pHead == nullptr) return; ListNode* pToBeDeleted = nullptr; if((*pHead)->m_nValue == value) { pToBeDeleted = *pHead; *pHead = (*pHead)->m_pNext; } else { ListNode* pNode = *pHead; while(pNode->m_pNext != nullptr && pNode->m_pNext->m_nValue != value) pNode = pNode->m_pNext; if(pNode->m_pNext != nullptr && pNode->m_pNext->m_nValue == value) { pToBeDeleted = pNode->m_pNext; pNode->m_pNext = pNode->m_pNext->m_pNext; } } if(pToBeDeleted != nullptr) { delete pToBeDeleted; pToBeDeleted = nullptr; } }
[ "1259906709@qq.com" ]
1259906709@qq.com
e96af7113d96551b9babff87da4f016a00de6d94
4c304390518ed09b983460914c431e446f765869
/main.cpp
a6b2b662ef7c7795841aea0f2f316ce2df081cf6
[]
no_license
Tzoali/NoelEscapes
93b97b6d7dee0b76c69874963568fafd7fe3cc6a
7ca953545bb602fe9830b3080c15b87df41b11a4
refs/heads/master
2023-07-06T23:05:59.193796
2021-08-06T14:18:51
2021-08-06T14:18:51
393,398,498
0
0
null
null
null
null
UTF-8
C++
false
false
3,019
cpp
//INTEGRANTES: // Daniel Tzoali Arroyo Valdivia // Omar Arturo Ruiz Bernal #include "Texture.h" #include <iostream> #include <string> #include <string.h> #include <time.h> #include <SDL2/SDL.h> #include <SDL2/SDL_main.h> #include <SDL2/SDL_ttf.h> #include <SDL2/SDL_image.h> #include <SDL2/SDL_mixer.h> #include <algorithm> #include <queue> #include <fstream> #include "Santa.h" #include "Game.h" #include "Songs.h" #include "Menu.h" using namespace std; int main(int argv, char** args) { srand(time(0)); float dtInput = 0; Uint64 Start = 0; Uint64 End = 0; Uint64 Frequency = SDL_GetPerformanceFrequency(); Uint32 Delay = 0; Uint32 DelayStart = SDL_GetTicks(); Uint32 DelayEnd = 0; bool running=true; SDL_Init(SDL_INIT_EVERYTHING); const Uint8 *keyState; if(TTF_Init() == -1) { SDL_Log("%s\n", TTF_GetError()); return(-1); } IMG_Init(IMG_INIT_PNG | IMG_INIT_JPG); Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048); SDL_Window* Win = SDL_CreateWindow("Noel Escapes", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1056, 720, SDL_WINDOW_SHOWN); SDL_Surface *logo; logo = SDL_LoadBMP("res/images/Noel.bmp"); SDL_SetWindowIcon(Win, logo); SDL_FreeSurface(logo); SDL_Renderer* Render = SDL_CreateRenderer(Win, -1, SDL_RENDERER_ACCELERATED); SDL_SetRenderDrawBlendMode(Render, SDL_BLENDMODE_BLEND); menu m(Render); char nombre[1000]={0}; int tam=0; Delay=0; SDL_Event Events; bool read=0; while(running && m.start(Render,keyState,Delay,Events,nombre,&tam,&read)) { while(SDL_PollEvent(&Events)) { if(Events.type==SDL_QUIT) { running = false; } if(read) { if(Events.type==SDL_TEXTINPUT || Events.type==SDL_KEYDOWN) { if(Events.type==SDL_KEYDOWN && Events.key.keysym.sym==SDLK_BACKSPACE && tam>0) { nombre[--tam]='\0'; } else if((*(Events.text.text)>='a' && *(Events.text.text)<='z' || *(Events.text.text)>='A' && *(Events.text.text)<='Z' || *(Events.text.text)>='0' && *(Events.text.text)<='9') && tam<=25) { nombre[tam]=*(Events.text.text); nombre[++tam]='\0'; } } } } keyState=SDL_GetKeyboardState(NULL); SDL_RenderPresent(Render); End = SDL_GetPerformanceCounter(); Uint64 Elapsed = End - Start; dtInput = (float)Elapsed/(float)Frequency; Start = End; DelayEnd = SDL_GetTicks(); Delay += DelayEnd - DelayStart; DelayStart = DelayEnd; } return 0; }
[ "dtav.sk.99@gmail.com" ]
dtav.sk.99@gmail.com
4c384429d1e5a31f8744e0d876f49f4f273cd5af
b1950dd1f1f7cfbc8843f993b884baee0d0e3488
/Even pair sum.cpp
caf297dc1337947ed3247773df7a7459b199129f
[]
no_license
Abhiishek-More/Codechef-Deceber-Challenge
2645eb96ec384f163f6c8d5b05036b9729ecf8cb
824bf9798100b2aeb7f572705bbea0826ffd546e
refs/heads/master
2023-01-30T10:25:31.067782
2020-12-19T05:03:54
2020-12-19T05:03:54
322,769,994
0
0
null
null
null
null
UTF-8
C++
false
false
714
cpp
#include<iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; scanf("%d", &T); while(T--) { unsigned long long int out, evenA=0, oddA=0, evenB=0, oddB=0; scanf("llu %llu", &A, &B); if(A%2==0) { evenA=A/2; oddA=A/2; } else { evenA=(A/2); oddA=evenA+1; } if(B%2==0) { evenB=B/2; oddB=B/2; } else { evenB=(B/2); oddB=evenB+1; } out = (evenA*evenB)+(oddA*oddB); printf("%llu", out); } return 0; }
[ "abhiishek.more@gmail.com" ]
abhiishek.more@gmail.com
1b55bcc2094c2cb3a8837fd4f1b007eb5aedd8ad
e2502b991ef5c62bf4263edc62d1e252c9294fbe
/FinalHUDTest/Intermediate/Build/Win32/UE4/Inc/FinalHUDTest/FinalHUDTestGameModeBase.generated.h
2e0b21199dc4d738a388c3a2bc75a1c8875405f1
[]
no_license
sbairedd/HONR399Final
59fc2c34b01ccbad91c2f00ea6679a4aa8039411
0c56be06cd50d693ea5925fd065bef2d5bb51255
refs/heads/master
2020-04-02T03:00:28.425276
2018-04-27T03:58:32
2018-04-27T03:58:32
129,951,984
0
0
null
2018-04-17T19:00:57
2018-04-17T19:00:57
null
UTF-8
C++
false
false
4,456
h
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ===========================================================================*/ #include "ObjectMacros.h" #include "ScriptMacros.h" PRAGMA_DISABLE_DEPRECATION_WARNINGS #ifdef FINALHUDTEST_FinalHUDTestGameModeBase_generated_h #error "FinalHUDTestGameModeBase.generated.h already included, missing '#pragma once' in FinalHUDTestGameModeBase.h" #endif #define FINALHUDTEST_FinalHUDTestGameModeBase_generated_h #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS_NO_PURE_DECLS #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS_NO_PURE_DECLS \ private: \ static void StaticRegisterNativesAFinalHUDTestGameModeBase(); \ friend FINALHUDTEST_API class UClass* Z_Construct_UClass_AFinalHUDTestGameModeBase(); \ public: \ DECLARE_CLASS(AFinalHUDTestGameModeBase, AGameModeBase, COMPILED_IN_FLAGS(0 | CLASS_Transient), 0, TEXT("/Script/FinalHUDTest"), NO_API) \ DECLARE_SERIALIZER(AFinalHUDTestGameModeBase) \ enum {IsIntrinsic=COMPILED_IN_INTRINSIC}; #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS \ private: \ static void StaticRegisterNativesAFinalHUDTestGameModeBase(); \ friend FINALHUDTEST_API class UClass* Z_Construct_UClass_AFinalHUDTestGameModeBase(); \ public: \ DECLARE_CLASS(AFinalHUDTestGameModeBase, AGameModeBase, COMPILED_IN_FLAGS(0 | CLASS_Transient), 0, TEXT("/Script/FinalHUDTest"), NO_API) \ DECLARE_SERIALIZER(AFinalHUDTestGameModeBase) \ enum {IsIntrinsic=COMPILED_IN_INTRINSIC}; #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_STANDARD_CONSTRUCTORS \ /** Standard constructor, called after all reflected properties have been initialized */ \ NO_API AFinalHUDTestGameModeBase(const FObjectInitializer& ObjectInitializer); \ DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL(AFinalHUDTestGameModeBase) \ DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, AFinalHUDTestGameModeBase); \ DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(AFinalHUDTestGameModeBase); \ private: \ /** Private move- and copy-constructors, should never be used */ \ NO_API AFinalHUDTestGameModeBase(AFinalHUDTestGameModeBase&&); \ NO_API AFinalHUDTestGameModeBase(const AFinalHUDTestGameModeBase&); \ public: #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_ENHANCED_CONSTRUCTORS \ private: \ /** Private move- and copy-constructors, should never be used */ \ NO_API AFinalHUDTestGameModeBase(AFinalHUDTestGameModeBase&&); \ NO_API AFinalHUDTestGameModeBase(const AFinalHUDTestGameModeBase&); \ public: \ DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, AFinalHUDTestGameModeBase); \ DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(AFinalHUDTestGameModeBase); \ DEFINE_DEFAULT_CONSTRUCTOR_CALL(AFinalHUDTestGameModeBase) #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_PRIVATE_PROPERTY_OFFSET #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_12_PROLOG #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_GENERATED_BODY_LEGACY \ PRAGMA_DISABLE_DEPRECATION_WARNINGS \ public: \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_PRIVATE_PROPERTY_OFFSET \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_STANDARD_CONSTRUCTORS \ public: \ PRAGMA_ENABLE_DEPRECATION_WARNINGS #define FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_GENERATED_BODY \ PRAGMA_DISABLE_DEPRECATION_WARNINGS \ public: \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_PRIVATE_PROPERTY_OFFSET \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_RPC_WRAPPERS_NO_PURE_DECLS \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_INCLASS_NO_PURE_DECLS \ FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h_15_ENHANCED_CONSTRUCTORS \ private: \ PRAGMA_ENABLE_DEPRECATION_WARNINGS #undef CURRENT_FILE_ID #define CURRENT_FILE_ID FinalHUDTest_Source_FinalHUDTest_FinalHUDTestGameModeBase_h PRAGMA_ENABLE_DEPRECATION_WARNINGS
[ "matrickpay@gmail.com" ]
matrickpay@gmail.com
e62ea1646814980e4f52832b256289c26ea29887
ad273708d98b1f73b3855cc4317bca2e56456d15
/aws-cpp-sdk-application-insights/source/model/ListComponentsResult.cpp
eb4afd45d90e39c9d6228c846b37d839df5be498
[ "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
1,892
cpp
/* * 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. */ #include <aws/application-insights/model/ListComponentsResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::ApplicationInsights::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; ListComponentsResult::ListComponentsResult() { } ListComponentsResult::ListComponentsResult(const Aws::AmazonWebServiceResult<JsonValue>& result) { *this = result; } ListComponentsResult& ListComponentsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("ApplicationComponentList")) { Array<JsonView> applicationComponentListJsonList = jsonValue.GetArray("ApplicationComponentList"); for(unsigned applicationComponentListIndex = 0; applicationComponentListIndex < applicationComponentListJsonList.GetLength(); ++applicationComponentListIndex) { m_applicationComponentList.push_back(applicationComponentListJsonList[applicationComponentListIndex].AsObject()); } } if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); } return *this; }
[ "aws-sdk-cpp-automation@github.com" ]
aws-sdk-cpp-automation@github.com
5e13ff7d061edb1fa547b469b4fc03c0cfa029f3
b3f9d2a11a6ee9ace2b276a49aba380c2a79592b
/Dependencies/Build/src/skia/include/core/SkVertices.h
c127d37432cb2a6daf09ab2c5370d6918733e8d2
[ "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-unknown-license-reference" ]
permissive
lah64/test
0f709e776c890ee1fd826f35fdac914aeba296b2
9b03adce666adb85e5ae2d8af5262e0acb4b91e1
refs/heads/master
2023-07-21T19:38:42.479734
2020-10-01T23:36:55
2020-10-01T23:36:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,030
h
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkVertices_DEFINED #define SkVertices_DEFINED #include "include/core/SkColor.h" #include "include/core/SkRect.h" #include "include/core/SkRefCnt.h" class SkData; struct SkPoint; class SkVerticesPriv; /** * An immutable set of vertex data that can be used with SkCanvas::drawVertices. */ class SK_API SkVertices : public SkNVRefCnt<SkVertices> { struct Desc; struct Sizes; public: // DEPRECATED -- remove when we've updated canvas virtuals to not mention bones struct Bone { float values[6]; }; enum VertexMode { kTriangles_VertexMode, kTriangleStrip_VertexMode, kTriangleFan_VertexMode, kLast_VertexMode = kTriangleFan_VertexMode, }; /** * Create a vertices by copying the specified arrays. texs, colors may be nullptr, * and indices is ignored if indexCount == 0. */ static sk_sp<SkVertices> MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[]); static sk_sp<SkVertices> MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[]) { return MakeCopy(mode, vertexCount, positions, texs, colors, 0, nullptr); } static constexpr int kMaxCustomAttributes = 8; struct Attribute { enum class Type : uint8_t { kFloat, kFloat2, kFloat3, kFloat4, kByte4_unorm, }; Attribute() : fType(Type::kFloat) {} Attribute(Type t) : fType(t) {} bool operator==(const Attribute& that) const { return fType == that.fType; } bool operator!=(const Attribute& that) const { return !(*this == that); } int channelCount() const; size_t bytesPerVertex() const; Type fType; }; enum BuilderFlags { kHasTexCoords_BuilderFlag = 1 << 0, kHasColors_BuilderFlag = 1 << 1, }; class Builder { public: Builder(VertexMode mode, int vertexCount, int indexCount, uint32_t flags); // EXPERIMENTAL -- do not call if you care what happens Builder(VertexMode mode, int vertexCount, int indexCount, const Attribute* attrs, int attrCount); bool isValid() const { return fVertices != nullptr; } SkPoint* positions(); uint16_t* indices(); // returns null if there are no indices // if we have texCoords or colors, this will always be null void* customData(); // returns null if there are no custom attributes // If we have custom attributes, these will always be null SkPoint* texCoords(); // returns null if there are no texCoords SkColor* colors(); // returns null if there are no colors // Detach the built vertices object. After the first call, this will always return null. sk_sp<SkVertices> detach(); private: Builder(const Desc&); void init(const Desc&); // holds a partially complete object. only completed in detach() sk_sp<SkVertices> fVertices; // Extra storage for intermediate vertices in the case where the client specifies indexed // triangle fans. These get converted to indexed triangles when the Builder is finalized. std::unique_ptr<uint8_t[]> fIntermediateFanIndices; friend class SkVertices; }; uint32_t uniqueID() const { return fUniqueID; } const SkRect& bounds() const { return fBounds; } // returns approximate byte size of the vertices object size_t approximateSize() const; /** * Recreate a vertices from a buffer previously created by calling encode(). * Returns null if the data is corrupt or the length is incorrect for the contents. */ static sk_sp<SkVertices> Decode(const void* buffer, size_t length); /** * Pack the vertices object into a byte buffer. This can be used to recreate the vertices * by calling Decode() with the buffer. */ sk_sp<SkData> encode() const; // Provides access to functions that aren't part of the public API. SkVerticesPriv priv(); const SkVerticesPriv priv() const; private: SkVertices() {} friend class SkVerticesPriv; // these are needed since we've manually sized our allocation (see Builder::init) friend class SkNVRefCnt<SkVertices>; void operator delete(void* p); Sizes getSizes() const; // we store this first, to pair with the refcnt in our base-class, so we don't have an // unnecessary pad between it and the (possibly 8-byte aligned) ptrs. uint32_t fUniqueID; // these point inside our allocation, so none of these can be "freed" SkPoint* fPositions; // [vertexCount] uint16_t* fIndices; // [indexCount] or null void* fCustomData; // [customDataSize * vertexCount] or null SkPoint* fTexs; // [vertexCount] or null SkColor* fColors; // [vertexCount] or null SkRect fBounds; // computed to be the union of the fPositions[] int fVertexCount; int fIndexCount; Attribute fAttributes[kMaxCustomAttributes]; int fAttributeCount; VertexMode fMode; // below here is where the actual array data is stored. }; #endif
[ "alexanderskyzzz@gmail.com" ]
alexanderskyzzz@gmail.com
234cff216cec4848ab3c7328a2fff23d5f73f26d
35f01879fcb6a6435994de68518275a07c3d631f
/WinAPI GameFramework/Include/Object/guided_bullet.h
b1aee2b836b877d7be45225285e2039d5504291e
[]
no_license
kwangminy27/WinAPI-GameFramework
5520a8b8a6d1fc845a9935e7970e3104db522e3a
e4530c6a4a255f853d8407f12225512e24366319
refs/heads/master
2020-03-24T22:49:47.052774
2018-08-07T12:25:00
2018-08-07T12:25:00
143,104,758
0
0
null
null
null
null
UTF-8
C++
false
false
943
h
#pragma once #include "bullet.h" class GuidedBullet final : public Bullet { friend class ObjectManager; public: virtual bool Initialize() override; bool is_guided() const; std::shared_ptr<Object> target() const; void set_target(std::weak_ptr<Object> const& target); private: GuidedBullet() = default; GuidedBullet(GuidedBullet const& other); GuidedBullet(GuidedBullet&& other) noexcept; GuidedBullet& operator=(GuidedBullet const&) = default; GuidedBullet& operator=(GuidedBullet&&) noexcept = default; virtual void _Release() override; virtual void _Input(float time) override; virtual void _Update(float time) override; virtual void _LateUpdate(float time) override; virtual void _Collision(float time) override; virtual void _Render(HDC device_context, float time) override; virtual std::unique_ptr<Object, std::function<void(Object*)>> _Clone() override; bool is_guided_{}; std::weak_ptr<Object> target_{}; };
[ "kwangminy27@outlook.com" ]
kwangminy27@outlook.com
ab1b878366e04fb0ea3c827393e478714e8188c1
af7f2ef58c7cbbbe78f0a2e57a14d45016ec607e
/Micro16/third_pipe.H
daaf12fa5ba2a087f657039df75775b843fa6d53
[]
no_license
juliolugo96/microbaseball
d585dc313a0fbc216ad1fbb1760cf06d7e033ea9
bde02945b6d4dcfc1069fcfbd19d712e2352459a
refs/heads/master
2020-06-10T03:27:10.524604
2019-06-24T19:42:49
2019-06-24T19:42:49
193,567,360
0
0
null
null
null
null
UTF-8
C++
false
false
1,433
h
#ifndef THIRD_PIPE_H #define THIRD_PIPE_H /** * @name Third pipe * @file third_pipe.H * @author Micro 16 development team * @brief Third pipe designed and developed in C++ using * system-C library */ # include <systemc.h> # include <iostream> using namespace std; class third_pipe : public sc_module { public: sc_in <bool> clock; sc_in <bool> enable; sc_in < sc_uint<4> > op_in, r3_in; sc_in < sc_uint<32> > result_in, store_in; sc_in < sc_uint<8> > dir_in; sc_out < sc_uint<4> > op_out, r3_out; sc_out < sc_uint<32> > result_out, store_out; sc_out < sc_uint<8> > dir_out; SC_CTOR(third_pipe) { for(int i = 0 ; i < 2; i++) arit_log_reg[i] = 0; op_reg = 0; dir_reg = 0; SC_METHOD(write); sensitive << clock.pos() << enable << op_in << r3_in << result_in << store_in << dir_in; SC_METHOD(read); sensitive << clock.neg(); } private: sc_uint<4> op_reg, r3_reg; sc_uint <32> arit_log_reg[2]; sc_uint <8> dir_reg; void write() { if(enable) { op_reg = op_in.read(); r3_reg = r3_in.read(); arit_log_reg[0] = result_in.read(); arit_log_reg[1] = store_in.read(); dir_reg = dir_in.read(); } } void read() { op_out.write(op_reg); r3_out.write(r3_reg); result_out.write(arit_log_reg[0]); store_out.write(arit_log_reg[1]); dir_out.write(dir_reg); } }; #endif
[ "julio@ignisgravitas.com" ]
julio@ignisgravitas.com
de1817cd588bf23a119b7fc380563dcaf06feb26
2ba94892764a44d9c07f0f549f79f9f9dc272151
/Engine/Source/Editor/ComponentVisualizers/Private/SpotLightComponentVisualizer.h
e521ad36695a50299d97924ca6d6fbcfe8d3dc13
[ "BSD-2-Clause", "LicenseRef-scancode-proprietary-license" ]
permissive
PopCap/GameIdea
934769eeb91f9637f5bf205d88b13ff1fc9ae8fd
201e1df50b2bc99afc079ce326aa0a44b178a391
refs/heads/master
2021-01-25T00:11:38.709772
2018-09-11T03:38:56
2018-09-11T03:38:56
37,818,708
0
0
BSD-2-Clause
2018-09-11T03:39:05
2015-06-21T17:36:44
null
UTF-8
C++
false
false
399
h
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once #include "ComponentVisualizer.h" class FSpotLightComponentVisualizer : public FComponentVisualizer { public: // Begin FComponentVisualizer interface virtual void DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI) override; // End FComponentVisualizer interface };
[ "dkroell@acm.org" ]
dkroell@acm.org
982784b052fe88e88786e2a85ce21f2d1b783b97
a33aac97878b2cb15677be26e308cbc46e2862d2
/program_data/PKU_raw/95/375.c
90860a26d5dfc92a47edba6f24b5df84dfa3264f
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
420
c
int main(int argc, char* argv[]) { char s1[80],s2[80]; int i; gets(s1); gets(s2); for (i=0;s1[i]!='\0';i++) { if (s1[i]<='z'&&s1[i]>='a') { s1[i]=s1[i]-32; } } for (i=0;s2[i]!='\0';i++) { if (s2[i]<='z'&&s2[i]>='a') { s2[i]=s2[i]-32; } } i=strcmp(s1,s2); if (i==0) printf ("="); else if (i<0) printf ("<"); else if (i>0) printf (">"); return 0; }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
944ed5eba0c5fc01df846105723781eb2b5b3342
340980d65abc89e98b274417ec118b1beca77924
/Kick Start/2021/1 A/KGoodnessString.cpp
bf2a189a8fab2177b96a742331b7f4b6ab5cc4d7
[]
no_license
AthulJoseph27/Code-Jam
fe5b1fcb7c986d443168940a69ddf36127cd2973
fcab3e58b69cf4eed8fb20f7d3e77403a1acf517
refs/heads/main
2023-05-05T04:43:22.181102
2021-05-23T17:14:24
2021-05-23T17:14:24
353,401,041
0
0
null
null
null
null
UTF-8
C++
false
false
1,971
cpp
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<vl> vvl; #define push push_back #define all(v) v.begin(), v.end() void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print(float x) { cerr << x; } void __print(double x) { cerr << x; } void __print(long double x) { cerr << x; } void __print(char x) { cerr << '\'' << x << '\''; } void __print(const char *x) { cerr << '\"' << x << '\"'; } void __print(const string &x) { cerr << '\"' << x << '\"'; } void __print(bool x) { cerr << (x ? "true" : "false"); } template <typename T, typename V> void __print(const pair<T, V> &x) { cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}'; } template <typename T> void __print(const T &x) { int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}"; } void _print() { cerr << "]\n"; } template <typename T, typename... V> void _print(T t, V... v) { __print(t); if (sizeof...(v)) cerr << ", "; _print(v...); } #ifndef ONLINE_JUDGE #define debug(x...) \ cerr << "[" << #x << "] = ["; \ _print(x) #else #define debug(x...) #endif void solve(int cc) { string s; int n, k; cin >> n >> k; cin >> s; int goodness = 0; for (int i = 1; i <= n / 2; i++) { if (s[i - 1] != s[n - i]) goodness++; } cout << "Case #" << cc << ": " << abs(goodness - k) << '\n'; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int T; cin >> T; for (int i = 0; i < T; i++) { solve(i + 1); } return 0; }
[ "athuljoseph27052001@gmail.com" ]
athuljoseph27052001@gmail.com
2f6190370eb297db2b2011dfb5bb2d60cdee6068
0953b8e08ae16dfb2ddfe278d28cbcd32d8f1276
/Bit Manupulation/342. Power of Four.cpp
aa9b477836839ea646e86a5d5234c0b914b92bcc
[]
no_license
Robust-star/Leetcode_Practice
acc876f13cf0bb3d52e2759d8f064f9453c10b5a
8dddf0626a4dabbecc40108d5e4f7d5bf2336bdd
refs/heads/master
2023-06-08T21:09:15.501292
2021-06-30T16:48:00
2021-06-30T16:48:00
378,225,927
0
0
null
null
null
null
UTF-8
C++
false
false
2,222
cpp
bool isPowerOfFour(const int &num) { return num > 0 && (num & (num - 1)) == 0 && (num & 0xAAAAAAAA) == 0; } // Explanation: // A number which is a power of 4 has binary representation like this: // 000...1000000... // There's only a single 1 bit. The number of zeros after the bit 1 must be an even number. 4^0 = 1 (1), 4^1 = 4 (100), 4^2 = 16 (10000). When we multiply a number by 4, we shift it left by 2 which means adding 2 more zeros after the 1 bit. In other words, the 1 bit must be in an even position. // To check if there's only a single bit 1: num & (num - 1) == 0. According to Cracking the Coding Interview's explanation: // A & B == 0 means that A and B never have a 1 bit in the same place. // When you subtract 1 from a number, you look at the least significant bit. If it's a 1 you change it to 0, and you are done. If it's a zero, you must "borrow" from a larger bit. So, you go to increasingly larger bits, changing each bit from a 0 to a 1, until you find a 1. You flip that 1 to a 0 and you are done. Thus, n-1 will look like n, except that n's initial 0s will be 1 s in n-1, and n's least significant 1 will be a 0 in n-1. That is: if n = abcde1000 then n-1 = abcde0111. // Recall that n and n-1 never have a 1 bit in the same place. n and n-1 have the same part in their binary representation: abcde. We can conclude that abcde = 00000, which means n = 00000...1000... // Actually this is a way to check if n is a power of 2 (or if n is 0). // How about (num & 0xAAAAAAAA) == 0? 0xAAAAAAAA is 10101010‭10101010101010101010101010101010‬ in binary. ANDing a 32-bit number with 0xAAAAAAAA means setting all even bits to 0. After clearing even bits, if the number is larger than 0, it means the 1 bit is in an odd position and num is just a power of 2. Otherwise num is a power of 4 (or a zero). // Finally, remember to check num > 0. // I see lots of solutions using built-in power or log function. I don't know the time complexity of these functions (if you know, please leave your comment to let me know) but I think they're slower than bitwise operation. I also think that computing floating-point number may leads to incorrect results because of accuracy problem. // Hope this helps!
[ "raj1999gupta@gmail.com" ]
raj1999gupta@gmail.com
d63f80de77cc0dc1bb05120e0c4edf6d09b5087e
9a94e85ef2820d626cd76123b9aa49190c991003
/HSPF_MRO_ANDR/build/iOS/Preview/src/_root.HSMRO_FuseControlsControl_Background_Property.cpp
3545ef526d825925deb981fb2b1554157d60f7ce
[]
no_license
jaypk-104/FUSE
448db1717a29052f7b551390322a6167dfea34cd
0464afa07998eea8de081526a9337bd9af42dcf3
refs/heads/master
2023-03-13T14:32:43.855977
2021-03-18T01:57:10
2021-03-18T01:57:10
348,617,284
0
0
null
null
null
null
UTF-8
C++
false
false
4,847
cpp
// This file was generated based on '/Users/jay/Dev/Fuse/HSPF_MRO_ANDR/build/iOS/Preview/cache/ux15/HS MRO.unoproj.g.uno'. // WARNING: Changes might be lost if you edit this file directly. #include <_root.HSMRO_FuseControlsControl_Background_Property.h> #include <Fuse.Controls.Control.h> #include <Uno.UX.IPropertyListener.h> #include <Uno.UX.PropertyObject.h> #include <Uno.UX.Selector.h> static uType* TYPES[1]; namespace g{ // internal sealed class HSMRO_FuseControlsControl_Background_Property // { static void HSMRO_FuseControlsControl_Background_Property_build(uType* type) { ::TYPES[0] = ::g::Fuse::Controls::Control_typeof(); type->SetBase(::g::Uno::UX::Property1_typeof()->MakeType(::g::Fuse::Drawing::Brush_typeof(), NULL)); type->SetFields(1, ::TYPES[0/*Fuse.Controls.Control*/], offsetof(HSMRO_FuseControlsControl_Background_Property, _obj), uFieldFlagsWeak); } ::g::Uno::UX::Property1_type* HSMRO_FuseControlsControl_Background_Property_typeof() { static uSStrong< ::g::Uno::UX::Property1_type*> type; if (type != NULL) return type; uTypeOptions options; options.BaseDefinition = ::g::Uno::UX::Property1_typeof(); options.FieldCount = 2; options.ObjectSize = sizeof(HSMRO_FuseControlsControl_Background_Property); options.TypeSize = sizeof(::g::Uno::UX::Property1_type); type = (::g::Uno::UX::Property1_type*)uClassType::New("HSMRO_FuseControlsControl_Background_Property", options); type->fp_build_ = HSMRO_FuseControlsControl_Background_Property_build; type->fp_Get1 = (void(*)(::g::Uno::UX::Property1*, ::g::Uno::UX::PropertyObject*, uTRef))HSMRO_FuseControlsControl_Background_Property__Get1_fn; type->fp_get_Object = (void(*)(::g::Uno::UX::Property*, ::g::Uno::UX::PropertyObject**))HSMRO_FuseControlsControl_Background_Property__get_Object_fn; type->fp_Set1 = (void(*)(::g::Uno::UX::Property1*, ::g::Uno::UX::PropertyObject*, void*, uObject*))HSMRO_FuseControlsControl_Background_Property__Set1_fn; return type; } // public HSMRO_FuseControlsControl_Background_Property(Fuse.Controls.Control obj, Uno.UX.Selector name) void HSMRO_FuseControlsControl_Background_Property__ctor_3_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector* name) { __this->ctor_3(obj, *name); } // public override sealed Fuse.Drawing.Brush Get(Uno.UX.PropertyObject obj) void HSMRO_FuseControlsControl_Background_Property__Get1_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Uno::UX::PropertyObject* obj, ::g::Fuse::Drawing::Brush** __retval) { uStackFrame __("HSMRO_FuseControlsControl_Background_Property", "Get(Uno.UX.PropertyObject)"); return *__retval = uPtr(uCast< ::g::Fuse::Controls::Control*>(obj, ::TYPES[0/*Fuse.Controls.Control*/]))->Background(), void(); } // public HSMRO_FuseControlsControl_Background_Property New(Fuse.Controls.Control obj, Uno.UX.Selector name) void HSMRO_FuseControlsControl_Background_Property__New1_fn(::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector* name, HSMRO_FuseControlsControl_Background_Property** __retval) { *__retval = HSMRO_FuseControlsControl_Background_Property::New1(obj, *name); } // public override sealed Uno.UX.PropertyObject get_Object() void HSMRO_FuseControlsControl_Background_Property__get_Object_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Uno::UX::PropertyObject** __retval) { return *__retval = __this->_obj, void(); } // public override sealed void Set(Uno.UX.PropertyObject obj, Fuse.Drawing.Brush v, Uno.UX.IPropertyListener origin) void HSMRO_FuseControlsControl_Background_Property__Set1_fn(HSMRO_FuseControlsControl_Background_Property* __this, ::g::Uno::UX::PropertyObject* obj, ::g::Fuse::Drawing::Brush* v, uObject* origin) { uStackFrame __("HSMRO_FuseControlsControl_Background_Property", "Set(Uno.UX.PropertyObject,Fuse.Drawing.Brush,Uno.UX.IPropertyListener)"); uPtr(uCast< ::g::Fuse::Controls::Control*>(obj, ::TYPES[0/*Fuse.Controls.Control*/]))->Background(v); } // public HSMRO_FuseControlsControl_Background_Property(Fuse.Controls.Control obj, Uno.UX.Selector name) [instance] void HSMRO_FuseControlsControl_Background_Property::ctor_3(::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector name) { ctor_2(name); _obj = obj; } // public HSMRO_FuseControlsControl_Background_Property New(Fuse.Controls.Control obj, Uno.UX.Selector name) [static] HSMRO_FuseControlsControl_Background_Property* HSMRO_FuseControlsControl_Background_Property::New1(::g::Fuse::Controls::Control* obj, ::g::Uno::UX::Selector name) { HSMRO_FuseControlsControl_Background_Property* obj1 = (HSMRO_FuseControlsControl_Background_Property*)uNew(HSMRO_FuseControlsControl_Background_Property_typeof()); obj1->ctor_3(obj, name); return obj1; } // } } // ::g
[ "sommelier0052@gmail.com" ]
sommelier0052@gmail.com
f9874f8ccf40dcb5c1b81242bebf0444488c0bb1
feff5dadc85629c0947abf87a79f86ace8c84539
/atcoder/abc256/F.cpp
afba99011943b06a1c6ca8e3de8c6ea5b07fbab7
[]
no_license
Redleaf23477/ojcodes
af7582d9de8619509fa4ffa5338b2a59d9176608
7ee3053a88a78f74764bc473b3bd4887ceac6734
refs/heads/master
2023-08-13T22:34:58.000532
2023-08-10T15:54:05
2023-08-10T15:54:05
107,507,680
0
0
null
null
null
null
UTF-8
C++
false
false
1,865
cpp
#include <bits/stdc++.h> using namespace std; using LL = long long int; constexpr LL MOD = 998244353; LL fastpw(LL x, LL p) { LL ans = 1; while (p > 0) { if (p % 2 == 1) ans = ans * x % MOD; x = x * x % MOD; p /= 2; } return ans; } struct BIT { int n; vector<LL> bit; int lowbit(int x) { return x & (-x); } BIT(int _n) : n(_n), bit(n + 1, 0) {} void add(int pos, LL val) { for (; pos <= n; pos += lowbit(pos)) { bit[pos] = (bit[pos] + val) % MOD; } } LL sum(LL pos) { LL ans = 0; for (; pos > 0; pos -= lowbit(pos)) { ans = (ans + bit[pos]) % MOD; } return ans; } }; void solve() { int N, Q; cin >> N >> Q; vector<LL> A(N); for (auto &x : A) cin >> x; BIT zero(N), one(N), two(N); for (LL i = 1; i <= N; i++) { zero.add(i, A[i - 1]); one.add(i, i * A[i - 1] % MOD); two.add(i, i * i % MOD * A[i - 1] % MOD); } LL inv2 = fastpw(2, MOD - 2); while (Q--) { int op; cin >> op; if (op == 1) { LL x; cin >> x; LL val; cin >> val; val %= MOD; val = (val - A[x - 1] + MOD) % MOD; A[x - 1] = (A[x - 1] + val) % MOD; zero.add(x, val); one.add(x, x * val % MOD); two.add(x, x * x % MOD * val % MOD); } else { LL x; cin >> x; LL ans = (x + 2) % MOD * (x + 1) % MOD * inv2 % MOD * zero.sum(x) % MOD; ans = (ans + (-3 - 2 * x + MOD) % MOD * inv2 % MOD * one.sum(x) % MOD) % MOD; ans = (ans + inv2 * two.sum(x) % MOD) % MOD; cout << ans << "\n"; } } } int main() { ios::sync_with_stdio(false); cin.tie(0); // int T; cin >> T; int T = 1; while (T--) { solve(); } }
[ "schpokeool@gmail.com" ]
schpokeool@gmail.com
492b642e0e45b1b5dc35a10f4dbcba857d5b0cd4
bd3630cebd53befb1c5ba3f4281eff3f4503b991
/VS 2019/Arduino/simple/simple.ino
2a2a9dad2cf155bc4c665ef3b4ea4925260d29f8
[]
no_license
YeungShaoFeng/FIlesBackUps
e4dd3d9082049c1caa913a3c11c9e94955d4720c
9d1b10fdfe3a6acc0a1aad082127f431e718dd9b
refs/heads/master
2020-09-07T12:34:24.159158
2019-11-22T01:37:59
2019-11-22T01:37:59
220,781,495
0
0
null
null
null
null
UTF-8
C++
false
false
207
ino
int value = 0; void setup() { Serial.begin(115200); pinMode(PB0, INPUT_ANALOG); pinMode(PB1, OUTPUT); } void loop() { value = analogRead(PB0); Serial.println(value); delay(300); }
[ "2013114698@qq.com" ]
2013114698@qq.com
ca72775b59aef895283808d82c4b1905e0a8ee66
165b2de352f01137bf108f6ca37b3753b10348f8
/release/moc_renderwindow.cpp
3292251436a6355f2e4f0e13d5ea395fc49b86ff
[]
no_license
ASnow/renderer
9badeb379900b9b2e4d6d0c212b9e66fa43925a4
221c19e98de2673a964a091f6cec337a09d7d391
refs/heads/master
2016-09-03T00:36:31.756799
2011-01-19T16:07:30
2011-01-19T16:07:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,838
cpp
/**************************************************************************** ** Meta object code from reading C++ file 'renderwindow.h' ** ** Created: Wed 19. Jan 15:44:30 2011 ** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../../Raytracer/renderwindow.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'renderwindow.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 62 #error "This file was generated using the moc from 4.7.0. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_RenderWindow[] = { // content: 5, // revision 0, // classname 0, 0, // classinfo 5, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 14, 13, 13, 13, 0x0a, 21, 13, 13, 13, 0x0a, 30, 13, 13, 13, 0x0a, 46, 38, 13, 13, 0x0a, 81, 75, 13, 13, 0x0a, 0 // eod }; static const char qt_meta_stringdata_RenderWindow[] = { "RenderWindow\0\0exit()\0render()\0about()\0" "partial\0displayPartialImage(QImage*)\0" "final\0renderingFinished(QImage*)\0" }; const QMetaObject RenderWindow::staticMetaObject = { { &QMainWindow::staticMetaObject, qt_meta_stringdata_RenderWindow, qt_meta_data_RenderWindow, 0 } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &RenderWindow::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *RenderWindow::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *RenderWindow::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_RenderWindow)) return static_cast<void*>(const_cast< RenderWindow*>(this)); return QMainWindow::qt_metacast(_clname); } int RenderWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: exit(); break; case 1: render(); break; case 2: about(); break; case 3: displayPartialImage((*reinterpret_cast< QImage*(*)>(_a[1]))); break; case 4: renderingFinished((*reinterpret_cast< QImage*(*)>(_a[1]))); break; default: ; } _id -= 5; } return _id; } QT_END_MOC_NAMESPACE
[ "asnow.dev@gmail.com" ]
asnow.dev@gmail.com
c8839a2c8d72426d766dceee6e57bf436ba87acd
9da6ffc55ba8a19192bd0efad09657758de4e792
/1152.D. Neko and Aki's Prank.cpp
1544eb7b0e929b30c15e95e14ea72be3e95831ea
[]
no_license
fsq/codeforces
b771cb33c67fb34168c8ee0533a67f16673f9057
58f3b66439457a7368bb40af38ceaf89b9275b36
refs/heads/master
2021-05-11T03:12:27.130277
2020-10-16T16:55:03
2020-10-16T16:55:03
117,908,849
0
0
null
null
null
null
UTF-8
C++
false
false
1,010
cpp
#include "stdc++.h" int n; const int M = 1e9 + 7; int f[2][2003][2003]; int v[2][2003][2003]; int dp(int vis, int i, int s) { if (s < 0 || s > n-i) return -1; if (v[vis][i][s]) return f[vis][i][s]; v[vis][i][s] = true; int& ans = f[vis][i][s]; if (i == n) { ans = 0; } else { if (vis) { int fl = dp(0, i+1, s+1), fr = dp(0, i+1, s-1); if (fl==-1 && fr==-1) ans = -1; else if (fl==-1 || fr==-1) ans = max(fl, fr); else ans = (fl + fr) % M; } else { FOR(x, 2) FOR(y, 2) if (!(x && y)) { int fl = dp(x, i+1, s+1), fr = dp(y, i+1, s-1), now = 0; if (fl==-1 && fr==-1) now = -1; else if (fl==-1 || fr==-1) now = max(fl, fr); else now = (fl + fr) % M; ans = max(ans, now); } } } if (ans != -1) ans += vis; return ans; } int main() { cin >> n; n <<= 1; MEMSET0(v); auto ans = dp(0, 0, 0); cout << ans << endl; return 0; }
[ "19474@qq.com" ]
19474@qq.com
1871f38b043af34c9fef670121afc7b24a5e0c57
364c1dd1855c4fa0a969ff1d0c9974be9c2f5271
/CoopGame/Source/CoopGame/Private/SPlayerState.cpp
91b31373a50d47f3d8dddb0d36b4cd8c0ed68615
[ "MIT" ]
permissive
DavidConsidine/CoopGame
070099ee3bf27f6f349d720f598e30db2165507f
429f701e208263f1e531bd8057a7ff437766ce6d
refs/heads/master
2021-03-30T17:35:48.223313
2018-05-15T13:21:37
2018-05-15T13:21:37
117,843,191
0
0
null
null
null
null
UTF-8
C++
false
false
182
cpp
// Fill out your copyright notice in the Description page of Project Settings. #include "SPlayerState.h" void ASPlayerState::AddScore(float DeltaScore) { Score += DeltaScore; }
[ "dmconsie@gmail.com" ]
dmconsie@gmail.com
63112593eda14daa8418a57797897735bb3a602a
536656cd89e4fa3a92b5dcab28657d60d1d244bd
/third_party/blink/renderer/modules/background_fetch/background_fetch_record.cc
2b90ccf72dd7ed34ed79c43fb28fa52f23d13511
[ "LGPL-2.0-or-later", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-only", "GPL-1.0-or-later", "GPL-2.0-only", "LGPL-2.0-only", "BSD-2-Clause", "LicenseRef-scancode-other-copyleft", "MIT", "Apache-2.0", "BSD-3-Clause" ]
permissive
ECS-251-W2020/chromium
79caebf50443f297557d9510620bf8d44a68399a
ac814e85cb870a6b569e184c7a60a70ff3cb19f9
refs/heads/master
2022-08-19T17:42:46.887573
2020-03-18T06:08:44
2020-03-18T06:08:44
248,141,336
7
8
BSD-3-Clause
2022-07-06T20:32:48
2020-03-18T04:52:18
null
UTF-8
C++
false
false
3,688
cc
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "third_party/blink/renderer/modules/background_fetch/background_fetch_record.h" #include "third_party/blink/renderer/core/fetch/request.h" #include "third_party/blink/renderer/core/fetch/response.h" #include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/heap/heap.h" namespace blink { BackgroundFetchRecord::BackgroundFetchRecord(Request* request, ScriptState* script_state) : request_(request), script_state_(script_state) { DCHECK(request_); DCHECK(script_state_); response_ready_property_ = MakeGarbageCollected<ResponseReadyProperty>( ExecutionContext::From(script_state)); } BackgroundFetchRecord::~BackgroundFetchRecord() = default; void BackgroundFetchRecord::ResolveResponseReadyProperty(Response* response) { if (response_ready_property_->GetState() != ResponseReadyProperty::State::kPending) { return; } switch (record_state_) { case State::kPending: return; case State::kAborted: response_ready_property_->Reject(MakeGarbageCollected<DOMException>( DOMExceptionCode::kAbortError, "The fetch was aborted before the record was processed.")); return; case State::kSettled: if (response) { response_ready_property_->Resolve(response); return; } if (!script_state_->ContextIsValid()) return; // TODO(crbug.com/875201): Per https://wicg.github.io/background-fetch/ // #background-fetch-response-exposed, this should be resolved with a // TypeError. Figure out a way to do so. // Rejecting this with a TypeError here doesn't work because the // RejectedType is a DOMException. Update this with the correct error // once confirmed, or change the RejectedType. response_ready_property_->Reject(MakeGarbageCollected<DOMException>( DOMExceptionCode::kUnknownError, "The response is not available.")); } } ScriptPromise BackgroundFetchRecord::responseReady(ScriptState* script_state) { return response_ready_property_->Promise(script_state->World()); } Request* BackgroundFetchRecord::request() const { return request_; } void BackgroundFetchRecord::UpdateState( BackgroundFetchRecord::State updated_state) { DCHECK_EQ(record_state_, State::kPending); if (!script_state_->ContextIsValid()) return; record_state_ = updated_state; ResolveResponseReadyProperty(/* updated_response = */ nullptr); } void BackgroundFetchRecord::SetResponseAndUpdateState( mojom::blink::FetchAPIResponsePtr& response) { DCHECK(record_state_ == State::kPending); DCHECK(!response.is_null()); if (!script_state_->ContextIsValid()) return; record_state_ = State::kSettled; ScriptState::Scope scope(script_state_); ResolveResponseReadyProperty(Response::Create(script_state_, *response)); } bool BackgroundFetchRecord::IsRecordPending() { return record_state_ == State::kPending; } void BackgroundFetchRecord::OnRequestCompleted( mojom::blink::FetchAPIResponsePtr response) { if (!response.is_null()) SetResponseAndUpdateState(response); else UpdateState(State::kSettled); } const KURL& BackgroundFetchRecord::ObservedUrl() const { return request_->url(); } void BackgroundFetchRecord::Trace(Visitor* visitor) { visitor->Trace(request_); visitor->Trace(response_ready_property_); visitor->Trace(script_state_); ScriptWrappable::Trace(visitor); } } // namespace blink
[ "pcding@ucdavis.edu" ]
pcding@ucdavis.edu
c92c037f40c5b192a89f583c30cc5ac49aed0012
2836cce07d048ed1fc9f1bd53a958df3681112c6
/Triditizer/logging.cpp
2ca65f75be0fdc5272ae2739780fcfbed7ee080d
[ "MIT" ]
permissive
samaust/Triditizer
08ad4b19c4912f669fcd8f4876952856c6f7f53a
bd0a5aa7369be9b80a72d90890e97dc488575a58
refs/heads/master
2020-12-31T07:55:47.688623
2016-02-21T04:01:16
2016-02-21T04:01:16
52,189,743
0
0
null
null
null
null
UTF-8
C++
false
false
729
cpp
#include <windows.h> #include <iostream> #include <fstream> #include <string> #include <stdio.h> #include "logging.h" va_list va_alist; std::ofstream ofile; static bool logOpened = false; void __cdecl open_log(void) { if (!logOpened) { logOpened = true; static char dir[] = "C:\\StereoScreenshots\\stereoLog.txt"; // hardcoded path ofile.open(dir, std::ios::app); } } void __cdecl add_log(const char *fmt, ...) { char logbuf[50000] = { 0 }; if (!fmt) { return; } va_start(va_alist, fmt); _vsnprintf(logbuf + strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist); va_end(va_alist); if (ofile) { ofile << logbuf << std::endl; } } void __cdecl close_log(void) { if (ofile) { ofile.close(); } }
[ "samaust@hotmail.com" ]
samaust@hotmail.com
e4680c51e08dfc59af4c1c41967cf3de0175748f
dc2e0d49f99951bc40e323fb92ea4ddd5d9644a0
/SDK/ThirdLibrary/include/activemq-cpp/decaf/lang/Byte.h
1b775df4d85fd4baf460c2d706699e116f9d6f79
[]
no_license
wenyu826/CecilySolution
8696290d1723fdfe6e41ce63e07c7c25a9295ded
14c4ba9adbb937d0ae236040b2752e2c7337b048
refs/heads/master
2020-07-03T06:26:07.875201
2016-11-19T07:04:29
2016-11-19T07:04:29
74,192,785
0
1
null
null
null
null
UTF-8
C++
false
false
12,122
h
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _DECAF_LANG_BYTE_H_ #define _DECAF_LANG_BYTE_H_ #include <decaf/util/Config.h> #include <decaf/lang/Number.h> #include <decaf/lang/Comparable.h> #include <decaf/lang/exceptions/NumberFormatException.h> #include <string> namespace decaf{ namespace lang{ class DECAF_API Byte : public Number, public Comparable<Byte>, public Comparable<unsigned char> { private: unsigned char value; public: /** The minimum value that a unsigned char can take on. */ static const unsigned char MIN_VALUE; /** The maximum value that a unsigned char can take on. */ static const unsigned char MAX_VALUE; /** The size of the primitive character in bits. */ static const int SIZE; public: /** * @param value - the primitive value to wrap */ Byte(unsigned char value); /** * Creates a new Byte instance from the given string. * * @param value * The string to convert to an unsigned char * * @throws NumberFormatException if the string is not a valid byte. */ Byte(const std::string& value); virtual ~Byte() {} /** * Compares this Byte instance with another. * @param c - the Byte instance to be compared * @return zero if this object represents the same char value as the * argument; a positive value if this object represents a value greater * than the passed in value, and -1 if this object repesents a value * less than the passed in value. */ virtual int compareTo(const Byte& c) const { return this->value < c.value ? -1 : (this->value > c.value) ? 1 : 0; } /** * Compares equality between this object and the one passed. * @param c - the value to be compared to this one. * @return true if this object is equal to the one passed. */ virtual bool operator==(const Byte& c) const { return this->value == c.value; } /** * Compares this object to another and returns true if this object * is considered to be less than the one passed. This * @param c - the value to be compared to this one. * @return true if this object is equal to the one passed. */ virtual bool operator<(const Byte& c) const { return this->value < c.value; } /** * Compares this Byte instance with a char type. * @param c - the char instance to be compared * @return zero if this object represents the same char value as the * argument; a positive value if this object represents a value greater * than the passed in value, and -1 if this object repesents a value * less than the passed in value. */ virtual int compareTo(const unsigned char& c) const { return this->value < c ? -1 : (this->value > c) ? 1 : 0; } /** * Compares equality between this object and the one passed. * @param c - the value to be compared to this one. * @return true if this object is equal to the one passed. */ virtual bool operator==(const unsigned char& c) const { return this->value == c; } /** * Compares this object to another and returns true if this object * is considered to be less than the one passed. This * @param c - the value to be compared to this one. * @return true if this object is equal to the one passed. */ virtual bool operator<(const unsigned char& c) const { return this->value < c; } /** * @returns true if the two Byte Objects have the same value. */ bool equals(const Byte& c) const { return this->value == c.value; } /** * @returns true if the two Bytes have the same value. */ bool equals(const unsigned char& c) const { return this->value == c; } /** * @returns this Byte Object as a String Representation */ std::string toString() const; /** * Answers the double value which the receiver represents * @return double the value of the receiver. */ virtual double doubleValue() const { return (double) this->value; } /** * Answers the float value which the receiver represents * @return float the value of the receiver. */ virtual float floatValue() const { return (float) this->value; } /** * Answers the byte value which the receiver represents * @return byte the value of the receiver. */ virtual unsigned char byteValue() const { return this->value; } /** * Answers the short value which the receiver represents * @return short the value of the receiver. */ virtual short shortValue() const { return (short) this->value; } /** * Answers the int value which the receiver represents * @return int the value of the receiver. */ virtual int intValue() const { return (int) this->value; } /** * Answers the long value which the receiver represents * @return long long the value of the receiver. */ virtual long long longValue() const { return (long long) this->value; } public: // statics /** * @returns a string representing the primitive value as Base 10 */ static std::string toString(unsigned char value); /** * Decodes a String into a Byte. Accepts decimal, hexadecimal, and octal * numbers given by the following grammar: * * The sequence of characters following an (optional) negative sign and/or * radix specifier ("0x", "0X", "#", or leading zero) is parsed as by the * Byte::parseByte method with the indicated radix (10, 16, or 8). This * sequence of characters must represent a positive value or a * NumberFormatException will be thrown. The result is negated if first * character of the specified String is the minus sign. No whitespace * characters are permitted in the string. * @param value - The string to decode * @returns a Byte object containing the decoded value * @throws NumberFomatException if the string is not formatted correctly. */ static Byte decode(const std::string& value); /** * Parses the string argument as a signed unsigned char in the radix specified by * the second argument. The characters in the string must all be digits, * of the specified radix (as determined by whether * Character.digit(char, int) returns a nonnegative value) except that the * first character may be an ASCII minus sign '-' to indicate * a negative value. The resulting byte value is returned. * * An exception of type NumberFormatException is thrown if any of the * following situations occurs: * * The first argument is null or is a string of length zero. * * The radix is either smaller than Character.MIN_RADIX or larger than * Character::MAX_RADIX. * * Any character of the string is not a digit of the specified radix, * except that the first character may be a minus sign '-' provided * that the string is longer than length 1. * * The value represented by the string is not a value of type unsigned char. * * @param s - the String containing the unsigned char to be parsed * @param radix - the radix to be used while parsing s * @return the unsigned char represented by the string argument in the * specified radix. * @throws NumberFormatException - If String does not contain a parsable * unsigned char. */ static unsigned char parseByte(const std::string& s, int radix); /** * Parses the string argument as a signed decimal unsigned char. The * characters in the string must all be decimal digits, except that the * first character may be an ASCII minus sign '-' to indicate a * negative value. The resulting unsigned char value is returned, exactly as * if the argument and the radix 10 were given as arguments to the * parseByte( const std::string, int ) method. * @param s - String to convert to a unsigned char * @returns the converted unsigned char value * @throws NumberFormatException if the string is not a unsigned char. */ static unsigned char parseByte(const std::string& s); /** * Returns a Character instance representing the specified char value. * @param value - the primitive char to wrap. * @returns a new Character instance that wraps this value. */ static Byte valueOf(unsigned char value) { return Byte(value); } /** * Returns a Byte object holding the value given by the specified std::string. * The argument is interpreted as representing a signed decimal unsigned char, * exactly as if the argument were given to the parseByte( std::string ) * method. The result is a Byte object that represents the unsigned char value * specified by the string. * @param value - std::string to parse as base 10 * @return new Byte Object wrapping the primitive * @throws NumberFormatException if the string is not a decimal unsigned char. */ static Byte valueOf(const std::string& value); /** * Returns a Byte object holding the value extracted from the specified * std::string when parsed with the radix given by the second argument. * The first argument is interpreted as representing a signed unsigned char * in the radix specified by the second argument, exactly as if the argument * were given to the parseByte( std::string, int ) method. The result is a * Byte object that represents the unsigned char value specified by the * string. * @param value - std::string to parse as base ( radix ) * @param radix - base of the string to parse. * @return new Byte Object wrapping the primitive * @throws NumberFormatException if the string is not a valid unsigned char. */ static Byte valueOf(const std::string& value, int radix); }; }} #endif /*_DECAF_LANG_BYTE_H_*/
[ "626955115@qq.com" ]
626955115@qq.com
7bca95f543354b8374d6395548551d7e9a9e2cd5
6828a93fe5c060e37a9c26d65ea3bf54837e4005
/public/public_pushbuton_number.h
7ad781dc8e27a1267f7b4a816eea8ab470089cfd
[]
no_license
blockspacer/fastfd20200204
76d87687ef7aeff174f53e03ad52734df3d5dfff
63d758b0962f3d2ebe9ecb10e0b26c79469eace4
refs/heads/master
2022-04-07T07:19:59.865293
2020-02-04T02:34:21
2020-02-04T02:34:21
null
0
0
null
null
null
null
UTF-8
C++
false
false
603
h
#ifndef PUBLIC_PUSHBUTON_NUMBER_H #define PUBLIC_PUSHBUTON_NUMBER_H #include <QPushButton> class public_pushbuton_number : public QPushButton { Q_OBJECT public: public_pushbuton_number(QWidget *parent); void setNumber(double num); double number(); void setNumber(const QString &desc); QString numberStr(); void setText(const QString &text); QString text() const; void setSuffix(const QString &suffix); protected: void paintEvent(QPaintEvent *e); private: QString _numberStr; QString _text; QString _suffix; }; #endif // PUBLIC_PUSHBUTON_NUMBER_H
[ "ch593030323@gmail.com" ]
ch593030323@gmail.com
f0e5449999620639d45bced63fa20631fb49ca08
1bf8b46afad5402fe6fa74293b464e1ca5ee5fd7
/SDK/BP_Hakkason_leadShe_functions.cpp
468fd7991d5286b0564fed8be90525b71855ccf6
[]
no_license
LemonHaze420/ShenmueIIISDK
a4857eebefc7e66dba9f667efa43301c5efcdb62
47a433b5e94f171bbf5256e3ff4471dcec2c7d7e
refs/heads/master
2021-06-30T17:33:06.034662
2021-01-19T20:33:33
2021-01-19T20:33:33
214,824,713
4
0
null
null
null
null
UTF-8
C++
false
false
7,044
cpp
#include "../SDK.h" // Name: Shenmue3, Version: 1.0.2 #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace SDK { //--------------------------------------------------------------------------- // Functions //--------------------------------------------------------------------------- // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.CheckLoadSartShe // (Net, NetMulticast, MulticastDelegate, Private, Protected, Delegate, HasOutParms, NetClient, BlueprintPure) // Parameters: // bool is_load (Parm, OutParm, ZeroConstructor, IsPlainOldData) // struct FVector SheLocation (Parm, OutParm, IsPlainOldData) // struct FRotator SheRotation (Parm, OutParm, IsPlainOldData) void ABP_Hakkason_leadShe_C::CheckLoadSartShe(bool* is_load, struct FVector* SheLocation, struct FRotator* SheRotation) { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.CheckLoadSartShe"); ABP_Hakkason_leadShe_C_CheckLoadSartShe_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; if (is_load != nullptr) *is_load = params.is_load; if (SheLocation != nullptr) *SheLocation = params.SheLocation; if (SheRotation != nullptr) *SheRotation = params.SheRotation; } // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.InitSet // (Net, NetRequest, Exec, Static, Private, Protected, Delegate, NetClient, DLLImport) // Parameters: // struct FDataTableRowHandle EventId (BlueprintVisible, BlueprintReadOnly, Parm) // int UseFlagID (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) // bool LoadStart (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) void ABP_Hakkason_leadShe_C::STATIC_InitSet(const struct FDataTableRowHandle& EventId, int UseFlagID, bool LoadStart) { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.InitSet"); ABP_Hakkason_leadShe_C_InitSet_Params params; params.EventId = EventId; params.UseFlagID = UseFlagID; params.LoadStart = LoadStart; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.UserConstructionScript // (Net, Exec, Native, NetResponse, NetMulticast, Public, Protected, Delegate, NetClient, BlueprintCallable) void ABP_Hakkason_leadShe_C::UserConstructionScript() { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.UserConstructionScript"); ABP_Hakkason_leadShe_C_UserConstructionScript_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ReceiveTick // (NetRequest, Exec, Event, NetResponse, Static, NetMulticast, Public, Private, Delegate, NetServer, HasOutParms, HasDefaults, DLLImport, BlueprintCallable, BlueprintEvent) // Parameters: // float DeltaSeconds (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) void ABP_Hakkason_leadShe_C::STATIC_ReceiveTick(float DeltaSeconds) { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ReceiveTick"); ABP_Hakkason_leadShe_C_ReceiveTick_Params params; params.DeltaSeconds = DeltaSeconds; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.RenewalActorCount // (NetReliable, NetRequest, Exec, Native, Public, Private, HasOutParms, NetClient, DLLImport) // Parameters: // TEnumAsByte<EN_MainFlowActorID> ActorId (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) // unsigned char RenewalCounter (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) void ABP_Hakkason_leadShe_C::RenewalActorCount(TEnumAsByte<EN_MainFlowActorID> ActorId, unsigned char RenewalCounter) { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.RenewalActorCount"); ABP_Hakkason_leadShe_C_RenewalActorCount_Params params; params.ActorId = ActorId; params.RenewalCounter = RenewalCounter; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.KillSheLead // (Net, NetRequest, Static, NetMulticast, MulticastDelegate, Public, Private, Protected, Delegate, HasOutParms, HasDefaults, DLLImport, BlueprintEvent, BlueprintPure) void ABP_Hakkason_leadShe_C::STATIC_KillSheLead() { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.KillSheLead"); ABP_Hakkason_leadShe_C_KillSheLead_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.StartLeadSHE_Macro // (Net, NetReliable, Exec, Event, NetResponse, Static, NetMulticast, Public, Private, Delegate, NetServer, HasOutParms, HasDefaults, DLLImport, BlueprintCallable, BlueprintEvent) // Parameters: // bool LoadStart (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) void ABP_Hakkason_leadShe_C::STATIC_StartLeadSHE_Macro(bool LoadStart) { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.StartLeadSHE_Macro"); ABP_Hakkason_leadShe_C_StartLeadSHE_Macro_Params params; params.LoadStart = LoadStart; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ExecuteUbergraph_BP_Hakkason_leadShe // (NetReliable, NetRequest, Native, NetResponse, Static, Private, Protected, NetServer, HasOutParms, HasDefaults, NetClient, DLLImport, BlueprintEvent, BlueprintPure, Const) // Parameters: // int EntryPoint (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) void ABP_Hakkason_leadShe_C::STATIC_ExecuteUbergraph_BP_Hakkason_leadShe(int EntryPoint) { static auto fn = UObject::FindObject<UFunction>("Function BP_Hakkason_leadShe.BP_Hakkason_leadShe_C.ExecuteUbergraph_BP_Hakkason_leadShe"); ABP_Hakkason_leadShe_C_ExecuteUbergraph_BP_Hakkason_leadShe_Params params; params.EntryPoint = EntryPoint; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "35783139+LemonHaze420@users.noreply.github.com" ]
35783139+LemonHaze420@users.noreply.github.com
12a55499c0d2a4d3f2d6ffda5c00713fa69fc8fd
1dd0195040028e2e8496d4b68bb60ef838dc5c76
/proxy/epoll_queue/timer_fd.cpp
1d66daf5ea8479e051ccc29f3c8bab5c766baf66
[]
no_license
CawaEast/proxi
dc0ea1e79b59abf63a749093aa147622c1161cc2
ef967652a72c24741ae4ed90aa10b7be9a5e30eb
refs/heads/master
2021-07-13T09:18:49.530096
2017-10-14T14:45:11
2017-10-14T14:45:11
106,099,935
0
0
null
null
null
null
UTF-8
C++
false
false
1,320
cpp
#include "timer_fd.h" #include "../util/annotated_exception.h" #include <sys/timerfd.h> timer_fd::timer_fd() : file_descriptor() { } timer_fd::timer_fd(clock_mode cmode, fd_mode mode) : timer_fd(cmode, {mode}) { } timer_fd::timer_fd(clock_mode cmode, std::initializer_list<fd_mode> mode) { int clock_mode = (cmode == MONOTONIC) ? CLOCK_MONOTONIC : CLOCK_REALTIME; if ((fd = timerfd_create(clock_mode, value_of(mode))) == -1) { int err = errno; throw annotated_exception("timerfd", err); } } void timer_fd::set_interval(long interval_sec, long start_after_sec) const { itimerspec spec; memset(&spec, 0, sizeof spec); spec.it_value.tv_sec = start_after_sec; spec.it_interval.tv_sec = interval_sec; if (timerfd_settime(fd, 0, &spec, 0) == -1) { int err = errno; throw annotated_exception("timerfd", err); } } int timer_fd::value_of(std::initializer_list<fd_mode> mode) { int res = 0; for (auto it = mode.begin(); it != mode.end(); it++) { switch (*it) { case NONBLOCK: res |= TFD_NONBLOCK; break; case CLOEXEC: res |= TFD_CLOEXEC; break; case SIMPLE: res |= 0; break; } } return res; }
[ "777.777.1234@mail.ru" ]
777.777.1234@mail.ru
cb5b392c6c228bcdd33b085dcca734ed29a8d960
4a905d68030de1c8efd41fd580e99dcad360ffe1
/DCC practice contest 2/jaam.cpp
414e5a971d6ef56de8df003401082288a246cbd7
[]
no_license
AliAkberAakash/_CONTESTS_
e687d80c7a69fdb134be08f1755e1dd93c6292c1
e9fe96eda38dd107bdd025d955d69e4fe789704b
refs/heads/master
2021-01-22T22:56:51.355883
2018-05-01T19:31:41
2018-05-01T19:31:41
85,589,590
0
0
null
null
null
null
UTF-8
C++
false
false
263
cpp
#include<stdio.h> #include<math.h> #define pi 2*acos (0.0) int main() { int i,t; double r, a; scanf("%d", &t); for(i=1; i<=t; i++) { scanf("%lf", &r); a=(4*r*r)-(pi*r*r); printf("Case %d: %.lf\n", i, a); } }
[ "cedward318@gmail.com" ]
cedward318@gmail.com
dcb9b6e268e5213956e8580e69fdf68d5339099d
7f439919fb8c3a8bbd0111f91217f3fd8668d262
/Projects/AILib/Genetics/Genetics_3_0/TestGenetics/Source/CommandLineOptions.h
f4c95449e8b2284f6746a482d974d274916b72d6
[]
no_license
quant-guy/Projects
459aa1e17e72057b1eef58c1926206686b32a78f
f50361dbfa9ee6e4d40cf99abf63edc6fc7e5308
refs/heads/master
2023-07-19T19:20:05.850481
2023-07-07T23:32:08
2023-07-07T23:32:08
48,806,322
0
0
null
null
null
null
UTF-8
C++
false
false
5,140
h
/////////////////////////////////////////////////////////////////////////////////// // COPYRIGHT 2015 Kovach Technologies, Inc. // 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. All advertising materials mentioning features or use of this software // must display the following acknowledgement: // This product includes software developed by the Kovach Technologies, LLC. // 4. Neither the name of the Kovach Technologies, LLC 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 Kovach Technologies, LLC 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 Kovach Technologies, LLC 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. // // AUTHOR : Daniel Kovach // DATE : 2015-12-30 10:19:06.739857 /////////////////////////////////////////////////////////////////////////////////// #include <CommandLineParser.hpp> using namespace Utility::CommandLineParser; using namespace std; struct CommandLineOptions { // instantiate parser CmdLine cmd; // testing modes SwitchArg GP_Constructor1; SwitchArg GP_Constructor2; SwitchArg GP_GetFirst; SwitchArg GP_GetSecond; SwitchArg GP_SetFirst; SwitchArg GP_SetSecond; SwitchArg GP_Swap; SwitchArg GG_Constructor1; SwitchArg GG_Constructor2; SwitchArg GG_Constructor3; SwitchArg GG_PutGenetic; SwitchArg GG_Mutate1; SwitchArg GG_Mutate2; SwitchArg GG_Ostream; SwitchArg GG_OutputMutate; SwitchArg GPA_Constructor1; SwitchArg GPA_Constructor2; SwitchArg GPA_Constructor3; SwitchArg GPA_Constructor4; SwitchArg GPA_Constructor5; SwitchArg GPA_Assignment; SwitchArg GPA_Perturb; SwitchArg GPA_Copy; SwitchArg GPA_Plus; SwitchArg Verbose; ValueArg<string> GeneticFilename; CommandLineOptions( void ) : cmd ( "TradingEngine", ' ', "0.1" ), GP_Constructor1 ( "", "GP_Constructor1", "Test GP_Constructor1", cmd, false ), GP_Constructor2 ( "", "GP_Constructor2", "Test GP_Constructor2", cmd, false ), GP_GetFirst ( "", "GP_GetFirst", "Test GP_GetFirst", cmd, false ), GP_GetSecond ( "", "GP_GetSecond", "Test GP_GetSecond", cmd, false ), GP_SetFirst ( "", "GP_SetFirst", "Test GP_SetFirst", cmd, false ), GP_SetSecond ( "", "GP_SetSecond", "Test GP_SetSecond", cmd, false ), GP_Swap ( "", "GP_Swap", "Test GP_Swap", cmd, false ), GG_Constructor1 ( "", "GG_Constructor1", "Test GG_Constructor1", cmd, false ), GG_Constructor2 ( "", "GG_Constructor2", "Test GG_Constructor2", cmd, false ), GG_Constructor3 ( "", "GG_Constructor3", "Test GG_Constructor3", cmd, false ), GG_PutGenetic ( "", "GG_PutGenetic", "Test GG_PutGenetic", cmd, false ), GG_Mutate1 ( "", "GG_Mutate1", "Test GG_Mutate1", cmd, false ), GG_Mutate2 ( "", "GG_Mutate2", "Test GG_Mutate2", cmd, false ), GG_Ostream ( "", "GG_Ostream", "Test GG_Ostream", cmd, false ), GG_OutputMutate ( "", "GG_OutputMutate", "Test GG_OutputMutate", cmd, false ), GPA_Constructor1 ( "", "GPA_Constructor1","Test GPA_Constructor1",cmd, false ), GPA_Constructor2 ( "", "GPA_Constructor2","Test GPA_Constructor2",cmd, false ), GPA_Constructor3 ( "", "GPA_Constructor3","Test GPA_Constructor3",cmd, false ), GPA_Constructor4 ( "", "GPA_Constructor4","Test GPA_Constructor4",cmd, false ), GPA_Constructor5 ( "", "GPA_Constructor5","Test GPA_Constructor5",cmd, false ), GPA_Assignment ( "", "GPA_Assignment", "Test GPA_Assignment", cmd, false ), GPA_Perturb ( "", "GPA_Perturb", "Test GPA_Perturb", cmd, false ), GPA_Copy ( "", "GPA_Copy", "Test GPA_Copy", cmd, false ), GPA_Plus ( "", "GPA_Plus", "Test GPA_Plus", cmd, false ), Verbose ( "", "Verbose", "Toggle verbosity", cmd, false ), GeneticFilename ( "", "GeneticFilename", "Genetic input filename", false, "string", "string", cmd ) {} }; CommandLineOptions options;
[ "0xd3ad@0xd3ad.com" ]
0xd3ad@0xd3ad.com
7aecae623ed538c25bc02ff7d6aa9e1cdd2615c9
282cb2c13dc07b6632a0c7f2d54f80ba6454c7a6
/chapter5/5_22.cpp
6b3b857f230f2636ea0072a3d98392b151271c37
[]
no_license
YipengUva/cpp_primer_solutions
850c789ccb4e6038b1b683d54d47b8932b25e251
45fda2dde20cfa8054a3020467b8c4dc0de5fb6c
refs/heads/master
2020-05-31T23:16:29.283644
2019-11-13T10:52:30
2019-11-13T10:52:30
190,535,852
0
0
null
null
null
null
UTF-8
C++
false
false
362
cpp
#include <iostream> #include <vector> #include <assert.h> #include <string> using namespace std; int main(){ int sz; while(cin >> sz){ if (sz <= 0){ std::cout << "using positive input: "; continue; }else break; } std::cout << "input: " << sz << endl; return 0; }
[ "yipeng.song@hotmail.com" ]
yipeng.song@hotmail.com