text
stringlengths
4
6.14k
// ----------------------------------------------------------------------------- // Copyright 2012-2021 Patrick Näf (herzbube@herzbube.ch) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- /// @brief The BoardPositionModel class provides user defaults data to its /// clients that is related to board position viewing. // ----------------------------------------------------------------------------- @interface BoardPositionModel : NSObject { } - (id) init; - (void) readUserDefaults; - (void) writeUserDefaults; @property(nonatomic, assign) bool discardFutureMovesAlert; @property(nonatomic, assign) bool markNextMove; @property(nonatomic, assign) bool discardMyLastMove; @end
// Copyright (c) 2008, Google Inc. // All rights reserved. // // 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 following disclaimer. // * 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. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // 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. // --- // This file is a compatibility layer that defines Google's version of // command line flags that are used for configuration. // // We put flags into their own namespace. It is purposefully // named in an opaque way that people should have trouble typing // directly. The idea is that DEFINE puts the flag in the weird // namespace, and DECLARE imports the flag from there into the // current namespace. The net result is to force people to use // DECLARE to get access to a flag, rather than saying // extern bool FLAGS_logtostderr; // or some such instead. We want this so we can put extra // functionality (like sanity-checking) in DECLARE if we want, // and make sure it is picked up everywhere. // // We also put the type of the variable in the namespace, so that // people can't DECLARE_int32 something that they DEFINE_bool'd // elsewhere. #ifndef BASE_COMMANDLINEFLAGS_H__ #define BASE_COMMANDLINEFLAGS_H__ #include "glog-config.h" #include <string> #include <string.h> // for memchr #include <stdlib.h> // for getenv #ifdef HAVE_LIB_GFLAGS #include <gflags/gflags.h> #else #include "glog/logging.h" #define DECLARE_VARIABLE(type, name, tn) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name #define DEFINE_VARIABLE(type, name, value, meaning, tn) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ GOOGLE_GLOG_DLL_DECL type FLAGS_##name(value); \ char FLAGS_no##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name // bool specialization #define DECLARE_bool(name) \ DECLARE_VARIABLE(bool, name, bool) #define DEFINE_bool(name, value, meaning) \ DEFINE_VARIABLE(bool, name, EnvToBool("GLOG_" #name, value), meaning, bool) // int32 specialization #define DECLARE_int32(name) \ DECLARE_VARIABLE(GOOGLE_NAMESPACE::int32, name, int32) #define DEFINE_int32(name, value, meaning) \ DEFINE_VARIABLE(GOOGLE_NAMESPACE::int32, name, \ EnvToInt("GLOG_" #name, value), meaning, int32) // Special case for string, because we have to specify the namespace // std::string, which doesn't play nicely with our FLAG__namespace hackery. #define DECLARE_string(name) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ extern GOOGLE_GLOG_DLL_DECL std::string FLAGS_##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name #define DEFINE_string(name, value, meaning) \ namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ GOOGLE_GLOG_DLL_DECL std::string \ FLAGS_##name(EnvToString("GLOG_" #name, value)); \ char FLAGS_no##name; \ } \ using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name // These macros (could be functions, but I don't want to bother with a .cc // file), make it easier to initialize flags from the environment. #define EnvToString(envname, dflt) \ (!getenv(envname) ? (dflt) : getenv(envname)) #define EnvToBool(envname, dflt) \ (!getenv(envname) ? (dflt) : memchr("tTyY1\0", getenv(envname)[0], 6) != NULL) #define EnvToInt(envname, dflt) \ (!getenv(envname) ? (dflt) : strtol(getenv(envname), NULL, 10)) #endif // HAVE_LIB_GFLAGS #endif // BASE_COMMANDLINEFLAGS_H__
/** * Copyright 2017 BitTorrent Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <okui/config.h> #include <okui/views/TextView.h> #include <okui/views/ScrollView.h> #include <okui/View.h> #include <okui/Application.h> #include <okui/Color.h> #include <scraps/Timer.h> namespace okui::views { class TextField : public okui::View { public: struct SelectionRange { size_t index; size_t length; }; using Action = std::function<void()>; TextField(); /** * The change action is invoked any time the field's text is changed. */ void setChangeAction(Action action) { _changeAction = std::move(action); } /** * The blur action is invoked any time the field loses focus. */ void setBlurAction(Action action) { _blurAction = std::move(action); } /** * The return action is invoked any time the return key is hit while the field has focus. */ void setReturnAction(Action action) { _returnAction = std::move(action); } const std::string& text() const { return _text; } void setText(const std::string& text); void setColors(const Color& highlightColor, const Color& cursorColor); /** * If the text is concealed, all characters are displayed as dots or some other uniform character. */ void setConcealsText(bool concealsText = true); void setEnabled(bool enabled = true); bool isEnabled() const { return _isEnabled; } /** * Sets the padding for the text display. */ void setPadding(double padding) { setPadding(padding, padding, padding, padding); } void setPadding(double left, double right, double top, double bottom); TextView& textView() { return _textView; } void selectRange(size_t index, size_t length); SelectionRange selectionRange() const; /** * Implement this to render the text field. * * Your implementation should render a background that fills the view's bounds. */ virtual void render() override = 0; virtual void layout() override; virtual bool canBecomeDirectFocus() override { return _isEnabled; } virtual void focusGained() override; virtual void focusLost() override; virtual void mouseDown(MouseButton button, double x, double y) override; virtual void mouseDrag(double startX, double startY, double x, double y) override; virtual void mouseEnter() override; virtual void mouseExit() override; virtual void textInput(const std::string& text) override; virtual void keyDown(KeyCode key, KeyModifiers mod, bool repeat) override; virtual bool canHandleCommand(Command command) override; virtual void handleCommand(Command command, CommandContext context) override; private: struct SelectionHighlight : public okui::View { virtual void render() override; Color color = Color::kWhite.withAlphaF(0.35); }; struct Cursor : public okui::View { virtual void render() override; virtual void appeared() override { timer.restart(); } Color color = Color::kWhite; scraps::SteadyTimer timer; }; void _textChanged(bool invokeAction = true); void _moveCursor(size_t pos, bool dragging = false); void _updateTextLayout(); void _updateCursorLayout(); std::string _text; ScrollView _scrollView; TextView _textView; SelectionHighlight _selectionHighlight; Cursor _cursor; Action _returnAction; Action _blurAction; Action _changeAction; bool _concealsText = false; bool _isEnabled = true; double _paddingLeft{0.0}, _paddingRight{0.0}, _paddingTop{0.0}, _paddingBottom{0.0}; size_t _cursorIndex = 0; size_t _selectionStartIndex = 0; }; } // namespace okui::views
// // LQYSeeBigViewController.h // baisibudejie // // Created by shasha on 15/11/3. // Copyright © 2015年 shasha. All rights reserved. // #import <UIKit/UIKit.h> @class LQYTopic; @interface LQYSeeBigViewController : UIViewController @property (nonatomic, strong) LQYTopic *topic; /**< 模型 */ @end
/****************************************************************************** * Copyright 2019 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ /** * @file **/ #pragma once #include <memory> #include <vector> #include "Eigen/Eigen" #include "modules/common/configs/proto/vehicle_config.pb.h" #include "modules/common/math/vec2d.h" #include "modules/common/vehicle_state/proto/vehicle_state.pb.h" #include "modules/planning/common/trajectory/discretized_trajectory.h" #include "modules/planning/open_space/coarse_trajectory_generator/hybrid_a_star.h" #include "modules/planning/open_space/trajectory_smoother/distance_approach_problem.h" #include "modules/planning/open_space/trajectory_smoother/dual_variable_warm_start_problem.h" #include "modules/planning/proto/open_space_trajectory_provider_config.pb.h" namespace apollo { namespace planning { class OpenSpaceTrajectoryOptimizer { public: OpenSpaceTrajectoryOptimizer( const OpenSpaceTrajectoryOptimizerConfig& config); virtual ~OpenSpaceTrajectoryOptimizer() = default; common::Status Plan( const std::vector<common::TrajectoryPoint>& stitching_trajectory, const std::vector<double>& end_pose, const std::vector<double>& XYbounds, double rotate_angle, const common::math::Vec2d& translate_origin, const Eigen::MatrixXi& obstacles_edges_num, const Eigen::MatrixXd& obstacles_A, const Eigen::MatrixXd& obstacles_b, const std::vector<std::vector<common::math::Vec2d>>& obstacles_vertices_vec); void GetStitchingTrajectory( std::vector<common::TrajectoryPoint>* stitching_trajectory) { stitching_trajectory->clear(); *stitching_trajectory = stitching_trajectory_; } void GetOptimizedTrajectory(DiscretizedTrajectory* optimized_trajectory) { optimized_trajectory->clear(); *optimized_trajectory = optimized_trajectory_; } void RecordDebugInfo( const common::TrajectoryPoint& trajectory_stitching_point, const Vec2d& translate_origin, const double rotate_angle, const std::vector<double>& end_pose, const Eigen::MatrixXd& xWS, const Eigen::MatrixXd& uWs, const Eigen::MatrixXd& l_warm_up, const Eigen::MatrixXd& n_warm_up, const Eigen::MatrixXd& dual_l_result_ds, const Eigen::MatrixXd& dual_n_result_ds, const Eigen::MatrixXd& state_result_ds, const Eigen::MatrixXd& control_result_ds, const Eigen::MatrixXd& time_result_ds, const std::vector<double>& XYbounds, const std::vector<std::vector<common::math::Vec2d>>& obstacles_vertices_vec); void UpdateDebugInfo( ::apollo::planning_internal::OpenSpaceDebug* open_space_debug); apollo::planning_internal::OpenSpaceDebug* mutable_open_space_debug() { return &open_space_debug_; } private: bool IsInitPointNearDestination( const common::TrajectoryPoint& planning_init_point, const std::vector<double>& end_pose, double rotate_angle, const Vec2d& translate_origin); void PathPointNormalizing(double rotate_angle, const common::math::Vec2d& translate_origin, double* x, double* y, double* phi); void PathPointDeNormalizing(double rotate_angle, const common::math::Vec2d& translate_origin, double* x, double* y, double* phi); void LoadTrajectory(const Eigen::MatrixXd& state_result_ds, const Eigen::MatrixXd& control_result_ds, const Eigen::MatrixXd& time_result_ds); void UseWarmStartAsResult( const Eigen::MatrixXd& xWS, const Eigen::MatrixXd& uWS, const Eigen::MatrixXd& l_warm_up, const Eigen::MatrixXd& n_warm_up, Eigen::MatrixXd* state_result_ds, Eigen::MatrixXd* control_result_ds, Eigen::MatrixXd* time_result_ds, Eigen::MatrixXd* dual_l_result_ds, Eigen::MatrixXd* dual_n_result_ds); private: OpenSpaceTrajectoryOptimizerConfig config_; std::unique_ptr<HybridAStar> warm_start_; std::unique_ptr<DistanceApproachProblem> distance_approach_; std::unique_ptr<DualVariableWarmStartProblem> dual_variable_warm_start_; std::vector<common::TrajectoryPoint> stitching_trajectory_; DiscretizedTrajectory optimized_trajectory_; apollo::planning_internal::OpenSpaceDebug open_space_debug_; }; } // namespace planning } // namespace apollo
// // PartialStreamTest.h // // Definition of the PartialStreamTest class. // // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #ifndef PartialStreamTest_INCLUDED #define PartialStreamTest_INCLUDED #include "Poco/Zip/Zip.h" #include "CppUnit/TestCase.h" class PartialStreamTest: public CppUnit::TestCase { public: PartialStreamTest(const std::string& name); ~PartialStreamTest(); void testReading(); void testWriting(); void testWritingZero(); void testWritingOne(); void testAutoDetect(); void setUp(); void tearDown(); static CppUnit::Test* suite(); private: }; #endif // PartialStreamTest_INCLUDED
// Copyright 2015 Heidelberg University Copyright and related rights are // licensed under the Solderpad Hardware License, Version 0.51 (the "License"); // you may not use this file except in compliance with the License. You may obtain // a copy of the License at http://solderpad.org/licenses/SHL-0.51. Unless // required by applicable law or agreed to in writing, software, hardware and // materials distributed under this License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See // the License for the specific language governing permissions and limitations // under the License. #include <stdio.h> #include <stdlib.h> #include <string.h> #ifndef TN_TEST_INC #include "operators.h" #else #include TN_TEST_INC #endif //die maximale kommentarlänge in den dateien betraegt 1024byte #ifndef TEMP_MEM_AD_FILE #define TEMP_MEM_AD_FILE "temp_mem_ad.txt" #endif #ifndef TN_DUMP_FILE #define TN_DUMP_FILE "../../../dump_tn_testflow_tn_testflow.mem" #endif int cmp_ad(){ FILE *pFcomp; int a, b; pFcomp = fopen (TEMP_MEM_AD_FILE,"r"); fscanf(pFcomp, "%x", &a); fclose(pFcomp); pFcomp = fopen ("emp_mem_ad.txt","w"); fprintf(pFcomp, "%d", (a-0x40000000)); fclose(pFcomp); pFcomp = fopen("emp_mem_ad.txt", "r"); fscanf(pFcomp,"%d", &b); fclose(pFcomp); return b; } void compare(int cmpad){ int iscomment; int i, indikator; char *dump = malloc(1024 + 4*size); char *endian = malloc(1024); FILE *pFiledump; FILE *pFileendian; pFiledump = fopen (TN_DUMP_FILE,"r"); if (pFiledump == NULL) { printf("error opening file %s \n", TN_DUMP_FILE); exit(1); } pFileendian = fopen ("endianneu.txt","r"); if (pFileendian == NULL) { printf("error opening file endinaneu.txt \n"); exit(1); } i = 0; iscomment = 1; do{ fscanf (pFiledump, "%s", dump); if((dump[0] == '/') && (dump[1] == '/')) { while(fgetc(pFiledump) != '\n'); } else{ fseek(pFiledump, (-1)*strlen(dump), SEEK_CUR); iscomment = 0; } }while(iscomment); while(i < cmpad){ i++; printf("%d \n", i); fscanf (pFiledump, "%s", dump); //ausblendung der kommentare if((dump[0] == '/') && (dump[1] == '/')) { while(fgetc(pFiledump) != '\n'); i--; } else { printf("%d, %s \n",i, dump); } } indikator = 1; printf("index, s2pp, referenzsystem\n"); for(i = 0; i < (4*size); i++){ fscanf(pFiledump, "%s", dump); fscanf(pFileendian, "%s", endian); if(strcmp(dump, endian) != 0){ printf("%d mismatch in ", i); indikator = 0; } printf("%d, %s, %s \n", i, dump, endian); } fclose (pFiledump); fclose (pFileendian); free(endian); free(dump); if(indikator == 1) printf("match \n"); } int main(){ //Initialisierung allokierter Bereich wird mit 0 initialisiert FILE * pFILE; // int* mem = malloc(4*size); unsigned char* t; int i, j, cmpad; for(i=0; i<size; i++){ mem[i] = 0; } t = mem; //zu testende Funktion test_funktion(); pFILE = fopen ("endianneu.txt","w"); for(i = 3; i < 4*size; i = i+4){ for(j = i; j > i - 4; j--){ if(t[j] < 0x10){ //printf("%d, %x, %p, 0%x, %d \n", j, mem[i/4], (mem + (i/4)), t[j], t[j]); fprintf(pFILE, "0%x\n", t[j]); } else{ //printf("%d, %x, %p, %x, %d \n", j, mem[i/4], (mem + (i/4)), t[j], t[j]); fprintf(pFILE, "%x\n", t[j]); } } } fclose (pFILE); // free(mem); cmpad = cmp_ad(); compare(cmpad); return 0; }
// // RKDynamicObjectMapping.h // RestKit // // Created by Blake Watters on 7/28/11. // Copyright (c) 2009-2012 RestKit. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import "RKObjectMappingDefinition.h" #import "RKObjectMapping.h" /** Return the appropriate object mapping given a mappable data */ @protocol RKDynamicObjectMappingDelegate <NSObject> @required - (RKObjectMapping *)objectMappingForData:(id)data; @end #ifdef NS_BLOCKS_AVAILABLE typedef RKObjectMapping *(^RKDynamicObjectMappingDelegateBlock)(id); #endif /** Defines a dynamic object mapping that determines the appropriate concrete object mapping to apply at mapping time. This allows you to map very similar payloads differently depending on the type of data contained therein. */ @interface RKDynamicObjectMapping : RKObjectMappingDefinition { NSMutableArray *_matchers; id<RKDynamicObjectMappingDelegate> _delegate; #ifdef NS_BLOCKS_AVAILABLE RKDynamicObjectMappingDelegateBlock _objectMappingForDataBlock; #endif } /** A delegate to call back to determine the appropriate concrete object mapping to apply to the mappable data. @see RKDynamicObjectMappingDelegate */ @property (nonatomic, assign) id<RKDynamicObjectMappingDelegate> delegate; #ifdef NS_BLOCKS_AVAILABLE /** A block to invoke to determine the appropriate concrete object mapping to apply to the mappable data. */ @property (nonatomic, copy) RKDynamicObjectMappingDelegateBlock objectMappingForDataBlock; #endif /** Return a new auto-released dynamic object mapping */ + (RKDynamicObjectMapping *)dynamicMapping; #if NS_BLOCKS_AVAILABLE /** Return a new auto-released dynamic object mapping after yielding it to the block for configuration */ + (RKDynamicObjectMapping *)dynamicMappingUsingBlock:(void(^)(RKDynamicObjectMapping *dynamicMapping))block; + (RKDynamicObjectMapping *)dynamicMappingWithBlock:(void(^)(RKDynamicObjectMapping *dynamicMapping))block DEPRECATED_ATTRIBUTE; #endif /** Defines a dynamic mapping rule stating that when the value of the key property matches the specified value, the objectMapping should be used. For example, suppose that we have a JSON fragment for a person that we want to map differently based on the gender of the person. When the gender is 'male', we want to use the Boy class and when then the gender is 'female' we want to use the Girl class. We might define our dynamic mapping like so: RKDynamicObjectMapping* mapping = [RKDynamicObjectMapping dynamicMapping]; [mapping setObjectMapping:boyMapping whenValueOfKeyPath:@"gender" isEqualTo:@"male"]; [mapping setObjectMapping:boyMapping whenValueOfKeyPath:@"gender" isEqualTo:@"female"]; */ - (void)setObjectMapping:(RKObjectMapping *)objectMapping whenValueOfKeyPath:(NSString *)keyPath isEqualTo:(id)value; /** Invoked by the RKObjectMapper and RKObjectMappingOperation to determine the appropriate RKObjectMapping to use when mapping the specified dictionary of mappable data. */ - (RKObjectMapping *)objectMappingForDictionary:(NSDictionary *)dictionary; @end /** Define an alias for the old class name for compatibility @deprecated */ @interface RKObjectDynamicMapping : RKDynamicObjectMapping @end
/** * Appcelerator Titanium Mobile * Copyright (c) 2010-2011 by sample_project, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #if defined(USE_TI_UIIPADPOPOVER) || defined(USE_TI_UIIPADSPLITWINDOW) #import "TiViewProxy.h" #import "TiViewController.h" //The iPadPopoverProxy should be seen more as like a window or such, because //The popover controller will contain the viewController, which has the view. //If the view had the logic, you get some nasty dependency loops. @interface TiUIiPadPopoverProxy : TiViewProxy<UIPopoverControllerDelegate,TiUIViewController> { @private UIPopoverController *popoverController; UINavigationController *navigationController; TiViewController *viewController; //We need to hold onto this information for whenever the status bar rotates. TiViewProxy *popoverView; CGRect popoverRect; BOOL animated; UIPopoverArrowDirection directions; BOOL isShowing; BOOL isDismissing; NSCondition* closingCondition; } //Because the Popover isn't meant to be placed in anywhere specific, @property(nonatomic,readonly) UIPopoverController *popoverController; @property(nonatomic,readwrite,retain) TiViewController *viewController; @property(nonatomic,readwrite,retain) TiViewProxy *popoverView; -(UINavigationController *)navigationController; -(void)updatePopover:(NSNotification *)notification; -(void)updatePopoverNow; @end #endif
// // AppDelegate.h // kedashixunDemo // // Created by wangbing on 16/5/8. // Copyright © 2016年 wangbing. All rights reserved. // #import <UIKit/UIKit.h> #import <BaiduMapAPI_Map/BMKMapView.h>//只引入所需的单个头文件 @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (nonatomic, strong) BMKMapManager *mapManager; @end
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <type_traits> // FOLLY_CREATE_EXTERN_ACCESSOR // // Defines a variable template which holds the address of an object or null // given a condition which identifies whether that object is expected to have // a definition. // // Example: // // extern void foobar(int); // may be defined in another library // inline constexpr bool has_foobar = // ... // // namespace myapp { // FOLLY_CREATE_EXTERN_ACCESSOR(access_foobar_v, ::foobar); // void try_foobar(int num) { // if (auto ptr = access_foobar_v<has_foobar>) { // ptr(num); // } // } // } // // Remarks: // // This can be done more simply using weak symbols. But weak symbols are non- // portable and the rules around the use of weak symbols are complex. // // This can be done more simply using if-constexpr. But if-constexpr requires // C++17 and there remain specific narrow cases to be supported on prior // versions of C++. // // TODO: Remove after C++17. #define FOLLY_CREATE_EXTERN_ACCESSOR(varname, name) \ struct __folly_extern_accessor_##varname { \ template <bool E, typename N, ::std::enable_if_t<E, int> = 0> \ static constexpr N* get() noexcept { \ return &name; \ } \ template <bool E, typename N, ::std::enable_if_t<!E, int> = 0> \ static constexpr N* get() noexcept { \ return nullptr; \ } \ }; \ template <bool E, typename N = decltype(name)> \ FOLLY_INLINE_VARIABLE constexpr N* varname = \ __folly_extern_accessor_##varname::get<E, N>()
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * 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 itkBinaryMinMaxCurvatureFlowFunction_h #define itkBinaryMinMaxCurvatureFlowFunction_h #include "itkMinMaxCurvatureFlowFunction.h" #include "itkMacro.h" namespace itk { /** \class BinaryMinMaxCurvatureFlowFunction * * This class encapsulate the finite difference equation which drives a * min/max curvature flow algorithm for denoising binary images. * * This class uses a zero flux Neumann boundary condition when computing * derivatives near the data boundary. * * This class operates as part of the finite difference solver hierarchy. * * \sa BinaryMinMaxCurvatureFlowImageFilter * \sa ZeroFluxNeumannBoundaryCondition * \ingroup FiniteDifferenceFunctions * \ingroup ITKCurvatureFlow */ template< typename TImage > class ITK_TEMPLATE_EXPORT BinaryMinMaxCurvatureFlowFunction: public MinMaxCurvatureFlowFunction< TImage > { public: /** Standard class typedefs. */ typedef BinaryMinMaxCurvatureFlowFunction Self; typedef MinMaxCurvatureFlowFunction< TImage > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods) */ itkTypeMacro(BinaryMinMaxCurvatureFlowFunction, MinMaxCurvatureFlowFunction); /** Inherit some parameters from the superclass type. */ typedef typename Superclass::PixelType PixelType; typedef typename Superclass::RadiusType RadiusType; typedef typename Superclass::NeighborhoodType NeighborhoodType; typedef typename Superclass::FloatOffsetType FloatOffsetType; typedef typename Superclass::ImageType ImageType; /** Extract superclass dimension. */ itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension); /** Set/Get the threshold value. */ void SetThreshold(const double thresh) { m_Threshold = thresh; } const double & GetThreshold() const { return m_Threshold; } /** This method computes the solution update for each pixel that does not * lie on a the data set boundary. */ virtual PixelType ComputeUpdate(const NeighborhoodType & neighborhood, void *globalData, const FloatOffsetType & offset = FloatOffsetType(0.0) ) ITK_OVERRIDE; protected: BinaryMinMaxCurvatureFlowFunction(); ~BinaryMinMaxCurvatureFlowFunction() {} private: ITK_DISALLOW_COPY_AND_ASSIGN(BinaryMinMaxCurvatureFlowFunction); double m_Threshold; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkBinaryMinMaxCurvatureFlowFunction.hxx" #endif #endif
/* * action() * * Preform any action that is needed with this article * * Copyright 1994 Timothy Pozar * */ #include "anpa.h" char doit[BUFSIZE]; action() { sprintf(doit,act,tmpfnp,tmpfnp,tmpfnp); if(debug_level > 4) printf("Running: %s\n",doit); system(doit); return(TRUE); }
/**************************************************************************** * Copyright 2014-2015 Trefilov Dmitrij * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * ****************************************************************************/ #ifndef MYSQLSTATEMENTIMPL_H #define MYSQLSTATEMENTIMPL_H #include "SqlStatementImpl.h" #include <mysql.h> namespace metacpp { namespace db { namespace sql { namespace connectors { namespace mysql { class MySqlStatementImpl : public SqlStatementImpl { public: MySqlStatementImpl(MYSQL_STMT *stmt, SqlStatementType type, const String& queryText); ~MySqlStatementImpl(); MYSQL_STMT *getStmt() const; MYSQL_RES *getResult() const; void setResult(MYSQL_RES *result); bool getExecuted() const; void setExecuted(bool val = true); /** Stores bind data which will receive field requirements on the next fetched row */ void prefetch(); MYSQL_BIND *bindResult(size_t nField); private: MYSQL_STMT *m_stmt; MYSQL_RES *m_result; Array<MYSQL_BIND> m_bindResult; bool m_executed; }; } // namespace mysql } // namespace connectors } // namespace sql } // namespace db } // namespace metacpp #endif // MYSQLSTATEMENTIMPL_H
/* Literate version 1.0, August 2010 Copyright 2010 Ryan Walklin Based on Smultron version 3.6b1, 2009-09-12 Written by Peter Borg, pgw3@mac.com Find the latest version at http://smultron.sourceforge.net Copyright 2004-2009 Peter Borg Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #import <Cocoa/Cocoa.h> @interface LTViewMenuController : NSObject { } + (LTViewMenuController *)sharedInstance; - (IBAction)splitWindowAction:(id)sender; - (void)performCollapse; - (IBAction)lineWrapTextAction:(id)sender; - (IBAction)showSyntaxColoursAction:(id)sender; - (IBAction)showLineNumbersAction:(id)sender; - (IBAction)showStatusBarAction:(id)sender; - (void)performHideStatusBar; - (IBAction)showInvisibleCharactersAction:(id)sender; - (IBAction)viewDocumentInSeparateWindowAction:(id)sender; - (IBAction)viewDocumentInFullScreenAction:(id)sender; - (IBAction)showTabBarAction:(id)sender; - (void)performHideTabBar; - (IBAction)showDocumentsViewAction:(id)sender; - (void)performCollapseDocumentsView; - (IBAction)documentsViewAction:(id)sender; - (IBAction)emptyDummyAction:(id)sender; - (IBAction)showSizeSliderAction:(id)sender; @end
// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import <HRSAdvancedTableViews/HRSTableViewSectionController.h> #import <HRSAdvancedTableViews/HRSTableViewSectionCoordinator.h> #import <HRSAdvancedTableViews/HRSTableViewSectionTransformer.h>
// // ViewController.h // Dizainer // // Created by m2sar on 03/10/2016. // Copyright © 2016 UPMC. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController - (void)updateView:(int)value; @end
#include "plugin/file/element.h" #include "common/file.h" #include <stdio.h> #include <stdarg.h> #include <stddef.h> #include <setjmp.h> #include <stdlib.h> #include <cmocka.h> static void compare(void** arg) { element* elem1; element* elem2; attribute* attr; int rc; elem1 = create_element(u"funky"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_REGULAR; add_element_attribute(elem1, attr); elem2 = create_element(u"monkey"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_REGULAR; add_element_attribute(elem2, attr); rc = compare_element_attributes(elem1, elem2); assert_int_equal(rc, 0); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_SHA256; attr->value.byte_array.mem = malloc(5); memcpy(attr->value.byte_array.mem, "hello", 5); attr->value.byte_array.sz = 5; add_element_attribute(elem1, attr); rc = compare_element_attributes(elem1, elem2); assert_int_not_equal(rc, 0); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_SHA256; attr->value.byte_array.mem = malloc(5); memcpy(attr->value.byte_array.mem, "hello", 5); attr->value.byte_array.sz = 5; add_element_attribute(elem2, attr); rc = compare_element_attributes(elem1, elem2); assert_int_equal(rc, 0); destroy_element(elem2); elem2 = create_element(u"iguana"); rc = compare_element_attributes(elem1, elem2); assert_int_not_equal(rc, 0); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_SYMBOLIC_LINK; add_element_attribute(elem2, attr); rc = compare_element_attributes(elem1, elem2); assert_int_not_equal(rc, 0); destroy_element(elem2); destroy_element(elem1); } void diff(void** arg) { element* elem1; element* elem2; element* elem3; attribute* attr; elem1 = create_element(u"funky"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_REGULAR; add_element_attribute(elem1, attr); elem2 = create_element(u"funky"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_SYMBOLIC_LINK; add_element_attribute(elem2, attr); diff_elements(elem1, elem2); elem3 = create_element(u"chunky"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_REGULAR; add_element_attribute(elem3, attr); assert_int_equal(compare_element_attributes(elem1, elem3), 0); destroy_element(elem3); destroy_element(elem2); destroy_element(elem1); elem1 = create_element(u"funky"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_REGULAR; add_element_attribute(elem1, attr); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_SHA256; attr->value.byte_array.mem = malloc(5); memcpy(attr->value.byte_array.mem, "hello", 5); attr->value.byte_array.sz = 5; add_element_attribute(elem1, attr); elem2 = create_element(u"funky"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_FILE_TYPE; attr->value.integer = YELLA_FILE_TYPE_REGULAR; add_element_attribute(elem2, attr); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_SHA256; attr->value.byte_array.mem = malloc(7); memcpy(attr->value.byte_array.mem, "goodbye", 7); attr->value.byte_array.sz = 7; add_element_attribute(elem2, attr); diff_elements(elem1, elem2); elem3 = create_element(u"funky"); attr = malloc(sizeof(attribute)); attr->type = ATTR_TYPE_SHA256; attr->value.byte_array.mem = malloc(5); memcpy(attr->value.byte_array.mem, "hello", 5); attr->value.byte_array.sz = 5; add_element_attribute(elem3, attr); assert_int_equal(compare_element_attributes(elem1, elem3), 0); destroy_element(elem3); destroy_element(elem2); destroy_element(elem1); } int main() { const struct CMUnitTest tests[] = { cmocka_unit_test(compare), cmocka_unit_test(diff) }; return cmocka_run_group_tests(tests, NULL, NULL); }
/* * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ // This file defines GPIO lookup macros for available UART IO_MUX pins on ESP32. #ifndef _SOC_UART_CHANNEL_H #define _SOC_UART_CHANNEL_H //UART channels #define UART_GPIO1_DIRECT_CHANNEL UART_NUM_0 #define UART_NUM_0_TXD_DIRECT_GPIO_NUM 1 #define UART_GPIO3_DIRECT_CHANNEL UART_NUM_0 #define UART_NUM_0_RXD_DIRECT_GPIO_NUM 3 #define UART_GPIO19_DIRECT_CHANNEL UART_NUM_0 #define UART_NUM_0_CTS_DIRECT_GPIO_NUM 19 #define UART_GPIO22_DIRECT_CHANNEL UART_NUM_0 #define UART_NUM_0_RTS_DIRECT_GPIO_NUM 22 #define UART_TXD_GPIO1_DIRECT_CHANNEL UART_GPIO1_DIRECT_CHANNEL #define UART_RXD_GPIO3_DIRECT_CHANNEL UART_GPIO3_DIRECT_CHANNEL #define UART_CTS_GPIO19_DIRECT_CHANNEL UART_GPIO19_DIRECT_CHANNEL #define UART_RTS_GPIO22_DIRECT_CHANNEL UART_GPIO22_DIRECT_CHANNEL #define UART_GPIO10_DIRECT_CHANNEL UART_NUM_1 #define UART_NUM_1_TXD_DIRECT_GPIO_NUM 10 #define UART_GPIO9_DIRECT_CHANNEL UART_NUM_1 #define UART_NUM_1_RXD_DIRECT_GPIO_NUM 9 #define UART_GPIO6_DIRECT_CHANNEL UART_NUM_1 #define UART_NUM_1_CTS_DIRECT_GPIO_NUM 6 #define UART_GPIO11_DIRECT_CHANNEL UART_NUM_1 #define UART_NUM_1_RTS_DIRECT_GPIO_NUM 11 #define UART_TXD_GPIO10_DIRECT_CHANNEL UART_GPIO10_DIRECT_CHANNEL #define UART_RXD_GPIO9_DIRECT_CHANNEL UART_GPIO9_DIRECT_CHANNEL #define UART_CTS_GPIO6_DIRECT_CHANNEL UART_GPIO6_DIRECT_CHANNEL #define UART_RTS_GPIO11_DIRECT_CHANNEL UART_GPIO11_DIRECT_CHANNEL #define UART_GPIO17_DIRECT_CHANNEL UART_NUM_2 #define UART_NUM_2_TXD_DIRECT_GPIO_NUM 17 #define UART_GPIO16_DIRECT_CHANNEL UART_NUM_2 #define UART_NUM_2_RXD_DIRECT_GPIO_NUM 16 #define UART_GPIO8_DIRECT_CHANNEL UART_NUM_2 #define UART_NUM_2_CTS_DIRECT_GPIO_NUM 8 #define UART_GPIO7_DIRECT_CHANNEL UART_NUM_2 #define UART_NUM_2_RTS_DIRECT_GPIO_NUM 7 #define UART_TXD_GPIO17_DIRECT_CHANNEL UART_GPIO17_DIRECT_CHANNEL #define UART_RXD_GPIO16_DIRECT_CHANNEL UART_GPIO16_DIRECT_CHANNEL #define UART_CTS_GPIO8_DIRECT_CHANNEL UART_GPIO8_DIRECT_CHANNEL #define UART_RTS_GPIO7_DIRECT_CHANNEL UART_GPIO7_DIRECT_CHANNEL #endif
/** *EG1302A *Fernando Urbina *2/4/2014 *Assignment 08 */ //Example program #1 from Chapter 6 of //Absoulte Beginner's Guide to C, #rd Edition //File Chapter6ex1.c //This program pairs three kids with their favorite superhero #include <stdio.h> #include <string.h> int main() { char Kid1[12]; //Kid1 can hold an 11-character name //Kid2 will be 7 characters (Maddie plus null 0) char Kid2[] = "Maddie"; //Kid3 is also 7 characters, but specfically defined char Kid3[7] = "Andrew"; //Hero1 will be 7 characters (adding null 0!) char Hero1 = "Batman"; //Hero2 will have extra room just in case char Hero2 [34] = "Spiderman"; char Hero3 [25]; Kid1[0] = 'K'; //Kid is being defined character-by-character Kid1[1] = 'a'; //Not efficient, bit it does work Kid1[2] = 't'; // Kid1[3] = 'i'; Kid1[4] = 'e'; Kid1[5] = '\0'; //Never forget the null 0 so C knows when the //string ends strcopy(Hero3, "The Incredible Hulk"); printf("%s\'s favorite hero is %s.\n", Kid1, Hero1); printf("%s\'s favorite hero is %s.\n", Kid2, Hero2); printf("%s\'s favorite hero is %s.\n", Kid3, Hero3); return 0; }
/* Copyright 2015 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef GRAPHD_RESUME_SABOTAGE_H #define GRAPHD_RESUME_SABOTAGE_H #include "libsrv/srv.h" #ifndef SABOTAGE #define SABOTAGE 1 /* Enable sabotage testing. */ #endif /* SABOTAGE */ /* Report acts of sabotage at this loglevel. */ #define GRAPHD_SABOTAGE_LOGLEVEL CL_LEVEL_ERROR /* * The array tracks whether or not a suspend statement has been * executed. Indexed with __LINE__. (This assumes we never have * more than 10,000 lines in a resumable translation unit, but * will abort with an assertion failure if we do.) */ #define GRAPHD_SABOTAGE_DECL static unsigned char graphd_sabotage_buffer[10000] #define GRAPHD_SABOTAGE(g, cond) \ ((cond) || \ ((g)->g_sabotage && (g)->g_sabotage->gs_countdown > 0 && \ sizeof(char[sizeof graphd_sabotage_buffer - __LINE__]) && \ graphd_sabotage_buffer[__LINE__] < (g)->g_sabotage->gs_target && \ --((g)->g_sabotage->gs_countdown) == 0 && \ ++(graphd_sabotage_buffer[__LINE__]) && \ (graphd_sabotage_report((g)->g_sabotage, __FILE__, __LINE__, __func__, \ #cond, graphd_sabotage_buffer[__LINE__]), \ 0))) struct graphd_handle; typedef struct graphd_sabotage_config { /* What was our initial level? */ unsigned long gsc_countdown_initial; /* Should we restart counting after triggering? */ unsigned int gsc_cycle : 1; /* Should we increment the initial countdown timer * after triggering? */ unsigned int gsc_increment : 1; /* Mess with the stack area * between each call to graphd_serve()? */ unsigned int gsc_deadbeef : 1; /* What loglevel are we logging at? */ cl_loglevel gsc_loglevel; /* How many times should each location fire? */ unsigned char gsc_target; } graphd_sabotage_config; typedef struct graphd_sabotage_handle { /* Log through this to report that * we're breaking something deliberately. */ cl_handle* gs_cl; /* What level are we logging at? */ cl_loglevel gs_loglevel; /* Count this down to 0 before striking. * An initial value of 0 is safe and never triggers. */ unsigned long gs_countdown; /* What was our initial level? */ unsigned long gs_countdown_initial; /* What's our total age in ticks? */ unsigned long gs_countdown_total; /* Should we restart counting after triggering? */ unsigned int gs_cycle : 1; /* Should we increment the initial countdown timer * after triggering? */ unsigned int gs_increment : 1; /* Mess with the stack area * between each call to graphd_serve()? */ unsigned int gs_deadbeef : 1; /* How many times should each location fire? */ unsigned char gs_target; } graphd_sabotage_handle; void graphd_sabotage_report(graphd_sabotage_handle* gs, char const* file, int line, char const* func, char const* cond, int local_count); int graphd_sabotage_option_set(void* data, srv_handle* srv, cm_handle* cm, int opt, char const* opt_arg); int graphd_sabotage_option_configure(void* data, srv_handle* srv, void* config_data, srv_config* srv_config_data); void graphd_sabotage_initialize(graphd_sabotage_handle* gs, cl_handle* cl); #endif /* GRAPHD_RESUME_SABOTAGE_H */
// // LCLiveQuery_Internal.h // LeanCloud // // Created by zapcannon87 on 26/03/2018. // Copyright © 2018 LeanCloud Inc. All rights reserved. // #import "LCLiveQuery.h" @interface LCLiveQuery () - (void)resubscribe; @end
/* Copyright (c) 2011, Siemens Corporate Research a Division of Siemens Corporation All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* * \brief * \author Sylvain Jaume, Francois Huguet */ # ifndef SO_VTK_IMAGESOBEL2D_H_ # define SO_VTK_IMAGESOBEL2D_H_ # include <Inventor/engines/SoSubEngine.h> # include "xip/inventor/vtk/SoSFVtkAlgorithmOutput.h" # include "xip/inventor/vtk/SoSFVtkObject.h" # include "vtkImageSobel2D.h" # include "Inventor/fields/SoSFInt32.h" class SoVtkImageSobel2D : public SoEngine { SO_ENGINE_HEADER( SoVtkImageSobel2D ); public: /// Constructor SoVtkImageSobel2D(); /// Class Initialization static void initClass(); // Inputs /// NumberOfThreads SoSFInt32 NumberOfThreads; /// Input connection SoSFVtkAlgorithmOutput InputConnection; // Outputs /// SoSFVtkObject of type vtkImageData SoEngineOutput Output; /// SoSFVtkAlgorithmOutput SoEngineOutput OutputPort; protected: /// Destructor ~SoVtkImageSobel2D(); /// Evaluate Function virtual void evaluate(); /// inputChanged Function virtual void inputChanged(SoField *); /// reset Function virtual void reset(); /// vtkImageData SoVtkObject *mOutput; /// vtkAlgorithm SoVtkAlgorithmOutput *mOutputPort; private: vtkImageSobel2D* mObject; /// addCalled checks if the Add*() method has been called bool addCalled; }; #endif // SO_VTK_IMAGESOBEL2D_H_
/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <iotbus_gpio.h> #include <stdlib.h> #include "modules/iotjs_module_gpio.h" struct _iotjs_gpio_module_platform_t { iotbus_gpio_context_h gpio_context; }; void iotjs_gpio_platform_create(iotjs_gpio_t_impl_t* _this) { size_t private_mem = sizeof(struct _iotjs_gpio_module_platform_t); _this->platform = (iotjs_gpio_module_platform_t)malloc(private_mem); } void iotjs_gpio_platform_destroy(iotjs_gpio_t_impl_t* _this) { iotjs_buffer_release((char*)_this->platform); } void iotjs_gpio_open_worker(uv_work_t* work_req) { GPIO_WORKER_INIT; IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio); DDDLOG("%s - pin: %d, direction: %d, mode: %d", __func__, _this->pin, _this->direction, _this->mode); iotbus_gpio_context_h gpio_context = iotbus_gpio_open((int)_this->pin); if (gpio_context == NULL) { req_data->result = false; return; } // Set direction iotbus_gpio_direction_e direction; if (_this->direction == kGpioDirectionIn) { direction = IOTBUS_GPIO_DIRECTION_IN; } else if (_this->direction == kGpioDirectionOut) { direction = IOTBUS_GPIO_DIRECTION_OUT; } else { direction = IOTBUS_GPIO_DIRECTION_NONE; } if (iotbus_gpio_set_direction(gpio_context, direction) < 0) { req_data->result = false; return; } _this->platform->gpio_context = gpio_context; req_data->result = true; } bool iotjs_gpio_write(iotjs_gpio_t* gpio, bool value) { IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio); if (iotbus_gpio_write(_this->platform->gpio_context, value) < 0) { return false; } return true; } int iotjs_gpio_read(iotjs_gpio_t* gpio) { IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio); return iotbus_gpio_read(_this->platform->gpio_context); } bool iotjs_gpio_close(iotjs_gpio_t* gpio) { IOTJS_VALIDATED_STRUCT_METHOD(iotjs_gpio_t, gpio); if (iotbus_gpio_close(_this->platform->gpio_context) < 0) { return false; } return true; }
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ssm/SSM_EXPORTS.h> #include <aws/ssm/SSMRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace SSM { namespace Model { /** */ class AWS_SSM_API ResumeSessionRequest : public SSMRequest { public: ResumeSessionRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "ResumeSession"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The ID of the disconnected session to resume.</p> */ inline const Aws::String& GetSessionId() const{ return m_sessionId; } /** * <p>The ID of the disconnected session to resume.</p> */ inline void SetSessionId(const Aws::String& value) { m_sessionIdHasBeenSet = true; m_sessionId = value; } /** * <p>The ID of the disconnected session to resume.</p> */ inline void SetSessionId(Aws::String&& value) { m_sessionIdHasBeenSet = true; m_sessionId = std::move(value); } /** * <p>The ID of the disconnected session to resume.</p> */ inline void SetSessionId(const char* value) { m_sessionIdHasBeenSet = true; m_sessionId.assign(value); } /** * <p>The ID of the disconnected session to resume.</p> */ inline ResumeSessionRequest& WithSessionId(const Aws::String& value) { SetSessionId(value); return *this;} /** * <p>The ID of the disconnected session to resume.</p> */ inline ResumeSessionRequest& WithSessionId(Aws::String&& value) { SetSessionId(std::move(value)); return *this;} /** * <p>The ID of the disconnected session to resume.</p> */ inline ResumeSessionRequest& WithSessionId(const char* value) { SetSessionId(value); return *this;} private: Aws::String m_sessionId; bool m_sessionIdHasBeenSet; }; } // namespace Model } // namespace SSM } // namespace Aws
/* * Copyright (C) 2014 ZYYX, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import <Foundation/Foundation.h> #import "ZXCoreDataRepresentationBase.h" #import "ZXPDFSearchCoreDataModels.h" @interface ZXPDFSearchResult : ZXCoreDataRepresentationBase { } + (id)searchResultWithPersistentStoreURL:(NSURL *)aPersistentStoreURL; + (id)searchResultWithPersistentStoreCoordinator:(NSPersistentStoreCoordinator *)aCoordinator; - (NSFetchRequest *)requestForSearchWordWithString:(NSString *)aSearchWordString; - (ZXPDFSearchWord *)searchWordWithString:(NSString *)aSearchWordString; - (ZXPDFSearchWord *)latestSearchWord; - (NSFetchRequest *)requestForSearchResultDocumentWithFilePath:(NSString *)aFilePath; - (ZXPDFSearchResultDocument *)searchResultDocumentWithFilePath:(NSString *)aFilePath; @end
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_NUMERICS_SAFE_MATH_ARM_IMPL_H_ #define BASE_NUMERICS_SAFE_MATH_ARM_IMPL_H_ #include <cassert> #include <limits> #include <type_traits> #include "third_party/chromium_base_numerics/safe_conversions.h" namespace base { namespace internal { template <typename T, typename U> struct CheckedMulFastAsmOp { static const bool is_supported = FastIntegerArithmeticPromotion<T, U>::is_contained; // The following is much more efficient than the Clang and GCC builtins for // performing overflow-checked multiplication when a twice wider type is // available. The below compiles down to 2-3 instructions, depending on the // width of the types in use. // As an example, an int32_t multiply compiles to: // smull r0, r1, r0, r1 // cmp r1, r1, asr #31 // And an int16_t multiply compiles to: // smulbb r1, r1, r0 // asr r2, r1, #16 // cmp r2, r1, asr #15 template <typename V> __attribute__((always_inline)) static bool Do(T x, U y, V* result) { using Promotion = typename FastIntegerArithmeticPromotion<T, U>::type; Promotion presult; presult = static_cast<Promotion>(x) * static_cast<Promotion>(y); *result = static_cast<V>(presult); return IsValueInRangeForNumericType<V>(presult); } }; template <typename T, typename U> struct ClampedAddFastAsmOp { static const bool is_supported = BigEnoughPromotion<T, U>::is_contained && IsTypeInRangeForNumericType< int32_t, typename BigEnoughPromotion<T, U>::type>::value; template <typename V> __attribute__((always_inline)) static V Do(T x, U y) { // This will get promoted to an int, so let the compiler do whatever is // clever and rely on the saturated cast to bounds check. if (IsIntegerArithmeticSafe<int, T, U>::value) return saturated_cast<V>(x + y); int32_t result; int32_t x_i32 = checked_cast<int32_t>(x); int32_t y_i32 = checked_cast<int32_t>(y); asm("qadd %[result], %[first], %[second]" : [result] "=r"(result) : [first] "r"(x_i32), [second] "r"(y_i32)); return saturated_cast<V>(result); } }; template <typename T, typename U> struct ClampedSubFastAsmOp { static const bool is_supported = BigEnoughPromotion<T, U>::is_contained && IsTypeInRangeForNumericType< int32_t, typename BigEnoughPromotion<T, U>::type>::value; template <typename V> __attribute__((always_inline)) static V Do(T x, U y) { // This will get promoted to an int, so let the compiler do whatever is // clever and rely on the saturated cast to bounds check. if (IsIntegerArithmeticSafe<int, T, U>::value) return saturated_cast<V>(x - y); int32_t result; int32_t x_i32 = checked_cast<int32_t>(x); int32_t y_i32 = checked_cast<int32_t>(y); asm("qsub %[result], %[first], %[second]" : [result] "=r"(result) : [first] "r"(x_i32), [second] "r"(y_i32)); return saturated_cast<V>(result); } }; template <typename T, typename U> struct ClampedMulFastAsmOp { static const bool is_supported = CheckedMulFastAsmOp<T, U>::is_supported; template <typename V> __attribute__((always_inline)) static V Do(T x, U y) { // Use the CheckedMulFastAsmOp for full-width 32-bit values, because // it's fewer instructions than promoting and then saturating. if (!IsIntegerArithmeticSafe<int32_t, T, U>::value && !IsIntegerArithmeticSafe<uint32_t, T, U>::value) { V result; if (CheckedMulFastAsmOp<T, U>::Do(x, y, &result)) return result; return CommonMaxOrMin<V>(IsValueNegative(x) ^ IsValueNegative(y)); } assert((FastIntegerArithmeticPromotion<T, U>::is_contained)); using Promotion = typename FastIntegerArithmeticPromotion<T, U>::type; return saturated_cast<V>(static_cast<Promotion>(x) * static_cast<Promotion>(y)); } }; } // namespace internal } // namespace base #endif // BASE_NUMERICS_SAFE_MATH_ARM_IMPL_H_
// // UIImageViewTap.h // Momento // // Created by Michael Waterfall on 04/11/2009. // Copyright 2009 d3i. All rights reserved. // #import <Foundation/Foundation.h> @protocol MWTapDetectingImageViewDelegate; @interface MWTapDetectingImageView : UIImageView { id <MWTapDetectingImageViewDelegate> tapDelegate; CGPoint startLocation; CGPoint imageStartOrigin; float lastDragPt; bool dragging; } @property (nonatomic, assign) id <MWTapDetectingImageViewDelegate> tapDelegate; - (void)handleSingleTap:(UITouch *)touch; - (void)handleDoubleTap:(UITouch *)touch; - (void)handleTripleTap:(UITouch *)touch; @end @protocol MWTapDetectingImageViewDelegate <NSObject> @optional - (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch; - (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch; - (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch; @end
/* * Copyright 2015 Cagdas Caglak * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QDebug> #include <QThread> #include <iostream> #include <QStringList> #include <QStringListModel> #include <QEventLoop> #include <QFileDialog> #include <QMessageBox> #include <QDir> #include "videoinfo.h" #include "audioplayer.h" #include "utils.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_search_bar_returnPressed(); void on_play_button_clicked(); void on_pause_button_clicked(); void on_stop_button_clicked(); void on_title_list_clicked(const QModelIndex &index); void update_time_line(); void on_next_button_clicked(); void on_prev_button_clicked(); void on_volume_slider_sliderMoved(int position); void on_volume_slider_sliderPressed(); void on_add_playlist_button_clicked(); void on_remove_playlist_button_clicked(); void on_playlist_clicked(const QModelIndex &index); void on_tool_open_triggered(); void on_tool_save_triggered(); void on_tool_saveas_triggered(); void openFileDialog(int result); void error(); signals: void stop_button_clicked(); void pause_button_clicked(); private: Ui::MainWindow *ui; QThread *thread; QList<VideoInfo> *list; QList<VideoInfo> *playlist; AudioPlayer *audio_player; QStringListModel *model; QStringListModel *model_playlist; QStringList *stringlist_playlist; VideoInfo video_info; QLinkedList<QString> *token_chain; QString file_name; QMessageBox *sure_box; int selected_index; int prev_index; int list_size; int playlist_size; bool playlist_change; int pageNumber; int result_sum; int start; int end; }; #endif // MAINWINDOW_H
/******************************************************************************* Copyright © 2015, STMicroelectronics International N.V. All rights reserved. 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 following disclaimer. * 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. * Neither the name of STMicroelectronics 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, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED. IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. 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 vl53l0_types.h * @brief VL53L0 types definition */ #ifndef VL53L0X_TYPES_H_ #define VL53L0X_TYPES_H_ /** @defgroup porting_type Basic type definition * @ingroup VL53L0X_platform_group * * @brief file vl53l0_types.h files hold basic type definition that may requires porting * * contains type that must be defined for the platform\n * when target platform and compiler provide stdint.h and stddef.h it is enough to include it.\n * If stdint.h is not available review and adapt all signed and unsigned 8/16/32 bits basic types. \n * If stddef.h is not available review and adapt NULL definition . */ #include <stdint.h> #include <stddef.h> #ifndef NULL #error "Error NULL definition should be done. Please add required include " #endif #if ! defined(STDINT_H) && !defined(_GCC_STDINT_H) &&!defined(__STDINT_DECLS) && !defined(_GCC_WRAP_STDINT_H) #pragma message("Please review type definition of STDINT define for your platform and add to list above ") /* * target platform do not provide stdint or use a different #define than above * to avoid seeing the message below addapt the #define list above or implement * all type and delete these pragma */ /** \ingroup VL53L0X_portingType_group * @{ */ typedef unsigned long long uint64_t; /** @brief Typedef defining 32 bit unsigned int type.\n * The developer should modify this to suit the platform being deployed. */ typedef unsigned int uint32_t; /** @brief Typedef defining 32 bit int type.\n * The developer should modify this to suit the platform being deployed. */ typedef int int32_t; /** @brief Typedef defining 16 bit unsigned short type.\n * The developer should modify this to suit the platform being deployed. */ typedef unsigned short uint16_t; /** @brief Typedef defining 16 bit short type.\n * The developer should modify this to suit the platform being deployed. */ typedef short int16_t; /** @brief Typedef defining 8 bit unsigned char type.\n * The developer should modify this to suit the platform being deployed. */ typedef unsigned char uint8_t; /** @brief Typedef defining 8 bit char type.\n * The developer should modify this to suit the platform being deployed. */ typedef signed char int8_t; /** @} */ #endif /* _STDINT_H */ /** use where fractional values are expected * * Given a floating point value f it's .16 bit point is (int)(f*(1<<16))*/ typedef uint32_t FixPoint1616_t; #endif /* VL53L0X_TYPES_H_ */
/* Copyright Abandoned 1996,1999 TCX DataKonsult AB & Monty Program KB & Detron HB, 1996, 1999-2004, 2007 MySQL AB. This file is public domain and comes with NO WARRANTY of any kind */ /* Version numbers for protocol & mysqld */ #ifndef _mysql_version_h #define _mysql_version_h #define PROTOCOL_VERSION 10 #define MYSQL_SERVER_VERSION "5.7.11" #define MYSQL_BASE_VERSION "mysqld-5.7" #define MYSQL_SERVER_SUFFIX_DEF "" #define FRM_VER 6 #define MYSQL_VERSION_ID 50711 #define MYSQL_PORT 3306 #define MYSQL_PORT_DEFAULT 0 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" #define MYSQL_CONFIG_NAME "my" #define MYSQL_COMPILATION_COMMENT "MySQL Community Server (GPL)" #define LIBMYSQL_VERSION "5.7.11" #define LIBMYSQL_VERSION_ID 50711 #define SYS_SCHEMA_VERSION "1.5.0" #ifndef LICENSE #define LICENSE GPL #endif /* LICENSE */ #endif /* _mysql_version_h */
// // ZFSettingGroup.h // ZFSetting // // Created by 任子丰 on 15/9/19. // Copyright (c) 2013年 任子丰. All rights reserved. // #import <Foundation/Foundation.h> @interface ZFSettingGroup : NSObject @property (nonatomic, copy) NSString *header; // 头部标题 @property (nonatomic, copy) NSString *footer; // 尾部标题 @property (nonatomic, strong) NSArray *items; // 中间的条目 @end
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/kinesisanalyticsv2/KinesisAnalyticsV2_EXPORTS.h> #include <aws/kinesisanalyticsv2/model/ApplicationDetail.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace KinesisAnalyticsV2 { namespace Model { class AWS_KINESISANALYTICSV2_API DescribeApplicationResult { public: DescribeApplicationResult(); DescribeApplicationResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DescribeApplicationResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>Provides a description of the application, such as the application's Amazon * Resource Name (ARN), status, and latest version.</p> */ inline const ApplicationDetail& GetApplicationDetail() const{ return m_applicationDetail; } /** * <p>Provides a description of the application, such as the application's Amazon * Resource Name (ARN), status, and latest version.</p> */ inline void SetApplicationDetail(const ApplicationDetail& value) { m_applicationDetail = value; } /** * <p>Provides a description of the application, such as the application's Amazon * Resource Name (ARN), status, and latest version.</p> */ inline void SetApplicationDetail(ApplicationDetail&& value) { m_applicationDetail = std::move(value); } /** * <p>Provides a description of the application, such as the application's Amazon * Resource Name (ARN), status, and latest version.</p> */ inline DescribeApplicationResult& WithApplicationDetail(const ApplicationDetail& value) { SetApplicationDetail(value); return *this;} /** * <p>Provides a description of the application, such as the application's Amazon * Resource Name (ARN), status, and latest version.</p> */ inline DescribeApplicationResult& WithApplicationDetail(ApplicationDetail&& value) { SetApplicationDetail(std::move(value)); return *this;} private: ApplicationDetail m_applicationDetail; }; } // namespace Model } // namespace KinesisAnalyticsV2 } // namespace Aws
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <assert.h> #include <exception> // System.ObjectDisposedException struct ObjectDisposedException_t973246880; // System.String struct String_t; // System.Runtime.Serialization.SerializationInfo struct SerializationInfo_t2995724695; #include "codegen/il2cpp-codegen.h" #include "mscorlib_System_String968488902.h" #include "mscorlib_System_Runtime_Serialization_Serializatio2995724695.h" #include "mscorlib_System_Runtime_Serialization_StreamingCont986364934.h" // System.Void System.ObjectDisposedException::.ctor(System.String) extern "C" void ObjectDisposedException__ctor_m1180707260 (ObjectDisposedException_t973246880 * __this, String_t* ___objectName, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.ObjectDisposedException::.ctor(System.String,System.String) extern "C" void ObjectDisposedException__ctor_m3489634552 (ObjectDisposedException_t973246880 * __this, String_t* ___objectName, String_t* ___message, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.ObjectDisposedException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void ObjectDisposedException__ctor_m571210567 (ObjectDisposedException_t973246880 * __this, SerializationInfo_t2995724695 * ___info, StreamingContext_t986364934 ___context, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.ObjectDisposedException::get_Message() extern "C" String_t* ObjectDisposedException_get_Message_m4164560767 (ObjectDisposedException_t973246880 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Void System.ObjectDisposedException::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void ObjectDisposedException_GetObjectData_m2669480868 (ObjectDisposedException_t973246880 * __this, SerializationInfo_t2995724695 * ___info, StreamingContext_t986364934 ___context, const MethodInfo* method) IL2CPP_METHOD_ATTR;
/** @file ConnectionCOM.h @author Lime Microsystems (www.limemicro.com) @brief Class for data communications through COM port */ #ifndef CONNECTION_COM_PORT_H #define CONNECTION_COM_PORT_H #ifndef __unix__ #include "windows.h" #endif #include "IConnection.h" #include <string> #include <vector> class ConnectionCOM : public IConnection { public: static const int COM_BUFFER_LENGTH = 1024; //max buffer size for data ConnectionCOM(); ~ConnectionCOM(); bool Open(); bool Open(int i); void Close(); bool IsOpen(); int SendData(const unsigned char *buffer, unsigned long length, unsigned long timeout_ms = 0); int ReadData(unsigned char *buffer, unsigned long length, unsigned long timeout_ms = 0); std::vector<std::string> GetDeviceNames(); void FindDevices(); void ClearComm(); private: void FindAllComPorts(); int Open(const char *comName, int baudrate); bool TestConnectivity(); std::string comPortName; int comBaudrate; bool connected; int currentDeviceIndex; std::vector<std::string> comPortList; std::vector<std::string> m_deviceNames; #ifndef __unix__ HANDLE hComm; COMMTIMEOUTS m_ctmoNew; COMMTIMEOUTS m_ctmoOld; OVERLAPPED m_osROverlap; OVERLAPPED m_osWOverlap; DCB m_dcbCommPort; #else int hComm; //com port file descriptor #endif }; #endif
/** ******************************************************************************* * ConnectionManager.cpp * * * * Tcp connection manager: * * - Manage TCP connections * ******************************************************************************* */ #ifndef _CONNECTION_MANAGER_H_ #define _CONNECTION_MANAGER_H_ /* ******************************************************************************* * Headers * ******************************************************************************* */ #include <memory> #include <map> #include <boost/asio.hpp> #include "stdinclude.h" #include "StoreMessage.h" #include "Connection.h" /* ******************************************************************************* * Forward declaraction * ******************************************************************************* */ /* ******************************************************************************* * Class declaraction * ******************************************************************************* */ class ConnectionManager { public: explicit ConnectionManager(boost::asio::io_service & io); void start(Connection_ptr conn); void stop(Connection_ptr conn); void stop_all(); void send_message(const boost::asio::ip::tcp::endpoint& endpoint, StoreMessage * pmsg, bool del_msg=true); private: typedef std::map< boost::asio::ip::tcp::endpoint, Connection_ptr > CM_MAP; private: // User strand to protect m_conn_map boost::asio::io_service::strand m_strand; CM_MAP m_conn_map; }; /* ******************************************************************************* * Inline functions * ******************************************************************************* */ #endif // _CONNECTION_MANAGER_H_
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/storagegateway/StorageGateway_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace StorageGateway { namespace Model { /** * <p>DisableGatewayOutput</p> */ class AWS_STORAGEGATEWAY_API DisableGatewayResult { public: DisableGatewayResult(); DisableGatewayResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DisableGatewayResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The unique Amazon Resource Name of the disabled gateway.</p> */ inline const Aws::String& GetGatewayARN() const{ return m_gatewayARN; } /** * <p>The unique Amazon Resource Name of the disabled gateway.</p> */ inline void SetGatewayARN(const Aws::String& value) { m_gatewayARN = value; } /** * <p>The unique Amazon Resource Name of the disabled gateway.</p> */ inline void SetGatewayARN(Aws::String&& value) { m_gatewayARN = value; } /** * <p>The unique Amazon Resource Name of the disabled gateway.</p> */ inline void SetGatewayARN(const char* value) { m_gatewayARN.assign(value); } /** * <p>The unique Amazon Resource Name of the disabled gateway.</p> */ inline DisableGatewayResult& WithGatewayARN(const Aws::String& value) { SetGatewayARN(value); return *this;} /** * <p>The unique Amazon Resource Name of the disabled gateway.</p> */ inline DisableGatewayResult& WithGatewayARN(Aws::String&& value) { SetGatewayARN(value); return *this;} /** * <p>The unique Amazon Resource Name of the disabled gateway.</p> */ inline DisableGatewayResult& WithGatewayARN(const char* value) { SetGatewayARN(value); return *this;} private: Aws::String m_gatewayARN; }; } // namespace Model } // namespace StorageGateway } // namespace Aws
// Copyright 2020 The Pigweed Authors // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy of // the License at // // https://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. // These tests call the pw_base64 module API from C. The return values are // checked in the main C++ tests. // // The encoded / decoded size macros are tested in the main C++ tests. #include <stddef.h> #include "pw_base64/base64.h" void pw_Base64CallEncode(const void* binary_data, const size_t binary_size_bytes, char* output) { return pw_Base64Encode(binary_data, binary_size_bytes, output); } size_t pw_Base64CallDecode(const char* base64, size_t base64_size_bytes, void* output) { return pw_Base64Decode(base64, base64_size_bytes, output); } bool pw_Base64CallIsValid(const char* base64_data, size_t base64_size) { return pw_Base64IsValid(base64_data, base64_size); }
/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ // * Deprecated * // Please note that this util has been deprecated. Please include and use // cyber/common/file.h directly. #pragma once #include "cyber/common/file.h" #include "modules/common/util/string_util.h" /** * @namespace apollo::common::util * @brief apollo::common::util */ namespace apollo { namespace common { namespace util { // TODO(all): The file utils have been moved into cyber. After migrating the // usages we'll retire the aliases here. using apollo::cyber::common::DirectoryExists; using apollo::cyber::common::EnsureDirectory; using apollo::cyber::common::GetProtoFromASCIIFile; using apollo::cyber::common::GetProtoFromFile; using apollo::cyber::common::PathExists; using apollo::cyber::common::SetProtoToASCIIFile; } // namespace util } // namespace common } // namespace apollo
#pragma once #include "AbstractPointsSchemaHandler.h" class RendermanPointsSchemaHandler : public AbstractPointsSchemaHandler { public: RendermanPointsSchemaHandler(); virtual ~RendermanPointsSchemaHandler(); protected: virtual void EmitPoints(Alembic::AbcGeom::IPoints& points, Alembic::Abc::index_t i_start_frame_number, Alembic::Abc::index_t i_requested_frame_number, const std::string& i_arnold_filename, Alembic::Abc::uint8_t i_motion_samples, float i_relative_shutter_open, float i_relative_shutter_close) const; }; // == Emacs ================ // ------------------------- // Local variables: // tab-width: 4 // indent-tabs-mode: t // c-basic-offset: 4 // end: // // == vi =================== // ------------------------- // Format block // ex:ts=4:sw=4:expandtab // -------------------------
/* Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php 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. MagickCore private graphic matrix methods. */ #ifndef MAGICKCORE_MATRIX_PRIVATE_H #define MAGICKCORE_MATRIX_PRIVATE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickPrivate MagickBooleanType GaussJordanElimination(double **,double **,const size_t,const size_t); extern MagickPrivate void LeastSquaresAddTerms(double **,double **,const double *,const double *, const size_t, const size_t); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif
#ifndef _CONTEXT_H #define _CONTEXT_H #include "Connection.h" #include <vector> #include <string> #include <unordered_map> class Context { public: void addConnection( Connection c ); void setGoal( std::vector<std::string> stops ); struct CtNode { CtNode( std::string name ) { mName = name; } std::string mName; struct Link { Link( Connection::Type type, CtNode* node, double timeConsuming, double distance, double cost ) { mType = type; mNode = node; mTimeConsuming = timeConsuming; mDistance = distance; mCost = cost; } Connection::Type mType; CtNode* mNode; double mTimeConsuming; // in hour double mDistance; // in km double mCost; }; std::vector<Context::CtNode::Link> mLinks; }; const std::vector<std::string>& getGoal() const { return mGoal; } const std::string& getGoalItem( int index ) const { return mGoal.at( index ); } const std::string& getLastGoalItem() const { return mGoal.at( mGoal.size() - 1 ); } const size_t getGoalSize() const { return mGoal.size(); } const CtNode* getNode( const std::string name ) const { auto it = mNodes.find( name ); if( it == mNodes.end()) return nullptr; return it->second; } private: void createNode( Connection c ); std::vector<Connection> mConnections; std::vector<std::string> mGoal; std::unordered_map<std::string, CtNode*> mNodes; }; #endif // _CONTEXT_H
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/forecast/ForecastService_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace ForecastService { namespace Model { class AWS_FORECASTSERVICE_API CreateDatasetImportJobResult { public: CreateDatasetImportJobResult(); CreateDatasetImportJobResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); CreateDatasetImportJobResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The Amazon Resource Name (ARN) of the dataset import job.</p> */ inline const Aws::String& GetDatasetImportJobArn() const{ return m_datasetImportJobArn; } /** * <p>The Amazon Resource Name (ARN) of the dataset import job.</p> */ inline void SetDatasetImportJobArn(const Aws::String& value) { m_datasetImportJobArn = value; } /** * <p>The Amazon Resource Name (ARN) of the dataset import job.</p> */ inline void SetDatasetImportJobArn(Aws::String&& value) { m_datasetImportJobArn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the dataset import job.</p> */ inline void SetDatasetImportJobArn(const char* value) { m_datasetImportJobArn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the dataset import job.</p> */ inline CreateDatasetImportJobResult& WithDatasetImportJobArn(const Aws::String& value) { SetDatasetImportJobArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the dataset import job.</p> */ inline CreateDatasetImportJobResult& WithDatasetImportJobArn(Aws::String&& value) { SetDatasetImportJobArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the dataset import job.</p> */ inline CreateDatasetImportJobResult& WithDatasetImportJobArn(const char* value) { SetDatasetImportJobArn(value); return *this;} private: Aws::String m_datasetImportJobArn; }; } // namespace Model } // namespace ForecastService } // namespace Aws
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/codestar/CodeStar_EXPORTS.h> #include <aws/codestar/model/S3Location.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CodeStar { namespace Model { /** * <p>The location where the source code files provided with the project request * are stored. AWS CodeStar retrieves the files during project * creation.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/codestar-2017-04-19/CodeSource">AWS * API Reference</a></p> */ class AWS_CODESTAR_API CodeSource { public: CodeSource(); CodeSource(Aws::Utils::Json::JsonView jsonValue); CodeSource& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>Information about the Amazon S3 location where the source code files provided * with the project request are stored. </p> */ inline const S3Location& GetS3() const{ return m_s3; } /** * <p>Information about the Amazon S3 location where the source code files provided * with the project request are stored. </p> */ inline void SetS3(const S3Location& value) { m_s3HasBeenSet = true; m_s3 = value; } /** * <p>Information about the Amazon S3 location where the source code files provided * with the project request are stored. </p> */ inline void SetS3(S3Location&& value) { m_s3HasBeenSet = true; m_s3 = std::move(value); } /** * <p>Information about the Amazon S3 location where the source code files provided * with the project request are stored. </p> */ inline CodeSource& WithS3(const S3Location& value) { SetS3(value); return *this;} /** * <p>Information about the Amazon S3 location where the source code files provided * with the project request are stored. </p> */ inline CodeSource& WithS3(S3Location&& value) { SetS3(std::move(value)); return *this;} private: S3Location m_s3; bool m_s3HasBeenSet; }; } // namespace Model } // namespace CodeStar } // namespace Aws
// // ViewController.h // LxVolumeManagerDemo // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
/** * * .. invisible: * _ _ _____ _ _____ _____ * * | | | | ___| | | ___/ ___| * * | | | | |__ | | | |__ \ `--. * * | | | | __|| | | __| `--. \ * * \ \_/ / |___| |___| |___/\__/ / * * \___/\____/\_____|____/\____/ * * 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 PIPE_CHAIN_TRANSFORMER #define PIPE_CHAIN_TRANSFORMER /** * @file PipeChainTransformer.h * @brief header file for chain transformer that * concatenates transformesr into one pipe */ #include <memory> #include "IChainTransformer.h" using std::shared_ptr; namespace LinearCRF { /** * @class PipeChainTransformer * @brief concatenates transformesr into one pipe */ template <class TransformerIterator = vector<shared_ptr<IChainTransformer> >::iterator> class PipeChainTransformer : public IChainTransformer { public: /** * @brief Constuctor * @param[in] begin - iterator to the first transformer * @param[out] end - iterator to the element after last transformer */ PipeChainTransformer(TransformerIterator begin, TransformerIterator end); /** * @brief Implements transformation function * @param[in] chain - chain to convert */ Chain ForwardTransform(Chain& chain) const; /** * @brief Implements backward transformation function * @param[in] transformedPredictedStates - predicted states for transformed chain * @param[out] result - predicted states for initial chain */ vector<int> BackwardTransform( const vector<int>& transformedPredictedStates) const; /** * @brief Abstract method: should transfrom predicted weights of transformed chain * into predicted weights of initial chain * @param[in] transformedPredictedStates - predicted states for transformed chain * @param[out] result - predicted weights for initial chain */ vector<double> BackwardTransform( const vector<double>& transformedPredictedStates) const; private: vector<shared_ptr<IChainTransformer> > transformers; }; template <class TransformerIterator> PipeChainTransformer<TransformerIterator>::PipeChainTransformer( TransformerIterator begin, TransformerIterator end) : transformers(begin, end) { } template <class TransformerIterator> Chain PipeChainTransformer<TransformerIterator>::ForwardTransform ( Chain& chain) const { Chain transformed = std::move(chain); for (auto iter = transformers.begin() ; iter != transformers.end(); ++iter) { transformed = (*iter)->ForwardTransform(transformed); } return transformed; } template <class TransformerIterator> vector<int> PipeChainTransformer<TransformerIterator>::BackwardTransform( const vector<int>& transformedPredictedStates) const { vector<int> predictedStates = transformedPredictedStates; for (auto iter = transformers.rbegin() ; iter != transformers.rend(); ++iter) { predictedStates = (*iter)->BackwardTransform(predictedStates); } return predictedStates; } template <class TransformerIterator> vector<double> PipeChainTransformer<TransformerIterator>::BackwardTransform( const vector<double>& transformedPredictedStates) const { vector<double> predictedStates = transformedPredictedStates; for (auto iter = transformers.rbegin() ; iter != transformers.rend(); ++iter) { predictedStates = (*iter)->BackwardTransform(predictedStates); } return predictedStates; } }; #endif // PIPE_CHAIN_TRANSFORMER
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/dynamodb/DynamoDB_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace DynamoDB { namespace Model { /** * <p>Represents a replica to be added.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateReplicaAction">AWS * API Reference</a></p> */ class AWS_DYNAMODB_API CreateReplicaAction { public: CreateReplicaAction(); CreateReplicaAction(Aws::Utils::Json::JsonView jsonValue); CreateReplicaAction& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The Region of the replica to be added.</p> */ inline const Aws::String& GetRegionName() const{ return m_regionName; } /** * <p>The Region of the replica to be added.</p> */ inline bool RegionNameHasBeenSet() const { return m_regionNameHasBeenSet; } /** * <p>The Region of the replica to be added.</p> */ inline void SetRegionName(const Aws::String& value) { m_regionNameHasBeenSet = true; m_regionName = value; } /** * <p>The Region of the replica to be added.</p> */ inline void SetRegionName(Aws::String&& value) { m_regionNameHasBeenSet = true; m_regionName = std::move(value); } /** * <p>The Region of the replica to be added.</p> */ inline void SetRegionName(const char* value) { m_regionNameHasBeenSet = true; m_regionName.assign(value); } /** * <p>The Region of the replica to be added.</p> */ inline CreateReplicaAction& WithRegionName(const Aws::String& value) { SetRegionName(value); return *this;} /** * <p>The Region of the replica to be added.</p> */ inline CreateReplicaAction& WithRegionName(Aws::String&& value) { SetRegionName(std::move(value)); return *this;} /** * <p>The Region of the replica to be added.</p> */ inline CreateReplicaAction& WithRegionName(const char* value) { SetRegionName(value); return *this;} private: Aws::String m_regionName; bool m_regionNameHasBeenSet; }; } // namespace Model } // namespace DynamoDB } // namespace Aws
// // Created by Pedro Soares on 26/03/17. // #ifndef COMPOSITOR_Downloader_H #define COMPOSITOR_Downloader_H #include <iostream> #include <curlpp/cURLpp.hpp> #include <curlpp/Easy.hpp> #include <curlpp/Options.hpp> #include <nlohmann/json/json.hpp> #include "../Controller/ProgressCallback.h" using namespace std; using json = nlohmann::json; class Downloader { public: Downloader(string nome, string url); ostringstream Baixar(); private: string nome; string url; }; #endif //COMPOSITOR_Downloader_H
#ifndef debug_header #define debug_header void telemetry(); String padding(String text, int size); #endif
/* Copyright 2014 Software Reliability Lab, ETH Zurich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef N2_INFERENCE_H__ #define N2_INFERENCE_H__ #include <mutex> #include <string> #include <map> #include "jsoncpp/json/json.h" // Abstract classes for inference. // A single query to be asked. class Nice2Query { public: virtual ~Nice2Query(); virtual void FromJSON(const Json::Value& query) = 0; }; struct PrecisionStats { PrecisionStats() : correct_labels(0), incorrect_labels(0), num_known_predictions(0) {} void AddStats(const PrecisionStats& o) { correct_labels += o.correct_labels; incorrect_labels += o.incorrect_labels; num_known_predictions += o.num_known_predictions; } int correct_labels; // When making an unknown prediction, this is considered an incorrect label. int incorrect_labels; // Only includes labels that were predicted not be unknown. int num_known_predictions; std::mutex lock; }; struct SingleLabelErrorStats { std::map<std::string, int> errors_and_counts; std::mutex lock; }; // Assigned results for the query (including the pre-assigned values). class Nice2Assignment { public: virtual ~Nice2Assignment(); // Used for maximum margin training. virtual void SetUpEqualityPenalty(double penalty) = 0; virtual void ClearPenalty() = 0; virtual void FromJSON(const Json::Value& assignment) = 0; virtual void ToJSON(Json::Value* assignment) const = 0; // Deletes all labels that must be inferred (does not affect the given known labels). virtual void ClearInferredAssignment() = 0; // Compare two assignments (it is assumed the two assignments are for the same Nice2Query). virtual void CompareAssignments(const Nice2Assignment* reference, PrecisionStats* stats) const = 0; // Compare two assignments and return the label errors observed in them. virtual void CompareAssignmentErrors(const Nice2Assignment* reference, SingleLabelErrorStats* error_stats) const = 0; }; class Nice2Inference { public: virtual ~Nice2Inference(); virtual void LoadModel(const std::string& file_prefix) = 0; virtual void SaveModel(const std::string& file_prefix) = 0; virtual Nice2Query* CreateQuery() const = 0; virtual Nice2Assignment* CreateAssignment(Nice2Query* query) const = 0; // Updates assignment with the most likely assignment (assignment with highest score). // Must be called after PrepareForInference virtual void MapInference( const Nice2Query* query, Nice2Assignment* assignment) const = 0; // Gets the score of a given assignment. virtual double GetAssignmentScore(const Nice2Assignment* assignment) const = 0; // Method containing common initializations between the different learning algorithms virtual void InitializeFeatureWeights(double regularization) = 0; // Initializes SSVM learning. virtual void SSVMInit(double margin) = 0; // Initializes PL learning virtual void PLInit(int beam_size) = 0; // Train on a single query + assignment of properties. // PrepareForInference and SSVMInit must have been called before SSVMLearn. // // Implementations of this method (and only this method) are typically thread-safe // allowing for multiple training data instances to be processed at once (via Hogwild training). virtual void SSVMLearn( const Nice2Query* query, const Nice2Assignment* assignment, double learning_rate, PrecisionStats* stats) = 0; // This method executes a training based on the optimization of the pseudolikelihood virtual void PLLearn( const Nice2Query* query, const Nice2Assignment* assignment, double learning_rate) = 0; // All queries that a SSVM should learn from must be given first with AddQueryToModel. // This is to ensure all the relevant features are added to the model. virtual void AddQueryToModel(const Json::Value& query, const Json::Value& assignment) = 0; // Must be called [at least] once before calling SSVMLearn or MapInference. virtual void PrepareForInference() = 0; // DEBUG methods. // Given a query and an assignment, return a graph to visualize the query. virtual void DisplayGraph( const Nice2Query* query, const Nice2Assignment* assignment, Json::Value* graph) const = 0; }; #endif
/** @file Algorithms.h @author Lime Microsystems @brief Header for Algorithms.cpp */ #ifndef ALGORITHMS_H #define ALGORITHMS_H class ConnectionManager; enum {MIMO_A, MIMO_B, MIMO_BOTH}; enum {//RBB Band_id RBB_1_4MHZ, RBB_3_0MHZ, RBB_5_0MHZ, RBB_10_0MHZ, RBB_15_0MHZ, RBB_20MHZ, //Low Band RBB_37_0MHZ, RBB_66_0MHZ, RBB_108_0MHZ, //High Band RBB_ALL }; enum {//TBB Band_id TBB_11_0MHZ,//Low Band //not all TBB_18_5MHZ, TBB_38_0MHZ, TBB_54_0MHZ, //High Band TBB_ALL }; class LMS7002_MainControl; /** @class Algorithms @brief Class containing all calibration and tuning algorithms */ class Algorithms { public: Algorithms(LMS7002_MainControl *pControl); ~Algorithms(); void Modify_SPI_Reg_bits (unsigned short SPI_reg_addr, unsigned char MSB_bit, unsigned char LSB_bit, unsigned short new_bits_data); unsigned short Get_SPI_Reg_bits (unsigned short SPI_reg_addr, unsigned char MSB_bit, unsigned char LSB_bit); void Modify_SPI_Reg_mask(const unsigned short addr[], const unsigned short masks[], const unsigned short value[], unsigned char start, unsigned char end); //Calibrated and corrected control values unsigned short RBB_CBANK[MIMO_BOTH][RBB_ALL]; unsigned char RBB_RBANK[MIMO_BOTH], TBB_CBANK[MIMO_BOTH], TBB_RBANK[MIMO_BOTH][TBB_ALL]; void MIMO_Ctrl (unsigned char ch); int VCO_CoarseTuning_SXT_SXR (float Fref_MHz, float Fvco_des_MHz, unsigned char ch); int VCO_Tuning_SXT_SXR (bool Rx); int VCO_CoarseTuning_CGEN (float Fref_MHz, float Fvco_des); int VCO_Tuning_CGEN (); float Resistor_calibration (); void Set_NCO_Freq (float Freq_MHz, float refClk_MHz, bool Rx); //RBB int Calibration_LowBand_RBB (unsigned char ch); int Calibration_HighBand_RBB (unsigned char ch); //TBB int Calibration_LowBand_TBB (unsigned char ch); int Calibration_HighBand_TBB (unsigned char ch); int DCCalibrationRX(char config, int *resultI = 0, int *resultQ = 0); int DCCalibrationRX_RSSI(char config); int DCCalibrationTX_PDET(); int DCCalibrationTX_RFLOOP(char config); int DCCalibrationTX_RFLOOP_MCU(char config); int DCCalibrationTX_PDET_config(); void LoadDCIQ(unsigned short I, unsigned short Q); int DetectRXSaturation(); int FixRXSaturation(); int VCO_Tuning(char module); // 0-cgen, 1-SXR, 2-SXT int TXIQCalibration_setup(); int TXIQCalibration(); int RXIQCalibration_setup(); int RXIQCalibration(); int DemoCalibration(int stage); void InitDemoStages(); void ReadRSSIField(int minI, int maxI, int stepI, int minQ, int maxQ, int stepQ, int avgCnt); unsigned long FindMinRSSI2(unsigned short adr1, char msb1, char lsb1, unsigned short adr2, char msb2, char lsb2, int &result1, int &result2); unsigned long FindMinRSSI(unsigned short addr, char msb, char lsb, int startValue, int *result, const char staleLimit, char twoCompl, int stepMult = 1); int SetFrequency(char Rx, float refClk_MHz, float freq_MHz); int SetFrequencyCGEN(float refClk_MHz, float freq_MHz, unsigned long *Nint=0, unsigned long *Nfrac=0, char *iHdiv=0); float GetFrequencySX(bool Rx); float GetFrequencyCGEN(); void CallMCU(int data); int WaitForMCU(); void SetDefaults(unsigned short sAddr, unsigned short eAddr); protected: void Set_DCOFF(char offsetI, char offsetQ); void BackupRegisters(const unsigned short *addrs, unsigned short *values, unsigned char start, unsigned char stop); void RestoreRegisters(const unsigned short *addrs, unsigned short *values, unsigned char start, unsigned char stop); void flipCapture(); void Set_cal_path_RBB (unsigned char path_no); void Set_cal_path_TBB (unsigned char path_no); void Algorithm_A_RBB(); unsigned short Algorithm_B_RBB(); void Algorithm_F_RBB(unsigned char Band_id); void Algorithm_A_TBB(); unsigned short Algorithm_B_TBB(); void Algorithm_C_TBB(unsigned char Band_id); int Algorithm_D_TBB(unsigned char Band_id); void Algorithm_E_TBB(unsigned char Band_id); ConnectionManager *m_serPort; ///Connection manager which will be used for data writing and reading LMS7002_MainControl *lmsControl; }; #endif // ALGORITHMS_h
// Copyright 2012-2016 Google // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // convenience classes to easily construct a memory index #ifndef EMRE_INDEXERS_MEMORY_INDEXER_H_ // NOLINT #define EMRE_INDEXERS_MEMORY_INDEXER_H_ #include "memory_vector.h" // NOLINT #include "vector_indexer.h" // NOLINT namespace emre { class MemoryIndexBuilder : public VectorIndexBuilder { public: explicit MemoryIndexBuilder(const std::string& feature_family, int size_hint = 0) : VectorIndexBuilder(feature_family, new MemoryVectorBuilderInt32(), new MemoryVectorBuilder<std::string>(), new MemoryVectorBuilder<int64>(), new MemoryVectorBuilder<double>()) {} ~MemoryIndexBuilder() {} }; class MemoryIndexReader : public VectorIndexReader { public: explicit MemoryIndexReader(VectorIndexReader* index) : VectorIndexReader( index->GetFeatureFamily(), new MemoryVectorReader<int32>(index->level_reader_.get())) { if (index->scaling_reader_ != nullptr) { scaling_reader_.reset( new MemoryVectorReader<double>(index->scaling_reader_.get())); } if (index->str_level_map_reader_ != nullptr) { str_level_map_reader_.reset( new MemoryVectorReader<std::string>(index->str_level_map_reader_.get())); str_level_map_itr_ = str_level_map_reader_->GetIterator(); } if (index->int64_level_map_reader_ != nullptr) { int64_level_map_reader_.reset(new MemoryVectorReader<int64>( index->int64_level_map_reader_.get())); int64_level_map_itr_ = int64_level_map_reader_->GetIterator(); } } }; } // namespace emre #endif // EMRE_INDEXERS_MEMORY_INDEXER_H_ // NOLINT
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Array struct Il2CppArray; #include "mscorlib_System_ValueType4014882752.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array/InternalEnumerator`1<UnityEngine.Object> struct InternalEnumerator_1_t3785842291 { public: // System.Array System.Array/InternalEnumerator`1::array Il2CppArray * ___array_0; // System.Int32 System.Array/InternalEnumerator`1::idx int32_t ___idx_1; public: inline static int32_t get_offset_of_array_0() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t3785842291, ___array_0)); } inline Il2CppArray * get_array_0() const { return ___array_0; } inline Il2CppArray ** get_address_of_array_0() { return &___array_0; } inline void set_array_0(Il2CppArray * value) { ___array_0 = value; Il2CppCodeGenWriteBarrier(&___array_0, value); } inline static int32_t get_offset_of_idx_1() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t3785842291, ___idx_1)); } inline int32_t get_idx_1() const { return ___idx_1; } inline int32_t* get_address_of_idx_1() { return &___idx_1; } inline void set_idx_1(int32_t value) { ___idx_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
// // ZJPhotoBrowserCell.h // test--图片浏览器 // // Created by YZJ on 15/6/29. // Copyright (c) 2015年 YZJ. All rights reserved. // #import <UIKit/UIKit.h> #import "ZJPhotoModel.h" @class ZJPhotoBrowserCell; @protocol ZJPhotoBrowserCellDelegate <NSObject> @optional; - (void)photoBrowserCellWillHide:(ZJPhotoBrowserCell *)cell; @end @interface ZJPhotoBrowserCell : UICollectionViewCell @property (nonatomic, weak) UIViewController *controller; @property (nonatomic, strong) ZJPhotoModel *model; @property (nonatomic, weak) id <ZJPhotoBrowserCellDelegate> delegate; /** 动画的展示出来 */ - (void)showImageAnimated; @end
/* simulated SC MSP register */ #include "sicortex/ice9/ice9_scb_spec_sw.h" #define SCMSPBASE (ICE9_RA_ScbAtnChip) #define SCMSPEND (ICE9_RAE_ScbAtnChip) #define SCMSPSIZE (SCMSPEND - SCMSPBASE)
/* This file is part of MAMBO, a low-overhead dynamic binary modification tool: https://github.com/beehive-lab/mambo Copyright 2017 The University of Manchester Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <stdint.h> #include <stdbool.h> typedef uintptr_t addr_t; typedef enum { REPLACE_RANDOM, REPLACE_LRU, } cachesim_policy; typedef struct { addr_t tag; uint64_t timestamp; } cachesim_model_line_t; typedef struct { uint64_t references[2]; uint64_t misses[2]; uint64_t writebacks[2]; } cachesim_stats_t; typedef struct cachesim_model cachesim_model_t; #define CACHESIM_NAME_LEN 20 struct cachesim_model { char name[CACHESIM_NAME_LEN]; unsigned size; unsigned line_size; unsigned max_fetch; unsigned assoc; cachesim_policy replacement_policy; unsigned sets; unsigned set_shift; unsigned set_mask; unsigned tag_shift; unsigned max_fetch_shift; addr_t last_addr; int last_line; pthread_mutex_t mutex; cachesim_model_t *parent; cachesim_stats_t stats; cachesim_model_line_t *lines; }; int cachesim_model_init(cachesim_model_t *cache, char *name, unsigned size, unsigned line_size, unsigned max_fetch, unsigned assoc, cachesim_policy repl_policy); void cachesim_model_free(cachesim_model_t *cache); int cachesim_ref(cachesim_model_t *cache, addr_t addr, unsigned size, bool is_write); void cachesim_print_stats(cachesim_model_t *cache);
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import "TiProxy.h" // main interface for File-based proxies -- this is in the API // since Filesystem implements it but we want to be able to have other // modules be able to cast to it transparently (such as database) // but without causing a compile-time dependency on Filesystem module @interface TiFile : TiProxy { @protected NSString *path; BOOL deleteOnExit; } @property(nonatomic,readonly) NSString *path; @property(nonatomic,readonly) unsigned long long size; -(id)initWithPath:(NSString*)path; -(id)initWithTempFilePath:(NSString*)path; +(TiFile*)createTempFile:(NSString*)extension; -(id)blob; -(id)toBlob:(id)args; @end
/* * Copyright (C) 2012 Adobe Systems Incorporated. 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 HOLDER “AS IS” AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 CustomFilterParameter_h #define CustomFilterParameter_h #include "wtf/PassRefPtr.h" #include "wtf/RefCounted.h" #include "wtf/text/WTFString.h" namespace WebCore { class CustomFilterParameter : public RefCounted<CustomFilterParameter> { public: // FIXME: Implement other parameters types: // booleans: https://bugs.webkit.org/show_bug.cgi?id=76438 // textures: https://bugs.webkit.org/show_bug.cgi?id=71442 // 3d-transforms: https://bugs.webkit.org/show_bug.cgi?id=71443 // mat2, mat3, mat4: https://bugs.webkit.org/show_bug.cgi?id=71444 enum ParameterType { ARRAY, NUMBER, TRANSFORM }; virtual ~CustomFilterParameter() { } ParameterType parameterType() const { return m_type; } const String& name() const { return m_name; } bool isSameType(const CustomFilterParameter& other) const { return parameterType() == other.parameterType(); } virtual PassRefPtr<CustomFilterParameter> blend(const CustomFilterParameter*, double progress) = 0; virtual bool operator==(const CustomFilterParameter&) const = 0; bool operator!=(const CustomFilterParameter& o) const { return !(*this == o); } protected: CustomFilterParameter(ParameterType type, const String& name) : m_name(name) , m_type(type) { } private: String m_name; ParameterType m_type; }; } // namespace WebCore #endif // CustomFilterParameter_h
#ifndef DSA_BROKER_ROOT_H #define DSA_BROKER_ROOT_H #if defined(_MSC_VER) #pragma once #endif #include "responder/node_model.h" namespace dsa { class RemoteNodeGroup; class DsBroker; class BrokerPubRoot; class BrokerRoot : public NodeModel { friend class DsBroker; ref_<RemoteNodeGroup> _downstream_root; ref_<RemoteNodeGroup> _upstream_root; ref_<DsBroker> _broker; ref_<BrokerPubRoot> _pub; ref_<NodeModel> _sys; public: BrokerRoot(const LinkStrandRef &strand, ref_<DsBroker>&& broker); ~BrokerRoot() override; BrokerPubRoot& get_pub() { return *_pub; } NodeModel& get_sys() { return *_sys; } protected: void destroy_impl() final; }; } #endif // DSA_BROKER_ROOT_H
/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ /** * @file visualization_manager.h * @brief */ #pragma once #include <atomic> #include <list> #include <map> #include <string> #include <thread> #include <utility> #include <vector> #include "modules/common/util/eigen_defs.h" #include "modules/localization/msf/local_tool/local_visualization/engine/visualization_engine.h" namespace apollo { namespace localization { namespace msf { struct LidarVisFrame { /**@brief The frame index. */ unsigned int frame_id; /**@brief The time stamp. */ double timestamp; /**@brief The 3D point cloud in this frame. */ ::apollo::common::EigenVector3dVec pt3ds; }; struct LocalizationMsg { double timestamp = 0.0; double x = 0; double y = 0; double z = 0; double qx = 0.0; double qy = 0.0; double qz = 0.0; double qw = 0.0; double std_x = 0; double std_y = 0; double std_z = 0; LocalizationMsg interpolate(const double scale, const LocalizationMsg &loc_msg) { LocalizationMsg res; res.x = this->x * (1 - scale) + loc_msg.x * scale; res.y = this->y * (1 - scale) + loc_msg.y * scale; res.z = this->z * (1 - scale) + loc_msg.z * scale; Eigen::Quaterniond quatd1(this->qw, this->qx, this->qy, this->qz); Eigen::Quaterniond quatd2(loc_msg.qw, loc_msg.qx, loc_msg.qy, loc_msg.qz); Eigen::Quaterniond res_quatd = quatd1.slerp(scale, quatd2); res.qx = res_quatd.x(); res.qy = res_quatd.y(); res.qz = res_quatd.z(); res.qw = res_quatd.w(); res.std_x = this->std_x * (1 - scale) + loc_msg.std_x * scale; res.std_y = this->std_y * (1 - scale) + loc_msg.std_y * scale; res.std_z = this->std_z * (1 - scale) + loc_msg.std_z * scale; return res; } }; template <class MessageType> class MessageBuffer { public: typedef typename std::list<std::pair<double, MessageType>>::iterator ListIterator; public: explicit MessageBuffer(int capacity); ~MessageBuffer(); bool PushNewMessage(const double timestamp, const MessageType &msg); bool PopOldestMessage(MessageType *msg); bool GetMessageBefore(const double timestamp, MessageType *msg); bool GetMessage(const double timestamp, MessageType *msg); void Clear(); void SetCapacity(const unsigned int capacity); void GetAllMessages(std::list<std::pair<double, MessageType>> *msg_list); bool IsEmpty(); unsigned int BufferSize(); protected: std::map<double, ListIterator> msg_map_; std::list<std::pair<double, MessageType>> msg_list_; protected: pthread_mutex_t buffer_mutex_; unsigned int capacity_; }; template <class MessageType> class IntepolationMessageBuffer : public MessageBuffer<MessageType> { public: typedef typename std::list<std::pair<double, MessageType>>::iterator ListIterator; public: explicit IntepolationMessageBuffer(int capacity); ~IntepolationMessageBuffer(); bool QueryMessage(const double timestamp, MessageType *msg, double timeout_s = 0.01); private: bool WaitMessageBufferOk(const double timestamp, std::map<double, ListIterator> *msg_map, std::list<std::pair<double, MessageType>> *msg_list, double timeout_ms); }; struct VisualizationManagerParams { EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::string map_folder; std::string map_visual_folder; Eigen::Affine3d velodyne_extrinsic; VisualMapParam map_param; unsigned int lidar_frame_buffer_capacity; unsigned int gnss_loc_info_buffer_capacity; unsigned int lidar_loc_info_buffer_capacity; unsigned int fusion_loc_info_buffer_capacity; }; class VisualizationManager { #define LOC_INFO_NUM 3 public: VisualizationManager(); ~VisualizationManager(); static VisualizationManager &GetInstance() { static VisualizationManager visual_manage; return visual_manage; } bool Init(const std::string &map_folder, const std::string &map_visual_folder, const Eigen::Affine3d &velodyne_extrinsic, const VisualMapParam &map_param); bool Init(const VisualizationManagerParams &params); void AddLidarFrame(const LidarVisFrame &lidar_frame); void AddGNSSLocMessage(const LocalizationMsg &gnss_loc_msg); void AddLidarLocMessage(const LocalizationMsg &lidar_loc_msg); void AddFusionLocMessage(const LocalizationMsg &fusion_loc_msg); void StartVisualization(); void StopVisualization(); private: void DoVisualize(); bool GetZoneIdFromMapFolder(const std::string &map_folder, const unsigned int resolution_id, int *zone_id); private: VisualizationEngine visual_engine_; // Visualization Thread std::thread visual_thread_; std::atomic<bool> stop_visualization_; MessageBuffer<LidarVisFrame> lidar_frame_buffer_; IntepolationMessageBuffer<LocalizationMsg> gnss_loc_info_buffer_; IntepolationMessageBuffer<LocalizationMsg> lidar_loc_info_buffer_; IntepolationMessageBuffer<LocalizationMsg> fusion_loc_info_buffer_; }; } // namespace msf } // namespace localization } // namespace apollo
/* * Copyright (©) 2015 Lucas Maugère, Thomas Mijieux * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdlib.h> #include <glib.h> #include "osux/stack.h" struct osux_stack_ { GList *l; unsigned size; }; unsigned osux_stack_size(osux_stack const *s) { return s->size; } osux_stack *osux_stack_new(void) { osux_stack *s = g_malloc0(sizeof*s); return s; } void osux_stack_push(osux_stack *s, gpointer data) { ++ s->size; s->l = g_list_prepend(s->l, data); } gpointer osux_stack_head(osux_stack const *s) { g_assert(s->l != NULL); return s->l->data; } gpointer osux_stack_pop(osux_stack *s) { g_assert(s->l != NULL); -- s->size; void *data = s->l->data; s->l = g_list_delete_link(s->l, s->l); return data; } bool osux_stack_is_empty(osux_stack const *s) { return s->size == 0; } void osux_stack_delete(osux_stack *s) { g_list_free(s->l); s->l = (gpointer) 0xdeadbeefcafebabe; // garbage memory s->size = 0xDEADBEEF; g_free(s); }
// =================================================== // WARNING: THIS IS A GENERATED FILE. DO NOT EDIT! // =================================================== //--------------------------------------------------------------------------------------- // Smile Programming Language Interpreter // Copyright 2004-2019 Sean Werkema // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //--------------------------------------------------------------------------------------- #include <smile/numeric/real64.h> #include <smile/numeric/float64.h> #include <smile/smiletypes/smileobject.h> #include <smile/smiletypes/numeric/smileinteger64.h> #include <smile/smiletypes/text/smilesymbol.h> #include <smile/smiletypes/smilelist.h> #include <smile/smiletypes/easyobject.h> #include <smile/smiletypes/text/smilechar.h> #include <smile/smiletypes/range/smilecharrange.h> SMILE_IGNORE_UNUSED_VARIABLES SMILE_EASY_OBJECT_VTABLE(SmileCharRange); SMILE_EASY_OBJECT_READONLY_SECURITY(SmileCharRange) SMILE_EASY_OBJECT_NO_CALL(SmileCharRange, "A CharRange object") SMILE_EASY_OBJECT_NO_SOURCE(SmileCharRange) SMILE_EASY_OBJECT_NO_UNBOX(SmileCharRange) SMILE_EASY_OBJECT_TOBOOL(SmileCharRange, True) SMILE_EASY_OBJECT_TOSTRING(SmileCharRange, ((obj->end >= obj->start && obj->stepping != +1 || obj->end < obj->start && obj->stepping != -1) ? String_Format("'%S'..'%S' step %ld", String_AddCSlashes(String_CreateRepeat(obj->start, 1)), String_AddCSlashes(String_CreateRepeat(obj->end, 1)), obj->stepping) : String_Format("'%S'..'%S'", String_AddCSlashes(String_CreateRepeat(obj->start, 1)), String_AddCSlashes(String_CreateRepeat(obj->end, 1)))) ) SmileCharRange SmileCharRange_Create(Byte start, Byte end, Int64 stepping) { // We MALLOC_ATOMIC here because the base is a known pointer that will never be collected. SmileCharRange smileRange = (SmileCharRange)GC_MALLOC_ATOMIC(sizeof(struct SmileCharRangeInt)); if (smileRange == NULL) Smile_Abort_OutOfMemory(); smileRange->base = (SmileObject)Smile_KnownBases.CharRange; smileRange->kind = SMILE_KIND_CHARRANGE; smileRange->vtable = SmileCharRange_VTable; smileRange->start = start; smileRange->end = end; smileRange->stepping = stepping; return smileRange; } static UInt32 SmileCharRange_Hash(SmileCharRange range) { UInt32 result; Byte start = range->start; Byte end = range->end; UInt32 stepping = (UInt32)(UInt64)range->stepping; result = Smile_ApplyHashOracle((UInt32)((UInt32)start ^ (UInt32)(end << 8) ^ (UInt32)(stepping << 16))); return result; } static SmileObject SmileCharRange_GetProperty(SmileCharRange self, Symbol propertyName) { if (propertyName == Smile_KnownSymbols.start) return (SmileObject)SmileChar_Create(self->start); else if (propertyName == Smile_KnownSymbols.end) return (SmileObject)SmileChar_Create(self->end); else if (propertyName == Smile_KnownSymbols.stepping) return (SmileObject)SmileInteger64_Create(self->stepping); else if (propertyName == Smile_KnownSymbols.length) return (SmileObject)SmileChar_Create(self->end > self->start ? self->end - self->start + 1 : self->start - self->end + 1); else return self->base->vtable->getProperty(self->base, propertyName); } static void SmileCharRange_SetProperty(SmileCharRange self, Symbol propertyName, SmileObject value) { if (propertyName == Smile_KnownSymbols.start || propertyName == Smile_KnownSymbols.end || propertyName == Smile_KnownSymbols.stepping || propertyName == Smile_KnownSymbols.length) { Smile_ThrowException(Smile_KnownSymbols.property_error, String_Format("Cannot set property \"%S\" on CharRange: Ranges are read-only objects.", SymbolTable_GetName(Smile_SymbolTable, propertyName))); } else { Smile_ThrowException(Smile_KnownSymbols.property_error, String_Format("Cannot set property \"%S\" on CharRange: This property does not exist, and ranges are not appendable objects.", SymbolTable_GetName(Smile_SymbolTable, propertyName))); } } static Bool SmileCharRange_HasProperty(SmileCharRange self, Symbol propertyName) { UNUSED(self); return (propertyName == Smile_KnownSymbols.start || propertyName == Smile_KnownSymbols.end || propertyName == Smile_KnownSymbols.stepping || propertyName == Smile_KnownSymbols.length); } static SmileList SmileCharRange_GetPropertyNames(SmileCharRange self) { SmileList head, tail; UNUSED(self); LIST_INIT(head, tail); LIST_APPEND(head, tail, SmileSymbol_Create(Smile_KnownSymbols.start)); LIST_APPEND(head, tail, SmileSymbol_Create(Smile_KnownSymbols.end)); LIST_APPEND(head, tail, SmileSymbol_Create(Smile_KnownSymbols.stepping)); LIST_APPEND(head, tail, SmileSymbol_Create(Smile_KnownSymbols.length)); return head; } static Bool SmileCharRange_CompareEqual(SmileCharRange a, SmileUnboxedData aData, SmileObject b, SmileUnboxedData bData) { if (SMILE_KIND(b) == SMILE_KIND_CHARRANGE) { return ((SmileCharRange)a)->start == ((SmileCharRange)b)->start && ((SmileCharRange)a)->end == ((SmileCharRange)b)->end && ((SmileCharRange)a)->stepping == ((SmileCharRange)b)->stepping; } else return False; } static Bool SmileCharRange_DeepEqual(SmileCharRange a, SmileUnboxedData aData, SmileObject b, SmileUnboxedData bData, PointerSet visitedPointers) { UNUSED(visitedPointers); if (SMILE_KIND(b) == SMILE_KIND_CHARRANGE) { return ((SmileCharRange)a)->start == ((SmileCharRange)b)->start && ((SmileCharRange)a)->end == ((SmileCharRange)b)->end && ((SmileCharRange)a)->stepping == ((SmileCharRange)b)->stepping; } else return False; }
/****************************************************************************** * * package: Log4Qt * file: rollingfileappender.h * created: September 2007 * author: Martin Heinrich * * * Copyright 2007 Martin Heinrich * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ #ifndef LOG4QT_ROLINGFILEAPPENDER_H #define LOG4QT_ROLINGFILEAPPENDER_H /****************************************************************************** * Dependencies ******************************************************************************/ #include "log4qt/fileappender.h" /****************************************************************************** * Declarations ******************************************************************************/ namespace Log4Qt { /*! * \brief The class RollingFileAppender extends FileAppender to backup * the log files when they reach a certain size. * * \note All the functions declared in this class are thread-safe. * * \note The ownership and lifetime of objects of this class are managed. * See \ref Ownership "Object ownership" for more details. */ class LOG4QT_EXPORT RollingFileAppender : public FileAppender { Q_OBJECT /*! * The property holds the maximum backup count used by the appender. * * The default is 1. * * \sa maxBackupIndex(), setMaxBackupIndex() */ Q_PROPERTY(int maxBackupIndex READ maxBackupIndex WRITE setMaxBackupIndex) /*! * The property holds the maximum file size used by the appender. * * The default is 10 MB (10 * 1024 * 1024). * * \sa maximumFileSize(), setMaximumFileSize() */ Q_PROPERTY(qint64 maximumFileSize READ maximumFileSize WRITE setMaximumFileSize) /*! * The property sets the maximum file size from a string value. * * \sa setMaxFileSize(), maximumFileSize() */ Q_PROPERTY(QString maxFileSize WRITE setMaxFileSize READ maximumFileSize) public: RollingFileAppender(QObject *pParent = 0); RollingFileAppender(Layout *pLayout, const QString &rFileName, QObject *pParent = 0); RollingFileAppender(Layout *pLayout, const QString &rFileName, bool append, QObject *pParent = 0); virtual ~RollingFileAppender(); private: RollingFileAppender(const RollingFileAppender &rOther); // Not implemented RollingFileAppender &operator=(const RollingFileAppender &rOther); // Not implemented public: int maxBackupIndex() const; qint64 maximumFileSize() const; void setMaxBackupIndex(int maxBackupIndex); void setMaximumFileSize(qint64 maximumFileSize); void setMaxFileSize(const QString &rMaxFileSize); protected: virtual void append(const LoggingEvent &rEvent); #ifndef QT_NO_DEBUG_STREAM /*! * Writes all object member variables to the given debug stream * \a rDebug and returns the stream. * * <tt> * %RollingFileAppender(name:"RFA" appendfile:false bufferedio:true * encoding:"" file:"/log.txt" filter: 0x0 * immediateflush:true isactive:true * isclosed:false layout:"TTCC" maxbackupindex:2 * maximumfilesize:40 referencecount:1 * threshold:"NULL" writer:0x4175af8) * </tt> * \sa QDebug, operator<<(QDebug debug, const LogObject &rLogObject) */ virtual QDebug debug(QDebug &rDebug) const; #endif // QT_NO_DEBUG_STREAM private: void rollOver(); private: int mMaxBackupIndex; qint64 mMaximumFileSize; }; /************************************************************************** * Operators, Helper **************************************************************************/ /************************************************************************** * Inline **************************************************************************/ inline int RollingFileAppender::maxBackupIndex() const { QMutexLocker locker(&mObjectGuard); return mMaxBackupIndex; } inline qint64 RollingFileAppender::maximumFileSize() const { QMutexLocker locker(&mObjectGuard); return mMaximumFileSize; } inline void RollingFileAppender::setMaxBackupIndex(int maxBackupIndex) { QMutexLocker locker(&mObjectGuard); mMaxBackupIndex = maxBackupIndex; } inline void RollingFileAppender::setMaximumFileSize(qint64 maximumFileSize) { QMutexLocker locker(&mObjectGuard); mMaximumFileSize = maximumFileSize; } } // namespace Log4Qt // Q_DECLARE_TYPEINFO(Log4Qt::RollingFileAppender, Q_COMPLEX_TYPE); // Use default #endif // LOG4QT_ROLINGFILEAPPENDER_H
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.IAsyncResult struct IAsyncResult_t2754620036; // System.AsyncCallback struct AsyncCallback_t1369114871; // System.Object struct Il2CppObject; #include "mscorlib_System_MulticastDelegate3389745971.h" #include "mscorlib_System_Reflection_CustomAttributeNamedArg3059612989.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Comparison`1<System.Reflection.CustomAttributeNamedArgument> struct Comparison_1_t1775974176 : public MulticastDelegate_t3389745971 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif
// // LQNewsList.h // 美发沙龙网 // // Created by admin on 15/8/6. // Copyright (c) 2015年 美发沙龙网. All rights reserved. // #import <Foundation/Foundation.h> @interface LQNewsList : NSObject @property (nonatomic, copy ) NSString *err_code; @property (nonatomic, copy ) NSString *err_msg; @property (nonatomic, copy ) NSString *table; @property (nonatomic, copy ) NSString *total; @property (nonatomic, copy ) NSString *pageTotal; @property (nonatomic, copy ) NSString *pageIndex; @property (nonatomic, copy ) NSString *pageSize; @property (nonatomic, copy ) NSString *info; @property (nonatomic, strong) NSArray *data; @end
/* * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include "esp_err.h" #ifdef __cplusplus extern "C" { #endif /** * @brief This helper function creates and starts a task which wraps `tud_task()`. * * The wrapper function basically wraps tud_task and some log. * Default parameters: stack size and priority as configured, argument = NULL, not pinned to any core. * If you have more requirements for this task, you can create your own task which calls tud_task as the last step. * * @retval ESP_OK run tinyusb main task successfully * @retval ESP_FAIL run tinyusb main task failed of internal error * @retval ESP_ERR_INVALID_STATE tinyusb main task has been created before */ esp_err_t tusb_run_task(void); /** * @brief This helper function stops and destroys the task created by `tusb_run_task()` * * @retval ESP_OK stop and destory tinyusb main task successfully * @retval ESP_ERR_INVALID_STATE tinyusb main task hasn't been created yet */ esp_err_t tusb_stop_task(void); #ifdef __cplusplus } #endif
// // AppDelegate.h // BBCellAnimation // // Created by Biao on 16/4/14. // Copyright © 2016年 Biao. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
// Almon David Ing // Ctr. Perceptual Systems, University of Texas at Austin // Compiled July 11, 2009 using Microsoft Visual C++ 2008 on 32-bit Windows Vista #include "mex.h" #include "math.h" #include "memory.h" #include "QuickSort.cpp" #ifndef null #define null 0 #endif //#ifndef DEBUG_MEXPRINTF // #define DEBUG_MEXPRINTF //#endif static int* QuantizeDv_Idx=null; static int nQuantizeDv_Idx=0; // This function is registered in mexAtExit() when static memory is used. It is called when Matlab exits or when a user types // "clear" or "clear mex" at the command prompt. This is necessary to clean up static memory resources. static void QuantizeDv_DeleteStaticMemory(void) { delete QuantizeDv_Idx; } //================================================================================================================================ //function Mcl_QuantizeDv(o) //-------------------------------------------------------------------------------------------------------------------------------- // This mex function assists Mcl_Exemplar and Mcl_Poly methods by quantizing decision values. // A "decision value" is a number that can be computed for each training sample using a decision function associated with a particular // category. Each category must be associated with a unique decision function, and each of these decision function is assumed (but not // required) to have an isotonic relationship with the posterior probability of memberhsip in the category. // // This procedure makes it possible to determine the posterior probability of category membership given the evaluated decision function // using a unique monotonic mapping function for each category. The output of this procedure provides an interpolation table that // defines the mapping of each category's decision value with the probability of membership in that category. // // If you have only one decision function for two categories, then you can always mimic a decision function for the second category by // transforming the output of the decision function for the first category. This transform can usually (but now always) be accomplished // by taking the negative, inverse, or 1-complement of the first decision function. For example, a linear model can be defined by the // following linear decision function where "x" is the vector coordinate of a training sample, "B" is a vector defining the slope of a // linear decision boundary, and "B0" is a scalar that defines the boundary's intercept. // f( category "1" , x ) = B * x + B0 // In this example, the linear decision function for the second category is the negative of the same function for the first category. // f( category "2" , x ) = -(B * x + B0) //-------------------------------------------------------------------------------------------------------------------------------- // NOMENCLATURE (for interpreting these comments) //---------------------------------------------------- // Ntsamp = The total number of training samples. // Ncats = The number of categories. // Nquant = The number of quantiles (bins). //-------------------------------------------------------------------------------------------------------------------------------- // INPUT (values are not changed by this mex function) //---------------------------------------------------- // o (mxArray*, Matlab structure) // A structure constructed from Mcl_Exemplar_Ctor (refer to its comments) and then run at least once through Mcl_Exemplar_Eval. //-------------------------------------------------------------------------------------------------------------------------------- // OUTPUT (pre-allocated memory will be filled with the output of this function.) //---------------------------------------------------- // o.Quant(iCat) (mxArray*, Matlab structure) // The quantization table for each iCat category is mostly completed by this function. However, o.PcMono and o.PcMonoLim are not // filled by this function. //-------------------------------------------------------------------------------------------------------------------------------- // After this function terminates, a decision value can be mapped to a posterior probability of assigning the iCat category label by // using o.Quant(iCat).Dv and o.Quant(iCat).Pc as an interpolation table. Since probabilities are computed separately for each // category (using separate decision functions), there is no guarantee that the probabilities will sum to 1.0 when a stimulus is // classified. Therefore, subsequent methods should always normalize the probabilities (making them sum to 1.0). // // Since posterior probabilities should never reach the boundaries [0.0, 1.0], it is recommended that the user set boundaries for // o.Quant(iCat).Pc(iBin) for each iBin quantile to be: // [1/Ncats/o.Quant.Weight(iBin), 1.0-(Ncats-1)/Ncats/o.Quant.Weight(iBin)] // This algorithm does not do this automatically, therefore o.Quant(iCat).Pc(iBin) can reach the boundaries of [0.0, 1.0]. // // Since quantization was used to compute the interpolation table, there will be quantization (binning) noise in o.Quant(iCat).Dv // and o.Quant(iCat).Pc. //================================================================================================================================ void Mcl_QuantizeDv(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]); void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]);
/* Thread.h - An runnable object Thread is responsable for holding the "action" for something, also, it responds if it "should" or "should not" run, based on the current time; For instructions, go to https://github.com/ivanseidel/ArduinoThread Created by Ivan Seidel Gomes, March, 2013. Released into the public domain. */ #ifndef Thread_h #define Thread_h #include <Arduino.h> #include <inttypes.h> /* Uncomment this line to enable ThreadName Strings. It might be usefull if you are loging thread with Serial, or displaying a list of threads... */ // #define USE_THREAD_NAMES 1 class Thread{ protected: // Desired interval between runs unsigned long interval; // Last runned time in Ms unsigned long last_run; // Scheduled run in Ms (MUST BE CACHED) unsigned long _cached_next_run; /* IMPORTANT! Run after all calls to run() Updates last_run and cache next run. NOTE: This MUST be called if extending this class and implementing run() method */ void runned(unsigned long time); // Default is to mark it runned "now" void runned() { runned(millis()); } // Callback for run() if not implemented void (*_onRun)(void); public: // If the current Thread is enabled or not bool enabled; // ID of the Thread (initialized from memory adr.) int ThreadID; #ifdef USE_THREAD_NAMES // Thread Name (used for better UI). String ThreadName; #endif Thread(void (*callback)(void) = NULL, unsigned long _interval = 0); // Set the desired interval for calls, and update _cached_next_run virtual void setInterval(unsigned long _interval); // Return if the Thread should be runned or not virtual bool shouldRun(unsigned long time); // Default is to check whether it should run "now" bool shouldRun() { return shouldRun(millis()); } // Callback set void onRun(void (*callback)(void)); // Runs Thread virtual void run(); }; #endif
/******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at * https://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. * * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ // // @author raver119@gmail.com // #ifndef DEV_TESTS_UNRESOLVED_OUTPUT_H #define DEV_TESTS_UNRESOLVED_OUTPUT_H #include <utility> #include <string> #include <stdexcept> namespace sd { namespace graph { class unresolved_output_exception : public std::runtime_error { public: unresolved_output_exception(std::string message); ~unresolved_output_exception() = default; static unresolved_output_exception build(std::string message, int nodeId, int outputIndex); static unresolved_output_exception build(std::string message, std::pair<int, int> &varIndex); static unresolved_output_exception build(std::string message, std::string &varName, int outputIndex); }; } } #endif //DEV_TESTS_UNRESOLVED_INPUT_H
// // CMLocation.h // MoveUp // // Created by sayyou2012 on 17/5/25. // Copyright © 2017年 sayyou2012. All rights reserved. // #import "Location.h" #import "LocationProtocolInMovingVC.h" #import "LocationProtocolInMovingTraceMapVC.h" @interface CMLocation : Location <LocationProtocolInMovingVC,LocationProtocolInMovingTraceMapVC> @end
//////////////////////////////////////////////////////////////////////////////// // GAURDS //////////////////////////////////////////////////////////////////////////////// #ifndef __A2DDISTANCESET4_H__ #define __A2DDISTANCESET4_H__ //+----------------------------------------------------------------------------- // // Class: // A2DDISTANCESET4 // // Synopsis: // Contains Component styles // //------------------------------------------------------------------------------ #include "Style.h" namespace A2D { struct A2DDISTANCESET4 { Style::Units m_leftUnits; Style::Units m_topUnits; Style::Units m_bottomUnits; Style::Units m_rightUnits; float m_left; float m_top; float m_bottom; float m_right; A2DDISTANCESET4() : m_leftUnits(Style::Units::PIXEL), m_topUnits(Style::Units::PIXEL), m_bottomUnits(Style::Units::PIXEL), m_rightUnits(Style::Units::PIXEL), m_left(0.0f), m_top(0.0f), m_bottom(0.0f), m_right(0.0f) { } }; } #endif
#ifndef NTRP_COMPLEXITY_PERF_H #define NTRP_COMPLEXITY_PERF_H /** * @file Declaration of Perf * * Copyright (C) 2010 Arthur D. Cherba * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "Tracker.h" #include "util/log.h" #include <boost/timer.hpp> #include <boost/shared_ptr.hpp> #include <boost/function.hpp> #define LOG_MODULE ::logging::LogModuleEnum::COMPLEXITY namespace complexity { typedef boost::function<long double (long double size)> TestFunction; /** * @brief Performance predictor and gatherer * This class is designed to allow flexible gathering of preformance information * for the purposes of future performance predictions. * Example * @code * { * Perf t("MainAlg",n,50); * std::cout << "Predicted time for the algorithm is " << t.predicted() << std::endl; * * // Invoke Algorithm routine 50 times * * std::cout << "Actual time taken " << t.current() << std::endl; * } // Invoke destructor of t, registering yet another measurement for MainAlg * @endcode */ class Perf { typedef void (Perf::*bool_type)() const; // private boolean type as ptr to mem fun public: /** * @brief Constructor */ Perf(const std::string& alg, double size, int nTimes); /** * @brief Destructor */ ~Perf(); /** * @brief Return predicted time in seconds */ double predicted() const; static const Equation* getEquation(const std::string& alg); /** * @brief Return time passed since construction of this object */ double current() const; static int registerAlg(const std::string& alg, boost::shared_ptr<TrackWithEqn> eqn); template <typename EQN> static int registerAlg(const std::string& alg); static boost::shared_ptr<TrackWithEqn> getTracker(const std::string& alg); static double predicted(const std::string& alg, double size, int nTimes); static void exercise(const std::string& alg, TestFunction f, double maxTime); /** * @brief Return true if this enum is set to some valid value. */ operator bool_type() const { return tracker_ ? & Perf::this_type_does_not_support_comparisons : 0; } private: boost::shared_ptr<TrackWithEqn> tracker_; double size_; int nTimes_; boost::timer tm_; void this_type_does_not_support_comparisons() const {} }; // class Perf template <typename EQN> int Perf::registerAlg(const std::string& alg) { boost::shared_ptr<TrackWithEqn> trc = Perf::getTracker(alg); if (trc) { return -1; } boost::shared_ptr<TrackWithEqn> tracker(new Tracker<EQN>()); Perf::registerAlg(alg,tracker); return 0; } } // namespace complexity #undef LOG_MODULE #endif // NTRP_COMPLEXITY_PERF_H
#ifndef __SMILE_PARSING_PARSEINCLUDE_H__ #define __SMILE_PARSING_PARSEINCLUDE_H__ #ifndef __SMILE_PARSING_PARSER_H__ #include <smile/parsing/parser.h> #endif #ifndef __SMILE_ENV_MODULES_H__ #include <smile/env/modules.h> #endif SMILE_API_FUNC ModuleInfo Stdio_Main(void); #endif
// // ViewController.h // ProjectBase // // Created by 向云飞 on 16/7/26. // Copyright © 2016年 向云飞. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include <time.h> #include <math.h> #define PI 3.141592653589793238462643383279502884197169399375105 #define PI_TIMES_2 6.283185307179586476925286766559005768394338798750210 #define PI_OVER_2 1.570796326794896619231321691639751442098584699687552 #define PI_OVER_180 0.017453292519943295769236907684886127134428718885417 #define CHUNK_READ_COUNT 1000000 inline double minimaxsin(double x) { while (x < 0.0) x += PI_TIMES_2; while (x >= PI_TIMES_2) x -= PI_TIMES_2; double s = 1.0; if (x >= PI) { x -= PI; s = -1.0; } // http://lolengine.net/blog/2011/12/21/better-function-approximations static const double a0 = 1.0, a1 = -1.666666666640169148537065260055e-1, a2 = 8.333333316490113523036717102793e-3, a3 = -1.984126600659171392655484413285e-4, a4 = 2.755690114917374804474016589137e-6, a5 = -2.502845227292692953118686710787e-8, a6 = 1.538730635926417598443354215485e-10; double x2 = x * x; return s * x * (a0 + x2 * (a1 + x2 * (a2 + x2 * (a3 + x2 * (a4 + x2 * (a5 + x2 * a6)))))); } uint64_t usec_diff(struct timeval start_time) { struct timeval tv; gettimeofday(&tv,NULL); return (uint64_t)((tv.tv_usec + tv.tv_sec*1e6) - (start_time.tv_usec + start_time.tv_sec*1e6)); } int main() { double input; double s, c; char line [15]; double * buffer; double * sin_buffer; double * cos_buffer; // do this in chunks of 1,000,000 buffer = (double*) malloc (sizeof(double) * CHUNK_READ_COUNT); sin_buffer = (double*) malloc (sizeof(double) * CHUNK_READ_COUNT); cos_buffer = (double*) malloc (sizeof(double) * CHUNK_READ_COUNT); FILE *ifp = fopen("trig.in", "r"); FILE *ofp = fopen("trig.out", "w"); int do_stuff = 1; int last_read_count = 0; int i; struct timeval start_time; gettimeofday(&start_time,NULL); uint64_t usec_math_count = 0; uint64_t usec_total = 0; while (1) { memset (buffer, 0, sizeof(double) * CHUNK_READ_COUNT); memset (sin_buffer, 0, sizeof(double) * CHUNK_READ_COUNT); memset (cos_buffer, 0, sizeof(double) * CHUNK_READ_COUNT); last_read_count = 0; // read inputs to buffer for (i=0; i<CHUNK_READ_COUNT; i++) { do_stuff = fgets (line, 15, ifp) != (char*)0; if (!do_stuff) { break; } buffer[i] = atof(line); } last_read_count = i; // do math struct timeval math_time; gettimeofday(&math_time,NULL); for (i=0; i<last_read_count; i++) { //sin_buffer[i] = minimaxsin(buffer[i] * PI_OVER_180); //cos_buffer[i] = minimaxsin(PI_OVER_2 - buffer[i] * PI_OVER_180); sin_buffer[i] = sin(buffer[i] * PI_OVER_180); cos_buffer[i] = sin(PI_OVER_2 - buffer[i] * PI_OVER_180); } usec_math_count += usec_diff(math_time); // save latest output batch for (i=0; i<last_read_count; i++) { if (cos_buffer[i] < 0.000000001 && cos_buffer[i] > -0.000000001) { fprintf(ofp, "%.7f %.7f n\n", sin_buffer[i], cos_buffer[i]); } else { fprintf(ofp, "%.7f %.7f %.7f\n", sin_buffer[i], cos_buffer[i], (sin_buffer[i]/cos_buffer[i])); } } if (!do_stuff) { break; } } fclose(ifp); fclose(ofp); usec_total += usec_diff(start_time); printf("estimated math time in usec: %llu\n", usec_math_count); printf("estimated run time in usec: %llu\n", usec_total); return 0; }
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/amplifyuibuilder/AmplifyUIBuilder_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace AmplifyUIBuilder { namespace Model { class AWS_AMPLIFYUIBUILDER_API RefreshTokenResult { public: RefreshTokenResult(); RefreshTokenResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); RefreshTokenResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The access token.</p> */ inline const Aws::String& GetAccessToken() const{ return m_accessToken; } /** * <p>The access token.</p> */ inline void SetAccessToken(const Aws::String& value) { m_accessToken = value; } /** * <p>The access token.</p> */ inline void SetAccessToken(Aws::String&& value) { m_accessToken = std::move(value); } /** * <p>The access token.</p> */ inline void SetAccessToken(const char* value) { m_accessToken.assign(value); } /** * <p>The access token.</p> */ inline RefreshTokenResult& WithAccessToken(const Aws::String& value) { SetAccessToken(value); return *this;} /** * <p>The access token.</p> */ inline RefreshTokenResult& WithAccessToken(Aws::String&& value) { SetAccessToken(std::move(value)); return *this;} /** * <p>The access token.</p> */ inline RefreshTokenResult& WithAccessToken(const char* value) { SetAccessToken(value); return *this;} /** * <p>The date and time when the new access token expires.</p> */ inline int GetExpiresIn() const{ return m_expiresIn; } /** * <p>The date and time when the new access token expires.</p> */ inline void SetExpiresIn(int value) { m_expiresIn = value; } /** * <p>The date and time when the new access token expires.</p> */ inline RefreshTokenResult& WithExpiresIn(int value) { SetExpiresIn(value); return *this;} private: Aws::String m_accessToken; int m_expiresIn; }; } // namespace Model } // namespace AmplifyUIBuilder } // namespace Aws
//===----------------------------------------------------------------------===// // // Peloton // // cuckoo_map.h // // Identification: src/include/container/cuckoo_map.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #pragma once #include <cstdlib> #include <cstring> #include <cstdio> #include "libcuckoo/cuckoohash_map.hh" namespace peloton { // CUCKOO_MAP_TEMPLATE_ARGUMENTS #define CUCKOO_MAP_TEMPLATE_ARGUMENTS template <typename KeyType, \ typename ValueType> // CUCKOO_MAP_TYPE #define CUCKOO_MAP_TYPE CuckooMap<KeyType, ValueType> CUCKOO_MAP_TEMPLATE_ARGUMENTS class CuckooMap { public: CuckooMap(); ~CuckooMap(); // Inserts a item bool Insert(const KeyType &key, ValueType value); // Extracts item with high priority bool Update(const KeyType &key, ValueType value); // Extracts the corresponding value bool Find(const KeyType &key, ValueType& value); // Delete key from the cuckoo_map bool Erase(const KeyType &key); // Checks whether the cuckoo_map contains key bool Contains(const KeyType &key); // Clears the tree (thread safe, not atomic) void Clear(); // Returns item count in the cuckoo_map size_t GetSize() const; // Checks if the cuckoo_map is empty bool IsEmpty() const; private: // cuckoo map typedef cuckoohash_map<KeyType, ValueType> cuckoo_map_t; cuckoo_map_t cuckoo_map; }; } // namespace peloton
/* * Copyright 2014-2017 Real Logic Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef AERON_DATAHEADERFLYWEIGHT_H #define AERON_DATAHEADERFLYWEIGHT_H #include <cstdint> #include <string> #include <stddef.h> #include <command/Flyweight.h> #include <concurrent/AtomicBuffer.h> #include <util/Index.h> #include "HeaderFlyweight.h" namespace aeron { namespace protocol { /** * HeaderFlyweight for Data Header * <p> * <a href="https://github.com/real-logic/Aeron/wiki/Protocol-Specification#data-frame">Data Frame</a> */ #pragma pack(push) #pragma pack(4) struct DataHeaderDefn { HeaderDefn header; std::int32_t termOffset; std::int32_t sessionId; std::int32_t streamId; std::int32_t termId; std::uint8_t data[0]; }; #pragma pack(pop) class DataHeaderFlyweight : public HeaderFlyweight { public: typedef DataHeaderFlyweight this_t; DataHeaderFlyweight(concurrent::AtomicBuffer& buffer, std::int32_t offset) : HeaderFlyweight(buffer, offset), m_struct(overlayStruct<DataHeaderDefn>(0)) { } inline std::int32_t sessionId() const { return m_struct.sessionId; } inline this_t& sessionId(std::int32_t value) { m_struct.sessionId = value; return *this; } inline std::int32_t streamId() const { return m_struct.streamId; } inline this_t& streamId(std::int32_t value) { m_struct.streamId = value; return *this; } inline std::int32_t termId() const { return m_struct.termId; } inline this_t& termId(std::int32_t value) { m_struct.termId = value; return *this; } inline std::int32_t termOffset() { return m_struct.termOffset; } inline this_t& termOffset(std::int32_t value) { m_struct.termOffset = value; return *this; } inline std::uint8_t* data() { return m_struct.data; } inline static constexpr std::int32_t headerLength() { return sizeof(DataHeaderDefn); } private: DataHeaderDefn& m_struct; }; }} #endif //AERON_DATAHEADERFLYWEIGHT_H
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * 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 itkHuangThresholdCalculator_h #define itkHuangThresholdCalculator_h #include "itkHistogramThresholdCalculator.h" namespace itk { /** \class HuangThresholdCalculator * \brief Computes the Huang's threshold for an image. * * This calculator computes the Huang's fuzzy threshold which separates an image * into foreground and background components. Uses Shannon's entropy * function (one can also use Yager's entropy function) * Huang L.-K. and Wang M.-J.J. (1995) "Image Thresholding by Minimizing * the Measures of Fuzziness" Pattern Recognition, 28(1): 41-51 * Reimplemented (to handle 16-bit efficiently) by Johannes Schindelin Jan 31, 2011 * * This class is templated over the input histogram type. * \warning This calculator assumes that the input histogram has only one dimension. * * \author Richard Beare. Department of Medicine, Monash University, * Melbourne, Australia. * \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France. * * This implementation was taken from the Insight Journal paper: * https://hdl.handle.net/10380/3279 or * http://www.insight-journal.org/browse/publication/811 * * \ingroup Operators * \ingroup ITKThresholding */ template <typename THistogram, typename TOutput=double> class HuangThresholdCalculator : public HistogramThresholdCalculator<THistogram, TOutput> { public: /** Standard class typedefs. */ typedef HuangThresholdCalculator Self; typedef Object Superclass; typedef SmartPointer<Self> Pointer; typedef SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(HuangThresholdCalculator, Object); /** Type definition for the input image. */ typedef THistogram HistogramType; typedef TOutput OutputType; protected: HuangThresholdCalculator() { m_FirstBin = 0; m_LastBin = 0; m_Size = 0; } virtual ~HuangThresholdCalculator() {} void GenerateData(void) ITK_OVERRIDE; typedef typename HistogramType::TotalAbsoluteFrequencyType TotalAbsoluteFrequencyType; typedef typename HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType; typedef typename HistogramType::InstanceIdentifier InstanceIdentifier; typedef typename HistogramType::SizeValueType SizeValueType; typedef typename HistogramType::MeasurementType MeasurementType; private: ITK_DISALLOW_COPY_AND_ASSIGN(HuangThresholdCalculator); InstanceIdentifier m_FirstBin; InstanceIdentifier m_LastBin; SizeValueType m_Size; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkHuangThresholdCalculator.hxx" #endif #endif
// Copyright 2016-2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /// Tapjoy mediation network adapter version. static NSString *const _Nonnull GADMAdapterTapjoyVersion = @"12.9.0.1"; /// Tapjoy mediation network adapter mediation agent. static NSString *const _Nonnull GADMAdapterTapjoyMediationAgent = @"admob"; /// Tapjoy mediation network adapter SDK key. static NSString *const _Nonnull GADMAdapterTapjoySdkKey = @"sdkKey"; /// Tapjoy mediation network adapter placement name key. static NSString *const _Nonnull GADMAdapterTapjoyPlacementKey = @"placementName"; /// Tapjoy mediation network adapter error domain. static NSString *const _Nonnull GADMAdapterTapjoyErrorDomain = @"com.google.mediation.tapjoy";
#include <stdio.h> #include <stdbool.h> int function(bool enter) { if(enter) { printf("I'm in!\n"); } else { printf("The answer is 42\n"); } } int main(int argc, char *argv[]) { function(argc>1); return 0; }
//===--- ASTTypeIDs.h - AST Type Ids ----------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2019 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // This file defines TypeID support for AST types. // //===----------------------------------------------------------------------===// #ifndef SWIFT_AST_ASTTYPEIDS_H #define SWIFT_AST_ASTTYPEIDS_H #include "swift/Basic/LLVM.h" #include "swift/Basic/TypeID.h" namespace swift { class AbstractFunctionDecl; class BraceStmt; class ClosureExpr; class CodeCompletionCallbacksFactory; class ConstructorDecl; class CustomAttr; class Decl; class EnumDecl; enum class FunctionBuilderBodyPreCheck : uint8_t; class GenericParamList; class GenericSignature; class GenericTypeParamType; class InfixOperatorDecl; class IterableDeclContext; class ModuleDecl; struct ImplicitImport; class NamedPattern; class NominalTypeDecl; class OperatorDecl; class OpaqueTypeDecl; class PatternBindingEntry; class ParamDecl; enum class ParamSpecifier : uint8_t; class PostfixOperatorDecl; class PrecedenceGroupDecl; class PrefixOperatorDecl; struct PropertyWrapperBackingPropertyInfo; struct PropertyWrapperTypeInfo; enum class CtorInitializerKind; struct PropertyWrapperLValueness; struct PropertyWrapperMutability; class ProtocolConformance; class ProtocolDecl; class Requirement; enum class ResilienceExpansion : unsigned; struct FragileFunctionKind; class SourceFile; struct TangentPropertyInfo; class Type; class TypeAliasDecl; struct TypePair; struct TypeWitnessAndDecl; class ValueDecl; class VarDecl; class Witness; enum class AncestryFlags : uint8_t; enum class ImplicitMemberAction : uint8_t; struct FingerprintAndMembers; class Identifier; // Define the AST type zone (zone 1) #define SWIFT_TYPEID_ZONE AST #define SWIFT_TYPEID_HEADER "swift/AST/ASTTypeIDZone.def" #include "swift/Basic/DefineTypeIDZone.h" } // end namespace swift #endif // SWIFT_AST_ASTTYPEIDS_H
/* * Copyright 2019 Volvo Cars * * 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. */ #include <csunixds.h> #include <stdio.h> #include <assert.h> int main(int argc, char *argv[]) { fprintf(stderr, "Core System Unix Domain Socket sample.\n" "Library version: \"%s\".\n", CS_VERSION_STR); // Connect //========================================================================= assert(cs_initialize(NULL) == CS_OK); // Write some signals //========================================================================= /* * 3 signals: * A = 1.0 * B = 2.0 * C = 3.0 */ const char *names[] = { "A", "B", "C" }; const cs_value_t write_values[] = { {CS_TYPE_F64, .value_f64=1.0}, {CS_TYPE_F64, .value_f64=2.0}, {CS_TYPE_F64, .value_f64=3.0}}; for (int u=0; u<5; u++) { assert(cs_write(3, names, write_values) == CS_OK); } // Read som signals //========================================================================= /* * 3 signals: * A * B * C */ cs_value_t read_values[3]; for (int u=0; u<4; u++) { assert(cs_read(3, names, read_values) == CS_OK); for (int i=0; i<3; i++) { fprintf(stderr, "[%s] = [%f]\n", names[i], read_values[i].value_f64); } } // Subscribe to event //========================================================================= assert(cs_subscribe(3, names) == CS_OK); int count = 4; cs_wait_mode_t event( int signal_count, const char *const names[], const cs_value_t values[]) { fprintf(stderr, "Got event with %d signals!\n", signal_count); for (int i=0; i<signal_count; i++) { fprintf(stderr, "[%s] = [%f]\n", names[i], values[i].value_f64); } count--; if (count > 0) { fprintf(stderr, "Continue block!\n"); return CS_BLOCK_CONTINUE; } else { fprintf(stderr, "Stop block!\n"); return CS_BLOCK_STOP; } } cs_event_loop(event); // Shut down connection //========================================================================= assert(cs_shutdown() == CS_OK); return 0; }
// // LoginViewController.h // delicacy-kitchen // // Created by 舒志凌 on 16/8/4. // Copyright © 2016年 Winner. All rights reserved. // #import <UIKit/UIKit.h> @interface LoginViewController : UIViewController @end
/* * Copyright (c) 2015-2021 Hanspeter Portner (dev@open-music-kontrollers.ch) * * This is free software: you can redistribute it and/or modify * it under the terms of the Artistic License 2.0 as published by * The Perl Foundation. * * This source 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 * Artistic License 2.0 for more details. * * You should have received a copy of the Artistic License 2.0 * along the source as a COPYING file. If not, obtain it from * http://www.perlfoundation.org/artistic_license_2_0. */ #ifndef _MOONY_API_TIME_H #define _MOONY_API_TIME_H #include <moony.h> int _ltimeresponder(lua_State *L); int _ltimeresponder_apply(lua_State *L); int _ltimeresponder_stash(lua_State *L); extern const luaL_Reg ltimeresponder_mt []; #endif
/* The JTAG Whisperer: An Arduino library for JTAG. By Mike Tsao <http://github.com/sowbug>. Copyright © 2012 Mike Tsao. Use, modification, and distribution are subject to the BSD-style license as described in the accompanying LICENSE file. See README for complete attributions. */ #ifndef INCLUDE_JTAG_WHISPERER_BIT_TWIDDLER_H #define INCLUDE_JTAG_WHISPERER_BIT_TWIDDLER_H #include <Arduino.h> // Knows how to set MCU-specific pins in a JTAG-relevant way. class BitTwiddler { public: BitTwiddler() : portb_(0) { DDRB = TMS | TDI | TCK; } inline void pulse_clock() { clr_port(TCK); delayMicroseconds(1); set_port(TCK); } bool pulse_clock_and_read_tdo() { clr_port(TCK); delayMicroseconds(1); uint8_t pinb = PINB; set_port(TCK); return pinb & TDO; } void wait_time(unsigned long microsec) { unsigned long until = micros() + microsec; while (microsec--) { pulse_clock(); } while (micros() < until) { pulse_clock(); } } void set_tms() { set_port(TMS); } void clr_tms() { clr_port(TMS); } void set_tdi() { set_port(TDI); } void clr_tdi() { clr_port(TDI); } private: enum { TMS = _BV(PINB0), // Arduino 8 TDI = _BV(PINB1), // Arduino 9 TDO = _BV(PINB2), // Arduino 10 TCK = _BV(PINB3) // Arduino 11 }; inline void write_portb_if_tck(uint8_t pin) { if (pin == TCK) { PORTB = portb_; } } inline void set_port(uint8_t pin) { portb_ |= pin; write_portb_if_tck(pin); } inline void clr_port(uint8_t pin) { portb_ &= ~pin; write_portb_if_tck(pin); } // The current PORTB state. We write this only when we twiddle TCK. uint8_t portb_; }; #endif // INCLUDE_JTAG_WHISPERER_BIT_TWIDDLER_H
/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if ENABLE(SVG) && ENABLE(FILTERS) #ifndef V8SVGFEMorphologyElement_h #define V8SVGFEMorphologyElement_h #include "SVGFEMorphologyElement.h" #include "V8DOMWrapper.h" #include "WrapperTypeInfo.h" #include <wtf/text/StringHash.h> #include <v8.h> #include <wtf/HashMap.h> namespace WebCore { class V8SVGFEMorphologyElement { public: static const bool hasDependentLifetime = true; static bool HasInstance(v8::Handle<v8::Value> value); static v8::Persistent<v8::FunctionTemplate> GetRawTemplate(); static v8::Persistent<v8::FunctionTemplate> GetTemplate(); static SVGFEMorphologyElement* toNative(v8::Handle<v8::Object> object) { return reinterpret_cast<SVGFEMorphologyElement*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex)); } inline static v8::Handle<v8::Object> wrap(SVGFEMorphologyElement*); static void derefObject(void*); static WrapperTypeInfo info; static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; private: static v8::Handle<v8::Object> wrapSlow(SVGFEMorphologyElement*); }; v8::Handle<v8::Object> V8SVGFEMorphologyElement::wrap(SVGFEMorphologyElement* impl) { v8::Handle<v8::Object> wrapper = V8DOMWrapper::getWrapper(impl); if (!wrapper.IsEmpty()) return wrapper; return V8SVGFEMorphologyElement::wrapSlow(impl); } inline v8::Handle<v8::Value> toV8(SVGFEMorphologyElement* impl) { if (!impl) return v8::Null(); return V8SVGFEMorphologyElement::wrap(impl); } inline v8::Handle<v8::Value> toV8(PassRefPtr< SVGFEMorphologyElement > impl) { return toV8(impl.get()); } } #endif // V8SVGFEMorphologyElement_h #endif // ENABLE(SVG) && ENABLE(FILTERS)
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #ifndef _NGX_CRYPT_H_INCLUDED_ #define _NGX_CRYPT_H_INCLUDED_ #include <ngx_config.h> #include <ngx_core.h> ngx_int_t ngx_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted); #endif /* _NGX_CRYPT_H_INCLUDED_ */
// // MainViewController.h // GLParticles1 // // Created by GRITS on 3/14/14. // Copyright (c) 2014 GRITS. All rights reserved. // #import <UIKit/UIKit.h> #import <GLKit/GLKit.h> #define IPAD_X_RESOLUTION 1024 #define IPAD_Y_RESOLUTION 768 @interface MainViewController : GLKViewController //- (void)tapDetected:(UITapGestureRecognizer *)sender; //- (IBAction)rotationDetected:(UIRotationGestureRecognizer *)sender; //- (IBAction)pinchDetected:(UIPinchGestureRecognizer *)sender; //- (IBAction)swipeDetected:(UISwipeGestureRecognizer *)sender; //- (IBAction)longPressDetected:(UILongPressGestureRecognizer *)sender; @end
/* Copyright 2009-2011 Urban Airship Inc. 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 binaryform must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided withthe distribution. THIS SOFTWARE IS PROVIDED BY THE URBAN AIRSHIP INC ``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 URBAN AIRSHIP INC 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. */ #import <Foundation/Foundation.h> #import "UADownloadManager.h" #import "UALocalStorageDirectory.h" #define kSubscriptionURLCacheFile [[UALocalStorageDirectory uaDirectory].path stringByAppendingPathComponent:@"/subsURLCache.plist"] #define kPendingSubscriptionContentFile [[UALocalStorageDirectory uaDirectory].path stringByAppendingPathComponent:@"/pendingSubscriptions.history"] #define kDecompressingSubscriptionContentFile [[UALocalStorageDirectory uaDirectory].path stringByAppendingPathComponent:@"/decompressingSubscriptions.history"] @class UAContentURLCache; @class UASubscriptionContent; /** * This class handles subscription downloads and decompression. */ @interface UASubscriptionDownloadManager : NSObject <UADownloadManagerDelegate> { @private NSMutableArray *pendingSubscriptionContent; NSMutableArray *decompressingSubscriptionContent; NSMutableArray *currentlyDecompressingContent; UADownloadManager *downloadManager; NSString *downloadDirectory; UAContentURLCache *contentURLCache; BOOL createProductIDSubdir; } /** * The download directory. If not set by the user, this will return a default value. */ @property (nonatomic, retain) NSString *downloadDirectory; @property (nonatomic, retain) UAContentURLCache *contentURLCache; /** * Indicates whether to create a subscription key or product ID subdirectory for downloaded content. * Defaults to YES. */ @property (nonatomic, assign) BOOL createProductIDSubdir; @property (nonatomic, retain) NSMutableArray *pendingSubscriptionContent; @property (nonatomic, retain) NSMutableArray *decompressingSubscriptionContent; @property (nonatomic, retain) NSMutableArray *currentlyDecompressingContent; //load the pending subscriptions dictionary from kPendingSubscriptionsFile - (void)loadPendingSubscriptionContent; - (BOOL)hasPendingSubscriptionContent:(UASubscriptionContent *)subscriptionContent; - (void)resumePendingSubscriptionContent; //load the decompressing subscriptions dictionary from kDecompressingSubscriptionsFile - (void)loadDecompressingSubscriptionContent; - (BOOL)hasDecompressingSubscriptionContent:(UASubscriptionContent *)subscriptionContent; - (void)resumeDecompressingSubscriptionContent; - (void)download:(UASubscriptionContent *)content; //private library method - (void)checkDownloading:(UASubscriptionContent *)content; @end
/* Copyright (c) 2005, Regents of Massachusetts Institute of Technology, * Brandeis University, Brown University, and University of Massachusetts * Boston. All rights reserved. * * 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 following disclaimer. * - 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. * - Neither the name of Massachusetts Institute of Technology, * Brandeis University, Brown University, or University of * Massachusetts Boston nor the names of its contributors may be used * to endorse or promote products derived from this software without * specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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. */ #ifndef _JoinExpDataRunner_H_ #define _JoinExpDataRunner_H_ #include "../common/Interfaces.h" #include "../AM/AM.h" #include "../Operators/ColumnExtracter.h" #include "../Writers/RLEWriter.h" #include "../Wrappers/Encoder/RLEEncoder.h" #include "../AM/PageWriter.h" #include "../common/Constants.h" #include "../common/Util.h" #include "../Wrappers/CodingException.h" #include "../Wrappers/Decoder/RLEDecoder.h" #include "../Wrappers/Decoder/IntDecoder.h" #include "../Wrappers/Decoder/RLEDecoderII.h" #include "../Wrappers/RLEDataSource.h" #include "../Wrappers/RLEIIDataSource.h" #include "../Wrappers/DeltaPosDataSource.h" #include "../Wrappers/Encoder/DeltaPosEncoder.h" #include "../Wrappers/Encoder/IntEncoder.h" #include "../Wrappers/Encoder/RLEEncoderII.h" #include "../Wrappers/IntDataSource.h" #include "../Wrappers/Type2DataSource.h" #include "../Wrappers/DictCPUDataSource.h" #include "../Paths.h" #include "../Operators/BlockPrinter.h" #include "../Operators/NLJoin.h" #include "../Operators/Count.h" #include "../Operators/Sum.h" #include "../Operators/Int2Dict.h" #include "../AM/NOBDBAM.h" #include <ctime> #include "../UnitTests/UnitTest.h" class JoinExpDataRunner : public UnitTest { public: JoinExpDataRunner(); virtual ~JoinExpDataRunner(); bool run(Globals* g, const vector<string>& args); const char* _file; const char* _file2; }; #endif //_JoinExpDataRunner_H_
#ifndef MODELS_SESSION_H #define MODELS_SESSION_H #include "sqlite3.h" typedef struct Session { int id; int createdAt; int accountId; char *sessionId; } Session; Session *sessionNew(int, int, int, char *); Session *sessionGetBySId(sqlite3 *, char *); Session *sessionCreate(sqlite3 *, char *, char *); void sessionDel(Session *); #endif
// // DTHTMLElementTest.h // DTCoreText // // Created by Hubert SARRET on 11/04/13. // Copyright (c) 2013 Drobnik.com. All rights reserved. // #import <DTCoreText/DTCoreText.h> #import <XCTest/XCTest.h> @interface DTHTMLElementTest : XCTestCase @end
// // MenuViewController.h // PL // // Created by René Swoboda on 23/04/14. // Copyright (c) 2014 productlayer. All rights reserved. // #import <UIKit/UIKit.h> #import "ProductLayerViewController.h" @interface MenuViewController : ProductLayerViewController - (IBAction)unwindToMenu:(UIStoryboardSegue *)unwindSegue; @end
/********************************************************************************* * * Inviwo - Interactive Visualization Workshop * * Copyright (c) 2013-2016 Inviwo Foundation * 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. * *********************************************************************************/ #ifndef IVW_PYTHONEDITORYWIDGET_H #define IVW_PYTHONEDITORYWIDGET_H #include <modules/python3qt/python3qtmoduledefine.h> #include <modules/python3/pythonscript.h> #include <modules/python3/python3module.h> #include <modules/python3/pythonexecutionoutputobservable.h> #include <inviwo/core/network/processornetworkobserver.h> #include <inviwo/core/util/fileobserver.h> #include <inviwo/qt/widgets/inviwodockwidget.h> #include <warn/push> #include <warn/ignore/all> #include <QTextEdit> #include <QColor> #include <QToolButton> #include <QSettings> #include <QPlainTextEdit> #include <warn/pop> class QPlainTextEdit; namespace inviwo { class IVW_MODULE_PYTHON3QT_API PythonTextEditor : public QPlainTextEdit { public: PythonTextEditor(QWidget* parent) : QPlainTextEdit(parent) {} virtual ~PythonTextEditor() {} virtual void keyPressEvent(QKeyEvent* keyEvent); }; class InviwoMainWindow; class SyntaxHighligther; class IVW_MODULE_PYTHON3QT_API PythonEditorWidget : public InviwoDockWidget, public FileObserver, public PythonExecutionOutputObeserver { #include <warn/push> #include <warn/ignore/all> Q_OBJECT #include <warn/pop> public: PythonEditorWidget(InviwoMainWindow* parent, InviwoApplication* app); virtual ~PythonEditorWidget(); void appendToOutput(const std::string& msg, bool error = false); virtual void fileChanged(const std::string& fileName) override; void loadFile(std::string fileName, bool askForSave = true); virtual void onPyhonExecutionOutput(const std::string& msg, const PythonExecutionOutputStream& outputType) override; bool hasFocus() const; static PythonEditorWidget* getPtr(); void updateStyle(); void save(); void saveAs(); void open(); void run(); void show(); void setDefaultText(); void clearOutput(); private: QSettings settings_; PythonTextEditor* pythonCode_; QTextEdit* pythonOutput_; QColor infoTextColor_; QColor errorTextColor_; PythonScript script_; std::string scriptFileName_; bool unsavedChanges_; void readFile(); SyntaxHighligther* syntaxHighligther_; static PythonEditorWidget* instance_; public slots: void onTextChange(); }; } // namespace #endif // IVW_PYTHONEDITORYWIDGET_H
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef __LIBSEL4_ARCH_CONSTANTS_H #define __LIBSEL4_ARCH_CONSTANTS_H #include <autoconf.h> #include <sel4/sel4_arch/constants.h> #include <sel4/plat/api/constants.h> #ifndef __ASM__ #include <sel4/sel4_arch/objecttype.h> #include <sel4/arch/objecttype.h> #endif /* Currently MSIs do not go through a vt-d translation by * the kernel, therefore when the user programs an MSI they * need to know how the 'vector' they allocated relates to * the actual vector table. In this case if they allocate * vector X they need to program their MSI to interrupt * vector X + IRQ_OFFSET */ #define IRQ_OFFSET (0x20 + 16) /* When allocating vectors for IOAPIC or MSI interrupts, * this represent the valid range */ #define VECTOR_MIN (0) #define VECTOR_MAX (109) /* Legacy definitions */ #define MSI_MIN VECTOR_MIN #define MSI_MAX VECTOR_MAX #endif
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleInterface.h" #include "SceneOutlinerFwd.h" /** * Implements the Scene Outliner module. */ class FSceneOutlinerModule : public IModuleInterface { public: /** * Creates a scene outliner widget * * @param InitOptions Programmer-driven configuration for this widget instance * @param MakeContentMenuWidgetDelegate Optional delegate to execute to build a context menu when right clicking on actors * @param OnActorPickedDelegate Optional callback when an actor is selected in 'actor picking' mode * * @return New scene outliner widget */ virtual TSharedRef< ISceneOutliner > CreateSceneOutliner( const SceneOutliner::FInitializationOptions& InitOptions, const FOnActorPicked& OnActorPickedDelegate ) const; /** * Creates a scene outliner widget * * @param InitOptions Programmer-driven configuration for this widget instance * @param MakeContentMenuWidgetDelegate Optional delegate to execute to build a context menu when right clicking on actors * @param OnItemPickedDelegate Optional callback when an item is selected in 'picking' mode * * @return New scene outliner widget */ virtual TSharedRef< ISceneOutliner > CreateSceneOutliner( const SceneOutliner::FInitializationOptions& InitOptions, const FOnSceneOutlinerItemPicked& OnItemPickedDelegate ) const; public: /** Register a new type of column available to all scene outliners */ template< typename T > void RegisterColumnType() { auto ID = T::GetID(); if ( !ColumnMap.Contains( ID ) ) { auto CreateColumn = []( ISceneOutliner& Outliner ){ return TSharedRef< ISceneOutlinerColumn >( MakeShareable( new T(Outliner) ) ); }; ColumnMap.Add( ID, FCreateSceneOutlinerColumn::CreateStatic( CreateColumn ) ); } } /** Unregister a previously registered column type */ template< typename T > void UnRegisterColumnType() { ColumnMap.Remove( T::GetID() ); } /** Factory a new column from the specified name. Returns null if no type has been registered under that name. */ TSharedPtr< ISceneOutlinerColumn > FactoryColumn( FName ID, ISceneOutliner& Outliner ) const { if ( auto* Factory = ColumnMap.Find( ID ) ) { return Factory->Execute(Outliner); } return nullptr; } private: /** Map of column type name -> factory delegate */ TMap< FName, FCreateSceneOutlinerColumn > ColumnMap; public: // IModuleInterface interface virtual void StartupModule() override; virtual void ShutdownModule() override; };
/** * Copyright (c) 2015, Chao Wang <hit9@icloud.com> */ #include <assert.h> #include <stdio.h> #include "bench.h" #include "datetime.h" /** * buf_bench */ void case_buf_puts(struct bench_ctx *ctx); static struct bench_case buf_bench_cases[] = { {"buf_puts", &case_buf_puts, 10000}, {"buf_puts", &case_buf_puts, 1000000}, {NULL, NULL, 0}, }; /** * dict_bench */ void case_dict_set(struct bench_ctx *ctx); void case_dict_get(struct bench_ctx *ctx); void case_dict_pop(struct bench_ctx *ctx); static struct bench_case dict_bench_cases[] = { {"dict_set", &case_dict_set, 10000}, {"dict_set", &case_dict_set, 1000000}, {"dict_get", &case_dict_get, 10000}, {"dict_get", &case_dict_get, 1000000}, {"dict_pop", &case_dict_pop, 10000}, {"dict_pop", &case_dict_pop, 1000000}, {NULL, NULL, 0}, }; /** * heap_bench */ void case_heap_push(struct bench_ctx *ctx); void case_heap_pop(struct bench_ctx *ctx); void case_heap_top(struct bench_ctx *ctx); static struct bench_case heap_bench_cases[] = { {"heap_push", &case_heap_push, 10000}, {"heap_push", &case_heap_push, 1000000}, {"heap_pop", &case_heap_pop, 10000}, {"heap_pop", &case_heap_pop, 1000000}, {"heap_top", &case_heap_top, 10000}, {"heap_top", &case_heap_top, 1000000}, {NULL, NULL, 0}, }; /** * log_bench */ void case_log_devnull(struct bench_ctx *ctx); static struct bench_case log_bench_cases[] = { {"log_devnull", &case_log_devnull, 1000000}, {NULL, NULL, 0}, }; /** * map_bench */ void case_map_set(struct bench_ctx *ctx); void case_map_get(struct bench_ctx *ctx); void case_map_pop(struct bench_ctx *ctx); static struct bench_case map_bench_cases[] = { {"map_set", &case_map_set, 10000}, {"map_set", &case_map_set, 1000000}, {"map_get", &case_map_get, 10000}, {"map_get", &case_map_get, 1000000}, {"map_pop", &case_map_pop, 10000}, {"map_pop", &case_map_pop, 1000000}, {NULL, NULL, 0}, }; /** * skiplist_bench */ void case_skiplist_push(struct bench_ctx *ctx); void case_skiplist_get(struct bench_ctx *ctx); void case_skiplist_pop(struct bench_ctx *ctx); void case_skiplist_popfirst(struct bench_ctx *ctx); void case_skiplist_first(struct bench_ctx *ctx); static struct bench_case skiplist_bench_cases[] = { {"skiplist_push", &case_skiplist_push, 10000}, {"skiplist_push", &case_skiplist_push, 1000000}, {"skiplist_get", &case_skiplist_get, 10000}, {"skiplist_get", &case_skiplist_get, 1000000}, {"skiplist_pop", &case_skiplist_pop, 10000}, {"skiplist_pop", &case_skiplist_pop, 1000000}, {"skiplist_first", &case_skiplist_first, 10000}, {"skiplist_first", &case_skiplist_first, 1000000}, {"skiplist_popfirst", &case_skiplist_popfirst, 10000}, {"skiplist_popfirst", &case_skiplist_popfirst, 1000000}, {NULL, NULL, 0}, }; /** * strings_bench */ void case_strings_search(struct bench_ctx *ctx); void case_strings_replace(struct bench_ctx *ctx); void case_strings_rand(struct bench_ctx *ctx); static struct bench_case strings_bench_cases[] = { {"strings_search", &case_strings_search, 1000000}, {"strings_replace", &case_strings_replace, 1000000}, {"strings_rand", &case_strings_rand, 1000000}, {NULL, NULL, 0}, }; /** * bench */ void bench_ctx_reset_start_at(struct bench_ctx *ctx) { assert(ctx != NULL); ctx->start_at = datetime_stamp_now(); } void bench_ctx_reset_end_at(struct bench_ctx *ctx) { assert(ctx != NULL); ctx->end_at = datetime_stamp_now(); } static void run_cases(const char *name, struct bench_case cases[]) { int idx = 0; while (1) { struct bench_case c = cases[idx]; if (c.name == NULL || c.fn == NULL) break; fprintf(stderr, "%-17s %-20s ", name, c.name); struct bench_ctx ctx = {datetime_stamp_now(), -1, c.n}; (c.fn)(&ctx); double start_at = ctx.start_at; double end_at = ctx.end_at; if (end_at < 0) end_at = datetime_stamp_now(); idx += 1; fprintf(stderr, "%10ld%10ldns/op\n", c.n, (long)(1000000.0 * (end_at - start_at) / (double)c.n)); } } int main(int argc, const char *argv[]) { run_cases("buf_bench", buf_bench_cases); run_cases("dict_bench", dict_bench_cases); run_cases("heap_bench", heap_bench_cases); run_cases("log_stderr", log_bench_cases); run_cases("map_bench", map_bench_cases); run_cases("skiplist_bench", skiplist_bench_cases); run_cases("strings_bench", strings_bench_cases); return 0; }
/** * @file * * @date Nov 13, 2020 * @author Anton Bondarev */ #include <wchar.h> #include <wctype.h> int wcsncasecmp(const wchar_t *ws1, const wchar_t *ws2, size_t n) { wchar_t c1, c2; if (n == 0) { return 0; } for (; *ws1; ws1++, ws2++) { c1 = towlower(*ws1); c2 = towlower(*ws2); if (c1 != c2) { return ((int) c1 - c2); } if (--n == 0) { return 0; } } return (-*ws2); }