text
stringlengths
4
6.14k
#ifndef _COMPONENT_MESH_ #define _COMPONENT_MESH_ #include "Component.h" #include "Math/float3.h" #include "Math/float2.h" #include <vector> class ResourceMesh; class GameObject; class CompMaterial; struct Vertex; struct FaceCenter { float3 pos; float3 norm; }; enum Type_Primitive { TYPE_NON, TYPE_SPHERE, TYPE_CUBE }; class CompMesh: public Component { public: CompMesh(Comp_Type t, GameObject* parent); CompMesh(const CompMesh& copy, GameObject* parent); ~CompMesh(); void Draw(); void Clear(); void preUpdate(float dt); void Update(float dt); void Render(bool render); bool isRendering() const; // EDITOR METHODS --------- void ShowOptions(); void ShowInspectorInfo(); // ------------------------ void LinkMaterial(const CompMaterial* mat); void SetResource(ResourceMesh * resourse_mesh, bool isImport = false); // SAVE - LOAD METHODS ---------------- void Save(JSON_Object* object, std::string name, bool saveScene, uint& countResources) const; void Load(const JSON_Object* object, std::string name); // ------------------------------------- public: char* name = "MESH NAME"; bool hasNormals = false; ResourceMesh* resourceMesh = nullptr; private: bool render = true; bool SelectMesh = false; const CompMaterial* material = nullptr; uint uuidResourceReimported = 0; }; #endif
/*************************************************************** * * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, * University of Wisconsin-Madison, WI. * * 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 IPV6_ADDRINFO_H #define IPV6_ADDRINFO_H //#include <string> struct shared_context; // an iterator and a smart pointer for addrinfo structure class addrinfo_iterator { public: addrinfo_iterator(); addrinfo_iterator(addrinfo* res); addrinfo_iterator(const addrinfo_iterator& rhs); ~addrinfo_iterator(); addrinfo* next(); addrinfo_iterator& operator= (const addrinfo_iterator& rhs); void reset(); protected: shared_context* cxt_; addrinfo* current_; }; // return with AI_ADDRCONFIG addrinfo get_default_hint(); // will use default hint int ipv6_getaddrinfo(const char *node, const char *service, addrinfo_iterator& ai, const addrinfo& hint = get_default_hint()); bool find_any_ipv4(addrinfo_iterator& ai, sockaddr_in& sin); #endif // IPV6_ADDRINFO_H
/* * File: IAS-QSystemLib/src/qs/workers/proc/cache/CacheStore.h * * Copyright (C) 2015, Albert Krzymowski * * 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 _IAS_QS_Workers_Proc_Cache_CacheStore_H_ #define _IAS_QS_Workers_Proc_Cache_CacheStore_H_ #include <commonlib/commonlib.h> #include "WorkerCache.h" namespace IAS { namespace QS { namespace Workers { namespace Proc { namespace Cache { /*************************************************************************/ /** The CacheStore class. * */ class CacheStore { public: virtual ~CacheStore() throw(); void addCache(const String& strName, WorkerCache* pWorkerCache); WorkerCache* lookup(const String& strName); protected: CacheStore(); typedef HashMapStringToPointer<WorkerCache> CacheMap; CacheMap hmCaches; Mutex mutex; friend class Factory<CacheStore>; }; /*************************************************************************/ } } } } } #endif /* _IAS_QS_Workers_Proc_Cache_CacheStore_H_ */
#ifndef __CLIENT_STATEBLOCK9__ #define __CLIENT_STATEBLOCK9__ #include <d3d9.h> class ClientStateBlock9 { private: IDirect3DStateBlock9* m_sb; public: ClientStateBlock9(IDirect3DStateBlock9* ptr); HRESULT Capture(); HRESULT Apply(); bool isValid(){ return m_sb != NULL ? true : false; } }; #endif
/* * 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/mediapackage/MediaPackage_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace MediaPackage { namespace Model { enum class ManifestLayout { NOT_SET, FULL, COMPACT }; namespace ManifestLayoutMapper { AWS_MEDIAPACKAGE_API ManifestLayout GetManifestLayoutForName(const Aws::String& name); AWS_MEDIAPACKAGE_API Aws::String GetNameForManifestLayout(ManifestLayout value); } // namespace ManifestLayoutMapper } // namespace Model } // namespace MediaPackage } // namespace Aws
// Copyright (c) 2020 RISC Software GmbH // // This file was generated by CPACSGen from CPACS XML Schema (c) German Aerospace Center (DLR/SC). // Do not edit, all changes are lost when files are re-generated. // // Licensed under the Apache License, Version 2.0 (the "License") // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once #include <boost/optional.hpp> #include <boost/utility/in_place_factory.hpp> #include <CCPACSWingRibsDefinitions.h> #include <CCPACSWingShell.h> #include <CCPACSWingSpars.h> #include <string> #include <tixi.h> #include <typeinfo> #include "CreateIfNotExists.h" #include "CTiglError.h" #include "tigl_internal.h" namespace tigl { class CTiglUIDManager; class CTiglUIDObject; class CCPACSWingComponentSegment; class CCPACSTrailingEdgeDevice; namespace generated { // This class is used in: // CPACSComponentSegment // CPACSTrailingEdgeDevice /// @brief Structure of the wing /// /// wingComponentSegmentStructure type, containing the /// whole structue (skins, ribs, spars...) of the wing. /// class CPACSWingComponentSegmentStructure { public: TIGL_EXPORT CPACSWingComponentSegmentStructure(CCPACSWingComponentSegment* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT CPACSWingComponentSegmentStructure(CCPACSTrailingEdgeDevice* parent, CTiglUIDManager* uidMgr); TIGL_EXPORT virtual ~CPACSWingComponentSegmentStructure(); template<typename P> bool IsParent() const { return m_parentType != NULL && *m_parentType == typeid(P); } template<typename P> P* GetParent() { #ifdef HAVE_STDIS_SAME static_assert(std::is_same<P, CCPACSWingComponentSegment>::value || std::is_same<P, CCPACSTrailingEdgeDevice>::value, "template argument for P is not a parent class of CPACSWingComponentSegmentStructure"); #endif if (!IsParent<P>()) { throw CTiglError("bad parent"); } return static_cast<P*>(m_parent); } template<typename P> const P* GetParent() const { #ifdef HAVE_STDIS_SAME static_assert(std::is_same<P, CCPACSWingComponentSegment>::value || std::is_same<P, CCPACSTrailingEdgeDevice>::value, "template argument for P is not a parent class of CPACSWingComponentSegmentStructure"); #endif if (!IsParent<P>()) { throw CTiglError("bad parent"); } return static_cast<P*>(m_parent); } TIGL_EXPORT virtual CTiglUIDObject* GetNextUIDParent(); TIGL_EXPORT virtual const CTiglUIDObject* GetNextUIDParent() const; TIGL_EXPORT CTiglUIDManager& GetUIDManager(); TIGL_EXPORT const CTiglUIDManager& GetUIDManager() const; TIGL_EXPORT virtual void ReadCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath); TIGL_EXPORT virtual void WriteCPACS(const TixiDocumentHandle& tixiHandle, const std::string& xpath) const; TIGL_EXPORT virtual const CCPACSWingShell& GetUpperShell() const; TIGL_EXPORT virtual CCPACSWingShell& GetUpperShell(); TIGL_EXPORT virtual const CCPACSWingShell& GetLowerShell() const; TIGL_EXPORT virtual CCPACSWingShell& GetLowerShell(); TIGL_EXPORT virtual const boost::optional<CCPACSWingRibsDefinitions>& GetRibsDefinitions() const; TIGL_EXPORT virtual boost::optional<CCPACSWingRibsDefinitions>& GetRibsDefinitions(); TIGL_EXPORT virtual const boost::optional<CCPACSWingSpars>& GetSpars() const; TIGL_EXPORT virtual boost::optional<CCPACSWingSpars>& GetSpars(); TIGL_EXPORT virtual CCPACSWingRibsDefinitions& GetRibsDefinitions(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveRibsDefinitions(); TIGL_EXPORT virtual CCPACSWingSpars& GetSpars(CreateIfNotExistsTag); TIGL_EXPORT virtual void RemoveSpars(); protected: void* m_parent; const std::type_info* m_parentType; CTiglUIDManager* m_uidMgr; CCPACSWingShell m_upperShell; CCPACSWingShell m_lowerShell; boost::optional<CCPACSWingRibsDefinitions> m_ribsDefinitions; boost::optional<CCPACSWingSpars> m_spars; private: CPACSWingComponentSegmentStructure(const CPACSWingComponentSegmentStructure&) = delete; CPACSWingComponentSegmentStructure& operator=(const CPACSWingComponentSegmentStructure&) = delete; CPACSWingComponentSegmentStructure(CPACSWingComponentSegmentStructure&&) = delete; CPACSWingComponentSegmentStructure& operator=(CPACSWingComponentSegmentStructure&&) = delete; }; } // namespace generated // CPACSWingComponentSegmentStructure is customized, use type CCPACSWingCSStructure directly } // namespace tigl
#ifndef CPP_UTILS_CONNECTION_H_ #define CPP_UTILS_CONNECTION_H_ #include <boost/asio.hpp> #include <string> #include <iostream> #include "jsoncons/json.hpp" using boost::asio::ip::tcp; namespace utils { class Connection { public: Connection(const std::string& host, const std::string& port); ~Connection(); jsoncons::json receive_response(boost::system::error_code* error); void send_requests(const std::vector<jsoncons::json>& msgs); private: jsoncons::json history_; boost::asio::io_service io_service; tcp::socket socket; boost::asio::streambuf response_buf; }; } // namespace utils #endif // CPP_UTILS_CONNECTION_H_
/* * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef RXCPPUNIQ_REACTIVE_SINGLE_H_ #define RXCPPUNIQ_REACTIVE_SINGLE_H_ #include "rxcppuniq/reactive/reactive.h" namespace rx { /** * A Single is a wrapper around a a stream which delivers a single element. * Any stream can be turned into a Single which delivers at least one element * or an error. * * The API for Singles is different than for streams. Though they are * conceptually similar, there are some pragmatic differences in usage: * flow control is implicit, and an end-of-stream marker is not needed. * * Singles as defined here are, like Publishers, unique and not active * before someone calls Subscribe() on them. This also means that singles can * be remoted to build single pipelines, as no execution is happening until * requested. */ template <typename T> class Single { public: Single() = default; /** * Creates a single which produces the given value. */ explicit Single(T value) : publisher_(Publisher<T>(std::move(value))) {} /** * Creates a single which produces the given error. */ static Single<T> Error(Status status) { return Single<T>(Publisher<T>::Error(status)); } /** * Creates a single from any publisher which produces at least one element * or an error. After the first element, the subscription will be canceled, * if it is still active. */ explicit Single(Publisher<T> publisher) : publisher_(std::move(publisher)) {} /** * Subscribes to the single and listens to the result. This consumes * the single. */ void Subscribe(std::function<void(StatusOr<T>)> listener) && { struct State { std::function<void(StatusOr<T>)> listener; bool called; }; auto state = State{std::move(listener), false}; auto wrapped = MoveToLambda(std::move(state)); std::move(publisher_) .Subscribe( [](Subscription const& subscription) { subscription.Request(1); }, // Lambda has mutable state (State::called) [wrapped](Subscription const& subscription, StatusOr<T> next) mutable { auto const& listener = wrapped->listener; auto& called = wrapped->called; if (IsDone(next)) { if (!called) { // This violates the contract for a single: there must be at // least one element or an error. called = true; listener(RX_STATUS(FAILED_PRECONDITION) << "unexpected end-of-stream for single"); } return; } called = true; auto is_end = IsEnd(next); listener(std::move(next)); // TODO(team): we shouldn't need the is_end check, the // subscription should just return has_ended() == true in this // case. But currently accessing it crashes. if (!is_end && !subscription.has_ended()) { subscription.Cancel(); } }); } /** * Continues with the function if the single returns a result, and * propagate the status if it returns an error. */ template <typename R> Single<R> ContinueWith(std::function<Single<R>(T)> func) && { auto wrapped = MoveToLambda(std::move(func)); return Single<R>( std::move(publisher_).template FlatMap<R>([wrapped](T value) { auto const& func = *wrapped; return std::move(func(std::move(value)).publisher_); })); } /** * Moves the underlying stream out of the single. * * TODO(team): we want to enforce cardinality if we move the publisher * out of here. Linked bug suggests to introduce Take(N) stream operator * which can be also used to implement this property. */ Publisher<T> move_publisher() && { return std::move(publisher_); } private: Publisher<T> publisher_; }; } // namespace rx #endif // RXCPPUNIQ_REACTIVE_SINGLE_H_
#include <math.h> #include "csa_types.h" #include "csa_defs.h" extern char *st_pop(); extern rhs_ptr deq_list(); extern void st_reset(); extern stack reached_nodes; extern rhs_ptr *bucket; extern long num_buckets; extern rhs_ptr head_rhs_node, tail_rhs_node; extern unsigned p_refines, r_scans; extern unsigned myclock(), p_refine_time; int dfs_visit(w) register rhs_ptr w; { register lr_aptr a, a_stop; lhs_ptr v; register rhs_ptr x; register long p; w->node_info.srchng = TRUE; if (w->node_info.priced_in && (v = w->matched)) { a_stop = (v+1)->priced_out; p = w->p; for (a = v->first; a != a_stop; a++) if (p + a->c - (x = a->head)->p < 0) { if (x->node_info.srchng) return(0); if (!x->node_info.srched && !dfs_visit(x)) return(0); } } w->node_info.srchng = FALSE; w->node_info.srched = TRUE; st_push(reached_nodes, w); return(1); } int top_sort() { register rhs_ptr w, w_stop; st_reset(reached_nodes); for (w = head_rhs_node; w != tail_rhs_node; w++) w->node_info.srched = w->node_info.srchng = FALSE; w_stop = head_rhs_node - 1; for (w--; w != w_stop; w--) if (!w->node_info.srched && !dfs_visit(w)) return(0); return(1); } void r_scan(w) register rhs_ptr w; { register lr_aptr a, a_stop; lhs_ptr v; register rhs_ptr x; register long wk, xk; register long p; long w_to_x_cost; r_scans++; if (w->node_info.priced_in && (v = w->matched)) { a_stop = (v+1)->priced_out; p = w->p; wk = w->key; for (a = v->first; a != a_stop; a++) if (a != v->matched) { if ((w_to_x_cost = p + a->c - (x = a->head)->p) < 0) xk = wk; else xk = wk - 1 - w_to_x_cost; if (xk > x->key) { delete_list(x, &bucket[x->key]); x->key = xk; insert_list(x, &bucket[xk]); } } } w->p -= w->key; w->key = num_buckets; } int p_refine() { register rhs_ptr w, x; lhs_ptr v; lr_aptr a, a_stop; long xk, max_key = 0; int eps_opt = FALSE; register long delta_c, p; p_refine_time -= myclock(); p_refines++; for (w = head_rhs_node; w != tail_rhs_node; w++) { /* Adjust l-r arc costs to incorporate costs of r-l arcs, so that we can deal with the l-r arcs only. */ if (w->node_info.priced_in && (v = w->matched)) { a_stop = (v+1)->priced_out; delta_c = v->matched->c; #ifdef STRONG_PO /* If we might price arcs back in, we need to adjust costs of priced-out arcs as well as those of priced-in arcs. */ a = v->priced_out; #else a = v->first; #endif for (; a != a_stop; a++) a->c -= delta_c; } } while (top_sort() && !eps_opt) { for (w = head_rhs_node; w != tail_rhs_node; w++) w->key = 0; max_key = 0; while (!st_empty(reached_nodes)) { w = (rhs_ptr) st_pop(reached_nodes); if (w->key > max_key) max_key = w->key; if ((v = w->matched) && w->node_info.priced_in) { a_stop = (v+1)->priced_out; p = w->key - w->p; for (a = v->first; a != a_stop; a++) { x = a->head; xk = p - 1 - a->c + x->p; if (xk > x->key) x->key = xk; } } } if (max_key == 0) eps_opt = TRUE; else { for (w = head_rhs_node; w != tail_rhs_node; w++) insert_list(w, &bucket[w->key]); for (; max_key > 0; max_key--) while (bucket[max_key] != tail_rhs_node) r_scan(deq_list(&bucket[max_key])); bucket[0] = tail_rhs_node; } } p_refine_time += myclock(); return(eps_opt); }
#pragma once #include "surface.h" #include "meterial.h" #include "vec3.h" class Triangle : public Surface { public: Vec3<double> a; Vec3<double> b; Vec3<double> c; virtual void intersect(const Vec3<double>& start, const Vec3<double>& dir, double t0, double t1, double & t, Vec3<double>& n)const; Triangle(Vec3<double> a, Vec3<double> b, Vec3<double> c, int met); ~Triangle(); };
/* Copyright 2014 PAW Solutions LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #import <UIKit/UIKit.h> #import "SwitchControlAppDelegate.h" #define MAX_AVAIL_NETWORKS 20 @interface configViewController : UIViewController <UITableViewDataSource, UITableViewDelegate,UIPickerViewDataSource, UIPickerViewDelegate> { @public SwitchControlAppDelegate *appDelegate; NSString *switchName; int num_avail_wifi; BOOL nowEnteringPassphrase; BOOL nowConfirmingConfig; } - (void)alertView:(UIAlertView *) alertView didDismissWithButtonIndex:(NSInteger) buttonIndex; - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView; - (IBAction)Cancel:(id)sender; - (void) wifi_list_updated:(NSNotification *) notification; - (void) reload_wifi_list_table; - (void)Background_Thread_To_Detect_Wifi; - (IBAction)ChangeName:(id)sender; - (IBAction)ChangeNetwork:(id)sender; - (IBAction)NetworkNameChanged:(id)sender; - (IBAction)ScanForNetworks:(id)sender; - (void)EnableUIAfterScan; - (void)ShowScanAlert:(id)alertMessage; // Picker support - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView; - (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component; - (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component; @property (retain, nonatomic) IBOutlet UIActivityIndicatorView *ScanActivityIndicator; @property (retain, nonatomic) IBOutlet UITableView *wifiNameTable; // Information for WiFi network detection @property (retain) NSLock *wifiDataLock; @property (nonatomic) NSMutableDictionary *wifiNameDictionary; @property (nonatomic) NSMutableArray *wifiNameArray; @property (retain, nonatomic) IBOutlet UIButton *CancelButton; @property (retain, nonatomic) IBOutlet UIPickerView *datePicker; @property (retain, nonatomic) IBOutlet UITextField *SwitchamajigNameText; @property (retain, nonatomic) IBOutlet UITextField *NetworkNameText; @property (retain, nonatomic) IBOutlet UIButton *ConfigureNetworkButton; @property (retain, nonatomic) IBOutlet UIButton *ScanNetworkButton; @property SwitchamajigControllerDeviceDriver *driver; @end
/* * Copyright (c) 2016, https://github.com/nebula-im * 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. */ // TODO(@benqi): 使用zrpc-code-gen代码生成工具自动生成 #ifndef PUSH_PUSH_SERVICE_IMPL_H_ #define PUSH_PUSH_SERVICE_IMPL_H_ #include "push/zrpc_push_service.h" class PushServiceImpl : public ZRpcPushService { public: PushServiceImpl() = default; ~PushServiceImpl() = default; int DeliveryDataToUsers(const zproto::DeliveryDataToUsersReq& request, zproto::VoidRsp* response) override; }; #endif
/*----------------------------------------------------------------------/ / Test if the file is contiguous / /----------------------------------------------------------------------*/ FRESULT test_contiguous_file ( FIL* fp, /* [IN] Open file object to be checked */ int* cont /* [OUT] 1:Contiguous, 0:Fragmented or zero-length */ ) { DWORD clst, clsz, step; FSIZE_t fsz; FRESULT fr; *cont = 0; fr = f_lseek(fp, 0); /* Validates and prepares the file */ if (fr != FR_OK) return fr; #if FF_MAX_SS == FF_MIN_SS clsz = (DWORD)fp->obj.fs->csize * FF_MAX_SS; /* Cluster size */ #else clsz = (DWORD)fp->obj.fs->csize * fp->obj.fs->ssize; #endif fsz = f_size(fp); if (fsz > 0) { clst = fp->obj.sclust - 1; /* A cluster leading the first cluster for first test */ while (fsz) { step = (fsz >= clsz) ? clsz : (DWORD)fsz; fr = f_lseek(fp, f_tell(fp) + step); /* Advances file pointer a cluster */ if (fr != FR_OK) return fr; if (clst + 1 != fp->clust) break; /* Is not the cluster next to previous one? */ clst = fp->clust; fsz -= step; /* Get current cluster for next test */ } if (fsz == 0) *cont = 1; /* All done without fail? */ } return FR_OK; }
#import <UIKit/UIKit.h> FOUNDATION_EXPORT double Pods_WEFreshBeenVersionNumber; FOUNDATION_EXPORT const unsigned char Pods_WEFreshBeenVersionString[];
// // HFAssignmentNotebookViewController.h // HFHS // // Created by Mark Glagola on 11/28/12. // Copyright (c) 2012 Mark Glagola. All rights reserved. // #import "HFScrollViewController.h" @interface HFAssignmentNotebookViewController : HFScrollViewController @end
///////////////////////////////////////////////////////////////////////////////////////////// // Copyright 2017 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. ///////////////////////////////////////////////////////////////////////////////////////////// #pragma once #include "RenderTechnique.h" #include "TerrainStructs.fxh" struct SBoundingBox { float fMinX, fMaxX, fMinY, fMaxY, fMinZ, fMaxZ; }; // Structure describing a plane struct SPlane3D { D3DXVECTOR3 Normal; float Distance; //Distance from the coordinate system origin to the plane along normal direction }; #pragma pack(1) struct SViewFrustum { SPlane3D LeftPlane, RightPlane, BottomPlane, TopPlane, NearPlane, FarPlane; }; #pragma pack() // Extract view frustum planes from the world-view-projection matrix void ExtractViewFrustumPlanesFromMatrix(const D3DXMATRIX &Matrix, SViewFrustum &ViewFrustum); // Tests if bounding box is visible by the camera bool IsBoxVisible(const SViewFrustum &ViewFrustum, const SBoundingBox &Box); // Structure describing terrain rendering parameters struct SRenderingParams { STerrainAttribs m_TerrainAttribs; enum TEXTURING_MODE { TM_HEIGHT_BASED = 0, TM_MATERIAL_MASK = 1, TM_MATERIAL_MASK_NM = 2 }; // Patch rendering params TEXTURING_MODE m_TexturingMode; int m_iRingDimension; int m_iNumRings; int m_iNumShadowCascades; BOOL m_bBestCascadeSearch; BOOL m_bSmoothShadows; int m_iColOffset, m_iRowOffset; SRenderingParams() : m_TexturingMode(TM_MATERIAL_MASK), m_iRingDimension(65), m_iNumRings(15), m_iNumShadowCascades(4), m_bBestCascadeSearch(TRUE), m_bSmoothShadows(TRUE), m_iColOffset(0), m_iRowOffset(0) {} }; struct SRingSectorMesh { CComPtr<ID3D11Buffer> pIndBuff; UINT uiNumIndices; SBoundingBox BoundBox; SRingSectorMesh() : uiNumIndices(0){} }; // This class renders the adaptive model using DX11 API class CEarthHemsiphere { public: CEarthHemsiphere(void) : m_uiNumStitchIndices(0){} // Renders the model void Render(ID3D11DeviceContext* pd3dImmediateContext, const D3DXVECTOR3 &vCameraPosition, const D3DXMATRIX &CameraViewProjMatrix, ID3D11Buffer *pcbLightAttribs, ID3D11Buffer *pcMediaScatteringParams, ID3D11ShaderResourceView *pShadowMapSRV, ID3D11ShaderResourceView *pPrecomputedNetDensitySRV, ID3D11ShaderResourceView *pAmbientSkylightSRV, bool bZOnlyPass); // Creates Direct3D11 device resources HRESULT OnD3D11CreateDevice( class CElevationDataSource *pDataSource, const SRenderingParams &Params, ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, LPCTSTR HeightMapPath, LPCTSTR MaterialMaskPath, LPCTSTR *TileTexturePath, LPCTSTR *TileNormalMapPath ); // Releases Direct3D11 device resources void OnD3D11DestroyDevice( ); enum {NUM_TILE_TEXTURES = 1 + 4};// One base material + 4 masked materials void UpdateParams(const SRenderingParams &NewParams); private: HRESULT CreateRenderStates(ID3D11Device* pd3dDevice); void RenderNormalMap(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, const UINT16 *pHeightMap, size_t HeightMapPitch, int iHeightMapDim); SRenderingParams m_Params; CRenderTechnique m_RenderEarthHemisphereTech; CRenderTechnique m_RenderEarthHemisphereZOnlyTech; CComPtr<ID3D11Buffer> m_pVertBuff; CComPtr<ID3D11InputLayout> m_pInputLayout; CComPtr<ID3D11ShaderResourceView> m_ptex2DNormalMapSRV, m_ptex2DMtrlMaskSRV; CComPtr<ID3D11DepthStencilState> m_pEnableDepthTestDS; CComPtr<ID3D11DepthStencilState> m_pDisableDepthTestDS; CComPtr<ID3D11BlendState> m_pDefaultBS; CComPtr<ID3D11RasterizerState> m_pRSSolidFill, m_pRSSolidFillNoCull, m_pRSZOnlyPass, m_pRSWireframeFill; CComPtr<ID3D11SamplerState> m_psamPointClamp, m_psamLinearMirror, m_psamLinearWrap, m_psamComaprison, m_psamLinearClamp; CComPtr<ID3D11Buffer> m_pcbTerrainAttribs; CComPtr<ID3D11Buffer> m_pcbCameraAttribs; CComPtr<ID3D11ShaderResourceView> m_ptex2DTilesSRV[NUM_TILE_TEXTURES]; CComPtr<ID3D11ShaderResourceView> m_ptex2DTilNormalMapsSRV[NUM_TILE_TEXTURES]; std::vector<SRingSectorMesh> m_SphereMeshes; CComPtr<ID3D11Buffer> m_pStitchIndBuff; UINT m_uiNumStitchIndices; private: CEarthHemsiphere(const CEarthHemsiphere&); CEarthHemsiphere& operator = (const CEarthHemsiphere&); };
#ifndef L_GL_GLSLHELPER #define L_GL_GLSLHELPER #include "Coordinates.h" #include "Vector.h" #include "Defines.h" #include "Errorlog.h" #include "math.h" // const used to convert degrees into radians // is defined in math.h #define M_PI 3.14 #define TAU 2.0 * M_PI #define ONE_DEG_IN_RAD (2.0 * M_PI) / 360.0 // 0.017444444 #define ONE_RAD_IN_DEG 360.0 / (2.0 * M_PI) // 57.2957795 #include <GL/gl.h> #include <GL/glew.h> /* stored like this: 0 4 8 12 1 5 9 13 2 6 10 14 3 7 11 15 */ class Matrix4 { public: Matrix4(); Matrix4(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float mm, float n, float o, float p); Vec4 operator*(const Vec4 &rhs); Matrix4 operator*(const Matrix4 &rhs); Matrix4 &operator=(const Matrix4 &rhs); Matrix4 Translate(const Vec3 &v); // Matrix4 RotateX (const float& deg ); // Matrix4 RotateY (const float& deg ); Matrix4 RotateZ(const float &deg); Matrix4 Scale(const Vec3 &v); float Determinant(); Matrix4 Inverse(); Matrix4 Transpose(); static Matrix4 IdentityMatrix(); static Matrix4 ZeroMatrix(); static Matrix4 OrthoGraphicProjectionMatrix(const Vec2 &displaySize); static Matrix4 OrthoGraphicProjectionMatrix(const Vec2 &displaySize, int near, int far); static Matrix4 OrthoGraphicProjectionMatrix(const Rect &displayArea); GLfloat m[16]; }; #endif // L_GL_GLSLHELPER
/** * @file ble_tracker.h * @breaf Cerevo CDP-TZ01B sample program. * BLE Motion Tracker * * @author Cerevo Inc. */ /* Copyright 2015 Cerevo 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 _BLE_TRACKER_H_ #define _BLE_TRACKER_H_ #include <stdbool.h> /** * @brief Initialize BLE tracker application. */ int ble_tracker_init(void); /** * @brief BLE tracker application * * @param[in] en_9axis Enabled 9-axis sensor. * @param[in] en_airpressure Enabled Airpressur sensor. */ int ble_tracker_run(const bool en_9axis, const bool en_airpressure); /** * @brief Stop BLE tracker application. */ void ble_tracker_stop(void); #endif
/* * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. */ #ifndef vnsw_test_agent_init_hpp #define vnsw_test_agent_init_hpp #include <boost/program_options.hpp> #include <init/contrail_init_common.h> #include <test/test_pkt0_interface.h> #include <uve/test/agent_stats_collector_test.h> #include <vrouter/flow_stats/flow_stats_collector.h> #include <port_ipc/port_ipc_handler.h> class Agent; class AgentParam; // The class to drive agent initialization. // Defines control parameters used to enable/disable agent features class TestAgentInit : public ContrailInitCommon { public: TestAgentInit(); virtual ~TestAgentInit(); static const uint32_t kDefaultInterval = 30 * 60 * 1000; static const uint32_t kIncrementalInterval = 30 * 60 * 1000; void ProcessOptions(const std::string &config_file, const std::string &program_name); // Initialization virtual methods void FactoryInit(); void CreateModules(); void InitDone(); // Shutdown virtual methods virtual void KSyncShutdown(); void UveShutdown(); void StatsCollectorShutdown(); void FlowStatsCollectorShutdown(); void WaitForIdle(); TestPkt0Interface *pkt0() const { return pkt0_.get(); } void ProcessComputeAddress(AgentParam *param); private: std::auto_ptr<KSync> ksync_; std::auto_ptr<PortIpcHandler> pih_; std::auto_ptr<AgentUveBase> uve_; std::auto_ptr<TestPkt0Interface> pkt0_; std::auto_ptr<AgentStatsCollectorTest> stats_collector_; std::auto_ptr<FlowStatsManager> flow_stats_manager_; DISALLOW_COPY_AND_ASSIGN(TestAgentInit); }; #endif // vnsw_test_agent_init_hpp
#pragma once #include "IUpdateable.h" #include "ConsoleModel.h" namespace TK { class ConsoleView : public sf::Drawable, public IUpdateable { public: ConsoleView(ConsoleModel &model); ~ConsoleView(); ConsoleView(const ConsoleView &a) = default; ConsoleView &operator = (const ConsoleView &a) = default; virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const override final; virtual TK_STATUS Update(const sf::Time &deltatime) override final; TK_STATUS SetSize(const sf::Vector2f &size); TK_STATUS SetFont(const sf::Font &font); TK_STATUS SetCharacterSize(size_t size); TK_STATUS SetBackgroundColor(const sf::Color &color); private: ConsoleModel &m_model; sf::RectangleShape m_background; sf::Vector2f m_size; sf::Text m_input_text; sf::Text m_user_text; sf::Text m_output_text; TK_PROPERTY_BOOL(m_visible, Visible); }; }
#pragma once #include <string> #include <view/interfaces/i_gui_object.h> namespace erebus { /** * This class is the base interface for all gui elements that can contain * other gui elements. */ class IContainer :public IGUIObject { public: /** * Destructor. */ ~IContainer() {} /** * Whether this container contains the widget with the given id. * * @return true if the container contains this widget */ virtual bool containsWidget(std::size_t id)=0; /** * Returns the parent container of the the widget with the given id. * * If this container does not contain the widget, nullptr is returned. * * @return the parent container of the widget with the given id */ virtual IGUIObject* getParentOf(std::size_t id)=0; }; }//namespace erebus
/* Copyright (c) 2013 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. */ #import <Foundation/Foundation.h> #import "CloudAuthenticatorDelegate.h" #import "CloudBackendIOSClientAppDelegate.h" #import "CloudControllerDelegate.h" #import "CloudEntityCollection.h" #import "GTLMobilebackend.h" // Notification name to notify receiving device token from APNS. extern NSString *const kCloudControllerDeviceTokenNotification; // Provides built-in user authentication, push notification registration, and // broadcasting functionality in a UIViewController. // Any application client desires these functionalities can instantiate this // class and implement CloudControllerDelegate protocol. @interface CloudControllerHelper : NSObject<CloudAuthenticatorDelegate> // Reference to the application @property(nonatomic, retain) CloudBackendIOSClientAppDelegate *appDelegate; // Reference to mobile backend service. @property(nonatomic, strong, readonly) GTLServiceMobilebackend *cloudEndpointService; // Start common services for the application (i.e. Authentication service, // Cloud endpoint service, APNS etc). - (void)startCommonServices; // New init method to initialize values needed for this class. - (id)initWithClientID:(NSString *)clientID secret:(NSString *)clientSecret chainName:(NSString *)chainName authEnabled:(BOOL)authEnabled serviceURL:(NSString *)serviceURL delegate:(id<CloudControllerDelegate>)delegate; // List collection of data with the provided kind. - (void)listCollectionWithKind:(NSString *)kind pastScope:(BOOL)pastScope completionHandle:(CloudEntityCollectionQueryCompletion)block; // Allow client to sign in. - (void)signIn; // Allow client to sign out. - (void)signOut; @end
/** * Appcelerator Titanium Mobile * Copyright (c) 2010 by PocketGuide, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import "TiUIView.h" #ifdef USE_TI_UIIOSADVIEW #import <iAd/iAd.h> @interface TiUIiOSAdView : TiUIView<ADBannerViewDelegate> { @private ADBannerView *adview; } @property (nonatomic, readonly) ADBannerView* adview; @end #endif
// // NewsFirstViewCell.h // ShowNews // // Created by YYP on 16/6/28. // Copyright © 2016年 YZZL. All rights reserved. // #import <UIKit/UIKit.h> #import <SMPageControl.h> @interface NewsFirstViewCell : UITableViewCell @property (nonatomic, strong) UIScrollView *scrollView; @property (nonatomic, strong) SMPageControl *pageControl; @property (nonatomic, strong) UIImageView *myImageView; @property (nonatomic, strong) NSMutableArray *imageArr; @property (nonatomic, strong) UILabel *titleLabel; - (void)addAllViews; @end
#pragma once #include "../SimpleLog.h" #include "Vec2.h" namespace Math { template <typename T> class Rectangle { public: typedef T Type; enum Position : unsigned int { Inside = 0, Left = 1, Right = 2, Bottom = 4, Top = 8 }; Rectangle(); Rectangle( const Vec2<T> & rightTop ); Rectangle( const T( &r )[4] ); Rectangle( const Vec2<T> & leftBottom, const Vec2<T> & rightTop ); Rectangle( const T & left, const T & bottom, const T & right, const T & top ); const T & getLeft() const; const T & getTop() const; const T & getRight() const; const T & getBottom() const; const Vec2<T> getLeftBottom() const; const Vec2<T> getRightTop() const; bool isInside( const Vec2<T> & p ) const; ///@brief get the zone of a point relatively to this rectangle (top left, right bottom, inside etc...) ///@see https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm#Example_C.2FC.2B.2B_implementation ///@param p Point ///@return combination of binary OR with enum Position unsigned int getZone( const Vec2<T> & p ) const; void setLeft( const T & left ); void setTop( const T & top ); void setRight( const T & right ); void setBottom( const T & bottom ); void setLeftBottom( const Vec2<T> & leftTop ); void setRightTop( const Vec2<T> & rightTop ); Rectangle<T> & operator+=( const Vec2<T> & p ); Rectangle<T> & operator-=( const Vec2<T> & p ); Rectangle<T> & operator=( const Rectangle<T> & r ); Rectangle<T> & operator=( const T( &r )[4] ); static const Rectangle<T> null; private: Vec2<T> pointLeftBottom; Vec2<T> pointRightTop; }; template<typename T> Rectangle<T> operator+( const Rectangle<T> & r, const Vec2<T> & p ); template<typename T> Rectangle<T> operator+( const Vec2<T> & p, const Rectangle<T> & r ); template<typename T> Rectangle<T> operator-( const Rectangle<T> & r, const Vec2<T> & p ); template<typename T> Rectangle<T> operator-( const Vec2<T> & p, const Rectangle<T> & r ); template<typename T, typename U = char> BasicString<U> & operator<<( BasicString<U> & string, const Rectangle<T> & r ); typedef Rectangle<float> RectF; typedef Rectangle<int> RectI; } #include "Rectangle.hpp"
// Copyright 2017 InnerFunction Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Created by Julian Goacher on 28/06/2014. // Copyright (c) 2014 Julian Goacher. All rights reserved. // #import <Foundation/Foundation.h> @interface NSString (SC) - (NSInteger)indexOf:(NSString *)str; - (NSString *)substringFromIndex:(NSUInteger)from toIndex:(NSUInteger)to; - (NSArray *)split:(NSString *)pattern; - (NSString *)replaceAllOccurrences:(NSString *)pattern with:(NSString *)string; - (id)parseJSON:(NSError *)error; @end
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /******************************************************************************* * NOTICE * The HAL is not public api, don't use in application code. * See readme.md in soc/README.md ******************************************************************************/ // CP DMA HAL usages: // 1. Initialize HAL layer by cp_dma_hal_init, pass in the allocated descriptors for TX and RX // 2. Enable DMA and interrupt by cp_dma_hal_start // 3. Prepare descriptors used for TX and RX // 4. Restart the DMA engine in case it's not in working #pragma once #ifdef __cplusplus extern "C" { #endif #include <stddef.h> #include <stdbool.h> #include "esp_attr.h" #include "hal/dma_types.h" #include "soc/cp_dma_struct.h" /** * @brief HAL context * */ typedef struct { cp_dma_dev_t *dev; } cp_dma_hal_context_t; typedef struct { } cp_dma_hal_config_t; /** * @brief Initialize HAL layer context * * @param hal HAL layer context, whose memroy should be allocated at driver layer * @param config configuration for the HAL layer */ void cp_dma_hal_init(cp_dma_hal_context_t *hal, const cp_dma_hal_config_t *config); /** * @brief Deinitialize HAL layer context */ void cp_dma_hal_deinit(cp_dma_hal_context_t *hal); /** * @brief Set descriptor base address */ void cp_dma_hal_set_desc_base_addr(cp_dma_hal_context_t *hal, intptr_t outlink_base, intptr_t inlink_base); /** * @brief Start mem2mem DMA state machine */ void cp_dma_hal_start(cp_dma_hal_context_t *hal); /** * @brief Stop mem2mem DMA state machine */ void cp_dma_hal_stop(cp_dma_hal_context_t *hal); /** * @brief Get interrupt status word * * @return uint32_t Interrupt status */ uint32_t cp_dma_hal_get_intr_status(cp_dma_hal_context_t *hal) IRAM_ATTR; /** * @brief Clear interrupt mask * * @param mask interrupt mask */ void cp_dma_hal_clear_intr_status(cp_dma_hal_context_t *hal, uint32_t mask) IRAM_ATTR; /**@{*/ /** * @brief Give the owner of descriptors between [start_desc, end_desc] to DMA, and restart DMA HW engine * * @param hal HAL layer context * @param start_desc The first descriptor that carries one transaction * @param end_desc The last descriptor that carries one transaction */ void cp_dma_hal_restart_tx(cp_dma_hal_context_t *hal); void cp_dma_hal_restart_rx(cp_dma_hal_context_t *hal); /**@}*/ #ifdef __cplusplus } #endif
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_MulticastDelegate3201952435.h" #include "mscorlib_System_Void1841601450.h" // UnityEngine.EventSystems.IPointerEnterHandler struct IPointerEnterHandler_t193164956; // UnityEngine.EventSystems.BaseEventData struct BaseEventData_t2681005625; // System.IAsyncResult struct IAsyncResult_t1999651008; // System.AsyncCallback struct AsyncCallback_t163412349; // System.Object struct Il2CppObject; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.EventSystems.ExecuteEvents/EventFunction`1<UnityEngine.EventSystems.IPointerEnterHandler> struct EventFunction_1_t2985282902 : public MulticastDelegate_t3201952435 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif
/* * File: IAS-LangLib/src/lang/script/parser.h * * Copyright (C) 2015, Albert Krzymowski * * 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 _IAS_AS_Lang_Script_H_ #define _IAS_AS_Lang_Script_H_ #include "../script/parser/Lexer.h" #include "../script/parser/Parser.h" #include "lang/tools/parser/LexerIStreamWrapper.h" #endif
/* * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "project_config.h" #include "buttons.h" void BUTTONS_Config(void) { // enable clock to the relevant IO PORT(s) RCC_AHBPeriphClockCmd(BUTTONS_POWER_AHB, ENABLE); CONFIG_pins(pins_buttons, BUTTONS_NUM); } uint32_t BUTTONS_Read_All(void) { int8_t i; uint32_t result = 0; for(i = BUTTONS_NUM-1; i >= 0; i--) result = (result << 1) | BUTTONS_Read(i); return result; } uint8_t BUTTONS_Read(uint8_t index) { if(GPIO_ReadInputDataBit(pins_buttons[index].GPIOx, pins_buttons[index].pin) == ((BUTTONS_POLARITY >> index) & 1) ) return 1; else return 0; }
#ifndef SENSORS_SYSFS_H_ #define SENSORS_SYSFS_H_ enum sensors_sysfs_type { SYSFS_TYPE_ABS_PATH, SYSFS_TYPE_INPUT_DEV }; #define SYSFS_PATH_MAX 64 struct sysfs_data_t { char path[SYSFS_PATH_MAX]; }; struct sensors_sysfs_t { int (*write)(struct sensors_sysfs_t* s, const char* attribute, const char *value, const int length); int (*write_int)(struct sensors_sysfs_t* s, const char* attribute, const long long value); struct sysfs_data_t data; }; int sensors_sysfs_init(struct sensors_sysfs_t* s, const char *str, enum sensors_sysfs_type type); #endif
/* * 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/servicecatalog/ServiceCatalog_EXPORTS.h> #include <aws/servicecatalog/ServiceCatalogRequest.h> namespace Aws { namespace ServiceCatalog { namespace Model { /** */ class AWS_SERVICECATALOG_API DisableAWSOrganizationsAccessRequest : public ServiceCatalogRequest { public: DisableAWSOrganizationsAccessRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "DisableAWSOrganizationsAccess"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; }; } // namespace Model } // namespace ServiceCatalog } // namespace Aws
/* * Copyright 2009-2020 The VOTCA Development Team * (http://www.votca.org) * * Licensed under the Apache License, Version 2.0 (the "License") * * You may not use this file except in compliance with the License. * 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 VOTCA_XTP_OVERLAP_FILTER_H #define VOTCA_XTP_OVERLAP_FILTER_H // Local VOTCA includes #include "votca/xtp/statefilter_base.h" namespace votca { namespace xtp { /** \brief overlap_filter tracks states according to their overlap with a previous state */ class Overlap_filter : public StateFilter_base { public: std::string Identify() const final { return "overlap"; } void Initialize(const tools::Property& options) final; void Info(Logger& log) const final; void UpdateHist(const Orbitals& orb, QMState state) final; bool NeedsInitialState() const final { return true; } std::vector<Index> CalcIndeces(const Orbitals& orb, QMStateType type) const final; void WriteToCpt(CheckpointWriter& w) final; void ReadFromCpt(CheckpointReader& r) final; private: Eigen::VectorXd CalculateOverlap(const Orbitals& orb, QMStateType type) const; Eigen::MatrixXd CalcAOCoeffs(const Orbitals& orb, QMStateType type) const; Eigen::MatrixXd CalcExcitonAORepresentation(const Orbitals& orb, QMStateType type) const; double threshold_ = 0.0; Eigen::VectorXd laststatecoeff_; }; } // namespace xtp } // namespace votca #endif // VOTCA_XTP_OVERLAP_FILTER_H
// // bleuuid.h // ImmPeri - Immediate Alert Peripheral Sample // // Created by youten on 2014/01/06. // Copyright (c) 2014年 sample. All rights reserved. // #ifndef bleuuid_h #define bleuuid_h // 180A Device Information static NSString * SERVICE_DEVICE_INFORMATION = @"0000180a-0000-1000-8000-00805f9b34fb"; static NSString * CHAR_MANUFACTURER_NAME_STRING = @"00002a29-0000-1000-8000-00805f9b34fb"; static NSString * CHAR_MODEL_NUMBER_STRING = @"00002a24-0000-1000-8000-00805f9b34fb"; static NSString * CHAR_SERIAL_NUMBEAR_STRING = @"00002a25-0000-1000-8000-00805f9b34fb"; // 1802 Immediate Alert static NSString * SERVICE_IMMEDIATE_ALERT = @"00001802-0000-1000-8000-00805f9b34fb"; static NSString * CHAR_ALERT_LEVEL = @"00002a06-0000-1000-8000-00805f9b34fb"; // StickNFindではCHAR_ALERT_LEVELに0x01をWriteすると光り、0x02では音が鳴り、0x03では光って鳴る。 #endif
/* uuid.c - Bluetooth UUID handling */ /* * Copyright (c) 2015-2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <string.h> #include <errno.h> #include <misc/byteorder.h> #include <misc/printk.h> #include <bluetooth/uuid.h> #define UUID_16_BASE_OFFSET 12 /* TODO: Decide whether to continue using BLE format or switch to RFC 4122 */ /* Base UUID : 0000[0000]-0000-1000-8000-00805F9B34FB -> * { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, * 0x00, 0x10, 0x00, 0x00, [0x00, 0x00], 0x00, 0x00 } * 0x2800 : 0000[2800]-0000-1000-8000-00805F9B34FB -> * { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, * 0x00, 0x10, 0x00, 0x00, [0x00, 0x28], 0x00, 0x00 } * little endian 0x2800 : [00 28] -> no swapping required * big endian 0x2800 : [28 00] -> swapping required */ static const struct bt_uuid_128 uuid128_base = { .uuid.type = BT_UUID_TYPE_128, .val = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, }; static void uuid_to_uuid128(const struct bt_uuid *src, struct bt_uuid_128 *dst) { switch (src->type) { case BT_UUID_TYPE_16: *dst = uuid128_base; sys_put_le16(BT_UUID_16(src)->val, &dst->val[UUID_16_BASE_OFFSET]); return; case BT_UUID_TYPE_32: *dst = uuid128_base; sys_put_le32(BT_UUID_32(src)->val, &dst->val[UUID_16_BASE_OFFSET]); return; case BT_UUID_TYPE_128: memcpy(dst, src, sizeof(*dst)); return; } } static int uuid128_cmp(const struct bt_uuid *u1, const struct bt_uuid *u2) { struct bt_uuid_128 uuid1, uuid2; uuid_to_uuid128(u1, &uuid1); uuid_to_uuid128(u2, &uuid2); return memcmp(uuid1.val, uuid2.val, 16); } int bt_uuid_cmp(const struct bt_uuid *u1, const struct bt_uuid *u2) { /* Convert to 128 bit if types don't match */ if (u1->type != u2->type) { return uuid128_cmp(u1, u2); } switch (u1->type) { case BT_UUID_TYPE_16: return (int)BT_UUID_16(u1)->val - (int)BT_UUID_16(u2)->val; case BT_UUID_TYPE_32: return (int)BT_UUID_32(u1)->val - (int)BT_UUID_32(u2)->val; case BT_UUID_TYPE_128: return memcmp(BT_UUID_128(u1)->val, BT_UUID_128(u2)->val, 16); } return -EINVAL; } #if defined(CONFIG_BT_DEBUG) void bt_uuid_to_str(const struct bt_uuid *uuid, char *str, size_t len) { u32_t tmp1, tmp5; u16_t tmp0, tmp2, tmp3, tmp4; switch (uuid->type) { case BT_UUID_TYPE_16: snprintk(str, len, "%04x", BT_UUID_16(uuid)->val); break; case BT_UUID_TYPE_32: snprintk(str, len, "%04x", BT_UUID_32(uuid)->val); break; case BT_UUID_TYPE_128: memcpy(&tmp0, &BT_UUID_128(uuid)->val[0], sizeof(tmp0)); memcpy(&tmp1, &BT_UUID_128(uuid)->val[2], sizeof(tmp1)); memcpy(&tmp2, &BT_UUID_128(uuid)->val[6], sizeof(tmp2)); memcpy(&tmp3, &BT_UUID_128(uuid)->val[8], sizeof(tmp3)); memcpy(&tmp4, &BT_UUID_128(uuid)->val[10], sizeof(tmp4)); memcpy(&tmp5, &BT_UUID_128(uuid)->val[12], sizeof(tmp5)); snprintk(str, len, "%08x-%04x-%04x-%04x-%08x%04x", tmp5, tmp4, tmp3, tmp2, tmp1, tmp0); break; default: (void)memset(str, 0, len); return; } } const char *bt_uuid_str(const struct bt_uuid *uuid) { static char str[37]; bt_uuid_to_str(uuid, str, sizeof(str)); return str; } #endif /* CONFIG_BT_DEBUG */
// // People.h // SimpleModel // // Created by wuyp on 16/6/16. // Copyright © 2016年 wuyp. All rights reserved. // #import <Foundation/Foundation.h> @interface People : NSObject @end
// // KHresultGoods.h // knock Honey // // Created by 刘毕涛 on 2016/11/10. // Copyright © 2016年 liubitao. All rights reserved. // #import <Foundation/Foundation.h> @interface KHresultGoods : NSObject @property (nonatomic,copy) NSString *buynum; @property (nonatomic,copy) NSString *codes; @property (nonatomic,copy) NSString *qishu; @property (nonatomic,copy) NSString *title; @end
/******************************************************************************* Copyright 2012 Arciem LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *******************************************************************************/ #import "CTableRowItem.h" @interface CTableSummaryItem : CTableRowItem @property (nonatomic) BOOL requiresDrillDown; - (id)initWithKey:(NSString*)key title:(NSString*)title model:(CItem*)model; @end
// // Created by glavo on 17-11-12. // #ifndef JOTVM_CPP_CLASSPATH_H #define JOTVM_CPP_CLASSPATH_H class ClassPath { }; #endif //JOTVM_CPP_CLASSPATH_H
/** * @license Apache-2.0 * * Copyright (c) 2021 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stdlib/strided/napi/dmskmap.h" #include "stdlib/math/base/special/ramp.h" STDLIB_STRIDED_NAPI_MODULE_DMSKMAP( stdlib_base_ramp )
/* Copyright 2010-2013 SourceGear, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * * @file sghash.h * * @details * */ ////////////////////////////////////////////////////////////////// #ifndef H_SGHASH_H #define H_SGHASH_H BEGIN_EXTERN_C; ////////////////////////////////////////////////////////////////// typedef struct _sghash_algorithm SGHASH_algorithm; typedef struct _sghash_handle SGHASH_handle; ////////////////////////////////////////////////////////////////// /** * Enumerate the various hash-methods that we support. * * Optionally copies the name of the nth hash-method into the supplied buffer. * If no buffer is supplied, the name is not returned. * * Optionally returns the string-length of a hash result. * This is the strlen() of a hash-result expressed as a hex digit string * (excluding the terminating NULL). THIS IS NOT THE LENGTH OF THE * BINARY VERSION OF THE HASH RESULT. * * For example, we may return: * "SHA1/160" and 40 * "SHA2/256" and 64. * * Returns SG_ERR_INDEXOUTOFRANGE if n exceeds the number of hash-methods defined. * Returns SG_ERR_INVALIDARG if the buffer isn't big enough to hold the name. * */ SG_error SGHASH_get_nth_hash_method_name(SG_uint32 n, char * pBufResult, SG_uint32 lenBuf, SG_uint32 * pStrlenHashes); /** * Return the string-length of a hash result using this hash-method. * This is the strlen() of a hash-result expressed as a hex digit string * (excluding the terminating NULL). THIS IS NOT THE LENGTH OF THE * BINARY VERSION OF THE HASH RESULT. * * The value after the "/" in the hash-method name is the bit-length * of a hash-result. So, for example, for "SHA1/160", we have * ((160 / 8) * 2) == 40 hex digits. * * Returns SG_ERR_UNKNOWN_HASH_METHOD if the given name does not match an * available hash-method. */ SG_error SGHASH_get_hash_length(const char * pszHashMethod, SG_uint32 * pStrlenHashes); /** * Begin a hash computation using the named hash-method. * If no hash-method is provided, we use the default hash-method (currently "SHA2/256"). * * A hash handled is ALLOCATED and RETURNED. You own this. Call SGHASH_final() or * SGHASH_abort() to free it. * * Returns SG_ERR_UNKNOWN_HASH_METHOD if the given name does not match an * available hash-method. */ SG_error SGHASH_init(const char * pszHashMethod, SGHASH_handle ** ppHandle); /** * Add content to the hash. */ SG_error SGHASH_update(SGHASH_handle * pHandle, const SG_byte * pBuf, SG_uint32 lenBuf); /** * Finish the hash computation and ALLOCATE and fill the provided buffer * with a hex digit string representation of the hash result. The provided * buffer must at least (strlen-hashes + 1). * * The hash handle is freed and your pointer is nulled. */ SG_error SGHASH_final(SGHASH_handle ** ppHandle, char * pBufResult, SG_uint32 lenBuf); /** * Abandon a hash computation and free the hash handle. Your pointer * is nulled. */ void SGHASH_abort(SGHASH_handle ** ppHandle); ////////////////////////////////////////////////////////////////// END_EXTERN_C; #endif//H_SGHASH_H
#include<stdio.h> #define MAXLINEA 1000 /*maximo tamano de una linea*/ /*definicion de variables externas*/ int max; char linea[MAXLINEA]; char linea_max[MAXLINEA]; /*Prototipo de funciones:*/ int obtenlinea(void); void copia(void); /*imprime la linea con tamano mas grande*/ int main(void){ int longitud; extern int max; extern char linea_max[MAXLINEA]; max=0; printf(" --- Ejercio 2.c modificando el codigo de 2.a---- "); while((longitud = obtenlinea()) > 0) if( longitud > 80){ //max = longitud; copia(); printf("%s", linea_max); } //if(max > 0) // printf("%s", linea_max); return 0; } /*obtenlinea: lee una linea en el arreglo linea, regresa longitud*/ int obtenlinea(void){ int c; int i; extern char linea[]; for(i=0; i < MAXLINEA-1 && (c=getchar())!=EOF && c!= '\n'; i++) linea[i] = c; if(c == '\n'){ linea[i] = c; i++; } linea[i]='\0'; //este caracter es necesario para almacenar strings return i; } /*copia: copia del arreglo "linea" al arreglo "linea_max"*/ void copia(void){ int i; extern char linea[], linea_max[]; i=0; while(linea[i] != '\0'){ linea_max[i] = linea[i]; //if(linea_max[i] == '\0') break; i++; } }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* * THE FILE HAS BEEN AUTOGENERATED BY THE IJH TOOL. * Please be aware that all changes made to this file manually * will be overwritten by the tool if it runs again. */ #include <jni.h> /* Header for class org.apache.harmony.test.stress.jni.stack.StackTest5 */ #ifndef _ORG_APACHE_HARMONY_TEST_STRESS_JNI_STACK_STACKTEST5_H #define _ORG_APACHE_HARMONY_TEST_STRESS_JNI_STACK_STACKTEST5_H #ifdef __cplusplus extern "C" { #endif /* Static final fields */ #undef org_apache_harmony_test_stress_jni_stack_StackTest5_TM_ERROR_NONE #define org_apache_harmony_test_stress_jni_stack_StackTest5_TM_ERROR_NONE 0L #undef org_apache_harmony_test_stress_jni_stack_StackTest5_TM_ERROR_INTERRUPT #define org_apache_harmony_test_stress_jni_stack_StackTest5_TM_ERROR_INTERRUPT 52L #undef org_apache_harmony_test_stress_jni_stack_StackTest5_TM_ERROR_ILLEGAL_STATE #define org_apache_harmony_test_stress_jni_stack_StackTest5_TM_ERROR_ILLEGAL_STATE 118L /* Native methods */ /* * Method: org.apache.harmony.test.stress.jni.stack.StackTest5.nativeMethod([IIII)[I */ JNIEXPORT jintArray JNICALL Java_org_apache_harmony_test_stress_jni_stack_StackTest5_nativeMethod(JNIEnv *, jclass, jintArray, jint, jint, jint); /* * Method: org.apache.harmony.test.stress.jni.stack.StackTest5.init(I)V */ JNIEXPORT void JNICALL Java_org_apache_harmony_test_stress_jni_stack_StackTest5_init(JNIEnv *, jobject, jint); #ifdef __cplusplus } #endif #endif /* _ORG_APACHE_HARMONY_TEST_STRESS_JNI_STACK_STACKTEST5_H */
/* -------------------------------------------------------------------------- */ /* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ /* */ /* 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 IMAGE_TEMPLATE_H_ #define IMAGE_TEMPLATE_H_ #include "Template.h" using namespace std; /** * Image Template class, it represents the attributes of an Image */ class ImageTemplate : public Template { public: ImageTemplate() : Template(true,'=',"TEMPLATE"){}; ImageTemplate(const ImageTemplate& tmpl):Template(tmpl){}; ~ImageTemplate(){}; /** * Checks the template for RESTRICTED ATTRIBUTES * @param rs_attr the first restricted attribute found if any * @return true if a restricted attribute is found in the template */ bool check(string& rs_attr) { return Template::check(rs_attr, restricted_attributes); }; /** * Deletes all restricted attributes */ void remove_restricted() { Template::remove_restricted(restricted_attributes); }; /** * Deletes all the attributes, except the restricted ones */ void remove_all_except_restricted() { Template::remove_all_except_restricted(restricted_attributes); }; bool is_saving() { bool save_as_hot; get("SAVE_AS_HOT", save_as_hot); return save_as_hot; } void set_saving() { replace("SAVE_AS_HOT", "YES"); } private: friend class ImagePool; static vector<string> restricted_attributes; bool has_restricted() { return restricted_attributes.size() > 0; }; /** * Stores the attributes as restricted, these attributes will be used in * ImageTemplate::check * @param rattrs Attributes to restrict */ static void set_restricted_attributes(vector<const Attribute *>& rattrs) { Template::set_restricted_attributes(rattrs, restricted_attributes); }; }; /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ #endif /*IMAGE_TEMPLATE_H_*/
// // UMComLoginManager.h // UMCommunity // // Created by Gavin Ye on 8/25/14. // Copyright (c) 2014 Umeng. All rights reserved. // #import <Foundation/Foundation.h> #import "UMComLoginUser.h" #import "UMComShareDelegate.h" @interface UMComShareManager : NSObject /********************UMComFirstTimeHandelerDelegate*******************/ /** 获取处理登录完后的逻辑的实现代理 */ @property (nonatomic, strong) id<UMComShareDelegate> shareHadleDelegate; + (UMComShareManager *)shareInstance; /** 处理SSO跳转回来之后的url */ + (BOOL)handleOpenURL:(NSURL *)url; @end
/* Copyright 2018 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef RESONANCE_AUDIO_AMBISONICS_AMBISONIC_CODEC_H_ #define RESONANCE_AUDIO_AMBISONICS_AMBISONIC_CODEC_H_ #include <vector> #include "base/audio_buffer.h" #include "base/spherical_angle.h" namespace vraudio { // An encoder/decoder for ambisonic sound fields. It supports variable ambisonic // order, ACN channel sequencing and SN3D normalization. class AmbisonicCodec { public: virtual ~AmbisonicCodec() {} // Encodes the given buffer of decoded vectors (unencoded data). // // @param input |AudioBuffer| of decoded (unencoded) data. // @param output |AudioBuffer| to store the encoded data. virtual void EncodeBuffer(const AudioBuffer& input, AudioBuffer* output) = 0; // Decodes the given |AudioBuffer| of planar (non-interleaved) encoded data. // // @param input |AudioBuffer| of encoded data. // @param output |AudioBuffer| to store the decoded data. virtual void DecodeBuffer(const AudioBuffer& input, AudioBuffer* output) = 0; // Returns the maximum periphonic ambisonic order that this codec supports. virtual int ambisonic_order() const = 0; // Returns the number of angles for this codec. virtual size_t num_angles() const = 0; // Returns the maximum number of spherical harmonics computed by this codec. virtual size_t num_spherical_harmonics() const = 0; // Returns the spherical angles currently used to define the encoder/decoder // matrices. virtual const std::vector<SphericalAngle>& angles() const = 0; // Sets the spherical angles used to build the encoder/decoder matrices. virtual void set_angles(const std::vector<SphericalAngle>& angles) = 0; }; } // namespace vraudio #endif // RESONANCE_AUDIO_AMBISONICS_AMBISONIC_CODEC_H_
// // TalkingProtocol.h // ObjectivecStudy // // Created by Jinyanhua on 14-3-9. // Copyright (c) 2014年 com.xysoft. All rights reserved. // #import <Foundation/Foundation.h> @protocol TalkingProtocol -(NSString *) getTalkPersonName:(NSString*) name; @optional -(NSNumber *) getConversationPersons; @end
// Copyright (C) 2013-2014, Infthink (Beijing) Technology Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import <UIKit/UIKit.h> #import <MediaPlayer/MediaPlayer.h> #import "MatchstickDeviceController.h" #import "Media.h" /** * A view to play media locally, when not connected to the Matchstick device. */ @interface LocalPlayerViewController : UIViewController<MatchstickControllerDelegate> /** The media object being played on Matchstick device. Set this before presenting the view. */ @property(strong, nonatomic) Media *mediaToPlay; /** An outlet to bind to media description. */ @property(weak, nonatomic) IBOutlet UITextView *mediaDescription; /** An outlet to bind to media title. */ @property(weak, nonatomic) IBOutlet UILabel *mediaTitle; /** An outlet to bind to media subtitle. */ @property(weak, nonatomic) IBOutlet UILabel *mediaSubtitle; @end
#pragma once class Int16 { public: Int16(); ~Int16(); };
#ifndef TITLEWIDGET_H #define TITLEWIDGET_H #include <QWidget> #include <QMainWindow> #include <QPaintEvent> #include <QPainter> #include "toolbutton.h" namespace Ui { class TitleWidget; } class TitleWidget : public QWidget { Q_OBJECT public: explicit TitleWidget(QWidget *parent = 0); ~TitleWidget(); QList<ToolButton *> button_list; private: Ui::TitleWidget *ui; protected: void paintEvent(QPaintEvent *); protected://鼠标移动窗口 QPoint press_point; bool is_move; void mousePressEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); void mouseReleaseEvent(QMouseEvent *); private slots: void turnPage(QString current_page); signals: void showMin(); void closeWindow(); }; #endif // TITLEWIDGET_H
/* * Copyright (C) 2011 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. */ #ifndef ANDROID_SURFACE_TEXTURE_LAYER_H #define ANDROID_SURFACE_TEXTURE_LAYER_H #include <stdlib.h> #include <stdint.h> #include <sys/types.h> #include <utils/Errors.h> #include <gui/BufferQueue.h> namespace android { // --------------------------------------------------------------------------- class Layer; class SurfaceFlinger; /* * This is a thin wrapper around BufferQueue, used by the Layer class. */ class SurfaceTextureLayer : public BufferQueue { sp<SurfaceFlinger> flinger; public: SurfaceTextureLayer(const sp<SurfaceFlinger>& flinger, const sp<Layer>& layer); virtual ~SurfaceTextureLayer(); bool usehwinit; wp<Layer> mLayer; virtual status_t disconnect(int api); virtual int setParameter(uint32_t cmd,uint32_t value); virtual uint32_t getParameter(uint32_t cmd); }; // --------------------------------------------------------------------------- }; // namespace android #endif // ANDROID_SURFACE_TEXTURE_LAYER_H
/*-------------------------------------------------------------------------- Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 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 __OMX_VENC__H #define __OMX_VENC__H #include <unistd.h> #include "omx_video_base.h" #include "video_encoder_device.h" extern "C" { OMX_API void * get_omx_component_factory_fn(void); } class omx_venc: public omx_video { public: omx_venc(); //constructor ~omx_venc(); //des static int async_message_process (void *context, void* message); OMX_ERRORTYPE component_init(OMX_STRING role); OMX_ERRORTYPE set_parameter(OMX_HANDLETYPE hComp, OMX_INDEXTYPE paramIndex, OMX_PTR paramData); OMX_ERRORTYPE set_config(OMX_HANDLETYPE hComp, OMX_INDEXTYPE configIndex, OMX_PTR configData); OMX_ERRORTYPE component_deinit(OMX_HANDLETYPE hComp); //OMX strucutres OMX_U32 m_nVenc_format; class venc_dev *handle; private: OMX_U32 dev_stop(void); OMX_U32 dev_pause(void); OMX_U32 dev_start(void); OMX_U32 dev_flush(unsigned); OMX_U32 dev_resume(void); bool dev_use_buf( void *,unsigned); bool dev_free_buf( void *,unsigned); bool dev_empty_buf(void *, void *); bool dev_fill_buf(void *, void *); bool dev_get_buf_req(OMX_U32 *,OMX_U32 *,OMX_U32 *,OMX_U32); bool dev_set_buf_req(OMX_U32 *,OMX_U32 *,OMX_U32 *,OMX_U32); bool update_profile_level(); }; #endif //__OMX_VENC__H
/* * Copyright (C) 2015 University of Oregon * * You may distribute under the terms of either the GNU General Public * License or the Apache License, as specified in the LICENSE file. * * For more information, see the LICENSE file. */ /* GLOBAL.H - RSAREF types and constants */ /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. */ #ifndef PROTOTYPES #define PROTOTYPES 0 #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word */ typedef unsigned long int UINT4; /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/lakeformation/LakeFormation_EXPORTS.h> #include <aws/lakeformation/LakeFormationRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace LakeFormation { namespace Model { /** */ class AWS_LAKEFORMATION_API GetDataLakeSettingsRequest : public LakeFormationRequest { public: GetDataLakeSettingsRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "GetDataLakeSettings"; } Aws::String SerializePayload() const override; /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline const Aws::String& GetCatalogId() const{ return m_catalogId; } /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline bool CatalogIdHasBeenSet() const { return m_catalogIdHasBeenSet; } /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline void SetCatalogId(const Aws::String& value) { m_catalogIdHasBeenSet = true; m_catalogId = value; } /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline void SetCatalogId(Aws::String&& value) { m_catalogIdHasBeenSet = true; m_catalogId = std::move(value); } /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline void SetCatalogId(const char* value) { m_catalogIdHasBeenSet = true; m_catalogId.assign(value); } /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline GetDataLakeSettingsRequest& WithCatalogId(const Aws::String& value) { SetCatalogId(value); return *this;} /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline GetDataLakeSettingsRequest& WithCatalogId(Aws::String&& value) { SetCatalogId(std::move(value)); return *this;} /** * <p>The identifier for the Data Catalog. By default, the account ID. The Data * Catalog is the persistent metadata store. It contains database definitions, * table definitions, and other control information to manage your Lake Formation * environment. </p> */ inline GetDataLakeSettingsRequest& WithCatalogId(const char* value) { SetCatalogId(value); return *this;} private: Aws::String m_catalogId; bool m_catalogIdHasBeenSet; }; } // namespace Model } // namespace LakeFormation } // namespace Aws
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <assert.h> #include <exception> // System.Reflection.Emit.ParameterBuilder struct ParameterBuilder_t3159962230; // System.String struct String_t; #include "codegen/il2cpp-codegen.h" // System.Int32 System.Reflection.Emit.ParameterBuilder::get_Attributes() extern "C" int32_t ParameterBuilder_get_Attributes_m2640139997 (ParameterBuilder_t3159962230 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.String System.Reflection.Emit.ParameterBuilder::get_Name() extern "C" String_t* ParameterBuilder_get_Name_m1429816234 (ParameterBuilder_t3159962230 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Reflection.Emit.ParameterBuilder::get_Position() extern "C" int32_t ParameterBuilder_get_Position_m388196207 (ParameterBuilder_t3159962230 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
#include <iostream> #include "Vector.h" #ifndef __SEPENTITY__ #define __SEPENTITY__ namespace sep { /** * The active Physics Properties that an object can have */ class PhysicsProperties { public: /** * The constructor for PhysicsProperties * * @param gravity Whether gravity is enabled for this object Default: true * @param collision Whether collisions are active in this object Default: true * @param rigidBody Whether an object has rigid body transformations (like rotating down a hill as a sphere) Default: true * @param otherPhysics Whether an alternate act of physics is taken into account Deafult: true **/ PhysicsProperties(bool gravity = true, bool collision = true, bool rigidBody = true, bool otherPhysics = true); /** * The destructor for PhysicProperties **/ ~PhysicsProperties(); /** * Toggles whether gravity is active or not * * @return Whether gravity is currently enabled **/ bool ToggleGravity(); /** * Toggles whether collision detection is active * * @return Whether collisions are currently active **/ bool ToggleCollision(); /** * Toggles whether Rigid Body transformations are possible * * @return Whether rigid bodies for this object are active **/ bool ToggleRigidBody(); /** * Toggles whether physics are possible for this object * * @return Whether physics for this object are active **/ bool TogglePhysics(); /** * Toggles whether alternate nondescribe physics are possible * * @return Whether alternate nondescribe physics for this object are active **/ bool ToggleAlternatePhysics(); /** * Returns whether gravity is enabled or not * * @return If gravity is active for this object **/ bool HasGravity(); /** * Returns whether collisions are enabled or not * * @return If collisions are active for this object **/ bool HasCollision(); /** * Returns whether rigid body transformations are enabled or not * * @return If rigid body transformations are active for this object **/ bool HasRigidBody(); /** * Returns whether alternate nondescribe physics are enabled or not * * @return If alternate nondescribe physics are active for this object **/ bool UsesAlternatePhysics(); private: bool gravity; bool collision; bool rigidBody; bool otherPhysics; }; /** * The physic holder for entities * **/ class PhysicsState { public: /** * The constructor of PhysicsState * * @param position The position this state holds for its object * @param rotation The rotation(recommended in degrees) this state holds for its object * @param velocity The velocity this state holds for its object (increases the position according to its states) * @param acceleration The acceleration this state holds for it object (increases the velocity according to it state) * @param pProps The PhysicsState current physical properties to apply to thos object */ PhysicsState(seu::Vector position = seu::Vector(), seu::Vector rotation = seu::Vector(), seu::Vector velocity = seu::Vector(), seu::Vector acceleration = seu::Vector(), PhysicsProperties pProps = PhysicsProperties()); /** * The deconstructor of PhysicsState */ ~PhysicsState(); seu::Vector position; ///< The States' current position seu::Vector rotation; ///< The States' current rotation seu::Vector velocity; ///< The States' current velocity seu::Vector acceleration; ///< The States' current acceleration PhysicsProperties physicsProps; ///< The properties for this physics state }; class PhysicsEntity { public: /** * The constructor of PhysicsEntity * * @param state The PhysicsState that represents this entity */ PhysicsEntity(PhysicsState state); /** * The deconstructor of PhysicsEntity */ ~PhysicsEntity(); /** * The function that updates the this PhysicsEntity */ void Update(); PhysicsState pState; ///< The PhysicsState that represents this entity }; } #endif /* defined(__SEPENTITY__) */
/* * Copyright 2015 Wink Saville * * 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 <ac_putchar.h> int main(void) { ac_putchar('O'); ac_putchar('K'); ac_putchar('\n'); return 0; }
#include <stdbool.h> #include <stdio.h> #include "lcd.h" #include "menu.h" #include "menu_items.h" /* ** Callback functions menu */ /************************************************************************* Universal callback *************************************************************************/ void menuUniversalCallbackRender(uint8_t which){ char buf[60]; snprintf(buf, 60, "Clicked callback.\nLine %d clicked.", which + 1); lcd_clrscr(); lcd_puts(buf); } bool menuUniversalCallback(MENU_BUTTON *button, uint8_t column){ switch(button->role){ case MENU_UP: break; case MENU_DOWN: break; case MENU_CONFIRM: break; case MENU_CANCEL: return true; } menuUniversalCallbackRender(column); return false; } /************************************************************************* Submenu custom callback *************************************************************************/ static int submenu_number = 0; void submenu3ActionCallbackRender(uint8_t which){ char buf[80]; snprintf(buf, 80, "Press UP or DOWN to\nchange number:\n%d", submenu_number); lcd_clrscr(); lcd_puts(buf); } bool submenu3ActionCallback(MENU_BUTTON *button, uint8_t column){ switch(button->role){ case MENU_UP: ++submenu_number; break; case MENU_DOWN: --submenu_number; break; case MENU_CONFIRM: return true; case MENU_CANCEL: return true; } char buf[80]; snprintf(buf, 80, "Press UP or DOWN to\nchange number:\n%d", submenu_number); lcd_clrscr(); lcd_puts(buf); return false; } /************************************************************************* Submenu custom callback *************************************************************************/ void submenu3PrintCallbackRender(uint8_t which){ char buf[80]; snprintf(buf, 80, "Custom message\nfor sub menu."); lcd_clrscr(); lcd_puts(buf); } bool submenu3PrintCallback(MENU_BUTTON *button, uint8_t column){ switch(button->role){ case MENU_UP: break; case MENU_DOWN: break; case MENU_CONFIRM: return true; case MENU_CANCEL: return true; } submenu3PrintCallbackRender(column); return false; } /************************************************************************* Menu 1, sub sub submenu definition *************************************************************************/ # define SUBMENU_3_ITEMS 3 static MENU_ITEM submenu_3[SUBMENU_3_ITEMS] = { {"Action", submenu3ActionCallbackRender, submenu3ActionCallback, 0, NULL}, {"Print", submenu3PrintCallbackRender, submenu3PrintCallback, 0, NULL}, {"Empty 1", NULL, NULL, 0, NULL} }; /************************************************************************* Menu 1, sub submenu definition *************************************************************************/ # define SUBMENU_2_ITEMS 4 static MENU_ITEM submenu_2[SUBMENU_2_ITEMS] = { {"Submenu", NULL, NULL, SUBMENU_3_ITEMS, submenu_3}, {"Empty 1", NULL, NULL, 0, NULL}, {"Action", menuUniversalCallbackRender, menuUniversalCallback, 0, NULL}, {"Empty 2", NULL, NULL, 0, NULL} }; /************************************************************************* Menu 1, submenu definition *************************************************************************/ # define MENU_1_SUBMENU_ITEMS 2 static MENU_ITEM menu_1_submenu[MENU_1_SUBMENU_ITEMS] = { {"Action", menuUniversalCallbackRender, menuUniversalCallback, 0, NULL }, {"Submenu", NULL, NULL, SUBMENU_2_ITEMS, submenu_2} }; /* ** HOME menu items definition */ #define MENU_HOME_ITEMS 10 static MENU_ITEM home_items[MENU_HOME_ITEMS] = { {"Menu 1", NULL, NULL, MENU_1_SUBMENU_ITEMS, menu_1_submenu}, {"Menu 2", menuUniversalCallbackRender, menuUniversalCallback, 0, NULL }, {"Menu 3", NULL, NULL, 0, NULL }, {"Menu 4", NULL, NULL, 0, NULL }, {"Menu 5", NULL, NULL, 0, NULL }, {"Menu 6", NULL, NULL, 0, NULL }, {"Menu 7", NULL, NULL, 0, NULL }, {"Menu 8", NULL, NULL, 0, NULL }, {"Menu 9", NULL, NULL, 0, NULL }, {"Menu 10", NULL, NULL, 0, NULL } }; /* ** Public methods to access home view and home view size */ MENU_ITEM *menuItemsGetHomeMenu(){ return home_items; } uint8_t menuItemsGetHomeMenuSize(){ return MENU_HOME_ITEMS; }
#ifndef HttpClient_h #define HttpClient_h #include "Arduino.h" #include "Client.h" class HttpClient{ public: HttpClient(Client& cl); //Les status que peut prendre la connection HTTP typedef enum { HTTP_STATUS_IDLE, //Aucune requete http en cours HTTP_STATUS_RESP_WAIT, //En attente de la réponse HTTP_STATUS_RESP_BEGIN, //Au début de la réponse (avant HTTP/1.1) HTTP_STATUS_RESP_HEADER, //Au début d'une ligne d'en-tête HTTP_STATUS_RESP_BODY, //Corps de la réponse HTTP_STATUS_ERROR, //Une erreur est survenue HTTP_STATUS_EOF //La fin de fichier a été atteinte } HttpState; //Les codes retours possibles (négatifs pour les différencier du nombre de caractères que peuvent renvoyer certaines fonctions) #define HTTP_ERROR -2 #define HTTP_ERROR_BUFFER_OVERFLOW -3 #define HTTP_ERROR_TIMEOUT -4 #define HTTP_ERROR_CONNECTION_FAILED -5 #define HTTP_ERROR_STATUS -6 #define HTTP_DEFAULT_TIMEOUT 3000; //Timeout http par défaut HttpState status; //Status courant de la connection void reset(); void close(); void setTimeout(int millis); void setDebug(boolean debug); //int sendGet(char* server, int port, char* path); int sendGet(char* server, int port, char* path, char* params); int readResponseCode(); int readLineToChar(char sep, char* key,int maxlen); int skipHeaders(); int moveToEOL(); int available(); int waitForResponse(); int httpRead(); protected: Client* client; //Interface Client (ethernet, GSM, Wifi ...) int print(char* str); int println(char* str); boolean connect(char* serv, int port); int error(int err); private: int startMillis; //timestamp de démarrage de la requete en cours (sert pour le timeout) int timeout; //configuration de timeout en cours boolean debug; boolean lastConnected; }; #endif
/** * ClassroomPlus ClassroomPlus License * This source code and all modifications done by ClassroomPlus * are licensed under the Apache Public License (version 2) and * are Copyright (c) 2009-2014 by ClassroomPlus, Inc. */ /* * Copyright (C) 2013 Apple 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 TiManagedValue_h #define TiManagedValue_h #import <JavaScriptCore/TiBase.h> #if JSC_OBJC_API_ENABLED @class TiValue; @class TiContext; /*! @interface @discussion TiManagedValue represents a "conditionally retained" TiValue. "Conditionally retained" means that as long as either the TiManagedValue's JavaScript value is reachable through the JavaScript object graph or the TiManagedValue object is reachable through the external Objective-C object graph as reported to the TiVirtualMachine using addManagedReference:withOwner:, the corresponding JavaScript value will be retained. However, if neither of these conditions are true, the corresponding TiValue will be released and set to nil. The primary use case for TiManagedValue is for safely referencing TiValues from the Objective-C heap. It is incorrect to store a TiValue into an Objective-C heap object, as this can very easily create a reference cycle, keeping the entire TiContext alive. */ NS_CLASS_AVAILABLE(10_9, 7_0) @interface TiManagedValue : NSObject /*! @method @abstract Create a TiManagedValue from a TiValue. @param value @result The new TiManagedValue. */ + (TiManagedValue *)managedValueWithValue:(TiValue *)value; /*! @method @abstract Create a TiManagedValue. @param value @result The new TiManagedValue. */ - (instancetype)initWithValue:(TiValue *)value; /*! @property @abstract Get the TiValue from the TiManagedValue. @result The corresponding TiValue for this TiManagedValue or nil if the TiValue has been collected. */ @property (readonly, strong) TiValue *value; @end #endif // JSC_OBJC_API_ENABLED #endif // TiManagedValue_h
/** * * .. invisible: * _ _ _____ _ _____ _____ * * | | | | ___| | | ___/ ___| * * | | | | |__ | | | |__ \ `--. * * | | | | __|| | | __| `--. \ * * \ \_/ / |___| |___| |___/\__/ / * * \___/\____/\_____|____/\____/ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License * */ #ifndef SCHEMA_FEATURE_CALCULATOR #define SCHEMA_FEATURE_CALCULATOR #include <vector> #include <string> #include <memory> #include <unordered_set> #include <map> #include "IFeatureCalculator.h" using std::vector; using std::string; using std::wstring; using std::shared_ptr; using std::unordered_set; using std::map; namespace Disambiguation { wstring GetUnitedLabel( const vector<wstring>& labels); wstring GetUnitedPOS( const vector<wstring>& labels); enum SchemaType { TOKEN_PLUS_PUNCUATION , TOKEN , UNITED_MORPHOLOGY_PLUS_PUNCTUATION , UNITED_MORPHOLOGY , UNITED_POS_PLUS_PUNCTUATION , UNITED_POS , PUNCTUATION , EMPTY }; struct Schema { vector<int> relativeDistances; vector<SchemaType> schemaTypes; Schema(const vector<int>& relativeDistances, const vector<SchemaType>& schemaTypes); Schema(vector<int>&& relativeDistances, vector<SchemaType>&& schemaTypes); }; class SchemaFeatureCalculatorRus : public IFeatureCalculator { public: SchemaFeatureCalculatorRus( shared_ptr<IFeatureCalculator> simpleFeatureCalculatorRus); vector<PredisambiguatedData> CalculateFeatures( const vector<Tokenization::Token>& sentence) const; private: shared_ptr<IFeatureCalculator> simpleFeatureCalculatorRus; vector<Schema> schemas; void initializeSchemas(); void calculateSchemaFeatures( const vector<PredisambiguatedData>& data , map<SchemaType, vector<wstring> >* schemaFeatures) const; wstring calculateSchema(int tokenIndex , const map<SchemaType, vector<wstring> >& schemaFeatures , const Schema& schema, int sentenceLength) const; }; }; #endif // SCHEMA_FEATURE_CALCULATOR
//****************************************************************** // // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved. // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #ifndef OC_LOGGER_TYPES_H_ #define OC_LOGGER_TYPES_H_ #include <stddef.h> #ifdef __cplusplus extern "C" { #endif typedef enum { OC_LOG_MIN_VAL__ = -1, OC_LOG_ALL = 0, OC_LOG_FATAL, OC_LOG_ERROR, OC_LOG_WARNING, OC_LOG_INFO, OC_LOG_DEBUG, OC_LOG_DISABLED, OC_LOG_MAX_VAL__ } oc_log_level; typedef struct _oc_log_ctx { void *ctx; oc_log_level log_level; char *module_name; /* Required interface: */ int (*init)(struct _oc_log_ctx *, void *); void (*destroy)(struct _oc_log_ctx *); void (*flush)(struct _oc_log_ctx *); void (*set_level)(struct _oc_log_ctx *, const int); size_t (*write_level)(struct _oc_log_ctx *, const int, const char *); int (*set_module)(struct _oc_log_ctx *, const char *); /* Optional interface (if one is implemented, all must be implemented): */ int (*lock)(struct _oc_log_ctx *); int (*unlock)(struct _oc_log_ctx *); int (*try_lock)(struct _oc_log_ctx *); int (*locked_destroy)(struct _oc_log_ctx *); } oc_log_ctx_t; /* Notice that these are all passed the /top level/ ctx-- it's "public" with respect to these functions, they have full access to fiddle with the structure all they want (but, generally should avoid doing that); I could certainly be convinced to go the other direction, and have most functions only take the inner context: */ typedef int (*oc_log_init_t)(oc_log_ctx_t *, void *); typedef void (*oc_log_destroy_t)(oc_log_ctx_t *); typedef void (*oc_log_flush_t)(oc_log_ctx_t *); typedef void (*oc_log_set_level_t)(oc_log_ctx_t *, const int); typedef size_t (*oc_log_write_level_t)(oc_log_ctx_t *, const int, const char *); typedef int (*oc_log_set_module_t)(oc_log_ctx_t *, const char *); typedef int (*oc_log_lock_t)(oc_log_ctx_t *); typedef int (*oc_log_unlock_t)(oc_log_ctx_t *); typedef int (*oc_log_try_lock_t)(oc_log_ctx_t *); #ifdef __cplusplus } // extern "C" #endif #endif
/* * This file is part of the Camera Streaming Daemon * * Copyright (C) 2017 Intel Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <arpa/inet.h> #include "pollable.h" struct buffer { unsigned int len; uint8_t *data; }; class Socket : public Pollable { public: Socket(); virtual ~Socket(); int write(const struct buffer &buf, const struct sockaddr_in &sockaddr); void set_read_callback( std::function<void(const struct buffer &buf, const struct sockaddr_in &sockaddr)> cb); protected: bool _can_read() override; bool _can_write() override; virtual int _do_write(const struct buffer &buf, const struct sockaddr_in &sockaddr) = 0; virtual int _do_read(const struct buffer &buf, struct sockaddr_in &sockaddr) = 0; private: std::function<void(const struct buffer &buf, const struct sockaddr_in &sockaddr)> _read_cb; struct buffer _write_buf; struct sockaddr_in sockaddr_buf {}; }; class UDPSocket : public Socket { public: UDPSocket(); ~UDPSocket(); int open(bool broadcast); void close(); int bind(const char *addr, unsigned long port); protected: int _do_write(const struct buffer &buf, const struct sockaddr_in &sockaddr) override; int _do_read(const struct buffer &buf, struct sockaddr_in &sockaddr) override; };
/****************************************************************************** * Copyright 2018 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #pragma once #include "modules/perception/inference/tensorrt/rt_common.h" namespace apollo { namespace perception { namespace inference { class SoftmaxPlugin : public nvinfer1::IPlugin { public: SoftmaxPlugin(const SoftmaxParameter &param, nvinfer1::Dims in_dims) { input_dims_.nbDims = in_dims.nbDims; for (int i = 0; i < in_dims.nbDims; i++) { input_dims_.d[i] = in_dims.d[i]; input_dims_.type[i] = in_dims.type[i]; } axis_ = param.axis() - 1; CHECK_GE(axis_, 0); CHECK_LE(axis_ + 1, input_dims_.nbDims); inner_num_ = 1; for (int i = axis_ + 1; i < input_dims_.nbDims; i++) { inner_num_ *= input_dims_.d[i]; } outer_num_ = 1; for (int i = 0; i < axis_; i++) { outer_num_ *= input_dims_.d[i]; } cudnnCreateTensorDescriptor(&input_desc_); cudnnCreateTensorDescriptor(&output_desc_); } SoftmaxPlugin() {} ~SoftmaxPlugin() { cudnnDestroyTensorDescriptor(input_desc_); cudnnDestroyTensorDescriptor(output_desc_); } virtual int initialize() { cudnnCreate(&cudnn_); // initialize cudnn and cublas cublasCreate(&cublas_); return 0; } virtual void terminate() { cublasDestroy(cublas_); cudnnDestroy(cudnn_); } int getNbOutputs() const override { return 1; } nvinfer1::Dims getOutputDimensions(int index, const nvinfer1::Dims *inputs, int nbInputDims) override { nvinfer1::Dims out_dims = inputs[0]; return out_dims; } void configure(const nvinfer1::Dims *inputDims, int nbInputs, const nvinfer1::Dims *outputDims, int nbOutputs, int maxBatchSize) override { input_dims_ = inputDims[0]; } size_t getWorkspaceSize(int maxBatchSize) const override { return 0; } int enqueue(int batchSize, const void *const *inputs, void **outputs, void *workspace, cudaStream_t stream) override; size_t getSerializationSize() override { return 0; } void serialize(void *buffer) override { char *d = reinterpret_cast<char *>(buffer), *a = d; size_t size = getSerializationSize(); CHECK_EQ(d, a + size); } private: cudnnHandle_t cudnn_; cublasHandle_t cublas_; nvinfer1::Dims input_dims_; int axis_; int inner_num_; int outer_num_; cudnnTensorDescriptor_t input_desc_; cudnnTensorDescriptor_t output_desc_; }; } // namespace inference } // namespace perception } // namespace apollo
// // ZJLrcLine.h // 音乐播放器 // // Created by liii on 15/12/3. // Copyright © 2015年 liii. All rights reserved. // #import <Foundation/Foundation.h> @interface ZJLrcLine : NSObject /** 每行歌词对应的播放时间 */ @property (nonatomic, copy) NSString *time; /** 每行歌词对应歌词内容 */ @property (nonatomic, copy) NSString *text; @end
#ifndef _ULCER_HLIST_H_ #define _ULCER_HLIST_H_ #include "config.h" typedef struct hlist_node_s { struct hlist_node_s *next; struct hlist_node_s **pprev; } hlist_node_t; typedef struct hlist_s { struct hlist_node_s *first; } hlist_t; static bool __hlist_is_empty__(hlist_t *hlist) { return (!hlist->first); } static void __hlist_move__(hlist_t *o, hlist_t *n) { n->first = o->first; if (n->first) { n->first->pprev = &n->first; } o->first = NULL; } static void __hlist_insert__(hlist_t *hlist, hlist_node_t *node) { hlist_node_t *first = hlist->first; node->next = first; if (first) { first->pprev = &node->next; } hlist->first = node; node->pprev = &hlist->first; } static void hlist_remove(hlist_node_t *node) { hlist_node_t *next = node->next; hlist_node_t **pprev = node->pprev; *pprev = next; if (next) { next->pprev = pprev; } } static void hlist_insert_front(hlist_node_t *next, hlist_node_t *node) { node->next = next; node->pprev = next->pprev; next->pprev = &node->next; *(node->pprev) = node; } static void hlist_insert_back(hlist_node_t *prev, hlist_node_t *node) { node->next = prev->next; prev->next = node; node->pprev = &prev->next; if (node->next) { node->next->pprev = &node->next; } } static void hlist_replace(hlist_node_t *o, hlist_node_t *n) { hlist_insert_front(o, n); hlist_remove(o); } #define hlist_init(hlist) \ do { \ (&hlist)->first = NULL; \ } while (false) #define hlist_is_empty(hlist) \ __hlist_is_empty__(&(hlist)) #define hlist_insert(hlist, node) \ __hlist_insert__(&(hlist), (node)) #define hlist_move(o, n) \ __hlist_move__(&(o), &(n)) #define hlist_element(ptr, type, member) \ ((type)(((unsigned char*)(ptr)) - (unsigned char*)(&(((type)0)->member)))) #define hlist_for_each(hlist, it) \ for ((it) = (&(hlist))->first; (it); (it)=(it)->next) #define hlist_safe_for_each(hlist, it, nextit) \ for ((it) = (&(hlist))->first, (nextit) = (it)->next; \ (it); \ (it) = (nextit), \ (nextit) = (nextit) ? (nextit)->next : NULL) #endif
// // WGTitleItem.h // WeygoIPhone // // Created by muma on 2017/3/26. // Copyright © 2017年 weygo.com. All rights reserved. // #import "WGObject.h" #import "WGHome.h" @interface WGTitleItem : WGObject @property (nonatomic, assign) long long id; @property (nonatomic, strong) NSString *name; //for self use @property (nonatomic, strong) WGHome *data; @end
// // CBLForestBridge.h // CouchbaseLite // // Created by Jens Alfke on 5/1/14. // Copyright (c) 2014-2015 Couchbase, Inc. All rights reserved. // #import <CBForest/CBForest.hh> extern "C" { #import <CBForest/CBForest.hh> #import "CBL_Storage.h" } CBLStatus CBLStatusFromForestDBStatus(int fdbStatus); @interface CBLForestBridge : NSObject + (NSMutableDictionary*) bodyOfNode: (const forestdb::Revision*)revNode; + (CBL_MutableRevision*) revisionObjectFromForestDoc: (forestdb::VersionedDocument&)doc revID: (NSString*)revID withBody: (BOOL)withBody; + (CBL_MutableRevision*) revisionObjectFromForestDoc: (forestdb::VersionedDocument&)doc sequence: (forestdb::sequence)sequence withBody: (BOOL)withBody; /** Stores the body of a revision (including metadata) into a CBL_MutableRevision. */ + (BOOL) loadBodyOfRevisionObject: (CBL_MutableRevision*)rev doc: (forestdb::VersionedDocument&)doc; /** Returns the revIDs of all current leaf revisions, in descending order of priority. */ + (NSArray*) getCurrentRevisionIDs: (forestdb::VersionedDocument&)doc; /** Returns a revision & its ancestors as CBL_Revision objects, in reverse chronological order. */ + (NSArray*) getRevisionHistory: (const forestdb::Revision*)revNode; /** Returns the revision history as a _revisions dictionary, as returned by the REST API's ?revs=true option. If 'ancestorRevIDs' is present, the revision history will only go back as far as any of the revision ID strings in that array. */ + (NSDictionary*) getRevisionHistoryOfNode: (const forestdb::Revision*)revNode startingFromAnyOf: (NSArray*)ancestorRevIDs; @end
/* * Copyright (C) 2013 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. * * 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 CSSVariablesMap_h #define CSSVariablesMap_h #include "RuntimeEnabledFeatures.h" #include "wtf/RefCounted.h" #include "wtf/text/WTFString.h" namespace WebCore { class CSSStyleDeclaration; class ExceptionState; class CSSVariablesMap : public RefCounted<CSSVariablesMap> { public: virtual ~CSSVariablesMap() { } static PassRefPtr<CSSVariablesMap> create(CSSStyleDeclaration* styleDeclaration) { return adoptRef(new CSSVariablesMap(styleDeclaration)); } unsigned size() const; String get(const AtomicString& name) const; bool has(const AtomicString& name) const; void set(const AtomicString& name, const String& value, ExceptionState&) const; bool remove(const AtomicString& name) const; void clear(ExceptionState&) const; void clearStyleDeclaration() { m_styleDeclaration = 0; } private: explicit CSSVariablesMap(CSSStyleDeclaration* styleDeclaration) : m_styleDeclaration(styleDeclaration) { ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); } CSSStyleDeclaration* m_styleDeclaration; }; } // namespace WebCore #endif // CSSVariablesMap_h
#ifndef ANIMAL_HEADER #define ANIMAL_HEADER #include <iostream> #include <string> using namespace std; class animal { private: string name; int age; public: animal() = default; animal(string inname); void sayHello(); }; #endif
/* * Project: FullereneViewer * Version: 1.0 * Copyright: (C) 2011-15 Dr.Sc.KAWAMOTO,Takuji (Ext) */ #ifndef __PATTERN_H__ #define __PATTERN_H__ class Pattern { // friend classes & functions // members int p_length; int p_offset; int* p_pattern; // private tools // constructors & the destructor public: Pattern(int length, int* values); Pattern(int value0); Pattern(int value0, int value1); Pattern(int value0, int value1, int value2); Pattern(int value0, int value1, int value2, int value3); Pattern(int value0, int value1, int value2, int value3, int value4); Pattern(int value0, int value1, int value2, int value3, int value4, int value5); ~Pattern(); // type converters // comparators // math operators // I/O // class decision // member accessing methods public: int get_value_then_next(); }; #endif /* __PATTERN_H__ */ /* Local Variables: */ /* mode: c++ */ /* End: */
// // XXShieldSDK.h // XXShield // // Created by nero on 2017/1/18. // Copyright © 2017年 XXShield. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN typedef NS_OPTIONS(NSUInteger, EXXShieldType) { EXXShieldTypeUnrecognizedSelector = 1 << 1, EXXShieldTypeContainer = 1 << 2, EXXShieldTypeNSNull = 1 << 3, EXXShieldTypeKVO = 1 << 4, EXXShieldTypeNotification = 1 << 5, EXXShieldTypeTimer = 1 << 6, EXXShieldTypeDangLingPointer = 1 << 7, EXXShieldTypeExceptDangLingPointer = (EXXShieldTypeUnrecognizedSelector | EXXShieldTypeContainer | EXXShieldTypeNSNull| EXXShieldTypeKVO | EXXShieldTypeNotification | EXXShieldTypeTimer) }; @protocol XXRecordProtocol <NSObject> - (void)recordWithReason:(NSError *)reason; @end @interface XXShieldSDK : NSObject /** 注册汇报中心 @param record 汇报中心 */ + (void)registerRecordHandler:(id<XXRecordProtocol>)record; /** 注册SDK,默认只要开启就打开防Crash,如果需要DEBUG关闭,请在调用处使用条件编译 本注册方式不包含EXXShieldTypeDangLingPointer类型 */ + (void)registerStabilitySDK; /** 本注册方式不包含EXXShieldTypeDangLingPointer类型 @param ability ability */ + (void)registerStabilityWithAbility:(EXXShieldType)ability; /** ///注册EXXShieldTypeDangLingPointer需要传入存储类名的array,不支持系统框架类。 @param ability ability description @param classNames 野指针类列表 */ + (void)registerStabilityWithAbility:(EXXShieldType)ability withClassNames:(nonnull NSArray<NSString *> *)classNames; @end NS_ASSUME_NONNULL_END
// // UILabel+iconfont.h // IconFont // // Created by Tory imac on 2019/6/5. // Copyright © 2019 Taodiandian. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface UILabel (iconfont) /** 设置 icon @param iconName 图片名 @param size 大小,icon 都是方形的一张图片 @param color 颜色 */ - (void)iconName:(NSString *)iconName size:(CGFloat)size color:(UIColor *)color; @end NS_ASSUME_NONNULL_END
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #ifndef ARROW_PYTHON_BENCHMARK_H #define ARROW_PYTHON_BENCHMARK_H #include "arrow/python/platform.h" #include "arrow/util/visibility.h" namespace arrow { namespace py { namespace benchmark { // Micro-benchmark routines for use from ASV // Run PandasObjectIsNull() once over every object in *list* ARROW_EXPORT void Benchmark_PandasObjectIsNull(PyObject* list); } // namespace benchmark } // namespace py } // namespace arrow #endif // ARROW_PYTHON_BENCHMARK_H
// // AppDelegate.h // LineTest // // Created by luph on 15/8/7. // Copyright (c) 2015年 luph. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/* The system call implemented in this file: * m_type: SYS_IOPENABLE * * The parameters for this system call are: * m2_i2: IOP_ENDPT (process to give I/O Protection Level bits) * * Author: * Jorrit N. Herder <jnherder@cs.vu.nl> */ #include "kernel/system.h" #include "kernel/kernel.h" #include <minix/endpoint.h> #include "arch_proto.h" /*===========================================================================* * do_iopenable * *===========================================================================*/ int do_iopenable(struct proc * caller, message * m_ptr) { int proc_nr; #if 1 /* ENABLE_USERPRIV && ENABLE_USERIOPL */ if (m_ptr->IOP_ENDPT == SELF) { okendpt(caller->p_endpoint, &proc_nr); } else if(!isokendpt(m_ptr->IOP_ENDPT, &proc_nr)) return(EINVAL); enable_iop(proc_addr(proc_nr)); return(OK); #else return(EPERM); #endif }
// // JBCPError.h // BeacappSDKforiOS version2.0.0 // // Created by Akira Hayakawa on 2014/11/11. // Update by Akira Hayakawa on 2017/04 // Copyright (c) 2017年 JMA Systems Corp. All rights reserved. // #ifndef BeacappSDK_JPCPError_h #define BeacappSDK_JPCPError_h typedef NS_ENUM(NSUInteger, JBCPCode) { JBCPCodeSuccess = 0, // 成功 JBCPCodeInvalidActivationKey = 1000, // アクティベーションキーが不正 JBCPCodeNotInitializeYet = 1001, // SDK未初期化エラー JBCPCodeDBError = 1002, // DB関連のエラー JBCPCodeNetworkError = 1003, // ネットワークエラー JBCPCodeAccessCodeExpired = 1004, // アクセストークンの有効期限切れ JBCPCodeNotSupportedBlutooth = 1005, // デバイスをサポートしていない JBCPCodeInvalidSDKVersion = 1006, //バージョン違い JBCPCodeNeedsDelegateSet = 1007, // デリゲート未定義 JBCPCodeInvalidBackgroundRunning = 1008, //バックグラウンド実行はできない JBCPCodeInvalidData = 1009, // データ不整合 JBCPCodeCannotStartLocation = 1010, // 位置情報サービスが開始できない JBCPCodeAWSError = 1011, // AWSでエラーが発生した JBCPCodeAlreadyScanning = 1012, // すでにビーコンのスキャンを開始している JBCPCodeUnKnownError = 9999 // UnknownError }; #endif
#ifndef HASHTABLE_H #define HASHTABLE_H #include "BST.h" #include "SerialBST.h" class HashTable { public: HashTable() { hash_table = new Dump_BST[27]; serialList=make_shared<Serial_BST>(); }; //default constructor will read data from input file "client_address_data.txt". HashTable(const HashTable &);//Copy Constructor ~HashTable() { delete[]hash_table; }; shared_ptr<BST_NODE>& insert(const string & x, const string & y) { return hash_table[hash(x)].insert(x, y);}; void remove() {}; int inline hash(const string & x) { if (x[0] < 96) return 0; else return x[0] - 96; }; void Print_Hash_Table() { for (int x = 1; x < 27; x++) hash_table[x].print(); }; void inline Update(const string & x) { hash_table[hash(x.substr(2))].Update(x); }; void read_tool_text(const string & s); void Print_Serials() { serialList->print(); }; void Print_BST(const string & s) { hash_table[hash(s)].print(); };//Print a BST (cell in hash table) inorder to the screen void compare(shared_ptr<BST_NODE>&branch, vector<shared_ptr<BST_NODE>>&); void Print_Hash_Table_to_File(const string & filename) { for (int x = 0; x < 27; x++) hash_table[x].writeToFile(filename); }; //function will print hash table to output file void Print_Serial_list_to_File(const string & filename) { serialList->writeToFile(filename); }; void Print_Hash_Table_to_Excel(const string & filename); void Print_Comparison_List_to_Excel(const string & filename); void Print_serials_to_Excel(const string & filename); shared_ptr<BST_NODE>& search_by_device(const string & y) { return search_by_device(hash(y), y); }; void set_comparison_list(vector<shared_ptr<BST_NODE>>& x) { comparisionList = x; }; private: void compare(shared_ptr<BST_NODE>&, shared_ptr<Serial_NODE>&, vector<shared_ptr<BST_NODE>>&); void compare_branch(shared_ptr<BST_NODE>&, shared_ptr<Serial_NODE>&, vector<shared_ptr<BST_NODE>>&); shared_ptr<BST_NODE>& search_by_device(const int & x, const string & y) { return hash_table[x].search(y); }; Dump_BST *hash_table; shared_ptr<Serial_BST> serialList; vector<shared_ptr<BST_NODE>> comparisionList; }; #endif
#ifndef _INC_CSECTOR_H #define _INC_CSECTOR_H #pragma once #define SECTOR_TICK_PERIOD (TICK_PER_SEC / 4) // pulse length class CSector : public CScriptObj, public CSectorBase { // A square region of the world // Eg: map0.mul dungeon sectors are 256x256 tiles public: CSector(); ~CSector() { ASSERT(!HasClients()); } LPCTSTR GetName() const { return "Sector"; } static const char *m_sClassName; static const LPCTSTR sm_szVerbKeys[]; static const LPCTSTR sm_szLoadKeys[]; private: BYTE m_ListenItems; // items on the ground that can listen (eg: communication crystal) bool m_fSaveParity; // the sector has been saved relative to the char entering it? CSectorEnviron m_Env; // current environment BYTE m_RainChance; // rain chance (0% - 100%) BYTE m_ColdChance; // cold chance (0% - 100%) - will snow if also raining public: void Close(); void RespawnDeadNPCs(); void Restock(); void OnTick(int iPulseCount); bool v_AllChars(CScript &s, CTextConsole *pSrc); bool v_AllCharsIdle(CScript &s, CTextConsole *pSrc); bool v_AllClients(CScript &s, CTextConsole *pSrc); bool v_AllItems(CScript &s, CTextConsole *pSrc); virtual bool r_LoadVal(CScript &s); virtual bool r_WriteVal(LPCTSTR pszKey, CGString &sVal, CTextConsole *pSrc); virtual void r_Write(); virtual bool r_Verb(CScript &s, CTextConsole *pSrc); private: bool IsMoonVisible(unsigned int uPhase, int iLocalTime) const; void CheckSaveParity(CChar *pChar); public: // Time int GetLocalTime() const; LPCTSTR GetLocalGameTime() const; // Light BYTE GetLightCalc(bool fQuickSet) const; BYTE GetLight() const { return m_Env.m_Light & ~LIGHT_OVERRIDE; } void SetLight(int iLight); bool IsLightOverriden() const { return (m_Env.m_Light & LIGHT_OVERRIDE); } bool IsDark() const { return (GetLight() >= 12); } bool IsNight() const { int iMinutes = GetLocalTime(); return ((iMinutes < 7 * 60) || (iMinutes > (9 + 12) * 60)); } // Weather WEATHER_TYPE GetWeatherCalc() const; WEATHER_TYPE GetWeather() const { return m_Env.m_Weather; } void SetWeather(WEATHER_TYPE weather); void SetDefaultWeatherChance(); void SetWeatherChance(bool fRain, int iChance); BYTE GetRainChance() const { return m_RainChance & ~LIGHT_OVERRIDE; } bool IsRainOverriden() const { return (m_RainChance & LIGHT_OVERRIDE); } BYTE GetColdChance() const { return m_ColdChance & ~LIGHT_OVERRIDE; } bool IsColdOverriden() const { return (m_ColdChance & LIGHT_OVERRIDE); } // Season SEASON_TYPE GetSeason() const { return m_Env.m_Season; } void SetSeason(SEASON_TYPE season); // Items in the sector void MoveItemToSector(CItem *pItem, bool fActive); bool IsItemInSector(const CItem *pItem) const { if ( !pItem ) return false; return ((pItem->GetParent() == &m_Items_Inert) || (pItem->GetParent() == &m_Items_Timer)); } size_t GetItemComplexity() const { return m_Items_Timer.GetCount() + m_Items_Inert.GetCount(); } void AddListenItem() { ++m_ListenItems; } void RemoveListenItem() { --m_ListenItems; } bool HasListenItems() const { return m_ListenItems ? true : false; } void OnHearItem(CChar *pChar, TCHAR *pszText); // Chars in the sector bool MoveCharToSector(CChar *pChar); bool MoveDisconnectedCharToSector(CChar *pChar); bool IsSectorSleeping() const; void SetSectorWakeStatus(); // ships may enter a sector before it's riders size_t GetCharComplexity() const { return m_Chars_Active.GetCount(); } size_t GetInactiveChars() const { return m_Chars_Disconnect.GetCount(); } bool IsCharActiveIn(const CChar *pChar) const { // Check if char is active return (pChar->GetParent() == &m_Chars_Active); } bool IsCharDisconnectedIn(const CChar *pChar) const { // Check if char is inactive (disconnected) return (pChar->GetParent() == &m_Chars_Disconnect); } // Clients in the sector size_t HasClients() const { return m_Chars_Active.HasClients(); } CServTime GetLastClientTime() const { return m_Chars_Active.m_timeLastClient; } void ClientAttach(CChar *pChar) { if ( !IsCharActiveIn(pChar) ) return; m_Chars_Active.ClientAttach(); } void ClientDetach(CChar *pChar) { if ( !IsCharActiveIn(pChar) ) return; m_Chars_Active.ClientDetach(); } private: CSector(const CSector &copy); CSector &operator=(const CSector &other); }; #endif // _INC_CSECTOR_H
#import <React/RCTViewManager.h> @interface NVBarButtonManager : RCTViewManager @end
/** @file * * A brief file description * * @section license License * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef AVL_H_79330EDE_2226_4D51_AA58_5878FDFF1483 #define AVL_H_79330EDE_2226_4D51_AA58_5878FDFF1483 #include <spl/avl.h> #endif /* AVL_H_79330EDE_2226_4D51_AA58_5878FDFF1483 */
#ifndef _WIN32 #include <lw/types.h> #include <lw/base.h> #include <lwstr.h> #include <reg/lwreg.h> #include <net/if.h> #include <ifaddrs.h> #include <arpa/inet.h> #include <config.h> #include <vmdnssys.h> #include <vmdns.h> #include <vmdnstypes.h> #include <vmdnsdefines.h> #include <vmdnserrorcode.h> #include <vmdnsbuffer.h> #include <vmdnscommon.h> #include "structs.h" #include "prototypes.h" #else #pragma once #include "targetver.h" #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <windows.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <errno.h> #include <Sddl.h> #include <process.h> #include <pthread.h> #include "banned.h" #include <vmdns.h> #include <vmdnstypes.h> #include <vmdnsdefines.h> #include <vmdnserrorcode.h> #include <vmdnsbuffer.h> #include <vmdnscommon.h> #include "structs.h" #include "prototypes.h" #endif #include "extern.h" #include "dce/rpc.h"
/* * Copyright (C) 2010 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. */ #ifndef JNI_CONSTANTS_H_included #define JNI_CONSTANTS_H_included #include "JNIHelp.h" /** * A cache to avoid calling FindClass at runtime. * * Class lookup is relatively expensive, so we do these lookups at startup. This means that code * that never uses, say, java.util.zip.Deflater still has to pay for the lookup, but it means that * on device the cost is paid during boot and amortized. A central cache also removes the temptation * to dynamically call FindClass rather than add a small cache to each file that needs one. Another * cost is that each class cached here requires a global reference, though in practice we save * enough by not having a global reference for each file that uses a class such as java.lang.String * which is used in several files. * * FindClass is still called in a couple of situations: when throwing exceptions, and in some of * the serialization code. The former is clearly not a performance case, and we're currently * assuming that neither is the latter. * * TODO: similar arguments hold for field and method IDs; we should cache them centrally too. */ struct JniConstants { static void init(JNIEnv* env); static jclass bigDecimalClass; static jclass booleanClass; static jclass byteArrayClass; static jclass byteClass; static jclass calendarClass; static jclass characterClass; static jclass charsetICUClass; static jclass constructorClass; static jclass deflaterClass; static jclass doubleClass; static jclass errnoExceptionClass; static jclass fieldClass; static jclass fileDescriptorClass; static jclass floatClass; static jclass gaiExceptionClass; static jclass inet6AddressClass; static jclass inetAddressClass; static jclass inetAddressHolderClass; static jclass inetSocketAddressClass; static jclass inetSocketAddressHolderClass; static jclass inflaterClass; static jclass inputStreamClass; static jclass integerClass; static jclass localeDataClass; static jclass longClass; static jclass methodClass; static jclass mutableIntClass; static jclass mutableLongClass; static jclass netlinkSocketAddressClass; static jclass objectClass; static jclass objectArrayClass; static jclass outputStreamClass; static jclass packetSocketAddressClass; static jclass parsePositionClass; static jclass patternSyntaxExceptionClass; static jclass referenceClass; static jclass shortClass; static jclass socketClass; static jclass socketImplClass; static jclass socketTaggerClass; static jclass stringClass; static jclass structAddrinfoClass; static jclass structFlockClass; static jclass structGroupReqClass; static jclass structGroupSourceReqClass; static jclass structLingerClass; static jclass structPasswdClass; static jclass structPollfdClass; static jclass structStatClass; static jclass structStatVfsClass; static jclass structTimevalClass; static jclass structUcredClass; static jclass structUtsnameClass; static jclass unixSocketAddressClass; static jclass zipEntryClass; }; #define NATIVE_METHOD(className, functionName, signature) \ { #functionName, signature, reinterpret_cast<void*>(className ## _ ## functionName) } #endif // JNI_CONSTANTS_H_included
#ifndef STROMX_CVIMGPROC_CONVEXHULL_H #define STROMX_CVIMGPROC_CONVEXHULL_H #include "stromx/cvimgproc/Config.h" #include <stromx/cvsupport/Matrix.h> #include <stromx/runtime/Enum.h> #include <stromx/runtime/EnumParameter.h> #include <stromx/runtime/List.h> #include <stromx/runtime/MatrixParameter.h> #include <stromx/runtime/NumericParameter.h> #include <stromx/runtime/OperatorException.h> #include <stromx/runtime/OperatorKernel.h> #include <stromx/runtime/Primitive.h> #include <stromx/runtime/Variant.h> #include <stromx/runtime/Visualization.h> namespace stromx { namespace cvimgproc { class STROMX_CVIMGPROC_API ConvexHull : public runtime::OperatorKernel { public: enum DataFlowId { ALLOCATE }; enum DataId { INPUT_CURVE, OUTPUT_OUT_CURVE, PARAMETER_CLOCKWISE, PARAMETER_DATA_FLOW }; ConvexHull(); virtual OperatorKernel* clone() const { return new ConvexHull; } virtual void setParameter(const unsigned int id, const runtime::Data& value); virtual const runtime::DataRef getParameter(const unsigned int id) const; void initialize(); virtual void execute(runtime::DataProvider& provider); private: static const std::string PACKAGE; static const runtime::Version VERSION; static const std::string TYPE; const std::vector<const runtime::Parameter*> setupInitParameters(); const std::vector<const runtime::Parameter*> setupParameters(); const std::vector<const runtime::Input*> setupInputs(); const std::vector<const runtime::Output*> setupOutputs(); runtime::Bool m_clockwise; runtime::Enum m_dataFlow; runtime::Parameter* m_clockwiseParameter; runtime::Input* m_curveDescription; runtime::Input* m_outCurveDescription; runtime::EnumParameter* m_dataFlowParameter; }; } // cvimgproc } // stromx #endif // STROMX_CVIMGPROC_CONVEXHULL_H
#ifndef PHP_TEST_AVRO_H #define PHP_TEST_AVRO_H extern zend_module_entry test_avro_module_entry; #define phpext_test_avro_ptr &test_avro_module_entry #ifdef PHP_WIN32 # define PHP_TEST_AVRO_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_TEST_AVRO_API __attribute__ ((visibility("default"))) #else # define PHP_TEST_AVRO_API #endif #ifdef ZTS #include "TSRM.h" #endif #define TS_S_L(s) s,strlen(s)+1 #define EX_ARRAY_DESTROY(arr) arr=NULL;efree(arr); PHP_MINIT_FUNCTION(test_avro); PHP_MSHUTDOWN_FUNCTION(test_avro); PHP_RINIT_FUNCTION(test_avro); PHP_RSHUTDOWN_FUNCTION(test_avro); PHP_MINFO_FUNCTION(test_avro); PHP_FUNCTION(confirm_test_avro_compiled); /* For test_avroing, remove later. */ PHP_FUNCTION(hello_avro); PHP_FUNCTION(self_concat); /* Declare any global variables you may need between the BEGIN and END macros here: */ ZEND_BEGIN_MODULE_GLOBALS(test_avro) long test_avro_long; char *test_avro_char; HashTable test_avro_zval; HashTable classMethodWhite; long global_value; char *global_string; ZEND_END_MODULE_GLOBALS(test_avro) extern ZEND_DECLARE_MODULE_GLOBALS(test_avro); /* In every utility function you add that needs to use variables in php_test_avro_globals, call TSRMLS_FETCH(); after declaring other variables used by that function, or better yet, pass in TSRMLS_CC after the last function argument and declare your utility function with TSRMLS_DC after the last declared argument. Always refer to the globals in your function as TEST_AVRO_G(variable). You are encouraged to rename these macros something shorter, see examples in any other php module directory. */ #ifdef ZTS #define TEST_AVRO_G(v) TSRMG(test_avro_globals_id, zend_test_avro_globals *, v) #else #define TEST_AVRO_G(v) (test_avro_globals.v) #endif #endif /* PHP_TEST_AVRO_H */
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Volumes/Personal/Documents/raspi-config/client-framework/build/j2oSources/javax/annotation/ParametersAreNullableByDefault.java // #include "J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_JavaxAnnotationParametersAreNullableByDefault") #ifdef RESTRICT_JavaxAnnotationParametersAreNullableByDefault #define INCLUDE_ALL_JavaxAnnotationParametersAreNullableByDefault 0 #else #define INCLUDE_ALL_JavaxAnnotationParametersAreNullableByDefault 1 #endif #undef RESTRICT_JavaxAnnotationParametersAreNullableByDefault #if !defined (JavaxAnnotationParametersAreNullableByDefault_) && (INCLUDE_ALL_JavaxAnnotationParametersAreNullableByDefault || defined(INCLUDE_JavaxAnnotationParametersAreNullableByDefault)) #define JavaxAnnotationParametersAreNullableByDefault_ #define RESTRICT_JavaLangAnnotationAnnotation 1 #define INCLUDE_JavaLangAnnotationAnnotation 1 #include "java/lang/annotation/Annotation.h" @class IOSClass; @protocol JavaxAnnotationParametersAreNullableByDefault < JavaLangAnnotationAnnotation > @end @interface JavaxAnnotationParametersAreNullableByDefault : NSObject < JavaxAnnotationParametersAreNullableByDefault > @end J2OBJC_EMPTY_STATIC_INIT(JavaxAnnotationParametersAreNullableByDefault) FOUNDATION_EXPORT id<JavaxAnnotationParametersAreNullableByDefault> create_JavaxAnnotationParametersAreNullableByDefault(); J2OBJC_TYPE_LITERAL_HEADER(JavaxAnnotationParametersAreNullableByDefault) #endif #pragma pop_macro("INCLUDE_ALL_JavaxAnnotationParametersAreNullableByDefault")
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once class SGraphNodeK2CreateDelegate : public SGraphNodeK2Base { public: SLATE_BEGIN_ARGS(SGraphNodeK2CreateDelegate){} SLATE_END_ARGS() struct FFunctionItemData { FName Name; FString Description; }; TArray<TSharedPtr<FFunctionItemData>> FunctionDataItems; TWeakPtr<SComboButton> SelectFunctionWidget; public: static FString FunctionDescription(const UFunction* Function); virtual ~SGraphNodeK2CreateDelegate(); void Construct(const FArguments& InArgs, UK2Node* InNode); virtual void CreateBelowWidgetControls(TSharedPtr<SVerticalBox> MainBox) override; protected: FText GetCurrentFunctionDescription() const; TSharedRef<ITableRow> HandleGenerateRowFunction(TSharedPtr<FFunctionItemData> FunctionItemData, const TSharedRef<STableViewBase>& OwnerTable); void OnFunctionSelected(TSharedPtr<FFunctionItemData> FunctionItemData, ESelectInfo::Type SelectInfo); };
/* * Copyright 2014 Facebook, 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 FOLLY_SMALLLOCKS_H_ #define FOLLY_SMALLLOCKS_H_ /* * This header defines a few very small mutex types. These are useful * in highly memory-constrained environments where contention is * unlikely. * * Note: these locks are for use when you aren't likely to contend on * the critical section, or when the critical section is incredibly * small. Given that, both of the locks defined in this header are * inherently unfair: that is, the longer a thread is waiting, the * longer it waits between attempts to acquire, so newer waiters are * more likely to get the mutex. For the intended use-case this is * fine. * * @author Keith Adams <kma@fb.com> * @author Jordan DeLong <delong.j@fb.com> */ #include <array> #include <cinttypes> #include <type_traits> #include <ctime> #include <cstdlib> #include <pthread.h> #include <mutex> //#include <asm/sync_bitops.h> #if !__x86_64__ # error "SmallLocks.h is currently x64-only." #endif ////////////////////////////////////////////////////////////////////// /* * A helper object for the condended case. Starts off with eager * spinning, and falls back to sleeping for small quantums. */ class Sleeper { static const uint32_t kMaxActiveSpin = 4000; uint32_t spinCount; public: Sleeper() : spinCount(0) {} void wait(); }; ////////////////////////////////////////////////////////////////////// /* * A really, *really* small spinlock for fine-grained locking of lots * of teeny-tiny data. * * Zero initializing these is guaranteed to be as good as calling * init(), since the free state is guaranteed to be all-bits zero. * * This class should be kept a POD, so we can used it in other packed * structs (gcc does not allow __attribute__((packed)) on structs that * contain non-POD data). This means avoid adding a constructor, or * making some members private, etc. */ struct MicroSpinLock { enum { FREE = 0, LOCKED = 1 }; uint8_t lock_; MicroSpinLock(); /* * Atomically move lock_ from "compare" to "newval". Return boolean * success. Do not play on or around. */ bool cas(uint8_t compare, uint8_t newVal); bool try_lock(); void lock(); void unlock(); };// __attribute__ ((packed)); ////////////////////////////////////////////////////////////////////// /* * Spin lock on a single bit in an integral type. You can use this * with 16, 32, or 64-bit integral types. * * This is useful if you want a small lock and already have an int * with a bit in it that you aren't using. But note that it can't be * as small as MicroSpinLock (1 byte), if you don't already have a * convenient int with an unused bit lying around to put it on. * * To construct these, either use init() or zero initialize. We don't * have a real constructor because we want this to be a POD type so we * can put it into packed structs. */ struct PicoSpinLock { // Internally we deal with the unsigned version of the type. //typedef typename std::make_unsigned<IntType>::type UIntType; typedef uint16_t UIntType; /*static_assert(std::is_integral<IntType>::value, "PicoSpinLock needs an integral type"); static_assert(sizeof(UIntType) == 2 || sizeof(UIntType) == 4 || sizeof(UIntType) == 8, "PicoSpinLock can't work on integers smaller than 2 bytes"); */ public: //static const UIntType kLockBitMask_ = UIntType(1) << Bit; UIntType* lock_; unsigned char len; /* * You must call this function before using this class, if you * default constructed it. If you zero-initialized it you can * assume the PicoSpinLock is in a valid unlocked state with * getData() == 0. * * (This doesn't use a constructor because we want to be a POD.) */ bool init(int bits = 16); void clear(); /* * Try to get the lock without blocking: returns whether or not we * got it. */ //template<int N> bool try_lock(UIntType N) const; /* * Block until we can acquire the lock. Uses Sleeper to wait. */ // template <int N> void lock(UIntType N) const; /* * Release the lock, without changing the value of the rest of the * integer. */ // template<int N> void unlock(UIntType N) const; }; ////////////////////////////////////////////////////////////////////// #endif
unsigned f(unsigned i) { return 3 * i; }
#ifndef __MONO_NATIVE_MSCORLIB_SYSTEM_PLATFORMID_H #define __MONO_NATIVE_MSCORLIB_SYSTEM_PLATFORMID_H namespace mscorlib { namespace System { class PlatformID { public: enum __ENUM__ { Win32S = 0, Win32Windows = 1, Win32NT = 2, WinCE = 3, Unix = 4, Xbox = 5, MacOSX = 6, }; }; } } #endif
// OgdcElemFactory.h: interface for the OgdcElemFactory class. // ////////////////////////////////////////////////////////////////////// // ____ ____ ____ ____ // Project / _ \ / ___) | _ \ / ___) // | | | | | | __ | | \ | | | // | |_| | | |_\ | | |_/ | | \___ // \____/ \____| |____/ \ ___) // //! \file OgdcElemFactory.h //! \brief ¼¸ºÎ¶ÔÏ󹤳§ //! \attention //! Copyright(c) 2007-2012 SuperMap Software Co., Ltd. <br> //! All Rights Reserved. //! \version 1.0(2012) ////////////////////////////////////////////////////////////////////////// #if !defined(AFX_OGDCELEMFACTORY_H__244F3B3F_FFBD_4586_B5E1_ABCF70E26CA6__INCLUDED_) #define AFX_OGDCELEMFACTORY_H__244F3B3F_FFBD_4586_B5E1_ABCF70E26CA6__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "OgdcElement.h" namespace OGDC { //! \brief »Øµ÷º¯Êý£¬ÓÃÓÚÀ©Õ¹¶ÔÏó»æÖÆ //! \param pElement ÍⲿҪ´´½¨µÄÀ©Õ¹¶ÔÏó //! \param nType À©Õ¹¶ÔÏóµÄÀàÐÍ //! \param pVoid ʵÏָûص÷º¯Êý¶ÔÏóµÄÖ¸Õë typedef void (OGDCSTDCALL *CREATEELEMENTEXTENDCALLBACKPROC) (OgdcElement** pElement, OgdcInt nType, void* pVoid); //! \brief ¼¸ºÎ¶ÔÏ󹤳§Àà class ELEMENT_API OgdcElemFactory { public: //! \brief ¼¸ºÎ¶ÔÏ󹤳§ÀàĬÈϹ¹Ô캯Êý OgdcElemFactory(); //! \brief ¼¸ºÎ¶ÔÏ󹤳§ÀàĬÈÏÎö¹¹º¯Êý virtual ~OgdcElemFactory(); public: //! \brief ´´½¨Ö¸¶¨ÀàÐ͵ļ¸ºÎ¶ÔÏó¡£ //! \param nType ¼¸ºÎ¶ÔÏóÀàÐÍ¡£ static OgdcElement* CreateElement(OgdcInt nType); //! \brief ¿Ë¡һ¸ö¼¸ºÎ¶ÔÏó¡£ //! \param pElement Òª±»¿Ë¡µÄ¼¸ºÎ¶ÔÏóÖ¸Õë, ²»ÄÜΪNULL¡£ static OgdcElement* CloneElement(const OgdcElement* pElement); //! \brief ¿½±´Ò»¸ö¼¸ºÎ¶ÔÏó¡£ //! \param pElement Ô­¼¸ºÎ¶ÔÏóÖ¸Õë, ²»ÄÜΪNULL¡£[in] //! \param pResElement Ä¿±ê¼¸ºÎ¶ÔÏóÖ¸Õë, ²»ÄÜΪNULL¡£[out] static OgdcBool CopyElement(const OgdcElement* pElement, OgdcElement* pResElement); }; } #endif // !defined(AFX_OGDCELEMFACTORY_H__244F3B3F_FFBD_4586_B5E1_ABCF70E26CA6__INCLUDED_)
/****************************************************** * File: TreeRoot.h * Author: Vasily I.Gurianov * Create date: 2017-11-21 * Testing: CodeGear C++Builder 2007 * * Ñlassical mechanics * * Using: * TreeRoot *pWorld = new TreeRoot; int iTime = 0; * ObserverX *eProbe = pWorld->headOfList->something->eProbe; * * pWorld->Run(); * Memo1->Lines->Add(IntToStr(eProbe->iTime)+","+IntToStr(eProbe->x)+","+ * IntToStr(eProbe->x2)+","+IntToStr(eProbe->v)+","+eProbe->kinetic_energy+ * ","+eProbe->potential_energy); * iTime++; * * ***************************************************/ //--------------------------------------------------------------------------- #ifndef TreeRootH #define TreeRootH #include "Models.h" // ================ êîíòåêñò ========================== class TreeRoot: public Composite { // <<Ontology Context>> Concept = Âñåëåííàÿ Íüþòîíà // çàäàåò ãðàíè÷íûå è íà÷àëüíûå óñëîâèÿ private: //AbstractTreeNode *mechanical_system; // ñèñòåìà //void replace(ListItem *b, Component *p) {} virtual void absorb(Carrier *f) {} virtual Component *getA() {} virtual Component *getB() {} public: int observe; // <- íàáëþäåíèå TreeRoot(){ this->headOfList = new ListItem; this->headOfList->something = new Simple; // One particle //this->headOfList->something = new Spring; // Spring, one particle //this->headOfList->something = new SimpleCouple; //two particles }; void Prepare(int r,int k1,int k2,int r1,int r2,int r3) { //this->headOfList->something = new AbstractTreeNode; //this->headOfList->something->Prepare(r,k1,k2,r1,r2,r3); } void Run() { this->headOfList->something->Run(); } void actuate() {} void doImpact(Carrier *) {} //void move() {} Skip *getListOfSkip(){return 0;} }; //--------------------------------------------------------------------------- #endif
//#include "../include/sha.h" void lcg(void); double lcg_rand(int, double, double*, int); void quadRes1(void); void quadRes2(void); void cubicRes(void); void exclusiveOR(void); void modExp(void); void bbs(void); void micali_schnorr(void); void SHA1(void); /* The circular shifts. */ #define CS1(x) ((((ULONG)x)<<1)|(((ULONG)x)>>31)) #define CS5(x) ((((ULONG)x)<<5)|(((ULONG)x)>>27)) #define CS30(x) ((((ULONG)x)<<30)|(((ULONG)x)>>2)) /* K constants */ #define K0 0x5a827999L #define K1 0x6ed9eba1L #define K2 0x8f1bbcdcL #define K3 0xca62c1d6L #define f1(x,y,z) ( (x & (y ^ z)) ^ z ) #define f3(x,y,z) ( (x & ( y ^ z )) ^ (z & y) ) #define f2(x,y,z) ( x ^ y ^ z ) /* Rounds 20-39 */ #define expand(x) Wbuff[x%16] = CS1(Wbuff[(x - 3)%16 ] ^ Wbuff[(x - 8)%16 ] ^ Wbuff[(x - 14)%16] ^ Wbuff[x%16]) #define sub1Round1(count) { \ temp = CS5(A) + f1(B, C, D) + E + Wbuff[count] + K0; \ E = D; \ D = C; \ C = CS30( B ); \ B = A; \ A = temp; \ } \ #define sub2Round1(count) \ { \ expand(count); \ temp = CS5(A) + f1(B, C, D) + E + Wbuff[count%16] + K0; \ E = D; \ D = C; \ C = CS30( B ); \ B = A; \ A = temp; \ } \ #define Round2(count) \ { \ expand(count); \ temp = CS5( A ) + f2( B, C, D ) + E + Wbuff[count%16] + K1; \ E = D; \ D = C; \ C = CS30( B ); \ B = A; \ A = temp; \ } \ #define Round3(count) \ { \ expand(count); \ temp = CS5( A ) + f3( B, C, D ) + E + Wbuff[count%16] + K2; \ E = D; \ D = C; \ C = CS30( B ); \ B = A; \ A = temp; \ } #define Round4(count) \ { \ expand(count); \ temp = CS5( A ) + f2( B, C, D ) + E + Wbuff[count%16] + K3; \ E = D; \ D = C; \ C = CS30( B ); \ B = A; \ A = temp; \ }
#ifndef NGX_HTTP_REDIS2_HANDLER_H #define NGX_HTTP_REDIS2_HANDLER_H #include "ngx_http_redis2_module.h" ngx_int_t ngx_http_redis2_handler(ngx_http_request_t *r); #endif /* NGX_HTTP_REDIS2_HANDLER_H */
/* * Copyright (C) 2009-2011, Andreas Sandberg * Copyright (C) 2009-2011, David Eklov * 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. * * * 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 <stdlib.h> #include <string.h> #include "usf_priv.h" #include "usf_header.h" #include "usf_internal.h" #include "error.h" static const char usf_magic[] = "USF1"; static usf_io_methods_t io_methods[] = { #define _COMP(comp, init, fini, read, write) [comp] = {init, fini, read, write}, USF_COMP_LIST #undef _COMP }; static inline usf_error_t check_compression(usf_compression_t comp) { #define _COMP(comp, u1, u2, u3, u4) case comp: switch (comp) { USF_COMP_LIST return USF_ERROR_OK; default: return USF_ERROR_FILE; } #undef _COMP } usf_error_t read_magic(FILE *f) { char magic[sizeof(usf_magic)]; if (fread(magic, sizeof(magic), 1, f) != 1) return feof(f) ? USF_ERROR_FILE : USF_ERROR_SYS; return memcmp(magic, usf_magic, sizeof(usf_magic)) == 0 ? USF_ERROR_OK : USF_ERROR_FILE; } usf_error_t write_magic(FILE *f) { return fwrite(usf_magic, sizeof(usf_magic), 1, f) == 1 ? USF_ERROR_OK : USF_ERROR_SYS; } /* This function is not exported, i.e. it prototype is not in usf.h, it is * only meant to be called by usf2usf */ usf_error_t usf_open_hidden(usf_file_t **file, const char *path, usf_compression_t override) { usf_file_t *f = NULL; usf_error_t error; E_IF(!file, USF_ERROR_PARAM); f = malloc(sizeof(usf_file_t)); E_NULL(f, USF_ERROR_MEM); f->header = NULL; f->bzeof = 0; if (path) f->file = fopen(path, "r"); else f->file = stdin; E_NULL(f->file, USF_ERROR_SYS); memset(&f->last_access, 0, sizeof(f->last_access)); E_ERROR(read_magic(f->file)); E_ERROR(usf_header_read(&f->header, f->file)); if (override != (usf_compression_t)-1) f->header->compression = override; E_ERROR(check_compression(f->header->compression)); f->io_methods = &io_methods[f->header->compression]; E_ERROR(usf_internal_init(f, USF_MODE_READ)); *file = f; return USF_ERROR_OK; ret_err: if (f) { if (f->file) fclose(f->file); if (f->header) usf_header_free(f->header); free(f); } return error; } usf_error_t usf_open(usf_file_t **file, const char *path) { return usf_open_hidden(file, path, -1); } usf_error_t usf_create(usf_file_t **file, const char *path, const usf_header_t *header) { usf_file_t *f; usf_error_t error; E_IF(!file || !header, USF_ERROR_PARAM); /* Currently we require the native endian bit to be set. We could * support having the foreign bit set instead, but we won't do * that at the moment. Having both bits set will always constitue * an error. */ E_IF(!(header->flags & USF_FLAG_NATIVE_ENDIAN) || header->flags & USF_FLAG_FOREIGN_ENDIAN, USF_ERROR_PARAM); f = malloc(sizeof(usf_file_t)); E_NULL(f, USF_ERROR_MEM); f->header = NULL; if (path) f->file = fopen(path, "w"); else f->file = stdout; E_NULL(f->file, USF_ERROR_SYS); memset(&f->last_access, 0, sizeof(f->last_access)); E_ERROR(write_magic(f->file)); E_ERROR(usf_header_dup(&f->header, header)); E_ERROR(usf_header_write(f->file, f->header)); E_ERROR(check_compression(f->header->compression)); f->io_methods = &io_methods[f->header->compression]; E_ERROR(usf_internal_init(f, USF_MODE_WRITE)); *file = f; return USF_ERROR_OK; ret_err: if (f) { if (f->file) fclose(f->file); if (f->header) usf_header_free(f->header); free(f); } return error; } usf_error_t usf_close(usf_file_t *file) { if (!file || !file->file) return USF_ERROR_PARAM; usf_internal_fini(file); usf_header_free(file->header); fclose(file->file); free(file); return USF_ERROR_OK; } usf_error_t usf_header(const usf_header_t **header, usf_file_t *file) { if (!file) return USF_ERROR_PARAM; *header = file->header; return USF_ERROR_OK; } /* * Local Variables: * mode: c * c-basic-offset: 4 * indent-tabs-mode: nil * c-file-style: "k&r" * End: */
#ifndef _ASM_X86_PAGE_H_ #define _ASM_X86_PAGE_H_ /* * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <agordeev@redhat.com> * * This work is licensed under the terms of the GNU LGPL, version 2. */ #include <linux/const.h> #include <bitops.h> #define PAGE_SHIFT 12 #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #ifndef __ASSEMBLY__ #ifdef __x86_64__ #define LARGE_PAGE_SIZE (512 * PAGE_SIZE) #else #define LARGE_PAGE_SIZE (1024 * PAGE_SIZE) #endif #define PT_PRESENT_MASK (1ull << 0) #define PT_WRITABLE_MASK (1ull << 1) #define PT_USER_MASK (1ull << 2) #define PT_ACCESSED_MASK (1ull << 5) #define PT_DIRTY_MASK (1ull << 6) #define PT_PAGE_SIZE_MASK (1ull << 7) #define PT64_NX_MASK (1ull << 63) #define PT_ADDR_MASK GENMASK_ULL(51, 12) #define PT_AD_MASK (PT_ACCESSED_MASK | PT_DIRTY_MASK) #ifdef __x86_64__ #define PAGE_LEVEL 4 #define PGDIR_WIDTH 9 #define PGDIR_MASK 511 #else #define PAGE_LEVEL 2 #define PGDIR_WIDTH 10 #define PGDIR_MASK 1023 #endif #define PGDIR_BITS(lvl) (((lvl) - 1) * PGDIR_WIDTH + PAGE_SHIFT) #define PGDIR_OFFSET(va, lvl) (((va) >> PGDIR_BITS(lvl)) & PGDIR_MASK) #endif /* !__ASSEMBLY__ */ #endif
//----------------------------------- // Copyright Pierric Gimmig 2013-2017 //----------------------------------- #pragma once #include <memory.h> #include <string> #include "BaseTypes.h" #include "OrbitFunction.h" #include "SerializationMacros.h" class Pdb; //----------------------------------------------------------------------------- struct Module { Module(); std::string GetPrettyName(); bool IsDll() const; bool LoadDebugInfo(); bool ContainsAddress(uint64_t a_Address) { return m_AddressStart <= a_Address && m_AddressEnd > a_Address; } uint64_t ValidateAddress(uint64_t a_Address); void SetLoaded(bool a_Value); bool GetLoaded() { return m_Loaded; } std::string m_Name; std::string m_FullName; std::string m_PdbName; std::string m_Directory; std::string m_PrettyName; std::string m_AddressRange; std::string m_DebugSignature; HMODULE m_ModuleHandle = 0; uint64_t m_AddressStart = 0; uint64_t m_AddressEnd = 0; uint64_t m_EntryPoint = 0; bool m_FoundPdb = false; bool m_Selected = false; uint64_t m_PdbSize = 0; mutable std::shared_ptr<Pdb> m_Pdb; ORBIT_SERIALIZABLE; private: bool m_Loaded = false; friend class TestRemoteMessages; }; //----------------------------------------------------------------------------- struct ModuleDebugInfo { uint32_t m_Pid = 0; std::string m_Name; std::vector<Function> m_Functions; uint64_t load_bias; ORBIT_SERIALIZABLE; };
#ifndef CONV_H #define CONV_H #include <stdint.h> uint32_t to_oct_pdep(uint32_t x); uint64_t to_oct_sse2(uint32_t x); uint32_t to_oct_naive(uint32_t x); uint32_t to_oct_mul(uint32_t x); void prepare_single_lookup(); uint32_t to_oct_single_lookup(uint32_t x); void prepare_two_lookups(); uint32_t to_oct_two_lookups(uint16_t x); #endif
/* * Copyright (c) 2013 ASMlover. 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 ofconditions 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 materialsprovided 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 <zmq.h> #include <stdio.h> #include <string.h> int main(int argc, char* argv[]) { int count = 0; char buf[128]; void* ctx = zmq_ctx_new(); void* rep = zmq_socket(ctx, ZMQ_REP); zmq_connect(rep, "tcp://localhost:6666"); fprintf(stdout, "reply server init success ...\n"); while (1) { memset(buf, 0, sizeof(buf)); zmq_recv(rep, buf, sizeof(buf), 0); fprintf(stdout, "recevied request : %s\n", buf); sprintf(buf, "reply => %d", count++); zmq_send(rep, buf, strlen(buf), 0); } zmq_close(rep); zmq_ctx_destroy(ctx); return 0; }
#import <Foundation/Foundation.h> #import <ReactiveCocoa/ReactiveCocoa.h> @interface GYMAddWorkoutViewModel : NSObject @property(nonatomic, copy) NSString *workoutName; @property(nonatomic, strong) RACCommand *saveCommand; @end