text
stringlengths
4
6.14k
#include "Constant.h" #include <cmath> #include "EcnomicThreadData.h" #include "EcnomicPair.h" #pragma warning(disable : 4482) #pragma once class CNonfarmerNumberData:public CEcnomicData { public: EcnomicResult DoAnalyse(const CString & rawStr); CNonfarmerNumberData(); CNonfarmerNumberData(const CEcnomicData& nonfarmer); } ; class CJoblessRateData:public CEcnomicData { public: EcnomicResult DoAnalyse(const CString & text); CJoblessRateData(); CJoblessRateData(const CEcnomicData & jobless); }; typedef CNonfarmerNumberData * PNonfarmerNumberData; typedef CJoblessRateData * PJoblessRateData; class CLocalServerData:public CEcnomicData { public: EcnomicResult DoAnalyse(const CString & text); CLocalServerData(); }; typedef CLocalServerData * PLocalServerData;
/* * 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/securityhub/SecurityHub_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace SecurityHub { namespace Model { enum class StringFilterComparison { NOT_SET, EQUALS, PREFIX }; namespace StringFilterComparisonMapper { AWS_SECURITYHUB_API StringFilterComparison GetStringFilterComparisonForName(const Aws::String& name); AWS_SECURITYHUB_API Aws::String GetNameForStringFilterComparison(StringFilterComparison value); } // namespace StringFilterComparisonMapper } // namespace Model } // namespace SecurityHub } // namespace Aws
#include "../atrshmlog_internal.h" /********************************************************************/ /** * \file atrshmlogimpl_logging_off_final_flag.c */ /** * \n Main code: * * \brief We have a per program switch for final log off . * * This can be used by the program to stop logging finally. * * We use this in all loop situations. So it works for the * logging even if you are stuck in a mem to shm thing. * * But you have still to wait till all threads are awakening * and recognise it. * * So this works not instantan, but with a little time shift. */ _Alignas(128) int atrshmlog_logging_process_off_final = 0;
/* * Copyright (c) 2018 <Carlos Chacón> * 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. */ #pragma once #ifndef _PHYSICS_MANAGER_H #define _PHYSICS_MANAGER_H /********************** * System Includes * ***********************/ /************************* * 3rd Party Includes * **************************/ /*************************** * Game Engine Includes * ****************************/ #include "ErrorCallbackPhysX.h" /******************** * Forward Decls * *********************/ class PhysicsActor; struct TimerParams; /************** * Typedef * ***************/ typedef std::map<uint64_t, PhysicsActor*> PhysicsActorMap; typedef PhysicsActorMap::iterator PhysicsActorMapIt; typedef PhysicsActorMap::const_iterator PhysicsActorMapItConst; /***************** * Class Decl * ******************/ class PhysicsManager sealed : public AEObject { private: /************************ * Private Variables * *************************/ #pragma region Private Variables /// <summary> /// PhysX Default CPU Dispatcher /// </summary> physx::PxDefaultCpuDispatcher* m_CpuDispatcher = nullptr; /// <summary> /// PhysX Pvd Debugger Connection /// </summary> physx::PxPvd* m_PxPvd = nullptr; /// <summary> /// PhysX Pvd Transport /// </summary> physx::PxPvdTransport* m_PxPvdTransport = nullptr; /// <summary> /// Default Allocator for PhysX /// </summary> physx::PxDefaultAllocator m_PxDefaultAllocatorCallback; /// <summary> /// Defines if the PVD is connected /// </summary> bool mIsPVDConnected = false; /// <summary> /// PhysX Foundation Instance /// </summary> physx::PxFoundation* m_PxFoundation = nullptr; /// <summary> /// PhysX Instance /// </summary> physx::PxPhysics* m_PxPhysics = nullptr; /// <summary> /// Error Callback Class to log PhysX Errors /// </summary> ErrorCallbackPhysX m_ErrorCallbackPhysX; /// <summary> /// PhysX Scene Instance /// </summary> physx::PxScene* m_PxScene = nullptr; /// <summary> /// Default Gravity /// </summary> float m_DefaultGravity = 9.8f; /// <summary> /// Defines if physics engine is ready to process data. /// </summary> bool m_IsReady = false; PhysicsActorMap m_PhysicsActorMap; #pragma endregion /********************** * Private Methods * ***********************/ #pragma region Private Methods void CleanUp(); AEResult UpdatePhysicsActorObject3D(); #pragma endregion public: /*************************************** * Constructor & Destructor Methods * ****************************************/ #pragma region Constructor & Destructor Methods /// <summary> /// Default PhysicsManager Constructor /// </summary> PhysicsManager(); /// <summary> /// Default PhysicsManager Destructor /// </summary> virtual ~PhysicsManager(); //Delete copy constructor/operator PhysicsManager(const PhysicsManager&) = delete; PhysicsManager& operator=(const PhysicsManager&) = delete; #pragma endregion /****************** * Get Methods * *******************/ #pragma region Get Methods physx::PxPhysics* GetPhysX() const { return m_PxPhysics; } physx::PxScene* GetPxScene() const { return m_PxScene; } inline bool IsReady() const { return m_IsReady; } #pragma endregion /****************** * Set Methods * *******************/ #pragma region Set Methods #pragma endregion /************************ * Framework Methods * *************************/ #pragma region Framework Methods AEResult Initialize(); AEResult Update(const TimerParams& timerParams); AEResult ConnectToPhysXDebugger(const std::string& ip = "127.0.0.1", uint32_t port = 5425, uint32_t timeout = 100); AEResult DisconnectToPhysXDebugger(); AEResult AddPhysicsActor(PhysicsActor* physicsActor); AEResult RemovePhysicsActor(uint64_t id, bool deleteObj = true); bool ExistsPhysicsActor(uint64_t id); PhysicsActorMapIt begin(); PhysicsActorMapIt end(); PhysicsActorMapItConst begin() const; PhysicsActorMapItConst end() const; PhysicsActorMapItConst cbegin() const; PhysicsActorMapItConst cend() const; #pragma endregion }; #endif
// // ttRecommendTagCell.h // bsbdj // // Created by 王涛 on 16/7/19. // Copyright © 2016年 wata. All rights reserved. // #import <UIKit/UIKit.h> @class ttRecommendTag; @interface ttRecommendTagCell : UITableViewCell /** 模型数据 */ @property (nonatomic, strong) ttRecommendTag *recommendTag; @end
/* * Copyright 2005-2017 ECMWF. * * This software is licensed under the terms of the Apache Licence Version 2.0 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. * * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ /* * Description: How to use an iterator on lat/lon/values and query the bitmap * for missing values * (rather than compare each value with the missingValue key) */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include "grib_api.h" void usage(char* prog) { printf("Usage: %s grib_file\n",prog); exit(1); } int main(int argc, char** argv) { FILE* in = NULL; int err = 0; double lat,lon,value; int n=0; size_t bmp_len = 0, values_len = 0; char* filename = NULL; long bitmapPresent = 0; long *bitmap = NULL; double *values = NULL; grib_handle *h = NULL; grib_iterator* iter=NULL; if (argc != 2) usage(argv[0]); filename=argv[1]; in = fopen(filename,"r"); if(!in) { fprintf(stderr, "ERROR: unable to open file %s\n",filename); return 1; } while ((h = grib_handle_new_from_file(0,in,&err)) != NULL ) { if (err != GRIB_SUCCESS) GRIB_CHECK(err,0); GRIB_CHECK(grib_get_long(h,"bitmapPresent",&bitmapPresent),0); if (bitmapPresent) { GRIB_CHECK(grib_get_size(h,"bitmap",&bmp_len),0); bitmap = (long*)malloc(bmp_len*sizeof(long)); GRIB_CHECK(grib_get_long_array(h,"bitmap",bitmap,&bmp_len),0); printf("Bitmap is present. Num = %ld\n", bmp_len); } /* Sanity check. Number of values must match number in bitmap */ GRIB_CHECK(grib_get_size(h,"values",&values_len),0); values = (double*)malloc(values_len*sizeof(double)); GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0); if (bitmapPresent) { assert(values_len==bmp_len); } /* A new iterator on lat/lon/values is created from the message handle h */ iter=grib_iterator_new(h,0,&err); if (err != GRIB_SUCCESS) GRIB_CHECK(err,0); n = 0; /* Loop on all the lat/lon/values. Only print non-missing values */ while(grib_iterator_next(iter,&lat,&lon,&value)) { /* Consult bitmap to see if the n'th value is missing */ int is_missing_val = (bitmapPresent && bitmap[n] == 0); if (!is_missing_val) { printf("- %d - lat=%f lon=%f value=%f\n",n,lat,lon,value); } n++; } /* Check number of elements in iterator matches value count */ assert(n == values_len); grib_iterator_delete(iter); grib_handle_delete(h); } fclose(in); return 0; }
/** * For conditions of distribution and use, see copyright notice in license.txt * * @file TreeWidgetItemExpandMemory.h * @brief Utility class for keeping track of expanded items at a tree widget. */ #pragma once #include <QObject> #include <QSet> class Framework; class QTreeWidget; class QTreeWidgetItem; /// Utility class for keeping track of expanded items at a tree widget. /** Usage example: @code QTreeWidget *treeWidget = new QTreeWidget; TreeWidgetItemExpandMemory *mem = new TreeWidgetItemExpandMemory("GroupIdName", GetFramework()); connect(treeWidget, SIGNAL(itemExpanded(QTreeWidgetItem *)), mem, SLOT(HandleItemExpanded(QTreeWidgetItem *)), Qt::UniqueConnection); connect(treeWidget, SIGNAL(itemCollapsed(QTreeWidgetItem *)), mem, SLOT(HandleItemCollapsed(QTreeWidgetItem *)), Qt::UniqueConnection); @endcode */ class TreeWidgetItemExpandMemory : public QObject { Q_OBJECT public: /// Constructs the object and loads information about expanded items from config file. /** @param group Group name identifier. @param fw Framework. */ TreeWidgetItemExpandMemory(const char *group, Framework *fw); /// Destroys the object and saves information about currently expanded items to config file. ~TreeWidgetItemExpandMemory(); /// Expands @c item in the @c treeWidget if expand memory contains idenfitier for the @c item or /// collapses the item if it's identifier is not found in the item info set. /** @param treeWidet Tree widget containting the @c item. @param item Tree widget item. */ void ExpandItem(QTreeWidget *treeWidget, const QTreeWidgetItem *item) const; /// Return identifier for the @c item. /** The text is full "path" of item and all its predecessors, separated with dots, e.g. "TopLevelItemName.SecondLevelItemName.ItemName". @note Currently uses text from item column 0 only. @param item Tree widget item. */ QString GetIndentifierText(const QTreeWidgetItem *item) const; /// Loads information about expanded items from config file. void Load(); /// Saves information about currently expanded items to config file. void Save(); public slots: /// Creates identifier text for @c item and adds it to set of indentifier texts. /** @param item Expanded tree widget item. */ void HandleItemExpanded(QTreeWidgetItem *item); /// Creates identifier text for @c item and removes it from set of indentifier texts. /** @param item Collapsed tree widget item. */ void HandleItemCollapsed(QTreeWidgetItem *item); private: /// Returns information about expanded items as one string suitable for saving to config file. std::string ToString() const; QSet<QString> items; ///< Set of item identifier texts. Framework *framework; ///< Framework. std::string groupName; ///< Setting group name. };
/* * TI's FM Stack * * Copyright 2001-2008 Texas Instruments, Inc. - http://www.ti.com/ * * 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 __CCM_IMI_BT_TRAN_SM_H #define __CCM_IMI_BT_TRAN_SM_H #include "mcp_hal_types.h" #include "mcp_hal_os.h" #include "mcp_config.h" #include "mcp_defs.h" #include "ccm_defs.h" #include "ccm_config.h" #include "ccm_imi_common.h" typedef enum _tagCcmIm_BtTranSm_Event { _CCM_IM_BT_TRAN_SM_EVENT_TRAN_OFF, _CCM_IM_BT_TRAN_SM_EVENT_TRAN_ON_ABORT, _CCM_IM_BT_TRAN_SM_EVENT_TRAN_ON, _CCM_IM_BT_TRAN_SM_EVENT_TRAN_OFF_COMPLETE, _CCM_IM_BT_TRAN_SM_EVENT_TRAN_ON_COMPLETE, _CCM_IM_BT_TRAN_SM_EVENT_TRAN_ON_ABORT_COMPLETE, _CCM_IM_BT_TRAN_SM_EVENT_TRAN_ON_FAILED, _CCM_IM_BT_TRAN_SM_EVENT_NULL_EVENT, _CCM_IM_NUM_OF_BT_TRAN_SM_EVENTS, _CCM_IM_INVALID_BT_TRAN_SM_EVENT } _CcmIm_BtTranSm_Event; typedef enum _tagCcmIm_BtTranSm_State { _CCM_IM_BT_TRAN_SM_STATE_OFF, _CCM_IM_BT_TRAN_SM_STATE_ON, _CCM_IM_BT_TRAN_SM_STATE_OFF_IN_PROGRESS, _CCM_IM_BT_TRAN_SM_STATE_ON_IN_PROGRESS, _CCM_IM_BT_TRAN_SM_STATE_ON_ABORT_IN_PROGRESS, _CCM_IM_BT_TRAN_SM_STATE_ON_ABORTED_OFF_IN_PROGRESS, _CCM_IM_BT_TRAN_SM_STATE_ON_FAILED, _CCM_IM_NUM_OF_BT_TRAN_SM_STATES, _CCM_IM_INVALID_BT_TRAN_SM_STATE } _CcmIm_BtTranSm_State; typedef enum _tagCcmIm_BtTranSm_CompletionEventType { _CCM_IM_BT_TRAN_SM_COMPLETED_EVENT_TRAN_OFF_COMPLETED, _CCM_IM_BT_TRAN_SM_COMPLETED_EVENT_TRAN_ON_COMPLETED, _CCM_IM_BT_TRAN_SM_COMPLETED_EVENT_TRAN_ON_ABORT_COMPLETED, } _CcmIm_BtTranSm_CompletionEventType; typedef struct _tagCcmIm_BtTranSm_CompletionEvent { McpHalChipId chipId; _CcmIm_BtTranSm_CompletionEventType eventType; _CcmImStatus completionStatus; } _CcmIm_BtTranSm_CompletionEvent; typedef void (*_CcmIm_BtTranSm_CompletionCb)(_CcmIm_BtTranSm_CompletionEvent *event); typedef struct _tagCcmIm_BtTranSm_Obj _CcmIm_BtTranSm_Obj; _CcmImStatus _CCM_IM_BtTranSm_StaticInit(void); _CcmImStatus _CCM_IM_BtTranSm_Create( McpHalChipId chipId, _CcmIm_BtTranSm_CompletionCb parentCb, McpHalOsSemaphoreHandle ccmImMutexHandle, _CcmIm_BtTranSm_Obj **thisObj); _CcmImStatus _CCM_IM_BtTranSm_Destroy(_CcmIm_BtTranSm_Obj **thisObj); _CcmImStatus _CCM_IM_BtTranSm_HandleEvent( _CcmIm_BtTranSm_Obj *smData, _CcmIm_BtTranSm_Event event, void *eventData); McpBool _CCM_IM_BtTranSm_IsInProgress(_CcmIm_BtTranSm_Obj *smData); BtHciIfObj *CCM_IM_BtTranSm_GetBtHciIfObj(_CcmIm_BtTranSm_Obj *smData); void _CCM_IM_BtTranSm_GetChipVersion(_CcmIm_BtTranSm_Obj *thisObj, McpU16 *projectType, McpU16 *versionMajor, McpU16 *versionMinor); const char *_CCM_IM_BtTranSm_DebugStatetStr(_CcmIm_BtTranSm_State state); const char *_CCM_IM_BtTranSm_DebugEventStr(_CcmIm_BtTranSm_Event event); #endif
#ifdef __OBJC__ #import <UIKit/UIKit.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif #import "EDAM.h" #import "EDAMAuthenticationTypes.h" #import "EDAMErrors.h" #import "EDAMLimits.h" #import "EDAMNoteStore.h" #import "EDAMTypes.h" #import "EDAMUserStore.h" #import "ENBusinessNoteStoreClient.h" #import "ENNoteStoreClient.h" #import "ENPreferencesStore.h" #import "ENSDKAdvanced.h" #import "ENUserStoreClient.h" #import "ENMLConstants.h" #import "ENMLUtility.h" #import "ENEncryptedContentInfo.h" #import "ENMIMEUtils.h" #import "ENMLWriter.h" #import "ENXMLDTD.h" #import "ENXMLUtils.h" #import "ENXMLWriter.h" #import "NSRegularExpression+ENAGRegex.h" #import "NSString+EDAMNilAdditions.h" #import "NSData+EvernoteSDK.h" #import "NSDate+EDAMAdditions.h" #import "ENCommonUtils.h" #import "ENError.h" #import "ENNote.h" #import "ENNotebook.h" #import "ENNoteContent.h" #import "ENNoteRef.h" #import "ENNoteSearch.h" #import "ENResource.h" #import "ENSDKLogging.h" #import "ENSession.h" #import "EvernoteSDK.h" #import "ENAFURLConnectionOperation.h" #import "ENGCOAuth.h" #import "KSForwardingWriter.h" #import "KSHTMLWriter.h" #import "KSWriter.h" #import "KSXMLAttributes.h" #import "KSXMLWriter.h" #import "NSString+XMLAdditions.h" #import "RMSTextField.h" #import "RMSTokenConstraintManager.h" #import "RMSTokenView.h" #import "ENSSKeychain.h" #import "ENSSKeychainQuery.h" #import "ENTBinaryProtocol.h" #import "ENTException.h" #import "ENThrift.h" #import "ENTHTTPClient.h" #import "ENTProtocol.h" #import "ENTTransport.h" #import "FATField.h" #import "FATObject.h" #import "EDAMNoteStoreClient+Utilities.h" #import "ENAuthCache.h" #import "ENCredentials.h" #import "ENCredentialStore.h" #import "ENHTMLNoteContent.h" #import "ENHTMLtoENMLConverter.h" #import "ENLinkedNotebookRef.h" #import "ENLinkedNoteStoreClient.h" #import "ENLoadingViewController.h" #import "ENNotebookCell.h" #import "ENNotebookChooserViewController.h" #import "ENNotebookTypeView.h" #import "ENNoteRefInternal.h" #import "ENOAuthAuthenticator.h" #import "ENOAuthViewController.h" #import "ENPlainNoteContent.h" #import "ENSDKPrivate.h" #import "ENSDKResourceLoader.h" #import "ENShareURLHelper.h" #import "ENStoreClient.h" #import "ENTheme.h" #import "ENWebArchive.h" #import "ENWebClipNoteBuilder.h" #import "ENWebContentTransformer.h" #import "ENWebResource.h" #import "ENXMLSaxParser.h" #import "NSString+ENScrubbing.h" #import "NSString+URLEncoding.h" #import "ENNotebookPickerButton.h" #import "ENNotebookPickerView.h" #import "ENSaveToEvernoteActivity.h" #import "ENSaveToEvernoteViewController.h" FOUNDATION_EXPORT double EvernoteSDKVersionNumber; FOUNDATION_EXPORT const unsigned char EvernoteSDKVersionString[];
/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University */ /* Copyright (c) 2011, 2012 Open Networking Foundation */ /* Copyright (c) 2012, 2013 Big Switch Networks, Inc. */ /* See the file LICENSE.loci which should have been included in the source distribution */ #ifdef __GNUC__ #ifdef __linux__ /* glibc */ #include <features.h> #else /* NetBSD etc */ #include <sys/cdefs.h> #ifdef __GNUC_PREREQ__ #define __GNUC_PREREQ __GNUC_PREREQ__ #endif #endif #ifndef __GNUC_PREREQ /* fallback */ #define __GNUC_PREREQ(maj, min) 0 #endif #if __GNUC_PREREQ(4,6) #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif #endif #include "loci_log.h" #include "loci_int.h" /** * Associate an iterator with a list * @param list The list to iterate over * @param obj The list entry iteration pointer * @return OF_ERROR_RANGE if the list is empty (end of list) * * The obj instance is completely initialized. The caller is responsible * for cleaning up any wire buffers associated with obj before this call */ int of_list_bsn_generic_stats_entry_first(of_list_bsn_generic_stats_entry_t *list, of_object_t *obj) { int rv; of_bsn_generic_stats_entry_init(obj, list->version, -1, 1); if ((rv = of_list_first(list, obj)) < 0) { return rv; } of_u16_len_wire_length_get(obj, &obj->length); return rv; } /** * Advance an iterator to the next element in a list * @param list The list being iterated * @param obj The list entry iteration pointer * @return OF_ERROR_RANGE if already at the last entry on the list * */ int of_list_bsn_generic_stats_entry_next(of_list_bsn_generic_stats_entry_t *list, of_object_t *obj) { int rv; if ((rv = of_list_next(list, obj)) < 0) { return rv; } of_u16_len_wire_length_get(obj, &obj->length); return rv; } /** * Set up to append an object of type of_bsn_generic_stats_entry to an of_list_bsn_generic_stats_entry. * @param list The list that is prepared for append * @param obj Pointer to object to hold data to append * * The obj instance is completely initialized. The caller is responsible * for cleaning up any wire buffers associated with obj before this call. * * See the generic documentation for of_list_append_bind. */ int of_list_bsn_generic_stats_entry_append_bind(of_list_bsn_generic_stats_entry_t *list, of_object_t *obj) { return of_list_append_bind(list, obj); } /** * Append an object to a of_list_bsn_generic_stats_entry list. * * This copies data from obj and leaves item untouched. * * See the generic documentation for of_list_append. */ int of_list_bsn_generic_stats_entry_append(of_list_bsn_generic_stats_entry_t *list, of_object_t *obj) { return of_list_append(list, obj); } /** * \defgroup of_list_bsn_generic_stats_entry of_list_bsn_generic_stats_entry */ /** * Create a new of_list_bsn_generic_stats_entry object * * @param version The wire version to use for the object * @return Pointer to the newly create object or NULL on error * * Initializes the new object with it's default fixed length associating * a new underlying wire buffer. * * \ingroup of_list_bsn_generic_stats_entry */ of_object_t * of_list_bsn_generic_stats_entry_new(of_version_t version) { of_object_t *obj; int bytes; bytes = of_object_fixed_len[version][OF_LIST_BSN_GENERIC_STATS_ENTRY]; if ((obj = of_object_new(OF_WIRE_BUFFER_MAX_LENGTH)) == NULL) { return NULL; } of_list_bsn_generic_stats_entry_init(obj, version, bytes, 0); return obj; } /** * Initialize an object of type of_list_bsn_generic_stats_entry. * * @param obj Pointer to the object to initialize * @param version The wire version to use for the object * @param bytes How many bytes in the object * @param clean_wire Boolean: If true, clear the wire object control struct * * If bytes < 0, then the default fixed length is used for the object * * This is a "coerce" function that sets up the pointers for the * accessors properly. * * If anything other than 0 is passed in for the buffer size, the underlying * wire buffer will have 'grow' called. */ void of_list_bsn_generic_stats_entry_init(of_object_t *obj, of_version_t version, int bytes, int clean_wire) { LOCI_ASSERT(of_object_fixed_len[version][OF_LIST_BSN_GENERIC_STATS_ENTRY] >= 0); if (clean_wire) { MEMSET(obj, 0, sizeof(*obj)); } if (bytes < 0) { bytes = of_object_fixed_len[version][OF_LIST_BSN_GENERIC_STATS_ENTRY]; } obj->version = version; obj->length = bytes; obj->object_id = OF_LIST_BSN_GENERIC_STATS_ENTRY; /* Grow the wire buffer */ if (obj->wbuf != NULL) { int tot_bytes; tot_bytes = bytes + obj->obj_offset; of_wire_buffer_grow(obj->wbuf, tot_bytes); } }
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2010-2020 Couchbase, 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. */ #ifndef TESTS_SERVER_PARAMS_H #define TESTS_SERVER_PARAMS_H 1 #include "config.h" #include <string> #include <string.h> #include <libcouchbase/couchbase.h> class ServerParams { public: ServerParams() {} ServerParams(const char *h, const char *b, const char *u, const char *p) { loadParam(host, h); loadParam(bucket, b); loadParam(user, u); loadParam(pass, p); } void makeConnectParams(lcb_CREATEOPTS *&crst, lcb_io_opt_t io, lcb_INSTANCE_TYPE type = LCB_TYPE_BUCKET) { lcb_createopts_create(&crst, type); if (host.find("couchbase://") == 0) { connstr = host; } else { if (mcNodes.empty() || type == LCB_TYPE_CLUSTER) { connstr = "couchbase://" + host + "=http"; } else { connstr = "couchbase+explicit://" + host + "=http;" + mcNodes; } } lcb_createopts_connstr(crst, connstr.c_str(), connstr.size()); lcb_createopts_credentials(crst, user.c_str(), user.size(), pass.c_str(), pass.size()); if (type == LCB_TYPE_BUCKET) { lcb_createopts_bucket(crst, bucket.c_str(), bucket.size()); } lcb_createopts_io(crst, io); } std::string getUsername() { return user; } std::string getPassword() { return pass; } std::string getBucket() { return bucket; } const std::string &getMcPorts() const { return mcNodes; } void setMcPorts(const std::vector<int> &portlist) { std::stringstream ss; for (std::vector<int>::const_iterator ii = portlist.begin(); ii != portlist.end(); ii++) { ss << "localhost"; ss << ":"; ss << std::dec << *ii; ss << "=mcd"; ss << ";"; } mcNodes = ss.str(); } protected: std::string host; std::string user; std::string pass; std::string bucket; std::string mcNodes; std::string connstr; private: void loadParam(std::string &d, const char *s) { if (s) { d.assign(s); } } }; #endif
/** Atomix project, amem4bitcpy.c, TODO: insert summary here Copyright (c) 2015 Stanford University Released under the Apache License v2.0. See the LICENSE file for details. Author(s): Manu Bansal Created on: Feb 14, 2012 */ #include <or_types.h> #include <swpform.h> //#pragma DATA_ALIGN(testInp, 4); //#pragma DATA_ALIGN(testOut, 4); //Uint8 testInp[8] = { // 0xF1, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF //}; // //Uint8 testOut[12] = { // 0xEF, 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE, 0x48, 0x39, 0x92 //}; //void test_amem4bitcpy_i( // Uint32 nBitsToCopy, // Uint32 nBitsToSkip // ) { // Uint32 i; // // printf("nBitsToCopy: %d, nBitsToSkip: %d\n", nBitsToCopy, nBitsToSkip); // for (i= 0; i < 8; i++) // printBitsMsb8(testInp[i]); // printf("\n"); // // for (i= 0; i < 12; i++) // printBitsMsb8(testOut[i]); // printf("\n"); // // amem4bitcpy( // (Uint32 *)testOut, // (Uint32 *)testInp, // nBitsToCopy, // nBitsToSkip // ); // // for (i= 0; i < 12; i++) // printBitsMsb8(testOut[i]); // printf("\n\n"); //} /* * All tests tried below pass. There may still be corner cases that I have missed. */ //void test_amem4bitcpy() { // // Uint32 nBitsToCopy; // Uint32 nBitsToSkip; // // //test1 -------------------------------------------------------------------- // nBitsToCopy = 11; // nBitsToSkip = 5; // // printf("test1\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- // // //test2 -------------------------------------------------------------------- // nBitsToCopy = 11; // nBitsToSkip = 0; // // printf("test2\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- // // //test3 -------------------------------------------------------------------- // nBitsToCopy = 32; // nBitsToSkip = 0; // // printf("test3\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- // // //test4 -------------------------------------------------------------------- // nBitsToCopy = 32; // nBitsToSkip = 32; // // printf("test4\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- // // //test5 -------------------------------------------------------------------- // nBitsToCopy = 16; // nBitsToSkip = 24; // // printf("test5\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- // // //test6 -------------------------------------------------------------------- // nBitsToCopy = 40; // nBitsToSkip = 18; // // printf("test6\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- // // //test7 -------------------------------------------------------------------- // nBitsToCopy = 0; // nBitsToSkip = 18; // // printf("test7\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- // // //test8 -------------------------------------------------------------------- // nBitsToCopy = 4; // nBitsToSkip = 31; // // printf("test8\n"); // test_amem4bitcpy_i(nBitsToCopy, nBitsToSkip); // //--------------------------------------------------------------------------- //}
// common string conversion funcions #include <string> std::string GlobalDoubleAsString(double m, unsigned short precision); std::string GlobalUINTAsString(UINT indata);
/************************************************* * Public Constants Tones defined in Tom Igoe's Example TONE http://arduino.cc/en/Tutorial/tone *************************************************/ #define NOTE_B0 31 #define NOTE_C1 33 #define NOTE_CS1 35 #define NOTE_D1 37 #define NOTE_DS1 39 #define NOTE_E1 41 #define NOTE_F1 44 #define NOTE_FS1 46 #define NOTE_G1 49 #define NOTE_GS1 52 #define NOTE_A1 55 #define NOTE_AS1 58 #define NOTE_B1 62 #define NOTE_C2 65 #define NOTE_CS2 69 #define NOTE_D2 73 #define NOTE_DS2 78 #define NOTE_E2 82 #define NOTE_F2 87 #define NOTE_FS2 93 #define NOTE_G2 98 #define NOTE_GS2 104 #define NOTE_A2 110 #define NOTE_AS2 117 #define NOTE_B2 123 #define NOTE_C3 131 #define NOTE_CS3 139 #define NOTE_D3 147 #define NOTE_DS3 156 #define NOTE_E3 165 #define NOTE_F3 175 #define NOTE_FS3 185 #define NOTE_G3 196 #define NOTE_GS3 208 #define NOTE_A3 220 #define NOTE_AS3 233 #define NOTE_B3 247 #define NOTE_C4 262 #define NOTE_CS4 277 #define NOTE_D4 294 #define NOTE_DS4 311 #define NOTE_E4 330 #define NOTE_F4 349 #define NOTE_FS4 370 #define NOTE_G4 392 #define NOTE_GS4 415 #define NOTE_A4 440 #define NOTE_AS4 466 #define NOTE_B4 494 #define NOTE_C5 523 #define NOTE_CS5 554 #define NOTE_D5 587 #define NOTE_DS5 622 #define NOTE_E5 659 #define NOTE_F5 698 #define NOTE_FS5 740 #define NOTE_G5 784 #define NOTE_GS5 831 #define NOTE_A5 880 #define NOTE_AS5 932 #define NOTE_B5 988 #define NOTE_C6 1047 #define NOTE_CS6 1109 #define NOTE_D6 1175 #define NOTE_DS6 1245 #define NOTE_E6 1319 #define NOTE_F6 1397 #define NOTE_FS6 1480 #define NOTE_G6 1568 #define NOTE_GS6 1661 #define NOTE_A6 1760 #define NOTE_AS6 1865 #define NOTE_B6 1976 #define NOTE_C7 2093 #define NOTE_CS7 2217 #define NOTE_D7 2349 #define NOTE_DS7 2489 #define NOTE_E7 2637 #define NOTE_F7 2794 #define NOTE_FS7 2960 #define NOTE_G7 3136 #define NOTE_GS7 3322 #define NOTE_A7 3520 #define NOTE_AS7 3729 #define NOTE_B7 3951 #define NOTE_C8 4186 #define NOTE_CS8 4435 #define NOTE_D8 4699 #define NOTE_DS8 4978
/* * Copyright (C) 2008 The Android Open Source Project * * 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 "bootloader.h" #include "common.h" #include "firmware.h" #include "roots.h" #include <errno.h> #include <string.h> #include <sys/reboot.h> static const char *update_type = NULL; static const char *update_data = NULL; static int update_length = 0; int remember_firmware_update(const char *type, const char *data, int length) { if (update_type != NULL || update_data != NULL) { LOGE("Multiple firmware images\n"); return -1; } update_type = type; update_data = data; update_length = length; return 0; } // Return true if there is a firmware update pending. int firmware_update_pending() { return update_data != NULL && update_length > 0; } /* Bootloader / Recovery Flow * * On every boot, the bootloader will read the bootloader_message * from flash and check the command field. The bootloader should * deal with the command field not having a 0 terminator correctly * (so as to not crash if the block is invalid or corrupt). * * The bootloader will have to publish the partition that contains * the bootloader_message to the linux kernel so it can update it. * * if command == "boot-recovery" -> boot recovery.img * else if command == "update-radio" -> update radio image (below) * else if command == "update-hboot" -> update hboot image (below) * else -> boot boot.img (normal boot) * * Radio/Hboot Update Flow * 1. the bootloader will attempt to load and validate the header * 2. if the header is invalid, status="invalid-update", goto #8 * 3. display the busy image on-screen * 4. if the update image is invalid, status="invalid-radio-image", goto #8 * 5. attempt to update the firmware (depending on the command) * 6. if successful, status="okay", goto #8 * 7. if failed, and the old image can still boot, status="failed-update" * 8. write the bootloader_message, leaving the recovery field * unchanged, updating status, and setting command to * "boot-recovery" * 9. reboot * * The bootloader will not modify or erase the cache partition. * It is recovery's responsibility to clean up the mess afterwards. */ int maybe_install_firmware_update(const char *send_intent) { if (update_data == NULL || update_length == 0) return 0; /* We destroy the cache partition to pass the update image to the * bootloader, so all we can really do afterwards is wipe cache and reboot. * Set up this instruction now, in case we're interrupted while writing. */ struct bootloader_message boot; memset(&boot, 0, sizeof(boot)); strlcpy(boot.command, "boot-recovery", sizeof(boot.command)); strlcpy(boot.recovery, "recovery\n--wipe_cache\n", sizeof(boot.command)); if (send_intent != NULL) { strlcat(boot.recovery, "--send_intent=", sizeof(boot.recovery)); strlcat(boot.recovery, send_intent, sizeof(boot.recovery)); strlcat(boot.recovery, "\n", sizeof(boot.recovery)); } if (set_bootloader_message(&boot)) return -1; int width = 0, height = 0, bpp = 0; char *busy_image = ui_copy_image( BACKGROUND_ICON_FIRMWARE_INSTALLING, &width, &height, &bpp); char *fail_image = ui_copy_image( BACKGROUND_ICON_FIRMWARE_ERROR, &width, &height, &bpp); ui_print("写入 %s 镜像...\n", update_type); if (write_update_for_bootloader( update_data, update_length, width, height, bpp, busy_image, fail_image)) { LOGE("Can't write %s image\n(%s)\n", update_type, strerror(errno)); format_volume("/cache"); // Attempt to clean cache up, at least. return -1; } free(busy_image); free(fail_image); /* The update image is fully written, so now we can instruct the bootloader * to install it. (After doing so, it will come back here, and we will * wipe the cache and reboot into the system.) */ snprintf(boot.command, sizeof(boot.command), "update-%s", update_type); if (set_bootloader_message(&boot)) { format_volume("/cache"); return -1; } reboot(RB_AUTOBOOT); // Can't reboot? WTF? LOGE("Can't reboot\n"); return -1; }
/************************************************************************* * Copyright (c) 2015, Synopsys, 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 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 * * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *************************************************************************/ // ldrDCHierarchy //------------------------------------------ // Synopsis: // ldr header for Data Charts // // Description: // ... //------------------------------------------ // Restrictions: // ... //------------------------------------------ #ifndef _ldrDCHierarchy_h_ #define _ldrDCHierarchy_h_ #include <objRelation.h> #include <OperPoint.h> #include <ldrSelection.h> #include <ldrOODT.h> #include <ddict.h> #include <viewNode.h> #include <symbolArr.h> // This is the ldr header for Data Charts class ldrDCHierarchy : public ldrOODT , public viewClass_mixin { public: ldrDCHierarchy(const symbolArr&); virtual void insert_obj(objInserter *oi, objInserter *ni); virtual void remove_obj(objRemover *, objRemover * nr); #ifdef __GNUG__ ldrDCHierarchy(const ldrDCHierarchy &ll): ldrOODT(ll) { } #endif copy_member(ldrDCHierarchy); define_relational(ldrDCHierarchy,ldrOODT); void add(symbolPtr); void remove_struct(symbolPtr); // remove an item from the DC void filter_builtin_relations(int); int builtin_relations_filter() const { return builtin_relation_filter; } void rebuild_root(); void import_all(); private: int builtin_relation_filter; virtual objTreePtr find_ldr(objTree *); void do_refresh(const symbolArr&, const symbolArr&); }; generate_descriptor(ldrDCHierarchy,ldrOODT); #endif /* START-LOG------------------------------------------- $Log: ldrDCHierarchy.h $ Revision 1.4 1998/08/10 18:21:05EDT pero port to VC 5.0: removal of typename, or, etc. // Revision 1.6 1993/08/30 21:45:33 wmm // Fix bug 4621. // // Revision 1.5 1993/08/05 23:20:16 wmm // Fix bug 4185 (allow deferred parsing from OODT views). // // Revision 1.4 1993/07/12 18:33:27 aharlap // put ifdef __GNUG__ around copy-constructor // // Revision 1.3 1993/02/05 16:26:35 wmm // Support "import and show details" functionality. // // Revision 1.2 1993/01/22 22:48:07 wmm // Support XREF-based ERDs and DCs. // // Revision 1.1 1992/12/17 21:30:40 wmm // Initial revision // END-LOG--------------------------------------------- */
#ifndef LOGGER_H #define LOGGER_H #include "linked_list.h" #include "strbuf.h" #include "mem.h" typedef struct log_entry_ { struct log_entry_* next; strBuf message; size_t timestamp; } log_entry; dADD_ITEM(log_entry); dDELETE_ITEM(log_entry); extern log_entry* log_entries; extern size_t nTicks; void add_message(const strBuf* mess, const size_t time); size_t getCurrentLength(); void registerMemoryGet(size_t size); void add_log_buffer(const char* buf); void* log_malloc(const size_t size); void log_free(void* entry); #define LOG_CLIENT_E(message,pespconn,err) {\ char buf[512];\ os_sprintf(buf,message ": %u.%u.%u.%u:%u %u\n",\ pespconn->proto.tcp->remote_ip[0],\ pespconn->proto.tcp->remote_ip[1],\ pespconn->proto.tcp->remote_ip[2],\ pespconn->proto.tcp->remote_ip[3],\ pespconn->proto.tcp->remote_port,\ err\ );\ add_log_buffer(buf);\ } #define LOG_CLIENT(message,pespconn) LOG_CLIENT_E(message, pespconn, pespconn) #endif // LOGGER_H
#ifndef E_MOD_TILING_H #define E_MOD_TILING_H #include <e.h> #include <e_border.h> #include <e_shelf.h> #include <stdbool.h> #include <assert.h> #include "config.h" typedef struct _Config Config; typedef struct _Tiling_Info Tiling_Info; struct tiling_g { E_Module *module; Config *config; int log_domain; const char *default_keyhints; }; extern struct tiling_g tiling_g; #undef ERR #undef DBG #define ERR(...) EINA_LOG_DOM_ERR(tiling_g.log_domain, __VA_ARGS__) #define DBG(...) EINA_LOG_DOM_DBG(tiling_g.log_domain, __VA_ARGS__) #define TILING_MAX_STACKS 8 struct _Config_vdesk { int x, y; unsigned int zone_num; int nb_stacks; int use_rows; }; struct _Config { int tile_dialogs; int show_titles; char *keyhints; Eina_List *vdesks; }; struct _Tiling_Info { /* The desk for which this _Tiling_Info is used. Needed because * (for example) on e restart all desks are shown on all zones but no * change events are triggered */ const E_Desk *desk; struct _Config_vdesk *conf; /* List of windows which were toggled floating */ Eina_List *floating_windows; Eina_List *stacks[TILING_MAX_STACKS]; int pos[TILING_MAX_STACKS]; int size[TILING_MAX_STACKS]; }; struct _E_Config_Dialog_Data { struct _Config config; Evas_Object *o_zonelist; Evas_Object *o_desklist; Evas_Object *osf; Evas *evas; }; E_Config_Dialog *e_int_config_tiling_module(E_Container *con, const char *params); EAPI extern E_Module_Api e_modapi; EAPI void *e_modapi_init(E_Module *m); EAPI int e_modapi_shutdown(E_Module *m); EAPI int e_modapi_save(E_Module *m); void change_desk_conf(struct _Config_vdesk *newconf); void e_tiling_update_conf(void); struct _Config_vdesk * get_vdesk(Eina_List *vdesks, int x, int y, unsigned int zone_num); #define EINA_LIST_IS_IN(_list, _el) \ (eina_list_data_find(_list, _el) == _el) #define EINA_LIST_APPEND(_list, _el) \ _list = eina_list_append(_list, _el) #define EINA_LIST_REMOVE(_list, _el) \ _list = eina_list_remove(_list, _el) #endif
#ifndef _INCLUDES_H_ #define _INCLUDES_H_ #include <stdio.h> /* `UNICODE' needs to be defined for the Windows API headers. */ #define UNICODE #include <Windows.h> #include <Psapi.h> #include <Shlwapi.h> #include <Aclapi.h> /* `_UNICODE' needs to be defined for "tchar.h" only. */ #define _UNICODE #include <tchar.h> /* "Strsafe.h" needs to be included after "tchar.h". */ #include <Strsafe.h> #define PAGE_SIZE 4096 #endif /* _INCLUDES_H_ */
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once class FCascade; class SCascadePreviewViewport; /*----------------------------------------------------------------------------- FCascadeViewportClient -----------------------------------------------------------------------------*/ class FCascadeEdPreviewViewportClient : public FEditorViewportClient { public: /** Constructor */ FCascadeEdPreviewViewportClient(TWeakPtr<FCascade> InCascade, const TSharedRef<SCascadePreviewViewport>& InCascadeViewport); ~FCascadeEdPreviewViewportClient(); /** FEditorViewportClient interface */ virtual void Draw(FViewport* Viewport, FCanvas* Canvas) override; virtual void Draw(const FSceneView* View, FPrimitiveDrawInterface* PDI) override; virtual bool InputKey(FViewport* Viewport, int32 ControllerId, FKey Key, EInputEvent Event, float AmountDepressed = 1.0f, bool bGamepad = false) override; virtual bool InputAxis(FViewport* Viewport, int32 ControllerId, FKey Key, float Delta, float DeltaTime, int32 NumSamples = 1, bool bGamepad = false) override; virtual FSceneInterface* GetScene() const override; virtual FLinearColor GetBackgroundColor() const override; virtual bool ShouldOrbitCamera() const override; virtual void AddReferencedObjects( FReferenceCollector& Collector ) override; virtual bool CanCycleWidgetMode() const override; /** Sets the position and orientation of the preview camera */ void SetPreviewCamera(const FRotator& NewPreviewAngle, float NewPreviewDistance); /** Update the memory information of the particle system */ void UpdateMemoryInformation(); /** Generates a new thumbnail image for the content browser */ void CreateThumbnail(); /** Draw flag types */ enum EDrawElements { ParticleCounts = 0x001, ParticleEvents = 0x002, ParticleTimes = 0x004, ParticleMemory = 0x008, VectorFields = 0x010, Bounds = 0x020, WireSphere = 0x040, OriginAxis = 0x080, Orbit = 0x100 }; /** Accessors */ FPreviewScene& GetPreviewScene(); bool GetDrawElement(EDrawElements Element) const; void ToggleDrawElement(EDrawElements Element); FColor GetPreviewBackgroundColor() const; UStaticMeshComponent* GetFloorComponent(); FEditorCommonDrawHelper& GetDrawHelper(); float& GetWireSphereRadius(); private: /** Pointer back to the ParticleSystem editor tool that owns us */ TWeakPtr<FCascade> CascadePtr; /** Preview mesh */ UStaticMeshComponent* FloorComponent; /** Camera potition/rotation */ FRotator PreviewAngle; float PreviewDistance; /** If true, will take screenshot for thumbnail on next draw call */ float bCaptureScreenShot; /** User input state info */ FVector WorldManipulateDir; FVector LocalManipulateDir; float DragX; float DragY; EAxisList::Type WidgetAxis; EWidgetMovementMode WidgetMM; bool bManipulatingVectorField; /** Draw flags (see EDrawElements) */ int32 DrawFlags; /** Radius of the wireframe sphere */ float WireSphereRadius; /** Veiwport background color */ FColor BackgroundColor; /** The scene used for the viewport. Owned externally */ FPreviewScene CascadePreviewScene; /** The size of the ParticleSystem via FArchive memory counting */ int32 ParticleSystemRootSize; /** The size the particle modules take for the system */ int32 ParticleModuleMemSize; /** The size of the ParticleSystemComponent via FArchive memory counting */ int32 PSysCompRootSize; /** The size of the ParticleSystemComponent resource size */ int32 PSysCompResourceSize; /** Draw info index for vector fields */ const int32 VectorFieldHitproxyInfo; /** Speed multiplier used when moving the scene light around */ const float LightRotSpeed; };
/********************************************************************************* * * 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_PYLISTMEHTODSINVIWO_H #define IVW_PYLISTMEHTODSINVIWO_H #include <modules/python3/python3moduledefine.h> namespace inviwo { PyObject* py_listProperties(PyObject* /*self*/, PyObject* /*args*/); PyObject* py_listProcessors(PyObject* /*self*/, PyObject* /*args*/); PyObject* py_listCanvases(PyObject* /*self*/, PyObject* /*noargs*/); } //namespace #endif // IVW_PYLISTMEHTODSINVIWO_H
/* * THE CHRONOTEXT-PLAYGROUND: https://github.com/arielm/chronotext-playground * COPYRIGHT (C) 2014-2015, ARIEL MALKA ALL RIGHTS RESERVED. * * THE FOLLOWING SOURCE-CODE IS DISTRIBUTED UNDER THE SIMPLIFIED BSD LICENSE: * https://github.com/arielm/chronotext-playground/blob/master/LICENSE */ /* * FEATURES: * * 1) UNLIKE TestingSound1: THIS TEST FAILS WHENEVER FMOD IS NOT PROPERLY INITIALIZED * * 2) FILE-STREAMING: * - INCLUDING FROM ANDROID-ASSETS * * 3) PROPER PAUSING/RESUMING OF PLAYING-SOUND */ #pragma once #include "Testing/TestingBase.h" #include "chronotext/sound/SoundManager.h" class TestingSound2 : public TestingBase { public: void setup() final; void shutdown() final; /* * PASSING VIA update() IS NECESSARY WHEN WORKING WITH FMOD */ void update() final; void addTouch(int index, float x, float y) final; void removeTouch(int index, float x, float y) final; protected: std::shared_ptr<chr::SoundManager> soundManager; FMOD::Sound* sound = nullptr; FMOD::Channel *channel = nullptr; bool paused = false; int pausedIndex = -1; void createSound(chr::InputSource::Ref source); // CAN THROW void destroySound(); #if defined(CINDER_ANDROID) static FMOD_RESULT F_CALLBACK android_open(const char *name, unsigned int *filesize, void **handle, void *userdata); static FMOD_RESULT F_CALLBACK android_close(void *handle, void *userdata); static FMOD_RESULT F_CALLBACK android_read(void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata); static FMOD_RESULT F_CALLBACK android_seek(void *handle, unsigned int pos, void *userdata); #endif };
/* @LICENSE(MUSLC_MIT) */ #include <time.h> #include "__time.h" struct tm *gmtime(const time_t *t) { static struct tm tm; __time_to_tm(*t, &tm); tm.tm_isdst = 0; return &tm; }
#include "ruby.h" #include "narray.h" static VALUE na_address(VALUE self) { struct NARRAY *ary; void * ptr; VALUE ret; GetNArray(self,ary); ptr = ary->ptr; ret = ULL2NUM( sizeof(ptr) == 4 ? (unsigned long long int) (unsigned long int) ptr : (unsigned long long int) ptr ); return ret; } static VALUE na_to_ptr(VALUE self) { struct NARRAY *ary; VALUE mod; VALUE klass; VALUE ret; long length; GetNArray(self,ary); mod = rb_const_get(rb_cObject, rb_intern("FFI")); klass = rb_const_get(mod, rb_intern("Pointer")); if ( ary->ref != Qnil ) { if ( rb_funcall(ary->ref, rb_intern("kind_of?"), 1, klass) == Qtrue ) { return ary->ref; } } length = na_sizeof[ary->type] * ary->total; ret = rb_funcall(klass, rb_intern("new"), 1, na_address(self)); ret = rb_funcall(ret, rb_intern("slice"), 2, LONG2NUM(0), LONG2NUM(length)); return ret; } static struct NARRAY* na_alloc_struct_empty(int type, int rank, int *shape) { int total=1, total_bak; int i, memsz; struct NARRAY *ary; for (i=0; i<rank; ++i) { if (shape[i] < 0) { rb_raise(rb_eArgError, "negative array size"); } else if (shape[i] == 0) { total = 0; break; } total_bak = total; total *= shape[i]; if (total < 1 || total > 2147483647 || total/shape[i] != total_bak) { rb_raise(rb_eArgError, "array size is too large"); } } if (rank<=0 || total<=0) { /* empty array */ ary = ALLOC(struct NARRAY); ary->rank = ary->total = 0; ary->shape = NULL; ary->ptr = NULL; ary->type = type; } else { memsz = na_sizeof[type] * total; if (memsz < 1 || memsz > 2147483647 || memsz/na_sizeof[type] != total) { rb_raise(rb_eArgError, "allocation size is too large"); } /* Garbage Collection */ #ifdef NARRAY_GC mem_count += memsz; if ( mem_count > na_gc_freq ) { rb_gc(); mem_count=0; } #endif ary = ALLOC(struct NARRAY); ary->shape = ALLOC_N(int, rank); ary->rank = rank; ary->total = total; ary->type = type; for (i=0; i<rank; ++i) ary->shape[i] = shape[i]; } ary->ref = Qtrue; return ary; } static void na_free_empty(struct NARRAY* ary) { if ( ary->total > 0 ) { xfree(ary->shape); } xfree(ary); } static void na_mark_ref_empty(struct NARRAY *ary) { rb_gc_mark( ary->ref ); } static VALUE na_make_object_empty(int type, int rank, int *shape, VALUE klass, VALUE pointer) { struct NARRAY *na; na = na_alloc_struct_empty(type, rank, shape); na->ref = pointer; return Data_Wrap_Struct(klass, na_mark_ref_empty, na_free_empty, na); } static VALUE na_pointer_to_na(int argc, VALUE *argv, VALUE pointer) { struct NARRAY *ary; VALUE v; void * ptr; VALUE address; int i, type, len=1, pointer_len, *shape, rank=argc-1; if (argc < 1) rb_raise(rb_eArgError, "Type and Size Arguments required"); type = na_get_typecode(argv[0]); if (type==NA_ROBJ) rb_raise(rb_eArgError, "Invalid type"); address = rb_funcall(pointer, rb_intern("address"), 0); ptr = sizeof(ptr) == 4 ? (void *) NUM2ULONG(address) : (void *) NUM2ULL(address); pointer_len = NUM2INT(rb_funcall(pointer, rb_intern("size"), 0)); if (argc == 1) { rank = 1; shape = ALLOCA_N(int,rank); if ( pointer_len % na_sizeof[type] != 0 ) rb_raise(rb_eArgError, "pointer size mismatch"); shape[0] = pointer_len / na_sizeof[type]; } else { shape = ALLOCA_N(int,rank); for (i=0; i<rank; i++) len *= shape[i] = NUM2INT(argv[i+1]); len *= na_sizeof[type]; if ( len != pointer_len ) rb_raise(rb_eArgError, "pointer size mismatch"); } v = na_make_object_empty( type, rank, shape, cNArray, pointer ); GetNArray(v,ary); ary->ptr = ptr; return v; } static VALUE na_s_to_na_pointer(int argc, VALUE *argv, VALUE klass) { VALUE mod; VALUE klass_p; if (argc < 1){ rb_raise(rb_eArgError, "Argument is required"); } mod = rb_const_get(rb_cObject, rb_intern("FFI")); klass_p = rb_const_get(mod, rb_intern("Pointer")); if ( rb_funcall(argv[0], rb_intern("kind_of?"), 1, klass_p) == Qtrue ){ return na_pointer_to_na(argc-1,argv+1,argv[0]); } return rb_funcall2(klass, rb_intern("to_na_old"), argc, argv); } void Init_narray_ffi_c() { ID id; VALUE klass; id = rb_intern("NArray"); klass = rb_const_get(rb_cObject, id); rb_define_private_method(klass, "address", na_address, 0); rb_define_method(klass, "to_ptr", na_to_ptr, 0); rb_define_alias(rb_singleton_class(klass), "to_na_old", "to_na"); rb_define_singleton_method(klass, "to_na", na_s_to_na_pointer, -1); rb_undef_method(rb_singleton_class(klass), "to_narray"); rb_define_singleton_method(klass, "to_narray", na_s_to_na_pointer, -1); }
// Interpolation test file // // Copyright (c) 2012-2015, Christian B. Mendl // All rights reserved. // http://christian.mendl.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the Simplified BSD License // http://www.opensource.org/licenses/bsd-license.php // // References: // - Martin L.R. F"urst, Christian B. Mendl, Herbert Spohn // Matrix-valued Boltzmann equation for the Hubbard chain // Physical Review E 86, 031122 (2012) // (arXiv:1207.6926) // // - Martin L.R. F"urst, Christian B. Mendl, Herbert Spohn // Matrix-valued Boltzmann equation for the non-integrable Hubbard chain // Physical Review E 88, 012108 (2013) // (arXiv:1302.2075) // // - Jianfeng Lu, Christian B. Mendl // Numerical scheme for a spatially inhomogeneous matrix-valued quantum Boltzmann equation // Journal of Computational Physics 291, 303-316 (2015) // (arXiv:1408.1782) //________________________________________________________________________________________________________________________ // #include "interpolation.h" #include "util.h" #include <stdlib.h> #include <stdio.h> #if defined(_WIN32) & (defined(DEBUG) | defined(_DEBUG)) #include <crtdbg.h> #endif int main() { const unsigned int ngrid = 64; // number of uniform grid points const unsigned int neval = 137; // number of evaluation points // enable run-time memory check for debug builds #if defined(_WIN32) & (defined(DEBUG) | defined(_DEBUG)) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif // function values on uniform grid mat2x2_t *f_grid = (mat2x2_t *)malloc(ngrid*sizeof(mat2x2_t)); // read values from disk if (ReadData("../test/interpolation_test_f_grid.dat", f_grid, sizeof(mat2x2_t), ngrid) < 0) { fprintf(stderr, "Error reading 'f_grid' data from disk, exiting...\n"); return -1; } // generate interpolation interpolating_func_t ip_func; GenerateInterpolation(f_grid, ngrid, &ip_func); double err = 0; // simple periodicity consistency check { mat2x2_t ip0, ip1; ip0 = EvaluateInterpolation(&ip_func, 0.0); ip1 = EvaluateInterpolation(&ip_func, 1.0); err += FrobeniusNorm(SubtractMatrices(ip1, ip0)); ip0 = EvaluateInterpolation(&ip_func, 0.3); ip1 = EvaluateInterpolation(&ip_func, -2.7); err += FrobeniusNorm(SubtractMatrices(ip1, ip0)); } // evaluation points double *x = (double *)malloc(neval*sizeof(double)); if (ReadData("../test/interpolation_test_x_eval.dat", x, sizeof(double), neval) < 0) { fprintf(stderr, "Error reading evaluation points from disk, exiting...\n"); return -1; } // evaluate interpolating function mat2x2_t *f_eval = (mat2x2_t *)malloc(neval*sizeof(mat2x2_t)); unsigned int i; for (i = 0; i < neval; i++) { f_eval[i] = EvaluateInterpolation(&ip_func, x[i]); } // read reference values from disk mat2x2_t *f_eref = (mat2x2_t *)malloc(neval*sizeof(mat2x2_t)); if (ReadData("../test/interpolation_test_f_eref.dat", f_eref, sizeof(mat2x2_t), neval) < 0) { fprintf(stderr, "Error reading 'f_eref' reference data from disk, exiting...\n"); return -1; } // compare with reference for (i = 0; i < neval; i++) { err += FrobeniusNorm(SubtractMatrices(f_eval[i], f_eref[i])); } printf("cumulative error: %g\n", err); // clean up DeleteInterpolation(&ip_func); free(x); free(f_eref); free(f_eval); free(f_grid); return 0; }
/* * Copyright (C) Niklaus F.Schen. */ #ifndef __MLN_LANG_INT_H #define __MLN_LANG_INT_H #include "mln_lang.h" extern mln_lang_method_t mln_lang_int_oprs; #endif
#pragma once class CTrajectory { public: CTrajectory(); virtual ~CTrajectory(); private: double* Left_trajectories_asym_x(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Left_trajectories_asym_y(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Left_trajectories_asym_z(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Right_trajectories_asym_x(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Right_trajectories_asym_y(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Right_trajectories_asym_z(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Relative_trajectories_asym_x(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Relative_trajectories_asym_y(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Relative_trajectories_asym_z(double j_max,double j_min ,double a_max,double v_max,double s,double t); /////////////////////////////////////////////////////////////////////////// double* Left_Joint_trajectories_asym(double j_max,double j_min ,double a_max,double v_max,double s,double t); double* Right_Joint_trajectories_asym(double j_max,double j_min ,double a_max,double v_max,double s,double t); ///////////////////5 order/////////////////////////////// void Polynomial_Trajectory_x(float t, float tf,float sPoint, float ePoint,float *tra); void Polynomial_Trajectory_y(float t, float tf,float sPoint, float ePoint,float *tra); void Polynomial_Trajectory_z(float t, float tf,float sPoint, float ePoint,float *tra); protected: public: struct { float x[50]; float y[50]; float z[50]; }lde_point; struct { float x[50]; float y[50]; float z[50]; }rde_point; struct { float x[50]; float y[50]; float z[50]; }rede_point; struct{ float l[12]; float r[12]; }joint_point; struct { int number; }Left_plan; struct { int number; }Right_plan; struct { int number; }Relative_plan; void Trajectory_planning_left(float *_pd_dot, float *_pd_ddot, float *_pd_dddot,float t); void Trajectory_planning_right(float *_pd_dot, float *_pd_ddot, float *_pd_dddot,float t); void Trajectory_planning_relative(float *_pd_dot, float *_pd_ddot, float *_pd_dddot,float t); void Trajectory_planning_joint_right(float *_qd, float *_qd_dot, float *_qd_ddot,float de_q,float t); ///////////////////////5 order///////////////////////////// void TP_right_arm(float *_pd, float *_pd_dot, float *_pd_ddot,float *eef,float t); float ploy[3]; };
#define debug(STR) printf("@ %s \n", STR); fflush(stdout) #define TAM_TOKEN 16 /* Erros */ #define INCOMPT 108 #define ATRIB 107 #define TPARAM 106 #define NPARAM 105 #define JA_DECL 104 #define VN_DECL 103 #define PN_DECL 102 #define FN_DECL 101 #define RN_DECL 100 /* Tipos */ #define TVOID 0 //para tipo #define TBOOL 1 #define TINT 2 #define TREAL 3 #define TCHAR 4 #define TSTR 5 typedef enum enum_pass { PVAL=0, PREF=1 }enum_pass; typedef enum enum_cat { CVAR, CPROC, CFUNC, CPARAM, CLABEL }enum_cat; /* Var é usado tanto para variáveis, quanto para parâmetros */ typedef struct Var{ int tipo; enum_pass pass; int desloc; } Var; /* Tabela de símbolos é implementada como uma pilha */ typedef struct Simbolo{ char ident[TAM_TOKEN]; enum_cat cat; int nivel; union{ // Vars e params usam: Var var; // Procedures e functions usam: struct{ int label; int num_params; Var *params; }; }; struct Simbolo *abaixo; } Simbolo; /* Pilha de procedures é usada para ter controle dos parâmetros*/ typedef struct PilhaProc{ Simbolo *proc; struct PilhaProc *abaixo; } PilhaProc; /* Pilha de inteiro é usara para controlas diversas coisas*/ typedef struct PilhaInt{ int val; struct PilhaInt *abaixo; } PilhaInt; /* Simbolos */ Simbolo* pushSimb(Simbolo *, Simbolo *); Simbolo* rmSimb(Simbolo *, int); Simbolo* buscaSimb(Simbolo *, char *); Simbolo* criaSimb(char *ident); void dumpTabela(Simbolo *); /* Integer (labels, tipos)*/ void pushInt(PilhaInt **, int); int popInt(PilhaInt **); void cmpTipo(int); /* Procedures e functions */ void pushProc(PilhaProc**, Simbolo* ); Simbolo* popProc(PilhaProc**); void erro(int); Simbolo *tabela, *s, *p, *esq; PilhaInt *tipos, *rotulos, *string, *nvars, *nparams, *declarou; PilhaProc *procs, *recipientes;
/* Copyright (c) 1985-2012, B-Core (UK) Ltd 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 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "btl_proofCtx.h" INI_btl_proofCtx() { }
#if __has_include(<React/RCTEventDispatcher.h>) #import <React/RCTComponent.h> #else #import "RCTComponent.h" #endif @import GoogleMobileAds; @class RCTEventDispatcher; @interface RNAdMobNativeExpressView : UIView <GADNativeExpressAdViewDelegate> @property (nonatomic, copy) NSNumber *bannerWidth; @property (nonatomic, copy) NSNumber *bannerHeight; @property (nonatomic, copy) NSString *adUnitID; @property (nonatomic, copy) NSString *testDeviceID; @property (nonatomic, copy) RCTBubblingEventBlock onSizeChange; @property (nonatomic, copy) RCTBubblingEventBlock onAdViewDidReceiveAd; @property (nonatomic, copy) RCTBubblingEventBlock onDidFailToReceiveAdWithError; @property (nonatomic, copy) RCTBubblingEventBlock onAdViewWillPresentScreen; @property (nonatomic, copy) RCTBubblingEventBlock onAdViewWillDismissScreen; @property (nonatomic, copy) RCTBubblingEventBlock onAdViewDidDismissScreen; @property (nonatomic, copy) RCTBubblingEventBlock onAdViewWillLeaveApplication; - (void)loadBanner; @end
/* * $Id$ * * Copyright (c) 2011 Surfnet * Copyright (c) 2011 .SE (The Internet Infrastructure Foundation). * Copyright (c) 2011 OpenDNSSEC AB (svb) * 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 AUTHOR ``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 AUTHOR 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 _KEYSTATE_DS_SUBMIT_TASK_H_ #define _KEYSTATE_DS_SUBMIT_TASK_H_ #include "daemon/cfg.h" #include "scheduler/task.h" void perform_keystate_ds_submit(int sockfd, engineconfig_type *config, const char *zone, const char *id, int bauto, bool force); task_type * keystate_ds_submit_task(engineconfig_type *config, const char *what, const char *who); #endif
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <stdbool.h> #include "libcommon.h" /* inefficient but who cares */ int cycleCount(void); void setup(void); void setupThird(void); void shutdown(byte* container); void decode(byte* container, FILE* input); void shiftcells(byte* container, byte value); void updateglow(byte* container); void updateglowThird(byte* container); typedef void (*Starter)(void); typedef void (*ContainerOp)(byte* container); int delayamount = 5; int brightnesscap = 10; bool tmode = false; int numLEDs = LEDCount; FILE* outputFile; // the variable aspects for different modes Starter setupLambda = setup; ContainerOp updateglowLambda = updateglow; void usage(char* name); void error(const char* message, int code); byte temperbrightness(int input); void commit(byte* container, byte brightness); int main(int argc, char* argv[]) { char* line; char* tmpline; char* outputpath; FILE* file; int needsclosing, last, i, errorfree; int outputFileNeedsClosing; byte* cells = 0; long tmp0; line = 0; file = 0; last = argc - 1; tmpline = 0; needsclosing = 0; errorfree = 1; tmp0 = 0L; outputFile = stdout; outputpath = 0; outputFileNeedsClosing = 0; if(argc > 1) { for(i = 1; errorfree && (i < last); ++i) { tmpline = argv[i]; if(strlen(tmpline) == 2 && tmpline[0] == '-') { switch(tmpline[1]) { case 'b': { ++i; tmp0 = strtol(argv[i], NULL, 10); if(errno == EINVAL) { fprintf(stderr, "error: invalid brightness '%s' provided\n", argv[i]); errorfree = 0; } else if(errno == ERANGE) { fprintf(stderr, "error: provided brightness: '%s' is out of range\n", argv[i]); errorfree = 0; } else { if(tmp0 < 0 || tmp0 > 255) { fprintf(stderr, "error: provided brightness: %d is out of range\n", tmp0); errorfree = 0; } else { brightnesscap = tmp0; } } break; } case 'd': { ++i; tmp0 = strtol(argv[i], NULL, 10); if(errno == EINVAL) { fprintf(stderr, "error: invalid delay '%s' provided\n", argv[i]); errorfree = 0; } else if(errno == ERANGE) { fprintf(stderr, "error: provided delay '%s' is out of range\n", argv[i]); errorfree = 0; } else { if(tmp0 < 0) { fprintf(stderr, "error: can't provide a negative delay\n"); errorfree = 0; } else { delayamount = tmp0; } } break; } case 'o': { // have an output file to write to ++i; outputpath = argv[i]; outputFile = fopen(outputpath, "w"); if(!outputFile) { custom_error(errno, "couldn't open output file %s\n", outputpath); } outputFileNeedsClosing = 1; break; } case 't': numLEDs = LEDCount / 3; // we only have 6 bytes to work with in this mode updateglowLambda = updateglowThird; setupLambda = setupThird; tmode = true; break; default: errorfree = 0; break; } } else { errorfree = 0; break; } } if(errorfree) { if(i == last) { line = argv[last]; if(strlen(line) == 1 && line[0] == '-') { file = stdin; } else if(strlen(line) >= 1 && line[0] != '-') { file = fopen(line, "r"); if(!file) { custom_error(errno, "couldn't open %s\n", line); } needsclosing = 1; } } else { fprintf(stderr, "no file provided\n"); } } } if(file) { cells = malloc(numLEDs * sizeof(byte)); if (cells == NULL) { custom_error(32, "Couldn't allocate %d bytes!\n", numLEDs); } setupLambda(); decode(cells, file); shutdown(cells); free(cells); cells = 0; if(needsclosing && fclose(file) != 0) { custom_error(errno, "couldn't close %s\n", line); } if(outputFileNeedsClosing && fclose(outputFile) != 0) { custom_error(errno, "couldn't close %s\n", outputpath); } } else { usage(argv[0]); } return 0; } void usage(char* name) { fprintf(stderr, "usage: %s [-o <output-file>] [-d <delayamt>] [-b <brightnesscap>] [-t] <file>\n", name); } // common functions void shutdown(byte* container) { /* turn off the leds by finishing the flow */ for(int i = 0; i < numLEDs; ++i) { commit(container, 0); } } void shiftcells(byte* container, byte value) { int i; byte* ptr = container; for(i = numLEDs - 1; i > 0; i--) { ptr[i] = ptr[i - 1]; } ptr[i] = value; } void commit(byte* container, byte value) { shiftcells(container, value); // Used to provide even more of a delay without resorting to tuning hacks // via the delay value. It seems that the space blowup for these operations // is even higher than I thought. This provides the correct amount of // delay to make it look pretty constant. One loop will always be invoked for (int i = 0; i < cycleCount(); i++) { updateglowLambda(container); } } int cycleCount() { if (tmode) { return 1; } else { return delayamount + 1; } } byte temperbrightness(int value) { return value % brightnesscap; } void decode(byte* container, FILE* input) { for (int a = fgetc(input); a != EOF; a = fgetc(input)) { commit(container, temperbrightness(a)); } } // fullwidth void setup() { ColorsmithMicroOperation uop; uop_initialize(uop); uop_emit(uop, outputFile); } void updateglow(byte* container) { byte* ptr = container; ColorsmithMicroOperation uop; int i; uop_initialize(uop); ptr = container; for(i = 0; i < LEDCount; i++) { uop[i] = ptr[i]; } uop[i] = delayamount; uop_emit(uop, outputFile); } // third mode or leg mode void setupThird() { byte data[LegFieldCount]; initialize(data, LegFieldCount); emit(data, LegFieldCount, outputFile); } void updateglowThird(byte* container) { int i; byte data[LegFieldCount]; initialize(data, LegFieldCount); for (i = 0; i < LegLEDCount; i++) { data[i] = container[i]; } data[i] = delayamount; emit(data, LegFieldCount, outputFile); }
#ifndef APUE_OPEND_H_ #define APUE_OPEND_H_ #include "apue.h" #include <errno.h> #define CS_OPEN "/home/jian/opend" /* well-known name */ #define CL_OPEN "open" extern int debug; /* nonzero if interactive (not daemon) */ extern char errmsg[]; /* error message string to return to client */ extern int oflag; /* open() flag: O_XXX ... */ extern char *pathname; /* of file to open() for client */ typedef struct { /* one Client struct per connected client */ int fd; /* fd, or -1 if available */ uid_t uid; } Client; extern Client *client; /* ptr to malloc'ed array */ extern int client_size; /* # entries in client[] array */ int cli_args(int, char **); int client_add(int, uid_t); void client_del(int); void loop(void); void request(char *, int, int, uid_t); #endif // APUE_OPEND_H_
#ifndef HEADER_CURL_TOOL_VERSION_H #define HEADER_CURL_TOOL_VERSION_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include <curl/curlver.h> #define CURL_NAME "curl" #define CURL_COPYRIGHT LIBCURL_COPYRIGHT #define CURL_VERSION "7.34.0" #define CURL_VERSION_MAJOR LIBCURL_VERSION_MAJOR #define CURL_VERSION_MINOR LIBCURL_VERSION_MINOR #define CURL_VERSION_PATCH LIBCURL_VERSION_PATCH #define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") " #endif /* HEADER_CURL_TOOL_VERSION_H */
#include "private.h" #include <Elementary.h> #include "config.h" #include "termio.h" #include "options.h" #include "options_wallpaper.h" void options_wallpaper(Evas_Object *opbox, Evas_Object *term __UNUSED__) { Evas_Object *o; o = elm_label_add(opbox); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_text_set(o, "Not Implemented Yet."); evas_object_show(o); elm_box_pack_end(opbox, o); }
//================================================================================================= /*! // \file blaze/config/TransposeFlag.h // \brief Configuration of the default transpose flag for all vectors of the Blaze library // // Copyright (C) 2012-2017 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group nor the names of its contributors // may be used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. */ //================================================================================================= //************************************************************************************************* /*!\brief The default transpose flag for all vectors of the Blaze library. // \ingroup config // // This value specifies the default transpose flag for all vector of the Blaze library. // In case no explicit transpose flag is specified with the according vector type, this // setting is used. \code // Explicit specification of the transpose flag => column vector StaticVector<double,3UL,columnVector> a; // No explicit specification of the transpose flag => use of the default transpose flag StaticVector<double,3UL> b; \endcode // Valid settings for the defaultTransposeFlag are blaze::rowVector and blaze::columnVector. // // \note It is possible to specify the default transpose flag via command line or by defining // this symbol manually before including any Blaze header file: \code #define BLAZE_DEFAULT_TRANSPOSE_FLAG blaze::columnVector #include <blaze/Blaze.h> \endcode */ #ifndef BLAZE_DEFAULT_TRANSPOSE_FLAG #define BLAZE_DEFAULT_TRANSPOSE_FLAG blaze::columnVector #endif //*************************************************************************************************
#include <stdio.h> #include <string.h> #include "common.h" #include "cmd.h" static const char no_mem[] = "out of memory"; void *xmalloc(size_t size) { void *mem = malloc(size); if (!mem) die(no_mem); return mem; } void *xcalloc(size_t nmemb, size_t size) { void *mem = calloc(nmemb, size); if (!mem) die(no_mem); return mem; } void *xrealloc(void *mem, size_t size) { mem = realloc(mem, size); if (!mem) die(no_mem); return mem; } char *xstrdup(const char *str) { size_t size = strlen(str) + 1; return memcpy(xmalloc(size), str, size); }
#ifndef SELDATA_H #define SELDATA_H #include "guidata.h" #include "molecule.h" namespace Vipster { namespace GUI { struct SelProp{ // 16 bytes Vec pos; // 3*4 = 12 bytes float rad; // 4 bytes }; class SelData: public Data{ // CPU-Data: std::vector<SelProp> sel_buffer{}; std::array<float, 9> cell_mat{}; Step::selection* curSel{nullptr}; // GPU-State/Data: GLuint vao{0}, vbo{0}; // Shader: static struct{ GLuint program; GLuint vertex, position, vert_scale; GLint offset, pos_scale, scale_fac, color; bool initialized{false}; } shader; public: SelData(const GlobalData& glob, Step::selection* sel=nullptr); ~SelData() override; void drawMol(const Vec &off) override; void drawCell(const Vec &off, const PBCVec &mult) override; void updateGL() override; void initGL() override; void update(Step::selection* sel); }; } } #endif // SELDATA_H
// // Created by Edd on 21/09/2017. // #ifndef PYSTOR_EXPORT_H #define PYSTOR_EXPORT_H #ifndef CSTOR_API # if defined(CSTOR_API_EXPORT) # if defined(_WIN32) || defined(__CYGWIN__) # if defined(CSTOR_API_EXPORT_BUILD) # if defined(__GNUC__) # define CSTOR_API __attribute__ ((dllexport)) # else # define CSTOR_API __declspec(dllexport) # endif # else # if defined(__GNUC__) # define CSTOR_API __attribute__ ((dllimport)) # else # define CSTOR_API __declspec(dllimport) # endif # endif # elif defined(__GNUC__) && defined(CSTOR_API_EXPORT_BUILD) # define CSTOR_API __attribute__ ((visibility ("default"))) # else # define CSTOR_API # endif # else # define CSTOR_API # endif #endif #endif //PYSTOR_EXPORT_H
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // SPXDefines #define COCOAPODS_POD_AVAILABLE_SPXDefines #define COCOAPODS_VERSION_MAJOR_SPXDefines 1 #define COCOAPODS_VERSION_MINOR_SPXDefines 1 #define COCOAPODS_VERSION_PATCH_SPXDefines 0 // SPXDefines/Asserts #define COCOAPODS_POD_AVAILABLE_SPXDefines_Asserts #define COCOAPODS_VERSION_MAJOR_SPXDefines_Asserts 1 #define COCOAPODS_VERSION_MINOR_SPXDefines_Asserts 1 #define COCOAPODS_VERSION_PATCH_SPXDefines_Asserts 0 // SPXDefines/Common #define COCOAPODS_POD_AVAILABLE_SPXDefines_Common #define COCOAPODS_VERSION_MAJOR_SPXDefines_Common 1 #define COCOAPODS_VERSION_MINOR_SPXDefines_Common 1 #define COCOAPODS_VERSION_PATCH_SPXDefines_Common 0 // SPXDefines/Description #define COCOAPODS_POD_AVAILABLE_SPXDefines_Description #define COCOAPODS_VERSION_MAJOR_SPXDefines_Description 1 #define COCOAPODS_VERSION_MINOR_SPXDefines_Description 1 #define COCOAPODS_VERSION_PATCH_SPXDefines_Description 0 // SPXDefines/Encoding #define COCOAPODS_POD_AVAILABLE_SPXDefines_Encoding #define COCOAPODS_VERSION_MAJOR_SPXDefines_Encoding 1 #define COCOAPODS_VERSION_MINOR_SPXDefines_Encoding 1 #define COCOAPODS_VERSION_PATCH_SPXDefines_Encoding 0 // SPXDefines/Logging #define COCOAPODS_POD_AVAILABLE_SPXDefines_Logging #define COCOAPODS_VERSION_MAJOR_SPXDefines_Logging 1 #define COCOAPODS_VERSION_MINOR_SPXDefines_Logging 1 #define COCOAPODS_VERSION_PATCH_SPXDefines_Logging 0
/*-------------------------------------------*/ /* Integer type definitions for FatFs module */ /*-------------------------------------------*/ #ifndef _INTEGER #define _INTEGER #ifdef _WIN32 /* FatFs development platform */ #include <windows.h> #include <tchar.h> #else /* Embedded platform */ /* jg: there's a reason this was invented */ #include <stdint.h> /* These types must be 16-bit, 32-bit or larger integer */ typedef int_least16_t INT; typedef uint_least16_t UINT; /* These types must be 8-bit integer */ typedef int8_t CHAR; typedef uint8_t UCHAR; typedef uint8_t BYTE; /* These types must be 16-bit integer */ typedef int16_t SHORT; typedef uint16_t USHORT; typedef uint16_t WORD; typedef uint16_t WCHAR; /* These types must be 32-bit integer */ typedef int32_t LONG; typedef uint32_t ULONG; typedef uint32_t DWORD; #endif #endif
/** * @file * @brief Works with Embox test subsystem. * * @date 17.11.09 * @author Alexey Fomin * - Initial implementation * @author Eldar Abusalimov * - Rewriting some parts from scratch */ #include <unistd.h> #include <stdio.h> #include <errno.h> #include <framework/test/api.h> static void print_usage(void) { printf("Usage: test [-h] [-n <test_num>] [-t <test_name, string>] [-i]\n"); } static void print_tests(void) { const struct test_suite *test; int i = 0; test_foreach(test) { printf("%3d. %s\n", ++i, test_name(test)); } printf("\nTotal tests: %d\n", i); } static const struct test_suite *get_test_by_nr(int nr) { const struct test_suite *test; int i = 0; if (nr <= 0) { printf("Invalid test number: %d\n", nr); return NULL; } test_foreach(test) { if (++i == nr) { return test; } } printf("Invalid test number: %d (total tests: %d)\n", nr, i); return NULL; } int main(int argc, char **argv) { const struct test_suite *test = NULL; int test_nr = -1; int opt; /* TODO it must be agreed with shell maximum command length */ char test_name[100] = { 0 }; while (-1 != (opt = getopt(argc, argv, "hn:t:i"))) { switch (opt) { case 'n': if ((optarg == NULL) || (!sscanf(optarg, "%d", &test_nr))) { printf("test -n: number expected\n"); print_usage(); return -EINVAL; } break; case 't': if ((optarg == NULL) || (!sscanf(optarg, "%s", test_name))) { printf("test -t: test name expected\n"); print_usage(); return -EINVAL; } break; case '?': case 'h': print_usage(); /* FALLTHROUGH */ default: return 0; } } if (test_nr != -1) { if (NULL == (test = get_test_by_nr(test_nr))) { return -ENOENT; } } if (*test_name != 0) { if (NULL == (test = test_lookup(test_name))) { printf("Can't find test named \"%s\"\n", test_name); return -ENOENT; } } if (NULL == test) { print_tests(); return 0; } return test_suite_run(test); }
#ifndef TOMATL_WINDOW_FUNCTION #define TOMATL_WINDOW_FUNCTION #include <functional> namespace tomatl { namespace dsp{ template <typename T> class WindowFunction { private: size_t mLength = 0; std::function<T(const int&, const size_t&)> mFunction; T* mPrecalculated = NULL; T mScalingFactor = 0.; TOMATL_DECLARE_NON_MOVABLE_COPYABLE(WindowFunction); public: WindowFunction(size_t length, std::function<T(const int&, const size_t&)> func, bool periodicMode = false) : mFunction(func) { mPrecalculated = new T[length]; mLength = length; memset(mPrecalculated, 0x0, sizeof(T)* length); if (periodicMode) ++length; for (int i = 0; i < mLength; ++i) { mPrecalculated[i] = mFunction(i, length); mScalingFactor += mPrecalculated[i]; } mScalingFactor /= length; } forcedinline void applyFunction(T* signal, size_t start, size_t length = 1, bool scale = false) { int end = start + length; int sample = 0; for (int i = start; i < end; ++i) { if (i >= 0 && i < mLength) { signal[sample] *= mPrecalculated[i]; if (scale) signal[sample] /= mScalingFactor; } else { signal[sample] = 0.; } ++sample; } } // TODO: handle negative indices? forcedinline T applyPeriodic(T signal, size_t position) { T temp = signal; applyFunction(&temp, position % getLength()); return temp; } forcedinline const size_t& getLength() { return mLength; } // After windowing input signal, it obviously becomes "more quiet", so we're need to compensate that sometimes (http://alpha.science.unitn.it/~bassi/Signal/NInotes/an041.pdf) // If we'll take signal consisting of all samples being equal to on one, its power (sum of all samples divided by sample count) will be equal to one // Applying window function to this signal and measuring its power will tell us how much power is being lost. This is how this thing can be calculated - // Sum all precalculated window samples (on large size like 40960 for accuracy) and divide by sample count. forcedinline const T& getNormalizationFactor() { return mScalingFactor; } virtual ~WindowFunction() { TOMATL_BRACE_DELETE(mPrecalculated); } }; class WindowFunctionFactory { private: WindowFunctionFactory(){} public: enum FunctionType { windowRectangle = 0, windowBlackmanHarris, windowHann, windowBarlett, windowMystic }; template <typename T> static std::function<T(const int&, const size_t&)> getWindowCalculator(FunctionType type) { if (type == windowRectangle) { return [](const int& i, const size_t& length) { return 1.; }; } else if (type == windowHann) { return [](const int& i, const size_t& length) { return 0.5 * (1. - std::cos(2 * TOMATL_PI * i / (length - 1))); }; } else if (type == windowBarlett) { return [](const int& i, const size_t& length) { double a = ((double)length - 1.) / 2.; return 1. - std::abs((i - a) / a); }; } else if (type == windowBlackmanHarris) // Four-term Blackman-Harris window { return[](const int& i, const size_t& length) { T a0 = 0.35875; T a1 = 0.48829; T a2 = 0.14128; T a3 = 0.01168; return a0 - a1 * std::cos(2 * TOMATL_PI * i / (length - 1)) + a2 * std::cos(4 * TOMATL_PI * i / (length - 1)) - a3 * std::cos(6 * TOMATL_PI * i / (length - 1)); }; } else if (type == windowMystic) { return [](const int& i, const size_t& length) { double a = std::sin(TOMATL_PI * i + TOMATL_PI / 2 * length); return std::sin(TOMATL_PI / 2 * a * a); }; } else { throw 20; // TODO: exception } } }; }} #endif
/********************************************************************************* * * 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_LAYERCLGLCONVERTER_H #define IVW_LAYERCLGLCONVERTER_H #include <inviwo/core/datastructures/representationconverter.h> #include <inviwo/core/datastructures/image/layerram.h> #include <inviwo/core/datastructures/image/layerramconverter.h> #include <modules/opengl/image/layerglconverter.h> #include <modules/opencl/inviwoopencl.h> #include <modules/opencl/image/layercl.h> #include <modules/opencl/image/layerclgl.h> namespace inviwo { class IVW_MODULE_OPENCL_API LayerCLGL2RAMConverter : public RepresentationConverterType<LayerCLGL, LayerRAM> { public: virtual std::shared_ptr<LayerRAM> createFrom( std::shared_ptr<const LayerCLGL> source) const override; virtual void update(std::shared_ptr<const LayerCLGL> source, std::shared_ptr<LayerRAM> destination) const override; }; class IVW_MODULE_OPENCL_API LayerCLGL2GLConverter : public RepresentationConverterType<LayerCLGL, LayerGL> { public: virtual std::shared_ptr<LayerGL> createFrom( std::shared_ptr<const LayerCLGL> source) const override; virtual void update(std::shared_ptr<const LayerCLGL> source, std::shared_ptr<LayerGL> destination) const override; }; class IVW_MODULE_OPENCL_API LayerCLGL2CLConverter : public RepresentationConverterType<LayerCLGL, LayerCL> { public: virtual std::shared_ptr<LayerCL> createFrom( std::shared_ptr<const LayerCLGL> source) const override; virtual void update(std::shared_ptr<const LayerCLGL> source, std::shared_ptr<LayerCL> destination) const override; }; class IVW_MODULE_OPENCL_API LayerGL2CLGLConverter : public RepresentationConverterType<LayerGL, LayerCLGL> { public: virtual std::shared_ptr<LayerCLGL> createFrom( std::shared_ptr<const LayerGL> source) const override; virtual void update(std::shared_ptr<const LayerGL> source, std::shared_ptr<LayerCLGL> destination) const override; }; } // namespace #endif // IVW_LAYERCLGLCONVERTER_H
#ifndef NOUDAR_CORE_IMAPELEMENT_H #define NOUDAR_CORE_IMAPELEMENT_H namespace Knights { using ElementView = char; const ElementView kEmptySpace = '.'; class IMapElement { public: ElementView mView = kEmptySpace; public: ElementView getView(); }; } #endif
// // XMLLogWindowController.h // Jabber // // Created by Alex on 04/11/13. // // #import <Cocoa/Cocoa.h> @interface XMLLogWindowController : NSWindowController @end
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <functional> #include <memory> #include <ABI42_0_0React/core/ComponentDescriptor.h> #include <ABI42_0_0React/core/EventDispatcher.h> #include <ABI42_0_0React/core/Props.h> #include <ABI42_0_0React/core/ShadowNode.h> #include <ABI42_0_0React/core/ShadowNodeFragment.h> #include <ABI42_0_0React/core/State.h> namespace ABI42_0_0facebook { namespace ABI42_0_0React { /* * Default template-based implementation of ComponentDescriptor. * Use your `ShadowNode` type as a template argument and override any methods * if necessary. */ template <typename ShadowNodeT> class ConcreteComponentDescriptor : public ComponentDescriptor { static_assert( std::is_base_of<ShadowNode, ShadowNodeT>::value, "ShadowNodeT must be a descendant of ShadowNode"); using SharedShadowNodeT = std::shared_ptr<const ShadowNodeT>; public: using ConcreteShadowNode = ShadowNodeT; using ConcreteProps = typename ShadowNodeT::ConcreteProps; using SharedConcreteProps = typename ShadowNodeT::SharedConcreteProps; using ConcreteEventEmitter = typename ShadowNodeT::ConcreteEventEmitter; using SharedConcreteEventEmitter = typename ShadowNodeT::SharedConcreteEventEmitter; using ConcreteState = typename ShadowNodeT::ConcreteState; using ConcreteStateData = typename ShadowNodeT::ConcreteState::Data; ConcreteComponentDescriptor(ComponentDescriptorParameters const &parameters) : ComponentDescriptor(parameters) { rawPropsParser_.prepare<ConcreteProps>(); } ComponentHandle getComponentHandle() const override { return ShadowNodeT::Handle(); } ComponentName getComponentName() const override { return ShadowNodeT::Name(); } ShadowNodeTraits getTraits() const override { return ShadowNodeT::BaseTraits(); } ShadowNode::Shared createShadowNode( const ShadowNodeFragment &fragment, ShadowNodeFamily::Shared const &family) const override { assert(std::dynamic_pointer_cast<const ConcreteProps>(fragment.props)); auto shadowNode = std::make_shared<ShadowNodeT>(fragment, family, getTraits()); adopt(shadowNode); return shadowNode; } UnsharedShadowNode cloneShadowNode( const ShadowNode &sourceShadowNode, const ShadowNodeFragment &fragment) const override { assert( dynamic_cast<ConcreteShadowNode const *>(&sourceShadowNode) && "Provided `sourceShadowNode` has an incompatible type."); auto shadowNode = std::make_shared<ShadowNodeT>(sourceShadowNode, fragment); adopt(shadowNode); return shadowNode; } void appendChild( const ShadowNode::Shared &parentShadowNode, const ShadowNode::Shared &childShadowNode) const override { assert( dynamic_cast<ConcreteShadowNode const *>(parentShadowNode.get()) && "Provided `parentShadowNode` has an incompatible type."); auto concreteParentShadowNode = std::static_pointer_cast<const ShadowNodeT>(parentShadowNode); auto concreteNonConstParentShadowNode = std::const_pointer_cast<ShadowNodeT>(concreteParentShadowNode); concreteNonConstParentShadowNode->appendChild(childShadowNode); } virtual SharedProps cloneProps( const SharedProps &props, const RawProps &rawProps) const override { assert( !props || dynamic_cast<ConcreteProps const *>(props.get()) && "Provided `props` has an incompatible type."); if (rawProps.isEmpty()) { return props ? props : ShadowNodeT::defaultSharedProps(); } rawProps.parse(rawPropsParser_); return ShadowNodeT::Props(rawProps, props); }; virtual State::Shared createInitialState( ShadowNodeFragment const &fragment, ShadowNodeFamily::Shared const &family) const override { if (std::is_same<ConcreteStateData, StateData>::value) { // Default case: Returning `null` for nodes that don't use `State`. return nullptr; } return std::make_shared<ConcreteState>( std::make_shared<ConcreteStateData const>( ConcreteShadowNode::initialStateData( fragment, family->getSurfaceId(), *this)), family); } virtual State::Shared createState( ShadowNodeFamily const &family, StateData::Shared const &data) const override { if (std::is_same<ConcreteStateData, StateData>::value) { // Default case: Returning `null` for nodes that don't use `State`. return nullptr; } assert(data && "Provided `data` is nullptr."); return std::make_shared<ConcreteState const>( std::static_pointer_cast<ConcreteStateData const>(data), *family.getMostRecentState()); } virtual ShadowNodeFamily::Shared createFamily( ShadowNodeFamilyFragment const &fragment, SharedEventTarget eventTarget) const override { auto eventEmitter = std::make_shared<ConcreteEventEmitter const>( std::move(eventTarget), fragment.tag, eventDispatcher_); return std::make_shared<ShadowNodeFamily>( ShadowNodeFamilyFragment{ fragment.tag, fragment.surfaceId, eventEmitter}, eventDispatcher_, *this); } protected: virtual void adopt(UnsharedShadowNode shadowNode) const { // Default implementation does nothing. assert(shadowNode->getComponentHandle() == getComponentHandle()); } }; } // namespace ABI42_0_0React } // namespace ABI42_0_0facebook
// This file is part of MOS, the MANTIS Operating System // See http://mantis.cs.colorado.edu/ // // Copyright (c) 2002 - 2007 University of Colorado, Boulder // // 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 the MANTIS Project 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. /** @file mica2-battery.h * @brief Mica2 battery functions. * @author Charles Gruenwald III * @date 04/23/2004 */ /** @brief Init the mica2 battery. */ void mica2_battery_init();
/* $OpenBSD: lm700x.h,v 1.1 2001/10/04 19:46:46 gluk Exp $ */ /* $RuOBSD: lm700x.h,v 1.3 2001/10/04 19:25:39 gluk Exp $ */ /* * Copyright (c) 2001 Vladimir Popov <jumbo@narod.ru> * 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 AUTHOR ``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 AUTHOR 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 _LM700X_H_ #define _LM700X_H_ #include <sys/types.h> #include <machine/bus.h> #define LM700X_REGISTER_LENGTH 24 #define LM700X_DATA_MASK 0xFFC000 #define LM700X_FREQ_MASK 0x003FFF #define LM700X_FREQ(x) (x << 0) /* 0x003FFF */ #define LM700X_LSI(x) (x << 14) /* 0x00C000 */ /* always zero */ #define LM700X_BAND(x) (x << 16) /* 0x070000 */ #define LM700X_STEREO LM700X_BAND(3) #define LM700X_MONO LM700X_BAND(1) #define LM700X_TIME_BASE(x) (x << 19) /* 0x080000 */ /* always zero */ #define LM700X_REF_FREQ(x) (x << 20) /* 0x700000 */ #define LM700X_REF_100 LM700X_REF_FREQ(0) #define LM700X_REF_025 LM700X_REF_FREQ(2) #define LM700X_REF_050 LM700X_REF_FREQ(4) /* The rest is for an AM band */ #define LM700X_DIVIDER_AM (0 << 23) /* 0x000000 */ #define LM700X_DIVIDER_FM (1 << 23) /* 0x800000 */ #define LM700X_WRITE_DELAY 6 /* 6 microseconds */ struct lm700x_t { bus_space_tag_t iot; bus_space_handle_t ioh; bus_size_t offset; u_long wzcl; /* write zero clock low */ u_long wzch; /* write zero clock high */ u_long wocl; /* write one clock low */ u_long woch; /* write one clock high */ u_long initdata; u_long rsetdata; void (*init)(bus_space_tag_t, bus_space_handle_t, bus_size_t, u_long); void (*rset)(bus_space_tag_t, bus_space_handle_t, bus_size_t, u_long); }; u_long lm700x_encode_freq(u_long, u_long); u_long lm700x_encode_ref(u_char); u_char lm700x_decode_ref(u_long); void lm700x_hardware_write(struct lm700x_t *, u_long, u_long); #endif /* _LM700X_H_ */
#ifndef EULER_GRID_EVAL_H #define EULER_GRID_EVAL_H #include "../common/data_structures.h" #include "../riemann/euler_rp.h" #include <tbb/parallel_for.h> #include <tbb/blocked_range2d.h> #include "template_grid_eval.h" #ifdef USE_TEMPLATE_GRID_EVAL void euler_rp_grid_eval_template(const real* q, const real* aux, const void* aux_global, const int nx, const int ny, real* amdq, real* apdq, real* wave, real* wave_speed); #endif // USE_TEMPLATE_GRID_EVAL void euler_rp_grid_eval_void_serial(const real* q, const real* aux, const void* aux_global, const int nx, const int ny, real* amdq, real* apdq, real* wave, real* wave_speed); void euler_rp_grid_eval_void_tbb(const real* q, const real* aux, const void* aux_global, const int nx, const int ny, real* amdq, real* apdq, real* wave, real* wave_speed); void euler_rp_grid_eval_void_omp(const real* q, const real* aux, const void* aux_global, const int nx, const int ny, real* amdq, real* apdq, real* wave, real* wave_speed); extern const char * euler_rp_grid_eval_names[]; extern const rp_grid_eval_t euler_rp_grid_evals[]; extern const size_t num_euler_rp_grid_eval_kernels; #endif // EULER_GRID_EVAL_H
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013 Andy Brown <www.andybrown.me.uk> * Please see website for licensing terms. */ #pragma once // ensure the MCU series is correct #ifndef STM32PLUS_F1 #error This class can only be used with the STM32F1 series #endif namespace stm32plus { /** * Utility class for the sole purpose of initialising a GPIO pin for the ADC. * @tparam TAdcNumber The ADC number (1..3) * @tparam TChannelNumber The channel number (0..15) */ template<uint8_t TAdcNumber,uint8_t TChannelNumber> struct AdcChannelGpioInitiaiser { /** * Initialise the GPIO pin. The idea here is that the conditional statements are on constants * and so can be evaluated at compile time. The optimiser will eliminate everything except * the two assignments for the correct port and pin. */ static void initialiseGpioPin() { GPIO_TypeDef *port; uint16_t pin; static_assert(TAdcNumber>=1 && TAdcNumber<=3,"TAdcNumber out of range"); if(TAdcNumber==1) { switch(TChannelNumber) { case 0: port=GPIOA; pin=GPIO_Pin_0; break; case 1: port=GPIOA; pin=GPIO_Pin_1; break; case 2: port=GPIOA; pin=GPIO_Pin_2; break; case 3: port=GPIOA; pin=GPIO_Pin_3; break; case 4: port=GPIOA; pin=GPIO_Pin_4; break; case 5: port=GPIOA; pin=GPIO_Pin_5; break; case 6: port=GPIOA; pin=GPIO_Pin_6; break; case 7: port=GPIOA; pin=GPIO_Pin_7; break; case 8: port=GPIOB; pin=GPIO_Pin_0; break; case 9: port=GPIOB; pin=GPIO_Pin_1; break; case 10: port=GPIOC; pin=GPIO_Pin_0; break; case 11: port=GPIOC; pin=GPIO_Pin_1; break; case 12: port=GPIOC; pin=GPIO_Pin_2; break; case 13: port=GPIOC; pin=GPIO_Pin_3; break; case 14: port=GPIOC; pin=GPIO_Pin_4; break; case 15: port=GPIOC; pin=GPIO_Pin_5; break; } } else if(TAdcNumber==2) { switch(TChannelNumber) { case 0: port=GPIOA; pin=GPIO_Pin_0; break; case 1: port=GPIOA; pin=GPIO_Pin_1; break; case 2: port=GPIOA; pin=GPIO_Pin_2; break; case 3: port=GPIOA; pin=GPIO_Pin_3; break; case 4: port=GPIOA; pin=GPIO_Pin_4; break; case 5: port=GPIOA; pin=GPIO_Pin_5; break; case 6: port=GPIOA; pin=GPIO_Pin_6; break; case 7: port=GPIOA; pin=GPIO_Pin_7; break; case 8: port=GPIOB; pin=GPIO_Pin_0; break; case 9: port=GPIOB; pin=GPIO_Pin_1; break; case 10: port=GPIOC; pin=GPIO_Pin_0; break; case 11: port=GPIOC; pin=GPIO_Pin_1; break; case 12: port=GPIOC; pin=GPIO_Pin_2; break; case 13: port=GPIOC; pin=GPIO_Pin_3; break; case 14: port=GPIOC; pin=GPIO_Pin_4; break; case 15: port=GPIOC; pin=GPIO_Pin_5; break; } } else if(TAdcNumber==3) { switch(TChannelNumber) { // not all channels are available on ADC3 case 0: port=GPIOA; pin=GPIO_Pin_0; break; case 1: port=GPIOA; pin=GPIO_Pin_1; break; case 2: port=GPIOA; pin=GPIO_Pin_2; break; case 3: port=GPIOA; pin=GPIO_Pin_3; break; case 4: port=GPIOF; pin=GPIO_Pin_6; break; case 5: port=GPIOF; pin=GPIO_Pin_7; break; case 6: port=GPIOF; pin=GPIO_Pin_8; break; case 7: port=GPIOF; pin=GPIO_Pin_9; break; case 8: port=GPIOF; pin=GPIO_Pin_10; break; case 10: port=GPIOC; pin=GPIO_Pin_0; break; case 11: port=GPIOC; pin=GPIO_Pin_1; break; case 12: port=GPIOC; pin=GPIO_Pin_2; break; case 13: port=GPIOC; pin=GPIO_Pin_3; break; } } // initialise the pin GpioPinInitialiser::initialise(port,pin); // this minimal overload is for analog input } }; }
/*ckwg +5 * Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef __vqQueryDialog_h #define __vqQueryDialog_h #include <QDateTime> #include <QDialog> #include <qtStatusSource.h> #include <vvQueryInstance.h> class vqCore; class vqQueryDialogPrivate; class vqQueryDialog : public QDialog { Q_OBJECT public: vqQueryDialog(vqCore* core, bool useAdvancedUi, QWidget* parent = 0, Qt::WindowFlags flags = 0); virtual ~vqQueryDialog(); void loadPersistentQuery(); vvQueryInstance query(); void initiateDatabaseQuery(std::string videoUri, long long startTimeLimit, long long endTimeLimit, long long initialTime); static void saveQuery(const vvQueryInstance& query, QWidget* parent = 0); static void savePersistentQuery(const vvQueryInstance& query); signals: void readyToProcessDatabaseVideoQuery(vvQueryInstance); public slots: virtual void accept(); protected slots: void updateTimeUpperFromLower(); void updateTimeLowerFromUpper(); void preSetQueryType(); void setQueryType(int); void requestRegion(); void acceptDrawnRegion(vgGeocodedPoly region); void editRegionNumeric(); void editQuery(); void loadQuery(); void saveQuery(); void setQuery(vvQueryInstance, bool setType = true); void setError(qtStatusSource, QString); void resetQueryId(); protected: QTE_DECLARE_PRIVATE_RPTR(vqQueryDialog) private: QTE_DECLARE_PRIVATE(vqQueryDialog) }; #endif
#ifndef FILEBROWSER_INCLUDED #define FILEBROWSER_INCLUDED #include "tw/tw.h" #include "tfilepath.h" //------------------------------------------------------------------- class GenericFileBrowserAction { public: virtual ~GenericFileBrowserAction() {} virtual void sendCommand(const TFilePath &) = 0; }; //------------------------------------------------------------------- template <class T> class FileBrowserAction : public GenericFileBrowserAction { public: typedef void (T::*Method)(const TFilePath &); FileBrowserAction(T *target, Method method) : m_target(target), m_method(method) {} void sendCommand(const TFilePath &fp) { (m_target->*m_method)(fp); } private: T *m_target; Method m_method; }; //------------------------------------------------------------------- class FileBrowser : public TWidget { public: FileBrowser(TWidget *parent, string name, const vector<string> &fileTypes); ~FileBrowser(); void setFilter(const vector<string> &fileTypes); void configureNotify(const TDimension &d); void setBackgroundColor(const TGuiColor &); void draw(); void setFileSelChangeAction(GenericFileBrowserAction *action); void setFileDblClickAction(GenericFileBrowserAction *action); TFilePath getCurrentDir() const; void setCurrentDir(const TFilePath &dirPath); void selectParentDirectory(); private: class Data; Data *m_data; }; #endif
//headers wrapper for all kinds of BPlusTree #include "ISTree/ISTree.h" #include "SITree/SITree.h" #include "IVTree/IVTree.h"
/* * Copyright (C) 2005-2016 Christoph Rupp (chris@crupp.de). * All Rights Reserved. * * 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. * * See the file COPYING for License information. */ #ifndef UPS_BENCH_GRAPH_H #define UPS_BENCH_GRAPH_H #include <string> #include <fstream> #include <stdio.h> #include <boost/filesystem.hpp> // // A class which writes a PNG graph // struct Graph { // constructor Graph(const char *name) : name_(name), latency_file_(0), throughput_file_(0), has_lat_inserts_(false), has_lat_finds_(false), has_lat_erases_(false), has_lat_commits_(false) { } // destructor - creates the PNG file ~Graph() { generate_png(); if (latency_file_) { ::fclose(latency_file_); latency_file_ = 0; } if (throughput_file_) { ::fclose(throughput_file_); throughput_file_ = 0; } } // add information to the "operations per second" graph void add_opspersec_graph(uint64_t time, uint32_t insert, uint32_t find, uint32_t erase, uint32_t commit) { if (!throughput_file_) { char filename[128]; ::sprintf(filename, "%s-ops.dat", name_.c_str()); throughput_file_ = ::fopen(filename, "w"); if (!throughput_file_) { std::cerr << "error writing to file: " << ::strerror(errno) << std::endl; ::exit(-1); } ::setvbuf(throughput_file_, NULL, _IOFBF, 2 * 1024 * 1024); } ::fprintf(throughput_file_, "%lu %u %u %u %u\n", time, insert, find, erase, commit); } // add latency metrics to the graphs void add_latency_metrics(double time, double lat_insert, double lat_find, double lat_erase, double lat_commit, uint32_t page_fetch, uint32_t page_flush) { if (!latency_file_) { char filename[128]; ::sprintf(filename, "%s-lat.dat", name_.c_str()); latency_file_ = ::fopen(filename, "w"); if (!latency_file_) { ::printf("error writing to file: %s\n", ::strerror(errno)); ::exit(-1); } ::setvbuf(latency_file_, NULL, _IOFBF, 10 * 1024 * 1024); } if (lat_insert > 0.0) has_lat_inserts_ = true; if (lat_erase > 0.0) has_lat_erases_ = true; if (lat_find > 0.0) has_lat_finds_ = true; if (lat_commit > 0.0) has_lat_commits_ = true; ::fprintf(latency_file_, "%f %f %f %f %f %u %u\n", time, lat_insert, lat_find, lat_erase, lat_commit, page_fetch, page_flush); } // generates a PNG from the accumulated data void generate_png() { boost::filesystem::remove("graph-lat.png"); boost::filesystem::remove("graph-ops.png"); if (latency_file_) { ::fflush(latency_file_); std::ofstream os; os.open("gnuplot-lat"); os << "reset" << std::endl << "set terminal png" << std::endl << "set xlabel \"time\"" << std::endl << "set ylabel \"latency (thread #1)\"" << std::endl << "set style data linespoint" << std::endl << "plot \"upscaledb-lat.dat\" using 1:2 title \"insert\""; if (has_lat_finds_) os << ", \"\" using 1:3 title \"find\""; if (has_lat_erases_) os << ", \"\" using 1:4 title \"erase\""; if (has_lat_commits_) os << ", \"\" using 1:5 title \"txn-commit\""; os << std::endl; os.close(); int s = ::system("gnuplot gnuplot-lat > graph-lat.png"); (void) s; // avoid compiler warning } if (throughput_file_) { ::fflush(throughput_file_); std::ofstream os; os.open("gnuplot-ops"); os << "reset" << std::endl << "set terminal png" << std::endl << "set xlabel \"time\"" << std::endl << "set ylabel \"operations (all threads)\"" << std::endl << "set style data linespoint" << std::endl << "plot \"upscaledb-ops.dat\" using 1:2 title \"insert\""; if (has_lat_finds_) os << ", \"\" using 1:3 title \"find\""; if (has_lat_erases_) os << ", \"\" using 1:4 title \"erase\""; if (has_lat_commits_) os << ", \"\" using 1:5 title \"txn-commit\""; os << std::endl; os.close(); int s = ::system("gnuplot gnuplot-ops > graph-ops.png"); (void) s; // avoid compiler warning } } // name: required for the filenames and labels std::string name_; // file handle for the latency output FILE *latency_file_; // file handle for the operation-per-second FILE *throughput_file_; // flags to decide whether certain graphs are printed bool has_lat_inserts_; bool has_lat_finds_; bool has_lat_erases_; bool has_lat_commits_; }; #endif /* UPS_BENCH_GRAPH_H */
/* Copyright (c) by respective owners including Yahoo!, Microsoft, and individual contributors. All rights reserved. Released under a BSD license as described in the file LICENSE. */ #pragma once namespace NOOP { LEARNER::base_learner* setup(vw& all); }
// Copyright 2016 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 COMPONENTS_BLOCKLIST_OPT_OUT_BLOCKLIST_OPT_OUT_BLOCKLIST_ITEM_H_ #define COMPONENTS_BLOCKLIST_OPT_OUT_BLOCKLIST_OPT_OUT_BLOCKLIST_ITEM_H_ #include <stdint.h> #include <map> #include <memory> #include <queue> #include "base/callback.h" #include "base/macros.h" #include "base/time/time.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace blocklist { // Stores the recent block list history for a single host. Stores // |stored_history_length| of the most recent actions. To determine action // eligibility fewer than |opt_out_block_list_threshold| out of the past // |stored_history_length| navigations must be opt outs. |block_list_duration| // is the amount of time that elapses until the host is no longer on the block // list. class OptOutBlocklistItem { public: OptOutBlocklistItem(size_t stored_history_length, int opt_out_block_list_threshold, base::TimeDelta block_list_duration); OptOutBlocklistItem(const OptOutBlocklistItem&) = delete; OptOutBlocklistItem& operator=(const OptOutBlocklistItem&) = delete; ~OptOutBlocklistItem(); // Adds a new navigation at the specified |entry_time|. void AddEntry(bool opt_out, base::Time entry_time); // Whether the action corresponding to |this| should be disallowed. bool IsBlockListed(base::Time now) const; absl::optional<base::Time> most_recent_opt_out_time() const { return most_recent_opt_out_time_; } size_t OptOutRecordsSizeForTesting() const; private: // An action to |this| is represented by time and whether the action was an // opt out. class OptOutRecord { public: OptOutRecord(base::Time entry_time, bool opt_out); OptOutRecord(const OptOutRecord&) = delete; OptOutRecord& operator=(const OptOutRecord&) = delete; ~OptOutRecord(); OptOutRecord(OptOutRecord&&) noexcept; OptOutRecord& operator=(OptOutRecord&&) noexcept; // Used to determine eviction priority. bool operator<(const OptOutRecord& other) const; // The time that the opt out state was determined. base::Time entry_time() const { return entry_time_; } // Whether the user opted out of the action. bool opt_out() const { return opt_out_; } private: // The time that the opt out state was determined. base::Time entry_time_; // Whether the user opted out of the action. bool opt_out_; }; // The number of entries to store to determine action eligibility. const size_t max_stored_history_length_; // The number opt outs in recent history that will trigger blocklisting. const int opt_out_block_list_threshold_; // The amount of time to block list a domain after the most recent opt out. const base::TimeDelta max_block_list_duration_; // The |max_stored_history_length_| most recent action. Is maintained as a // priority queue that has high priority for items that should be evicted // (i.e., they are old). std::priority_queue<OptOutRecord> opt_out_records_; // Time of the most recent opt out. absl::optional<base::Time> most_recent_opt_out_time_; // The total number of opt outs currently in |opt_out_records_|. int total_opt_out_; }; } // namespace blocklist #endif // COMPONENTS_BLOCKLIST_OPT_OUT_BLOCKLIST_OPT_OUT_BLOCKLIST_ITEM_H_
// Copyright (C) 2011 Google 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. // Author: Fredrik Roubert <roubert@google.com> // RE2Cache is a simple wrapper around hash_map<> to store RE2 objects. // // To get a cached RE2 object for a regexp pattern string, create a ScopedAccess // object with a pointer to the cache object and the pattern string itself as // constructor parameters. If an RE2 object corresponding to the pattern string // doesn't already exist, it will be created by the access object constructor. // The access object implements operator const RE& and can therefore be passed // as an argument to any function that expects an RE2 object. // // RE2Cache cache; // RE2Cache::ScopedAccess foo(&cache, "foo"); // bool match = RE2::FullMatch("foobar", foo); #ifndef I18N_PHONENUMBERS_RE2_CACHE_H_ #define I18N_PHONENUMBERS_RE2_CACHE_H_ #ifdef __DEPRECATED #undef __DEPRECATED // Don't warn for using <hash_map>. #endif #include <cstddef> #include <hash_map> #include <string> #include "base/scoped_ptr.h" #include "base/synchronization/lock.h" namespace re2 { class RE2; } // namespace re2 namespace i18n { namespace phonenumbers { using re2::RE2; using std::string; using __gnu_cxx::hash_map; class RE2Cache { private: typedef hash_map<string, const RE2*> CacheImpl; public: explicit RE2Cache(size_t min_items); ~RE2Cache(); class ScopedAccess { public: ScopedAccess(RE2Cache* cache, const string& pattern); operator const RE2&() const { return *regexp_; } private: const RE2* regexp_; friend class RE2CacheTest_AccessConstructor_Test; }; private: base::Lock lock_; // protects cache_impl_ scoped_ptr<CacheImpl> cache_impl_; // protected by lock_ friend class RE2CacheTest_CacheConstructor_Test; friend class RE2CacheTest_AccessConstructor_Test; }; } // namespace phonenumbers } // namespace i18n #endif // I18N_PHONENUMBERS_RE2_CACHE_H_
// ContentsHistory.h // kotonoko // // Copyright 2001 - 2014 Atsushi Tagami. All rights reserved. // #import <AppKit/AppKit.h> @interface ContentsHistoryItem : NSObject { NSURL* _url; NSBitmapImageRep* _bitmapCache; } +(ContentsHistoryItem*) historyItemWithUrl:(NSURL*)url bitmap:(NSBitmapImageRep*)bitmap; -(id) initWithUrl:(NSURL*)url bitmap:(NSBitmapImageRep*)bitmap; @property(strong) NSURL* url; @property(strong) NSBitmapImageRep* bitmapCache; @end @interface ContentsHistory : NSObject { NSMutableArray* _values; NSUInteger _historyIndex; NSURL* _currentURL; } @property(readonly) NSUInteger historyIndex; @property(strong) NSURL* currentURL; @property(readonly) BOOL canBackHistory, canForwardHistory; -(void) addHistoryItem:(ContentsHistoryItem*)item; -(void) addURL:(NSURL*)url historyItem:(BOOL)history; -(NSURL*) moveHistoryAt:(NSUInteger)index; -(NSURL*) currentURL; -(void) setCurrentDisplayCache:(NSBitmapImageRep*) bitmap; -(NSBitmapImageRep*) getCurrentDisplayCache:(NSUInteger) offset; -(BOOL) canBackHistory; -(BOOL) canForwardHistory; @end
/** * * @generated c Thu Sep 15 12:09:48 2011 * **/ #define _TYPE PLASMA_Complex32_t #define _PREC float #define _LAMCH LAPACKE_slamch_work #define _NAME "PLASMA_cgetrf_rectil" /* See Lawn 41 page 120 */ #define _FMULS FMULS_GETRF(n, nrhs) #define _FADDS FADDS_GETRF(n, nrhs) #include "../control/common.h" #include "./timing.c" void CORE_cgetrf_rectil_init(void); extern plasma_context_t* plasma_context_self(void); /* * WARNING: the check is only working with LAPACK Netlib * which choose the same pivot than this code. * MKL has a different code and can pick a different pivot * if two elments have the same absolute value but not the * same sign for example. */ static int RunTest(int *iparam, float *dparam, real_Double_t *t_) { plasma_context_t *plasma; Quark_Task_Flags task_flags = Quark_Task_Flags_Initializer; PLASMA_Complex32_t *A, *AT, *A2 = NULL; PLASMA_desc *descA; real_Double_t t; int *ipiv, *ipiv2 = NULL; int i; int nb = iparam[TIMING_NB]; int m = iparam[TIMING_N]; int n = iparam[TIMING_NRHS]; int check = iparam[TIMING_CHECK]; int lda = m; PLASMA_sequence *sequence = NULL; PLASMA_request request = PLASMA_REQUEST_INITIALIZER; /* Initialize Plasma */ PLASMA_Init( iparam[TIMING_THRDNBR] ); PLASMA_Set(PLASMA_SCHEDULING_MODE, PLASMA_DYNAMIC_SCHEDULING ); PLASMA_Disable(PLASMA_AUTOTUNING); PLASMA_Set(PLASMA_TILE_SIZE, iparam[TIMING_NB] ); PLASMA_Set(PLASMA_INNER_BLOCK_SIZE, iparam[TIMING_IB] ); /* Allocate Data */ A = (PLASMA_Complex32_t *)malloc(lda*n*sizeof(PLASMA_Complex32_t)); AT = (PLASMA_Complex32_t *)malloc(lda*n*sizeof(PLASMA_Complex32_t)); /* Check if unable to allocate memory */ if ( ( !AT ) || (! A) ) { printf("Out of Memory \n "); return -1; } /* Initialiaze Data */ LAPACKE_clarnv_work(1, ISEED, lda*n, A); /* for(i=0; i<n; i++) { */ /* A[i*lda+i] += (float)m; */ /* } */ PLASMA_Desc_Create(&descA, AT, PlasmaComplexFloat, nb, nb, nb*nb, lda, n, 0, 0, m, n); PLASMA_cLapack_to_Tile((void*)A, lda, descA); /* Allocate Workspace */ ipiv = (int *)malloc( n*sizeof(int) ); /* Save AT in lapack layout for check */ if ( check ) { A2 = (PLASMA_Complex32_t *)malloc(lda*n*sizeof(PLASMA_Complex32_t)); ipiv2 = (int *)malloc( n*sizeof(int) ); LAPACKE_clacpy_work(LAPACK_COL_MAJOR,' ', m, n, A, lda, A2, lda); LAPACKE_cgetrf_work(LAPACK_COL_MAJOR, m, n, A2, lda, ipiv2 ); } plasma = plasma_context_self(); PLASMA_Sequence_Create(&sequence); QUARK_Task_Flag_Set(&task_flags, TASK_SEQUENCE, (intptr_t)sequence->quark_sequence); QUARK_Task_Flag_Set(&task_flags, TASK_THREAD_COUNT, iparam[TIMING_THRDNBR] ); plasma_dynamic_spawn(); CORE_cgetrf_rectil_init(); t = -cWtime(); QUARK_CORE_cgetrf_rectil(plasma->quark, &task_flags, *descA, AT, descA->mb*descA->nb, ipiv, sequence, &request, 0, 0, iparam[TIMING_THRDNBR]); PLASMA_Sequence_Wait(sequence); t += cWtime(); *t_ = t; PLASMA_Sequence_Destroy(sequence); /* Check the solution */ if ( check ) { float *work = (float *)malloc(max(m,n)*sizeof(float)); PLASMA_cTile_to_Lapack(descA, (void*)A, lda); /* Check ipiv */ for(i=0; i<n; i++) { if( ipiv[i] != ipiv2[i] ) { fprintf(stderr, "\nPLASMA (ipiv[%d] = %d, A[%d] = %e) / LAPACK (ipiv[%d] = %d, A[%d] = [%e])\n", i, ipiv[i], i, crealf(A[ i * lda + i ]), i, ipiv2[i], i, crealf(A2[ i * lda + i ])); break; } } dparam[TIMING_ANORM] = LAPACKE_clange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaMaxNorm), m, n, A, lda, work); dparam[TIMING_XNORM] = LAPACKE_clange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaMaxNorm), m, n, A2, lda, work); dparam[TIMING_BNORM] = 0.0; CORE_caxpy( m, n, -1.0, A, lda, A2, lda); dparam[TIMING_RES] = LAPACKE_clange_work(LAPACK_COL_MAJOR, lapack_const(PlasmaMaxNorm), m, n, A2, lda, work); free( A2 ); free( ipiv2 ); free( work ); } /* Deallocate Workspace */ PLASMA_Desc_Destroy(&descA); free( A ); free( AT ); free( ipiv ); PLASMA_Finalize(); return 0; }
/* * International Chemical Identifier (InChI) * Version 1 * Software version 1.02 * October 31, 2008 * Developed at NIST * * The InChI library and programs are free software developed under the * auspices of the International Union of Pure and Applied Chemistry (IUPAC); * you can redistribute this software and/or modify it under the terms of * the GNU Lesser General Public License as published by the Free Software * Foundation: * http://www.opensource.org/licenses/lgpl-license.php */ #ifndef __INCHICANO_H__ #define __INCHICANO_H__ #ifndef INCHI_ALL_CPP #ifdef __cplusplus extern "C" { #endif #endif int GetCanonLengths( int num_at, sp_ATOM* at, ATOM_SIZES *s, T_GROUP_INFO *t_group_info ); int AllocateCS( CANON_STAT *pCS, int num_at, int num_at_tg, int nLenCT, int nLenCTAtOnly, int nLenLinearCTStereoDble, int nLenLinearCTIsotopicStereoDble, int nLenLinearCTStereoCarb, int nLenLinearCTIsotopicStereoCarb, int nLenLinearCTTautomer, int nLenLinearCTIsotopicTautomer, int nLenIsotopic, INCHI_MODE nMode, BCN *pBCN ); int DeAllocateCS( CANON_STAT *pCS ); void DeAllocBCN( BCN *pBCN ); int Canon_INChI( int num_atoms, int num_at_tg, sp_ATOM* at, CANON_STAT* pCS, INCHI_MODE nMode, int bTautFtcn); int GetBaseCanonRanking( int num_atoms, int num_at_tg, sp_ATOM* at[], T_GROUP_INFO *t_group_info, ATOM_SIZES s[], BCN *pBCN, struct tagInchiTime *ulTimeOutTime, int bFixIsoFixedH ); int bCanonIsFinerThanEquitablePartition( int num_atoms, sp_ATOM* at, AT_RANK *nSymmRank ); int UpdateFullLinearCT( int num_atoms, int num_at_tg, sp_ATOM* at, AT_RANK *nRank, AT_RANK *nAtomNumber, CANON_STAT* pCS, int bFirstTime ); int FixCanonEquivalenceInfo( int num_at_tg, AT_RANK *nSymmRank, AT_RANK *nCurrRank, AT_RANK *nTempRank, AT_NUMB *nAtomNumber, int *bChanged); #ifndef INCHI_ALL_CPP #ifdef __cplusplus } #endif #endif #endif /* __INCHICANO_H__ */
/*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkPropertyListDeserializerV1_h_included #define mitkPropertyListDeserializerV1_h_included #include "mitkPropertyListDeserializer.h" namespace mitk { /** \brief Deserializes a mitk::PropertyList */ class PropertyListDeserializerV1 : public PropertyListDeserializer { public: mitkClassMacro(PropertyListDeserializerV1, PropertyListDeserializer); itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should itkCloneMacro(Self) /** \brief Reads a propertylist from file. Get result via GetOutput() \return success of deserialization */ bool Deserialize() override; protected: PropertyListDeserializerV1(); ~PropertyListDeserializerV1() override; }; } // namespace #endif
/* $NetBSD: endian.h,v 1.1 2001/06/19 00:20:10 fvdl Exp $ */ #include <sys/endian.h>
// Copyright 2018-present 650 Industries. All rights reserved. #import <AVFoundation/AVFoundation.h> #import <UIKit/UIKit.h> #import <ABI41_0_0UMCore/ABI41_0_0UMModuleRegistry.h> #import <ABI41_0_0UMCore/ABI41_0_0UMAppLifecycleListener.h> #import <ABI41_0_0EXBarCodeScanner/ABI41_0_0EXBarCodeScannerView.h> @interface ABI41_0_0EXBarCodeScannerView : UIView <ABI41_0_0UMAppLifecycleListener> @property (nonatomic, assign) NSInteger presetCamera; @property (nonatomic, strong) NSArray *barCodeTypes; - (instancetype)initWithModuleRegistry:(ABI41_0_0UMModuleRegistry *)moduleRegistry; - (void)onReady; - (void)onMountingError:(NSDictionary *)event; - (void)onBarCodeScanned:(NSDictionary *)event; @end
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END * * $FreeBSD$ * */ int dtrace_debug = 0; TUNABLE_INT("debug.dtrace.debug", &dtrace_debug); SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RW, &dtrace_debug, 0, ""); /* Report registered DTrace providers. */ static int sysctl_dtrace_providers(SYSCTL_HANDLER_ARGS) { char *p_name = NULL; dtrace_provider_t *prov = dtrace_provider; int error = 0; size_t len = 0; mutex_enter(&dtrace_provider_lock); mutex_enter(&dtrace_lock); /* Compute the length of the space-separated provider name string. */ while (prov != NULL) { len += strlen(prov->dtpv_name) + 1; prov = prov->dtpv_next; } if ((p_name = kmem_alloc(len, KM_SLEEP)) == NULL) error = ENOMEM; else { /* Start with an empty string. */ *p_name = '\0'; /* Point to the first provider again. */ prov = dtrace_provider; /* Loop through the providers, appending the names. */ while (prov != NULL) { if (prov != dtrace_provider) (void) strlcat(p_name, " ", len); (void) strlcat(p_name, prov->dtpv_name, len); prov = prov->dtpv_next; } } mutex_exit(&dtrace_lock); mutex_exit(&dtrace_provider_lock); if (p_name != NULL) { error = sysctl_handle_string(oidp, p_name, len, req); kmem_free(p_name, 0); } return (error); } SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_RD, 0, 0, sysctl_dtrace_providers, "A", "");
/***************************************************************************** Copyright (c) 2011, Intel Corp. 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 Intel Corporation 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. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function shsein * Author: Intel Corporation * Generated November, 2011 *****************************************************************************/ #include "lapacke.h" #include "lapacke_utils.h" lapack_int LAPACKE_shsein( int matrix_order, char job, char eigsrc, char initv, lapack_logical* select, lapack_int n, const float* h, lapack_int ldh, float* wr, const float* wi, float* vl, lapack_int ldvl, float* vr, lapack_int ldvr, lapack_int mm, lapack_int* m, lapack_int* ifaill, lapack_int* ifailr ) { lapack_int info = 0; float* work = NULL; if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_shsein", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_order, n, n, h, ldh ) ) { return -7; } if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'l' ) ) { if( LAPACKE_sge_nancheck( matrix_order, n, mm, vl, ldvl ) ) { return -11; } } if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'r' ) ) { if( LAPACKE_sge_nancheck( matrix_order, n, mm, vr, ldvr ) ) { return -13; } } if( LAPACKE_s_nancheck( n, wi, 1 ) ) { return -10; } if( LAPACKE_s_nancheck( n, wr, 1 ) ) { return -9; } #endif /* Allocate memory for working array(s) */ work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) * MAX(1,n+2) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_shsein_work( matrix_order, job, eigsrc, initv, select, n, h, ldh, wr, wi, vl, ldvl, vr, ldvr, mm, m, work, ifaill, ifailr ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_shsein", info ); } return info; }
/* * Copyright (c) 2010,2011,2012,2013,2014,2015 Apple Inc. All rights reserved. * * corecrypto Internal Use License Agreement * * IMPORTANT: This Apple corecrypto software is supplied to you by Apple Inc. ("Apple") * in consideration of your agreement to the following terms, and your download or use * of this Apple software constitutes acceptance of these terms. If you do not agree * with these terms, please do not download or use this Apple software. * * 1. As used in this Agreement, the term "Apple Software" collectively means and * includes all of the Apple corecrypto materials provided by Apple here, including * but not limited to the Apple corecrypto software, frameworks, libraries, documentation * and other Apple-created materials. In consideration of your agreement to abide by the * following terms, conditioned upon your compliance with these terms and subject to * these terms, Apple grants you, for a period of ninety (90) days from the date you * download the Apple Software, a limited, non-exclusive, non-sublicensable license * under Apple’s copyrights in the Apple Software to make a reasonable number of copies * of, compile, and run the Apple Software internally within your organization only on * devices and computers you own or control, for the sole purpose of verifying the * security characteristics and correct functioning of the Apple Software; provided * that you must retain this notice and the following text and disclaimers in all * copies of the Apple Software that you make. You may not, directly or indirectly, * redistribute the Apple Software or any portions thereof. The Apple Software is only * licensed and intended for use as expressly stated above and may not be used for other * purposes or in other contexts without Apple's prior written permission. Except as * expressly stated in this notice, no other rights or licenses, express or implied, are * granted by Apple herein. * * 2. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES * OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING * THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS, * SYSTEMS, OR SERVICES. APPLE DOES NOT WARRANT THAT THE APPLE SOFTWARE WILL MEET YOUR * REQUIREMENTS, THAT THE OPERATION OF THE APPLE SOFTWARE WILL BE UNINTERRUPTED OR * ERROR-FREE, THAT DEFECTS IN THE APPLE SOFTWARE WILL BE CORRECTED, OR THAT THE APPLE * SOFTWARE WILL BE COMPATIBLE WITH FUTURE APPLE PRODUCTS, SOFTWARE OR SERVICES. NO ORAL * OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE * WILL CREATE A WARRANTY. * * 3. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING * IN ANY WAY OUT OF THE USE, REPRODUCTION, COMPILATION OR OPERATION OF THE APPLE * SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * 4. This Agreement is effective until terminated. Your rights under this Agreement will * terminate automatically without notice from Apple if you fail to comply with any term(s) * of this Agreement. Upon termination, you agree to cease all use of the Apple Software * and destroy all copies, full or partial, of the Apple Software. This Agreement will be * governed and construed in accordance with the laws of the State of California, without * regard to its choice of law rules. * * You may report security issues about Apple products to product-security@apple.com, * as described here:  https://www.apple.com/support/security/. Non-security bugs and * enhancement requests can be made via https://bugreport.apple.com as described * here: https://developer.apple.com/bug-reporting/ * * EA1350 * 10/5/15 */ #include <corecrypto/ccec_priv.h> int ccec_generate_key(ccec_const_cp_t cp, struct ccrng_state *rng, ccec_full_ctx_t key) { return ccec_generate_key_fips(cp,rng,key); }
/* $OpenBSD: c_cfb64.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <openssl/cast.h> #include "cast_lcl.h" /* The input and output encrypted as though 64bit cfb mode is being * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, const CAST_KEY *schedule, unsigned char *ivec, int *num, int enc) { register CAST_LONG v0,v1,t; register int n= *num; register long l=length; CAST_LONG ti[2]; unsigned char *iv,c,cc; iv=ivec; if (enc) { while (l--) { if (n == 0) { n2l(iv,v0); ti[0]=v0; n2l(iv,v1); ti[1]=v1; CAST_encrypt((CAST_LONG *)ti,schedule); iv=ivec; t=ti[0]; l2n(t,iv); t=ti[1]; l2n(t,iv); iv=ivec; } c= *(in++)^iv[n]; *(out++)=c; iv[n]=c; n=(n+1)&0x07; } } else { while (l--) { if (n == 0) { n2l(iv,v0); ti[0]=v0; n2l(iv,v1); ti[1]=v1; CAST_encrypt((CAST_LONG *)ti,schedule); iv=ivec; t=ti[0]; l2n(t,iv); t=ti[1]; l2n(t,iv); iv=ivec; } cc= *(in++); c=iv[n]; iv[n]=cc; *(out++)=c^cc; n=(n+1)&0x07; } } v0=v1=ti[0]=ti[1]=t=c=cc=0; *num=n; }
#include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> typedef struct{ int out; int in; }pipe_t; struct threads{ pthread_t id; int num; pipe_t pipe; }; int func(void *arg){ struct threads *thread = arg; char buf; ssize_t len = 0; fprintf(stdout, "Hello World from %d\n", thread->num); do{ len = read(thread->pipe.out, &buf, 1); if(len < 0){ if (errno == EAGAIN) { usleep(1000); continue; } fprintf(stderr, "%s():%d\t%s\n", __func__, __LINE__, strerror(errno)); break; } if(len == 0){ /* We are done */ break; } fprintf(stdout, "[%d] \\x%02x\n", thread->num, buf); } while(1); return EXIT_SUCCESS; }
// // SKSelectionCommand.h // Skim // // Created by Christiaan on 30/10/2018. /* This software is Copyright (c) 2019-2020 Christiaan Hofman. 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 Christiaan Hofman nor the names of any 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. */ #import <Cocoa/Cocoa.h> @interface SKSelectionCommand : NSScriptCommand @end
#ifndef MANIFOLD_SIMPLE_PROC_QSIM_PROC_H #define MANIFOLD_SIMPLE_PROC_QSIM_PROC_H #ifdef USE_QSIM //this file would be empty if USE_QSIM is not defined. #include "simple-proc.h" #include "qsim.h" #include "qsim-client.h" namespace manifold { namespace simple_proc { struct QsimProc_Settings : public SimpleProc_Settings { QsimProc_Settings(const char* server, int port, unsigned cl_size, int msize=16); const char* server; int port; }; //! @brief This processor model acts as a QSim client and fetches instructions from QSim server. //! class QsimProcessor: public SimpleProcessor { public: QsimProcessor (int cpuid, int id, const QsimProc_Settings&); ~QsimProcessor(); protected: private: virtual Instruction* fetch(); Qsim::Client* m_Qsim_client; Qsim::ClientQueue* m_Qsim_queue; int m_Qsim_cpuid; //CPU ID }; } //namespace simple_proc } //namespace manifold #endif //USE_QSIM #endif // MANIFOLD_SIMPLE_PROC_QSIM_PROC_H
#ifndef TBASESERVER_H #define TBASESERVER_H #include <string> //#include "tthread.h" //--------------------------------------------------------------------- class TBaseServer { public: TBaseServer(int port); virtual ~TBaseServer(); void start(); void stop(); virtual std::string exec(int argc, char *argv[]) = 0; private: int extractArgs(char *s, char *argv[]); int m_port; int m_socketId; bool m_stopped; // TThread::Mutex m_mutex; }; #endif
#import <UIKit/UIKit.h> #import <ABI42_0_0React/ABI42_0_0RCTViewManager.h> #import <ABI42_0_0React/ABI42_0_0RCTUIManager.h> #import <ABI42_0_0React/ABI42_0_0RCTLog.h> #import "ABI42_0_0ReactNativePageView.h" NS_ASSUME_NONNULL_BEGIN @interface ABI42_0_0ReactViewPagerManager : ABI42_0_0RCTViewManager @end NS_ASSUME_NONNULL_END
//===-- LibCxx.h ---------------------------------------------------*- C++ //-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_LibCxx_h_ #define liblldb_LibCxx_h_ #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Utility/Stream.h" namespace lldb_private { namespace formatters { bool LibcxxStringSummaryProvider( ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); // libc++ std::string bool LibcxxWStringSummaryProvider( ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); // libc++ std::wstring bool LibcxxSmartPointerSummaryProvider( ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); // libc++ std::shared_ptr<> and std::weak_ptr<> SyntheticChildrenFrontEnd * LibcxxVectorBoolSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); bool LibcxxContainerSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); class LibCxxMapIteratorSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: LibCxxMapIteratorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); size_t CalculateNumChildren() override; lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; bool Update() override; bool MightHaveChildren() override; size_t GetIndexOfChildWithName(const ConstString &name) override; ~LibCxxMapIteratorSyntheticFrontEnd() override; private: ValueObject *m_pair_ptr; lldb::ValueObjectSP m_pair_sp; }; SyntheticChildrenFrontEnd * LibCxxMapIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibCxxVectorIteratorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); class LibcxxSharedPtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: LibcxxSharedPtrSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); size_t CalculateNumChildren() override; lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; bool Update() override; bool MightHaveChildren() override; size_t GetIndexOfChildWithName(const ConstString &name) override; ~LibcxxSharedPtrSyntheticFrontEnd() override; private: ValueObject *m_cntrl; lldb::ValueObjectSP m_count_sp; lldb::ValueObjectSP m_weak_count_sp; uint8_t m_ptr_size; lldb::ByteOrder m_byte_order; }; SyntheticChildrenFrontEnd * LibcxxBitsetSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibcxxSharedPtrSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibcxxStdVectorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibcxxStdListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibcxxStdForwardListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibcxxStdMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibcxxStdUnorderedMapSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * LibcxxInitializerListSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd *LibcxxFunctionFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd *LibcxxQueueFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd *LibcxxTupleFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); } // namespace formatters } // namespace lldb_private #endif // liblldb_LibCxx_h_
/* * Copyright (C) 2011 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. */ #ifndef MeterShadowElement_h #define MeterShadowElement_h #if ENABLE(METER_ELEMENT) #include "HTMLDivElement.h" #include <wtf/Forward.h> namespace WebCore { class HTMLMeterElement; class RenderMeter; class MeterShadowElement : public HTMLDivElement { public: HTMLMeterElement* meterElement() const; protected: MeterShadowElement(Document&); private: virtual bool rendererIsNeeded(const RenderStyle&); }; class MeterInnerElement FINAL : public MeterShadowElement { public: static PassRefPtr<MeterInnerElement> create(Document&); private: MeterInnerElement(Document&); virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; virtual RenderElement* createRenderer(RenderArena&, RenderStyle&) OVERRIDE; }; inline PassRefPtr<MeterInnerElement> MeterInnerElement::create(Document& document) { return adoptRef(new MeterInnerElement(document)); } class MeterBarElement FINAL : public MeterShadowElement { public: static PassRefPtr<MeterBarElement> create(Document&); private: MeterBarElement(Document& document) : MeterShadowElement(document) { DEFINE_STATIC_LOCAL(AtomicString, pseudoId, ("-webkit-meter-bar", AtomicString::ConstructFromLiteral)); setPseudo(pseudoId); } }; inline PassRefPtr<MeterBarElement> MeterBarElement::create(Document& document) { return adoptRef(new MeterBarElement(document)); } class MeterValueElement FINAL : public MeterShadowElement { public: static PassRefPtr<MeterValueElement> create(Document&); void setWidthPercentage(double); void updatePseudo() { setPseudo(valuePseudoId()); } private: MeterValueElement(Document& document) : MeterShadowElement(document) { updatePseudo(); } const AtomicString& valuePseudoId() const; }; inline PassRefPtr<MeterValueElement> MeterValueElement::create(Document& document) { return adoptRef(new MeterValueElement(document)); } } #endif // ENABLE(METER_ELEMENT) #endif // MeterShadowElement_h
// // AppDelegate.h // CocoaOpenNI // // Created by John Boiles on 1/13/12. // Copyright (c) 2012 John Boiles. All rights reserved. // #import <Cocoa/Cocoa.h> @class DepthView; @interface AppDelegate : NSObject <NSApplicationDelegate> { NSWindow *_window; IBOutlet DepthView *_depthView; } @property (assign) IBOutlet NSWindow *window; @end
/* * RTP unit test program. Test scaffolding sets up RTP session object, * uses RTP methods. This file holds all of the RTP SSM RSI RECEIVER tests. * * Copyright (c) 2007-2008 by cisco Systems, Inc. * All rights reserved. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "../include/utils/vam_types.h" #include "rtp_session.h" #include "rtp_ssm_rsi_rcvr.h" #include "rtp_ssm_rsi_source.h" #include "../add-ons/include/CUnit/CUnit.h" #include "../add-ons/include/CUnit/Basic.h" /* CU_ASSERT_* return values are not used */ /* sa_ignore DISABLE_RETURNS CU_assertImplementation */ /* Globals for cross-test validation or cleanup */ extern rtp_session_t *p_test_sess; extern rtp_session_t *p_receiver_sess; /* Used for sender report tests. */ extern rtp_session_t *p_sender_sess; /* Used for sender report tests. */ rtp_ssm_rsi_rcvr_t *p_rtp_ssm_rcv = NULL; /* Used for creation and later * deletion. */ /* Check at known points for memory leaks. */ extern uint32_t memblocks_suite; extern uint32_t memblocks_members; /*********************************************************************** * * SSM RSI RECEIVER SESSION SUITE TESTS START HERE * * SSM RSI RECEIVER Session Suite tests the basic session functions (create * and delete). * **********************************************************************/ int init_ssm_rcv_sess_suite(void) { // memblocks_suite = alloc_blocks; return(0); } int clean_ssm_rcv_sess_suite(void) { return(0); } void test_ssm_rcv_sess_create(void) { rtp_config_t config; rtp_init_config(&config, RTPAPP_STBRTP); config.senders_cached = 1; config.rtcp_bw_cfg.media_as_bw = RTCP_DFLT_AS_BW; /* Use the fatal form; no use proceeding if we can't create a session. */ CU_ASSERT_TRUE_FATAL(rtp_create_session_ssm_rsi_rcvr(&config, &p_rtp_ssm_rcv, TRUE)); /* KK!! Should beat on the session creation some more! */ } void test_ssm_rcv_sess_delete(void) { /* KK!! Must change delete to return error if bad */ rtp_delete_session_ssm_rsi_rcvr(&p_rtp_ssm_rcv, TRUE); } /*********************************************************************** * * SSM RSI RECEIVER MEMBER FUNCTIONS SUITE TESTS START HERE * * SSM RSI RECEIVER Member Functions Suite tests the basic member functions * using * the base_multi tests. Important to create the session at init_suite * time and store the pointer in the p_test_sess global. Also clean up * the session afterwards. * **********************************************************************/ int init_ssm_rcv_member_suite(void) { rtp_config_t config; rtp_init_config(&config, RTPAPP_STBRTP); config.senders_cached = 1; config.rtcp_bw_cfg.media_as_bw = RTCP_DFLT_AS_BW; // memblocks_suite = alloc_blocks; /* Note that you can't assert from within an init or cleanup function. */ if (TRUE != (rtp_create_session_ssm_rsi_rcvr(&config, &p_rtp_ssm_rcv, TRUE))) { return (-1); } p_test_sess = (rtp_session_t *)p_rtp_ssm_rcv; return(0); } int clean_ssm_rcv_member_suite(void) { rtp_delete_session_ssm_rsi_rcvr(&p_rtp_ssm_rcv, TRUE); return(0); } /*********************************************************************** * * SSM RSI RECEIVER SENDER REPORT SUITE TESTS START HERE * * SSM RSI RECEIVER Sender Report Suite tests the basic sender report * functions using * the base sender report tests. It's important to create two sessions * at init_suite time and store the pointers in the p_receiver_sess and * p_sender_sess globals. Also clean up the sessions afterwards. * * IMPORTANT! Note that the SSM "sessions" (rsi source and rsi receiver) * are really two members of the same SSM session. This is important to * this test because the rsi source expects to send the rsi as part of * the Sender Report, and the rsi receiver expects to receive and * parse it. In the current code, the source CANNOT parse a Sender * Report with an RSI and the receiver CANNOT send one. I think this * may be a problem with the source -- what if there's a loop and you * get your own packet in? Possibly it's not a problem, and this * situation is prevented earlier in the data path. * Anyway, for now this test creates two different types of sessions, * the proper ones for the sender and receiver. * **********************************************************************/ int init_ssm_rcv_sender_report_suite(void) { rtp_config_t config; rtp_init_config(&config, RTPAPP_STBRTP); config.senders_cached = 1; config.rtcp_bw_cfg.media_as_bw = RTCP_DFLT_AS_BW; // memblocks_suite = alloc_blocks; /* Note that you can't assert from within an init or cleanup function. */ if (TRUE != (rtp_create_session_ssm_rsi_rcvr( &config, (rtp_ssm_rsi_rcvr_t **)&p_receiver_sess, TRUE))) { return (-1); } config.senders_cached = 1; config.app_type = RTPAPP_VAMRTP; config.app_ref = NULL; if (TRUE != (rtp_create_session_ssm_rsi_source( &config, (rtp_ssm_rsi_source_t **)&p_sender_sess, TRUE))) { return (-1); } return(0); } int clean_ssm_rcv_sender_report_suite(void) { rtp_delete_session_ssm_rsi_source( (rtp_ssm_rsi_source_t **)&p_sender_sess, TRUE); rtp_delete_session_ssm_rsi_rcvr( (rtp_ssm_rsi_rcvr_t **)&p_receiver_sess, TRUE); return(0); }
/*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef __Q_MITK_MATCHPOINT_MAPPER_H #define __Q_MITK_MATCHPOINT_MAPPER_H #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "mitkNodePredicateBase.h" #include "ui_QmitkSegmentationFlowControlView.h" /*! \brief QmitkSegmentationFlowControlView Class that "controls" the segmentation view. It offers the possibility to accept a segmentation. Accepting the segmentation stores the segmentation to the given working directory. The working directory is specified by command line arguments. If no commandline flag is set the current working directory will be used. */ class QmitkSegmentationFlowControlView : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkSegmentationFlowControlView) QmitkSegmentationFlowControlView(); void CreateQtPartControl(QWidget *parent) override; protected slots: void OnAcceptButtonPushed(); protected: void SetFocus() override; void NodeAdded(const mitk::DataNode* node) override; void NodeChanged(const mitk::DataNode* node) override; void NodeRemoved(const mitk::DataNode* node) override; void UpdateControls(); Ui::SegmentationFlowControlView m_Controls; private: QWidget *m_Parent; mitk::NodePredicateBase::Pointer m_SegmentationPredicate; QString m_OutputDir; QString m_FileExtension; }; #endif // MatchPoint_h
// // R2RWalkDriveSegment.h // Rome2Rio // // Created by Ash Verdoorn on 4/09/12. // Copyright (c) 2012 Rome2Rio. All rights reserved. // #import <Foundation/Foundation.h> #import "R2RPosition.h" #import "R2RIndicativePrice.h" @interface R2RWalkDriveSegment : NSObject @property (strong, nonatomic) NSString *kind; @property (strong, nonatomic) NSString *subkind; @property (strong, nonatomic) NSString *vehicle; @property (nonatomic) float distance; @property (nonatomic) float duration; @property (strong, nonatomic) NSString *sName; @property (strong, nonatomic) R2RPosition *sPos; @property (strong, nonatomic) NSString *tName; @property (strong, nonatomic) R2RPosition *tPos; @property (strong, nonatomic) NSString *path; @property (nonatomic) BOOL isMajor; @property (nonatomic) BOOL isImperial; @property (strong, nonatomic) R2RIndicativePrice *indicativePrice; @end
///////////////////////////////////////////////////////////////////////////////// //文件名:DaemonThread.h //功能描述:守护线程,用于监控当前服务器各种信息,以及相关数据保存处理 ///////////////////////////////////////////////////////////////////////////////// #ifndef __DAEMONTHREAD_H__ #define __DAEMONTHREAD_H__ #include "Type.h" class DaemonThread { public : DaemonThread( ) ; ~DaemonThread( ) ; BOOL Init( ) ; VOID CleanUp( ) ; BOOL Loop( ) ; VOID Stop( ){ m_Active = FALSE ; } //模块退出处理 VOID Quit( ) ; //判断当前模块是否处于活动状态 BOOL IsActive( ){ return m_Active ; } ; private : BOOL m_Active ;//是否活动的标志 CMyTimer m_WorkingTime ;// CMyTimer m_FlushLogTimer ; }; extern DaemonThread* g_pDaemonThread ; #endif
// // DaodanStore.h // Daodan // // Created by Sam Marshall on 10/31/13. // Copyright (c) 2013 Sam Marshall. All rights reserved. // #ifndef Daodan_DaodanStore_h #define Daodan_DaodanStore_h #include "SDMHeader.h" #include "SDMSymbolTable.h" void SDMDaodanWriteDump(struct SDMSTLibrary *libTable); #endif
// // MyView.h // objc-calayer-example // // Created by dolphilia on 2016/02/01. // Copyright © 2016年 dolphilia. All rights reserved. // #ifndef MyView_h #define MyView_h #import <Cocoa/Cocoa.h> #import "MyCALayer.h" #include "debug_message.h" @interface MyView : NSView { NSImage* image; MyCALayer* mylayer; @public //mouse BOOL isMouseDown; BOOL isMouseUp; BOOL isMouseDragged; BOOL isRightMouseDown; BOOL isRightMouseUp; BOOL isRightMouseDragged; //key BOOL isKeyDown_Left; // 123 BOOL isKeyDown_Up; // 126 BOOL isKeyDown_Right; // 124 BOOL isKeyDown_Down; // 125 BOOL isKeyDown_Space; // 49 BOOL isKeyDown_Enter; // 36 BOOL isKeyDown_Control; // NSControlKeyMask BOOL isKeyDown_Escape; // 53 BOOL isKeyDown_Tab; // 48 // BOOL isKeyDown_BackSpace; BOOL isKeyDown_0; BOOL isKeyDown_1; BOOL isKeyDown_2; BOOL isKeyDown_3; BOOL isKeyDown_4; BOOL isKeyDown_5; BOOL isKeyDown_6; BOOL isKeyDown_7; BOOL isKeyDown_8; BOOL isKeyDown_9; BOOL isKeyDown_Ten0; BOOL isKeyDown_Ten1; BOOL isKeyDown_Ten2; BOOL isKeyDown_Ten3; BOOL isKeyDown_Ten4; BOOL isKeyDown_Ten5; BOOL isKeyDown_Ten6; BOOL isKeyDown_Ten7; BOOL isKeyDown_Ten8; BOOL isKeyDown_Ten9; BOOL isKeyDown_TenDot; BOOL isKeyDown_TenEnter; BOOL isKeyDown_TenPlus; BOOL isKeyDown_TenMinus; BOOL isKeyDown_TenMul; BOOL isKeyDown_TenDiv; BOOL isKeyDown_NumLock; BOOL isKeyDown_F1; BOOL isKeyDown_F2; BOOL isKeyDown_F3; BOOL isKeyDown_F4; BOOL isKeyDown_F5; BOOL isKeyDown_F6; BOOL isKeyDown_F7; BOOL isKeyDown_F8; BOOL isKeyDown_F9; BOOL isKeyDown_F10; BOOL isKeyDown_F11; BOOL isKeyDown_F12; BOOL isKeyDown_Delete; BOOL isKeyDown_Insert; BOOL isKeyDown_PauseBreak; BOOL isKeyDown_PrtScSysRq; BOOL isKeyDown_HankakuZenkaku; // BOOL isKeyDown_A; BOOL isKeyDown_B; BOOL isKeyDown_C; BOOL isKeyDown_D; BOOL isKeyDown_E; BOOL isKeyDown_F; BOOL isKeyDown_G; BOOL isKeyDown_H; BOOL isKeyDown_I; BOOL isKeyDown_J; BOOL isKeyDown_K; BOOL isKeyDown_L; BOOL isKeyDown_M; BOOL isKeyDown_N; BOOL isKeyDown_O; BOOL isKeyDown_P; BOOL isKeyDown_Q; BOOL isKeyDown_R; BOOL isKeyDown_S; BOOL isKeyDown_T; BOOL isKeyDown_U; BOOL isKeyDown_V; BOOL isKeyDown_W; BOOL isKeyDown_X; BOOL isKeyDown_Y; BOOL isKeyDown_Z; } -(MyCALayer*)getMyCALayer; // -(int)getMouseX; -(int)getMouseY; // -(BOOL)getIsMouseDown; -(BOOL)getIsRightMouseDown; -(BOOL)getIsKeyDown_Left; -(BOOL)getIsKeyDown_Up; -(BOOL)getIsKeyDown_Right; -(BOOL)getIsKeyDown_Down; -(BOOL)getIsKeyDown_Space; -(BOOL)getIsKeyDown_Enter; -(BOOL)getIsKeyDown_Escape; -(BOOL)getIsKeyDown_Tab; // -(BOOL)getIsKeyDown_BackSpace; -(BOOL)getIsKeyDown_0; -(BOOL)getIsKeyDown_1; -(BOOL)getIsKeyDown_2; -(BOOL)getIsKeyDown_3; -(BOOL)getIsKeyDown_4; -(BOOL)getIsKeyDown_5; -(BOOL)getIsKeyDown_6; -(BOOL)getIsKeyDown_7; -(BOOL)getIsKeyDown_8; -(BOOL)getIsKeyDown_9; -(BOOL)getIsKeyDown_Ten0; -(BOOL)getIsKeyDown_Ten1; -(BOOL)getIsKeyDown_Ten2; -(BOOL)getIsKeyDown_Ten3; -(BOOL)getIsKeyDown_Ten4; -(BOOL)getIsKeyDown_Ten5; -(BOOL)getIsKeyDown_Ten6; -(BOOL)getIsKeyDown_Ten7; -(BOOL)getIsKeyDown_Ten8; -(BOOL)getIsKeyDown_Ten9; -(BOOL)getIsKeyDown_TenDot; -(BOOL)getIsKeyDown_TenEnter; -(BOOL)getIsKeyDown_TenPlus; -(BOOL)getIsKeyDown_TenMinus; -(BOOL)getIsKeyDown_TenMul; -(BOOL)getIsKeyDown_TenDiv; -(BOOL)getIsKeyDown_NumLock; -(BOOL)getIsKeyDown_F1; -(BOOL)getIsKeyDown_F2; -(BOOL)getIsKeyDown_F3; -(BOOL)getIsKeyDown_F4; -(BOOL)getIsKeyDown_F5; -(BOOL)getIsKeyDown_F6; -(BOOL)getIsKeyDown_F7; -(BOOL)getIsKeyDown_F8; -(BOOL)getIsKeyDown_F9; -(BOOL)getIsKeyDown_F10; -(BOOL)getIsKeyDown_F11; -(BOOL)getIsKeyDown_F12; -(BOOL)getIsKeyDown_Delete; -(BOOL)getIsKeyDown_Insert; -(BOOL)getIsKeyDown_PauseBreak; -(BOOL)getIsKeyDown_PrtScSysRq; -(BOOL)getIsKeyDown_HankakuZenkaku; // -(BOOL)getIsKeyDown_A; -(BOOL)getIsKeyDown_B; -(BOOL)getIsKeyDown_C; -(BOOL)getIsKeyDown_D; -(BOOL)getIsKeyDown_E; -(BOOL)getIsKeyDown_F; -(BOOL)getIsKeyDown_G; -(BOOL)getIsKeyDown_H; -(BOOL)getIsKeyDown_I; -(BOOL)getIsKeyDown_J; -(BOOL)getIsKeyDown_K; -(BOOL)getIsKeyDown_L; -(BOOL)getIsKeyDown_M; -(BOOL)getIsKeyDown_N; -(BOOL)getIsKeyDown_O; -(BOOL)getIsKeyDown_P; -(BOOL)getIsKeyDown_Q; -(BOOL)getIsKeyDown_R; -(BOOL)getIsKeyDown_S; -(BOOL)getIsKeyDown_T; -(BOOL)getIsKeyDown_U; -(BOOL)getIsKeyDown_V; -(BOOL)getIsKeyDown_W; -(BOOL)getIsKeyDown_X; -(BOOL)getIsKeyDown_Y; -(BOOL)getIsKeyDown_Z; @end #endif /* MyView_h */
// // test.c // CCanOpenStack // // Created by Timo Jääskeläinen on 20.10.2013. // Copyright (c) 2013 Timo Jääskeläinen. All rights reserved. // #include "test.h" #include "log.h" #include "test_appcycle.h" #include "test_can_bus.h" #include "test_nmt.h" #include "test_od.h" #include "test_rpdo.h" #include "test_tpdo.h" #include "test_sdo.h" #include "test_sdo_server.h" /****************************** Global Functions *****************************/ extern void test_run_all_tests(void) { int error = 0; error |= test_can_bus_run(); error |= test_od_run(); error |= test_sdo_run(); error |= test_sdo_server_run(); error |= test_nmt_run(); error |= test_rpdo_run(); error |= test_tpdo_run(); error |= test_appcycle_run(); if (!error) { log_write_ln("test: ALL OK"); } else { log_write_ln("test: ERRORS"); } }
/**************************************************************************** * * Copyright (c) 2018, 2021 PX4 Development Team. 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. * 3. Neither the name PX4 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. * ****************************************************************************/ /** * @file manifest.c * * This module supplies the interface to the manifest of hardware that is * optional and dependent on the HW REV and HW VER IDs * * The manifest allows the system to know whether a hardware option * say for example the PX4IO is an no-pop option vs it is broken. * */ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <board_config.h> #include <inttypes.h> #include <stdbool.h> #include <syslog.h> #include "systemlib/px4_macros.h" /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ typedef struct { uint32_t hw_ver_rev; /* the version and revision */ const px4_hw_mft_item_t *mft; /* The first entry */ uint32_t entries; /* the lenght of the list */ } px4_hw_mft_list_entry_t; typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry; #define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1 static const px4_hw_mft_item_t device_unsupported = {0, 0, 0}; // List of components on a specific board configuration // The index of those components is given by the enum (px4_hw_mft_item_id_t) // declared in board_common.h static const px4_hw_mft_item_t hw_mft_list_v0500[] = { { .present = 1, .mandatory = 1, .connection = px4_hw_con_onboard, }, { .present = 1, .mandatory = 1, .connection = px4_hw_con_onboard, }, }; static const px4_hw_mft_item_t hw_mft_list_v0510[] = { { .present = 0, .mandatory = 0, .connection = px4_hw_con_unknown, }, { .present = 1, .mandatory = 1, .connection = px4_hw_con_onboard, }, }; static const px4_hw_mft_item_t hw_mft_list_v0509[] = { { .present = 1, .mandatory = 1, .connection = px4_hw_con_onboard, }, { .present = 0, .mandatory = 0, .connection = px4_hw_con_unknown, }, }; static px4_hw_mft_list_entry_t mft_lists[] = { // ver_rev {V5X00, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 0 {V5X01, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 1 {V5X02, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 2 {V5X10, hw_mft_list_v0510, arraySize(hw_mft_list_v0510)}, // NO PX4IO, Rev 0 {V5X90, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB, Rev 0 {V5X91, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB I2C2 BMP388, Rev 1 {V5X92, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB I2C2 BMP388, Rev 2 {V5Xa0, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q), Rev 0 {V5Xa1, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q) I2C2 BMP388, Rev 1 {V5Xa2, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB (Q) I2C2 BMP388, Rev 2 }; /************************************************************************************ * Name: board_query_manifest * * Description: * Optional returns manifest item. * * Input Parameters: * manifest_id - the ID for the manifest item to retrieve * * Returned Value: * 0 - item is not in manifest => assume legacy operations * pointer to a manifest item * ************************************************************************************/ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) { static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { uint32_t ver_rev = board_get_hw_version() << 8; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { if (mft_lists[i].hw_ver_rev == ver_rev) { boards_manifest = &mft_lists[i]; break; } } if (boards_manifest == px4_hw_mft_list_uninitialized) { syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); } } px4_hw_mft_item rv = &device_unsupported; if (boards_manifest != px4_hw_mft_list_uninitialized && id < boards_manifest->entries) { rv = &boards_manifest->mft[id]; } return rv; }
/*========================================================================= Program: Visualization Toolkit Module: vtkLocator.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkLocator - abstract base class for objects that accelerate spatial searches // .SECTION Description // vtkLocator is an abstract base class for spatial search objects, or // locators. The principle behind locators is that they divide 3-space into // small regions (or "buckets") that can be quickly found in response to // queries about point location, line intersection, or object-object // intersection. // // The purpose of this base class is to provide data members and methods // shared by all locators. The GenerateRepresentation() is one such // interesting method. This method works in conjunction with // vtkLocatorFilter to create polygonal representations for the locator. For // example, if the locator is an OBB tree (i.e., vtkOBBTree.h), then the // representation is a set of one or more oriented bounding boxes, depending // upon the specified level. // // Locators typically work as follows. One or more "entities", such as points // or cells, are inserted into the locator structure. These entities are // associated with one or more buckets. Then, when performing geometric // operations, the operations are performed first on the buckets, and then if // the operation tests positive, then on the entities in the bucket. For // example, during collision tests, the locators are collided first to // identify intersecting buckets. If an intersection is found, more expensive // operations are then carried out on the entities in the bucket. // // To obtain good performance, locators are often organized in a tree // structure. In such a structure, there are frequently multiple "levels" // corresponding to different nodes in the tree. So the word level (in the // context of the locator) can be used to specify a particular representation // in the tree. For example, in an octree (which is a tree with 8 children), // level 0 is the bounding box, or root octant, and level 1 consists of its // eight children. // .SECTION Caveats // There is a concept of static and incremental locators. Static locators are // constructed one time, and then support appropriate queries. Incremental // locators may have data inserted into them over time (e.g., adding new // points during the process of isocontouring). // .SECTION See Also // vtkPointLocator vtkCellLocator vtkOBBTree vtkMergePoints #ifndef vtkLocator_h #define vtkLocator_h #include "vtkCommonDataModelModule.h" // For export macro #include "vtkObject.h" class vtkDataSet; class vtkPolyData; class VTKCOMMONDATAMODEL_EXPORT vtkLocator : public vtkObject { public: // Description: // Standard type and print methods. vtkTypeMacro(vtkLocator,vtkObject); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Build the locator from the points/cells defining this dataset. virtual void SetDataSet(vtkDataSet*); vtkGetObjectMacro(DataSet,vtkDataSet); // Description: // Set the maximum allowable level for the tree. If the Automatic ivar is // off, this will be the target depth of the locator. // Initial value is 8. vtkSetClampMacro(MaxLevel,int,0,VTK_INT_MAX); vtkGetMacro(MaxLevel,int); // Description: // Get the level of the locator (determined automatically if Automatic is // true). The value of this ivar may change each time the locator is built. // Initial value is 8. vtkGetMacro(Level,int); // Description: // Boolean controls whether locator depth/resolution of locator is computed // automatically from average number of entities in bucket. If not set, // there will be an explicit method to control the construction of the // locator (found in the subclass). vtkSetMacro(Automatic,int); vtkGetMacro(Automatic,int); vtkBooleanMacro(Automatic,int); // Description: // Specify absolute tolerance (in world coordinates) for performing // geometric operations. vtkSetClampMacro(Tolerance,double,0.0,VTK_DOUBLE_MAX); vtkGetMacro(Tolerance,double); // Description: // Cause the locator to rebuild itself if it or its input dataset has // changed. virtual void Update(); // Description: // Initialize locator. Frees memory and resets object as appropriate. virtual void Initialize(); // Description: // Build the locator from the input dataset. virtual void BuildLocator() = 0; // Description: // Free the memory required for the spatial data structure. virtual void FreeSearchStructure() = 0; // Description: // Method to build a representation at a particular level. Note that the // method GetLevel() returns the maximum number of levels available for // the tree. You must provide a vtkPolyData object into which to place the // data. virtual void GenerateRepresentation(int level, vtkPolyData *pd) = 0; // Description: // Return the time of the last data structure build. vtkGetMacro(BuildTime, unsigned long); // Description: // Handle the PointSet <-> Locator loop. virtual void Register(vtkObjectBase *o); virtual void UnRegister(vtkObjectBase *o); protected: vtkLocator(); ~vtkLocator(); vtkDataSet *DataSet; int Automatic; // boolean controls automatic subdivision (or uses user spec.) double Tolerance; // for performing merging int MaxLevel; int Level; vtkTimeStamp BuildTime; // time at which locator was built void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE; private: vtkLocator(const vtkLocator&) VTK_DELETE_FUNCTION; void operator=(const vtkLocator&) VTK_DELETE_FUNCTION; }; #endif
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file tinyOsxGraphicsWindow.h * @author drose * @date 2008-05-12 */ #ifndef TINYOSXGRAPHICSWINDOW_H #define TINYOSXGRAPHICSWINDOW_H #include "pandabase.h" #if defined(IS_OSX) && !defined(BUILD_IPHONE) && defined(HAVE_CARBON) && !__LP64__ #include <Carbon/Carbon.h> #include "graphicsWindow.h" #include "buttonHandle.h" #include "tinyGraphicsStateGuardian.h" /** * Opens a window on OS X to display the TinyPanda software rendering. */ class TinyOsxGraphicsWindow : public GraphicsWindow { public: TinyOsxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, const std::string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~TinyOsxGraphicsWindow(); virtual bool move_pointer(int device, int x, int y); virtual bool begin_frame(FrameMode mode, Thread *current_thread); virtual void end_frame(FrameMode mode, Thread *current_thread); virtual void begin_flip(); virtual void process_events(); virtual bool supports_pixel_zoom() const; virtual bool do_reshape_request(int x_origin, int y_origin, bool has_origin, int x_size, int y_size); virtual void mouse_mode_absolute(); virtual void mouse_mode_relative(); virtual void set_properties_now(WindowProperties &properties); private: void ReleaseSystemResources(); inline void SendKeyEvent( ButtonHandle key, bool down); protected: virtual void close_window(); virtual bool open_window(); private: bool OSOpenWindow(WindowProperties &properties); // a singleton .. for the events to find the right pipe to push the event // into public: // do not call direct .. OSStatus handleKeyInput (EventHandlerCallRef myHandler, EventRef event, Boolean keyDown); OSStatus handleTextInput (EventHandlerCallRef myHandler, EventRef event); OSStatus handleWindowMouseEvents (EventHandlerCallRef myHandler, EventRef event); ButtonHandle OSX_TranslateKey( UInt32 key, EventRef event ); static TinyOsxGraphicsWindow * GetCurrentOSxWindow (WindowRef hint); void HandleModifireDeleta(UInt32 modifiers); void HandleButtonDelta(UInt32 new_buttons); void DoResize(void); OSStatus event_handler(EventHandlerCallRef myHandler, EventRef event); virtual void user_close_request(); void SystemCloseWindow(); void SystemSetWindowForground(bool forground); void SystemPointToLocalPoint(Point &qdGlobalPoint); void LocalPointToSystemPoint(Point &qdLocalPoint); bool set_icon_filename(const Filename &icon_filename); void set_pointer_in_window(int x, int y); void set_pointer_out_of_window(); private: void create_frame_buffer(); private: ZBuffer *_frame_buffer; private: UInt32 _last_key_modifiers; UInt32 _last_buttons; WindowRef _osx_window; bool _is_fullscreen; CGImageRef _pending_icon; CGImageRef _current_icon; int _ID; static TinyOsxGraphicsWindow *FullScreenWindow; CFDictionaryRef _originalMode; // True if _properties.get_cursor_hidden() is true. bool _cursor_hidden; // True if the cursor is actually hidden right now via system calls. bool _display_hide_cursor; SInt32 _wheel_delta; public: static TypeHandle get_class_type() { return _type_handle; } static void init_type() { GraphicsWindow::init_type(); register_type(_type_handle, "TinyOsxGraphicsWindow", GraphicsWindow::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} private: static TypeHandle _type_handle; }; #include "tinyOsxGraphicsWindow.I" #endif // IS_OSX #endif
#include <string> #include <vector> #include <map> #include <ctime> #include <windows.h> #include <atlstr.h> #include <atlsafe.h> #include "GoogleDesktopSearchAPI.h" using namespace std; class LarGDSPlugin { private: struct ConversationStruct { time_t LastMessageTime; ULONG ConversationID; }; CLSID ObjClassID; map <string, ConversationStruct> Conversations; public: LarGDSPlugin(CLSID ClassID); bool RegisterPlugin(string Title, string Description, string IconPath); bool RegisterPluginWithExtensions(string Title, string Description, string IconPath, vector<string> &Extensions); bool UnregisterPlugin(); bool SendIMEvent(string Content, string UserName, string BuddyName, string Title, unsigned long ConversationID); bool SendIMEvent(string Content, string UserName, string BuddyName, string Title, unsigned long ConversationID, SYSTEMTIME MessageTime, string Format); bool SendTextFileEvent(string Content, string Path, SYSTEMTIME LastModified); unsigned long GetConversationID(string Identifier); unsigned long GetConversationID(string Identifier, int Timeout); };
/* * TTBlue (Linked) List Class * Copyright © 2008, Timothy Place * * License: This code is licensed under the terms of the "New BSD License" * http://creativecommons.org/licenses/BSD/ */ #ifndef __TT_LIST_H__ #define __TT_LIST_H__ #include "TTBase.h" #include "TTValue.h" #include "TTMutex.h" #include <list> class TTObjectBase; typedef std::list<TTValue> TTLinkedList; typedef std::list<TTValue>::iterator TTListIter; typedef TTObjectBase* TTObjectBasePtr; /****************************************************************************************************/ // Class Specification class TTFOUNDATION_EXPORT TTList { private: TTBoolean mThreadProtection{YES}; ///< Use thread safety mechanisms. Only disable this if you are certain that you will be calling from a single thread. std::mutex mMutex; #ifdef TT_PLATFORM_WIN #pragma warning(disable:4251) #endif TTLinkedList theList; TTListIter theIter; std::unique_lock<std::mutex> acquireLock(); public: TTList() = default; virtual ~TTList() = default; TTList(TTList& that); /** Determine the number of values in the list. @return The count of the values in the list. */ TTUInt32 getSize() const; /** Determine whether the list has any items. @return True if the list is empty, otherwise false. */ TTBoolean isEmpty(); /** Return the first value in the list. @return The first value in the list. */ TTValue& getHead(); /** Return the last value in the list. @return The last value in the list. */ TTValue& getTail(); /** Put the iterator pointing to the beginning of the list. */ void begin(); /** Is the iterator points to the end of the list ? @return false if the iterator is at the end of the list */ bool end(); /** Put the iterator pointing to the next position */ void next(); /** Put the iterator pointing to the prev position */ void prev(); /** Returns the current value in the list (where the iterator is). @return The current value. */ TTValue& current(); /** Return a value by it's location in the list. */ TTErr getIndex(TTUInt32 index, TTValue& returnedValue); /** Appends a value to the list. @param newValue The value to add to the list. */ void append(const TTValue& newValue); /** If we don't define a version of this function that takes a pointer, then when a pointer is provided a new temporary TTValue is created to provide the reference and then when the temporary is deleted we end up with a corrupt entry in the linked list. */ /* void append(const TTValuePtr newValue) { append(*newValue); } */ void appendUnique(const TTValue& newValue); /** Insert a value into the list at a given location. @param index The location of the value after insertion. @param newValue The value to add to the list. @return kTTErrGeneric if the value can't be inserted (bad index) */ void insert(TTUInt32 index, const TTValue& newValue); /** If we don't define a version of this function that takes a pointer, then when a pointer is provided a new temporary TTValue is created to provide the reference and then when the temporary is deleted we end up with a corrupt entry in the linked list. */ /* void insert(TTUInt32 index, const TTValuePtr newValue) { insert(index, *newValue); } */ /** Appends a list to the list. @param newList The list to add to the list. */ void merge(TTList& newList); /** Sort a list using a comparison function @param comparisonFunction which return true if the first element have to be before the second */ void sort(TTBoolean(*comparisonFunction)(TTValue&, TTValue&) = NULL); /** Find a value in the list by using a passed-in matching function. */ TTErr find(TTFunctionMatch aMatchFunction, TTPtr aBaton, TTValue& returnedValue); /** Find a value in the list that is equal to a value passed-in. */ TTErr findEquals(const TTValue& valueToCompareAgainst, TTValue& foundValue); /** Remove the specified value. This doesn't change the value or free it, it just removed the pointer to it from the list. @param The value to remove. */ void remove(const TTValue& value); /** Remove all values from the list */ void clear(); /** Assign the contents of the list to a value as an array. */ void assignToValue(TTValue& value); /** Traverse the entire list, sending each item of the list to a specified function. */ TTErr iterate(const TTObjectBasePtr target, const TTFunctionWithBatonAndValue callback); /** Traverse the entire list, sending each item of the list to a specified object with the specified message. */ TTErr iterate(const TTObjectBasePtr target, const TTSymbol messageName); /** Traverse the entire list, and if the item in the list is an object, then send it the specified message. */ TTErr iterateObjectsSendingMessage(const TTSymbol messageName); TTErr iterateObjectsSendingMessage(const TTSymbol messageName, TTValue& aValue); void setThreadProtection(TTBoolean threadProtection) { mThreadProtection = threadProtection; } }; typedef TTList* TTListPtr; #endif // __TT_LIST_H__
// Copyright (c) 2014 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef XWALK_RUNTIME_BROWSER_SYSAPPS_COMPONENT_H_ #define XWALK_RUNTIME_BROWSER_SYSAPPS_COMPONENT_H_ #include "base/compiler_specific.h" #include "xwalk/runtime/browser/xwalk_component.h" #include "xwalk/sysapps/common/sysapps_manager.h" namespace xwalk { class SysAppsComponent : public XWalkComponent { public: SysAppsComponent(); virtual ~SysAppsComponent(); void DisableDeviceCapabilities() { manager_.DisableDeviceCapabilities(); } private: // XWalkComponent implementation. void CreateUIThreadExtensions( content::RenderProcessHost* host, extensions::XWalkExtensionVector* extensions) override; void CreateExtensionThreadExtensions( content::RenderProcessHost* host, extensions::XWalkExtensionVector* extensions) override; sysapps::SysAppsManager manager_; }; } // namespace xwalk #endif // XWALK_RUNTIME_BROWSER_SYSAPPS_COMPONENT_H_
//****************************************************************************** // // MIDITrail / MTScenePianoRollRain2DLive // // ライブモニタ用ピアノロールレイン2Dシーン描画クラス // // Copyright (C) 2013 WADA Masashi. All Rights Reserved. // //****************************************************************************** #include "MTScenePianoRollRainLive.h" //****************************************************************************** // ピアノロールレイン2Dシーン描画クラス //****************************************************************************** class MTScenePianoRollRain2DLive : public MTScenePianoRollRainLive { public: //コンストラクタ/デストラクタ MTScenePianoRollRain2DLive(void); virtual ~MTScenePianoRollRain2DLive(void); //名称取得 NSString* GetName(); //生成 virtual int Create( NSView* pView, OGLDevice* pOGLDevice, SMSeqData* pSeqData ); //視点取得 virtual void GetDefaultViewParam(MTViewParamMap* pParamMap); };
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2016, Image Engine Design 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 John Haddon nor the names of // any other contributors to this software 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 GAFFERARNOLD_ARNOLDDISPLACEMENT_H #define GAFFERARNOLD_ARNOLDDISPLACEMENT_H #include "GafferArnold/Export.h" #include "GafferArnold/TypeIds.h" #include "GafferScene/Shader.h" #include "GafferScene/ShaderPlug.h" namespace GafferArnold { /// \todo It's slightly awkward that this inherits from Shader, because /// it inherits namePlug(), typePlug() and parametersPlug(), none of /// which are needed. We should consider creating a fully abstract Shader /// base class and renaming the current Shader class to StandardShader, /// or defining an even more general Assignable base class which both /// Shader and ArnoldDisplacement can inherit from. class GAFFERARNOLD_API ArnoldDisplacement : public GafferScene::Shader { public : ArnoldDisplacement( const std::string &name=defaultName<ArnoldDisplacement>() ); ~ArnoldDisplacement() override; GAFFER_GRAPHCOMPONENT_DECLARE_TYPE( GafferArnold::ArnoldDisplacement, ArnoldDisplacementTypeId, GafferScene::Shader ); GafferScene::ShaderPlug *mapPlug(); const GafferScene::ShaderPlug *mapPlug() const; Gaffer::FloatPlug *heightPlug(); const Gaffer::FloatPlug *heightPlug() const; Gaffer::FloatPlug *paddingPlug(); const Gaffer::FloatPlug *paddingPlug() const; Gaffer::FloatPlug *zeroValuePlug(); const Gaffer::FloatPlug *zeroValuePlug() const; Gaffer::BoolPlug *autoBumpPlug(); const Gaffer::BoolPlug *autoBumpPlug() const; Gaffer::Plug *outPlug(); const Gaffer::Plug *outPlug() const; void affects( const Gaffer::Plug *input, AffectedPlugsContainer &outputs ) const override; protected : void attributesHash( const Gaffer::Plug *output, IECore::MurmurHash &h ) const override; IECore::ConstCompoundObjectPtr attributes( const Gaffer::Plug *output ) const override; bool acceptsInput( const Gaffer::Plug *plug, const Gaffer::Plug *inputPlug ) const override; private : static size_t g_firstPlugIndex; }; IE_CORE_DECLAREPTR( ArnoldDisplacement ) } // namespace GafferArnold #endif // GAFFERARNOLD_ARNOLDDISPLACEMENT_H
// gcc -I../../CSPL/Special -I../../CSPL/Array -L../../ erf.c -lm -Wall -lCSPL -o erf // install_name_tool -add_rpath ../../ erf #include <stdio.h> #include "CSPL_Array.h" #include "CSPL_Special.h" int main(void) { long i, ind; double val[101]; double x[101]; const char * filename = "erf_data.txt"; printf("CSPL_Special_Erf1(0.0) = %lf\n",CSPL_Special_Erf1(0.0)); printf("CSPL_Special_Erf1(-1.0) = %lf\n",CSPL_Special_Erf1(-1.0)); printf("CSPL_Special_Erf1(1.0) = %lf\n",CSPL_Special_Erf1(1.0)); printf("CSPL_Special_Erf1(3.0) = %lf\n",CSPL_Special_Erf1(3.0)); printf("CSPL_Special_Erf1(-3.0) = %lf\n",CSPL_Special_Erf1(-3.0)); ind=0; for (i=-50;i<51;i++) { x[ind] = (double)i/(50./3.); val[ind] = CSPL_Special_Erf1(x[ind]); ind++; } printf("\nDumping Answer and input file named %s\n", filename); CSPL_Array_filedump1d(filename, 101, 2, x, val); //CSPL_Array_filedump1d(filename, 101, 1, x); return(0); }
// ***************************************************************************** // // Copyright (c) 2020, Southwest Research Institute® (SwRI®) // 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 Southwest Research Institute® (SwRI®) 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 <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 MAPVIZ_PLUGINS_OBJECT_PLUGIN_H_ #define MAPVIZ_PLUGINS_OBJECT_PLUGIN_H_ // C++ standard libraries #include <string> #include <mapviz/mapviz_plugin.h> // QT libraries #include <QGLWidget> // ROS libraries #include <tf/transform_datatypes.h> #include <topic_tools/shape_shifter.h> #include <marti_nav_msgs/TrackedObjectArray.h> #include <marti_nav_msgs/ObstacleArray.h> #include <mapviz/map_canvas.h> // QT autogenerated files #include "ui_object_config.h" namespace mapviz_plugins { class ObjectPlugin : public mapviz::MapvizPlugin { Q_OBJECT public: ObjectPlugin(); virtual ~ObjectPlugin(); bool Initialize(QGLWidget* canvas); void Shutdown() {} void Draw(double x, double y, double scale); void Paint(QPainter* painter, double x, double y, double scale); void Transform(); void LoadConfig(const YAML::Node& node, const std::string& path); void SaveConfig(YAML::Emitter& emitter, const std::string& path); void ClearHistory(); QWidget* GetConfigWidget(QWidget* parent); bool SupportsPainting() { return true; } protected: void PrintError(const std::string& message); void PrintInfo(const std::string& message); void PrintWarning(const std::string& message); void timerEvent(QTimerEvent *); protected Q_SLOTS: void SelectTopic(); void TopicEdited(); void SetColor(const QColor& color); private: struct Color { float r, g, b, a; }; struct StampedPoint { tf::Point point; tf::Point transformed_point; }; struct ObjectData { ros::Time stamp; std::vector<StampedPoint> polygon; std::string id; std::string source_frame; swri_transform_util::Transform local_transform; bool transformed; }; Ui::object_config ui_; QWidget* config_widget_; std::string topic_; QColor color_; ros::Subscriber object_sub_; bool connected_; bool has_message_; std::vector<ObjectData> objects_; void handleMessage(const topic_tools::ShapeShifter::ConstPtr& msg); void handleTrack(const marti_nav_msgs::TrackedObject& obj); void handleObstacle(const marti_nav_msgs::Obstacle& obj, const std_msgs::Header& header); }; } #endif // MAPVIZ_PLUGINS_OBJECT_PLUGIN_H_
$FreeBSD: head/sysutils/mbmon/files/patch-testsmb.c 300897 2012-07-14 14:29:18Z beat $ --- testsmb.c Thu Aug 12 07:34:48 2004 +++ testsmb.c Fri Dec 30 23:11:29 2005 @@ -105,8 +105,9 @@ case ID_AMD756: case ID_AMD766: case ID_AMD768: + case ID_AMD8111_1: smbus = &smbus_amd; - fprintf(stderr, "AMD756/766/768 found.\n"); + fprintf(stderr, "AMD756/766/768/8111 found.\n"); break; case ID_NFORCE: smbus = &smbus_amd; @@ -116,9 +117,9 @@ smbus = &smbus_ali; fprintf(stderr, "ALi M1535D+ found.\n"); break; - case ID_AMD8111: + case ID_AMD8111_2: smbus = &smbus_amd8; - fprintf(stderr, "AMD8111 found.\n"); + fprintf(stderr, "AMD8111 SMBus 2.0 found.\n"); break; case ID_NFORCE2: smbus = &smbus_amd8; @@ -126,7 +127,7 @@ break; default: fprintf(stderr, "No known SMBus(I2C) chip found.\n"); - goto exit; + continue; } if(OpenIO() == -1) return -1; @@ -141,7 +142,6 @@ } CloseIO(); -exit: ; /* dummy statment for gcc 3.4 or after */ } /* endo of Big loop for smb_base candidates */
// Copyright 2014 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 COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_CONTRIBUTION_H_ #define COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_CONTRIBUTION_H_ #include <stddef.h> #include "components/sync/base/syncer_error.h" #include "components/sync/engine/non_blocking_sync_common.h" #include "components/sync/engine_impl/cycle/status_controller.h" #include "components/sync/protocol/sync.pb.h" namespace syncer { class StatusController; // This class represents a set of items belonging to a particular data type that // have been selected from a CommitContributor and prepared for commit. // // This class handles the bookkeeping related to the commit of these items. class CommitContribution { public: CommitContribution(); virtual ~CommitContribution() = 0; // Serialize this contribution's entries to the given commit request |msg|. // // This function is not const. It may update some state in this contribution // that will be used when processing the associated commit response. This // function should not be called more than once. virtual void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) = 0; // Updates this contribution's contents in accordance with the provided // |response|. // // It is not valid to call this function unless AddToCommitMessage() was // called earlier. This function should not be called more than once. virtual SyncerError ProcessCommitResponse( const sync_pb::ClientToServerResponse& response, StatusController* status) = 0; // This method is called when there is an error during commit and there is no // proper response to process (i.e. unparsable or unexpected server response, // network error). This method may be called only if ProcessCommitResponse // was never called. virtual void ProcessCommitFailure(SyncCommitError commit_error) = 0; // Cleans up any temporary state associated with the commit. Must be called // before destruction. virtual void CleanUp() = 0; // Returns the number of entries included in this contribution. virtual size_t GetNumEntries() const = 0; }; } // namespace syncer #endif // COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_CONTRIBUTION_H_
// Copyright 2014 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 CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_CONTROLLER_H_ #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_CONTROLLER_H_ #include <string> #include "ash/public/cpp/shelf_model_observer.h" #include "base/macros.h" #include "ui/wm/public/activation_change_observer.h" class AppWindowLauncherItemController; class ChromeLauncherController; class Profile; namespace aura { class Window; } namespace wm { class ActivationClient; } class AppWindowLauncherController : public wm::ActivationChangeObserver, public ash::ShelfModelObserver { public: ~AppWindowLauncherController() override; // Called by ChromeLauncherController when the active user changed and the // items need to be updated. virtual void ActiveUserChanged(const std::string& user_email) {} // An additional user identified by |Profile|, got added to the existing // session. virtual void AdditionalUserAddedToSession(Profile* profile) {} // Overriden from client::ActivationChangeObserver: void OnWindowActivated(wm::ActivationChangeObserver::ActivationReason reason, aura::Window* gained_active, aura::Window* lost_active) override; ChromeLauncherController* owner() { return owner_; } protected: explicit AppWindowLauncherController(ChromeLauncherController* owner); virtual AppWindowLauncherItemController* ControllerForWindow( aura::Window* window) = 0; // Called to update local caches when the item |delegate| is replaced. Note, // |delegate| might not belong to current launcher controller. virtual void OnItemDelegateDiscarded(ash::ShelfItemDelegate* delegate) = 0; private: // Unowned pointers. ChromeLauncherController* owner_; wm::ActivationClient* activation_client_ = nullptr; // ash::ShelfModelObserver: void ShelfItemDelegateChanged(const ash::ShelfID& id, ash::ShelfItemDelegate* old_delegate, ash::ShelfItemDelegate* delegate) override; DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherController); }; #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_CONTROLLER_H_
#ifndef TRIANGLE_H #define TRIANGLE_H #include "mesh.h" class Triangle : public Mesh { public: Triangle(); virtual ~Triangle(); void create(); void update(double time=0); void draw(); }; #endif // TRIANGLE_H
/* * Copyright (c) 2001 M. Warner Losh * 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 AUTHOR 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 AUTHOR 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 code is based on ugen.c and ulpt.c developed by Lennart Augustsson. * This code includes software developed by the NetBSD Foundation, Inc. and * its contributors. */ /* $FreeBSD: src/sys/dev/usb/dsbr100io.h,v 1.1.2.1 2002/03/04 04:01:35 alfred Exp $ */ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #include <sys/ioccom.h> #endif #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #define FM_SET_FREQ _IOWR('U', 200, int) #define FM_GET_FREQ _IOWR('U', 201, int) #define FM_START _IOWR('U', 202, int) #define FM_STOP _IOWR('U', 203, int) #define FM_GET_STAT _IOWR('U', 204, int) #else #define FM_SET_FREQ 0x1 #define FM_GET_FREQ 0x2 #define FM_START 0x3 #define FM_STOP 0x4 #define FM_GET_STAT 0x5 #endif
/*License Notification Fab@Home operates under the BSD Open Source License Copyright (c) 2008, Paulo Inforçatti Neto (paulo.inforcatti@cenpra.gov.br) and Renan Rodrigues dos Santos Renato Archer Research Center (CenPRA), Campinas, Brazil 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 the Fab@Home Project 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. */ #pragma once #include "afxwin.h" // -------------------------------------------------------------------------- // CPrinterDlgGeneral // -------------------------------------------------------------------------- class CPrinterDlgGeneral : public CPropertyPage { DECLARE_DYNAMIC(CPrinterDlgGeneral) public: CPrinterDlgGeneral(); virtual ~CPrinterDlgGeneral(); // Dialog Data enum { IDD = IDD_PRINTERDLGGENERAL }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: CToolTipCtrl* m_pToolTip; CEdit m_DEFAULT_POD; CEdit m_DESCRIPTION; CEdit m_JOGSPEED; CEdit m_MAXTOOLS; CEdit m_Name; CEdit m_STATUS_UPDATE_PERIOD; CEdit m_TOOLLIMITSWITCH; virtual BOOL OnInitDialog(); virtual BOOL PreTranslateMessage(MSG* pMsg); }; // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // CPrinterDlgComponent // -------------------------------------------------------------------------- class CPrinterDlgComponent : public CPropertyPage { DECLARE_DYNAMIC(CPrinterDlgComponent) public: CPrinterDlgComponent(); virtual ~CPrinterDlgComponent(); // Dialog Data enum { IDD = IDD_PRINTERDLGCOMPONENT }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: CToolTipCtrl* m_pToolTip; CEdit m_APPENDGEOM; CEdit m_COLOR; CEdit m_COMPONENT; CEdit m_DIRECTION; CEdit m_INCREMENT; CEdit m_LIMIT_SWITCH; CEdit m_MOTOR; CEdit m_OFFSET; CEdit m_RANGE; virtual BOOL OnInitDialog(); virtual BOOL PreTranslateMessage(MSG* pMsg); }; // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // CToolDlgPropSheet // -------------------------------------------------------------------------- #define IDD_SAVE_BUTTON 1 #define IDD_CANCEL_BUTTON 2 #define IDD_CLOSE_BUTTON 3 #define IDD_REFRESH_BUTTON 4 #define IDD_IMPORT_BUTTON 5 #define IDD_EXPORT_BUTTON 6 #define BASE 1 #define X_CARRIAGE 2 #define Y_CARRIAGE 3 #define Z_CARRIAGE 4 #define MAX_COMPONENTS 4 class CPrinterDlgPropSheet : public CPropertySheet { DECLARE_DYNAMIC(CPrinterDlgPropSheet) public: CPrinterDlgPropSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); CPrinterDlgPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); virtual ~CPrinterDlgPropSheet(); protected: DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedButtonSave(); afx_msg void OnBnClickedButtonCancel(); afx_msg void OnBnClickedButtonClose(); afx_msg void OnBnClickedButtonRefresh(); afx_msg void OnBnClickedButtonImport(); afx_msg void OnBnClickedButtonExport(); CToolTipCtrl* m_pToolTip; CButton Save; CButton Cancel; CButton Close; CButton Refresh; CButton Import; CButton Export; CFabAtHomeApp *pApp; CPrinterDlgGeneral m_PrinterDlgGeneral; CPrinterDlgComponent m_PrinterDlgComponent[MAX_COMPONENTS]; virtual BOOL OnInitDialog(); virtual BOOL PreTranslateMessage(MSG* pMsg); bool SetParameters(void); //Set the paremeters of the current loaded printer to the dialog bool ClearParameters(void); //Clear the paremeters of the current loaded printer to the dialog protected: bool RefreshParameters(void); //Refresh the paremeters of the current loaded printer to the dialog bool SaveParameters(CString filename = ""); //Refresh the paremeters of the current loaded printer to the dialog }; // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // CPrinterDlg frame // -------------------------------------------------------------------------- class CPrinterDlg : public CMiniFrameWnd { DECLARE_DYNCREATE(CPrinterDlg) public: CPrinterDlg(); // protected constructor used by dynamic creation virtual ~CPrinterDlg(); protected: DECLARE_MESSAGE_MAP() public: afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); afx_msg void OnClose(); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnSetFocus(CWnd* pOldWnd); afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); CFabAtHomeApp *pApp; CPrinterDlgPropSheet *m_PrinterDlgPropSheet; }; // --------------------------------------------------------------------------
#ifndef SEC_SOSTransportTestTransports_h #define SEC_SOSTransportTestTransports_h typedef struct SOSTransportKeyParameterTest *SOSTransportKeyParameterTestRef; typedef struct SOSTransportCircleTest *SOSTransportCircleTestRef; typedef struct SOSTransportMessageTest *SOSTransportMessageTestRef; CF_RETURNS_RETAINED CFDictionaryRef SOSTransportMessageTestHandleMessages(SOSTransportMessageTestRef transport, CFMutableDictionaryRef circle_peer_messages_table, CFErrorRef *error); void SOSAccountUpdateTestTransports(SOSAccountRef account, CFDictionaryRef gestalt); SOSTransportKeyParameterTestRef SOSTransportTestCreateKeyParameter(SOSAccountRef account, CFStringRef name, CFStringRef circleName); SOSTransportCircleTestRef SOSTransportTestCreateCircle(SOSAccountRef account, CFStringRef name, CFStringRef circleName); SOSTransportMessageTestRef SOSTransportTestCreateMessage(SOSAccountRef account, CFStringRef name, CFStringRef circleName); CFMutableArrayRef key_transports; CFMutableArrayRef circle_transports; CFMutableArrayRef message_transports; CFStringRef SOSTransportMessageTestGetName(SOSTransportMessageTestRef transport); CFStringRef SOSTransportCircleTestGetName(SOSTransportCircleTestRef transport); CFStringRef SOSTransportKeyParameterTestGetName(SOSTransportKeyParameterTestRef transport); void SOSTransportKeyParameterTestSetName(SOSTransportKeyParameterTestRef transport, CFStringRef accountName); void SOSTransportCircleTestSetName(SOSTransportCircleTestRef transport, CFStringRef accountName); void SOSTransportMessageTestSetName(SOSTransportMessageTestRef transport, CFStringRef accountName); CFMutableDictionaryRef SOSTransportMessageTestGetChanges(SOSTransportMessageTestRef transport); CFMutableDictionaryRef SOSTransportCircleTestGetChanges(SOSTransportCircleTestRef transport); CFMutableDictionaryRef SOSTransportKeyParameterTestGetChanges(SOSTransportKeyParameterTestRef transport); SOSAccountRef SOSTransportMessageTestGetAccount(SOSTransportMessageTestRef transport); SOSAccountRef SOSTransportCircleTestGetAccount(SOSTransportCircleTestRef transport); SOSAccountRef SOSTransportKeyParameterTestGetAccount(SOSTransportKeyParameterTestRef transport); bool SOSAccountInflateTestTransportsForCircle(SOSAccountRef account, CFStringRef circleName, CFStringRef accountName, CFErrorRef *error); bool SOSAccountEnsureFactoryCirclesTest(SOSAccountRef a, CFStringRef accountName); #endif